]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.99pre9-1 2.3.99pre9-1
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:34:48 +0000 (15:34 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:34:48 +0000 (15:34 -0500)
500 files changed:
Documentation/DocBook/Makefile
Documentation/DocBook/kernel-api.tmpl
Documentation/pci.txt
Makefile
arch/i386/kernel/acpi.c
arch/i386/kernel/apic.c
arch/i386/kernel/i8259.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/irq.c
arch/i386/kernel/mpparse.c
arch/i386/kernel/pci-irq.c
arch/i386/kernel/setup.c
arch/i386/kernel/traps.c
arch/i386/mm/init.c
arch/mips/Makefile
arch/mips/arc/Makefile
arch/mips/arc/cmdline.c
arch/mips/arc/env.c
arch/mips/arc/file.c
arch/mips/arc/identify.c
arch/mips/arc/init.c
arch/mips/arc/memory.c
arch/mips/arc/misc.c
arch/mips/arc/salone.c
arch/mips/arc/time.c
arch/mips/arc/tree.c
arch/mips/baget/Makefile
arch/mips/baget/baget.c
arch/mips/baget/bagetIRQ.S
arch/mips/baget/balo.c
arch/mips/baget/irq.c
arch/mips/baget/print.c
arch/mips/baget/prom/Makefile
arch/mips/baget/time.c
arch/mips/baget/vacserial.c
arch/mips/boot/Makefile
arch/mips/config.in
arch/mips/ddb5074/Makefile
arch/mips/ddb5074/int-handler.S
arch/mips/ddb5074/irq.c
arch/mips/ddb5074/nile4.c
arch/mips/ddb5074/pci-dma.c [new file with mode: 0644]
arch/mips/ddb5074/pci.c
arch/mips/ddb5074/prom.c
arch/mips/ddb5074/setup.c
arch/mips/ddb5074/time.c
arch/mips/dec/irq.c
arch/mips/dec/prom/Makefile
arch/mips/dec/prom/init.c
arch/mips/dec/prom/memory.c
arch/mips/dec/reset.c
arch/mips/dec/rtc-dec.c
arch/mips/dec/serial.c
arch/mips/defconfig
arch/mips/defconfig-decstation
arch/mips/defconfig-ip22
arch/mips/jazz/Makefile
arch/mips/jazz/floppy-jazz.c
arch/mips/jazz/int-handler.S
arch/mips/jazz/kbd-jazz.c
arch/mips/jazz/reset.c
arch/mips/jazz/rtc-jazz.c
arch/mips/jazz/setup.c
arch/mips/kernel/Makefile
arch/mips/kernel/entry.S
arch/mips/kernel/fpe.c
arch/mips/kernel/gdb-low.S
arch/mips/kernel/gdb-stub.c
arch/mips/kernel/head.S
arch/mips/kernel/irix5sys.h
arch/mips/kernel/irixelf.c
arch/mips/kernel/irixinv.c
arch/mips/kernel/irixioctl.c
arch/mips/kernel/irixsig.c
arch/mips/kernel/irq.c
arch/mips/kernel/mips_ksyms.c
arch/mips/kernel/proc.c
arch/mips/kernel/process.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/r2300_fpu.S
arch/mips/kernel/r2300_switch.S
arch/mips/kernel/r4k_fpu.S
arch/mips/kernel/r4k_misc.S
arch/mips/kernel/r4k_switch.S
arch/mips/kernel/r6000_fpu.S
arch/mips/kernel/scall_o32.S
arch/mips/kernel/setup.c
arch/mips/kernel/signal.c
arch/mips/kernel/softfp.S
arch/mips/kernel/syscall.c
arch/mips/kernel/syscalls.h
arch/mips/kernel/sysirix.c
arch/mips/kernel/sysmips.c
arch/mips/kernel/traps.c
arch/mips/kernel/unaligned.c
arch/mips/lib/Makefile
arch/mips/lib/csum_partial.S
arch/mips/lib/csum_partial_copy.c
arch/mips/lib/floppy-no.c
arch/mips/lib/floppy-std.c
arch/mips/lib/ide-no.c
arch/mips/lib/ide-std.c
arch/mips/lib/kbd-no.c
arch/mips/lib/kbd-std.c
arch/mips/lib/memcpy.S
arch/mips/lib/memset.S
arch/mips/lib/r3k_dump_tlb.c
arch/mips/lib/rtc-no.c
arch/mips/lib/rtc-std.c
arch/mips/lib/strlen_user.S
arch/mips/lib/strncpy_user.S
arch/mips/lib/strnlen_user.S
arch/mips/lib/watch.S
arch/mips/mm/andes.c
arch/mips/mm/fault.c
arch/mips/mm/init.c
arch/mips/mm/loadmmu.c
arch/mips/mm/r2300.c
arch/mips/mm/r4xx0.c
arch/mips/sgi/kernel/Makefile
arch/mips/sgi/kernel/indyIRQ.S
arch/mips/sgi/kernel/indy_hpc.c
arch/mips/sgi/kernel/indy_int.c
arch/mips/sgi/kernel/indy_mc.c
arch/mips/sgi/kernel/indy_rtc.c
arch/mips/sgi/kernel/indy_sc.c
arch/mips/sgi/kernel/indy_timer.c
arch/mips/sgi/kernel/promcon.c
arch/mips/sgi/kernel/reset.c
arch/mips/sgi/kernel/setup.c
arch/mips/sgi/kernel/system.c
arch/mips/sgi/kernel/time.c
arch/mips/sni/Makefile
arch/mips/sni/dma.c
arch/mips/sni/int-handler.S
arch/mips/sni/io.c
arch/mips/sni/pci.c
arch/mips/sni/pcimt_scache.c
arch/mips/sni/setup.c
arch/mips/tools/Makefile
arch/mips/tools/offset.c
arch/mips64/Makefile
arch/mips64/arc/Makefile
arch/mips64/arc/cmdline.c
arch/mips64/arc/console.c
arch/mips64/arc/env.c
arch/mips64/arc/file.c
arch/mips64/arc/identify.c
arch/mips64/arc/misc.c
arch/mips64/arc/printf.c
arch/mips64/arc/salone.c
arch/mips64/arc/time.c
arch/mips64/arc/tree.c
arch/mips64/boot/Makefile
arch/mips64/config.in
arch/mips64/defconfig
arch/mips64/defconfig-ip22
arch/mips64/defconfig-ip27
arch/mips64/kernel/Makefile
arch/mips64/kernel/binfmt_elf32.c
arch/mips64/kernel/branch.c
arch/mips64/kernel/entry.S
arch/mips64/kernel/head.S
arch/mips64/kernel/ioctl32.c [new file with mode: 0644]
arch/mips64/kernel/linux32.c
arch/mips64/kernel/mips64_ksyms.c
arch/mips64/kernel/proc.c
arch/mips64/kernel/process.c
arch/mips64/kernel/ptrace.c
arch/mips64/kernel/r4k_cache.S
arch/mips64/kernel/r4k_fpu.S
arch/mips64/kernel/r4k_genex.S
arch/mips64/kernel/r4k_switch.S
arch/mips64/kernel/r4k_tlb_debug.c
arch/mips64/kernel/r4k_tlb_glue.S
arch/mips64/kernel/scall_64.S
arch/mips64/kernel/scall_o32.S
arch/mips64/kernel/setup.c
arch/mips64/kernel/signal.c
arch/mips64/kernel/signal32.c
arch/mips64/kernel/smp.c [new file with mode: 0644]
arch/mips64/kernel/softfp.S
arch/mips64/kernel/syscall.c
arch/mips64/kernel/traps.c
arch/mips64/kernel/unaligned.c
arch/mips64/lib/Makefile
arch/mips64/lib/csum_partial.S
arch/mips64/lib/csum_partial_copy.c
arch/mips64/lib/floppy-no.c
arch/mips64/lib/floppy-std.c
arch/mips64/lib/ide-no.c
arch/mips64/lib/ide-std.c
arch/mips64/lib/kbd-no.c
arch/mips64/lib/kbd-std.c
arch/mips64/lib/memcpy.S
arch/mips64/lib/memset.S
arch/mips64/lib/rtc-no.c
arch/mips64/lib/rtc-std.c
arch/mips64/lib/strlen_user.S
arch/mips64/lib/strncpy_user.S
arch/mips64/lib/strnlen_user.S
arch/mips64/lib/watch.S
arch/mips64/mm/Makefile
arch/mips64/mm/andes.c
arch/mips64/mm/extable.c
arch/mips64/mm/fault.c
arch/mips64/mm/init.c
arch/mips64/mm/loadmmu.c
arch/mips64/mm/r4xx0.c
arch/mips64/mm/umap.c
arch/mips64/sgi-ip22/Makefile
arch/mips64/sgi-ip22/ip22-berr.c
arch/mips64/sgi-ip22/ip22-hpc.c
arch/mips64/sgi-ip22/ip22-int.c
arch/mips64/sgi-ip22/ip22-irq.S
arch/mips64/sgi-ip22/ip22-mc.c
arch/mips64/sgi-ip22/ip22-reset.c
arch/mips64/sgi-ip22/ip22-rtc.c
arch/mips64/sgi-ip22/ip22-sc.c
arch/mips64/sgi-ip22/ip22-setup.c
arch/mips64/sgi-ip22/ip22-timer.c
arch/mips64/sgi-ip22/system.c
arch/mips64/sgi-ip22/time.c
arch/mips64/sgi-ip27/Makefile
arch/mips64/sgi-ip27/TODO
arch/mips64/sgi-ip27/ip27-berr.c
arch/mips64/sgi-ip27/ip27-init.c
arch/mips64/sgi-ip27/ip27-irq-glue.S
arch/mips64/sgi-ip27/ip27-irq.c
arch/mips64/sgi-ip27/ip27-klconfig.c
arch/mips64/sgi-ip27/ip27-memory.c
arch/mips64/sgi-ip27/ip27-nmi.c [new file with mode: 0644]
arch/mips64/sgi-ip27/ip27-pci-dma.c
arch/mips64/sgi-ip27/ip27-pci.c
arch/mips64/sgi-ip27/ip27-reset.c
arch/mips64/sgi-ip27/ip27-setup.c
arch/mips64/sgi-ip27/ip27-timer.c
arch/mips64/tools/Makefile
arch/mips64/tools/offset.c
drivers/atm/eni.c
drivers/block/DAC960.c
drivers/block/DAC960.h
drivers/char/epca.c
drivers/net/3c59x.c
drivers/net/8139too.c
drivers/net/Config.in
drivers/net/arcnet/arc-rimi.c
drivers/net/arcnet/com20020-isa.c
drivers/net/arcnet/com20020-pci.c
drivers/net/arcnet/com90io.c
drivers/net/arcnet/com90xx.c
drivers/net/bagetlance.c
drivers/net/declance.c
drivers/net/eepro100.c
drivers/net/epic100.c
drivers/net/ioc3-eth.c
drivers/net/ne2k-pci.c
drivers/net/pcnet32.c
drivers/net/sgiseeq.c
drivers/net/sgiseeq.h
drivers/net/sis900.c
drivers/net/starfire.c
drivers/net/tulip/tulip_core.c
drivers/net/via-rhine.c
drivers/net/wan/lmc/lmc_main.c
drivers/net/yellowfin.c
drivers/parport/parport_pc.c
drivers/sound/emu10k1/main.c
drivers/sound/es1370.c
drivers/sound/es1371.c
drivers/sound/esssolo1.c
drivers/sound/i810_audio.c
drivers/sound/sb_card.c
drivers/sound/sonicvibes.c
drivers/sound/trident.c
drivers/sound/via82cxxx_audio.c
drivers/tc/tc.c
drivers/tc/tcsyms.c
drivers/tc/zs.c
drivers/tc/zs.h
drivers/video/newport_con.c
drivers/video/riva/fbdev.c
fs/devfs/base.c
fs/devfs/util.c
include/asm-i386/apicdef.h
include/asm-i386/hw_irq.h
include/asm-mips/arc/types.h [new file with mode: 0644]
include/asm-mips/asmmacro.h
include/asm-mips/atomic.h
include/asm-mips/baget/baget.h
include/asm-mips/baget/vac.h
include/asm-mips/baget/vic.h
include/asm-mips/bcache.h
include/asm-mips/bitops.h
include/asm-mips/bootinfo.h
include/asm-mips/branch.h
include/asm-mips/bugs.h
include/asm-mips/byteorder.h
include/asm-mips/cache.h
include/asm-mips/checksum.h
include/asm-mips/cpu.h
include/asm-mips/current.h
include/asm-mips/ddb5074.h
include/asm-mips/delay.h
include/asm-mips/div64.h
include/asm-mips/dma.h
include/asm-mips/ds1286.h
include/asm-mips/elf.h
include/asm-mips/fcntl.h
include/asm-mips/floppy.h
include/asm-mips/fp.h
include/asm-mips/gdb-stub.h
include/asm-mips/gfx.h
include/asm-mips/hardirq.h
include/asm-mips/hdreg.h
include/asm-mips/highmem.h
include/asm-mips/hw_irq.h [new file with mode: 0644]
include/asm-mips/ide.h
include/asm-mips/inventory.h
include/asm-mips/ioctls.h
include/asm-mips/irq.h
include/asm-mips/isadep.h
include/asm-mips/jazz.h
include/asm-mips/jazzdma.h
include/asm-mips/linux_logo.h
include/asm-mips/mc146818rtc.h
include/asm-mips/mipsregs.h
include/asm-mips/mman.h
include/asm-mips/mmu_context.h
include/asm-mips/namei.h
include/asm-mips/ng1.h
include/asm-mips/ng1hw.h
include/asm-mips/nile4.h
include/asm-mips/offset.h
include/asm-mips/paccess.h [new file with mode: 0644]
include/asm-mips/parport.h
include/asm-mips/pci.h
include/asm-mips/pgalloc.h
include/asm-mips/pgtable.h
include/asm-mips/posix_types.h
include/asm-mips/prctl.h
include/asm-mips/processor.h
include/asm-mips/ptrace.h
include/asm-mips/r4kcache.h
include/asm-mips/resource.h
include/asm-mips/semaphore-helper.h
include/asm-mips/semaphore.h
include/asm-mips/serial.h
include/asm-mips/sgi/sgi.h
include/asm-mips/sgi/sgihpc.h
include/asm-mips/sgi/sgimc.h
include/asm-mips/sgi/sgint23.h
include/asm-mips/sgialib.h
include/asm-mips/sgiarcs.h
include/asm-mips/shmparam.h
include/asm-mips/sigcontext.h
include/asm-mips/siginfo.h
include/asm-mips/signal.h
include/asm-mips/sni.h
include/asm-mips/socket.h
include/asm-mips/softirq.h
include/asm-mips/spinlock.h
include/asm-mips/stackframe.h
include/asm-mips/string.h
include/asm-mips/system.h
include/asm-mips/termios.h
include/asm-mips/timex.h
include/asm-mips/types.h
include/asm-mips/uaccess.h
include/asm-mips/ucontext.h
include/asm-mips/unaligned.h
include/asm-mips/unistd.h
include/asm-mips/watch.h
include/asm-mips/wbflush.h
include/asm-mips64/a.out.h
include/asm-mips64/addrspace.h
include/asm-mips64/arc/hinv.h
include/asm-mips64/asm.h
include/asm-mips64/asmmacro.h
include/asm-mips64/atomic.h
include/asm-mips64/bcache.h
include/asm-mips64/bitops.h
include/asm-mips64/bootinfo.h
include/asm-mips64/branch.h
include/asm-mips64/bugs.h
include/asm-mips64/byteorder.h
include/asm-mips64/cache.h
include/asm-mips64/checksum.h
include/asm-mips64/cpu.h
include/asm-mips64/current.h
include/asm-mips64/delay.h
include/asm-mips64/div64.h
include/asm-mips64/dma.h
include/asm-mips64/ds1286.h
include/asm-mips64/elf.h
include/asm-mips64/errno.h
include/asm-mips64/fcntl.h
include/asm-mips64/floppy.h
include/asm-mips64/gfx.h
include/asm-mips64/hardirq.h
include/asm-mips64/hdreg.h
include/asm-mips64/highmem.h
include/asm-mips64/hw_irq.h [new file with mode: 0644]
include/asm-mips64/ide.h
include/asm-mips64/init.h
include/asm-mips64/inst.h
include/asm-mips64/io.h
include/asm-mips64/ioc3.h
include/asm-mips64/ioctl.h
include/asm-mips64/ioctls.h
include/asm-mips64/irq.h
include/asm-mips64/linux_logo.h
include/asm-mips64/mc146818rtc.h
include/asm-mips64/mipsregs.h
include/asm-mips64/mman.h
include/asm-mips64/mmu_context.h
include/asm-mips64/mmzone.h
include/asm-mips64/namei.h
include/asm-mips64/ng1.h
include/asm-mips64/offset.h
include/asm-mips64/paccess.h
include/asm-mips64/param.h
include/asm-mips64/parport.h
include/asm-mips64/pci/bridge.h
include/asm-mips64/pgalloc.h
include/asm-mips64/pgtable.h
include/asm-mips64/poll.h
include/asm-mips64/posix_types.h
include/asm-mips64/processor.h
include/asm-mips64/ptrace.h
include/asm-mips64/r10kcache.h
include/asm-mips64/r10kcacheops.h
include/asm-mips64/r4kcache.h
include/asm-mips64/r4kcacheops.h
include/asm-mips64/regdef.h
include/asm-mips64/resource.h
include/asm-mips64/semaphore-helper.h
include/asm-mips64/semaphore.h
include/asm-mips64/serial.h
include/asm-mips64/sgi/io.h
include/asm-mips64/sgi/sgi.h
include/asm-mips64/sgi/sgihpc.h
include/asm-mips64/sgi/sgimc.h
include/asm-mips64/sgi/sgint23.h
include/asm-mips64/sgialib.h
include/asm-mips64/sgiarcs.h
include/asm-mips64/sgidefs.h
include/asm-mips64/shmiq.h
include/asm-mips64/shmparam.h
include/asm-mips64/sigcontext.h
include/asm-mips64/siginfo.h
include/asm-mips64/signal.h
include/asm-mips64/smp.h [new file with mode: 0644]
include/asm-mips64/smplock.h [new file with mode: 0644]
include/asm-mips64/sn/addrs.h
include/asm-mips64/sn/agent.h
include/asm-mips64/sn/arch.h
include/asm-mips64/sn/gda.h
include/asm-mips64/sn/intr.h [new file with mode: 0644]
include/asm-mips64/sn/intr_public.h [new file with mode: 0644]
include/asm-mips64/sn/io.h
include/asm-mips64/sn/klconfig.h
include/asm-mips64/sn/kldir.h
include/asm-mips64/sn/launch.h [new file with mode: 0644]
include/asm-mips64/sn/nmi.h [new file with mode: 0644]
include/asm-mips64/sn/sn0/addrs.h
include/asm-mips64/sn/sn0/arch.h
include/asm-mips64/sn/sn0/hub.h
include/asm-mips64/sn/sn0/hubio.h
include/asm-mips64/sn/sn0/hubni.h
include/asm-mips64/sn/sn0/hubpi.h
include/asm-mips64/sn/sn0/ip27.h
include/asm-mips64/sn/sn0/sn0_fru.h
include/asm-mips64/sn/sn_private.h [new file with mode: 0644]
include/asm-mips64/sn/types.h
include/asm-mips64/socket.h
include/asm-mips64/sockios.h
include/asm-mips64/softirq.h
include/asm-mips64/spinlock.h
include/asm-mips64/stackframe.h
include/asm-mips64/stat.h
include/asm-mips64/statfs.h
include/asm-mips64/string.h
include/asm-mips64/sysmips.h
include/asm-mips64/system.h
include/asm-mips64/termbits.h
include/asm-mips64/termios.h
include/asm-mips64/timex.h
include/asm-mips64/types.h
include/asm-mips64/uaccess.h
include/asm-mips64/ucontext.h
include/asm-mips64/unaligned.h
include/asm-mips64/unistd.h
include/asm-mips64/user.h
include/asm-mips64/usioctl.h
include/asm-mips64/watch.h
include/asm-mips64/xtalk/xtalk.h
include/asm-mips64/xtalk/xwidget.h
kernel/fork.c
mm/vmscan.c

index 2079bae183d8badf019fe9b8f16cae2e497999ab..d785534f6178a6d706ddfadc7d2c3c1151635e09 100644 (file)
@@ -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 \
index 3f886e702ec3ba5e93366dea6bfecd596c5eda96..688cdf351cd0e9fa93c9bfb58444e88aaff6eb70 100644 (file)
      </sect1>
   </chapter>
 
+  <chapter id="devfs">
+     <title>The Device File System</title>
+!Efs/devfs/base.c
+  </chapter>
+
   <chapter id="pmfuncs">
      <title>Power Management</title>
 !Ekernel/pm.c
index 63e035a9390cdd095e7b8c03cbd638bf407afe22..b676d2b32c9645b842ec29fef5b60841a611dbab 100644 (file)
@@ -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)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 36601cd87604cc6bc3b31b9490e9249a21da8b53..7398c689849560bbeec9ef3d08d8f8533c772099 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 3
 SUBLEVEL = 99
-EXTRAVERSION = -pre8
+EXTRAVERSION = -pre9
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
index d9dabac2f417f3f3c89d33817476ee276b410db5..9d21c617e17e9f5852b4f7c4564e5ff51d4493b1 100644 (file)
@@ -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,
index bf3d3c0af6ce37dfac9b67bf0ec4a59826e13294..eab365e260e10787089937483454fba11e5eaf59 100644 (file)
@@ -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;
index 334a75f88aca61f4ad07c4679ca43ba3d3b74411..e88fa90229b4b799f786d18059ef114aee3d87c1 100644 (file)
@@ -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
index dfee6e4d55f9411abd2d7319c38ccfbea941864e..7bf275c14b80c83a1bad0f70094546be821b3909 100644 (file)
@@ -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);
 }
 
index 79155a3262b49f0976c4586b9045ee91a3cffb5d..fb0fe277c51353aa3fc9b98fd9c736000bec1886 100644 (file)
@@ -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);
-       }
 }
 
index 5df83a10a2fa424d17814c5f10561a92e261d365..9455d2e3a79d0493e88951c006d225421024e75e 100644 (file)
@@ -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;
 }
 
 /*
index d678801b69e9b3b8544c73b813ab59c31ac82f05..cd16c78a5ffa4ddc67b38d2bb73ec04458e08619 100644 (file)
@@ -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
index e3e043b2372c20c6c2198e3e0edeff1a3556735e..7a9561719520aba15a622c1a49aac0a53df2b31c 100644 (file)
@@ -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)
index e25f50cfd20c2c9e3658604ab6343474c7daf79d..7fb5ebc6114055405d413a3e4828c4cd2b785937 100644 (file)
@@ -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));
 
index c801285eb18020125fd3f44b065713724a928215..af72d158103a548e07bc344d927c250bbbe7321d 100644 (file)
@@ -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);
                        }
index 53d7d0358633f28d4efc9339e672215be360bc27..baccc3980f750d153c9b9b11ed386c14f6e4cb31 100644 (file)
@@ -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:
 
index 12f71ab8d18022f0b3a540c864741cd64dae32ce..7bfefcfbae1a5d18c6781ffd558f6f470789096b 100644 (file)
@@ -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.
index d089b5409a32c3b30847c737a2f9a59150a4f5a1..d60ff2bab8771d3b72be60991d1902e7b05e907f 100644 (file)
@@ -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 <linux/init.h>
 #include <linux/kernel.h>
index 051db843f2af7e6e357a84b72001306db16a016d..193e9dd085c2df5e3c8550bcd064112a4fba2ab8 100644 (file)
 
 #include <asm/sgialib.h>
 
-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);
 }
index ee1a7cfcce75897f90833c0e776cb106de104be8..30be5f5d01debc139eba15183c197391be08f071 100644 (file)
@@ -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 <linux/init.h>
 #include <asm/sgialib.h>
index eba565db2fbdcf8079bbf99b12a8a463b04027fa..8cc0a22edf905e5facad7a7bb83d0451e52c1746 100644 (file)
@@ -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 <linux/init.h>
 #include <linux/kernel.h>
index 81cf6cf74b755979d3bdfbe062bc6683e0347e15..05200cb423850ad2539063ede6709256674b800d 100644 (file)
@@ -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;
 
index d1c530fda4bf24a21809b61b871e7e01fae41c7d..22c868ca1c1afeebcc33cf843748efae5f6b8481 100644 (file)
@@ -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",
index 1fe6bfa0cc7d313a503c87693deecc2fd8a3d37a..4c056be43c518eab18be48c72aa7b9bcc2dfeb86 100644 (file)
@@ -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.
  *
index 4cef8c838df75a6807f70c19e0ca7cc5c3e2aca0..3ed8daa403d736de47105913db6662e9795adcec 100644 (file)
@@ -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 <linux/init.h>
 #include <asm/sgialib.h>
index 07cdeda2c447382054c19a56e7be665b299cc01f..34925bacf84348017521a01acf8ad41685e4c0ce 100644 (file)
@@ -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 <linux/init.h>
 #include <asm/sgialib.h>
index 8ed2684b9308b6cef22778b3f208964e59cd594c..2c3ec6744d1df0bb89af0534193be0eb2f4e23f3 100644 (file)
@@ -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 <linux/init.h>
 #include <asm/sgialib.h>
index a471f18c2f117fb7b51e3fbc2a82a6a4383cb361..f27a9e6f33b6540d1a2b86b22d561e120c27bfa6 100644 (file)
 
 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
index c3545b21243ec10eeda9aa87e83b71be834f23e3..ef03dca069546425405e5d27b62e8ffe4399a0a7 100644 (file)
 #include <asm/bootinfo.h>
 #include <asm/mipsregs.h>
 #include <asm/pgtable.h>
+#include <asm/pgalloc.h>
 
 #include <asm/baget/baget.h>
 
-/* 
- * 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.
index ec0a5c19d0fc0890940ada4dbf558168bd9545b3..4990a9cf655fa80a8427d7aa5a5fd84c9964c9ae 100644 (file)
@@ -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
index f549b932edec5441739457abcb2fe20c4de86e95..819a2f9f10304b26664dda159ce786609b96743b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: balo.c,v 1.1 1999/01/17 03:49:37 ralf Exp $
+/* $Id$
  *
  * balo.c: BAget LOader
  *
index bd280841b8f44de82677b9733efffb3b77f78ac6..08b15a7a8e122d09e43319ce27871a2ea8f8f8c2 100644 (file)
@@ -29,8 +29,7 @@
 
 #include <asm/baget/baget.h>
 
-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;
 
 /*
index 6db85deb162caa1580b0666100af7bc134437ab4..0efbef1e39cbd48a2dac5f933a3989a26dcf24ae 100644 (file)
@@ -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
  *
index 302af7ec2b75b13b0fe281ad0ce6c096a84b14a2..a98779f0ee482ca8b6a7cdd4a57f0f0c62aaed50 100644 (file)
@@ -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
index 1f345d261d2f51cbc639d526ffe3004cd6ba9f22..d56fa6a23a9bdd5306147a7f94a256aab41b89d9 100644 (file)
@@ -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
index 5370013d78a3c94ce0f1267e070b893631221563..048e32ed5c6741840d0ac249fcd322e61aac3a94 100644 (file)
@@ -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
index 3d677cb8c90ef38a3be10cc3f370f00451dd6d1e..1ae3a3fd66aa45726af74b3660ccce79db967bdd 100644 (file)
@@ -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
index f570766613fe24aac02d36c154c192179169d657..9e6e664d2ea69d7c6c2b3053a4fe3ef31d610bfe 100644 (file)
@@ -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
index a01684fa85d4965fcddc0129d12aa298aded2860..559e0bc8ed3b4509e0bc354e1e38742530784850 100644 (file)
@@ -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
index 43ef0ce644257df23ae51ae321cbbdfc2f8f7c57..eab4d2dd928ce69959819cd0b37ad7322faad970 100644 (file)
@@ -6,9 +6,9 @@
  *  Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     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 <asm/asm.h>
index 4fee350e23e29ae9fa41473d2714e9d41dcb23c4..31813fe41d8a4569a2da88fe1ced20a71ebea35d 100644 (file)
@@ -2,7 +2,7 @@
  *  arch/mips/ddb5074/irq.c -- NEC DDB Vrc-5074 interrupt routines
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     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)
 {
 }
 
index 3cd4ac50f827ce584b3aa6347aca17c160430f61..35793b605397b506ffabb1a8318b705a2255fa24 100644 (file)
@@ -2,9 +2,9 @@
  *  arch/mips/ddb5074/nile4.c -- NEC Vrc-5074 Nile 4 support routines
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     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 <linux/kernel.h>
diff --git a/arch/mips/ddb5074/pci-dma.c b/arch/mips/ddb5074/pci-dma.c
new file mode 100644 (file)
index 0000000..1309e5e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2000   Ani Joshi <ajoshi@unixbox.com>
+ *
+ *
+ * Dynamic DMA mapping support.
+ *
+ * swiped from i386, and cloned for MIPS by Geert.
+ *
+ */
+
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+
+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));
+}
index e0f39c666d464610ec476afd33b9c99d578aa112..0a76788500b2419861a216df7e27e92bd38d8006 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
  *                     Albert Dorofeev <albert@sonycom.com>
- *                     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 = (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[] = {};
 
index 247297bcf4e80d1c47c612decdd13170049b7bd7..b85a3342b94a17647be56e7f5b1857709dc5189b 100644 (file)
@@ -2,9 +2,9 @@
  *  arch/mips/ddb5074/prom.c -- NEC DDB Vrc-5074 PROM routines
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     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 <linux/init.h>
index 03450a4417a56201c91d53f85b673aac3a72d4f0..d2f48c27fe896211df1c5daa710d0121239805ab 100644 (file)
@@ -2,9 +2,9 @@
  *  arch/mips/ddb5074/setup.c -- NEC DDB Vrc-5074 setup routines
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     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 <linux/config.h>
@@ -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)
index 7cc61eea54fa4d7c05bf012fbd731d3ef2e8b197..14503c66a4f9dc76933848363967b15c1eb732fc 100644 (file)
@@ -1,8 +1,8 @@
 /*
- *  arch.mips/ddb5074/time.c -- Timer routines
+ *  arch/mips/ddb5074/time.c -- Timer routines
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     Sony Suprastructure Center Europe (SUPC-E), Brussels
+ *                     Sony Software Development Center Europe (SDCE), Brussels
  *
  *  $Id*
  */
index 5d12eca3db2b36642e819116b9b81861982da068..7551ae6814d469af0ebb2f68e2db41be8fea2143 100644 (file)
@@ -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;
index c4bc1564add4cba3e360dc1ee1f5dc3f5a4e9964..c139bbda302db91e88567d721a7379ed8897d08a 100644 (file)
@@ -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.
 #
index e275b8be82bb253e31fb305c175fd25e6c50ecde..f81ee77ca5e317cfc0241ccbe9c7e82378e7fb09 100644 (file)
@@ -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 <linux/init.h>
 #include <linux/config.h>
index 88d8a0bc1ed39596d8a9d5a5d9da22504d04b030..a093c45bb82950ffed37c1f555255cd166959347 100644 (file)
@@ -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 <linux/init.h>
 #include <linux/config.h>
index 75e18c215dbf1c13db6719e446b49c4383caf3e7..e4d07608f4075f86cbb7c254d9b1c3c1805c21f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  $Id: reset.c,v 1.4 1999/04/11 17:06:16 harald Exp $
+ *  $Id: $
  *
  *  Reset a DECstation machine.
  *
index 5ee0fec3527e7fcc92581b285534f28b5b1a9416..f54bc89e2ab01ea9ffd6867f0b318a8480d1ac94 100644 (file)
@@ -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
index 6cb764d02e9d1d8329c949c20d7fe1b4ec8e6bd0..6c82b6cf816ce9faea1286827019cf00463f99cb 100644 (file)
@@ -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
index 16a01ec9bba885a042f0f76cf5496e734a297355..d4451245a13b33427b6f7316ade8cdecceaadd68 100644 (file)
@@ -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
 #
index 53fa16f7ed4df1ea5d15bc5d610daf6e55b73096..add67fef1da20d24d4085a4ab6c2f782645ee492 100644 (file)
@@ -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
 #
index 6272b0d180183a53b3f2530bf6b9b98045b90cc5..d4451245a13b33427b6f7316ade8cdecceaadd68 100644 (file)
@@ -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
 #
index 63c6adffb341109c65bf23a9620d5096bcc1c0a6..3b3e83e96ac6d4e1a6964f424bd2c913d324155f 100644 (file)
@@ -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
 #
index e69e67a9f49a39521873ba34bb2df3ac522ddb50..76f39e52a31bf21d74ef4c5d05578c18542aa326 100644 (file)
@@ -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
index 9efd8bb28c109051b8a41989ed9660c0ca6096c4..a05cf7cfa282cec2c96eb254029e9cbb6c9bbed7 100644 (file)
@@ -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
index 17f977f2a250d01f7f58a3da13a1c661579c60c6..1dfed0384354b6e8245142f4d5508986bc9a4f6a 100644 (file)
@@ -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.
  *
index d689d696c306265ee435db7e52c41a14df5dfbf9..f1aac5388ad3b38f34995453827d0242a56c6057 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  Reset a Jazz machine.
  *
- *  $Id: reset.c,v 1.3 1998/03/04 08:29:10 ralf Exp $
+ *  $Id:$
  */
 
 #include <linux/sched.h>
index 46414f7830c81c1a8ef4e0cb5a667498d6339282..2f5393ed15bfc73bc2c534118f0cafffd96a7205 100644 (file)
@@ -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
index 7d762f742277344937e4bd8935c0a215f1508ec0..a16ce7b69411f11b9f357ee7fa695740bcfa9259 100644 (file)
@@ -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.
  *
index 7e02712339cbff6a17aeae1afa423dd37629986a..9ef5ecbb298c07a7fff6f5cb80adf2182fb4ff8c 100644 (file)
@@ -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.
 #
index de00ba1218a7ed3a42ca21388efc477861c3d0f1..bde21011fcff887408fd5c438acd88ff36cbf19a 100644 (file)
@@ -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
  *
index 2845930d025c3e15a5a5ddf36666a7df51a31c69..66703471ccc47b6be001262249cea7dde8ffee24 100644 (file)
@@ -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 <linux/kernel.h>
 #include <linux/module.h>
index 0ee67dcf8cb5d8779e15a89ff1814d36966d42c3..dff18ca1220f1086b443adbd05e781208c554f7c 100644 (file)
@@ -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 <linux/sys.h>
index 84bebf269e718f844addf3be3802d93eee24bf07..2aff468fa6cfaf62ca79a2b12315dbabf6af7541 100644 (file)
@@ -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 $
  */
 
 /*
index be4751390aaa52c8b46007fdef85ec1cf80814b9..df612cbf8a769157b6b6a55f79efbe34e2f596f4 100644 (file)
@@ -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 <asm/mipsregs.h>
 #include <asm/stackframe.h>
 #include <asm/bootinfo.h>
-#include <asm/cpu.h>
 
        .text
        /*
        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)
        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.
  */
index 154cbc78d73ae2b1b3b4dfa89bd614e519246222..2d344c3010e057077206e8f99561b48ef32d6c5b 100644 (file)
@@ -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.
  *
index a4f767a68f33c7845a2e87a99949d5ba7a92c4d3..ddf2340450f4371f97e726431100b2d52dc649c1 100644 (file)
@@ -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 <linux/shm.h>
 #include <linux/personality.h>
 #include <linux/elfcore.h>
+#include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
@@ -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(&current->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;
index af3db7f469810e8130c625eb4e038bf885c4b5a8..9028a27be9c25407bbba983203fc46f97a063199 100644 (file)
@@ -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 <linux/mm.h>
 #include <linux/init.h>
index b59f630b9e48b95d4692f3b9cc002e0c9e0d4dd7..10ca5b15e8c40c8b3f43ee6994228815cf05e983 100644 (file)
@@ -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)
index 46b7bb55d89aa3f12320abc103df9d2f37927bd7..1bcafdf75d73d418168539b3d5df7902d6ea9c15 100644 (file)
@@ -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 <linux/kernel.h>
index cdb22693d7b670c61358acc60bab1a1049db557f..239576e4e34acaf5edc1f6bda50c3f5a911ee80c 100644 (file)
 #include <asm/sni.h>
 #include <asm/nile4.h>
 
+/*
+ * 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.
index 1f40f5756486b29ab34d3042499c8e2b1011b364..bfd75f6c8202b048732d97795adf8e17c45d7fed 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
+#include <asm/semaphore.h>
 #include <asm/sgi/sgihpc.h>
 #include <asm/softirq.h>
 #include <asm/uaccess.h>
@@ -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.
  */
index c2ee57b8606c0acd5019e9a6572c55f85da7bab1..701321a6bee296575607dd9b3468d2133bcc03be 100644 (file)
@@ -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.  */
+}
index c9bb395e7e73f654e76e730fe28d8d39a5c8e559..2353515b98a3d3ca20c70d1cd3e8b12977c350fa 100644 (file)
@@ -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();
        }
index b88cd808d128db8d7b34e135a1bce94597aebac8..dd96d035734eb6988463cfa775dc6a28ce6c16a7 100644 (file)
@@ -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;
index b0868a3beb82735056f4a77120620072bdfd3385..efb00dce139e1961c4de0a2d29e1249c2058aa03 100644 (file)
@@ -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.
  *
index 93d31a952bf35245369824b3a96eb21d87bd4503..c94037a2445aa0f1263e9b8a046321dd98ad0d9a 100644 (file)
@@ -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.
  *
index cd0df15b8b06800f88b79bd536e74c168d92e22f..c5649bd039a4533b12e11062a0a778d7b1900e2d 100644 (file)
@@ -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))
index 887fe84655a2959626cd513dd8c2cc158ebb8577..35493e1826b3ae146429e9f5e684b81ebb5c2bc0 100644 (file)
@@ -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.
  *
index 9d84fe6048a73fd8c24fce00167a60b05bca05c1..0ac3c532f4cc7e1cca3eb110d7eb3c807e4743e7 100644 (file)
@@ -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
index 560871d9763e682eb14fcfdca93cf38c269b8894..851b4dc4887ac054c532119a5b1b91e392324bed 100644 (file)
@@ -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 <asm/asm.h>
 #include <asm/fpregdef.h>
index 402dbb6048264cdd736dce1c52832baf8a547c7c..cb81afa07735c6ac84400427a1db9263aa8eb968 100644 (file)
@@ -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
index 3f0bb6888df5603af128084a21f3fb7ac291add8..fa44ffabf13617404cc4c85c94c47cbb51a2fd73 100644 (file)
@@ -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 <asm/io.h>
 #include <asm/stackframe.h>
 #include <asm/system.h>
+#include <asm/cpu.h>
 #ifdef CONFIG_SGI_IP22
 #include <asm/sgialib.h>
 #endif
 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");
 }
index cfd6b00a4808aa4418f4374d84b3471a42b19e6b..a912be2e1fb928ad35e7fb46efa7fd6a159addda 100644 (file)
@@ -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
index 61e4a166ffb383ec293d88ad8e9c46372c11709e..6b1bd77eb2b2778ac280a8bb7af2926b53c8663c 100644 (file)
 insn:  LOCK_KERNEL;                                                    \
        la      a1, 8f;                                                 \
        TEXT(#insn);                                                    \
-       la      a1, nosim;                                              \
+       la      a0, nosim;                                              \
        UNLOCK_KERNEL;                                                  \
        j       done
 
index 2ba03bda73fabcd7ec74b80e60c0de266e99e384..d2df0dc2049b68a1b24bca5dd9964a0e3516f0d1 100644 (file)
@@ -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;
 }
 
index de802c8f4b1bfe22b59a2afcff66f72c9545baed..e1720d46e3bf31ccc5ad9eb3b383fbc31b5a3804 100644 (file)
@@ -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)
index 8dbf00c60f296aec13311f2049c9cf049f8d2836..847acadd99aeae2eba8c4ffd68ba2677eb26c48d 100644 (file)
@@ -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)
index 4b90f23d02eec54c6e219339d35cae0e794c77dd..1602013ec0a058ca3a84b5786edb0eed6d2a6c7f 100644 (file)
@@ -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 <linux/errno.h>
 #include <linux/linkage.h>
@@ -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;
+}
index c9aaad50ce1e672642de3c81a9d5e5b443c8334d..4972885c2820f1cdc7e9cd483b2f21a883f88e75 100644 (file)
@@ -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 <linux/config.h>
 #include <linux/init.h>
@@ -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]);
index cfbd7390b2f3771d307f99f7450cc1c5f334135b..9953922b73952707b9e7f21203372cbe78416f53 100644 (file)
@@ -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
index a8d0cc9c98fa6772b946d430bfac1a7de82d0318..604847280df3ae394deb0ce68365037ecdb3f3ba 100644 (file)
@@ -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..
 #
index b814b56bff863ce952da165b3a64061bc890d213..66fd03031c4fa73fae38d0afd53dc2a616591d99 100644 (file)
@@ -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
index 5abb89398cdfb863d33b89edd7f9ae2810ff9799..c73ae974c1af76e01d063074b8c0819d99eddd35 100644 (file)
@@ -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 <net/checksum.h>
 #include <linux/types.h>
index ad4eb65ce553798b01b1f26c53c08d9c8e8a5d30..fd1b47db14e64b17826002235d56c7118772e6b1 100644 (file)
@@ -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
index f08a893507326aafd20c9f54c543343c2a2193a7..ada280d55ed004fa6a0d9b0fc7ef6e542c109296 100644 (file)
@@ -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
index b248028224aa16a2b2798b1527f443e685ce5069..77a388c8b12c7fb0ce5e7e44cd18e6e46ae0e5f8 100644 (file)
@@ -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
index d7b30ee895f102b61710fd42bc179d042617e118..8bedbbbc8dfd58ff40d525e401543609848010e6 100644 (file)
@@ -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
index 31210be29304471c97cd4e00bc3549cc59f690b5..c94e8c000648aa066d2a9634894b546cb97b6a86 100644 (file)
@@ -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
index e3cf757343471685b92e8ce3ee443ad7093dfd8e..8e7e69ecc1e754291c65868de3a841aa842ea8c6 100644 (file)
@@ -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
index 31447c20fbbfce96ea40181d16addcacb1109fa2..4850b09cea0eacdf6b7749f6494db1ea8b448c7a 100644 (file)
@@ -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
index 3951087ee56a86553338a84c11e8d7be5960a0ee..32f175756c9f7507e9be469587f2736f810053ac 100644 (file)
@@ -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 <asm/asm.h>
 #include <asm/offset.h>
index adc4279e614cd251c79ebdbd9b47b24bfce52bd8..34ee45953766cbfcbf1bb36d76842ad2b0ce309a 100644 (file)
@@ -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"
index 709366c67203d6d55d5894f9c1be566a0922dc39..7f0c02e18459eed067b64605a5f8b5107e9053b5 100644 (file)
@@ -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
index afacfa44d13cb1ae6b0700d00d7a910cf3bb25e6..a601d187917868837c2b236d3291436b4f9ab0c4 100644 (file)
@@ -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
index 4718eeb85f8384278800f177735378452dd188dd..0902817c08c514cfd9aafa910625dff257edb54b 100644 (file)
@@ -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
index 4e932c8e41b935b0a349b289fdfa17280bf2291b..9c8e0ab85405388e0a9af37ef1411e3123662e2d 100644 (file)
@@ -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
index 34c1de76f44bc56f39f2ea1c2a6c05dfb5b94db4..0ae411834e519e842e705705ccffe0693096d160 100644 (file)
@@ -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
index e0b2cde4fa6935ac0108469cab9f5ee2470edd1d..ee9559522d1f487d8c91105e367ce358cfe80c4e 100644 (file)
@@ -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
index e4700430b546115f67a5c97c9e15b8f02ba51963..d76b5f14196ca51e19596a28edc9a39df47eea16 100644 (file)
@@ -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).
  *
index ff03ce01ec347b8ae72771ab64682ec8bcccdcbf..e2d74fd11ef823767e1599bc37c5237962681086 100644 (file)
@@ -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);
index a6f8f5a12e5489582c71f1b4c5977a9494f54def..bc7a36da1faa6033672b67620a011a399fdd9a68 100644 (file)
@@ -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
index cb5e1e66dbaae4cc37144331b6b304fb89abfce0..6a1ad94aed2553b7ea4c879ffc32bb4545f0c7cf 100644 (file)
@@ -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 <linux/config.h>
 #include <linux/init.h>
@@ -15,7 +15,6 @@
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/bootinfo.h>
-#include <asm/sgialib.h>
 
 /* 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;
index b60294bd913de173a1942b4f1954342eddbdb2b0..2e699b41647019587b91b73168d7a5b8bbb9f9d3 100644 (file)
@@ -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 <linux/init.h>
 #include <linux/kernel.h>
@@ -18,7 +18,6 @@
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/system.h>
-#include <asm/sgialib.h>
 #include <asm/isadep.h>
 #include <asm/io.h>
 #include <asm/wbflush.h>
@@ -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);
 }
index 6085220c6518a5a2cb47b7b4a940be305c3d553a..8fc356d9ee521a387961a407ccc8c1f6e7e1401e 100644 (file)
@@ -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
index c797ac1c9667941e1e55d2f41f68cca55adbdffd..760e9fe51b05d3e41a01ba323da603d484d2438d 100644 (file)
@@ -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.
 #
index 1132c84c09ee8c333878b977e70b46e7f9870a8b..fd8e2a1dda1bae69ccb1a9f43113098251523f74 100644 (file)
@@ -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.
  *
index 3fa10fb0b32d1dd7c55e82a12a7d91dfcf56e132..5f4ae7644fed1652c1ecaacf5f3f8345539187bd 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright (C) 1998 Ralf Baechle
  */
 #include <linux/init.h>
+#include <linux/types.h>
 
 #include <asm/addrspace.h>
 #include <asm/sgi/sgihpc.h>
index 0a4647262f8709543a57d3c406ca3962347ac5f9..06d8573cbb2751cf784e500e70b4d271b0213cb3 100644 (file)
@@ -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..
 #include <asm/sgialib.h>
 #include <asm/gdb-stub.h>
 
+/*
+ * 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;
index 6d0c3c23dd9909ebf8a4f02ace61c3fad3dc0cb5..11a7c510f58a1d174cb7ad6ea5f9f5b9409e344c 100644 (file)
@@ -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 <linux/init.h>
 #include <linux/kernel.h>
index cec8aa01e6f66a02e81cde3a90225b937cc02a84..bad4f66674200b197838daa4b9b2526845bc1910 100644 (file)
@@ -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
index 6db7f1fe2be63c65e19c8d480c99c323e1c03631..b41620c93c463f71f9983c646941f7bb09319f19 100644 (file)
@@ -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;
index 412089d25576f467e304142ac539b3162e737b40..3306cdc25b3293c82b54e08823b0d19c671961e3 100644 (file)
@@ -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.
  *
index 570d27303b5f598995c99d19f316d48208c46fca..391f9613cd5aa13a21fe1b59b16c7adc3001c6c6 100644 (file)
@@ -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;
 }
index 02789145b8f06422983cf6c926c71852e9025397..53cd9b1e47e9d4fc158ab6d2d088cbd3edac1a76 100644 (file)
@@ -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.
  *
index cd0a5ed675ff4f5ebb2f101d823f6e73e93b1a3f..f70d31ddd77a8e92ce492a7945c9c6b170684291 100644 (file)
 #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);
index 69245c9cac5e2b78598b801fc0b1bf8df1002e56..29bf6ced28151a75982694fa2985f9a93ca5cfaa 100644 (file)
@@ -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 <linux/init.h>
 #include <linux/kernel.h>
index 5f72701c500e840fb2b862ee807a9daa30245838..355f1c47131927929309b7090c4b24a0ca289ad4 100644 (file)
@@ -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.
  *
index bec45bb05278158be224736868546b31c6dc6820..b5091e1590401ca674637e8d6bf397f48c5311a4 100644 (file)
@@ -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
 #
index 855262547684c540c8c58adb9e84588abf1efdee..2f092abf4b55dc9625254eb8a6fee7b5819bf8f2 100644 (file)
@@ -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.
  *
index 247c5922de7b3dbfc92b6654386716bf183f4bc1..57dfd661f9cb8b4111f166fd549f7ef4c8d7ffdc 100644 (file)
@@ -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.
  *
index 40e51a095ef83de1fbbe7b176ecb68c1284fc076..80a9037c9aa6b6ca39dcd4d83dc3808dbb0f27fc 100644 (file)
@@ -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
index 942bbaf56306f2dafd356f405ed4aaeccbdc1f2a..cfbc4b3e73c37bd26325f2d65e152e13c7c82c0a 100644 (file)
@@ -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
index 1994b0cd2c802c53962aec21e1a1bb42c7285671..ce9366a200fec528b8f8c45a832a9f5848b93223 100644 (file)
@@ -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
  *
index b184a7cd0614f879b06ff9fdca522b8d5ab15e8f..767e2fc111d87dfc6323001be4cde4a8a3718a81 100644 (file)
@@ -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.
  *
index df81fac5c2120d4042bc077c805f62de30bc048e..94cfc08a04d2729e5c6bc7dd89b8e2e5f2470bc5 100644 (file)
@@ -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
 
index 5a33d3db6131ca90cadd34e8bf16f552217c1ba2..b76281d648007b8de6d943733d439f33f6e3d1a3 100644 (file)
@@ -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.
  *
index d884cb875405d972f46f506eb0d4915a39ba6800..218c22ec4e1fa6f5d3e45cf185a7354d57b32b6b 100644 (file)
@@ -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
index 8ca0a53936efdd801686a05d6462cfcbbf006795..039caf88de5674ee58f54081dc3752505f645452 100644 (file)
@@ -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.
 #
index f6fb752f190b6e27155a0d836833e0ff1fddb653..8ab66fa5926a6eae5c97901db8c0527820c33fea 100644 (file)
@@ -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
index cb22af6ecef50d4020a7428fad50237858e02916..0f087e912ee07d1f557dbd09757b7900f553a3a5 100644 (file)
@@ -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
index c787965aa3a1d69957d729ff829b7d9bd5509f92..f379c63a4166632941dca445007acb7f6523e8ed 100644 (file)
@@ -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
index 2f5047c666d8905d6e14ae15679c84a159e30234..a11583b0109e88d4bb3afb657821541b9ed0ba2a 100644 (file)
@@ -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
index 61725d5f21921d27a1aee41dd66c83c1d9fc420b..ab2d553ad3565bda034a6a37d0e14b76e3cceb83 100644 (file)
@@ -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
index 79476ab8129396f77a28d3d1bdce678d108871f0..703305c2023f9be457661da0ce54b84c9f445e11 100644 (file)
@@ -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
index 84a5c76d05c7571895fad1441234fdec343822fe..2d175ebf8ee988612f29904ccb2a8eed78c5358a 100644 (file)
@@ -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
index ea91b4a6ce604e74e4d19c5f907f43070f641d27..f3abd90a205b965084ca43365c818fe3d4406409 100644 (file)
@@ -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.
index 8333a2f001fe9fa72a113bdc17bf49099604da8e..82742c4fd71fc329bfc5b7ca5163bf24d3ceaacb 100644 (file)
@@ -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
index 16478ed344524c522eccafb3fa80d750a5ba30b5..68c6787df90607e908f37b0ee98f14d7a9dd892e 100644 (file)
@@ -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
index 80c0e0b7d2ebe688e971a55422de2fe82eeb3201..07891869526ef931bcc680f3d6f431fcc8b57d8e 100644 (file)
@@ -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
index 0a1b4ec1837f262a09e2a04432b5833ed3d95e0b..b2454b8cc3015d6cb6af48d9272d2369c8cdb2ea 100644 (file)
@@ -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
index b6114af664414cd76c12f4e1aed82e06650ac8a7..fc6376f142be84dccf58396e70d1c213432b86cc 100644 (file)
 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
index d425580c508720414058fdcab2572eb414b80d80..e9a442e43a1c35ea199ed5a3cf5d18ea42680903 100644 (file)
@@ -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
 #
index 039ffd84ff3559da013829b947cd986e40bc7370..fc6376f142be84dccf58396e70d1c213432b86cc 100644 (file)
 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
index 0f70cba13480b00cebc5c5838645e42a41bf82b7..e1edfc6a7a5baa83c0411a6484613eaba1913524 100644 (file)
@@ -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
index 5575b0f28a456d4f6c691423035f12ddd8efddb4..a199839a64048ba28c2d01ef54697f1d0a97fa83 100644 (file)
@@ -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.
  *
index 97371fddf75461bb60eadb0364b6655c171a1774..0b2f51c7fc5baaf369183fd7923985279fff17e0 100644 (file)
@@ -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
index 9e05e7a68c17bcdd598c8d3f968f5a9344d3937e..8f61ca7eec9ee5c9e88be489baa9d0a499eb9fac 100644 (file)
@@ -10,6 +10,7 @@
  * Copyright (C) 1999, 2000 Silicon Graphics
  */
 #include <linux/config.h>
+
 #include <asm/asm.h>
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
@@ -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
index 2621873e80dcd0a02d90131422162977b82d39fb..cc19d318c2bc84c313aa16500cb83b65cbf6972d 100644 (file)
@@ -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
 #include <asm/mipsregs.h>
 #include <asm/stackframe.h>
 
+#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 (file)
index 0000000..45c9cf5
--- /dev/null
@@ -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 <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/file.h>
+#include <linux/vt.h>
+#include <linux/kd.h>
+#include <linux/netdevice.h>
+#include <linux/route.h>
+#include <asm/types.h>
+#include <asm/uaccess.h>
+
+#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);
index 9ab468913d266519441f2b21e8d796da6856cbf0..529c62031a1a487fcc18f510019f56402f0d349e 100644 (file)
-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 <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/file.h>
+#include <linux/smp_lock.h>
+#include <linux/highuid.h>
+#include <linux/dirent.h>
+#include <linux/resource.h>
+#include <linux/highmem.h>
+#include <linux/time.h>
+#include <linux/poll.h>
+#include <linux/slab.h>
+
+#include <asm/uaccess.h>
+#include <asm/mman.h>
+
+
+#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], &regs);
+       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(&current->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(&current->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, &regs);
+       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
+       <<Bomb - little endian support must define this>>
+#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;
+}
index 2c31e87f7339f9be11f4d3479385527b2bcf29bd..5b77f30502367f27eb6c433d4b955486bb1569bc 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
+#include <asm/semaphore.h>
 #include <asm/softirq.h>
 #include <asm/uaccess.h>
 
@@ -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.
  */
index 74332257b0fc563d0202a47c975b08b7370bb314..78a9cbdcc617a47d357ef0466d0d5c5a9e74eda7 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/smp.h>
 #include <asm/bootinfo.h>
 #include <asm/mipsregs.h>
 #include <asm/processor.h>
@@ -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.  */
+}
index 78a933d3b03de5e688060bf585574204c617ba07..22ce0ed6d07d28e5e8029e859affb381d5083a07 100644 (file)
@@ -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 <linux/config.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -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. */
index 1fd46b093850ed4549a09ff4ec4eaa5d7c8289da..a0488107f19e2a72ebab7782c441151c77a816b1 100644 (file)
  * 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 <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/ptrace.h>
+#include <linux/smp.h>
+#include <linux/smp_lock.h>
+#include <linux/user.h>
 
+#include <asm/mipsregs.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/system.h>
+#include <asm/uaccess.h>
+
+/* 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)
 {
index 6d5a8271251c7696b0bd9d24158ee4bf19bb37d6..87c496af8ed63521f4d5c89bb713ffcd53453da1 100644 (file)
@@ -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
index 24fc735f11cba28aedee87e09f00d32b45b66e0e..609b9fd0abbb1cd7c481a93ffb365167b4ca9b4a 100644 (file)
@@ -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
index 45e6c154f4132ff9d2cbe5374bac8fd12409df86..b4ada3668ca1e8c7f1f472bd52497d447b35c757 100644 (file)
@@ -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
        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
index 2d889a9ad44ef0f7328215469131cf4084126916..f82ea64a485b5dbf689ffe9061781a55127d205c 100644 (file)
@@ -9,6 +9,7 @@
  * Copyright (C) 1994, 1995, 1996, by Andreas Busse
  * Copyright (C) 1999 Silicon Graphics, Inc.
  */
+#include <linux/config.h>
 #include <asm/asm.h>
 #include <asm/bootinfo.h>
 #include <asm/cachectl.h>
         */
        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)
 
index 48631d57eb0a18c17878622dcf4341316ca7aed2..e9ae2d6045da93821b5dea5343dabf87330cbc62 100644 (file)
@@ -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
index b0726421eb25ff01c28100e3d724e7d4d62d85c2..7cf15443ef889e951b277bffa944c7779da3f58f 100644 (file)
@@ -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
index db1f1812295e7dd0348d81d4114a7fed654d5161..6a7a595512e8239881dbac481aaa98e7503654e4 100644 (file)
@@ -22,9 +22,6 @@
 /* This duplicates the definition from <asm/signal.h> */
 #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
index c7ffed12bce4c609a78b44abf798ad927e5784f1..d37fa0c2c2087faa92261ce68e57e1838cf8c82e 100644 (file)
@@ -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
index 2009860a9775402993024447f2d330039bf22c4e..fe4c750d40219ef79f16a56509faa6fc57a667c3 100644 (file)
@@ -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
 #include <asm/system.h>
 
 #ifdef CONFIG_SGI_IP27
+/* XXX Origin garbage has no business in this file  */
 #include <asm/sn/sn0/addrs.h>
 #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();
 }
index c80b58a1cf65af67b67e6a2f9fca1ee120dc054b..7f644a4378838e099d17e876e91191b6d4f82183 100644 (file)
@@ -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 <asm/stackframe.h>
 #include <asm/uaccess.h>
 #include <asm/ucontext.h>
+#include <asm/system.h>
 
 #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], 
+               &current->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS * 
+                                               sizeof(unsigned long));
+       err |= __copy_to_user(&sc->sc_fpc_csr, &current->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(&current->thread.fpu.hard.fp_regs[0], 
+                       &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long));
+       err |= __copy_from_user(&current->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;
 }
index 109c4d37b8dcde513ed001dc7acc87cd23ed6a7e..e33a69d5ef6a546bde646ff5c5d31b24717546a7 100644 (file)
@@ -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 <linux/config.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
@@ -25,6 +26,7 @@
 #include <asm/stackframe.h>
 #include <asm/uaccess.h>
 #include <asm/ucontext.h>
+#include <asm/system.h>
 
 #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], 
+               &current->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS * 
+                                               sizeof(unsigned long));
+       err |= __copy_to_user(&sc->sc_fpc_csr, &current->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(&current->thread.fpu.hard.fp_regs[0], 
+                       &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long));
+       err |= __copy_from_user(&current->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 = &current->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 (file)
index 0000000..155b065
--- /dev/null
@@ -0,0 +1,258 @@
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/threads.h>
+#include <linux/time.h>
+#include <linux/timex.h>
+#include <linux/sched.h>
+
+#include <asm/atomic.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/hardirq.h>
+#include <asm/softirq.h>
+#include <asm/mmu_context.h>
+
+#ifdef CONFIG_SGI_IP27
+
+#include <asm/sn/arch.h>
+#include <asm/sn/intr.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/agent.h>
+#include <asm/sn/sn0/ip27.h>
+
+#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.
+ *  <func>      The function to run. This must be fast and non-blocking.
+ *  <info>      An arbitrary pointer to pass to the function.
+ *  <retry>     If true, keep retrying until ready.
+ *  <wait>      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 <func>
+ * 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);
+}
+
index e83c63d6a1ccf542507977fbb9124287668e6d15..be08ff010876fda68fd2692134b307e2029042fe 100644 (file)
@@ -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
 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
index b7521f15112713ac77bb5011f4b2f3282420ec04..f791806d606f32bce1110d8389233962368a6cdc 100644 (file)
@@ -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;
+}
index 1af2be15aa3a56a6fed2c9dbfb4e11b47d715187..fa58017cfef3bb67e04174a49176abe100dccc1c 100644 (file)
@@ -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;
 }
index 34c5857c51f5dacf2e71f27ae509718ce989f959..5381642f104f4effe71438d95eb5a1dac2a0fd87 100644 (file)
@@ -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.
  *
index f021deb6449bf6ab7e0e46481805f64cf8347ea9..3e61ae79edeb28870633f30a592cd81e2ac9b139 100644 (file)
@@ -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..
 #
index 7851d98f40e1b8427e6d1806b5e700ac438b01df..27147065a1646096b724ab8286360ed664f9c548 100644 (file)
@@ -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
index ee314cd9512a8da692426d958d453ea819ea7ae3..49607c46644cfaecb22debf79ea2f636068b051f 100644 (file)
@@ -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
index d2cf2932c274873b17f47d23a474dc553663bd20..f0cd72d28cd55196af34cecc67c15738236da901 100644 (file)
@@ -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
index 079acae8cb8c669114bf465f7ad13bd229ebd3aa..88dbfdbc140d2f1f64e47ac17543a6036338a38b 100644 (file)
@@ -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
index 97bb48260aa00813cb66bbed6607e111506b407f..7a7833db738926f44eaa0b4024fe2c3f1bc90d04 100644 (file)
@@ -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
index 2a4fa1bb12fbbc0211b70f1ea489d6222d45308d..f80f7d5ead48d82d1978ae2cf3c7a515796b200f 100644 (file)
@@ -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
index f0692772568fa9cf7c7d79a399752b2ffd7576f1..0120e9ba4b824f048992c8331ab2114d3ae3f457 100644 (file)
@@ -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
index 0edd0eef2ec69ec05cd99c46c0141db208a6c249..a35a0c5c848c515ec7e9195bb34fd1f0165b994d 100644 (file)
@@ -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
index 0a316f9d45ed2f566efd0c6d57fa7c6de1266a14..d62c300821ed53d53f7816cb7ab9a78cf4dbccee 100644 (file)
@@ -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
index 0e8986f1f239e659177b0b5b017f0c1a7d6302bf..4a051cebff43fc033f53d8ae5f1a8e56dcea0bd9 100644 (file)
@@ -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
index d0945417a50bec0c49e2d0e5c75236d7b336dbaf..808033648f27f3b717e0546d5eee7e4924616474 100644 (file)
@@ -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
index 8224a567b2f562fc80fc8ca6c0772c86beee0a39..a4a6ead814f82bd953d0e3101c71609c9dc92fd8 100644 (file)
@@ -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
index b9f97a86c8ce7662e98ba3f08a6b21ffa4297d8f..38b7082d93a256eb4ca163896156a7bd114632a1 100644 (file)
@@ -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
index 61f6ebf518cbf9b68ee0674a3fb16e3a2d4e21ee..49ba07b0560dd7cfd6b28bee5e732f7b97299b0d 100644 (file)
@@ -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
index 1137b3bf16b580692487ba1360e1e8561c2a3f6e..9df7e5e87c155c94c7294c423e85bfe250193dcc 100644 (file)
@@ -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
index 7e0d9f7582a87002f1709de44486d601812cf366..3f3d18c6e129a0cceab999e401ad058c53becec3 100644 (file)
@@ -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
index 9a8acde88efbeeb08bc8770efd2d8d4e40a695d4..fe95aff18456d161276392843945be13c9d0dc55 100644 (file)
@@ -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.
 #
index bf47923cb8642ea4bddf1d3b62a1f577ed07c17a..7e4d4122f3590d91cb5d281965debac13f01f9d1 100644 (file)
@@ -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?  */
 }
index 8a1bbe06f987ce4b8a261b4c45da9837ff97f115..f9ae91ae057e971e22ff6b7b64974cbf9b0c2a8a 100644 (file)
@@ -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
index a6468e800196d25a835841814db7a262ac6cab0e..e31c82568075357cef4ebfc2d2363df1393d76ae 100644 (file)
@@ -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
 #include <asm/softirq.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/ptrace.h>
 
 #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);
 
index 285be08bfd23c9c4d6c2dc268a27f3adf2516262..42dece54934216dfb65decb6b8fa32ca3770a6e3 100644 (file)
@@ -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;
index 7aecbe2f12016f8cd203155f57ed033a0cac6811..69f661c0baed5ded3fa2ef3829ad7b4fe66f3f1a 100644 (file)
@@ -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
index cf176a92521e46058b5b5955ccf9e83d9b2a85dd..c2b9c406634be842be578fbde90ae8c679288fc4 100644 (file)
@@ -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();
 }
index 7da20ad62a523ad5b016141d5bb042204f016c9f..b8ae542ccad5799a5943a61d7affc2de7086cdae 100644 (file)
@@ -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
index 3b9fbcf162c80763c04c3f7f6cc89c9158f5de92..f303d90dacb4590c752312359c17e8178e486166 100644 (file)
@@ -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.
index 8142336202e6e08a496b5956b182e2cf5185404f..ecc3af19845605b3062acb102b74683491ede825 100644 (file)
@@ -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
index 0f9ce72f122cf1fdbe6e7a672427f0d8f5768fb2..5e42803c1cd646ad5d124269087d0dc73f706723 100644 (file)
@@ -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.
  *
index b5ce61f3acedcb35f2b321670b27b8f9bfd1d003..891e121f637ba3be305832b3ca64b1a8181d4925 100644 (file)
@@ -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..
 #include <asm/sgi/sgint23.h>
 #include <asm/sgialib.h>
 
+/*
+ * 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... */
index a244c74dd7965e7656a1e5600aae9327ac3c6b4b..e943d3e3034f636ce0c0c59563133e58a80a68ea 100644 (file)
@@ -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
index c51119db4f5359a71e7c47125d4208150ef39c96..be8a91a0a06c1845b4191937778026c8cbd41505 100644 (file)
@@ -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
index 281967f92acee8055dab95beafcb8c213d35eda0..e8d4ff345c003bed9ea6aad7eb5af8d1c12f465a 100644 (file)
@@ -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
index 55678acbb89a65e8c5f47277e4c131f8510da717..eca3bcaabb07900b7f78bc42cb2398c65ca1bca2 100644 (file)
@@ -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
index cddc1b1955aec85b5b8cbfba09829f4b8d0891ab..21736bf0a4e6cfe2252ae3b57bb9662d1a1918b9 100644 (file)
@@ -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;
index 777743b0ace1b6ddea6726e8a311b805e3dbc42a..7505e0c03c415cd7361cb0bc739cdb2116778749 100644 (file)
@@ -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
index d0f2aa75e37af3db194d4e7bf66381c1fc70f33b..76b613e60cdd2754d43cefbb4f8def31ba125964 100644 (file)
@@ -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)
index e31802680161e06faa1d4169069e187a9f5fa837..ce8b81085a04de239ddfb73dd846dd30ef1032a8 100644 (file)
@@ -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
index 82012ce33ac71713ddcfa67166d66eca2f957015..27a104d000741b0f228c0ad1afdfd910d5d0bcae 100644 (file)
@@ -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
index 857aef1d819bd0eabcc834e0f16d209187a5ca8e..c15231c93186a0137419f998cd159583ef2bfbee 100644 (file)
@@ -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
index 5f2961f3a84aeba0be912ed963862e91fd1a2460..78451283fe300a4af8f0e2811d30c388de4397b0 100644 (file)
@@ -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.
index 67ff8666125f031aa1ea061b554f598b6417b4ac..b4b594baa66bb85c5a0ce619cbed5508056d64e8 100644 (file)
@@ -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
index e09bc60364858aa6342d8a2c439999fd769cf544..9e2df36625ce28797809a81d4caf8ec3eb5504ba 100644 (file)
@@ -1,5 +1,10 @@
 #include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sched.h>
 #include <linux/mmzone.h>      /* for numnodes */
+#include <linux/mm.h>
+#include <asm/pgalloc.h>
+#include <asm/pgtable.h>
 #include <asm/sn/types.h>
 #include <asm/sn/sn0/addrs.h>
 #include <asm/sn/sn0/hubni.h>
 #include <asm/ioc3.h>
 #include <asm/mipsregs.h>
 #include <asm/sn/gda.h>
+#include <asm/sn/intr.h>
+#include <asm/current.h>
+#include <asm/smp.h>
+#include <asm/processor.h>
+#include <asm/mmu_context.h>
+#include <asm/sn/launch.h>
+#include <asm/sn/sn_private.h>
+#include <asm/sn/sn0/ip27.h>
 
-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(&region_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 */
index 5912a8b433b88513e29233b92443bce09d257181..40517c2d4dbd78da8d70aa89ff37b1f7cab5d39c 100644 (file)
@@ -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
index 266a753e1953df88a16cb930af14d4d6e0d2ddfa..2c0ddcc69924df87a5629ee3f078e8afc4a3066f 100644 (file)
@@ -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 <linux/init.h>
 
 #include <linux/errno.h>
-#include <linux/kernel_stat.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/types.h>
@@ -17,8 +16,9 @@
 #include <linux/timex.h>
 #include <linux/malloc.h>
 #include <linux/random.h>
-#include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/kernel_stat.h>
+#include <linux/delay.h>
 
 #include <asm/bitops.h>
 #include <asm/bootinfo.h>
 #include <asm/sn/sn0/hub.h>
 #include <asm/sn/sn0/ip27.h>
 #include <asm/sn/arch.h>
+#include <asm/sn/intr.h>
+#include <asm/sn/intr_public.h>
+
+#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; bus<num_bridges; bus++) {
+          bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus],bus_to_wid[bus]);          
+          /* 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 */
 #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);
+}
index 3d9ea3566a234e17eba2f0dbf974787309a4f00d..fac7c9dfad425ef69b9c4122bc684a77560bdad3 100644 (file)
@@ -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.
 #include <linux/mm.h>          
 
 #include <asm/sn/klconfig.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/gda.h>
 
-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;
+}
index a7bc49cf30876d0b62cf524842164fbf2a5bf74c..063fb5a41ac9038f93797b6aa503fcd14b3b83f5 100644 (file)
@@ -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 (file)
index 0000000..3511c62
--- /dev/null
@@ -0,0 +1,165 @@
+#include <linux/kernel.h>
+#include <linux/mmzone.h>
+#include <linux/spinlock.h>
+#include <linux/smp.h>
+#include <asm/atomic.h>
+#include <asm/sn/types.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/nmi.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/sn0/hub.h>
+
+#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);
+}
+
index 895cf2827659fb1e1ef131db2167bbdd35c55bc1..81e3e5c6fdfe056678ee0791569fdbb88665c429 100644 (file)
@@ -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.
  *
index 62cd3a0cb206d1bd4490632dd2564d989ec0d6ca..75d966d9d1a387f596b946cba12b6825b87ad640 100644 (file)
@@ -13,6 +13,8 @@
 #include <asm/sn/arch.h>
 #include <asm/pci/bridge.h>
 #include <asm/paccess.h>
+#include <asm/sn/sn0/ip27.h>
+#include <asm/sn/sn0/hub.h>
 
 /*
  * The Bridge ASIC supports both type 0 and type 1 access.  Type 1 is
  */
 #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; i<num_bridges; i++) {
+               printk("PCI: Probing PCI hardware on host bus %2d, node %d.\n", i, nid);
+               pci_scan_bus(i, ops, NULL);
+       }
 }
 
 static inline u8
@@ -145,7 +158,11 @@ pci_swizzle(struct pci_dev *dev, u8 *pinp)
 static int __init
 pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
-       return (slot + (((pin-1) & 1) << 2)) & 7;
+       int rv;
+       rv = (slot + (((pin-1) & 1) << 2)) & 7;
+       rv |= (bus_to_wid[dev->bus->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 }
 };
index b30cb12a29ed290eebd14d9c5e814cfe62682135..388fb602648fc4f77c4a2cd332c3f0803baf4c5c 100644 (file)
@@ -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 <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
+#include <linux/smp.h>
+#include <linux/mmzone.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/sgialib.h>
 #include <asm/sgi/sgihpc.h>
 #include <asm/sgi/sgint23.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/gda.h>
+#include <asm/sn/sn0/hub.h>
 
 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)
index f0d7d66ab0dce96550dd961d17809d0d3bd42ce0..89f58c13de6e4f1516952a1a30d5f6b1c0d9e02b 100644 (file)
@@ -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
 #include <asm/sn/klconfig.h>
 #include <asm/ioc3.h>
 #include <asm/mipsregs.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/sn_private.h>
+#include <asm/pci/bridge.h>
+#include <asm/paccess.h>
+#include <asm/sn/sn0/ip27.h>
+#include <asm/sn/sn0/hubio.h>
 
 /* 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; i<num_bridges; i++) {
+               DBG("pcibr_setup: bus= %d  bus_to_wid[%2d]= %d  bus_to_nid[%2d]= %d\n",
+                        i, i, bus_to_wid[i], i, bus_to_nid[i]);
+
+               /*
+                * point to this bridge
+                */
+               bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[i],bus_to_wid[i]);
+               /*
+                * Clear all pending interrupts.
+                */
+               bridge->b_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");
 }
index ff6ea60e7cc4809207041299a44499d91fdde67d..d5a1ed0581a54e76306a1ac6d678f7bed18c6964 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/sn/klconfig.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/addrs.h>
+#include <asm/sn/sn_private.h>
 #include <asm/sn/sn0/ip27.h>
 #include <asm/sn/sn0/hub.h>
 
@@ -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);
+       }
+}
index 0fdcd92f8b6c6627aa26e3398bde50853de26611..6a7d7de6bbed8a89a06467150643d2b3726fe56f 100644 (file)
@@ -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.
 #
index 9673dea80ca8a056afffc5053011222835510f26..a8833e216a112c639f1db1dab6efef5effb8e4ee 100644 (file)
@@ -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;
 }
index df6ae2eda1858b5f180e49ecb3d81dbc1ac15e14..c4d5254700646d83ffdf7faa1a411b08d1151139 100644 (file)
@@ -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);
 
index 04004d7fb28bbc094febe8380327120ac6f8c74d..c6f8531f476d2453cb222e8e18fff126a0b5af0c 100644 (file)
@@ -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 <linux/version.h>
@@ -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 "
                  "<lnz@dandelion.com>\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;
index e93448faba1eda688bf04059a255ae261b118ced..d748f0982bc6346cf4f61e70897b31c209cd7252 100644 (file)
@@ -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.
index dd94223bc0703e73bb1aacc2905d3d0484f24d0c..6763b068a21ccc2aa0581f42a8837a26a696a28e 100644 (file)
@@ -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 */
index c5fcec9bc404b979c69f027e71c0b1d0b4d494fb..d90732d8a2bb221846c926d4423b57a6aeed03c6 100644 (file)
@@ -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);
 
index 9a5b25038f50f8854b22e524e424998986460d10..5a148b633e008bab277a2bb4677111e0d63d4c6a 100644 (file)
@@ -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);
 
index 7aaeb9398d2f9614c4c7221c45a5343d1b01acd7..a02829c249e07338fa1e3901d59c9c09ea77e864 100644 (file)
@@ -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
index 02331da249719b4893cb0c46acfbf7844bf869e2..d36f74aa86751eceaa8ae1feb39aff979d5b19e9 100644 (file)
@@ -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]) {
index 7f8a022bf6268d1e17ef2acd50f0f22d47e5b185..9363422188c8e7adc75837186c32e422d0c6ab75 100644 (file)
@@ -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]) {
index f468f38292e39ae83c00d84b59a3d765eb04798b..0c92cc4d247132bd651e221c1771fac2a1412eff 100644 (file)
@@ -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,
index aca9635aef8a42c921912ebe2bcf464f3247c44c..24ba13ef23112f7eb48d9574d5670a73a6652e54 100644 (file)
@@ -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]) {
index 7293a16f89ba3352567d335215f085380860ee95..97f8d0a41c5c9ecb2fa7825583d88869cf1769d4 100644 (file)
@@ -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]) {
index 19c7dd255dba433ef30038a4bd27c3fbfe4a5436..eeb6b77c519cd85fba5f28a2fff3b9999d8b01b5 100644 (file)
@@ -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
index 4964a3fe0dcd721d7f3aced62875a0e276ff13ec..d7aa8927d0e719bc7dd6d4aa4b6cc47208caed2e 100644 (file)
@@ -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);
index afb6cbfeb04bfe4ec55142d4cf21968b4343c7f9..048f7edd1657bd8343d938dad41e0a5537b79304 100644 (file)
@@ -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);
        
index 80a756ae8537c00748b5b4849b973efaf55361c0..6e6af292f8d377a41ccf4fb85b0d668ad74ebceb 100644 (file)
@@ -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);
 
index eb571db3ddc6ec131f4934169e5baac252cd39ef..8a3952df44e16b246cad965938c6d9c8bdf516c6 100644 (file)
@@ -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;
 }
index c36c76dff99ccbef243a57863f1d1aecc8620aac..3f40f5aaed9e7618da55c3940365906a9e536366 100644 (file)
@@ -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);
 
index 7b1f7644808afc03f0348b5887bec5b841df8c3b..dc580b0fe5ccef08317c6f2a50b81721d2a59815 100644 (file)
@@ -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);
index 2e0bf00461391cec65ac73feaf06b5f0a73a20b7..15a304c4f516ee36b15953d231bd65a879ea6899 100644 (file)
@@ -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)),
index ed66e2bf989945caeab5a9904e83f67536e19461..0b5d39c688a71739442e58615255e24a298fb6a4 100644 (file)
@@ -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)
index b48b726f646b97878c8958ecb0f664d2f1977291..8efaf47f8bd2b1b852d8d3e42e14b16785b4805e 100644 (file)
@@ -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);
 
index 3d59d63c1635e3fdd758b0878018e7dff7d7113a..b5f70ff1616ff543b8b4b4ba14e49c9bded0db3d 100644 (file)
@@ -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);
 
index bc4dec29cb3ea8cc52466b619f53b5fa63cc6bb5..12cee4da53900644dc71a90aea15d030fd042efc 100644 (file)
@@ -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);
 
index 77816670f30ef086f40874eae790f7a544fea23d..67db42e974e70b01371306ee96827aa7e650dbbc 100644 (file)
@@ -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);
 
index ebf339d2ee965a511d7aa5bd6a1dfa3ae02317d7..6346873e8873f61ab0daf5f52326befa14f4730a 100644 (file)
@@ -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);
index 2be7d5823e1c435c8de0782afbf740d777a49a45..4e2d6435e87e6f84b4604a6ef389b0d49cadd95f 100644 (file)
@@ -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);
 
index 09255a3c10674e1156fa3686c402717881ba4476..5c78c1565684c7fffa17b6b043bdafc7aba28437 100644 (file)
@@ -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);
 
index 5f06dc3680f346d01bdd6036c69ef810f1b42cc8..bce892fe33ce96cdaddbf147033c57d33277de24 100644 (file)
@@ -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,}
index f457347713776642a3cc5134a3ae4d4ee2adc0b7..7f05925cd5e7845ca3086dfc95d15ea171f4dcd7 100644 (file)
@@ -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);
index 8ae10a074f80b67d8243748ba994f99518bfebfb..1623c98ba681c71ac64ecc2f151cf4428548dc32 100644 (file)
@@ -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);
index aa1fc77d19edcb9c6b7db523385af0264c691f1c..1c62eafed743fcf0616bf8c601c1035c149fbe1a 100644 (file)
@@ -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);
index 76bfcc3c058098387edc62ee60c60673ab2281d3..4e42146614bd6a0de319cb3fbfc4f3f2256eaae2 100644 (file)
@@ -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,
index 427167b3d759f27b89974115ab5c7c755e4e66b4..a6e5448567adf4d6fdbdc8faa5c50b3a90912d53 100644 (file)
@@ -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}
 };
 
index 6588f3b3f6e1f05db72db84df827aea84043502b..5aa31f506575bc5b57fd27767993fe766e0d9015 100644 (file)
@@ -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);
index a1f462f3b34da4092ef72d387f8689a61df6f3dd..aa680aefc98e8f2de5da146316fd4cfcf61d0ca1 100644 (file)
@@ -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,
index 47bac97d85f85d1f03bb469cdaa5ad6447283ae0..03aa75bf0878a13611742e6a60888c1c7b6e8b55 100644 (file)
@@ -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);
 
index 30cabd0edfa0322492d88228016555cffdd3a083..04de10d9443e8eaeb7d776515c511b16a3a496ef 100644 (file)
@@ -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 <linux/string.h>
 #include <linux/init.h>
+#include <linux/ioport.h>
 #include <asm/addrspace.h>
 #include <asm/errno.h>
 #include <asm/dec/machtype.h>
@@ -231,6 +232,6 @@ void __init tc_init(void)
                                        tc_bus[i].name, tc_bus[i].firmware);
                        }
 #endif
+               ioport_resource.end = KSEG2 - 1;
        }
-
 }
index 88af39ec5f7b8d8623f18d7305fcb67a8f7191da..9e3a24dca70f3f0e62388dece3508f9cd734fdd9 100644 (file)
@@ -1,13 +1,14 @@
 /*
- *     Turbo Channel Services -- Exported Symbols
+ *     TURBOchannel Services -- Exported Symbols
  *
  */
 
 #include <linux/module.h>
 #include <asm/dec/tc.h>
 
-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);
index 46f4c152ca9cab30d64d71a98c3fdd6ee6eca060..af219cd5652f2f4d33e6284cb33ff3bcc35b9916 100644 (file)
@@ -42,6 +42,7 @@
 #include <asm/segment.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
+#include <asm/wbflush.h>
 #include <asm/dec/interrupts.h>
 #include <asm/dec/machtype.h>
 #include <asm/dec/tc.h>
@@ -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 */
 
index d45ce05ed1de745fc66159fe0558f1cf0f7f90ae..e10e1c3d2c345b1c716486b5f46672d74d76f50d 100644 (file)
@@ -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;
 };
 
 
index 3f775b726bca4324bf806e661e047b41b46596c3..3d461df5de98c5e26d433b3e6018ec8a4184f1b8 100644 (file)
@@ -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.
  * 
 #include <asm/system.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/newport.h>
+#include <video/newport.h>
 #define INCLUDE_LINUX_LOGO_DATA
 #include <asm/linux_logo.h>
 
+#include <video/font.h>
+
 #define LOGO_W         80
 #define LOGO_H         80
 
-extern unsigned char vga_font[];
+extern struct fbcon_font_desc font_vga_8x16;
+
+#define FONT_DATA ((unsigned char *)font_vga_8x16.data)
+
 extern struct newport_regs *npregs;
 
 static int logo_active;
@@ -148,9 +153,9 @@ void newport_reset (void)
     for(i = 0; i < 128; i++) {
        newport_bfwait();
        if (i == 92 || i == 94)
-           npregs->set.dcbdata0.hwords.s1 = 0xff00;
+           npregs->set.dcbdata0.byshort.s1 = 0xff00;
        else
-           npregs->set.dcbdata0.hwords.s1 = 0x0000;
+           npregs->set.dcbdata0.byshort.s1 = 0x0000;
     }
 
     newport_init_cmap();
@@ -158,10 +163,10 @@ void newport_reset (void)
     /* turn off popup plane */
     npregs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
                            XM9_CRS_CONFIG | NPORT_DMODE_W1);
-    npregs->set.dcbdata0.bytes.b3 &= ~XM9_PUPMODE;
+    npregs->set.dcbdata0.bybytes.b3 &= ~XM9_PUPMODE;
     npregs->set.dcbmode = (DCB_XMAP1 | R_DCB_XMAP9_PROTOCOL |
                            XM9_CRS_CONFIG | NPORT_DMODE_W1);
-    npregs->set.dcbdata0.bytes.b3 &= ~XM9_PUPMODE;
+    npregs->set.dcbdata0.bybytes.b3 &= ~XM9_PUPMODE;
     
     topscan = 0;
     npregs->cset.topscan = 0x3ff;
@@ -187,7 +192,7 @@ void newport_get_screensize(void)
                           NPORT_DMODE_W2 | VC2_PROTOCOL);
     for(i = 0; i < 128; i++) {
        newport_bfwait();
-       linetable[i] = npregs->set.dcbdata0.hwords.s1;
+       linetable[i] = npregs->set.dcbdata0.byshort.s1;
     }
 
     newport_xsize = newport_ysize = 0;
@@ -198,12 +203,12 @@ void newport_get_screensize(void)
                               NPORT_DMODE_W2 | VC2_PROTOCOL);
        do {
            newport_bfwait();
-           treg = npregs->set.dcbdata0.hwords.s1;
+           treg = npregs->set.dcbdata0.byshort.s1;
            if ((treg & 1) == 0)
                cols += (treg >> 7) & 0xfe;
            if ((treg & 0x80) == 0) {
                newport_bfwait();
-               treg = npregs->set.dcbdata0.hwords.s1;
+               treg = npregs->set.dcbdata0.byshort.s1;
            } 
        } while ((treg & 0x8000) == 0);
        if (cols) {
@@ -226,18 +231,18 @@ static void newport_get_revisions(void)
     unsigned int bt445_rev;
     unsigned int bitplanes;
 
-    rex3_rev = npregs->cset.stat & NPORT_STAT_VERS;
+    rex3_rev = npregs->cset.status & NPORT_STAT_VERS;
 
     npregs->set.dcbmode = (DCB_CMAP0 | NCMAP_PROTOCOL |
                            NCMAP_REGADDR_RREG | NPORT_DMODE_W1);
-    tmp = npregs->set.dcbdata0.bytes.b3;
+    tmp = npregs->set.dcbdata0.bybytes.b3;
     cmap_rev = tmp & 7;
     board_rev = (tmp >> 4) & 7;
     bitplanes = ((board_rev > 1) && (tmp & 0x80)) ? 8 : 24; 
 
     npregs->set.dcbmode = (DCB_CMAP1 | NCMAP_PROTOCOL |
                            NCMAP_REGADDR_RREG | NPORT_DMODE_W1);
-    tmp = npregs->set.dcbdata0.bytes.b3;
+    tmp = npregs->set.dcbdata0.bybytes.b3;
     if ((tmp & 7) < cmap_rev)
        cmap_rev = (tmp & 7);
 
@@ -245,14 +250,14 @@ static void newport_get_revisions(void)
 
     npregs->set.dcbmode = (DCB_XMAP0 | R_DCB_XMAP9_PROTOCOL |
                            XM9_CRS_REVISION | NPORT_DMODE_W1);
-    xmap9_rev = npregs->set.dcbdata0.bytes.b3 & 7;
+    xmap9_rev = npregs->set.dcbdata0.bybytes.b3 & 7;
 
     npregs->set.dcbmode = (DCB_BT445 | BT445_PROTOCOL |
                            BT445_CSR_ADDR_REG | NPORT_DMODE_W1);
-    npregs->set.dcbdata0.bytes.b3 = BT445_REVISION_REG;
+    npregs->set.dcbdata0.bybytes.b3 = BT445_REVISION_REG;
     npregs->set.dcbmode = (DCB_BT445 | BT445_PROTOCOL |
                            BT445_CSR_REVISION | NPORT_DMODE_W1);
-    bt445_rev = (npregs->set.dcbdata0.bytes.b3 >> 4) - 0x0a;
+    bt445_rev = (npregs->set.dcbdata0.bybytes.b3 >> 4) - 0x0a;
 
 #define L(a)     (char)('A'+(a))
     printk ("NG1: Revision %d, %d bitplanes, REX3 revision %c, VC2 revision %c, xmap9 revision %c, cmap revision %c, bt445 revision %c\n",
@@ -281,7 +286,7 @@ static const char * __init newport_startup(void)
        return NULL;
     }
 
-    p->set.xstarti = TESTVAL; if(p->set._xstart.i != XSTI_TO_FXSTART(TESTVAL)) {
+    p->set.xstarti = TESTVAL; if(p->set._xstart.word != XSTI_TO_FXSTART(TESTVAL)) {
        return NULL;
     }
 
@@ -325,7 +330,7 @@ static void newport_putc(struct vc_data *vc, int charattr, int ypos, int xpos)
 {
     unsigned char *p;
     
-    p = &vga_font[(charattr & 0xff) << 4];
+    p = &FONT_DATA[(charattr & 0xff) << 4];
     charattr = (charattr >> 8) & 0xff;
     xpos <<= 3;
     ypos <<= 4;
@@ -374,7 +379,7 @@ static void newport_putcs(struct vc_data *vc, const unsigned short *s,
                             NPORT_DMODE0_L32);
     
     for (i = 0; i < count; i++, xpos += 8) {
-       p = &vga_font[(s[i] & 0xff) << 4];
+       p = &FONT_DATA[(s[i] & 0xff) << 4];
 
        newport_wait();
 
index 4d214b025022e420913980c2baf93ca5cdf40129..15552ca660d8ada1cc2675acfebea145cb8a6b66 100644 (file)
@@ -127,7 +127,7 @@ static struct pci_device_id rivafb_pci_tbl[] __devinitdata = {
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_VTNT2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_RIVA_VTNT2 },
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_UVTNT2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_RIVA_VTNT2 },
        { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_ITNT2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_RIVA_ITNT2 },
-       { 0, }, /* terminate list */
+       { 0, } /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, rivafb_pci_tbl);
 
index 567156868b7a789945880ef5e5db05e7758ee071..3cf9e566e4bd7c0d154204045eb9f1fd1173f493 100644 (file)
@@ -729,17 +729,21 @@ static struct file_operations devfsd_fops =
 
 /*  Support functions follow  */
 
+
+/**
+ *     search_for_entry_in_dir - Search for a devfs entry inside another devfs entry.
+ *     @parent:  The parent devfs entry.
+ *     @name:  The name of the entry.
+ *     @namelen:  The number of characters in @name.
+ *     @traverse_symlink:  If %TRUE then the entry is traversed if it is a symlink.
+ *
+ *     Returns a pointer to the entry on success, else %NULL.
+ */
+
 static struct devfs_entry *search_for_entry_in_dir (struct devfs_entry *parent,
                                                    const char *name,
                                                    unsigned int namelen,
                                                    int traverse_symlink)
-/*  [SUMMARY] Search for a devfs entry inside another devfs entry.
-    <parent> The parent devfs entry.
-    <name> The name of the entry.
-    <namelen> The number of characters in <<name>>.
-    <traverse_symlink> If TRUE then the entry is traversed if it is a symlink.
-    [RETURNS] A pointer to the entry on success, else NULL.
-*/
 {
     struct devfs_entry *curr;
 
@@ -783,10 +787,14 @@ static struct devfs_entry *create_entry (struct devfs_entry *parent,
     return new;
 }   /*  End Function create_entry  */
 
+
+/**
+ *     get_root_entry - Get the root devfs entry.
+ *
+ *     Returns the root devfs entry on success, else %NULL.
+ */
+
 static struct devfs_entry *get_root_entry (void)
-/*  [SUMMARY] Get the root devfs entry.
-    [RETURNS] The root devfs entry on success, else NULL.
-*/
 {
     struct devfs_entry *new;
 
@@ -809,23 +817,27 @@ static struct devfs_entry *get_root_entry (void)
     return root_entry;
 }   /*  End Function get_root_entry  */
 
+
+/**
+ *     search_for_entry - Search for an entry in the devfs tree.
+ *     @dir: The parent directory to search from. If this is %NULL the root is used
+ *     @name: The name of the entry.
+ *     @namelen: The number of characters in @name.
+ *     @mkdir: If %TRUE intermediate directories are created as needed.
+ *     @mkfile: If %TRUE the file entry is created if it doesn't exist.
+ *     @is_new: If the returned entry was newly made, %TRUE is written here. If
+ *             this is %NULL nothing is written here.
+ *     @traverse_symlink: If %TRUE then symbolic links are traversed.
+ *
+ *     If the entry is created, then it will be in the unregistered state.
+ *     Returns a pointer to the entry on success, else %NULL.
+ */
+
 static struct devfs_entry *search_for_entry (struct devfs_entry *dir,
                                             const char *name,
                                             unsigned int namelen, int mkdir,
                                             int mkfile, int *is_new,
                                             int traverse_symlink)
-/*  [SUMMARY] Search for an entry in the devfs tree.
-    <dir> The parent directory to search from. If this is NULL the root is used
-    <name> The name of the entry.
-    <namelen> The number of characters in <<name>>.
-    <mkdir> If TRUE intermediate directories are created as needed.
-    <mkfile> If TRUE the file entry is created if it doesn't exist.
-    <is_new> If the returned entry was newly made, TRUE is written here. If
-    this is NULL nothing is written here.
-    <traverse_symlink> If TRUE then symbolic links are traversed.
-    [NOTE] If the entry is created, then it will be in the unregistered state.
-    [RETURNS] A pointer to the entry on success, else NULL.
-*/
 {
     int len;
     const char *subname, *stop, *ptr;
@@ -887,16 +899,20 @@ static struct devfs_entry *search_for_entry (struct devfs_entry *dir,
     return NULL;
 }   /*  End Function search_for_entry  */
 
+
+/**
+ *     find_by_dev - Find a devfs entry in a directory.
+ *     @major: The major number to search for.
+ *     @minor: The minor number to search for.
+ *     @type: The type of special file to search for. This may be either
+ *             %DEVFS_SPECIAL_CHR or %DEVFS_SPECIAL_BLK.
+ *
+ *     Returns the devfs_entry pointer on success, else %NULL.
+ */
+
 static struct devfs_entry *find_by_dev (struct devfs_entry *dir,
                                        unsigned int major, unsigned int minor,
                                        char type)
-/*  [SUMMARY] Find a devfs entry in a directory.
-    <major> The major number to search for.
-    <minor> The minor number to search for.
-    <type> The type of special file to search for. This may be either
-    DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK.
-    [RETURNS] The devfs_entry pointer on success, else NULL.
-*/
 {
     struct devfs_entry *entry, *de;
 
@@ -926,26 +942,31 @@ static struct devfs_entry *find_by_dev (struct devfs_entry *dir,
     return NULL;
 }   /*  End Function find_by_dev  */
 
+
+/**
+ *     find_entry - Find a devfs entry.
+ *     @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ *             name is relative to the root of the devfs.
+ *     @name: The name of the entry. This is ignored if @handle is not %NULL.
+ *     @namelen: The number of characters in @name, not including a %NULL
+ *             terminator. If this is 0, then @name must be %NULL-terminated and the
+ *             length is computed internally.
+ *     @major: The major number. This is used if @handle and @name are %NULL.
+ *     @minor: The minor number. This is used if @handle and @name are %NULL.
+ *             NOTE: If @major and @minor are both 0, searching by major and minor
+ *             numbers is disabled.
+ *     @type: The type of special file to search for. This may be either
+ *             %DEVFS_SPECIAL_CHR or %DEVFS_SPECIAL_BLK.
+ *     @traverse_symlink: If %TRUE then symbolic links are traversed.
+ *
+ *     FIXME: What the hell is @handle? - ch
+ *     Returns the devfs_entry pointer on success, else %NULL.
+ */
+
 static struct devfs_entry *find_entry (devfs_handle_t dir,
                                       const char *name, unsigned int namelen,
                                       unsigned int major, unsigned int minor,
                                       char type, int traverse_symlink)
-/*  [SUMMARY] Find a devfs entry.
-    <dir> The handle to the parent devfs directory entry. If this is NULL the
-    name is relative to the root of the devfs.
-    <name> The name of the entry. This is ignored if <<handle>> is not NULL.
-    <namelen> The number of characters in <<name>>, not including a NULL
-    terminator. If this is 0, then <<name>> must be NULL-terminated and the
-    length is computed internally.
-    <major> The major number. This is used if <<handle>> and <<name>> are NULL.
-    <minor> The minor number. This is used if <<handle>> and <<name>> are NULL.
-    [NOTE] If <<major>> and <<minor>> are both 0, searching by major and minor
-    numbers is disabled.
-    <type> The type of special file to search for. This may be either
-    DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK.
-    <traverse_symlink> If TRUE then symbolic links are traversed.
-    [RETURNS] The devfs_entry pointer on success, else NULL.
-*/
 {
     struct devfs_entry *entry;
 
@@ -991,11 +1012,13 @@ static struct devfs_inode *get_devfs_inode_from_vfs_inode (struct inode *inode)
     return fs_info->table[inode->i_ino - FIRST_INODE];
 }   /*  End Function get_devfs_inode_from_vfs_inode  */
 
+
+/**
+ *     free_dentries - Free the dentries for a device entry and invalidate inodes.
+ *     @de: The entry.
+ */
+
 static void free_dentries (struct devfs_entry *de)
-/*  [SUMMARY] Free the dentries for a device entry and invalidate inodes.
-    <de> The entry.
-    [RETURNS] Nothing.
-*/
 {
     struct devfs_inode *di;
     struct dentry *dentry;
@@ -1015,11 +1038,15 @@ static void free_dentries (struct devfs_entry *de)
     }
 }   /*  End Function free_dentries  */
 
+
+/**
+ *     is_devfsd_or_child - Test if the current process is devfsd or one of its children.
+ *     fs_info: The filesystem information.
+ *
+ *     Returns %TRUE if devfsd or child, else %FALSE.
+ */
+
 static int is_devfsd_or_child (struct fs_info *fs_info)
-/*  [SUMMARY] Test if the current process is devfsd or one of its children.
-    <fs_info> The filesystem information.
-    [RETURNS] TRUE if devfsd or child, else FALSE.
-*/
 {
     struct task_struct *p;
 
@@ -1030,20 +1057,28 @@ static int is_devfsd_or_child (struct fs_info *fs_info)
     return (FALSE);
 }   /*  End Function is_devfsd_or_child  */
 
+
+/**
+ *     devfsd_queue_empty - Test if devfsd has work pending in its event queue.
+ *     @fs_info: The filesystem information.
+ *
+ *     Returns %TRUE if the queue is empty, else %FALSE.
+ */
+
 static inline int devfsd_queue_empty (struct fs_info *fs_info)
-/*  [SUMMARY] Test if devfsd has work pending in its event queue.
-    <fs_info> The filesystem information.
-    [RETURNS] TRUE if the queue is empty, else FALSE.
-*/
 {
     return (fs_info->devfsd_buf_out == fs_info->devfsd_buf_in) ? TRUE : FALSE;
 }   /*  End Function devfsd_queue_empty  */
 
+
+/**
+ *     wait_for_devfsd_finished - Wait for devfsd to finish processing its event queue.
+ *     @fs_info: The filesystem information.
+ *
+ *     Returns %TRUE if no more waiting will be required, else %FALSE.
+ */
+
 static int wait_for_devfsd_finished (struct fs_info *fs_info)
-/*  [SUMMARY] Wait for devfsd to finish processing its event queue.
-    <fs_info> The filesystem information.
-    [RETURNS] TRUE if no more waiting will be required, else FALSE.
-*/
 {
     DECLARE_WAITQUEUE (wait, current);
 
@@ -1059,17 +1094,21 @@ static int wait_for_devfsd_finished (struct fs_info *fs_info)
     return (TRUE);
 }   /*  End Function wait_for_devfsd_finished  */
 
+
+/**
+ *     devfsd_notify_one - Notify a single devfsd daemon of a change.
+ *     @data: Data to be passed.
+ *     @type: The type of change.
+ *     @mode: The mode of the entry.
+ *     @uid: The user ID.
+ *     @gid: The group ID.
+ *     @fs_info: The filesystem info.
+ *
+ *     Returns %TRUE if an event was queued and devfsd woken up, else %FALSE.
+ */
+
 static int devfsd_notify_one (void *data, unsigned int type, umode_t mode,
                              uid_t uid, gid_t gid, struct fs_info *fs_info)
-/*  [SUMMARY] Notify a single devfsd daemon of a change.
-    <data> Data to be passed.
-    <type> The type of change.
-    <mode> The mode of the entry.
-    <uid> The user ID.
-    <gid> The group ID.
-    <fs_info> The filesystem info.
-    [RETURNS] TRUE if an event was queued and devfsd woken up, else FALSE.
-*/
 {
     unsigned int next_pos;
     unsigned long flags;
@@ -1103,14 +1142,16 @@ static int devfsd_notify_one (void *data, unsigned int type, umode_t mode,
     return (TRUE);
 }   /*  End Function devfsd_notify_one  */
 
+
+/**
+ *     devfsd_notify - Notify all devfsd daemons of a change.
+ *     @de: The devfs entry that has changed.
+ *     @type: The type of change event.
+ *     @wait: If TRUE, the functions waits for all daemons to finish processing
+ *             the event.
+ */
+
 static void devfsd_notify (struct devfs_entry *de, unsigned int type, int wait)
-/*  [SUMMARY] Notify all devfsd daemons of a change.
-    <de> The devfs entry that has changed.
-    <type> The type of change event.
-    <wait> If TRUE, the functions waits for all daemons to finish processing
-    the event.
-    [RETURNS] Nothing.
-*/
 {
     struct fs_info *fs_info;
 
@@ -1122,35 +1163,38 @@ static void devfsd_notify (struct devfs_entry *de, unsigned int type, int wait)
     }
 }   /*  End Function devfsd_notify  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_register - Register a device entry.
+ *     @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ *             new name is relative to the root of the devfs.
+ *     @name: The name of the entry.
+ *     @namelen: The number of characters in @name, not including a %NULL
+ *             terminator. If this is 0, then @name must be %NULL-terminated and the
+ *             length is computed internally.
+ *     @flags: A set of bitwise-ORed flags (DEVFS_FL_*).
+ *     @major: The major number. Not needed for regular files.
+ *     @minor: The minor number. Not needed for regular files.
+ *     @mode: The default file mode.
+ *     @uid: The default UID of the file.
+ *     @guid: The default GID of the file.
+ *     @ops: The &file_operations or &block_device_operations structure.
+ *             This must not be externally deallocated.
+ *     @info: An arbitrary pointer which will be written to the @private_data
+ *             field of the &file structure passed to the device driver. You can set
+ *             this to whatever you like, and change it once the file is opened (the next
+ *             file opened will not see this change).
+ *
+ *     Returns a handle which may later be used in a call to devfs_unregister().
+ *     On failure %NULL is returned.
+ */
+
 devfs_handle_t devfs_register (devfs_handle_t dir,
                               const char *name, unsigned int namelen,
                               unsigned int flags,
                               unsigned int major, unsigned int minor,
                               umode_t mode, uid_t uid, gid_t gid,
                               void *ops, void *info)
-/*  [SUMMARY] Register a device entry.
-    <dir> The handle to the parent devfs directory entry. If this is NULL the
-    new name is relative to the root of the devfs.
-    <name> The name of the entry.
-    <namelen> The number of characters in <<name>>, not including a NULL
-    terminator. If this is 0, then <<name>> must be NULL-terminated and the
-    length is computed internally.
-    <flags> A set of bitwise-ORed flags (DEVFS_FL_*).
-    <major> The major number. Not needed for regular files.
-    <minor> The minor number. Not needed for regular files.
-    <mode> The default file mode.
-    <uid> The default UID of the file.
-    <guid> The default GID of the file.
-    <ops> The <<file_operations>> or <<block_device_operations>> structure.
-    This must not be externally deallocated.
-    <info> An arbitrary pointer which will be written to the <<private_data>>
-    field of the <<file>> structure passed to the device driver. You can set
-    this to whatever you like, and change it once the file is opened (the next
-    file opened will not see this change).
-    [RETURNS] A handle which may later be used in a call to
-    [<devfs_unregister>]. On failure NULL is returned.
-*/
 {
     int is_new;
     struct devfs_entry *de;
@@ -1276,11 +1320,13 @@ devfs_handle_t devfs_register (devfs_handle_t dir,
     return de;
 }   /*  End Function devfs_register  */
 
+
+/**
+ *     unregister - Unregister a device entry.
+ *     @de: The entry to unregister.
+ */
+
 static void unregister (struct devfs_entry *de)
-/*  [SUMMARY] Unregister a device entry.
-    <de> The entry to unregister.
-    [RETURNS] Nothing.
-*/
 {
     struct devfs_entry *child;
 
@@ -1332,13 +1378,14 @@ static void unregister (struct devfs_entry *de)
     }
 }   /*  End Function unregister  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_unregister - Unregister a device entry.
+ *     de: A handle previously created by devfs_register() or returned from
+ *             devfs_find_handle(). If this is %NULL the routine does nothing.
+ */
+
 void devfs_unregister (devfs_handle_t de)
-/*  [SUMMARY] Unregister a device entry.
-    <de> A handle previously created by [<devfs_register>] or returned from
-    [<devfs_find_handle>]. If this is NULL the routine does nothing.
-    [RETURNS] Nothing.
-*/
 {
     if (de == NULL) return;
 #ifdef CONFIG_DEVFS_DEBUG
@@ -1349,28 +1396,31 @@ void devfs_unregister (devfs_handle_t de)
     unregister (de);
 }   /*  End Function devfs_unregister  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_mk_symlink Create a symbolic link in the devfs namespace.
+ *     @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ *             new name is relative to the root of the devfs.
+ *     @name: The name of the entry.
+ *     @namelen: The number of characters in @name, not including a %NULL
+ *             terminator. If this is 0, then @name must be %NULL-terminated and the
+ *             length is computed internally.
+ *     @flags: A set of bitwise-ORed flags (DEVFS_FL_*).
+ *     @link: The destination name.
+ *     @linklength: The number of characters in @link, not including a %NULL
+ *             terminator. If this is 0, then @link must be %NULL-terminated and the
+ *             length is computed internally.
+ *     @handle: The handle to the symlink entry is written here. This may be %NULL.
+ *     @info: An arbitrary pointer which will be associated with the entry.
+ *
+ *     Returns 0 on success, else a negative error code is returned.
+ */
+
 int devfs_mk_symlink (devfs_handle_t dir,
                      const char *name, unsigned int namelen,
                      unsigned int flags,
                      const char *link, unsigned int linklength,
                      devfs_handle_t *handle, void *info)
-/*  [SUMMARY] Create a symbolic link in the devfs namespace.
-    <dir> The handle to the parent devfs directory entry. If this is NULL the
-    new name is relative to the root of the devfs.
-    <name> The name of the entry.
-    <namelen> The number of characters in <<name>>, not including a NULL
-    terminator. If this is 0, then <<name>> must be NULL-terminated and the
-    length is computed internally.
-    <flags> A set of bitwise-ORed flags (DEVFS_FL_*).
-    <link> The destination name.
-    <linklength> The number of characters in <<link>>, not including a NULL
-    terminator. If this is 0, then <<link>> must be NULL-terminated and the
-    length is computed internally.
-    <handle> The handle to the symlink entry is written here. This may be NULL.
-    <info> An arbitrary pointer which will be associated with the entry.
-    [RETURNS] 0 on success, else a negative error code is returned.
-*/
 {
     int is_new;
     char *newname;
@@ -1439,23 +1489,26 @@ int devfs_mk_symlink (devfs_handle_t dir,
     return 0;
 }   /*  End Function devfs_mk_symlink  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_mk_dir - Create a directory in the devfs namespace.
+ *     @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ *             new name is relative to the root of the devfs.
+ *     @name: The name of the entry.
+ *     @namelen: The number of characters in @name, not including a %NULL
+ *             terminator. If this is 0, then @name must be %NULL-terminated and the
+ *             length is computed internally.
+ *     @info: An arbitrary pointer which will be associated with the entry.
+ *
+ *     Use of this function is optional. The devfs_register() function
+ *     will automatically create intermediate directories as needed. This function
+ *     is provided for efficiency reasons, as it provides a handle to a directory.
+ *     Returns a handle which may later be used in a call to devfs_unregister().
+ *     On failure %NULL is returned.
+ */
+
 devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name,
                             unsigned int namelen, void *info)
-/*  [SUMMARY] Create a directory in the devfs namespace.
-    <dir> The handle to the parent devfs directory entry. If this is NULL the
-    new name is relative to the root of the devfs.
-    <name> The name of the entry.
-    <namelen> The number of characters in <<name>>, not including a NULL
-    terminator. If this is 0, then <<name>> must be NULL-terminated and the
-    length is computed internally.
-    <info> An arbitrary pointer which will be associated with the entry.
-    [NOTE] Use of this function is optional. The [<devfs_register>] function
-    will automatically create intermediate directories as needed. This function
-    is provided for efficiency reasons, as it provides a handle to a directory.
-    [RETURNS] A handle which may later be used in a call to
-    [<devfs_unregister>]. On failure NULL is returned.
-*/
 {
     int is_new;
     struct devfs_entry *de;
@@ -1499,29 +1552,31 @@ devfs_handle_t devfs_mk_dir (devfs_handle_t dir, const char *name,
     return de;
 }   /*  End Function devfs_mk_dir  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_find_handle - Find the handle of a devfs entry.
+ *     @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ *             name is relative to the root of the devfs.
+ *     @name: The name of the entry.
+ *     @namelen: The number of characters in @name, not including a %NULL
+ *             terminator. If this is 0, then @name must be %NULL-terminated and the
+ *             length is computed internally.
+ *     @major: The major number. This is used if @name is %NULL.
+ *     @minor: The minor number. This is used if @name is %NULL.
+ *     @type: The type of special file to search for. This may be either
+ *             %DEVFS_SPECIAL_CHR or %DEVFS_SPECIAL_BLK.
+ *     @traverse_symlinks: If %TRUE then symlink entries in the devfs namespace are
+ *             traversed. Symlinks pointing out of the devfs namespace will cause a
+ *             failure. Symlink traversal consumes stack space.
+ *
+ *     Returns a handle which may later be used in a call to devfs_unregister(),
+ *     devfs_get_flags(), or devfs_set_flags(). On failure %NULL is returned.
+ */
+
 devfs_handle_t devfs_find_handle (devfs_handle_t dir,
                                  const char *name, unsigned int namelen,
                                  unsigned int major, unsigned int minor,
                                  char type, int traverse_symlinks)
-/*  [SUMMARY] Find the handle of a devfs entry.
-    <dir> The handle to the parent devfs directory entry. If this is NULL the
-    name is relative to the root of the devfs.
-    <name> The name of the entry.
-    <namelen> The number of characters in <<name>>, not including a NULL
-    terminator. If this is 0, then <<name>> must be NULL-terminated and the
-    length is computed internally.
-    <major> The major number. This is used if <<name>> is NULL.
-    <minor> The minor number. This is used if <<name>> is NULL.
-    <type> The type of special file to search for. This may be either
-    DEVFS_SPECIAL_CHR or DEVFS_SPECIAL_BLK.
-    <traverse_symlinks> If TRUE then symlink entries in the devfs namespace are
-    traversed. Symlinks pointing out of the devfs namespace will cause a
-    failure. Symlink traversal consumes stack space.
-    [RETURNS] A handle which may later be used in a call to
-    [<devfs_unregister>], [<devfs_get_flags>], or [<devfs_set_flags>].
-    On failure NULL is returned.
-*/
 {
     devfs_handle_t de;
 
@@ -1533,13 +1588,16 @@ devfs_handle_t devfs_find_handle (devfs_handle_t dir,
     return de;
 }   /*  End Function devfs_find_handle  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_flags - Get the flags for a devfs entry.
+ *     @de: The handle to the device entry.
+ *     @flags: The flags are written here.
+ *
+ *     Returns 0 on success, else a negative error code.
+ */
+
 int devfs_get_flags (devfs_handle_t de, unsigned int *flags)
-/*  [SUMMARY] Get the flags for a devfs entry.
-    <de> The handle to the device entry.
-    <flags> The flags are written here.
-    [RETURNS] 0 on success, else a negative error code.
-*/
 {
     unsigned int fl = 0;
 
@@ -1557,13 +1615,16 @@ int devfs_get_flags (devfs_handle_t de, unsigned int *flags)
     return 0;
 }   /*  End Function devfs_get_flags  */
 
-/*PUBLIC_FUNCTION*/
+
+/*
+ *     devfs_set_flags - Set the flags for a devfs entry.
+ *     @de: The handle to the device entry.
+ *     @flags: The flags to set. Unset flags are cleared.
+ *
+ *     Returns 0 on success, else a negative error code.
+ */
+
 int devfs_set_flags (devfs_handle_t de, unsigned int flags)
-/*  [SUMMARY] Set the flags for a devfs entry.
-    <de> The handle to the device entry.
-    <flags> The flags to set. Unset flags are cleared.
-    [RETURNS] 0 on success, else a negative error code.
-*/
 {
     if (de == NULL) return -EINVAL;
     if (!de->registered) return -ENODEV;
@@ -1592,15 +1653,18 @@ int devfs_set_flags (devfs_handle_t de, unsigned int flags)
     return 0;
 }   /*  End Function devfs_set_flags  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_maj_min - Get the major and minor numbers for a devfs entry.
+ *     @de: The handle to the device entry.
+ *     @major: The major number is written here. This may be %NULL.
+ *     @minor: The minor number is written here. This may be %NULL.
+ *
+ *     Returns 0 on success, else a negative error code.
+ */
+
 int devfs_get_maj_min (devfs_handle_t de, unsigned int *major,
                       unsigned int *minor)
-/*  [SUMMARY] Get the major and minor numbers for a devfs entry.
-    <de> The handle to the device entry.
-    <major> The major number is written here. This may be NULL.
-    <minor> The minor number is written here. This may be NULL.
-    [RETURNS] 0 on success, else a negative error code.
-*/
 {
     if (de == NULL) return -EINVAL;
     if (!de->registered) return -ENODEV;
@@ -1611,12 +1675,15 @@ int devfs_get_maj_min (devfs_handle_t de, unsigned int *major,
     return 0;
 }   /*  End Function devfs_get_maj_min  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_handle_from_inode - Get the devfs handle for a VFS inode.
+ *     @inode: The VFS inode.
+ *
+ *     Returns the devfs handle on success, else %NULL.
+ */
+
 devfs_handle_t devfs_get_handle_from_inode (struct inode *inode)
-/*  [SUMMARY] Get the devfs handle for a VFS inode.
-    <inode> The VFS inode.
-    [RETURNS] The devfs handle on success, else NULL.
-*/
 {
     struct devfs_inode *di;
 
@@ -1627,16 +1694,19 @@ devfs_handle_t devfs_get_handle_from_inode (struct inode *inode)
     return di->de;
 }   /*  End Function devfs_get_handle_from_inode  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_generate_path - Generate a pathname for an entry, relative to the devfs root.
+ *     @de: The devfs entry.
+ *     @path: The buffer to write the pathname to. The pathname and '\0'
+ *             terminator will be written at the end of the buffer.
+ *     @buflen: The length of the buffer.
+ *
+ *     Returns the offset in the buffer where the pathname starts on success,
+ *     else a negative error code.
+ */
+
 int devfs_generate_path (devfs_handle_t de, char *path, int buflen)
-/*  [SUMMARY] Generate a pathname for an entry, relative to the devfs root.
-    <de> The devfs entry.
-    <path> The buffer to write the pathname to. The pathname and '\0'
-    terminator will be written at the end of the buffer.
-    <buflen> The length of the buffer.
-    [RETURNS] The offset in the buffer where the pathname starts on success,
-    else a negative error code.
-*/
 {
     int pos;
 
@@ -1656,12 +1726,15 @@ int devfs_generate_path (devfs_handle_t de, char *path, int buflen)
     return pos;
 }   /*  End Function devfs_generate_path  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_ops - Get the device operations for a devfs entry.
+ *     @de: The handle to the device entry.
+ *
+ *     Returns a pointer to the device operations on success, else NULL.
+ */
+
 void *devfs_get_ops (devfs_handle_t de)
-/*  [SUMMARY] Get the device operations for a devfs entry.
-    <de> The handle to the device entry.
-    [RETURNS] A pointer to the device operations on success, else NULL.
-*/
 {
     if (de == NULL) return NULL;
     if (!de->registered) return NULL;
@@ -1670,13 +1743,16 @@ void *devfs_get_ops (devfs_handle_t de)
     return NULL;
 }   /*  End Function devfs_get_ops  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_set_file_size - Set the file size for a devfs regular file.
+ *     de: The handle to the device entry.
+ *     size: The new file size.
+ *
+ *     Returns 0 on success, else a negative error code.
+ */
+
 int devfs_set_file_size (devfs_handle_t de, unsigned long size)
-/*  [SUMMARY] Set the file size for a devfs regular file.
-    <de> The handle to the device entry.
-    <size> The new file size.
-    [RETURNS] 0 on success, else a negative error code.
-*/
 {
     struct devfs_inode *di;
 
@@ -1694,24 +1770,28 @@ int devfs_set_file_size (devfs_handle_t de, unsigned long size)
     return 0;
 }   /*  End Function devfs_set_file_size  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_info - Get the info pointer written to private_data of @de upon open.
+ *     @de: The handle to the device entry.
+ *
+ *     Returns the info pointer.
+ */
 void *devfs_get_info (devfs_handle_t de)
-/*  [SUMMARY] Get the info pointer written to <<private_data>> upon open.
-    <de> The handle to the device entry.
-    [RETURNS] The info pointer.
-*/
 {
     if (de == NULL) return NULL;
     if (!de->registered) return NULL;
     return de->info;
 }   /*  End Function devfs_get_info  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_set_info - Set the info pointer written to private_data upon open.
+ *     @de: The handle to the device entry.
+ *
+ *     Returns 0 on success, else a negative error code.
+ */
 int devfs_set_info (devfs_handle_t de, void *info)
-/*  [SUMMARY] Set the info pointer written to <<private_data>> upon open.
-    <de> The handle to the device entry.
-    [RETURNS] 0 on success, else a negative error code.
-*/
 {
     if (de == NULL) return -EINVAL;
     if (!de->registered) return -EINVAL;
@@ -1719,24 +1799,29 @@ int devfs_set_info (devfs_handle_t de, void *info)
     return 0;
 }   /*  End Function devfs_set_info  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_parent - Get the parent device entry.
+ *     @de: The handle to the device entry.
+ *
+ *     Returns the parent device entry if it exists, else %NULL.
+ */
 devfs_handle_t devfs_get_parent (devfs_handle_t de)
-/*  [SUMMARY] Get the parent device entry.
-    <de> The handle to the device entry.
-    [RETURNS] The parent device entry if it exists, else NULL.
-*/
 {
     if (de == NULL) return NULL;
     if (!de->registered) return NULL;
     return de->parent;
 }   /*  End Function devfs_get_parent  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_first_child - Get the first leaf node in a directory.
+ *     @de: The handle to the device entry.
+ *
+ *     Returns the leaf node device entry if it exists, else %NULL.
+ */
+
 devfs_handle_t devfs_get_first_child (devfs_handle_t de)
-/*  [SUMMARY] Get the first leaf node in a directory.
-    <de> The handle to the device entry.
-    [RETURNS] The leaf node device entry if it exists, else NULL.
-*/
 {
     if (de == NULL) return NULL;
     if (!de->registered) return NULL;
@@ -1744,27 +1829,31 @@ devfs_handle_t devfs_get_first_child (devfs_handle_t de)
     return de->u.dir.first;
 }   /*  End Function devfs_get_first_child  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_next_sibling - Get the next sibling leaf node. for a device entry.
+ *     @de: The handle to the device entry.
+ *
+ *     Returns the leaf node device entry if it exists, else %NULL.
+ */
+
 devfs_handle_t devfs_get_next_sibling (devfs_handle_t de)
-/*  [SUMMARY] Get the next sibling leaf node. for a device entry.
-    <de> The handle to the device entry.
-    [RETURNS] The leaf node device entry if it exists, else NULL.
-*/
 {
     if (de == NULL) return NULL;
     if (!de->registered) return NULL;
     return de->next;
 }   /*  End Function devfs_get_next_sibling  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_auto_unregister - Configure a devfs entry to be automatically unregistered.
+ *     @master: The master devfs entry. Only one slave may be registered.
+ *     @slave: The devfs entry which will be automatically unregistered when the
+ *             master entry is unregistered. It is illegal to call devfs_unregister()
+ *             on this entry.
+ */
+
 void devfs_auto_unregister (devfs_handle_t master, devfs_handle_t slave)
-/*  [SUMMARY] Configure a devfs entry to be automatically unregistered.
-    <master> The master devfs entry. Only one slave may be registered.
-    <slave> The devfs entry which will be automatically unregistered when the
-    master entry is unregistered. It is illegal to call [<devfs_unregister>] on
-    this entry.
-    [RETURNS] Nothing.
-*/
 {
     if (master == NULL) return;
     if (master->slave != NULL)
@@ -1779,25 +1868,30 @@ void devfs_auto_unregister (devfs_handle_t master, devfs_handle_t slave)
     master->slave = slave;
 }   /*  End Function devfs_auto_unregister  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_unregister_slave - Get the slave entry which will be automatically unregistered.
+ *     @master: The master devfs entry.
+ *
+ *     Returns the slave which will be unregistered when @master is unregistered.
+ */
+
 devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master)
-/*  [SUMMARY] Get the slave entry which will be automatically unregistered.
-    <master> The master devfs entry.
-    [RETURNS] The slave which will be unregistered when <<master>> is
-    unregistered.
-*/
 {
     if (master == NULL) return NULL;
     return master->slave;
 }   /*  End Function devfs_get_unregister_slave  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_get_name - Get the name for a device entry in its parent directory.
+ *     @de: The handle to the device entry.
+ *     @namelen: The length of the name is written here. This may be %NULL.
+ *
+ *     Returns the name on success, else %NULL.
+ */
+
 const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen)
-/*  [SUMMARY] Get the name for a device entry in its parent directory.
-    <de> The handle to the device entry.
-    <namelen> The length of the name is written here. This may be NULL.
-    [RETURNS] The name on success, else NULL.
-*/
 {
     if (de == NULL) return NULL;
     if (!de->registered) return NULL;
@@ -1805,61 +1899,73 @@ const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen)
     return de->name;
 }   /*  End Function devfs_get_name  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_register_chrdev - Optionally register a conventional character driver.
+ *     @major: The major number for the driver.
+ *     @name: The name of the driver (as seen in /proc/devices).
+ *     @fops: The &file_operations structure pointer.
+ *
+ *     This function will register a character driver provided the "devfs=only"
+ *     option was not provided at boot time.
+ *     Returns 0 on success, else a negative error code on failure.
+ */
+
 int devfs_register_chrdev (unsigned int major, const char *name,
                           struct file_operations *fops)
-/*  [SUMMARY] Optionally register a conventional character driver.
-    [PURPOSE] This function will register a character driver provided the
-    "devfs=only" option was not provided at boot time.
-    <major> The major number for the driver.
-    <name> The name of the driver (as seen in /proc/devices).
-    <fops> The file_operations structure pointer.
-    [RETURNS] 0 on success, else a negative error code on failure.
-*/
 {
     if (boot_options & OPTION_ONLY) return 0;
     return register_chrdev (major, name, fops);
 }   /*  End Function devfs_register_chrdev  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_register_blkdev - Optionally register a conventional block driver.
+ *     @major: The major number for the driver.
+ *     @name: The name of the driver (as seen in /proc/devices).
+ *     @bdops: The &block_device_operations structure pointer.
+ *
+ *     This function will register a block driver provided the "devfs=only"
+ *     option was not provided at boot time.
+ *     Returns 0 on success, else a negative error code on failure.
+ */
+
 int devfs_register_blkdev (unsigned int major, const char *name,
                           struct block_device_operations *bdops)
-/*  [SUMMARY] Optionally register a conventional block driver.
-    [PURPOSE] This function will register a block driver provided the
-    "devfs=only" option was not provided at boot time.
-    <major> The major number for the driver.
-    <name> The name of the driver (as seen in /proc/devices).
-    <bdops> The block_device_operations structure pointer.
-    [RETURNS] 0 on success, else a negative error code on failure.
-*/
 {
     if (boot_options & OPTION_ONLY) return 0;
     return register_blkdev (major, name, bdops);
 }   /*  End Function devfs_register_blkdev  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_unregister_chrdev - Optionally unregister a conventional character driver.
+ *     major: The major number for the driver.
+ *     name: The name of the driver (as seen in /proc/devices).
+ *
+ *     This function will unregister a character driver provided the "devfs=only"
+ *     option was not provided at boot time.
+ *     Returns 0 on success, else a negative error code on failure.
+ */
+
 int devfs_unregister_chrdev (unsigned int major, const char *name)
-/*  [SUMMARY] Optionally unregister a conventional character driver.
-    [PURPOSE] This function will unregister a character driver provided the
-    "devfs=only" option was not provided at boot time.
-    <major> The major number for the driver.
-    <name> The name of the driver (as seen in /proc/devices).
-    [RETURNS] 0 on success, else a negative error code on failure.
-*/
 {
     if (boot_options & OPTION_ONLY) return 0;
     return unregister_chrdev (major, name);
 }   /*  End Function devfs_unregister_chrdev  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_unregister_blkdev - Optionally unregister a conventional block driver.
+ *     @major: The major number for the driver.
+ *     @name: The name of the driver (as seen in /proc/devices).
+ *
+ *     This function will unregister a block driver provided the "devfs=only"
+ *     option was not provided at boot time.
+ *     Returns 0 on success, else a negative error code on failure.
+ */
+
 int devfs_unregister_blkdev (unsigned int major, const char *name)
-/*  [SUMMARY] Optionally unregister a conventional block driver.
-    [PURPOSE] This function will unregister a block driver provided the
-    "devfs=only" option was not provided at boot time.
-    <major> The major number for the driver.
-    <name> The name of the driver (as seen in /proc/devices).
-    [RETURNS] 0 on success, else a negative error code on failure.
-*/
 {
     if (boot_options & OPTION_ONLY) return 0;
     return unregister_blkdev (major, name);
@@ -1867,13 +1973,13 @@ int devfs_unregister_blkdev (unsigned int major, const char *name)
 
 #ifndef MODULE
 
-/*UNPUBLISHED_FUNCTION*/
+/**
+ *     devfs_setup - Process kernel boot options.
+ *     @str: The boot options after the "devfs=".
+ *     @unused: Unused.
+ */
+
 SETUP_STATIC int __init devfs_setup (char *str)
-/*  [SUMMARY] Process kernel boot options.
-    <str> The boot options after the "devfs=".
-    <unused> Unused.
-    [RETURNS] Nothing.
-*/
 {
     while ( (*str != '\0') && !isspace (*str) )
     {
@@ -2027,13 +2133,17 @@ static void update_devfs_inode_from_entry (struct devfs_inode *di)
     }
 }   /*  End Function update_devfs_inode_from_entry  */
 
+
+/**
+ *     create_devfs_inode - Create a devfs inode entry.
+ *     @de: The devfs entry to associate the new inode with.
+ *     @fs_info: The FS info.
+ *
+ *     Returns a pointer to the devfs inode on success, else %NULL.
+ */
+
 static struct devfs_inode *create_devfs_inode (struct devfs_entry *de,
                                               struct fs_info *fs_info)
-/*  [SUMMARY] Create a devfs inode entry.
-    <de> The devfs entry to associate the new inode with.
-    <fs_info> The FS info.
-    [RETURNS] A pointer to the devfs inode on success, else NULL.
-*/
 {
     struct devfs_inode *di, **table;
 
@@ -2077,18 +2187,22 @@ static struct devfs_inode *create_devfs_inode (struct devfs_entry *de,
     return di;
 }   /*  End Function create_devfs_inode  */
 
+
+/**
+ *     try_modload - Notify devfsd of an inode lookup.
+ *     @parent: The parent devfs entry.
+ *     @fs_info: The filesystem info.
+ *     @name: The device name.
+ *     @namelen: The number of characters in @name.
+ *     @buf: A working area that will be used. This must not go out of scope until
+ *             devfsd is idle again.
+ *
+ *     Returns 0 on success, else a negative error code.
+ */
+
 static int try_modload (struct devfs_entry *parent, struct fs_info *fs_info,
                        const char *name, unsigned namelen,
                        char buf[STRING_LENGTH])
-/*  [SUMMARY] Notify devfsd of an inode lookup.
-    <parent> The parent devfs entry.
-    <fs_info> The filesystem info.
-    <name> The device name.
-    <namelen> The number of characters in <<name>>.
-    <buf> A working area that will be used. This must not go out of scope until
-    devfsd is idle again.
-    [RETURNS] 0 on success, else a negative error code.
-*/
 {
     int pos;
 
@@ -2136,11 +2250,15 @@ static void delete_fs (struct fs_info *fs_info)
     kfree (fs_info);
 }   /*  End Function delete_fs  */
 
+
+/**
+ *     check_disc_changed - Check if a removable disc was changed.
+ *     @de: The device.
+ *
+ *     Returns 1 if the media was changed, else 0.
+ */
+
 static int check_disc_changed (struct devfs_entry *de)
-/*  [SUMMARY] Check if a removable disc was changed.
-    <de> The device.
-    [RETURNS] 1 if the media was changed, else 0.
-*/
 {
     int tmp;
     kdev_t dev = MKDEV (de->u.fcb.u.device.major, de->u.fcb.u.device.minor);
@@ -2166,11 +2284,13 @@ static int check_disc_changed (struct devfs_entry *de)
     return 1;
 }   /*  End Function check_disc_changed  */
 
+
+/**
+ *     scan_dir_for_removable - Scan a directory for removable media devices and check media.
+ *     @dir: The directory.
+ */
+
 static void scan_dir_for_removable (struct devfs_entry *dir)
-/*  [SUMMARY] Scan a directory for removable media devices and check media.
-    <dir> The directory.
-    [RETURNS] Nothing.
-*/
 {
     struct devfs_entry *de;
 
@@ -2184,14 +2304,17 @@ static void scan_dir_for_removable (struct devfs_entry *dir)
     }
 }   /*  End Function scan_dir_for_removable  */
 
+/**
+ *     get_removable_partition - Get removable media partition.
+ *     @dir: The parent directory.
+ *     @name: The name of the entry.
+ *     @namelen: The number of characters in <<name>>.
+ *
+ *     Returns 1 if the media was changed, else 0.
+ */
+
 static int get_removable_partition (struct devfs_entry *dir, const char *name,
                                    unsigned int namelen)
-/*  [SUMMARY] Get removable media partition.
-    <dir> The parent directory.
-    <name> The name of the entry.
-    <namelen> The number of characters in <<name>>.
-    [RETURNS] 1 if the media was changed, else 0.
-*/
 {
     struct devfs_entry *de;
 
@@ -2365,15 +2488,19 @@ static struct super_operations devfs_sops =
     statfs:        devfs_statfs,
 };
 
+
+/**
+ *     get_vfs_inode - Get a VFS inode.
+ *     @sb: The super block.
+ *     @di: The devfs inode.
+ *     @dentry The dentry to register with the devfs inode.
+ *
+ *     Returns the inode on success, else %NULL.
+ */
+
 static struct inode *get_vfs_inode (struct super_block *sb,
                                    struct devfs_inode *di,
                                    struct dentry *dentry)
-/*  [SUMMARY] Get a VFS inode.
-    <sb> The super block.
-    <di> The devfs inode.
-    <dentry> The dentry to register with the devfs inode.
-    [RETURNS] The inode on success, else NULL.
-*/
 {
     struct inode *inode;
 
@@ -2551,9 +2678,13 @@ static struct file_operations devfs_fops =
 
 /*  Dentry operations for device entries follow  */
 
+
+/**
+ *     devfs_d_release - Callback for when a dentry is freed.
+ *     @dentry: The dentry.
+ */
+
 static void devfs_d_release (struct dentry *dentry)
-/*  [SUMMARY] Callback for when a dentry is freed.
-*/
 {
 #ifdef CONFIG_DEVFS_DEBUG
     struct inode *inode = dentry->d_inode;
@@ -2564,9 +2695,13 @@ static void devfs_d_release (struct dentry *dentry)
 #endif
 }   /*  End Function devfs_d_release  */
 
+/**
+ *     devfs_d_iput - Callback for when a dentry loses its inode.
+ *     @dentry: The dentry.
+ *     @inode: The inode.
+ */
+
 static void devfs_d_iput (struct dentry *dentry, struct inode *inode)
-/*  [SUMMARY] Callback for when a dentry loses its inode.
-*/
 {
     struct devfs_inode *di;
 
@@ -2606,9 +2741,12 @@ static struct dentry_operations devfs_wait_dops =
     d_revalidate: devfs_d_revalidate_wait,
 };
 
+/**
+ *     devfs_d_delete - Callback for when all files for a dentry are closed.
+ *     @detry: The dentry.
+ */
+
 static void devfs_d_delete (struct dentry *dentry)
-/*  [SUMMARY] Callback for when all files for a dentry are closed.
-*/
 {
     struct inode *inode = dentry->d_inode;
     struct devfs_inode *di;
index 7e22ae7cb93278d5f938fcdffa690ace9515e4b6..fe47464487e94e6ed3e8b5b1a18aaa2b8efbe301 100644 (file)
 
 /*  Private functions follow  */
 
+/**
+ *     _devfs_convert_name - Convert from an old style location-based name to new style.
+ *     @new: The new name will be written here.
+ *     @old: The old name.
+ *     @disc: If true, disc partitioning information should be processed.
+ */
+
 static void __init _devfs_convert_name (char *new, const char *old, int disc)
-/*  [SUMMARY] Convert from an old style location-based name to new style.
-    <new> The new name will be written here.
-    <old> The old name.
-    <disc> If true, disc partitioning information should be processed.
-    [RETURNS] Nothing.
-*/
 {
     int host, bus, target, lun;
     char *ptr;
@@ -73,12 +74,12 @@ static void __init _devfs_convert_name (char *new, const char *old, int disc)
 
 /*  Public functions follow  */
 
-/*PUBLIC_FUNCTION*/
+/**
+ *     devfs_make_root - Create the root FS device entry if required.
+ *     @name: The name of the root FS device, as passed by "root=".
+ */
+
 void __init devfs_make_root (const char *name)
-/*  [SUMMARY] Create the root FS device entry if required.
-    <name> The name of the root FS device, as passed by "root=".
-    [RETURNS] Nothing.
-*/
 {
     char dest[64];
 
@@ -97,12 +98,13 @@ void __init devfs_make_root (const char *name)
     devfs_mk_symlink (NULL, name, 0, DEVFS_FL_DEFAULT, dest, 0, NULL,NULL);
 }   /*  End Function devfs_make_root  */
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_register_tape - Register a tape device in the "/dev/tapes" hierarchy.
+ *     @de: Any tape device entry in the device directory.
+ */
+
 void devfs_register_tape (devfs_handle_t de)
-/*  [SUMMARY] Register a tape device in the "/dev/tapes" hierarchy.
-    <de> Any tape device entry in the device directory.
-    [RETURNS] Nothing.
-*/
 {
     int pos;
     devfs_handle_t parent, slave;
@@ -122,30 +124,31 @@ void devfs_register_tape (devfs_handle_t de)
 }   /*  End Function devfs_register_tape  */
 EXPORT_SYMBOL(devfs_register_tape);
 
-/*PUBLIC_FUNCTION*/
+
+/**
+ *     devfs_register_series - Register a sequence of device entries.
+ *     @dir: The handle to the parent devfs directory entry. If this is %NULL the
+ *             new names are relative to the root of the devfs.
+ *     @format: The printf-style format string. A single "\%u" is allowed.
+ *     @flags: A set of bitwise-ORed flags (DEVFS_FL_*).
+ *     @major: The major number. Not needed for regular files.
+ *     @minor_start: The starting minor number. Not needed for regular files.
+ *     @mode: The default file mode.
+ *     @uid: The default UID of the file.
+ *     @guid: The default GID of the file.
+ *     @ops: The &file_operations or &block_device_operations structure.
+ *             This must not be externally deallocated.
+ *     @info: An arbitrary pointer which will be written to the private_data
+ *             field of the &file structure passed to the device driver. You can set
+ *             this to whatever you like, and change it once the file is opened (the next
+ *             file opened will not see this change).
+ */
+
 void devfs_register_series (devfs_handle_t dir, const char *format,
                            unsigned int num_entries, unsigned int flags,
                            unsigned int major, unsigned int minor_start,
                            umode_t mode, uid_t uid, gid_t gid,
                            void *ops, void *info)
-/*  [SUMMARY] Register a sequence of device entries.
-    <dir> The handle to the parent devfs directory entry. If this is NULL the
-    new names are relative to the root of the devfs.
-    <format> The printf-style format string. A single "%u" is allowed.
-    <flags> A set of bitwise-ORed flags (DEVFS_FL_*).
-    <major> The major number. Not needed for regular files.
-    <minor_start> The starting minor number. Not needed for regular files.
-    <mode> The default file mode.
-    <uid> The default UID of the file.
-    <guid> The default GID of the file.
-    <ops> The <<file_operations>> or <<block_device_operations>> structure.
-    This must not be externally deallocated.
-    <info> An arbitrary pointer which will be written to the <<private_data>>
-    field of the <<file>> structure passed to the device driver. You can set
-    this to whatever you like, and change it once the file is opened (the next
-    file opened will not see this change).
-    [RETURNS] Nothing.
-*/
 {
     unsigned int count;
     char devname[128];
index 2f0e2d3c30e663957329bf20e2660f63ccc33ba3..d8a2109523558760f3c767b2699b92cff1477711 100644 (file)
@@ -7,7 +7,8 @@
  * Alan Cox <Alan.Cox@linux.org>, 1995.
  * Ingo Molnar <mingo@redhat.com>, 1999, 2000
  */
-#define                APIC_PHYS_BASE  0xfee00000 /* IA s/w dev Vol 3, Section 7.4 */
+
+#define                APIC_DEFAULT_PHYS_BASE  0xfee00000
  
 #define                APIC_ID         0x20
 #define                        GET_APIC_ID(x)          (((x)>>24)&0x0F)
index 413a98c5590e0b757d875d9bdefea504d2d998b7..0c883af9d6ef25492bd25e4280b321552025e69b 100644 (file)
  */
 
 /*
- * Special IRQ vectors used by the SMP architecture, 0x30-0x4f
+ * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
  *
  *  some of the following vectors are 'rare', they are merged
  *  into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
  *  TLB, reschedule and local APIC vectors are performance-critical.
+ *
+ *  Vectors 0xf0-0xfa are free (reserved for future Linux use).
  */
-#define INVALIDATE_TLB_VECTOR  0x30
-#define LOCAL_TIMER_VECTOR     0x31
-#define RESCHEDULE_VECTOR      0x40
-
-/* 'rare' vectors: */
-#define CALL_FUNCTION_VECTOR   0x41
+#define SPURIOUS_APIC_VECTOR   0xff
+#define ERROR_APIC_VECTOR      0xfe
+#define INVALIDATE_TLB_VECTOR  0xfd
+#define RESCHEDULE_VECTOR      0xfc
+#define CALL_FUNCTION_VECTOR   0xfb
 
 /*
- * These IRQs should never really happen on perfect hardware running
- * a perfect kernel, but we nevertheless print a message to catch the
- * rest ;) Subtle, the APIC architecture mandates the spurious vector
- * to have bits 0-3 set to 1. Note that these vectors do not occur
- * normally, so we violate the 'only 2 vectors per priority level'
- * rule here.
+ * Local APIC timer IRQ vector is on a different priority level,
+ * to work around the 'lost local interrupt if more than 2 IRQ
+ * sources per level' errata.
  */
-#define SPURIOUS_APIC_VECTOR   0x3f
-#define ERROR_APIC_VECTOR      0x43
+#define LOCAL_TIMER_VECTOR     0xef
 
 /*
- * First APIC vector available to drivers: (vectors 0x51-0xfe)
- * we start at 0x51 to spread out vectors between priority levels
- * evenly. (note that 0x80 is the syscall vector)
+ * First APIC vector available to drivers: (vectors 0x30-0xee)
+ * we start at 0x31 to spread out vectors evenly between priority
+ * levels. (0x80 is the syscall vector)
  */
-#define IRQ0_TRAP_VECTOR       0x51
+#define FIRST_DEVICE_VECTOR    0x31
+#define FIRST_SYSTEM_VECTOR    0xef
 
 extern int irq_vector[NR_IRQS];
 #define IO_APIC_VECTOR(irq)    irq_vector[irq]
diff --git a/include/asm-mips/arc/types.h b/include/asm-mips/arc/types.h
new file mode 100644 (file)
index 0000000..79ca5d9
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * 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 1999 Ralf Baechle (ralf@gnu.org)
+ * Copyright 1999 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_ARC_TYPES_H
+#define _ASM_ARC_TYPES_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_ARC32
+
+typedef char           CHAR;
+typedef short          SHORT;
+typedef long           LARGE_INTEGER __attribute__ ((__mode__ (__DI__)));
+typedef        long            LONG __attribute__ ((__mode__ (__SI__)));
+typedef unsigned char  UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned long  ULONG __attribute__ ((__mode__ (__SI__)));
+typedef void           VOID;
+
+/* The pointer types.  Note that we're using a 64-bit compiler but all
+   pointer in the ARC structures are only 32-bit, so we need some disgusting
+   workarounds.  Keep your vomit bag handy.  */
+typedef LONG           _PCHAR;
+typedef LONG           _PSHORT;
+typedef LONG           _PLARGE_INTEGER;
+typedef        LONG            _PLONG;
+typedef LONG           _PUCHAR;
+typedef LONG           _PUSHORT;
+typedef LONG           _PULONG;
+typedef LONG           _PVOID;
+
+#endif /* CONFIG_ARC32 */
+
+#ifdef CONFIG_ARC64
+
+typedef char           CHAR;
+typedef short          SHORT;
+typedef long           LARGE_INTEGER __attribute__ ((__mode__ (__DI__)));
+typedef        long            LONG __attribute__ ((__mode__ (__DI__)));
+typedef unsigned char  UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned long  ULONG __attribute__ ((__mode__ (__DI__)));
+typedef void           VOID;
+
+/* The pointer types.  We're 64-bit and the firmware is also 64-bit, so
+   live is sane ...  */
+typedef CHAR           *_PCHAR;
+typedef SHORT          *_PSHORT;
+typedef LARGE_INTEGER  *_PLARGE_INTEGER;
+typedef        LONG            *_PLONG;
+typedef UCHAR          *_PUCHAR;
+typedef USHORT         *_PUSHORT;
+typedef ULONG          *_PULONG;
+typedef VOID           *_PVOID;
+
+#endif /* CONFIG_ARC64  */
+
+typedef CHAR           *PCHAR;
+typedef SHORT          *PSHORT;
+typedef LARGE_INTEGER  *PLARGE_INTEGER;
+typedef        LONG            *PLONG;
+typedef UCHAR          *PUCHAR;
+typedef USHORT         *PUSHORT;
+typedef ULONG          *PULONG;
+typedef VOID           *PVOID;
+
+#endif /* _ASM_ARC_TYPES_H */
index c25956ccf070d05fc964cb7cc2f25042e248baec..fb3692dd705cf98d822c46b1c4408f6d90ab4f85 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1998 Ralf Baechle
  *
- * $Id: asmmacro.h,v 1.4 1999/08/18 23:37:49 ralf Exp $
+ * $Id: asmmacro.h,v 1.3 1998/03/27 04:47:58 ralf Exp $
  */
 #ifndef __MIPS_ASMMACRO_H
 #define __MIPS_ASMMACRO_H
index 2d2a97add192574529264f197e7b13f8c9f5e054..fbd2daee70fc77d38a1b4664d89069dcbe3be70d 100644 (file)
  *
  * Copyright (C) 1996, 1997 by Ralf Baechle
  *
- * $Id: atomic.h,v 1.7 1999/08/13 17:07:27 harald Exp $
+ * $Id: atomic.h,v 1.6 1999/07/26 19:42:42 harald Exp $
  */
-#ifndef __ASM_MIPS_ATOMIC_H
-#define __ASM_MIPS_ATOMIC_H
+#ifndef __ASM_ATOMIC_H
+#define __ASM_ATOMIC_H
 
 #include <linux/config.h>
 
index 871d19c9f62b3eeaf1aab4f93fdff27065f67c76..172b8c884b1561fe86136ec81fee085bf6f8d4dd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: baget.h,v 1.2 1999/04/11 17:03:40 harald Exp $
+/* $Id$
  * baget.h: Definitions specific to Baget/MIPS machines.
  *
  * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
index 6d194d7635f2a2c29fc869e37cd2d8488569724d..46ae6812e39598ce1837235f703a2fdbbacc7fc7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: vac.h,v 1.2 1999/04/11 17:03:40 harald Exp $
+/* $Id$
  *
  * vac.h: Various VIC controller defines.  The VIC is a VME controller
  *        used in Baget/MIPS series.
index 99a3f3364a6d975113227984e002bb51dabaa0ab..f995066ab670c8d8aa1a823507f3f93de715122c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: vic.h,v 1.1 1999/01/27 23:59:07 ralf Exp $
+/* $Id$
  *
  * vic.h: Various VIC controller defines.  The VIC is an interrupt controller
  *        used in Baget/MIPS series.
index 07b51c373afdee111946902bac682d9051cde797..e3507bb042e96dc1cc4630be42e078f701a982d9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bcache.h,v 1.2 1999/08/20 21:59:07 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
index cd49b101a04b8d22f55b446bef0354c828b0bd28..caffa4eded327f1a91c42da9a50123821b0bff41 100644 (file)
@@ -54,10 +54,10 @@ extern __inline__ int find_first_zero_bit (void *addr, unsigned size);
 extern __inline__ int find_next_zero_bit (void * addr, int size, int offset);
 extern __inline__ unsigned long ffz(unsigned long word);
 
-#include <asm/mipsregs.h>
-
 #if defined(CONFIG_CPU_HAS_LLSC)
 
+#include <asm/mipsregs.h>
+
 /*
  * These functions for MIPS ISA > 1 are interrupt and SMP proof and
  * interrupt friendly
index 2d7ebf8987e67de68e7ba04c1af80c0e5d7c2e43..1e4fb5d51c9c4bc84b5272118c332c91c927ed70 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bootinfo.h,v 1.10 2000/01/26 00:07:45 ralf Exp $
+/* $Id: bootinfo.h,v 1.11 2000/03/06 11:14:32 raiko Exp $
  *
  * bootinfo.h -- Definition of the Linux/MIPS boot information structure
  *
 #define MACH_GROUP_SGI          6 /* Silicon Graphics workstations and servers */
 #define MACH_GROUP_COBALT       7 /* Cobalt servers                          */
 #define MACH_GROUP_NEC_DDB     8 /* NEC DDB */
+#define MACH_GROUP_BAGET       9 /* Baget */
 
 #define GROUP_NAMES { "unknown", "Jazz", "Digital", "ARC", \
-                      "SNI", "ACN", "SGI", "Cobalt", "NEC DDB" }
+                      "SNI", "ACN", "SGI", "Cobalt", "NEC DDB", "Baget" }
 
 /*
  * Valid machtype values for group unknown (low order halfword of mips_machtype)
 
 #define GROUP_NEC_DDB_NAMES { "Vrc-5074" }
 
+/*
+ * Valid machtype for group BAGET
+ */
+#define MACH_BAGET201          0       /* BT23-201 */
+#define MACH_BAGET202          1       /* BT23-202 */
+
+#define GROUP_BAGET_NAMES { "BT23-201", "BT23-202" }
+
 /*
  * Valid cputype values
  */
index 076edd581326e82f2a8bd3c6efeb19aa73bb0e6d..d8882cfb1bf90cc65629aea4126f5753e78f9902 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (C) 1996, 1997, 1998 by Ralf Baechle
  *
- * $Id: branch.h,v 1.2 1998/05/04 09:13:00 ralf Exp $
+ * $Id: branch.h,v 1.2 1998/04/28 19:37:46 ralf Exp $
  */
 #include <asm/ptrace.h>
 
index a839fe11eecf413ec4de3645532d4c7c111703cb..7a7871dd3c57ff27f4269b6758d4dd01bae108c1 100644 (file)
@@ -17,6 +17,11 @@ static inline void check_wait(void)
 {
        printk("Checking for 'wait' instruction... ");
        switch(mips_cputype) {
+       case CPU_R3081:
+       case CPU_R3081E:
+               cpu_wait = r3081_wait;
+               printk(" available.\n");
+               break;
        case CPU_R4200: 
        case CPU_R4300: 
        case CPU_R4600: 
@@ -25,7 +30,7 @@ static inline void check_wait(void)
        case CPU_R4700: 
        case CPU_R5000: 
        case CPU_NEVADA:
-               wait_available = 1;
+               cpu_wait = r4k_wait;
                printk(" available.\n");
                break;
        default:
index c3e48440836d8beecbcb948d5114105b41056bba..b9604cf202aabe1268bd1119697404b9528f2d60 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: byteorder.h,v 1.7 1999/01/04 16:09:20 ralf Exp $
+/* $Id: byteorder.h,v 1.8 1998/11/02 09:29: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
index 0de758cf09caa9489fb191307a47e186c58e4919..a6c80d31ee3ed360826e06c53b2163c531d92ccd 100644 (file)
 #include <linux/config.h>
 
 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_R6000)
-#define L1_CACHE_BYTES 16
+#define L1_CACHE_BYTES         16
 #else
-#define L1_CACHE_BYTES  32     /* A guess */
+#define L1_CACHE_BYTES                 32      /* A guess */
 #endif
 
+#define SMP_CACHE_BYTES                L1_CACHE_BYTES
+
 #endif /* _ASM_CACHE_H */
index 84da5badf1e52cc7bc4eda006a6a1c5c11e07b06..25e303e8cb02487b29c01bf0de7aec189af8f4d6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: checksum.h,v 1.9 2000/02/18 22:06:19 ralf Exp $
+/* $Id: checksum.h,v 1.8 2000/02/18 00:24:48 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
index 6be166cf8a8650020ff011c7a01cb5dc303e3a58..4d42be6f13347ecb0d8764de979e6c701bb24880 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cpu.h,v 1.1.1.1 1997/06/01 03:17:12 ralf Exp $
+/* $Id: cpu.h,v 1.1 1996/06/23 09:38:33 dm Exp $
  * cpu.h: Values of the PRId register used to match up
  *        various MIPS cpu types.
  *
index 927708318e2ee2def67ecef0a8b7fb8e27987f14..3015ce4bd256203a397a0f97ac9bfd36be8855b9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: current.h,v 1.6 1999/09/28 22:27:17 ralf Exp $
+/* $Id: current.h,v 1.5 1999/07/26 19:42:43 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
index 023618b3ae0c2e0a73ae9f132d5bd2ef97ed9384..0d09ac27f9a556a5f581324ebc58555bded6236a 100644 (file)
@@ -2,7 +2,7 @@
  *  include/asm-mips/ddb5074.h -- NEC DDB Vrc-5074 definitions
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     Sony Suprastructure Center Europe (SUPC-E), Brussels
+ *                     Sony Software Development Center Europe (SDCE), Brussels
  */
 
 extern void ddb5074_led_hex(int hex);
index 1679ca6d5f236d5877f9cf1af9e6c78a75ea0a2a..a7fa5e56f26145c93def41f7e75d76954c97e855 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: delay.h,v 1.3 1999/08/18 23:37:49 ralf Exp $
+/* $Id: delay.h,v 1.2 1999/01/04 16:09:20 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
@@ -12,6 +12,8 @@
 
 #include <linux/config.h>
 
+#include <linux/config.h>
+
 extern __inline__ void
 __delay(unsigned long loops)
 {
index 9c954a454e602c1ef60b476280e62f86d44eff33..58a7b437e8008926125f93ea63896e554c19ad55 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: div64.h,v 1.1 2000/01/29 01:42:28 ralf Exp $
+/* $Id: div64.h,v 1.1 2000/01/28 23:18:43 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
index e967bd447def87552a895b98c7f078e2279309ba..54e938ef42ebde556a7de898907bb984a690fa2e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: dma.h,v 1.7 2000/01/29 01:42:28 ralf Exp $
+/* $Id: dma.h,v 1.6 1999/12/30 14:22:47 raiko Exp $
  * linux/include/asm/dma.h: Defines for using and allocating dma channels.
  * Written by Hennus Bergman, 1992.
  * High DMA channel support & info by Hannu Savolainen
index 7c180b371813d8d5a494bcf99133a57607773b03..2d60fb89d328ef46aacf8e61a45431e97a46333f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ds1286.h,v 1.2 1999/08/19 22:56:33 ralf Exp $
+/* $Id: ds1286.h,v 1.1 1998/07/10 01:14: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
index 64239c53904e88c2437229f56d6812a2975c7178..31f455d9df239e522eff5bcd9387b349325dacbd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: elf.h,v 1.7 1999/08/20 21:59:08 ralf Exp $
+ * $Id: elf.h,v 1.6 1999/02/15 02:22:10 ralf Exp $
  */
 #ifndef __ASM_MIPS_ELF_H
 #define __ASM_MIPS_ELF_H
index 57101f4e005af1ba553dedfa428037a563b7279a..02b0c7dae0fa3cb2876be8e10190f4e43e3b6527 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fcntl.h,v 1.5 1999/01/04 16:09:21 ralf Exp $
+/* $Id: fcntl.h,v 1.4 1998/09/19 19:19:36 ralf Exp $
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
index 67177d7ddfeca76831389f0ee25993ba867d6fc4..67d8051a898122351bbdfffa76705775b557a714 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: floppy.h,v 1.7 1999/08/18 23:37:49 ralf Exp $
+/* $Id: floppy.h,v 1.6 1999/01/04 16:09:21 ralf Exp $
  *
  * Architecture specific parts of the Floppy driver
  *
index e773ed889c3e4c92d24c2cb66f5dd537d7184f83..30c17dc83e44d0feace49a91d9ec388ff50a5109 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fp.h,v 1.2 1999/07/26 19:42:43 harald Exp $
+/* $Id: fp.h,v 1.1 1998/07/16 19:10:04 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
index ed32904aef7d40af47796f547edb7c60a0e428cd..0bf2aafb9c302821e6ec3deccf3dde5b7f6e65ae 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gdb-stub.h,v 1.3 1998/08/25 09:21:55 ralf Exp $
+/* $Id: gdb-stub.h,v 1.3 1998/07/20 17:52:19 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
index 920944b2f0efe4ceddc2aa470c743bb53f74688c..7cda7a69f5e9494b69fac23cd40a1bba1436a372 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gfx.h,v 1.5 1999/08/19 22:56:33 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
index 93c6bae3a5d51637b8c822ddc0e698c42fe4feeb..59d6681dec7bca59e216db1a1ee0ac3700443718 100644 (file)
@@ -1,35 +1,50 @@
-/* $Id: hardirq.h,v 1.7 2000/02/23 00:41:38 ralf Exp $
+/* $Id: hardirq.h,v 1.8 2000/03/02 02:37:13 ralf Exp $
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1997, 1998, 1999 by Ralf Baechle
- * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #ifndef _ASM_HARDIRQ_H
 #define _ASM_HARDIRQ_H
 
+#include <linux/config.h>
+
 #include <linux/config.h>
 #include <linux/threads.h>
+#include <linux/irq.h>
+
+typedef struct {
+       unsigned int __local_irq_count;
+       unsigned int __local_bh_count;
+} ____cacheline_aligned irq_cpustat_t;
 
-extern unsigned int local_irq_count[NR_CPUS];
+extern irq_cpustat_t irq_stat [NR_CPUS];
+
+/*
+ * Simple wrappers reducing source bloat
+ */
+#define local_irq_count(cpu) (irq_stat[(cpu)].__local_irq_count)
+#define local_bh_count(cpu) (irq_stat[(cpu)].__local_bh_count)
+#define nmi_counter(cpu) (irq_stat[(cpu)].__nmi_counter)
 
 /*
  * Are we in an interrupt context? Either doing bottom half
  * or hardware interrupt processing?
  */
 #define in_interrupt() ({ int __cpu = smp_processor_id(); \
-       (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
-#define in_irq() (local_irq_count[smp_processor_id()] != 0)
+       (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
+#define in_irq() (local_irq_count(smp_processor_id()) != 0)
 
 #ifndef CONFIG_SMP
 
-#define hardirq_trylock(cpu)   (local_irq_count[cpu] == 0)
+#define hardirq_trylock(cpu)   (local_irq_count(cpu) == 0)
 #define hardirq_endlock(cpu)   do { } while (0)
 
-#define irq_enter(cpu)         (local_irq_count[cpu]++)
-#define irq_exit(cpu)          (local_irq_count[cpu]--)
+#define irq_enter(cpu)         (local_irq_count(cpu)++)
+#define irq_exit(cpu)          (local_irq_count(cpu)--)
 
 #define synchronize_irq()      barrier();
 
index 99145061943ee7ba65cf9a09b8596df01b838b92..189dfc55c3cb85a5d8ad2d55afe6936fd17040f1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hdreg.h,v 1.1 1999/06/17 14:09:00 ralf Exp $
+/* $Id: hdreg.h,v 1.4 1998/05/08 21:05:26 davem Exp $
  *
  *  linux/include/asm-mips/hdreg.h
  *
index 74492aee5b7226f65502f1e7f721d37238eee04d..032acd2ee2143382e5b5bc4292323a2a0ef3d6fb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: highmem.h,v 1.2 2000/01/29 01:42:28 ralf Exp $
+/* $Id: highmem.h,v 1.1 2000/01/27 01:05: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/include/asm-mips/hw_irq.h b/include/asm-mips/hw_irq.h
new file mode 100644 (file)
index 0000000..1bf6629
--- /dev/null
@@ -0,0 +1,5 @@
+/* This exists merely to satisfy <linux/irq.h>.  There is
+   nothing that would go here of general interest.
+
+   Everything of consequence is in arch/alpha/kernel/irq_impl.h,
+   to be used only in arch/alpha/kernel/.  */
index 4279b276fce813babd4f68d4870246bdb9c436cb..d66835618f56bcb143edecd374902590775d47b1 100644 (file)
 #include <linux/config.h>
 
 #ifndef MAX_HWIFS
+# ifdef CONFIG_BLK_DEV_IDEPCI
+#define MAX_HWIFS      10
+# else
 #define MAX_HWIFS      6
+# endif
 #endif
 
 #define ide__sti()     __sti()
index 2f5e0bf33d15a0f66400f490b48fc8182b39a04d..7ea13dc13c5fced5fae20c52dcd55322f43db6b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: inventory.h,v 1.2 1997/12/06 23:55:49 ralf Exp $
+ * $Id:$
  */
 #ifndef __ASM_MIPS_INVENTORY_H
 #define __ASM_MIPS_INVENTORY_H
index c543c6c87953886a4d35f299c1001417afd29a59..5e268a1c5787b9fc009eddfee9965fec57301f1c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctls.h,v 1.8 1998/08/25 09:21:56 ralf Exp $
+/* $Id: ioctls.h,v 1.5 1998/08/19 21:58: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
index 8bd0478a5f2138dd73901fdd5f8aeaf028be0f51..c7bafd3c879f84161fc1caacad144c8517763af1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: irq.h,v 1.7 2000/02/23 00:41:38 ralf Exp $
+/* $Id: irq.h,v 1.6 2000/01/26 00:07: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
index 94e422f299dc94fb2e7a56eb515f382ac098b2ea..16d07ccabdb3edac5a8683ce85fcc37f09137d73 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1998 Harald Koerfgen
  *
- * $Id: isadep.h,v 1.2 1999/08/13 17:07:27 harald Exp $
+ * $Id: isadep.h,v 1.1 1999/07/26 19:46:00 harald Exp $
  */
 #include <linux/config.h>
 
index f13ad3187778661a812b4037173682f12498c553..f76b319079195d7c400654de9753715b20eb539f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: jazz.h,v 1.10 1998/10/18 13:16:02 tsbogend Exp $
+/* $Id: jazz.h,v 1.9 1998/09/19 19:19: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
index 632c440af0d2f169b92cc45ac038382194e20c27..634cfecd38af7ca310fd89c73f6bfbb86edba8a2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Helpfile for jazzdma.c -- Mips Jazz R4030 DMA controller support
  *
- * $Id: jazzdma.h,v 1.6 1998/03/04 09:51:22 ralf Exp $
+ * $Id:$
  */
 #ifndef __ASM_MIPS_JAZZDMA_H
 #define __ASM_MIPS_JAZZDMA_H
index 8453c1ad52a7d96250847670b024c836765ba468..31450dbeba14c33c3a66839638afb4e6fde86b3b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: linux_logo.h,v 1.4 1999/01/04 16:09:23 ralf Exp $
+/* $Id: linux_logo.h,v 1.3 1998/09/19 19:19:38 ralf Exp $
  *
  * include/asm-mips/linux_logo.h: This is a linux logo
  *                                to be displayed on boot.
index 68e41da4f1c03e88a60c7fb1e5b923816014b2b5..4ed782fc6fd0b16d456339d74dea0e5d15a64d98 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mc146818rtc.h,v 1.3 1999/08/19 22:56:33 ralf Exp $
+/* $Id: mc146818rtc.h,v 1.2 1998/06/30 00:23:10 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
index 842e513dbd055d4b00b59168e0c6a1c98db00b4e..23ed82cfd91142028d26ac5f2d7b4a71da60838f 100644 (file)
@@ -30,6 +30,7 @@
 #define CP0_RANDOM $1
 #define CP0_ENTRYLO0 $2
 #define CP0_ENTRYLO1 $3
+#define CP0_CONF $3
 #define CP0_CONTEXT $4
 #define CP0_PAGEMASK $5
 #define CP0_WIRED $6
@@ -333,6 +334,8 @@ __BUILD_SET_CP0(config,CP0_CONFIG)
 #define CONF_DB                                (1 <<  4)
 #define CONF_IB                                (1 <<  5)
 #define CONF_SC                                (1 << 17)
+#define CONF_AC                         (1 << 23)
+#define CONF_HALT                       (1 << 25)
 
 /*
  * R10000 performance counter definitions.
index e408affffe7b0bf3d6f5d3eb371d54a8058f287a..64dd2c674aed3c12b233bcb41e72156e18962aed 100644 (file)
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
+#define MADV_NORMAL    0x0             /* default page-in behavior */
+#define MADV_RANDOM    0x1             /* page-in minimum required */
+#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
+#define MADV_WILLNEED  0x3             /* pre-fault pages */
+#define MADV_DONTNEED  0x4             /* discard these pages */
+
 /* compatibility flags */
 #define MAP_ANON       MAP_ANONYMOUS
 #define MAP_FILE       0
index 77fdcc790d3559c66e4b478363aa08ee62d809cb..2e9809bbaacf7fcf8795ffc82a2ac427fc81b763 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mmu_context.h,v 1.8 2000/02/23 00:41:38 ralf Exp $
+/* $Id: mmu_context.h,v 1.7 2000/02/04 07:40:53 ralf Exp $
  *
  * Switch a MMU context.
  *
index eadf748e2982e836c0eeb53b98fcfce83925e1af..5361d07fdb37b82b6662417f404908f031e28de4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Included from linux/fs/namei.c
  *
- * $Id: namei.h,v 1.7 1999/06/17 13:30:37 ralf Exp $
+ * $Id: namei.h,v 1.6 1999/01/04 16:09:23 ralf Exp $
  */
 #ifndef __ASM_MIPS_NAMEI_H
 #define __ASM_MIPS_NAMEI_H
index a6a2fe42f4cd63e051f6e50c0daecf827901f2e0..7c7104415001c7fd438caadf9919d872b6de21d5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ng1.h,v 1.4 1999/08/19 22:56:33 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
index d8f2d8cf3cedb16e1ce6582999de39ad2351559d..d981e583641c6ca6b2ca03b2ca3c64d07a023b90 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ng1hw.h,v 1.5 1999/11/07 10:18:31 ulfc Exp $
+/* $Id: ng1hw.h,v 1.4 1999/08/04 06:01:51 ulfc Exp $
  * 
  * ng1hw.h: Tweaks the newport.h structures and definations to be compatible
  *         with IRIX.  Quite ugly, but it works.
index 74fc7ad9ef4c51d16be37bc5e89121bdeafb2a30..29e870dce5dada703c9f46ae7930e36503fa64cf 100644 (file)
@@ -2,7 +2,7 @@
  *  asm-mips/nile4.h -- NEC Vrc-5074 Nile 4 definitions
  *
  *  Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
- *                     Sony Suprastructure Center Europe (SUPC-E), Brussels
+ *                     Sony Software Development Center Europe (SDCE), Brussels
  *
  *  This file is based on the following documentation:
  *
@@ -11,8 +11,6 @@
  *  $Id: nile4.h,v 1.1 2000/01/26 00:07:45 ralf Exp $
  */
 
-#include <asm/addrspace.h>
-
 
 #define NILE4_BASE             0xbfa00000
 #define NILE4_SIZE             0x00200000              /* 2 MB */
index be9c36b0630141f64473161596d597ea8d06af44..42d7a5b81aa2bfdea6c99f53c97ec4b44bc398cd 100644 (file)
@@ -52,7 +52,7 @@
 #define TASK_COUNTER       32
 #define TASK_PRIORITY      36
 #define TASK_MM            44
-#define TASK_STRUCT_SIZE   904
+#define TASK_STRUCT_SIZE   880
 
 /* MIPS specific thread_struct offsets. */
 #define THREAD_REG16   584
@@ -80,7 +80,7 @@
 /* Linux mm_struct offsets. */
 #define MM_USERS      16
 #define MM_PGD        12
-#define MM_CONTEXT    64
+#define MM_CONTEXT    68
 
 /* Linux sigcontext offsets. */
 #define SC_REGS       16
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h
new file mode 100644 (file)
index 0000000..6f6f4a1
--- /dev/null
@@ -0,0 +1,98 @@
+/* $Id: paccess.h,v 1.1 2000/04/07 12:55:57 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 (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ *
+ * Protected memory access.  Used for everything that might take revenge
+ * by sending a DBE error like accessing possibly non-existant memory or
+ * devices.
+ */
+#ifndef _ASM_PACCESS_H
+#define _ASM_PACCESS_H
+
+#include <linux/errno.h>
+
+#define put_dbe(x,ptr) __put_dbe((x),(ptr),sizeof(*(ptr)))
+#define get_dbe(x,ptr) __get_dbe((x),(ptr),sizeof(*(ptr)))
+
+struct __large_pstruct { unsigned long buf[100]; };
+#define __mp(x) (*(struct __large_pstruct *)(x))
+
+#define __get_dbe(x,ptr,size) ({ \
+int __gu_err; \
+__typeof(*(ptr)) __gu_val; \
+unsigned long __gu_addr; \
+__asm__("":"=r" (__gu_val)); \
+__gu_addr = (unsigned long) (ptr); \
+__asm__("":"=r" (__gu_err)); \
+switch (size) { \
+case 1: __get_dbe_asm("lb"); break; \
+case 2: __get_dbe_asm("lh"); break; \
+case 4: __get_dbe_asm("lw"); break; \
+case 8:  __get_dbe_asm("ld"); break; \
+default: __get_dbe_unknown(); break; \
+} x = (__typeof__(*(ptr))) __gu_val; __gu_err; })
+
+#define __get_dbe_asm(insn) \
+({ \
+__asm__ __volatile__( \
+       ".set\tpush\n\t" \
+       ".set\tnoreorder\n\t" \
+       insn "\t%1,%2\n\t" \
+       "1:\tmove\t%0,$0\n" \
+       ".set\tpop\n\t" \
+       "2:\n\t" \
+       ".section\t.fixup,\"ax\"\n" \
+       "3:\tli\t%0,%3\n\t" \
+       "move\t%1,$0\n\t" \
+       "j\t2b\n\t" \
+       ".previous\n\t" \
+       ".section\t__dbe_table,\"a\"\n\t" \
+       ".word\t1b-4,3b\n\t" \
+       ".previous" \
+       :"=r" (__gu_err), "=r" (__gu_val) \
+       :"o" (__mp(__gu_addr)), "i" (-EFAULT)); })
+
+extern void __get_dbe_unknown(void);
+
+#define __put_dbe(x,ptr,size) ({ \
+int __pu_err; \
+__typeof__(*(ptr)) __pu_val; \
+unsigned long __pu_addr; \
+__pu_val = (x); \
+__pu_addr = (unsigned long) (ptr); \
+__asm__("":"=r" (__pu_err)); \
+switch (size) { \
+case 1: __put_dbe_asm("sb"); break; \
+case 2: __put_dbe_asm("sh"); break; \
+case 4: __put_dbe_asm("sw"); break; \
+case 8: __put_dbe_asm("sd"); break; \
+default: __put_dbe_unknown(); break; \
+} __pu_err; })
+
+#define __put_dbe_asm(insn) \
+({ \
+__asm__ __volatile__( \
+       ".set\tpush\n\t" \
+       ".set\tnoreorder\n\t" \
+       insn "\t%1,%2\n\t" \
+       "1:\tmove\t%0,$0\n" \
+       ".set\tpop\n\t" \
+       "2:\n\t" \
+       ".section\t.fixup,\"ax\"\n" \
+       "3:\tli\t%0,%3\n\t" \
+       "j\t2b\n\t" \
+       ".previous\n\t" \
+       ".section\t__dbe_table,\"a\"\n\t" \
+       ".word\t1b-4,3b\n\t" \
+       ".previous" \
+       :"=r" (__pu_err) \
+       :"r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); })
+
+extern void __put_dbe_unknown(void);
+
+#endif /* _ASM_PACCESS_H */
index f303ce56951a494853f5d706594fe93843d5e9c0..159e2345d9b28391b01209f2de05ab9f8de199a9 100644 (file)
@@ -1,13 +1,11 @@
-/* $Id: parport.h,v 1.2 2000/02/18 00:24:48 ralf Exp $
- *
- * parport.h: ia32-specific parport initialisation
+/* $Id$
  *
  * Copyright (C) 1999, 2000  Tim Waugh <tim@cyberelk.demon.co.uk>
  *
  * This file should only be included by drivers/parport/parport_pc.c.
  */
 #ifndef _ASM_PARPORT_H
-#define _ASM_PARPORT_H 1
+#define _ASM_PARPORT_H
 
 static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
 static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
@@ -15,4 +13,4 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
        return parport_pc_find_isa_ports (autoirq, autodma);
 }
 
-#endif /* !(_ASM_PARPORT_H) */
+#endif /* _ASM_PARPORT_H */
index aaa5c8fb78ef69b573acd6033cc89eb0ccde2e96..14126235c8129894936eab93c7619b4482b4bcc5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pci.h,v 1.9 2000/02/24 00:13:19 ralf Exp $
+/* $Id: pci.h,v 1.10 2000/03/23 02:26: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
@@ -35,6 +35,13 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
 #include <linux/string.h>
 #include <asm/io.h>
 
+#ifdef CONFIG_DDB5074
+#undef PCIBIOS_MIN_IO
+#undef PCIBIOS_MIN_MEM
+#define PCIBIOS_MIN_IO         0x0100000
+#define PCIBIOS_MIN_MEM                0x1000000
+#endif
+
 struct pci_dev;
 
 /*
index 0909033219e2a82fa712ad53dfafe1ed7344c34b..a91913bcc72b1daa2141ccf2cfaefd6d23ea1a8a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pgalloc.h,v 1.4 2000/02/24 00:13:19 ralf Exp $
+/* $Id: pgalloc.h,v 1.3 2000/02/23 00:41: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
@@ -12,6 +12,8 @@
 
 #include <linux/config.h>
 
+#include <linux/config.h>
+
 /* TLB flushing:
  *
  *  - flush_tlb_all() flushes all processes TLB entries
index 2f635b7c08a258a3582753770f633aeb67ea32be..a21e78b04ba4dd9f633c55df5f454414267d0e50 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.30 2000/02/24 00:13:19 ralf Exp $
+/* $Id: pgtable.h,v 1.31 2000/03/02 02:37:13 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
@@ -439,6 +439,7 @@ extern void __bad_pte_kernel(pmd_t *pmd);
 extern int do_check_pgt_cache(int, int);
 
 extern pgd_t swapper_pg_dir[1024];
+extern void paging_init(void);
 
 extern void update_mmu_cache(struct vm_area_struct *vma,
                                unsigned long address, pte_t pte);
index 7da5046d611ec54e3cf9b7624654f38a1958ead3..a1e1080e71368848860dbc552c0c199f728cc6db 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: posix_types.h,v 1.7 2000/02/16 01:07:48 ralf Exp $
+/* $Id: posix_types.h,v 1.6 2000/02/04 23:32: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
index 3aaafc55c00bfeed220059a2f5844ac35a556f88..941f96feace0f127bba20a09042a6a2d93309679 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The IRIX kernel maps a page at PRDA_ADDRESS with the
  * contents of prda and fills it the bits on prda_sys.
- * $Id: prctl.h,v 1.1 1997/09/21 22:27:19 miguel Exp $
+ * $Id$
  */
 
 #ifndef __PRCTL_H__
index 545c6ecb894913610f67a138fe132c30325c7882..ab996d0b292c6adf9c4ea1bfb618c3b5cc314569 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef _ASM_PROCESSOR_H
 #define _ASM_PROCESSOR_H
 
+#include <linux/config.h>
+
 #include <asm/isadep.h>
 
 #include <linux/config.h>
@@ -39,7 +41,9 @@ struct mips_cpuinfo {
  * System setup and hardware flags..
  * XXX: Should go into mips_cpuinfo.
  */
-extern char wait_available;            /* only available on R4[26]00 */
+extern void (*cpu_wait)(void); /* only available on R4[26]00 and R3081 */
+extern void r3081_wait(void);
+extern void r4k_wait(void);
 extern char cyclecounter_available;    /* only available from R4000 upwards. */
 extern char dedicated_iv_available;    /* some embedded MIPS like Nevada */
 extern char vce_available;             /* Supports VCED / VCEI exceptions */
index cc74f6acbef305f9171761050e1987408be42231..559edac6a57a51d3e65a2ddaf8f85116dcacefbb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ptrace.h,v 1.8 1999/10/12 17:33:50 harald Exp $
+/* $Id: ptrace.h,v 1.7 1999/09/28 22:27: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
index 36be5cd56033c78342e984ddbf9e8879127991f5..561be48b836b506572c25566e67fa4e886843645 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  *
- * $Id: r4kcache.h,v 1.5 1998/03/04 05:36:23 ralf Exp $
+ * $Id: r4kcache.h,v 1.7 1997/12/18 13:00:45 ralf Exp $
  *
  * FIXME: Handle split L2 caches.
  */
index 370e98d1484634cbcae222b76a27aeb2ef039406..af41618ba9962d968dd6d7c39d5e9b242b32991b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: resource.h,v 1.5 2000/02/04 07:40:53 ralf Exp $
+/* $Id: resource.h,v 1.4 2000/01/27 23:45:30 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
index 96bcaecc46ebaccfee9f09ac7e710ef0caa6f340..6b9c6ba3f29a1da1ec1bdbd39ec20d47d3106fe0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: semaphore-helper.h,v 1.7 1999/10/21 00:23:05 ralf Exp $
+/* $Id: semaphore-helper.h,v 1.6 1999/10/20 21:10:58 ralf Exp $
  *
  * SMP- and interrupt-safe semaphores helper functions.
  *
@@ -92,7 +92,6 @@ waking_non_zero(struct semaphore *sem)
        "sc\t%0, %2\n\t"
        "beqz\t%0, 1b\n\t"
        "2:"
-       ".text"
        : "=r"(ret), "=r"(tmp), "=m"(__atomic_fool_gcc(&sem->waking))
        : "0"(0));
 
index d2462ea6f3af3bbf81c68cf1e34ef1c71c04dc50..f8774022fe6707f414d168f82f187d0d9a00b856 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: semaphore.h,v 1.13 2000/02/18 00:24:48 ralf Exp $
+/* $Id: semaphore.h,v 1.12 1999/12/08 22:05:10 harald Exp $
  *
  * SMP- and interrupt-safe semaphores..
  *
@@ -31,7 +31,7 @@ struct semaphore {
 #if WAITQUEUE_DEBUG
        long __magic;
 #endif
-};
+} __attribute__((aligned(8)));
 
 #if WAITQUEUE_DEBUG
 # define __SEM_DEBUG_INIT(name) \
index 86ed9835fa9f3bacc4b552d078792a8b8c29a4c6..f255684b4e8b91d54e37678eae90525749ee7f7d 100644 (file)
@@ -1,4 +1,8 @@
 /* $Id: serial.h,v 1.9 2000/02/16 01:45: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
+ * for more details.
  *
  * Copyright (C) 1999 by Ralf Baechle
  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
index ce45507072249cfff4cee7801519f88eeb0ca8fb..bafe60b57796438114784f81e6d5dcac663face6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgi.h,v 1.1 1999/10/21 00:23:05 ralf Exp $
+/* $Id: sgi.h,v 1.1.1.1 1997/06/01 03:17:12 ralf Exp $
  * sgi.h: Definitions specific to SGI machines.
  *
  * Copyright (C) 1996 David S. Miller (dm@sgi.com)
index 5dc5845f21d4ec70c6cd843f936273f970279734..69dcbda586f48a194c7db017ef983b85773da74f 100644 (file)
@@ -18,8 +18,8 @@ extern int sgi_boardid;  /* Board revision. */
 
 /* An HPC dma descriptor. */
 struct hpc_dma_desc {
-       unsigned long pbuf;      /* physical address of data buffer */
-       unsigned long cntinfo;   /* counter and info bits */
+       unsigned int pbuf;      /* physical address of data buffer */
+       unsigned int cntinfo;   /* counter and info bits */
 #define HPCDMA_EOX    0x80000000 /* last desc in chain for tx */
 #define HPCDMA_EOR    0x80000000 /* last desc in chain for rx */
 #define HPCDMA_EOXP   0x40000000 /* end of packet for tx */
@@ -31,10 +31,10 @@ struct hpc_dma_desc {
 #define HPCDMA_OWN    0x00004000 /* Denotes ring buffer ownership on rx */
 #define HPCDMA_BCNT   0x00003fff /* size in bytes of this dma buffer */
 
-       unsigned long pnext;     /* paddr of next hpc_dma_desc if any */
+       unsigned int pnext;     /* paddr of next hpc_dma_desc if any */
 };
 
-typedef volatile unsigned long hpcreg;
+typedef volatile unsigned int hpcreg;
 
 /* HPC1 stuff. */
 
index cf4df160085980cd7231f43bf3ecbe774d6fd50b..8f11c137e94725ca3c5e528cb3171d29356c4192 100644 (file)
@@ -1,16 +1,22 @@
-/* $Id: sgimc.h,v 1.2 1999/12/06 23:13:21 ralf Exp $
+/* $Id: sgimc.h,v 1.1.1.1 1997/06/01 03:17:13 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.
+ *
  * sgimc.h: Definitions for memory controller hardware found on
  *          SGI IP20, IP22, IP26, and IP28 machines.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 1999 Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
  */
-
-#ifndef _MIPS_SGIMC_H
-#define _MIPS_SGIMC_H
+#ifndef _ASM_SGI_SGIMC_H
+#define _ASM_SGI_SGIMC_H
 
 struct sgimc_misc_ctrl {
-       unsigned long _unused1;
-       volatile unsigned long cpuctrl0;     /* CPU control register 0, readwrite */
+       u32 _unused1;
+       volatile u32 cpuctrl0;     /* CPU control register 0, readwrite */
 #define SGIMC_CCTRL0_REFS         0x0000000f /* REFS mask */
 #define SGIMC_CCTRL0_EREFRESH     0x00000010 /* Memory refresh enable */
 #define SGIMC_CCTRL0_EPERRGIO     0x00000020 /* GIO parity error enable */
@@ -31,8 +37,8 @@ struct sgimc_misc_ctrl {
 #define SGIMC_CCTRL0_R4KNOCHKPARR 0x04000000 /* Don't chk parity on mem data reads */
 #define SGIMC_CCTRL0_GIOBTOB      0x08000000 /* Allow GIO back to back writes */
 
-       unsigned long _unused2;
-       volatile unsigned long cpuctrl1;     /* CPU control register 1, readwrite */
+       u32 _unused2;
+       volatile u32 cpuctrl1;     /* CPU control register 1, readwrite */
 #define SGIMC_CCTRL1_EGIOTIMEO    0x00000010 /* GIO bus timeout enable */
 #define SGIMC_CCTRL1_FIXEDEHPC    0x00001000 /* Fixed HPC endianness */
 #define SGIMC_CCTRL1_LITTLEHPC    0x00002000 /* Little endian HPC */
@@ -41,18 +47,18 @@ struct sgimc_misc_ctrl {
 #define SGIMC_CCTRL1_FIXEDEEXP1   0x00010000 /* Fixed EXP1 endianness */
 #define SGIMC_CCTRL1_LITTLEEXP1   0x00020000 /* Little endian EXP1 */
 
-       unsigned long _unused3;
-       volatile unsigned long watchdogt;    /* Watchdog reg rdonly, write clears */
+       u32 _unused3;
+       volatile u32 watchdogt;    /* Watchdog reg rdonly, write clears */
 
-       unsigned long _unused4;
-       volatile unsigned long systemid;     /* MC system ID register, readonly */
+       u32 _unused4;
+       volatile u32 systemid;     /* MC system ID register, readonly */
 #define SGIMC_SYSID_MASKREV       0x0000000f /* Revision of MC controller */
 #define SGIMC_SYSID_EPRESENT      0x00000010 /* Indicates presence of EISA bus */
 
-       unsigned long _unused5[3];
-       volatile unsigned long divider;      /* Divider reg for RPSS */
+       u32 _unused5[3];
+       volatile u32 divider;      /* Divider reg for RPSS */
 
-       unsigned long _unused6;
+       u32 _unused6;
        volatile unsigned char eeprom;       /* EEPROM byte reg for r4k */
 #define SGIMC_EEPROM_PRE          0x00000001 /* eeprom chip PRE pin assertion */
 #define SGIMC_EEPROM_CSEL         0x00000002 /* Active high, eeprom chip select */
@@ -61,16 +67,16 @@ struct sgimc_misc_ctrl {
 #define SGIMC_EEPROM_SDATAI       0x00000010 /* Serial EEPROM data-in */
 
        unsigned char _unused7[3];
-       unsigned long _unused8[3];
+       u32 _unused8[3];
        volatile unsigned short rcntpre;     /* Preload refresh counter */
 
        unsigned short _unused9;
-       unsigned long _unused9a;
+       u32 _unused9a;
        volatile unsigned short rcounter;    /* Readonly refresh counter */
 
        unsigned short _unused10;
-       unsigned long _unused11[13];
-       volatile unsigned long gioparm;      /* Parameter word for GIO64 */
+       u32 _unused11[13];
+       volatile u32 gioparm;      /* Parameter word for GIO64 */
 #define SGIMC_GIOPARM_HPC64       0x00000001 /* HPC talks to GIO using 64-bits */
 #define SGIMC_GIOPARM_GFX64       0x00000002 /* GFX talks to GIO using 64-bits */
 #define SGIMC_GIOPARM_EXP064      0x00000004 /* EXP(slot0) talks using 64-bits */
@@ -88,18 +94,18 @@ struct sgimc_misc_ctrl {
 #define SGIMC_GIOPARM_PLINEEXP0   0x00004000 /* EXP(slot0) has pipeline attr */
 #define SGIMC_GIOPARM_PLINEEXP1   0x00008000 /* EXP(slot1) has pipeline attr */
 
-       unsigned long _unused13;
+       u32 _unused13;
        volatile unsigned short cputp;       /* CPU bus arb time period */
 
        unsigned short _unused14;
-       unsigned long _unused15[3];
+       u32 _unused15[3];
        volatile unsigned short lbursttp;    /* Time period for long bursts */
 
        unsigned short _unused16;
-       unsigned long _unused17[9];
-       volatile unsigned long mconfig0;     /* Memory config register zero */
-       unsigned long _unused18;
-       volatile unsigned long mconfig1;     /* Memory config register one */
+       u32 _unused17[9];
+       volatile u32 mconfig0;     /* Memory config register zero */
+       u32 _unused18;
+       volatile u32 mconfig1;     /* Memory config register one */
 
         /* These defines apply to both mconfig registers above. */
 #define SGIMC_MCONFIG_FOURMB     0x00000000  /* Physical ram = 4megs */
@@ -110,99 +116,99 @@ struct sgimc_misc_ctrl {
 #define SGIMC_MCONFIG_OTEIGHTMB  0x00001f00  /* Physical ram = 128megs */
 #define SGIMC_MCONFIG_RMASK      0x00001f00  /* Ram config bitmask */
 
-       unsigned long _unused19;
-       volatile unsigned long cmacc;        /* Mem access config for CPU */
-       unsigned long _unused20;
-       volatile unsigned long gmacc;        /* Mem access config for GIO */
+       u32 _unused19;
+       volatile u32 cmacc;        /* Mem access config for CPU */
+       u32 _unused20;
+       volatile u32 gmacc;        /* Mem access config for GIO */
 
        /* This define applies to both cmacc and gmacc registers above. */
 #define SGIMC_MACC_ALIASBIG       0x20000000 /* 512MB home for alias */
 
        /* Error address/status regs from GIO and CPU perspectives. */
-       unsigned long _unused21;
-       volatile unsigned long cerr;         /* Error address reg for CPU */
-       unsigned long _unused22;
-       volatile unsigned long cstat;        /* Status reg for CPU */
-       unsigned long _unused23;
-       volatile unsigned long gerr;         /* Error address reg for GIO */
-       unsigned long _unused24;
-       volatile unsigned long gstat;        /* Status reg for GIO */
+       u32 _unused21;
+       volatile u32 cerr;         /* Error address reg for CPU */
+       u32 _unused22;
+       volatile u32 cstat;        /* Status reg for CPU */
+       u32 _unused23;
+       volatile u32 gerr;         /* Error address reg for GIO */
+       u32 _unused24;
+       volatile u32 gstat;        /* Status reg for GIO */
 
        /* Special hard bus locking registers. */
-       unsigned long _unused25;
+       u32 _unused25;
        volatile unsigned char syssembit;    /* Uni-bit system semaphore */
        unsigned char _unused26[3];
-       unsigned long _unused27;
+       u32 _unused27;
        volatile unsigned char mlock;        /* Global GIO memory access lock */
        unsigned char _unused28[3];
-       unsigned long _unused29;
+       u32 _unused29;
        volatile unsigned char elock;        /* Locks EISA from GIO accesses */
 
        /* GIO dma control registers. */
        unsigned char _unused30[3];
-       unsigned long _unused31[14];
-       volatile unsigned long gio_dma_trans;/* DMA mask to translation GIO addrs */
-       unsigned long _unused32;
-       volatile unsigned long gio_dma_sbits;/* DMA GIO addr substitution bits */
-       unsigned long _unused33;
-       volatile unsigned long dma_intr_cause; /* DMA IRQ cause indicator bits */
-       unsigned long _unused34;
-       volatile unsigned long dma_ctrl;     /* Main DMA control reg */
+       u32 _unused31[14];
+       volatile u32 gio_dma_trans;/* DMA mask to translation GIO addrs */
+       u32 _unused32;
+       volatile u32 gio_dma_sbits;/* DMA GIO addr substitution bits */
+       u32 _unused33;
+       volatile u32 dma_intr_cause; /* DMA IRQ cause indicator bits */
+       u32 _unused34;
+       volatile u32 dma_ctrl;     /* Main DMA control reg */
 
        /* DMA TLB entry 0 */
-       unsigned long _unused35;
-       volatile unsigned long dtlb_hi0;
-       unsigned long _unused36;
-       volatile unsigned long dtlb_lo0;
+       u32 _unused35;
+       volatile u32 dtlb_hi0;
+       u32 _unused36;
+       volatile u32 dtlb_lo0;
 
        /* DMA TLB entry 1 */
-       unsigned long _unused37;
-       volatile unsigned long dtlb_hi1;
-       unsigned long _unused38;
-       volatile unsigned long dtlb_lo1;
+       u32 _unused37;
+       volatile u32 dtlb_hi1;
+       u32 _unused38;
+       volatile u32 dtlb_lo1;
 
        /* DMA TLB entry 2 */
-       unsigned long _unused39;
-       volatile unsigned long dtlb_hi2;
-       unsigned long _unused40;
-       volatile unsigned long dtlb_lo2;
+       u32 _unused39;
+       volatile u32 dtlb_hi2;
+       u32 _unused40;
+       volatile u32 dtlb_lo2;
 
        /* DMA TLB entry 3 */
-       unsigned long _unused41;
-       volatile unsigned long dtlb_hi3;
-       unsigned long _unused42;
-       volatile unsigned long dtlb_lo3;
+       u32 _unused41;
+       volatile u32 dtlb_hi3;
+       u32 _unused42;
+       volatile u32 dtlb_lo3;
 };
 
 /* MC misc control registers live at physical 0x1fa00000. */
 extern struct sgimc_misc_ctrl *mcmisc_regs;
-extern u32 *rpsscounter;               /* Chirps at 100ns */
+extern u32 *rpsscounter;          /* Chirps at 100ns */
 
 struct sgimc_dma_ctrl {
-       unsigned long _unused1;
-       volatile unsigned long maddronly;   /* Address DMA goes at */
-       unsigned long _unused2;
-       volatile unsigned long maddrpdeflts; /* Same as above, plus set defaults */
-       unsigned long _unused3;
-       volatile unsigned long dmasz;       /* DMA count */
-       unsigned long _unused4;
-       volatile unsigned long ssize;       /* DMA stride size */
-       unsigned long _unused5;
-       volatile unsigned long gmaddronly;  /* Set GIO DMA but do not start trans */
-       unsigned long _unused6;
-       volatile unsigned long dmaddnpgo;   /* Set GIO DMA addr + start transfer */
-       unsigned long _unused7;
-       volatile unsigned long dmamode;     /* DMA mode config bit settings */
-       unsigned long _unused8;
-       volatile unsigned long dmacount;    /* Zoom and byte count for DMA */
-       unsigned long _unused9;
-       volatile unsigned long dmastart;    /* Pedal to the metal. */
-       unsigned long _unused10;
-       volatile unsigned long dmarunning;  /* DMA op is in progress */
-       unsigned long _unused11;
+       u32 _unused1;
+       volatile u32 maddronly;   /* Address DMA goes at */
+       u32 _unused2;
+       volatile u32 maddrpdeflts; /* Same as above, plus set defaults */
+       u32 _unused3;
+       volatile u32 dmasz;       /* DMA count */
+       u32 _unused4;
+       volatile u32 ssize;       /* DMA stride size */
+       u32 _unused5;
+       volatile u32 gmaddronly;  /* Set GIO DMA but do not start trans */
+       u32 _unused6;
+       volatile u32 dmaddnpgo;   /* Set GIO DMA addr + start transfer */
+       u32 _unused7;
+       volatile u32 dmamode;     /* DMA mode config bit settings */
+       u32 _unused8;
+       volatile u32 dmacount;    /* Zoom and byte count for DMA */
+       u32 _unused9;
+       volatile u32 dmastart;    /* Pedal to the metal. */
+       u32 _unused10;
+       volatile u32 dmarunning;  /* DMA op is in progress */
+       u32 _unused11;
 
        /* Set dma addr, defaults, and kick it */
-       volatile unsigned long maddr_defl_go; /* go go go! -lm */
+       volatile u32 maddr_defl_go; /* go go go! -lm */
 };
 
 /* MC controller dma regs live at physical 0x1fa02000. */
@@ -213,11 +219,11 @@ extern struct sgimc_dma_ctrl *dmactrlregs;
 #define SGIMC_SEG1_BADDR     0x20000000
 
 /* Maximum size of the above banks are per machine. */
-extern unsigned long sgimc_seg0_size, sgimc_seg1_size;
+extern u32 sgimc_seg0_size, sgimc_seg1_size;
 #define SGIMC_SEG0_SIZE_ALL         0x10000000 /* 256MB */
 #define SGIMC_SEG1_SIZE_IP20_IP22   0x08000000 /* 128MB */
 #define SGIMC_SEG1_SIZE_IP26_IP28   0x20000000 /* 512MB */
 
 extern void sgimc_init(void);
 
-#endif /* !(_MIPS_SGIMC_H) */
+#endif /* _ASM_SGI_SGIMC_H */
index 4a1e397d419b046c26c2ed4a70968eb4404c4f85..d851d2f3011a3ccfca449f2d4e219000ebc0a837 100644 (file)
@@ -1,12 +1,16 @@
-/* $Id: sgint23.h,v 1.1 1999/10/21 00:23:05 ralf Exp $
+/* $Id: sgint23.h,v 1.4 1999/09/28 21:02:12 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.
  *
  * sgint23.h: Defines for the SGI INT2 and INT3 chipsets.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - INT2 corrections
  */
-#ifndef _ASM_SGINT23_H
-#define _ASM_SGINT23_H
+#ifndef _ASM_SGI_SGINT23_H
+#define _ASM_SGI_SGINT23_H
 
 /* These are the virtual IRQ numbers, we divide all IRQ's into
  * 'spaces', the 'space' determines where and how to enable/disable
@@ -163,7 +167,7 @@ struct sgi_ioc_timers {
 struct sgi_int2_regs {
        struct sgi_ioc_ints ints;
 
-       volatile unsigned long ledbits;   /* LED control bits */
+       volatile u32 ledbits;             /* LED control bits */
 #define INT2_LED_TXCLK         0x01       /* GPI to TXCLK enable */
 #define INT2_LED_SERSLCT0      0x02       /* serial port0: 0=apple 1=pc */
 #define INT2_LED_SERSLCT1      0x04       /* serial port1: 0=apple 1=pc */
@@ -182,8 +186,8 @@ struct sgi_int2_regs {
 /* I am guesing there are only two unused registers here 
  * but I could be wrong...                     - andrewb
  */
-/*     unsigned long _unused[3]; */
-       unsigned long _unused[2];
+/*     u32 _unused[3]; */
+       u32 _unused[2];
        struct sgi_ioc_timers timers;
 };
 
@@ -192,13 +196,13 @@ struct sgi_int3_regs {
 
 #ifdef __MIPSEB__
        unsigned char _unused0[3];
-       volatile unsigned char tclear;    /* Timer clear strobe address */
+       volatile unsigned char tclear;          /* Timer clear strobe address */
 #else
-       volatile unsigned char tclear;    /* Timer clear strobe address */
+       volatile unsigned char tclear;          /* Timer clear strobe address */
        unsigned char _unused0[3];
 #endif
-       volatile unsigned long estatus;   /* Error status reg */
-       unsigned long _unused1[2];
+       volatile u32 estatus;                   /* Error status reg */
+       u32 _unused1[2];
        struct sgi_ioc_timers timers;
 };
 
index 880074764c59c30ca1456d04d86a873841f6e01b..8a9e2f49e1bce9eafb4ba01cbc026cd433a2f2c1 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: sgialib.h,v 1.4 1999/02/25 20:55:07 tsbogend Exp $
+/* $Id: sgialib.h,v 1.5 2000/03/19 01:28:58 ralf Exp $
  * sgialib.h: SGI ARCS firmware interface library for the Linux kernel.
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  */
 
-#ifndef _MIPS_SGIALIB_H
-#define _MIPS_SGIALIB_H
+#ifndef _ASM_SGIALIB_H
+#define _ASM_SGIALIB_H
 
 #include <asm/sgiarcs.h>
 
@@ -17,10 +17,11 @@ extern char **prom_argv, **prom_envp;
 extern int prom_flags;
 #define PROM_FLAG_ARCS  1
 
-/* Init the PROM library and it's internal data structures.  Called
+/*
+ * Init the PROM library and it's internal data structures.  Called
  * at boot time from head.S before start_kernel is invoked.
  */
-extern int prom_init(int argc, char **argv, char **envp);
+extern int prom_init(int argc, char **argv, char **envp, int *prom_vec);
 
 /* Simple char-by-char console I/O. */
 extern void prom_putchar(char c);
@@ -81,8 +82,8 @@ extern pcomponent *prom_componentbypath(char *path);
 extern void prom_identify_arch(void);
 
 /* Environemt variable routines. */
-extern char *prom_getenv(char *name);
-extern long prom_setenv(char *name, char *value);
+extern PCHAR ArcGetEnvironmentVariable(CHAR *name);
+extern LONG SetEnvironmentVariable(PCHAR name, PCHAR value);
 
 /* ARCS command line acquisition and parsing. */
 extern char *prom_getcmdline(void);
@@ -119,4 +120,4 @@ extern long prom_cfgsave(void);
 extern struct linux_sysid *prom_getsysid(void);
 extern void prom_cacheflush(void);
 
-#endif /* !(_MIPS_SGIALIB_H) */
+#endif /* _ASM_SGIALIB_H */
index 82296903a97b2a0e193b0371d01fd5d94ca2c98b..b9faf024f881c9be405c0a4d215d1e8aa6cee333 100644 (file)
@@ -4,9 +4,10 @@
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  */
+#ifndef _ASM_SGIARCS_H
+#define _ASM_SGIARCS_H
 
-#ifndef _MIPS_SGIARCS_H
-#define _MIPS_SGIARCS_H
+#include <asm/arc/types.h>
 
 /* Various ARCS error codes. */
 #define PROM_ESUCCESS                   0x00
@@ -232,8 +233,8 @@ struct linux_romvec {
        long (*mount)(char *file, enum linux_mountops op);
 
        /* Dealing with firmware environment variables. */
-       char *(*get_evar)(char *name);
-       long (*set_evar)(char *name, char *value);
+       PCHAR (*get_evar)(CHAR *name);
+       LONG (*set_evar)(PCHAR name, PCHAR value);
 
        long (*get_finfo)(unsigned long fd, struct linux_finfo *buf);
        long (*set_finfo)(unsigned long fd, unsigned long flags,
@@ -366,4 +367,4 @@ struct linux_smonblock {
        int             smax;              /* Max # of symbols. */
 };
 
-#endif /* !(_MIPS_SGIARCS_H) */
+#endif /* _ASM_SGIARCS_H */
index c25cc93333b7514d8bf9dfc40a48378f2148ce28..966fcfe762c3ec866c8ed7b6fc2e60f1ec6867b2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: shmparam.h,v 1.3 2000/01/29 01:42:28 ralf Exp $
+/* $Id: shmparam.h,v 1.3 2000/01/28 19:46: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
index 10753a4fbb8229fda3a3fd4a9f90952ccfcd0d6d..748e3d5422b0cc54db4b5623bcf0280c8e82849b 100644 (file)
@@ -1,16 +1,13 @@
-/*
- * include/asm-mips/sigcontext.h
+/* $Id: sigcontext.h,v 1.5 1997/12/16 05:36:43 ralf Exp $
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1996, 1997 by Ralf Baechle
- *
- * $Id: sigcontext.h,v 1.5 1997/12/16 05:36:43 ralf Exp $
+ * Copyright (C) 1996, 1997, 2000 by Ralf Baechle
  */
-#ifndef __ASM_MIPS_SIGCONTEXT_H
-#define __ASM_MIPS_SIGCONTEXT_H
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
 
 /*
  * Keep this struct definition in sync with the sigcontext fragment
@@ -35,4 +32,4 @@ struct sigcontext {
        unsigned long      sc_sigset[4];        /* kernel's sigset_t */
 };
 
-#endif /* __ASM_MIPS_SIGCONTEXT_H */
+#endif /* _ASM_SIGCONTEXT_H */
index b22daf5bd0d76d0eb29c05748cb131b6abe315ff..2dd4765e744a6e9996fd2f6698a9ec6796386e83 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: siginfo.h,v 1.6 2000/02/18 00:24:48 ralf Exp $
+/* $Id: siginfo.h,v 1.5 1999/08/18 23:37: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
index d448d1625e9e4a7c013d429892025913fe088281..59a30e987209c496a165cf3b56bcef628095feb6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: signal.h,v 1.7 1999/09/28 22:27:17 ralf Exp $
+/* $Id: signal.h,v 1.6 1999/08/18 23:37: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
index abd4ec163b403fda0448f6012f28fdbf40130348..1e2391ddb0e40b04c37d48b386bcd7194508ceca 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sni.h,v 1.3 1999/01/04 16:09:26 ralf Exp $
+/* $Id: sni.h,v 1.2 1998/09/19 19:19:39 ralf Exp $
  *
  * SNI specific definitions
  *
index 2a9979a269c6c726a58b031ed8de495967c0c565..5108021ba0c343db69f27a5dce7dbd998df2ac9a 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * $Id: socket.h,v 1.5 1998/03/17 22:16:17 ralf Exp $
+ * $Id: socket.h,v 1.6 2000/02/25 21:52:09 ralf Exp $
  */
-#ifndef __ASM_MIPS_SOCKET_H
-#define __ASM_MIPS_SOCKET_H
+#ifndef _ASM_SOCKET_H
+#define _ASM_SOCKET_H
 
 #include <asm/sockios.h>
 
@@ -56,6 +56,8 @@ To add: #define SO_REUSEPORT 0x0200   /* Allow local address and port reuse.  */
 #define SO_ATTACH_FILTER        26
 #define SO_DETACH_FILTER        27
 
+#ifdef __KERNEL__
+
 #define SO_PEERNAME             28
 
 /* Types of sockets.  */
@@ -71,4 +73,6 @@ To add: #define SO_REUSEPORT 0x0200   /* Allow local address and port reuse.  */
                                   the dev level.  For writing rarp and
                                   other similar things on the user level.  */
 
-#endif /* __ASM_MIPS_SOCKET_H */
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_SOCKET_H */
index 00cac7389519643ecaa8bc921ba13ae010ba6835..bc4af8ccba1445e5df4d0d61a245cf2bcc13bba8 100644 (file)
 #include <asm/atomic.h>
 #include <asm/hardirq.h>
 
-extern unsigned int local_bh_count[NR_CPUS];
-
-#define cpu_bh_disable(cpu)    do { local_bh_count[(cpu)]++; barrier(); } while (0)
-#define cpu_bh_enable(cpu)     do { barrier(); local_bh_count[(cpu)]--; } while (0)
+#define cpu_bh_disable(cpu)    do { local_bh_count(cpu)++; barrier(); } while (0)
+#define cpu_bh_enable(cpu)     do { barrier(); local_bh_count(cpu)--; } while (0)
 
 #define local_bh_disable()     cpu_bh_disable(smp_processor_id())
 #define local_bh_enable()      cpu_bh_enable(smp_processor_id())
 
-#define in_softirq() (local_bh_count[smp_processor_id()] != 0)
+#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
 
 #endif /* _ASM_SOFTIRQ_H */
index 5af23cdd75cb9e629c26a8bcb7a410fb0fcb0562..724d105200fc73419721d84dd319e6e65055fe94 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: spinlock.h,v 1.9 2000/01/25 00:41:46 ralf Exp $
+/* $Id: spinlock.h,v 1.8 2000/01/23 21:15:52 ralf Exp $
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
index 060826e8e78642411463fd8646affd4cc634b94a..490724b21a66c5e91027e2e4610d7904f2294506 100644 (file)
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 1994, 1995, 1996 by Ralf Baechle and Paul M. Antoine.
  *
- * $Id: stackframe.h,v 1.11 1999/12/04 03:59:12 ralf Exp $
+ * $Id: stackframe.h,v 1.10 1999/08/13 17:07:27 harald Exp $
  */
 #ifndef __ASM_MIPS_STACKFRAME_H
 #define __ASM_MIPS_STACKFRAME_H
index 3a3b3386a4e50890de702754c9901f97a233246a..e19a50fbbdb71560e9c90135077ab0044da4ff64 100644 (file)
@@ -100,20 +100,18 @@ strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count)
        ".set\tnoreorder\n\t"
        ".set\tnoat\n"
        "1:\tlbu\t%3,(%0)\n\t"
-#if defined(CONFIG_CPU_R3000)
-       "lbu\t$1,(%1)\n\t"
-       "nop\n\t"
-       "beqz\t%2,2f\n\t"
-#else
        "beqz\t%2,2f\n\t"
        "lbu\t$1,(%1)\n\t"
-#endif
        "subu\t%2,1\n\t"
        "bne\t$1,%3,3f\n\t"
        "addiu\t%0,1\n\t"
        "bnez\t%3,1b\n\t"
        "addiu\t%1,1\n"
-       "2:\tmove\t%3,$1\n"
+       "2:\n\t"
+#if defined(CONFIG_CPU_R3000)
+       "nop\n\t"
+#endif 
+       "move\t%3,$1\n"
        "3:\tsubu\t%3,$1\n\t"
        ".set\tat\n\t"
        ".set\treorder"
index 8d806112e4911e1a62844789610de3621cbc1573..a1f553488e8c6c10413fa496131e16a9238f37ff 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.21 1999/12/30 14:21:21 raiko Exp $
+/* $Id: system.h,v 1.20 1999/12/06 23:13:21 ralf Exp $
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
index ad71864ebcf3b0b61b1eccafa79079a2bdcccb1d..2e0ed639a709ba979210330d2b507a056f59d7c1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: termios.h,v 1.9 2000/02/18 00:24:48 ralf Exp $
+/* $Id: termios.h,v 1.8 2000/01/27 23:45:30 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
index 76b5998cf00f97ee489736e3e14bd7a5bf9ab510..599336a9a0c70852d2b1ce8d05eed1f05572ed6d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: timex.h,v 1.2 1999/02/15 02:22:14 ralf Exp $
+/* $Id: timex.h,v 1.1 1998/08/25 09:22: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
@@ -17,6 +17,7 @@
        (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
                << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
 
+#ifdef __KERNEL__
 /*
  * Standard way to access the cycle counter.
  * Currently only used on SMP for scheduling.
@@ -35,5 +36,6 @@ static inline cycles_t get_cycles (void)
 {
        return read_32bit_cp0_register(CP0_COUNT);
 }
+#endif /* __KERNEL__ */
 
 #endif /*  __ASM_MIPS_TIMEX_H */
index 8c7cf633140c9f51c01be7450b2f004c74c3f093..d7bf84ee46f31fbce513cb3fab257ecf88519d24 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: types.h,v 1.4 2000/02/18 00:24:48 ralf Exp $
+/* $Id: types.h,v 1.3 1999/08/18 23:37: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
index dec09f2b16e5df611c4b04d736740632c5207ada..6235cf488b85489bfc7a1bfa427589171f262d6b 100644 (file)
@@ -407,7 +407,7 @@ __clear_user(void *addr, __kernel_size_t size)
 #define clear_user(addr,n) ({ \
 void * __cl_addr = (addr); \
 unsigned long __cl_size = (n); \
-if (__cl_size && __access_ok(VERIFY_WRITE, ((unsigned long)(__cl_addr)), __cl_size)) \
+if (__cl_size && access_ok(VERIFY_WRITE, ((unsigned long)(__cl_addr)), __cl_size)) \
 __cl_size = __clear_user(__cl_addr, __cl_size); \
 __cl_size; })
 
index 3e9c7b32b56b084b36140ccec4107f7ab3dea347..db501bef0ec4cae3ff0d662b28e5ca9a7973c98f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ucontext.h,v 1.2 1999/09/28 22:27:17 ralf Exp $
+/* $Id: ucontext.h,v 1.2 1999/09/27 16:01: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
index 346d501ad9941110d41a8476429b084413759e6d..622e1e97740001f6f3208a693347d8a7cf8dad90 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: unaligned.h,v 1.3 1999/08/19 22:56:34 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
index 3e1f7f75742782949a88c97cbc27126be8465cd9..ff127260ce0f480627b9099d7fb60f64dde10910 100644 (file)
 #define __NR_ptrace                    (__NR_Linux +  26)
 #define __NR_alarm                     (__NR_Linux +  27)
 #define __NR_oldfstat                  (__NR_Linux +  28)
-#define __NR_unused29                  (__NR_Linux +  29)
+#define __NR_pause                     (__NR_Linux +  29)
 #define __NR_utime                     (__NR_Linux +  30)
 #define __NR_stty                      (__NR_Linux +  31)
 #define __NR_gtty                      (__NR_Linux +  32)
 #define __NR_lstat64                   (__NR_Linux + 214)
 #define __NR_fstat64                   (__NR_Linux + 215)
 #define __NR_pivot_root                        (__NR_Linux + 216)
+#define __NR_mincore                   (__NR_Linux + 217)
+#define __NR_madvise                   (__NR_Linux + 218)
 
 /*
  * Offset of the last Linux flavoured syscall
  */
-#define __NR_Linux_syscalls            216
+#define __NR_Linux_syscalls            218
 
 #ifndef _LANGUAGE_ASSEMBLY
 
index 3c10f3aaaf544e4543c09d8199d4b65b8c92bb5d..abfc622efee92f27bfc2c060589eea847bae81d6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: watch.h,v 1.3 1998/08/25 09:22:05 ralf Exp $
+/* $Id: watch.h,v 1.3 1998/08/19 21:58: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
index a5e0f5fceed872760afbc6e17c0fb49b2a877c6f..31a3679090b1025ef542bb5be69126ce88fb190b 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1998 Harald Koerfgen
  *
- * $Id: wbflush.h,v 1.3 1999/10/07 07:27:43 raiko Exp $
+ * $Id: wbflush.h,v 1.2 1999/08/13 17:07:28 harald Exp $
  */
 #ifndef __ASM_MIPS_WBFLUSH_H
 #define __ASM_MIPS_WBFLUSH_H
index df535408039cbf6c877073d95e455e0528e0d415..07f6565d34b5b7bb53fe5b6581ba5fa2fa95241e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: a.out.h,v 1.2 2000/01/16 01:40:43 ralf Exp $
+/* $Id: a.out.h,v 1.1 1999/08/18 23:37: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
index e1e0c8fb29cac52ab59106e5a91e43dd1b352fd8..1591e1071215d049cc46836d13ed313183d050ba 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: addrspace.h,v 1.6 2000/02/10 20:20:15 kanoj Exp $
+/* $Id: addrspace.h,v 1.5 2000/02/01 00:32:01 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
 #endif
 #define K2BASE         0xc000000000000000
 
+#if !defined (CONFIG_CPU_R8000)
+#define COMPAT_K1BASE32                0xffffffffa0000000
+#define PHYS_TO_COMPATK1(x)    ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */
+#endif
+
 #endif /* _ASM_ADDRSPACE_H */
index 59680643d06bae8b8dd3da3d3fcea9645656ff04..698891f878a2cecf667ffffd920962429cc283c4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hinv.h,v 1.1 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
  *
  * ARCS hardware/memory inventory/configuration and system ID definitions.
  */
index 563989c2f70704fd2fb5df902e8418a01d8dd6c9..48f6bfbec18e71f9bb931b9d371d492e29b207ae 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: asm.h,v 1.3 2000/01/17 23:32:47 ralf Exp $
+/* $Id: asm.h,v 1.2 1999/12/04 03:59:12 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
index 00cd1a83d329bc0cdc1753b3aefdbb7e83035f42..240bde270c3c91358d8b2e749ad89ee51241eb16 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: asmmacro.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: asmmacro.h,v 1.2 1999/10/19 20:51:53 ralf Exp $
  *
  * asmmacro.h: Assembler macros to make things easier to read.
  *
index 3749acdd58a11d2b01c28945b89a40d31e3d7434..5d57f8a8ca547a656ac6b4caf91420cf21f99bda 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: atomic.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
+/* $Id$
  *
  * Atomic operations that C can't guarantee us.  Useful for
  * resource counting etc..
@@ -16,6 +16,7 @@
 #define _ASM_ATOMIC_H
 
 #include <linux/config.h>
+
 #include <asm/sgidefs.h>
 
 #ifdef CONFIG_SMP
index a4697b66150c34ebfe86a6c6827fb304e5ca0da0..4ab0fca1904236b39ff5d7e69bc5db41ce80f3a3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bcache.h,v 1.3 2000/01/21 22:34:07 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
index 5e059174d60882b25c56da8a6f59a8f5f6c5ff1c..5f27e05cfa902218ebabd45057d290565c225589 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.4 1999/12/04 03:59:12 ralf Exp $
+/* $Id: bitops.h,v 1.3 1999/08/20 21:59:08 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
@@ -376,12 +376,12 @@ ext2_test_bit(int nr, const void * addr)
 #define ext2_find_first_zero_bit(addr, size) \
         ext2_find_next_zero_bit((addr), (size), 0)
 
-extern inline unsigned long
+extern inline unsigned int
 ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
 {
-       unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
-       unsigned long result = offset & ~31UL;
-       unsigned long tmp;
+       unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
+       unsigned int result = offset & ~31UL;
+       unsigned int tmp;
 
        if (offset >= size)
                return size;
index 2737fe6d49a7a7e3e0cb114121d36af2e22ca21d..f62ec0e2f083b5b4dd161800ddaca3d07420dbaa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bootinfo.h,v 1.2 2000/01/17 23:32:47 ralf Exp $
+/* $Id: bootinfo.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
  *
  * bootinfo.h -- Definition of the Linux/MIPS boot information structure
  *
index d36aa66d1948ba50753a7a57c2718b43fc76c789..1ac45c9dc45f471daf9dc6263d36b3375cccfb8e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: branch.h,v 1.1 1999/08/21 22:19:17 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
index 69a010c34ae5e7251448d8c61e317cc43c99593a..e86ede7d5aabb0fe30bfd85f115272b5a97664a3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bugs.h,v 1.1 1999/08/18 23:37:50 ralf Exp $
+/* $Id$
  *
  *  Copyright (C) 1995 Waldorf Electronics
  *  Copyright (C) 1997, 1999 Ralf Baechle
index 9121ef06b9e0560e3d618790032d8e5e77c86746..f1746299f336b76c525774d000ae8cde9e587c26 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: byteorder.h,v 1.1 1999/08/18 23:37:50 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
index e3f57853acc80c4d98ed916ffd8716848d40fc5e..c05688a723de8a901a0f2a04614ad2730915d5d9 100644 (file)
@@ -11,6 +11,7 @@
 #define _ASM_CACHE_H
 
 /* bytes per L1 cache line */
-#define L1_CACHE_BYTES 32      /* A guess */
+#define L1_CACHE_BYTES         32      /* A guess */
+#define SMP_CACHE_BYTES                L1_CACHE_BYTES
 
 #endif /* _ASM_CACHE_H */
index b3aa26164828037f2e2677e179f8724d1068b866..94206a81c6048fc372560a3b466dd3a6fef72e96 100644 (file)
@@ -10,8 +10,6 @@
 #ifndef _ASM_CHECKSUM_H
 #define _ASM_CHECKSUM_H
 
-#include <asm/checksum.h>
-
 /*
  * computes the checksum of a memory block at buff, length len,
  * and adds in "sum" (32-bit)
index 32697c3be6b1df64e3944e733612f1bf8b172ec4..9378e18abd448cd83b86a72ff59849cae0a0078d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cpu.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: cpu.h,v 1.1 1999/10/19 20:51:53 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
index f319525091d43f49a714ef0dfe909d3121331eb1..d957f3a4c072ebf1cdafc15ff13a9b62198d710a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: current.h,v 1.4 2000/01/17 23:32:47 ralf Exp $
+/* $Id: current.h,v 1.3 1999/12/04 03:59:12 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
 register struct task_struct *current asm("$28");
 
 #endif /* _LANGUAGE_C */
-#ifdef _LANGUAGE_ASSEMBLY
-
-/*
- * Special variant for use by exception handlers when the stack pointer
- * is not loaded.
- */
-#define _GET_CURRENT(reg)                      \
-       lui     reg, %hi(kernelsp);             \
-       .set    push;                           \
-       .set    noreorder;                      \
-       ld      reg, %lo(kernelsp)(reg);        \
-       .set    pop;                            \
-       ori     reg, 0x3fff;                    \
-       xori    reg, 0x3fff
-
-#endif
-
 #endif /* _ASM_CURRENT_H */
index fa66ef45bc608bc100c968722a8c76a66d8f1f66..4c05d3cc146d8d9f890c89f71a11efd53ae872de 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: delay.h,v 1.1 1999/08/18 23:37:50 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
@@ -13,6 +13,8 @@
 
 #include <linux/config.h>
 
+#include <linux/config.h>
+
 extern __inline__ void
 __delay(unsigned long loops)
 {
index 9c954a454e602c1ef60b476280e62f86d44eff33..bb15c7ac2173d02cb291360209c9b07137c0009d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: div64.h,v 1.1 2000/01/29 01:42:28 ralf Exp $
+/* $Id: div64.h,v 1.1 2000/01/28 23:18: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
index ef380f1d46e122c05fd4d4b44e49ad71537953fb..df2f47f6c425e815c5a7430398b850c9e3574c28 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: dma.h,v 1.4 2000/01/29 01:42:28 ralf Exp $
+/* $Id: dma.h,v 1.5 2000/03/07 15:45:42 ralf Exp $
  *
  * linux/include/asm/dma.h: Defines for using and allocating dma channels.
  * Written by Hennus Bergman, 1992.
@@ -295,4 +295,12 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
 extern int request_dma(unsigned int dmanr, const char * device_id);    /* reserve a DMA channel */
 extern void free_dma(unsigned int dmanr);      /* release it again */
 
+/* From PCI */
+
+#ifdef CONFIG_PCI
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy   (0)
+#endif
+
 #endif /* _ASM_DMA_H */
index a8622afef8f9cc95269b32072041eab13aa9df60..bf279ebcb052a3fc40d75c007bf8f93e84c85e44 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ds1286.h,v 1.1 1999/08/19 22:56:34 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
index 57855c7d75187247d8a8d9d12c428ef602a49752..0c549baf03cbfec945ff85f0a273f842b17e810d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: elf.h,v 1.4 2000/02/24 00:13:20 ralf Exp $
+/* $Id: elf.h,v 1.3 2000/01/17 23:32: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
index c581639f3d6c08ca5d96e77f5008aa73405740a8..b2f507f4f05b7a34bfec1f3c7cbc8c4ed993001c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: errno.h,v 1.2 1999/09/28 22:27:19 ralf Exp $
+/* $Id: errno.h,v 1.1 1999/08/18 23:37: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
index ad0d84a3dd5c877e342a3d78810fc9fe33b1af51..2cd961315e26b2df93e05333c6b1a8e4a2d6ed3e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fcntl.h,v 1.1 1999/08/18 23:37:51 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
index f3273cc8f85c02f311e862711856547aaf6b2eca..3e14397584516589e6dbef4ca9b16cb6ff873cbe 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: floppy.h,v 1.2 1999/08/21 22:19:17 ralf Exp $
+/* $Id$
  *
  * Architecture specific parts of the Floppy driver
  *
index ff4f1f0a08c5152b3623bdb8b9fb1ac8bf071f5d..7cda7a69f5e9494b69fac23cd40a1bba1436a372 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gfx.h,v 1.1 1999/08/19 22:56:34 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
index 177cde386c41b87f303af898e2d0863ba87e9aa9..192b61f7b9a99412ccff49246cb9ae55553ad8b4 100644 (file)
-/* $Id: hardirq.h,v 1.4 2000/02/23 00:41:38 ralf Exp $
+/* $Id: hardirq.h,v 1.6 2000/03/07 15:45:42 ralf Exp $
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1997, 1998, 1999 by Ralf Baechle
- * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 1997 - 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #ifndef _ASM_HARDIRQ_H
 #define _ASM_HARDIRQ_H
 
 #include <linux/config.h>
 #include <linux/threads.h>
+#include <linux/irq.h>
 
-extern unsigned int local_irq_count[NR_CPUS];
+typedef struct {
+       unsigned long __local_irq_count;
+       unsigned long __local_bh_count;
+       unsigned long __pad[14];
+} ____cacheline_aligned irq_cpustat_t;
+
+extern irq_cpustat_t irq_stat [NR_CPUS];
+
+/*
+ * Simple wrappers reducing source bloat
+ */
+#define local_irq_count(cpu) (irq_stat[(cpu)].__local_irq_count)
+#define local_bh_count(cpu) (irq_stat[(cpu)].__local_bh_count)
 
 /*
  * Are we in an interrupt context? Either doing bottom half
  * or hardware interrupt processing?
  */
 #define in_interrupt() ({ int __cpu = smp_processor_id(); \
-       (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
-#define in_irq() (local_irq_count[smp_processor_id()] != 0)
+       (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
+#define in_irq() (local_irq_count(smp_processor_id()) != 0)
 
 #ifndef CONFIG_SMP
 
-#define hardirq_trylock(cpu)   (local_irq_count[cpu] == 0)
+#define hardirq_trylock(cpu)   (local_irq_count(cpu) == 0)
 #define hardirq_endlock(cpu)   do { } while (0)
 
-#define irq_enter(cpu)         (local_irq_count[cpu]++)
-#define irq_exit(cpu)          (local_irq_count[cpu]--)
+#define irq_enter(cpu, irq)    (local_irq_count(cpu)++)
+#define irq_exit(cpu, irq)     (local_irq_count(cpu)--)
 
 #define synchronize_irq()      barrier();
 
 #else
 
-#error No habla MIPS SMP
+#include <asm/atomic.h>
+#include <linux/spinlock.h>
+#include <asm/smp.h>
+
+extern int global_irq_holder;
+extern spinlock_t global_irq_lock;
+
+static inline int irqs_running (void)
+{
+       int i;
+
+       for (i = 0; i < smp_num_cpus; i++)
+               if (local_irq_count(i))
+                       return 1;
+       return 0;
+}
+
+static inline void release_irqlock(int cpu)
+{
+       /* if we didn't own the irq lock, just ignore.. */
+       if (global_irq_holder == cpu) {
+               global_irq_holder = NO_PROC_ID;
+               spin_unlock(&global_irq_lock);
+       }
+}
+
+static inline int hardirq_trylock(int cpu)
+{
+       return !local_irq_count(cpu) && !spin_is_locked(&global_irq_lock);
+}
+
+#define hardirq_endlock(cpu)   do { } while (0)
+
+static inline void irq_enter(int cpu, int irq)
+{
+       ++local_irq_count(cpu);
+
+       while (spin_is_locked(&global_irq_lock))
+               barrier();
+}
+
+static inline void irq_exit(int cpu, int irq)
+{
+       --local_irq_count(cpu);
+}
+
+extern void synchronize_irq(void);
 
 #endif /* CONFIG_SMP */
+
 #endif /* _ASM_HARDIRQ_H */
index 4ece5a73a515e5f11354dd8312c24d922340f6b8..7577696705a6900e8043d3eee36471316fbfd254 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hdreg.h,v 1.1 1999/08/21 22:19:17 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
index 74492aee5b7226f65502f1e7f721d37238eee04d..032acd2ee2143382e5b5bc4292323a2a0ef3d6fb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: highmem.h,v 1.2 2000/01/29 01:42:28 ralf Exp $
+/* $Id: highmem.h,v 1.1 2000/01/27 01:05: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/include/asm-mips64/hw_irq.h b/include/asm-mips64/hw_irq.h
new file mode 100644 (file)
index 0000000..1bf6629
--- /dev/null
@@ -0,0 +1,5 @@
+/* This exists merely to satisfy <linux/irq.h>.  There is
+   nothing that would go here of general interest.
+
+   Everything of consequence is in arch/alpha/kernel/irq_impl.h,
+   to be used only in arch/alpha/kernel/.  */
index 38781d2b2db38b22325c2f8b1bbe2c069e19cc3f..bb3a32200aee2292367496b6967c240f3e6f8081 100644 (file)
 #include <linux/config.h>
 
 #ifndef MAX_HWIFS
+# ifdef CONFIG_BLK_DEV_IDEPCI
+#define MAX_HWIFS      10
+# else
 #define MAX_HWIFS      6
+# endif
 #endif
 
 #define ide__sti()     __sti()
index 5633fe5730b63dbb8b65a82ef95d53d5ca05da79..fdc1328074423d38269659e8b1a6861f947d2534 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: init.h,v 1.1 1999/08/18 23:37:51 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
index baf64c2fe48278610b5a7bdf271406690d1718e1..0a484592f71a2df4d4de7871ee68119d9262bbd8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: inst.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: inst.h,v 1.1 1999/10/09 20:55:09 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
index ec1290996be882306bd730f84310a4f564f759bf..a1ca4492b6bf5ff3a3f09f4cdec4effddd68389a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.10 2000/02/24 00:13:20 ralf Exp $
+/* $Id: io.h,v 1.9 2000/02/04 07:40:53 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
@@ -111,7 +111,7 @@ extern inline void * phys_to_virt(unsigned long address)
        return (void *)(address + PAGE_OFFSET);
 }
 
-#define        BRIDGE_DIRECT_MAPPED_BASE       0xa200000000000000ull
+#define        BRIDGE_DIRECT_MAPPED_BASE       0xa180000000000000ull
 
 /*
  * IO bus memory addresses are also 1:1 with the physical address
@@ -264,44 +264,44 @@ __OUTS(w,l,4)
  *  - you don't have to worry about side effects within the __builtin..
  */
 #define outb(val,port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
-       __outbc((val),(port)) : \
-       __outb((val),(port)))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+       __outbc((val),(port)^(3)) : \
+       __outb((val),(port)^(3)))
 
 #define inb(port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
-       __inbc(port) : \
-       __inb(port))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+       __inbc((port)^(3)) : \
+       __inb((port)^(3)))
 
 #define outb_p(val,port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
-       __outbc_p((val),(port)) : \
-       __outb_p((val),(port)))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+       __outbc_p((val),(port)^(3)) : \
+       __outb_p((val),(port)^(3)))
 
 #define inb_p(port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
-       __inbc_p(port) : \
-       __inb_p(port))
+((__builtin_constant_p((port)^(3)) && ((port)^(3)) < 32768) ? \
+       __inbc_p((port)^(3)) : \
+       __inb_p((port)^(3)))
 
 #define outw(val,port) \
-((__builtin_constant_p((port^2)) && (port^2) < 32768) ? \
-       __outwc((val),(port^2)) : \
-       __outw((val),(port^2)))
+((__builtin_constant_p(((port)^(2))) && ((port)^(2)) < 32768) ? \
+       __outwc((val),((port)^(2))) : \
+       __outw((val),((port)^(2))))
 
 #define inw(port) \
-((__builtin_constant_p((port^2)) && (port^2) < 32768) ? \
-       __inwc(port^2) : \
-       __inw(port^2))
+((__builtin_constant_p(((port)^(2))) && ((port)^(2)) < 32768) ? \
+       __inwc((port)^(2)) : \
+       __inw((port)^(2)))
 
 #define outw_p(val,port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
-       __outwc_p((val),(port)) : \
-       __outw_p((val),(port)))
+((__builtin_constant_p((port)^(2)) && ((port)^(2)) < 32768) ? \
+       __outwc_p((val),(port)^(2)) : \
+       __outw_p((val),(port)^(2)))
 
 #define inw_p(port) \
-((__builtin_constant_p((port)) && (port) < 32768) ? \
-       __inwc_p(port) : \
-       __inw_p(port))
+((__builtin_constant_p((port)^(2)) && ((port)^(2)) < 32768) ? \
+       __inwc_p((port)^(2)) : \
+       __inw_p((port)^(2)))
 
 #define outl(val,port) \
 ((__builtin_constant_p((port)) && (port) < 32768) ? \
index faf6e37ce985eca36749a7f95d531c749706c2fc..ea5b712bae59fffb86cef84a41209680196219b5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioc3.h,v 1.2 2000/02/18 09:54:39 ulfc Exp $
+/* $Id: ioc3.h,v 1.1 2000/01/13 00:17:02 ralf Exp $
  *
  * Copyright (C) 1999 Ralf Baechle
  * This file is part of the Linux driver for the SGI IOC3.
index 4b4d59b05a09a6e2cb57c7db28662e8a0b8c25dc..07b17f83288cbd891260816d7cc599179ce17848 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctl.h,v 1.1 1999/08/18 23:37:51 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
index ecb2bf79509ead777c5cec4d7ecbc67f8f1147c4..7f3cdc0d7b00290b1a1f0ddb68bf9ce82e87cc8b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctls.h,v 1.1 1999/08/18 23:37:51 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
index 3e23a301b2fb8fecade2cd264776cf0d4dac5c8c..5baa58f6e23c09263baf590123e0def5c112cbc9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: irq.h,v 1.1 1999/08/19 22:56:34 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
index 20da59209053fb02bb914df5e65f67867c4e9134..a6a2816e71a6ff6b86c9baacc6d5b20644c85022 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: linux_logo.h,v 1.1 1999/08/19 22:56:34 ralf Exp $
+/* $Id$
  *
  * include/asm-mips/linux_logo.h: This is a linux logo
  *                                to be displayed on boot.
index d4eb7b140eda7fe3d24b4043629b71656a9a4e72..f9e51fa61902096f05eab8442d70d71dc21909fa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mc146818rtc.h,v 1.1 1999/08/19 22:56:34 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
index eafa6462ac9a9617e21cd996816c0b93f898c271..cddc66d393b562c4ea9a5ab1ff158421d04925f8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mipsregs.h,v 1.2 2000/01/17 23:32:47 ralf Exp $
+/* $Id: mipsregs.h,v 1.1 1999/08/18 23:37: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
@@ -238,6 +238,7 @@ __BUILD_SET_CP0(config,CP0_CONFIG)
 #define ST0_CE                 0x00020000
 #define ST0_CH                 0x00040000
 #define ST0_SR                 0x00100000
+#define ST0_TS                 0x00200000
 #define ST0_BEV                        0x00400000
 #define ST0_RE                 0x02000000
 #define ST0_FR                 0x04000000
index b06dac74f009c0218cac621ea098fd21eeda4b35..a7cba2bae695aa056a29cc2b242343c58659d639 100644 (file)
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
+#define MADV_NORMAL    0x0             /* default page-in behavior */
+#define MADV_RANDOM    0x1             /* page-in minimum required */
+#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
+#define MADV_WILLNEED  0x3             /* pre-fault pages */
+#define MADV_DONTNEED  0x4             /* discard these pages */
+
 /* compatibility flags */
 #define MAP_ANON       MAP_ANONYMOUS
 #define MAP_FILE       0
index 878fe8300f5bd2ff713eac08d3a633eaa7329f91..eeb8d9091f888fc2cb470321baef85185c72c8e7 100644 (file)
 #ifndef _ASM_MMU_CONTEXT_H
 #define _ASM_MMU_CONTEXT_H
 
+#include <linux/config.h>
+#include <linux/slab.h>
 #include <asm/pgalloc.h>
+#include <asm/processor.h>
 
-/* Fuck.  The f-word is here so you can grep for it :-)  */
-extern unsigned long asid_cache;
-extern pgd_t *current_pgd;
+#ifndef CONFIG_SMP
+#define CPU_CONTEXT(cpu, mm)   (mm)->context
+#else
+#define CPU_CONTEXT(cpu, mm)   (*((unsigned long *)((mm)->context) + cpu))
+#endif
+#define ASID_CACHE(cpu)                cpu_data[cpu].asid_cache
 
 #define ASID_INC       0x1
 #define ASID_MASK      0xff
@@ -33,14 +39,16 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk,
 #define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1)
 
 extern inline void
-get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
+get_new_cpu_mmu_context(struct mm_struct *mm, unsigned long cpu)
 {
+       unsigned long asid = ASID_CACHE(cpu);
+
        if (! ((asid += ASID_INC) & ASID_MASK) ) {
-               flush_tlb_all(); /* start new asid cycle */
+               _flush_tlb_all(); /* start new asid cycle */
                if (!asid)      /* fix version if needed */
                        asid = ASID_FIRST_VERSION;
        }
-       mm->context = asid_cache = asid;
+       CPU_CONTEXT(cpu, mm) = ASID_CACHE(cpu) = asid;
 }
 
 /*
@@ -50,20 +58,34 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
 extern inline void
 init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 {
+#ifndef CONFIG_SMP
        mm->context = 0;
+#else
+       /* Make sure not to do anything during a clone-vm operation */
+       if ((current == tsk) || (current->mm != mm)) {
+               mm->context = (unsigned long)kmalloc(smp_num_cpus * 
+                                       sizeof(unsigned long), GFP_KERNEL);
+               /*
+                * Init the "context" values so that a tlbpid allocation 
+                * happens on the first switch.
+                */
+               if (mm->context)
+                       memset((void *)mm->context, 0, smp_num_cpus * 
+                                                       sizeof(unsigned long));
+               else
+                       printk("Warning: init_new_context failed\n");
+       }
+#endif
 }
 
 extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                              struct task_struct *tsk, unsigned cpu)
 {
-       unsigned long asid = asid_cache;
-
        /* Check if our ASID is of an older version and thus invalid */
-       if ((next->context ^ asid) & ASID_VERSION_MASK)
-               get_new_mmu_context(next, asid);
+       if ((CPU_CONTEXT(cpu, next) ^ ASID_CACHE(cpu)) & ASID_VERSION_MASK)
+               get_new_cpu_mmu_context(next, cpu);
 
-       current_pgd = next->pgd;
-       set_entryhi(next->context);
+       set_entryhi(CPU_CONTEXT(cpu, next));
 }
 
 /*
@@ -72,7 +94,10 @@ extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
  */
 extern inline void destroy_context(struct mm_struct *mm)
 {
-       /* Nothing to do.  */
+#ifdef CONFIG_SMP
+       if (mm->context)
+               kfree((void *)mm->context);
+#endif
 }
 
 /*
@@ -83,10 +108,9 @@ extern inline void
 activate_mm(struct mm_struct *prev, struct mm_struct *next)
 {
        /* Unconditionally get a new ASID.  */
-       get_new_mmu_context(next, asid_cache);
+       get_new_cpu_mmu_context(next, smp_processor_id());
 
-       current_pgd = next->pgd;
-       set_entryhi(next->context);
+       set_entryhi(CPU_CONTEXT(smp_processor_id(), next));
 }
 
 #endif /* _ASM_MMU_CONTEXT_H */
index 53172cd404cef5cf1a65c744f26aa7ef060a6c29..795aed323df092b60b0623e8c3dc2a6830d87bdb 100644 (file)
@@ -11,9 +11,6 @@
 
 typedef struct plat_pglist_data {
        pg_data_t       gendata;
-       unsigned long   physstart;
-       unsigned long   size;
-       unsigned long   start_mapnr;
 } plat_pg_data_t;
 
 /*
@@ -25,10 +22,10 @@ extern plat_pg_data_t *plat_node_data[];
 
 #define PHYSADDR_TO_NID(pa)            NASID_TO_COMPACT_NODEID(NASID_GET(pa))
 #define PLAT_NODE_DATA(n)              (plat_node_data[n])
-#define PLAT_NODE_DATA_STARTNR(n)      (PLAT_NODE_DATA(n)->start_mapnr)
+#define PLAT_NODE_DATA_STARTNR(n)    (PLAT_NODE_DATA(n)->gendata.node_start_mapnr)
+#define PLAT_NODE_DATA_SIZE(n)      (PLAT_NODE_DATA(n)->gendata.node_size)
 #define PLAT_NODE_DATA_LOCALNR(p, n) \
-                       (((p) - PLAT_NODE_DATA(n)->physstart) >> PAGE_SHIFT)
-#define PAGE_TO_PLAT_NODE(p)           (plat_pg_data_t *)((p)->zone->zone_pgdat)
+               (((p) - PLAT_NODE_DATA(n)->gendata.node_start_paddr) >> PAGE_SHIFT)
 
 #ifdef CONFIG_DISCONTIGMEM
 
@@ -38,8 +35,6 @@ extern plat_pg_data_t *plat_node_data[];
 
 /*
  * Given a kernel address, find the home node of the underlying memory.
- * For production kern_addr_valid, change to return "numnodes" instead
- * of panicing.
  */
 #define KVADDR_TO_NID(kaddr) \
        ((NASID_TO_COMPACT_NODEID(NASID_GET(__pa(kaddr))) != -1) ? \
@@ -57,13 +52,6 @@ extern plat_pg_data_t *plat_node_data[];
  */
 #define NODE_MEM_MAP(nid)      (NODE_DATA(nid)->node_mem_map)
 
-/*
- * Given a mem_map_t, LOCAL_MAP_BASE finds the owning node for the
- * physical page and returns the kaddr for the mem_map of that node.
- */
-#define LOCAL_MAP_BASE(page) \
-                       NODE_MEM_MAP(KVADDR_TO_NID((unsigned long)(page)))
-
 /*
  * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
  * and returns the the mem_map of that node.
@@ -78,6 +66,18 @@ extern plat_pg_data_t *plat_node_data[];
  */
 #define LOCAL_BASE_ADDR(kaddr) ((unsigned long)(kaddr) & ~(NODE_MAX_MEM_SIZE-1))
 
+#define LOCAL_MAP_NR(kvaddr) \
+       (((unsigned long)(kvaddr)-LOCAL_BASE_ADDR((kvaddr))) >> PAGE_SHIFT)
+
+#define MAP_NR(kaddr)  (((unsigned long)(kaddr) > (unsigned long)high_memory)\
+               ? (max_mapnr + 1) : (LOCAL_MAP_NR((kaddr)) + \
+               (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
+               sizeof(mem_map_t))))
+
+#define kern_addr_valid(addr)  ((KVADDR_TO_NID((unsigned long)addr) > \
+       -1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \
+       NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap)))
+
 #endif /* CONFIG_DISCONTIGMEM */
 
 #endif /* _ASM_MMZONE_H_ */
index ac36b113cba2a97d10a33873824874ee4b19cfc1..aed1ebf52c3703bac964d3e0b7e310a070cdcd8e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: namei.h,v 1.1 1999/08/20 21:59:08 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
index 9a5bae456b93e6ffe12d2c5e25c35c4c7cad030f..7c7104415001c7fd438caadf9919d872b6de21d5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ng1.h,v 1.1 1999/08/19 22:56:34 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
index b0d9e97c3688a53fa8811b8935be38c7855ac01b..1397e3203fa6edccec92d24ce00ced1c22ba6a91 100644 (file)
@@ -52,7 +52,8 @@
 #define TASK_COUNTER       56
 #define TASK_PRIORITY      64
 #define TASK_MM            80
-#define TASK_STRUCT_SIZE   1480
+#define TASK_PROCESSOR     100
+#define TASK_STRUCT_SIZE   1432
 
 /* MIPS specific thread_struct offsets. */
 #define THREAD_REG16   896
index d1b5375350d7e20b3b66fc5083aa6106ba1dfd2e..a4e14ab584ee15703f59197bbed9b4a7dafb6dde 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: paccess.h,v 1.3 2000/02/04 07:40:53 ralf Exp $
+/* $Id: paccess.h,v 1.2 2000/01/21 22:34:07 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
index 7b9dfe1288413b288c6de7c3ad3f4fd9ef73ee15..981baa1d7874d881d4237d3b952ee9532e7e4994 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: param.h,v 1.2 2000/01/19 02:08:47 ralf Exp $
+/* $Id: param.h,v 1.1 1999/08/18 23:37: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
index f303ce56951a494853f5d706594fe93843d5e9c0..159e2345d9b28391b01209f2de05ab9f8de199a9 100644 (file)
@@ -1,13 +1,11 @@
-/* $Id: parport.h,v 1.2 2000/02/18 00:24:48 ralf Exp $
- *
- * parport.h: ia32-specific parport initialisation
+/* $Id$
  *
  * Copyright (C) 1999, 2000  Tim Waugh <tim@cyberelk.demon.co.uk>
  *
  * This file should only be included by drivers/parport/parport_pc.c.
  */
 #ifndef _ASM_PARPORT_H
-#define _ASM_PARPORT_H 1
+#define _ASM_PARPORT_H
 
 static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
 static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
@@ -15,4 +13,4 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
        return parport_pc_find_isa_ports (autoirq, autodma);
 }
 
-#endif /* !(_ASM_PARPORT_H) */
+#endif /* _ASM_PARPORT_H */
index 7d4a08e265bd12185ada74cb1130c83608cb4d58..1fc14c5a505540e4332dd8e22fffde69328a76fe 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bridge.h,v 1.1 2000/01/13 00:17:02 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
@@ -828,4 +828,11 @@ typedef union ate_u {
 
 #define BRIDGE_INTERNAL_ATES   128
 
+/* ========================================================================
+ *    Linux pci bus mappings to sn physical id's
+ */
+unsigned char bus_to_wid[256]; /* widget id for linux pci bus */
+unsigned char bus_to_nid[256]; /* nasid for linux pci bus */
+unsigned char num_bridges;     /* number of bridges in the system */
+
 #endif /* _ASM_PCI_BRIDGE_H */
index c7bc5aedcbd8df71f292a70cda393bdbe9a0b310..4db514c487d2ca9a0e65c69ce8522ac965e9a698 100644 (file)
 
 #include <linux/config.h>
 
+#include <linux/config.h>
+
 /* TLB flushing:
  *
  *  - flush_tlb_all() flushes all processes TLB entries
  *  - flush_tlb_mm(mm) flushes the specified mm context TLB entries
  *  - flush_tlb_page(mm, vmaddr) flushes a single page
  *  - flush_tlb_range(mm, start, end) flushes a range of pages
+ *  - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
  */
 extern void (*_flush_tlb_all)(void);
 extern void (*_flush_tlb_mm)(struct mm_struct *mm);
@@ -25,11 +28,22 @@ extern void (*_flush_tlb_range)(struct mm_struct *mm, unsigned long start,
                               unsigned long end);
 extern void (*_flush_tlb_page)(struct vm_area_struct *vma, unsigned long page);
 
+#ifndef CONFIG_SMP
+
 #define flush_tlb_all()                        _flush_tlb_all()
 #define flush_tlb_mm(mm)               _flush_tlb_mm(mm)
 #define flush_tlb_range(mm,vmaddr,end) _flush_tlb_range(mm, vmaddr, end)
 #define flush_tlb_page(vma,page)       _flush_tlb_page(vma, page)
 
+#else /* CONFIG_SMP */
+
+extern void flush_tlb_all(void);
+extern void flush_tlb_mm(struct mm_struct *);
+extern void flush_tlb_range(struct mm_struct *, unsigned long, unsigned long);
+extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
+
+#endif /* CONFIG_SMP */
+
 extern inline void flush_tlb_pgtables(struct mm_struct *mm,
                                       unsigned long start, unsigned long end)
 {
@@ -111,8 +125,8 @@ extern inline pmd_t *get_pmd_fast(void)
 {
        unsigned long *ret;
 
-       if ((ret = (unsigned long *)pte_quicklist) != NULL) {
-               pte_quicklist = (unsigned long *)(*ret);
+       if ((ret = (unsigned long *)pmd_quicklist) != NULL) {
+               pmd_quicklist = (unsigned long *)(*ret);
                ret[0] = ret[1];
                pgtable_cache_size--;
                return (pmd_t *)ret;
@@ -123,8 +137,8 @@ extern inline pmd_t *get_pmd_fast(void)
 
 extern inline void free_pmd_fast(pmd_t *pmd)
 {
-       *(unsigned long *)pmd = (unsigned long) pte_quicklist;
-       pte_quicklist = (unsigned long *) pmd;
+       *(unsigned long *)pmd = (unsigned long) pmd_quicklist;
+       pmd_quicklist = (unsigned long *) pmd;
        pgtable_cache_size++;
 }
 
index 816decddb9fced0ad02043167021fcccc77c02c3..af4251f385546546b831244d3a95a5fed3a2e961 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.12 2000/02/24 00:13:20 ralf Exp $
+/* $Id: pgtable.h,v 1.14 2000/03/02 02:37:13 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
@@ -72,6 +72,7 @@ extern void (*_flush_page_to_ram)(struct page * page);
 #define PTRS_PER_PMD   1024
 #define PTRS_PER_PTE   512
 #define USER_PTRS_PER_PGD      (TASK_SIZE/PGDIR_SIZE)
+#define FIRST_USER_PGD_NR      0
 
 #define VMALLOC_START     XKSEG
 #define VMALLOC_VMADDR(x) ((unsigned long)(x))
@@ -123,15 +124,15 @@ extern void (*_flush_page_to_ram)(struct page * page);
 
 #define _PAGE_CHG_MASK  (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK)
 
-#define PAGE_NONE      __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
+#define PAGE_NONE      __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_COW)
 #define PAGE_SHARED     __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
-                       _CACHE_CACHABLE_NONCOHERENT)
+                       _CACHE_CACHABLE_COW)
 #define PAGE_COPY       __pgprot(_PAGE_PRESENT | _PAGE_READ | \
-                       _CACHE_CACHABLE_NONCOHERENT)
+                       _CACHE_CACHABLE_COW)
 #define PAGE_READONLY   __pgprot(_PAGE_PRESENT | _PAGE_READ | \
-                       _CACHE_CACHABLE_NONCOHERENT)
+                       _CACHE_CACHABLE_COW)
 #define PAGE_KERNEL    __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
-                       _CACHE_CACHABLE_NONCOHERENT)
+                       _CACHE_CACHABLE_COW)
 #define PAGE_USERIO     __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
                        _CACHE_UNCACHED)
 #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
@@ -204,7 +205,7 @@ extern unsigned long zero_page_mask;
 #define PAGE_PTR(address) \
 ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
 
-extern pte_t invalid_pte_table[PAGE_SIZE/sizeof(pte_t)];
+extern pte_t invalid_pte_table[2*PAGE_SIZE/sizeof(pte_t)];
 extern pmd_t invalid_pmd_table[2*PAGE_SIZE/sizeof(pmd_t)];
 
 /*
@@ -411,8 +412,8 @@ extern inline pte_t pte_mkyoung(pte_t pte)
 #define PAGE_TO_PA(page)       ((page - mem_map) << PAGE_SHIFT)
 #else
 #define PAGE_TO_PA(page) \
-               ((((page)-(page)->zone->zone_pgdat->node_mem_map) << PAGE_SHIFT) \
-               + ((PAGE_TO_PLAT_NODE(page))->physstart))
+               ((((page)-(page)->zone->zone_mem_map) << PAGE_SHIFT) \
+               + ((page)->zone->zone_start_paddr))
 #endif
 #define mk_pte(page, pgprot)                                           \
 ({                                                                     \
@@ -469,6 +470,7 @@ extern void pgd_init(unsigned long page);
 extern void pmd_init(unsigned long page);
 
 extern pgd_t swapper_pg_dir[1024];
+extern void paging_init(void);
 
 extern void (*update_mmu_cache)(struct vm_area_struct *vma,
                                unsigned long address, pte_t pte);
index 23bf6eaa8e7eb661beb21cd4c1f9c4e85a1671c8..7d14790b9674a461f8243ce818e4b95d1a5c7ce8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: poll.h,v 1.1 1999/08/19 22:56:34 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
index 37f5fe763d2e439b977357f663dab7e489c75e05..44ab2568dcd5a7375f7184fb57cec398ad6efe27 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: posix_types.h,v 1.4 2000/02/16 01:07:49 ralf Exp $
+/* $Id: posix_types.h,v 1.5 2000/02/29 20:49:16 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
@@ -49,6 +49,26 @@ typedef struct {
         int    val[2];
 } __kernel_fsid_t;
 
+/* Now 32bit compatibility types */
+typedef unsigned int   __kernel_dev_t32;
+typedef unsigned int   __kernel_ino_t32;
+typedef unsigned int   __kernel_mode_t32;
+typedef unsigned int   __kernel_nlink_t32;
+typedef int            __kernel_off_t32;
+typedef int            __kernel_pid_t32;
+typedef int            __kernel_ipc_pid_t32;
+typedef int            __kernel_uid_t32;
+typedef int            __kernel_gid_t32;
+typedef unsigned int   __kernel_size_t32;
+typedef int            __kernel_ssize_t32;
+typedef int            __kernel_ptrdiff_t32;
+typedef int            __kernel_time_t32;
+typedef int            __kernel_suseconds_t32;
+typedef int            __kernel_clock_t32;
+typedef int            __kernel_daddr_t32;
+typedef char *         __kernel_caddr_t32;
+typedef __kernel_fsid_t        __kernel_fsid_t32;
+
 #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
 
 #undef __FD_SET
index 3b5338bc935da0331465402d80275cbd3d2e4c23..7245e27b08886e4c1079f59d7ba765677e6de28a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.10 2000/02/24 00:13:20 ralf Exp $
+/* $Id: processor.h,v 1.11 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
@@ -12,6 +12,8 @@
 #ifndef _ASM_PROCESSOR_H
 #define _ASM_PROCESSOR_H
 
+#include <linux/config.h>
+
 /*
  * Default implementation of macro that returns current
  * instruction pointer ("program counter").
 #include <asm/reg.h>
 #include <asm/system.h>
 
-struct mips_cpuinfo {
+#if (defined(CONFIG_SGI_IP27))
+#include <asm/sn/types.h>
+#include <asm/sn/intr_public.h>
+#endif
+
+struct cpuinfo_mips {
        unsigned long udelay_val;
        unsigned long *pgd_quick;
        unsigned long *pmd_quick;
        unsigned long *pte_quick;
        unsigned long pgtable_cache_sz;
-};
+       unsigned long last_asn;
+       unsigned int irq_count, bh_count;
+       unsigned long asid_cache;
+#if defined(CONFIG_SGI_IP27)
+       cnodeid_t       p_nodeid;       /* my node ID in compact-id-space */
+       nasid_t         p_nasid;        /* my node ID in numa-as-id-space */
+       unsigned char   p_slice;        /* Physical position on node board */
+       hub_intmasks_t  p_intmasks;     /* SN0 per-CPU interrupt masks */
+#endif
+} __attribute__((aligned(128)));
 
 /*
  * System setup and hardware flags..
@@ -43,15 +59,13 @@ extern char dedicated_iv_available; /* some embedded MIPS like Nevada */
 extern char vce_available;             /* Supports VCED / VCEI exceptions */
 extern char mips4_available;           /* CPU has MIPS IV ISA or better */
 
-extern struct mips_cpuinfo boot_cpu_data;
 extern unsigned int vced_count, vcei_count;
+extern struct cpuinfo_mips cpu_data[];
 
 #ifdef CONFIG_SMP
-extern struct mips_cpuinfo cpu_data[];
 #define current_cpu_data cpu_data[smp_processor_id()]
 #else
-#define cpu_data &boot_cpu_data
-#define current_cpu_data boot_cpu_data
+#define current_cpu_data cpu_data[0]
 #endif
 
 /*
@@ -74,6 +88,14 @@ extern int EISA_bus;
 /* Lazy FPU handling on uni-processor */
 extern struct task_struct *last_task_used_math;
 
+#ifndef CONFIG_SMP
+#define IS_FPU_OWNER()         (last_task_used_math == current)
+#define CLEAR_FPU_OWNER()      last_task_used_math = NULL;
+#else
+#define IS_FPU_OWNER()         (current->flags & PF_USEDFPU)
+#define CLEAR_FPU_OWNER()      current->flags &= ~PF_USEDFPU;
+#endif
+
 /*
  * User space process size: 1TB. This is hardcoded into a few places,
  * so don't change it unless you know what you are doing.  TASK_SIZE
@@ -215,13 +237,19 @@ extern int (*_user_mode)(struct pt_regs *);
 /*
  * Do necessary setup to start up a newly executed thread.
  */
-#define start_thread(regs, new_pc, new_sp) do {                                \
+#define start_thread(regs, pc, sp)                                     \
+do {                                                                   \
+       unsigned long __status;                                         \
+                                                                       \
        /* New thread looses kernel privileges. */                      \
-       regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KSU_USER;\
-       regs->cp0_epc = new_pc;                                         \
-       regs->regs[29] = new_sp;                                        \
+       __status = regs->cp0_status & ~(ST0_CU0|ST0_FR|ST0_KSU);        \
+       __status |= KSU_USER;                                           \
+       __status |= (current->thread.mflags & MF_32BIT) ? 0 : ST0_FR;   \
+       regs->cp0_status = __status;                                    \
+       regs->cp0_epc = pc;                                             \
+       regs->regs[29] = sp;                                            \
        current->thread.current_ds = USER_DS;                           \
-} while (0)
+} while(0)
 
 unsigned long get_wchan(struct task_struct *p);
 
index aa5e158b9c77ca3a6b93c0972899990831c6016c..ff5745e24614e8387b7e32b3ec54e60d41aae200 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ptrace.h,v 1.4 2000/02/24 00:13:20 ralf Exp $
+/* $Id: ptrace.h,v 1.3 1999/12/04 03:59:12 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
index 228d0fb9897436b75dce99369013bb1f1e29a66b..77d14e9a7573cd09e6f41fad9d7f1cb9a5cd9502 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: r10kcache.h,v 1.2 2000/01/17 23:32:47 ralf Exp $
+/* $Id: r10kcache.h,v 1.1 2000/01/16 01:27: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
index 81419e8cf590e770e03ee2bd29adfc677c8804fe..88251c1f03e52570020cc061344fe1937c82c9ec 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: r10kcacheops.h,v 1.1 2000/01/16 01:27:14 ralf Exp $
+/* $Id: r10kcacheops.h,v 1.1 2000/01/12 23:18: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
index 29c42c2cfdce96b362f461110ca39debd5fdc8ce..cee70ceb9263887895427d0928cb9a9f29da2a28 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: r4kcache.h,v 1.2 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
index 9b273598bba6f24d6104f570bc99954dce866113..bc4b924ed883da0725a5ed166f694c4045538f69 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: r4kcacheops.h,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
index dc6634e544fc46184c4b666272525efa6534c5a2..a6853fb69a2552c4d930146771a31ffb54cc3fc9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: regdef.h,v 1.1 1999/08/20 21:59:08 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
index 3d194d420989e73e1b35ff1c7e6c6743dae4aa79..199a9a4e6a1e817c218fc7b414a42e2ef14e4b50 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: resource.h,v 1.4 2000/02/04 07:40:53 ralf Exp $
+/* $Id: resource.h,v 1.3 2000/01/27 23:45:30 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
index e11ed4834cbdd82a2dc6ddc98d6a62c616d7d893..fa2f7064546acfe9d1e97bd95ac6459e5da45e39 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: semaphore-helper.h,v 1.3 1999/12/04 03:59:12 ralf Exp $
+/* $Id: semaphore-helper.h,v 1.2 1999/10/20 18:10:32 ralf Exp $
  *
  * SMP- and interrupt-safe semaphores helper functions.
  *
index a36d087f5e88764e74f44bbd1dd972931404a7ca..0ca9689e663ed190a2d6424f1caf401e2cda38df 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: semaphore.h,v 1.6 2000/02/24 03:09:52 ulfc Exp $
+/* $Id: semaphore.h,v 1.5 2000/02/18 00:24:49 ralf Exp $
  *
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
index e773f2b8aa288824a4a98304f356de21ae45a519..82abb1fc250247378f7729cf5c549acdce6bb071 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: serial.h,v 1.3 2000/02/04 07:40:53 ralf Exp $
+/* $Id: serial.h,v 1.2 2000/01/17 23:32: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
index 7d92335fbbce3756c244cb59b29eb2d0faeeedd5..77489223909cbdeafb15a9520c988288b8f9e23e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.1 2000/02/04 07:40:53 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
index 1a82e9f11ad659dac3aedf6b923275386f8e3a4a..0e6840aed2a673a4e3a602463470f3491b076273 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgi.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgi.h,v 1.1 1999/08/20 21:13: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
index d5b1dc45ec6f106813de7957da3c68aabfc5971c..ab9ede57e68c9a0c30348f9747ddda3d5a713a61 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgihpc.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgihpc.h,v 1.2 1999/10/19 20:51: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
index 23c9e495cf866e1c3a52e10ad5417113aa3ccfea..56b5b5d19bdede96001cf13ce238207c739f416d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgimc.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgimc.h,v 1.2 1999/10/19 20:51: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
index 591021847b0c4981991568207e4829ab93ea3cd3..83c465b620aa4f97c9878d65f0e4c4ccbe1f98a6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgint23.h,v 1.2 1999/12/04 03:59:13 ralf Exp $
+/* $Id: sgint23.h,v 1.3 1999/10/20 18:10: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
index 4c3fcb514e9e7d4ca2c6c089a937688d7661d58c..ab02c8fd991f84d6eea06b9cc8cffd3773188ec7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgialib.h,v 1.4 2000/01/17 23:32:47 ralf Exp $
+/* $Id: sgialib.h,v 1.3 1999/12/04 03:59:12 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
index 4446bea128ab81286f2bc64a38fb6495d6f7a2e5..457c03af1b00e36a93ee26095f5260a2f8199ea2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgiarcs.h,v 1.5 2000/01/17 23:32:47 ralf Exp $
+/* $Id: sgiarcs.h,v 1.4 1999/12/04 03:59:12 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
index 8c4df4d366f06f003de50d07d9af8caf28240f3b..195ab5e471ff0e2dd01642a51c7e10cdf20bc7ea 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sgidefs.h,v 1.2 1999/08/20 21:59:08 ralf Exp $
+/* $Id: sgidefs.h,v 1.1 1999/08/18 23:37: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
index bfd41cb0b1cfe7aacef295fe11e8122a44b18eb0..cbce272121f0dd42c235ab8c17bee6972d16b9ca 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: shmiq.h,v 1.1 1999/08/19 22:56:34 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
index 1be80b3a6f93edb5f0584fd5370635f049509fa0..9107b35a7775f683b5611aded2a687c8c45aa673 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: shmparam.h,v 1.2 2000/01/29 01:42:28 ralf Exp $
+/* $Id: shmparam.h,v 1.1 1999/08/19 22:56:35 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
index c032e78860414cfaebd3778d743a51c92d2e6512..215d56124d7371341055d665f797f5995e6c1f92 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sigcontext.h,v 1.2 1999/09/28 22:27:19 ralf Exp $
+/* $Id: sigcontext.h,v 1.2 1999/09/27 16:01: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
index bda45071d429ca6dead3749181707c7cebfb4cfc..f207032736b116c09fec17d96dd3ad5e811bccd7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: siginfo.h,v 1.3 2000/02/18 00:24:49 ralf Exp $
+/* $Id: siginfo.h,v 1.2 2000/01/27 01:05: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
index 75c662d72565e0c754b3dc4aad70b9d165b7052b..e8e45dc25d3d26f8e4b1424b5f4fb61639d744fa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: signal.h,v 1.2 1999/09/28 22:27:19 ralf Exp $
+/* $Id: signal.h,v 1.2 1999/09/27 16:01: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
@@ -21,6 +21,7 @@ typedef struct {
 } sigset_t;
 
 typedef unsigned long old_sigset_t;            /* at least 32 bits */
+typedef unsigned int old_sigset_t32;
 
 #define SIGHUP          1      /* Hangup (POSIX).  */
 #define SIGINT          2      /* Interrupt (ANSI).  */
diff --git a/include/asm-mips64/smp.h b/include/asm-mips64/smp.h
new file mode 100644 (file)
index 0000000..ed0420d
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef __ASM_SMP_H
+#define __ASM_SMP_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_SMP
+
+#include <linux/threads.h>
+#include <linux/irq.h>
+
+#if 0
+struct cpuinfo_mips {                          /* XXX  */
+       unsigned long loops_per_sec;
+       unsigned long last_asn;
+       unsigned long *pgd_cache;
+       unsigned long *pte_cache;
+       unsigned long pgtable_cache_sz;
+       unsigned long ipi_count;
+       unsigned long irq_attempt[NR_IRQS];
+       unsigned long smp_local_irq_count;
+       unsigned long prof_multiplier;
+       unsigned long prof_counter;
+       int irq_count, bh_count;
+} __attribute__((aligned(64)));
+
+extern struct cpuinfo_mips cpu_data[NR_CPUS];
+#endif
+
+#define smp_processor_id()     (current->processor)
+
+#define PROC_CHANGE_PENALTY    20
+
+/* Map from cpu id to sequential logical cpu number.  This will only
+   not be idempotent when cpus failed to come on-line.  */
+extern int __cpu_number_map[NR_CPUS];
+#define cpu_number_map(cpu)  __cpu_number_map[cpu]
+
+/* The reverse map from sequential logical cpu number to cpu id.  */
+extern int __cpu_logical_map[NR_CPUS];
+#define cpu_logical_map(cpu)  __cpu_logical_map[cpu]
+
+/* Good enough for toy^Wupto 64 CPU Origins.  */
+extern unsigned long cpu_present_mask;
+
+#endif
+
+#define NO_PROC_ID     (-1)
+
+#endif __ASM_SMP_H
diff --git a/include/asm-mips64/smplock.h b/include/asm-mips64/smplock.h
new file mode 100644 (file)
index 0000000..f0b627e
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * <asm/smplock.h>
+ *
+ * Default SMP lock implementation
+ */
+#ifndef _ASM_SMPLOCK_H
+#define _ASM_SMPLOCK_H
+
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/spinlock.h>
+
+extern spinlock_t kernel_flag;
+
+#define kernel_locked()                        spin_is_locked(&kernel_flag)
+
+/*
+ * Release global kernel lock and global interrupt lock
+ */
+static __inline__ void release_kernel_lock(struct task_struct *task, int cpu)
+{
+       if (task->lock_depth >= 0)
+               spin_unlock(&kernel_flag);
+       release_irqlock(cpu);
+       __sti();
+}
+
+/*
+ * Re-acquire the kernel lock
+ */
+static __inline__ void reacquire_kernel_lock(struct task_struct *task)
+{
+       if (task->lock_depth >= 0)
+               spin_lock(&kernel_flag);
+}
+
+/*
+ * Getting the big kernel lock.
+ *
+ * This cannot happen asynchronously,
+ * so we only need to worry about other
+ * CPU's.
+ */
+static __inline__ void lock_kernel(void)
+{
+       if (!++current->lock_depth)
+               spin_lock(&kernel_flag);
+}
+
+static __inline__ void unlock_kernel(void)
+{
+       if (--current->lock_depth < 0)
+               spin_unlock(&kernel_flag);
+}
+
+#endif /* _ASM_SMPLOCK_H */
index a7f71bbd2df41ede32590da76cbf44b604d58efe..225adb30c932c6415406df4e0667ab51e30793ce 100644 (file)
@@ -1,11 +1,9 @@
-/* $Id: addrs.h,v 1.1 2000/01/13 00:17:02 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
  * for more details.
  *
- * Derived from IRIX <sys/SN/addrs.h>.
- *
  * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
  * Copyright (C) 1999 by Ralf Baechle
  */
 #include <asm/reg.h>
 #include <asm/sn/kldir.h>
 
+#if defined(CONFIG_SGI_IP27)
+#include <asm/sn/sn0/addrs.h>
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/sn/sn1/addrs.h>
+#endif
+
+
 #if _LANGUAGE_C
 
+#if defined(CONFIG_SGI_IO)     /* FIXME */
+#define PS_UINT_CAST           (__psunsigned_t)
+#define UINT64_CAST            (__uint64_t)
+#else  /* CONFIG_SGI_IO */
 #define PS_UINT_CAST           (unsigned long)
 #define UINT64_CAST            (unsigned long)
+#endif /* CONFIG_SGI_IO */
+
 #define HUBREG_CAST            (volatile hubreg_t *)
 
 #elif _LANGUAGE_ASSEMBLY
@@ -36,7 +47,9 @@
 
 
 #define NASID_GET_META(_n)     ((_n) >> NASID_LOCAL_BITS)
+#ifdef CONFIG_SGI_IP27
 #define NASID_GET_LOCAL(_n)    ((_n) & 0xf)
+#endif
 #define NASID_MAKE(_m, _l)     (((_m) << NASID_LOCAL_BITS) | (_l))
 
 #define NODE_ADDRSPACE_MASK    (NODE_ADDRSPACE_SIZE - 1)
  * The bottom of ualias space is flipped depending on whether you're
  * processor 0 or 1 within a node.
  */
+#ifdef CONFIG_SGI_IP27
 #define UALIAS_FLIP_BASE       UALIAS_BASE
 #define UALIAS_FLIP_SIZE       0x20000
 #define UALIAS_FLIP_BIT                0x10000
 #define LBOOT_BASE             (HSPEC_BASE + 0x10000000)
 #define LBOOT_SIZE             0x10000000
 #define LBOOT_LIMIT            (LBOOT_BASE + LBOOT_SIZE)
+#define LBOOT_STRIDE           0               /* IP27 has only one CPU PROM */
+
+#endif
 
 #define        HUB_REGISTER_WIDGET     1
 #define IALIAS_BASE            NODE_SWIN_BASE(0, HUB_REGISTER_WIDGET)
 /*
  * Macro for referring to Hub's RBOOT space
  */
+
+#ifdef CONFIG_SGI_IP27
 #define RBOOT_SIZE             0x10000000      /* 256 Megabytes */
 #define NODE_RBOOT_BASE(_n)    (NODE_HSPEC_BASE(_n) + 0x30000000)
 #define NODE_RBOOT_LIMIT(_n)   (NODE_RBOOT_BASE(_n) + RBOOT_SIZE)
 
+#endif
+
 /*
  * Macros for referring the Hub's back door space
  *
  *   BDDIR_ENTRY_HI returns the address of the high double-word of the entry.
  *   BDPRT_ENTRY    returns the address of the double-word protection entry
  *                  corresponding to the page containing the physical address.
+ *   BDPRT_ENTRY_S  Stores the value into the protection entry.
+ *   BDPRT_ENTRY_L  Load the value from the protection entry.
  *   BDECC_ENTRY    returns the address of the ECC byte corresponding to a
  *                  double-word at a specified physical address.
+ *   BDECC_ENTRY_H  returns the address of the two ECC bytes corresponding to a
+ *                  quad-word at a specified physical address.
  */
 #define NODE_BDOOR_BASE(_n)    (NODE_HSPEC_BASE(_n) + (NODE_ADDRSPACE_SIZE/2))
 
 #define NODE_BDECC_BASE(_n)    (NODE_BDOOR_BASE(_n))
 #define NODE_BDDIR_BASE(_n)    (NODE_BDOOR_BASE(_n) + (NODE_ADDRSPACE_SIZE/4))
-
+#ifdef CONFIG_SGI_IP27
 #define BDDIR_ENTRY_LO(_pa)    ((HSPEC_BASE +                                \
                                  NODE_ADDRSPACE_SIZE * 3 / 4 +               \
                                  0x200)                                    | \
                                 UINT64_CAST (_pa)       & NASID_MASK       | \
                                 UINT64_CAST (_pa) >> 2 & BDDIR_UPPER_MASK  | \
                                 (_rgn) << 3)
+#define BDPRT_ENTRY_ADDR(_pa,_rgn) (BDPRT_ENTRY((_pa),(_rgn)))
+#define BDPRT_ENTRY_S(_pa,_rgn,_val) (*(__psunsigned_t *)BDPRT_ENTRY((_pa),(_rgn))=(_val))
+#define BDPRT_ENTRY_L(_pa,_rgn)        (*(__psunsigned_t *)BDPRT_ENTRY((_pa),(_rgn)))
 
 #define BDECC_ENTRY(_pa)       ((HSPEC_BASE +                                \
                                  NODE_ADDRSPACE_SIZE / 2)                  | \
 #define BDECC_TO_MEM(_ba)      (UINT64_CAST  (_ba) & NASID_MASK            | \
                                 (UINT64_CAST (_ba) & BDECC_UPPER_MASK)<<2  | \
                                 (UINT64_CAST (_ba) & 3) << 3)
+#endif /* CONFIG_SGI_IP27 */
 
 
 /*
 #define LOCAL_HUB(_x)          (HUBREG_CAST (IALIAS_BASE + (_x)))
 #define REMOTE_HUB(_n, _x)     (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) +   \
                                              0x800000 + (_x)))
-
 #endif /* _STANDALONE */
 
 /*
 #define LOCAL_HUB_ADDR(_x)     (HUBREG_CAST (IALIAS_BASE + (_x)))
 #define REMOTE_HUB_ADDR(_n, _x)        (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) +   \
                                              0x800000 + (_x)))
+#ifdef CONFIG_SGI_IP27
+#define REMOTE_HUB_PI_ADDR(_n, _sn, _x)        (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) +   \
+                                             0x800000 + (_x)))
+#endif /* CONFIG_SGI_IP27 */
 
 #if _LANGUAGE_C
 
 #define LOCAL_HUB_S(_r, _d)            HUB_S(LOCAL_HUB_ADDR(_r), (_d))
 #define REMOTE_HUB_L(_n, _r)           HUB_L(REMOTE_HUB_ADDR((_n), (_r)))
 #define REMOTE_HUB_S(_n, _r, _d)       HUB_S(REMOTE_HUB_ADDR((_n), (_r)), (_d))
+#define REMOTE_HUB_PI_L(_n, _sn, _r)   HUB_L(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)))
+#define REMOTE_HUB_PI_S(_n, _sn, _r, _d) HUB_S(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)), (_d))
 
 #endif /* _LANGUAGE_C */
 
 /* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a
  * relocatable program
  */
-#ifdef SN0XXL
-#define UNIX_DEBUG_LOADADDR     0x360000
-#else
 #define        UNIX_DEBUG_LOADADDR     0x300000
-#endif
 #define        SYMMON_LOADADDR(nasid)                                          \
        TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000))
 
 #define        KERN_XP_ADDR(nasid)     KLD_KERN_XP(nasid)->pointer
 #define        KERN_XP_SIZE(nasid)     KLD_KERN_XP(nasid)->size
 
+#define GPDA_ADDR(nasid)       TO_NODE_CAC(nasid, GPDA_OFFSET)
+
 #endif /* _LANGUAGE_C */
 
-/* Fixme for SN1 */
-#include <asm/sn/sn0/addrs.h>
 
 #endif /* _ASM_SN_ADDRS_H */
index 8bd832b821c5d857a298a8109fb79508c258760c..f9115805ef69261e1a2bca9dce5d130f0aa3bf98 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: agent.h,v 1.1 2000/01/13 00:17:02 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
 
 #include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
-//#include <sys/SN/io.h>
+//#include <asm/sn/io.h>
 
+#if defined(CONFIG_SGI_IP27)
 #include <asm/sn/sn0/hub.h>
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/sn/sn1/hub.h>
+#endif /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
 
 /*
  * NIC register macros
  */
 
+#if defined(CONFIG_SGI_IP27)
 #define HUB_NIC_ADDR(_cpuid)                                              \
        REMOTE_HUB_ADDR(COMPACT_TO_NASID_NODEID(cputocnode(_cpuid)),       \
                MD_MLAN_CTL)
+#endif
 
 #define SET_HUB_NIC(_my_cpuid, _val)                                      \
        (HUB_S(HUB_NIC_ADDR(_my_cpuid), (_val)))
index edd79283bc43ed2720c6461ef60c26902e027dc6..b6f59b2329f916ec23f366919b428539dd1e1bd3 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: arch.h,v 1.2 2000/02/10 07:28:35 kanoj 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
  * for more details.
  *
- * SGI IP27 specific setup.
+ * SGI specific setup.
  *
  * Copyright (C) 1995 - 1997, 1999 Silcon Graphics, Inc.
  * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
 #define _ASM_SN_ARCH_H
 
 #include <linux/types.h>
+#include <linux/config.h>
 
+#if !defined(CONFIG_SGI_IO)
 #include <asm/sn/types.h>
 #include <asm/sn/sn0/arch.h>
+#endif
+
 
 #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
+#if !defined(CONFIG_SGI_IO)
 typedef u64    hubreg_t;
 typedef u64    nic_t;
 #endif
+#endif
 
+#ifdef CONFIG_SGI_IP27
 #define CPUS_PER_NODE          2       /* CPUs on a single hub */
 #define CPUS_PER_NODE_SHFT     1       /* Bits to shift in the node number */
+#define CPUS_PER_SUBNODE       2       /* CPUs on a single hub PI */
+#endif
 #define CNODE_NUM_CPUS(_cnode)         (NODEPDA(_cnode)->node_num_cpus)
+
 #define CNODE_TO_CPU_BASE(_cnode)      (NODEPDA(_cnode)->node_first_cpu)
 #define cputocnode(cpu)                                \
-               (ASSERT(pdaindr[(cpu)].pda), (pdaindr[(cpu)].pda->p_nodeid))
+               (cpu_data[(cpu)].p_nodeid)
 #define cputonasid(cpu)                                \
-               (ASSERT(pdaindr[(cpu)].pda), (pdaindr[(cpu)].pda->p_nasid))
+               (cpu_data[(cpu)].p_nasid)
 #define cputoslice(cpu)                                \
-               (ASSERT(pdaindr[(cpu)].pda), (pdaindr[(cpu)].pda->p_slice))
+               (cpu_data[(cpu)].p_slice)
 #define makespnum(_nasid, _slice)                                      \
                (((_nasid) << CPUS_PER_NODE_SHFT) | (_slice))
 
-
 #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
 
 #define INVALID_NASID          (nasid_t)-1
@@ -45,6 +54,9 @@ typedef u64   nic_t;
 #define        INVALID_PARTID          (partid_t)-1
 
 extern nasid_t get_nasid(void);
+extern cnodeid_t get_cpu_cnode(int);
+extern int get_cpu_slice(cpuid_t);
+
 /*
  * NO ONE should access these arrays directly.  The only reason we refer to
  * them here is to avoid the procedure call that would be required in the
@@ -64,6 +76,12 @@ extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
     ((nnode) >> \
      (is_fine_dirmode() ? NASID_TO_FINEREG_SHFT : NASID_TO_COARSEREG_SHFT))
 
+#if !defined(_STANDALONE)
+extern cnodeid_t nasid_to_compact_node[MAX_NASIDS];
+extern nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
+extern cnodeid_t cpuid_to_compact_node[MAXCPUS];
+#endif
+
 #if !defined(DEBUG) && (!defined(SABLE) || defined(_STANDALONE))
 
 #define NASID_TO_COMPACT_NODEID(nnode) (nasid_to_compact_node[nnode])
@@ -90,13 +108,8 @@ extern int node_getlastslot(cnodeid_t);
 #define SLOT_BITMASK           (MAX_MEM_SLOTS - 1)
 #define SLOT_SIZE              (1LL<<SLOT_SHIFT)
 
-#if SABLE
-#define node_getnumslots(node) (1)
-#define        NODE_MAX_MEM_SIZE       SLOT_SIZE * 1
-#else
 #define node_getnumslots(node) (MAX_MEM_SLOTS)
 #define NODE_MAX_MEM_SIZE      SLOT_SIZE * MAX_MEM_SLOTS
-#endif /* SABLE */
 
 /*
  * New stuff in here from Irix sys/pfdat.h.
index 8ae09507ac5baeec2f05a7f0c5a2be1d3748a200..5980764633a216c8ea2118c7859f6922b1a94f4a 100644 (file)
@@ -1,23 +1,19 @@
-/**************************************************************************
- *                                                                        *
- *               Copyright (C) 1992-1997, Silicon Graphics, Inc.          *
- *                                                                        *
- *  These coded instructions, statements, and computer programs  contain  *
- *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
- *  are protected by Federal copyright law.  They  may  not be disclosed  *
- *  to  third  parties  or copied or duplicated in any form, in whole or  *
- *  in part, without the prior written consent of Silicon Graphics, Inc.  *
- *                                                                        *
- **************************************************************************/
-
-/*
+/* $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
+ * for more details.
+ *
+ * Derived from IRIX <sys/SN/gda.h>.
+ *
+ * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
+ *
  * gda.h -- Contains the data structure for the global data area,
  *     The GDA contains information communicated between the
  *     PROM, SYMMON, and the kernel. 
  */
-
-#ifndef __SYS_SN_GDA_H__
-#define __SYS_SN_GDA_H__
+#ifndef _ASM_SN_GDA_H
+#define _ASM_SN_GDA_H
 
 #include <asm/sn/addrs.h>
 
@@ -109,4 +105,4 @@ typedef struct gda {
 #define PROMOP_BIST1           0x0800          /* keep track of which BIST ran */
 #define PROMOP_BIST2           0x1000          /* keep track of which BIST ran */
 
-#endif /* __SYS_SN_GDA_H__ */
+#endif /* _ASM_SN_GDA_H */
diff --git a/include/asm-mips64/sn/intr.h b/include/asm-mips64/sn/intr.h
new file mode 100644 (file)
index 0000000..33a8f22
--- /dev/null
@@ -0,0 +1,127 @@
+/**************************************************************************
+ *                                                                        *
+ *               Copyright (C) 1992-1997, Silicon Graphics, Inc.          *
+ *                                                                        *
+ *  These coded instructions, statements, and computer programs  contain  *
+ *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
+ *  are protected by Federal copyright law.  They  may  not be disclosed  *
+ *  to  third  parties  or copied or duplicated in any form, in whole or  *
+ *  in part, without the prior written consent of Silicon Graphics, Inc.  *
+ *                                                                        *
+ **************************************************************************/
+
+#ifndef __SYS_SN_INTR_H__
+#define __SYS_SN_INTR_H__
+
+/* Number of interrupt levels associated with each interrupt register. */
+#define N_INTPEND_BITS         64
+
+#define INT_PEND0_BASELVL      0
+#define INT_PEND1_BASELVL      64
+
+#define        N_INTPENDJUNK_BITS      8
+#define        INTPENDJUNK_CLRBIT      0x80
+
+#include <asm/sn/intr_public.h>
+
+#if _LANGUAGE_C
+
+/*
+ * Macros to manipulate the interrupt register on the calling hub chip.
+ */
+
+#define LOCAL_HUB_SEND_INTR(_level)    LOCAL_HUB_S(PI_INT_PEND_MOD, \
+                                                   (0x100|(_level)))
+#define REMOTE_HUB_SEND_INTR(_hub, _level) \
+               REMOTE_HUB_S((_hub), PI_INT_PEND_MOD, (0x100|(_level)))
+
+/*
+ * When clearing the interrupt, make sure this clear does make it 
+ * to the hub. Otherwise we could end up losing interrupts.
+ * We do an uncached load of the int_pend0 register to ensure this.
+ */
+
+#define LOCAL_HUB_CLR_INTR(_level)       \
+                LOCAL_HUB_S(PI_INT_PEND_MOD, (_level)),        \
+                LOCAL_HUB_L(PI_INT_PEND0)
+#define REMOTE_HUB_CLR_INTR(_hub, _level) \
+               REMOTE_HUB_S((_hub), PI_INT_PEND_MOD, (_level)),        \
+                REMOTE_HUB_L((_hub), PI_INT_PEND0)
+
+#else /* LANGUAGE_ASSEMBLY */
+
+#endif /* LANGUAGE_C */
+
+/*
+ * Hard-coded interrupt levels:
+ */
+
+/*
+ *     L0 = SW1
+ *     L1 = SW2
+ *     L2 = INT_PEND0
+ *     L3 = INT_PEND1
+ *     L4 = RTC
+ *     L5 = Profiling Timer
+ *     L6 = Hub Errors
+ *     L7 = Count/Compare (T5 counters)
+ */
+
+
+/* INT_PEND0 hard-coded bits. */
+#ifdef SABLE
+#define SDISK_INTR     63
+#endif
+#ifdef DEBUG_INTR_TSTAMP
+/* hard coded interrupt level for interrupt latency test interrupt */
+#define        CPU_INTRLAT_B   62
+#define        CPU_INTRLAT_A   61
+#endif
+
+/* Hardcoded bits required by software. */
+#define MSC_MESG_INTR  13
+#define CPU_ACTION_B   11
+#define CPU_ACTION_A   10
+
+/* These are determined by hardware: */
+#define CC_PEND_B      6
+#define CC_PEND_A      5
+#define UART_INTR      4
+#define PG_MIG_INTR    3
+#define GFX_INTR_B     2
+#define GFX_INTR_A     1
+#define RESERVED_INTR  0
+
+/* INT_PEND1 hard-coded bits: */
+#define MSC_PANIC_INTR 63
+#define NI_ERROR_INTR  62
+#define MD_COR_ERR_INTR        61
+#define COR_ERR_INTR_B 60
+#define COR_ERR_INTR_A 59
+#define CLK_ERR_INTR   58
+#define IO_ERROR_INTR  57      /* set up by prom */
+
+#define        DEBUG_INTR_B    55      /* used by symmon to stop all cpus */
+#define        DEBUG_INTR_A    54
+
+#define BRIDGE_ERROR_INTR 53   /* Setup by PROM to catch Bridge Errors */
+
+#define IP27_INTR_0    52      /* Reserved for PROM use */
+#define IP27_INTR_1    51      /*   (do not use in Kernel) */
+#define IP27_INTR_2    50
+#define IP27_INTR_3    49
+#define IP27_INTR_4    48
+#define IP27_INTR_5    47
+#define IP27_INTR_6    46
+#define IP27_INTR_7    45
+
+#define        TLB_INTR_B      44      /* used for tlb flush random */
+#define        TLB_INTR_A      43
+
+#define LLP_PFAIL_INTR_B 42    /* see ml/SN/SN0/sysctlr.c */
+#define LLP_PFAIL_INTR_A 41
+
+#define NI_BRDCAST_ERR_B 40
+#define NI_BRDCAST_ERR_A 39
+
+#endif /* __SYS_SN_INTR_H__ */
diff --git a/include/asm-mips64/sn/intr_public.h b/include/asm-mips64/sn/intr_public.h
new file mode 100644 (file)
index 0000000..63d3e6e
--- /dev/null
@@ -0,0 +1,59 @@
+/**************************************************************************
+ *                                                                        *
+ *               Copyright (C) 1992-1997, Silicon Graphics, Inc.          *
+ *                                                                        *
+ *  These coded instructions, statements, and computer programs  contain  *
+ *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
+ *  are protected by Federal copyright law.  They  may  not be disclosed  *
+ *  to  third  parties  or copied or duplicated in any form, in whole or  *
+ *  in part, without the prior written consent of Silicon Graphics, Inc.  *
+ *                                                                        *
+ **************************************************************************/
+
+#ifndef __SYS_SN_INTR_PUBLIC_H__
+#define __SYS_SN_INTR_PUBLIC_H__
+
+
+/* REMEMBER: If you change these, the whole world needs to be recompiled.
+ * It would also require changing the hubspl.s code and SN0/intr.c
+ * Currently, the spl code has no support for multiple INTPEND1 masks.
+ */
+
+#define        N_INTPEND0_MASKS        1
+#define        N_INTPEND1_MASKS        1
+
+#define INTPEND0_MAXMASK       (N_INTPEND0_MASKS - 1)
+#define INTPEND1_MAXMASK       (N_INTPEND1_MASKS - 1)
+
+#if _LANGUAGE_C
+#include <asm/sn/arch.h>
+
+struct intr_vecblk_s;  /* defined in asm/sn/intr.h */
+
+/*
+ * The following are necessary to create the illusion of a CEL
+ * on the SN0 hub.  We'll add more priority levels soon, but for
+ * now, any interrupt in a particular band effectively does an spl.
+ * These must be in the PDA since they're different for each processor.
+ * Users of this structure must hold the vector_lock in the appropriate vector
+ * block before modifying the mask arrays.  There's only one vector block
+ * for each Hub so a lock in the PDA wouldn't be adequate.
+ */
+typedef struct hub_intmasks_s {
+       /*
+        * The masks are stored with the lowest-priority (most inclusive)
+        * in the lowest-numbered masks (i.e., 0, 1, 2...).
+        */
+       /* INT_PEND0: */
+       hubreg_t                intpend0_masks[N_INTPEND0_MASKS]; 
+       /* INT_PEND1: */
+       hubreg_t                intpend1_masks[N_INTPEND1_MASKS];
+       /* INT_PEND0: */
+       struct intr_vecblk_s    *dispatch0;     
+       /* INT_PEND1: */
+       struct intr_vecblk_s    *dispatch1;
+} hub_intmasks_t;
+
+#endif /* _LANGUAGE_C */
+#endif /* __SYS_SN_INTR_PUBLIC_H__ */
+
index b7aa2fc3c25c544aa8eb97a5965c04d10b8fb099..4c95ae1d86f2bc4d7828072008b04b7193f92787 100644 (file)
@@ -1,4 +1,5 @@
-/* $Id: io.h,v 1.1 2000/02/04 07:40:53 ralf Exp $
+
+/* $Id: io.h,v 1.2 2000/02/02 16:35:57 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
@@ -10,6 +11,7 @@
 #ifndef _ASM_SN_IO_H
 #define _ASM_SN_IO_H
 
+#if !defined(CONFIG_SGI_IO)
 #include <asm/sn/sn0/addrs.h>
 
 #define IO_SPACE_BASE IO_BASE
 
 /* No isa_* versions, the Origin doesn't have ISA / EISA bridges.  */
 
+#else  /* CONFIG_SGI_IO */
+
+#define IIO_ITTE_BASE  0x400160        /* base of translation table entries */
+#define IIO_ITTE(bigwin)       (IIO_ITTE_BASE + 8*(bigwin))
+
+#define IIO_ITTE_OFFSET_BITS   5       /* size of offset field */
+#define IIO_ITTE_OFFSET_MASK   ((1<<IIO_ITTE_OFFSET_BITS)-1)
+#define IIO_ITTE_OFFSET_SHIFT  0
+
+#define IIO_ITTE_WIDGET_BITS   4       /* size of widget field */
+#define IIO_ITTE_WIDGET_MASK   ((1<<IIO_ITTE_WIDGET_BITS)-1)
+#define IIO_ITTE_WIDGET_SHIFT  8
+
+#define IIO_ITTE_IOSP          1       /* I/O Space bit */
+#define IIO_ITTE_IOSP_MASK     1
+#define IIO_ITTE_IOSP_SHIFT    12
+#define HUB_PIO_MAP_TO_MEM     0
+#define HUB_PIO_MAP_TO_IO      1
+
+#define IIO_ITTE_INVALID_WIDGET        3       /* an invalid widget  */
+
+#define IIO_ITTE_PUT(nasid, bigwin, io_or_mem, widget, addr) \
+       REMOTE_HUB_S((nasid), IIO_ITTE(bigwin), \
+               (((((addr) >> BWIN_SIZE_BITS) & \
+                  IIO_ITTE_OFFSET_MASK) << IIO_ITTE_OFFSET_SHIFT) | \
+               (io_or_mem << IIO_ITTE_IOSP_SHIFT) | \
+               (((widget) & IIO_ITTE_WIDGET_MASK) << IIO_ITTE_WIDGET_SHIFT)))
+
+#define IIO_ITTE_DISABLE(nasid, bigwin) \
+       IIO_ITTE_PUT((nasid), HUB_PIO_MAP_TO_MEM, \
+                    (bigwin), IIO_ITTE_INVALID_WIDGET, 0)
+
+#define IIO_ITTE_GET(nasid, bigwin) REMOTE_HUB_ADDR((nasid), IIO_ITTE(bigwin))
+
+/*
+ * Macro which takes the widget number, and returns the 
+ * IO PRB address of that widget.
+ * value _x is expected to be a widget number in the range 
+ * 0, 8 - 0xF
+ */
+#define        IIO_IOPRB(_x)   (IIO_IOPRB_0 + ( ( (_x) < HUB_WIDGET_ID_MIN ? \
+                       (_x) : \
+                       (_x) - (HUB_WIDGET_ID_MIN-1)) << 3) )
+
+#if defined (CONFIG_SGI_IP27)
+#include <asm/sn/sn0/hubio.h>
+#endif
+
+#endif /* CONFIG_SGI_IO */
+
 #endif /* _ASM_SN_IO_H */
index c007fa0ca5919906a147b7503e221af92ba8d49e..46433db7f04e7c35cb9a3b5d2f85096e1b12ab89 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: klconfig.h,v 1.2 2000/01/16 01:39:08 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
 
 #include <linux/types.h>
 #include <asm/sn/types.h>
+#if defined(CONFIG_SGI_IP27)
 #include <asm/sn/sn0/addrs.h>
 //#include <sys/SN/router.h>
 // XXX Stolen from <sys/SN/router.h>:
-#define MAX_ROUTER_PORTS (6)   /* Max. number of ports on a router */
+#define MAX_ROUTER_PORTS (6)    /* Max. number of ports on a router */
+#include <asm/sn/sn0/sn0_fru.h>
 #include <asm/sn/agent.h>
 //#include <sys/graph.h>
 #include <asm/arc/types.h>
 #include <asm/arc/hinv.h>
 //#include <sys/xtalk/xbow.h>
-#include <asm/sn/sn0/sn0_fru.h>
-
+#if defined(CONFIG_SGI_IO)
+// The hack file has to be before vector and after sn0_fru....
+#include <asm/hack.h>
+#include <asm/sn/vector.h>
+#include <asm/xtalk/xtalk.h>
+#endif  /* CONFIG_SGI_IO */
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/hack.h>
+#include <asm/sn/sn1/addrs.h>
+#include <asm/sn/vector.h>
+#include <sys/sn/router.h>
+#include <asm/sn/agent.h>
+#include <sys/graph.h>
+#include <asm/arc/types.h>
+#include <asm/arc/hinv.h>
+#include <asm/xtalk/xbow.h>
+#include <asm/xtalk/xtalk.h>
+#endif  /* !CONFIG_SGI_IP27 && !CONFIG_SGI_IP35 */
 
 #define KLCFGINFO_MAGIC        0xbeedbabe
 
@@ -118,9 +136,15 @@ typedef s32 klconf_off_t;
 
 
 typedef struct console_s {
+#if defined(CONFIG_SGI_IO)     /* FIXME */
+       __psunsigned_t  uart_base;
+       __psunsigned_t  config_base;
+       __psunsigned_t  memory_base;
+#else
        unsigned long   uart_base;
        unsigned long   config_base;
        unsigned long   memory_base;
+#endif
        short           baud;
        short           flag;
        int             type;
@@ -175,13 +199,23 @@ typedef struct kl_config_hdr {
 
 /* --- New Macros for the changed kl_config_hdr_t structure --- */
 
+#if defined(CONFIG_SGI_IO)
 #define PTR_CH_MALLOC_HDR(_k)   ((klc_malloc_hdr_t *)\
-                       ((unsigned long)_k + (_k->ch_malloc_hdr_off)))
+                       ((__psunsigned_t)_k + (_k->ch_malloc_hdr_off)))
+#else
+#define PTR_CH_MALLOC_HDR(_k)   ((klc_malloc_hdr_t *)\
+                       (unsigned long)_k + (_k->ch_malloc_hdr_off)))
+#endif
 
 #define KL_CONFIG_CH_MALLOC_HDR(_n)   PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
 
+#if defined(CONFIG_SGI_IO)
+#define PTR_CH_CONS_INFO(_k)   ((console_t *)\
+                       ((__psunsigned_t)_k + (_k->ch_cons_off)))
+#else
 #define PTR_CH_CONS_INFO(_k)   ((console_t *)\
                        ((unsigned long)_k + (_k->ch_cons_off)))
+#endif
 
 #define KL_CONFIG_CH_CONS_INFO(_n)   PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
 
@@ -313,7 +347,7 @@ typedef struct kl_config_hdr {
 #define KL_CPU_NONE            (-1)    /* no cpu present in slot */
 
 /*
- * SN0 BOARD classes
+ * IP27 BOARD classes
  */
 
 #define KLCLASS_MASK   0xf0   
@@ -331,15 +365,15 @@ typedef struct kl_config_hdr {
                                         * hw ifc to xtalk and are not gfx
                                         * class for sw purposes */
 
-#define KLCLASS_MAX    6               /* Bump this if a new CLASS is added */
-#define KLTYPE_MAX                   /* Bump this if a new CLASS is added */
+#define KLCLASS_MAX    7               /* Bump this if a new CLASS is added */
+#define KLTYPE_MAX     10              /* Bump this if a new CLASS is added */
 
 #define KLCLASS_UNKNOWN        0xf0
 
 #define KLCLASS(_x) ((_x) & KLCLASS_MASK)
 
 /*
- * SN0 board types
+ * IP27 board types
  */
 
 #define KLTYPE_MASK    0x0f
@@ -369,8 +403,8 @@ typedef struct kl_config_hdr {
 #define KLTYPE_GSN_B           (KLCLASS_IO  | 0xD) /* Auxiliary GSN board */
 
 #define KLTYPE_GFX     (KLCLASS_GFX | 0x0) /* unknown graphics type */
-#define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1) /* KONA graphics on SN0 */
-#define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3) /* MGRAS graphics on SN0 */
+#define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1) /* KONA graphics on IP27 */
+#define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3) /* MGRAS graphics on IP27 */
 
 #define KLTYPE_WEIRDROUTER (KLCLASS_ROUTER | 0x0)
 #define KLTYPE_ROUTER     (KLCLASS_ROUTER | 0x1)
@@ -381,6 +415,14 @@ typedef struct kl_config_hdr {
 #define KLTYPE_WEIRDMIDPLANE (KLCLASS_MIDPLANE | 0x0)
 #define KLTYPE_MIDPLANE8  (KLCLASS_MIDPLANE | 0x1) /* 8 slot backplane */
 #define KLTYPE_MIDPLANE    KLTYPE_MIDPLANE8
+#define KLTYPE_PBRICK_XBOW     (KLCLASS_MIDPLANE | 0x2)
+
+#define KLTYPE_IOBRICK         (KLCLASS_IOBRICK | 0x0)
+#define KLTYPE_IBRICK          (KLCLASS_IOBRICK | 0x1)
+#define KLTYPE_PBRICK          (KLCLASS_IOBRICK | 0x2)
+#define KLTYPE_XBRICK          (KLCLASS_IOBRICK | 0x3)
+
+#define KLTYPE_PBRICK_BRIDGE   KLTYPE_PBRICK
 
 /* The value of type should be more than 8 so that hinv prints
  * out the board name from the NIC string. For values less than
@@ -898,6 +940,43 @@ typedef union {
 
 /* external declarations of Linux kernel functions. */
 
-extern lboard_t *find_lboard(unsigned int type);
+extern lboard_t *find_lboard(lboard_t *start, unsigned char type);
+extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);
+extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);
+extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
+
+
+#if defined(CONFIG_SGI_IO)
+extern xwidgetnum_t nodevertex_widgetnum_get(vertex_hdl_t node_vtx);
+extern vertex_hdl_t nodevertex_xbow_peer_get(vertex_hdl_t node_vtx);
+extern lboard_t *find_gfxpipe(int pipenum);
+extern void setup_gfxpipe_link(vertex_hdl_t vhdl,int pipenum);
+extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
+extern lboard_t *find_lboard_module_class(lboard_t *start, moduleid_t mod,
+                                               unsigned char brd_class);
+extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
+extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
+extern lboard_t *find_lboard_modslot(lboard_t *start, moduleid_t mod, slotid_t slot);
+extern lboard_t *find_lboard_module(lboard_t *start, moduleid_t mod);
+extern lboard_t *get_board_name(nasid_t nasid, moduleid_t mod, slotid_t slot, char *name);
+extern int     config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
+extern int     config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
+extern int     config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
+extern klcpu_t *get_cpuinfo(cpuid_t cpu);
+extern int     update_klcfg_cpuinfo(nasid_t, int);
+extern void    board_to_path(lboard_t *brd, char *path);
+extern moduleid_t get_module_id(nasid_t nasid);
+extern void    nic_name_convert(char *old_name, char *new_name);
+extern int     module_brds(nasid_t nasid, lboard_t **module_brds, int n);
+extern lboard_t *brd_from_key(ulong_t key);
+extern void    device_component_canonical_name_get(lboard_t *,klinfo_t *,
+                                                   char *);
+extern int     board_serial_number_get(lboard_t *,char *);
+extern int     is_master_baseio(nasid_t,moduleid_t,slotid_t);
+extern nasid_t get_actual_nasid(lboard_t *brd) ;
+extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);
+#else  /* CONFIG_SGI_IO */
+extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu);
+#endif /* CONFIG_SGI_IO */
 
 #endif /* _ASM_SN_KLCONFIG_H */
index 68b91903d390afc1597c9a6a78e6a3e15b7c5918..67d650905e25768093f09f3b99ac2a3528abe565 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: kldir.h,v 1.1 2000/01/13 00:17:02 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
 #ifndef _ASM_SN_KLDIR_H
 #define _ASM_SN_KLDIR_H
 
+#if defined(CONFIG_SGI_IO)
+#include <asm/hack.h>
+#endif
+
 /*
  * The kldir memory area resides at a fixed place in each node's memory and
- * provides pointers to most other SN0 memory areas.  This allows us to
+ * provides pointers to most other IP27 memory areas.  This allows us to
  * resize and/or relocate memory areas at a later time without breaking all
  * firmware and kernels that use them.  Indices in the array are
  * permanently dedicated to areas listed below.  Some memory areas (marked
 #define KLDIR_OFF_STRIDE               0x28
 #endif /* LANGUAGE_ASSEMBLY */
 
+#if !defined(CONFIG_SGI_IO)
+
 /*
  * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
  * we define here.  Since it's set up in the prom.  We can't redefine it later
 #define KLDIR_ENT_SIZE                 0x40
 #define KLDIR_MAX_ENTRIES              (0x400 / 0x40)
 
+#endif /* !CONFIG_SGI_IO */
+
 #ifdef _LANGUAGE_C
 typedef struct kldir_ent_s {
        u64             magic;          /* Indicates validity of entry      */
        off_t           offset;         /* Offset from start of node space  */
+#if defined(CONFIG_SGI_IO)     /* FIXME */
+       __psunsigned_t  pointer;        /* Pointer to area in some cases    */
+#else
        unsigned long   pointer;        /* Pointer to area in some cases    */
+#endif
        size_t          size;           /* Size in bytes                    */
        u64             count;          /* Repeat count if array, 1 if not  */
        size_t          stride;         /* Stride if array, 0 if not        */
@@ -214,4 +226,22 @@ typedef struct kldir_ent_s {
 } kldir_ent_t;
 #endif /* _LANGUAGE_C */
 
+#if defined(CONFIG_SGI_IO)
+
+#define KLDIR_ENT_SIZE                 0x40
+#define KLDIR_MAX_ENTRIES              (0x400 / 0x40)
+
+/*
+ * The actual offsets of each memory area are machine-dependent
+ */
+#ifdef CONFIG_SGI_IP27
+// Not yet #include <asm/sn/sn0/kldir.h>
+#elif defined(CONFIG_SGI_IP35)
+#include <asm/sn/sn1/kldir.h>
+#else
+#error "kldir.h is currently defined for IP27 and IP35 platforms only"
+#endif
+
+#endif /* CONFIG_SGI_IO */
+
 #endif /* _ASM_SN_KLDIR_H */
diff --git a/include/asm-mips64/sn/launch.h b/include/asm-mips64/sn/launch.h
new file mode 100644 (file)
index 0000000..fcd79ea
--- /dev/null
@@ -0,0 +1,123 @@
+/* $Id: launch.h,v 1.3 2000/04/21 04:09:13 pfg Exp $
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2000 by Colin Ngam
+ */
+#ifndef _ASM_SN_LAUNCH_H
+#define _ASM_SN_LAUNCH_H
+
+#include <linux/config.h>
+#include <asm/sn/types.h>
+#include <asm/sn/addrs.h>
+
+/*
+ * The launch data structure resides at a fixed place in each node's memory
+ * and is used to communicate between the master processor and the slave
+ * processors.
+ *
+ * The master stores launch parameters in the launch structure
+ * corresponding to a target processor that is in a slave loop, then sends
+ * an interrupt to the slave processor.  The slave calls the desired
+ * function, then returns to the slave loop.  The master may poll or wait
+ * for the slaves to finish.
+ *
+ * There is an array of launch structures, one per CPU on the node.  One
+ * interrupt level is used per local CPU.
+ */
+
+#define LAUNCH_MAGIC           0xaddbead2addbead3
+#ifdef CONFIG_SGI_IP27
+#define LAUNCH_SIZEOF          0x100
+#define LAUNCH_PADSZ           0xa0
+#endif
+
+#define LAUNCH_OFF_MAGIC       0x00    /* Struct offsets for assembly      */
+#define LAUNCH_OFF_BUSY                0x08
+#define LAUNCH_OFF_CALL                0x10
+#define LAUNCH_OFF_CALLC       0x18
+#define LAUNCH_OFF_CALLPARM    0x20
+#define LAUNCH_OFF_STACK       0x28
+#define LAUNCH_OFF_GP          0x30
+#define LAUNCH_OFF_BEVUTLB     0x38
+#define LAUNCH_OFF_BEVNORMAL   0x40
+#define LAUNCH_OFF_BEVECC      0x48
+
+#define LAUNCH_STATE_DONE      0       /* Return value of LAUNCH_POLL      */
+#define LAUNCH_STATE_SENT      1
+#define LAUNCH_STATE_RECD      2
+
+/*
+ * The launch routine is called only if the complement address is correct.
+ *
+ * Before control is transferred to a routine, the compliment address
+ * is zeroed (invalidated) to prevent an accidental call from a spurious
+ * interrupt.
+ *
+ * The slave_launch routine turns on the BUSY flag, and the slave loop
+ * clears the BUSY flag after control is returned to it.
+ */
+
+#ifdef _LANGUAGE_C
+
+typedef int launch_state_t;
+typedef void (*launch_proc_t)(u64 call_parm);
+
+typedef struct launch_s {
+       volatile u64            magic;  /* Magic number                     */
+       volatile u64            busy;   /* Slave currently active           */
+       volatile launch_proc_t  call_addr;      /* Func. for slave to call  */
+       volatile u64            call_addr_c;    /* 1's complement of call_addr*/
+       volatile u64            call_parm;      /* Single parm passed to call*/
+       volatile void *stack_addr;      /* Stack pointer for slave function */
+       volatile void *gp_addr;         /* Global pointer for slave func.   */
+       volatile char           *bevutlb;/* Address of bev utlb ex handler   */
+       volatile char           *bevnormal;/*Address of bev normal ex handler */
+       volatile char           *bevecc;/* Address of bev cache err handler */
+       volatile char           pad[160];       /* Pad to LAUNCH_SIZEOF     */
+} launch_t;
+
+/*
+ * PROM entry points for launch routines are determined by IPxxprom/start.s
+ */
+
+#define LAUNCH_SLAVE   (*(void (*)(int nasid, int cpu, \
+                                   launch_proc_t call_addr, \
+                                   u64 call_parm, \
+                                   void *stack_addr, \
+                                   void *gp_addr)) \
+                        IP27PROM_LAUNCHSLAVE)
+
+#define LAUNCH_WAIT    (*(void (*)(int nasid, int cpu, int timeout_msec)) \
+                        IP27PROM_WAITSLAVE)
+
+#define LAUNCH_POLL    (*(launch_state_t (*)(int nasid, int cpu)) \
+                        IP27PROM_POLLSLAVE)
+
+#define LAUNCH_LOOP    (*(void (*)(void)) \
+                        IP27PROM_SLAVELOOP)
+
+#define LAUNCH_FLASH   (*(void (*)(void)) \
+                        IP27PROM_FLASHLEDS)
+
+#ifdef _STANDALONE
+
+launch_t       *launch_get(int nasid, int cpu);
+launch_t       *launch_get_current(void);
+void           launch_loop(void);
+void           launch_slave(int nasid, int cpu,
+                            launch_proc_t call_addr,
+                            __int64_t call_parm,
+                            void *stack_addr,
+                            void *gp_addr);
+int            launch_wait(int nasid, int cpu, int timeout_msec);
+launch_state_t launch_poll(int nasid, int cpu);
+
+#endif /* _STANDALONE */
+
+#endif /* _LANGUAGE_C */
+
+#endif /* _ASM_SN_LAUNCH_H */
diff --git a/include/asm-mips64/sn/nmi.h b/include/asm-mips64/sn/nmi.h
new file mode 100644 (file)
index 0000000..580cde7
--- /dev/null
@@ -0,0 +1,131 @@
+/**************************************************************************
+ *                                                                        *
+ *               Copyright (C) 1992-1997, Silicon Graphics, Inc.          *
+ *                                                                        *
+ *  These coded instructions, statements, and computer programs  contain  *
+ *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
+ *  are protected by Federal copyright law.  They  may  not be disclosed  *
+ *  to  third  parties  or copied or duplicated in any form, in whole or  *
+ *  in part, without the prior written consent of Silicon Graphics, Inc.  *
+ *                                                                        *
+ **************************************************************************/
+
+#ifndef __SYS_SN_NMI_H__
+#define __SYS_SN_NMI_H__
+
+#ident "$Revision: 1.1 $"
+
+#include <asm/sn/addrs.h>
+
+/*
+ * The launch data structure resides at a fixed place in each node's memory
+ * and is used to communicate between the master processor and the slave
+ * processors.
+ *
+ * The master stores launch parameters in the launch structure
+ * corresponding to a target processor that is in a slave loop, then sends
+ * an interrupt to the slave processor.  The slave calls the desired
+ * function, followed by an optional rendezvous function, then returns to
+ * the slave loop.  The master does not wait for the slaves before
+ * returning.
+ *
+ * There is an array of launch structures, one per CPU on the node.  One
+ * interrupt level is used per CPU.
+ */
+
+#define NMI_MAGIC              0x48414d4d455201
+#define NMI_SIZEOF             0x40
+
+#define NMI_OFF_MAGIC          0x00    /* Struct offsets for assembly      */
+#define NMI_OFF_FLAGS          0x08
+#define NMI_OFF_CALL           0x10
+#define NMI_OFF_CALLC          0x18
+#define NMI_OFF_CALLPARM       0x20
+#define NMI_OFF_GMASTER                0x28
+
+/*
+ * The NMI routine is called only if the complement address is
+ * correct.
+ *
+ * Before control is transferred to a routine, the compliment address
+ * is zeroed (invalidated) to prevent an accidental call from a spurious
+ * interrupt.
+ *
+ */
+
+#ifdef _LANGUAGE_C
+
+typedef struct nmi_s {
+       volatile unsigned long   magic;         /* Magic number */
+       volatile unsigned long   flags;         /* Combination of flags above */
+       volatile void *call_addr;       /* Routine for slave to call        */
+       volatile void *call_addr_c;     /* 1's complement of address        */
+       volatile void *call_parm;       /* Single parm passed to call       */
+       volatile unsigned long   gmaster;       /* Flag true only on global master*/
+} nmi_t;
+
+#endif /* _LANGUAGE_C */
+
+/* Following definitions are needed both in the prom & the kernel
+ * to identify the format of the nmi cpu register save area in the
+ * low memory on each node.
+ */
+#ifdef _LANGUAGE_C
+
+struct reg_struct {
+       unsigned long   gpr[32];
+       unsigned long   sr;
+       unsigned long   cause;
+       unsigned long   epc;
+       unsigned long   badva;
+       unsigned long   error_epc;
+       unsigned long   cache_err;
+       unsigned long   nmi_sr;
+};
+
+#endif /* _LANGUAGE_C */
+
+/* These are the assembly language offsets into the reg_struct structure */
+
+#define R0_OFF         0x0
+#define R1_OFF         0x8
+#define R2_OFF         0x10
+#define R3_OFF         0x18
+#define R4_OFF         0x20
+#define R5_OFF         0x28
+#define R6_OFF         0x30
+#define R7_OFF         0x38
+#define R8_OFF         0x40
+#define R9_OFF         0x48
+#define R10_OFF                0x50
+#define R11_OFF                0x58
+#define R12_OFF                0x60
+#define R13_OFF                0x68
+#define R14_OFF                0x70
+#define R15_OFF                0x78
+#define R16_OFF                0x80
+#define R17_OFF                0x88
+#define R18_OFF                0x90
+#define R19_OFF                0x98
+#define R20_OFF                0xa0
+#define R21_OFF                0xa8
+#define R22_OFF                0xb0
+#define R23_OFF                0xb8
+#define R24_OFF                0xc0
+#define R25_OFF                0xc8
+#define R26_OFF                0xd0
+#define R27_OFF                0xd8
+#define R28_OFF                0xe0
+#define R29_OFF                0xe8
+#define R30_OFF                0xf0
+#define R31_OFF                0xf8
+#define SR_OFF         0x100
+#define CAUSE_OFF      0x108
+#define EPC_OFF                0x110
+#define BADVA_OFF      0x118
+#define ERROR_EPC_OFF  0x120
+#define CACHE_ERR_OFF  0x128
+#define NMISR_OFF      0x130
+
+
+#endif /* __SYS_SN_NMI_H__ */
index c6275e86941a0ace1db271b10f2d36ffa4d27e94..4694cdcf614435415e76dc8962b417eff6788df8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: addrs.h,v 1.1 2000/01/13 00:17:02 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
index 95a2801789c016b08089b0f9cb2a22cf21afaf05..0b8785287198d53cb75fd6077e52358af830fe57 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: arch.h,v 1.1 2000/01/13 00:17:02 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
index 4bd66a82df46d75ae8820524ac6bb318ec9be128..3446033f1f33563caa88e2b76fe1e63afc20165a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hub.h,v 1.1 2000/01/13 00:17:02 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
index ba001a19b85441a1a209d96e90a1be4b63fffcb7..fae9bfef8520c5603f12790b5295884e2ea4723f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hubio.h,v 1.1 2000/01/13 00:17:02 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
index 9bf2699797ba2d52828ba391f0da60d17df55a87..51c8619a098bb61f2bf5295b0e96efff0418b466 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hubni.h,v 1.1 2000/01/13 00:17:02 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
index 7ea8c574160e07d3db56f874408af9a06a72d791..fdc5d2400818f55b4882d6eda249a09d701fe0e0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: hubpi.h,v 1.1 2000/01/13 00:17:02 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
index 7aa17299655789b9e37c134f9c1ccf263226e86f..206c043fa3f71e6cf927b1c0c0ee80d8ec4ac30e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ip27.h,v 1.2 2000/01/26 06:11:50 kanoj 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
 
 /* Sanity hazzard ...  Below all the Origin hacks are following.  */
 
-#define IOC3_SERIAL_INT                8
-#define IOC3_ETH_INT           9
-#define SCSI1_INT              1
 #define SCSI0_INT              0
+#define SCSI1_INT              1
+#define CPU_RESCHED_A_IRQ      3
+#define CPU_RESCHED_B_IRQ      4
+#define QLOGICFC_SLOT5          5
+#define CPU_CALL_A_IRQ         6
+#define CPU_CALL_B_IRQ         7
+#define IOC3_SERIAL_INT                8
+/*#define IOC3_ETH_INT         9*/
+#define IOC3_ETH_INT           0x0809  /* nasid 0, wid 0x8 */
 
+#define SN00_BRIDGE            0x9200000008000000
+#define SN00I_BRIDGE0          0x920000000b000000
+#define SN00I_BRIDGE1          0x920000000e000000
+#define SN00I_BRIDGE2          0x920000000f000000
 #endif /* _ASM_SN_SN0_IP27_H */
index 54581645ce9207188dd8b6a642c9b00dba3f51c0..53ccc64754a818d137890775f6fa703648558f5b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sn0_fru.h,v 1.1 2000/01/13 00:17:02 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/include/asm-mips64/sn/sn_private.h b/include/asm-mips64/sn/sn_private.h
new file mode 100644 (file)
index 0000000..08d31c9
--- /dev/null
@@ -0,0 +1,6 @@
+extern cnodeid_t get_compact_nodeid(void);
+extern void hub_rtc_init(cnodeid_t);
+extern void cpu_time_init(void);
+extern void per_cpu_init(void);
+extern void install_cpuintr(cpuid_t cpu);
+extern void install_tlbintr(cpuid_t cpu);
index 9c0515341b7221ef6236423530f3e08dc1b69db4..c3905ad24f20439b85268d086bdc02a888c1b6b9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: types.h,v 1.1 2000/01/13 00:17:02 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
@@ -12,6 +12,9 @@
 
 #include <linux/types.h>
 
+typedef unsigned long  cpuid_t;
+typedef unsigned long  cpumask_t;
+typedef unsigned long  cnodemask_t;
 typedef signed short   nasid_t;        /* node id in numa-as-id space */
 typedef signed short   cnodeid_t;      /* node id in compact-id space */
 typedef signed char    partid_t;       /* partition ID type */
index d5aed86e1f6c84a989be6d438c961d1a94f933e5..02be40b6b0058e6760083fc11fa25812d84efbc1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: socket.h,v 1.1 1999/08/18 23:37:52 ralf Exp $
+/* $Id: socket.h,v 1.2 2000/02/25 21:52:09 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
@@ -61,6 +61,8 @@ To add: #define SO_REUSEPORT 0x0200   /* Allow local address and port reuse.  */
 #define SO_ATTACH_FILTER        26
 #define SO_DETACH_FILTER        27
 
+#ifdef __KERNEL__
+
 #define SO_PEERNAME             28
 
 /* Types of sockets.  */
@@ -75,5 +77,6 @@ To add: #define SO_REUSEPORT 0x0200   /* Allow local address and port reuse.  */
 #define SOCK_PACKET 10         /* Linux specific way of getting packets at
                                   the dev level.  For writing rarp and
                                   other similar things on the user level.  */
+#endif /* __KERNEL__ */
 
 #endif /* _ASM_SOCKET_H */
index e80a871103491dc05412fd62bc1501ae9e87c377..3131c6f89a6978e2a3a7d433d7f56fec101a0690 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sockios.h,v 1.1 1999/08/18 23:37:52 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
index 4a05ad50425e2acf22f352f3f15d4af797b0d03c..716cd3e17fb48387d2bd028caf6bd327c9c4bd82 100644 (file)
 #include <asm/atomic.h>
 #include <asm/hardirq.h>
 
-extern unsigned int local_bh_count[NR_CPUS];
-
-#define cpu_bh_disable(cpu)    do { local_bh_count[(cpu)]++; barrier(); } while (0)
-#define cpu_bh_enable(cpu)     do { barrier(); local_bh_count[(cpu)]--; } while (0)
+#define cpu_bh_disable(cpu)    do { local_bh_count(cpu)++; barrier(); } while (0)
+#define cpu_bh_enable(cpu)     do { barrier(); local_bh_count(cpu)--; } while (0)
 
 #define local_bh_disable()     cpu_bh_disable(smp_processor_id())
 #define local_bh_enable()      cpu_bh_enable(smp_processor_id())
 
-#define in_softirq() (local_bh_count[smp_processor_id()] != 0)
+#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
 
 #endif /* _ASM_SOFTIRQ_H */
index 267b3b7c05a08aa1ae55c5436919c09d7a5a5879..9a1ccf1984df6a5f3a11d0d6e2f3a597fae5f981 100644 (file)
@@ -22,6 +22,9 @@ typedef struct {
 
 #define spin_lock_init(x)      do { (x)->lock = 0; } while(0);
 
+#define spin_is_locked(x)      ((x)->lock != 0)
+#define spin_unlock_wait(x)    ({ do { barrier(); } while ((x)->lock); })
+
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
  * on the local processor, one does not.
@@ -62,7 +65,24 @@ static inline void spin_unlock(spinlock_t *lock)
        : "memory");
 }
 
-#define spin_trylock(lock) (!test_and_set_bit(0,(lock)))
+static inline unsigned int spin_trylock(spinlock_t *lock)
+{
+       unsigned int temp, res;
+
+       __asm__ __volatile__(
+       ".set\tnoreorder\t\t\t# spin_trylock\n\t"
+       "1:\tll\t%0, %1\n\t"
+       "or\t%2, %0, %3\n\t"
+       "sc\t%2, %1\n\t"
+       "beqz\t%2, 1b\n\t"
+       " and\t%2, %0, %3\n\t"
+       ".set\treorder"
+       :"=&r" (temp), "=m" (*lock), "=&r" (res)
+       :"r" (1), "m" (*lock)
+       : "memory");
+
+       return res == 0;
+}
 
 /*
  * Read-write spinlocks, allowing multiple readers but only one writer.
@@ -110,6 +130,7 @@ static inline void read_unlock(rwlock_t *rw)
        "sub\t%1, 1\n\t"
        "sc\t%1, %0\n\t"
        "beqz\t%1, 1b\n\t"
+       "sync\n\t"
        ".set\treorder" 
        : "=o" (__dummy_lock(rw)), "=&r" (tmp)
        : "o" (__dummy_lock(rw))
index dd896048b1b334311ad5c3287df8e3691ad071e2..83131cc822bde88ba919c5983b6e8aad062a699c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: stackframe.h,v 1.4 2000/02/24 03:24:38 ulfc Exp $
+/* $Id: stackframe.h,v 1.3 1999/12/04 03:59:12 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
 #ifndef _ASM_STACKFRAME_H
 #define _ASM_STACKFRAME_H
 
+#include <linux/config.h>
+
 #include <asm/asm.h>
 #include <asm/offset.h>
+#include <asm/processor.h>
+#include <asm/addrspace.h>
 
 #ifdef _LANGUAGE_C
 
                 move   k1, sp
                .set    reorder
                /* Called from user mode, new stack. */
+#ifndef CONFIG_SMP
                lui     k1, %hi(kernelsp)
                ld      k1, %lo(kernelsp)(k1)
+#else
+               mfc0    k0, CP0_WATCHLO
+               mfc0    k1, CP0_WATCHHI
+               dsll32  k0, k0, 0       /* Get rid of sign extension */
+               dsrl32  k0, k0, 0       /* Get rid of sign extension */
+               dsll32  k1, k1, 0
+               or      k1, k1, k0
+               li      k0, K0BASE
+               or      k1, k1, k0
+               daddiu  k1, k1, KERNEL_STACK_SIZE-32
+#endif
 8:             move    k0, sp
                dsubu   sp, k1, PT_SIZE
                sd      k0, PT_R29(sp)
index f42ef7293feb0daf41d4c1c001ba59076a5c7c08..8fdcd95d4122b427c214496bf279567dcf5a5280 100644 (file)
@@ -28,6 +28,32 @@ struct __old_kernel_stat {
        unsigned int    st_gen;
 };
 
+struct stat32 {
+       __kernel_dev_t32    st_dev;
+       int                 st_pad1[3];
+       __kernel_ino_t32    st_ino;
+       __kernel_mode_t32   st_mode;
+       __kernel_nlink_t32  st_nlink;
+       __kernel_uid_t32    st_uid;
+       __kernel_gid_t32    st_gid;
+       __kernel_dev_t32    st_rdev;
+       int                 st_pad2[2];
+       __kernel_off_t32    st_size;
+       int                 st_pad3;
+       __kernel_time_t32   st_atime;
+       int                 reserved0;
+       __kernel_time_t32   st_mtime;
+       int                 reserved1;
+       __kernel_time_t32   st_ctime;
+       int                 reserved2;
+       int                 st_blksize;
+       int                 st_blocks;
+       char                st_fstype[16];      /* Filesystem type name */
+       int                 st_pad4[8];
+       unsigned int        st_flags;
+       unsigned int        st_gen;
+};
+
 struct stat {
        dev_t           st_dev;
        long            st_pad1[3];             /* Reserved for network id */
index 3013c2611564b5de2fef91325150889503fa6524..7bb7ad9137ba86a0493b46e89c3c28f9d71e967a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: statfs.h,v 1.1 1999/08/18 23:37:52 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
index e820cb9b4cd7904e213709bc56ac25b5c7ddfeef..45680b78a5700b04a064f2b080f93e10f0b4bf2f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: string.h,v 1.4 2000/01/16 01:37:19 ralf Exp $
+/* $Id: string.h,v 1.3 1999/12/04 03:59:12 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
index 5d71d85e3253cb8dd77f5a4f6ccbff10ef7dcb69..af69c6f6ca12b33291da557127677cce00811073 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sysmips.h,v 1.1 1999/12/04 03:59:12 ralf Exp $
+/* $Id: sysmips.h,v 1.1 1999/10/08 21:07:57 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
index 47ee40a3bb7edb56d1143f03f1d536de335cb01b..3592b3821add1a366b0004a30963df322b55c181 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef _ASM_SYSTEM_H
 #define _ASM_SYSTEM_H
 
+#include <linux/config.h>
+
 #include <asm/sgidefs.h>
 #include <linux/kernel.h>
 
@@ -105,14 +107,27 @@ __restore_flags(int flags)
                : "$8", "$9", "memory");
 }
 
-/*
- * Non-SMP versions ...
- */
-#define sti() __sti()
+#ifdef CONFIG_SMP
+
+extern void __global_cli(void);
+extern void __global_sti(void);
+extern unsigned long __global_save_flags(void);
+extern void __global_restore_flags(unsigned long);
+#define cli() __global_cli()
+#define sti() __global_sti()
+#define save_flags(x) ((x)=__global_save_flags())
+#define restore_flags(x) __global_restore_flags(x)
+#define save_and_cli(x) do { save_flags(flags); cli(); } while(0)
+
+#else
+
 #define cli() __cli()
+#define sti() __sti()
 #define save_flags(x) __save_flags(x)
-#define save_and_cli(x) __save_and_cli(x)
 #define restore_flags(x) __restore_flags(x)
+#define save_and_cli(x) __save_and_cli(x)
+
+#endif /* CONFIG_SMP */
 
 /* For spinlocks etc */
 #define local_irq_save(x)      __save_and_cli(x);
@@ -154,8 +169,25 @@ extern asmlinkage void *resume(void *last, void *next);
 #endif /* !defined (_LANGUAGE_ASSEMBLY) */
 
 #define prepare_to_switch()    do { } while(0)
+
+extern asmlinkage void lazy_fpu_switch(void *, void *);
+extern asmlinkage void init_fpu(void);
+extern asmlinkage void save_fp(void *);
+
+#ifdef CONFIG_SMP
+#define SWITCH_DO_LAZY_FPU \
+       if (prev->flags & PF_USEDFPU) { \
+               lazy_fpu_switch(prev, 0); \
+               set_cp0_status(ST0_CU1, ~ST0_CU1); \
+               prev->flags &= ~PF_USEDFPU; \
+       }
+#else /* CONFIG_SMP */
+#define SWITCH_DO_LAZY_FPU     do { } while(0)
+#endif /* CONFIG_SMP */
+
 #define switch_to(prev,next,last) \
 do { \
+       SWITCH_DO_LAZY_FPU; \
        (last) = resume(prev, next); \
 } while(0)
 
index 77b27110c80f81a4808e443d419dc1c3a1e963d1..498fbdd3bfff9aa48d28d535a15e50b6a66b7997 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: termbits.h,v 1.1 1999/08/18 23:37:52 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
index a6449b77b0181c1de33998e52633ab9df65aa7e2..930a6dcb149be1cdc634d4d3bc7427c67d982f21 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: termios.h,v 1.3 2000/02/18 00:24:49 ralf Exp $
+/* $Id: termios.h,v 1.2 2000/01/27 23:45:30 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
index aac3a6fb3e2bc84a63853c71a9f357652fb19f3f..1642f30bef931ec37edd48b8b3f6f8696aabd1f0 100644 (file)
@@ -33,7 +33,15 @@ extern cycles_t cacheflush_time;
 
 static inline cycles_t get_cycles (void)
 {
-       return read_32bit_cp0_register(CP0_COUNT);
+       cycles_t val;
+
+       __asm__ __volatile__(
+               ".set noreorder\n\t"
+               "mfc0 %0, $9\n\t"
+               ".set reorder"
+               : "=r" (val));
+
+       return val;
 }
 
 #endif /*  _ASM_TIMEX_H */
index 0a5ad5f7e19b7f2ac55a999735db4a2cb85fe784..989e79622516987cc7a5de9158a50b5ce313018e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: types.h,v 1.3 2000/02/18 00:24:49 ralf Exp $
+/* $Id: types.h,v 1.2 1999/12/04 03:59:12 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
index b104b097ac2bfc5da78583a05fc71c611d67cc3d..887b08eddcebff74f4055d84853a039452bcd272 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.5 2000/02/21 18:05:07 ralf Exp $
+/* $Id: uaccess.h,v 1.4 2000/02/19 00:33:10 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
index de83875dda2799fd91a452f7e273d755bb5bd516..3667acde156bdad4bd8eaa8092f3414d36ed56b4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ucontext.h,v 1.1 1999/09/28 22:27:20 ralf Exp $
+/* $Id: ucontext.h,v 1.1 1999/09/27 16:01: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
index 972320298cce866d666c88cccd4d1b6aacc385a2..fecbd76be3793b405fa301f21163047710164a2a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: unaligned.h,v 1.1 1999/08/19 22:56:35 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
index f1b1fe62f4b3fcb646e09362c2067eeef45d188a..5c3689b3a730e592939de827a89ead299d3cd74f 100644 (file)
 #define __NR_Linux32_ptrace            (__NR_Linux32 +  26)
 #define __NR_Linux32_alarm             (__NR_Linux32 +  27)
 #define __NR_Linux32_oldfstat          (__NR_Linux32 +  28)
-#define __NR_Linux32_unused29          (__NR_Linux32 +  29)
+#define __NR_Linux32_pause             (__NR_Linux32 +  29)
 #define __NR_Linux32_utime             (__NR_Linux32 +  30)
 #define __NR_Linux32_stty              (__NR_Linux32 +  31)
 #define __NR_Linux32_gtty              (__NR_Linux32 +  32)
 #define __NR_Linux32_lstat64           (__NR_Linux32 + 214)
 #define __NR_Linux32_fstat64           (__NR_Linux32 + 215)
 #define __NR_Linux32_root_pivot                (__NR_Linux32 + 216)
+#define __NR_Linux32_mincore           (__NR_Linux32 + 217)
+#define __NR_Linux32_madvise           (__NR_Linux32 + 218)
 
 /*
  * Offset of the last Linux o32 flavoured syscall
  */
-#define __NR_Linux32_syscalls          216
+#define __NR_Linux32_syscalls          218
 
 /*
  * Linux 64-bit syscalls are in the range from 5000 to 5999.
 #define __NR_ptrace                    (__NR_Linux +  26)
 #define __NR_alarm                     (__NR_Linux +  27)
 #define __NR_oldfstat                  (__NR_Linux +  28)
-#define __NR_unused29                  (__NR_Linux +  29)
+#define __NR_pause                     (__NR_Linux +  29)
 #define __NR_utime                     (__NR_Linux +  30)
 #define __NR_stty                      (__NR_Linux +  31)
 #define __NR_gtty                      (__NR_Linux +  32)
 #define __NR_getpmsg                   (__NR_Linux + 208)
 #define __NR_putpmsg                   (__NR_Linux + 209)
 #define __NR_root_pivot                        (__NR_Linux + 210)
+#define __NR_mincore                   (__NR_Linux + 211)
+#define __NR_madvise                   (__NR_Linux + 212)
 
 /*
  * Offset of the last Linux flavoured syscall
  */
-#define __NR_Linux_syscalls            210
+#define __NR_Linux_syscalls            212
 
 #ifndef _LANGUAGE_ASSEMBLY
 
index 104b2af4cdc98b3974e1ab7a5625e30b360a4180..88322ae2d1fd3ab4ec182cdb41bd275aaa03a372 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: user.h,v 1.1 1999/08/20 21:59:09 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
index 55a5c1e40ad90884aeecbb4678a2b6544f4aa29f..1f2d81cc1ba0de49db7050c563e0ee31845e79eb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: usioctl.h,v 1.1 1999/08/19 22:56:35 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
index 5beb0bdfb25526051494bdf7dae3f736a1aa5caf..b9c744ce85a1107c92932f7749d860889658121d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: watch.h,v 1.1 1999/09/28 22:27:20 ralf Exp $
+/* $Id: watch.h,v 1.1 1999/09/27 16:01:41 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
index 77e7e7a0e58f7f8a1e5147ad7dfe9611488faded..e5abedb35df46a0c7a6a50a8978888748c95edeb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: xtalk.h,v 1.1 2000/01/13 00:17:02 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
index f40703cc7fe65f4bca9f433b710b201c9ceef879..54052f33464ffcbc8b0da12a01ef455b8fa15fca 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: xwidget.h,v 1.1 2000/01/13 00:17:02 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
index aa350672a627075ff18dc7fc67111cdd5d9eaa29..4300d242d235857ce50f447496c499f70754cddb 100644 (file)
@@ -674,7 +674,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
 
        if ((clone_flags & CLONE_VFORK) || !(clone_flags & CLONE_PARENT)) {
                p->p_opptr = current;
-               if (!(current->flags & PF_PTRACED))
+               if (!(p->flags & PF_PTRACED))
                        p->p_pptr = current;
        }
        p->p_cptr = NULL;
index 8734cc45968b4ec8c0a9c21a4320bfaf54aca906..c96b1bc9122acc6d4cb1c8ea0ef4d007810bd3e0 100644 (file)
@@ -538,16 +538,19 @@ int kswapd(void *unused)
                        int i;
                        for(i = 0; i < MAX_NR_ZONES; i++) {
                                zone_t *zone = pgdat->node_zones+ i;
+                               if (tsk->need_resched)
+                                       schedule();
                                if (!zone->size || !zone->zone_wake_kswapd)
                                        continue;
-                               something_to_do = 1;
+                               if (zone->free_pages < zone->pages_low)
+                                       something_to_do = 1;
                                do_try_to_free_pages(GFP_KSWAPD);
                        }
                        run_task_queue(&tq_disk);
                        pgdat = pgdat->node_next;
                } while (pgdat);
 
-               if (tsk->need_resched || !something_to_do) {
+               if (!something_to_do) {
                        tsk->state = TASK_INTERRUPTIBLE;
                        interruptible_sleep_on(&kswapd_wait);
                }