diff -u --recursive --new-file v2.5.1/linux/Documentation/DocBook/kernel-hacking.tmpl linux/Documentation/DocBook/kernel-hacking.tmpl
--- v2.5.1/linux/Documentation/DocBook/kernel-hacking.tmpl Fri Oct 5 12:06:51 2001
+++ linux/Documentation/DocBook/kernel-hacking.tmpl Thu Dec 20 08:54:23 2001
@@ -18,8 +18,8 @@
- 2000
- Paul Russell
+ 2001
+ Rusty Russell
@@ -651,6 +651,29 @@
+
+ cpu_to_be32()/be32_to_cpu()/cpu_to_le32()/le32_to_cpu()
+
+
+
+
+ The cpu_to_be32() family (where the "32" can
+ be replaced by 64 or 16, and the "be" can be replaced by "le") are
+ the general way to do endian conversions in the kernel: they
+ return the converted value. All variations supply the reverse as
+ well: be32_to_cpu(), etc.
+
+
+
+ There are two major variations of these functions: the pointer
+ variation, such as cpu_to_be32p(), which take
+ a pointer to the given type, and return the converted value. The
+ other variation is the "in-situ" family, such as
+ cpu_to_be32s(), which convert value referred
+ to by the pointer, and return void.
+
+
+
local_irq_save()/local_irq_restore()
diff -u --recursive --new-file v2.5.1/linux/Documentation/filesystems/devfs/ChangeLog linux/Documentation/filesystems/devfs/ChangeLog
--- v2.5.1/linux/Documentation/filesystems/devfs/ChangeLog Tue Dec 18 14:56:34 2001
+++ linux/Documentation/filesystems/devfs/ChangeLog Thu Dec 27 08:29:14 2001
@@ -1794,3 +1794,72 @@
- Use "existing" directory in <_devfs_make_parent_for_leaf>
- Use slab cache rather than fixed buffer for devfsd events
+===============================================================================
+Changes for patch v199
+
+- Removed obsolete usage of DEVFS_FL_NO_PERSISTENCE
+
+- Send DEVFSD_NOTIFY_REGISTERED events in
+
+- Fixed locking bug in due to typo
+
+- Do not send CREATE, CHANGE, ASYNC_OPEN or DELETE events from devfsd
+ or children
+===============================================================================
+Changes for patch v200
+
+- Ported to kernel 2.5.1-pre2
+===============================================================================
+Changes for patch v201
+
+- Fixed bug in : was dereferencing freed pointer
+===============================================================================
+Changes for patch v202
+
+- Fixed bug in : was dereferencing freed pointer
+
+- Added process group check for devfsd privileges
+===============================================================================
+Changes for patch v203
+
+- Use SLAB_ATOMIC in from
+===============================================================================
+Changes for patch v204
+
+- Removed long obsolete rc.devfs
+
+- Return old entry in for 2.4.x kernels
+
+- Updated README from master HTML file
+
+- Increment refcount on module in
+
+- Created and exported
+
+- Increment refcount on module in
+
+- Created and used where needed to fix races
+
+- Added clarifying comments in response to preliminary EMC code review
+
+- Added poisoning to
+
+- Improved debugging messages
+
+- Fixed unregister bugs in drivers/md/lvm-fs.c
+===============================================================================
+Changes for patch v205
+
+- Corrected (made useful) debugging message in
+
+- Moved in to
+
+- Fixed drivers/md/lvm-fs.c to create "lvm" entry
+
+- Added magic number to guard against scribbling drivers
+
+- Only return old entry in if a directory
+
+- Defined macros for error and debug messages
+
+- Updated README from master HTML file
diff -u --recursive --new-file v2.5.1/linux/Documentation/filesystems/devfs/README linux/Documentation/filesystems/devfs/README
--- v2.5.1/linux/Documentation/filesystems/devfs/README Tue Dec 18 14:56:34 2001
+++ linux/Documentation/filesystems/devfs/README Thu Dec 27 08:29:14 2001
@@ -3,7 +3,7 @@
Linux Devfs (Device File System) FAQ
Richard Gooch
-9-NOV-2001
+21-DEC-2001
-----------------------------------------------------------------------------
@@ -66,6 +66,9 @@
Making things work
Alternatives to devfs
+What I don't like about devfs
+How to report bugs
+Strange kernel messages
Other resources
@@ -557,8 +560,10 @@
Devfsd
OK, if you're reading this, I assume you want to play with
-devfs. First you need to compile devfsd, the device management daemon,
-available at
+devfs. First you should ensure that /usr/src/linux contains a
+recent kernel source tree. Then you need to compile devfsd, the device
+management daemon, available at
+
http://www.atnf.csiro.au/~rgooch/linux/.
Because the kernel has a naming scheme
which is quite different from the old naming scheme, you need to
@@ -1470,6 +1475,8 @@
Making things work
Alternatives to devfs
What I don't like about devfs
+How to report bugs
+Strange kernel messages
@@ -1733,6 +1740,93 @@
This is not even remotely true. As shown above,
both code and data size are quite modest.
+
+
+How to report bugs
+
+If you have (or think you have) a bug with devfs, please follow the
+steps below:
+
+
+
+please make sure you have the latest devfs patches applied. The
+latest kernel version might not have the latest devfs patches applied
+yet (Linus is very busy)
+
+
+save a copy of your complete kernel logs (preferably by
+using the dmesg programme) for later inclusion in your bug
+report. You may need to use the -s switch to increase the
+internal buffer size so you can capture all the boot messages
+
+
+try booting with devfs=dall passed to the kernel boot
+command line (read the documentation on your bootloader on how to do
+this), and save the result to a file. This may be quite verbose, and
+it may overflow the messages buffer, but try to get as much of it as
+you can
+
+
+if you get an Oops, run ksymoops to decode it so that the
+names of the offending functions are provided. A non-decoded Oops is
+pretty useless
+
+
+send a copy of your devfsd configuration file(s)
+
+send the bug report to me first.
+Don't expect that I will see it if you post it to the linux-kernel
+mailing list. Include all the information listed above, plus
+anything else that you think might be relevant. Put the string
+devfs somewhere in the subject line, so my mail filters mark
+it as urgent
+
+
+
+
+Here is a general guide on how to ask questions in a way that greatly
+improves your chances of getting a reply:
+
+http://www.tuxedo.org/~esr/faqs/smart-questions.html. If you have
+a bug to report, you should also read
+
+http://www.chiark.greenend.org.uk/~sgtatham/bugs.html.
+
+
+Strange kernel messages
+
+You may see devfs-related messages in your kernel logs. Below are some
+messages and what they mean (and what you should do about them, if
+anything).
+
+
+
+devfs_register(fred): could not append to parent, err: -17
+
+You need to check what the error code means, but usually 17 means
+EEXIST. This means that a driver attempted to create an entry
+fred in a directory, but there already was an entry with that
+name. This is often caused by flawed boot scripts which untar a bunch
+of inodes into /dev, as a way to restore permissions. This
+message is harmless, as the device nodes will still
+provide access to the driver (unless you use the devfs=only
+boot option, which is only for dedicated souls:-). If you want to get
+rid of these annoying messages, upgrade to devfsd-v1.3.20 and use the
+recommended RESTORE directive to restore permissions.
+
+
+devfs_mk_dir(bill): using old entry in dir: c1808724 ""
+
+This is similar to the message above, except that a driver attempted
+to create a directory named bill, and the parent directory
+has an entry with the same name. In this case, to ensure that drivers
+continue to work properly, the old entry is re-used and given to the
+driver. In 2.5 kernels, the driver is given a NULL entry, and thus,
+under rare circumstances, may not create the require device nodes.
+The solution is the same as above.
+
+
+
-----------------------------------------------------------------------------
diff -u --recursive --new-file v2.5.1/linux/Documentation/filesystems/devfs/rc.devfs linux/Documentation/filesystems/devfs/rc.devfs
--- v2.5.1/linux/Documentation/filesystems/devfs/rc.devfs Wed Feb 16 15:42:05 2000
+++ linux/Documentation/filesystems/devfs/rc.devfs Wed Dec 31 16:00:00 1969
@@ -1,104 +0,0 @@
-#! /bin/sh
-#
-# /etc/rc.d/rc.devfs
-#
-# Linux Boot Scripts by Richard Gooch
-# Copyright 1993-1999 under GNU Copyleft version 2.0. See /etc/rc for
-# copyright notice.
-#
-# Save and restore devfs ownerships and permissions
-#
-# Written by Richard Gooch 11-JAN-1998
-#
-# Updated by Richard Gooch 23-JAN-1998: Added "start" and "stop".
-#
-# Updated by Richard Gooch 5-AUG-1998: Robustness improvements by
-# Roderich Schupp.
-#
-# Updated by Richard Gooch 9-AUG-1998: Took account of change from
-# ".epoch" to ".devfsd".
-#
-# Updated by Richard Gooch 19-AUG-1998: Test and tty pattern patch
-# by Roderich Schupp.
-#
-# Updated by Richard Gooch 24-MAY-1999: Use sed instead of tr.
-#
-# Last updated by Richard Gooch 25-MAY-1999: Don't save /dev/log.
-#
-#
-# Usage: rc.devfs save|restore [savedir] [devfsdir]
-#
-# Note: "start" is a synonym for "restore" and "stop" is a synonym for "save".
-
-# Set VERBOSE to "no" if you would like a more quiet operation.
-VERBOSE=yes
-
-# Set TAROPTS to "v" or even "vv" to see which files get saved/restored.
-TAROPTS=
-
-option="$1"
-
-case "$option" in
- save|restore) ;;
- start) option=restore ;;
- stop) option=save ;;
- *) echo "No save or restore option given" ; exit 1 ;;
-esac
-
-if [ "$2" = "" ]; then
- savedir=/var/state
-else
- savedir=$2
-fi
-
-if [ ! -d $savedir ]; then
- echo "Directory: $savedir does not exist"
- exit 1
-fi
-
-if [ "$3" = "" ]; then
- if [ -d /devfs ]; then
- devfs=/devfs
- else
- devfs=/dev
- fi
-else
- devfs=$3
-fi
-
-grep devfs /proc/filesystems >/dev/null || exit 0
-
-if [ ! -d $devfs ]; then
- echo "Directory: $devfs does not exist"
- exit 1
-elif [ ! -c $devfs/.devfsd ]; then
- echo "Directory: $devfs is not the root of a devfs filesystem"
- exit 1
-fi
-
-savefile=`echo $devfs | sed 's*/*_*g'`
-tarfile=${savedir}/devfssave.${savefile}.tar.gz
-
-cd $devfs
-
-case "$option" in
- save)
- [ "$VERBOSE" != no ] && echo "Saving $devfs permissions..."
-
- # You might want to adjust the pattern below to control
- # which file's permissions will be saved.
- # The sample pattern exludes all virtual consoles
- # as well as old and new style pseudo terminals.
- files=`find * -noleaf -cnewer .devfsd \
- ! -regex 'tty[0-9]+\|vc/.*\|vcsa?[0-9]+\|vcc/.*\|[pt]ty[a-z][0-9a-f]\|pt[ms]/.*\|log' -print`
- rm -f $tarfile
- [ -n "$files" ] && tar cz${TAROPTS}f $tarfile $files
- ;;
-
- restore)
- [ "$VERBOSE" != no ] && echo "Restoring $devfs permissions..."
- [ -f $tarfile ] && tar xpz${TAROPTS}f $tarfile
- ;;
-esac
-
-exit 0
diff -u --recursive --new-file v2.5.1/linux/MAINTAINERS linux/MAINTAINERS
--- v2.5.1/linux/MAINTAINERS Tue Dec 18 14:56:34 2001
+++ linux/MAINTAINERS Thu Dec 27 08:38:57 2001
@@ -843,7 +843,7 @@
M: vojtech@suse.cz
L: linux-joystick@atrey.karlin.mff.cuni.cz
W: http://www.suse.cz/development/joystick/
-S: Supported
+S: Maintained
KERNEL AUTOMOUNTER (AUTOFS)
P: H. Peter Anvin
@@ -1322,8 +1322,10 @@
S: Maintained
SCSI SUBSYSTEM
+P: Jens Axboe
+M: axboe@suse.de
L: linux-scsi@vger.kernel.org
-S: Unmaintained
+S: Maintained
SCSI TAPE DRIVER
P: Kai Mäkisara
@@ -1538,7 +1540,7 @@
M: vojtech@suse.cz
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
-S: Supported
+S: Maintained
USB BLUETOOTH DRIVER
P: Greg Kroah-Hartman
@@ -1561,7 +1563,7 @@
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
W: http://www.suse.cz/development/input/
-S: Supported
+S: Maintained
USB HUB
P: Johannes Erdfelt
@@ -1612,7 +1614,7 @@
M: vojtech@suse.cz
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
-S: Supported
+S: Maintained
USB SE401 DRIVER
P: Jeroen Vreeken
diff -u --recursive --new-file v2.5.1/linux/Makefile linux/Makefile
--- v2.5.1/linux/Makefile Tue Dec 18 14:56:34 2001
+++ linux/Makefile Sun Dec 30 17:02:51 2001
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 5
-SUBLEVEL = 1
-EXTRAVERSION =
+SUBLEVEL = 2
+EXTRAVERSION =-pre5
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
diff -u --recursive --new-file v2.5.1/linux/arch/alpha/kernel/alpha_ksyms.c linux/arch/alpha/kernel/alpha_ksyms.c
--- v2.5.1/linux/arch/alpha/kernel/alpha_ksyms.c Tue Dec 18 14:56:34 2001
+++ linux/arch/alpha/kernel/alpha_ksyms.c Sun Dec 30 10:06:16 2001
@@ -259,3 +259,8 @@
EXPORT_SYMBOL_NOVERS(memchr);
EXPORT_SYMBOL(get_wchan);
+
+#ifdef CONFIG_ALPHA_IRONGATE
+EXPORT_SYMBOL(irongate_ioremap);
+EXPORT_SYMBOL(irongate_iounmap);
+#endif
diff -u --recursive --new-file v2.5.1/linux/arch/alpha/kernel/pci-noop.c linux/arch/alpha/kernel/pci-noop.c
--- v2.5.1/linux/arch/alpha/kernel/pci-noop.c Thu Sep 13 15:21:32 2001
+++ linux/arch/alpha/kernel/pci-noop.c Sun Dec 30 10:06:16 2001
@@ -104,21 +104,21 @@
}
/* stubs for the routines in pci_iommu.c */
void *
-pci_alloc_consistent(struct pci_dev *pdev, long size, dma_addr_t *dma_addrp)
+pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
{
}
void
-pci_free_consistent(struct pci_dev *pdev, long size, void *cpu_addr,
+pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr,
dma_addr_t dma_addr)
{
}
dma_addr_t
-pci_map_single(struct pci_dev *pdev, void *cpu_addr, long size,
+pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size,
int direction)
{
}
void
-pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, long size,
+pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
int direction)
{
}
diff -u --recursive --new-file v2.5.1/linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c
--- v2.5.1/linux/arch/alpha/kernel/process.c Sun Sep 30 12:26:08 2001
+++ linux/arch/alpha/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -75,7 +75,6 @@
{
/* An endless idle loop with no priority at all. */
current->nice = 20;
- current->counter = -100;
while (1) {
/* FIXME -- EV6 and LCA45 know how to power down
diff -u --recursive --new-file v2.5.1/linux/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c
--- v2.5.1/linux/arch/alpha/kernel/setup.c Fri Nov 16 18:38:39 2001
+++ linux/arch/alpha/kernel/setup.c Tue Dec 25 15:39:20 2001
@@ -440,12 +440,6 @@
return MKDEV(TTY_MAJOR, 64 + c->index);
}
-static int srm_console_wait_key(struct console *co)
-{
- /* Huh? */
- return 1;
-}
-
static int __init srm_console_setup(struct console *co, char *options)
{
return 1;
@@ -455,7 +449,6 @@
name: "srm0",
write: srm_console_write,
device: srm_console_device,
- wait_key: srm_console_wait_key,
setup: srm_console_setup,
flags: CON_PRINTBUFFER | CON_ENABLED, /* fake it out */
index: -1,
diff -u --recursive --new-file v2.5.1/linux/arch/alpha/kernel/smp.c linux/arch/alpha/kernel/smp.c
--- v2.5.1/linux/arch/alpha/kernel/smp.c Wed Nov 21 10:31:09 2001
+++ linux/arch/alpha/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
@@ -65,7 +66,7 @@
IPI_CPU_STOP,
};
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
/* Set to a secondary's cpuid when it comes online. */
static unsigned long smp_secondary_alive;
diff -u --recursive --new-file v2.5.1/linux/arch/arm/kernel/process.c linux/arch/arm/kernel/process.c
--- v2.5.1/linux/arch/arm/kernel/process.c Sun Sep 30 12:26:08 2001
+++ linux/arch/arm/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -85,7 +85,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
while (1) {
void (*idle)(void) = pm_idle;
diff -u --recursive --new-file v2.5.1/linux/arch/arm/lib/changebit.S linux/arch/arm/lib/changebit.S
--- v2.5.1/linux/arch/arm/lib/changebit.S Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/lib/changebit.S Tue Dec 25 21:43:32 2001
@@ -14,7 +14,9 @@
/* Purpose : Function to change a bit
* Prototype: int change_bit(int bit, void *addr)
*/
-ENTRY(change_bit)
+ENTRY(_change_bit_be)
+ eor r0, r0, #0x18 @ big endian byte ordering
+ENTRY(_change_bit_le)
and r2, r0, #7
mov r3, #1
mov r3, r3, lsl r2
diff -u --recursive --new-file v2.5.1/linux/arch/arm/lib/clearbit.S linux/arch/arm/lib/clearbit.S
--- v2.5.1/linux/arch/arm/lib/clearbit.S Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/lib/clearbit.S Tue Dec 25 21:43:32 2001
@@ -15,8 +15,9 @@
* Purpose : Function to clear a bit
* Prototype: int clear_bit(int bit, void *addr)
*/
-
-ENTRY(clear_bit)
+ENTRY(_clear_bit_be)
+ eor r0, r0, #0x18 @ big endian byte ordering
+ENTRY(_clear_bit_le)
and r2, r0, #7
mov r3, #1
mov r3, r3, lsl r2
diff -u --recursive --new-file v2.5.1/linux/arch/arm/lib/findbit.S linux/arch/arm/lib/findbit.S
--- v2.5.1/linux/arch/arm/lib/findbit.S Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/lib/findbit.S Tue Dec 25 21:43:32 2001
@@ -15,14 +15,14 @@
* Purpose : Find a 'zero' bit
* Prototype: int find_first_zero_bit(void *addr, int maxbit);
*/
-ENTRY(find_first_zero_bit)
+ENTRY(_find_first_zero_bit_le)
mov r2, #0
-.bytelp: ldrb r3, [r0, r2, lsr #3]
+1: ldrb r3, [r0, r2, lsr #3]
eors r3, r3, #0xff @ invert bits
bne .found @ any now set - found zero bit
add r2, r2, #8 @ next bit pointer
cmp r2, r1 @ any more?
- bcc .bytelp
+ bcc 1b
add r0, r1, #1 @ no free bits
RETINSTR(mov,pc,lr)
@@ -30,15 +30,43 @@
* Purpose : Find next 'zero' bit
* Prototype: int find_next_zero_bit(void *addr, int maxbit, int offset)
*/
-ENTRY(find_next_zero_bit)
+ENTRY(_find_next_zero_bit_le)
ands ip, r2, #7
- beq .bytelp @ If new byte, goto old routine
+ beq 1b @ If new byte, goto old routine
ldrb r3, [r0, r2, lsr#3]
eor r3, r3, #0xff @ now looking for a 1 bit
movs r3, r3, lsr ip @ shift off unused bits
+ bne .found
+ orr r2, r2, #7 @ if zero, then no bits here
+ add r2, r2, #1 @ align bit pointer
+ b 1b @ loop for next bit
+
+#ifdef __ARMEB__
+
+ENTRY(_find_first_zero_bit_be)
+ mov r2, #0
+1: eor r3, r2, #0x18 @ big endian byte ordering
+ ldrb r3, [r0, r3, lsr #3]
+ eors r3, r3, #0xff @ invert bits
+ bne .found @ any now set - found zero bit
+ add r2, r2, #8 @ next bit pointer
+ cmp r2, r1 @ any more?
+ bcc 1b
+ add r0, r1, #1 @ no free bits
+ RETINSTR(mov,pc,lr)
+
+ENTRY(_find_next_zero_bit_be)
+ ands ip, r2, #7
+ beq 1b @ If new byte, goto old routine
+ eor r3, r2, #0x18 @ big endian byte ordering
+ ldrb r3, [r0, r3, lsr#3]
+ eor r3, r3, #0xff @ now looking for a 1 bit
+ movs r3, r3, lsr ip @ shift off unused bits
orreq r2, r2, #7 @ if zero, then no bits here
addeq r2, r2, #1 @ align bit pointer
- beq .bytelp @ loop for next bit
+ beq 1b @ loop for next bit
+
+#endif
/*
* One or more bits in the LSB of r3 are assumed to be set.
diff -u --recursive --new-file v2.5.1/linux/arch/arm/lib/setbit.S linux/arch/arm/lib/setbit.S
--- v2.5.1/linux/arch/arm/lib/setbit.S Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/lib/setbit.S Tue Dec 25 21:43:32 2001
@@ -9,22 +9,21 @@
*/
#include
#include
- .text
+ .text
/*
* Purpose : Function to set a bit
* Prototype: int set_bit(int bit, void *addr)
*/
-
-ENTRY(set_bit)
- and r2, r0, #7
- mov r3, #1
- mov r3, r3, lsl r2
+ENTRY(_set_bit_be)
+ eor r0, r0, #0x18 @ big endian byte ordering
+ENTRY(_set_bit_le)
+ and r2, r0, #7
+ mov r3, #1
+ mov r3, r3, lsl r2
save_and_disable_irqs ip, r2
ldrb r2, [r1, r0, lsr #3]
orr r2, r2, r3
strb r2, [r1, r0, lsr #3]
restore_irqs ip
RETINSTR(mov,pc,lr)
-
-
diff -u --recursive --new-file v2.5.1/linux/arch/arm/lib/testchangebit.S linux/arch/arm/lib/testchangebit.S
--- v2.5.1/linux/arch/arm/lib/testchangebit.S Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/lib/testchangebit.S Tue Dec 25 21:43:32 2001
@@ -11,7 +11,9 @@
#include
.text
-ENTRY(test_and_change_bit)
+ENTRY(_test_and_change_bit_be)
+ eor r0, r0, #0x18 @ big endian byte ordering
+ENTRY(_test_and_change_bit_le)
add r1, r1, r0, lsr #3
and r3, r0, #7
mov r0, #1
diff -u --recursive --new-file v2.5.1/linux/arch/arm/lib/testclearbit.S linux/arch/arm/lib/testclearbit.S
--- v2.5.1/linux/arch/arm/lib/testclearbit.S Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/lib/testclearbit.S Tue Dec 25 21:43:32 2001
@@ -11,7 +11,9 @@
#include
.text
-ENTRY(test_and_clear_bit)
+ENTRY(_test_and_clear_bit_be)
+ eor r0, r0, #0x18 @ big endian byte ordering
+ENTRY(_test_and_clear_bit_le)
add r1, r1, r0, lsr #3 @ Get byte offset
and r3, r0, #7 @ Get bit offset
mov r0, #1
diff -u --recursive --new-file v2.5.1/linux/arch/arm/lib/testsetbit.S linux/arch/arm/lib/testsetbit.S
--- v2.5.1/linux/arch/arm/lib/testsetbit.S Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/lib/testsetbit.S Tue Dec 25 21:43:32 2001
@@ -11,7 +11,9 @@
#include
.text
-ENTRY(test_and_set_bit)
+ENTRY(_test_and_set_bit_be)
+ eor r0, r0, #0x18 @ big endian byte ordering
+ENTRY(_test_and_set_bit_le)
add r1, r1, r0, lsr #3 @ Get byte offset
and r3, r0, #7 @ Get bit offset
mov r0, #1
diff -u --recursive --new-file v2.5.1/linux/arch/arm/nwfpe/ARM-gcc.h linux/arch/arm/nwfpe/ARM-gcc.h
--- v2.5.1/linux/arch/arm/nwfpe/ARM-gcc.h Thu Jun 17 01:11:35 1999
+++ linux/arch/arm/nwfpe/ARM-gcc.h Tue Dec 25 21:43:32 2001
@@ -1,11 +1,3 @@
-
-/*
--------------------------------------------------------------------------------
-One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.
--------------------------------------------------------------------------------
-*/
-#define LITTLEENDIAN
-
/*
-------------------------------------------------------------------------------
The macro `BITS64' can be defined to indicate that 64-bit integer types are
diff -u --recursive --new-file v2.5.1/linux/arch/arm/nwfpe/entry.S linux/arch/arm/nwfpe/entry.S
--- v2.5.1/linux/arch/arm/nwfpe/entry.S Sun Aug 12 11:13:59 2001
+++ linux/arch/arm/nwfpe/entry.S Tue Dec 25 21:43:32 2001
@@ -50,11 +50,10 @@
This routine does three things:
-1) It saves SP into a variable called userRegisters. The kernel has
-created a struct pt_regs on the stack and saved the user registers
-into it. See /usr/include/asm/proc/ptrace.h for details. The
-emulator code uses userRegisters as the base of an array of words from
-which the contents of the registers can be extracted.
+1) The kernel has created a struct pt_regs on the stack and saved the
+user registers into it. See /usr/include/asm/proc/ptrace.h for details.
+The emulator code uses userRegisters as the base of an array of words
+from which the contents of the registers can be extracted.
2) It calls EmulateAll to emulate a floating point instruction.
EmulateAll returns 1 if the emulation was successful, or 0 if not.
@@ -78,16 +77,18 @@
of stealing two regs from the register allocator. Not sure if
it's worth it. */
str sp, [r10] @ Store the user registers pointer in the fpa11 structure.
- mov r4, sp @ use r4 for local pointer
- mov r10, lr @ save the failure-return addresses
+ mov r4, lr @ save the failure-return addresses
- ldr r5, [r4, #60] @ get contents of PC;
+ mov r0, r10
+ bl FPA11_CheckInit @ check to see if we are initialised
+
+ ldr r5, [sp, #60] @ get contents of PC;
sub r8, r5, #4
.Lx2: ldrt r0, [r8] @ get actual instruction into r0
emulate:
bl EmulateAll @ emulate the instruction
cmp r0, #0 @ was emulation successful
- moveq pc, r10 @ no, return failure
+ moveq pc, r4 @ no, return failure
next:
.Lx1: ldrt r6, [r5], #4 @ get the next instruction and
@@ -99,10 +100,10 @@
teqne r2, #0x0E000000
movne pc, r9 @ return ok if not a fp insn
- str r5, [r4, #60] @ update PC copy in regs
+ str r5, [sp, #60] @ update PC copy in regs
mov r0, r6 @ save a copy
- ldr r1, [r4, #64] @ fetch the condition codes
+ ldr r1, [sp, #64] @ fetch the condition codes
bl checkCondition @ check the condition
cmp r0, #0 @ r0 = 0 ==> condition failed
diff -u --recursive --new-file v2.5.1/linux/arch/arm/nwfpe/fpa11.c linux/arch/arm/nwfpe/fpa11.c
--- v2.5.1/linux/arch/arm/nwfpe/fpa11.c Sun Aug 12 11:13:59 2001
+++ linux/arch/arm/nwfpe/fpa11.c Tue Dec 25 21:43:32 2001
@@ -18,7 +18,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
+#include
#include
#include "fpa11.h"
@@ -123,47 +123,58 @@
}
}
-/* Emulate the instruction in the opcode. */
-unsigned int EmulateAll(unsigned int opcode)
+void FPA11_CheckInit(FPA11 *fpa11)
{
- unsigned int nRc = 0;
- unsigned long flags;
- FPA11 *fpa11;
- save_flags(flags); sti();
-
- fpa11 = GET_FPA11();
-
- if (fpa11->initflag == 0) /* good place for __builtin_expect */
+ if (unlikely(fpa11->initflag == 0))
{
resetFPA11();
SetRoundingMode(ROUND_TO_NEAREST);
SetRoundingPrecision(ROUND_EXTENDED);
fpa11->initflag = 1;
}
+}
- if (TEST_OPCODE(opcode,MASK_CPRT))
- {
- /* Emulate conversion opcodes. */
- /* Emulate register transfer opcodes. */
- /* Emulate comparison opcodes. */
- nRc = EmulateCPRT(opcode);
- }
- else if (TEST_OPCODE(opcode,MASK_CPDO))
- {
- /* Emulate monadic arithmetic opcodes. */
- /* Emulate dyadic arithmetic opcodes. */
- nRc = EmulateCPDO(opcode);
- }
- else if (TEST_OPCODE(opcode,MASK_CPDT))
- {
- /* Emulate load/store opcodes. */
- /* Emulate load/store multiple opcodes. */
- nRc = EmulateCPDT(opcode);
- }
- else
+/* Emulate the instruction in the opcode. */
+unsigned int EmulateAll(unsigned int opcode)
+{
+ unsigned int nRc = 1, code;
+ unsigned long flags;
+ FPA11 *fpa11;
+
+ save_flags(flags); sti();
+
+ code = opcode & 0x00000f00;
+ if (code == 0x00000100 || code == 0x00000200)
{
- /* Invalid instruction detected. Return FALSE. */
- nRc = 0;
+ /* For coprocessor 1 or 2 (FPA11) */
+ code = opcode & 0x0e000000;
+ if (code == 0x0e000000)
+ {
+ if (opcode & 0x00000010)
+ {
+ /* Emulate conversion opcodes. */
+ /* Emulate register transfer opcodes. */
+ /* Emulate comparison opcodes. */
+ nRc = EmulateCPRT(opcode);
+ }
+ else
+ {
+ /* Emulate monadic arithmetic opcodes. */
+ /* Emulate dyadic arithmetic opcodes. */
+ nRc = EmulateCPDO(opcode);
+ }
+ }
+ else if (code == 0x0c000000)
+ {
+ /* Emulate load/store opcodes. */
+ /* Emulate load/store multiple opcodes. */
+ nRc = EmulateCPDT(opcode);
+ }
+ else
+ {
+ /* Invalid instruction detected. Return FALSE. */
+ nRc = 0;
+ }
}
restore_flags(flags);
diff -u --recursive --new-file v2.5.1/linux/arch/arm/nwfpe/fpa11_cpdt.c linux/arch/arm/nwfpe/fpa11_cpdt.c
--- v2.5.1/linux/arch/arm/nwfpe/fpa11_cpdt.c Sun Aug 12 11:13:59 2001
+++ linux/arch/arm/nwfpe/fpa11_cpdt.c Tue Dec 25 21:43:32 2001
@@ -45,7 +45,7 @@
fpa11->fType[Fn] = typeDouble;
get_user(p[0], &pMem[1]);
get_user(p[1], &pMem[0]); /* sign & exponent */
-}
+}
static inline
void loadExtended(const unsigned int Fn,const unsigned int *pMem)
@@ -57,7 +57,7 @@
get_user(p[0], &pMem[0]); /* sign & exponent */
get_user(p[1], &pMem[2]); /* ls bits */
get_user(p[2], &pMem[1]); /* ms bits */
-}
+}
static inline
void loadMultiple(const unsigned int Fn,const unsigned int *pMem)
@@ -69,7 +69,7 @@
p = (unsigned int*)&(fpa11->fpreg[Fn]);
get_user(x, &pMem[0]);
fpa11->fType[Fn] = (x >> 14) & 0x00000003;
-
+
switch (fpa11->fType[Fn])
{
case typeSingle:
@@ -79,13 +79,13 @@
get_user(p[1], &pMem[1]); /* double msw */
p[2] = 0; /* empty */
}
- break;
-
+ break;
+
case typeExtended:
{
get_user(p[1], &pMem[2]);
get_user(p[2], &pMem[1]); /* msw */
- p[0] = (x & 0x80003fff);
+ p[0] = (x & 0x80003fff);
}
break;
}
@@ -95,82 +95,92 @@
void storeSingle(const unsigned int Fn,unsigned int *pMem)
{
FPA11 *fpa11 = GET_FPA11();
- float32 val;
- register unsigned int *p = (unsigned int*)&val;
-
+ union
+ {
+ float32 f;
+ unsigned int i[1];
+ } val;
+
switch (fpa11->fType[Fn])
{
- case typeDouble:
- val = float64_to_float32(fpa11->fpreg[Fn].fDouble);
+ case typeDouble:
+ val.f = float64_to_float32(fpa11->fpreg[Fn].fDouble);
break;
- case typeExtended:
- val = floatx80_to_float32(fpa11->fpreg[Fn].fExtended);
+ case typeExtended:
+ val.f = floatx80_to_float32(fpa11->fpreg[Fn].fExtended);
break;
- default: val = fpa11->fpreg[Fn].fSingle;
+ default: val.f = fpa11->fpreg[Fn].fSingle;
}
-
- put_user(p[0], pMem);
-}
+
+ put_user(val.i[0], pMem);
+}
static inline
void storeDouble(const unsigned int Fn,unsigned int *pMem)
{
FPA11 *fpa11 = GET_FPA11();
- float64 val;
- register unsigned int *p = (unsigned int*)&val;
+ union
+ {
+ float64 f;
+ unsigned int i[2];
+ } val;
switch (fpa11->fType[Fn])
{
- case typeSingle:
- val = float32_to_float64(fpa11->fpreg[Fn].fSingle);
+ case typeSingle:
+ val.f = float32_to_float64(fpa11->fpreg[Fn].fSingle);
break;
case typeExtended:
- val = floatx80_to_float64(fpa11->fpreg[Fn].fExtended);
+ val.f = floatx80_to_float64(fpa11->fpreg[Fn].fExtended);
break;
- default: val = fpa11->fpreg[Fn].fDouble;
+ default: val.f = fpa11->fpreg[Fn].fDouble;
}
- put_user(p[1], &pMem[0]); /* msw */
- put_user(p[0], &pMem[1]); /* lsw */
-}
+
+ put_user(val.i[1], &pMem[0]); /* msw */
+ put_user(val.i[0], &pMem[1]); /* lsw */
+}
static inline
void storeExtended(const unsigned int Fn,unsigned int *pMem)
{
FPA11 *fpa11 = GET_FPA11();
- floatx80 val;
- register unsigned int *p = (unsigned int*)&val;
-
+ union
+ {
+ floatx80 f;
+ unsigned int i[3];
+ } val;
+
switch (fpa11->fType[Fn])
{
- case typeSingle:
- val = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
+ case typeSingle:
+ val.f = float32_to_floatx80(fpa11->fpreg[Fn].fSingle);
break;
- case typeDouble:
- val = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
+ case typeDouble:
+ val.f = float64_to_floatx80(fpa11->fpreg[Fn].fDouble);
break;
- default: val = fpa11->fpreg[Fn].fExtended;
+ default: val.f = fpa11->fpreg[Fn].fExtended;
}
-
- put_user(p[0], &pMem[0]); /* sign & exp */
- put_user(p[1], &pMem[2]);
- put_user(p[2], &pMem[1]); /* msw */
-}
+
+ put_user(val.i[0], &pMem[0]); /* sign & exp */
+ put_user(val.i[1], &pMem[2]);
+ put_user(val.i[2], &pMem[1]); /* msw */
+}
static inline
void storeMultiple(const unsigned int Fn,unsigned int *pMem)
{
FPA11 *fpa11 = GET_FPA11();
register unsigned int nType, *p;
-
+
p = (unsigned int*)&(fpa11->fpreg[Fn]);
nType = fpa11->fType[Fn];
-
+
switch (nType)
{
case typeSingle:
@@ -180,8 +190,8 @@
put_user(p[1], &pMem[1]); /* double msw */
put_user(nType << 14, &pMem[0]);
}
- break;
-
+ break;
+
case typeExtended:
{
put_user(p[2], &pMem[1]); /* msw */
@@ -221,7 +231,7 @@
case TRANSFER_EXTENDED: loadExtended(getFd(opcode),pAddress); break;
default: nRc = 0;
}
-
+
if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
return nRc;
}
@@ -230,10 +240,10 @@
{
unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
write_back = WRITE_BACK(opcode);
-
+
//printk("PerformSTF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode));
SetRoundingMode(ROUND_TO_NEAREST);
-
+
pBase = (unsigned int*)readRegister(getRn(opcode));
if (REG_PC == getRn(opcode))
{
@@ -256,7 +266,7 @@
case TRANSFER_EXTENDED: storeExtended(getFd(opcode),pAddress); break;
default: nRc = 0;
}
-
+
if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal);
return nRc;
}
@@ -297,14 +307,14 @@
{
unsigned int i, Fd, *pBase, *pAddress, *pFinal,
write_back = WRITE_BACK(opcode);
-
+
pBase = (unsigned int*)readRegister(getRn(opcode));
if (REG_PC == getRn(opcode))
{
pBase += 2;
write_back = 0;
}
-
+
pFinal = pBase;
if (BIT_UP_SET(opcode))
pFinal += getOffset(opcode);
@@ -331,7 +341,7 @@
unsigned int nRc = 0;
//printk("EmulateCPDT(0x%08x)\n",opcode);
-
+
if (LDF_OP(opcode))
{
nRc = PerformLDF(opcode);
@@ -343,7 +353,7 @@
else if (STF_OP(opcode))
{
nRc = PerformSTF(opcode);
- }
+ }
else if (SFM_OP(opcode))
{
nRc = PerformSFM(opcode);
@@ -352,7 +362,7 @@
{
nRc = 0;
}
-
+
return nRc;
}
#endif
diff -u --recursive --new-file v2.5.1/linux/arch/cris/kernel/process.c linux/arch/cris/kernel/process.c
--- v2.5.1/linux/arch/cris/kernel/process.c Fri Nov 9 13:58:02 2001
+++ linux/arch/cris/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -119,7 +119,6 @@
int cpu_idle(void *unused)
{
while(1) {
- current->counter = -100;
schedule();
}
}
diff -u --recursive --new-file v2.5.1/linux/arch/i386/config.in linux/arch/i386/config.in
--- v2.5.1/linux/arch/i386/config.in Mon Nov 12 11:58:08 2001
+++ linux/arch/i386/config.in Sun Dec 30 10:38:45 2001
@@ -52,6 +52,7 @@
define_int CONFIG_X86_L1_CACHE_SHIFT 4
define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
+ define_bool CONFIG_X86_PPRO_FENCE y
else
define_bool CONFIG_X86_WP_WORKS_OK y
define_bool CONFIG_X86_INVLPG y
@@ -66,17 +67,20 @@
define_int CONFIG_X86_L1_CACHE_SHIFT 4
define_bool CONFIG_X86_USE_STRING_486 y
define_bool CONFIG_X86_ALIGNMENT_16 y
+ define_bool CONFIG_X86_PPRO_FENCE y
fi
if [ "$CONFIG_M586" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
define_bool CONFIG_X86_USE_STRING_486 y
define_bool CONFIG_X86_ALIGNMENT_16 y
+ define_bool CONFIG_X86_PPRO_FENCE y
fi
if [ "$CONFIG_M586TSC" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
define_bool CONFIG_X86_USE_STRING_486 y
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_TSC y
+ define_bool CONFIG_X86_PPRO_FENCE y
fi
if [ "$CONFIG_M586MMX" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
@@ -84,6 +88,7 @@
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_GOOD_APIC y
+ define_bool CONFIG_X86_PPRO_FENCE y
fi
if [ "$CONFIG_M686" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
@@ -91,6 +96,7 @@
define_bool CONFIG_X86_GOOD_APIC y
define_bool CONFIG_X86_PGE y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+ define_bool CONFIG_X86_PPRO_FENCE y
fi
if [ "$CONFIG_MPENTIUMIII" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
@@ -135,21 +141,24 @@
define_int CONFIG_X86_L1_CACHE_SHIFT 5
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+ define_bool CONFIG_X86_OOSTORE y
fi
if [ "$CONFIG_MWINCHIP2" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+ define_bool CONFIG_X86_OOSTORE y
fi
if [ "$CONFIG_MWINCHIP3D" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+ define_bool CONFIG_X86_OOSTORE y
fi
tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
-tristate 'Dell Inspiron 8000 support' CONFIG_I8K
+tristate 'Dell laptop support' CONFIG_I8K
tristate '/dev/cpu/microcode - Intel IA32 CPU microcode support' CONFIG_MICROCODE
tristate '/dev/cpu/*/msr - Model-specific register support' CONFIG_X86_MSR
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/Makefile linux/arch/i386/kernel/Makefile
--- v2.5.1/linux/arch/i386/kernel/Makefile Fri Nov 9 14:21:21 2001
+++ linux/arch/i386/kernel/Makefile Sun Dec 30 16:51:48 2001
@@ -39,6 +39,9 @@
obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o
obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o apic.o nmi.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o acpitable.o
+ifdef CONFIG_VISWS
+obj-y += setup-visws.o
obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o
+endif
include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/apic.c linux/arch/i386/kernel/apic.c
--- v2.5.1/linux/arch/i386/kernel/apic.c Fri Nov 9 14:12:55 2001
+++ linux/arch/i386/kernel/apic.c Tue Dec 25 17:04:40 2001
@@ -56,6 +56,14 @@
maxlvt = get_maxlvt();
/*
+ * Masking an LVT entry on a P6 can trigger a local APIC error
+ * if the vector is zero. Mask LVTERR first to prevent this.
+ */
+ if (maxlvt >= 3) {
+ v = ERROR_APIC_VECTOR; /* any non-zero vector will do */
+ apic_write_around(APIC_LVTERR, v | APIC_LVT_MASKED);
+ }
+ /*
* Careful: we have to set masks only first to deassert
* any level-triggered sources.
*/
@@ -65,10 +73,6 @@
apic_write_around(APIC_LVT0, v | APIC_LVT_MASKED);
v = apic_read(APIC_LVT1);
apic_write_around(APIC_LVT1, v | APIC_LVT_MASKED);
- if (maxlvt >= 3) {
- v = apic_read(APIC_LVTERR);
- apic_write_around(APIC_LVTERR, v | APIC_LVT_MASKED);
- }
if (maxlvt >= 4) {
v = apic_read(APIC_LVTPC);
apic_write_around(APIC_LVTPC, v | APIC_LVT_MASKED);
@@ -84,6 +88,8 @@
apic_write_around(APIC_LVTERR, APIC_LVT_MASKED);
if (maxlvt >= 4)
apic_write_around(APIC_LVTPC, APIC_LVT_MASKED);
+ apic_write(APIC_ESR, 0);
+ v = apic_read(APIC_ESR);
}
void __init connect_bsp_APIC(void)
@@ -480,6 +486,7 @@
l &= ~MSR_IA32_APICBASE_BASE;
l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
wrmsr(MSR_IA32_APICBASE, l, h);
+ apic_write(APIC_LVTERR, ERROR_APIC_VECTOR | APIC_LVT_MASKED);
apic_write(APIC_ID, apic_pm_state.apic_id);
apic_write(APIC_DFR, apic_pm_state.apic_dfr);
apic_write(APIC_LDR, apic_pm_state.apic_ldr);
@@ -487,15 +494,15 @@
apic_write(APIC_SPIV, apic_pm_state.apic_spiv);
apic_write(APIC_LVT0, apic_pm_state.apic_lvt0);
apic_write(APIC_LVT1, apic_pm_state.apic_lvt1);
+ apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc);
+ apic_write(APIC_LVTT, apic_pm_state.apic_lvtt);
+ apic_write(APIC_TDCR, apic_pm_state.apic_tdcr);
+ apic_write(APIC_TMICT, apic_pm_state.apic_tmict);
apic_write(APIC_ESR, 0);
apic_read(APIC_ESR);
apic_write(APIC_LVTERR, apic_pm_state.apic_lvterr);
apic_write(APIC_ESR, 0);
apic_read(APIC_ESR);
- apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc);
- apic_write(APIC_LVTT, apic_pm_state.apic_lvtt);
- apic_write(APIC_TDCR, apic_pm_state.apic_tdcr);
- apic_write(APIC_TMICT, apic_pm_state.apic_tmict);
__restore_flags(flags);
if (apic_pm_state.perfctr_pmdev)
pm_send(apic_pm_state.perfctr_pmdev, PM_RESUME, data);
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/dmi_scan.c linux/arch/i386/kernel/dmi_scan.c
--- v2.5.1/linux/arch/i386/kernel/dmi_scan.c Tue Dec 18 14:56:34 2001
+++ linux/arch/i386/kernel/dmi_scan.c Sun Dec 30 09:44:51 2001
@@ -572,6 +572,11 @@
MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0094.P10"),
NO_MATCH, NO_MATCH
} },
+ { broken_pirq, "l44GX Bios", { /* Bad $PIR */
+ MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
+ MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0120.P12"),
+ NO_MATCH, NO_MATCH
+ } },
{ broken_pirq, "l44GX Bios", { /* Bad $PIR */
MATCH(DMI_BIOS_VENDOR, "Intel Corporation"),
MATCH(DMI_BIOS_VERSION,"L440GX0.86B.0125.P13"),
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/pci-pc.c linux/arch/i386/kernel/pci-pc.c
--- v2.5.1/linux/arch/i386/kernel/pci-pc.c Tue Dec 18 14:56:34 2001
+++ linux/arch/i386/kernel/pci-pc.c Sun Dec 30 09:44:51 2001
@@ -30,7 +30,7 @@
* This interrupt-safe spinlock protects all accesses to PCI
* configuration space.
*/
-spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
/*
@@ -1109,17 +1109,15 @@
}
/*
- * Nobody seems to know what this does. Damn.
- *
- * But it does seem to fix some unspecified problem
- * with 'movntq' copies on Athlons.
+ * Addresses issues with problems in the memory write queue timer in
+ * certain VIA Northbridges. This bugfix is per VIA's specifications.
*
* VIA 8363,8622,8361 Northbridges:
* - bits 5, 6, 7 at offset 0x55 need to be turned off
* VIA 8367 (KT266x) Northbridges:
* - bits 5, 6, 7 at offset 0x95 need to be turned off
*/
-static void __init pci_fixup_via_athlon_bug(struct pci_dev *d)
+static void __init pci_fixup_via_northbridge_bug(struct pci_dev *d)
{
u8 v;
int where = 0x55;
@@ -1131,7 +1129,7 @@
pci_read_config_byte(d, where, &v);
if (v & 0xe0) {
- printk("Trying to stomp on Athlon bug...\n");
+ printk("Disabling broken memory write queue.\n");
v &= 0x1f; /* clear bits 5, 6, 7 */
pci_write_config_byte(d, where, v);
}
@@ -1146,10 +1144,10 @@
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, pci_fixup_piix4_acpi },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, pci_fixup_via_athlon_bug },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8622, pci_fixup_via_athlon_bug },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, pci_fixup_via_athlon_bug },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8367_0, pci_fixup_via_athlon_bug },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, pci_fixup_via_northbridge_bug },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8622, pci_fixup_via_northbridge_bug },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, pci_fixup_via_northbridge_bug },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8367_0, pci_fixup_via_northbridge_bug },
{ 0 }
};
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
--- v2.5.1/linux/arch/i386/kernel/process.c Thu Oct 4 18:42:54 2001
+++ linux/arch/i386/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -125,7 +125,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
while (1) {
void (*idle)(void) = pm_idle;
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/setup-visws.c linux/arch/i386/kernel/setup-visws.c
--- v2.5.1/linux/arch/i386/kernel/setup-visws.c Wed Dec 31 16:00:00 1969
+++ linux/arch/i386/kernel/setup-visws.c Sun Dec 30 16:51:48 2001
@@ -0,0 +1,126 @@
+/*
+ * Unmaintained SGI Visual Workstation support.
+ * Split out from setup.c by davej@suse.de
+ */
+
+char visws_board_type = -1;
+char visws_board_rev = -1;
+
+#define PIIX_PM_START 0x0F80
+
+#define SIO_GPIO_START 0x0FC0
+
+#define SIO_PM_START 0x0FC8
+
+#define PMBASE PIIX_PM_START
+#define GPIREG0 (PMBASE+0x30)
+#define GPIREG(x) (GPIREG0+((x)/8))
+#define PIIX_GPI_BD_ID1 18
+#define PIIX_GPI_BD_REG GPIREG(PIIX_GPI_BD_ID1)
+
+#define PIIX_GPI_BD_SHIFT (PIIX_GPI_BD_ID1 % 8)
+
+#define SIO_INDEX 0x2e
+#define SIO_DATA 0x2f
+
+#define SIO_DEV_SEL 0x7
+#define SIO_DEV_ENB 0x30
+#define SIO_DEV_MSB 0x60
+#define SIO_DEV_LSB 0x61
+
+#define SIO_GP_DEV 0x7
+
+#define SIO_GP_BASE SIO_GPIO_START
+#define SIO_GP_MSB (SIO_GP_BASE>>8)
+#define SIO_GP_LSB (SIO_GP_BASE&0xff)
+
+#define SIO_GP_DATA1 (SIO_GP_BASE+0)
+
+#define SIO_PM_DEV 0x8
+
+#define SIO_PM_BASE SIO_PM_START
+#define SIO_PM_MSB (SIO_PM_BASE>>8)
+#define SIO_PM_LSB (SIO_PM_BASE&0xff)
+#define SIO_PM_INDEX (SIO_PM_BASE+0)
+#define SIO_PM_DATA (SIO_PM_BASE+1)
+
+#define SIO_PM_FER2 0x1
+
+#define SIO_PM_GP_EN 0x80
+
+void __init visws_get_board_type_and_rev(void)
+{
+ int raw;
+
+ visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)
+ >> PIIX_GPI_BD_SHIFT;
+/*
+ * Get Board rev.
+ * First, we have to initialize the 307 part to allow us access
+ * to the GPIO registers. Let's map them at 0x0fc0 which is right
+ * after the PIIX4 PM section.
+ */
+ outb_p(SIO_DEV_SEL, SIO_INDEX);
+ outb_p(SIO_GP_DEV, SIO_DATA); /* Talk to GPIO regs. */
+
+ outb_p(SIO_DEV_MSB, SIO_INDEX);
+ outb_p(SIO_GP_MSB, SIO_DATA); /* MSB of GPIO base address */
+
+ outb_p(SIO_DEV_LSB, SIO_INDEX);
+ outb_p(SIO_GP_LSB, SIO_DATA); /* LSB of GPIO base address */
+
+ outb_p(SIO_DEV_ENB, SIO_INDEX);
+ outb_p(1, SIO_DATA); /* Enable GPIO registers. */
+
+/*
+ * Now, we have to map the power management section to write
+ * a bit which enables access to the GPIO registers.
+ * What lunatic came up with this shit?
+ */
+ outb_p(SIO_DEV_SEL, SIO_INDEX);
+ outb_p(SIO_PM_DEV, SIO_DATA); /* Talk to GPIO regs. */
+
+ outb_p(SIO_DEV_MSB, SIO_INDEX);
+ outb_p(SIO_PM_MSB, SIO_DATA); /* MSB of PM base address */
+
+ outb_p(SIO_DEV_LSB, SIO_INDEX);
+ outb_p(SIO_PM_LSB, SIO_DATA); /* LSB of PM base address */
+
+ outb_p(SIO_DEV_ENB, SIO_INDEX);
+ outb_p(1, SIO_DATA); /* Enable PM registers. */
+
+/*
+ * Now, write the PM register which enables the GPIO registers.
+ */
+ outb_p(SIO_PM_FER2, SIO_PM_INDEX);
+ outb_p(SIO_PM_GP_EN, SIO_PM_DATA);
+
+/*
+ * Now, initialize the GPIO registers.
+ * We want them all to be inputs which is the
+ * power on default, so let's leave them alone.
+ * So, let's just read the board rev!
+ */
+ raw = inb_p(SIO_GP_DATA1);
+ raw &= 0x7f; /* 7 bits of valid board revision ID. */
+
+ if (visws_board_type == VISWS_320) {
+ if (raw < 0x6) {
+ visws_board_rev = 4;
+ } else if (raw < 0xc) {
+ visws_board_rev = 5;
+ } else {
+ visws_board_rev = 6;
+ }
+ } else if (visws_board_type == VISWS_540) {
+ visws_board_rev = 2;
+ } else {
+ visws_board_rev = raw;
+ }
+
+ printk(KERN_INFO "Silicon Graphics %s (rev %d)\n",
+ visws_board_type == VISWS_320 ? "320" :
+ (visws_board_type == VISWS_540 ? "540" :
+ "unknown"), visws_board_rev);
+ }
+}
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- v2.5.1/linux/arch/i386/kernel/setup.c Tue Dec 18 14:56:34 2001
+++ linux/arch/i386/kernel/setup.c Sun Dec 30 16:54:29 2001
@@ -158,6 +158,7 @@
extern int root_mountflags;
extern char _text, _etext, _edata, _end;
extern int blk_nohighio;
+void __init visws_get_board_type_and_rev(void);
static int disable_x86_serial_nr __initdata = 1;
static int disable_x86_fxsr __initdata = 0;
@@ -191,131 +192,6 @@
#define RAMDISK_PROMPT_FLAG 0x8000
#define RAMDISK_LOAD_FLAG 0x4000
-#ifdef CONFIG_VISWS
-char visws_board_type = -1;
-char visws_board_rev = -1;
-
-#define PIIX_PM_START 0x0F80
-
-#define SIO_GPIO_START 0x0FC0
-
-#define SIO_PM_START 0x0FC8
-
-#define PMBASE PIIX_PM_START
-#define GPIREG0 (PMBASE+0x30)
-#define GPIREG(x) (GPIREG0+((x)/8))
-#define PIIX_GPI_BD_ID1 18
-#define PIIX_GPI_BD_REG GPIREG(PIIX_GPI_BD_ID1)
-
-#define PIIX_GPI_BD_SHIFT (PIIX_GPI_BD_ID1 % 8)
-
-#define SIO_INDEX 0x2e
-#define SIO_DATA 0x2f
-
-#define SIO_DEV_SEL 0x7
-#define SIO_DEV_ENB 0x30
-#define SIO_DEV_MSB 0x60
-#define SIO_DEV_LSB 0x61
-
-#define SIO_GP_DEV 0x7
-
-#define SIO_GP_BASE SIO_GPIO_START
-#define SIO_GP_MSB (SIO_GP_BASE>>8)
-#define SIO_GP_LSB (SIO_GP_BASE&0xff)
-
-#define SIO_GP_DATA1 (SIO_GP_BASE+0)
-
-#define SIO_PM_DEV 0x8
-
-#define SIO_PM_BASE SIO_PM_START
-#define SIO_PM_MSB (SIO_PM_BASE>>8)
-#define SIO_PM_LSB (SIO_PM_BASE&0xff)
-#define SIO_PM_INDEX (SIO_PM_BASE+0)
-#define SIO_PM_DATA (SIO_PM_BASE+1)
-
-#define SIO_PM_FER2 0x1
-
-#define SIO_PM_GP_EN 0x80
-
-static void __init visws_get_board_type_and_rev(void)
-{
- int raw;
-
- visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)
- >> PIIX_GPI_BD_SHIFT;
-/*
- * Get Board rev.
- * First, we have to initialize the 307 part to allow us access
- * to the GPIO registers. Let's map them at 0x0fc0 which is right
- * after the PIIX4 PM section.
- */
- outb_p(SIO_DEV_SEL, SIO_INDEX);
- outb_p(SIO_GP_DEV, SIO_DATA); /* Talk to GPIO regs. */
-
- outb_p(SIO_DEV_MSB, SIO_INDEX);
- outb_p(SIO_GP_MSB, SIO_DATA); /* MSB of GPIO base address */
-
- outb_p(SIO_DEV_LSB, SIO_INDEX);
- outb_p(SIO_GP_LSB, SIO_DATA); /* LSB of GPIO base address */
-
- outb_p(SIO_DEV_ENB, SIO_INDEX);
- outb_p(1, SIO_DATA); /* Enable GPIO registers. */
-
-/*
- * Now, we have to map the power management section to write
- * a bit which enables access to the GPIO registers.
- * What lunatic came up with this shit?
- */
- outb_p(SIO_DEV_SEL, SIO_INDEX);
- outb_p(SIO_PM_DEV, SIO_DATA); /* Talk to GPIO regs. */
-
- outb_p(SIO_DEV_MSB, SIO_INDEX);
- outb_p(SIO_PM_MSB, SIO_DATA); /* MSB of PM base address */
-
- outb_p(SIO_DEV_LSB, SIO_INDEX);
- outb_p(SIO_PM_LSB, SIO_DATA); /* LSB of PM base address */
-
- outb_p(SIO_DEV_ENB, SIO_INDEX);
- outb_p(1, SIO_DATA); /* Enable PM registers. */
-
-/*
- * Now, write the PM register which enables the GPIO registers.
- */
- outb_p(SIO_PM_FER2, SIO_PM_INDEX);
- outb_p(SIO_PM_GP_EN, SIO_PM_DATA);
-
-/*
- * Now, initialize the GPIO registers.
- * We want them all to be inputs which is the
- * power on default, so let's leave them alone.
- * So, let's just read the board rev!
- */
- raw = inb_p(SIO_GP_DATA1);
- raw &= 0x7f; /* 7 bits of valid board revision ID. */
-
- if (visws_board_type == VISWS_320) {
- if (raw < 0x6) {
- visws_board_rev = 4;
- } else if (raw < 0xc) {
- visws_board_rev = 5;
- } else {
- visws_board_rev = 6;
-
- }
- } else if (visws_board_type == VISWS_540) {
- visws_board_rev = 2;
- } else {
- visws_board_rev = raw;
- }
-
- printk(KERN_INFO "Silicon Graphics %s (rev %d)\n",
- visws_board_type == VISWS_320 ? "320" :
- (visws_board_type == VISWS_540 ? "540" :
- "unknown"),
- visws_board_rev);
- }
-#endif
-
static char command_line[COMMAND_LINE_SIZE];
char saved_command_line[COMMAND_LINE_SIZE];
@@ -1289,9 +1165,24 @@
}
break;
- case 6: /* An Athlon/Duron. We can trust the BIOS probably */
- mcheck_init(c);
- break;
+ case 6: /* An Athlon/Duron */
+
+ /* Bit 15 of Athlon specific MSR 15, needs to be 0
+ * to enable SSE on Palomino/Morgan CPU's.
+ * If the BIOS didn't enable it already, enable it
+ * here.
+ */
+ if (c->x86_model == 6 || c->x86_model == 7) {
+ if (!test_bit(X86_FEATURE_XMM, &c->x86_capability)) {
+ printk(KERN_INFO "Enabling disabled K7/SSE Support.\n");
+ rdmsr(MSR_K7_HWCR, l, h);
+ l &= ~0x00008000;
+ wrmsr(MSR_K7_HWCR, l, h);
+ set_bit(X86_FEATURE_XMM, &c->x86_capability);
+ }
+ }
+ break;
+
}
display_cacheinfo(c);
@@ -1918,7 +1809,6 @@
c->x86_cache_size = (cc>>24)+(dd>>24);
}
sprintf( c->x86_model_id, "WinChip %s", name );
- mcheck_init(c);
break;
case 6:
@@ -2202,9 +2092,56 @@
if ( p )
strcpy(c->x86_model_id, p);
+
+#ifdef CONFIG_SMP
+ if (test_bit(X86_FEATURE_HT, &c->x86_capability)) {
+ extern int phys_proc_id[NR_CPUS];
+
+ u32 eax, ebx, ecx, edx;
+ int index_lsb, index_msb, tmp;
+ int initial_apic_id;
+ int cpu = smp_processor_id();
+
+ cpuid(1, &eax, &ebx, &ecx, &edx);
+ smp_num_siblings = (ebx & 0xff0000) >> 16;
+
+ if (smp_num_siblings == 1) {
+ printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
+ } else if (smp_num_siblings > 1 ) {
+ index_lsb = 0;
+ index_msb = 31;
+ /*
+ * At this point we only support two siblings per
+ * processor package.
+ */
+#define NR_SIBLINGS 2
+ if (smp_num_siblings != NR_SIBLINGS) {
+ printk(KERN_WARNING "CPU: Unsupported number of the siblings %d", smp_num_siblings);
+ smp_num_siblings = 1;
+ goto too_many_siblings;
+ }
+ tmp = smp_num_siblings;
+ while ((tmp & 1) == 0) {
+ tmp >>=1 ;
+ index_lsb++;
+ }
+ tmp = smp_num_siblings;
+ while ((tmp & 0x80000000 ) == 0) {
+ tmp <<=1 ;
+ index_msb--;
+ }
+ if (index_lsb != index_msb )
+ index_msb++;
+ initial_apic_id = ebx >> 24 & 0xff;
+ phys_proc_id[cpu] = initial_apic_id >> index_msb;
- /* Enable MCA if available */
- mcheck_init(c);
+ printk(KERN_INFO "CPU: Physical Processor ID: %d\n",
+ phys_proc_id[cpu]);
+ }
+
+ }
+too_many_siblings:
+#endif
}
void __init get_cpu_vendor(struct cpuinfo_x86 *c)
@@ -2584,7 +2521,7 @@
init_rise(c);
break;
}
-
+
printk(KERN_DEBUG "CPU: After vendor init, caps: %08x %08x %08x %08x\n",
c->x86_capability[0],
c->x86_capability[1],
@@ -2611,6 +2548,9 @@
/* Disable the PN if appropriate */
squash_the_stupid_serial_number(c);
+ /* Init Machine Check Exception if available. */
+ mcheck_init(c);
+
/* If the model name is still unset, do table lookup. */
if ( !c->x86_model_id[0] ) {
char *p;
@@ -2708,7 +2648,7 @@
"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
"cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
"pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx",
- "fxsr", "sse", "sse2", "ss", NULL, "tm", "ia64", NULL,
+ "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL,
/* AMD-defined */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c
--- v2.5.1/linux/arch/i386/kernel/signal.c Fri Sep 14 14:15:40 2001
+++ linux/arch/i386/kernel/signal.c Wed Dec 19 15:27:12 2001
@@ -28,7 +28,7 @@
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
-asmlinkage int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
+int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from)
{
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
--- v2.5.1/linux/arch/i386/kernel/smp.c Tue Oct 23 14:17:10 2001
+++ linux/arch/i386/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include
#include
@@ -102,7 +103,7 @@
*/
/* The 'big kernel lock' */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
struct tlb_state cpu_tlbstate[NR_CPUS] = {[0 ... NR_CPUS-1] = { &init_mm, 0 }};
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/smpboot.c linux/arch/i386/kernel/smpboot.c
--- v2.5.1/linux/arch/i386/kernel/smpboot.c Wed Nov 21 10:35:48 2001
+++ linux/arch/i386/kernel/smpboot.c Sun Dec 30 16:54:29 2001
@@ -56,6 +56,10 @@
/* Total count of live CPUs */
int smp_num_cpus = 1;
+/* Number of siblings per CPU package */
+int smp_num_siblings = 1;
+int __initdata phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */
+
/* Bitmask of currently online CPUs */
unsigned long cpu_online_map;
@@ -971,6 +975,8 @@
/* Where the IO area was mapped on multiquad, always 0 otherwise */
void *xquad_portio = NULL;
+int cpu_sibling_map[NR_CPUS] __cacheline_aligned;
+
void __init smp_boot_cpus(void)
{
int apicid, cpu, bit;
@@ -1162,6 +1168,34 @@
printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n");
Dprintk("Boot done.\n");
+ /*
+ * If Hyper-Threading is avaialble, construct cpu_sibling_map[], so
+ * that we can tell the sibling CPU efficiently.
+ */
+ if (test_bit(X86_FEATURE_HT, boot_cpu_data.x86_capability)
+ && smp_num_siblings > 1) {
+ for (cpu = 0; cpu < NR_CPUS; cpu++)
+ cpu_sibling_map[cpu] = NO_PROC_ID;
+
+ for (cpu = 0; cpu < smp_num_cpus; cpu++) {
+ int i;
+
+ for (i = 0; i < smp_num_cpus; i++) {
+ if (i == cpu)
+ continue;
+ if (phys_proc_id[cpu] == phys_proc_id[i]) {
+ cpu_sibling_map[cpu] = i;
+ printk("cpu_sibling_map[%d] = %d\n", cpu, cpu_sibling_map[cpu]);
+ break;
+ }
+ }
+ if (cpu_sibling_map[cpu] == NO_PROC_ID) {
+ smp_num_siblings = 1;
+ printk(KERN_WARNING "WARNING: No sibling found for CPU %d.\n", cpu);
+ }
+ }
+ }
+
#ifndef CONFIG_VISWS
/*
* Here we can be sure that there is an IO-APIC in the system. Let's
diff -u --recursive --new-file v2.5.1/linux/arch/i386/kernel/vm86.c linux/arch/i386/kernel/vm86.c
--- v2.5.1/linux/arch/i386/kernel/vm86.c Fri Jul 6 17:05:07 2001
+++ linux/arch/i386/kernel/vm86.c Wed Dec 19 15:27:12 2001
@@ -62,7 +62,7 @@
( (unsigned)( & (((struct kernel_vm86_regs *)0)->VM86_REGS_PART2) ) )
#define VM86_REGS_SIZE2 (sizeof(struct kernel_vm86_regs) - VM86_REGS_SIZE1)
-asmlinkage struct pt_regs * FASTCALL(save_v86_state(struct kernel_vm86_regs * regs));
+struct pt_regs * FASTCALL(save_v86_state(struct kernel_vm86_regs * regs));
struct pt_regs * save_v86_state(struct kernel_vm86_regs * regs)
{
struct tss_struct *tss;
diff -u --recursive --new-file v2.5.1/linux/arch/ia64/hp/hpsim_console.c linux/arch/ia64/hp/hpsim_console.c
--- v2.5.1/linux/arch/ia64/hp/hpsim_console.c Thu Oct 12 14:20:48 2000
+++ linux/arch/ia64/hp/hpsim_console.c Tue Dec 25 15:39:20 2001
@@ -24,14 +24,12 @@
static int simcons_init (struct console *, char *);
static void simcons_write (struct console *, const char *, unsigned);
-static int simcons_wait_key (struct console *);
static kdev_t simcons_console_device (struct console *);
struct console hpsim_cons = {
name: "simcons",
write: simcons_write,
device: simcons_console_device,
- wait_key: simcons_wait_key,
setup: simcons_init,
flags: CON_PRINTBUFFER,
index: -1,
@@ -54,17 +52,6 @@
if (ch == '\n')
ia64_ssc('\r', 0, 0, 0, SSC_PUTCHAR);
}
-}
-
-static int
-simcons_wait_key (struct console *cons)
-{
- char ch;
-
- do {
- ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR);
- } while (ch == '\0');
- return ch;
}
static kdev_t
diff -u --recursive --new-file v2.5.1/linux/arch/ia64/kernel/process.c linux/arch/ia64/kernel/process.c
--- v2.5.1/linux/arch/ia64/kernel/process.c Fri Nov 9 14:26:17 2001
+++ linux/arch/ia64/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -114,8 +114,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
-
while (1) {
#ifdef CONFIG_SMP
diff -u --recursive --new-file v2.5.1/linux/arch/ia64/kernel/smp.c linux/arch/ia64/kernel/smp.c
--- v2.5.1/linux/arch/ia64/kernel/smp.c Fri Nov 9 14:26:17 2001
+++ linux/arch/ia64/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
@@ -51,7 +52,7 @@
#include
/* The 'big kernel lock' */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
/*
* Structure and data for smp_call_function(). This is designed to minimise static memory
diff -u --recursive --new-file v2.5.1/linux/arch/ia64/sn/io/hcl.c linux/arch/ia64/sn/io/hcl.c
--- v2.5.1/linux/arch/ia64/sn/io/hcl.c Thu Apr 5 12:51:47 2001
+++ linux/arch/ia64/sn/io/hcl.c Thu Dec 27 08:29:14 2001
@@ -1049,16 +1049,22 @@
struct file_operations *
hwgraph_cdevsw_get(devfs_handle_t de)
{
- return(devfs_get_ops(de));
+ struct file_operations *fops = devfs_get_ops(de);
+
+ devfs_put_ops(de); /* FIXME: this may need to be moved to callers */
+ return(fops);
}
/*
* hwgraph_bdevsw_get - returns the fops of the given devfs entry.
*/
-struct file_operations *
+struct file_operations * /* FIXME: shouldn't this be a blkdev? */
hwgraph_bdevsw_get(devfs_handle_t de)
{
- return(devfs_get_ops(de));
+ struct file_operations *fops = devfs_get_ops(de);
+
+ devfs_put_ops(de); /* FIXME: this may need to be moved to callers */
+ return(fops);
}
/*
diff -u --recursive --new-file v2.5.1/linux/arch/m68k/amiga/config.c linux/arch/m68k/amiga/config.c
--- v2.5.1/linux/arch/m68k/amiga/config.c Tue Dec 18 14:56:34 2001
+++ linux/arch/m68k/amiga/config.c Tue Dec 25 15:39:20 2001
@@ -98,7 +98,6 @@
extern void amiga_floppy_setup(char *, int *);
#endif
static void amiga_reset (void);
-static int amiga_wait_key (struct console *co);
extern void amiga_init_sound(void);
static void amiga_savekmsg_init(void);
static void amiga_mem_console_write(struct console *co, const char *b,
@@ -112,7 +111,6 @@
static struct console amiga_console_driver = {
name: "debug",
- wait_key: amiga_wait_key,
flags: CON_PRINTBUFFER,
index: -1,
};
@@ -740,33 +738,6 @@
}
return 0;
-}
-
-static int amiga_wait_key (struct console *co)
-{
- int i;
-
- while (1) {
- while (ciaa.pra & 0x40);
-
- /* debounce */
- for (i = 0; i < 1000; i++);
-
- if (!(ciaa.pra & 0x40))
- break;
- }
-
- /* wait for button up */
- while (1) {
- while (!(ciaa.pra & 0x40));
-
- /* debounce */
- for (i = 0; i < 1000; i++);
-
- if (ciaa.pra & 0x40)
- break;
- }
- return 0;
}
static NORET_TYPE void amiga_reset( void )
diff -u --recursive --new-file v2.5.1/linux/arch/m68k/kernel/process.c linux/arch/m68k/kernel/process.c
--- v2.5.1/linux/arch/m68k/kernel/process.c Sun Sep 30 12:26:08 2001
+++ linux/arch/m68k/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -81,7 +81,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
idle();
}
diff -u --recursive --new-file v2.5.1/linux/arch/m68k/mac/debug.c linux/arch/m68k/mac/debug.c
--- v2.5.1/linux/arch/m68k/mac/debug.c Mon Jun 11 19:15:27 2001
+++ linux/arch/m68k/mac/debug.c Tue Dec 25 15:39:20 2001
@@ -248,17 +248,6 @@
return( scc.cha_b_data );
}
-int mac_scca_console_wait_key(struct console *co)
-{
- int i;
- do {
- for( i = uSEC; i > 0; --i )
- barrier();
- } while( !(scc.cha_a_ctrl & 0x01) ); /* wait for rx buf filled */
- for( i = uSEC; i > 0; --i )
- barrier();
- return( scc.cha_a_data );
-}
#endif
/* The following two functions do a quick'n'dirty initialization of the MFP or
@@ -395,9 +384,6 @@
/* Mac modem port */
mac_init_scc_port( B9600|CS8, 0 );
mac_console_driver.write = mac_scca_console_write;
-#ifdef CONFIG_SERIAL_CONSOLE
- mac_console_driver.wait_key = mac_scca_console_wait_key;
-#endif
scc_port = 0;
}
else if (!strcmp( m68k_debug_device, "ser2" )) {
diff -u --recursive --new-file v2.5.1/linux/arch/m68k/mvme147/config.c linux/arch/m68k/mvme147/config.c
--- v2.5.1/linux/arch/m68k/mvme147/config.c Tue Dec 18 14:56:34 2001
+++ linux/arch/m68k/mvme147/config.c Tue Dec 25 15:39:20 2001
@@ -241,31 +241,7 @@
restore_flags(flags);
}
-
-static int m147_scc_wait_key (struct console *co)
-{
- volatile unsigned char *p = (volatile char *)M147_SCC_A_ADDR;
- unsigned long flags;
- int c;
-
- /* wait for rx buf filled */
- while ((*p & 0x01) == 0)
- ;
-
- save_flags(flags);
- cli();
-
- *p = 8;
- scc_delay();
- c = *p;
-
- restore_flags(flags);
- return c;
-}
-
-
void mvme147_init_console_port (struct console *co, int cflag)
{
co->write = m147_scc_write;
- co->wait_key = m147_scc_wait_key;
}
diff -u --recursive --new-file v2.5.1/linux/arch/m68k/q40/config.c linux/arch/m68k/q40/config.c
--- v2.5.1/linux/arch/m68k/q40/config.c Tue Dec 18 14:56:34 2001
+++ linux/arch/m68k/q40/config.c Tue Dec 25 15:39:20 2001
@@ -72,10 +72,8 @@
extern int ql_ticks;
-static int q40_wait_key(struct console *co){return 0;}
static struct console q40_console_driver = {
name: "debug",
- wait_key: q40_wait_key,
flags: CON_PRINTBUFFER,
index: -1,
};
diff -u --recursive --new-file v2.5.1/linux/arch/m68k/sun3x/prom.c linux/arch/m68k/sun3x/prom.c
--- v2.5.1/linux/arch/m68k/sun3x/prom.c Mon Jun 11 19:15:27 2001
+++ linux/arch/m68k/sun3x/prom.c Tue Dec 25 15:39:20 2001
@@ -96,7 +96,6 @@
sun3x_prom_write, /* write */
NULL, /* read */
NULL, /* device */
- NULL, /* wait_key */
NULL, /* unblank */
NULL, /* setup */
CON_PRINTBUFFER,
diff -u --recursive --new-file v2.5.1/linux/arch/mips/au1000/common/serial.c linux/arch/mips/au1000/common/serial.c
--- v2.5.1/linux/arch/mips/au1000/common/serial.c Fri Oct 5 12:06:51 2001
+++ linux/arch/mips/au1000/common/serial.c Tue Dec 25 15:39:20 2001
@@ -2922,35 +2922,6 @@
serial_out(info, UART_IER, ier);
}
-/*
- * Receive character from the serial port
- */
-static int serial_console_wait_key(struct console *co)
-{
- static struct async_struct *info;
- int ier, c;
-
- info = &async_sercons;
-
- /*
- * First save the IER then disable the interrupts so
- * that the real driver for the port does not get the
- * character.
- */
- ier = serial_in(info, UART_IER);
- serial_out(info, UART_IER, 0x00);
-
- while ((serial_in(info, UART_LSR) & UART_LSR_DR) == 0);
- c = serial_in(info, UART_RX);
-
- /*
- * Restore the interrupts
- */
- serial_out(info, UART_IER, ier);
-
- return c;
-}
-
static kdev_t serial_console_device(struct console *c)
{
return MKDEV(TTY_MAJOR, 64 + c->index);
@@ -3075,7 +3046,6 @@
name: "ttyS",
write: serial_console_write,
device: serial_console_device,
- wait_key: serial_console_wait_key,
setup: serial_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/arch/mips/baget/vacserial.c linux/arch/mips/baget/vacserial.c
--- v2.5.1/linux/arch/mips/baget/vacserial.c Sun Sep 9 10:43:01 2001
+++ linux/arch/mips/baget/vacserial.c Tue Dec 25 15:39:20 2001
@@ -2622,43 +2622,6 @@
serial_outp(&scr_info, VAC_UART_INT_MASK, ier);
}
-/*
- * Receive character from the serial port
- */
-static int serial_console_wait_key(struct console *co)
-{
- struct serial_state *ser;
- int ier;
- int lsr;
- int c;
- struct async_struct scr_info; /* serial_{in,out} because HUB6 */
-
- ser = rs_table + co->index;
- scr_info.magic = SERIAL_MAGIC;
- scr_info.port = ser->port;
- scr_info.flags = ser->flags;
-
- /*
- * First save the IER then disable the interrupts so
- * that the real driver for the port does not get the
- * character.
- */
- ier = serial_inp(&scr_info, VAC_UART_INT_MASK);
- serial_outp(&scr_info, VAC_UART_INT_MASK, 0x00);
-
- do {
- lsr = serial_inp(&scr_info, VAC_UART_INT_STATUS);
- } while (!(lsr & VAC_UART_STATUS_RX_READY));
- c = serial_inp(&scr_info, VAC_UART_RX);
-
- /*
- * Restore the interrupts
- */
- serial_outp(&scr_info, VAC_UART_INT_MASK, ier);
-
- return c;
-}
-
static kdev_t serial_console_device(struct console *c)
{
return MKDEV(TTY_MAJOR, 64 + c->index);
@@ -2812,7 +2775,6 @@
name: "ttyS",
write: serial_console_write,
device: serial_console_device,
- wait_key: serial_console_wait_key,
setup: serial_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/arch/mips/dec/promcon.c linux/arch/mips/dec/promcon.c
--- v2.5.1/linux/arch/mips/dec/promcon.c Thu Oct 12 14:20:48 2000
+++ linux/arch/mips/dec/promcon.c Tue Dec 25 15:39:20 2001
@@ -30,11 +30,6 @@
}
}
-static int prom_console_wait_key(struct console *co)
-{
- return prom_getchar();
-}
-
static int __init prom_console_setup(struct console *co, char *options)
{
return 0;
@@ -50,7 +45,6 @@
name: "ttyS",
write: prom_console_write,
device: prom_console_device,
- wait_key: prom_console_wait_key,
setup: prom_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/arch/mips/kernel/process.c linux/arch/mips/kernel/process.c
--- v2.5.1/linux/arch/mips/kernel/process.c Sun Sep 9 10:43:01 2001
+++ linux/arch/mips/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -36,7 +36,6 @@
{
/* endless idle loop with no priority at all */
current->nice = 20;
- current->counter = -100;
init_idle();
while (1) {
diff -u --recursive --new-file v2.5.1/linux/arch/mips/kernel/smp.c linux/arch/mips/kernel/smp.c
--- v2.5.1/linux/arch/mips/kernel/smp.c Wed Nov 21 10:31:09 2001
+++ linux/arch/mips/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include
#include
@@ -52,7 +53,7 @@
/* Ze Big Kernel Lock! */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
int smp_threads_ready; /* Not used */
int smp_num_cpus;
int global_irq_holder = NO_PROC_ID;
diff -u --recursive --new-file v2.5.1/linux/arch/mips64/kernel/process.c linux/arch/mips64/kernel/process.c
--- v2.5.1/linux/arch/mips64/kernel/process.c Fri Feb 9 11:29:44 2001
+++ linux/arch/mips64/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -34,7 +34,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
while (1) {
while (!current->need_resched)
if (wait_available)
diff -u --recursive --new-file v2.5.1/linux/arch/mips64/kernel/smp.c linux/arch/mips64/kernel/smp.c
--- v2.5.1/linux/arch/mips64/kernel/smp.c Wed Jul 4 11:50:39 2001
+++ linux/arch/mips64/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -5,6 +5,7 @@
#include
#include
#include
+#include
#include
#include
@@ -52,7 +53,7 @@
#endif /* CONFIG_SGI_IP27 */
/* The 'big kernel lock' */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
int smp_threads_ready; /* Not used */
atomic_t smp_commenced = ATOMIC_INIT(0);
struct cpuinfo_mips cpu_data[NR_CPUS];
diff -u --recursive --new-file v2.5.1/linux/arch/parisc/kernel/pdc_cons.c linux/arch/parisc/kernel/pdc_cons.c
--- v2.5.1/linux/arch/parisc/kernel/pdc_cons.c Sun Sep 16 21:23:15 2001
+++ linux/arch/parisc/kernel/pdc_cons.c Tue Dec 25 15:39:20 2001
@@ -105,10 +105,6 @@
static struct console pdc_cons = {
name: "ttyB",
write: pdc_console_write,
- read: NULL,
- device: NULL,
- wait_key: pdc_console_wait_key,
- unblank: NULL,
setup: pdc_console_setup,
flags: CON_PRINTBUFFER|CON_ENABLED, // |CON_CONSDEV,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/arch/parisc/kernel/process.c linux/arch/parisc/kernel/process.c
--- v2.5.1/linux/arch/parisc/kernel/process.c Fri Feb 9 11:29:44 2001
+++ linux/arch/parisc/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -71,7 +71,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
while (1) {
while (!current->need_resched) {
diff -u --recursive --new-file v2.5.1/linux/arch/ppc/8260_io/uart.c linux/arch/ppc/8260_io/uart.c
--- v2.5.1/linux/arch/ppc/8260_io/uart.c Mon May 21 17:04:46 2001
+++ linux/arch/ppc/8260_io/uart.c Thu Dec 27 08:21:28 2001
@@ -1732,7 +1732,7 @@
printk("lsr = %d (jiff=%lu)...", lsr, jiffies);
#endif
current->state = TASK_INTERRUPTIBLE;
-/* current->counter = 0; make us low-priority */
+/* current->dyn_prio = 0; make us low-priority */
schedule_timeout(char_time);
if (signal_pending(current))
break;
@@ -2216,54 +2216,6 @@
info->tx_cur = (cbd_t *)bdp;
}
-/*
- * Receive character from the serial port. This only works well
- * before the port is initialize for real use.
- */
-static int serial_console_wait_key(struct console *co)
-{
- struct serial_state *ser;
- u_char c, *cp;
- ser_info_t *info;
- volatile cbd_t *bdp;
- volatile smc_uart_t *up;
-
- ser = rs_table + co->index;
-
- /* Pointer to UART in parameter ram.
- */
- up = (smc_uart_t *)&immr->im_dprambase[ser->port];
-
- /* Get the address of the host memory buffer.
- * If the port has been initialized for general use, we must
- * use information from the port structure.
- */
- if ((info = (ser_info_t *)ser->info))
- bdp = info->rx_cur;
- else
- bdp = (cbd_t *)&immr->im_dprambase[up->smc_rbase];
-
- /*
- * We need to gracefully shut down the receiver, disable
- * interrupts, then read the input.
- */
- while (bdp->cbd_sc & BD_SC_EMPTY); /* Wait for a character */
- cp = __va(bdp->cbd_bufaddr);
-
- if (info) {
- if (bdp->cbd_sc & BD_SC_WRAP) {
- bdp = info->rx_bd_base;
- }
- else {
- bdp++;
- }
- info->rx_cur = (cbd_t *)bdp;
- }
-
- c = *cp;
- return((int)c);
-}
-
static kdev_t serial_console_device(struct console *c)
{
return MKDEV(TTYAUX_MAJOR, 64 + c->index);
@@ -2274,7 +2226,6 @@
name: "ttyS",
write: serial_console_write,
device: serial_console_device,
- wait_key: serial_console_wait_key,
setup: serial_console_setup,
flags: CON_PRINTBUFFER,
index: CONFIG_SERIAL_CONSOLE_PORT,
diff -u --recursive --new-file v2.5.1/linux/arch/ppc/8xx_io/uart.c linux/arch/ppc/8xx_io/uart.c
--- v2.5.1/linux/arch/ppc/8xx_io/uart.c Fri Nov 2 17:43:54 2001
+++ linux/arch/ppc/8xx_io/uart.c Thu Dec 27 08:21:28 2001
@@ -97,7 +97,6 @@
static void serial_console_write(struct console *c, const char *s,
unsigned count);
static kdev_t serial_console_device(struct console *c);
-static int serial_console_wait_key(struct console *co);
#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
static unsigned long break_pressed; /* break, really ... */
@@ -218,7 +217,6 @@
name: "ttyS",
write: serial_console_write,
device: serial_console_device,
- wait_key: serial_console_wait_key,
setup: serial_console_setup,
flags: CON_PRINTBUFFER,
index: CONFIG_SERIAL_CONSOLE_PORT,
@@ -1798,7 +1796,7 @@
printk("lsr = %d (jiff=%lu)...", lsr, jiffies);
#endif
current->state = TASK_INTERRUPTIBLE;
-/* current->counter = 0; make us low-priority */
+/* current->dyn_prio = 0; make us low-priority */
schedule_timeout(char_time);
if (signal_pending(current))
break;
@@ -2400,11 +2398,6 @@
}
return((int)c);
-}
-
-static int serial_console_wait_key(struct console *co)
-{
- return(my_console_wait_key(co->index, 0, NULL));
}
#ifdef CONFIG_XMON
diff -u --recursive --new-file v2.5.1/linux/arch/ppc/amiga/config.c linux/arch/ppc/amiga/config.c
--- v2.5.1/linux/arch/ppc/amiga/config.c Tue Dec 18 14:56:34 2001
+++ linux/arch/ppc/amiga/config.c Tue Dec 25 15:39:20 2001
@@ -104,7 +104,6 @@
extern void amiga_floppy_setup(char *, int *);
#endif
static void amiga_reset (void);
-static int amiga_wait_key (struct console *co);
extern void amiga_init_sound(void);
static void amiga_savekmsg_init(void);
static void amiga_mem_console_write(struct console *co, const char *b,
@@ -118,7 +117,6 @@
static struct console amiga_console_driver = {
name: "debug",
- wait_key: amiga_wait_key,
flags: CON_PRINTBUFFER,
index: -1,
};
@@ -734,33 +732,6 @@
}
return 0;
-}
-
-static int amiga_wait_key (struct console *co)
-{
- int i;
-
- while (1) {
- while (ciaa.pra & 0x40);
-
- /* debounce */
- for (i = 0; i < 1000; i++);
-
- if (!(ciaa.pra & 0x40))
- break;
- }
-
- /* wait for button up */
- while (1) {
- while (!(ciaa.pra & 0x40));
-
- /* debounce */
- for (i = 0; i < 1000; i++);
-
- if (ciaa.pra & 0x40)
- break;
- }
- return 0;
}
static NORET_TYPE void amiga_reset( void )
diff -u --recursive --new-file v2.5.1/linux/arch/ppc/kernel/idle.c linux/arch/ppc/kernel/idle.c
--- v2.5.1/linux/arch/ppc/kernel/idle.c Fri Nov 2 17:43:54 2001
+++ linux/arch/ppc/kernel/idle.c Thu Dec 27 08:21:28 2001
@@ -54,7 +54,6 @@
/* endless loop with no priority at all */
current->nice = 20;
- current->counter = -100;
init_idle();
for (;;) {
#ifdef CONFIG_SMP
diff -u --recursive --new-file v2.5.1/linux/arch/ppc/kernel/m8xx_setup.c linux/arch/ppc/kernel/m8xx_setup.c
--- v2.5.1/linux/arch/ppc/kernel/m8xx_setup.c Fri Nov 16 10:10:08 2001
+++ linux/arch/ppc/kernel/m8xx_setup.c Mon Dec 17 11:12:05 2001
@@ -55,12 +55,6 @@
extern void m8xx_ide_init(void);
-#ifdef CONFIG_BLK_DEV_RAM
-extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */
-extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */
-extern int rd_image_start; /* starting block # of image */
-#endif
-
extern unsigned long find_available_memory(void);
extern void m8xx_cpm_reset(uint);
diff -u --recursive --new-file v2.5.1/linux/arch/ppc/kernel/prep_setup.c linux/arch/ppc/kernel/prep_setup.c
--- v2.5.1/linux/arch/ppc/kernel/prep_setup.c Fri Nov 16 10:10:08 2001
+++ linux/arch/ppc/kernel/prep_setup.c Mon Dec 17 11:12:05 2001
@@ -111,12 +111,6 @@
extern int probingmem;
extern unsigned long loops_per_jiffy;
-#ifdef CONFIG_BLK_DEV_RAM
-extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */
-extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */
-extern int rd_image_start; /* starting block # of image */
-#endif
-
#ifdef CONFIG_SOUND_MODULE
EXPORT_SYMBOL(ppc_cs4232_dma);
EXPORT_SYMBOL(ppc_cs4232_dma2);
diff -u --recursive --new-file v2.5.1/linux/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c
--- v2.5.1/linux/arch/ppc/kernel/smp.c Wed Nov 21 10:31:09 2001
+++ linux/arch/ppc/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
@@ -47,7 +48,7 @@
struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 };
atomic_t ipi_recv;
atomic_t ipi_sent;
-spinlock_t kernel_flag __cacheline_aligned = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
unsigned int prof_multiplier[NR_CPUS];
unsigned int prof_counter[NR_CPUS];
cycles_t cacheflush_time;
diff -u --recursive --new-file v2.5.1/linux/arch/s390/kernel/process.c linux/arch/s390/kernel/process.c
--- v2.5.1/linux/arch/s390/kernel/process.c Thu Oct 11 09:04:57 2001
+++ linux/arch/s390/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -57,7 +57,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
wait_psw.mask = _WAIT_PSW_MASK;
wait_psw.addr = (unsigned long) &&idle_wakeup | 0x80000000L;
while(1) {
diff -u --recursive --new-file v2.5.1/linux/arch/s390/kernel/smp.c linux/arch/s390/kernel/smp.c
--- v2.5.1/linux/arch/s390/kernel/smp.c Wed Nov 21 10:31:09 2001
+++ linux/arch/s390/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -29,6 +29,7 @@
#include
#include
+#include
#include
#include
@@ -55,7 +56,7 @@
int smp_threads_ready=0; /* Set when the idlers are all forked. */
static atomic_t smp_commenced = ATOMIC_INIT(0);
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
unsigned long cpu_online_map;
diff -u --recursive --new-file v2.5.1/linux/arch/s390x/kernel/process.c linux/arch/s390x/kernel/process.c
--- v2.5.1/linux/arch/s390x/kernel/process.c Thu Oct 11 09:04:57 2001
+++ linux/arch/s390x/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -57,7 +57,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
wait_psw.mask = _WAIT_PSW_MASK;
wait_psw.addr = (unsigned long) &&idle_wakeup;
while(1) {
diff -u --recursive --new-file v2.5.1/linux/arch/s390x/kernel/smp.c linux/arch/s390x/kernel/smp.c
--- v2.5.1/linux/arch/s390x/kernel/smp.c Wed Nov 21 10:31:09 2001
+++ linux/arch/s390x/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -29,6 +29,7 @@
#include
#include
+#include
#include
#include
@@ -55,7 +56,7 @@
int smp_threads_ready=0; /* Set when the idlers are all forked. */
static atomic_t smp_commenced = ATOMIC_INIT(0);
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
unsigned long cpu_online_map;
diff -u --recursive --new-file v2.5.1/linux/arch/sh/kernel/process.c linux/arch/sh/kernel/process.c
--- v2.5.1/linux/arch/sh/kernel/process.c Mon Oct 15 13:36:48 2001
+++ linux/arch/sh/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -41,7 +41,6 @@
/* endless idle loop with no priority at all */
init_idle();
current->nice = 20;
- current->counter = -100;
while (1) {
if (hlt_counter) {
diff -u --recursive --new-file v2.5.1/linux/arch/sh/kernel/setup.c linux/arch/sh/kernel/setup.c
--- v2.5.1/linux/arch/sh/kernel/setup.c Fri Nov 16 18:38:39 2001
+++ linux/arch/sh/kernel/setup.c Tue Dec 25 15:39:20 2001
@@ -140,15 +140,6 @@
sh_bios_console_write(s, count);
}
-/*
- * Receive character from the serial port
- */
-static int sh_console_wait_key(struct console *co)
-{
- /* Not implemented yet */
- return 0;
-}
-
static kdev_t sh_console_device(struct console *c)
{
/* TODO: this is totally bogus */
@@ -183,7 +174,6 @@
name: "bios",
write: sh_console_write,
device: sh_console_device,
- wait_key: sh_console_wait_key,
setup: sh_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/arch/sparc/kernel/process.c linux/arch/sparc/kernel/process.c
--- v2.5.1/linux/arch/sparc/kernel/process.c Tue Nov 13 09:16:05 2001
+++ linux/arch/sparc/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -61,7 +61,6 @@
/* endless idle loop with no priority at all */
current->nice = 20;
- current->counter = -100;
init_idle();
for (;;) {
@@ -110,7 +109,6 @@
{
/* endless idle loop with no priority at all */
current->nice = 20;
- current->counter = -100;
init_idle();
while(1) {
diff -u --recursive --new-file v2.5.1/linux/arch/sparc/kernel/smp.c linux/arch/sparc/kernel/smp.c
--- v2.5.1/linux/arch/sparc/kernel/smp.c Tue Nov 13 09:16:05 2001
+++ linux/arch/sparc/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -18,6 +18,7 @@
#include
#include
#include
+#include
#include
#include
@@ -66,7 +67,7 @@
*/
/* Kernel spinlock */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
/* Used to make bitops atomic */
unsigned char bitops_spinlock = 0;
diff -u --recursive --new-file v2.5.1/linux/arch/sparc64/kernel/process.c linux/arch/sparc64/kernel/process.c
--- v2.5.1/linux/arch/sparc64/kernel/process.c Sun Oct 21 10:36:54 2001
+++ linux/arch/sparc64/kernel/process.c Thu Dec 27 08:21:28 2001
@@ -54,7 +54,6 @@
/* endless idle loop with no priority at all */
current->nice = 20;
- current->counter = -100;
init_idle();
for (;;) {
@@ -84,7 +83,6 @@
int cpu_idle(void)
{
current->nice = 20;
- current->counter = -100;
init_idle();
while(1) {
diff -u --recursive --new-file v2.5.1/linux/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c
--- v2.5.1/linux/arch/sparc64/kernel/smp.c Wed Nov 21 10:31:09 2001
+++ linux/arch/sparc64/kernel/smp.c Sun Dec 30 10:02:19 2001
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include
#include
@@ -39,17 +40,17 @@
extern void calibrate_delay(void);
extern unsigned prom_cpu_nodes[];
-struct cpuinfo_sparc cpu_data[NR_CPUS] __attribute__ ((aligned (64)));
+cpuinfo_sparc cpu_data[NR_CPUS];
-volatile int __cpu_number_map[NR_CPUS] __attribute__ ((aligned (64)));
-volatile int __cpu_logical_map[NR_CPUS] __attribute__ ((aligned (64)));
+volatile int __cpu_number_map[NR_CPUS] __attribute__ ((aligned (SMP_CACHE_BYTES)));
+volatile int __cpu_logical_map[NR_CPUS] __attribute__ ((aligned (SMP_CACHE_BYTES)));
/* Please don't make this stuff initdata!!! --DaveM */
static unsigned char boot_cpu_id = 0;
static int smp_activated = 0;
/* Kernel spinlock */
-spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
+spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
volatile int smp_processors_ready = 0;
unsigned long cpu_present_map = 0;
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/acornscsi.c linux/drivers/acorn/scsi/acornscsi.c
--- v2.5.1/linux/drivers/acorn/scsi/acornscsi.c Thu Oct 11 09:04:57 2001
+++ linux/drivers/acorn/scsi/acornscsi.c Tue Dec 25 17:04:40 2001
@@ -3142,18 +3142,17 @@
static int __init acornscsi_init(void)
{
- acornscsi_template.module = THIS_MODULE;
- scsi_register_module(MODULE_SCSI_HA, &acornscsi_template);
+ scsi_register_host(&acornscsi_template);
if (acornscsi_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &acornscsi_template);
+ scsi_unregister_host(&acornscsi_template);
return -ENODEV;
}
static void __exit acornscsi_exit(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &acornscsi_template);
+ scsi_unregister_host(&acornscsi_template);
}
module_init(acornscsi_init);
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/arxescsi.c linux/drivers/acorn/scsi/arxescsi.c
--- v2.5.1/linux/drivers/acorn/scsi/arxescsi.c Thu Oct 11 09:04:57 2001
+++ linux/drivers/acorn/scsi/arxescsi.c Tue Dec 25 17:04:40 2001
@@ -423,17 +423,17 @@
static int __init init_arxe_scsi_driver(void)
{
arxescsi_template.module = THIS_MODULE;
- scsi_register_module(MODULE_SCSI_HA, &arxescsi_template);
+ scsi_register_host(&arxescsi_template);
if (arxescsi_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &arxescsi_template);
+ scsi_unregister_host(&arxescsi_template);
return -ENODEV;
}
static void __exit exit_arxe_scsi_driver(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &arxescsi_template);
+ scsi_unregister_host(&arxescsi_template);
}
module_init(init_arxe_scsi_driver);
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/cumana_1.c linux/drivers/acorn/scsi/cumana_1.c
--- v2.5.1/linux/drivers/acorn/scsi/cumana_1.c Thu Sep 13 15:21:32 2001
+++ linux/drivers/acorn/scsi/cumana_1.c Tue Dec 25 17:04:40 2001
@@ -409,17 +409,17 @@
static int __init cumanascsi_init(void)
{
- scsi_register_module(MODULE_SCSI_HA, &cumanascsi_template);
+ scsi_register_host(&cumanascsi_template);
if (cumanascsi_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &cumanascsi_template);
+ scsi_unregister_host(&cumanascsi_template);
return -ENODEV;
}
static void __exit cumanascsi_exit(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &cumanascsi_template);
+ scsi_unregister_host(&cumanascsi_template);
}
module_init(cumanascsi_init);
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/cumana_2.c linux/drivers/acorn/scsi/cumana_2.c
--- v2.5.1/linux/drivers/acorn/scsi/cumana_2.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/acorn/scsi/cumana_2.c Tue Dec 25 17:04:40 2001
@@ -579,17 +579,17 @@
static int __init cumanascsi2_init(void)
{
- scsi_register_module(MODULE_SCSI_HA, &cumanascsi2_template);
+ scsi_register_host(&cumanascsi2_template);
if (cumanascsi2_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &cumanascsi2_template);
+ scsi_unregister_host(&cumanascsi2_template);
return -ENODEV;
}
static void __exit cumanascsi2_exit(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &cumanascsi2_template);
+ scsi_unregister_host(&cumanascsi2_template);
}
module_init(cumanascsi2_init);
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/ecoscsi.c linux/drivers/acorn/scsi/ecoscsi.c
--- v2.5.1/linux/drivers/acorn/scsi/ecoscsi.c Thu Oct 25 13:53:46 2001
+++ linux/drivers/acorn/scsi/ecoscsi.c Tue Dec 25 17:04:40 2001
@@ -276,17 +276,17 @@
static int __init ecoscsi_init(void)
{
- scsi_register_module(MODULE_SCSI_HA, &ecoscsi_template);
+ scsi_register_host(&ecoscsi_template);
if (ecoscsi_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &ecoscsi_template);
+ scsi_unregister_host(&ecoscsi_template);
return -ENODEV;
}
static void __exit ecoscsi_exit(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &ecoscsi_template);
+ scsi_unregister_host(&ecoscsi_template);
}
module_init(ecoscsi_init);
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/eesox.c linux/drivers/acorn/scsi/eesox.c
--- v2.5.1/linux/drivers/acorn/scsi/eesox.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/acorn/scsi/eesox.c Tue Dec 25 17:04:40 2001
@@ -581,17 +581,17 @@
static int __init eesox_init(void)
{
- scsi_register_module(MODULE_SCSI_HA, &eesox_template);
+ scsi_register_host(&eesox_template);
if (eesox_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &eesox_template);
+ scsi_unregister_host(&eesox_template);
return -ENODEV;
}
static void __exit eesox_exit(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &eesox_template);
+ scsi_unregister_host(&eesox_template);
}
module_init(eesox_init);
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/oak.c linux/drivers/acorn/scsi/oak.c
--- v2.5.1/linux/drivers/acorn/scsi/oak.c Thu Oct 11 09:04:57 2001
+++ linux/drivers/acorn/scsi/oak.c Tue Dec 25 17:04:40 2001
@@ -270,17 +270,17 @@
static int __init oakscsi_init(void)
{
- scsi_register_module(MODULE_SCSI_HA, &oakscsi_template);
+ scsi_register_host(&oakscsi_template);
if (oakscsi_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &oakscsi_template);
+ scsi_unregister_host(&oakscsi_template);
return -ENODEV;
}
static void __exit oakscsi_exit(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &oakscsi_template);
+ scsi_unregister_host(&oakscsi_template);
}
module_init(oakscsi_init);
diff -u --recursive --new-file v2.5.1/linux/drivers/acorn/scsi/powertec.c linux/drivers/acorn/scsi/powertec.c
--- v2.5.1/linux/drivers/acorn/scsi/powertec.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/acorn/scsi/powertec.c Tue Dec 25 17:04:40 2001
@@ -481,17 +481,17 @@
static int __init powertecscsi_init(void)
{
- scsi_register_module(MODULE_SCSI_HA, &powertecscsi_template);
+ scsi_register_host(&powertecscsi_template);
if (powertecscsi_template.present)
return 0;
- scsi_unregister_module(MODULE_SCSI_HA, &powertecscsi_template);
+ scsi_unregister_host(&powertecscsi_template);
return -ENODEV;
}
static void __exit powertecscsi_exit(void)
{
- scsi_unregister_module(MODULE_SCSI_HA, &powertecscsi_template);
+ scsi_unregister_host(&powertecscsi_template);
}
module_init(powertecscsi_init);
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/ac_adapter/ac_osl.c linux/drivers/acpi/ospm/ac_adapter/ac_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/ac_adapter/ac_osl.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/ac_adapter/ac_osl.c Sun Dec 30 09:40:59 2001
@@ -35,6 +35,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - AC Adapter Driver");
+MODULE_LICENSE("GPL");
#define AC_PROC_ROOT "ac_adapter"
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/battery/bt_osl.c linux/drivers/acpi/ospm/battery/bt_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/battery/bt_osl.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/battery/bt_osl.c Sun Dec 30 09:40:59 2001
@@ -44,6 +44,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Control Method Battery Driver");
+MODULE_LICENSE("GPL");
#define BT_PROC_ROOT "battery"
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/busmgr/bm_osl.c linux/drivers/acpi/ospm/busmgr/bm_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/busmgr/bm_osl.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/busmgr/bm_osl.c Sun Dec 30 09:40:59 2001
@@ -38,6 +38,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI Bus Manager");
+MODULE_LICENSE("GPL");
/*****************************************************************************
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/button/bn_osl.c linux/drivers/acpi/ospm/button/bn_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/button/bn_osl.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/button/bn_osl.c Sun Dec 30 09:40:59 2001
@@ -35,6 +35,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Button Driver");
+MODULE_LICENSE("GPL");
#define BN_PROC_ROOT "button"
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/ec/ec_osl.c linux/drivers/acpi/ospm/ec/ec_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/ec/ec_osl.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/ec/ec_osl.c Sun Dec 30 09:40:59 2001
@@ -36,6 +36,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Embedded Controller Driver");
+MODULE_LICENSE("GPL");
extern struct proc_dir_entry *bm_proc_root;
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/processor/pr_osl.c linux/drivers/acpi/ospm/processor/pr_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/processor/pr_osl.c Fri Nov 9 13:58:02 2001
+++ linux/drivers/acpi/ospm/processor/pr_osl.c Sun Dec 30 09:40:59 2001
@@ -37,6 +37,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - IA32 Processor Driver");
+MODULE_LICENSE("GPL");
#define PR_PROC_ROOT "processor"
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/system/sm_osl.c linux/drivers/acpi/ospm/system/sm_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/system/sm_osl.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/system/sm_osl.c Sun Dec 30 09:40:59 2001
@@ -42,6 +42,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - ACPI System Driver");
+MODULE_LICENSE("GPL");
#define SM_PROC_INFO "info"
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/thermal/tz_osl.c linux/drivers/acpi/ospm/thermal/tz_osl.c
--- v2.5.1/linux/drivers/acpi/ospm/thermal/tz_osl.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/thermal/tz_osl.c Sun Dec 30 09:40:59 2001
@@ -35,6 +35,7 @@
MODULE_AUTHOR("Andrew Grover");
MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Thermal Zone Driver");
+MODULE_LICENSE("GPL");
int TZP = 0;
MODULE_PARM(TZP, "i");
diff -u --recursive --new-file v2.5.1/linux/drivers/acpi/ospm/thermal/tzpolicy.c linux/drivers/acpi/ospm/thermal/tzpolicy.c
--- v2.5.1/linux/drivers/acpi/ospm/thermal/tzpolicy.c Wed Oct 24 14:06:22 2001
+++ linux/drivers/acpi/ospm/thermal/tzpolicy.c Sun Dec 30 16:44:13 2001
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/atm/fore200e.c linux/drivers/atm/fore200e.c
--- v2.5.1/linux/drivers/atm/fore200e.c Thu Sep 13 15:21:32 2001
+++ linux/drivers/atm/fore200e.c Sun Dec 30 10:31:51 2001
@@ -39,7 +39,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/block/DAC960.c linux/drivers/block/DAC960.c
--- v2.5.1/linux/drivers/block/DAC960.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/DAC960.c Sun Dec 30 10:31:51 2001
@@ -45,7 +45,6 @@
#include
#include
#include
-#include
#include
#include "DAC960.h"
diff -u --recursive --new-file v2.5.1/linux/drivers/block/blkpg.c linux/drivers/block/blkpg.c
--- v2.5.1/linux/drivers/block/blkpg.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/blkpg.c Thu Dec 27 08:17:43 2001
@@ -201,6 +201,7 @@
struct gendisk *g;
u64 ullval = 0;
int intval, *iptr;
+ unsigned short usval;
if (!dev)
return -EINVAL;
@@ -247,9 +248,12 @@
return put_user(iptr[MINOR(dev)], (long *) arg);
case BLKSECTGET:
- if ((q = blk_get_queue(dev)))
- return put_user(q->max_sectors, (unsigned short *)arg);
- return -EINVAL;
+ if ((q = blk_get_queue(dev)) == NULL)
+ return -EINVAL;
+
+ usval = q->max_sectors;
+ blk_put_queue(q);
+ return put_user(usval, (unsigned short *)arg);
case BLKFLSBUF:
if (!capable(CAP_SYS_ADMIN))
@@ -291,9 +295,7 @@
case BLKBSZGET:
/* get the logical block size (cf. BLKSSZGET) */
- intval = BLOCK_SIZE;
- if (blksize_size[MAJOR(dev)])
- intval = blksize_size[MAJOR(dev)][MINOR(dev)];
+ intval = block_size(dev);
return put_user(intval, (int *) arg);
case BLKBSZSET:
diff -u --recursive --new-file v2.5.1/linux/drivers/block/block_ioctl.c linux/drivers/block/block_ioctl.c
--- v2.5.1/linux/drivers/block/block_ioctl.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/block_ioctl.c Thu Dec 27 08:15:15 2001
@@ -35,7 +35,7 @@
DECLARE_COMPLETION(wait);
int err = 0;
- rq->flags |= REQ_BARRIER;
+ rq->flags |= REQ_NOMERGE;
rq->waiting = &wait;
elv_add_request(q, rq, 1);
generic_unplug_device(q);
@@ -76,8 +76,8 @@
err = -ENOTTY;
}
-#if 0
blk_put_queue(q);
-#endif
return err;
}
+
+EXPORT_SYMBOL(block_ioctl);
diff -u --recursive --new-file v2.5.1/linux/drivers/block/elevator.c linux/drivers/block/elevator.c
--- v2.5.1/linux/drivers/block/elevator.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/elevator.c Sat Dec 29 11:17:37 2001
@@ -53,7 +53,7 @@
* if .next is a valid request
*/
next = rq->queuelist.next;
- if (next == head)
+ if (unlikely(next == head))
return 0;
next_rq = list_entry(next, struct request, queuelist);
@@ -101,7 +101,7 @@
*/
inline int elv_rq_merge_ok(struct request *rq, struct bio *bio)
{
- if (!(rq->flags & REQ_CMD))
+ if (!rq_mergeable(rq))
return 0;
/*
@@ -109,8 +109,6 @@
*/
if (bio_data_dir(bio) != rq_data_dir(rq))
return 0;
- if (rq->flags & REQ_NOMERGE)
- return 0;
/*
* same device and no special stuff set, merge is ok
@@ -121,49 +119,71 @@
return 0;
}
-int elevator_linus_merge(request_queue_t *q, struct request **req,
- struct list_head *head, struct bio *bio)
+inline int elv_try_merge(struct request *__rq, struct bio *bio)
{
unsigned int count = bio_sectors(bio);
- struct list_head *entry = &q->queue_head;
int ret = ELEVATOR_NO_MERGE;
+
+ /*
+ * we can merge and sequence is ok, check if it's possible
+ */
+ if (elv_rq_merge_ok(__rq, bio)) {
+ if (__rq->sector + __rq->nr_sectors == bio->bi_sector) {
+ ret = ELEVATOR_BACK_MERGE;
+ } else if (__rq->sector - count == bio->bi_sector) {
+ __rq->elevator_sequence -= count;
+ ret = ELEVATOR_FRONT_MERGE;
+ }
+ }
+
+ return ret;
+}
+
+int elevator_linus_merge(request_queue_t *q, struct request **req,
+ struct bio *bio)
+{
+ struct list_head *entry;
struct request *__rq;
+ int ret;
+
+ /*
+ * give a one-shot try to merging with the last touched
+ * request
+ */
+ if (q->last_merge) {
+ __rq = list_entry_rq(q->last_merge);
+ BUG_ON(__rq->flags & REQ_STARTED);
+
+ if ((ret = elv_try_merge(__rq, bio))) {
+ *req = __rq;
+ return ret;
+ }
+ }
entry = &q->queue_head;
- while ((entry = entry->prev) != head) {
+ ret = ELEVATOR_NO_MERGE;
+ while ((entry = entry->prev) != &q->queue_head) {
__rq = list_entry_rq(entry);
- prefetch(list_entry_rq(entry->prev));
+ if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
+ break;
/*
* simply "aging" of requests in queue
*/
if (__rq->elevator_sequence-- <= 0)
break;
- if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
- break;
if (!(__rq->flags & REQ_CMD))
continue;
+ if (__rq->elevator_sequence < bio_sectors(bio))
+ break;
if (!*req && bio_rq_in_between(bio, __rq, &q->queue_head))
*req = __rq;
- if (!elv_rq_merge_ok(__rq, bio))
- continue;
-
- if (__rq->elevator_sequence < count)
- break;
- /*
- * we can merge and sequence is ok, check if it's possible
- */
- if (__rq->sector + __rq->nr_sectors == bio->bi_sector) {
- ret = ELEVATOR_BACK_MERGE;
- *req = __rq;
- break;
- } else if (__rq->sector - count == bio->bi_sector) {
- ret = ELEVATOR_FRONT_MERGE;
- __rq->elevator_sequence -= count;
+ if ((ret = elv_try_merge(__rq, bio))) {
*req = __rq;
+ q->last_merge = &__rq->queuelist;
break;
}
}
@@ -183,7 +203,6 @@
entry = &req->queuelist;
while ((entry = entry->next) != &q->queue_head) {
struct request *tmp;
- prefetch(list_entry_rq(entry->next));
tmp = list_entry_rq(entry);
tmp->elevator_sequence -= count;
}
@@ -199,12 +218,20 @@
struct list_head *insert_here)
{
list_add(&rq->queuelist, insert_here);
+
+ /*
+ * new merges must not precede this barrier
+ */
+ if (rq->flags & REQ_BARRIER)
+ q->last_merge = NULL;
+ else if (!q->last_merge)
+ q->last_merge = &rq->queuelist;
}
struct request *elv_next_request_fn(request_queue_t *q)
{
if (!blk_queue_empty(q))
- return list_entry(q->queue_head.next, struct request, queuelist);
+ return list_entry_rq(q->queue_head.next);
return NULL;
}
@@ -222,17 +249,24 @@
* See if we can find a request that this buffer can be coalesced with.
*/
int elevator_noop_merge(request_queue_t *q, struct request **req,
- struct list_head *head, struct bio *bio)
+ struct bio *bio)
{
- unsigned int count = bio_sectors(bio);
struct list_head *entry = &q->queue_head;
struct request *__rq;
+ int ret;
- entry = &q->queue_head;
- while ((entry = entry->prev) != head) {
- __rq = list_entry_rq(entry);
+ if (q->last_merge) {
+ __rq = list_entry_rq(q->last_merge);
+ BUG_ON(__rq->flags & REQ_STARTED);
+
+ if ((ret = elv_try_merge(__rq, bio))) {
+ *req = __rq;
+ return ret;
+ }
+ }
- prefetch(list_entry_rq(entry->prev));
+ while ((entry = entry->prev) != &q->queue_head) {
+ __rq = list_entry_rq(entry);
if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
break;
@@ -240,18 +274,10 @@
if (!(__rq->flags & REQ_CMD))
continue;
- if (!elv_rq_merge_ok(__rq, bio))
- continue;
-
- /*
- * we can merge and sequence is ok, check if it's possible
- */
- if (__rq->sector + __rq->nr_sectors == bio->bi_sector) {
- *req = __rq;
- return ELEVATOR_BACK_MERGE;
- } else if (__rq->sector - count == bio->bi_sector) {
+ if ((ret = elv_try_merge(__rq, bio))) {
*req = __rq;
- return ELEVATOR_FRONT_MERGE;
+ q->last_merge = &__rq->queuelist;
+ return ret;
}
}
@@ -267,6 +293,7 @@
*e = type;
INIT_LIST_HEAD(&q->queue_head);
+ q->last_merge = NULL;
if (e->elevator_init_fn)
return e->elevator_init_fn(q, e);
diff -u --recursive --new-file v2.5.1/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- v2.5.1/linux/drivers/block/ll_rw_blk.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/ll_rw_blk.c Sat Dec 29 11:17:37 2001
@@ -117,6 +117,11 @@
return &blk_dev[MAJOR(dev)].request_queue;
}
+void blk_queue_prep_rq(request_queue_t *q, prep_rq_fn *pfn)
+{
+ q->prep_rq_fn = pfn;
+}
+
/**
* blk_queue_make_request - define an alternate make_request function for a device
* @q: the request queue for the device to be affected
@@ -150,6 +155,11 @@
blk_queue_max_sectors(q, MAX_SECTORS);
blk_queue_hardsect_size(q, 512);
+ /*
+ * by default assume old behaviour and bounce for any highmem page
+ */
+ blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
+
init_waitqueue_head(&q->queue_wait);
}
@@ -179,7 +189,6 @@
if (dma_addr == BLK_BOUNCE_ISA) {
init_emergency_isa_pool();
q->bounce_gfp = GFP_NOIO | GFP_DMA;
- printk("isa pfn %lu, max low %lu, max %lu\n", bounce_pfn, blk_max_low_pfn, blk_max_pfn);
} else
q->bounce_gfp = GFP_NOHIGHIO;
@@ -319,7 +328,7 @@
/*
* standard prep_rq_fn that builds 10 byte cmds
*/
-static int ll_10byte_cmd_build(request_queue_t *q, struct request *rq)
+int ll_10byte_cmd_build(request_queue_t *q, struct request *rq)
{
int hard_sect = get_hardsect_size(rq->rq_dev);
sector_t block = rq->hard_sector / (hard_sect >> 9);
@@ -477,7 +486,7 @@
sg[nsegs - 1].length += nbytes;
} else {
new_segment:
- sg[nsegs].address = NULL;
+ memset(&sg[nsegs],0,sizeof(struct scatterlist));
sg[nsegs].page = bvec->bv_page;
sg[nsegs].length = nbytes;
sg[nsegs].offset = bvec->bv_offset;
@@ -504,6 +513,7 @@
if (req->nr_phys_segments + nr_phys_segs > q->max_phys_segments) {
req->flags |= REQ_NOMERGE;
+ q->last_merge = NULL;
return 0;
}
@@ -523,6 +533,7 @@
if (req->nr_hw_segments + nr_hw_segs > q->max_hw_segments) {
req->flags |= REQ_NOMERGE;
+ q->last_merge = NULL;
return 0;
}
@@ -540,11 +551,11 @@
{
if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) {
req->flags |= REQ_NOMERGE;
+ q->last_merge = NULL;
return 0;
}
- if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(req->biotail),
- __BVEC_START(bio)))
+ if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(req->biotail), __BVEC_START(bio)))
return ll_new_mergeable(q, req, bio);
return ll_new_hw_segment(q, req, bio);
@@ -555,11 +566,11 @@
{
if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) {
req->flags |= REQ_NOMERGE;
+ q->last_merge = NULL;
return 0;
}
- if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio),
- __BVEC_START(req->bio)))
+ if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(req->bio)))
return ll_new_mergeable(q, req, bio);
return ll_new_hw_segment(q, req, bio);
@@ -568,7 +579,7 @@
static int ll_merge_requests_fn(request_queue_t *q, struct request *req,
struct request *next)
{
- int total_phys_segments = req->nr_phys_segments + next->nr_phys_segments;
+ int total_phys_segments = req->nr_phys_segments +next->nr_phys_segments;
int total_hw_segments = req->nr_hw_segments + next->nr_hw_segments;
/*
@@ -799,18 +810,14 @@
q->back_merge_fn = ll_back_merge_fn;
q->front_merge_fn = ll_front_merge_fn;
q->merge_requests_fn = ll_merge_requests_fn;
- q->prep_rq_fn = ll_10byte_cmd_build;
+ q->prep_rq_fn = NULL;
q->plug_tq.sync = 0;
q->plug_tq.routine = &generic_unplug_device;
q->plug_tq.data = q;
q->queue_flags = (1 << QUEUE_FLAG_CLUSTER);
q->queue_lock = lock;
+ q->last_merge = NULL;
- /*
- * by default assume old behaviour and bounce for any highmem page
- */
- blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
-
blk_queue_segment_boundary(q, 0xffffffff);
blk_queue_make_request(q, __make_request);
@@ -874,11 +881,19 @@
BUG_ON(rw != READ && rw != WRITE);
+ spin_lock_irq(q->queue_lock);
rq = get_request(q, rw);
+ spin_unlock_irq(q->queue_lock);
if (!rq && (gfp_mask & __GFP_WAIT))
rq = get_request_wait(q, rw);
+ if (rq) {
+ rq->flags = 0;
+ rq->buffer = NULL;
+ rq->bio = rq->biotail = NULL;
+ rq->waiting = NULL;
+ }
return rq;
}
@@ -944,13 +959,10 @@
drive_stat_acct(req, req->nr_sectors, 1);
/*
- * debug stuff...
+ * it's a bug to let this rq preempt an already started request
*/
- if (insert_here == &q->queue_head) {
- struct request *__rq = __elv_next_request(q);
-
- BUG_ON(__rq && (__rq->flags & REQ_STARTED));
- }
+ if (insert_here->next != &q->queue_head)
+ BUG_ON(list_entry_rq(insert_here->next)->flags & REQ_STARTED);
/*
* elevator indicated where it wants this request to be
@@ -965,11 +977,17 @@
void blkdev_release_request(struct request *req)
{
struct request_list *rl = req->rl;
+ request_queue_t *q = req->q;
req->rq_status = RQ_INACTIVE;
req->q = NULL;
req->rl = NULL;
+ if (q) {
+ if (q->last_merge == &req->queuelist)
+ q->last_merge = NULL;
+ }
+
/*
* Request may not have originated from ll_rw_blk. if not,
* it didn't come out of our reserved rq pools
@@ -985,14 +1003,10 @@
/*
* Has to be called with the request spinlock acquired
*/
-static void attempt_merge(request_queue_t *q, struct request *req)
+static void attempt_merge(request_queue_t *q, struct request *req,
+ struct request *next)
{
- struct request *next = blkdev_next_request(req);
-
- /*
- * not a rw command
- */
- if (!(next->flags & REQ_CMD))
+ if (!rq_mergeable(req) || !rq_mergeable(next))
return;
/*
@@ -1001,12 +1015,6 @@
if (req->sector + req->nr_sectors != next->sector)
return;
- /*
- * don't touch NOMERGE rq, or one that has been started by driver
- */
- if (next->flags & (REQ_NOMERGE | REQ_STARTED))
- return;
-
if (rq_data_dir(req) != rq_data_dir(next)
|| req->rq_dev != next->rq_dev
|| req->nr_sectors + next->nr_sectors > q->max_sectors
@@ -1014,10 +1022,10 @@
return;
/*
- * If we are not allowed to merge these requests, then
- * return. If we are allowed to merge, then the count
- * will have been updated to the appropriate number,
- * and we shouldn't do it here too.
+ * If we are allowed to merge, then append bio list
+ * from next to rq and release next. merge_requests_fn
+ * will have updated segment counts, update sector
+ * counts here.
*/
if (q->merge_requests_fn(q, req, next)) {
q->elevator.elevator_merge_req_fn(req, next);
@@ -1035,24 +1043,18 @@
static inline void attempt_back_merge(request_queue_t *q, struct request *rq)
{
- if (&rq->queuelist != q->queue_head.prev)
- attempt_merge(q, rq);
+ struct list_head *next = rq->queuelist.next;
+
+ if (next != &q->queue_head)
+ attempt_merge(q, rq, list_entry_rq(next));
}
-static inline void attempt_front_merge(request_queue_t *q,
- struct list_head *head,
- struct request *rq)
+static inline void attempt_front_merge(request_queue_t *q, struct request *rq)
{
struct list_head *prev = rq->queuelist.prev;
- if (prev != head)
- attempt_merge(q, blkdev_entry_to_request(prev));
-}
-
-static inline void __blk_attempt_remerge(request_queue_t *q, struct request *rq)
-{
- if (rq->queuelist.next != &q->queue_head)
- attempt_merge(q, rq);
+ if (prev != &q->queue_head)
+ attempt_merge(q, list_entry_rq(prev), rq);
}
/**
@@ -1073,7 +1075,7 @@
unsigned long flags;
spin_lock_irqsave(q->queue_lock, flags);
- __blk_attempt_remerge(q, rq);
+ attempt_back_merge(q, rq);
spin_unlock_irqrestore(q->queue_lock, flags);
}
@@ -1081,7 +1083,7 @@
{
struct request *req, *freereq = NULL;
int el_ret, latency = 0, rw, nr_sectors, cur_nr_sectors, barrier;
- struct list_head *head, *insert_here;
+ struct list_head *insert_here;
elevator_t *elevator = &q->elevator;
sector_t sector;
@@ -1102,28 +1104,20 @@
latency = elevator_request_latency(elevator, rw);
barrier = test_bit(BIO_RW_BARRIER, &bio->bi_rw);
+ spin_lock_irq(q->queue_lock);
again:
req = NULL;
- head = &q->queue_head;
-
- spin_lock_irq(q->queue_lock);
+ insert_here = q->queue_head.prev;
- insert_here = head->prev;
if (blk_queue_empty(q) || barrier) {
blk_plug_device(q);
goto get_rq;
- } else if ((req = __elv_next_request(q))) {
- if (req->flags & REQ_STARTED)
- head = head->next;
-
- req = NULL;
}
- el_ret = elevator->elevator_merge_fn(q, &req, head, bio);
+ el_ret = elevator->elevator_merge_fn(q, &req, bio);
switch (el_ret) {
case ELEVATOR_BACK_MERGE:
- BUG_ON(req->flags & REQ_STARTED);
- BUG_ON(req->flags & REQ_NOMERGE);
+ BUG_ON(!rq_mergeable(req));
if (!q->back_merge_fn(q, req, bio))
break;
@@ -1137,8 +1131,7 @@
goto out;
case ELEVATOR_FRONT_MERGE:
- BUG_ON(req->flags & REQ_STARTED);
- BUG_ON(req->flags & REQ_NOMERGE);
+ BUG_ON(!rq_mergeable(req));
if (!q->front_merge_fn(q, req, bio))
break;
@@ -1157,7 +1150,7 @@
req->sector = req->hard_sector = sector;
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
drive_stat_acct(req, nr_sectors, 0);
- attempt_front_merge(q, head, req);
+ attempt_front_merge(q, req);
goto out;
/*
@@ -1188,7 +1181,6 @@
req = freereq;
freereq = NULL;
} else if ((req = get_request(q, rw)) == NULL) {
-
spin_unlock_irq(q->queue_lock);
/*
@@ -1200,6 +1192,7 @@
}
freereq = get_request_wait(q, rw);
+ spin_lock_irq(q->queue_lock);
goto again;
}
@@ -1298,7 +1291,7 @@
int minor = MINOR(bio->bi_dev);
request_queue_t *q;
sector_t minorsize = 0;
- int nr_sectors = bio_sectors(bio);
+ int ret, nr_sectors = bio_sectors(bio);
/* Test device or partition size, when known. */
if (blk_size[major])
@@ -1352,7 +1345,10 @@
*/
blk_partition_remap(bio);
- } while (q->make_request_fn(q, bio));
+ ret = q->make_request_fn(q, bio);
+ blk_put_queue(q);
+
+ } while (ret);
}
/*
@@ -1572,21 +1568,23 @@
inline void blk_recalc_rq_sectors(struct request *rq, int nsect)
{
- rq->hard_sector += nsect;
- rq->hard_nr_sectors -= nsect;
- rq->sector = rq->hard_sector;
- rq->nr_sectors = rq->hard_nr_sectors;
+ if (rq->flags & REQ_CMD) {
+ rq->hard_sector += nsect;
+ rq->hard_nr_sectors -= nsect;
+ rq->sector = rq->hard_sector;
+ rq->nr_sectors = rq->hard_nr_sectors;
- rq->current_nr_sectors = bio_iovec(rq->bio)->bv_len >> 9;
- rq->hard_cur_sectors = rq->current_nr_sectors;
+ rq->current_nr_sectors = bio_iovec(rq->bio)->bv_len >> 9;
+ rq->hard_cur_sectors = rq->current_nr_sectors;
- /*
- * if total number of sectors is less than the first segment
- * size, something has gone terribly wrong
- */
- if (rq->nr_sectors < rq->current_nr_sectors) {
- printk("blk: request botched\n");
- rq->nr_sectors = rq->current_nr_sectors;
+ /*
+ * if total number of sectors is less than the first segment
+ * size, something has gone terribly wrong
+ */
+ if (rq->nr_sectors < rq->current_nr_sectors) {
+ printk("blk: request botched\n");
+ rq->nr_sectors = rq->current_nr_sectors;
+ }
}
}
@@ -1755,3 +1753,6 @@
EXPORT_SYMBOL(blk_queue_assign_lock);
EXPORT_SYMBOL(blk_phys_contig_segment);
EXPORT_SYMBOL(blk_hw_contig_segment);
+
+EXPORT_SYMBOL(ll_10byte_cmd_build);
+EXPORT_SYMBOL(blk_queue_prep_rq);
diff -u --recursive --new-file v2.5.1/linux/drivers/block/loop.c linux/drivers/block/loop.c
--- v2.5.1/linux/drivers/block/loop.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/loop.c Sun Dec 30 10:19:58 2001
@@ -284,14 +284,7 @@
static inline int loop_get_bs(struct loop_device *lo)
{
- int bs = 0;
-
- if (blksize_size[MAJOR(lo->lo_device)])
- bs = blksize_size[MAJOR(lo->lo_device)][MINOR(lo->lo_device)];
- if (!bs)
- bs = BLOCK_SIZE;
-
- return bs;
+ return block_size(lo->lo_device);
}
static inline unsigned long loop_get_iv(struct loop_device *lo,
@@ -559,6 +552,8 @@
atomic_inc(&lo->lo_pending);
spin_unlock_irq(&lo->lo_lock);
+ current->flags |= PF_NOIO;
+
/*
* up sem, we are running
*/
@@ -600,7 +595,6 @@
kdev_t lo_device;
int lo_flags = 0;
int error;
- int bs;
MOD_INC_USE_COUNT;
@@ -621,6 +615,10 @@
if (S_ISBLK(inode->i_mode)) {
lo_device = inode->i_rdev;
+ if (lo_device == dev) {
+ error = -EBUSY;
+ goto out;
+ }
} else if (S_ISREG(inode->i_mode)) {
struct address_space_operations *aops = inode->i_mapping->a_ops;
/*
@@ -656,13 +654,7 @@
lo->old_gfp_mask = inode->i_mapping->gfp_mask;
inode->i_mapping->gfp_mask = GFP_NOIO;
- bs = 0;
- if (blksize_size[MAJOR(lo_device)])
- bs = blksize_size[MAJOR(lo_device)][MINOR(lo_device)];
- if (!bs)
- bs = BLOCK_SIZE;
-
- set_blocksize(dev, bs);
+ set_blocksize(dev, block_size(lo_device));
lo->lo_bio = lo->lo_biotail = NULL;
kernel_thread(loop_thread, lo, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
@@ -1007,6 +999,7 @@
goto out_mem;
blk_queue_make_request(BLK_DEFAULT_QUEUE(MAJOR_NR), loop_make_request);
+ blk_queue_bounce_limit(BLK_DEFAULT_QUEUE(MAJOR_NR), BLK_BOUNCE_HIGH);
for (i = 0; i < max_loop; i++) {
struct loop_device *lo = &loop_dev[i];
diff -u --recursive --new-file v2.5.1/linux/drivers/block/nbd.c linux/drivers/block/nbd.c
--- v2.5.1/linux/drivers/block/nbd.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/nbd.c Sun Dec 30 10:31:51 2001
@@ -45,7 +45,6 @@
#include
-#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/block/paride/Config.in linux/drivers/block/paride/Config.in
--- v2.5.1/linux/drivers/block/paride/Config.in Thu Oct 25 00:07:39 2001
+++ linux/drivers/block/paride/Config.in Sun Dec 30 10:19:58 2001
@@ -29,7 +29,7 @@
dep_tristate ' Shuttle EPAT/EPEZ protocol' CONFIG_PARIDE_EPAT $CONFIG_PARIDE
if [ "$CONFIG_PARIDE_EPAT" != "n" ]; then
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool ' Support c7/c8 chips (EXPERIMENTAL)' CONFIG_PARIDE_EPATC8 $CONFIG_PARIDE
+ bool ' Support c7/c8 chips (EXPERIMENTAL)' CONFIG_PARIDE_EPATC8
fi
fi
diff -u --recursive --new-file v2.5.1/linux/drivers/block/ps2esdi.c linux/drivers/block/ps2esdi.c
--- v2.5.1/linux/drivers/block/ps2esdi.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/ps2esdi.c Sun Dec 30 16:54:29 2001
@@ -51,7 +51,6 @@
#include
#include
-#include
#include
#include
#include
@@ -953,10 +952,10 @@
break;
}
if(ending != -1) {
- spin_lock_irqsave(ps2esdi_LOCK, flags);
+ spin_lock_irqsave(&ps2esdi_lock, flags);
end_request(ending);
do_ps2esdi_request(BLK_DEFAULT_QUEUE(MAJOR_NR));
- spin_unlock_irqrestore(ps2esdi_LOCK, flags);
+ spin_unlock_irqrestore(&ps2esdi_lock, flags);
}
} /* handle interrupts */
diff -u --recursive --new-file v2.5.1/linux/drivers/block/rd.c linux/drivers/block/rd.c
--- v2.5.1/linux/drivers/block/rd.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/block/rd.c Mon Dec 17 11:12:05 2001
@@ -43,26 +43,12 @@
*/
#include
-#include
-#include
-#include
-#include
#include
-#include
-#include
#include
-#include
-#include
#include
#include
#include
-#include
-
-#include
#include
-#include
-
-extern void wait_for_keypress(void);
/*
* 35 has been officially registered as the RAMDISK major number, but
@@ -79,6 +65,8 @@
#ifdef CONFIG_BLK_DEV_INITRD
static int initrd_users;
static spinlock_t initrd_users_lock = SPIN_LOCK_UNLOCKED;
+unsigned long initrd_start, initrd_end;
+int initrd_below_start_ok;
#endif
/* Various static variables go here. Most are used only in the RAM disk code.
@@ -111,70 +99,6 @@
*/
int rd_blocksize = BLOCK_SIZE; /* blocksize of the RAM disks */
-#ifndef MODULE
-
-int rd_doload; /* 1 = load RAM disk, 0 = don't load */
-int rd_prompt = 1; /* 1 = prompt for RAM disk, 0 = don't prompt */
-int rd_image_start; /* starting block # of image */
-#ifdef CONFIG_BLK_DEV_INITRD
-unsigned long initrd_start, initrd_end;
-int mount_initrd = 1; /* zero if initrd should not be mounted */
-int initrd_below_start_ok;
-
-static int __init no_initrd(char *str)
-{
- mount_initrd = 0;
- return 1;
-}
-
-__setup("noinitrd", no_initrd);
-
-#endif
-
-static int __init ramdisk_start_setup(char *str)
-{
- rd_image_start = simple_strtol(str,NULL,0);
- return 1;
-}
-
-static int __init load_ramdisk(char *str)
-{
- rd_doload = simple_strtol(str,NULL,0) & 3;
- return 1;
-}
-
-static int __init prompt_ramdisk(char *str)
-{
- rd_prompt = simple_strtol(str,NULL,0) & 1;
- return 1;
-}
-
-static int __init ramdisk_size(char *str)
-{
- rd_size = simple_strtol(str,NULL,0);
- return 1;
-}
-
-static int __init ramdisk_size2(char *str)
-{
- return ramdisk_size(str);
-}
-
-static int __init ramdisk_blocksize(char *str)
-{
- rd_blocksize = simple_strtol(str,NULL,0);
- return 1;
-}
-
-__setup("ramdisk_start=", ramdisk_start_setup);
-__setup("load_ramdisk=", load_ramdisk);
-__setup("prompt_ramdisk=", prompt_ramdisk);
-__setup("ramdisk=", ramdisk_size);
-__setup("ramdisk_size=", ramdisk_size2);
-__setup("ramdisk_blocksize=", ramdisk_blocksize);
-
-#endif
-
/*
* Copyright (C) 2000 Linus Torvalds.
* 2000 Transmeta Corp.
@@ -492,7 +416,7 @@
}
/* This is the registration and initialization section of the RAM disk driver */
-int __init rd_init (void)
+static int __init rd_init (void)
{
int i;
@@ -548,7 +472,28 @@
module_init(rd_init);
module_exit(rd_cleanup);
-/* loadable module support */
+/* options - nonmodular */
+#ifndef MODULE
+static int __init ramdisk_size(char *str)
+{
+ rd_size = simple_strtol(str,NULL,0);
+ return 1;
+}
+static int __init ramdisk_size2(char *str) /* kludge */
+{
+ return ramdisk_size(str);
+}
+static int __init ramdisk_blocksize(char *str)
+{
+ rd_blocksize = simple_strtol(str,NULL,0);
+ return 1;
+}
+__setup("ramdisk=", ramdisk_size);
+__setup("ramdisk_size=", ramdisk_size2);
+__setup("ramdisk_blocksize=", ramdisk_blocksize);
+#endif
+
+/* options - modular */
MODULE_PARM (rd_size, "1i");
MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
MODULE_PARM (rd_blocksize, "i");
diff -u --recursive --new-file v2.5.1/linux/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
--- v2.5.1/linux/drivers/cdrom/cdrom.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/cdrom/cdrom.c Sun Dec 30 10:31:51 2001
@@ -266,7 +266,6 @@
#include
#include
-#include
#include
/* used to tell the module to turn on full debugging messages */
diff -u --recursive --new-file v2.5.1/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- v2.5.1/linux/drivers/cdrom/cdu31a.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/cdrom/cdu31a.c Sat Dec 29 11:17:37 2001
@@ -237,6 +237,7 @@
static volatile unsigned short sony_cd_read_reg;
static volatile unsigned short sony_cd_fifost_reg;
+static spinlock_t cdu31a_lock = SPIN_LOCK_UNLOCKED; /* queue lock */
static int sony_spun_up = 0; /* Has the drive been spun up? */
@@ -1605,17 +1606,7 @@
scd_spinup();
}
- /* I don't use INIT_REQUEST because it calls return, which would
- return without unlocking the device. It shouldn't matter,
- but just to be safe... */
- if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) {
- panic(DEVICE_NAME ": request list destroyed");
- }
- if (CURRENT->bh) {
- if (!buffer_locked(CURRENT->bh)) {
- panic(DEVICE_NAME ": block not locked");
- }
- }
+ INIT_REQUEST;
block = CURRENT->sector;
nblock = CURRENT->nr_sectors;
@@ -1626,112 +1617,105 @@
goto cdu31a_request_startover;
}
- switch (CURRENT->cmd) {
- case READ:
- /*
- * If the block address is invalid or the request goes beyond the end of
- * the media, return an error.
- */
-#if 0
- if ((block / 4) < sony_toc.start_track_lba) {
- printk
- ("CDU31A: Request before beginning of media\n");
- end_request(0);
- goto cdu31a_request_startover;
- }
-#endif
- if ((block / 4) >= sony_toc.lead_out_start_lba) {
- printk
- ("CDU31A: Request past end of media\n");
- end_request(0);
- goto cdu31a_request_startover;
- }
- if (((block + nblock) / 4) >=
- sony_toc.lead_out_start_lba) {
- printk
- ("CDU31A: Request past end of media\n");
- end_request(0);
- goto cdu31a_request_startover;
- }
-
- num_retries = 0;
-
- try_read_again:
- while (handle_sony_cd_attention());
-
- if (!sony_toc_read) {
- printk("CDU31A: TOC not read\n");
- end_request(0);
- goto cdu31a_request_startover;
- }
-
- /* If no data is left to be read from the drive, start the
- next request. */
- if (sony_blocks_left == 0) {
- if (start_request
- (block / 4, CDU31A_READAHEAD / 4, 0)) {
- end_request(0);
- goto cdu31a_request_startover;
- }
- }
- /* If the requested block is not the next one waiting in
- the driver, abort the current operation and start a
- new one. */
- else if (block != sony_next_block) {
-#if DEBUG
- printk
- ("CDU31A Warning: Read for block %d, expected %d\n",
- block, sony_next_block);
-#endif
- abort_read();
- if (!sony_toc_read) {
- printk("CDU31A: TOC not read\n");
+ if(CURRENT->flags & REQ_CMD) {
+ switch (rq_data_dir(CURRENT)) {
+ case READ:
+ /*
+ * If the block address is invalid or the request goes beyond the end of
+ * the media, return an error.
+ */
+ if ((block / 4) >= sony_toc.lead_out_start_lba) {
+ printk
+ ("CDU31A: Request past end of media\n");
end_request(0);
goto cdu31a_request_startover;
}
- if (start_request
- (block / 4, CDU31A_READAHEAD / 4, 0)) {
+ if (((block + nblock) / 4) >=
+ sony_toc.lead_out_start_lba) {
printk
- ("CDU31a: start request failed\n");
+ ("CDU31A: Request past end of media\n");
end_request(0);
goto cdu31a_request_startover;
}
- }
- read_data_block(CURRENT->buffer, block, nblock,
- res_reg, &res_size);
- if (res_reg[0] == 0x20) {
- if (num_retries > MAX_CDU31A_RETRIES) {
+ num_retries = 0;
+
+ try_read_again:
+ while (handle_sony_cd_attention());
+
+ if (!sony_toc_read) {
+ printk("CDU31A: TOC not read\n");
end_request(0);
goto cdu31a_request_startover;
}
- num_retries++;
- if (res_reg[1] == SONY_NOT_SPIN_ERR) {
- do_sony_cd_cmd(SONY_SPIN_UP_CMD,
- NULL, 0, res_reg,
- &res_size);
- } else {
+ /* If no data is left to be read from the drive, start the
+ next request. */
+ if (sony_blocks_left == 0) {
+ if (start_request
+ (block / 4, CDU31A_READAHEAD / 4, 0)) {
+ end_request(0);
+ goto cdu31a_request_startover;
+ }
+ }
+ /* If the requested block is not the next one waiting in
+ the driver, abort the current operation and start a
+ new one. */
+ else if (block != sony_next_block) {
+#if DEBUG
printk
- ("CDU31A: %s error for block %d, nblock %d\n",
- translate_error(res_reg[1]),
- block, nblock);
+ ("CDU31A Warning: Read for block %d, expected %d\n",
+ block, sony_next_block);
+#endif
+ abort_read();
+ if (!sony_toc_read) {
+ printk("CDU31A: TOC not read\n");
+ end_request(0);
+ goto cdu31a_request_startover;
+ }
+ if (start_request
+ (block / 4, CDU31A_READAHEAD / 4, 0)) {
+ printk
+ ("CDU31a: start request failed\n");
+ end_request(0);
+ goto cdu31a_request_startover;
+ }
}
- goto try_read_again;
- } else {
- end_request(1);
- }
- break;
- case WRITE:
- end_request(0);
- break;
+ read_data_block(CURRENT->buffer, block, nblock,
+ res_reg, &res_size);
+ if (res_reg[0] == 0x20) {
+ if (num_retries > MAX_CDU31A_RETRIES) {
+ end_request(0);
+ goto cdu31a_request_startover;
+ }
- default:
- panic("CDU31A: Unknown cmd");
+ num_retries++;
+ if (res_reg[1] == SONY_NOT_SPIN_ERR) {
+ do_sony_cd_cmd(SONY_SPIN_UP_CMD,
+ NULL, 0, res_reg,
+ &res_size);
+ } else {
+ printk
+ ("CDU31A: %s error for block %d, nblock %d\n",
+ translate_error(res_reg[1]),
+ block, nblock);
+ }
+ goto try_read_again;
+ } else {
+ end_request(1);
+ }
+ break;
+
+ case WRITE:
+ end_request(0);
+ break;
+
+ default:
+ panic("CDU31A: Unknown cmd");
+ }
}
}
-
end_do_cdu31a_request:
spin_lock_irq(&q->queue_lock);
#if 0
@@ -3456,7 +3440,8 @@
strcmp("CD-ROM CDU31A", drive_config.product_id) == 0;
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR),
- DEVICE_REQUEST);
+ DEVICE_REQUEST,
+ &cdu31a_lock);
read_ahead[MAJOR_NR] = CDU31A_READAHEAD;
cdu31a_block_size = 1024; /* 1kB default block size */
/* use 'mount -o block=2048' */
diff -u --recursive --new-file v2.5.1/linux/drivers/char/Config.in linux/drivers/char/Config.in
--- v2.5.1/linux/drivers/char/Config.in Mon Nov 12 09:34:16 2001
+++ linux/drivers/char/Config.in Sun Dec 30 10:32:43 2001
@@ -16,7 +16,7 @@
tristate ' Dual serial port support' CONFIG_DUALSP_SERIAL
fi
fi
-if [ "$CONFIG_ACPI" = "y" ]; then
+if [ "$CONFIG_ACPI" = "y" -a "$CONFIG_IA64" = "y" ]; then
bool ' Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI
fi
dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL
diff -u --recursive --new-file v2.5.1/linux/drivers/char/console.c linux/drivers/char/console.c
--- v2.5.1/linux/drivers/char/console.c Mon Oct 15 14:00:43 2001
+++ linux/drivers/char/console.c Tue Dec 25 15:39:20 2001
@@ -2178,7 +2178,6 @@
name: "tty",
write: vt_console_print,
device: vt_console_device,
- wait_key: keyboard_wait_for_keypress,
unblank: unblank_screen,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/drivers/char/dsp56k.c linux/drivers/char/dsp56k.c
--- v2.5.1/linux/drivers/char/dsp56k.c Mon Sep 10 08:06:32 2001
+++ linux/drivers/char/dsp56k.c Sun Dec 30 10:31:51 2001
@@ -37,7 +37,6 @@
#include
#include
-#include
#include
#include
#include /* For put_user and get_user */
diff -u --recursive --new-file v2.5.1/linux/drivers/char/dtlk.c linux/drivers/char/dtlk.c
--- v2.5.1/linux/drivers/char/dtlk.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/char/dtlk.c Sun Dec 30 10:31:51 2001
@@ -57,7 +57,6 @@
#include /* for -EBUSY */
#include /* for check_region, request_region */
#include /* for loops_per_jiffy */
-#include /* for put_user_byte */
#include /* for inb_p, outb_p, inb, outb, etc. */
#include /* for get_user, etc. */
#include /* for wait_queue */
diff -u --recursive --new-file v2.5.1/linux/drivers/char/dz.c linux/drivers/char/dz.c
--- v2.5.1/linux/drivers/char/dz.c Sun Sep 9 10:43:02 2001
+++ linux/drivers/char/dz.c Tue Dec 25 15:39:20 2001
@@ -75,7 +75,6 @@
DECLARE_TASK_QUEUE(tq_serial);
-extern wait_queue_head_t keypress_wait;
static struct dz_serial *lines[4];
static unsigned char tmp_buffer[256];
@@ -228,8 +227,6 @@
if (info->is_console) {
if (ch == 0)
return; /* it's a break ... */
-
- wake_up (&keypress_wait); /* It is a 'keyboard interrupt' ;-) */
}
#endif
@@ -1509,11 +1506,6 @@
}
}
-static int dz_console_wait_key(struct console *co)
-{
- return 0;
-}
-
static kdev_t dz_console_device(struct console *c)
{
return MKDEV(TTY_MAJOR, 64 + c->index);
@@ -1614,7 +1606,6 @@
name: "ttyS",
write: dz_console_print,
device: dz_console_device,
- wait_key: dz_console_wait_key,
setup: dz_console_setup,
flags: CON_CONSDEV | CON_PRINTBUFFER,
index: CONSOLE_LINE,
diff -u --recursive --new-file v2.5.1/linux/drivers/char/epca.c linux/drivers/char/epca.c
--- v2.5.1/linux/drivers/char/epca.c Fri Oct 12 13:48:42 2001
+++ linux/drivers/char/epca.c Sun Dec 30 10:31:51 2001
@@ -897,7 +897,6 @@
inline void copy_from_user(void * to, const void * from,
unsigned long count);
- You must include
I also think (Check hackers guide) that optimization must
be turned ON. (Which sounds strange to me...)
diff -u --recursive --new-file v2.5.1/linux/drivers/char/esp.c linux/drivers/char/esp.c
--- v2.5.1/linux/drivers/char/esp.c Fri Nov 9 14:01:21 2001
+++ linux/drivers/char/esp.c Sun Dec 30 10:31:51 2001
@@ -60,7 +60,6 @@
#include
#include
-#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-buffer.c linux/drivers/char/ftape/lowlevel/ftape-buffer.c
--- v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-buffer.c Fri Feb 9 11:30:22 2001
+++ linux/drivers/char/ftape/lowlevel/ftape-buffer.c Sun Dec 30 10:31:51 2001
@@ -24,7 +24,6 @@
* buffer.
*/
-#include
#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-io.c linux/drivers/char/ftape/lowlevel/ftape-io.c
--- v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-io.c Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/lowlevel/ftape-io.c Sun Dec 30 10:31:51 2001
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-read.c linux/drivers/char/ftape/lowlevel/ftape-read.c
--- v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-read.c Tue Nov 25 14:45:27 1997
+++ linux/drivers/char/ftape/lowlevel/ftape-read.c Sun Dec 30 10:31:51 2001
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-setup.c linux/drivers/char/ftape/lowlevel/ftape-setup.c
--- v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-setup.c Thu Aug 12 11:53:22 1999
+++ linux/drivers/char/ftape/lowlevel/ftape-setup.c Sun Dec 30 10:31:51 2001
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,16)
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-write.c linux/drivers/char/ftape/lowlevel/ftape-write.c
--- v2.5.1/linux/drivers/char/ftape/lowlevel/ftape-write.c Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/lowlevel/ftape-write.c Sun Dec 30 10:31:51 2001
@@ -28,7 +28,6 @@
#include
#include
#include
-#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/zftape/zftape-buffers.c linux/drivers/char/ftape/zftape/zftape-buffers.c
--- v2.5.1/linux/drivers/char/ftape/zftape/zftape-buffers.c Fri Feb 9 11:30:22 2001
+++ linux/drivers/char/ftape/zftape/zftape-buffers.c Sun Dec 30 10:31:51 2001
@@ -27,7 +27,6 @@
#include
#include
#include
-#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/zftape/zftape-init.c linux/drivers/char/ftape/zftape/zftape-init.c
--- v2.5.1/linux/drivers/char/ftape/zftape/zftape-init.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/char/ftape/zftape/zftape-init.c Sun Dec 30 10:31:51 2001
@@ -25,7 +25,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/zftape/zftape-rw.c linux/drivers/char/ftape/zftape/zftape-rw.c
--- v2.5.1/linux/drivers/char/ftape/zftape/zftape-rw.c Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/zftape/zftape-rw.c Sun Dec 30 10:31:51 2001
@@ -27,7 +27,6 @@
#include /* for CONFIG_ZFT_DFLT_BLK_SZ */
#include
#include
-#include
#include
#include "../zftape/zftape-init.h"
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ftape/zftape/zftape-vtbl.c linux/drivers/char/ftape/zftape/zftape-vtbl.c
--- v2.5.1/linux/drivers/char/ftape/zftape/zftape-vtbl.c Fri Apr 6 10:42:55 2001
+++ linux/drivers/char/ftape/zftape/zftape-vtbl.c Sun Dec 30 10:31:51 2001
@@ -31,7 +31,6 @@
#include
#include
#include
-#include
#include
#include "../zftape/zftape-init.h"
diff -u --recursive --new-file v2.5.1/linux/drivers/char/h8.c linux/drivers/char/h8.c
--- v2.5.1/linux/drivers/char/h8.c Thu Sep 13 15:21:32 2001
+++ linux/drivers/char/h8.c Sun Dec 30 10:31:51 2001
@@ -14,7 +14,6 @@
#include
#include
-#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/i8k.c linux/drivers/char/i8k.c
--- v2.5.1/linux/drivers/char/i8k.c Fri Nov 2 17:46:47 2001
+++ linux/drivers/char/i8k.c Sun Dec 30 10:38:45 2001
@@ -1,5 +1,7 @@
/*
- * i8k.c -- Linux driver for accessing the SMM BIOS on Dell I8000 laptops
+ * i8k.c -- Linux driver for accessing the SMM BIOS on Dell laptops.
+ * See http://www.debian.org/~dz/i8k/ for more information
+ * and for latest version of this driver.
*
* Copyright (C) 2001 Massimo Dal Zotto
*
@@ -19,15 +21,13 @@
#include
#include
#include
-#include
+#include
#include
+#include
#include
-#define I8K_VERSION "1.1 02/11/2001"
-#define I8K_BIOS_SIGNATURE "Dell System Inspiron 8000"
-#define I8K_BIOS_SIGNATURE_ADDR 0x000ec000
-#define I8K_BIOS_VERSION_OFFSET 32
+#define I8K_VERSION "1.7 21/11/2001"
#define I8K_SMM_FN_STATUS 0x0025
#define I8K_SMM_POWER_STATUS 0x0069
@@ -35,31 +35,47 @@
#define I8K_SMM_GET_FAN 0x00a3
#define I8K_SMM_GET_SPEED 0x02a3
#define I8K_SMM_GET_TEMP 0x10a3
+#define I8K_SMM_GET_DELL_SIG 0xffa3
#define I8K_SMM_BIOS_VERSION 0x00a6
#define I8K_FAN_MULT 30
#define I8K_MAX_TEMP 127
-#define I8K_FN_NONE 0x08
-#define I8K_FN_UP 0x09
-#define I8K_FN_DOWN 0x0a
-#define I8K_FN_MUTE 0x0c
+#define I8K_FN_NONE 0x00
+#define I8K_FN_UP 0x01
+#define I8K_FN_DOWN 0x02
+#define I8K_FN_MUTE 0x04
+#define I8K_FN_MASK 0x07
+#define I8K_FN_SHIFT 8
#define I8K_POWER_AC 0x05
#define I8K_POWER_BATTERY 0x01
#define I8K_TEMPERATURE_BUG 1
-static char bios_version[4] = "?";
-static char bios_machine_id[16] = "?";
+#define DELL_SIGNATURE "Dell Computer"
+
+static char *supported_models[] = {
+ "Inspiron",
+ "Latitude",
+ NULL
+};
+
+static char system_vendor[48] = "?";
+static char product_name [48] = "?";
+static char bios_version [4] = "?";
+static char serial_number[16] = "?";
int force = 0;
+int power_status = 0;
MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)");
-MODULE_DESCRIPTION("Driver for accessing the SMM BIOS on Dell I8000 laptops");
+MODULE_DESCRIPTION("Driver for accessing SMM BIOS on Dell laptops");
MODULE_LICENSE("GPL");
MODULE_PARM(force, "i");
-MODULE_PARM_DESC(force, "Force loading without checking for an Inspiron 8000");
+MODULE_PARM(power_status, "i");
+MODULE_PARM_DESC(force, "Force loading without checking for supported models");
+MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
static ssize_t i8k_read(struct file *, char *, size_t, loff_t *);
static int i8k_ioctl(struct inode *, struct file *, unsigned int,
@@ -79,12 +95,19 @@
unsigned int edi __attribute__ ((packed));
} SMMRegisters;
+typedef struct {
+ u8 type;
+ u8 length;
+ u16 handle;
+} DMIHeader;
+
/*
- * Call the System Management Mode BIOS.
+ * Call the System Management Mode BIOS. Code provided by Jonathan Buzzard.
*/
static int i8k_smm(SMMRegisters *regs)
{
int rc;
+ int eax = regs->eax;
asm("pushl %%eax\n\t" \
"movl 0(%%eax),%%edx\n\t" \
@@ -112,7 +135,7 @@
: "a" (regs)
: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
- if ((rc != 0) || ((regs->eax & 0xffff) == 0xffff)) {
+ if ((rc != 0) || ((regs->eax & 0xffff) == 0xffff) || (regs->eax == eax)) {
return -EINVAL;
}
@@ -137,11 +160,12 @@
}
/*
- * Read the machine id. Not yet implemented.
+ * Read the machine id.
*/
-static int i8k_get_machine_id(unsigned char *buff)
+static int i8k_get_serial_number(unsigned char *buff)
{
- return -EINVAL;
+ strncpy(buff, serial_number, 16);
+ return 0;
}
/*
@@ -157,7 +181,7 @@
return rc;
}
- switch ((regs.eax & 0xff00) >> 8) {
+ switch ((regs.eax >> I8K_FN_SHIFT) & I8K_FN_MASK) {
case I8K_FN_UP:
return I8K_VOL_UP;
case I8K_FN_DOWN:
@@ -281,6 +305,23 @@
return temp;
}
+static int i8k_get_dell_signature(void)
+{
+ SMMRegisters regs = { 0, 0, 0, 0, 0, 0 };
+ int rc;
+
+ regs.eax = I8K_SMM_GET_DELL_SIG;
+ if ((rc=i8k_smm(®s)) < 0) {
+ return rc;
+ }
+
+ if ((regs.eax == 1145651527) && (regs.edx == 1145392204)) {
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
unsigned long arg)
{
@@ -299,7 +340,7 @@
case I8K_MACHINE_ID:
memset(buff, 0, 16);
- val = i8k_get_machine_id(buff);
+ val = i8k_get_serial_number(buff);
break;
case I8K_FN_STATUS:
@@ -375,13 +416,17 @@
int n, fn_key, cpu_temp, ac_power;
int left_fan, right_fan, left_speed, right_speed;
- cpu_temp = i8k_get_cpu_temp();
- left_fan = i8k_get_fan_status(I8K_FAN_LEFT);
- right_fan = i8k_get_fan_status(I8K_FAN_RIGHT);
- left_speed = i8k_get_fan_speed(I8K_FAN_LEFT);
- right_speed = i8k_get_fan_speed(I8K_FAN_RIGHT);
- ac_power = i8k_get_power_status();
- fn_key = i8k_get_fn_status();
+ cpu_temp = i8k_get_cpu_temp(); /* 11100 µs */
+ left_fan = i8k_get_fan_status(I8K_FAN_LEFT); /* 580 µs */
+ right_fan = i8k_get_fan_status(I8K_FAN_RIGHT); /* 580 µs */
+ left_speed = i8k_get_fan_speed(I8K_FAN_LEFT); /* 580 µs */
+ right_speed = i8k_get_fan_speed(I8K_FAN_RIGHT); /* 580 µs */
+ fn_key = i8k_get_fn_status(); /* 750 µs */
+ if (power_status) {
+ ac_power = i8k_get_power_status(); /* 14700 µs */
+ } else {
+ ac_power = -1;
+ }
/*
* Info:
@@ -400,7 +445,7 @@
n = sprintf(buffer, "%s %s %s %d %d %d %d %d %d %d\n",
I8K_PROC_FMT,
bios_version,
- bios_machine_id,
+ serial_number,
cpu_temp,
left_fan,
right_fan,
@@ -438,76 +483,253 @@
return len;
}
+static char* __init string_trim(char *s, int size)
+{
+ int len;
+ char *p;
+
+ if ((len = strlen(s)) > size) {
+ len = size;
+ }
+
+ for (p=s+len-1; len && (*p==' '); len--,p--) {
+ *p = '\0';
+ }
+
+ return s;
+}
+
+/* DMI code, stolen from arch/i386/kernel/dmi_scan.c */
+
/*
- * Probe for the presence of an Inspiron I8000.
+ * |<-- dmi->length -->|
+ * | |
+ * |dmi header s=N | string1,\0, ..., stringN,\0, ..., \0
+ * | |
+ * +-----------------------+
*/
-static int i8k_probe(void)
+static char* __init dmi_string(DMIHeader *dmi, u8 s)
{
- unsigned char *buff, *p;
- unsigned char bios_vers[4];
- int version;
+ u8 *p;
+
+ if (!s) {
+ return "";
+ }
+ s--;
+
+ p = (u8 *)dmi + dmi->length;
+ while (s > 0) {
+ p += strlen(p);
+ p++;
+ s--;
+ }
+
+ return p;
+}
+
+static void __init dmi_decode(DMIHeader *dmi)
+{
+ u8 *data = (u8 *) dmi;
+ char *p;
+
+#ifdef I8K_DEBUG
+ int i;
+ printk("%08x ", (int)data);
+ for (i=0; itype) {
+ case 0: /* BIOS Information */
+ p = dmi_string(dmi,data[5]);
+ if (*p) {
+ strncpy(bios_version, p, sizeof(bios_version));
+ string_trim(bios_version, sizeof(bios_version));
+ }
+ break;
+ case 1: /* System Information */
+ p = dmi_string(dmi,data[4]);
+ if (*p) {
+ strncpy(system_vendor, p, sizeof(system_vendor));
+ string_trim(system_vendor, sizeof(system_vendor));
+ }
+ p = dmi_string(dmi,data[5]);
+ if (*p) {
+ strncpy(product_name, p, sizeof(product_name));
+ string_trim(product_name, sizeof(product_name));
+ }
+ p = dmi_string(dmi,data[7]);
+ if (*p) {
+ strncpy(serial_number, p, sizeof(serial_number));
+ string_trim(serial_number, sizeof(serial_number));
+ }
+ break;
+ }
+}
+
+static int __init dmi_table(u32 base, int len, int num, void (*fn)(DMIHeader*))
+{
+ u8 *buf;
+ u8 *data;
+ DMIHeader *dmi;
+ int i = 1;
+
+ buf = ioremap(base, len);
+ if (buf == NULL) {
+ return -1;
+ }
+ data = buf;
/*
- * Until Dell tell us how to reliably check for an Inspiron system
- * look for a signature at a fixed location in the BIOS memory.
- * Ugly but safe.
+ * Stop when we see al the items the table claimed to have
+ * or we run off the end of the table (also happens)
*/
- if (!force) {
- buff = ioremap(I8K_BIOS_SIGNATURE_ADDR, I8K_BIOS_VERSION_OFFSET+4);
- if (buff == NULL) {
- printk("i8k: ioremap failed\n");
- return -ENODEV;
+ while ((ilength) >= len) {
+ break;
+ }
+ fn(dmi);
+ data += dmi->length;
+ /*
+ * Don't go off the end of the data if there is
+ * stuff looking like string fill past the end
+ */
+ while (((data-buf) < len) && (*data || data[1])) {
+ data++;
}
- if (strncmp(buff,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE)) != 0) {
- printk("i8k: Inspiron 8000 BIOS signature not found\n");
- iounmap(buff);
- return -ENODEV;
+ data += 2;
+ i++;
+ }
+ iounmap(buf);
+
+ return 0;
+}
+
+static int __init dmi_iterate(void (*decode)(DMIHeader *))
+{
+ unsigned char buf[20];
+ long fp = 0x000e0000L;
+ fp -= 16;
+
+ while (fp < 0x000fffffL) {
+ fp += 16;
+ isa_memcpy_fromio(buf, fp, 20);
+ if (memcmp(buf, "_DMI_", 5)==0) {
+ u16 num = buf[13]<<8 | buf[12];
+ u16 len = buf [7]<<8 | buf [6];
+ u32 base = buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8];
+#ifdef I8K_DEBUG
+ printk(KERN_INFO "DMI %d.%d present.\n",
+ buf[14]>>4, buf[14]&0x0F);
+ printk(KERN_INFO "%d structures occupying %d bytes.\n",
+ buf[13]<<8 | buf[12],
+ buf [7]<<8 | buf[6]);
+ printk(KERN_INFO "DMI table at 0x%08X.\n",
+ buf[11]<<24 | buf[10]<<16 | buf[9]<<8 | buf[8]);
+#endif
+ if (dmi_table(base, len, num, decode)==0) {
+ return 0;
+ }
}
- strncpy(bios_vers, buff+I8K_BIOS_VERSION_OFFSET, 3);
- bios_vers[3] = '\0';
- iounmap(buff);
- }
- if (force >= 2) {
- buff = ioremap(0x000c0000, 0x00100000-0x000c0000);
- if (buff == NULL) {
- printk("i8k: ioremap failed\n");
+ }
+ return -1;
+}
+/* end of DMI code */
+
+/*
+ * Get DMI information.
+ */
+static int __init i8k_dmi_probe(void)
+{
+ char **p;
+
+ if (dmi_iterate(dmi_decode) != 0) {
+ printk(KERN_INFO "i8k: unable to get DMI information\n");
+ return -ENODEV;
+ }
+
+ if (strncmp(system_vendor,DELL_SIGNATURE,strlen(DELL_SIGNATURE)) != 0) {
+ printk(KERN_INFO "i8k: not running on a Dell system\n");
+ return -ENODEV;
+ }
+
+ for (p=supported_models; ; p++) {
+ if (!*p) {
+ printk(KERN_INFO "i8k: unsupported model: %s\n", product_name);
return -ENODEV;
}
- for (p=buff; (p-buff)<(0x00100000-0x000c0000); p+=16) {
- if (strncmp(p,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE))==0) {
- printk("i8k: Inspiron 8000 BIOS signature found at %08x\n",
- 0x000c0000+(p-buff));
- break;
- }
+ if (strncmp(product_name,*p,strlen(*p)) == 0) {
+ break;
}
- iounmap(buff);
}
+ return 0;
+}
+
+/*
+ * Probe for the presence of a supported laptop.
+ */
+static int __init i8k_probe(void)
+{
+ char buff[4];
+ int version;
+ int smm_found = 0;
+
/*
- * Next try to get the BIOS version with an SMM call. If this
- * fails SMM can't be reliably used on this system.
+ * Get DMI information
*/
- version = i8k_get_bios_version();
- if (version <= 0) {
- printk("i8k: unable to get BIOS version\n");
- return -ENODEV;
+ if (i8k_dmi_probe() != 0) {
+ printk(KERN_INFO "i8k: vendor=%s, model=%s, version=%s\n",
+ system_vendor, product_name, bios_version);
}
- bios_version[0] = (version >> 16) & 0xff;
- bios_version[1] = (version >> 8) & 0xff;
- bios_version[2] = (version) & 0xff;
- bios_version[3] = '\0';
/*
- * Finally check if the two versions match.
+ * Get SMM Dell signature
*/
- if (!force) {
- if (strncmp(bios_version,bios_vers,sizeof(bios_version)) != 0) {
- printk("i8k: BIOS version mismatch: %s != %s\n",
- bios_version, bios_vers);
- return -ENODEV;
+ if (i8k_get_dell_signature() != 0) {
+ printk(KERN_INFO "i8k: unable to get SMM Dell signature\n");
+ } else {
+ smm_found = 1;
+ }
+
+ /*
+ * Get SMM BIOS version.
+ */
+ version = i8k_get_bios_version();
+ if (version <= 0) {
+ printk(KERN_INFO "i8k: unable to get SMM BIOS version\n");
+ } else {
+ smm_found = 1;
+ buff[0] = (version >> 16) & 0xff;
+ buff[1] = (version >> 8) & 0xff;
+ buff[2] = (version) & 0xff;
+ buff[3] = '\0';
+ /*
+ * If DMI BIOS version is unknown use SMM BIOS version.
+ */
+ if (bios_version[0] == '?') {
+ strcpy(bios_version, buff);
+ }
+ /*
+ * Check if the two versions match.
+ */
+ if (strncmp(buff,bios_version,sizeof(bios_version)) != 0) {
+ printk(KERN_INFO "i8k: BIOS version mismatch: %s != %s\n",
+ buff, bios_version);
}
}
+ if (!smm_found && !force) {
+ return -ENODEV;
+ }
+
return 0;
}
@@ -518,7 +740,7 @@
{
struct proc_dir_entry *proc_i8k;
- /* Are we running on an Inspiron 8000 laptop? */
+ /* Are we running on an supported laptop? */
if (i8k_probe() != 0) {
return -ENODEV;
}
@@ -532,7 +754,7 @@
SET_MODULE_OWNER(proc_i8k);
printk(KERN_INFO
- "Inspiron 8000 SMM driver v%s Massimo Dal Zotto (dz@debian.org)\n",
+ "Dell laptop SMM driver v%s Massimo Dal Zotto (dz@debian.org)\n",
I8K_VERSION);
return 0;
diff -u --recursive --new-file v2.5.1/linux/drivers/char/ip2main.c linux/drivers/char/ip2main.c
--- v2.5.1/linux/drivers/char/ip2main.c Fri Nov 2 17:26:17 2001
+++ linux/drivers/char/ip2main.c Sun Dec 30 10:31:51 2001
@@ -142,7 +142,6 @@
// so blame them.
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,4)
-# include
# define GET_USER(error,value,addr) error = get_user(value,addr)
# define COPY_FROM_USER(error,dest,src,size) error = copy_from_user(dest,src,size) ? -EFAULT : 0
# define PUT_USER(error,value,addr) error = put_user(value,addr)
diff -u --recursive --new-file v2.5.1/linux/drivers/char/isicom.c linux/drivers/char/isicom.c
--- v2.5.1/linux/drivers/char/isicom.c Fri Nov 9 14:01:21 2001
+++ linux/drivers/char/isicom.c Sun Dec 30 10:31:51 2001
@@ -51,7 +51,6 @@
#include
#include
-#include
#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c
--- v2.5.1/linux/drivers/char/keyboard.c Tue Sep 18 13:39:51 2001
+++ linux/drivers/char/keyboard.c Tue Dec 25 15:39:20 2001
@@ -67,15 +67,8 @@
extern void ctrl_alt_del(void);
-DECLARE_WAIT_QUEUE_HEAD(keypress_wait);
struct console;
-int keyboard_wait_for_keypress(struct console *co)
-{
- sleep_on(&keypress_wait);
- return 0;
-}
-
/*
* global state includes the following, and various static variables
* in this module: prev_scancode, shift_state, diacr, npadch, dead_key_next.
@@ -334,7 +327,6 @@
void put_queue(int ch)
{
- wake_up(&keypress_wait);
if (tty) {
tty_insert_flip_char(tty, ch, 0);
con_schedule_flip(tty);
@@ -343,7 +335,6 @@
static void puts_queue(char *cp)
{
- wake_up(&keypress_wait);
if (!tty)
return;
diff -u --recursive --new-file v2.5.1/linux/drivers/char/moxa.c linux/drivers/char/moxa.c
--- v2.5.1/linux/drivers/char/moxa.c Thu Oct 25 13:53:47 2001
+++ linux/drivers/char/moxa.c Sun Dec 30 10:31:51 2001
@@ -53,7 +53,6 @@
#include
#include
-#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/mxser.c linux/drivers/char/mxser.c
--- v2.5.1/linux/drivers/char/mxser.c Thu Oct 25 13:53:47 2001
+++ linux/drivers/char/mxser.c Sun Dec 30 10:31:51 2001
@@ -58,7 +58,6 @@
#include
#include
#include
-#include
#include
#include
diff -u --recursive --new-file v2.5.1/linux/drivers/char/n_hdlc.c linux/drivers/char/n_hdlc.c
--- v2.5.1/linux/drivers/char/n_hdlc.c Thu Sep 13 15:21:32 2001
+++ linux/drivers/char/n_hdlc.c Sun Dec 30 10:31:51 2001
@@ -112,7 +112,6 @@
#include
#endif
-#include
#define GET_USER(error,value,addr) error = get_user(value,addr)
#define COPY_FROM_USER(error,dest,src,size) error = copy_from_user(dest,src,size) ? -EFAULT : 0
#define PUT_USER(error,value,addr) error = put_user(value,addr)
diff -u --recursive --new-file v2.5.1/linux/drivers/char/pc110pad.c linux/drivers/char/pc110pad.c
--- v2.5.1/linux/drivers/char/pc110pad.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/char/pc110pad.c Sun Dec 30 09:08:06 2001
@@ -590,7 +590,7 @@
spin_lock_irqsave(&pc110_lock, flags);
if (!--active_count)
outb(0x30, current_params.io+2); /* switch off digitiser */
- spin_unlock_irqrestore(&active_lock, flags);
+ spin_unlock_irqrestore(&pc110_lock, flags);
return 0;
}
diff -u --recursive --new-file v2.5.1/linux/drivers/char/pty.c linux/drivers/char/pty.c
--- v2.5.1/linux/drivers/char/pty.c Fri Sep 21 10:55:22 2001
+++ linux/drivers/char/pty.c Thu Dec 27 08:29:14 2001
@@ -334,8 +334,7 @@
/* Register a slave for the master */
if (tty->driver.major == PTY_MASTER_MAJOR)
tty_register_devfs(&tty->link->driver,
- DEVFS_FL_CURRENT_OWNER |
- DEVFS_FL_NO_PERSISTENCE | DEVFS_FL_WAIT,
+ DEVFS_FL_CURRENT_OWNER | DEVFS_FL_WAIT,
tty->link->driver.minor_start +
MINOR(tty->device)-tty->driver.minor_start);
retval = 0;
diff -u --recursive --new-file v2.5.1/linux/drivers/char/raw.c linux/drivers/char/raw.c
--- v2.5.1/linux/drivers/char/raw.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/char/raw.c Thu Dec 27 08:17:43 2001
@@ -117,21 +117,8 @@
if (raw_devices[minor].inuse++)
goto out;
- /*
- * Don't interfere with mounted devices: we cannot safely set
- * the blocksize on a device which is already mounted.
- */
-
- sector_size = 512;
- if (is_mounted(rdev)) {
- if (blksize_size[MAJOR(rdev)])
- sector_size = blksize_size[MAJOR(rdev)][MINOR(rdev)];
- } else
- sector_size = get_hardsect_size(rdev);
-
- set_blocksize(rdev, sector_size);
+ sector_size = get_hardsect_size(rdev);
raw_devices[minor].sector_size = sector_size;
-
for (sector_bits = 0; !(sector_size & 1); )
sector_size>>=1, sector_bits++;
raw_devices[minor].sector_bits = sector_bits;
diff -u --recursive --new-file v2.5.1/linux/drivers/char/serial.c linux/drivers/char/serial.c
--- v2.5.1/linux/drivers/char/serial.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/char/serial.c Tue Dec 25 15:39:20 2001
@@ -5825,35 +5825,6 @@
serial_out(info, UART_IER, ier);
}
-/*
- * Receive character from the serial port
- */
-static int serial_console_wait_key(struct console *co)
-{
- static struct async_struct *info;
- int ier, c;
-
- info = &async_sercons;
-
- /*
- * First save the IER then disable the interrupts so
- * that the real driver for the port does not get the
- * character.
- */
- ier = serial_in(info, UART_IER);
- serial_out(info, UART_IER, 0x00);
-
- while ((serial_in(info, UART_LSR) & UART_LSR_DR) == 0);
- c = serial_in(info, UART_RX);
-
- /*
- * Restore the interrupts
- */
- serial_out(info, UART_IER, ier);
-
- return c;
-}
-
static kdev_t serial_console_device(struct console *c)
{
return MKDEV(TTY_MAJOR, 64 + c->index);
@@ -5994,7 +5965,6 @@
name: "ttyS",
write: serial_console_write,
device: serial_console_device,
- wait_key: serial_console_wait_key,
setup: serial_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/drivers/char/serial167.c linux/drivers/char/serial167.c
--- v2.5.1/linux/drivers/char/serial167.c Sun Sep 16 21:23:07 2001
+++ linux/drivers/char/serial167.c Sun Dec 30 10:31:51 2001
@@ -65,7 +65,6 @@
#include
#include
-#include
#include
#include
#include
@@ -2806,58 +2805,6 @@
restore_flags(flags);
}
-/* This is a hack; if there are multiple chars waiting in the chip we
- * discard all but the last one, and return that. The cd2401 is not really
- * designed to be driven in polled mode.
- */
-
-int serial167_console_wait_key(struct console *co)
-{
- volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
- unsigned long flags;
- volatile u_char sink;
- u_char ier;
- int port;
- int keypress = 0;
-
- save_flags(flags); cli();
-
- /* Ensure receiver is enabled! */
-
- port = 0;
- base_addr[CyCAR] = (u_char)port;
- while (base_addr[CyCCR])
- ;
- base_addr[CyCCR] = CyENB_RCVR;
- ier = base_addr[CyIER];
- base_addr[CyIER] = CyRxData;
-
- while (!keypress) {
- if (pcc2chip[PccSCCRICR] & 0x20)
- {
- /* We have an Rx int. Acknowledge it */
- sink = pcc2chip[PccRPIACKR];
- if ((base_addr[CyLICR] >> 2) == port) {
- int cnt = base_addr[CyRFOC];
- while (cnt-- > 0)
- {
- keypress = base_addr[CyRDR];
- }
- base_addr[CyREOIR] = 0;
- }
- else
- base_addr[CyREOIR] = CyNOTRANS;
- }
- }
-
- base_addr[CyIER] = ier;
-
- restore_flags(flags);
-
- return keypress;
-}
-
-
static kdev_t serial167_console_device(struct console *c)
{
return MKDEV(TTY_MAJOR, 64 + c->index);
@@ -2874,7 +2821,6 @@
name: "ttyS",
write: serial167_console_write,
device: serial167_console_device,
- wait_key: serial167_console_wait_key,
setup: serial167_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/drivers/char/serial_21285.c linux/drivers/char/serial_21285.c
--- v2.5.1/linux/drivers/char/serial_21285.c Thu Sep 13 15:21:32 2001
+++ linux/drivers/char/serial_21285.c Tue Dec 25 15:39:20 2001
@@ -389,17 +389,6 @@
enable_irq(IRQ_CONTX);
}
-static int rs285_console_wait_key(struct console *co)
-{
- int c;
-
- disable_irq(IRQ_CONRX);
- while (*CSR_UARTFLG & 0x10);
- c = *CSR_UARTDR;
- enable_irq(IRQ_CONRX);
- return c;
-}
-
static kdev_t rs285_console_device(struct console *c)
{
return MKDEV(SERIAL_21285_MAJOR, SERIAL_21285_MINOR);
@@ -493,7 +482,6 @@
name: SERIAL_21285_NAME,
write: rs285_console_write,
device: rs285_console_device,
- wait_key: rs285_console_wait_key,
setup: rs285_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/drivers/char/serial_amba.c linux/drivers/char/serial_amba.c
--- v2.5.1/linux/drivers/char/serial_amba.c Sun Sep 16 21:23:14 2001
+++ linux/drivers/char/serial_amba.c Tue Dec 25 15:39:20 2001
@@ -1921,22 +1921,6 @@
UART_PUT_CR(port, old_cr);
}
-/*
- * Receive character from the serial port
- */
-static int ambauart_console_wait_key(struct console *co)
-{
- struct amba_port *port = &amba_ports[co->index];
- unsigned int status;
- int c;
-
- do {
- status = UART_GET_FR(port);
- } while (!UART_RX_DATA(status));
- c = UART_GET_CHAR(port);
- return c;
-}
-
static kdev_t ambauart_console_device(struct console *c)
{
return MKDEV(SERIAL_AMBA_MAJOR, SERIAL_AMBA_MINOR + c->index);
@@ -2015,7 +1999,6 @@
read: ambauart_console_read,
#endif
device: ambauart_console_device,
- wait_key: ambauart_console_wait_key,
setup: ambauart_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/drivers/char/serial_tx3912.c linux/drivers/char/serial_tx3912.c
--- v2.5.1/linux/drivers/char/serial_tx3912.c Fri Nov 9 14:01:21 2001
+++ linux/drivers/char/serial_tx3912.c Tue Dec 25 15:39:20 2001
@@ -993,21 +993,6 @@
IntEnable2 = int2;
}
-static int serial_console_wait_key(struct console *co)
-{
- unsigned int int2, res;
-
- int2 = IntEnable2;
- IntEnable2 = 0;
-
- while (!(UartA_Ctrl1 & UART_RX_HOLD_FULL));
- res = UartA_Data;
- udelay(10);
-
- IntEnable2 = int2;
- return res;
-}
-
static void serial_console_write(struct console *co, const char *s,
unsigned count)
{
@@ -1065,7 +1050,6 @@
name: "ttyS",
write: serial_console_write,
device: serial_console_device,
- wait_key: serial_console_wait_key,
setup: serial_console_setup,
flags: CON_PRINTBUFFER,
index: -1
diff -u --recursive --new-file v2.5.1/linux/drivers/char/sh-sci.c linux/drivers/char/sh-sci.c
--- v2.5.1/linux/drivers/char/sh-sci.c Mon Oct 15 13:36:48 2001
+++ linux/drivers/char/sh-sci.c Tue Dec 25 15:39:20 2001
@@ -1181,15 +1181,6 @@
put_string(sercons_port, s, count);
}
-/*
- * Receive character from the serial port
- */
-static int serial_console_wait_key(struct console *co)
-{
- /* Not implemented yet */
- return 0;
-}
-
static kdev_t serial_console_device(struct console *c)
{
return MKDEV(SCI_MAJOR, SCI_MINOR_START + c->index);
@@ -1273,7 +1264,6 @@
name: "ttySC",
write: serial_console_write,
device: serial_console_device,
- wait_key: serial_console_wait_key,
setup: serial_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/drivers/char/synclink.c linux/drivers/char/synclink.c
--- v2.5.1/linux/drivers/char/synclink.c Fri Sep 14 14:39:59 2001
+++ linux/drivers/char/synclink.c Sun Dec 30 10:31:51 2001
@@ -114,7 +114,6 @@
#endif
#endif
-#include
#define GET_USER(error,value,addr) error = get_user(value,addr)
#define COPY_FROM_USER(error,dest,src,size) error = copy_from_user(dest,src,size) ? -EFAULT : 0
#define PUT_USER(error,value,addr) error = put_user(value,addr)
diff -u --recursive --new-file v2.5.1/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v2.5.1/linux/drivers/char/tty_io.c Tue Dec 18 14:56:35 2001
+++ linux/drivers/char/tty_io.c Thu Dec 27 08:29:14 2001
@@ -597,12 +597,6 @@
read_unlock(&tasklist_lock);
}
-void wait_for_keypress(void)
-{
- struct console *c = console_drivers;
- if (c) c->wait_key(c);
-}
-
void stop_tty(struct tty_struct *tty)
{
if (tty->stopped)
@@ -1339,7 +1333,7 @@
set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
minor -= driver->minor_start;
devpts_pty_new(driver->other->name_base + minor, MKDEV(driver->other->major, minor + driver->other->minor_start));
- tty_register_devfs(&pts_driver[major], DEVFS_FL_NO_PERSISTENCE,
+ tty_register_devfs(&pts_driver[major], DEVFS_FL_DEFAULT,
pts_driver[major].minor_start + minor);
noctty = 1;
goto init_dev_done;
diff -u --recursive --new-file v2.5.1/linux/drivers/char/vme_scc.c linux/drivers/char/vme_scc.c
--- v2.5.1/linux/drivers/char/vme_scc.c Sun Sep 16 21:22:50 2001
+++ linux/drivers/char/vme_scc.c Tue Dec 25 15:39:20 2001
@@ -1065,41 +1065,6 @@
restore_flags(flags);
}
-
-static int scc_console_wait_key(struct console *co)
-{
- unsigned long flags;
- volatile char *p = NULL;
- int c;
-
-#ifdef CONFIG_MVME147_SCC
- if (MACH_IS_MVME147)
- p = (volatile char *)M147_SCC_A_ADDR;
-#endif
-#ifdef CONFIG_MVME162_SCC
- if (MACH_IS_MVME16x)
- p = (volatile char *)MVME_SCC_A_ADDR;
-#endif
-#ifdef CONFIG_BVME6000_SCC
- if (MACH_IS_BVME6000)
- p = (volatile char *)BVME_SCC_A_ADDR;
-#endif
-
- save_flags(flags);
- cli();
-
- /* wait for rx buf filled */
- while ((*p & 0x01) == 0)
- ;
-
- *p = 8;
- scc_delay();
- c = *p;
- restore_flags(flags);
- return c;
-}
-
-
static kdev_t scc_console_device(struct console *c)
{
return MKDEV(TTY_MAJOR, SCC_MINOR_BASE + c->index);
@@ -1116,7 +1081,6 @@
name: "ttyS",
write: scc_console_write,
device: scc_console_device,
- wait_key: scc_console_wait_key,
setup: scc_console_setup,
flags: CON_PRINTBUFFER,
index: -1,
diff -u --recursive --new-file v2.5.1/linux/drivers/ide/amd74xx.c linux/drivers/ide/amd74xx.c
--- v2.5.1/linux/drivers/ide/amd74xx.c Tue Dec 18 14:56:36 2001
+++ linux/drivers/ide/amd74xx.c Mon Dec 17 10:49:31 2001
@@ -459,6 +459,8 @@
hwif->tuneproc = &amd74xx_tune_drive;
hwif->speedproc = &amd74xx_tune_chipset;
+ hwif->highmem = 1;
+
#ifndef CONFIG_BLK_DEV_IDEDMA
hwif->drives[0].autotune = 1;
hwif->drives[1].autotune = 1;
diff -u --recursive --new-file v2.5.1/linux/drivers/ide/hptraid.c linux/drivers/ide/hptraid.c
--- v2.5.1/linux/drivers/ide/hptraid.c Mon Oct 15 13:27:42 2001
+++ linux/drivers/ide/hptraid.c Thu Dec 27 08:17:43 2001
@@ -226,32 +226,20 @@
#include "hptraid.h"
-static int read_disk_sb (int major, int minor, unsigned char *buffer,int bufsize)
+static int __init read_disk_sb(struct block_device *bdev,
+ struct highpoint_raid_conf *buf)
{
- int ret = -EINVAL;
- struct buffer_head *bh = NULL;
- kdev_t dev = MKDEV(major,minor);
-
- if (blksize_size[major]==NULL) /* device doesn't exist */
- return -EINVAL;
-
-
- /* Superblock is at 4096+412 bytes */
- set_blocksize (dev, 4096);
- bh = bread (dev, 1, 4096);
-
-
- if (bh) {
- memcpy (buffer, bh->b_data, bufsize);
- } else {
- printk(KERN_ERR "hptraid: Error reading superblock.\n");
- goto abort;
+ /* Superblock is at 9*512 bytes */
+ Sector sect;
+ unsigned char *p = read_dev_sector(bdev, 9, §);
+
+ if (p) {
+ memcpy(buf, p, 512);
+ put_dev_sector(§);
+ return 0;
}
- ret = 0;
-abort:
- if (bh)
- brelse (bh);
- return ret;
+ printk(KERN_ERR "hptraid: Error reading superblock.\n");
+ return -1;
}
static unsigned long maxsectors (int major,int minor)
@@ -276,55 +264,58 @@
return lba;
}
+static struct highpoint_raid_conf __initdata prom;
static void __init probedisk(int major, int minor,int device)
{
int i;
- struct highpoint_raid_conf *prom;
- static unsigned char block[4096];
- struct block_device *bdev;
-
- if (maxsectors(major,minor)==0)
+ struct block_device *bdev = bdget(MKDEV(major,minor));
+ struct gendisk *gd;
+
+ if (!bdev)
return;
-
- if (read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block)))
- return;
-
- prom = (struct highpoint_raid_conf*)&block[512];
-
- if (prom->magic!= 0x5a7816f0)
- return;
- if (prom->type) {
+
+ if (blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) < 0)
+ return;
+
+ if (maxsectors(major,minor)==0)
+ goto out;
+
+ if (read_disk_sb(bdev, &prom))
+ goto out;
+
+ if (prom.magic!= 0x5a7816f0)
+ goto out;
+ if (prom.type) {
printk(KERN_INFO "hptraid: only RAID0 is supported currently\n");
- return;
+ goto out;
}
- i = prom->disk_number;
+ i = prom.disk_number;
if (i<0)
- return;
+ goto out;
if (i>8)
- return;
+ goto out;
+
+ raid[device].disk[i].bdev = bdev;
+ /* This is supposed to prevent others from stealing our underlying disks */
+ /* now blank the /proc/partitions table for the wrong partition table,
+ so that scripts don't accidentally mount it and crash the kernel */
+ /* XXX: the 0 is an utter hack --hch */
+ gd=get_gendisk(MKDEV(major, 0));
+ if (gd!=NULL) {
+ int j;
+ for (j=1+(minor<minor_shift);j<((minor+1)<minor_shift);j++)
+ gd->part[j].nr_sects=0;
+ }
- bdev = bdget(MKDEV(major,minor));
- if (bdev && blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) == 0) {
- int j=0;
- struct gendisk *gd;
- raid[device].disk[i].bdev = bdev;
- /* This is supposed to prevent others from stealing our underlying disks */
- /* now blank the /proc/partitions table for the wrong partition table,
- so that scripts don't accidentally mount it and crash the kernel */
- /* XXX: the 0 is an utter hack --hch */
- gd=get_gendisk(MKDEV(major, 0));
- if (gd!=NULL) {
- for (j=1+(minor<minor_shift);j<((minor+1)<minor_shift);j++)
- gd->part[j].nr_sects=0;
- }
- }
raid[device].disk[i].device = MKDEV(major,minor);
raid[device].disk[i].sectors = maxsectors(major,minor);
- raid[device].stride = (1<