diff -u --recursive --new-file v2.3.99-pre8/linux/CREDITS linux/CREDITS
--- v2.3.99-pre8/linux/CREDITS Wed Apr 26 16:34:06 2000
+++ linux/CREDITS Sat May 20 11:39:56 2000
@@ -251,6 +251,14 @@
S: 6369 BG Simpelveld
S: The Netherlands
+N: Peter Berger
+E: pberger@brimson.com
+W: http://www.brimson.com
+D: Author/maintainer of Digi AccelePort USB driver
+S: 1549 Hiironen Rd.
+S: Brimson, MN 55602
+S: USA
+
N: Hennus Bergman
E: hennus@cybercomm.nl
W: http://www.cybercomm.nl/~hennus/
@@ -318,6 +326,13 @@
D: IEEE 1394 subsystem rewrite and maintainer
D: Texas Instruments PCILynx IEEE 1394 driver
+N: Al Borchers
+E: alborchers@steinerpoint.com
+D: Author/maintainer of Digi AccelePort USB driver
+S: 4912 Zenith Ave. S.
+S: Minneapolis, MN 55410
+S: USA
+
N: Marc Boucher
E: marc@mbsi.ca
P: CA 67 A5 1A 38 CE B6 F2 D5 83 51 03 D2 9C 30 9E CE D2 DD 65
@@ -942,14 +957,20 @@
N: Andre Hedrick
E: andre@linux-ide.org
+E: ahedrick@atipa.com
E: andre@suse.com
+W: http://www.linux-ide.org/
D: Random SMP kernel hacker...
D: Uniform Multi-Platform E-IDE driver
D: Active-ATA-Chipset maddness..........
D: Ultra DMA 66/33
D: ATA-Smart Kernel Daemon
-S: 580 Second Street, Suite 2
-S: Oakland, CA
+S: Linux ATA Development (LAD)
+S: Concord, CA
+S: Atipa Linux Solutions
+S: 6000 Connecticut Kansas City, MO 64120
+S: SuSE Linux, Inc.
+S: 580 Second Street, Suite 210 Oakland, CA 94607
S: USA
N: Jochen Hein
@@ -1607,12 +1628,30 @@
D: XF86_8514
D: cfdisk (curses based disk partitioning program)
+N: Claudio S. Matsuoka
+E: claudio@conectiva.com
+E: claudio@helllabs.org
+W: http://helllabs.org/~claudio
+D: OV511 driver hacks
+S: Conectiva S.A.
+S: R. Tocantins 89
+S: 80050-430 Curitiba PR
+S: Brazil
+
N: Heinz Mauelshagen
E: mge@EZ-Darmstadt.Telekom.de
D: Logical Volume Manager
S: Bartningstr. 12
S: 64289 Darmstadt
S: Germany
+
+N: Mark W. McClelland
+E: mmcclelland@delphi.com
+E: mark@alpha.dyndns.org
+W: http://alpha.dyndns.org/ov511/
+D: OV511 driver
+S: (address available on request)
+S: USA
N: Mike McLagan
E: mike.mclagan@linux.org
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/Configure.help linux/Documentation/Configure.help
--- v2.3.99-pre8/linux/Documentation/Configure.help Fri May 12 14:18:55 2000
+++ linux/Documentation/Configure.help Tue May 23 08:22:22 2000
@@ -1496,7 +1496,7 @@
If unsure, say Y.
-DANGEROUS! RAID-1/RAID-5 code
+RAID-1/RAID-5 code (DANGEROUS)
CONFIG_RAID15_DANGEROUS
This new RAID1/RAID5 code has been freshly merged, and has not seen
enough testing yet. While there are no known bugs in it, it might
@@ -9779,6 +9779,12 @@
CONFIG_USB_SERIAL_OMNINET
Say Y here if you want to use a ZyXEL omni.net LCD ISDN TA.
+USB Digi International AccelePort USB Serial Driver
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT
+ Say Y here if you want to use a Digi AccelePort USB 4 device,
+ a 4 port USB serial converter. The Digi Acceleport USB 2 and
+ 8 are not yet supported by this driver.
+
USB Printer support
CONFIG_USB_PRINTER
Say Y here if you want to connect a USB printer to your computer's
@@ -10430,7 +10436,7 @@
Provide NFSv3 server support
CONFIG_NFSD_V3
If you would like to include the NFSv3 server as well as the NFSv2
- server, say Y here. In unsure, say Y.
+ server, say Y here. If unsure, say Y.
OS/2 HPFS file system support
CONFIG_HPFS_FS
@@ -12461,14 +12467,6 @@
option doesn't work for all laptops -- it might not turn off your
backlight at all, or it might print a lot of errors to the console,
especially if you are using gpm.
-
-Ignore multiple suspend/standby events
-CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
- This option is necessary on the IBM Thinkpad 560, but should work on
- all other laptops. When the APM BIOS returns multiple suspend or
- standby events while one is already being processed they will be
- ignored. Without this the Thinkpad 560 has troubles with the user
- level daemon apmd, and with the PCMCIA package pcmcia-cs.
Ignore multiple suspend/resume cycles
CONFIG_APM_IGNORE_SUSPEND_BOUNCE
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/DocBook/Makefile linux/Documentation/DocBook/Makefile
--- v2.3.99-pre8/linux/Documentation/DocBook/Makefile Wed Apr 26 16:34:06 2000
+++ linux/Documentation/DocBook/Makefile Sun May 21 20:18:07 2000
@@ -1,4 +1,4 @@
-BOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml kernel-api.sgml parportbook.sgml
+BOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml kernel-api.sgml parportbook.sgml kernel-hacking.sgml kernel-locking.sgml
PS := $(patsubst %.sgml, %.ps, $(BOOKS))
PDF := $(patsubst %.sgml, %.pdf, $(BOOKS))
@@ -18,6 +18,9 @@
(echo "*** You need to install DocBook stylesheets ***"; \
exit 1)
+%.eps: %.fig
+ -fig2dev -Leps $< $@
+
$(TOPDIR)/scripts/docproc:
$(MAKE) -C $(TOPDIR)/scripts docproc
@@ -51,6 +54,7 @@
$(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 \
@@ -66,12 +70,15 @@
LOG := $(patsubst %.sgml, %.log, $(BOOKS))
clean:
- $(RM) core *~
- $(RM) $(BOOKS)
- $(RM) $(DVI) $(AUX) $(TEX) $(LOG)
+ -$(RM) core *~
+ -$(RM) $(BOOKS)
+ -$(RM) $(DVI) $(AUX) $(TEX) $(LOG)
+ -$(RM) parport-share.eps parport-multi.eps parport-structure.eps
mrproper: clean
- $(RM) $(PS) $(PDF)
+ -$(RM) $(PS) $(PDF)
+
+parportbook.ps: parport-share.eps parport-multi.eps parport-structure.eps
%.ps : %.sgml db2ps
db2ps $<
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/DocBook/kernel-api.tmpl linux/Documentation/DocBook/kernel-api.tmpl
--- v2.3.99-pre8/linux/Documentation/DocBook/kernel-api.tmpl Tue Apr 11 15:09:11 2000
+++ linux/Documentation/DocBook/kernel-api.tmpl Sat May 13 08:11:27 2000
@@ -101,6 +101,11 @@
+
+ The Device File System
+!Efs/devfs/base.c
+
+
Power Management
!Ekernel/pm.c
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/DocBook/kernel-hacking.tmpl linux/Documentation/DocBook/kernel-hacking.tmpl
--- v2.3.99-pre8/linux/Documentation/DocBook/kernel-hacking.tmpl Wed Dec 31 16:00:00 1969
+++ linux/Documentation/DocBook/kernel-hacking.tmpl Sun May 21 20:18:07 2000
@@ -0,0 +1,1316 @@
+
+
+
+
+ Unreliable Guide To Hacking The Linux Kernel
+
+
+
+ Paul
+ Rusty
+ Russell
+
+
+ rusty@linuxcare.com
+
+
+
+
+
+
+ 2000
+ Paul Russell
+
+
+
+
+ This documentation is free software; you can redistribute
+ it and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+
+
+
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA
+
+
+
+ For more details see the file COPYING in the source
+ distribution of Linux.
+
+
+
+
+ This is the first release of this document as part of the kernel tarball.
+
+
+
+
+
+
+
+ Introduction
+
+ Welcome, gentle reader, to Rusty's Unreliable Guide to Linux
+ Kernel Hacking. This document describes the common routines and
+ general requirements for kernel code: its goal is to serve as a
+ primer for Linux kernel development for experienced C
+ programmers. I avoid implementation details: that's what the
+ code is for, and I ignore whole tracts of useful routines.
+
+
+ Before you read this, please understand that I never wanted to
+ write this document, being grossly under-qualified, but I always
+ wanted to read it, and this was the only way. I hope it will
+ grow into a compendium of best practice, common starting points
+ and random information.
+
+
+
+
+ The Players
+
+
+ At any time each of the CPUs in a system can be:
+
+
+
+
+
+ not associated with any process, serving a hardware interrupt;
+
+
+
+
+
+ not associated with any process, serving a softirq, tasklet or bh;
+
+
+
+
+
+ running in kernel space, associated with a process;
+
+
+
+
+
+ running a process in user space.
+
+
+
+
+
+ There is a strict ordering between these: other than the last
+ category (userspace) each can only be pre-empted by those above.
+ For example, while a softirq is running on a CPU, no other
+ softirq will pre-empt it, but a hardware interrupt can. However,
+ any other CPUs in the system execute independently.
+
+
+
+ We'll see a number of ways that the user context can block
+ interrupts, to become truly non-preemptable.
+
+
+
+ User Context
+
+
+ User context is when you are coming in from a system call or
+ other trap: you can sleep, and you own the CPU (except for
+ interrupts) until you call schedule().
+ In other words, user context (unlike userspace) is not pre-emptable.
+
+
+
+
+ You are always in user context on module load and unload,
+ and on operations on the block device layer.
+
+
+
+
+ In user context, the current pointer (indicating
+ the task we are currently executing) is valid, and
+ in_interrupt()
+ (include/asm/hardirq.h) is false
+ .
+
+
+
+
+ Beware that if you have interrupts or bottom halves disabled
+ (see below), in_interrupt() will return a
+ false positive.
+
+
+
+
+
+ Hardware Interrupts (Hard IRQs)
+
+
+ Timer ticks, network cards and
+ keyboard are examples of real
+ hardware which produce interrupts at any time. The kernel runs
+ interrupt handlers, which services the hardware. The kernel
+ guarantees that this handler is never re-entered: if another
+ interrupt arrives, it is queued (or dropped). Because it
+ disables interrupts, this handler has to be fast: frequently it
+ simply acknowledges the interrupt, marks a `software interrupt'
+ for execution and exits.
+
+
+
+ You can tell you are in a hardware interrupt, because
+ in_irq() returns true.
+
+
+
+ Beware that this will return a false positive if interrupts are disabled
+ (see below).
+
+
+
+
+
+ Software Interrupt Context: Bottom Halves, Tasklets, softirqs
+
+
+ Whenever a system call is about to return to userspace, or a
+ hardware interrupt handler exits, any `software interrupts'
+ which are marked pending (usually by hardware interrupts) are
+ run (kernel/softirq.c).
+
+
+
+ Much of the real interrupt handling work is done here. Early in
+ the transition to SMP, there were only `bottom
+ halves' (BHs), which didn't take advantage of multiple CPUs. Shortly
+ after we switched from wind-up computers made of match-sticks and snot,
+ we abandoned this limitation.
+
+
+
+ lists the
+ different BH's. No matter how many CPUs you have, no two BHs will run at
+ the same time. This made the transition to SMP simpler, but sucks hard for
+ scalable performance. A very important bottom half is the timer
+ BH (): you
+ can register to have it call functions for you in a given length of time.
+
+
+
+ 2.3.43 introduced softirqs, and re-implemented the (now
+ deprecated) BHs underneath them. Softirqs are fully-SMP
+ versions of BHs: they can run on as many CPUs at once as
+ required. This means they need to deal with any races in shared
+ data using their own locks. A bitmask is used to keep track of
+ which are enabled, so the 32 available softirqs should not be
+ used up lightly. (Yes, people will
+ notice).
+
+
+
+ tasklets ()
+ are like softirqs, except they are dynamically-registrable (meaning you
+ can have as many as you want), and they also guarantee that any tasklet
+ will only run on one CPU at any time, although different tasklets can
+ run simultaneously (unlike different BHs).
+
+
+
+ The name `tasklet' is misleading: they have nothing to do with `tasks',
+ and probably more to do with some bad vodka Alexey Kuznetsov had at the
+ time.
+
+
+
+
+ You can tell you are in a softirq (or bottom half, or tasklet)
+ using the in_softirq() macro
+ ().
+
+
+
+ Beware that this will return a false positive if a bh lock (see below)
+ is held.
+
+
+
+
+
+
+ Some Basic Rules
+
+
+
+ No memory protection
+
+
+ If you corrupt memory, whether in user context or
+ interrupt context, the whole machine will crash. Are you
+ sure you can't do what you want in userspace?
+
+
+
+
+
+ No floating point or MMX
+
+
+ The FPU context is not saved; even in user
+ context the FPU state probably won't
+ correspond with the current process: you would mess with some
+ user process' FPU state. If you really want
+ to do this, you would have to explicitly save/restore the full
+ FPU state (and avoid context switches). It
+ is generally a bad idea; use fixed point arithmetic first.
+
+
+
+
+
+ A rigid stack limit
+
+
+ The kernel stack is about 6K in 2.2 (for most
+ architectures: it's about 14K on the Alpha), and shared
+ with interrupts so you can't use it all. Avoid deep
+ recursion and huge local arrays on the stack (allocate
+ them dynamically instead).
+
+
+
+
+
+ The Linux kernel is portable
+
+
+ Let's keep it that way. Your code should be 64-bit clean,
+ and endian-independent. You should also minimize CPU
+ specific stuff, e.g. inline assembly should be cleanly
+ encapsulated and minimized to ease porting. Generally it
+ should be restricted to the architecture-dependent part of
+ the kernel tree.
+
+
+
+
+
+
+
+ ioctls: Not writing a new system call
+
+
+ A system call generally looks like this
+
+
+
+asmlinkage int sys_mycall(int arg)
+{
+ return 0;
+}
+
+
+
+ First, in most cases you don't want to create a new system call.
+ You create a character device and implement an appropriate ioctl
+ for it. This is much more flexible than system calls, doesn't have
+ to be entered in every architecture's
+ and
+ arch/kernel/entry.S file, and is much more
+ likely to be accepted by Linus.
+
+
+
+ Inside the ioctl you're in user context to a process. When a
+ error occurs you return a negated errno (see
+ ),
+ otherwise you return 0.
+
+
+
+ After you slept you should check if a signal occurred: the
+ Unix/Linux way of handling signals is to temporarily exit the
+ system call with the -ERESTARTSYS error. The
+ system call entry code will switch back to user context, process
+ the signal handler and then your system call will be restarted
+ (unless the user disabled that). So you should be prepared to
+ process the restart, e.g. if you're in the middle of manipulating
+ some data structure.
+
+
+
+if (signal_pending())
+ return -ERESTARTSYS;
+
+
+
+ If you're doing longer computations: first think userspace. If you
+ really want to do it in kernel you should
+ regularly check if you need to give up the CPU (remember there is
+ cooperative multitasking per CPU). Idiom:
+
+
+
+if (current->need_resched)
+ schedule(); /* Will sleep */
+
+
+
+ A short note on interface design: the UNIX system call motto is
+ "Provide mechanism not policy".
+
+
+
+
+ Recipes for Deadlock
+
+
+ You cannot call any routines which may sleep, unless:
+
+
+
+
+ You are in user context.
+
+
+
+
+
+ You do not own any spinlocks.
+
+
+
+
+
+ You have interrupts enabled (actually, Andi Kleen says
+ that the scheduling code will enable them for you, but
+ that's probably not what you wanted).
+
+
+
+
+
+ Note that some functions may sleep implicitly: common ones are
+ the user space access functions (*_user) and memory allocation
+ functions without GFP_ATOMIC.
+
+
+
+ You will eventually lock up your box if you break these rules.
+
+
+
+ Really.
+
+
+
+
+ Common Routines
+
+
+
+ printk()
+
+
+
+
+ printk() feeds kernel messages to the
+ console, dmesg, and the syslog daemon. It is useful for debugging
+ and reporting errors, and can be used inside interrupt context,
+ but use with caution: a machine which has its console flooded with
+ printk messages is unusable. It uses a format string mostly
+ compatible with ANSI C printf, and C string concatenation to give
+ it a first "priority" argument:
+
+
+
+printk(KERN_INFO "i = %u\n", i);
+
+
+
+ See ;
+ for other KERN_ values; these are interpreted by syslog as the
+ level. Special case: for printing an IP address use
+
+
+
+__u32 ipaddress;
+printk(KERN_INFO "my ip: %d.%d.%d.%d\n", NIPQUAD(ipaddress));
+
+
+
+ printk() internally uses a 1K buffer and does
+ not catch overruns. Make sure that will be enough.
+
+
+
+
+ You will know when you are a real kernel hacker
+ when you start typoing printf as printk in your user programs :)
+
+
+
+
+
+
+
+ Another sidenote: the original Unix Version 6 sources had a
+ comment on top of its printf function: "Printf should not be
+ used for chit-chat". You should follow that advice.
+
+
+
+
+
+
+ copy_[to/from]_user()
+ /
+ get_user()
+ /
+ put_user()
+
+
+
+
+ [SLEEPS]
+
+
+
+ put_user() and get_user()
+ are used to get and put single values (such as an int, char, or
+ long) from and to userspace. A pointer into userspace should
+ never be simply dereferenced: data should be copied using these
+ routines. Both return -EFAULT or 0.
+
+
+ copy_to_user() and
+ copy_from_user() are more general: they copy
+ an arbitrary amount of data to and from userspace.
+
+
+ Unlike put_user() and
+ get_user(), they return the amount of
+ uncopied data (ie. 0 still means
+ success).
+
+
+ [Yes, this moronic interface makes me cringe. Please submit a
+ patch and become my hero --RR.]
+
+
+ The functions may sleep implicitly. This should never be called
+ outside user context (it makes no sense), with interrupts
+ disabled, or a spinlock held.
+
+
+
+
+ kmalloc()/kfree()
+
+
+
+ [MAY SLEEP: SEE BELOW]
+
+
+
+ These routines are used to dynamically request pointer-aligned
+ chunks of memory, like malloc and free do in userspace, but
+ kmalloc() takes an extra flag word.
+ Important values:
+
+
+
+
+
+
+ GFP_KERNEL
+
+
+
+
+ May sleep and swap to free memory. Only allowed in user
+ context, but is the most reliable way to allocate memory.
+
+
+
+
+
+
+
+ GFP_ATOMIC
+
+
+
+
+ Don't sleep. Less reliable than GFP_KERNEL,
+ but may be called from interrupt context. You should
+ really have a good out-of-memory
+ error-handling strategy.
+
+
+
+
+
+
+
+ GFP_DMA
+
+
+
+
+ Allocate ISA DMA lower than 16MB. If you don't know what that
+ is you don't need it. Very unreliable.
+
+
+
+
+
+
+ If you see a kmem_grow: Called nonatomically from int
+ warning message you called a memory allocation function
+ from interrupt context without GFP_ATOMIC.
+ You should really fix that. Run, don't walk.
+
+
+
+ If you are allocating at least PAGE_SIZE
+ () bytes,
+ consider using __get_free_pages()
+
+ (). It
+ takes an order argument (0 for page sized, 1 for double page, 2
+ for four pages etc.) and the same memory priority flag word as
+ above.
+
+
+
+ If you are allocating more than a page worth of bytes you can use
+ vmalloc(). It'll allocate virtual memory in
+ the kernel map. This block is not contiguous in physical memory,
+ but the MMU makes it look like it is for you
+ (so it'll only look contiguous to the CPUs, not to external device
+ drivers). If you really need large physically contiguous memory
+ for some weird device, you have a problem: it is poorly supported
+ in Linux because after some time memory fragmentation in a running
+ kernel makes it hard. The best way is to allocate the block early
+ in the boot process.
+
+
+
+ Before inventing your own cache of often-used objects consider
+ using a slab cache in
+
+
+
+
+
+ current
+
+
+
+ This global variable (really a macro) contains a pointer to
+ the current task structure, so is only valid in user context.
+ For example, when a process makes a system call, this will
+ point to the task structure of the calling process. It is
+ not NULL in interrupt context.
+
+
+
+
+ local_irq_save()/local_irq_restore()
+
+
+
+
+ These routines disable hard interrupts on the local CPU, and
+ restore them. They are reentrant; saving the previous state in
+ their one unsigned long flags argument. If you
+ know that interrupts are enabled, you can simply use
+ local_irq_disable() and
+ local_irq_enable().
+
+
+
+
+ local_bh_disable()/local_bh_enable()
+
+
+
+ These routines disable soft interrupts on the local CPU, and
+ restore them. They are reentrant; if soft interrupts were
+ disabled before, they will still be disabled after this pair
+ of functions has been called. They prevent softirqs, tasklets
+ and bottom halves from running on the current CPU.
+
+
+
+
+ smp_processor_id()/cpu_[number/logical]_map()
+
+
+
+ smp_processor_id() returns the current
+ processor number, between 0 and NR_CPUS (the
+ maximum number of CPUs supported by Linux, currently 32). These
+ values are not necessarily continuous: to get a number between 0
+ and smp_num_cpus() (the number of actual
+ processors in this machine), the
+ cpu_number_map() function is used to map the
+ processor id to a logical number.
+ cpu_logical_map() does the reverse.
+
+
+
+
+ __init/__exit/__initdata
+
+
+
+ After boot, the kernel frees up a special section; functions
+ marked with __init and data structures marked with
+ __initdata are dropped after boot is complete (within
+ modules this directive is currently ignored). __exit
+ is used to declare a function which is only required on exit: the
+ function will be dropped if this file is not compiled as a module.
+ See the header file for use.
+
+
+
+
+
+ __initcall()/module_init()
+
+
+ Many parts of the kernel are well served as a module
+ (dynamically-loadable parts of the kernel). Using the
+ module_init() and
+ module_exit() macros it is easy to write code
+ without #ifdefs which can operate both as a module or built into
+ the kernel.
+
+
+
+ The module_init() macro defines which
+ function is to be called at module insertion time (if the file is
+ compiled as a module), or at boot time: if the file is not
+ compiled as a module the module_init() macro
+ becomes equivalent to __initcall(), which
+ through linker magic ensures that the function is called on boot.
+
+
+
+ The function can return a negative error number to cause
+ module loading to fail (unfortunately, this has no effect if
+ the module is compiled into the kernel). For modules, this is
+ called in user context, with interrupts enabled, and the
+ kernel lock held, so it can sleep.
+
+
+
+
+ module_exit()
+
+
+
+ This macro defines the function to be called at module removal
+ time (or never, in the case of the file compiled into the
+ kernel). It will only be called if the module usage count has
+ reached zero. This function can also sleep, but cannot fail:
+ everything must be cleaned up by the time it returns.
+
+
+
+
+ MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT
+
+
+
+ These manipulate the module usage count, to protect against
+ removal (a module also can't be removed if another module uses
+ one of its exported symbols: see below). Every reference to
+ the module from user context should be reflected by this
+ counter (e.g. for every data structure or socket) before the
+ function sleeps. To quote Tim Waugh:
+
+
+
+/* THIS IS BAD */
+foo_open (...)
+{
+ stuff..
+ if (fail)
+ return -EBUSY;
+ sleep.. (might get unloaded here)
+ stuff..
+ MOD_INC_USE_COUNT;
+ return 0;
+}
+
+/* THIS IS GOOD /
+foo_open (...)
+{
+ MOD_INC_USE_COUNT;
+ stuff..
+ if (fail) {
+ MOD_DEC_USE_COUNT;
+ return -EBUSY;
+ }
+ sleep.. (safe now)
+ stuff..
+ return 0;
+}
+
+
+
+
+
+ Wait Queues
+
+
+
+ [SLEEPS]
+
+
+
+ A wait queue is used to wait for someone to wake you up when a
+ certain condition is true. They must be used carefully to ensure
+ there is no race condition. You declare a
+ wait_queue_head_t, and then processes which want to
+ wait for that condition declare a wait_queue_t
+ referring to themselves, and place that in the queue.
+
+
+
+ Declaring
+
+
+ You declare a wait_queue_head_t using the
+ DECLARE_WAIT_QUEUE_HEAD() macro, or using the
+ init_waitqueue_head() routine in your
+ initialization code.
+
+
+
+
+ Queuing
+
+
+ Placing yourself in the waitqueue is fairly complex, because you
+ must put yourself in the queue before checking the condition.
+ There is a macro to do this:
+ wait_event_interruptible()
+
+ The
+ first argument is the wait queue head, and the second is an
+ expression which is evaluated; the macro returns
+ 0 when this expression is true, or
+ -ERESTARTSYS if a signal is received.
+ The wait_event() version ignores signals.
+
+
+
+
+ Waking Up Queued Tasks
+
+
+ Call wake_up()
+
+ ;,
+ which will wake up every process in the queue. The exception is
+ if one has TASK_EXCLUSIVE set, in which case
+ the remainder of the queue will not be woken.
+
+
+
+
+
+ Atomic Operations
+
+
+ Certain operations are guaranteed atomic on all platforms. The
+ first class of operations work on atomic_t
+
+ ; this
+ contains a signed integer (at least 32 bits long), and you must use
+ these functions to manipulate or read atomic_t variables.
+ atomic_read() and
+ atomic_set() get and set the counter,
+ atomic_add(),
+ atomic_sub(),
+ atomic_inc(),
+ atomic_dec(), and
+ atomic_dec_and_test() (returns
+ true if it was decremented to zero).
+
+
+
+ Yes. It returns true (i.e. != 0) if the
+ atomic variable is zero.
+
+
+
+ Note that these functions are slower than normal arithmetic, and
+ so should not be used unnecessarily. On some platforms they
+ are much slower, like 32-bit Sparc where they use a spinlock.
+
+
+
+ The second class of atomic operations is atomic bit operations,
+ defined in
+
+ . These
+ operations generally take a pointer to the bit pattern, and a bit
+ number: 0 is the least significant bit.
+ set_bit(), clear_bit()
+ and change_bit() set, clear, and flip the
+ given bit. test_and_set_bit(),
+ test_and_clear_bit() and
+ test_and_change_bit() do the same thing,
+ except return true if the bit was previously set; these are
+ particularly useful for very simple locking.
+
+
+
+ It is possible to call these operations with bit indices greater
+ than 31. The resulting behavior is strange on big-endian
+ platforms though so it is a good idea not to do this.
+
+
+
+
+ Symbols
+
+
+ Within the kernel proper, the normal linking rules apply
+ (ie. unless a symbol is declared to be file scope with the
+ static keyword, it can be used anywhere in the
+ kernel). However, for modules, a special exported symbol table is
+ kept which limits the entry points to the kernel proper. Modules
+ can also export symbols.
+
+
+
+ EXPORT_SYMBOL()
+
+
+
+ This is the classic method of exporting a symbol, and it works
+ for both modules and non-modules. In the kernel all these
+ declarations are often bundled into a single file to help
+ genksyms (which searches source files for these declarations).
+ See the comment on genksyms and Makefiles below.
+
+
+
+
+ EXPORT_SYMTAB
+
+
+ For convenience, a module usually exports all non-file-scope
+ symbols (ie. all those not declared static). If this
+ is defined before
+
+ is
+ included, then only symbols explicit exported with
+ EXPORT_SYMBOL() will be exported.
+
+
+
+
+
+ Routines and Conventions
+
+
+ Double-linked lists
+
+
+
+ There are three sets of linked-list routines in the kernel
+ headers, but this one seems to be winning out (and Linus has
+ used it). If you don't have some particular pressing need for
+ a single list, it's a good choice. In fact, I don't care
+ whether it's a good choice or not, just use it so we can get
+ rid of the others.
+
+
+
+
+ Return Conventions
+
+
+ For code called in user context, it's very common to defy C
+ convention, and return 0 for success,
+ and a negative error number
+ (eg. -EFAULT) for failure. This can be
+ unintuitive at first, but it's fairly widespread in the networking
+ code, for example.
+
+
+
+ The filesystem code uses ERR_PTR()
+
+ ; to
+ encode a negative error number into a pointer, and
+ IS_ERR() and PTR_ERR()
+ to get it back out again: avoids a separate pointer parameter for
+ the error number. Icky, but in a good way.
+
+
+
+
+ Breaking Compilation
+
+
+ Linus and the other developers sometimes change function or
+ structure names in development kernels; this is not done just to
+ keep everyone on their toes: it reflects a fundamental change
+ (eg. can no longer be called with interrupts on, or does extra
+ checks, or doesn't do checks which were caught before). Usually
+ this is accompanied by a fairly complete note to the linux-kernel
+ mailing list; search the archive. Simply doing a global replace
+ on the file usually makes things worse.
+
+
+
+
+ Initializing structure members
+
+
+ The preferred method of initializing structures is to use the
+ gcc Labeled Elements extension, eg:
+
+
+static struct block_device_operations opt_fops = {
+ open: opt_open,
+ release: opt_release,
+ ioctl: opt_ioctl,
+ check_media_change: opt_media_change,
+};
+
+
+
+ This makes it easy to grep for, and makes it clear which
+ structure fields are set. You should do this because it looks
+ cool.
+
+
+
+
+ GNU Extensions
+
+
+ GNU Extensions are explicitly allowed in the Linux kernel.
+ Note that some of the more complex ones are not very well
+ supported, due to lack of general use, but the following are
+ considered standard (see the GCC info page section "C
+ Extensions" for more details - Yes, really the info page, the
+ man page is only a short summary of the stuff in info):
+
+
+
+
+ Inline functions
+
+
+
+
+ Statement expressions (ie. the ({ and }) constructs).
+
+
+
+
+ Declaring attributes of a function / variable / type
+ (__attribute__)
+
+
+
+
+ Labeled elements
+
+
+
+
+ typeof
+
+
+
+
+ Zero length arrays
+
+
+
+
+ Macro varargs
+
+
+
+
+ Arithmetic on void pointers
+
+
+
+
+ Non-Constant initializers
+
+
+
+
+ Assembler Instructions (not outside arch/ and include/asm/)
+
+
+
+
+ Function names as strings (__FUNCTION__)
+
+
+
+
+ __builtin_constant_p()
+
+
+
+
+
+ Be wary when using long long in the kernel, the code gcc generates for
+ it is horrible and worse: division and multiplication does not work
+ on i386 because the GCC runtime functions for it are missing from
+ the kernel environment.
+
+
+
+
+
+
+ C++
+
+
+ Using C++ in the kernel is usually a bad idea, because the
+ kernel does not provide the necessary runtime environment
+ and the include files are not tested for it. It is still
+ possible, but not recommended. If you really want to do
+ this, forget about exceptions at least.
+
+
+
+
+ #if
+
+
+ It is generally considered cleaner to use macros in header files
+ (or at the top of .c files) to abstract away functions rather than
+ using `#if' pre-processor statements throughout the source code.
+
+
+
+
+
+ Putting Your Stuff in the Kernel
+
+
+ In order to get your stuff into shape for official inclusion, or
+ even to make a neat patch, there's administrative work to be
+ done:
+
+
+
+
+ Figure out whose pond you've been pissing in. Look at the top of
+ the source files, inside the MAINTAINERS
+ file, and last of all in the CREDITS file.
+ You should coordinate with this person to make sure you're not
+ duplicating effort, or trying something that's already been
+ rejected.
+
+
+
+ Make sure you put your name and EMail address at the top of
+ any files you create or mangle significantly. This is the
+ first place people will look when they find a bug, or when
+ they want to make a change.
+
+
+
+
+
+ Usually you want a configuration option for your kernel hack.
+ Edit Config.in in the appropriate directory
+ (but under arch/ it's called
+ config.in). The Config Language used is not
+ bash, even though it looks like bash; the safe way is to use only
+ the constructs that you already see in
+ Config.in files (see
+ Documentation/kbuild/config-language.txt).
+ It's good to run "make xconfig" at least once to test (because
+ it's the only one with a static parser).
+
+
+
+ Variables which can be Y or N use bool followed by a
+ tagline and the config define name (which must start with
+ CONFIG_). The tristate function is the same, but
+ allows the answer M (which defines
+ CONFIG_foo_MODULE in your source, instead of
+ CONFIG_FOO) if CONFIG_MODULES
+ is enabled.
+
+
+
+ You may well want to make your CONFIG option only visible if
+ CONFIG_EXPERIMENTAL is enabled: this serves as a
+ warning to users. There many other fancy things you can do: see
+ the the various Config.in files for ideas.
+
+
+
+
+
+ Edit the Makefile: the CONFIG variables are
+ exported here so you can conditionalize compilation with `ifeq'.
+ If your file exports symbols then add the names to
+ MX_OBJS or OX_OBJS instead
+ of M_OBJS or O_OBJS, so
+ that genksyms will find them.
+
+
+
+
+
+ Document your option in Documentation/Configure.help. Mention
+ incompatibilities and issues here. Definitely
+ end your description with if in doubt, say N
+
(or, occasionally, `Y'); this is for people who have no
+ idea what you are talking about.
+
+
+
+
+
+ Put yourself in CREDITS if you've done
+ something noteworthy, usually beyond a single file (your name
+ should be at the top of the source files anyway).
+ MAINTAINERS means you want to be consulted
+ when changes are made to a subsystem, and hear about bugs; it
+ implies a more-than-passing commitment to some part of the code.
+
+
+
+
+
+
+ Kernel Cantrips
+
+
+ Some favorites from browsing the source. Feel free to add to this
+ list.
+
+
+
+ include/linux/brlock.h:
+
+
+extern inline void br_read_lock (enum brlock_indices idx)
+{
+ /*
+ * This causes a link-time bug message if an
+ * invalid index is used:
+ */
+ if (idx >= __BR_END)
+ __br_lock_usage_bug();
+
+ read_lock(&__brlock_array[smp_processor_id()][idx]);
+}
+
+
+
+ include/linux/fs.h:
+
+
+/*
+ * Kernel pointers have redundant information, so we can use a
+ * scheme where we can return either an error code or a dentry
+ * pointer with the same return value.
+ *
+ * This should be a per-architecture thing, to allow different
+ * error and pointer decisions.
+ */
+ #define ERR_PTR(err) ((void *)((long)(err)))
+ #define PTR_ERR(ptr) ((long)(ptr))
+ #define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000))
+
+
+
+ include/asm-i386/uaccess.h:
+
+
+
+#define copy_to_user(to,from,n) \
+ (__builtin_constant_p(n) ? \
+ __constant_copy_to_user((to),(from),(n)) : \
+ __generic_copy_to_user((to),(from),(n)))
+
+
+
+ arch/sparc/kernel/head.S:
+
+
+
+/*
+ * Sun people can't spell worth damn. "compatability" indeed.
+ * At least we *know* we can't spell, and use a spell-checker.
+ */
+
+/* Uh, actually Linus it is I who cannot spell. Too much murky
+ * Sparc assembly will do this to ya.
+ */
+C_LABEL(cputypvar):
+ .asciz "compatability"
+
+/* Tested on SS-5, SS-10. Probably someone at Sun applied a spell-checker. */
+ .align 4
+C_LABEL(cputypvar_sun4m):
+ .asciz "compatible"
+
+
+
+ arch/sparc/lib/checksum.S:
+
+
+
+ /* Sun, you just can't beat me, you just can't. Stop trying,
+ * give up. I'm serious, I am going to kick the living shit
+ * out of you, game over, lights out.
+ */
+
+
+
+
+ Thanks
+
+
+ Thanks to Andi Kleen for the idea, answering my questions, fixing
+ my mistakes, filling content, etc. Philipp Rumpf for more spelling
+ and clarity fixes, and some excellent non-obvious points. Werner
+ Almesberger for giving me a great summary of
+ disable_irq(), and Jes Sorensen and Andrea
+ Arcangeli added caveats. Michael Elizabeth Chastain for checking
+ and adding to the Configure section. Telsa Gwynne for teaching me DocBook.
+
+
+
+
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/DocBook/kernel-locking.tmpl linux/Documentation/DocBook/kernel-locking.tmpl
--- v2.3.99-pre8/linux/Documentation/DocBook/kernel-locking.tmpl Wed Dec 31 16:00:00 1969
+++ linux/Documentation/DocBook/kernel-locking.tmpl Sun May 21 20:18:07 2000
@@ -0,0 +1,1221 @@
+
+
+
+
+ Unreliable Guide To Locking
+
+
+
+ Paul
+ Rusty
+ Russell
+
+
+ rusty@linuxcare.com
+
+
+
+
+
+
+ 2000
+ Paul Russell
+
+
+
+
+ This documentation is free software; you can redistribute
+ it and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+
+
+
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA
+
+
+
+ For more details see the file COPYING in the source
+ distribution of Linux.
+
+
+
+
+
+
+ Introduction
+
+ Welcome, to Rusty's Remarkably Unreliable Guide to Kernel
+ Locking issues. This document describes the locking systems in
+ the Linux Kernel as we approach 2.4.
+
+
+ It looks like SMP
+ is here to stay; so everyone hacking on the kernel
+ these days needs to know the fundamentals of concurrency and locking
+ for SMP.
+
+
+
+ The Problem With Concurrency
+
+ (Skip this if you know what a Race Condition is).
+
+
+ In a normal program, you can increment a counter like so:
+
+
+ very_important_count++;
+
+
+
+ This is what they would expect to happen:
+
+
+
+ Expected Results
+
+
+
+
+
+ Instance 1
+ Instance 2
+
+
+
+
+
+ read very_important_count (5)
+
+
+
+ add 1 (6)
+
+
+
+ write very_important_count (6)
+
+
+
+
+ read very_important_count (6)
+
+
+
+ add 1 (7)
+
+
+
+ write very_important_count (7)
+
+
+
+
+
+
+
+ This is what might happen:
+
+
+
+ Possible Results
+
+
+
+
+ Instance 1
+ Instance 2
+
+
+
+
+
+ read very_important_count (5)
+
+
+
+
+ read very_important_count (5)
+
+
+ add 1 (6)
+
+
+
+
+ add 1 (5)
+
+
+ write very_important_count (6)
+
+
+
+
+ write very_important_count (6)
+
+
+
+
+
+
+ This overlap, where what actually happens depends on the
+ relative timing of multiple tasks, is called a race condition.
+ The piece of code containing the concurrency issue is called a
+ critical region. And especially since Linux starting running
+ on SMP machines, they became one of the major issues in kernel
+ design and implementation.
+
+
+ The solution is to recognize when these simultaneous accesses
+ occur, and use locks to make sure that only one instance can
+ enter the critical region at any time. There are many
+ friendly primitives in the Linux kernel to help you do this.
+ And then there are the unfriendly primitives, but I'll pretend
+ they don't exist.
+
+
+
+
+
+ Two Main Types of Kernel Locks: Spinlocks and Semaphores
+
+
+ There are two main types of kernel locks. The fundamental type
+ is the spinlock
+ (),
+ which is a very simple single-holder lock: if you can't get the
+ spinlock, you keep trying (spinning) until you can. Spinlocks are
+ very small and fast, and can be used anywhere.
+
+
+ The second type is a semaphore
+ (): it
+ can have more than one holder at any time (the number decided at
+ initialization time), although it is most commonly used as a
+ single-holder lock (a mutex). If you can't get a semaphore,
+ your task will put itself on the queue, and be woken up when the
+ semaphore is released. This means the CPU will do something
+ else while you are waiting, but there are many cases when you
+ simply can't sleep, and so have to use a spinlock instead.
+
+
+
+ Locks and Uniprocessor Kernels
+
+
+ For kernels compiled without CONFIG_SMP, spinlocks
+ do not exist at all. This is an excellent design decision: when
+ no-one else can run at the same time, there is no reason to
+ have a lock at all.
+
+
+
+ You should always test your locking code with CONFIG_SMP
+ enabled, even if you don't have an SMP test box, because it
+ will still catch some (simple) kinds of deadlock.
+
+
+
+ Semaphores still exist, because they are required for
+ synchronization between user
+ contexts, as we will see below.
+
+
+
+
+ Read/Write Lock Variants
+
+
+ Both spinlocks and semaphores have read/write variants:
+ rwlock_t and struct rw_semaphore.
+ These divide users into two classes: the readers and the writers. If
+ you are only reading the data, you can get a read lock, but to write to
+ the data you need the write lock. Many people can hold a read lock,
+ but a writer must be sole holder.
+
+
+
+ This means much smoother locking if your code divides up
+ neatly along reader/writer lines. All the discussions below
+ also apply to read/write variants.
+
+
+
+
+ Locking Only In User Context
+
+
+ If you have a data structure which is only ever accessed from
+ user context, then you can use a simple semaphore
+ (linux/asm/semaphore.h) to protect it. This
+ is the most trivial case: you initialize the semaphore to the number
+ of resources available (usually 1), and call
+ down_interruptible() to grab the semaphore, and
+ up() to release it. There is also a
+ down(), which should be avoided, because it
+ will not return if a signal is received.
+
+
+
+ Example: linux/net/core/netfilter.c allows
+ registration of new setsockopt() and
+ getsockopt() calls, with
+ nf_register_sockopt(). Registration and
+ de-registration are only done on module load and unload (and boot
+ time, where there is no concurrency), and the list of registrations
+ is only consulted for an unknown setsockopt()
+ or getsockopt() system call. The
+ nf_sockopt_mutex is perfect to protect this,
+ especially since the setsockopt and getsockopt calls may well
+ sleep.
+
+
+
+
+ Locking Between User Context and BHs
+
+
+ If a bottom half shares
+ data with user context, you have two problems. Firstly, the current
+ user context can be interrupted by a bottom half, and secondly, the
+ critical region could be entered from another CPU. This is where
+ spin_lock_bh()
+ () is
+ used. It disables bottom halves on that CPU, then grabs the lock.
+ spin_unlock_bh() does the reverse.
+
+
+
+ This works perfectly for UP
+ as well: the spin lock vanishes, and this macro
+ simply becomes local_bh_disable()
+ (), which
+ protects you from the bottom half being run.
+
+
+
+
+ Locking Between User Context and Tasklets/Soft IRQs
+
+
+ This is exactly the same as above, because
+ local_bh_disable() actually disables all
+ softirqs and tasklets
+ on that CPU as well. It should really be
+ called `local_softirq_disable()', but the name has been preserved
+ for historical reasons. Similarly,
+ spin_lock_bh() would now be called
+ spin_lock_softirq() in a perfect world.
+
+
+
+
+ Locking Between Bottom Halves
+
+
+ Sometimes a bottom half might want to share data with
+ another bottom half (especially remember that timers are run
+ off a bottom half).
+
+
+
+ The Same BH
+
+
+ Since a bottom half is never run on two CPUs at once, you
+ don't need to worry about your bottom half being run twice
+ at once, even on SMP.
+
+
+
+
+ Different BHs
+
+
+ Since only one bottom half ever runs at a time once, you
+ don't need to worry about race conditions with other bottom
+ halves. Beware that things might change under you, however,
+ if someone changes your bottom half to a tasklet. If you
+ want to make your code future-proof, pretend you're already
+ running from a tasklet (see below), and doing the extra
+ locking. Of course, if it's five years before that happens,
+ you're gonna look like a damn fool.
+
+
+
+
+
+ Locking Between Tasklets
+
+
+ Sometimes a tasklet might want to share data with another
+ tasklet, or a bottom half.
+
+
+
+ The Same Tasklet
+
+ Since a tasklet is never run on two CPUs at once, you don't
+ need to worry about your tasklet being reentrant (running
+ twice at once), even on SMP.
+
+
+
+
+ Different Tasklets
+
+ If another tasklet (or bottom half, such as a timer) wants
+ to share data with your tasklet, you will both need to use
+ spin_lock() and
+ spin_unlock() calls.
+ spin_lock_bh() is
+ unnecessary here, as you are already in a a tasklet, and
+ none will be run on the same CPU.
+
+
+
+
+
+ Locking Between Softirqs
+
+
+ Often a softirq might
+ want to share data with itself, a tasklet, or a bottom half.
+
+
+
+ The Same Softirq
+
+
+ The same softirq can run on the other CPUs: you can use a
+ per-CPU array (see ) for better
+ performance. If you're going so far as to use a softirq,
+ you probably care about scalable performance enough
+ to justify the extra complexity.
+
+
+
+ You'll need to use spin_lock() and
+ spin_unlock() for shared data.
+
+
+
+
+ Different Softirqs
+
+
+ You'll need to use spin_lock() and
+ spin_unlock() for shared data, whether it
+ be a timer (which can be running on a different CPU), bottom half,
+ tasklet or the same or another softirq.
+
+
+
+
+
+
+ Hard IRQ Context
+
+
+ Hardware interrupts usually communicate with a bottom half,
+ tasklet or softirq. Frequently this involved putting work in a
+ queue, which the BH/softirq will take out.
+
+
+
+ Locking Between Hard IRQ and Softirqs/Tasklets/BHs
+
+
+ If a hardware irq handler shares data with a softirq, you have
+ two concerns. Firstly, the softirq processing can be
+ interrupted by a hardware interrupt, and secondly, the
+ critical region could be entered by a hardware interrupt on
+ another CPU. This is where spin_lock_irq() is
+ used. It is defined to disable interrupts on that cpu, then grab
+ the lock. spin_unlock_irq() does the reverse.
+
+
+
+ This works perfectly for UP as well: the spin lock vanishes,
+ and this macro simply becomes local_irq_disable()
+ (), which
+ protects you from the softirq/tasklet/BH being run.
+
+
+
+ spin_lock_irqsave()
+ (include/linux/spinlock.h) is a variant
+ which saves whether interrupts were on or off in a flags word,
+ which is passed to spin_lock_irqrestore(). This
+ means that the same code can be used inside an hard irq handler (where
+ interrupts are already off) and in softirqs (where the irq
+ disabling is required).
+
+
+
+
+
+ Common Techniques
+
+
+ This section lists some common dilemmas and the standard
+ solutions used in the Linux kernel code. If you use these,
+ people will find your code simpler to understand.
+
+
+
+ If I could give you one piece of advice: never sleep with anyone
+ crazier than yourself. But if I had to give you advice on
+ locking: keep it simple.
+
+
+
+ Lock data, not code.
+
+
+
+ Be reluctant to introduce new locks.
+
+
+
+ Strangely enough, this is the exact reverse of my advice when
+ you have slept with someone crazier than yourself.
+
+
+
+ No Writers in Interrupt Context
+
+
+ There is a fairly common case where an interrupt handler needs
+ access to a critical region, but does not need write access.
+ In this case, you do not need to use
+ read_lock_irq(), but only
+ read_lock() everywhere (since if an interrupt
+ occurs, the irq handler will only try to grab a read lock, which
+ won't deadlock). You will still need to use
+ write_lock_irq().
+
+
+
+ Similar logic applies to locking between softirqs/tasklets/BHs
+ which never need a write lock, and user context:
+ read_lock() and
+ write_lock_bh().
+
+
+
+
+ Deadlock: Simple and Advanced
+
+
+ There is a coding bug where a piece of code tries to grab a
+ spinlock twice: it will spin forever, waiting for the lock to
+ be released (spinlocks and writelocks are not re-entrant in
+ Linux). This is trivial to diagnose: not a
+ stay-up-five-nights-talk-to-fluffy-code-bunnies kind of
+ problem.
+
+
+
+ For a slightly more complex case, imagine you have a region
+ shared by a bottom half and user context. If you use a
+ spin_lock() call to protect it, it is
+ possible that the user context will be interrupted by the bottom
+ half while it holds the lock, and the bottom half will then spin
+ forever trying to get the same lock.
+
+
+
+ Both of these are called deadlock, and as shown above, it can
+ occur even with a single CPU (although not on UP compiles,
+ since spinlocks vanish on kernel compiles with
+ CONFIG_SMP=n. You'll still get data corruption
+ in the second example).
+
+
+
+ This complete lockup is easy to diagnose: on SMP boxes the
+ watchdog timer or compiling with DEBUG_SPINLOCKS set
+ (include/linux/spinlock.h) will show this up
+ immediately when it happens.
+
+
+
+ A more complex problem is the so-called `deadly embrace',
+ involving two or more locks. Say you have a hash table: each
+ entry in the table is a spinlock, and a chain of hashed
+ objects. Inside a softirq handler, you sometimes want to
+ alter an object from one place in the hash to another: you
+ grab the spinlock of the old hash chain and the spinlock of
+ the new hash chain, and delete the object from the old one,
+ and insert it in the new one.
+
+
+
+ There are two problems here. First, if your code ever
+ tries to move the object to the same chain, it will deadlock
+ with itself as it tries to lock it twice. Secondly, if the
+ same softirq on another CPU is trying to move another object
+ in the reverse direction, the following could happen:
+
+
+
+ Consequences
+
+
+
+
+
+ CPU 1
+ CPU 2
+
+
+
+
+
+ Grab lock A -> OK
+ Grab lock B -> OK
+
+
+ Grab lock B -> spin
+ Grab lock A -> spin
+
+
+
+
+
+
+ The two CPUs will spin forever, waiting for the other to give up
+ their lock. It will look, smell, and feel like a crash.
+
+
+
+ Preventing Deadlock
+
+
+ Textbooks will tell you that if you always lock in the same
+ order, you will never get this kind of deadlock. Practice
+ will tell you that this approach doesn't scale: when I
+ create a new lock, I don't understand enough of the kernel
+ to figure out where in the 5000 lock hierarchy it will fit.
+
+
+
+ The best locks are encapsulated: they never get exposed in
+ headers, and are never held around calls to non-trivial
+ functions outside the same file. You can read through this
+ code and see that it will never deadlock, because it never
+ tries to grab another lock while it has that one. People
+ using your code don't even need to know you are using a
+ lock.
+
+
+
+ A classic problem here is when you provide callbacks or
+ hooks: if you call these with the lock held, you risk simple
+ deadlock, or a deadly embrace (who knows what the callback
+ will do?). Remember, the other programmers are out to get
+ you, so don't do this.
+
+
+
+
+ Overzealous Prevention Of Deadlocks
+
+
+ Deadlocks are problematic, but not as bad as data
+ corruption. Code which grabs a read lock, searches a list,
+ fails to find what it wants, drops the read lock, grabs a
+ write lock and inserts the object has a race condition.
+
+
+
+ If you don't see why, please stay the fuck away from my code.
+
+
+
+
+
+ Per-CPU Data
+
+
+ A great technique for avoiding locking which is used fairly
+ widely is to duplicate information for each CPU. For example,
+ if you wanted to keep a count of a common condition, you could
+ use a spin lock and a single counter. Nice and simple.
+
+
+
+ If that was too slow [it's probably not], you could instead
+ use a counter for each CPU [don't], then none of them need an
+ exclusive lock [you're wasting your time here]. To make sure
+ the CPUs don't have to synchronize caches all the time, align
+ the counters to cache boundaries by appending
+ `__cacheline_aligned' to the declaration
+ ().
+ [Can't you think of anything better to do?]
+
+
+
+ They will need a read lock to access their own counters,
+ however. That way you can use a write lock to grant exclusive
+ access to all of them at once, to tally them up.
+
+
+
+
+ Big Reader Locks
+
+
+ A classic example of per-CPU information is Ingo's `big
+ reader' locks
+ (). These
+ use the Per-CPU Data techniques described above to create a lock which
+ is very fast to get a read lock, but agonizingly slow for a write
+ lock.
+
+
+
+ Fortunately, there are a limited number of these locks
+ available: you have to go through a strict interview process
+ to get one.
+
+
+
+
+ Avoiding Locks: Read And Write Ordering
+
+
+ Sometimes it is possible to avoid locking. Consider the
+ following case from the 2.2 firewall code, which inserted an
+ element into a single linked list in user context:
+
+
+
+ new->next = i->next;
+ i->next = new;
+
+
+
+ Here the author (Alan Cox, who knows what he's doing) assumes
+ that the pointer assignments are atomic. This is important,
+ because networking packets would traverse this list on bottom
+ halves without a lock. Depending on their exact timing, they
+ would either see the new element in the list with a valid
+ next pointer, or it would not be in the
+ list yet.
+
+
+
+ Of course, the writes must be in this
+ order, otherwise the new element appears in the list with an
+ invalid next pointer, and any other
+ CPU iterating at the wrong time will jump through it into garbage.
+ Because modern CPUs reorder, Alan's code actually read as follows:
+
+
+
+ new->next = i->next;
+ wmb();
+ i->next = new;
+
+
+
+ The wmb() is a write memory barrier
+ (): neither
+ the compiler nor the CPU will allow any writes to memory after the
+ wmb() to be visible to other hardware
+ before any of the writes before the wmb().
+
+
+
+ As i386 does not do write reordering, this bug would never
+ show up on that platform. On other SMP platforms, however, it
+ will.
+
+
+
+ There is also rmb() for read ordering: to ensure
+ any previous variable reads occur before following reads. The simple
+ mb() macro combines both
+ rmb() and wmb().
+
+
+
+ Dropping or gaining a spinlock, and any atomic operation are
+ all defined to act as memory barriers (ie. as per the
+ mb() macro).
+
+
+
+ There is a similar, but unrelated, problem with code like the
+ following:
+
+
+
+ if (!(ctrack->status & IPS_CONFIRMED)) {
+ spin_lock_bh(&ip_conntrack_lock);
+ if (!(ctrack->status & IPS_CONFIRMED)) {
+ clean_from_lists(h->ctrack);
+ h->ctrack->status |= IPS_CONFIRMED;
+ }
+ spin_unlock_bh(&ip_conntrack_lock);
+ }
+
+
+
+ In this case, the author has tried to be tricky: knowing that
+ the CONFIRMED bit is set and never reset in the status word,
+ you can test it outside the lock, and frequently avoid
+ grabbing the lock at all. However, the compiler could cache
+ the value in a register, rather than rereading it once the
+ lock is obtained, creating a subtle race. The way to get
+ around this is to declare the status field `volatile', or use
+ a temporary volatile pointer to achieve the same effect in
+ this one place.
+
+
+
+
+ Avoiding Locks: Atomic Operations
+
+
+ There are a number of atomic operations defined in
+ : these
+ are guaranteed to be seen atomically from all CPUs in the system, thus
+ avoiding races. If your shared data consists of a single counter, say,
+ these operations might be simpler than using spinlocks (although for
+ anything non-trivial using spinlocks is clearer).
+
+
+
+ Note that the atomic operations are defined to act as both
+ read and write barriers on all platforms.
+
+
+
+
+ Protecting A Collection of Objects: Reference Counts
+
+
+ Locking a collection of objects is fairly easy: you get a
+ single spinlock, and you make sure you grab it before
+ searching, adding or deleting an object.
+
+
+
+ The purpose of this lock is not to protect the individual
+ objects: you might have a separate lock inside each one for
+ that. It is to protect the data structure
+ containing the objects from race conditions. Often
+ the same lock is used to protect the contents of all the
+ objects as well, for simplicity, but they are inherently
+ orthogonal (and many other big words designed to confuse).
+
+
+
+ Changing this to a read-write lock will often help markedly if
+ reads are far more common that writes. If not, there is
+ another approach you can use to reduce the time the lock is
+ held: reference counts.
+
+
+
+ In this approach, an object has an owner, who sets the
+ reference count to one. Whenever you get a pointer to the
+ object, you increment the reference count (a `get' operation).
+ Whenever you relinquish a pointer, you decrement the reference
+ count (a `put' operation). When the owner wants to destroy
+ it, they mark it dead, and do a put.
+
+
+
+ Whoever drops the reference count to zero (usually implemented
+ with atomic_dec_and_test()) actually cleans
+ up and frees the object.
+
+
+
+ This means that you are guaranteed that the object won't
+ vanish underneath you, even though you no longer have a lock
+ for the collection.
+
+
+
+ Here's some skeleton code:
+
+
+
+ void create_foo(struct foo *x)
+ {
+ atomic_set(&x->use, 1);
+ spin_lock_bh(&list_lock);
+ ... insert in list ...
+ spin_unlock_bh(&list_lock);
+ }
+
+ struct foo *get_foo(int desc)
+ {
+ struct foo *ret;
+
+ spin_lock_bh(&list_lock);
+ ... find in list ...
+ if (ret) atomic_inc(&ret->use);
+ spin_unlock_bh(&list_lock);
+
+ return ret;
+ }
+
+ void put_foo(struct foo *x)
+ {
+ if (atomic_dec_and_test(&x->use))
+ kfree(foo);
+ }
+
+ void destroy_foo(struct foo *x)
+ {
+ spin_lock_bh(&list_lock);
+ ... remove from list ...
+ spin_unlock_bh(&list_lock);
+
+ put_foo(x);
+ }
+
+
+
+ Macros To Help You
+
+ There are a set of debugging macros tucked inside
+
+ and : these are very
+ useful for ensuring that locks are held in the right places to protect
+ infrastructure.
+
+
+
+
+
+ Things Which Sleep
+
+
+ You can never call the following routines while holding a
+ spinlock, as they may sleep:
+
+
+
+
+
+ Accesses to
+ userspace:
+
+
+
+
+ copy_from_user()
+
+
+
+
+ copy_to_user()
+
+
+
+
+ get_user()
+
+
+
+
+ put_user()
+
+
+
+
+
+
+
+ kmalloc(GFP_KERNEL)
+
+
+
+
+
+ printk(), which can be called from
+ user context, interestingly enough.
+
+
+
+
+
+
+ The Fucked Up Sparc
+
+
+ Alan Cox says the irq disable/enable is in the register
+ window on a sparc
. Andi Kleen says when you do
+ restore_flags in a different function you mess up all the
+ register windows
.
+
+
+
+ So never pass the flags word set by
+ spin_lock_irqsave() and brethren to another
+ function (unless it's declared inline. Usually no-one
+ does this, but now you've been warned. Dave Miller can never do
+ anything in a straightforward manner (I can say that, because I have
+ pictures of him and a certain PowerPC maintainer in a compromising
+ position).
+
+
+
+
+ Racing Timers: A Kernel Pastime
+
+
+ Timers can produce their own special problems with races.
+ Consider a collection of objects (list, hash, etc) where each
+ object has a timer which is due to destroy it.
+
+
+
+ If you want to destroy the entire collection (say on module
+ removal), you might do the following:
+
+
+
+ /* THIS CODE BAD BAD BAD BAD: IF IT WAS ANY WORSE IT WOULD USE
+ HUNGARIAN NOTATION */
+ spin_lock_bh(&list_lock);
+
+ while (list) {
+ struct foo *next = list->next;
+ del_timer(&list->timer);
+ kfree(list);
+ list = next;
+ }
+
+ spin_unlock_bh(&list_lock);
+
+
+
+ Sooner or later, this will crash on SMP, because a timer can
+ have just gone off before the spin_lock_bh(),
+ and it will only get the lock after we
+ spin_unlock_bh(), and then try to free
+ the element (which has already been freed!).
+
+
+
+ This can be avoided by checking the result of
+ del_timer(): if it returns
+ 1, the timer has been deleted.
+ If 0, it means (in this
+ case) that it is currently running, so we can do:
+
+
+
+ retry:
+ spin_lock_bh(&list_lock);
+
+ while (list) {
+ struct foo *next = list->next;
+ if (!del_timer(&list->timer)) {
+ /* Give timer a chance to delete this */
+ spin_unlock_bh(&list_lock);
+ goto retry;
+ }
+ kfree(list);
+ list = next;
+ }
+
+ spin_unlock_bh(&list_lock);
+
+
+
+ Another common problem is deleting timers which restart
+ themselves (by calling add_timer() at the end
+ of their timer function). Because this is a fairly common case
+ which is prone to races, the function del_timer_sync()
+ () is
+ provided to handle this case. It returns the number of times the timer
+ had to be deleted before we finally stopped it from adding itself back
+ in.
+
+
+
+
+
+ Further reading
+
+
+
+
+ Documentation/spinlocks.txt:
+ Linus Torvalds' spinlocking tutorial in the kernel sources.
+
+
+
+
+
+ Unix Systems for Modern Architectures: Symmetric
+ Multiprocessing and Caching for Kernel Programmers:
+
+
+
+ Curt Schimmel's very good introduction to kernel level
+ locking (not written for Linux, but nearly everything
+ applies). The book is expensive, but really worth every
+ penny to understand SMP locking. [ISBN: 0201633388]
+
+
+
+
+
+
+ Thanks
+
+
+ Thanks to Telsa Gwynne for DocBooking, neatening and adding
+ style.
+
+
+
+ Thanks to Martin Pool, Philipp Rumpf, Stephen Rothwell, Paul
+ Mackerras, Ruedi Aschwanden, Alan Cox for proofreading,
+ correcting, flaming, commenting.
+
+
+
+ Thanks to the cabal for having no influence on this document.
+
+
+
+
+ Glossary
+
+
+ bh
+
+
+ Bottom Half: for historical reasons, functions with
+ `_bh' in them often now refer to any software interrupt, e.g.
+ spin_lock_bh() blocks any software interrupt
+ on the current CPU. Bottom halves are deprecated, and will
+ eventually be replaced by tasklets. Only one bottom half will be
+ running at any time.
+
+
+
+
+
+ Hardware Interrupt / Hardware IRQ
+
+
+ Hardware interrupt request. in_irq() returns
+ true in a hardware interrupt handler (it
+ also returns true when interrupts are blocked).
+
+
+
+
+
+ Interrupt Context
+
+
+ Not user context: processing a hardware irq or software irq.
+ Indicated by the in_interrupt() macro
+ returning true (although it also
+ returns true when interrupts or BHs are blocked).
+
+
+
+
+
+ SMP
+
+
+ Symmetric Multi-Processor: kernels compiled for multiple-CPU
+ machines. (CONFIG_SMP=y).
+
+
+
+
+
+ softirq
+
+
+ Strictly speaking, one of up to 32 enumerated software
+ interrupts which can run on multiple CPUs at once.
+ Sometimes used to refer to tasklets and bottom halves as
+ well (ie. all software interrupts).
+
+
+
+
+
+ Software Interrupt / Software IRQ
+
+
+ Software interrupt handler. in_irq() returns
+ false; in_softirq()
+ returns true. Tasklets, softirqs and
+ bottom halves all fall into the category of `software interrupts'.
+
+
+
+
+
+ tasklet
+
+
+ A dynamically-registrable software interrupt,
+ which is guaranteed to only run on one CPU at a time.
+
+
+
+
+
+ UP
+
+
+ Uni-Processor: Non-SMP. (CONFIG_SMP=n).
+
+
+
+
+
+ User Context
+
+
+ The kernel executing on behalf of a particular
+ process or kernel thread (given by the current()
+ macro.) Not to be confused with userspace. Can be interrupted by
+ software or hardware interrupts.
+
+
+
+
+
+ Userspace
+
+
+ A process executing its own code outside the kernel.
+
+
+
+
+
+
+
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/DocBook/parportbook.tmpl linux/Documentation/DocBook/parportbook.tmpl
--- v2.3.99-pre8/linux/Documentation/DocBook/parportbook.tmpl Tue Apr 11 15:09:11 2000
+++ linux/Documentation/DocBook/parportbook.tmpl Tue May 23 08:44:35 2000
@@ -1,8 +1,9 @@
+
- The Parallel Port Subsystem
+ The Linux 2.4 Parallel Port Subsystem
@@ -51,90 +52,97 @@
-
+
-
-Design goals
+
+ Design goals
-
-The problems
+
+ The problems
-
-
-
-
+
+ The first parallel port support for Linux came with the line
+ printer driver, lp. The printer driver is a
+ character special device, and (in Linux 2.0) had support for
+ writing, via write, and configuration and
+ statistics reporting via ioctl.
+
+
+
+ The printer driver could be used on any computer that had an IBM
+ PC-compatible parallel port. Because some architectures have
+ parallel ports that aren't really the same as PC-style ports,
+ other variants of the printer driver were written in order to
+ support Amiga and Atari parallel ports.
+
+
+
+ When the Iomega Zip drive was released, and a driver written for
+ it, a problem became apparent. The Zip drive is a parallel port
+ device that provides a parallel port of its own---it is designed
+ to sit between a computer and an attached printer, with the
+ printer plugged into the Zip drive, and the Zip drive plugged into
+ the computer.
+
+
+
+ The problem was that, although printers and Zip drives were both
+ supported, for any given port only one could be used at a time.
+ Only one of the two drivers could be present in the kernel at
+ once. This was because of the fact that both drivers wanted to
+ drive the same hardware---the parallel port. When the printer
+ driver initialised, it would call the
+ check_region function to make sure that the
+ IO region associated with the parallel port was free, and then it
+ would call request_region to allocate it.
+ The Zip drive used the same mechanism. Whichever driver
+ initialised first would gain exclusive control of the parallel
+ port.
+
+
+
+ The only way around this problem at the time was to make sure that
+ both drivers were available as loadable kernel modules. To use
+ the printer, load the printer driver module; then for the Zip
+ drive, unload the printer driver module and load the Zip driver
+ module.
+
+
+
+ The net effect was that printing a document that was stored on a
+ Zip drive was a bit of an ordeal, at least if the Zip drive and
+ printer shared a parallel port. A better solution was
+ needed.
+
+
+
+ Zip drives are not the only devices that presented problems for
+ Linux. There are other devices with pass-through ports, for
+ example parallel port CD-ROM drives. There are also printers that
+ report their status textually rather than using simple error pins:
+ sending a command to the printer can cause it to report the number
+ of pages that it has ever printed, or how much free memory it has,
+ or whether it is running out of toner, and so on. The printer
+ driver didn't originally offer any facility for reading back this
+ information (although Carsten Gross added nibble mode readback
+ support for kernel 2.2).
+
-The first parallel port support for Linux came with the line
-printer driver, lp. The printer driver is a
-character special device, and (in Linux 2.0) had support for writing,
-via write, and configuration and statistics
-reporting via ioctl.
-
-The printer driver could be used on any computer that had an IBM
-PC-compatible parallel port. Because some architectures have parallel
-ports that aren't really the same as PC-style ports, other variants of
-the printer driver were written in order to support Amiga and Atari
-parallel ports.
-
-When the Iomega Zip drive was released, and a driver written for
-it, a problem became apparent. The Zip drive is a parallel port
-device that provides a parallel port of its own---it is designed to
-sit between a computer and an attached printer, with the printer
-plugged into the Zip drive, and the Zip drive plugged into the
-computer.
-
-The problem was that, although printers and Zip drives were both
-supported, for any given port only one could be used at a time. Only
-one of the two drivers could be present in the kernel at once. This
-was because of the fact that both drivers wanted to drive the same
-hardware---the parallel port. When the printer driver initialised, it
-would call the check_region function to make sure
-that the IO region associated with the parallel port was free, and
-then it would call request_region to allocate it.
-The Zip drive used the same mechanism. Whichever driver initialised
-first would gain exclusive control of the parallel port.
-
-The only way around this problem at the time was to make sure
-that both drivers were available as loadable kernel modules. To use
-the printer, load the printer driver module; then for the Zip drive,
-unload the printer driver module and load the Zip driver
-module.
-
-The net effect was that printing a document that was stored on a Zip
-drive was a bit of an ordeal, at least if the Zip drive and printer
-shared a parallel port. A better solution was needed.
-
-Zip drives are not the only devices that presented problems for
-Linux. There are other devices with pass-through ports, for example
-parallel port CD-ROM drives. There are also printers that report
-their status textually rather than using simple error pins: sending a
-command to the printer can cause it to report the number of pages that
-it has ever printed, or how much free memory it has, or whether it is
-running out of toner, and so on. The printer driver didn't originally
-offer any facility for reading back this information (although Carsten
-Gross added nibble mode readback support for kernel 2.2).
-
-
-
-The IEEE has issued a standards document called IEEE 1284, which
-documents existing practice for parallel port communications in a
-variety of modes. Those modes are: compatibility
,
-reverse nibble, reverse byte, ECP and EPP. Newer devices often use
-the more advanced modes of transfer (ECP and EPP). In Linux 2.0, the
-printer driver only supported compatibility mode
-(i.e. normal printer protocol) and reverse nibble mode.
+
+ The IEEE has issued a standards document called IEEE 1284, which
+ documents existing practice for parallel port communications in a
+ variety of modes. Those modes are: compatibility
,
+ reverse nibble, reverse byte, ECP and EPP. Newer devices often
+ use the more advanced modes of transfer (ECP and EPP). In Linux
+ 2.0, the printer driver only supported compatibility
+ mode
(i.e. normal printer protocol) and reverse nibble
+ mode.
+
-
+
-
-The solutions
+
+ The solutions
-The parport code in Linux 2.2 was designed
-to meet these problems of architectural differences in parallel ports,
-of port-sharing between devices with pass-through ports, and of lack
-of support for IEEE 1284 transfer modes.
-
-
-
-There are two layers to the
-parport subsystem, only one of which deals
-directly with the hardware. The other layer deals with sharing and
-IEEE 1284 transfer modes. In this way, parallel support for a
-particular architecture comes in the form of a module which registers
-itself with the generic sharing layer.
-
-
-
-The sharing model provided by the parport
-subsystem is one of exclusive access. A device driver, such as the
-printer driver, must ask the parport layer for
-access to the port, and can only use the port once access has been
-granted. When it has finished a transaction
, it can
-tell the parport layer that it may release the
-port for other device drivers to use.
-
-
-
-Devices with pass-through ports all manage to share a parallel
-port with other devices in generally the same way. The device has a
-latch for each of the pins on its pass-through port. The normal state
-of affairs is pass-through mode, with the device copying the signal
-lines between its host port and its pass-through port. When the
-device sees a special signal from the host port, it latches the
-pass-through port so that devices further downstream don't get
-confused by the pass-through device's conversation with the host
-parallel port: the device connected to the pass-through port (and any
-devices connected in turn to it) are effectively cut off from the
-computer. When the pass-through device has completed its transaction
-with the computer, it enables the pass-through port again.
-
-
-
-
-
-
-
-This technique relies on certain special signals
-being invisible to devices that aren't watching for them. This tends
-to mean only changing the data signals and leaving the control signals
-alone. IEEE 1284.3 documents a standard protocol for daisy-chaining
-devices together with parallel ports.
-
-
-
-Support for standard transfer modes are provided as operations
-that can be performed on a port, along with operations for setting the
-data lines, or the control lines, or reading the status lines. These
-operations appear to the device driver as function pointers; more
-later.
-
-
-
-
-
-
-Standard transfer modes
-
-
-
-
-The standard
transfer modes in use over the
-parallel port are defined
by a document called IEEE
-1284. It really just codifies existing practice and documents
-protocols (and variations on protocols) that have been in common use
-for quite some time.
-
-The original definitions of which pin did what were set out by
-Centronics Data Computer Corporation, but only the printer-side
-interface signals were specified.
-
-By the early 1980s, IBM's host-side implementation had become
-the most widely used. New printers emerged that claimed Centronics
-compatibility, but although compatible with Centronics they differed
-from one another in a number of ways.
-
-As a result of this, when IEEE 1284 was published in 1994, all
-that it could really do was document the various protocols that are
-used for printers (there are about six variations on a theme).
-
-In addition to the protocol used to talk to
-Centronics-compatible printers, IEEE 1284 defined other protocols that
-are used for unidirectional peripheral-to-host transfers (reverse
-nibble and reverse byte) and for fast bidirectional transfers (ECP and
-EPP).
+
+ The parport code in Linux 2.2 was designed to
+ meet these problems of architectural differences in parallel
+ ports, of port-sharing between devices with pass-through ports,
+ and of lack of support for IEEE 1284 transfer modes.
+
-
+
+
+
+ There are two layers to the parport
+ subsystem, only one of which deals directly with the hardware.
+ The other layer deals with sharing and IEEE 1284 transfer modes.
+ In this way, parallel support for a particular architecture comes
+ in the form of a module which registers itself with the generic
+ sharing layer.
+
-
-Structure
+
+
+
+ The sharing model provided by the parport
+ subsystem is one of exclusive access. A device driver, such as
+ the printer driver, must ask the parport
+ layer for access to the port, and can only use the port once
+ access has been granted. When it has finished a
+ transaction
, it can tell the
+ parport layer that it may release the port
+ for other device drivers to use.
+
+
+
+
+
+ Devices with pass-through ports all manage to share a parallel
+ port with other devices in generally the same way. The device has
+ a latch for each of the pins on its pass-through port. The normal
+ state of affairs is pass-through mode, with the device copying the
+ signal lines between its host port and its pass-through port.
+ When the device sees a special signal from the host port, it
+ latches the pass-through port so that devices further downstream
+ don't get confused by the pass-through device's conversation with
+ the host parallel port: the device connected to the pass-through
+ port (and any devices connected in turn to it) are effectively cut
+ off from the computer. When the pass-through device has completed
+ its transaction with the computer, it enables the pass-through
+ port again.
+
+
+
+
+
+
+
+
+
+
+
+
+ This technique relies on certain special signals
+ being invisible to devices that aren't watching for them. This
+ tends to mean only changing the data signals and leaving the
+ control signals alone. IEEE 1284.3 documents a standard protocol
+ for daisy-chaining devices together with parallel ports.
+
+
+
+
+
+ Support for standard transfer modes are provided as operations
+ that can be performed on a port, along with operations for setting
+ the data lines, or the control lines, or reading the status lines.
+ These operations appear to the device driver as function pointers;
+ more later.
+
+
+
+
+
+
+
+ Standard transfer modes
+
+
+
+
+
+ The standard
transfer modes in use over the parallel
+ port are defined
by a document called IEEE 1284. It
+ really just codifies existing practice and documents protocols (and
+ variations on protocols) that have been in common use for quite
+ some time.
+
+
+
+ The original definitions of which pin did what were set out by
+ Centronics Data Computer Corporation, but only the printer-side
+ interface signals were specified.
+
+
+
+ By the early 1980s, IBM's host-side implementation had become the
+ most widely used. New printers emerged that claimed Centronics
+ compatibility, but although compatible with Centronics they
+ differed from one another in a number of ways.
+
+
+
+ As a result of this, when IEEE 1284 was published in 1994, all that
+ it could really do was document the various protocols that are used
+ for printers (there are about six variations on a theme).
+
+
+
+ In addition to the protocol used to talk to Centronics-compatible
+ printers, IEEE 1284 defined other protocols that are used for
+ unidirectional peripheral-to-host transfers (reverse nibble and
+ reverse byte) and for fast bidirectional transfers (ECP and
+ EPP).
+
+
+
+
+
+ Structure
-
+
+
+
+
+
+
+
+
+
+
+ Sharing core
+
+
+ At the core of the parport subsystem is the
+ sharing mechanism (see
+ drivers/parport/share.c). This module,
+ parport, is responsible for keeping track of
+ which ports there are in the system, which device drivers might be
+ interested in new ports, and whether or not each port is available
+ for use (or if not, which driver is currently using it).
+
+
+
+
+
+ Parports and their overrides
+
+
+ The generic parport sharing code doesn't
+ directly handle the parallel port hardware. That is done instead
+ by low-level
parport drivers.
+ The function of a low-level parport driver is
+ to detect parallel ports, register them with the sharing code, and
+ provide a list of access functions for each port.
+
+
+
+ The most basic access functions that must be provided are ones for
+ examining the status lines, for setting the control lines, and for
+ setting the data lines. There are also access functions for
+ setting the direction of the data lines; normally they are in the
+ forward
direction (that is, the computer drives
+ them), but some ports allow switching to reverse
+ mode (driven by the peripheral). There is an access function for
+ examining the data lines once in reverse mode.
+
+
+
+
+
+ IEEE 1284 transfer modes
+
+
+ Stacked on top of the sharing mechanism, but still in the
+ parport module, are functions for
+ transferring data. They are provided for the device drivers to
+ use, and are very much like library routines. Since these
+ transfer functions are provided by the generic
+ parport core they must use the lowest
+ common denominator
set of access functions: they can set
+ the control lines, examine the status lines, and use the data
+ lines. With some parallel ports the data lines can only be set
+ and not examined, and with other ports accessing the data register
+ causes control line activity; with these types of situations, the
+ IEEE 1284 transfer functions make a best effort attempt to do the
+ right thing. In some cases, it is not physically possible to use
+ particular IEEE 1284 transfer modes.
+
+
+
+ The low-level parport drivers also provide
+ IEEE 1284 transfer functions, as names in the access function
+ list. The low-level driver can just name the generic IEEE 1284
+ transfer functions for this. Some parallel ports can do IEEE 1284
+ transfers in hardware; for those ports, the low-level driver can
+ provide functions to utilise that feature.
+
+
+
+
+
+
+
+ Pardevices and parport_drivers
+
+
+ When a parallel port device driver (such as
+ lp) initialises it tells the sharing layer
+ about itself using parport_register_driver.
+ The information is put into a struct
+ parport_driver, which is put into a linked list. The
+ information in a struct parport_driver
+ really just amounts to some function pointers to callbacks in the
+ parallel port device driver.
+
+
+
+ During its initialisation, a low-level port driver tells the
+ sharing layer about all the ports that it has found (using
+ parport_register_port), and the sharing layer
+ creates a struct parport for each of
+ them. Each struct parport contains
+ (among other things) a pointer to a struct
+ parport_operations, which is a list of function
+ pointers for the various operations that can be performed on a
+ port. You can think of a struct parport
+ as a parallel port object
, if
+ object-orientated
programming is your thing. The
+ parport structures are chained in a
+ linked list, whose head is portlist (in
+ drivers/parport/share.c).
+
+
+
+ Once the port has been registered, the low-level port driver
+ announces it. The parport_announce_port
+ function walks down the list of parallel port device drivers
+ (struct parport_drivers) calling the
+ attach function of each.
+
+
+
+ Similarly, a low-level port driver can undo the effect of
+ registering a port with the
+ parport_unregister_port function, and device
+ drivers are notified using the detach
+ callback.
+
+
+
+ Device drivers can undo the effect of registering themselves with
+ the parport_unregister_driver
+ function.
+
+
+
+
+
+
+
+ The IEEE 1284.3 API
+
+
+ The ability to daisy-chain devices is very useful, but if every
+ device does it in a different way it could lead to lots of
+ complications for device driver writers. Fortunately, the IEEE
+ are standardising it in IEEE 1284.3, which covers daisy-chain
+ devices and port multiplexors.
+
+
+
+ At the time of writing, IEEE 1284.3 has not been published, but
+ the draft specifies the on-the-wire protocol for daisy-chaining
+ and multiplexing, and also suggests a programming interface for
+ using it. That interface (or most of it) has been implemented in
+ the parport code in Linux.
+
+
+
+ At initialisation of the parallel port bus
,
+ daisy-chained devices are assigned addresses starting from zero.
+ There can only be four devices with daisy-chain addresses, plus
+ one device on the end that doesn't know about daisy-chaining and
+ thinks it's connected directly to a computer.
+
+
+
+ Another way of connecting more parallel port devices is to use a
+ multiplexor. The idea is to have a device that is connected
+ directly to a parallel port on a computer, but has a number of
+ parallel ports on the other side for other peripherals to connect
+ to (two or four ports are allowed). The multiplexor switches
+ control to different ports under software control---it is, in
+ effect, a programmable printer switch.
+
+
+
+ Combining the ability of daisy-chaining five devices together with
+ the ability to multiplex one parallel port between four gives the
+ potential to have twenty peripherals connected to the same
+ parallel port!
+
+
+
+ In addition, of course, a single computer can have multiple
+ parallel ports. So, each parallel port peripheral in the system
+ can be identified with three numbers, or co-ordinates: the
+ parallel port, the multiplexed port, and the daisy-chain
+ address.
+
+
+
+
+
+
+
+
+
+
+
+
+ Each device in the system is numbered at initialisation (by
+ parport_daisy_init). You can convert between
+ this device number and its co-ordinates with
+ parport_device_num and
+ parport_device_coords.
+
+
+
+
+#include <parport.h>
+
+
+ int parport_device_num
+ int parport
+ int mux
+ int daisy
+
+
+
+
+
+ int parport_device_coords
+ int devnum
+ int *parport
+ int *mux
+ int *daisy
+
+
+
+
+ Any parallel port peripheral will be connected directly or
+ indirectly to a parallel port on the system, but it won't have a
+ daisy-chain address if it does not know about daisy-chaining, and
+ it won't be connected through a multiplexor port if there is no
+ multiplexor. The special co-ordinate value
+ -1 is used to indicate these cases.
+
+
+
+ Two functions are provided for finding devices based on their IEEE
+ 1284 Device ID: parport_find_device and
+ parport_find_class.
+
-
-
-
-
-
-
-
-Sharing core
-
-
-
-At the core of the parport subsystem is the
-sharing mechanism (see drivers/parport/share.c).
-This module, parport, is responsible for
-keeping track of which ports there are in the system, which device
-drivers might be interested in new ports, and whether or not each port
-is available for use (or if not, which driver is currently using
-it).
-
-
-
-
-Parports and their overrides
-
-
-The generic parport sharing code doesn't
-directly handle the parallel port hardware. That is done instead by
-low-level
parport drivers. The
-function of a low-level parport driver is to
-detect parallel ports, register them with the sharing code, and
-provide a list of access functions for each port.
-
-The most basic access functions that must be provided are ones
-for examining the status lines, for setting the control lines, and for
-setting the data lines. There are also access functions for setting
-the direction of the data lines; normally they are in the
-forward
direction (that is, the computer drives them),
-but some ports allow switching to reverse
mode (driven
-by the peripheral). There is an access function for examining the
-data lines once in reverse mode.
-
-
-
-
-IEEE 1284 transfer modes
-
-
-Stacked on top of the sharing mechanism, but still in the
-parport module, are functions for transferring
-data. They are provided for the device drivers to use, and are very
-much like library routines. Since these transfer functions are
-provided by the generic parport core they must
-use the lowest common denominator
set of access
-functions: they can set the control lines, examine the status lines,
-and use the data lines. With some parallel ports the data lines can
-only be set and not examined, and with other ports accessing the data
-register causes control line activity; with these types of situations,
-the IEEE 1284 transfer functions make a best effort attempt to do the
-right thing. In some cases, it is not physically possible to use
-particular IEEE 1284 transfer modes.
-
-The low-level parport drivers also provide
-IEEE 1284 transfer functions, as names in the access function list.
-The low-level driver can just name the generic IEEE 1284 transfer
-functions for this. Some parallel ports can do IEEE 1284 transfers in
-hardware; for those ports, the low-level driver can provide functions
-to utilise that feature.
-
-
-
-
-
-
-
-
-Pardevices and parport_drivers
-
-When a parallel port device driver (such as
-lp) initialises it tells the sharing layer about
-itself using parport_register_driver. The
-information is put into a struct
-parport_driver, which is put into a linked list. The
-information in a struct parport_driver really
-just amounts to some function pointers to callbacks in the parallel
-port device driver.
-
-During its initialisation, a low-level port driver tells the
-sharing layer about all the ports that it has found (using
-parport_register_port), and the sharing layer
-creates a struct parport for each of them.
-Each struct parport contains (among other
-things) a pointer to a struct
-parport_operations, which is a list of function pointers
-for the various operations that can be performed on a port. You can
-think of a struct parport as a parallel port
-object
, if object-orientated
programming
-is your thing. The parport structures are
-chained in a linked list, whose head is portlist
-(in drivers/parport/share.c).
-
-Once the port has been registered, the low-level port driver
-announces it. The parport_announce_port function
-walks down the list of parallel port device drivers
-(struct parport_drivers) calling the
-attach function of each.
-
-Similarly, a low-level port driver can undo the effect of
-registering a port with the
-parport_unregister_port function, and device
-drivers are notified using the detach
-callback.
-
-Device drivers can undo the effect of registering themselves
-with the parport_unregister_driver
-function.
-
-
-
-
-
-
-The IEEE 1284.3 API
-
-The ability to daisy-chain devices is very useful, but if every
-device does it in a different way it could lead to lots of
-complications for device driver writers. Fortunately, the IEEE are
-standardising it in IEEE 1284.3, which covers daisy-chain devices and
-port multiplexors.
-
-At the time of writing, IEEE 1284.3 has not been published, but
-the draft specifies the on-the-wire protocol for daisy-chaining and
-multiplexing, and also suggests a programming interface for using it.
-That interface (or most of it) has been implemented in the
-parport code in Linux.
-
-At initialisation of the parallel port bus
, daisy-chained
-devices are assigned addresses starting from zero. There can only be
-four devices with daisy-chain addresses, plus one device on the end
-that doesn't know about daisy-chaining and thinks it's connected
-directly to a computer.
-
-Another way of connecting more parallel port devices is to use a
-multiplexor. The idea is to have a device that is connected directly
-to a parallel port on a computer, but has a number of parallel ports
-on the other side for other peripherals to connect to (two or four
-ports are allowed). The multiplexor switches control to different
-ports under software control---it is, in effect, a programmable
-printer switch.
-
-Combining the ability of daisy-chaining five devices together
-with the ability to multiplex one parallel port between four gives the
-potential to have twenty peripherals connected to the same parallel
-port!
-
-In addition, of course, a single computer can have multiple
-parallel ports. So, each parallel port peripheral in the system can
-be identified with three numbers, or co-ordinates: the parallel port,
-the multiplexed port, and the daisy-chain address.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Each device in the system is numbered at initialisation (by
-parport_daisy_init). You can convert between
-this device number and its co-ordinates with
-parport_device_num and
-parport_device_coords.
-
-
- int parport_device_num
- int parport
- int mux
- int daisy
-
-
-
- int parport_device_coords
- int devnum
- int *parport
- int *mux
- int *daisy
-
-
-Any parallel port peripheral will be connected directly or
-indirectly to a parallel port on the system, but it won't have a
-daisy-chain address if it does not know about daisy-chaining, and it
-won't be connected through a multiplexor port if there is no
-multiplexor. The special co-ordinate value -1 is
-used to indicate these cases.
-
-Two functions are provided for finding devices based on their
-IEEE 1284 Device ID: parport_find_device and
-parport_find_class.
-
-
- int parport_find_device
- const char *mfg
- const char *mdl
- int from
-
-
-
- int parport_find_class
- parport_device_class cls
- int from
-
-
-These functions take a device number (in addition to some other
-things), and return another device number. They walk through the list
-of detected devices until they find one that matches the requirements,
-and then return that device number (or -1 if
-there are no more such devices). They start their search at the
-device after the one in the list with the number given (at
-from+1, in other words).
+
+
+#include <parport.h>
+
+
+ int parport_find_device
+ const char *mfg
+ const char *mdl
+ int from
+
+
+
+
+
+ int parport_find_class
+ parport_device_class cls
+ int from
+
+
-
+
+ These functions take a device number (in addition to some other
+ things), and return another device number. They walk through the
+ list of detected devices until they find one that matches the
+ requirements, and then return that device number (or
+ -1 if there are no more such devices). They
+ start their search at the device after the one in the list with
+ the number given (at from+1, in other
+ words).
+
-
+
-
-Device driver's view
+
+
+
+ Device driver's view
-This section is written from the point of view of the device
-driver programmer, who might be writing a driver for a printer or a
-scanner or else anything that plugs into the parallel port. It
-explains how to use the parport interface to find
-parallel ports, use them, and share them with other device
-drivers.
-
-We'll start out with a description of the various functions that
-can be called, and then look at a reasonably simple example of their
-use: the printer driver.
-
-The interactions between the device driver and the
-parport layer are as follows. First, the device
-driver registers its existence with parport, in
-order to get told about any parallel ports that have been (or will be)
-detected. When it gets told about a parallel port, it then tells
-parport that it wants to drive a device on that
-port. Thereafter it can claim exclusive access to the port in order
-to talk to its device.
-
-So, the first thing for the device driver to do is tell
-parport that it wants to know what parallel ports
-are on the system. To do this, it uses the
-parport_register_device function:
+
+ This section is written from the point of view of the device driver
+ programmer, who might be writing a driver for a printer or a
+ scanner or else anything that plugs into the parallel port. It
+ explains how to use the parport interface to
+ find parallel ports, use them, and share them with other device
+ drivers.
+
+
+
+ We'll start out with a description of the various functions that
+ can be called, and then look at a reasonably simple example of
+ their use: the printer driver.
+
+
+
+ The interactions between the device driver and the
+ parport layer are as follows. First, the
+ device driver registers its existence with
+ parport, in order to get told about any
+ parallel ports that have been (or will be) detected. When it gets
+ told about a parallel port, it then tells
+ parport that it wants to drive a device on
+ that port. Thereafter it can claim exclusive access to the port in
+ order to talk to its device.
+
+
+
+ So, the first thing for the device driver to do is tell
+ parport that it wants to know what parallel
+ ports are on the system. To do this, it uses the
+ parport_register_device function:
+
+
+
+
+#include <parport.h>
-
-
+
-
- int parport_register_driver
- struct parport_driver *driver
-
-
-In other words, the device driver passes pointers to a couple of
-functions to parport, and
-parport calls attach for
-each port that's detected (and detach for each
-port that disappears -- yes, this can happen).
-
-The next thing that happens is that the device driver tells
-parport that it thinks there's a device on the
-port that it can drive. This typically will happen in the driver's
-attach function, and is done with
-parport_register_device:
-
-
- struct pardevice *parport_register_device
- struct parport *port
- const char *name
- int (*pf)
- void *
- void (*kf)
- void *
- void (*irq_func)
- int, void *, struct pt_regs *
- int flags
- void *handle
-
-
-The port comes from the parameter supplied
-to the attach function when it is called, or
-alternatively can be found from the list of detected parallel ports
-directly with the (now deprecated)
-parport_enumerate function.
-
-The next three parameters, pf,
-kf, and irq_func, are
-more function pointers. These callback functions get called under
-various circumstances, and are always given the
-handle as one of their parameters.
-
-The preemption callback, pf, is called
-when the driver has claimed access to the port but another device
-driver wants access. If the driver is willing to let the port go, it
-should return zero and the port will be released on its behalf. There
-is no need to call parport_release. If
-pf gets called at a bad time for letting the
-port go, it should return non-zero and no action will be taken. It is
-good manners for the driver to try to release the port at the earliest
-opportunity after its preemption callback is called.
-
-The kick
callback, kf, is
-called when the port can be claimed for exclusive access; that is,
-parport_claim is guaranteed to succeed inside the
-kick
callback. If the driver wants to claim the port
-it should do so; otherwise, it need not take any action.
-
-The irq_func callback is called,
-predictably, when a parallel port interrupt is generated. But it is
-not the only code that hooks on the interrupt. The sequence is this:
-the lowlevel driver is the one that has done
-request_irq; it then does whatever
-hardware-specific things it needs to do to the parallel port hardware
-(for PC-style ports, there is nothing special to do); it then tells
-the IEEE 1284 code about the interrupt, which may involve reacting to
-an IEEE 1284 event, depending on the current IEEE 1284 phase; and
-finally the irq_func function is called.
-
-None of the callback functions are allowed to block.
-
-The flags are for telling
-parport any requirements or hints that are
-useful. The only useful value here (other than
-0, which is the usual value) is
-PARPORT_DEV_EXCL. The point of that flag is to
-request exclusive access at all times---once a driver has successfully
-called parport_register_device with that flag, no
-other device drivers will be able to register devices on that port
-(until the successful driver deregisters its device, of
-course).
-
-The PARPORT_DEV_EXCL flag is for preventing
-port sharing, and so should only be used when sharing the port with
-other device drivers is impossible and would lead to incorrect
-behaviour. Use it sparingly!
-
-Devices can also be registered by device drivers based on their
-device numbers (the same device numbers as in the previous
-section).
-
-The parport_open function is similar to
-parport_register_device, and
-parport_close is the equivalent of
-parport_unregister_device. The difference is
-that parport_open takes a device number rather
-than a pointer to a struct parport.
-
-
- struct pardevice *parport_open
- int devnum
- int (*pf)
- void *
- int (*kf)
- void *
- int (*irqf)
- int, void *, struct pt_regs *
- int flags
- void *handle
-
-
-
- void parport_close
- struct pardevice *dev
-
-
-
- struct pardevice *parport_register_device
- struct parport *port
- const char *name
- int (*pf)
- void *
- int (*kf)
- void *
- int (*irqf)
- int, void *, struct pt_regs *
- int flags
- void *handle
-
-
-
- void parport_unregister_device
- struct pardevice *dev
-
-
-The intended use of these functions is during driver
-initialisation while the driver looks for devices that it supports, as
-demonstrated by the following code fragment:
+
+ int parport_register_driver
+ struct parport_driver *driver
+
+
+
+
+ In other words, the device driver passes pointers to a couple of
+ functions to parport, and
+ parport calls attach for
+ each port that's detected (and detach for each
+ port that disappears---yes, this can happen).
+
+
+
+ The next thing that happens is that the device driver tells
+ parport that it thinks there's a device on the
+ port that it can drive. This typically will happen in the driver's
+ attach function, and is done with
+ parport_register_device:
+
+
+
+
+#include <parport.h>
+
+
+ struct pardevice *parport_register_device
+ struct parport *port
+ const char *name
+ int (*pf)
+ void *
+ void (*kf)
+ void *
+ void (*irq_func)
+ int, void *, struct pt_regs *
+ int flags
+ void *handle
+
+
+
+
+ The port comes from the parameter supplied
+ to the attach function when it is called, or
+ alternatively can be found from the list of detected parallel ports
+ directly with the (now deprecated)
+ parport_enumerate function.
+
+
+
+ The next three parameters, pf,
+ kf, and irq_func, are
+ more function pointers. These callback functions get called under
+ various circumstances, and are always given the
+ handle as one of their parameters.
+
+
+
+ The preemption callback, pf, is called when
+ the driver has claimed access to the port but another device driver
+ wants access. If the driver is willing to let the port go, it
+ should return zero and the port will be released on its behalf.
+ There is no need to call parport_release. If
+ pf gets called at a bad time for letting the
+ port go, it should return non-zero and no action will be taken. It
+ is good manners for the driver to try to release the port at the
+ earliest opportunity after its preemption callback is
+ called.
+
+
+
+ The kick
callback, kf, is
+ called when the port can be claimed for exclusive access; that is,
+ parport_claim is guaranteed to succeed inside
+ the kick
callback. If the driver wants to claim the
+ port it should do so; otherwise, it need not take any
+ action.
+
+
+
+ The irq_func callback is called,
+ predictably, when a parallel port interrupt is generated. But it
+ is not the only code that hooks on the interrupt. The sequence is
+ this: the lowlevel driver is the one that has done
+ request_irq; it then does whatever
+ hardware-specific things it needs to do to the parallel port
+ hardware (for PC-style ports, there is nothing special to do); it
+ then tells the IEEE 1284 code about the interrupt, which may
+ involve reacting to an IEEE 1284 event, depending on the current
+ IEEE 1284 phase; and finally the irq_func
+ function is called.
+
+
+
+ None of the callback functions are allowed to block.
+
+
+
+ The flags are for telling
+ parport any requirements or hints that are
+ useful. The only useful value here (other than
+ 0, which is the usual value) is
+ PARPORT_DEV_EXCL. The point of that flag is
+ to request exclusive access at all times---once a driver has
+ successfully called parport_register_device
+ with that flag, no other device drivers will be able to register
+ devices on that port (until the successful driver deregisters its
+ device, of course).
+
+
+
+ The PARPORT_DEV_EXCL flag is for preventing
+ port sharing, and so should only be used when sharing the port with
+ other device drivers is impossible and would lead to incorrect
+ behaviour. Use it sparingly!
+
+
+
+ Devices can also be registered by device drivers based on their
+ device numbers (the same device numbers as in the previous
+ section).
+
+
+
+ The parport_open function is similar to
+ parport_register_device, and
+ parport_close is the equivalent of
+ parport_unregister_device. The difference is
+ that parport_open takes a device number rather
+ than a pointer to a struct parport.
+
+
+
+
+#include <parport.h>
+
+
+ struct pardevice *parport_open
+ int devnum
+ int (*pf)
+ void *
+ int (*kf)
+ void *
+ int (*irqf)
+ int, void *, struct pt_regs *
+ int flags
+ void *handle
+
+
+
+
+
+ void parport_close
+ struct pardevice *dev
+
+
+
+
+
+ struct pardevice *parport_register_device
+ struct parport *port
+ const char *name
+ int (*pf)
+ void *
+ int (*kf)
+ void *
+ int (*irqf)
+ int, void *, struct pt_regs *
+ int flags
+ void *handle
+
+
+
+
+
+ void parport_unregister_device
+ struct pardevice *dev
+
+
+
+
+ The intended use of these functions is during driver initialisation
+ while the driver looks for devices that it supports, as
+ demonstrated by the following code fragment:
+
-
-
+
+ ]]>
-Once your device driver has registered its device and been
-handed a pointer to a struct pardevice, the
-next thing you are likely to want to do is communicate with the device
-you think is there. To do that you'll need to claim access to the
-port.
-
-
- int parport_claim
- struct pardevice *dev
-
-
-
- int parport_claim_or_block
- struct pardevice *dev
-
-
-
- void parport_release
- struct pardevice *dev
-
-
-To claim access to the port, use
-parport_claim or
-parport_claim_or_block. The first of these will
-not block, and so can be used from interrupt context. If
-parport_claim succeeds it will return zero and
-the port is available to use. It may fail (returning non-zero) if the
-port is in use by another driver and that driver is not willing to
-relinquish control of the port.
-
-The other function, parport_claim_or_block,
-will block if necessary to wait for the port to be free. If it slept,
-it returns 1; if it succeeded without needing to
-sleep it returns 0. If it fails it will return a
-negative error code.
-
-When you have finished communicating with the device, you can
-give up access to the port so that other drivers can communicate with
-their devices. The parport_release function
-cannot fail, but it should not be called without the port claimed.
-Similarly, you should not try to claim the port if you already have it
-claimed.
-
-You may find that although there are convenient points for your
-driver to relinquish the parallel port and allow other drivers to talk
-to their devices, it would be preferable to keep hold of the port.
-The printer driver only needs the port when there is data to print,
-for example, but a network driver (such as PLIP) could be sent a
-remote packet at any time. With PLIP, it is no huge catastrophe if a
-network packet is dropped, since it will likely be sent again, so it
-is possible for that kind of driver to share the port with other
-(pass-through) devices.
-
-The parport_yield and
-parport_yield_blocking functions are for marking
-points in the driver at which other drivers may claim the port and use
-their devices. Yielding the port is similar to releasing it and
-reclaiming it, but it more efficient because nothing is done if there
-are no other devices needing the port. In fact, nothing is done even
-if there are other devices waiting but the current device is still
-within its timeslice
. The default timeslice is half a
-second, but it can be adjusted via a /proc
-entry.
-
-
- int parport_yield
- struct pardevice *dev
-
-
-
- int parport_yield_blocking
- struct pardevice *dev
-
-
-The first of these, parport_yield, will not
-block but as a result may fail. The return value for
-parport_yield is the same as for
-parport_claim. The blocking version,
-parport_yield_blocking, has the same return code
-as parport_claim_or_block.
-
-Once the port has been claimed, the device driver can use the
-functions in the struct parport_operations
-pointer in the struct parport it has a
-pointer to. For example:
+
+ Once your device driver has registered its device and been handed a
+ pointer to a struct pardevice, the next
+ thing you are likely to want to do is communicate with the device
+ you think is there. To do that you'll need to claim access to the
+ port.
+
+
+
+
+#include <parport.h>
+
+
+ int parport_claim
+ struct pardevice *dev
+
+
+
+
+
+ int parport_claim_or_block
+ struct pardevice *dev
+
+
+
+
+
+ void parport_release
+ struct pardevice *dev
+
+
+
+
+ To claim access to the port, use parport_claim
+ or parport_claim_or_block. The first of these
+ will not block, and so can be used from interrupt context. If
+ parport_claim succeeds it will return zero and
+ the port is available to use. It may fail (returning non-zero) if
+ the port is in use by another driver and that driver is not willing
+ to relinquish control of the port.
+
+
+
+ The other function, parport_claim_or_block,
+ will block if necessary to wait for the port to be free. If it
+ slept, it returns 1; if it succeeded without
+ needing to sleep it returns 0. If it fails it
+ will return a negative error code.
+
+
+
+ When you have finished communicating with the device, you can give
+ up access to the port so that other drivers can communicate with
+ their devices. The parport_release function
+ cannot fail, but it should not be called without the port claimed.
+ Similarly, you should not try to claim the port if you already have
+ it claimed.
+
+
+
+ You may find that although there are convenient points for your
+ driver to relinquish the parallel port and allow other drivers to
+ talk to their devices, it would be preferable to keep hold of the
+ port. The printer driver only needs the port when there is data to
+ print, for example, but a network driver (such as PLIP) could be
+ sent a remote packet at any time. With PLIP, it is no huge
+ catastrophe if a network packet is dropped, since it will likely be
+ sent again, so it is possible for that kind of driver to share the
+ port with other (pass-through) devices.
+
+
+
+ The parport_yield and
+ parport_yield_blocking functions are for
+ marking points in the driver at which other drivers may claim the
+ port and use their devices. Yielding the port is similar to
+ releasing it and reclaiming it, but is more efficient because
+ nothing is done if there are no other devices needing the port. In
+ fact, nothing is done even if there are other devices waiting but
+ the current device is still within its timeslice
.
+ The default timeslice is half a second, but it can be adjusted via
+ a /proc entry.
+
+
+
+
+#include <parport.h>
+
+
+ int parport_yield
+ struct pardevice *dev
+
+
+
+
+
+ int parport_yield_blocking
+ struct pardevice *dev
+
+
+
+
+ The first of these, parport_yield, will not
+ block but as a result may fail. The return value for
+ parport_yield is the same as for
+ parport_claim. The blocking version,
+ parport_yield_blocking, has the same return
+ code as parport_claim_or_block.
+
+
+
+ Once the port has been claimed, the device driver can use the
+ functions in the struct parport_operations
+ pointer in the struct parport it has a
+ pointer to. For example:
+
-
-
+ ops->write_data (port, d);
-]]>
+ ]]>
-Some of these operations have shortcuts
. For
-instance, parport_write_data is equivalent to the
-above, but may be a little bit faster (it's a macro that in some cases
-can avoid needing to indirect through port and
-ops).
-
-
-
-
-Port drivers
-
-
-
-To recap, then:
-
-
-
-
-
-The device driver registers itself with parport.
-
-
-
-
-
-A low-level driver finds a parallel port and registers it with
-parport (these first two things can happen in
-either order). This registration creates a struct
-parport which is linked onto a list of known ports.
-
-
-
-
-
-parport calls the attach
-function of each registered device driver, passing it the pointer to
-the new struct parport.
-
-
-
-
-
-The device driver gets a handle from parport, for
-use with
-parport_claim/release. This
-handle takes the form of a pointer to a struct
-pardevice, representing a particular device on the
-parallel port, and is acquired using
-parport_register_device.
-
-
-
-
-
-The device driver claims the port using
-parport_claim (or
-function_claim_or_block).
-
-
-
-
-
-Then it goes ahead and uses the port. When finished it releases the
-port.
-
-
-
-
-
-The purpose of the low-level drivers, then, is to detect
-parallel ports and provide methods of accessing them
-(i.e. implementing the operations in struct
-parport_operations).
-
-
-
-
-
-
-A more complete description of which operation is supposed to do
-what is available in
-Documentation/parport-lowlevel.txt.
-
-
-
-
-The printer driver
-
-
-
-
-The printer driver, lp is a character
-special device driver and a parport client. As a
-character special device driver it registers a struct
-file_operations using
-register_chrdev, with pointers filled in for
-write, ioctl,
-open and
-release. As a client of
-parport, it registers a struct
-parport_driver using
-parport_register_driver, so that
-parport knows to call
-lp_attach when a new parallel port is discovered
-(and lp_detach when it goes away).
-
-The parallel port console functionality is also implemented in
-lp.c, but that won't be covered here (it's quite
-simple though).
-
-The initialisation of the driver is quite easy to understand
-(see lp_init). The lp_table
-is an array of structures that contain information about a specific
-device (the struct pardevice associated with
-it, for example). That array is initialised to sensible values first
-of all.
-
-Next, the printer driver calls
-register_chrdev passing it a pointer to
-lp_fops, which contains function pointers for the
-printer driver's implementation of open,
-write, and so on. This part is the same as for
-any character special device driver.
-
-After successfully registering itself as a character special
-device driver, the printer driver registers itself as a
-parport client using
-parport_register_driver. It passes a pointer to
-this structure:
+
+ Some of these operations have shortcuts
. For
+ instance, parport_write_data is equivalent to
+ the above, but may be a little bit faster (it's a macro that in
+ some cases can avoid needing to indirect through
+ port and ops).
+
+
+
+
+
+ Port drivers
+
+
+
+
+ To recap, then:
+
+
+
+
+
+ The device driver registers itself with parport.
+
+
+
+
+
+ A low-level driver finds a parallel port and registers it with
+ parport (these first two things can happen
+ in either order). This registration creates a struct
+ parport which is linked onto a list of known ports.
+
+
+
+
+
+ parport calls the
+ attach function of each registered device
+ driver, passing it the pointer to the new struct
+ parport.
+
+
+
+
+
+ The device driver gets a handle from
+ parport, for use with
+ parport_claim/release.
+ This handle takes the form of a pointer to a struct
+ pardevice, representing a particular device on the
+ parallel port, and is acquired using
+ parport_register_device.
+
+
+
+
+
+ The device driver claims the port using
+ parport_claim (or
+ function_claim_or_block).
+
+
+
+
+
+ Then it goes ahead and uses the port. When finished it releases
+ the port.
+
+
+
+
+
+
+ The purpose of the low-level drivers, then, is to detect parallel
+ ports and provide methods of accessing them (i.e. implementing the
+ operations in struct
+ parport_operations).
+
+
+
+
+ A more complete description of which operation is supposed to do
+ what is available in
+ Documentation/parport-lowlevel.txt.
+
+
+
+
+
+ The printer driver
+
+
+
+
+
+ The printer driver, lp is a character special
+ device driver and a parport client. As a
+ character special device driver it registers a struct
+ file_operations using
+ register_chrdev, with pointers filled in for
+ write, ioctl,
+ open and
+ release. As a client of
+ parport, it registers a struct
+ parport_driver using
+ parport_register_driver, so that
+ parport knows to call
+ lp_attach when a new parallel port is
+ discovered (and lp_detach when it goes
+ away).
+
+
+
+ The parallel port console functionality is also implemented in
+ drivers/char/lp.c, but that won't be covered
+ here (it's quite simple though).
+
+
+
+ The initialisation of the driver is quite easy to understand (see
+ lp_init). The lp_table is
+ an array of structures that contain information about a specific
+ device (the struct pardevice associated
+ with it, for example). That array is initialised to sensible
+ values first of all.
+
+
+
+ Next, the printer driver calls register_chrdev
+ passing it a pointer to lp_fops, which contains
+ function pointers for the printer driver's implementation of
+ open, write, and so on.
+ This part is the same as for any character special device
+ driver.
+
+
+
+ After successfully registering itself as a character special device
+ driver, the printer driver registers itself as a
+ parport client using
+ parport_register_driver. It passes a pointer
+ to this structure:
+
-
-
+
+ ]]>
-The lp_detach function is not very
-interesting (it does nothing); the interesting bit is
-lp_attach. What goes on here depends on whether
-the user supplied any parameters. The possibilities are: no
-parameters supplied, in which case the printer driver uses every port
-that is detected; the user supplied the parameter auto
,
-in which case only ports on which the device ID string indicates a
-printer is present are used; or the user supplied a list of parallel
-port numbers to try, in which case only those are used.
-
-For each port that the printer driver wants to use (see
-lp_register), it calls
-parport_register_device and stores the resulting
-struct pardevice pointer in the
-lp_table. If the user told it to do so, it then
-resets the printer.
-
-The other interesting piece of the printer driver, from the
-point of view of parport, is
-lp_write. In this function, the user space
-process has data that it wants printed, and the printer driver hands
-it off to the parport code to deal with.
-
-The parport functions it uses that we have
-not seen yet are parport_negotiate,
-parport_set_timeout, and
-parport_write. These functions are part of the
-IEEE 1284 implementation.
-
-The way the IEEE 1284 protocol works is that the host tells the
-peripheral what transfer mode it would like to use, and the peripheral
-either accepts that mode or rejects it; if the mode is rejected, the
-host can try again with a different mode. This is the negotation
-phase. Once the peripheral has accepted a particular transfer mode,
-data transfer can begin that mode.
-
-The particular transfer mode that the printer driver wants to
-use is named in IEEE 1284 as compatibility
mode, and
-the function to request a particular mode is called
-parport_negotiate.
-
-
- int parport_negotiate
- struct parport *port
- int mode
-
-
-The modes parameter is a symbolic
-constant representing an IEEE 1284 mode; in this instance, it is
-IEEE1284_MODE_COMPAT. (Compatibility mode is
-slightly different to the other modes---rather than being specifically
-requested, it is the default until another mode is selected.)
-
-Back to lp_write then. First, access to
-the parallel port is secured with
-parport_claim_or_block. At this point the driver
-might sleep, waiting for another driver (perhaps a Zip drive driver,
-for instance) to let the port go. Next, it goes to compatibility mode
-using parport_negotiate.
-
-The main work is done in the write-loop. In particular, the
-line that hands the data over to parport
-reads:
+
+ The lp_detach function is not very interesting
+ (it does nothing); the interesting bit is
+ lp_attach. What goes on here depends on
+ whether the user supplied any parameters. The possibilities are:
+ no parameters supplied, in which case the printer driver uses every
+ port that is detected; the user supplied the parameter
+ auto
, in which case only ports on which the device
+ ID string indicates a printer is present are used; or the user
+ supplied a list of parallel port numbers to try, in which case only
+ those are used.
+
+
+
+ For each port that the printer driver wants to use (see
+ lp_register), it calls
+ parport_register_device and stores the
+ resulting struct pardevice pointer in the
+ lp_table. If the user told it to do so, it then
+ resets the printer.
+
+
+
+ The other interesting piece of the printer driver, from the point
+ of view of parport, is
+ lp_write. In this function, the user space
+ process has data that it wants printed, and the printer driver
+ hands it off to the parport code to deal with.
+
+
+
+ The parport functions it uses that we have not
+ seen yet are parport_negotiate,
+ parport_set_timeout, and
+ parport_write. These functions are part of
+ the IEEE 1284 implementation.
+
+
+
+ The way the IEEE 1284 protocol works is that the host tells the
+ peripheral what transfer mode it would like to use, and the
+ peripheral either accepts that mode or rejects it; if the mode is
+ rejected, the host can try again with a different mode. This is
+ the negotation phase. Once the peripheral has accepted a
+ particular transfer mode, data transfer can begin that mode.
+
+
+
+ The particular transfer mode that the printer driver wants to use
+ is named in IEEE 1284 as compatibility
mode, and the
+ function to request a particular mode is called
+ parport_negotiate.
+
+
+
+
+#include <parport.h>
+
+
+ int parport_negotiate
+ struct parport *port
+ int mode
+
+
+
+
+ The modes parameter is a symbolic constant
+ representing an IEEE 1284 mode; in this instance, it is
+ IEEE1284_MODE_COMPAT. (Compatibility mode is
+ slightly different to the other modes---rather than being
+ specifically requested, it is the default until another mode is
+ selected.)
+
+
+
+ Back to lp_write then. First, access to the
+ parallel port is secured with
+ parport_claim_or_block. At this point the
+ driver might sleep, waiting for another driver (perhaps a Zip drive
+ driver, for instance) to let the port go. Next, it goes to
+ compatibility mode using parport_negotiate.
+
+
+
+ The main work is done in the write-loop. In particular, the line
+ that hands the data over to parport reads:
+
-The parport_write function writes data to
-the peripheral using the currently selected transfer mode
-(compatibility mode, in this case). It returns the number of bytes
-successfully written:
-
-
- ssize_t parport_write
- struct parport *port
- const void *buf
- size_t len
-
-
-
- ssize_t parport_read
- struct parport *port
- void *buf
- size_t len
-
-
-(parport_read does what it sounds like, but
-only works for modes in which reverse transfer is possible. Of
-course, parport_write only works in modes in
-which forward transfer is possible, too.)
-
-The buf pointer should be to kernel space
-memory, and obviously the len parameter
-specifies the amount of data to transfer.
-
-In fact what parport_write does is call the
-appropriate block transfer function from the struct
-parport_operations:
+
+ The parport_write function writes data to the
+ peripheral using the currently selected transfer mode
+ (compatibility mode, in this case). It returns the number of bytes
+ successfully written:
+
+
+
+
+#include <parport.h>
+
+
+ ssize_t parport_write
+ struct parport *port
+ const void *buf
+ size_t len
+
+
+
+
+
+ ssize_t parport_read
+ struct parport *port
+ void *buf
+ size_t len
+
+
+
+
+ (parport_read does what it sounds like, but
+ only works for modes in which reverse transfer is possible. Of
+ course, parport_write only works in modes in
+ which forward transfer is possible, too.)
+
+
+
+ The buf pointer should be to kernel space
+ memory, and obviously the len parameter
+ specifies the amount of data to transfer.
+
+
+
+ In fact what parport_write does is call the
+ appropriate block transfer function from the struct
+ parport_operations:
+
-
-
+
+ ]]>
-The transfer code in parport will tolerate
-a data transfer stall only for so long, and this timeout can be
-specified with parport_set_timeout, which returns
-the previous timeout:
-
-
- long parport_set_timeout
- struct pardevice *dev
- long inactivity
-
-
-This timeout is specific to the device, and is restored on
-parport_claim.
-
-
-
-
-User-level device drivers
-
-
-
-Introduction to ppdev
-
-The printer is accessible through /dev/lp0;
-in the same way, the parallel port itself is accessible through
-/dev/parport0. The difference is in the level of
-control that you have over the wires in the parallel port
-cable.
-
-With the printer driver, a user-space program (such as the
-printer spooler) can send bytes in printer protocol
.
-Briefly, this means that for each byte, the eight data lines are set
-up, then a strobe
line tells the printer to look at the
-data lines, and the printer sets an acknowledgement
-line to say that it got the byte. The printer driver also allows the
-user-space program to read bytes in nibble mode
, which
-is a way of transferring data from the peripheral to the computer half
-a byte at a time (and so it's quite slow).
-
-In contrast, the ppdev driver (accessed via
-/dev/parport0) allows you to:
-
-
-
-
-
-examine status lines,
-
-
-
-
-
-set control lines,
-
-
-
-
-
-set/examine data lines (and control the direction of the data lines),
-
-
-
-
-
-wait for an interrupt (triggered by one of the status lines),
-
-
-
-
-
-find out how many new interrupts have occurred,
-
-
-
-
-
-set up a response to an interrupt,
-
-
-
-
-
-use IEEE 1284 negotiation (for telling peripheral which transfer mode,
-to use)
-
-
-
-
-
-transfer data using a specified IEEE 1284 mode.
-
-
-
-
-
-
-
-
-User-level or kernel-level driver?
-
-The decision of whether to choose to write a kernel-level device
-driver or a user-level device driver depends on several factors. One
-of the main ones from a practical point of view is speed: kernel-level
-device drivers get to run faster because they are not preemptable,
-unlike user-level applications.
-
-Another factor is ease of development. It is in general easier
-to write a user-level driver because (a) one wrong move does not
-result in a crashed machine, (b) you have access to user libraries
-(such as the C library), and (c) debugging is easier.
-
-
-
-
-Programming interface
-
-The ppdev interface is largely the same as
-that of other character special devices, in that it supports
-open, close,
-read, write, and
-ioctl.
-
-
-Starting and stopping: open and
-close
-
-The device node /dev/parport0 represents
-any device that is connected to parport0, the
-first parallel port in the system. Each time the device node is
-opened, it represents (to the process doing the opening) a different
-device. It can be opened more than once, but only one instance can
-actually be in control of the parallel port at any time. A process
-that has opened /dev/parport0 shares the parallel
-port in the same way as any other device driver. A user-land driver
-may be sharing the parallel port with in-kernel device drivers as well
-as other user-land drivers.
-
-
-
-Control: ioctl
-
-Most of the control is done, naturally enough, via the
-ioctl call. Using ioctl,
-the user-land driver can control both the ppdev
-driver in the kernel and the physical parallel port itself. The
-ioctl call takes as parameters a file descriptor
-(the one returned from opening the device node), a command, and
-optionally (a pointer to) some data.
-
-
-PPCLAIM
-
-
-Claims access to the port. As a user-land device driver writer,
-you will need to do this before you are able to actually change the
-state of the parallel port in any way. Note that some operations only
-affect the ppdev driver and not the port, such as
-PPSETMODE; they can be performed while access to
-the port is not claimed.
-
-
-
-PPEXCL
-
-
-Instructs the kernel driver to forbid any sharing of the port
-with other drivers, i.e. it requests exclusivity. The
-PPEXCL command is only valid when the port is not
-already claimed for use, and it may mean that the next
-PPCLAIM ioctl will fail:
-some other driver may already have registered itself on that
-port.
-
-Most device drivers don't need exclusive access to the port.
-It's only provided in case it is really needed, for example for
-devices where access to the port is required for extensive periods of
-time (many seconds).
-
-Note that the PPEXCL
-ioctl doesn't actually claim the port there and
-then---action is deferred until the PPCLAIM
-ioctl is performed.
-
-
-
-PPRELEASE
-
-
-Releases the port. Releasing the port undoes the effect of
-claiming the port. It allows other device drivers to talk to their
-devices (assuming that there are any).
-
-
-
-PPYIELD
-
-
-Yields the port to another driver. This
-ioctl is a kind of short-hand for releasing the
-port and immediately reclaiming it. It gives other drivers a chance
-to talk to their devices, but afterwards claims the port back. An
-example of using this would be in a user-land printer driver: once a
-few characters have been written we could give the port to another
-device driver for a while, but if we still have characters to send to
-the printer we would want the port back as soon as possible.
-
-It is important not to claim the parallel port for too long, as
-other device drivers will have no time to service their devices. If
-your device does not allow for parallel port sharing at all, it is
-better to claim the parallel port exclusively (see
-PPEXCL).
-
-
-
-PPNEGOT
-
-
-Performs IEEE 1284 negotiation into a particular mode. Briefly,
-negotiation is the method by which the host and the peripheral decide
-on a protocol to use when transferring data.
-
-An IEEE 1284 compliant device will start out in compatibility
-mode, and then the host can negotiate to another mode (such as
-ECP).
-
-The ioctl parameter should be a pointer to
-an int; values for this are in
-parport.h and include:
-
-
-IEEE1284_MODE_COMPAT
-IEEE1284_MODE_NIBBLE
-IEEE1284_MODE_BYTE
-IEEE1284_MODE_EPP
-IEEE1284_MODE_ECP
-
-
-The PPNEGOT ioctl
-actually does two things: it performs the on-the-wire negotiation, and
-it sets the behaviour of subsequent
-read/write calls so that
-they use that mode (but see PPSETMODE).
-
-
-
-PPSETMODE
-
-
-Sets which IEEE 1284 protocol to use for the
-read and write calls.
-
-The ioctl parameter should be a pointer to
-an int.
-
-
-
-PPGETTIME
-
-
-Retrieves the time-out value. The read and
-write calls will time out if the peripheral
-doesn't respond quickly enough. The PPGETTIME
-ioctl retrieves the length of time that the
-peripheral is allowed to have before giving up.
-
-The ioctl parameter should be a pointer to
-a struct timeval.
-
-
-
-PPSETTIME
-
-
-Sets the time-out. The ioctl parameter
-should be a pointer to a struct
-timeval.
-
-
-
-PPWCONTROL
-
-
-Sets the control lines. The ioctl
-parameter is a pointer to an unsigned char, the bitwise
-OR of the control line values in
-parport.h.
-
-
-
-PPRCONTROL
-
-
-Returns the last value written to the control register, in the
-form of an unsigned char: each bit corresponds to a
-control line (although some are unused). The
-ioctl parameter should be a pointer to an
-unsigned char.
-
-This doesn't actually touch the hardware; the last value written
-is remembered in software. This is because some parallel port
-hardware does not offer read access to the control register.
-
-The control lines bits are defined in
-parport.h:
-
-
-PARPORT_CONTROL_STROBE
-PARPORT_CONTROL_AUTOFD
-PARPORT_CONTROL_SELECT
-PARPORT_CONTROL_INIT
-
-
-
-
-PPFCONTROL
-
-
-Frobs the control lines. Since a common operation is to change
-one of the control signals while leaving the others alone, it would be
-quite inefficient for the user-land driver to have to use
-PPRCONTROL, make the change, and then use
-PPWCONTROL. Of course, each driver could
-remember what state the control lines are supposed to be in (they are
-never changed by anything else), but in order to provide
-PPRCONTROL, ppdev must
-remember the state of the control lines anyway.
-
-The PPFCONTROL ioctl
-is for frobbing
control lines, and is like
-PPWCONTROL but acts on a restricted set of
-control lines. The ioctl parameter is a pointer
-to a struct ppdev_frob_struct:
+
+ The transfer code in parport will tolerate a
+ data transfer stall only for so long, and this timeout can be
+ specified with parport_set_timeout, which
+ returns the previous timeout:
+
+
+
+
+#include <parport.h>
+
+
+ long parport_set_timeout
+ struct pardevice *dev
+ long inactivity
+
+
+
+
+ This timeout is specific to the device, and is restored on
+ parport_claim.
+
+
+
+ The next function to look at is the one that allows processes to
+ read from /dev/lp0:
+ lp_read. It's short, like
+ lp_write.
+
+
+
+ The semantics of reading from a line printer device are as follows:
+
+
+
+
+
+ Switch to reverse nibble mode.
+
+
+
+
+
+ Try to read data from the peripheral using reverse nibble mode,
+ until either the user-provided buffer is full or the peripheral
+ indicates that there is no more data.
+
+
+
+
+
+ If there was data, stop, and return it.
+
+
+
+
+
+ Otherwise, we tried to read data and there was none. If the user
+ opened the device node with the O_NONBLOCK
+ flag, return. Otherwise wait until an interrupt occurs on the
+ port (or a timeout elapses).
+
+
+
+
+
+
+
+ User-level device drivers
+
+
+
+ Introduction to ppdev
-
-
-
-
-The mask and
-val fields are bitwise ORs of control line
-names (such as in PPWCONTROL). The operation
-performed by PPFCONTROL is:
-
-
-
-
-
-In other words, the signals named in
-mask are set to the values in
-val.
-
-
-
-PPRSTATUS
-
-
-Returns an unsigned char containing bits set for
-each status line that is set (for instance,
-PARPORT_STATUS_BUSY). The
-ioctl parameter should be a pointer to an
-unsigned char.
-
-
-
-PPDATADIR
-
-
-Controls the data line drivers. Normally the computer's
-parallel port will drive the data lines, but for byte-wide transfers
-from the peripheral to the host it is useful to turn off those drivers
-and let the peripheral drive the signals. (If the drivers on the
-computer's parallel port are left on when this happens, the port might
-be damaged.)
-
-This is only needed in conjunction with
-PPWDATA or PPRDATA.
-
-The ioctl parameter is a pointer to an
-int. If the int is zero, the drivers are
-turned on (forward direction); if non-zero, the drivers are turned off
-(reverse direction).
-
-
-
-PPWDATA
-
-
-Sets the data lines (if in forward mode). The
-ioctl parameter is a pointer to an unsigned
-char.
-
-
-
-PPRDATA
-
-
-Reads the data lines (if in reverse mode). The
-ioctl parameter is a pointer to an unsigned
-char.
-
-
-
-PPCLRIRQ
-
+
+ The printer is accessible through /dev/lp0;
+ in the same way, the parallel port itself is accessible through
+ /dev/parport0. The difference is in the
+ level of control that you have over the wires in the parallel port
+ cable.
+
-Clears the interrupt count. The ppdev
-driver keeps a count of interrupts as they are triggered.
-PPCLRIRQ stores this count in an
-int, a pointer to which is passed in as the
-ioctl parameter.
+
+ With the printer driver, a user-space program (such as the printer
+ spooler) can send bytes in printer protocol
.
+ Briefly, this means that for each byte, the eight data lines are
+ set up, then a strobe
line tells the printer to
+ look at the data lines, and the printer sets an
+ acknowledgement
line to say that it got the byte.
+ The printer driver also allows the user-space program to read
+ bytes in nibble mode
, which is a way of
+ transferring data from the peripheral to the computer half a byte
+ at a time (and so it's quite slow).
+
-In addition, the interrupt count is reset to zero.
+
+ In contrast, the ppdev driver (accessed via
+ /dev/parport0) allows you to:
+
-
+
-PPWCTLONIRQ
-
+
+
+ examine status lines,
+
+
+
+
+
+ set control lines,
+
+
+
+
+
+ set/examine data lines (and control the direction of the data
+ lines),
+
+
+
+
+
+ wait for an interrupt (triggered by one of the status lines),
+
+
+
+
+
+ find out how many new interrupts have occurred,
+
+
+
+
+
+ set up a response to an interrupt,
+
+
+
+
+
+ use IEEE 1284 negotiation (for telling peripheral which transfer
+ mode, to use)
+
+
+
+
+
+ transfer data using a specified IEEE 1284 mode.
+
+
-Set a trigger response. Afterwards when an interrupt is
-triggered, the interrupt handler will set the control lines as
-requested. The ioctl parameter is a pointer to
-an unsigned char, which is interpreted in the same way as
-for PPWCONTROL.
+
-The reason for this ioctl is simply speed.
-Without this ioctl, responding to an interrupt
-would start in the interrupt handler, switch context to the user-land
-driver via poll or select,
-and then switch context back to the kernel in order to handle
-PPWCONTROL. Doing the whole lot in the interrupt
-handler is a lot faster.
+
-
+
+ User-level or kernel-level driver?
-
+
+ The decision of whether to choose to write a kernel-level device
+ driver or a user-level device driver depends on several factors.
+ One of the main ones from a practical point of view is speed:
+ kernel-level device drivers get to run faster because they are not
+ preemptable, unlike user-level applications.
+
-
+
+ Another factor is ease of development. It is in general easier to
+ write a user-level driver because (a) one wrong move does not
+ result in a crashed machine, (b) you have access to user libraries
+ (such as the C library), and (c) debugging is easier.
+
-
+
-
-Transferring data: read and
-write
+
+ Programming interface
-Transferring data using read and
-write is straightforward. The data is
-transferring using the current IEEE 1284 mode (see the
-PPSETMODE ioctl). For modes
-which can only transfer data in one direction, only the appropriate
-function will work, of course.
-
+
+ The ppdev interface is largely the same as that
+ of other character special devices, in that it supports
+ open, close,
+ read, write, and
+ ioctl. The constants for the
+ ioctl commands are in
+ include/linux/ppdev.h.
+
-
-Waiting for events: poll and
-select
+
+
+ Starting and stopping: open and
+ close
+
+
+
+ The device node /dev/parport0 represents any
+ device that is connected to parport0, the
+ first parallel port in the system. Each time the device node is
+ opened, it represents (to the process doing the opening) a
+ different device. It can be opened more than once, but only one
+ instance can actually be in control of the parallel port at any
+ time. A process that has opened
+ /dev/parport0 shares the parallel port in
+ the same way as any other device driver. A user-land driver may
+ be sharing the parallel port with in-kernel device drivers as
+ well as other user-land drivers.
+
+
+
+
+ Control: ioctl
+
+
+ Most of the control is done, naturally enough, via the
+ ioctl call. Using
+ ioctl, the user-land driver can control both
+ the ppdev driver in the kernel and the
+ physical parallel port itself. The ioctl
+ call takes as parameters a file descriptor (the one returned from
+ opening the device node), a command, and optionally (a pointer
+ to) some data.
+
+
+
+ PPCLAIM
+
+
+
+ Claims access to the port. As a user-land device driver
+ writer, you will need to do this before you are able to
+ actually change the state of the parallel port in any way.
+ Note that some operations only affect the
+ ppdev driver and not the port, such as
+ PPSETMODE; they can be performed while
+ access to the port is not claimed.
+
+
+
+
+ PPEXCL
+
+
+
+ Instructs the kernel driver to forbid any sharing of the port
+ with other drivers, i.e. it requests exclusivity. The
+ PPEXCL command is only valid when the
+ port is not already claimed for use, and it may mean that the
+ next PPCLAIM ioctl
+ will fail: some other driver may already have registered
+ itself on that port.
+
+
+
+ Most device drivers don't need exclusive access to the port.
+ It's only provided in case it is really needed, for example
+ for devices where access to the port is required for extensive
+ periods of time (many seconds).
+
+
+
+ Note that the PPEXCL
+ ioctl doesn't actually claim the port
+ there and then---action is deferred until the
+ PPCLAIM ioctl is
+ performed.
+
+
+
+
+ PPRELEASE
+
+
+
+ Releases the port. Releasing the port undoes the effect of
+ claiming the port. It allows other device drivers to talk to
+ their devices (assuming that there are any).
+
+
+
+
+ PPYIELD
+
+
+
+ Yields the port to another driver. This
+ ioctl is a kind of short-hand for
+ releasing the port and immediately reclaiming it. It gives
+ other drivers a chance to talk to their devices, but
+ afterwards claims the port back. An example of using this
+ would be in a user-land printer driver: once a few characters
+ have been written we could give the port to another device
+ driver for a while, but if we still have characters to send to
+ the printer we would want the port back as soon as possible.
+
+
+
+ It is important not to claim the parallel port for too long,
+ as other device drivers will have no time to service their
+ devices. If your device does not allow for parallel port
+ sharing at all, it is better to claim the parallel port
+ exclusively (see PPEXCL).
+
+
+
+
+ PPNEGOT
+
+
+
+ Performs IEEE 1284 negotiation into a particular mode.
+ Briefly, negotiation is the method by which the host and the
+ peripheral decide on a protocol to use when transferring data.
+
+
+
+ An IEEE 1284 compliant device will start out in compatibility
+ mode, and then the host can negotiate to another mode (such as
+ ECP).
+
+
+
+ The ioctl parameter should be a pointer
+ to an int; values for this are in
+ incluce/linux/parport.h and include:
+
+
+
+
+ IEEE1284_MODE_COMPAT
+
+ IEEE1284_MODE_NIBBLE
+
+ IEEE1284_MODE_BYTE
+
+ IEEE1284_MODE_EPP
+
+ IEEE1284_MODE_ECP
+
+
+
+ The PPNEGOT ioctl
+ actually does two things: it performs the on-the-wire
+ negotiation, and it sets the behaviour of subsequent
+ read/write calls so
+ that they use that mode (but see
+ PPSETMODE).
+
+
+
+
+ PPSETMODE
+
+
+
+ Sets which IEEE 1284 protocol to use for the
+ read and write
+ calls.
+
+
+
+ The ioctl parameter should be a pointer
+ to an int.
+
+
+
+
+ PPGETTIME
+
+
+
+ Retrieves the time-out value. The read
+ and write calls will time out if the
+ peripheral doesn't respond quickly enough. The
+ PPGETTIME ioctl
+ retrieves the length of time that the peripheral is allowed to
+ have before giving up.
+
+
+
+ The ioctl parameter should be a pointer
+ to a struct timeval.
+
+
+
+
+ PPSETTIME
+
+
+
+ Sets the time-out. The ioctl parameter
+ should be a pointer to a struct
+ timeval.
+
+
+
+
+ PPWCONTROL
+
+
+
+ Sets the control lines. The ioctl
+ parameter is a pointer to an unsigned char, the
+ bitwise OR of the control line values in
+ include/linux/parport.h.
+
+
+
+
+ PPRCONTROL
+
+
+
+ Returns the last value written to the control register, in the
+ form of an unsigned char: each bit corresponds to
+ a control line (although some are unused). The
+ ioctl parameter should be a pointer to an
+ unsigned char.
+
+
+
+ This doesn't actually touch the hardware; the last value
+ written is remembered in software. This is because some
+ parallel port hardware does not offer read access to the
+ control register.
+
+
+
+ The control lines bits are defined in
+ include/linux/parport.h:
+
+
+
+
+ PARPORT_CONTROL_STROBE
+
+ PARPORT_CONTROL_AUTOFD
+
+ PARPORT_CONTROL_SELECT
+
+ PARPORT_CONTROL_INIT
+
+
+
+
+ PPFCONTROL
+
+
+
+ Frobs the control lines. Since a common operation is to
+ change one of the control signals while leaving the others
+ alone, it would be quite inefficient for the user-land driver
+ to have to use PPRCONTROL, make the
+ change, and then use PPWCONTROL. Of
+ course, each driver could remember what state the control
+ lines are supposed to be in (they are never changed by
+ anything else), but in order to provide
+ PPRCONTROL, ppdev
+ must remember the state of the control lines anyway.
+
+
+
+ The PPFCONTROL ioctl
+ is for frobbing
control lines, and is like
+ PPWCONTROL but acts on a restricted set
+ of control lines. The ioctl parameter is
+ a pointer to a struct
+ ppdev_frob_struct:
+
-The ppdev driver provides user-land device
-drivers with the ability to wait for interrupts, and this is done
-using poll (and select,
-which is implemented in terms of poll).
+
+
+
-When a user-land device driver wants to wait for an interrupt,
-it sleeps with poll. When the interrupt arrives,
-ppdev wakes it up (with a read
-event, although strictly speaking there is nothing to actually
-read).
+
+ The mask and
+ val fields are bitwise ORs of
+ control line names (such as in
+ PPWCONTROL). The operation performed by
+ PPFCONTROL is:
+
+
+
+
+
+
+
+ In other words, the signals named in
+ mask are set to the values in
+ val.
+
+
+
+
+ PPRSTATUS
+
+
+
+ Returns an unsigned char containing bits set for
+ each status line that is set (for instance,
+ PARPORT_STATUS_BUSY). The
+ ioctl parameter should be a pointer to an
+ unsigned char.
+
+
+
+
+ PPDATADIR
+
+
+
+ Controls the data line drivers. Normally the computer's
+ parallel port will drive the data lines, but for byte-wide
+ transfers from the peripheral to the host it is useful to turn
+ off those drivers and let the peripheral drive the
+ signals. (If the drivers on the computer's parallel port are
+ left on when this happens, the port might be damaged.)
+
+
+
+ This is only needed in conjunction with
+ PPWDATA or
+ PPRDATA.
+
+
+
+ The ioctl parameter is a pointer to an
+ int. If the int is zero, the
+ drivers are turned on (forward direction); if non-zero, the
+ drivers are turned off (reverse direction).
+
+
+
+
+ PPWDATA
+
+
+
+ Sets the data lines (if in forward mode). The
+ ioctl parameter is a pointer to an
+ unsigned char.
+
+
+
+
+ PPRDATA
+
+
+
+ Reads the data lines (if in reverse mode). The
+ ioctl parameter is a pointer to an
+ unsigned char.
+
+
+
+
+ PPCLRIRQ
+
+
+
+ Clears the interrupt count. The ppdev
+ driver keeps a count of interrupts as they are triggered.
+ PPCLRIRQ stores this count in an
+ int, a pointer to which is passed in as the
+ ioctl parameter.
+
+
+
+ In addition, the interrupt count is reset to zero.
+
+
+
+
+ PPWCTLONIRQ
+
+
+
+ Set a trigger response. Afterwards when an interrupt is
+ triggered, the interrupt handler will set the control lines as
+ requested. The ioctl parameter is a
+ pointer to an unsigned char, which is interpreted
+ in the same way as for PPWCONTROL.
+
+
+
+ The reason for this ioctl is simply
+ speed. Without this ioctl, responding to
+ an interrupt would start in the interrupt handler, switch
+ context to the user-land driver via poll
+ or select, and then switch context back
+ to the kernel in order to handle
+ PPWCONTROL. Doing the whole lot in the
+ interrupt handler is a lot faster.
+
+
+
+
+
+
+
+
+
+
+
+ Transferring data: read and
+ write
+
+
+ Transferring data using read and
+ write is straightforward. The data is
+ transferring using the current IEEE 1284 mode (see the
+ PPSETMODE ioctl). For
+ modes which can only transfer data in one direction, only the
+ appropriate function will work, of course.
+
+
+
+
+ Waiting for events: poll and
+ select
+
+
+ The ppdev driver provides user-land device
+ drivers with the ability to wait for interrupts, and this is done
+ using poll (and select,
+ which is implemented in terms of poll).
+
+
+
+ When a user-land device driver wants to wait for an interrupt, it
+ sleeps with poll. When the interrupt
+ arrives, ppdev wakes it up (with a
+ read
event, although strictly speaking there is
+ nothing to actually read).
+
-
+
-
+
-
-Examples
+
+ Examples
-Presented here are two demonstrations of how to write a simple
-printer driver for ppdev. Firstly we will use
-the write function, and after that we will drive
-the control and data lines directly.
+
+ Presented here are two demonstrations of how to write a simple
+ printer driver for ppdev. Firstly we will
+ use the write function, and after that we
+ will drive the control and data lines directly.
+
-The first thing to do is to actually open the device.
+
+ The first thing to do is to actually open the device.
+
-
+ ]]>
-Here name should be something along the lines
-of "/dev/parport0". (If you don't have any
-/dev/parport files, you can make them with
-mknod; they are character special device nodes with
-major 99.)
+
+ Here name should be something along the lines
+ of "/dev/parport0". (If you don't have any
+ /dev/parport files, you can make them with
+ mknod; they are character special device nodes
+ with major 99.)
+
-In order to do anything with the port we need to claim access to
-it.
+
+ In order to do anything with the port we need to claim access to
+ it.
+
-
+ ]]>
-Our printer driver will copy its input (from
-stdin) to the printer, and it can do that it one of
-two ways. The first way is to hand it all off to the kernel driver,
-with the knowledge that the protocol that the printer speaks is IEEE
-1284's compatibility
mode.
+
+ Our printer driver will copy its input (from
+ stdin) to the printer, and it can do that it
+ one of two ways. The first way is to hand it all off to the
+ kernel driver, with the knowledge that the protocol that the
+ printer speaks is IEEE 1284's compatibility
+ mode.
+
-
+ ]]>
-The write_printer function is not pictured
-above. This is because the main loop that is shown can be used for
-both methods of driving the printer. Here is one implementation of
-write_printer:
+
+ The write_printer function is not pictured
+ above. This is because the main loop that is shown can be used
+ for both methods of driving the printer. Here is one
+ implementation of write_printer:
+
-
+ ]]>
+
+
+ We hand the data to the kernel-level driver (using
+ write) and it handles the printer
+ protocol.
+
+
+
+ Now let's do it the hard way! In this particular example there is
+ no practical reason to do anything other than just call
+ write, because we know that the printer talks
+ an IEEE 1284 protocol. On the other hand, this particular example
+ does not even need a user-land driver since there is already a
+ kernel-level one; for the purpose of this discussion, try to
+ imagine that the printer speaks a protocol that is not already
+ implemented under Linux.
+
-We hand the data to the kernel-level driver (using
-write) and it handles the printer
-protocol.
-
-Now let's do it the hard way! In this particular example there
-is no practical reason to do anything other than just call
-write, because we know that the printer talks an
-IEEE 1284 protocol. On the other hand, this particular example does
-not even need a user-land driver since there is already a kernel-level
-one; for the purpose of this discussion, try to imagine that the
-printer speaks a protocol that is not already implemented under
-Linux.
-
-So, here is the alternative implementation of
-write_printer (for brevity, error checking has
-been omitted):
+
+ So, here is the alternative implementation of
+ write_printer (for brevity, error checking
+ has been omitted):
+
-
+ ]]>
-To show a bit more of the ppdev interface,
-here is a small piece of code that is intended to mimic the printer's
-side of printer protocol.
+
+ To show a bit more of the ppdev interface,
+ here is a small piece of code that is intended to mimic the
+ printer's side of printer protocol.
+
-
+ ]]>
+
+
+ And here is an example (with no error checking at all) to show how
+ to read data from the port, using ECP mode, with optional
+ negotiation to ECP mode first.
+
+
+
+
+
+
+
-
+
+
+ API reference
+
+
+!Fdrivers/parport/daisy.c parport_device_num
+!Fdrivers/parport/daisy.c parport_device_coords
+!Fdrivers/parport/daisy.c parport_find_device
+!Fdrivers/parport/daisy.c parport_find_class
+!Fdrivers/parport/share.c parport_register_driver
+!Fdrivers/parport/share.c parport_unregister_driver
+!Fdrivers/parport/share.c parport_register_device
+!Fdrivers/parport/share.c parport_unregister_device
+!Fdrivers/parport/daisy.c parport_open
+!Fdrivers/parport/daisy.c parport_close
+!Fdrivers/parport/share.c parport_claim
+!Fdrivers/parport/share.c parport_claim_or_block
+!Fdrivers/parport/share.c parport_release
+!Finclude/linux/parport.h parport_yield
+!Finclude/linux/parport.h parport_yield_blocking
+!Fdrivers/parport/ieee1284.c parport_negotiate
+!Fdrivers/parport/ieee1284.c parport_write
+!Fdrivers/parport/ieee1284.c parport_read
+!Fdrivers/parport/ieee1284.c parport_set_timeout
+
+
+
+
+
+ The Linux 2.2 Parallel Port Subsystem
+
+
+
+ Although the interface described in this document is largely new
+ with the 2.4 kernel, the sharing mechanism is available in the 2.2
+ kernel as well. The functions available in 2.2 are:
+
+
+
+
+
+ parport_register_device
+
+
+
+
+
+ parport_unregister_device
+
+
+
+
+
+ parport_claim
+
+
+
+
+
+ parport_claim_or_block
+
+
+
+
+
+ parport_release
+
+
+
+
+
+ parport_yield
+
+
+
+
+
+ parport_yield_blocking
+
+
+
+
+
+ In addition, negotiation to reverse nibble mode is supported:
+
+
+
+
+ int parport_ieee1284_nibble_mode_ok
+ struct parport *port
+ unsigned char mode
+
+
+
+
+ The only valid values for mode are 0 (for
+ reverse nibble mode) and 4 (for Device ID in reverse nibble mode).
+
+
+
+ This function is obsoleted by
+ parport_negotiate in Linux 2.4, and has been
+ removed.
+
+
+
+
+
+
+
+
-
-
\ No newline at end of file
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/filesystems/cramfs.txt linux/Documentation/filesystems/cramfs.txt
--- v2.3.99-pre8/linux/Documentation/filesystems/cramfs.txt Fri Jan 21 18:19:15 2000
+++ linux/Documentation/filesystems/cramfs.txt Sat May 20 11:30:31 2000
@@ -27,8 +27,8 @@
mkcramfs simply truncates to 8 bits, which is a potential security
issue.
-Hard links are not supported, but symlinks are. (See also the TODO
-comment in mkcramfs.c at the nlink test.)
+Hard links are supported, but hard linked files
+will still have a link count of 1 in the cramfs image.
Cramfs directories have no `.' or `..' entries. Directories (like
every other file on cramfs) always have a link count of 1. (There's
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/kbuild/config-language.txt linux/Documentation/kbuild/config-language.txt
--- v2.3.99-pre8/linux/Documentation/kbuild/config-language.txt Thu May 11 15:30:05 2000
+++ linux/Documentation/kbuild/config-language.txt Sun May 21 20:18:08 2000
@@ -193,7 +193,7 @@
Configure: implemented
Menuconfig: implemented
-Xconfig: does not display, but writes to output files
+Xconfig: implemented
mconfig: implemented
Example:
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/kernel-doc-nano-HOWTO.txt linux/Documentation/kernel-doc-nano-HOWTO.txt
--- v2.3.99-pre8/linux/Documentation/kernel-doc-nano-HOWTO.txt Wed Dec 31 16:00:00 1969
+++ linux/Documentation/kernel-doc-nano-HOWTO.txt Sun May 21 20:18:07 2000
@@ -0,0 +1,128 @@
+kernel-doc nano-HOWTO
+=====================
+
+Many places in the source tree have extractable documentation in the
+form of block comments above functions. The components of this system
+are:
+
+- scripts/kernel-doc
+
+ This is a perl script that hunts for the block comments and can mark
+ them up directly into DocBook, man, text, and HTML. (No, not
+ texinfo.)
+
+- Documentation/DocBook/*.tmpl
+
+ These are SGML template files, which are normal SGML files with
+ special place-holders for where the extracted documentation should
+ go.
+
+- scripts/docproc.c
+
+ This is a program for converting SGML template files into SGML
+ files. It invokes kernel-doc, giving it the list of functions that
+ are to be documented.
+
+- scripts/gen-all-syms
+
+ This is a script that lists the EXPORT_SYMBOL symbols in a list of C
+ files.
+
+- scripts/docgen
+
+ This script invokes docproc, telling it which functions are to be
+ documented (this list comes from gen-all-syms).
+
+- Makefile
+
+ The targets 'sgmldocs', 'psdocs', and 'pdfdocs' are used to build
+ DocBook files, PostScript files, and PDF files in
+ Documentation/DocBook.
+
+- Documentation/DocBook/Makefile
+
+ This is where C files are associated with SGML templates.
+
+
+How to extract the documentation
+--------------------------------
+
+If you just want to read the ready-made books on the various
+subsystems (see Documentation/DocBook/*.tmpl), just type 'make
+psdocs', or 'make pdfdocs', depending on your preference. If you
+would rather read a different format, you can type 'make sgmldocs' and
+then use DocBook tools to convert Documentation/DocBook/*.sgml to a
+format of your choice (for example, 'db2html ...').
+
+If you want to see man pages instead, you can do this:
+
+$ cd linux
+$ scripts/kernel-doc -man $(find -name '*.c') | split-man.pl /tmp/man
+
+Here is split-man.pl:
+
+-->
+#!/usr/bin/perl
+
+if ($#ARGV < 0) {
+ die "where do I put the results?\n";
+}
+
+mkdir $ARGV[0],0777 or die "Can't create $ARGV[0]: $!\n";
+$state = 0;
+while () {
+ if (/^\.TH \"[^\"]*\" 4 \"([^\"]*)\"/) {
+ if ($state == 1) { close OUT }
+ $state = 1;
+ $fn = "$ARGV[0]/$1.4";
+ print STDERR "Creating $fn\n";
+ open OUT, ">$fn" or die "can't open $fn: $!\n";
+ print OUT $_;
+ } elsif ($state != 0) {
+ print OUT $_;
+ }
+}
+
+close OUT;
+<--
+
+If you just want to view the documentation for one function in one
+file, you can do this:
+
+$ scripts/kernel-doc -man -function fn file | nroff -man | less
+
+or this:
+
+$ scripts/kernel-doc -text -function fn file
+
+
+How to add extractable documentation to your source files
+---------------------------------------------------------
+
+The format of the block comment is like this:
+
+/**
+ * function_name(:)? (- short description)?
+(* @parameterx: (description of parameter x)?)*
+(* a blank line)?
+ * (Description:)? (Description of function)?
+ * (section header: (section description)? )*
+(*)?*/
+
+The short function description cannot be multiline, but the other
+descriptions can be.
+
+All descriptive text is further processed, scanning for the following special
+patterns, which are highlighted appropriately.
+
+'funcname()' - function
+'$ENVVAR' - environment variable
+'&struct_name' - name of a structure (up to two words including 'struct')
+'@parameter' - name of a parameter
+'%CONST' - name of a constant.
+
+Take a look around the source tree for examples.
+
+Tim.
+*/
+
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/networking/8139too.txt linux/Documentation/networking/8139too.txt
--- v2.3.99-pre8/linux/Documentation/networking/8139too.txt Thu May 11 15:30:05 2000
+++ linux/Documentation/networking/8139too.txt Sat May 20 11:38:02 2000
@@ -132,6 +132,20 @@
+Submitting Bug Reports
+----------------------
+Obtain and compile the modified rtl8139-diag source code from the
+8139too driver Web site. This diagnostics programs, originally
+from Donald Becker, has been modified to display all registers
+on your RTL8139 chip, not just the first 0x80.
+
+If possible, send the output of a working and broken driver with
+ rtl8139-diag -mmmaaavvveefN > my-output-file.txt
+
+Send "lspci -vvv" or "cat /proc/pci" output for PCI information.
+
+
+
Known Bugs / Errata / To-Do
---------------------------
The following issues are known, and are actively being pursued. Patches
@@ -149,7 +163,7 @@
4) Sparc64 platform not tested at all.
-5) Identify and fix "rx wedge" when ping flooded.
+5) Identify and fix "rx wedge" when ping flooded. (WIP)
7) N-Way auto-negotiation is known to fail in some cases. This problem
also occurs in the rtl8139 driver in kernels 2.2.x/2.3.x. Solution:
@@ -158,17 +172,30 @@
it automatically. (patches welcome)
8) Much improved command line / module parameter setup. (patches and
-suggestions welcome)
+suggestions welcome) (WIP)
9) Better documentation. (patches welcome)
-10) User-mode (or maybe optional /proc) diagnostics program.
+10) (rtl8139-diag modified from Becker version, DONE)
+User-mode (or maybe optional /proc) diagnostics program.
+
+11) RTL8139C support untested.
Change History
--------------
+Version 0.9.5 - May 17, 2000
+
+* Improved chip version recognition
+* Continue banging away at receiver hang problem
+* Use spin_lock_irq in another spot
+* Don't print anything on pci_enable_device, it does so for us
+* Disable buggy NWay code
+* Define TxConfig bitmasks
+
+
Version 0.9.4.1 - April 27, 2000 - third public beta release
* Replace several "magic numbers" with symbolic constants
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/pci.txt linux/Documentation/pci.txt
--- v2.3.99-pre8/linux/Documentation/pci.txt Thu May 11 15:30:05 2000
+++ linux/Documentation/pci.txt Mon May 15 12:13:10 2000
@@ -89,6 +89,16 @@
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.
+ If you are sure the driver is not a hotplug driver then use only
+ __init/exit __initdata/exitdata.
+
2. How to find PCI devices manually (the old style)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/s390/DASD linux/Documentation/s390/DASD
--- v2.3.99-pre8/linux/Documentation/s390/DASD Fri May 12 14:18:55 2000
+++ linux/Documentation/s390/DASD Sat May 20 11:30:31 2000
@@ -22,7 +22,7 @@
support of the FBA and CKD architectures. For the FBA architecture
only some smart data structures are missing to make the support
complete.
-We performed our testing on 3380 and 3390 type disksof different
+We performed our testing on 3380 and 3390 type disks of different
sizes, under VM and on the bare hardware (LPAR), using internal disks
of the multiprise as well as a RAMAC virtual array. Disks exported by
an Enterprise Storage Server (Seascape) should work fine as well.
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/usb/ov511.txt linux/Documentation/usb/ov511.txt
--- v2.3.99-pre8/linux/Documentation/usb/ov511.txt Thu May 11 15:30:05 2000
+++ linux/Documentation/usb/ov511.txt Sat May 20 10:37:04 2000
@@ -6,11 +6,8 @@
Homepage: http://alpha.dyndns.org/ov511
NEW IN THIS VERSION:
- o Improvements to sensor detection code
- o Added "i2c_detect_tries" and "aperture" parameters
- o proc filesystem status support
- o read() fixed partially
- o code cleanups and minor fixes
+ o 352x288 mode
+ o force_rgb parameter for apps that expect RGB instead of BGR
INTRODUCTION:
@@ -139,7 +136,7 @@
or so lines higher than the red component. This is only apparent in
images with white objects on black backgrounds at 640x480. Setting this
to 1 will realign the color planes correctly. NOTE: This is still
- experimental and very buggy.
+ experimental and very buggy. You will likely need a fast (500 Mhz) CPU.
NAME: snapshot
TYPE: integer (boolean)
@@ -148,8 +145,41 @@
button is pressed. Note that this does not yet work with most apps,
including xawtv and vidcat. NOTE: See the section "TODO" for more info.
+ NAME: sensor
+ TYPE: integer ([0, 1, 3])
+ DEFAULT: [varies]
+ DESC: If you know that your camera sensor is not detected correctly, set this
+ parameter. This is a global option for all attached OV511 cameras. You
+ will probably never need to set this, but if you do, valid values are:
+ 0 for OV7620
+ 1 for OV7620AE
+ 3 for OV7610
+
+ NAME: i2c_detect_tries
+ TYPE: integer (don't set it insanely high!)
+ DEFAULT: 5
+ DESC: This is the number of times the driver will try to sync and detect the
+ internal i2c bus (which connects the OV511 and sensor). If you are
+ getting intermittant detection failures ("Failed to read sensor ID...")
+ you should increase this by a modest amount. If setting it to 20 or so
+ doesn't fix things, look elsewhere for the cause of the problem.
+
+ NAME: aperture
+ TYPE: integer (0 - 15)
+ DEFAULT: [varies by sensor]
+ DESC: For legal values, see the OV7610/7620 specs under register Common F.
+ This setting affects the upper nybble of that reg (bits 4-7). This is
+ for if you want to play with the camera's pixel saturation.
+
+ NAME: force_rgb
+ TYPE: integer (boolean)
+ DEFAULT: 0
+ DESC: Force image to be read in RGB instead of BGR. This option allow
+ programs that expect RGB data (e.g. gqcam) to work with this driver. If
+ your colors look VERY wrong, you may want to change this.
+
WORKING FEATURES:
- o Color streaming/capture at 640x480 and 320x240
+ o Color streaming/capture at 640x480, 352x288, and 320x240
o YUV420 color
o Monochrome
o Setting/getting of saturation, contrast and brightness (no hue yet; only
@@ -158,7 +188,7 @@
EXPERIMENTAL FEATURES:
o fix_rgb_offset: Sometimes works, but other times causes errors with xawtv and
- corrupted frames.
+ corrupted frames. If you have a very fast CPU, you can try it.
o Snapshot mode (only works with some read() based apps; see below for more)
o read() support
@@ -197,6 +227,6 @@
The code is based in no small part on the CPiA driver by Johannes Erdfelt,
Randy Dunlap, and others. Big thanks to them for their pioneering work on that
-and the USB stack. Thanks to Bret Wallach for getting camera reg IO , ISOC, and
-image capture working. Thanks to Orion Sky Lawlor and Kevin Moore for their
-work as well.
+and the USB stack. Thanks to Bret Wallach for getting camera reg IO, ISOC, and
+image capture working. Thanks to Orion Sky Lawlor, Kevin Moore, and Claudio
+Matsuoka for their work as well.
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/usb/usb-serial.txt linux/Documentation/usb/usb-serial.txt
--- v2.3.99-pre8/linux/Documentation/usb/usb-serial.txt Thu May 11 15:30:05 2000
+++ linux/Documentation/usb/usb-serial.txt Sat May 20 11:39:56 2000
@@ -59,6 +59,13 @@
properly enumerated, assigned a port, and then communication _should_ be
possible. The driver cleans up properly when the device is removed, or
the connection is canceled on the Visor.
+
+ NOTE:
+ This means that in order to talk to the Visor, the sync button must be
+ pressed BEFORE trying to get any program to communicate to the Visor.
+ This goes against the current documentation for pilot-xfer and other
+ packages, but is the only way that it will work due to the hardware
+ in the Visor.
When the device is connected, try talking to it on the second port
(this is usually /dev/ttyUSB1 if you do not have any other usb-serial
@@ -105,6 +112,24 @@
This is an ISDN TA. Please report both successes and troubles to the
author at omninet@kroah.com
+
+
+Digi AccelePort Driver
+
+ This driver supports the Digi AccelePort USB 4 device, a 4 port
+ USB serial converter. The driver does NOT yet support the Digi
+ AccelePort USB 2 or 8.
+
+ The driver supports open, close, read, write, termios settings (baud
+ rate, word size, parity, stop bits, hardware/software flow control,
+ CREAD), DTR/RTS, and TIOCMGET/SET/BIS/BIC ioctls. It has not been
+ thoroughly tested, but it seems to be working reasonable well. There
+ is more work to do, including flow control, ioctls, and support for
+ the Digi AccelePort USB 2 and 8.
+
+ Please contact Peter Berger (pberger@brimson.com) or Al Borchers
+ (alborchers@steinerpoint.com) for questions or problems with this
+ driver.
Generic Serial driver
diff -u --recursive --new-file v2.3.99-pre8/linux/Documentation/video4linux/bttv/CARDLIST linux/Documentation/video4linux/bttv/CARDLIST
--- v2.3.99-pre8/linux/Documentation/video4linux/bttv/CARDLIST Tue Apr 11 15:09:11 2000
+++ linux/Documentation/video4linux/bttv/CARDLIST Mon May 15 12:06:25 2000
@@ -38,6 +38,10 @@
card=36 - Typhoon TView TV/FM Tuner
card=37 - PixelView PlayTV pro
card=38 - TView99 CPH063
+ card=39 - Pinnacle PCTV Rave
+ card=40 - STB2
+ card=41 - AVerMedia TVPhone 98
+ card=42 - ProVideo PV951
tuner.o
type=0 - Temic PAL
diff -u --recursive --new-file v2.3.99-pre8/linux/MAINTAINERS linux/MAINTAINERS
--- v2.3.99-pre8/linux/MAINTAINERS Thu May 11 15:30:05 2000
+++ linux/MAINTAINERS Sat May 20 11:39:56 2000
@@ -482,6 +482,7 @@
IDE DRIVER [GENERAL]
P: Andre Hedrick
M: andre@linux-ide.org
+M: ahedrick@atipa.com
M: andre@suse.com
L: linux-kernel@vger.rutgers.edu
W: http://www.kernel.org/pub/linux/kernel/people/hedrick/
@@ -1139,6 +1140,13 @@
L: linux-usb@suse.com
S: Maintained
+USB OV511 DRIVER
+P: Mark McClelland
+M: mmcclelland@delphi.com
+L: linux-usb@suse.com
+W: http://alpha.dyndns.org/ov511/
+S: Maintained
+
USB PEGASUS DRIVER
P: Petko Manolov
M: petkan@spct.net
@@ -1148,6 +1156,13 @@
USB PRINTER DRIVER
P: Vojtech Pavlik
M: vojtech@suse.cz
+L: linux-usb@suse.com
+S: Supported
+
+USB SERIAL DIGI ACCELEPORT DRIVER
+P: Peter Berger and Al Borchers
+M: pberger@brimson.com
+M: alborchers@steinerpoint.com
L: linux-usb@suse.com
S: Supported
diff -u --recursive --new-file v2.3.99-pre8/linux/Makefile linux/Makefile
--- v2.3.99-pre8/linux/Makefile Fri May 12 14:18:55 2000
+++ linux/Makefile Mon May 15 15:30:20 2000
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 3
SUBLEVEL = 99
-EXTRAVERSION = -pre8
+EXTRAVERSION = -pre9
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
@@ -81,10 +81,6 @@
#
CPPFLAGS := -D__KERNEL__ -I$(HPATH)
-
-ifdef CONFIG_SMP
-CPPFLAGS += -D__SMP__
-endif
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/alpha/kernel/osf_sys.c linux/arch/alpha/kernel/osf_sys.c
--- v2.3.99-pre8/linux/arch/alpha/kernel/osf_sys.c Thu May 11 15:30:05 2000
+++ linux/arch/alpha/kernel/osf_sys.c Sat May 20 10:47:29 2000
@@ -42,7 +42,6 @@
#include
#include
-extern long do_sys_mount(char *, char *, char *, int, void *);
extern int do_pipe(int *);
extern asmlinkage int sys_swapon(const char *specialfile, int swap_flags);
@@ -377,7 +376,7 @@
retval = PTR_ERR(devname);
if (IS_ERR(devname))
goto out;
- retval = do_sys_mount(devname, dirname, "ext2", flags, NULL);
+ retval = do_mount(devname, dirname, "ext2", flags, NULL);
putname(devname);
out:
return retval;
@@ -396,7 +395,7 @@
retval = PTR_ERR(devname);
if (IS_ERR(devname))
goto out;
- retval = do_sys_mount(devname, dirname, "iso9660", flags, NULL);
+ retval = do_mount(devname, dirname, "iso9660", flags, NULL);
putname(devname);
out:
return retval;
@@ -409,7 +408,7 @@
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
- return do_sys_mount("", dirname, "proc", flags, NULL);
+ return do_mount("", dirname, "proc", flags, NULL);
}
asmlinkage int osf_mount(unsigned long typenr, char *path, int flag, void *data)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/Makefile linux/arch/arm/Makefile
--- v2.3.99-pre8/linux/arch/arm/Makefile Fri May 12 14:18:55 2000
+++ linux/arch/arm/Makefile Mon May 15 12:00:34 2000
@@ -182,7 +182,7 @@
SUBDIRS += drivers/acorn
DRIVERS += drivers/acorn/block/acorn-block.a
DRIVERS += drivers/acorn/char/acorn-char.o
-DRIVERS += drivers/acorn/net/acorn-net.a
+DRIVERS += drivers/acorn/net/acorn-net.o
DRIVERS += drivers/acorn/scsi/acorn-scsi.a
endif
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/def-configs/ebsa110 linux/arch/arm/def-configs/ebsa110
--- v2.3.99-pre8/linux/arch/arm/def-configs/ebsa110 Thu May 11 15:30:05 2000
+++ linux/arch/arm/def-configs/ebsa110 Mon May 15 12:00:33 2000
@@ -10,7 +10,7 @@
CONFIG_EXPERIMENTAL=y
#
-# System and processor type
+# System and Processor Type
#
# CONFIG_ARCH_ARC is not set
# CONFIG_ARCH_A5K is not set
@@ -25,6 +25,8 @@
# CONFIG_PCI is not set
# CONFIG_ISA is not set
# CONFIG_ISA_DMA is not set
+# CONFIG_SBUS is not set
+# CONFIG_PCMCIA is not set
#
# Loadable module support
@@ -69,7 +71,6 @@
# 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
@@ -87,13 +88,19 @@
# 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=m
+# 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=y
# CONFIG_BLK_DEV_INITRD is not set
@@ -124,7 +131,7 @@
# Mice
#
# CONFIG_BUSMOUSE is not set
-CONFIG_MOUSE=y
+# CONFIG_MOUSE is not set
# CONFIG_PSMOUSE is not set
# CONFIG_82C710_MOUSE is not set
# CONFIG_PC110_PAD is not set
@@ -141,6 +148,7 @@
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
CONFIG_SOFT_WATCHDOG=y
# CONFIG_PCWATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
@@ -173,6 +181,7 @@
CONFIG_RTNETLINK=y
# CONFIG_NETLINK_DEV is not set
CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
CONFIG_INET=y
@@ -222,6 +231,7 @@
CONFIG_IP_NF_TARGET_REJECT=y
# CONFIG_IP_NF_TARGET_MIRROR is not set
CONFIG_IP_NF_NAT=y
+CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
@@ -302,10 +312,12 @@
# CONFIG_HIPPI is not set
# CONFIG_PLIP is not set
CONFIG_PPP=y
+# CONFIG_PPP_MULTILINK is not set
CONFIG_PPP_ASYNC=y
# CONFIG_PPP_SYNC_TTY is not set
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
# CONFIG_SLIP is not set
#
@@ -342,9 +354,10 @@
# File systems
#
# CONFIG_QUOTA is not set
-CONFIG_AUTOFS_FS=y
+# CONFIG_AUTOFS_FS is not set
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
@@ -354,10 +367,12 @@
# 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=y
+# 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
@@ -365,23 +380,39 @@
# 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 is not set
# 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
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/def-configs/footbridge linux/arch/arm/def-configs/footbridge
--- v2.3.99-pre8/linux/arch/arm/def-configs/footbridge Thu May 11 15:30:05 2000
+++ linux/arch/arm/def-configs/footbridge Mon May 15 12:00:33 2000
@@ -10,7 +10,7 @@
CONFIG_EXPERIMENTAL=y
#
-# System and processor type
+# System and Processor Type
#
# CONFIG_ARCH_ARC is not set
# CONFIG_ARCH_A5K is not set
@@ -19,6 +19,10 @@
CONFIG_FOOTBRIDGE=y
CONFIG_HOST_FOOTBRIDGE=y
# CONFIG_ADDIN_FOOTBRIDGE is not set
+
+#
+# Footbridge Implementations
+#
CONFIG_ARCH_EBSA285=y
# CONFIG_ARCH_CATS is not set
CONFIG_ARCH_NETWINDER=y
@@ -30,7 +34,10 @@
CONFIG_CPU_SA110=y
CONFIG_PCI=y
CONFIG_PCI_NAMES=y
+CONFIG_ISA=y
CONFIG_ISA_DMA=y
+# CONFIG_SBUS is not set
+# CONFIG_PCMCIA is not set
CONFIG_ALIGNMENT_TRAP=y
#
@@ -137,7 +144,11 @@
#
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_NBD=m
+# 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=y
# CONFIG_BLK_DEV_INITRD is not set
@@ -202,6 +213,7 @@
CONFIG_WATCHDOG=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
CONFIG_SOFT_WATCHDOG=y
# CONFIG_PCWATCHDOG is not set
# CONFIG_ACQUIRE_WDT is not set
@@ -242,6 +254,7 @@
# CONFIG_VIDEO_PMS is not set
# CONFIG_VIDEO_BWQCAM is not set
# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_CPIA is not set
# CONFIG_VIDEO_SAA5249 is not set
# CONFIG_TUNER_3036 is not set
# CONFIG_VIDEO_STRADIS is not set
@@ -262,56 +275,6 @@
# CONFIG_AGP is not set
#
-# USB support
-#
-CONFIG_USB=m
-
-#
-# USB Controllers
-#
-# CONFIG_USB_UHCI is not set
-# CONFIG_USB_UHCI_ALT is not set
-CONFIG_USB_OHCI=m
-
-#
-# Miscellaneous USB options
-#
-# CONFIG_USB_DEVICEFS is not set
-
-#
-# USB Devices
-#
-CONFIG_USB_PRINTER=m
-CONFIG_USB_SCANNER=m
-CONFIG_USB_AUDIO=m
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_SERIAL is not set
-# CONFIG_USB_CPIA is not set
-# CONFIG_USB_IBMCAM is not set
-# CONFIG_USB_OV511 is not set
-# CONFIG_USB_DC2XX is not set
-# CONFIG_USB_STORAGE is not set
-# CONFIG_USB_USS720 is not set
-# CONFIG_USB_DABUSB is not set
-# CONFIG_USB_PLUSB is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_DSBR is not set
-
-#
-# USB HID
-#
-# CONFIG_USB_HID is not set
-CONFIG_USB_KBD=m
-CONFIG_USB_MOUSE=m
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_WMFORCE is not set
-# CONFIG_INPUT_KEYBDEV is not set
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-
-#
# Console drivers
#
CONFIG_VGA_CONSOLE=y
@@ -522,10 +485,12 @@
# CONFIG_HIPPI is not set
# CONFIG_PLIP is not set
CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
CONFIG_PPP_ASYNC=m
# CONFIG_PPP_SYNC_TTY is not set
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
CONFIG_SLIP=m
CONFIG_SLIP_COMPRESSED=y
CONFIG_SLIP_SMART=y
@@ -588,9 +553,10 @@
CONFIG_IDEDMA_PCI_EXPERIMENTAL=y
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
-# CONFIG_BLK_DEV_AEC6210 is not set
-# CONFIG_AEC6210_TUNING is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_AEC62XX_TUNING is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_WDC_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD7409 is not set
# CONFIG_AMD7409_OVERRIDE is not set
# CONFIG_BLK_DEV_CMD64X is not set
@@ -610,6 +576,7 @@
# CONFIG_BLK_DEV_SIS5513 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_VIA82CXXX_TUNING is not set
CONFIG_BLK_DEV_SL82C105=y
# CONFIG_IDE_CHIPSETS is not set
CONFIG_IDEDMA_AUTO=y
@@ -625,6 +592,7 @@
#
CONFIG_SOUND=m
# CONFIG_SOUND_CMPCI is not set
+# CONFIG_SOUND_EMU10K1 is not set
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_ESSSOLO1 is not set
@@ -633,6 +601,7 @@
# CONFIG_SOUND_TRIDENT is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
+# CONFIG_SOUND_VIA82CXXX is not set
CONFIG_SOUND_OSS=m
# CONFIG_SOUND_TRACEINIT is not set
# CONFIG_SOUND_DMAP is not set
@@ -643,6 +612,7 @@
# CONFIG_SOUND_CS4232 is not set
# CONFIG_SOUND_SSCAPE is not set
# CONFIG_SOUND_GUS is not set
+# CONFIG_SOUND_ICH is not set
# CONFIG_SOUND_VMIDI is not set
# CONFIG_SOUND_TRIX is not set
# CONFIG_SOUND_MSS is not set
@@ -657,7 +627,6 @@
# CONFIG_SOUND_AWE32_SYNTH is not set
# CONFIG_SOUND_WAVEFRONT is not set
# CONFIG_SOUND_MAUI is not set
-# CONFIG_SOUND_VIA82CXXX is not set
# CONFIG_SOUND_YM3812 is not set
# CONFIG_SOUND_OPL3SA1 is not set
# CONFIG_SOUND_OPL3SA2 is not set
@@ -670,8 +639,8 @@
# File systems
#
# CONFIG_QUOTA is not set
-CONFIG_AUTOFS_FS=y
-# CONFIG_AUTOFS4_FS is not set
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=y
CONFIG_ADFS_FS=m
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
@@ -683,10 +652,12 @@
CONFIG_VFAT_FS=m
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
CONFIG_ISO9660_FS=m
CONFIG_JOLIET=y
# 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
@@ -694,17 +665,22 @@
# CONFIG_DEVFS_DEBUG is not set
CONFIG_DEVPTS_FS=y
# 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=m
# CONFIG_NFSD_V3 is not set
@@ -712,6 +688,16 @@
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
@@ -767,6 +753,57 @@
# CONFIG_NLS_KOI8_R is not set
#
+# USB support
+#
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+CONFIG_USB_OHCI=m
+
+#
+# USB Devices
+#
+CONFIG_USB_PRINTER=m
+CONFIG_USB_SCANNER=m
+CONFIG_USB_AUDIO=m
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_USS720 is not set
+# CONFIG_USB_DABUSB is not set
+# CONFIG_USB_PLUSB is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_DSBR is not set
+
+#
+# USB HID
+#
+# CONFIG_USB_HID is not set
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_WMFORCE is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
# Kernel hacking
#
CONFIG_FRAME_POINTER=y
@@ -774,4 +811,5 @@
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
CONFIG_MAGIC_SYSRQ=y
-# CONFIG_DEBUG_LL is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_DC21285_PORT is not set
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/def-configs/rpc linux/arch/arm/def-configs/rpc
--- v2.3.99-pre8/linux/arch/arm/def-configs/rpc Thu Feb 10 17:11:02 2000
+++ linux/arch/arm/def-configs/rpc Mon May 15 12:00:33 2000
@@ -2,6 +2,7 @@
# Automatically generated make config: don't edit
#
CONFIG_ARM=y
+CONFIG_UID16=y
#
# Code maturity level options
@@ -9,7 +10,7 @@
CONFIG_EXPERIMENTAL=y
#
-# System and processor type
+# System and Processor Type
#
# CONFIG_ARCH_ARC is not set
# CONFIG_ARCH_A5K is not set
@@ -23,7 +24,11 @@
CONFIG_CPU_ARM6=y
CONFIG_CPU_ARM7=y
CONFIG_CPU_SA110=y
+# CONFIG_PCI is not set
+# CONFIG_ISA is not set
# CONFIG_ISA_DMA is not set
+# CONFIG_SBUS is not set
+# CONFIG_PCMCIA is not set
# CONFIG_ALIGNMENT_TRAP is not set
#
@@ -47,10 +52,14 @@
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_ARTHUR is not set
+
+#
+# Parallel port support
+#
CONFIG_PARPORT=y
CONFIG_PARPORT_PC=y
# CONFIG_PARPORT_PC_FIFO is not set
-# CONFIG_PARPORT_PC_PCMCIA is not set
+CONFIG_PARPORT_PC_SUPERIO=y
# CONFIG_PARPORT_ARC is not set
# CONFIG_PARPORT_AMIGA is not set
# CONFIG_PARPORT_MFC3 is not set
@@ -63,7 +72,6 @@
# 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
@@ -79,44 +87,23 @@
# Block devices
#
CONFIG_BLK_DEV_FD=y
-CONFIG_BLK_DEV_IDE=y
-
-#
-# Please see Documentation/ide.txt for help/info on IDE drives
-#
-# CONFIG_BLK_DEV_HD_IDE is not set
-CONFIG_BLK_DEV_IDEDISK=y
-CONFIG_IDEDISK_MULTI_MODE=y
-CONFIG_BLK_DEV_IDECD=y
-# CONFIG_BLK_DEV_IDETAPE is not set
-# CONFIG_BLK_DEV_IDEFLOPPY is not set
-# CONFIG_BLK_DEV_IDESCSI is not set
-
-#
-# IDE chipset support/bugfixes
-#
-# CONFIG_BLK_DEV_CMD640 is not set
-CONFIG_BLK_DEV_IDE_ICSIDE=y
-CONFIG_BLK_DEV_IDEDMA_ICS=y
-CONFIG_IDEDMA_ICS_AUTO=y
-CONFIG_BLK_DEV_IDE_RAPIDE=y
-CONFIG_BLK_DEV_IDEDMA=y
-CONFIG_IDEDMA_AUTO=y
-# CONFIG_IDE_CHIPSETS 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=m
# 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=y
CONFIG_BLK_DEV_INITRD=y
-# CONFIG_BLK_DEV_XD is not set
-CONFIG_PARIDE_PARPORT=y
-# CONFIG_PARIDE is not set
-# CONFIG_BLK_DEV_IDE_MODES is not set
-# CONFIG_BLK_DEV_HD is not set
#
# Acorn-specific block devices
@@ -139,6 +126,17 @@
# CONFIG_PPDEV is not set
#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_PHILIPSPAR is not set
+# CONFIG_I2C_ELV is not set
+# CONFIG_I2C_VELLEMAN is not set
+# CONFIG_I2C_ALGOPCF is not set
+CONFIG_I2C_CHARDEV=y
+
+#
# Mice
#
CONFIG_BUSMOUSE=y
@@ -177,20 +175,10 @@
# CONFIG_FTAPE is not set
# CONFIG_DRM is not set
# CONFIG_DRM_TDFX is not set
-
-#
-# PCMCIA character device support
-#
-# CONFIG_PCMCIA_SERIAL_CS is not set
# CONFIG_AGP is not set
CONFIG_RPCMOUSE=y
#
-# Support for USB
-#
-# CONFIG_USB is not set
-
-#
# Console drivers
#
CONFIG_FB=y
@@ -201,10 +189,6 @@
CONFIG_FB=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_FB_ACORN=y
-# CONFIG_FB_MATROX is not set
-# CONFIG_FB_ATY is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_3DFX is not set
# CONFIG_FB_VIRTUAL is not set
CONFIG_FBCON_ADVANCED=y
CONFIG_FBCON_MFB=y
@@ -222,6 +206,7 @@
# CONFIG_FBCON_MAC is not set
# CONFIG_FBCON_VGA_PLANES is not set
# CONFIG_FBCON_VGA is not set
+# CONFIG_FBCON_HGA is not set
# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
CONFIG_FBCON_FONTS=y
# CONFIG_FONT_8x8 is not set
@@ -298,6 +283,7 @@
#
# 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
@@ -312,12 +298,10 @@
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set
-# CONFIG_RTL8139 is not set
-# CONFIG_DM9102 is not set
# CONFIG_AT1700 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
#
@@ -330,10 +314,12 @@
# CONFIG_HIPPI is not set
# CONFIG_PLIP is not set
CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
# CONFIG_PPP_DEFLATE is not set
# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPPOE=m
# CONFIG_SLIP is not set
#
@@ -342,7 +328,7 @@
# CONFIG_NET_RADIO is not set
#
-# Token Ring driver support
+# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
@@ -355,9 +341,42 @@
# CONFIG_WAN is not set
#
-# PCMCIA network device support
+# ATA/IDE/MFM/RLL support
+#
+CONFIG_IDE=y
+
+#
+# IDE, ATA and ATAPI Block devices
#
-# CONFIG_NET_PCMCIA is not set
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_HD_IDE is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+# CONFIG_BLK_DEV_IDECS is not set
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+CONFIG_BLK_DEV_IDE_ICSIDE=y
+CONFIG_BLK_DEV_IDEDMA_ICS=y
+CONFIG_IDEDMA_ICS_AUTO=y
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_BLK_DEV_IDE_RAPIDE=y
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_IDE_MODES is not set
#
# SCSI support
@@ -368,9 +387,11 @@
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
+CONFIG_SD_EXTRA_DEVS=8
+CONFIG_CHR_DEV_ST=m
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_SR_EXTRA_DEVS=2
CONFIG_CHR_DEV_SG=y
#
@@ -390,12 +411,12 @@
# 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
@@ -403,6 +424,8 @@
# 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_PPA=m
CONFIG_SCSI_IMM=m
# CONFIG_SCSI_IZIP_EPP16 is not set
@@ -410,15 +433,14 @@
# 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_SCSI_ACORNSCSI_3=m
CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE=y
@@ -439,6 +461,7 @@
#
CONFIG_SOUND=m
# CONFIG_SOUND_CMPCI is not set
+# CONFIG_SOUND_EMU10K1 is not set
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_ESSSOLO1 is not set
@@ -447,12 +470,18 @@
# CONFIG_SOUND_TRIDENT is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
+# CONFIG_SOUND_VIA82CXXX is not set
CONFIG_SOUND_OSS=m
+# CONFIG_SOUND_TRACEINIT is not set
+# CONFIG_SOUND_DMAP is not set
# CONFIG_SOUND_AD1816 is not set
# CONFIG_SOUND_SGALAXY is not set
+# CONFIG_SOUND_ADLIB is not set
+# CONFIG_SOUND_ACI_MIXER is not set
# CONFIG_SOUND_CS4232 is not set
# CONFIG_SOUND_SSCAPE is not set
# CONFIG_SOUND_GUS is not set
+# CONFIG_SOUND_ICH is not set
# CONFIG_SOUND_VMIDI is not set
# CONFIG_SOUND_TRIX is not set
# CONFIG_SOUND_MSS is not set
@@ -460,30 +489,29 @@
# CONFIG_SOUND_NM256 is not set
# CONFIG_SOUND_MAD16 is not set
# CONFIG_SOUND_PAS is not set
+# CONFIG_PAS_JOYSTICK is not set
# CONFIG_SOUND_PSS is not set
-# CONFIG_SOUND_SOFTOSS is not set
+CONFIG_SOUND_SOFTOSS=m
# CONFIG_SOUND_SB is not set
+# CONFIG_SOUND_AWE32_SYNTH is not set
# CONFIG_SOUND_WAVEFRONT is not set
# CONFIG_SOUND_MAUI is not set
-# CONFIG_SOUND_VIA82CXXX is not set
# CONFIG_SOUND_YM3812 is not set
# CONFIG_SOUND_OPL3SA1 is not set
# CONFIG_SOUND_OPL3SA2 is not set
# CONFIG_SOUND_UART6850 is not set
+# CONFIG_SOUND_AEDSP16 is not set
CONFIG_SOUND_VIDC=m
# CONFIG_SOUND_WAVEARTIST is not set
#
-# Additional low level sound drivers
-#
-# CONFIG_LOWLEVEL_SOUND is not set
-
-#
-# Filesystems
+# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=m
CONFIG_ADFS_FS=y
+# 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
@@ -492,35 +520,66 @@
# 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=y
CONFIG_JOLIET=y
# 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
+# 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
# 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 is not set
# 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
#
CONFIG_PARTITION_ADVANCED=y
+CONFIG_ACORN_PARTITION=y
+CONFIG_ACORN_PARTITION_ICS=y
+CONFIG_ACORN_PARTITION_ADFS=y
+CONFIG_ACORN_PARTITION_POWERTEC=y
+CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_OSF_PARTITION=y
+CONFIG_AMIGA_PARTITION=y
+# CONFIG_ATARI_PARTITION is not set
CONFIG_MAC_PARTITION=y
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
@@ -528,13 +587,6 @@
# CONFIG_UNIXWARE_DISKLABEL is not set
CONFIG_SGI_PARTITION=y
CONFIG_SUN_PARTITION=y
-CONFIG_AMIGA_PARTITION=y
-# CONFIG_ATARI_PARTITION is not set
-CONFIG_ACORN_PARTITION=y
-CONFIG_ACORN_PARTITION_ADFS=y
-CONFIG_ACORN_PARTITION_ICS=y
-CONFIG_ACORN_PARTITION_POWERTEC=y
-CONFIG_ACORN_PARTITION_RISCIX=y
CONFIG_NLS=y
#
@@ -568,6 +620,11 @@
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
CONFIG_NLS_KOI8_R=m
+
+#
+# USB support
+#
+# CONFIG_USB is not set
#
# Kernel hacking
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/kernel/Makefile linux/arch/arm/kernel/Makefile
--- v2.3.99-pre8/linux/arch/arm/kernel/Makefile Fri May 12 14:18:55 2000
+++ linux/arch/arm/kernel/Makefile Mon May 15 12:00:33 2000
@@ -34,7 +34,7 @@
export-objs := armksyms.o dma.o ecard.o hw-footbridge.o leds-$(MACHINE).o
-obj-$(CONFIG_ARCH_ACORN) += dma.o ecard.o iic.o fiq.o time-acorn.o
+obj-$(CONFIG_ARCH_ACORN) += dma.o ecard.o fiq.o time-acorn.o
obj-$(CONFIG_DEBUG_LL) += debug-$(PROCESSOR).o
obj-$(CONFIG_MODULES) += armksyms.o
obj-$(CONFIG_LEDS) += leds-$(MACHINE).o
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/kernel/iic.c linux/arch/arm/kernel/iic.c
--- v2.3.99-pre8/linux/arch/arm/kernel/iic.c Thu Jun 17 01:11:35 1999
+++ linux/arch/arm/kernel/iic.c Wed Dec 31 16:00:00 1969
@@ -1,248 +0,0 @@
-/*
- * linux/arch/arm/kernel/iic.c
- *
- * Copyright (C) 1995, 1996 Russell King
- *
- * IIC is used to get the current time from the CMOS rtc.
- */
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#define FORCE_ONES 0xdc
-
-/*
- * if delay loop has been calibrated then us that,
- * else use IOC timer 1.
- */
-static void iic_delay(void)
-{
- extern unsigned long loops_per_sec;
- if (loops_per_sec != (1 << 12)) {
- udelay(100); /* was 10 */
- return;
- } else {
- unsigned long flags;
- save_flags_cli(flags);
-
- outb(254, IOC_T1LTCHL);
- outb(255, IOC_T1LTCHH);
- outb(0, IOC_T1GO);
- outb(1<<6, IOC_IRQCLRA); /* clear T1 irq */
- outb(10, IOC_T1LTCHL); /* was 4 */
- outb(0, IOC_T1LTCHH);
- outb(0, IOC_T1GO);
- while ((inb(IOC_IRQSTATA) & (1<<6)) == 0);
- restore_flags(flags);
- }
-}
-
-#define IIC_INIT() dat = (inb(IOC_CONTROL) | FORCE_ONES) & ~3
-#define IIC_SET_DAT outb(dat|=1, IOC_CONTROL);
-#define IIC_CLR_DAT outb(dat&=~1, IOC_CONTROL);
-#define IIC_SET_CLK outb(dat|=2, IOC_CONTROL);
-#define IIC_CLR_CLK outb(dat&=~2, IOC_CONTROL);
-#define IIC_DELAY iic_delay();
-#define IIC_READ_DATA() (inb(IOC_CONTROL) & 1)
-
-static inline void iic_set_lines(int clk, int dat)
-{
- int old;
-
- old = inb(IOC_CONTROL) | FORCE_ONES;
-
- old &= ~3;
-
- if (clk)
- old |= 2;
- if (dat)
- old |= 1;
-
- outb(old, IOC_CONTROL);
-
- iic_delay();
-}
-
-static inline unsigned int iic_read_data(void)
-{
- return inb(IOC_CONTROL) & 1;
-}
-
-/*
- * C: ==~~_
- * D: =~~__
- */
-static inline void iic_start(void)
-{
- unsigned int dat;
-
- IIC_INIT();
-
- IIC_SET_DAT
- IIC_DELAY
- IIC_SET_CLK
- IIC_DELAY
-
- IIC_CLR_DAT
- IIC_DELAY
- IIC_CLR_CLK
- IIC_DELAY
-}
-
-/*
- * C: __~~
- * D: =__~
- */
-static inline void iic_stop(void)
-{
- unsigned int dat;
-
- IIC_INIT();
-
- IIC_CLR_DAT
- IIC_DELAY
- IIC_SET_CLK
- IIC_DELAY
- IIC_SET_DAT
- IIC_DELAY
-}
-
-/*
- * C: __~_
- * D: =___
- */
-static inline void iic_acknowledge(void)
-{
- unsigned int dat;
-
- IIC_INIT();
-
- IIC_CLR_DAT
- IIC_DELAY
- IIC_SET_CLK
- IIC_DELAY
- IIC_CLR_CLK
- IIC_DELAY
-}
-
-/*
- * C: __~_
- * D: =~H~
- */
-static inline int iic_is_acknowledged(void)
-{
- unsigned int dat, ack_bit;
-
- IIC_INIT();
-
- IIC_SET_DAT
- IIC_DELAY
- IIC_SET_CLK
- IIC_DELAY
-
- ack_bit = IIC_READ_DATA();
-
- IIC_CLR_CLK
- IIC_DELAY
-
- return ack_bit == 0;
-}
-
-/*
- * C: _~__~__~__~__~__~__~__~_
- * D: =DDXDDXDDXDDXDDXDDXDDXDD
- */
-static void iic_sendbyte(unsigned int b)
-{
- unsigned int dat, i;
-
- IIC_INIT();
-
- for (i = 0; i < 8; i++) {
- if (b & 128)
- IIC_SET_DAT
- else
- IIC_CLR_DAT
- IIC_DELAY
-
- IIC_SET_CLK
- IIC_DELAY
- IIC_CLR_CLK
- IIC_DELAY
-
- b <<= 1;
- }
-}
-
-/*
- * C: __~_~_~_~_~_~_~_~_
- * D: =~HHHHHHHHHHHHHHHH
- */
-static unsigned char iic_recvbyte(void)
-{
- unsigned int dat, i, in;
-
- IIC_INIT();
-
- IIC_SET_DAT
- IIC_DELAY
-
- in = 0;
- for (i = 0; i < 8; i++) {
- IIC_SET_CLK
- IIC_DELAY
-
- in = (in << 1) | IIC_READ_DATA();
-
- IIC_CLR_CLK
- IIC_DELAY
- }
-
- return in;
-}
-
-int iic_control (unsigned char addr, unsigned char loc, unsigned char *buf, int len)
-{
- int i, err = -EIO;
-
- iic_start();
- iic_sendbyte(addr & 0xfe);
- if (!iic_is_acknowledged())
- goto error;
-
- iic_sendbyte(loc);
- if (!iic_is_acknowledged())
- goto error;
-
- if (addr & 1) {
- iic_stop();
- iic_start();
- iic_sendbyte(addr|1);
- if (!iic_is_acknowledged())
- goto error;
-
- for (i = 0; i < len - 1; i++) {
- buf[i] = iic_recvbyte();
- iic_acknowledge();
- }
- buf[i] = iic_recvbyte();
- } else {
- for (i = 0; i < len; i++) {
- iic_sendbyte(buf[i]);
-
- if (!iic_is_acknowledged())
- goto error;
- }
- }
-
- err = 0;
-error:
- iic_stop();
-
- return err;
-}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/kernel/traps.c linux/arch/arm/kernel/traps.c
--- v2.3.99-pre8/linux/arch/arm/kernel/traps.c Thu Feb 10 17:11:03 2000
+++ linux/arch/arm/kernel/traps.c Mon May 15 16:41:29 2000
@@ -399,13 +399,13 @@
printk(KERN_CRIT"kernel BUG at %s:%d!\n", file, line);
if (data)
printk(KERN_CRIT"extra data = %p\n", data);
- *(int *)0 = 0;
+ BUG();
}
void __readwrite_bug(const char *fn)
{
printk("%s called, but not implemented", fn);
- *(int *)0 = 0;
+ BUG();
}
void __pte_error(const char *file, int line, unsigned long val)
@@ -436,7 +436,7 @@
printk(KERN_CRIT "abort() called from %p! (Please "
"report to rmk@arm.linux.org.uk)\n", lr);
- *(int *)0 = 0;
+ BUG();
/* if that doesn't kill us, halt */
panic("Oops failed to kill thread");
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/arm/lib/Makefile linux/arch/arm/lib/Makefile
--- v2.3.99-pre8/linux/arch/arm/lib/Makefile Tue Apr 11 15:09:12 2000
+++ linux/arch/arm/lib/Makefile Mon May 15 12:00:33 2000
@@ -20,6 +20,7 @@
L_OBJS_clps7500 := io-acorn.o
L_OBJS_ebsa110 := io-ebsa110.o
L_OBJS_footbridge := io-footbridge.o
+L_OBJS_l7200 := io-acorn.o
L_OBJS_nexuspci := io-footbridge.o
L_OBJS_sa1100 := io-footbridge.o
L_OBJS_shark := io-shark.o
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/config.in linux/arch/i386/config.in
--- v2.3.99-pre8/linux/arch/i386/config.in Thu May 11 15:30:05 2000
+++ linux/arch/i386/config.in Tue May 23 08:22:22 2000
@@ -180,7 +180,6 @@
bool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE
bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE
bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK
- bool ' Ignore multiple suspend' CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
bool ' Ignore multiple suspend/resume cycles' CONFIG_APM_IGNORE_SUSPEND_BOUNCE
bool ' RTC stores time in GMT' CONFIG_APM_RTC_IS_GMT
bool ' Allow interrupts during APM BIOS calls' CONFIG_APM_ALLOW_INTS
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/defconfig linux/arch/i386/defconfig
--- v2.3.99-pre8/linux/arch/i386/defconfig Fri May 12 14:18:55 2000
+++ linux/arch/i386/defconfig Mon May 15 13:11:34 2000
@@ -111,7 +111,6 @@
# 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
@@ -169,6 +168,13 @@
# CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
+# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
# CONFIG_BLK_DEV_IDECS is not set
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/acpi.c linux/arch/i386/kernel/acpi.c
--- v2.3.99-pre8/linux/arch/i386/kernel/acpi.c Thu May 11 15:30:06 2000
+++ linux/arch/i386/kernel/acpi.c Mon May 15 12:14:19 2000
@@ -829,7 +829,7 @@
{0x8086, 0x7113, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_INTEL_PIIX4},
{0x1106, 0x3040, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_VIA_586},
{0x1106, 0x3057, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_VIA_686A},
- {0,}, /* terminate list */
+ {0,} /* terminate list */
};
static int __init acpi_probe(struct pci_dev *dev,
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/apic.c linux/arch/i386/kernel/apic.c
--- v2.3.99-pre8/linux/arch/i386/kernel/apic.c Thu May 11 15:30:06 2000
+++ linux/arch/i386/kernel/apic.c Sat May 13 07:37:34 2000
@@ -30,11 +30,6 @@
int prof_old_multiplier[NR_CPUS] = { 1, };
int prof_counter[NR_CPUS] = { 1, };
-/*
- * IA s/w dev Vol 3, Section 7.4
- */
-#define APIC_DEFAULT_PHYS_BASE 0xfee00000
-
int get_maxlvt(void)
{
unsigned int v, ver, maxlvt;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
--- v2.3.99-pre8/linux/arch/i386/kernel/apm.c Fri Mar 10 16:40:39 2000
+++ linux/arch/i386/kernel/apm.c Tue May 23 08:22:22 2000
@@ -132,6 +132,9 @@
* 1.13: Changes for new pm_ interfaces (Andy Henroid
* ).
* Modularize the code.
+ * Fix the Thinkpad (again) :-( (CONFIG_APM_IGNORE_MULTIPLE_SUSPENDS
+ * is now the way life works).
+ * Fix thinko in suspend() (wrong return).
*
* APM 1.1 Reference:
*
@@ -308,9 +311,7 @@
#endif
static int suspends_pending = 0;
static int standbys_pending = 0;
-#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
static int waiting_for_resume = 0;
-#endif
#ifdef CONFIG_APM_RTC_IS_GMT
# define clock_cmos_diff 0
@@ -866,22 +867,22 @@
static int suspend(void)
{
int err;
- int ret;
struct apm_user *as;
get_time_diff();
err = apm_set_power_state(APM_STATE_SUSPEND);
reinit_timer();
set_time();
- ret = (err == APM_SUCCESS) || (err == APM_NO_ERROR);
- if (!ret)
+ if (err == APM_NO_ERROR)
+ err = APM_SUCCESS;
+ if (err != APM_SUCCESS)
apm_error("suspend", err);
for (as = user_list; as != NULL; as = as->next) {
as->suspend_wait = 0;
- as->suspend_result = (ret ? 0 : -EIO);
+ as->suspend_result = ((err == APM_SUCCESS) ? 0 : -EIO);
}
wake_up_interruptible(&apm_suspend_waitqueue);
- return ret;
+ return err;
}
static void standby(void)
@@ -962,14 +963,7 @@
switch (event) {
case APM_SYS_STANDBY:
case APM_USER_STANDBY:
-#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
- if (waiting_for_resume)
- break;
-#endif
if (send_event(event, NULL)) {
-#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
- waiting_for_resume = 1;
-#endif
if (standbys_pending <= 0)
standby();
}
@@ -986,14 +980,18 @@
if (ignore_bounce)
break;
#endif
-#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
+ /*
+ * If we are already processing a SUSPEND,
+ * then further SUSPEND events from the BIOS
+ * will be ignored. We also return here to
+ * cope with the fact that the Thinkpads keep
+ * sending a SUSPEND event until something else
+ * happens!
+ */
if (waiting_for_resume)
- break;
-#endif
+ return;
if (send_event(event, NULL)) {
-#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
waiting_for_resume = 1;
-#endif
if (suspends_pending <= 0)
(void) suspend();
}
@@ -1002,9 +1000,7 @@
case APM_NORMAL_RESUME:
case APM_CRITICAL_RESUME:
case APM_STANDBY_RESUME:
-#ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
waiting_for_resume = 0;
-#endif
#ifdef CONFIG_APM_IGNORE_SUSPEND_BOUNCE
last_resume = jiffies;
ignore_bounce = 1;
@@ -1036,8 +1032,10 @@
int err;
if ((standbys_pending > 0) || (suspends_pending > 0)) {
- if ((apm_bios_info.version > 0x100) && (pending_count-- < 0)) {
+ if ((apm_bios_info.version > 0x100) && (pending_count-- <= 0)) {
pending_count = 4;
+ if (debug)
+ printk(KERN_DEBUG "apm: setting state busy\n");
err = apm_set_power_state(APM_STATE_BUSY);
if (err)
apm_error("busy", err);
@@ -1097,7 +1095,7 @@
static int check_apm_user(struct apm_user *as, const char *func)
{
if ((as == NULL) || (as->magic != APM_BIOS_MAGIC)) {
- printk(KERN_ERR "apm: %s passed bad filp", func);
+ printk(KERN_ERR "apm: %s passed bad filp\n", func);
return 1;
}
return 0;
@@ -1200,7 +1198,7 @@
} else if (!send_event(APM_USER_SUSPEND, as))
return -EAGAIN;
if (suspends_pending <= 0) {
- if (!suspend())
+ if (suspend() != APM_SUCCESS)
return -EIO;
} else {
as->suspend_wait = 1;
@@ -1251,7 +1249,7 @@
as1 = as1->next)
;
if (as1 == NULL)
- printk(KERN_ERR "apm: filp not in user list");
+ printk(KERN_ERR "apm: filp not in user list\n");
else
as1->next = as->next;
}
@@ -1268,7 +1266,7 @@
as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL);
if (as == NULL) {
- printk(KERN_ERR "apm: cannot allocate struct of size %d bytes",
+ printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
sizeof(*as));
MOD_DEC_USE_COUNT;
return -ENOMEM;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/i8259.c linux/arch/i386/kernel/i8259.c
--- v2.3.99-pre8/linux/arch/i386/kernel/i8259.c Wed Apr 26 16:34:06 2000
+++ linux/arch/i386/kernel/i8259.c Sat May 13 07:37:34 2000
@@ -456,7 +456,7 @@
* IRQ0 must be given a fixed assignment and initialized,
* because it's used before the IO-APIC is set up.
*/
- set_intr_gate(IRQ0_TRAP_VECTOR, interrupt[0]);
+ set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]);
/*
* The reschedule interrupt is a CPU-to-CPU reschedule-helper
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/io_apic.c linux/arch/i386/kernel/io_apic.c
--- v2.3.99-pre8/linux/arch/i386/kernel/io_apic.c Wed Apr 26 16:34:06 2000
+++ linux/arch/i386/kernel/io_apic.c Sat May 13 07:37:34 2000
@@ -48,6 +48,11 @@
/* 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 @@
entry->pin = pin;
}
-#define __DO_ACTION(name,R,ACTION, FINAL) \
+#define __DO_ACTION(R, ACTION, FINAL) \
\
{ \
int pin; \
@@ -112,8 +117,8 @@
#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 @@
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 @@
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 @@
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 @@
*/
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 @@
mask = mask << 24;
spin_lock_irqsave(&ioapic_lock, flags);
- __DO_ACTION( target, 1, = mask, )
+ __DO_ACTION(1, = mask, )
spin_unlock_irqrestore(&ioapic_lock, flags);
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- v2.3.99-pre8/linux/arch/i386/kernel/irq.c Wed Apr 26 16:34:06 2000
+++ linux/arch/i386/kernel/irq.c Sat May 13 07:37:34 2000
@@ -1117,7 +1117,8 @@
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 @@
/*
* Create entries for all existing IRQs.
*/
- for (i = 0; i < NR_IRQS; i++) {
- if (irq_desc[i].handler == &no_irq_type)
- continue;
+ for (i = 0; i < NR_IRQS; i++)
register_irq_proc(i);
- }
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/ldt.c linux/arch/i386/kernel/ldt.c
--- v2.3.99-pre8/linux/arch/i386/kernel/ldt.c Tue Aug 3 12:10:35 1999
+++ linux/arch/i386/kernel/ldt.c Sat May 20 10:39:58 2000
@@ -93,6 +93,7 @@
mm->segments = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
if (!mm->segments)
goto out_unlock;
+ memset(mm->segments, 0, LDT_ENTRIES*LDT_ENTRY_SIZE);
if (atomic_read(&mm->mm_users) > 1)
printk(KERN_WARNING "LDT allocated for cloned task!\n");
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/mpparse.c linux/arch/i386/kernel/mpparse.c
--- v2.3.99-pre8/linux/arch/i386/kernel/mpparse.c Wed Apr 26 16:34:06 2000
+++ linux/arch/i386/kernel/mpparse.c Sat May 13 07:37:34 2000
@@ -50,11 +50,6 @@
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 @@
static int __init mpf_checksum(unsigned char *mp, int len)
{
- int sum=0;
- while(len--)
- sum+=*mp++;
- return sum&0xFF;
+ int sum = 0;
+
+ while (len--)
+ sum += *mp++;
+
+ return sum & 0xFF;
}
/*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/pci-i386.c linux/arch/i386/kernel/pci-i386.c
--- v2.3.99-pre8/linux/arch/i386/kernel/pci-i386.c Thu May 11 15:30:06 2000
+++ linux/arch/i386/kernel/pci-i386.c Mon May 15 13:40:09 2000
@@ -121,6 +121,19 @@
}
}
+/*
+ * We need to avoid collisions with `mirrored' VGA ports
+ * and other strange ISA hardware, so we always want the
+ * addresses to be allocated in the 0x000-0x0ff region
+ * modulo 0x400.
+ *
+ * Why? Because some silly external IO cards only decode
+ * the low 10 bits of the IO address. The 0x00-0xff region
+ * is reserved for motherboard devices that decode all 16
+ * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
+ * but we want to try to avoid allocating at 0x2900-0x2bff
+ * which might have be mirrored at 0x0100-0x03ff..
+ */
void
pcibios_align_resource(void *data, struct resource *res, unsigned long size)
{
@@ -129,17 +142,16 @@
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;
+ if (start & 0x300) {
+ start = (start + 0x3ff) & ~0x3ff;
+ res->start = start;
+ }
}
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/pci-irq.c linux/arch/i386/kernel/pci-irq.c
--- v2.3.99-pre8/linux/arch/i386/kernel/pci-irq.c Thu May 11 15:30:06 2000
+++ linux/arch/i386/kernel/pci-irq.c Sat May 13 07:34:49 2000
@@ -222,6 +222,7 @@
{ "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 @@
if (!irq) {
DBG(" ... failed\n");
- if (newirq && mask == (1 << newirq)) {
+ if (assign && newirq && mask == (1 << newirq)) {
msg = "Guessed";
irq = newirq;
} else
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/pci-pc.c linux/arch/i386/kernel/pci-pc.c
--- v2.3.99-pre8/linux/arch/i386/kernel/pci-pc.c Thu May 11 15:30:06 2000
+++ linux/arch/i386/kernel/pci-pc.c Sat May 20 11:32:08 2000
@@ -844,15 +844,15 @@
pcibios_last_bus = -1;
}
-static void __init pci_fixup_rcc(struct pci_dev *d)
+static void __init pci_fixup_serverworks(struct pci_dev *d)
{
/*
- * RCC host bridges -- Find and scan all secondary buses.
+ * ServerWorks host bridges -- Find and scan all secondary buses.
* Register 0x44 contains first, 0x45 last bus number routed there.
*/
u8 busno;
pci_read_config_byte(d, 0x44, &busno);
- printk("PCI: RCC host bridge: secondary bus %02x\n", busno);
+ printk("PCI: ServerWorks host bridge: secondary bus %02x\n", busno);
pci_scan_bus(busno, pci_root_ops, NULL);
pcibios_last_bus = -1;
}
@@ -928,8 +928,9 @@
struct pci_fixup pcibios_fixups[] = {
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_RCC, PCI_DEVICE_ID_RCC_HE, pci_fixup_rcc },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_RCC, PCI_DEVICE_ID_RCC_LE, pci_fixup_rcc },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HE, pci_fixup_serverworks },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE, pci_fixup_serverworks },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CMIC_HE, pci_fixup_serverworks },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_6010, pci_fixup_compaq },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, pci_fixup_ide_trash },
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- v2.3.99-pre8/linux/arch/i386/kernel/setup.c Thu May 11 15:30:06 2000
+++ linux/arch/i386/kernel/setup.c Sat May 20 09:22:58 2000
@@ -406,6 +406,32 @@
e820.nr_map++;
} /* add_memory_region */
+#define E820_DEBUG 1
+
+static void __init 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 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 @@
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 @@
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 @@
}
*to = '\0';
*cmdline_p = command_line;
+ if (usermem) {
+ printk("user-defined physical RAM map:\n");
+ print_e820_map();
+ }
}
void __init setup_arch(char **cmdline_p)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
--- v2.3.99-pre8/linux/arch/i386/kernel/traps.c Wed Apr 26 16:34:06 2000
+++ linux/arch/i386/kernel/traps.c Sat May 13 07:37:34 2000
@@ -790,7 +790,7 @@
* On normal SMP PC this is used only with SMP, but we have to
* use it and set it up here to start the Cobalt clock
*/
- set_fixmap(FIX_APIC_BASE, APIC_PHYS_BASE);
+ set_fixmap(FIX_APIC_BASE, APIC_DEFAULT_PHYS_BASE);
printk("Local APIC ID %lx\n", apic_read(APIC_ID));
printk("Local APIC Version %lx\n", apic_read(APIC_LVR));
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/i386/mm/init.c linux/arch/i386/mm/init.c
--- v2.3.99-pre8/linux/arch/i386/mm/init.c Tue Mar 7 14:32:25 2000
+++ linux/arch/i386/mm/init.c Sat May 13 07:40:53 2000
@@ -242,8 +242,18 @@
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 @@
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 @@
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 @@
for (k = 0; k < PTRS_PER_PTE; pte++, k++) {
vaddr = i*PGDIR_SIZE + j*PMD_SIZE + k*PAGE_SIZE;
- if (vaddr >= end)
+ if (end && (vaddr >= end))
break;
*pte = mk_pte_phys(__pa(vaddr), PAGE_KERNEL);
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/ia64/ia32/sys_ia32.c linux/arch/ia64/ia32/sys_ia32.c
--- v2.3.99-pre8/linux/arch/ia64/ia32/sys_ia32.c Wed Apr 26 16:34:06 2000
+++ linux/arch/ia64/ia32/sys_ia32.c Sat May 20 10:47:29 2000
@@ -2735,8 +2735,6 @@
extern asmlinkage long sys_mount(char * dev_name, char * dir_name, char * type,
unsigned long new_flags, void *data);
-extern long do_sys_mount(char * dev_name, char * dir_name, char * type,
- unsigned long new_flags, void *data);
#define SMBFS_NAME "smbfs"
#define NCPFS_NAME "ncpfs"
@@ -2784,7 +2782,7 @@
do_smb_super_data_conv((void *)data_page);
else
panic("The problem is here...");
- err = do_sys_mount((char *)dev_page, (char *)dir_page,
+ err = do_mount((char *)dev_page, (char *)dir_page,
(char *)type_page, new_flags,
(void *)data_page);
if(data_page)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/Makefile linux/arch/mips/Makefile
--- v2.3.99-pre8/linux/arch/mips/Makefile Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/Makefile Sat May 13 08:29:14 2000
@@ -125,6 +125,7 @@
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 @@
@$(MAKEBOOT) clean
$(MAKE) -C arch/$(ARCH)/kernel clean
$(MAKE) -C arch/$(ARCH)/tools clean
+ $(MAKE) -C arch/mips/baget clean
archmrproper:
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/Makefile linux/arch/mips/arc/Makefile
--- v2.3.99-pre8/linux/arch/mips/arc/Makefile Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 2000/01/13 00:11:11 ralf Exp $
+# $Id: Makefile,v 1.1 1998/10/18 13:32:08 tsbogend Exp $
#
# Makefile for the SGI arcs prom monitor library routines
# under Linux.
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/cmdline.c linux/arch/mips/arc/cmdline.c
--- v2.3.99-pre8/linux/arch/mips/arc/cmdline.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/cmdline.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: cmdline.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: cmdline.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/env.c linux/arch/mips/arc/env.c
--- v2.3.99-pre8/linux/arch/mips/arc/env.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/env.c Sat May 13 08:29:14 2000
@@ -11,12 +11,14 @@
#include
-char * __init prom_getenv(char *name)
+PCHAR __init
+ArcGetEnvironmentVariable(CHAR *name)
{
return romvec->get_evar(name);
}
-long __init prom_setenv(char *name, char *value)
+LONG __init
+ArcSetEnvironmentVariable(PCHAR name, PCHAR value)
{
return romvec->set_evar(name, value);
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/file.c linux/arch/mips/arc/file.c
--- v2.3.99-pre8/linux/arch/mips/arc/file.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/file.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: file.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: file.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/identify.c linux/arch/mips/arc/identify.c
--- v2.3.99-pre8/linux/arch/mips/arc/identify.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/identify.c Sat May 13 08:29:14 2000
@@ -7,7 +7,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: identify.c,v 1.3 1999/10/21 00:23:04 ralf Exp $
+ * $Id: identify.c,v 1.2 1999/02/25 21:04:13 tsbogend Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/init.c linux/arch/mips/arc/init.c
--- v2.3.99-pre8/linux/arch/mips/arc/init.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips/arc/init.c Sat May 13 08:29:14 2000
@@ -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 @@
extern void prom_testtree(void);
-int __init prom_init(int argc, char **argv, char **envp)
+int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
{
struct linux_promblock *pb;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/memory.c linux/arch/mips/arc/memory.c
--- v2.3.99-pre8/linux/arch/mips/arc/memory.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips/arc/memory.c Sat May 13 08:29:14 2000
@@ -21,8 +21,6 @@
#undef DEBUG
-extern char _end;
-
struct linux_mdesc * __init
ArcGetMemoryDescriptor(struct linux_mdesc *Current)
{
@@ -146,7 +144,7 @@
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 @@
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 @@
prom_printf("CRITIAL: overwriting PROM data.\n");
BUG();
}
+
+ /* Reserve the memory bootmap itself */
reserve_bootmem(largest->base, bootmap_size);
printk("PROMLIB: Total free ram %dK / %dMB.\n",
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/misc.c linux/arch/mips/arc/misc.c
--- v2.3.99-pre8/linux/arch/mips/arc/misc.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/misc.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+/* $Id: misc.c,v 1.1 1998/10/18 13:32:09 tsbogend Exp $
*
* misc.c: Miscellaneous ARCS PROM routines.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/salone.c linux/arch/mips/arc/salone.c
--- v2.3.99-pre8/linux/arch/mips/arc/salone.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/salone.c Sat May 13 08:29:14 2000
@@ -4,7 +4,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: salone.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: salone.c,v 1.1 1998/10/18 13:32:09 tsbogend Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/time.c linux/arch/mips/arc/time.c
--- v2.3.99-pre8/linux/arch/mips/arc/time.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/time.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: time.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: time.c,v 1.1 1998/10/18 13:32:10 tsbogend Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/arc/tree.c linux/arch/mips/arc/tree.c
--- v2.3.99-pre8/linux/arch/mips/arc/tree.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/arc/tree.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: tree.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+ * $Id: tree.c,v 1.1 1998/10/18 13:32:10 tsbogend Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/Makefile linux/arch/mips/baget/Makefile
--- v2.3.99-pre8/linux/arch/mips/baget/Makefile Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/Makefile Sat May 13 08:29:14 2000
@@ -11,11 +11,8 @@
all: baget.a
-image: ../../../vmlinux
- cp -f $< $@
-
O_TARGET := baget.a
-O_OBJS := baget.o print.o setup.o time.o irq.o bagetIRQ.o reset.o
+O_OBJS := baget.o print.o setup.o time.o irq.o bagetIRQ.o reset.o wbflush.o
ifeq ($(CONFIG_SERIAL),y)
OX_OBJS += vacserial.o
@@ -38,8 +35,8 @@
##################### Baget Loader stuff ########################
-dummy.c:
- touch $@
+image: ../../../vmlinux
+ cp -f $< $@
image.bin: image
$(OBJCOPY) -O binary $< $@
@@ -47,6 +44,9 @@
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 @@
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 @@
$(LD) $(LDFLAGS) -T ld.script.balo -o $@ $^
clean:
- rm -f balo.o balo.h dummy.o dummy.c hello.o image.bin image balo_supp.o
- rm -f $(O_OBJS) $(O_TARGET)
+ rm -f balo balo.h dummy.c image image.bin
include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/baget.c linux/arch/mips/baget/baget.c
--- v2.3.99-pre8/linux/arch/mips/baget/baget.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/baget.c Sat May 13 08:29:14 2000
@@ -13,15 +13,9 @@
#include
#include
#include
+#include
#include
-
-/*
- * Following values are set by BALO into RAM disk buffer parameters
- */
-unsigned long balo_ramdisk_base = 0xBA; /* Signature for BALO ! */
-unsigned long balo_ramdisk_size = 0;
-
/*
* Following code is based on routines from 'mm/vmalloc.c'
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/bagetIRQ.S linux/arch/mips/baget/bagetIRQ.S
--- v2.3.99-pre8/linux/arch/mips/baget/bagetIRQ.S Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/bagetIRQ.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: bagetIRQ.S,v 1.2 1999/08/18 23:37:42 ralf Exp $
+/* $Id: bagetIRQ.S,v 1.1 1999/01/17 03:49:37 ralf Exp $
* bagetIRQ.S: Interrupt exception dispatch code for Baget/MIPS
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/balo.c linux/arch/mips/baget/balo.c
--- v2.3.99-pre8/linux/arch/mips/baget/balo.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/balo.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: balo.c,v 1.1 1999/01/17 03:49:37 ralf Exp $
+/* $Id$
*
* balo.c: BAget LOader
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/irq.c linux/arch/mips/baget/irq.c
--- v2.3.99-pre8/linux/arch/mips/baget/irq.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/irq.c Sat May 13 08:29:14 2000
@@ -29,8 +29,7 @@
#include
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
+irq_cpustat_t irq_stat [NR_CPUS];
unsigned long spurious_count = 0;
/*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/print.c linux/arch/mips/baget/print.c
--- v2.3.99-pre8/linux/arch/mips/baget/print.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/print.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: print.c,v 1.2 1999/10/09 00:00:57 ralf Exp $
+/* $Id: print.c,v 1.1 1999/01/17 03:49:38 ralf Exp $
*
* print.c: Simple print fascility
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/prom/Makefile linux/arch/mips/baget/prom/Makefile
--- v2.3.99-pre8/linux/arch/mips/baget/prom/Makefile Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/prom/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 1999/01/17 03:49:40 ralf Exp $
+# $Id$
# Makefile for the Baget/MIPS prom emulator library routines.
#
# Note! Dependencies are done automagically by 'make dep', which also
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/time.c linux/arch/mips/baget/time.c
--- v2.3.99-pre8/linux/arch/mips/baget/time.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/baget/time.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.4 1999/10/09 00:00:57 ralf Exp $
+/* $Id: time.c,v 1.3 1999/08/17 22:18:37 ralf Exp $
* time.c: Baget/MIPS specific time handling details
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/baget/vacserial.c linux/arch/mips/baget/vacserial.c
--- v2.3.99-pre8/linux/arch/mips/baget/vacserial.c Wed Apr 26 16:34:06 2000
+++ linux/arch/mips/baget/vacserial.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: vacserial.c,v 1.4 1999/10/09 00:00:57 ralf Exp $
+/* $Id: vacserial.c,v 1.3 1999/08/17 22:18:37 ralf Exp $
* vacserial.c: VAC UART serial driver
* This code stealed and adopted from linux/drivers/char/serial.c
* See that for author info
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/boot/Makefile linux/arch/mips/boot/Makefile
--- v2.3.99-pre8/linux/arch/mips/boot/Makefile Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/boot/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.10 1999/10/17 19:55:22 harald Exp $
+# $Id: Makefile,v 1.9 1999/04/07 18:45:23 harald Exp $
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/config.in linux/arch/mips/config.in
--- v2.3.99-pre8/linux/arch/mips/config.in Tue Apr 11 15:09:13 2000
+++ linux/arch/mips/config.in Sat May 13 08:29:14 2000
@@ -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,168 +26,169 @@
#
# 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
+ comment 'CPU selection'
- 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
+ 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_PROC_FS" = "y" ]; then
+ define_bool CONFIG_KCORE_ELF y
+ fi
+ define_bool CONFIG_ELF_KERNEL y
+
+ if [ "$CONFIG_CPU_LITTLE_ENDIAN" = "n" ]; then
+ bool 'Include IRIX binary compatibility' CONFIG_BINFMT_IRIX
+ bool 'Include forward keyboard' CONFIG_FORWARD_KEYBOARD
+ fi
+
+ define_bool CONFIG_BINFMT_AOUT n
+ define_bool CONFIG_BINFMT_ELF y
+ tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
+
+ bool 'Networking support' CONFIG_NET
+
+ if [ "$CONFIG_PCI" = "y" ]; then
+ source drivers/pci/Config.in
+ fi
+
+ bool 'System V IPC' CONFIG_SYSVIPC
+ bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
+ bool 'Sysctl support' CONFIG_SYSCTL
+
+ source drivers/parport/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_CPU_LITTLE_ENDIAN" = "n" ]; then
- define_bool CONFIG_BINFMT_IRIX y
- define_bool CONFIG_FORWARD_KEYBOARD y
+if [ "$CONFIG_ISA" = "y" ]; then
+ source drivers/pnp/Config.in
fi
-define_bool CONFIG_BINFMT_AOUT n
-define_bool CONFIG_BINFMT_ELF y
-tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
-
-bool 'Networking support' CONFIG_NET
-source drivers/pci/Config.in
-
-bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
-if [ "$CONFIG_HOTPLUG" = "y" ]; then
+if [ "$CONFIG_HOTPLUG" = "y" ] ; then
source drivers/pcmcia/Config.in
else
define_bool CONFIG_PCMCIA n
fi
-bool 'System V IPC' CONFIG_SYSVIPC
-bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
-bool 'Sysctl support' CONFIG_SYSCTL
-
-if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then
- source drivers/parport/Config.in
-fi
-endmenu
-
-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/pci/Config.in
-
-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
-fi
-
-source drivers/pnp/Config.in
-
source drivers/block/Config.in
if [ "$CONFIG_NET" = "y" ]; then
source net/Config.in
fi
-mainmenu_option next_comment
-comment 'ATA/IDE/MFM/RLL support'
-
-tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
+if [ "$CONFIG_DECSTATION" != "n" -a \
+ "$CONFIG_SGI_IP22" != "n" ]; then
+ source drivers/telephony/Config.in
+fi
-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
+if [ "$CONFIG_SGI_IP22" != "n" -a \
+ "$CONFIG_DECSTATION" != "n" ]; then
+
+ 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 @@
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 @@
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 @@
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 @@
mainmenu_option next_comment
comment 'Kernel hacking'
-#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
bool 'Are you using a crosscompiler' CONFIG_CROSSCOMPILE
if [ "$CONFIG_MODULES" = "y" ]; then
bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/Makefile linux/arch/mips/ddb5074/Makefile
--- v2.3.99-pre8/linux/arch/mips/ddb5074/Makefile Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/ddb5074/Makefile Sat May 13 08:29:14 2000
@@ -8,7 +8,7 @@
#
# Note 2! The CFLAGS definitions are now in the main makefile...
#
-# $Id: Makefile,v 1.1 2000/01/26 00:07:44 ralf Exp $
+# $Id$
#
.S.s:
@@ -17,6 +17,6 @@
$(CC) $(CFLAGS) -c $< -o $*.o
O_TARGET = ddb5074.a
-O_OBJS = setup.o irq.o time.o prom.o pci.o int-handler.o nile4.o
+O_OBJS = setup.o irq.o time.o prom.o pci.o pci-dma.o int-handler.o nile4.o
include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/int-handler.S linux/arch/mips/ddb5074/int-handler.S
--- v2.3.99-pre8/linux/arch/mips/ddb5074/int-handler.S Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/ddb5074/int-handler.S Sat May 13 08:29:14 2000
@@ -6,9 +6,9 @@
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
* Copyright (C) 2000 Geert Uytterhoeven
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: int-handler.S,v 1.2 2000/01/27 02:06:56 ralf Exp $
+ * $Id: int-handler.S,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/irq.c linux/arch/mips/ddb5074/irq.c
--- v2.3.99-pre8/linux/arch/mips/ddb5074/irq.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips/ddb5074/irq.c Sat May 13 08:29:14 2000
@@ -2,7 +2,7 @@
* arch/mips/ddb5074/irq.c -- NEC DDB Vrc-5074 interrupt routines
*
* Copyright (C) 2000 Geert Uytterhoeven
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
* $Id: irq.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
@@ -30,7 +30,7 @@
extern asmlinkage void do_IRQ(int irq, struct pt_regs * regs);
-static void no_action(int cpl, void *dev_id, struct pt_regs *regs)
+void no_action(int cpl, void *dev_id, struct pt_regs *regs)
{
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/nile4.c linux/arch/mips/ddb5074/nile4.c
--- v2.3.99-pre8/linux/arch/mips/ddb5074/nile4.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/ddb5074/nile4.c Sat May 13 08:29:14 2000
@@ -2,9 +2,9 @@
* arch/mips/ddb5074/nile4.c -- NEC Vrc-5074 Nile 4 support routines
*
* Copyright (C) 2000 Geert Uytterhoeven
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: nile4.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
+ * $Id$
*/
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/pci-dma.c linux/arch/mips/ddb5074/pci-dma.c
--- v2.3.99-pre8/linux/arch/mips/ddb5074/pci-dma.c Wed Dec 31 16:00:00 1969
+++ linux/arch/mips/ddb5074/pci-dma.c Sat May 13 08:29:14 2000
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2000 Ani Joshi
+ *
+ *
+ * Dynamic DMA mapping support.
+ *
+ * swiped from i386, and cloned for MIPS by Geert.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
+ dma_addr_t *dma_handle)
+{
+ void *ret;
+ int gfp = GFP_ATOMIC;
+
+ if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
+ gfp |= GFP_DMA;
+ ret = (void *)__get_free_pages(gfp, get_order(size));
+
+ if (ret != NULL) {
+ memset(ret, 0, size);
+ *dma_handle = virt_to_bus(ret);
+ }
+ return ret;
+}
+
+void pci_free_consistent(struct pci_dev *hwdev, size_t size,
+ void *vaddr, dma_addr_t dma_handle)
+{
+ free_pages((unsigned long)vaddr, get_order(size));
+}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/pci.c linux/arch/mips/ddb5074/pci.c
--- v2.3.99-pre8/linux/arch/mips/ddb5074/pci.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips/ddb5074/pci.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 2000 Geert Uytterhoeven
* Albert Dorofeev
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
* $Id: pci.c,v 1.4 2000/02/18 00:02:17 ralf Exp $
*/
@@ -168,163 +168,136 @@
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;
+ bus->resource[1] = &ddb5074_resources.pci_mem;
+}
- where = PCI_BASE_ADDRESS_0 + (resource * 4);
- size = res->end - res->start;
- pci_read_config_dword(dev, where, ®);
- reg = (reg & size) | (((u32)(res->start - root->start)) & ~size);
- pci_write_config_dword(dev, where, reg);
+char *pcibios_setup (char *str)
+{
+ return str;
}
void __init pcibios_update_irq(struct pci_dev *dev, int irq)
@@ -341,15 +314,85 @@
ranges->mem_end -= bus->resource[1]->start;
}
-int __init pcibios_enable_device(struct pci_dev *dev)
+int pcibios_enable_resources(struct pci_dev *dev)
{
- printk("pcibios_enable_device for %04x:%04x\n", dev->vendor, dev->device);
- panic("pcibios_enable_device: not yet implemented\n");
+ 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)
+{
+ struct pci_dev *dev = data;
+
+ if (res->flags & IORESOURCE_IO) {
+ unsigned long start = res->start;
+
+ /* We need to avoid collisions with `mirrored' VGA ports
+ and other strange ISA hardware, so we always want the
+ addresses kilobyte aligned. */
+ if (size > 0x100) {
+ printk(KERN_ERR "PCI: I/O Region %s/%d too large"
+ " (%ld bytes)\n", dev->slot_name,
+ dev->resource - res, size);
+ }
+
+ start = (start + 1024 - 1) & ~(1024 - 1);
+ res->start = start;
+ }
}
-void __init pcibios_align_resource(void *data, struct resource *res,
- unsigned long size)
-{}
struct pci_fixup pcibios_fixups[] = {};
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/prom.c linux/arch/mips/ddb5074/prom.c
--- v2.3.99-pre8/linux/arch/mips/ddb5074/prom.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/ddb5074/prom.c Sat May 13 08:29:14 2000
@@ -2,9 +2,9 @@
* arch/mips/ddb5074/prom.c -- NEC DDB Vrc-5074 PROM routines
*
* Copyright (C) 2000 Geert Uytterhoeven
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: prom.c,v 1.2 2000/02/14 17:07:36 ralf Exp $
+ * $Id: prom.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/setup.c linux/arch/mips/ddb5074/setup.c
--- v2.3.99-pre8/linux/arch/mips/ddb5074/setup.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/ddb5074/setup.c Sat May 13 08:29:14 2000
@@ -2,9 +2,9 @@
* arch/mips/ddb5074/setup.c -- NEC DDB Vrc-5074 setup routines
*
* Copyright (C) 2000 Geert Uytterhoeven
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
- * $Id: setup.c,v 1.2 2000/02/14 17:07:36 ralf Exp $
+ * $Id: setup.c,v 1.1 2000/01/26 00:07:44 ralf Exp $
*/
#include
@@ -40,12 +40,12 @@
extern 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 @@
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 @@
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 @@
_machine_power_off = ddb_machine_power_off;
rtc_ops = &ddb_rtc_ops;
+
+ /* Reboot on panic */
+ panic_timeout = 180;
}
int __init page_is_ram(unsigned long pagenr)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/ddb5074/time.c linux/arch/mips/ddb5074/time.c
--- v2.3.99-pre8/linux/arch/mips/ddb5074/time.c Sat Feb 26 22:31:39 2000
+++ linux/arch/mips/ddb5074/time.c Sat May 13 08:29:14 2000
@@ -1,8 +1,8 @@
/*
- * arch.mips/ddb5074/time.c -- Timer routines
+ * arch/mips/ddb5074/time.c -- Timer routines
*
* Copyright (C) 2000 Geert Uytterhoeven
- * Sony Suprastructure Center Europe (SUPC-E), Brussels
+ * Sony Software Development Center Europe (SDCE), Brussels
*
* $Id*
*/
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/dec/irq.c linux/arch/mips/dec/irq.c
--- v2.3.99-pre8/linux/arch/mips/dec/irq.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/dec/irq.c Sat May 13 08:29:14 2000
@@ -31,6 +31,8 @@
extern volatile unsigned int *imr; /* address of the interrupt mask register */
extern decint_t dec_interrupt[NR_INTS];
+irq_cpustat_t irq_stat [NR_CPUS];
+
unsigned int local_bh_count[NR_CPUS];
unsigned int local_irq_count[NR_CPUS];
unsigned long spurious_count = 0;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/dec/prom/Makefile linux/arch/mips/dec/prom/Makefile
--- v2.3.99-pre8/linux/arch/mips/dec/prom/Makefile Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/dec/prom/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 2000/02/05 06:47:08 ralf Exp $
+# $Id: Makefile,v 1.1 1999/01/17 03:49:44 ralf Exp $
# Makefile for the DECstation prom monitor library routines
# under Linux.
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/dec/prom/init.c linux/arch/mips/dec/prom/init.c
--- v2.3.99-pre8/linux/arch/mips/dec/prom/init.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/dec/prom/init.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1998 Harald Koerfgen
*
- * $Id: init.c,v 1.4 1999/10/09 00:00:58 ralf Exp $
+ * $Id: init.c,v 1.3 1999/08/09 19:43:13 harald Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/dec/prom/memory.c linux/arch/mips/dec/prom/memory.c
--- v2.3.99-pre8/linux/arch/mips/dec/prom/memory.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/dec/prom/memory.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1998 Harald Koerfgen, Frieder Streffer and Paul M. Antoine
*
- * $Id: memory.c,v 1.4 2000/02/13 20:52:05 harald Exp $
+ * $Id: memory.c,v 1.3 1999/10/09 00:00:58 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/dec/reset.c linux/arch/mips/dec/reset.c
--- v2.3.99-pre8/linux/arch/mips/dec/reset.c Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/dec/reset.c Sat May 13 08:29:14 2000
@@ -1,5 +1,5 @@
/*
- * $Id: reset.c,v 1.4 1999/04/11 17:06:16 harald Exp $
+ * $Id: $
*
* Reset a DECstation machine.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/dec/rtc-dec.c linux/arch/mips/dec/rtc-dec.c
--- v2.3.99-pre8/linux/arch/mips/dec/rtc-dec.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/dec/rtc-dec.c Sat May 13 08:29:14 2000
@@ -1,5 +1,5 @@
-/* $Id: rtc-dec.c,v 1.1 1999/01/17 03:49:42 ralf Exp $
+/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 ralf Exp $
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/dec/serial.c linux/arch/mips/dec/serial.c
--- v2.3.99-pre8/linux/arch/mips/dec/serial.c Tue Aug 31 17:29:12 1999
+++ linux/arch/mips/dec/serial.c Sat May 13 08:29:14 2000
@@ -31,11 +31,11 @@
#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 @@
#endif
}
+__initcall(rs_init);
+
#endif
#ifdef CONFIG_SERIAL_CONSOLE
@@ -73,26 +75,24 @@
/* serial_console_init handles the special case of starting
* up the console on the serial port
*/
-long __init serial_console_init(long kmem_start, long kmem_end)
+void __init serial_console_init(void)
{
#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
if (IOASIC)
- kmem_start = zs_serial_console_init(kmem_start, kmem_end);
+ zs_serial_console_init();
else
- kmem_start = dz_serial_console_init(kmem_start, kmem_end);
+ dz_serial_console_init();
#else
#ifdef CONFIG_ZS
- kmem_start = zs_serial_console_init(kmem_start, kmem_end);
+ zs_serial_console_init();
#endif
#ifdef CONFIG_DZ
- kmem_start = dz_serial_console_init(kmem_start, kmem_end);
+ dz_serial_console_init();
#endif
#endif
-
- return kmem_start;
}
#endif
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/defconfig linux/arch/mips/defconfig
--- v2.3.99-pre8/linux/arch/mips/defconfig Thu May 11 15:30:06 2000
+++ linux/arch/mips/defconfig Sat May 13 08:29:14 2000
@@ -20,8 +20,9 @@
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_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_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
@@ -134,13 +136,6 @@
# 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
#
CONFIG_SCSI=y
@@ -174,12 +169,12 @@
# 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_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_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_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_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_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_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,8 +318,14 @@
# SGI devices
#
CONFIG_SGI_SERIAL=y
+# CONFIG_SERIAL_CONSOLE is not set
CONFIG_SGI_DS1286=y
# CONFIG_SGI_NEWPORT_GFX is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
#
# Kernel hacking
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/defconfig-decstation linux/arch/mips/defconfig-decstation
--- v2.3.99-pre8/linux/arch/mips/defconfig-decstation Fri Mar 10 16:40:40 2000
+++ linux/arch/mips/defconfig-decstation Sat May 13 08:29:14 2000
@@ -1,5 +1,5 @@
#
-# Automatically generated by make menuconfig: don't edit
+# Automatically generated make config: don't edit
#
#
@@ -19,6 +19,9 @@
# 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_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_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_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_DECLANCE=y
#
-# DECstation Character devices
+# DECStation Character devices
#
# CONFIG_VT is not set
CONFIG_SERIAL=y
@@ -177,29 +214,26 @@
# 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_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_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_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
@@ -249,6 +297,11 @@
CONFIG_ULTRIX_PARTITION=y
# CONFIG_SUN_PARTITION is not set
# CONFIG_NLS is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
#
# Kernel hacking
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/defconfig-ip22 linux/arch/mips/defconfig-ip22
--- v2.3.99-pre8/linux/arch/mips/defconfig-ip22 Thu May 11 15:30:06 2000
+++ linux/arch/mips/defconfig-ip22 Sat May 13 08:29:14 2000
@@ -19,6 +19,10 @@
# 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_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
@@ -142,12 +136,6 @@
# CONFIG_NET_SCHED is not set
#
-# Telephony Support
-#
-# CONFIG_PHONE is not set
-# CONFIG_PHONE_IXJ is not set
-
-#
# SCSI support
#
CONFIG_SCSI=y
@@ -158,7 +146,6 @@
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_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_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_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_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_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_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_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,8 +318,14 @@
# SGI devices
#
CONFIG_SGI_SERIAL=y
+# CONFIG_SERIAL_CONSOLE is not set
CONFIG_SGI_DS1286=y
# CONFIG_SGI_NEWPORT_GFX is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
#
# Kernel hacking
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/jazz/Makefile linux/arch/mips/jazz/Makefile
--- v2.3.99-pre8/linux/arch/mips/jazz/Makefile Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/jazz/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 1999/02/25 21:57:01 tsbogend Exp $
+# $Id: Makefile,v 1.5 1999/01/03 17:50:47 ralf Exp $
#
# Makefile for the Jazz family specific parts of the kernel
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/jazz/floppy-jazz.c linux/arch/mips/jazz/floppy-jazz.c
--- v2.3.99-pre8/linux/arch/mips/jazz/floppy-jazz.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/jazz/floppy-jazz.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: floppy-jazz.c,v 1.3 2000/02/24 00:12:40 ralf Exp $
+/* $Id: floppy-jazz.c,v 1.2 1998/10/18 13:18:25 tsbogend Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/jazz/int-handler.S linux/arch/mips/jazz/int-handler.S
--- v2.3.99-pre8/linux/arch/mips/jazz/int-handler.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/jazz/int-handler.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: int-handler.S,v 1.15 1999/08/18 23:37:43 ralf Exp $
+/* $Id: int-handler.S,v 1.14 1999/05/01 22:40:34 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/jazz/kbd-jazz.c linux/arch/mips/jazz/kbd-jazz.c
--- v2.3.99-pre8/linux/arch/mips/jazz/kbd-jazz.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/jazz/kbd-jazz.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: kbd-jazz.c,v 1.1 1999/01/03 17:50:48 ralf Exp $
+/* $Id: kbd-jazz.c,v 1.1 1998/10/28 12:38:10 ralf Exp $
*
* Low-level hardware access stuff for Jazz family machines.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/jazz/reset.c linux/arch/mips/jazz/reset.c
--- v2.3.99-pre8/linux/arch/mips/jazz/reset.c Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/jazz/reset.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Reset a Jazz machine.
*
- * $Id: reset.c,v 1.3 1998/03/04 08:29:10 ralf Exp $
+ * $Id:$
*/
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/jazz/rtc-jazz.c linux/arch/mips/jazz/rtc-jazz.c
--- v2.3.99-pre8/linux/arch/mips/jazz/rtc-jazz.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/jazz/rtc-jazz.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: rtc-jazz.c,v 1.2 1998/08/26 21:46:38 tsbogend Exp $
+/* $Id: rtc-jazz.c,v 1.2 1998/06/25 20:19:14 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/jazz/setup.c linux/arch/mips/jazz/setup.c
--- v2.3.99-pre8/linux/arch/mips/jazz/setup.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/jazz/setup.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.25 2000/01/27 01:05:23 ralf Exp $
+/* $Id: setup.c,v 1.24 1999/10/09 00:00:58 ralf Exp $
*
* Setup pointers to hardware-dependent routines.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/Makefile linux/arch/mips/kernel/Makefile
--- v2.3.99-pre8/linux/arch/mips/kernel/Makefile Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.15 2000/01/26 00:07:44 ralf Exp $
+# $Id: Makefile,v 1.14 1999/10/09 00:00:58 ralf Exp $
#
# Makefile for the Linux/MIPS kernel.
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/entry.S linux/arch/mips/kernel/entry.S
--- v2.3.99-pre8/linux/arch/mips/kernel/entry.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/entry.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.20 2000/02/23 00:41:00 ralf Exp $
+/* $Id: entry.S,v 1.19 1999/12/08 22:05:10 harald Exp $
*
* Low level exception handling
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/fpe.c linux/arch/mips/kernel/fpe.c
--- v2.3.99-pre8/linux/arch/mips/kernel/fpe.c Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/kernel/fpe.c Sat May 13 08:29:14 2000
@@ -6,7 +6,7 @@
*
* Copyright (C) 1997 Ralf Baechle
*
- * $Id: fpe.c,v 1.4 1999/05/01 22:40:35 ralf Exp $
+ * $Id: fpe.c,v 1.3 1998/04/05 11:23:50 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/gdb-low.S linux/arch/mips/kernel/gdb-low.S
--- v2.3.99-pre8/linux/arch/mips/kernel/gdb-low.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/gdb-low.S Sat May 13 08:29:14 2000
@@ -5,7 +5,7 @@
*
* Copyright (C) 1995 Andreas Busse
*
- * $Id: gdb-low.S,v 1.5 1999/08/18 23:37:43 ralf Exp $
+ * $Id: gdb-low.S,v 1.4 1997/12/01 17:57:26 ralf Exp $
*/
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/gdb-stub.c linux/arch/mips/kernel/gdb-stub.c
--- v2.3.99-pre8/linux/arch/mips/kernel/gdb-stub.c Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/kernel/gdb-stub.c Sat May 13 08:29:14 2000
@@ -12,7 +12,7 @@
*
* Copyright (C) 1995 Andreas Busse
*
- * $Id: gdb-stub.c,v 1.7 1999/06/12 18:39:28 ulfc Exp $
+ * $Id: gdb-stub.c,v 1.6 1999/05/01 22:40:35 ralf Exp $
*/
/*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/head.S linux/arch/mips/kernel/head.S
--- v2.3.99-pre8/linux/arch/mips/kernel/head.S Thu May 11 15:30:06 2000
+++ linux/arch/mips/kernel/head.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: head.S,v 1.17 1999/12/04 03:58:59 ralf Exp $
+/* $Id: head.S,v 1.18 2000/03/03 22:17:07 kevink Exp $
*
* arch/mips/kernel/head.S
*
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
.text
/*
@@ -101,7 +100,7 @@
eret
END(except_vec0_r4600)
- /* TLB refill, EXL == 0, R4xx0, non-R4600 version */
+ /* TLB refill, EXL == 0, R52x0 "Nevada" version */
.set noreorder
.set noat
LEAF(except_vec0_nevada)
@@ -122,9 +121,10 @@
mtc0 k0, CP0_ENTRYLO0 # load it
srl k1, k1, 6 # convert to entrylo1
mtc0 k1, CP0_ENTRYLO1 # load it
- tlbwr # write random tlb entry
- nop
+ nop # QED specified nops
nop
+ tlbwr # write random tlb entry
+ nop # traditional nop
eret # return from trap
END(except_vec0_nevada)
@@ -393,12 +393,6 @@
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,166 +414,9 @@
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
+ jal init_arch
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
- nop
- /*
- * Main should never return here, but
- * just in case, we know what happens.
- */
- b 1b
- nop # delay slot
END(kernel_entry)
-
- /* CPU type probing code, called at Kernel entry. */
- LEAF(cpu_probe)
- mfc0 t0, CP0_PRID
- la t3, mips_cputype
- andi t1, t0, 0xff00
- li t2, PRID_IMP_R2000
- bne t1, t2, 1f
- andi t0, 0x00ff
-
- li t2, CPU_R2000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R3000
- bne t1, t2, 1f
- nop
-
- li t2, PRID_REV_R3000A
- bne t0, t2, 9f
- nop
-
- li t2, CPU_R3000A
- b probe_done
- sw t2, (t3)
-9:
- li t2, CPU_R3000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R6000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R6000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4000
- bne t1, t2, 1f
- nop
-
- li t2, PRID_REV_R4400
- bne t0, t2, 9f
- nop
-
- li t2, CPU_R4400SC
- b probe_done
- sw t2, (t3)
-9:
- li t2, CPU_R4000SC
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R6000A
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R6000A
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R10000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R10000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R8000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R8000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4600
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R4600
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4700
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R4700
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R4650
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R4650
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_R5000
- bne t1, t2, 1f
- nop
-
- li t2, CPU_R5000
- b probe_done
- sw t2, (t3)
-1:
- li t2, PRID_IMP_NEVADA
- bne t1, t2, 1f
- nop
-
- li t2, CPU_NEVADA
- b probe_done
- sw t2, (t3)
-1:
- li t2, CPU_UNKNOWN
- sw t2, (t3)
-
- b probe_done
- nop
- END(cpu_probe)
/*
* This buffer is reserved for the use of the cache error handler.
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/irix5sys.h linux/arch/mips/kernel/irix5sys.h
--- v2.3.99-pre8/linux/arch/mips/kernel/irix5sys.h Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/kernel/irix5sys.h Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: irix5sys.h,v 1.2 1998/08/25 09:14:39 ralf Exp $
+/* $Id: irix5sys.h,v 1.2 1998/08/17 10:16:25 ralf Exp $
*
* irix5sys.h: 32-bit IRIX5 ABI system call table.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/irixelf.c linux/arch/mips/kernel/irixelf.c
--- v2.3.99-pre8/linux/arch/mips/kernel/irixelf.c Wed Apr 26 16:34:06 2000
+++ linux/arch/mips/kernel/irixelf.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: irixelf.c,v 1.24 2000/02/04 07:40:23 ralf Exp $
+/* $Id: irixelf.c,v 1.28 2000/03/23 02:25:42 ralf Exp $
*
* irixelf.c: Code to load IRIX ELF executables which conform to
* the MIPS ABI.
@@ -29,6 +29,7 @@
#include
#include
#include
+#include
#include
#include
@@ -253,10 +254,10 @@
#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 @@
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 @@
fput(interp);
- if(*eentry == 0xffffffff)
+ if (*eentry == 0xffffffff)
return -1;
}
return 0;
@@ -655,10 +655,10 @@
&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 @@
up(¤t->mm->mmap_sem);
k = elf_phdata->p_vaddr + elf_phdata->p_filesz;
- if(k > elf_bss) elf_bss = k;
-
+ if (k > elf_bss) elf_bss = k;
+
if (error != (elf_phdata->p_vaddr & 0xfffff000)) {
kfree(elf_phdata);
return error;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/irixinv.c linux/arch/mips/kernel/irixinv.c
--- v2.3.99-pre8/linux/arch/mips/kernel/irixinv.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/irixinv.c Sat May 13 08:29:14 2000
@@ -5,7 +5,7 @@
*
* Miguel de Icaza, 1997.
*
- * $Id: irixinv.c,v 1.4 1999/10/09 00:00:58 ralf Exp $
+ * $Id: irixinv.c,v 1.3 1998/04/05 11:23:51 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/irixioctl.c linux/arch/mips/kernel/irixioctl.c
--- v2.3.99-pre8/linux/arch/mips/kernel/irixioctl.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/irixioctl.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: irixioctl.c,v 1.7 1999/09/28 22:25:46 ralf Exp $
+/* $Id: irixioctl.c,v 1.6 1999/02/06 05:12:56 adevries Exp $
* irixioctl.c: A fucking mess...
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/irixsig.c linux/arch/mips/kernel/irixsig.c
--- v2.3.99-pre8/linux/arch/mips/kernel/irixsig.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/irixsig.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: irixsig.c,v 1.14 2000/01/17 03:58:59 ralf Exp $
+ * $Id: irixsig.c,v 1.13 1999/10/09 00:00:58 ralf Exp $
*/
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/irq.c linux/arch/mips/kernel/irq.c
--- v2.3.99-pre8/linux/arch/mips/kernel/irq.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/irq.c Sat May 13 08:29:14 2000
@@ -32,6 +32,24 @@
#include
/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the apropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+irq_cpustat_t irq_stat [NR_CPUS];
+
+/*
* This contains the irq mask for both 8259A irq controllers, it's an
* int so we can deal with the third PIC in some systems like the RM300.
* (XXX This is broken for big endian.)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/mips_ksyms.c linux/arch/mips/kernel/mips_ksyms.c
--- v2.3.99-pre8/linux/arch/mips/kernel/mips_ksyms.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/mips_ksyms.c Sat May 13 08:29:14 2000
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -56,8 +57,6 @@
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);
@@ -87,6 +86,13 @@
EXPORT_SYMBOL(_dma_cache_inv);
EXPORT_SYMBOL(invalid_pte_table);
+
+/*
+ * Semaphore stuff
+ */
+EXPORT_SYMBOL(__down_read);
+EXPORT_SYMBOL(__down_write);
+EXPORT_SYMBOL(__rwsem_wake);
/*
* Base address of ports for Intel style I/O.
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/proc.c linux/arch/mips/kernel/proc.c
--- v2.3.99-pre8/linux/arch/mips/kernel/proc.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/proc.c Sat May 13 08:29:14 2000
@@ -34,6 +34,7 @@
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 @@
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 @@
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",
@@ -82,4 +84,9 @@
len += sprintf(buffer + len, fmt, 'I', vcei_count);
return len;
+}
+
+void init_irq_proc(void)
+{
+ /* Nothing, for now. */
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/process.c linux/arch/mips/kernel/process.c
--- v2.3.99-pre8/linux/arch/mips/kernel/process.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/process.c Sat May 13 08:29:14 2000
@@ -40,10 +40,8 @@
while (1) {
while (!current->need_resched)
- if (wait_available)
- __asm__(".set\tmips3\n\t"
- "wait\n\t"
- ".set\tmips0");
+ if (cpu_wait)
+ (*cpu_wait)();
schedule();
check_pgt_cache();
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/ptrace.c linux/arch/mips/kernel/ptrace.c
--- v2.3.99-pre8/linux/arch/mips/kernel/ptrace.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/ptrace.c Sat May 13 08:29:14 2000
@@ -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 @@
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 @@
(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 @@
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 @@
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 @@
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 @@
* perhaps it should be put in the status that it wants to
* exit.
*/
- case PTRACE_KILL: {
- if (child->state != TASK_ZOMBIE) {
- child->exit_code = SIGKILL;
- wake_up_process(child);
- }
+ case PTRACE_KILL:
res = 0;
- goto out;
- }
+ if (child->state != TASK_ZOMBIE) /* already dead */
+ break;
+ child->exit_code = SIGKILL;
+ wake_up_process(child);
+ break;
- case PTRACE_DETACH: { /* detach a process that was attached. */
- if ((unsigned long) data > _NSIG) {
- res = -EIO;
- goto out;
- }
+ case PTRACE_DETACH: /* detach a process that was attached. */
+ res = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->exit_code = data;
+ write_lock_irq(&tasklist_lock);
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
SET_LINKS(child);
+ write_unlock_irq(&tasklist_lock);
wake_up_process(child);
res = 0;
- goto out;
- }
+ break;
default:
res = -EIO;
goto out;
}
+out_tsk:
+ free_task_struct(child);
out:
unlock_kernel();
return res;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/r2300_fpu.S linux/arch/mips/kernel/r2300_fpu.S
--- v2.3.99-pre8/linux/arch/mips/kernel/r2300_fpu.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/r2300_fpu.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: r2300_fpu.S,v 1.7 1999/09/28 22:25:47 ralf Exp $
+/* $Id: r2300_fpu.S,v 1.6 1999/08/09 19:43:14 harald Exp $
*
* r2300_fpu.S: Save/restore floating point context for signal handlers.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/r2300_switch.S linux/arch/mips/kernel/r2300_switch.S
--- v2.3.99-pre8/linux/arch/mips/kernel/r2300_switch.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/r2300_switch.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: r2300_switch.S,v 1.9 1999/10/12 17:33:49 harald Exp $
+/* $Id: r2300_switch.S,v 1.8 1999/08/18 23:37:44 ralf Exp $
*
* r2300_switch.S: R2300 specific task switching code.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/r4k_fpu.S linux/arch/mips/kernel/r4k_fpu.S
--- v2.3.99-pre8/linux/arch/mips/kernel/r4k_fpu.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/r4k_fpu.S Sat May 13 08:29:14 2000
@@ -32,7 +32,6 @@
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 @@
* Restore the 16 even double precision registers
* when cp1 was enabled in the cp0 status register.
*/
-1: EX(ldc1 $f0,(SC_FPREGS+0)(a0))
+ EX(ldc1 $f0,(SC_FPREGS+0)(a0))
EX(ldc1 $f2,(SC_FPREGS+16)(a0))
EX(ldc1 $f4,(SC_FPREGS+32)(a0))
EX(ldc1 $f6,(SC_FPREGS+48)(a0))
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/r4k_misc.S linux/arch/mips/kernel/r4k_misc.S
--- v2.3.99-pre8/linux/arch/mips/kernel/r4k_misc.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/r4k_misc.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: r4k_misc.S,v 1.9 1999/12/04 03:59:00 ralf Exp $
+/* $Id: r4k_misc.S,v 1.8 1999/10/09 00:00:58 ralf Exp $
*
* r4k_misc.S: Misc. exception handling code for r4k.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/r4k_switch.S linux/arch/mips/kernel/r4k_switch.S
--- v2.3.99-pre8/linux/arch/mips/kernel/r4k_switch.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/r4k_switch.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: r4k_switch.S,v 1.10 1999/10/09 00:00:58 ralf Exp $
+/* $Id: r4k_switch.S,v 1.9 1999/08/18 23:37:44 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/r6000_fpu.S linux/arch/mips/kernel/r6000_fpu.S
--- v2.3.99-pre8/linux/arch/mips/kernel/r6000_fpu.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/r6000_fpu.S Sat May 13 08:29:14 2000
@@ -10,7 +10,7 @@
* Multi-arch abstraction and asm macros for easier reading:
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: r6000_fpu.S,v 1.6 1999/08/09 19:43:15 harald Exp $
+ * $Id: r6000_fpu.S,v 1.5 1999/05/01 22:40:37 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/scall_o32.S linux/arch/mips/kernel/scall_o32.S
--- v2.3.99-pre8/linux/arch/mips/kernel/scall_o32.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/scall_o32.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: scall_o32.S,v 1.11 2000/02/23 01:33:55 ralf Exp $
+/* $Id: scall_o32.S,v 1.10 2000/02/23 00:41:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/setup.c linux/arch/mips/kernel/setup.c
--- v2.3.99-pre8/linux/arch/mips/kernel/setup.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/setup.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.22 2000/01/27 01:05:23 ralf Exp $
+/* $Id: setup.c,v 1.28 2000/03/13 22:21:44 harald Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -39,6 +39,7 @@
#include
#include
#include
+#include
#ifdef CONFIG_SGI_IP22
#include
#endif
@@ -46,11 +47,13 @@
struct mips_cpuinfo boot_cpu_data = { NULL, NULL, 0 };
/*
- * Not all of the MIPS CPUs have the "wait" instruction available. This
- * is set to true if it is available. The wait instruction stops the
- * pipeline and reduces the power consumption of the CPU very much.
+ * Not all of the MIPS CPUs have the "wait" instruction available. Moreover,
+ * the implementation of the "wait" feature differs between CPU families. This
+ * points to the function that implements CPU specific wait.
+ * The wait instruction stops the pipeline and reduces the power consumption of
+ * the CPU very much.
*/
-char wait_available;
+void (*cpu_wait)(void) = NULL;
/*
* Do we have a cyclecounter available?
@@ -119,6 +122,125 @@
*/
unsigned long 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 @@
switch(mips_machgroup)
{
#ifdef CONFIG_BAGET_MIPS
- case MACH_GROUP_UNKNOWN:
+ case MACH_GROUP_BAGET:
baget_setup();
break;
#endif
@@ -220,4 +342,19 @@
*memory_start_p = initrd_end;
}
#endif
+
+ paging_init();
+}
+
+void r3081_wait(void)
+{
+ unsigned long cfg = read_32bit_cp0_register(CP0_CONF);
+ write_32bit_cp0_register(CP0_CONF, cfg|CONF_HALT);
+}
+
+void r4k_wait(void)
+{
+ __asm__(".set\tmips3\n\t"
+ "wait\n\t"
+ ".set\tmips0");
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/signal.c linux/arch/mips/kernel/signal.c
--- v2.3.99-pre8/linux/arch/mips/kernel/signal.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/signal.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.25 2000/02/05 06:47:08 ralf Exp $
+/* $Id: signal.c,v 1.24 2000/02/04 07:40:23 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/softfp.S linux/arch/mips/kernel/softfp.S
--- v2.3.99-pre8/linux/arch/mips/kernel/softfp.S Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/kernel/softfp.S Sat May 13 08:29:14 2000
@@ -147,7 +147,7 @@
insn: LOCK_KERNEL; \
la a1, 8f; \
TEXT(#insn); \
- la a1, nosim; \
+ la a0, nosim; \
UNLOCK_KERNEL; \
j done
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/syscall.c linux/arch/mips/kernel/syscall.c
--- v2.3.99-pre8/linux/arch/mips/kernel/syscall.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/syscall.c Sat May 13 08:29:14 2000
@@ -129,7 +129,6 @@
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 @@
putname(filename);
out:
- unlock_kernel();
return error;
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/syscalls.h linux/arch/mips/kernel/syscalls.h
--- v2.3.99-pre8/linux/arch/mips/kernel/syscalls.h Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/syscalls.h Sat May 13 08:29:14 2000
@@ -44,7 +44,7 @@
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_lstat64, 3)
SYS(sys_fstat64, 3) /* 4215 */
SYS(sys_pivot_root, 2)
+SYS(sys_mincore, 3)
+SYS(sys_madvise, 3)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/sysirix.c linux/arch/mips/kernel/sysirix.c
--- v2.3.99-pre8/linux/arch/mips/kernel/sysirix.c Thu May 11 15:30:06 2000
+++ linux/arch/mips/kernel/sysirix.c Sat May 13 08:29:14 2000
@@ -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 @@
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 @@
putname(filename);
out:
- unlock_kernel();
return error;
}
@@ -1491,10 +1489,10 @@
printk("[%s:%ld] Wheee.. irix_statvfs(%s,%p)\n",
current->comm, current->pid, fname, buf);
error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
- if(error)
+ if (error)
goto out;
error = user_path_walk(fname, &nd);
- if (err)
+ if (error)
goto out;
error = vfs_statfs(nd.dentry->d_inode->i_sb, &kbuf);
if (error)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/sysmips.c linux/arch/mips/kernel/sysmips.c
--- v2.3.99-pre8/linux/arch/mips/kernel/sysmips.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/sysmips.c Sat May 13 08:29:14 2000
@@ -7,7 +7,7 @@
*
* Copyright (C) 1995, 1996, 1997 by Ralf Baechle
*
- * $Id: sysmips.c,v 1.9 2000/02/18 00:24:30 ralf Exp $
+ * $Id: sysmips.c,v 1.8 2000/02/05 06:47:08 ralf Exp $
*/
#include
#include
@@ -123,4 +123,11 @@
sys_cachectl(char *addr, int nbytes, int op)
{
return -ENOSYS;
+}
+
+asmlinkage int sys_pause(void)
+{
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ return -ERESTARTNOHAND;
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
--- v2.3.99-pre8/linux/arch/mips/kernel/traps.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/traps.c Sat May 13 08:29:14 2000
@@ -1,12 +1,13 @@
-/* $Id: traps.c,v 1.27 2000/01/16 01:29:05 ralf Exp $
+/* $Id: traps.c,v 1.28 2000/03/13 10:33:02 raiko Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright 1994, 1995, 1996, 1997, 1998 by Ralf Baechle
+ * Copyright (C) 1994 - 1999 by Ralf Baechle
* Modified for R3000 by Paul M. Antoine, 1995, 1996
* Complete output from die() by Ulf Carlsson, 1998
+ * Copyright (C) 1999 Silicon Graphics, Inc.
*/
#include
#include
@@ -226,8 +227,50 @@
__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 @@
{
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 @@
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 @@
memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic,
0x80);
}
-
break;
case CPU_R6000:
@@ -718,14 +759,14 @@
case CPU_R2000:
case CPU_R3000:
case CPU_R3000A:
- memcpy((void *)KSEG0, &except_vec0_r2300, 0x80);
- memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80);
- break;
case CPU_R3041:
case CPU_R3051:
case CPU_R3052:
case CPU_R3081:
case CPU_R3081E:
+ memcpy((void *)KSEG0, &except_vec0_r2300, 0x80);
+ memcpy((void *)(KSEG0 + 0x80), &except_vec3_generic, 0x80);
+ break;
case CPU_R8000:
printk("Detected unsupported CPU type %s.\n",
cpu_names[mips_cputype]);
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/kernel/unaligned.c linux/arch/mips/kernel/unaligned.c
--- v2.3.99-pre8/linux/arch/mips/kernel/unaligned.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/kernel/unaligned.c Sat May 13 08:29:14 2000
@@ -7,8 +7,7 @@
* for more details.
*
* Copyright (C) 1996, 1998 by Ralf Baechle
- *
- * $Id: unaligned.c,v 1.7 1999/12/04 03:59:00 ralf Exp $
+ * Copyright (C) 1999 Silicon Graphics, Inc.
*
* This file contains exception handler for address error exception with the
* special capability to execute faulting instructions in software. The
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/Makefile linux/arch/mips/lib/Makefile
--- v2.3.99-pre8/linux/arch/mips/lib/Makefile Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.12 1999/12/04 03:59:00 ralf Exp $
+# $Id: Makefile,v 1.11 1999/10/17 19:55:22 harald Exp $
#
# Makefile for MIPS-specific library files..
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/csum_partial.S linux/arch/mips/lib/csum_partial.S
--- v2.3.99-pre8/linux/arch/mips/lib/csum_partial.S Fri Jun 25 17:40:12 1999
+++ linux/arch/mips/lib/csum_partial.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: csum_partial.S,v 1.2 1998/05/07 23:44:01 ralf Exp $
+/* $Id: csum_partial.S,v 1.1 1998/05/04 09:12:52 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/csum_partial_copy.c linux/arch/mips/lib/csum_partial_copy.c
--- v2.3.99-pre8/linux/arch/mips/lib/csum_partial_copy.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/csum_partial_copy.c Sat May 13 08:29:14 2000
@@ -14,7 +14,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * $Id: csum_partial_copy.c,v 1.3 2000/02/05 06:47:08 ralf Exp $
+ * $Id: csum_partial_copy.c,v 1.2 1998/09/19 19:16:17 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/floppy-no.c linux/arch/mips/lib/floppy-no.c
--- v2.3.99-pre8/linux/arch/mips/lib/floppy-no.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/floppy-no.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: floppy-no.c,v 1.1 1998/06/30 00:21:54 ralf Exp $
+/* $Id: floppy-no.c,v 1.1 1998/05/07 18:38:32 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/floppy-std.c linux/arch/mips/lib/floppy-std.c
--- v2.3.99-pre8/linux/arch/mips/lib/floppy-std.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/floppy-std.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: floppy-std.c,v 1.3 2000/02/24 00:12:40 ralf Exp $
+/* $Id: floppy-std.c,v 1.2 1999/01/04 16:03:51 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/ide-no.c linux/arch/mips/lib/ide-no.c
--- v2.3.99-pre8/linux/arch/mips/lib/ide-no.c Fri Jun 25 17:40:13 1999
+++ linux/arch/mips/lib/ide-no.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: ide-no.c,v 1.3 1999/06/17 13:25:49 ralf Exp $
+/* $Id: ide-no.c,v 1.2 1998/06/30 00:21:54 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/ide-std.c linux/arch/mips/lib/ide-std.c
--- v2.3.99-pre8/linux/arch/mips/lib/ide-std.c Fri Jun 25 17:40:13 1999
+++ linux/arch/mips/lib/ide-std.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: ide-std.c,v 1.4 1999/06/17 13:25:49 ralf Exp $
+/* $Id: ide-std.c,v 1.4 1999/06/11 14:29:45 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/kbd-no.c linux/arch/mips/lib/kbd-no.c
--- v2.3.99-pre8/linux/arch/mips/lib/kbd-no.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/kbd-no.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: kbd-no.c,v 1.1 1999/01/04 16:03:51 ralf Exp $
+/* $Id: kbd-no.c,v 1.1 1998/10/28 12:38:14 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/kbd-std.c linux/arch/mips/lib/kbd-std.c
--- v2.3.99-pre8/linux/arch/mips/lib/kbd-std.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/kbd-std.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: kbd-std.c,v 1.2 1999/06/17 13:25:50 ralf Exp $
+/* $Id: kbd-std.c,v 1.2 1999/06/11 14:29:45 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/memcpy.S linux/arch/mips/lib/memcpy.S
--- v2.3.99-pre8/linux/arch/mips/lib/memcpy.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/memcpy.S Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * $Id: memcpy.S,v 1.4 2000/01/27 01:05:23 ralf Exp $
+ * $Id: memcpy.S,v 1.3 1998/07/10 01:14:49 ralf Exp $
*
* Unified implementation of memcpy, memmove and the __copy_user backend.
* For __rmemcpy and memmove an exception is always a kernel bug, therefore
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/memset.S linux/arch/mips/lib/memset.S
--- v2.3.99-pre8/linux/arch/mips/lib/memset.S Fri Jun 25 17:40:13 1999
+++ linux/arch/mips/lib/memset.S Sat May 13 08:29:14 2000
@@ -7,7 +7,7 @@
*
* Copyright (C) 1998 by Ralf Baechle
*
- * $Id: memset.S,v 1.1 1998/05/04 09:12:54 ralf Exp $
+ * $Id: memset.S,v 1.2 1998/04/25 17:01:45 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/r3k_dump_tlb.c linux/arch/mips/lib/r3k_dump_tlb.c
--- v2.3.99-pre8/linux/arch/mips/lib/r3k_dump_tlb.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/r3k_dump_tlb.c Sat May 13 08:29:14 2000
@@ -29,7 +29,7 @@
for(i=first;i<=last;i++)
{
- write_32bit_cp0_register(CP0_INDEX, i);
+ write_32bit_cp0_register(CP0_INDEX, i<<8);
__asm__ __volatile__(
".set\tnoreorder\n\t"
"tlbr\n\t"
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/rtc-no.c linux/arch/mips/lib/rtc-no.c
--- v2.3.99-pre8/linux/arch/mips/lib/rtc-no.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/rtc-no.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: rtc-no.c,v 1.1 1998/06/30 00:21:55 ralf Exp $
+/* $Id: rtc-no.c,v 1.2 1998/06/25 20:19:15 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/rtc-std.c linux/arch/mips/lib/rtc-std.c
--- v2.3.99-pre8/linux/arch/mips/lib/rtc-std.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/rtc-std.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: rtc-std.c,v 1.1 1998/06/30 00:21:55 ralf Exp $
+/* $Id: rtc-std.c,v 1.2 1998/06/25 20:19:16 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/strlen_user.S linux/arch/mips/lib/strlen_user.S
--- v2.3.99-pre8/linux/arch/mips/lib/strlen_user.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/strlen_user.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: strlen_user.S,v 1.4 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strlen_user.S,v 1.3 1999/08/21 22:19:11 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/strncpy_user.S linux/arch/mips/lib/strncpy_user.S
--- v2.3.99-pre8/linux/arch/mips/lib/strncpy_user.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/strncpy_user.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: strncpy_user.S,v 1.4 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strncpy_user.S,v 1.3 1999/08/21 22:19:11 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/strnlen_user.S linux/arch/mips/lib/strnlen_user.S
--- v2.3.99-pre8/linux/arch/mips/lib/strnlen_user.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/strnlen_user.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: strnlen_user.S,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strnlen_user.S,v 1.2 1999/11/19 20:35:21 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/lib/watch.S linux/arch/mips/lib/watch.S
--- v2.3.99-pre8/linux/arch/mips/lib/watch.S Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/lib/watch.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: watch.S,v 1.3 1999/08/21 22:19:11 ralf Exp $
+/* $Id$
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/mm/andes.c linux/arch/mips/mm/andes.c
--- v2.3.99-pre8/linux/arch/mips/mm/andes.c Sat Feb 26 22:31:40 2000
+++ linux/arch/mips/mm/andes.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: andes.c,v 1.11 2000/02/24 00:12:40 ralf Exp $
+/* $Id: andes.c,v 1.10 2000/02/13 20:52:05 harald Exp $
*
* andes.c: MMU and cache operations for the R10000 (ANDES).
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/mm/fault.c linux/arch/mips/mm/fault.c
--- v2.3.99-pre8/linux/arch/mips/mm/fault.c Wed Apr 26 16:34:06 2000
+++ linux/arch/mips/mm/fault.c Sat May 13 08:29:14 2000
@@ -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 @@
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
- {
- int fault = handle_mm_fault(mm, vma, address, write);
- if (fault < 0)
- goto out_of_memory;
- if (!fault)
- goto do_sigbus;
+ switch (handle_mm_fault(mm, vma, address, write)) {
+ case 1:
+ tsk->min_flt++;
+ break;
+ case 2:
+ tsk->maj_flt++;
+ break;
+ case 0:
+ goto do_sigbus;
+ default:
+ goto out_of_memory;
}
up(&mm->mmap_sem);
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/mm/init.c linux/arch/mips/mm/init.c
--- v2.3.99-pre8/linux/arch/mips/mm/init.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/mm/init.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.27 2000/02/23 01:33:56 ralf Exp $
+/* $Id: init.c,v 1.26 2000/02/23 00:41:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/mm/loadmmu.c linux/arch/mips/mm/loadmmu.c
--- v2.3.99-pre8/linux/arch/mips/mm/loadmmu.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips/mm/loadmmu.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: loadmmu.c,v 1.15 2000/02/24 00:12:40 ralf Exp $
+ * $Id: loadmmu.c,v 1.17 2000/03/13 10:33:05 raiko Exp $
*/
#include
#include
@@ -15,7 +15,6 @@
#include
#include
#include
-#include
/* memory functions */
void (*_clear_page)(void * page);
@@ -59,6 +58,7 @@
case CPU_R2000:
case CPU_R3000:
case CPU_R3000A:
+ case CPU_R3081E:
printk("Loading R[23]00 MMU routines.\n");
ld_mmu_r2300();
break;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/mm/r2300.c linux/arch/mips/mm/r2300.c
--- v2.3.99-pre8/linux/arch/mips/mm/r2300.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/mm/r2300.c Sat May 13 08:29:14 2000
@@ -7,7 +7,7 @@
* Copyright (C) 1998, 2000 Harald Koerfgen
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
*
- * $Id: r2300.c,v 1.15 2000/02/24 00:12:40 ralf Exp $
+ * $Id: r2300.c,v 1.16 2000/03/13 10:33:05 raiko Exp $
*/
#include
#include
@@ -18,7 +18,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -116,7 +115,7 @@
"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 void __init probe_dcache(void)
{
- dcache_size = size_cache(ST0_DE);
+ dcache_size = r3k_cache_size(ST0_DE);
printk("Primary data cache %dkb, linesize 4 bytes\n",
dcache_size >> 10);
}
static void __init probe_icache(void)
{
- icache_size = size_cache(ST0_DE|ST0_CE);
+ icache_size = r3k_cache_size(ST0_DE|ST0_CE);
printk("Primary instruction cache %dkb, linesize 8 bytes\n",
icache_size >> 10);
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/mm/r4xx0.c linux/arch/mips/mm/r4xx0.c
--- v2.3.99-pre8/linux/arch/mips/mm/r4xx0.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/mm/r4xx0.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: r4xx0.c,v 1.30 2000/02/24 01:12:37 ralf Exp $
+/* $Id: r4xx0.c,v 1.29 2000/02/24 00:12:40 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/Makefile linux/arch/mips/sgi/kernel/Makefile
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.8 2000/02/05 06:47:08 ralf Exp $
+# $Id: Makefile,v 1.7 1999/05/07 18:00:16 ulfc Exp $
# Makefile for the SGI specific kernel interface routines
# under Linux.
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/indyIRQ.S linux/arch/mips/sgi/kernel/indyIRQ.S
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/indyIRQ.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/indyIRQ.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: indyIRQ.S,v 1.4 1999/08/18 23:37:45 ralf Exp $
+/* $Id: indyIRQ.S,v 1.3 1998/03/22 23:27:17 ralf Exp $
* indyIRQ.S: Interrupt exception dispatch code for FullHouse and
* Guiness.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_hpc.c linux/arch/mips/sgi/kernel/indy_hpc.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_hpc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/indy_hpc.c Sat May 13 08:29:14 2000
@@ -6,6 +6,7 @@
* Copyright (C) 1998 Ralf Baechle
*/
#include
+#include
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_int.c linux/arch/mips/sgi/kernel/indy_int.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_int.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips/sgi/kernel/indy_int.c Sat May 13 08:29:14 2000
@@ -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..
@@ -38,6 +38,24 @@
#include
#include
#include
+
+/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the apropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+irq_cpustat_t irq_stat [NR_CPUS];
/* #define DEBUG_SGINT */
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_mc.c linux/arch/mips/sgi/kernel/indy_mc.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_mc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/indy_mc.c Sat May 13 08:29:14 2000
@@ -4,7 +4,7 @@
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
* Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes
*
- * $Id: indy_mc.c,v 1.8 1999/12/06 23:13:20 ralf Exp $
+ * $Id: indy_mc.c,v 1.7 1999/12/04 03:59:00 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_rtc.c linux/arch/mips/sgi/kernel/indy_rtc.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_rtc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/indy_rtc.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: indy_rtc.c,v 1.2 1999/10/21 00:23:05 ralf Exp $
+/* $Id: indy_rtc.c,v 1.1 1998/06/30 00:21:58 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_sc.c linux/arch/mips/sgi/kernel/indy_sc.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_sc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/indy_sc.c Sat May 13 08:29:14 2000
@@ -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 @@
#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 @@
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 @@
#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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
void __init indy_sc_init(void)
{
-return;
if (indy_sc_probe()) {
indy_sc_enable();
bcops = &indy_sc_ops;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_timer.c linux/arch/mips/sgi/kernel/indy_timer.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/indy_timer.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/indy_timer.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: indy_timer.c,v 1.18 2000/02/04 07:40:23 ralf Exp $
+/* $Id: indy_timer.c,v 1.17 2000/01/21 22:34:03 ralf Exp $
*
* indy_timer.c: Setting up the clock on the INDY 8254 controller.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/promcon.c linux/arch/mips/sgi/kernel/promcon.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/promcon.c Tue Aug 31 17:29:12 1999
+++ linux/arch/mips/sgi/kernel/promcon.c Sat May 13 08:29:14 2000
@@ -66,8 +66,7 @@
* Register console.
*/
-long __init sgi_prom_console_init(long kmem_start, long kmem_end)
+void __init sgi_prom_console_init(void )
{
register_console(&sercons);
- return kmem_start;
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/reset.c linux/arch/mips/sgi/kernel/reset.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/reset.c Thu May 11 15:30:06 2000
+++ linux/arch/mips/sgi/kernel/reset.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: reset.c,v 1.8 1999/10/21 00:23:05 ralf Exp $
+/* $Id: reset.c,v 1.7 1999/08/11 20:26:51 andrewb Exp $
*
* Reset a SGI.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/setup.c linux/arch/mips/sgi/kernel/setup.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/setup.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/setup.c Sat May 13 08:29:14 2000
@@ -30,9 +30,10 @@
#ifdef CONFIG_REMOTE_DEBUG
extern void rs_kgdb_hook(int);
extern void breakpoint(void);
+static int remote_debug = 0;
#endif
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_PROM_CONSOLE)
+#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SGI_PROM_CONSOLE)
extern void console_setup(char *);
#endif
@@ -40,8 +41,6 @@
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 @@
* 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 @@
#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 @@
init_vino();
#endif
}
+__initcall(rs_init);
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/system.c linux/arch/mips/sgi/kernel/system.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/system.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/system.c Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
*
- * $Id: system.c,v 1.9 1999/10/21 00:23:05 ralf Exp $
+ * $Id: system.c,v 1.8 1999/10/09 00:00:59 ralf Exp $
*/
#include
#include
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sgi/kernel/time.c linux/arch/mips/sgi/kernel/time.c
--- v2.3.99-pre8/linux/arch/mips/sgi/kernel/time.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sgi/kernel/time.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.3 1999/10/09 00:00:59 ralf Exp $
+/* $Id: time.c,v 1.2 1998/04/05 11:24:00 ralf Exp $
* time.c: Generic SGI time_init() code, this will dispatch to the
* appropriate per-architecture time/counter init code.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sni/Makefile linux/arch/mips/sni/Makefile
--- v2.3.99-pre8/linux/arch/mips/sni/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sni/Makefile Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 2000/02/18 00:24:30 ralf Exp $
+# $Id: Makefile,v 1.3 1999/01/04 16:03:57 ralf Exp $
#
# Makefile for the SNI specific part of the kernel
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sni/dma.c linux/arch/mips/sni/dma.c
--- v2.3.99-pre8/linux/arch/mips/sni/dma.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sni/dma.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: dma.c,v 1.2 2000/02/24 00:12:41 ralf Exp $
+/* $Id: dma.c,v 1.1 2000/02/18 00:24:30 ralf Exp $
*
* Dynamic DMA mapping support.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sni/int-handler.S linux/arch/mips/sni/int-handler.S
--- v2.3.99-pre8/linux/arch/mips/sni/int-handler.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sni/int-handler.S Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: int-handler.S,v 1.5 1999/08/18 23:37:46 ralf Exp $
+/* $Id: int-handler.S,v 1.4 1999/01/04 16:03:58 ralf Exp $
*
* SNI RM200 PCI specific interrupt handler code.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sni/io.c linux/arch/mips/sni/io.c
--- v2.3.99-pre8/linux/arch/mips/sni/io.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sni/io.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.5 1999/10/09 00:00:59 ralf Exp $
+/* $Id: io.c,v 1.4 1999/08/18 23:37:46 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sni/pci.c linux/arch/mips/sni/pci.c
--- v2.3.99-pre8/linux/arch/mips/sni/pci.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sni/pci.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: pci.c,v 1.10 2000/02/05 06:47:09 ralf Exp $
+/* $Id: pci.c,v 1.9 1999/12/04 03:59:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sni/pcimt_scache.c linux/arch/mips/sni/pcimt_scache.c
--- v2.3.99-pre8/linux/arch/mips/sni/pcimt_scache.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sni/pcimt_scache.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: pcimt_scache.c,v 1.5 1999/10/09 00:00:59 ralf Exp $
+/* $Id: pcimt_scache.c,v 1.4 1999/01/04 16:03:59 ralf Exp $
*
* arch/mips/sni/pcimt_scache.c
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/sni/setup.c linux/arch/mips/sni/setup.c
--- v2.3.99-pre8/linux/arch/mips/sni/setup.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/sni/setup.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.14 2000/01/27 01:05:23 ralf Exp $
+/* $Id: setup.c,v 1.13 1999/12/04 03:59:00 ralf Exp $
*
* Setup pointers to hardware-dependent routines.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/tools/Makefile linux/arch/mips/tools/Makefile
--- v2.3.99-pre8/linux/arch/mips/tools/Makefile Fri Jun 25 17:40:13 1999
+++ linux/arch/mips/tools/Makefile Sat May 13 08:29:14 2000
@@ -3,7 +3,7 @@
# Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
# Copyright (C) 1997 Ralf Baechle (ralf@gnu.ai.mit.edu)
#
-# $Id: Makefile,v 1.2 1997/12/01 17:57:41 ralf Exp $
+# $Id: Makefile,v 1.2 1997/09/23 06:23:49 ralf Exp $
#
TARGET := $(TOPDIR)/include/asm-$(ARCH)/offset.h
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips/tools/offset.c linux/arch/mips/tools/offset.c
--- v2.3.99-pre8/linux/arch/mips/tools/offset.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips/tools/offset.c Sat May 13 08:29:14 2000
@@ -1,4 +1,4 @@
-/* $Id: offset.c,v 1.12 1999/10/09 00:00:59 ralf Exp $
+/* $Id: offset.c,v 1.11 1999/09/28 22:25:50 ralf Exp $
*
* offset.c: Calculate pt_regs and task_struct offsets.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/Makefile linux/arch/mips64/Makefile
--- v2.3.99-pre8/linux/arch/mips64/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/Makefile Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.6 2000/01/29 01:41:59 ralf Exp $
+# $Id: Makefile,v 1.5 2000/01/21 22:34:03 ralf Exp $
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/Makefile linux/arch/mips64/arc/Makefile
--- v2.3.99-pre8/linux/arch/mips64/arc/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/Makefile Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 2000/01/17 23:32:46 ralf Exp $
+# $Id: Makefile,v 1.1 1999/08/20 21:13:32 ralf Exp $
#
# Makefile for the ARC prom monitor library routines under Linux.
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/cmdline.c linux/arch/mips64/arc/cmdline.c
--- v2.3.99-pre8/linux/arch/mips64/arc/cmdline.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/cmdline.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: cmdline.c,v 1.2 1999/11/19 23:29:05 ralf Exp $
+/* $Id: cmdline.c,v 1.2 1999/10/19 20:51:44 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/console.c linux/arch/mips64/arc/console.c
--- v2.3.99-pre8/linux/arch/mips64/arc/console.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/console.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: console.c,v 1.3 1999/10/19 20:51:44 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/env.c linux/arch/mips64/arc/env.c
--- v2.3.99-pre8/linux/arch/mips64/arc/env.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/env.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: env.c,v 1.4 1999/11/19 23:29:05 ralf Exp $
+/* $Id: env.c,v 1.4 1999/10/19 20:51:44 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/file.c linux/arch/mips64/arc/file.c
--- v2.3.99-pre8/linux/arch/mips64/arc/file.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/file.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: file.c,v 1.3 1999/10/19 20:51:44 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/identify.c linux/arch/mips64/arc/identify.c
--- v2.3.99-pre8/linux/arch/mips64/arc/identify.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/identify.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: identify.c,v 1.5 2000/01/17 23:32:46 ralf Exp $
+/* $Id: identify.c,v 1.5 1999/11/19 20:35:21 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/misc.c linux/arch/mips64/arc/misc.c
--- v2.3.99-pre8/linux/arch/mips64/arc/misc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/misc.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.4 2000/01/17 23:32:46 ralf Exp $
+/* $Id: misc.c,v 1.2 1999/08/21 21:42:59 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/printf.c linux/arch/mips64/arc/printf.c
--- v2.3.99-pre8/linux/arch/mips64/arc/printf.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/printf.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: printf.c,v 1.2 1999/11/19 23:29:05 ralf Exp $
+/* $Id: printf.c,v 1.1 1999/08/20 21:13:33 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/salone.c linux/arch/mips64/arc/salone.c
--- v2.3.99-pre8/linux/arch/mips64/arc/salone.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/salone.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: salone.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: salone.c,v 1.2 1999/08/21 21:42:59 ralf Exp $
*
* Routines to load into memory and execute stand-along program images using
* ARCS PROM firmware.
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/time.c linux/arch/mips64/arc/time.c
--- v2.3.99-pre8/linux/arch/mips64/arc/time.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/time.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.3 1999/11/19 23:29:05 ralf Exp $
+/* $Id: time.c,v 1.2 1999/08/21 21:42:59 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/arc/tree.c linux/arch/mips64/arc/tree.c
--- v2.3.99-pre8/linux/arch/mips64/arc/tree.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/arc/tree.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: tree.c,v 1.4 1999/11/19 23:29:05 ralf Exp $
+/* $Id: tree.c,v 1.3 1999/09/27 16:01:37 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/boot/Makefile linux/arch/mips64/boot/Makefile
--- v2.3.99-pre8/linux/arch/mips64/boot/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/boot/Makefile Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 1999/12/04 03:59:00 ralf Exp $
+# $Id: Makefile,v 1.1 1999/08/18 21:46:52 ralf Exp $
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/config.in linux/arch/mips64/config.in
--- v2.3.99-pre8/linux/arch/mips64/config.in Tue Apr 11 15:09:13 2000
+++ linux/arch/mips64/config.in Sat May 13 08:30:17 2000
@@ -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 @@
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 @@
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 @@
tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
+ else
+ define_bool CONFIG_FONT_8x16 y
fi
fi
endmenu
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/defconfig linux/arch/mips64/defconfig
--- v2.3.99-pre8/linux/arch/mips64/defconfig Thu May 11 15:30:06 2000
+++ linux/arch/mips64/defconfig Mon May 15 10:57:20 2000
@@ -14,13 +14,14 @@
CONFIG_SGI_IP27=y
# CONFIG_SGI_SN0_N_MODE is not set
# CONFIG_DISCONTIGMEM is not set
-# CONFIG_ISA is not set
-# CONFIG_SBUS is not set
+# CONFIG_SMP is not set
CONFIG_BOOT_ELF64=y
CONFIG_ARC64=y
CONFIG_COHERENT_IO=y
CONFIG_PCI=y
CONFIG_QL_ISP_A64=y
+# CONFIG_ISA is not set
+# CONFIG_SBUS is not set
#
# CPU selection
@@ -43,7 +44,7 @@
# CONFIG_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 @@
#
# 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,12 @@
#
# 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_BLK_DEV_RAM is not set
+# CONFIG_BLK_DEV_INITRD is not set
#
# Networking options
@@ -149,12 +156,12 @@
# 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 +187,9 @@
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
@@ -322,17 +327,13 @@
# CONFIG_DRM_TDFX is not set
#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
# 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,10 +343,12 @@
# 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 +356,39 @@
# 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 +401,7 @@
# 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
@@ -392,8 +412,14 @@
# CONFIG_SOUND is not set
#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
# Kernel hacking
#
CONFIG_CROSSCOMPILE=y
+# CONFIG_MIPS_FPE_MODULE is not set
# CONFIG_REMOTE_DEBUG is not set
-CONFIG_MAGIC_SYSRQ=y
+# CONFIG_MAGIC_SYSRQ is not set
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/defconfig-ip22 linux/arch/mips64/defconfig-ip22
--- v2.3.99-pre8/linux/arch/mips64/defconfig-ip22 Thu May 11 15:30:06 2000
+++ linux/arch/mips64/defconfig-ip22 Mon May 15 10:57:20 2000
@@ -16,6 +16,9 @@
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_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,22 @@
# 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_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 +100,7 @@
#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
#
# Telephony Support
@@ -110,6 +109,13 @@
# 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
#
# CONFIG_SCSI is not set
@@ -118,7 +124,6 @@
# 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 +139,7 @@
#
# 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 +164,7 @@
# CONFIG_NET_RADIO is not set
#
-# Token Ring driver support
+# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
@@ -241,17 +247,13 @@
# CONFIG_DRM_TDFX is not set
#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
# 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
@@ -261,10 +263,12 @@
# 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 +276,39 @@
# 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 +321,7 @@
# Console drivers
#
CONFIG_SGI_NEWPORT_CONSOLE=y
+CONFIG_FONT_8x16=y
CONFIG_KCORE_ELF=y
#
@@ -313,6 +334,11 @@
#
# CONFIG_SGI_SERIAL is not set
CONFIG_SGI_DS1286=y
+
+#
+# USB support
+#
+# CONFIG_USB is not set
#
# Kernel hacking
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/defconfig-ip27 linux/arch/mips64/defconfig-ip27
--- v2.3.99-pre8/linux/arch/mips64/defconfig-ip27 Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/defconfig-ip27 Mon May 15 10:57:20 2000
@@ -14,11 +14,14 @@
CONFIG_SGI_IP27=y
# CONFIG_SGI_SN0_N_MODE is not set
# CONFIG_DISCONTIGMEM is not set
+# CONFIG_SMP is not set
CONFIG_BOOT_ELF64=y
CONFIG_ARC64=y
CONFIG_COHERENT_IO=y
CONFIG_PCI=y
CONFIG_QL_ISP_A64=y
+# CONFIG_ISA is not set
+# CONFIG_SBUS is not set
#
# CPU selection
@@ -37,14 +40,11 @@
# CONFIG_CPU_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,31 @@
#
# 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_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 +109,7 @@
#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
#
# Telephony Support
@@ -119,6 +118,13 @@
# 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
#
CONFIG_SCSI=y
@@ -129,7 +135,6 @@
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 +149,19 @@
#
# 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 +187,9 @@
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 +211,7 @@
#
# 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 +226,7 @@
# 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 +245,7 @@
# 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 +327,13 @@
# 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 +343,7 @@
# 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 +351,9 @@
# 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 +371,7 @@
#
# 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 +379,30 @@
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
@@ -388,8 +412,14 @@
# CONFIG_SOUND is not set
#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
# Kernel hacking
#
CONFIG_CROSSCOMPILE=y
+# CONFIG_MIPS_FPE_MODULE is not set
# CONFIG_REMOTE_DEBUG is not set
-CONFIG_MAGIC_SYSRQ=y
+# CONFIG_MAGIC_SYSRQ is not set
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/Makefile linux/arch/mips64/kernel/Makefile
--- v2.3.99-pre8/linux/arch/mips64/kernel/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/Makefile Sat May 13 08:30:17 2000
@@ -18,11 +18,15 @@
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:
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/binfmt_elf32.c linux/arch/mips64/kernel/binfmt_elf32.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/binfmt_elf32.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/binfmt_elf32.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: binfmt_elf32.c,v 1.2 2000/01/17 23:32:46 ralf Exp $
+/* $Id: binfmt_elf32.c,v 1.1 1999/11/24 06:56:13 ralf Exp $
*
* Support for 32-bit Linux/MIPS ELF binaries.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/branch.c linux/arch/mips64/kernel/branch.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/branch.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/branch.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: branch.c,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: branch.c,v 1.1 1999/10/09 20:55:05 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/entry.S linux/arch/mips64/kernel/entry.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/entry.S Thu May 11 15:30:06 2000
+++ linux/arch/mips64/kernel/entry.S Sat May 13 08:30:17 2000
@@ -10,6 +10,7 @@
* Copyright (C) 1999, 2000 Silicon Graphics
*/
#include
+
#include
#include
#include
@@ -34,10 +35,11 @@
FEXPORT(ret_from_sys_call)
FEXPORT(ret_from_irq)
-#ifdef CONFIG_SMP
-#error Barffff...
-#else
la t1, softirq_state
+#ifdef CONFIG_SMP
+ lwu t0, TASK_PROCESSOR($28)
+ dsll t0, t0, 5
+ daddu t1, t0
#endif
lw t0, 0 (t1)
lw t1, 4 (t1) # unused delay slot
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/head.S linux/arch/mips64/kernel/head.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/head.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/head.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: head.S,v 1.4 2000/01/25 01:35:05 ralf Exp $
+/* $Id: head.S,v 1.6 2000/03/27 21:05:04 ulfc Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -20,6 +20,15 @@
#include
#include
+#define ARC64_TWIDDLE_PC \
+#ifdef CONFIG_ARC64 \
+ /* We get launched at a XKPHYS address but the kernel is linked to \
+ run at a KSEG0 address, so jump there. */ \
+ la t0, 1f \
+ jr t0 \
+1: \
+#endif
+
.text
EXPORT(stext) # used for profiling
@@ -29,13 +38,7 @@
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 @@
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 @@
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 -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/ioctl32.c linux/arch/mips64/kernel/ioctl32.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/ioctl32.c Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/kernel/ioctl32.c Sat May 13 08:30:17 2000
@@ -0,0 +1,529 @@
+/* $Id: ioctl32.c,v 1.1 2000/04/05 00:43:25 ulfc Exp $
+ * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
+ *
+ * Copyright (C) 2000 Silicon Graphics, Inc.
+ * Written by Ulf Carlsson (ulfc@engr.sgi.com)
+ *
+ * Mostly from the sparc64 ioctl32 implementation.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define A(__x) ((unsigned long)(__x))
+
+long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
+
+struct timeval32 {
+ int tv_sec;
+ int tv_usec;
+};
+
+#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
+#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int)
+#define EXT2_IOC32_GETVERSION _IOR('v', 1, int)
+#define EXT2_IOC32_SETVERSION _IOW('v', 2, int)
+
+static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct timeval32 *up = (struct timeval32 *)arg;
+ struct timeval ktv;
+ mm_segment_t old_fs = get_fs();
+ int err;
+
+ set_fs(KERNEL_DS);
+ err = sys_ioctl(fd, cmd, (unsigned long)&ktv);
+ set_fs(old_fs);
+ if(!err) {
+ err = put_user(ktv.tv_sec, &up->tv_sec);
+ err |= __put_user(ktv.tv_usec, &up->tv_usec);
+ }
+ return err;
+}
+
+struct ifmap32 {
+ unsigned int mem_start;
+ unsigned int mem_end;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+};
+
+struct ifreq32 {
+#define IFHWADDRLEN 6
+#define IFNAMSIZ 16
+ union {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap32 ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ __kernel_caddr_t32 ifru_data;
+ } ifr_ifru;
+};
+
+struct ifconf32 {
+ int ifc_len; /* size of buffer */
+ __kernel_caddr_t32 ifcbuf;
+};
+
+static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct ireq32 *uir32 = (struct ireq32 *)arg;
+ struct net_device *dev;
+ struct ifreq32 ifr32;
+
+ if (copy_from_user(&ifr32, uir32, sizeof(struct ifreq32)))
+ return -EFAULT;
+
+ read_lock(&dev_base_lock);
+ dev = __dev_get_by_index(ifr32.ifr_ifindex);
+ if (!dev) {
+ read_unlock(&dev_base_lock);
+ return -ENODEV;
+ }
+
+ strcpy(ifr32.ifr_name, dev->name);
+ read_unlock(&dev_base_lock);
+
+ if (copy_to_user(uir32, &ifr32, sizeof(struct ifreq32)))
+ return -EFAULT;
+
+ return 0;
+}
+
+static inline int dev_ifconf(unsigned int fd, unsigned int cmd,
+ unsigned long arg)
+{
+ struct ioconf32 *uifc32 = (struct ioconf32 *)arg;
+ struct ifconf32 ifc32;
+ struct ifconf ifc;
+ struct ifreq32 *ifr32;
+ struct ifreq *ifr;
+ mm_segment_t old_fs;
+ int len;
+ int err;
+
+ if (copy_from_user(&ifc32, uifc32, sizeof(struct ifconf32)))
+ return -EFAULT;
+
+ if(ifc32.ifcbuf == 0) {
+ ifc32.ifc_len = 0;
+ ifc.ifc_len = 0;
+ ifc.ifc_buf = NULL;
+ } else {
+ ifc.ifc_len = ((ifc32.ifc_len / sizeof (struct ifreq32))) *
+ sizeof (struct ifreq);
+ ifc.ifc_buf = kmalloc (ifc.ifc_len, GFP_KERNEL);
+ if (!ifc.ifc_buf)
+ return -ENOMEM;
+ }
+ ifr = ifc.ifc_req;
+ ifr32 = (struct ifreq32 *)A(ifc32.ifcbuf);
+ len = ifc32.ifc_len / sizeof (struct ifreq32);
+ while (len--) {
+ if (copy_from_user(ifr++, ifr32++, sizeof (struct ifreq32))) {
+ err = -EFAULT;
+ goto out;
+ }
+ }
+
+ old_fs = get_fs();
+ set_fs (KERNEL_DS);
+ err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)&ifc);
+ set_fs (old_fs);
+ if (err)
+ goto out;
+
+ ifr = ifc.ifc_req;
+ ifr32 = (struct ifreq32 *)A(ifc32.ifcbuf);
+ len = ifc.ifc_len / sizeof (struct ifreq);
+ ifc32.ifc_len = len * sizeof (struct ifreq32);
+
+ while (len--) {
+ if (copy_to_user(ifr32++, ifr++, sizeof (struct ifreq32))) {
+ err = -EFAULT;
+ goto out;
+ }
+ }
+
+ if (copy_to_user(uifc32, &ifc32, sizeof(struct ifconf32))) {
+ err = -EFAULT;
+ goto out;
+ }
+out:
+ if(ifc.ifc_buf != NULL)
+ kfree (ifc.ifc_buf);
+ return err;
+}
+
+static inline int dev_ifsioc(unsigned int fd, unsigned int cmd,
+ unsigned long arg)
+{
+ struct ifreq32 *uifr = (struct ifreq32 *)arg;
+ struct ifreq ifr;
+ mm_segment_t old_fs;
+ int err;
+
+ switch (cmd) {
+ case SIOCSIFMAP:
+ err = copy_from_user(&ifr, uifr, sizeof(ifr.ifr_name));
+ err |= __get_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start));
+ err |= __get_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end));
+ err |= __get_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr));
+ err |= __get_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq));
+ err |= __get_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma));
+ err |= __get_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port));
+ if (err)
+ return -EFAULT;
+ break;
+ default:
+ if (copy_from_user(&ifr, uifr, sizeof(struct ifreq32)))
+ return -EFAULT;
+ break;
+ }
+ old_fs = get_fs();
+ set_fs (KERNEL_DS);
+ err = sys_ioctl (fd, cmd, (unsigned long)&ifr);
+ set_fs (old_fs);
+ if (!err) {
+ switch (cmd) {
+ case SIOCGIFFLAGS:
+ case SIOCGIFMETRIC:
+ case SIOCGIFMTU:
+ case SIOCGIFMEM:
+ case SIOCGIFHWADDR:
+ case SIOCGIFINDEX:
+ case SIOCGIFADDR:
+ case SIOCGIFBRDADDR:
+ case SIOCGIFDSTADDR:
+ case SIOCGIFNETMASK:
+ case SIOCGIFTXQLEN:
+ if (copy_to_user(uifr, &ifr, sizeof(struct ifreq32)))
+ return -EFAULT;
+ break;
+ case SIOCGIFMAP:
+ err = copy_to_user(uifr, &ifr, sizeof(ifr.ifr_name));
+ err |= __put_user(ifr.ifr_map.mem_start, &(uifr->ifr_ifru.ifru_map.mem_start));
+ err |= __put_user(ifr.ifr_map.mem_end, &(uifr->ifr_ifru.ifru_map.mem_end));
+ err |= __put_user(ifr.ifr_map.base_addr, &(uifr->ifr_ifru.ifru_map.base_addr));
+ err |= __put_user(ifr.ifr_map.irq, &(uifr->ifr_ifru.ifru_map.irq));
+ err |= __put_user(ifr.ifr_map.dma, &(uifr->ifr_ifru.ifru_map.dma));
+ err |= __put_user(ifr.ifr_map.port, &(uifr->ifr_ifru.ifru_map.port));
+ if (err)
+ err = -EFAULT;
+ break;
+ }
+ }
+ return err;
+}
+
+struct rtentry32
+{
+ unsigned int rt_pad1;
+ struct sockaddr rt_dst; /* target address */
+ struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
+ struct sockaddr rt_genmask; /* target network mask (IP) */
+ unsigned short rt_flags;
+ short rt_pad2;
+ unsigned int rt_pad3;
+ unsigned int rt_pad4;
+ short rt_metric; /* +1 for binary compatibility! */
+ unsigned int rt_dev; /* forcing the device at add */
+ unsigned int rt_mtu; /* per route MTU/Window */
+#ifndef __KERNEL__
+#define rt_mss rt_mtu /* Compatibility :-( */
+#endif
+ unsigned int rt_window; /* Window clamping */
+ unsigned short rt_irtt; /* Initial RTT */
+};
+
+static inline int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct rtentry32 *ur = (struct rtentry32 *)arg;
+ struct rtentry r;
+ char devname[16];
+ u32 rtdev;
+ int ret;
+ mm_segment_t old_fs = get_fs();
+
+ ret = copy_from_user (&r.rt_dst, &(ur->rt_dst), 3 * sizeof(struct sockaddr));
+ ret |= __get_user (r.rt_flags, &(ur->rt_flags));
+ ret |= __get_user (r.rt_metric, &(ur->rt_metric));
+ ret |= __get_user (r.rt_mtu, &(ur->rt_mtu));
+ ret |= __get_user (r.rt_window, &(ur->rt_window));
+ ret |= __get_user (r.rt_irtt, &(ur->rt_irtt));
+ ret |= __get_user (rtdev, &(ur->rt_dev));
+ if (rtdev) {
+ ret |= copy_from_user (devname, (char *)A(rtdev), 15);
+ r.rt_dev = devname; devname[15] = 0;
+ } else
+ r.rt_dev = 0;
+ if (ret)
+ return -EFAULT;
+ set_fs (KERNEL_DS);
+ ret = sys_ioctl (fd, cmd, (long)&r);
+ set_fs (old_fs);
+ return ret;
+}
+
+static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ /* These are just misnamed, they actually get/put from/to user an int */
+ switch (cmd) {
+ case EXT2_IOC32_GETFLAGS: cmd = EXT2_IOC_GETFLAGS; break;
+ case EXT2_IOC32_SETFLAGS: cmd = EXT2_IOC_SETFLAGS; break;
+ case EXT2_IOC32_GETVERSION: cmd = EXT2_IOC_GETVERSION; break;
+ case EXT2_IOC32_SETVERSION: cmd = EXT2_IOC_SETVERSION; break;
+ }
+ return sys_ioctl(fd, cmd, arg);
+}
+
+static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ mm_segment_t old_fs = get_fs();
+ int err;
+ unsigned long val;
+
+ set_fs (KERNEL_DS);
+ err = sys_ioctl(fd, cmd, (unsigned long)&val);
+ set_fs (old_fs);
+ if (!err && put_user((unsigned int) val, (u32 *)arg))
+ return -EFAULT;
+ return err;
+}
+
+struct ioctl32_handler {
+ unsigned int cmd;
+ int (*function)(unsigned int, unsigned int, unsigned long);
+};
+
+struct ioctl32_list {
+ struct ioctl32_handler handler;
+ struct ioctl32_list *next;
+};
+
+#define IOCTL32_DEFAULT(cmd) { { cmd, (void *) sys_ioctl }, 0 }
+#define IOCTL32_HANDLER(cmd, handler) { { cmd, (void *) handler }, 0 }
+
+static struct ioctl32_list ioctl32_handler_table[] = {
+ IOCTL32_DEFAULT(TCGETA),
+ IOCTL32_DEFAULT(TCSETA),
+ IOCTL32_DEFAULT(TCSETAW),
+ IOCTL32_DEFAULT(TCSETAF),
+ IOCTL32_DEFAULT(TCSBRK),
+ IOCTL32_DEFAULT(TCXONC),
+ IOCTL32_DEFAULT(TCFLSH),
+ IOCTL32_DEFAULT(TCGETS),
+ IOCTL32_DEFAULT(TCSETS),
+ IOCTL32_DEFAULT(TCSETSW),
+ IOCTL32_DEFAULT(TCSETSF),
+ IOCTL32_DEFAULT(TIOCLINUX),
+
+ IOCTL32_DEFAULT(TIOCGETD),
+ IOCTL32_DEFAULT(TIOCSETD),
+ IOCTL32_DEFAULT(TIOCEXCL),
+ IOCTL32_DEFAULT(TIOCNXCL),
+ IOCTL32_DEFAULT(TIOCCONS),
+ IOCTL32_DEFAULT(TIOCGSOFTCAR),
+ IOCTL32_DEFAULT(TIOCSSOFTCAR),
+ IOCTL32_DEFAULT(TIOCSWINSZ),
+ IOCTL32_DEFAULT(TIOCGWINSZ),
+ IOCTL32_DEFAULT(TIOCMGET),
+ IOCTL32_DEFAULT(TIOCMBIC),
+ IOCTL32_DEFAULT(TIOCMBIS),
+ IOCTL32_DEFAULT(TIOCMSET),
+ IOCTL32_DEFAULT(TIOCPKT),
+ IOCTL32_DEFAULT(TIOCNOTTY),
+ IOCTL32_DEFAULT(TIOCSTI),
+ IOCTL32_DEFAULT(TIOCOUTQ),
+ IOCTL32_DEFAULT(TIOCSPGRP),
+ IOCTL32_DEFAULT(TIOCGPGRP),
+ IOCTL32_DEFAULT(TIOCSCTTY),
+ IOCTL32_DEFAULT(TIOCGPTN),
+ IOCTL32_DEFAULT(TIOCSPTLCK),
+ IOCTL32_DEFAULT(TIOCGSERIAL),
+ IOCTL32_DEFAULT(TIOCSSERIAL),
+ IOCTL32_DEFAULT(TIOCSERGETLSR),
+
+ IOCTL32_DEFAULT(FIOCLEX),
+ IOCTL32_DEFAULT(FIONCLEX),
+ IOCTL32_DEFAULT(FIOASYNC),
+ IOCTL32_DEFAULT(FIONBIO),
+ IOCTL32_DEFAULT(FIONREAD),
+
+ IOCTL32_DEFAULT(PIO_FONT),
+ IOCTL32_DEFAULT(GIO_FONT),
+ IOCTL32_DEFAULT(KDSIGACCEPT),
+ IOCTL32_DEFAULT(KDGETKEYCODE),
+ IOCTL32_DEFAULT(KDSETKEYCODE),
+ IOCTL32_DEFAULT(KIOCSOUND),
+ IOCTL32_DEFAULT(KDMKTONE),
+ IOCTL32_DEFAULT(KDGKBTYPE),
+ IOCTL32_DEFAULT(KDSETMODE),
+ IOCTL32_DEFAULT(KDGETMODE),
+ IOCTL32_DEFAULT(KDSKBMODE),
+ IOCTL32_DEFAULT(KDGKBMODE),
+ IOCTL32_DEFAULT(KDSKBMETA),
+ IOCTL32_DEFAULT(KDGKBMETA),
+ IOCTL32_DEFAULT(KDGKBENT),
+ IOCTL32_DEFAULT(KDSKBENT),
+ IOCTL32_DEFAULT(KDGKBSENT),
+ IOCTL32_DEFAULT(KDSKBSENT),
+ IOCTL32_DEFAULT(KDGKBDIACR),
+ IOCTL32_DEFAULT(KDSKBDIACR),
+ IOCTL32_DEFAULT(KDGKBLED),
+ IOCTL32_DEFAULT(KDSKBLED),
+ IOCTL32_DEFAULT(KDGETLED),
+ IOCTL32_DEFAULT(KDSETLED),
+ IOCTL32_DEFAULT(GIO_SCRNMAP),
+ IOCTL32_DEFAULT(PIO_SCRNMAP),
+ IOCTL32_DEFAULT(GIO_UNISCRNMAP),
+ IOCTL32_DEFAULT(PIO_UNISCRNMAP),
+ IOCTL32_DEFAULT(PIO_FONTRESET),
+ IOCTL32_DEFAULT(PIO_UNIMAPCLR),
+
+ IOCTL32_DEFAULT(VT_SETMODE),
+ IOCTL32_DEFAULT(VT_GETMODE),
+ IOCTL32_DEFAULT(VT_GETSTATE),
+ IOCTL32_DEFAULT(VT_OPENQRY),
+ IOCTL32_DEFAULT(VT_ACTIVATE),
+ IOCTL32_DEFAULT(VT_WAITACTIVE),
+ IOCTL32_DEFAULT(VT_RELDISP),
+ IOCTL32_DEFAULT(VT_DISALLOCATE),
+ IOCTL32_DEFAULT(VT_RESIZE),
+ IOCTL32_DEFAULT(VT_RESIZEX),
+ IOCTL32_DEFAULT(VT_LOCKSWITCH),
+ IOCTL32_DEFAULT(VT_UNLOCKSWITCH),
+
+ IOCTL32_HANDLER(SIOCGIFNAME, dev_ifname32),
+ IOCTL32_HANDLER(SIOCGIFCONF, dev_ifconf),
+ IOCTL32_HANDLER(SIOCGIFFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMETRIC, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMETRIC, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMTU, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMTU, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMEM, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMEM, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFHWADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFHWADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCADDMULTI, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCDELMULTI, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFINDEX, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFMAP, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFMAP, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFBRDADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFBRDADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFDSTADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFDSTADDR, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFNETMASK, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFNETMASK, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFPFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFPFLAGS, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCGIFTXQLEN, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCSIFTXQLEN, dev_ifsioc),
+ IOCTL32_HANDLER(SIOCADDRT, routing_ioctl),
+ IOCTL32_HANDLER(SIOCDELRT, routing_ioctl),
+
+ IOCTL32_HANDLER(EXT2_IOC32_GETFLAGS, do_ext2_ioctl),
+ IOCTL32_HANDLER(EXT2_IOC32_SETFLAGS, do_ext2_ioctl),
+ IOCTL32_HANDLER(EXT2_IOC32_GETVERSION, do_ext2_ioctl),
+ IOCTL32_HANDLER(EXT2_IOC32_SETVERSION, do_ext2_ioctl),
+
+ IOCTL32_HANDLER(BLKGETSIZE, w_long)
+
+};
+
+#define NR_IOCTL32_HANDLERS (sizeof(ioctl32_handler_table) / \
+ sizeof(ioctl32_handler_table[0]))
+
+static struct ioctl32_list *ioctl32_hash_table[1024];
+
+static inline int ioctl32_hash(unsigned int cmd)
+{
+ return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
+}
+
+int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned int arg)
+{
+ int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
+ struct file *filp;
+ struct ioctl32_list *l;
+ int error;
+
+ l = ioctl32_hash_table[ioctl32_hash(cmd)];
+
+ error = -EBADF;
+
+ filp = fget(fd);
+ if (!filp)
+ return error;
+
+ if (!filp->f_op || !filp->f_op->ioctl) {
+ error = sys_ioctl (fd, cmd, arg);
+ goto out;
+ }
+
+ while (l && l->handler.cmd != cmd)
+ l = l->next;
+
+ if (l) {
+ handler = (void *)l->handler.function;
+ error = handler(fd, cmd, arg, filp);
+ } else {
+ error = -EINVAL;
+ printk("unknown ioctl: %08x\n", cmd);
+ }
+out:
+ fput(filp);
+ return error;
+}
+
+static void ioctl32_insert(struct ioctl32_list *entry)
+{
+ int hash = ioctl32_hash(entry->handler.cmd);
+ if (!ioctl32_hash_table[hash])
+ ioctl32_hash_table[hash] = entry;
+ else {
+ struct ioctl32_list *l;
+ l = ioctl32_hash_table[hash];
+ while (l->next)
+ l = l->next;
+ l->next = entry;
+ entry->next = 0;
+ }
+}
+
+static int __init init_ioctl32(void)
+{
+ int i;
+ for (i = 0; i < NR_IOCTL32_HANDLERS; i++)
+ ioctl32_insert(&ioctl32_handler_table[i]);
+ return 0;
+}
+
+__initcall(init_ioctl32);
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/linux32.c linux/arch/mips64/kernel/linux32.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/linux32.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/linux32.c Sat May 13 08:30:17 2000
@@ -1,10 +1,1309 @@
-int sys32_newstat(void) {return 0;}
-int sys32_newlstat(void) {return 0;}
-int sys32_newfstat(void) {return 0;}
-int sys_mmap2(void) {return 0;}
-int sys_truncate64(void) {return 0;}
-int sys_ftruncate64(void) {return 0;}
-int sys_stat64(void) {return 0;}
-int sys_lstat64(void) {return 0;}
-int sys_fstat64(void) {return 0;}
+/* $Id: linux32.c,v 1.14 2000/03/23 00:30:53 ulfc Exp $
+ *
+ * Conversion between 32-bit and 64-bit native system calls.
+ *
+ * Copyright (C) 2000 Silicon Graphics, Inc.
+ * Written by Ulf Carlsson (ulfc@engr.sgi.com)
+ * sys32_execve from ia64/ia32 code, Feb 2000, Kanoj Sarcar (kanoj@sgi.com)
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+
+#define A(__x) ((unsigned long)(__x))
+
+#if 1
+static inline int
+putstat(struct stat32 *ubuf, struct stat *kbuf)
+{
+ int err;
+
+ err = put_user (kbuf->st_dev, &ubuf->st_dev);
+ err |= __put_user (kbuf->st_ino, &ubuf->st_ino);
+ err |= __put_user (kbuf->st_mode, &ubuf->st_mode);
+ err |= __put_user (kbuf->st_nlink, &ubuf->st_nlink);
+ err |= __put_user (kbuf->st_uid, &ubuf->st_uid);
+ err |= __put_user (kbuf->st_gid, &ubuf->st_gid);
+ err |= __put_user (kbuf->st_rdev, &ubuf->st_rdev);
+ err |= __put_user (kbuf->st_size, &ubuf->st_size);
+ err |= __put_user (kbuf->st_atime, &ubuf->st_atime);
+ err |= __put_user (kbuf->st_mtime, &ubuf->st_mtime);
+ err |= __put_user (kbuf->st_ctime, &ubuf->st_ctime);
+ err |= __put_user (kbuf->st_blksize, &ubuf->st_blksize);
+ err |= __put_user (kbuf->st_blocks, &ubuf->st_blocks);
+ return err;
+}
+
+extern asmlinkage long sys_newstat(char * filename, struct stat * statbuf);
+
+asmlinkage int
+sys32_newstat(char * filename, struct stat32 *statbuf)
+{
+ int ret;
+ struct stat s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_newstat(filename, &s);
+ set_fs (old_fs);
+ if (putstat (statbuf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage long sys_newlstat(char * filename, struct stat * statbuf);
+
+asmlinkage int
+sys32_newlstat(char * filename, struct stat32 *statbuf)
+{
+ int ret;
+ struct stat s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_newlstat(filename, &s);
+ set_fs (old_fs);
+ if (putstat (statbuf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf);
+
+asmlinkage int
+sys32_newfstat(unsigned int fd, struct stat32 *statbuf)
+{
+ int ret;
+ struct stat s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_newfstat(fd, &s);
+ set_fs (old_fs);
+ if (putstat (statbuf, &s))
+ return -EFAULT;
+ return ret;
+}
+#else
+/*
+ * Revalidate the inode. This is required for proper NFS attribute caching.
+ */
+static __inline__ int
+do_revalidate(struct dentry *dentry)
+{
+ struct inode * inode = dentry->d_inode;
+ if (inode->i_op && inode->i_op->revalidate)
+ return inode->i_op->revalidate(dentry);
+ return 0;
+}
+
+static int cp_new_stat32(struct inode * inode, struct stat32 * statbuf)
+{
+ struct stat32 tmp;
+ unsigned int blocks, indirect;
+
+ memset(&tmp, 0, sizeof(tmp));
+ tmp.st_dev = kdev_t_to_nr(inode->i_dev);
+ tmp.st_ino = inode->i_ino;
+ tmp.st_mode = inode->i_mode;
+ tmp.st_nlink = inode->i_nlink;
+ SET_STAT_UID(tmp, inode->i_uid);
+ SET_STAT_GID(tmp, inode->i_gid);
+ tmp.st_rdev = kdev_t_to_nr(inode->i_rdev);
+ tmp.st_size = inode->i_size;
+ tmp.st_atime = inode->i_atime;
+ tmp.st_mtime = inode->i_mtime;
+ tmp.st_ctime = inode->i_ctime;
+/*
+ * st_blocks and st_blksize are approximated with a simple algorithm if
+ * they aren't supported directly by the filesystem. The minix and msdos
+ * filesystems don't keep track of blocks, so they would either have to
+ * be counted explicitly (by delving into the file itself), or by using
+ * this simple algorithm to get a reasonable (although not 100% accurate)
+ * value.
+ */
+
+/*
+ * Use minix fs values for the number of direct and indirect blocks. The
+ * count is now exact for the minix fs except that it counts zero blocks.
+ * Everything is in units of BLOCK_SIZE until the assignment to
+ * tmp.st_blksize.
+ */
+#define D_B 7
+#define I_B (BLOCK_SIZE / sizeof(unsigned short))
+
+ if (!inode->i_blksize) {
+ blocks = (tmp.st_size + BLOCK_SIZE - 1) / BLOCK_SIZE;
+ if (blocks > D_B) {
+ indirect = (blocks - D_B + I_B - 1) / I_B;
+ blocks += indirect;
+ if (indirect > 1) {
+ indirect = (indirect - 1 + I_B - 1) / I_B;
+ blocks += indirect;
+ if (indirect > 1)
+ blocks++;
+ }
+ }
+ tmp.st_blocks = (BLOCK_SIZE / 512) * blocks;
+ tmp.st_blksize = BLOCK_SIZE;
+ } else {
+ tmp.st_blocks = inode->i_blocks;
+ tmp.st_blksize = inode->i_blksize;
+ }
+ return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+}
+asmlinkage int sys32_newstat(char * filename, struct stat32 *statbuf)
+{
+ struct dentry * dentry;
+ int error;
+
+ lock_kernel();
+ dentry = namei(filename);
+
+ error = PTR_ERR(dentry);
+ if (!IS_ERR(dentry)) {
+ error = do_revalidate(dentry);
+ if (!error)
+ error = cp_new_stat32(dentry->d_inode, statbuf);
+
+ dput(dentry);
+ }
+ unlock_kernel();
+ return error;
+}
+asmlinkage int sys32_newlstat(char *filename, struct stat32 * statbuf)
+{
+ struct dentry * dentry;
+ int error;
+
+ lock_kernel();
+ dentry = lnamei(filename);
+
+ error = PTR_ERR(dentry);
+ if (!IS_ERR(dentry)) {
+ error = do_revalidate(dentry);
+ if (!error)
+ error = cp_new_stat32(dentry->d_inode, statbuf);
+
+ dput(dentry);
+ }
+ unlock_kernel();
+ return error;
+}
+
+asmlinkage int sys32_newfstat(unsigned int fd, struct stat32 * statbuf)
+{
+ struct file * f;
+ int err = -EBADF;
+
+ lock_kernel();
+ f = fget(fd);
+ if (f) {
+ struct dentry * dentry = f->f_dentry;
+
+ err = do_revalidate(dentry);
+ if (!err)
+ err = cp_new_stat32(dentry->d_inode, statbuf);
+ fput(f);
+ }
+ unlock_kernel();
+ return err;
+}
+#endif
+asmlinkage int sys_mmap2(void) {return 0;}
+
+asmlinkage long sys_truncate(const char * path, unsigned long length);
+
+asmlinkage int sys_truncate64(const char *path, unsigned int high,
+ unsigned int low)
+{
+ if ((int)high < 0)
+ return -EINVAL;
+ return sys_truncate(path, (high << 32) | low);
+}
+
+asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
+
+asmlinkage int sys_ftruncate64(unsigned int fd, unsigned int high,
+ unsigned int low)
+{
+ if ((int)high < 0)
+ return -EINVAL;
+ return sys_ftruncate(fd, (high << 32) | low);
+}
+
+asmlinkage long sys_newstat(char * filename, struct stat * statbuf);
+
+asmlinkage int sys_stat64(char * filename, struct stat *statbuf)
+{
+ return sys_newstat(filename, statbuf);
+}
+
+asmlinkage long sys_newlstat(char * filename, struct stat * statbuf);
+
+asmlinkage int sys_lstat64(char * filename, struct stat *statbuf)
+{
+ return sys_newlstat(filename, statbuf);
+}
+
+asmlinkage long sys_newfstat(unsigned int fd, struct stat * statbuf);
+
+asmlinkage int sys_fstat64(unsigned int fd, struct stat *statbuf)
+{
+ return sys_newfstat(fd, statbuf);
+}
+
+#if 0
+/*
+ * count32() counts the number of arguments/envelopes
+ */
+static int count32(u32 * argv, int max)
+{
+ int i = 0;
+
+ if (argv != NULL) {
+ for (;;) {
+ u32 p;
+ /* egcs is stupid */
+ if (!access_ok(VERIFY_READ, argv, sizeof (u32)))
+ return -EFAULT;
+ __get_user(p,argv);
+ if (!p)
+ break;
+ argv++;
+ if(++i > max)
+ return -E2BIG;
+ }
+ }
+ return i;
+}
+
+
+/*
+ * 'copy_strings32()' copies argument/envelope strings from user
+ * memory to free pages in kernel mem. These are in a format ready
+ * to be put directly into the top of new user memory.
+ */
+int copy_strings32(int argc, u32 * argv, struct linux_binprm *bprm)
+{
+ while (argc-- > 0) {
+ u32 str;
+ int len;
+ unsigned long pos;
+
+ if (get_user(str, argv+argc) || !str || !(len = strnlen_user((char *)A(str), bprm->p)))
+ return -EFAULT;
+ if (bprm->p < len)
+ return -E2BIG;
+
+ bprm->p -= len;
+ /* XXX: add architecture specific overflow check here. */
+
+ pos = bprm->p;
+ while (len > 0) {
+ char *kaddr;
+ int i, new, err;
+ struct page *page;
+ int offset, bytes_to_copy;
+
+ offset = pos % PAGE_SIZE;
+ i = pos/PAGE_SIZE;
+ page = bprm->page[i];
+ new = 0;
+ if (!page) {
+ page = alloc_page(GFP_HIGHUSER);
+ bprm->page[i] = page;
+ if (!page)
+ return -ENOMEM;
+ new = 1;
+ }
+ kaddr = (char *)kmap(page);
+
+ if (new && offset)
+ memset(kaddr, 0, offset);
+ bytes_to_copy = PAGE_SIZE - offset;
+ if (bytes_to_copy > len) {
+ bytes_to_copy = len;
+ if (new)
+ memset(kaddr+offset+len, 0, PAGE_SIZE-offset-len);
+ }
+ err = copy_from_user(kaddr + offset, (char *)A(str), bytes_to_copy);
+ flush_page_to_ram(page);
+ kunmap(page);
+
+ if (err)
+ return -EFAULT;
+
+ pos += bytes_to_copy;
+ str += bytes_to_copy;
+ len -= bytes_to_copy;
+ }
+ }
+ return 0;
+}
+
+
+/*
+ * sys_execve32() executes a new program.
+ */
+int do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
+{
+ struct linux_binprm bprm;
+ struct dentry * dentry;
+ int retval;
+ int i;
+
+ bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
+ memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
+
+ dentry = open_namei(filename, 0, 0);
+ retval = PTR_ERR(dentry);
+ if (IS_ERR(dentry))
+ return retval;
+
+ bprm.dentry = dentry;
+ bprm.filename = filename;
+ bprm.sh_bang = 0;
+ bprm.loader = 0;
+ bprm.exec = 0;
+ if ((bprm.argc = count32(argv, bprm.p / sizeof(u32))) < 0) {
+ dput(dentry);
+ return bprm.argc;
+ }
+
+ if ((bprm.envc = count32(envp, bprm.p / sizeof(u32))) < 0) {
+ dput(dentry);
+ return bprm.envc;
+ }
+
+ retval = prepare_binprm(&bprm);
+ if (retval < 0)
+ goto out;
+
+ retval = copy_strings_kernel(1, &bprm.filename, &bprm);
+ if (retval < 0)
+ goto out;
+
+ bprm.exec = bprm.p;
+ retval = copy_strings32(bprm.envc, envp, &bprm);
+ if (retval < 0)
+ goto out;
+
+ retval = copy_strings32(bprm.argc, argv, &bprm);
+ if (retval < 0)
+ goto out;
+
+ retval = search_binary_handler(&bprm,regs);
+ if (retval >= 0)
+ /* execve success */
+ return retval;
+
+out:
+ /* Something went wrong, return the inode and free the argument pages*/
+ if (bprm.dentry)
+ dput(bprm.dentry);
+
+ /* Assumes that free_page() can take a NULL argument. */
+ /* I hope this is ok for all architectures */
+ for (i = 0 ; i < MAX_ARG_PAGES ; i++)
+ if (bprm.page[i])
+ __free_page(bprm.page[i]);
+
+ return retval;
+}
+
+/*
+ * sys_execve() executes a new program.
+ */
+asmlinkage int sys32_execve(abi64_no_regargs, struct pt_regs regs)
+{
+ int error;
+ char * filename;
+
+ filename = getname((char *) (long)regs.regs[4]);
+ printk("Executing: %s\n", filename);
+ error = PTR_ERR(filename);
+ if (IS_ERR(filename))
+ goto out;
+ error = do_execve32(filename, (u32 *) (long)regs.regs[5],
+ (u32 *) (long)regs.regs[6], ®s);
+ putname(filename);
+
+out:
+ return error;
+}
+#else
+static int
+nargs(unsigned int arg, char **ap)
+{
+ char *ptr;
+ int n;
+
+ n = 0;
+ do {
+ /* egcs is stupid */
+ if (!access_ok(VERIFY_READ, arg, sizeof (unsigned int)))
+ return -EFAULT;
+ __get_user((long)ptr,(int *)A(arg));
+ if (ap)
+ *ap++ = ptr;
+ arg += sizeof(unsigned int);
+ n++;
+ } while (ptr);
+ return(n - 1);
+}
+
+asmlinkage int
+sys32_execve(abi64_no_regargs, struct pt_regs regs)
+{
+ extern asmlinkage int sys_execve(abi64_no_regargs, struct pt_regs regs);
+ extern asmlinkage long sys_munmap(unsigned long addr, size_t len);
+ unsigned int argv = (unsigned int)regs.regs[5];
+ unsigned int envp = (unsigned int)regs.regs[6];
+ char **av, **ae;
+ int na, ne, r, len;
+ char * filename;
+
+ na = nargs(argv, NULL);
+ ne = nargs(envp, NULL);
+ len = (na + ne + 2) * sizeof(*av);
+ /*
+ * kmalloc won't work because the `sys_exec' code will attempt
+ * to do a `get_user' on the arg list and `get_user' will fail
+ * on a kernel address (simplifies `get_user'). Instead we
+ * do an mmap to get a user address. Note that since a successful
+ * `execve' frees all current memory we only have to do an
+ * `munmap' if the `execve' failes.
+ */
+ down(¤t->mm->mmap_sem);
+ lock_kernel();
+
+ av = (char **) do_mmap_pgoff(0, 0, len, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, 0);
+
+ unlock_kernel();
+ up(¤t->mm->mmap_sem);
+
+ if (IS_ERR(av))
+ return((long) av);
+ ae = av + na + 1;
+ av[na] = (char *)0;
+ ae[ne] = (char *)0;
+ (void)nargs(argv, av);
+ (void)nargs(envp, ae);
+ filename = getname((char *) (long)regs.regs[4]);
+ r = PTR_ERR(filename);
+ if (IS_ERR(filename))
+ return(r);
+
+ r = do_execve(filename, av, ae, ®s);
+ putname(filename);
+ if (IS_ERR(r))
+ sys_munmap((unsigned long)av, len);
+ return(r);
+}
+#endif
+
+struct dirent32 {
+ unsigned int d_ino;
+ unsigned int d_off;
+ unsigned short d_reclen;
+ char d_name[NAME_MAX + 1];
+};
+
+static void
+xlate_dirent(void *dirent64, void *dirent32, long n)
+{
+ long off;
+ struct dirent *dirp;
+ struct dirent32 *dirp32;
+
+ off = 0;
+ while (off < n) {
+ dirp = (struct dirent *)(dirent64 + off);
+ dirp32 = (struct dirent32 *)(dirent32 + off);
+ off += dirp->d_reclen;
+ dirp32->d_ino = dirp->d_ino;
+ dirp32->d_off = (unsigned int)dirp->d_off;
+ dirp32->d_reclen = dirp->d_reclen;
+ strncpy(dirp32->d_name, dirp->d_name, dirp->d_reclen - ((3 * 4) + 2));
+ }
+ return;
+}
+
+asmlinkage long sys_getdents(unsigned int fd, void * dirent, unsigned int count);
+
+asmlinkage long
+sys32_getdents(unsigned int fd, void * dirent32, unsigned int count)
+{
+ long n;
+ void *dirent64;
+
+ dirent64 = (void *)((unsigned long)(dirent32 + (sizeof(long) - 1)) & ~(sizeof(long) - 1));
+ if ((n = sys_getdents(fd, dirent64, count - (dirent64 - dirent32))) < 0)
+ return(n);
+ xlate_dirent(dirent64, dirent32, n);
+ return(n);
+}
+
+asmlinkage int old_readdir(unsigned int fd, void * dirent, unsigned int count);
+
+asmlinkage int
+sys32_readdir(unsigned int fd, void * dirent32, unsigned int count)
+{
+ int n;
+ struct dirent dirent64;
+
+ if ((n = old_readdir(fd, &dirent64, count)) < 0)
+ return(n);
+ xlate_dirent(&dirent64, dirent32, dirent64.d_reclen);
+ return(n);
+}
+
+struct timeval32
+{
+ int tv_sec, tv_usec;
+};
+
+struct itimerval32
+{
+ struct timeval32 it_interval;
+ struct timeval32 it_value;
+};
+
+struct rusage32 {
+ struct timeval32 ru_utime;
+ struct timeval32 ru_stime;
+ int ru_maxrss;
+ int ru_ixrss;
+ int ru_idrss;
+ int ru_isrss;
+ int ru_minflt;
+ int ru_majflt;
+ int ru_nswap;
+ int ru_inblock;
+ int ru_oublock;
+ int ru_msgsnd;
+ int ru_msgrcv;
+ int ru_nsignals;
+ int ru_nvcsw;
+ int ru_nivcsw;
+};
+
+static int
+put_rusage (struct rusage32 *ru, struct rusage *r)
+{
+ int err;
+
+ err = put_user (r->ru_utime.tv_sec, &ru->ru_utime.tv_sec);
+ err |= __put_user (r->ru_utime.tv_usec, &ru->ru_utime.tv_usec);
+ err |= __put_user (r->ru_stime.tv_sec, &ru->ru_stime.tv_sec);
+ err |= __put_user (r->ru_stime.tv_usec, &ru->ru_stime.tv_usec);
+ err |= __put_user (r->ru_maxrss, &ru->ru_maxrss);
+ err |= __put_user (r->ru_ixrss, &ru->ru_ixrss);
+ err |= __put_user (r->ru_idrss, &ru->ru_idrss);
+ err |= __put_user (r->ru_isrss, &ru->ru_isrss);
+ err |= __put_user (r->ru_minflt, &ru->ru_minflt);
+ err |= __put_user (r->ru_majflt, &ru->ru_majflt);
+ err |= __put_user (r->ru_nswap, &ru->ru_nswap);
+ err |= __put_user (r->ru_inblock, &ru->ru_inblock);
+ err |= __put_user (r->ru_oublock, &ru->ru_oublock);
+ err |= __put_user (r->ru_msgsnd, &ru->ru_msgsnd);
+ err |= __put_user (r->ru_msgrcv, &ru->ru_msgrcv);
+ err |= __put_user (r->ru_nsignals, &ru->ru_nsignals);
+ err |= __put_user (r->ru_nvcsw, &ru->ru_nvcsw);
+ err |= __put_user (r->ru_nivcsw, &ru->ru_nivcsw);
+ return err;
+}
+
+extern asmlinkage int sys_wait4(pid_t pid, unsigned int * stat_addr,
+ int options, struct rusage * ru);
+
+asmlinkage int
+sys32_wait4(__kernel_pid_t32 pid, unsigned int * stat_addr, int options,
+ struct rusage32 * ru)
+{
+ if (!ru)
+ return sys_wait4(pid, stat_addr, options, NULL);
+ else {
+ struct rusage r;
+ int ret;
+ unsigned int status;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs(KERNEL_DS);
+ ret = sys_wait4(pid, stat_addr ? &status : NULL, options, &r);
+ set_fs(old_fs);
+ if (put_rusage (ru, &r)) return -EFAULT;
+ if (stat_addr && put_user (status, stat_addr))
+ return -EFAULT;
+ return ret;
+ }
+}
+
+asmlinkage int
+sys32_waitpid(__kernel_pid_t32 pid, unsigned int *stat_addr, int options)
+{
+ return sys32_wait4(pid, stat_addr, options, NULL);
+}
+
+#define RLIM_INFINITY32 0x7fffffff
+#define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x)
+
+struct rlimit32 {
+ int rlim_cur;
+ int rlim_max;
+};
+
+extern asmlinkage int sys_old_getrlimit(unsigned int resource, struct rlimit *rlim);
+
+asmlinkage int
+sys32_getrlimit(unsigned int resource, struct rlimit32 *rlim)
+{
+ struct rlimit r;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ set_fs (KERNEL_DS);
+ ret = sys_old_getrlimit(resource, &r);
+ set_fs (old_fs);
+ if (!ret) {
+ ret = put_user (RESOURCE32(r.rlim_cur), &rlim->rlim_cur);
+ ret |= __put_user (RESOURCE32(r.rlim_max), &rlim->rlim_max);
+ }
+ return ret;
+}
+
+extern asmlinkage int sys_setrlimit(unsigned int resource, struct rlimit *rlim);
+
+asmlinkage int
+sys32_setrlimit(unsigned int resource, struct rlimit32 *rlim)
+{
+ struct rlimit r;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ if (resource >= RLIM_NLIMITS) return -EINVAL;
+ if (get_user (r.rlim_cur, &rlim->rlim_cur) ||
+ __get_user (r.rlim_max, &rlim->rlim_max))
+ return -EFAULT;
+ if (r.rlim_cur == RLIM_INFINITY32)
+ r.rlim_cur = RLIM_INFINITY;
+ if (r.rlim_max == RLIM_INFINITY32)
+ r.rlim_max = RLIM_INFINITY;
+ set_fs (KERNEL_DS);
+ ret = sys_setrlimit(resource, &r);
+ set_fs (old_fs);
+ return ret;
+}
+
+struct statfs32 {
+ int f_type;
+ int f_bsize;
+ int f_frsize;
+ int f_blocks;
+ int f_bfree;
+ int f_files;
+ int f_ffree;
+ int f_bavail;
+ __kernel_fsid_t32 f_fsid;
+ int f_namelen;
+ int f_spare[6];
+};
+
+static inline int
+put_statfs (struct statfs32 *ubuf, struct statfs *kbuf)
+{
+ int err;
+
+ err = put_user (kbuf->f_type, &ubuf->f_type);
+ err |= __put_user (kbuf->f_bsize, &ubuf->f_bsize);
+ err |= __put_user (kbuf->f_blocks, &ubuf->f_blocks);
+ err |= __put_user (kbuf->f_bfree, &ubuf->f_bfree);
+ err |= __put_user (kbuf->f_bavail, &ubuf->f_bavail);
+ err |= __put_user (kbuf->f_files, &ubuf->f_files);
+ err |= __put_user (kbuf->f_ffree, &ubuf->f_ffree);
+ err |= __put_user (kbuf->f_namelen, &ubuf->f_namelen);
+ err |= __put_user (kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]);
+ err |= __put_user (kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]);
+ return err;
+}
+
+extern asmlinkage int sys_statfs(const char * path, struct statfs * buf);
+
+asmlinkage int
+sys32_statfs(const char * path, struct statfs32 *buf)
+{
+ int ret;
+ struct statfs s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_statfs((const char *)path, &s);
+ set_fs (old_fs);
+ if (put_statfs(buf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage int sys_fstatfs(unsigned int fd, struct statfs * buf);
+
+asmlinkage int
+sys32_fstatfs(unsigned int fd, struct statfs32 *buf)
+{
+ int ret;
+ struct statfs s;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_fstatfs(fd, &s);
+ set_fs (old_fs);
+ if (put_statfs(buf, &s))
+ return -EFAULT;
+ return ret;
+}
+
+extern asmlinkage int
+sys_getrusage(int who, struct rusage *ru);
+
+asmlinkage int
+sys32_getrusage(int who, struct rusage32 *ru)
+{
+ struct rusage r;
+ int ret;
+ mm_segment_t old_fs = get_fs();
+
+ set_fs (KERNEL_DS);
+ ret = sys_getrusage(who, &r);
+ set_fs (old_fs);
+ if (put_rusage (ru, &r)) return -EFAULT;
+ return ret;
+}
+
+static inline long
+get_tv32(struct timeval *o, struct timeval32 *i)
+{
+ return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
+ (__get_user(o->tv_sec, &i->tv_sec) |
+ __get_user(o->tv_usec, &i->tv_usec)));
+ return ENOSYS;
+}
+
+static inline long
+get_it32(struct itimerval *o, struct itimerval32 *i)
+{
+ return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
+ (__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) |
+ __get_user(o->it_interval.tv_usec, &i->it_interval.tv_usec) |
+ __get_user(o->it_value.tv_sec, &i->it_value.tv_sec) |
+ __get_user(o->it_value.tv_usec, &i->it_value.tv_usec)));
+ return ENOSYS;
+}
+
+static inline long
+put_tv32(struct timeval32 *o, struct timeval *i)
+{
+ return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
+ (__put_user(i->tv_sec, &o->tv_sec) |
+ __put_user(i->tv_usec, &o->tv_usec)));
+}
+
+static inline long
+put_it32(struct itimerval32 *o, struct itimerval *i)
+{
+ return (!access_ok(VERIFY_WRITE, i, sizeof(*i)) ||
+ (__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) |
+ __put_user(i->it_interval.tv_usec, &o->it_interval.tv_usec) |
+ __put_user(i->it_value.tv_sec, &o->it_value.tv_sec) |
+ __put_user(i->it_value.tv_usec, &o->it_value.tv_usec)));
+ return ENOSYS;
+}
+
+extern int do_getitimer(int which, struct itimerval *value);
+
+asmlinkage int
+sys32_getitimer(int which, struct itimerval32 *it)
+{
+ struct itimerval kit;
+ int error;
+
+ error = do_getitimer(which, &kit);
+ if (!error && put_it32(it, &kit))
+ error = -EFAULT;
+
+ return error;
+}
+
+extern int do_setitimer(int which, struct itimerval *, struct itimerval *);
+
+
+asmlinkage int
+sys32_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out)
+{
+ struct itimerval kin, kout;
+ int error;
+
+ if (in) {
+ if (get_it32(&kin, in))
+ return -EFAULT;
+ } else
+ memset(&kin, 0, sizeof(kin));
+
+ error = do_setitimer(which, &kin, out ? &kout : NULL);
+ if (error || !out)
+ return error;
+ if (put_it32(out, &kout))
+ return -EFAULT;
+
+ return 0;
+
+}
+asmlinkage unsigned long
+sys32_alarm(unsigned int seconds)
+{
+ struct itimerval it_new, it_old;
+ unsigned int oldalarm;
+
+ it_new.it_interval.tv_sec = it_new.it_interval.tv_usec = 0;
+ it_new.it_value.tv_sec = seconds;
+ it_new.it_value.tv_usec = 0;
+ do_setitimer(ITIMER_REAL, &it_new, &it_old);
+ oldalarm = it_old.it_value.tv_sec;
+ /* ehhh.. We can't return 0 if we have an alarm pending.. */
+ /* And we'd better return too much than too little anyway */
+ if (it_old.it_value.tv_usec)
+ oldalarm++;
+ return oldalarm;
+}
+
+/* Translations due to time_t size differences. Which affects all
+ sorts of things, like timeval and itimerval. */
+
+
+extern struct timezone sys_tz;
+extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
+
+asmlinkage int
+sys32_gettimeofday(struct timeval32 *tv, struct timezone *tz)
+{
+ if (tv) {
+ struct timeval ktv;
+ do_gettimeofday(&ktv);
+ if (put_tv32(tv, &ktv))
+ return -EFAULT;
+ }
+ if (tz) {
+ if (copy_to_user(tz, &sys_tz, sizeof(sys_tz)))
+ return -EFAULT;
+ }
+ return 0;
+}
+
+asmlinkage int
+sys32_settimeofday(struct timeval32 *tv, struct timezone *tz)
+{
+ struct timeval ktv;
+ struct timezone ktz;
+
+ if (tv) {
+ if (get_tv32(&ktv, tv))
+ return -EFAULT;
+ }
+ if (tz) {
+ if (copy_from_user(&ktz, tz, sizeof(ktz)))
+ return -EFAULT;
+ }
+
+ return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL);
+}
+
+extern asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
+ unsigned long offset_low, loff_t * result,
+ unsigned int origin);
+
+extern asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
+ unsigned int offset_low, loff_t * result,
+ unsigned int origin)
+{
+ return sys_llseek(fd, offset_high, offset_low, result, origin);
+}
+
+struct iovec32 { unsigned int iov_base; int iov_len; };
+
+typedef ssize_t (*IO_fn_t)(struct file *, char *, size_t, loff_t *);
+
+static long
+do_readv_writev32(int type, struct file *file, const struct iovec32 *vector,
+ u32 count)
+{
+ unsigned long tot_len;
+ struct iovec iovstack[UIO_FASTIOV];
+ struct iovec *iov=iovstack, *ivp;
+ struct inode *inode;
+ long retval, i;
+ IO_fn_t fn;
+
+ /* First get the "struct iovec" from user memory and
+ * verify all the pointers
+ */
+ if (!count)
+ return 0;
+ if(verify_area(VERIFY_READ, vector, sizeof(struct iovec32)*count))
+ return -EFAULT;
+ if (count > UIO_MAXIOV)
+ return -EINVAL;
+ if (count > UIO_FASTIOV) {
+ iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
+ if (!iov)
+ return -ENOMEM;
+ }
+
+ tot_len = 0;
+ i = count;
+ ivp = iov;
+ while(i > 0) {
+ u32 len;
+ u32 buf;
+
+ __get_user(len, &vector->iov_len);
+ __get_user(buf, &vector->iov_base);
+ tot_len += len;
+ ivp->iov_base = (void *)A(buf);
+ ivp->iov_len = (__kernel_size_t) len;
+ vector++;
+ ivp++;
+ i--;
+ }
+
+ inode = file->f_dentry->d_inode;
+ /* VERIFY_WRITE actually means a read, as we write to user space */
+ retval = locks_verify_area((type == VERIFY_WRITE
+ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
+ inode, file, file->f_pos, tot_len);
+ if (retval) {
+ if (iov != iovstack)
+ kfree(iov);
+ return retval;
+ }
+
+ /* Then do the actual IO. Note that sockets need to be handled
+ * specially as they have atomicity guarantees and can handle
+ * iovec's natively
+ */
+ if (inode->i_sock) {
+ int err;
+ err = sock_readv_writev(type, inode, file, iov, count, tot_len);
+ if (iov != iovstack)
+ kfree(iov);
+ return err;
+ }
+
+ if (!file->f_op) {
+ if (iov != iovstack)
+ kfree(iov);
+ return -EINVAL;
+ }
+ /* VERIFY_WRITE actually means a read, as we write to user space */
+ fn = file->f_op->read;
+ if (type == VERIFY_READ)
+ fn = (IO_fn_t) file->f_op->write;
+ ivp = iov;
+ while (count > 0) {
+ void * base;
+ int len, nr;
+
+ base = ivp->iov_base;
+ len = ivp->iov_len;
+ ivp++;
+ count--;
+ nr = fn(file, base, len, &file->f_pos);
+ if (nr < 0) {
+ if (retval)
+ break;
+ retval = nr;
+ break;
+ }
+ retval += nr;
+ if (nr != len)
+ break;
+ }
+ if (iov != iovstack)
+ kfree(iov);
+ return retval;
+}
+
+asmlinkage long
+sys32_readv(int fd, struct iovec32 *vector, u32 count)
+{
+ struct file *file;
+ long ret = -EBADF;
+
+ lock_kernel();
+ file = fget(fd);
+ if(!file)
+ goto bad_file;
+
+ if(!(file->f_mode & 1))
+ goto out;
+
+ ret = do_readv_writev32(VERIFY_WRITE, file,
+ vector, count);
+out:
+ fput(file);
+bad_file:
+ unlock_kernel();
+ return ret;
+}
+
+asmlinkage long
+sys32_writev(int fd, struct iovec32 *vector, u32 count)
+{
+ struct file *file;
+ int ret = -EBADF;
+
+ lock_kernel();
+ file = fget(fd);
+ if(!file)
+ goto bad_file;
+
+ if(!(file->f_mode & 2))
+ goto out;
+
+ ret = do_readv_writev32(VERIFY_READ, file,
+ vector, count);
+out:
+ fput(file);
+bad_file:
+ unlock_kernel();
+ return ret;
+}
+
+/*
+ * Ooo, nasty. We need here to frob 32-bit unsigned longs to
+ * 64-bit unsigned longs.
+ */
+
+static inline int
+get_fd_set32(unsigned long n, unsigned long *fdset, u32 *ufdset)
+{
+#ifdef __MIPSEB__
+ if (ufdset) {
+ unsigned long odd;
+
+ if (verify_area(VERIFY_WRITE, ufdset, n*sizeof(u32)))
+ return -EFAULT;
+
+ odd = n & 1UL;
+ n &= ~1UL;
+ while (n) {
+ unsigned long h, l;
+ __get_user(l, ufdset);
+ __get_user(h, ufdset+1);
+ ufdset += 2;
+ *fdset++ = h << 32 | l;
+ n -= 2;
+ }
+ if (odd)
+ __get_user(*fdset, ufdset);
+ } else {
+ /* Tricky, must clear full unsigned long in the
+ * kernel fdset at the end, this makes sure that
+ * actually happens.
+ */
+ memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
+ }
+ return 0;
+#else
+ <>
+#endif
+}
+
+static inline void
+set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
+{
+ unsigned long odd;
+
+ if (!ufdset)
+ return;
+
+ odd = n & 1UL;
+ n &= ~1UL;
+ while (n) {
+ unsigned long h, l;
+ l = *fdset++;
+ h = l >> 32;
+ __put_user(l, ufdset);
+ __put_user(h, ufdset+1);
+ ufdset += 2;
+ n -= 2;
+ }
+ if (odd)
+ __put_user(*fdset, ufdset);
+}
+
+/*
+ * We can actually return ERESTARTSYS instead of EINTR, but I'd
+ * like to be certain this leads to no problems. So I return
+ * EINTR just for safety.
+ *
+ * Update: ERESTARTSYS breaks at least the xview clock binary, so
+ * I'm trying ERESTARTNOHAND which restart only when you want to.
+ */
+#define MAX_SELECT_SECONDS \
+ ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
+
+asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, struct timeval32 *tvp)
+{
+ fd_set_bits fds;
+ char *bits;
+ unsigned long nn;
+ long timeout;
+ int ret, size;
+
+ timeout = MAX_SCHEDULE_TIMEOUT;
+ if (tvp) {
+ time_t sec, usec;
+
+ if ((ret = verify_area(VERIFY_READ, tvp, sizeof(*tvp)))
+ || (ret = __get_user(sec, &tvp->tv_sec))
+ || (ret = __get_user(usec, &tvp->tv_usec)))
+ goto out_nofds;
+
+ ret = -EINVAL;
+ if(sec < 0 || usec < 0)
+ goto out_nofds;
+
+ if ((unsigned long) sec < MAX_SELECT_SECONDS) {
+ timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
+ timeout += sec * (unsigned long) HZ;
+ }
+ }
+
+ ret = -EINVAL;
+ if (n < 0)
+ goto out_nofds;
+ if (n > current->files->max_fdset)
+ n = current->files->max_fdset;
+
+ /*
+ * We need 6 bitmaps (in/out/ex for both incoming and outgoing),
+ * since we used fdset we need to allocate memory in units of
+ * long-words.
+ */
+ ret = -ENOMEM;
+ size = FDS_BYTES(n);
+ bits = kmalloc(6 * size, GFP_KERNEL);
+ if (!bits)
+ goto out_nofds;
+ fds.in = (unsigned long *) bits;
+ fds.out = (unsigned long *) (bits + size);
+ fds.ex = (unsigned long *) (bits + 2*size);
+ fds.res_in = (unsigned long *) (bits + 3*size);
+ fds.res_out = (unsigned long *) (bits + 4*size);
+ fds.res_ex = (unsigned long *) (bits + 5*size);
+
+ nn = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
+ if ((ret = get_fd_set32(nn, fds.in, inp)) ||
+ (ret = get_fd_set32(nn, fds.out, outp)) ||
+ (ret = get_fd_set32(nn, fds.ex, exp)))
+ goto out;
+ zero_fd_set(n, fds.res_in);
+ zero_fd_set(n, fds.res_out);
+ zero_fd_set(n, fds.res_ex);
+
+ ret = do_select(n, &fds, &timeout);
+
+ if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
+ time_t sec = 0, usec = 0;
+ if (timeout) {
+ sec = timeout / HZ;
+ usec = timeout % HZ;
+ usec *= (1000000/HZ);
+ }
+ put_user(sec, &tvp->tv_sec);
+ put_user(usec, &tvp->tv_usec);
+ }
+
+ if (ret < 0)
+ goto out;
+ if (!ret) {
+ ret = -ERESTARTNOHAND;
+ if (signal_pending(current))
+ goto out;
+ ret = 0;
+ }
+
+ set_fd_set32(nn, inp, fds.res_in);
+ set_fd_set32(nn, outp, fds.res_out);
+ set_fd_set32(nn, exp, fds.res_ex);
+
+out:
+ kfree(bits);
+out_nofds:
+ return ret;
+}
+
+
+
+struct timespec32 {
+ int tv_sec;
+ int tv_nsec;
+};
+
+extern asmlinkage int sys_sched_rr_get_interval(pid_t pid,
+ struct timespec *interval);
+
+asmlinkage int
+sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct timespec32 *interval)
+{
+ struct timespec t;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ set_fs (KERNEL_DS);
+ ret = sys_sched_rr_get_interval(pid, &t);
+ set_fs (old_fs);
+ if (put_user (t.tv_sec, &interval->tv_sec) ||
+ __put_user (t.tv_nsec, &interval->tv_nsec))
+ return -EFAULT;
+ return ret;
+}
+
+
+extern asmlinkage int sys_nanosleep(struct timespec *rqtp,
+ struct timespec *rmtp);
+
+asmlinkage int
+sys32_nanosleep(struct timespec32 *rqtp, struct timespec32 *rmtp)
+{
+ struct timespec t;
+ int ret;
+ mm_segment_t old_fs = get_fs ();
+
+ if (get_user (t.tv_sec, &rqtp->tv_sec) ||
+ __get_user (t.tv_nsec, &rqtp->tv_nsec))
+ return -EFAULT;
+
+ set_fs (KERNEL_DS);
+ ret = sys_nanosleep(&t, rmtp ? &t : NULL);
+ set_fs (old_fs);
+ if (rmtp && ret == -EINTR) {
+ if (__put_user (t.tv_sec, &rmtp->tv_sec) ||
+ __put_user (t.tv_nsec, &rmtp->tv_nsec))
+ return -EFAULT;
+ }
+ return ret;
+}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/mips64_ksyms.c linux/arch/mips64/kernel/mips64_ksyms.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/mips64_ksyms.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/mips64_ksyms.c Sat May 13 08:30:17 2000
@@ -24,6 +24,7 @@
#include
#include
#include
+#include
#include
#include
@@ -56,8 +57,6 @@
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,10 +82,19 @@
*/
EXPORT_SYMBOL(_flush_page_to_ram);
EXPORT_SYMBOL(_flush_cache_all);
+#ifndef CONFIG_COHERENT_IO
EXPORT_SYMBOL(_dma_cache_wback_inv);
EXPORT_SYMBOL(_dma_cache_inv);
+#endif
EXPORT_SYMBOL(invalid_pte_table);
+
+/*
+ * Semaphore stuff
+ */
+EXPORT_SYMBOL(__down_read);
+EXPORT_SYMBOL(__down_write);
+EXPORT_SYMBOL(__rwsem_wake);
/*
* Base address of ports for Intel style I/O.
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/proc.c linux/arch/mips64/kernel/proc.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/proc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/proc.c Sat May 13 08:30:17 2000
@@ -11,6 +11,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -45,6 +46,7 @@
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
@@ -68,4 +70,9 @@
len += sprintf(buffer + len, fmt, 'I', vcei_count);
return len;
+}
+
+void init_irq_proc(void)
+{
+ /* Nothing, for now. */
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/process.c linux/arch/mips64/kernel/process.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/process.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/process.c Mon May 15 12:10:26 2000
@@ -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
@@ -33,6 +33,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 +52,20 @@
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 +77,7 @@
childksp = (unsigned long)p + KERNEL_STACK_SIZE - 32;
- if (last_task_used_math == current) {
- set_cp0_status(ST0_CU1, ST0_CU1);
+ if (IS_FPU_OWNER()) {
save_fp(p);
}
/* set up new TSS. */
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/ptrace.c linux/arch/mips64/kernel/ptrace.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/ptrace.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/ptrace.c Sat May 13 08:30:17 2000
@@ -8,13 +8,561 @@
* Copyright (C) Linus Torvalds
* Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle
* Copyright (C) 1996 David S. Miller
+ * Copyright (C) 2000 Ulf Carlsson
*
* At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit
* binaries.
*/
+#include
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/* Tracing a 32-bit process with a 64-bit strace and vice verca will not
+ work. I don't know how to fix this. */
+
+asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
+{
+ struct task_struct *child;
+ int ret;
+
+ lock_kernel();
+#if 0
+ printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n",
+ (int) request, (int) pid, (unsigned long) addr,
+ (unsigned long) data);
+#endif
+ ret = -EPERM;
+ if (request == PTRACE_TRACEME) {
+ /* are we already being traced? */
+ if (current->flags & PF_PTRACED)
+ goto out;
+ /* set the ptrace bit in the process flags. */
+ current->flags |= PF_PTRACED;
+ ret = 0;
+ goto out;
+ }
+ ret = -ESRCH;
+ read_lock(&tasklist_lock);
+ child = find_task_by_pid(pid);
+ if (child)
+ get_task_struct(child);
+ read_unlock(&tasklist_lock);
+ if (!child)
+ goto out;
+
+ ret = -EPERM;
+ if (pid == 1) /* you may not mess with init */
+ goto out_tsk;
+
+ if (request == PTRACE_ATTACH) {
+ if (child == current)
+ goto out_tsk;
+ if ((!child->dumpable ||
+ (current->uid != child->euid) ||
+ (current->uid != child->suid) ||
+ (current->uid != child->uid) ||
+ (current->gid != child->egid) ||
+ (current->gid != child->sgid) ||
+ (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
+ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
+ goto out_tsk;
+ /* the same process cannot be attached many times */
+ if (child->flags & PF_PTRACED)
+ goto out_tsk;
+ child->flags |= PF_PTRACED;
+
+ write_lock_irq(&tasklist_lock);
+ if (child->p_pptr != current) {
+ REMOVE_LINKS(child);
+ child->p_pptr = current;
+ SET_LINKS(child);
+ }
+ write_unlock_irq(&tasklist_lock);
+
+ send_sig(SIGSTOP, child, 1);
+ ret = 0;
+ goto out_tsk;
+ }
+ ret = -ESRCH;
+ if (!(child->flags & PF_PTRACED))
+ goto out_tsk;
+ if (child->state != TASK_STOPPED) {
+ if (request != PTRACE_KILL)
+ goto out_tsk;
+ }
+ if (child->p_pptr != current)
+ goto out_tsk;
+
+ switch (request) {
+ /* when I and D space are separate, these will need to be fixed. */
+ case PTRACE_PEEKTEXT: /* read word at location addr. */
+ case PTRACE_PEEKDATA: {
+ unsigned int tmp;
+ int copied;
+
+ copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
+ ret = -EIO;
+ if (copied != sizeof(tmp))
+ break;
+ ret = put_user(tmp, (unsigned int *) data);
+ break;
+ }
+
+ /* read the word at location addr in the USER area. */
+ case PTRACE_PEEKUSR: {
+ struct pt_regs *regs;
+ unsigned int tmp;
+
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+ ret = 0;
+
+ switch (addr) {
+ case 0 ... 31:
+ tmp = regs->regs[addr];
+ break;
+ case FPR_BASE ... FPR_BASE + 31:
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ }
+#endif
+ tmp = child->thread.fpu.hard.fp_regs[addr - 32];
+ } else {
+ tmp = -EIO;
+ }
+ break;
+ case PC:
+ tmp = regs->cp0_epc;
+ break;
+ case CAUSE:
+ tmp = regs->cp0_cause;
+ break;
+ case BADVADDR:
+ tmp = regs->cp0_badvaddr;
+ break;
+ case MMHI:
+ tmp = regs->hi;
+ break;
+ case MMLO:
+ tmp = regs->lo;
+ break;
+ case FPC_CSR:
+ tmp = child->thread.fpu.hard.control;
+ break;
+ case FPC_EIR: { /* implementation / version register */
+ unsigned int flags;
+ __save_flags(flags);
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
+ __restore_flags(flags);
+ break;
+ }
+ default:
+ tmp = 0;
+ ret = -EIO;
+ goto out_tsk;
+ }
+ ret = put_user(tmp, (unsigned *) data);
+ break;
+ }
+ /* when I and D space are separate, this will have to be fixed. */
+ case PTRACE_POKETEXT: /* write the word at location addr. */
+ case PTRACE_POKEDATA:
+ ret = 0;
+ if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
+ break;
+ ret = -EIO;
+ break;
+
+ case PTRACE_POKEUSR: {
+ struct pt_regs *regs;
+ ret = 0;
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+
+ switch (addr) {
+ case 0 ... 31:
+ regs->regs[addr] = data;
+ break;
+ case FPR_BASE ... FPR_BASE + 31: {
+ unsigned long *fregs;
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ regs->cp0_status &= ~ST0_CU1;
+ }
+#endif
+ } else {
+ /* FP not yet used */
+ memset(&child->thread.fpu.hard, ~0,
+ sizeof(child->thread.fpu.hard));
+ child->thread.fpu.hard.control = 0;
+ }
+ fregs = child->thread.fpu.hard.fp_regs;
+ fregs[addr - FPR_BASE] = data;
+ break;
+ }
+ case PC:
+ regs->cp0_epc = data;
+ break;
+ case MMHI:
+ regs->hi = data;
+ break;
+ case MMLO:
+ regs->lo = data;
+ break;
+ case FPC_CSR:
+ child->thread.fpu.hard.control = data;
+ break;
+ default:
+ /* The rest are not allowed. */
+ ret = -EIO;
+ break;
+ }
+ goto out;
+ }
+ case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
+ case PTRACE_CONT: { /* restart after signal. */
+ ret = -EIO;
+ if ((unsigned int) data > _NSIG)
+ break;
+ if (request == PTRACE_SYSCALL)
+ child->flags |= PF_TRACESYS;
+ else
+ child->flags &= ~PF_TRACESYS;
+ child->exit_code = data;
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+/*
+ * make the child exit. Best I can do is send it a sigkill.
+ * perhaps it should be put in the status that it wants to
+ * exit.
+ */
+ case PTRACE_KILL: {
+ if (child->state == TASK_ZOMBIE) /* already dead */
+ break;
+ child->exit_code = SIGKILL;
+ wake_up_process(child);
+ break;
+ }
+
+ case PTRACE_DETACH: { /* detach a process that was attached. */
+ ret = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
+ child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->exit_code = data;
+ write_lock_irq(&tasklist_lock);
+ REMOVE_LINKS(child);
+ child->p_pptr = child->p_opptr;
+ SET_LINKS(child);
+ write_unlock_irq(&tasklist_lock);
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+ default:
+ ret = -EIO;
+ break;
+ }
+
+out_tsk:
+ free_task_struct(child);
+out:
+ unlock_kernel();
+ return ret;
+}
+
+asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
+{
+ struct task_struct *child;
+ int ret;
+
+ lock_kernel();
+#if 0
+ printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n",
+ (int) request, (int) pid, (unsigned long) addr,
+ (unsigned long) data);
+#endif
+ ret = -EPERM;
+ if (request == PTRACE_TRACEME) {
+ /* are we already being traced? */
+ if (current->flags & PF_PTRACED)
+ goto out;
+ /* set the ptrace bit in the process flags. */
+ current->flags |= PF_PTRACED;
+ ret = 0;
+ goto out;
+ }
+ ret = -ESRCH;
+ read_lock(&tasklist_lock);
+ child = find_task_by_pid(pid);
+ if (child)
+ get_task_struct(child);
+ read_unlock(&tasklist_lock);
+ if (!child)
+ goto out;
+
+ ret = -EPERM;
+ if (pid == 1) /* you may not mess with init */
+ goto out;
+
+ if (request == PTRACE_ATTACH) {
+ if (child == current)
+ goto out_tsk;
+ if ((!child->dumpable ||
+ (current->uid != child->euid) ||
+ (current->uid != child->suid) ||
+ (current->uid != child->uid) ||
+ (current->gid != child->egid) ||
+ (current->gid != child->sgid) ||
+ (!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
+ (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
+ goto out_tsk;
+ /* the same process cannot be attached many times */
+ if (child->flags & PF_PTRACED)
+ goto out_tsk;
+ child->flags |= PF_PTRACED;
+
+ write_lock_irq(&tasklist_lock);
+ if (child->p_pptr != current) {
+ REMOVE_LINKS(child);
+ child->p_pptr = current;
+ SET_LINKS(child);
+ }
+ write_unlock_irq(&tasklist_lock);
+
+ send_sig(SIGSTOP, child, 1);
+ ret = 0;
+ goto out_tsk;
+ }
+ ret = -ESRCH;
+ if (!(child->flags & PF_PTRACED))
+ goto out_tsk;
+ if (child->state != TASK_STOPPED) {
+ if (request != PTRACE_KILL)
+ goto out_tsk;
+ }
+ if (child->p_pptr != current)
+ goto out_tsk;
+
+ switch (request) {
+ /* when I and D space are separate, these will need to be fixed. */
+ case PTRACE_PEEKTEXT: /* read word at location addr. */
+ case PTRACE_PEEKDATA: {
+ unsigned long tmp;
+ int copied;
+
+ copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
+ ret = -EIO;
+ if (copied != sizeof(tmp))
+ break;
+ ret = put_user(tmp,(unsigned long *) data);
+ break;
+ }
+
+ /* read the word at location addr in the USER area. */
+ case PTRACE_PEEKUSR: {
+ struct pt_regs *regs;
+ unsigned long tmp;
+
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+ ret = 0;
+
+ switch (addr) {
+ case 0 ... 31:
+ tmp = regs->regs[addr];
+ break;
+ case FPR_BASE ... FPR_BASE + 31:
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ }
+#endif
+ tmp = child->thread.fpu.hard.fp_regs[addr - 32];
+ } else {
+ tmp = -EIO;
+ }
+ break;
+ case PC:
+ tmp = regs->cp0_epc;
+ break;
+ case CAUSE:
+ tmp = regs->cp0_cause;
+ break;
+ case BADVADDR:
+ tmp = regs->cp0_badvaddr;
+ break;
+ case MMHI:
+ tmp = regs->hi;
+ break;
+ case MMLO:
+ tmp = regs->lo;
+ break;
+ case FPC_CSR:
+ tmp = child->thread.fpu.hard.control;
+ break;
+ case FPC_EIR: { /* implementation / version register */
+ unsigned int flags;
+ __save_flags(flags);
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
+ __restore_flags(flags);
+ break;
+ }
+ default:
+ tmp = 0;
+ ret = -EIO;
+ goto out_tsk;
+ }
+ ret = put_user(tmp, (unsigned long *) data);
+ break;
+ }
+ /* when I and D space are separate, this will have to be fixed. */
+ case PTRACE_POKETEXT: /* write the word at location addr. */
+ case PTRACE_POKEDATA:
+ ret = 0;
+ if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
+ break;
+ ret = -EIO;
+ break;
+
+ case PTRACE_POKEUSR: {
+ struct pt_regs *regs;
+ ret = 0;
+ regs = (struct pt_regs *) ((unsigned long) child +
+ KERNEL_STACK_SIZE - 32 - sizeof(struct pt_regs));
+
+ switch (addr) {
+ case 0 ... 31:
+ regs->regs[addr] = data;
+ break;
+ case FPR_BASE ... FPR_BASE + 31: {
+ unsigned long *fregs;
+ if (child->used_math) {
+#ifndef CONFIG_SMP
+ if (last_task_used_math == child) {
+ set_cp0_status(ST0_CU1, ST0_CU1);
+ save_fp(child);
+ set_cp0_status(ST0_CU1, 0);
+ last_task_used_math = NULL;
+ regs->cp0_status &= ~ST0_CU1;
+ }
+#endif
+ } else {
+ /* FP not yet used */
+ memset(&child->thread.fpu.hard, ~0,
+ sizeof(child->thread.fpu.hard));
+ child->thread.fpu.hard.control = 0;
+ }
+ fregs = child->thread.fpu.hard.fp_regs;
+ fregs[addr - FPR_BASE] = data;
+ break;
+ }
+ case PC:
+ regs->cp0_epc = data;
+ break;
+ case MMHI:
+ regs->hi = data;
+ break;
+ case MMLO:
+ regs->lo = data;
+ break;
+ case FPC_CSR:
+ child->thread.fpu.hard.control = data;
+ break;
+ default:
+ /* The rest are not allowed. */
+ ret = -EIO;
+ break;
+ }
+ goto out;
+ }
+ case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
+ case PTRACE_CONT: { /* restart after signal. */
+ ret = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
+ if (request == PTRACE_SYSCALL)
+ child->flags |= PF_TRACESYS;
+ else
+ child->flags &= ~PF_TRACESYS;
+ child->exit_code = data;
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+/*
+ * make the child exit. Best I can do is send it a sigkill.
+ * perhaps it should be put in the status that it wants to
+ * exit.
+ */
+ case PTRACE_KILL: {
+ if (child->state == TASK_ZOMBIE) /* already dead */
+ break;
+ child->exit_code = SIGKILL;
+ wake_up_process(child);
+ break;
+ }
+
+ case PTRACE_DETACH: { /* detach a process that was attached. */
+ ret = -EIO;
+ if ((unsigned long) data > _NSIG)
+ break;
+ child->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ child->exit_code = data;
+ write_lock_irq(&tasklist_lock);
+ REMOVE_LINKS(child);
+ child->p_pptr = child->p_opptr;
+ SET_LINKS(child);
+ write_unlock_irq(&tasklist_lock);
+ wake_up_process(child);
+ ret = 0;
+ break;
+ }
+
+ default:
+ ret = -EIO;
+ break;
+ }
+
+out_tsk:
+ free_task_struct(child);
+out:
+ unlock_kernel();
+ return ret;
+}
asmlinkage void syscall_trace(void)
{
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/r4k_cache.S linux/arch/mips64/kernel/r4k_cache.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/r4k_cache.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/r4k_cache.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: r4k_cache.S,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: r4k_cache.S,v 1.1 1999/10/10 18:49:17 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/r4k_fpu.S linux/arch/mips64/kernel/r4k_fpu.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/r4k_fpu.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/r4k_fpu.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: r4k_fpu.S,v 1.1 1999/09/28 22:25:52 ralf Exp $
+/* $Id: r4k_fpu.S,v 1.1 1999/09/27 16:01:38 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/r4k_genex.S linux/arch/mips64/kernel/r4k_genex.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/r4k_genex.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/r4k_genex.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: r4k_genex.S,v 1.3 2000/01/20 23:32:21 ralf Exp $
+/* $Id: r4k_genex.S,v 1.3 1999/11/23 17:12:49 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -69,6 +69,14 @@
NESTED(handle_\exception, PT_SIZE, sp)
.set noat
SAVE_ALL
+#if DEBUG_MIPS64
+jal dodebug2
+ld $4, PT_R4(sp)
+ld $5, PT_R5(sp)
+ld $6, PT_R6(sp)
+ld $7, PT_R7(sp)
+ld $2, PT_R2(sp)
+#endif
__BUILD_clear_\clear
.set at
__BUILD_\verbose \exception
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/r4k_switch.S linux/arch/mips64/kernel/r4k_switch.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/r4k_switch.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/r4k_switch.S Sat May 13 08:30:17 2000
@@ -9,6 +9,7 @@
* Copyright (C) 1994, 1995, 1996, by Andreas Busse
* Copyright (C) 1999 Silicon Graphics, Inc.
*/
+#include
#include
#include
#include
@@ -43,8 +44,14 @@
*/
move $28, a1
cpu_restore_nonscratch $28
+#ifndef CONFIG_SMP
daddiu t0, $28, KERNEL_STACK_SIZE-32
sd t0, kernelsp
+#else
+ mtc0 a1, CP0_WATCHLO
+ dsrl32 a1, a1, 0
+ mtc0 a1, CP0_WATCHHI
+#endif
mfc0 t1, CP0_STATUS /* Do we really need this? */
li a3, 0xff00
and t1, a3
@@ -73,7 +80,7 @@
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 @@
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 @@
1:
.set reorder
fpu_restore_16even $28, t0 # clobbers t0
+3:
jr ra
END(lazy_fpu_switch)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/r4k_tlb_debug.c linux/arch/mips64/kernel/r4k_tlb_debug.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/r4k_tlb_debug.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/r4k_tlb_debug.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: r4k_tlb_debug.c,v 1.3 2000/01/29 01:41:59 ralf Exp $
+/* $Id: r4k_tlb_debug.c,v 1.2 2000/01/17 23:32:46 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/r4k_tlb_glue.S linux/arch/mips64/kernel/r4k_tlb_glue.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/r4k_tlb_glue.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/r4k_tlb_glue.S Sat May 13 08:30:17 2000
@@ -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 @@
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 @@
END(__\name)
.endm
- tlb_handler tlb_refill_debug
- tlb_handler xtlb_refill_debug
- tlb_handler xtlb_mod_debug
- tlb_handler xtlb_tlbl_debug
- tlb_handler xtlb_tlbs_debug
+ tlb_handler tlb_refill_debug cli
+ tlb_handler xtlb_refill_debug cli
+ tlb_handler xtlb_mod_debug sti
+ tlb_handler xtlb_tlbl_debug sti
+ tlb_handler xtlb_tlbs_debug sti
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/scall_64.S linux/arch/mips64/kernel/scall_64.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/scall_64.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/scall_64.S Sat May 13 08:30:17 2000
@@ -22,9 +22,6 @@
/* This duplicates the definition from */
#define SIGILL 4 /* Illegal instruction (ANSI). */
-/* Highest syscall handled here. */
-#define MAX_SYSCALL_NO __NR_Linux + __NR_Linux_syscalls
-
#ifndef CONFIG_MIPS32_COMPAT
#define handle_sys64 handle_sys
#endif
@@ -35,18 +32,19 @@
#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 @@
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 @@
PTR sys_ni_syscall
PTR sys_ni_syscall
PTR sys_pivot_root /* 4210 */
+ PTR sys_mincore
+ PTR sys_madvise
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/scall_o32.S linux/arch/mips64/kernel/scall_o32.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/scall_o32.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/scall_o32.S Sat May 13 08:30:17 2000
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
sys sys_lstat64 3
sys sys_fstat64 3 /* 4210 */
sys sys_pivot_root 2
+ sys sys_mincore 3
+ sys sys_madvise 3
.endm
.macro sys function, nargs
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/setup.c linux/arch/mips64/kernel/setup.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/setup.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/setup.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.7 2000/02/04 07:40:24 ralf Exp $
+/* $Id: setup.c,v 1.9 2000/03/14 01:39:27 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -37,10 +37,13 @@
#include
#ifdef CONFIG_SGI_IP27
+/* XXX Origin garbage has no business in this file */
#include
#endif
-struct mips_cpuinfo boot_cpu_data;
+#ifndef CONFIG_SMP
+struct cpuinfo_mips cpu_data[1];
+#endif
#ifdef CONFIG_VT
struct screen_info screen_info;
@@ -102,7 +105,10 @@
* 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 @@
*memory_start_p = initrd_end;
}
#endif
+
+ paging_init();
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/signal.c linux/arch/mips64/kernel/signal.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/signal.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/signal.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: signal.c,v 1.5 2000/02/04 07:40:24 ralf Exp $
+/* $Id: signal.c,v 1.4 2000/01/17 23:32:46 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -26,6 +26,7 @@
#include
#include
#include
+#include
#define DEBUG_SIG 0
@@ -37,6 +38,35 @@
extern asmlinkage int save_fp_context(struct sigcontext *sc);
extern asmlinkage int restore_fp_context(struct sigcontext *sc);
+static inline int store_fp_context(struct sigcontext *sc)
+{
+ unsigned int fcr0;
+ int err = 0;
+
+ err |= __copy_to_user(&sc->sc_fpregs[0],
+ ¤t->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS *
+ sizeof(unsigned long));
+ err |= __copy_to_user(&sc->sc_fpc_csr, ¤t->thread.fpu.hard.control,
+ sizeof(unsigned int));
+ __asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0));
+ err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int));
+
+ return err;
+}
+
+static inline int refill_fp_context(struct sigcontext *sc)
+{
+ int err = 0;
+
+ if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
+ return -EFAULT;
+ err |= __copy_from_user(¤t->thread.fpu.hard.fp_regs[0],
+ &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long));
+ err |= __copy_from_user(¤t->thread.fpu.hard.control, &sc->sc_fpc_csr,
+ sizeof(unsigned int));
+ return err;
+}
+
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
@@ -180,8 +210,12 @@
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 @@
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 @@
err |= __put_user(regs->cp0_cause, &sc->sc_cause);
err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr);
- owned_fp = (current == last_task_used_math);
- err |= __put_user(owned_fp, &sc->sc_ownedfp);
-
if (current->used_math) { /* fp is active. */
- set_cp0_status(ST0_CU1, ST0_CU1);
- err |= save_fp_context(sc);
- last_task_used_math = NULL;
- regs->cp0_status &= ~ST0_CU1;
+ if (IS_FPU_OWNER()) {
+ lazy_fpu_switch(current, 0);
+ CLEAR_FPU_OWNER();
+ regs->cp0_status &= ~ST0_CU1;
+ }
+ err |= __put_user(1, &sc->sc_ownedfp);
+ err |= store_fp_context(sc);
current->used_math = 0;
+ } else {
+ err |= __put_user(0, &sc->sc_ownedfp);
}
+ err |= __put_user(regs->cp0_status, &sc->sc_status);
return err;
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/signal32.c linux/arch/mips64/kernel/signal32.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/signal32.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips64/kernel/signal32.c Mon May 15 12:10:26 2000
@@ -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
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#define DEBUG_SIG 0
@@ -38,12 +39,11 @@
/* 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 +65,35 @@
} stack32_t;
+static inline int store_fp_context(struct sigcontext *sc)
+{
+ unsigned int fcr0;
+ int err = 0;
+
+ err |= __copy_to_user(&sc->sc_fpregs[0],
+ ¤t->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS *
+ sizeof(unsigned long));
+ err |= __copy_to_user(&sc->sc_fpc_csr, ¤t->thread.fpu.hard.control,
+ sizeof(unsigned int));
+ __asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0));
+ err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int));
+
+ return err;
+}
+
+static inline int refill_fp_context(struct sigcontext *sc)
+{
+ int err = 0;
+
+ if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
+ return -EFAULT;
+ err |= __copy_from_user(¤t->thread.fpu.hard.fp_regs[0],
+ &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long));
+ err |= __copy_from_user(¤t->thread.fpu.hard.control, &sc->sc_fpc_csr,
+ sizeof(unsigned int));
+ return err;
+}
+
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
@@ -211,8 +240,12 @@
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 +270,10 @@
{
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 +350,9 @@
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 +373,19 @@
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 +427,10 @@
/*
* 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 +490,10 @@
/*
* 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 +592,10 @@
{
struct k_sigaction *ka;
siginfo_t info;
+
+#if DEBUG_MIPS64
printk("%s: delivering signal.\n", current->comm);
+#endif
if (!oldset)
oldset = ¤t->blocked;
@@ -656,7 +696,9 @@
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;
}
@@ -674,6 +716,25 @@
regs->cp0_epc -= 8;
}
}
+ 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;
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/smp.c linux/arch/mips64/kernel/smp.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/smp.c Wed Dec 31 16:00:00 1969
+++ linux/arch/mips64/kernel/smp.c Sat May 13 08:30:17 2000
@@ -0,0 +1,258 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef CONFIG_SGI_IP27
+
+#include
+#include
+#include
+#include
+#include
+
+#define DORESCHED 0xab
+#define DOCALL 0xbc
+
+#define IRQ_TO_SWLEVEL(i) i + 7 /* Delete this from here */
+
+static void sendintr(int destid, unsigned char status)
+{
+ int irq;
+
+#if (CPUS_PER_NODE == 2)
+ switch (status) {
+ case DORESCHED: irq = CPU_RESCHED_A_IRQ; break;
+ case DOCALL: irq = CPU_CALL_A_IRQ; break;
+ default: panic("sendintr");
+ }
+ irq += cputoslice(destid);
+
+ /*
+ * Convert the compact hub number to the NASID to get the correct
+ * part of the address space. Then set the interrupt bit associated
+ * with the CPU we want to send the interrupt to.
+ */
+ REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cputocnode(destid)),
+ IRQ_TO_SWLEVEL(irq));
+#else
+ << Bomb! Must redefine this for more than 2 CPUS. >>
+#endif
+}
+
+#endif /* CONFIG_SGI_IP27 */
+
+/* The 'big kernel lock' */
+spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+int smp_threads_ready = 0; /* Not used */
+atomic_t smp_commenced = ATOMIC_INIT(0);
+struct cpuinfo_mips cpu_data[NR_CPUS];
+int smp_num_cpus; /* Number that came online. */
+int __cpu_number_map[NR_CPUS];
+int __cpu_logical_map[NR_CPUS];
+cycles_t cacheflush_time;
+
+static void smp_tune_scheduling (void)
+{
+}
+
+void __init smp_boot_cpus(void)
+{
+ extern void allowboot(void);
+ extern int maxcpus;
+
+ init_new_context(current, &init_mm);
+ global_irq_holder = 0;
+ current->processor = 0;
+ init_idle();
+ smp_tune_scheduling();
+ smp_num_cpus = maxcpus;
+ allowboot();
+}
+
+void __init smp_commence(void)
+{
+ wmb();
+ atomic_set(&smp_commenced,1);
+}
+
+static void stop_this_cpu(void *dummy)
+{
+ /*
+ * Remove this CPU
+ */
+ for (;;);
+}
+
+void smp_send_stop(void)
+{
+ smp_call_function(stop_this_cpu, NULL, 1, 0);
+ smp_num_cpus = 1;
+}
+
+/*
+ * this function sends a 'reschedule' IPI to another CPU.
+ * it goes straight through and wastes no time serializing
+ * anything. Worst case is that we lose a reschedule ...
+ */
+void smp_send_reschedule(int cpu)
+{
+ sendintr(cpu, DORESCHED);
+}
+
+/* Not really SMP stuff ... */
+int setup_profiling_timer(unsigned int multiplier)
+{
+ return 0;
+}
+
+/*
+ * Run a function on all other CPUs.
+ * The function to run. This must be fast and non-blocking.
+ * An arbitrary pointer to pass to the function.
+ * If true, keep retrying until ready.
+ * If true, wait until function has completed on other CPUs.
+ * [RETURNS] 0 on success, else a negative status code.
+ *
+ * Does not return until remote CPUs are nearly ready to execute
+ * or are or have executed.
+ */
+static volatile struct call_data_struct {
+ void (*func) (void *info);
+ void *info;
+ atomic_t started;
+ atomic_t finished;
+ int wait;
+} *call_data = NULL;
+
+int smp_call_function (void (*func) (void *info), void *info, int retry,
+ int wait)
+{
+ struct call_data_struct data;
+ int i, cpus = smp_num_cpus-1;
+ static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+
+ if (cpus == 0)
+ return 0;
+
+ data.func = func;
+ data.info = info;
+ atomic_set(&data.started, 0);
+ data.wait = wait;
+ if (wait)
+ atomic_set(&data.finished, 0);
+
+ spin_lock_bh(&lock);
+ call_data = &data;
+ /* Send a message to all other CPUs and wait for them to respond */
+ for (i = 0; i < smp_num_cpus; i++)
+ if (smp_processor_id() != i)
+ sendintr(i, DOCALL);
+
+ /* Wait for response */
+ /* FIXME: lock-up detection, backtrace on lock-up */
+ while (atomic_read(&data.started) != cpus)
+ barrier();
+
+ if (wait)
+ while (atomic_read(&data.finished) != cpus)
+ barrier();
+ spin_unlock_bh(&lock);
+ return 0;
+}
+
+void smp_call_function_interrupt(void)
+{
+ void (*func) (void *info) = call_data->func;
+ void *info = call_data->info;
+ int wait = call_data->wait;
+
+ /*
+ * Notify initiating CPU that I've grabbed the data and am
+ * about to execute the function.
+ */
+ atomic_inc(&call_data->started);
+
+ /*
+ * At this point the info structure may be out of scope unless wait==1.
+ */
+ (*func)(info);
+ if (wait)
+ atomic_inc(&call_data->finished);
+}
+
+
+static void flush_tlb_all_ipi(void *info)
+{
+ _flush_tlb_all();
+}
+
+void flush_tlb_all(void)
+{
+ smp_call_function(flush_tlb_all_ipi, 0, 1, 1);
+ _flush_tlb_all();
+}
+
+static void flush_tlb_mm_ipi(void *mm)
+{
+ _flush_tlb_mm((struct mm_struct *)mm);
+}
+
+void flush_tlb_mm(struct mm_struct *mm)
+{
+ smp_call_function(flush_tlb_mm_ipi, (void *)mm, 1, 1);
+ _flush_tlb_mm(mm);
+}
+
+struct flush_tlb_data {
+ struct mm_struct *mm;
+ struct vm_area_struct *vma;
+ unsigned long addr1;
+ unsigned long addr2;
+};
+
+static void flush_tlb_range_ipi(void *info)
+{
+ struct flush_tlb_data *fd = (struct flush_tlb_data *)info;
+
+ _flush_tlb_range(fd->mm, fd->addr1, fd->addr2);
+}
+
+void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end)
+{
+ struct flush_tlb_data fd;
+
+ fd.mm = mm;
+ fd.addr1 = start;
+ fd.addr2 = end;
+ smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1, 1);
+ _flush_tlb_range(mm, start, end);
+}
+
+static void flush_tlb_page_ipi(void *info)
+{
+ struct flush_tlb_data *fd = (struct flush_tlb_data *)info;
+
+ _flush_tlb_page(fd->vma, fd->addr1);
+}
+
+void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
+{
+ struct flush_tlb_data fd;
+
+ fd.vma = vma;
+ fd.addr1 = page;
+ smp_call_function(flush_tlb_page_ipi, (void *)&fd, 1, 1);
+ _flush_tlb_page(vma, page);
+}
+
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/softfp.S linux/arch/mips64/kernel/softfp.S
--- v2.3.99-pre8/linux/arch/mips64/kernel/softfp.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/softfp.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: softfp.S,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: softfp.S,v 1.2 2000/03/21 23:50:42 ulfc Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -148,7 +148,8 @@
insn: LOCK_KERNEL; \
la a1, 8f; \
TEXT(#insn); \
- la a1, nosim; \
+ la a0, nosim; \
+ jal printk; \
UNLOCK_KERNEL; \
j done
@@ -165,9 +166,9 @@
.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 @@
*/
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 @@
* 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 @@
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 @@
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 @@
/* 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_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 @@
/* 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 @@
* 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 @@
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 @@
move a1, $28
jal force_sig
- lw ra, 16(sp)
- addu sp, 16
+ ld ra, 0(sp)
+ daddu sp, 16
jr ra
/*
* Jump table for the lowest 6 bits of a cp1 instruction.
*/
.data
-lowtab: .word add, sub, mul, div, sqrt, abs, mov, neg
- .word round.l,trunc.l,ceil.l,floor.l,round.w,trunc.w,ceil.w,floor.w
- .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
- .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
- .word cvt.s, cvt.d, unimp, unimp, cvt.w, cvt.l, unimp, unimp
- .word unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
- .word c.f, c.un, c.eq, c.ueq, c.olt, c.ult, c.ole, c.ule
- .word c.sf, c.ngle,c.seq, c.ngl, c.lt, c.nge, c.le, c.ngt
+lowtab: .dword add, sub, mul, div, sqrt, abs, mov, neg
+ .dword round.l,trunc.l,ceil.l,floor.l,round.w,trunc.w,ceil.w,floor.w
+ .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
+ .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
+ .dword cvt.s, cvt.d, unimp, unimp, cvt.w, cvt.l, unimp, unimp
+ .dword unimp, unimp, unimp, unimp, unimp, unimp, unimp, unimp
+ .dword c.f, c.un, c.eq, c.ueq, c.olt, c.ult, c.ole, c.ule
+ .dword c.sf, c.ngle,c.seq, c.ngl, c.lt, c.nge, c.le, c.ngt
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/syscall.c linux/arch/mips64/kernel/syscall.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/syscall.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips64/kernel/syscall.c Sat May 13 08:30:17 2000
@@ -108,7 +108,6 @@
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 @@
putname(filename);
out:
- unlock_kernel();
return error;
}
@@ -322,4 +320,11 @@
asmlinkage void bad_stack(void)
{
do_exit(SIGSEGV);
+}
+
+asmlinkage int sys_pause(void)
+{
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ return -ERESTARTNOHAND;
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/traps.c linux/arch/mips64/kernel/traps.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/traps.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/traps.c Sat May 13 08:30:17 2000
@@ -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_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 @@
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 @@
mips4_available = 1;
set_cp0_status(ST0_XX, ST0_XX);
}
- mips4_available = 0;
}
static inline void go_64(void)
@@ -561,5 +572,4 @@
atomic_inc(&init_mm.mm_count); /* XXX UP? */
current->active_mm = &init_mm;
- current_pgd = init_mm.pgd;
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/kernel/unaligned.c linux/arch/mips64/kernel/unaligned.c
--- v2.3.99-pre8/linux/arch/mips64/kernel/unaligned.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/kernel/unaligned.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: unaligned.c,v 1.2 2000/01/17 23:32:46 ralf Exp $
+/* $Id: unaligned.c,v 1.2 1999/11/23 17:12:50 ralf Exp $
*
* Handle unaligned accesses by emulation.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/Makefile linux/arch/mips64/lib/Makefile
--- v2.3.99-pre8/linux/arch/mips64/lib/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/Makefile Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 1999/12/04 03:59:00 ralf Exp $
+# $Id: Makefile,v 1.2 1999/11/19 20:35:22 ralf Exp $
#
# Makefile for MIPS-specific library files..
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/csum_partial.S linux/arch/mips64/lib/csum_partial.S
--- v2.3.99-pre8/linux/arch/mips64/lib/csum_partial.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/csum_partial.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: csum_partial.S,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: csum_partial.S,v 1.1 1999/08/21 21:43:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/csum_partial_copy.c linux/arch/mips64/lib/csum_partial_copy.c
--- v2.3.99-pre8/linux/arch/mips64/lib/csum_partial_copy.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/csum_partial_copy.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: csum_partial_copy.c,v 1.3 2000/02/05 06:47:09 ralf Exp $
+/* $Id: csum_partial_copy.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/floppy-no.c linux/arch/mips64/lib/floppy-no.c
--- v2.3.99-pre8/linux/arch/mips64/lib/floppy-no.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/floppy-no.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: floppy-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: floppy-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/floppy-std.c linux/arch/mips64/lib/floppy-std.c
--- v2.3.99-pre8/linux/arch/mips64/lib/floppy-std.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/floppy-std.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: floppy-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: floppy-std.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/ide-no.c linux/arch/mips64/lib/ide-no.c
--- v2.3.99-pre8/linux/arch/mips64/lib/ide-no.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/ide-no.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ide-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: ide-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/ide-std.c linux/arch/mips64/lib/ide-std.c
--- v2.3.99-pre8/linux/arch/mips64/lib/ide-std.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/ide-std.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ide-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: ide-std.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/kbd-no.c linux/arch/mips64/lib/kbd-no.c
--- v2.3.99-pre8/linux/arch/mips64/lib/kbd-no.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/kbd-no.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: kbd-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: kbd-no.c,v 1.1 1999/08/21 21:43:00 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/kbd-std.c linux/arch/mips64/lib/kbd-std.c
--- v2.3.99-pre8/linux/arch/mips64/lib/kbd-std.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/kbd-std.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: kbd-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: kbd-std.c,v 1.1 1999/08/21 21:43:01 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/memcpy.S linux/arch/mips64/lib/memcpy.S
--- v2.3.99-pre8/linux/arch/mips64/lib/memcpy.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/memcpy.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: memcpy.S,v 1.4 2000/01/27 01:05:24 ralf Exp $
+/* $Id: memcpy.S,v 1.2 1999/10/19 20:51:51 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/memset.S linux/arch/mips64/lib/memset.S
--- v2.3.99-pre8/linux/arch/mips64/lib/memset.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/memset.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: memset.S,v 1.3 2000/01/16 01:37:19 ralf Exp $
+/* $Id: memset.S,v 1.3 2000/01/15 23:48:55 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/rtc-no.c linux/arch/mips64/lib/rtc-no.c
--- v2.3.99-pre8/linux/arch/mips64/lib/rtc-no.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/rtc-no.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: rtc-no.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: rtc-no.c,v 1.1 1999/08/21 21:43:01 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/rtc-std.c linux/arch/mips64/lib/rtc-std.c
--- v2.3.99-pre8/linux/arch/mips64/lib/rtc-std.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/rtc-std.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: rtc-std.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: rtc-std.c,v 1.1 1999/08/21 21:43:01 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/strlen_user.S linux/arch/mips64/lib/strlen_user.S
--- v2.3.99-pre8/linux/arch/mips64/lib/strlen_user.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/strlen_user.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: strlen_user.S,v 1.3 2000/01/17 23:32:46 ralf Exp $
+/* $Id: strlen_user.S,v 1.2 1999/11/19 20:35:22 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/strncpy_user.S linux/arch/mips64/lib/strncpy_user.S
--- v2.3.99-pre8/linux/arch/mips64/lib/strncpy_user.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/strncpy_user.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: strncpy_user.S,v 1.3 2000/01/17 23:32:46 ralf Exp $
+/* $Id: strncpy_user.S,v 1.2 1999/11/19 20:35:23 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/strnlen_user.S linux/arch/mips64/lib/strnlen_user.S
--- v2.3.99-pre8/linux/arch/mips64/lib/strnlen_user.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/strnlen_user.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: strnlen_user.S,v 1.1 1999/12/04 03:59:00 ralf Exp $
+/* $Id: strnlen_user.S,v 1.1 1999/11/19 20:35:23 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/lib/watch.S linux/arch/mips64/lib/watch.S
--- v2.3.99-pre8/linux/arch/mips64/lib/watch.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/lib/watch.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: watch.S,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: watch.S,v 1.1 1999/08/21 21:43:01 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/Makefile linux/arch/mips64/mm/Makefile
--- v2.3.99-pre8/linux/arch/mips64/mm/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/mm/Makefile Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 2000/02/24 00:12:41 ralf Exp $
+# $Id: Makefile,v 1.4 2000/01/17 23:32:46 ralf Exp $
#
# Makefile for the Linux/MIPS-specific parts of the memory manager.
#
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/andes.c linux/arch/mips64/mm/andes.c
--- v2.3.99-pre8/linux/arch/mips64/mm/andes.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/mm/andes.c Sat May 13 08:30:17 2000
@@ -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 @@
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 @@
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 @@
* 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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
finish:
BARRIER;
set_entryhi(oldpid);
- restore_flags(flags);
+ __restore_flags(flags);
}
}
@@ -354,17 +355,16 @@
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 @@
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 @@
write_32bit_cp0_register(CP0_PAGEMASK, PM_4K);
/* From this point on the ARC firmware is dead. */
- flush_tlb_all();
+ _flush_tlb_all();
/* Did I tell you that ARC SUCKS? */
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/extable.c linux/arch/mips64/mm/extable.c
--- v2.3.99-pre8/linux/arch/mips64/mm/extable.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/mm/extable.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: extable.c,v 1.2 1999/12/04 03:59:00 ralf Exp $
+/* $Id: extable.c,v 1.2 1999/11/23 17:12:50 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/fault.c linux/arch/mips64/mm/fault.c
--- v2.3.99-pre8/linux/arch/mips64/mm/fault.c Wed Apr 26 16:34:07 2000
+++ linux/arch/mips64/mm/fault.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: fault.c,v 1.6 2000/02/18 00:24:31 ralf Exp $
+/* $Id: fault.c,v 1.7 2000/03/13 22:43:25 kanoj Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -27,18 +27,36 @@
#include
#include
#include
+#include
#define development_version (LINUX_VERSION_CODE & 0x100)
extern void die(char *, struct pt_regs *, unsigned long write);
-unsigned long asid_cache;
-
/*
* Macro for exception fixup code to access integer registers.
*/
#define dpf_reg(r) (regs->regs[r])
+asmlinkage void
+dodebug(abi64_no_regargs, struct pt_regs regs)
+{
+ printk("Got syscall %d, cpu %d proc %s:%d epc 0x%lx\n", regs.regs[2], smp_processor_id(), current->comm, current->pid, regs.cp0_epc);
+}
+
+asmlinkage void
+dodebug2(abi64_no_regargs, struct pt_regs regs)
+{
+ unsigned long retaddr;
+
+ __asm__ __volatile__(
+ ".set noreorder\n\t"
+ "add %0,$0,$31\n\t"
+ ".set reorder"
+ : "=r" (retaddr));
+ printk("Got exception 0x%lx at 0x%lx\n", retaddr, regs.cp0_epc);
+}
+
/*
* This routine handles page faults. It determines the address,
* and the problem, and then passes it off to one of the appropriate
@@ -59,9 +77,9 @@
*/
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 @@
* 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 @@
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.
*/
- printk(KERN_ALERT "Unable to handle kernel paging request at virtual "
+ printk(KERN_ALERT "Cpu %d Unable to handle kernel paging request at "
"address %08lx, epc == %08lx, ra == %08lx\n",
- address, regs->cp0_epc, regs->regs[31]);
-while(1);
+ smp_processor_id(), address, regs->cp0_epc, regs->regs[31]);
die("Oops", regs, write);
do_exit(SIGKILL);
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/init.c linux/arch/mips64/mm/init.c
--- v2.3.99-pre8/linux/arch/mips64/mm/init.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/mm/init.c Sat May 13 08:30:17 2000
@@ -87,6 +87,8 @@
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 @@
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 @@
unsigned long page;
page = (unsigned long) invalid_pmd_table;
- pte_init(page);
+ pmd_init(page);
return (pmd_t *) page;
}
@@ -345,8 +347,8 @@
/* Initialize the entire pgd. */
pgd_init((unsigned long)swapper_pg_dir);
- pgd_init((unsigned long)swapper_pg_dir + PAGE_SIZE / 2);
pmd_init((unsigned long)invalid_pmd_table);
+ memset((void *)invalid_pte_table, 0, sizeof(pte_t) * 2 * PTRS_PER_PTE);
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
low = max_low_pfn;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/loadmmu.c linux/arch/mips64/mm/loadmmu.c
--- v2.3.99-pre8/linux/arch/mips64/mm/loadmmu.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/mm/loadmmu.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: loadmmu.c,v 1.6 2000/02/24 00:12:41 ralf Exp $
+/* $Id: loadmmu.c,v 1.5 2000/01/27 01:05:24 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/r4xx0.c linux/arch/mips64/mm/r4xx0.c
--- v2.3.99-pre8/linux/arch/mips64/mm/r4xx0.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/mm/r4xx0.c Sat May 13 08:30:17 2000
@@ -784,7 +784,7 @@
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 @@
#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 @@
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 @@
#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 @@
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 @@
#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 @@
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 @@
#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 @@
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 @@
#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 @@
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 @@
#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 @@
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 @@
#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 @@
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 @@
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 @@
*/
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_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_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_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_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_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_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_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_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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
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 @@
}
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 @@
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 @@
}
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_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 @@
finish:
BARRIER;
set_entryhi(oldpid);
- restore_flags(flags);
+ __restore_flags(flags);
}
}
@@ -2150,16 +2165,18 @@
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 @@
* be set for 4kb pages.
*/
write_32bit_cp0_register(CP0_PAGEMASK, PM_4K);
- flush_tlb_all();
+ _flush_tlb_all();
}
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/mm/umap.c linux/arch/mips64/mm/umap.c
--- v2.3.99-pre8/linux/arch/mips64/mm/umap.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/mm/umap.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: umap.c,v 1.5 2000/02/04 07:40:24 ralf Exp $
+/* $Id: umap.c,v 1.4 2000/01/29 01:41:59 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/Makefile linux/arch/mips64/sgi-ip22/Makefile
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/Makefile Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 2000/01/21 22:34:03 ralf Exp $
+# $Id: Makefile,v 1.1 1999/08/20 21:13:33 ralf Exp $
#
# Makefile for the SGI specific kernel interface routines
# under Linux.
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-berr.c linux/arch/mips64/sgi-ip22/ip22-berr.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-berr.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-berr.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-berr.c,v 1.2 2000/02/24 00:12:41 ralf Exp $
+/* $Id: ip22-berr.c,v 1.1 2000/01/21 22:34:03 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-hpc.c linux/arch/mips64/sgi-ip22/ip22-hpc.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-hpc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-hpc.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-hpc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-hpc.c,v 1.2 1999/10/19 20:51:52 ralf Exp $
*
* ip22-hpc.c: Routines for generic manipulation of the HPC controllers.
*
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-int.c linux/arch/mips64/sgi-ip22/ip22-int.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-int.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-int.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-int.c,v 1.4 2000/02/04 07:40:24 ralf Exp $
+/* $Id: ip22-int.c,v 1.5 2000/03/02 02:36:50 ralf Exp $
*
* indy_int.c: Routines for generic manipulation of the INT[23] ASIC
* found on INDY workstations..
@@ -37,6 +37,24 @@
#include
#include
+/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the apropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+irq_cpustat_t irq_stat [NR_CPUS];
+
struct sgi_int2_regs *sgi_i2regs;
struct sgi_int3_regs *sgi_i3regs;
struct sgi_ioc_ints *ioc_icontrol;
@@ -272,7 +290,7 @@
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 @@
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 @@
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 @@
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 @@
int cpu = smp_processor_id();
int irq = 6;
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[0][irq]++;
printk("Got a bus error IRQ, shouldn't happen yet\n");
show_regs(regs);
printk("Spinning...\n");
while(1);
- irq_exit(cpu);
+ irq_exit(cpu, irq);
}
/* Misc. crap just to keep the kernel linking... */
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-irq.S linux/arch/mips64/sgi-ip22/ip22-irq.S
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-irq.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-irq.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-irq.S,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-irq.S,v 1.1 1999/08/20 21:13:33 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-mc.c linux/arch/mips64/sgi-ip22/ip22-mc.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-mc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-mc.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-mc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-mc.c,v 1.2 1999/10/19 20:51:52 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-reset.c linux/arch/mips64/sgi-ip22/ip22-reset.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-reset.c Thu May 11 15:30:06 2000
+++ linux/arch/mips64/sgi-ip22/ip22-reset.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-reset.c,v 1.3 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-reset.c,v 1.3 1999/10/08 21:07:51 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-rtc.c linux/arch/mips64/sgi-ip22/ip22-rtc.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-rtc.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-rtc.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-rtc.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: ip22-rtc.c,v 1.1 1999/08/20 21:13:34 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-sc.c linux/arch/mips64/sgi-ip22/ip22-sc.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-sc.c Mon Mar 27 08:08:22 2000
+++ linux/arch/mips64/sgi-ip22/ip22-sc.c Sat May 13 08:30:17 2000
@@ -27,7 +27,6 @@
#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 @@
#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 @@
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 @@
void __init indy_sc_init(void)
{
-return; /* Not for now, debugging ... */
if (indy_sc_probe()) {
indy_sc_enable();
bcops = &indy_sc_ops;
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-setup.c linux/arch/mips64/sgi-ip22/ip22-setup.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-setup.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-setup.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip22-setup.c,v 1.5 2000/01/27 01:05:24 ralf Exp $
+/* $Id: ip22-setup.c,v 1.4 1999/10/08 21:07:51 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-timer.c linux/arch/mips64/sgi-ip22/ip22-timer.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/ip22-timer.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/ip22-timer.c Sat May 13 08:30:17 2000
@@ -267,12 +267,12 @@
int cpu = smp_processor_id();
int irq = 4;
- irq_enter(cpu);
+ irq_enter(cpu, irq);
kstat.irqs[0][irq]++;
printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
prom_getchar();
ArcEnterInteractiveMode();
- irq_exit(cpu);
+ irq_exit(cpu, irq);
}
void do_gettimeofday(struct timeval *tv)
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/system.c linux/arch/mips64/sgi-ip22/system.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/system.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/system.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: system.c,v 1.3 1999/12/04 03:59:01 ralf Exp $
+/* $Id: system.c,v 1.3 1999/10/19 20:51:52 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip22/time.c linux/arch/mips64/sgi-ip22/time.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip22/time.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip22/time.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.2 1999/12/04 03:59:01 ralf Exp $
+/* $Id: time.c,v 1.1 1999/08/20 21:13:34 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip27/Makefile linux/arch/mips64/sgi-ip27/Makefile
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip27/Makefile Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip27/Makefile Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 2000/02/18 00:24:31 ralf Exp $
+# $Id: Makefile,v 1.3 2000/02/04 08:41:40 kanoj Exp $
#
# Makefile for the IP27 specific kernel interface routines under Linux.
#
@@ -11,6 +11,6 @@
L_TARGET = ip27.a
L_OBJS = ip27-berr.o ip27-irq.o ip27-irq-glue.o ip27-klconfig.o \
ip27-memory.o ip27-pci.o ip27-pci-dma.o ip27-reset.o ip27-setup.o \
- ip27-timer.o ip27-init.o
+ ip27-timer.o ip27-init.o ip27-nmi.o
include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip27/TODO linux/arch/mips64/sgi-ip27/TODO
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip27/TODO Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip27/TODO Sat May 13 08:30:17 2000
@@ -4,8 +4,20 @@
3. Need to figure out why address swaizzling is needed in inw/outw for
Qlogic scsi controllers.
4. Need to integrate ip27-klconfig.c:find_lboard and
-ip27-init.c:find_lbaord_real.
+ip27-init.c:find_lbaord_real. DONE
5. Is it okay to set calias space on all nodes as 0, instead of 8k as
in irix?
6. Investigate why things do not work without the setup_test() call
being invoked on all nodes in ip27-memory.c.
+7. Too many CLIs in the locore handlers :
+For the low level handlers set up by set_except_vector(),
+__tlb_refill_debug_tramp, __xtlb_refill_debug_tramp and cacheerror,
+investigate whether the code should do CLI, STI or KMODE.
+8. Too many do_page_faults invoked - investigate.
+9. start_thread must turn off UX64 ... and define tlb_refill_debug.
+10. Need a bad pmd table, bad pte table. __bad_pmd_table/__bad_pagetable
+does not agree with pgd_bad/pmd_bad.
+11. All intrs (ip27_do_irq handlers) are targetted at cpu A on the node.
+This might need to change later. Only the timer intr is set up to be
+received on both Cpu A and B. (ip27_do_irq()/bridge_startup())
+13. Cache flushing (specially the SMP version) has to be investigated.
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-berr.c linux/arch/mips64/sgi-ip27/ip27-berr.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-berr.c Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip27/ip27-berr.c Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip27-berr.c,v 1.1 2000/01/20 23:50:27 ralf Exp $
+/* $Id: ip27-berr.c,v 1.1 2000/01/20 22:50:29 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-init.c linux/arch/mips64/sgi-ip27/ip27-init.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-init.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips64/sgi-ip27/ip27-init.c Mon May 15 12:10:26 2000
@@ -1,5 +1,11 @@
+#include
#include
+#include
+#include
#include /* for numnodes */
+#include
+#include
+#include
#include
#include
#include
@@ -8,16 +14,33 @@
#include
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
-typedef unsigned long cpumask_t; /* into asm/sn/types.h */
-typedef unsigned long cpuid_t;
+#define CPU_NONE (cpuid_t)-1
#define CPUMASK_CLRALL(p) (p) = 0
#define CPUMASK_SETB(p, bit) (p) |= 1 << (bit)
+#define CPUMASK_CLRB(p, bit) (p) &= ~(1ULL << (bit))
+#define CPUMASK_TSTB(p, bit) ((p) & (1ULL << (bit)))
+
+#define CNODEMASK_CLRALL(p) (p) = 0
+#define CNODEMASK_TSTB(p, bit) ((p) & (1ULL << (bit)))
+#define CNODEMASK_SETB(p, bit) ((p) |= 1ULL << (bit))
cpumask_t boot_cpumask;
+static volatile cpumask_t boot_barrier;
hubreg_t region_mask = 0;
static int fine_mode = 0;
+int maxcpus;
+static spinlock_t hub_mask_lock = SPIN_LOCK_UNLOCKED;
+static cnodemask_t hub_init_mask;
cnodeid_t nasid_to_compact_node[MAX_NASIDS];
nasid_t compact_to_nasid_node[MAX_COMPACT_NODES];
@@ -47,51 +70,6 @@
>> 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 +95,7 @@
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 +116,7 @@
}
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 +160,38 @@
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 +201,11 @@
*/
CPUMASK_CLRALL(boot_cpumask);
maxcpus = cpu_node_probe(&boot_cpumask, &numnodes);
+ printk("Discovered %d cpus on %d nodes\n", maxcpus, numnodes);
+ initpdas();
gen_region_mask(®ion_mask, numnodes);
+ CNODEMASK_CLRALL(hub_init_mask);
/*
* Set all nodes' calias sizes to 8k
@@ -225,3 +235,257 @@
}
}
+
+void intr_clear_bits(nasid_t nasid, volatile hubreg_t *pend, int base_level,
+ char *name)
+{
+ volatile hubreg_t bits;
+ int i;
+
+ /* Check pending interrupts */
+ if ((bits = HUB_L(pend)) != 0)
+ for (i = 0; i < N_INTPEND_BITS; i++)
+ if (bits & (1 << i))
+ LOCAL_HUB_CLR_INTR(base_level + i);
+}
+
+void intr_clear_all(nasid_t nasid)
+{
+ REMOTE_HUB_S(nasid, PI_INT_MASK0_A, 0);
+ REMOTE_HUB_S(nasid, PI_INT_MASK0_B, 0);
+ REMOTE_HUB_S(nasid, PI_INT_MASK1_A, 0);
+ REMOTE_HUB_S(nasid, PI_INT_MASK1_B, 0);
+ intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND0),
+ INT_PEND0_BASELVL, "INT_PEND0");
+ intr_clear_bits(nasid, REMOTE_HUB_ADDR(nasid, PI_INT_PEND1),
+ INT_PEND1_BASELVL, "INT_PEND1");
+}
+
+void sn_mp_setup(void)
+{
+ cnodeid_t cnode;
+#if 0
+ cpuid_t cpu;
+#endif
+
+ for (cnode = 0; cnode < numnodes; cnode++) {
+#if 0
+ init_platform_nodepda();
+#endif
+ intr_clear_all(COMPACT_TO_NASID_NODEID(cnode));
+ }
+#if 0
+ for (cpu = 0; cpu < maxcpus; cpu++) {
+ init_platform_pda();
+ }
+#endif
+}
+
+void per_hub_init(cnodeid_t cnode)
+{
+ cnodemask_t done;
+
+ spin_lock(&hub_mask_lock);
+ /* Test our bit. */
+ if (!(done = CNODEMASK_TSTB(hub_init_mask, cnode))) {
+ /* Turn our bit on in the mask. */
+ CNODEMASK_SETB(hub_init_mask, cnode);
+ }
+ spin_unlock(&hub_mask_lock);
+
+ /*
+ * Do the actual initialization if it hasn't been done yet.
+ * We don't need to hold a lock for this work.
+ */
+ if (!done) {
+ hub_rtc_init(cnode);
+ }
+}
+
+/*
+ * This is similar to hard_smp_processor_id().
+ */
+cpuid_t getcpuid(void)
+{
+ klcpu_t *klcpu;
+
+ klcpu = nasid_slice_to_cpuinfo(get_nasid(),LOCAL_HUB_L(PI_CPU_NUM));
+ return klcpu->cpu_info.virtid;
+}
+
+void per_cpu_init(void)
+{
+ extern void install_cpu_nmi_handler(int slice);
+ extern void load_mmu(void);
+ static int is_slave = 0;
+ cpuid_t cpu = getcpuid();
+ cnodeid_t cnode = get_compact_nodeid();
+
+ current_cpu_data.asid_cache = ASID_FIRST_VERSION;
+#if 0
+ intr_init();
+#endif
+ set_cp0_status(ST0_IM, 0);
+ per_hub_init(cnode);
+ cpu_time_init();
+ if (smp_processor_id()) /* master can't do this early, no kmalloc */
+ install_cpuintr(cpu);
+ /* Install our NMI handler if symmon hasn't installed one. */
+ install_cpu_nmi_handler(cputoslice(smp_processor_id()));
+#if 0
+ install_tlbintr(cpu);
+#endif
+ set_cp0_status(SRB_DEV0 | SRB_DEV1, SRB_DEV0 | SRB_DEV1);
+ if (is_slave) {
+ set_cp0_status(ST0_BEV, 0);
+ if (mips4_available)
+ set_cp0_status(ST0_XX, ST0_XX);
+ set_cp0_status(ST0_KX|ST0_SX|ST0_UX, ST0_KX|ST0_SX|ST0_UX);
+ sti();
+ load_mmu();
+ }
+ if (is_slave == 0)
+ is_slave = 1;
+}
+
+cnodeid_t get_compact_nodeid(void)
+{
+ nasid_t nasid;
+
+ nasid = get_nasid();
+ /*
+ * Map the physical node id to a virtual node id (virtual node ids
+ * are contiguous).
+ */
+ return NASID_TO_COMPACT_NODEID(nasid);
+}
+
+#ifdef CONFIG_SMP
+
+void __init smp_callin(void)
+{
+#if 0
+ calibrate_delay();
+ smp_store_cpu_info(cpuid);
+#endif
+}
+
+int __init start_secondary(void)
+{
+ extern int cpu_idle(void);
+ extern atomic_t smp_commenced;
+
+ smp_callin();
+ while (!atomic_read(&smp_commenced));
+ return cpu_idle();
+}
+
+static atomic_t numstarted = ATOMIC_INIT(0);
+void cboot(void)
+{
+ atomic_inc(&numstarted);
+ CPUMASK_CLRB(boot_barrier, getcpuid()); /* needs atomicity */
+ per_cpu_init();
+#if 0
+ ecc_init();
+ bte_lateinit();
+ init_mfhi_war();
+#endif
+ _flush_tlb_all();
+ flush_cache_all();
+ start_secondary();
+}
+
+void allowboot(void)
+{
+ int num_cpus = 0;
+ cpuid_t cpu;
+ cnodeid_t cnode;
+ extern void bootstrap(void);
+
+ sn_mp_setup();
+ /* Master has already done per_cpu_init() */
+ install_cpuintr(getcpuid());
+#if 0
+ bte_lateinit();
+ ecc_init();
+#endif
+
+ boot_barrier = boot_cpumask;
+ /* Launch slaves. */
+ for (cpu = 0; cpu < maxcpus; cpu++) {
+ if (cpu == smp_processor_id()) {
+ num_cpus++;
+ /* We're already started, clear our bit */
+ CPUMASK_CLRB(boot_barrier, cpu);
+ continue;
+ }
+
+ /* Skip holes in CPU space */
+ if (CPUMASK_TSTB(boot_cpumask, cpu)) {
+ struct task_struct *p;
+
+ /*
+ * The following code is purely to make sure
+ * Linux can schedule processes on this slave.
+ */
+ kernel_thread(0, NULL, CLONE_PID);
+ p = init_task.prev_task;
+ sprintf(p->comm, "%s%d", "Idle", num_cpus);
+ init_tasks[num_cpus] = p;
+ p->processor = num_cpus;
+ p->has_cpu = 1; /* we schedule the first task manually */
+ del_from_runqueue(p);
+ unhash_process(p);
+ /* Attach to the address space of init_task. */
+ atomic_inc(&init_mm.mm_count);
+ p->active_mm = &init_mm;
+
+ /*
+ * Launch a slave into bootstrap().
+ * It doesn't take an argument, and we
+ * set sp to the kernel stack of the newly
+ * created idle process, gp to the proc struct
+ * (so that current-> works).
+ */
+ LAUNCH_SLAVE(cputonasid(cpu), cputoslice(cpu),
+ (launch_proc_t)bootstrap, 0,
+ (void *)((unsigned long)p+KERNEL_STACK_SIZE - 32),
+ (void *)p);
+
+ /*
+ * Now optimistically set the mapping arrays. We
+ * need to wait here, verify the cpu booted up, then
+ * fire up the next cpu.
+ */
+ __cpu_number_map[cpu] = num_cpus;
+ __cpu_logical_map[num_cpus] = cpu;
+ num_cpus++;
+ /* smp_num_cpus++; Do after smp_send_reschedule works */
+ }
+ }
+
+ /* while(atomic_read(&numstarted) != (maxcpus - num_cpus)) */
+ if (maxcpus > 1) while(atomic_read(&numstarted) == 0);
+ printk("Holding %d cpus slave\n", atomic_read(&numstarted));
+
+#ifdef LATER
+ Wait logic goes here.
+#endif
+ for (cnode = 0; cnode < numnodes; cnode++) {
+#if 0
+ if (cnodetocpu(cnode) == -1) {
+ printk("Initializing headless hub,cnode %d", cnode);
+ per_hub_init(cnode);
+ }
+#endif
+ }
+#if 0
+ cpu_io_setup();
+ init_mfhi_war();
+#endif
+}
+
+#else /* CONFIG_SMP */
+void cboot(void) {}
+#endif /* CONFIG_SMP */
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-irq-glue.S linux/arch/mips64/sgi-ip27/ip27-irq-glue.S
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-irq-glue.S Sat Feb 26 22:31:41 2000
+++ linux/arch/mips64/sgi-ip27/ip27-irq-glue.S Sat May 13 08:30:17 2000
@@ -1,4 +1,4 @@
-/* $Id: ip27-irq-glue.S,v 1.1 2000/01/17 23:32:47 ralf Exp $
+/* $Id$
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff -u --recursive --new-file v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-irq.c linux/arch/mips64/sgi-ip27/ip27-irq.c
--- v2.3.99-pre8/linux/arch/mips64/sgi-ip27/ip27-irq.c Thu Mar 2 14:36:22 2000
+++ linux/arch/mips64/sgi-ip27/ip27-irq.c Mon May 15 12:10:26 2000
@@ -1,14 +1,14 @@
-/* $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.
*
* Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
* Copyright (C) 1999 Silicon Graphics, Inc.
*/
+#include
#include
#include
-#include
#include
#include
#include
@@ -17,8 +17,9 @@
#include
#include
#include
-#include