r4258 - in dists/trunk/linux-2.4/debian: . patches-arch

Sven Luther luther at costa.debian.org
Thu Sep 22 09:37:13 UTC 2005


Author: luther
Date: 2005-09-22 09:36:43 +0000 (Thu, 22 Sep 2005)
New Revision: 4258

Added:
   dists/trunk/linux-2.4/debian/patches-debian/
Removed:
   dists/trunk/linux-2.4/debian/patches-arch/hppa.diff
   dists/trunk/linux-2.4/debian/patches-arch/m68k.diff
Log:
Removed hppa and m68k 2.6 patches, added 2.4.27 patches from the older packages.


Deleted: dists/trunk/linux-2.4/debian/patches-arch/hppa.diff
===================================================================
--- dists/trunk/linux-2.4/debian/patches-arch/hppa.diff	2005-09-22 09:33:55 UTC (rev 4257)
+++ dists/trunk/linux-2.4/debian/patches-arch/hppa.diff	2005-09-22 09:36:43 UTC (rev 4258)
@@ -1,10909 +0,0 @@
-Index: linux-2.6-2.6.12/CREDITS
-===================================================================
---- linux-2.6-2.6.12.orig/CREDITS	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/CREDITS	2005-08-09 17:53:35.000000000 -0400
-@@ -611,8 +611,7 @@
- N: Randolph Chung
- E: tausq at debian.org
- D: Linux/PA-RISC hacker
--S: Los Altos, CA 94022
--S: USA
-+S: Hong Kong
- 
- N: Juan Jose Ciarlante
- W: http://juanjox.kernelnotes.org/
-Index: linux-2.6-2.6.12/Documentation/parisc/todo
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/Documentation/parisc/todo	2005-08-09 17:53:35.000000000 -0400
-@@ -0,0 +1,82 @@
-+Status 2005-03-07 :
-+-------------------
-+ - Merged to 2.6.11
-+
-+Todo:
-+-----
-+
-+ - Review and eliminate all warnings for io accesses with an eye to
-+   turning on ioremap
-+ - 2005-02-04 (Carlos) Review the gettimeofday
-+   implementation, possibly use a light-weight-syscall and
-+   rely on cr16 and cpu speed for more accurate timing?
-+   This requires adding some backwards compatibility code in
-+   userspace since the LWS might not be available on the
-+   booted kernel. Detecting LWS is a problem.
-+ - PREEMPT support
-+ - CPU hotplug: we cannot bring up cpus after init, and we don't know if we can
-+   shutdown cpus
-+ - task_struct/thread_info split -- task_struct should not be visible in
-+   entry.S, we need to move some items into thread_info -- this includes
-+   pt_regs and maybe some of the flags (ptrace, etc)
-+ - flush_tlb_kernel_range is horribly inefficient. this has been merged
-+   with the userspace tlb flush, but it has a magic constant that needs
-+   tuning
-+ - Superdome support
-+ - our PDC early debug console hacks need to be cleaned up somehow
-+ - CPU IRQ affinity (willy)
-+ - Allow more than BITS_PER_LONG cpu interrupts to be allocated (willy)
-+ - 64-bit userspace (Leandro)
-+ - syscall signal return path needs work, we don't loop on signal
-+   delivery like other archs.
-+	= 2005-02-04 (Carlos) This entry should be more specific,
-+	we recently fixed do_signal such that it always
-+	loops forcing the signal. If this was the bug then it was
-+	fixed.
-+
-+
-+Drivers
-+-------
-+
-+ - write Lasi floppy driver
-+ - write Suckyio floppy driver
-+ - write spifi driver (rbrad)
-+ - modify ncr53c8xx driver for Outfield (735 & 755)
-+ - write GSC FDDI driver
-+ - write Timi ASIC (74x) support
-+ - EISA DMA support
-+
-+
-+Started and in progress:
-+------------------------
-+ - 2004-08-16 (Carlos)
-+   64-bit binutils needs to be fixed to get multiple stub
-+   section support.
-+ - port hil_kbd.c to new input layer
-+ - port hil_ptr.c to new input layer
-+
-+
-+CONFIG options without help:
-+-----------------------------
-+ - REVIEW THESE ENTRIES!
-+
-+ _USB_OHCI_HCD (add parisc info?)
-+ _HP_SDC_RTC
-+ _HIL_MLC
-+ _HIL_KBD (to improve)
-+ _HIL_PTR (to improve)
-+
-+ 
-+Review all the todo entries below!
-+----------------------------------
-+
-+ - the fix for do_fork needs checking
-+ - ns87415 dma doesn't work reliably on suckyio-systems
-+ - (ab)use kmap/kunmap on 64-bit to eliminate flush_dcache calls.
-+ - cp_new_stat32 for sys_parisc32.c is inefficient; maybe it's better
-+   to fill in a tmp stat32 and just do copy_to_user in one go at the end?
-+ - investigate not putting in extable entries for put_kernel_asm; will
-+   probably reduce kernel size
-+ - fix HIL problem: ksoftirqd/0 eats 56% cpu (kernel 2.4 & kernel 2.6)
-+ - NPTL kernel support (CLONE_*TID flags need to be correctly handled by 
-+   sys_clone() and friends)
-Index: linux-2.6-2.6.12/MAINTAINERS
-===================================================================
---- linux-2.6-2.6.12.orig/MAINTAINERS	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/MAINTAINERS	2005-08-09 17:53:35.000000000 -0400
-@@ -191,6 +191,13 @@
- W:	http://linux.thorsten-knabe.de
- S:	Maintained
- 
-+AD1889 SOUND DRIVER
-+P:	Kyle McMartin
-+M:	kyle at parisc-linux.org
-+W:	http://www.parisc-linux.org/~kyle/ad1889/
-+L:	parisc-linux at lists.parisc-linux.org
-+S:	Maintained
-+
- ADM1025 HARDWARE MONITOR DRIVER
- P:	Jean Delvare
- M:	khali at linux-fr.org
-Index: linux-2.6-2.6.12/arch/ia64/ia32/ia32_signal.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/ia64/ia32/ia32_signal.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/ia64/ia32/ia32_signal.c	2005-08-09 17:53:35.000000000 -0400
-@@ -24,6 +24,7 @@
- #include <linux/unistd.h>
- #include <linux/wait.h>
- #include <linux/compat.h>
-+#include <linux/compat_siginfo.h>
- 
- #include <asm/intrinsics.h>
- #include <asm/uaccess.h>
-Index: linux-2.6-2.6.12/arch/ia64/ia32/ia32priv.h
-===================================================================
---- linux-2.6-2.6.12.orig/arch/ia64/ia32/ia32priv.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/ia64/ia32/ia32priv.h	2005-08-09 17:53:35.000000000 -0400
-@@ -225,58 +225,6 @@
- 	unsigned int	st_ino_hi;
- };
- 
--typedef struct compat_siginfo {
--	int si_signo;
--	int si_errno;
--	int si_code;
--
--	union {
--		int _pad[((128/sizeof(int)) - 3)];
--
--		/* kill() */
--		struct {
--			unsigned int _pid;	/* sender's pid */
--			unsigned int _uid;	/* sender's uid */
--		} _kill;
--
--		/* POSIX.1b timers */
--		struct {
--			timer_t _tid;		/* timer id */
--			int _overrun;		/* overrun count */
--			char _pad[sizeof(unsigned int) - sizeof(int)];
--			compat_sigval_t _sigval;	/* same as below */
--			int _sys_private;       /* not to be passed to user */
--		} _timer;
--
--		/* POSIX.1b signals */
--		struct {
--			unsigned int _pid;	/* sender's pid */
--			unsigned int _uid;	/* sender's uid */
--			compat_sigval_t _sigval;
--		} _rt;
--
--		/* SIGCHLD */
--		struct {
--			unsigned int _pid;	/* which child */
--			unsigned int _uid;	/* sender's uid */
--			int _status;		/* exit code */
--			compat_clock_t _utime;
--			compat_clock_t _stime;
--		} _sigchld;
--
--		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
--		struct {
--			unsigned int _addr;	/* faulting insn/memory ref. */
--		} _sigfault;
--
--		/* SIGPOLL */
--		struct {
--			int _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
--			int _fd;
--		} _sigpoll;
--	} _sifields;
--} compat_siginfo_t;
--
- struct old_linux32_dirent {
- 	u32	d_ino;
- 	u32	d_offset;
-Index: linux-2.6-2.6.12/arch/parisc/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/Kconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/Kconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -150,7 +150,7 @@
- 
- config DISCONTIGMEM
- 	bool "Discontiguous memory support (EXPERIMENTAL)"
--	depends on EXPERIMENTAL
-+	depends on 64BIT && EXPERIMENTAL
- 	help
- 	  Say Y to support efficient handling of discontiguous physical memory,
- 	  for architectures which are either NUMA (Non-Uniform Memory Access)
-Index: linux-2.6-2.6.12/arch/parisc/Makefile
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/Makefile	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/Makefile	2005-08-09 17:53:47.000000000 -0400
-@@ -20,13 +20,13 @@
- CHECKFLAGS	+= -D__hppa__=1
- 
- ifdef CONFIG_64BIT
--CROSS_COMPILE	:= hppa64-linux-
-+CROSS_COMPILE	:= hppa64-linux-gnu-
- UTS_MACHINE	:= parisc64
- CHECKFLAGS	+= -D__LP64__=1 -m64
- else
- MACHINE := $(subst 64,,$(shell uname -m))
- ifneq ($(MACHINE),parisc)
--CROSS_COMPILE	:= hppa-linux-
-+CROSS_COMPILE	:= hppa-linux-gnu-
- endif
- endif
- 
-@@ -34,6 +34,11 @@
- 
- OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
- 
-+GCC_VERSION     := $(call cc-version)
-+ifneq ($(shell if [ $(GCC_VERSION) -lt 0303 ] ; then echo "bad"; fi ;),)
-+$(error Sorry, your compiler is too old ($(GCC_VERSION)).  GCC v3.3 or above is required.)
-+endif
-+
- cflags-y	:= -pipe
- 
- # These flags should be implied by an hppa-linux configuration, but they
-@@ -43,7 +48,7 @@
- # Currently we save and restore fpregs on all kernel entry/interruption paths.
- # If that gets optimized, we might need to disable the use of fpregs in the
- # kernel.
--#cflags-y	+= -mdisable-fpregs
-+cflags-y	+= -mdisable-fpregs
- 
- # Without this, "ld -r" results in .text sections that are too big
- # (> 0x40000) for branches to reach stubs.
-Index: linux-2.6-2.6.12/arch/parisc/configs/712_defconfig
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/configs/712_defconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/configs/712_defconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -1,12 +1,16 @@
- #
- # Automatically generated make config: don't edit
--# Linux kernel version: 2.6.10-pa5
--# Wed Jan  5 13:20:32 2005
-+# Linux kernel version: 2.6.12-rc4-pa2
-+# Wed May 11 23:02:52 2005
- #
- CONFIG_PARISC=y
- CONFIG_MMU=y
- CONFIG_STACK_GROWSUP=y
- CONFIG_RWSEM_GENERIC_SPINLOCK=y
-+CONFIG_GENERIC_CALIBRATE_DELAY=y
-+CONFIG_GENERIC_HARDIRQS=y
-+CONFIG_GENERIC_IRQ_PROBE=y
-+CONFIG_ISA_DMA_API=y
- 
- #
- # Code maturity level options
-@@ -15,6 +19,7 @@
- # CONFIG_CLEAN_COMPILE is not set
- CONFIG_BROKEN=y
- CONFIG_BROKEN_ON_SMP=y
-+CONFIG_INIT_ENV_ARG_LIMIT=32
- 
- #
- # General setup
-@@ -26,7 +31,6 @@
- # CONFIG_BSD_PROCESS_ACCT is not set
- CONFIG_SYSCTL=y
- # CONFIG_AUDIT is not set
--CONFIG_LOG_BUF_SHIFT=16
- CONFIG_HOTPLUG=y
- CONFIG_KOBJECT_UEVENT=y
- CONFIG_IKCONFIG=y
-@@ -35,15 +39,18 @@
- CONFIG_KALLSYMS=y
- CONFIG_KALLSYMS_ALL=y
- # CONFIG_KALLSYMS_EXTRA_PASS is not set
-+CONFIG_PRINTK=y
-+CONFIG_BUG=y
-+CONFIG_BASE_FULL=y
- CONFIG_FUTEX=y
- CONFIG_EPOLL=y
--# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
- CONFIG_SHMEM=y
- CONFIG_CC_ALIGN_FUNCTIONS=0
- CONFIG_CC_ALIGN_LABELS=0
- CONFIG_CC_ALIGN_LOOPS=0
- CONFIG_CC_ALIGN_JUMPS=0
- # CONFIG_TINY_SHMEM is not set
-+CONFIG_BASE_SMALL=0
- 
- #
- # Loadable module support
-@@ -65,9 +72,7 @@
- # CONFIG_PA7300LC is not set
- # CONFIG_PA8X00 is not set
- CONFIG_PA11=y
--# CONFIG_64BIT is not set
- # CONFIG_SMP is not set
--# CONFIG_DISCONTIGMEM is not set
- # CONFIG_PREEMPT is not set
- # CONFIG_HPUX is not set
- 
-@@ -81,8 +86,6 @@
- # CONFIG_GSC_WAX is not set
- # CONFIG_EISA is not set
- # CONFIG_PCI is not set
--CONFIG_CHASSIS_LCD_LED=y
--# CONFIG_PDC_CHASSIS is not set
- 
- #
- # PCCARD (PCMCIA/CardBus) support
-@@ -90,12 +93,15 @@
- # CONFIG_PCCARD is not set
- 
- #
--# PC-card bridges
-+# PCI Hotplug Support
- #
- 
- #
--# PCI Hotplug Support
-+# PA-RISC specific drivers
- #
-+CONFIG_CHASSIS_LCD_LED=y
-+# CONFIG_PDC_CHASSIS is not set
-+CONFIG_PDC_STABLE=y
- 
- #
- # Executable file formats
-@@ -125,11 +131,9 @@
- #
- CONFIG_PARPORT=y
- CONFIG_PARPORT_PC=m
--CONFIG_PARPORT_PC_CML1=m
- # CONFIG_PARPORT_PC_FIFO is not set
- # CONFIG_PARPORT_PC_SUPERIO is not set
- CONFIG_PARPORT_GSC=y
--# CONFIG_PARPORT_OTHER is not set
- # CONFIG_PARPORT_1284 is not set
- 
- #
-@@ -141,6 +145,7 @@
- #
- # CONFIG_BLK_DEV_FD is not set
- # CONFIG_PARIDE is not set
-+# CONFIG_BLK_DEV_COW_COMMON is not set
- CONFIG_BLK_DEV_LOOP=y
- CONFIG_BLK_DEV_CRYPTOLOOP=y
- # CONFIG_BLK_DEV_NBD is not set
-@@ -158,6 +163,7 @@
- CONFIG_IOSCHED_AS=y
- CONFIG_IOSCHED_DEADLINE=y
- CONFIG_IOSCHED_CFQ=y
-+CONFIG_ATA_OVER_ETH=m
- 
- #
- # ATA/ATAPI/MFM/RLL support
-@@ -192,6 +198,7 @@
- #
- CONFIG_SCSI_SPI_ATTRS=y
- # CONFIG_SCSI_FC_ATTRS is not set
-+CONFIG_SCSI_ISCSI_ATTRS=m
- 
- #
- # SCSI low-level drivers
-@@ -200,7 +207,6 @@
- # CONFIG_SCSI_PPA is not set
- # CONFIG_SCSI_IMM is not set
- CONFIG_SCSI_LASI700=y
--CONFIG_53C700_MEM_MAPPED=y
- CONFIG_53C700_LE_ON_BE=y
- # CONFIG_SCSI_ZALON is not set
- CONFIG_SCSI_DEBUG=m
-@@ -243,7 +249,6 @@
- #
- CONFIG_PACKET=y
- CONFIG_PACKET_MMAP=y
--CONFIG_NETLINK_DEV=y
- CONFIG_UNIX=y
- CONFIG_NET_KEY=m
- CONFIG_INET=y
-@@ -321,7 +326,6 @@
- CONFIG_IP_NF_TARGET_REDIRECT=m
- CONFIG_IP_NF_TARGET_NETMAP=m
- CONFIG_IP_NF_TARGET_SAME=m
--# CONFIG_IP_NF_NAT_LOCAL is not set
- CONFIG_IP_NF_NAT_SNMP_BASIC=m
- CONFIG_IP_NF_NAT_IRC=m
- CONFIG_IP_NF_NAT_FTP=m
-@@ -340,8 +344,6 @@
- CONFIG_IP_NF_ARPTABLES=m
- CONFIG_IP_NF_ARPFILTER=m
- CONFIG_IP_NF_ARP_MANGLE=m
--# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
--# CONFIG_IP_NF_COMPAT_IPFWADM is not set
- CONFIG_XFRM=y
- CONFIG_XFRM_USER=m
- 
-@@ -383,7 +385,6 @@
- CONFIG_BONDING=m
- # CONFIG_EQUALIZER is not set
- CONFIG_TUN=m
--# CONFIG_ETHERTAP is not set
- 
- #
- # Ethernet (10 or 100Mbit)
-@@ -460,19 +461,6 @@
- # CONFIG_INPUT_EVBUG is not set
- 
- #
--# Input I/O drivers
--#
--# CONFIG_GAMEPORT is not set
--CONFIG_SOUND_GAMEPORT=y
--CONFIG_SERIO=y
--CONFIG_SERIO_SERPORT=y
--# CONFIG_SERIO_PARKBD is not set
--CONFIG_SERIO_GSCPS2=y
--CONFIG_HP_SDC=y
--CONFIG_HIL_MLC=y
--# CONFIG_SERIO_RAW is not set
--
--#
- # Input Device Drivers
- #
- CONFIG_INPUT_KEYBOARD=y
-@@ -483,6 +471,7 @@
- # CONFIG_KEYBOARD_LKKBD is not set
- # CONFIG_KEYBOARD_XTKBD is not set
- # CONFIG_KEYBOARD_NEWTON is not set
-+CONFIG_KEYBOARD_HIL_OLD=y
- # CONFIG_KEYBOARD_HIL is not set
- CONFIG_INPUT_MOUSE=y
- CONFIG_MOUSE_PS2=y
-@@ -494,6 +483,20 @@
- # CONFIG_INPUT_MISC is not set
- 
- #
-+# Hardware I/O ports
-+#
-+CONFIG_SERIO=y
-+CONFIG_SERIO_SERPORT=y
-+# CONFIG_SERIO_PARKBD is not set
-+CONFIG_SERIO_GSCPS2=y
-+CONFIG_HP_SDC=y
-+CONFIG_HIL_MLC=y
-+CONFIG_SERIO_LIBPS2=y
-+# CONFIG_SERIO_RAW is not set
-+# CONFIG_GAMEPORT is not set
-+CONFIG_SOUND_GAMEPORT=y
-+
-+#
- # Character devices
- #
- CONFIG_VT=y
-@@ -546,12 +549,15 @@
- #
- # Ftape, the floppy tape device driver
- #
--# CONFIG_AGP is not set
- # CONFIG_DRM is not set
- CONFIG_RAW_DRIVER=y
- CONFIG_MAX_RAW_DEVS=256
- 
- #
-+# TPM devices
-+#
-+
-+#
- # I2C support
- #
- # CONFIG_I2C is not set
-@@ -579,19 +585,25 @@
- # Graphics support
- #
- CONFIG_FB=y
-+CONFIG_FB_CFB_FILLRECT=y
-+CONFIG_FB_CFB_COPYAREA=y
-+CONFIG_FB_CFB_IMAGEBLIT=y
-+CONFIG_FB_SOFT_CURSOR=y
-+# CONFIG_FB_MACMODES is not set
- CONFIG_FB_MODE_HELPERS=y
- CONFIG_FB_TILEBLITTING=y
- CONFIG_FB_STI=y
-+# CONFIG_FB_S1D13XXX is not set
- # CONFIG_FB_VIRTUAL is not set
- 
- #
- # Console display driver support
- #
--CONFIG_STI_CONSOLE=y
-+CONFIG_DUMMY_CONSOLE=y
- CONFIG_DUMMY_CONSOLE_COLUMNS=128
- CONFIG_DUMMY_CONSOLE_ROWS=48
--CONFIG_DUMMY_CONSOLE=y
- CONFIG_FRAMEBUFFER_CONSOLE=y
-+CONFIG_STI_CONSOLE=y
- CONFIG_FONTS=y
- CONFIG_FONT_8x8=y
- CONFIG_FONT_8x16=y
-@@ -610,6 +622,7 @@
- # CONFIG_LOGO_LINUX_VGA16 is not set
- # CONFIG_LOGO_LINUX_CLUT224 is not set
- CONFIG_LOGO_PARISC_CLUT224=y
-+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
- 
- #
- # Sound
-@@ -657,10 +670,6 @@
- # CONFIG_USB_ARCH_HAS_OHCI is not set
- 
- #
--# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
--#
--
--#
- # USB Gadget Support
- #
- # CONFIG_USB_GADGET is not set
-@@ -671,6 +680,11 @@
- # CONFIG_MMC is not set
- 
- #
-+# InfiniBand support
-+#
-+# CONFIG_INFINIBAND is not set
-+
-+#
- # File systems
- #
- CONFIG_EXT2_FS=y
-@@ -682,10 +696,16 @@
- # CONFIG_REISERFS_FS is not set
- CONFIG_JFS_FS=m
- # CONFIG_JFS_POSIX_ACL is not set
-+# CONFIG_JFS_SECURITY is not set
- # CONFIG_JFS_DEBUG is not set
- # CONFIG_JFS_STATISTICS is not set
- CONFIG_FS_POSIX_ACL=y
-+
-+#
-+# XFS support
-+#
- CONFIG_XFS_FS=m
-+CONFIG_XFS_EXPORT=y
- # CONFIG_XFS_RT is not set
- # CONFIG_XFS_QUOTA is not set
- # CONFIG_XFS_SECURITY is not set
-@@ -838,13 +858,18 @@
- #
- # Kernel hacking
- #
-+# CONFIG_PRINTK_TIME is not set
- CONFIG_DEBUG_KERNEL=y
- CONFIG_MAGIC_SYSRQ=y
-+CONFIG_LOG_BUF_SHIFT=16
- # CONFIG_SCHEDSTATS is not set
- # CONFIG_DEBUG_SLAB is not set
- # CONFIG_DEBUG_SPINLOCK is not set
-+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
- # CONFIG_DEBUG_KOBJECT is not set
- # CONFIG_DEBUG_INFO is not set
-+# CONFIG_DEBUG_IOREMAP is not set
-+# CONFIG_DEBUG_FS is not set
- 
- #
- # Security options
-@@ -865,6 +890,7 @@
- CONFIG_CRYPTO_SHA256=m
- CONFIG_CRYPTO_SHA512=m
- CONFIG_CRYPTO_WP512=m
-+CONFIG_CRYPTO_TGR192=m
- CONFIG_CRYPTO_DES=y
- CONFIG_CRYPTO_BLOWFISH=m
- CONFIG_CRYPTO_TWOFISH=m
-@@ -882,6 +908,10 @@
- CONFIG_CRYPTO_TEST=m
- 
- #
-+# Hardware crypto devices
-+#
-+
-+#
- # Library routines
- #
- CONFIG_CRC_CCITT=m
-Index: linux-2.6-2.6.12/arch/parisc/configs/a500_defconfig
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/configs/a500_defconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/configs/a500_defconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -1,7 +1,7 @@
- #
- # Automatically generated make config: don't edit
--# Linux kernel version: 2.6.11-rc4-pa1
--# Wed Feb 16 11:32:49 2005
-+# Linux kernel version: 2.6.12-rc4-pa2
-+# Wed May 11 23:04:06 2005
- #
- CONFIG_PARISC=y
- CONFIG_MMU=y
-@@ -10,6 +10,7 @@
- CONFIG_GENERIC_CALIBRATE_DELAY=y
- CONFIG_GENERIC_HARDIRQS=y
- CONFIG_GENERIC_IRQ_PROBE=y
-+CONFIG_ISA_DMA_API=y
- 
- #
- # Code maturity level options
-@@ -19,6 +20,7 @@
- CONFIG_BROKEN=y
- CONFIG_BROKEN_ON_SMP=y
- CONFIG_LOCK_KERNEL=y
-+CONFIG_INIT_ENV_ARG_LIMIT=32
- 
- #
- # General setup
-@@ -30,15 +32,18 @@
- # CONFIG_BSD_PROCESS_ACCT is not set
- CONFIG_SYSCTL=y
- # CONFIG_AUDIT is not set
--CONFIG_LOG_BUF_SHIFT=16
- CONFIG_HOTPLUG=y
- CONFIG_KOBJECT_UEVENT=y
- CONFIG_IKCONFIG=y
- CONFIG_IKCONFIG_PROC=y
-+# CONFIG_CPUSETS is not set
- CONFIG_EMBEDDED=y
- CONFIG_KALLSYMS=y
- CONFIG_KALLSYMS_ALL=y
- # CONFIG_KALLSYMS_EXTRA_PASS is not set
-+CONFIG_PRINTK=y
-+CONFIG_BUG=y
-+CONFIG_BASE_FULL=y
- CONFIG_FUTEX=y
- CONFIG_EPOLL=y
- # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-@@ -48,6 +53,7 @@
- CONFIG_CC_ALIGN_LOOPS=0
- CONFIG_CC_ALIGN_JUMPS=0
- # CONFIG_TINY_SHMEM is not set
-+CONFIG_BASE_SMALL=0
- 
- #
- # Loadable module support
-@@ -86,6 +92,7 @@
- CONFIG_PCI=y
- CONFIG_PCI_LEGACY_PROC=y
- CONFIG_PCI_NAMES=y
-+# CONFIG_PCI_DEBUG is not set
- CONFIG_PCI_LBA=y
- CONFIG_IOSAPIC=y
- CONFIG_IOMMU_SBA=y
-@@ -259,6 +266,7 @@
- CONFIG_SCSI_QLA2300=m
- CONFIG_SCSI_QLA2322=m
- CONFIG_SCSI_QLA6312=m
-+# CONFIG_SCSI_LPFC is not set
- # CONFIG_SCSI_DC395x is not set
- # CONFIG_SCSI_DC390T is not set
- CONFIG_SCSI_DEBUG=m
-@@ -312,7 +320,6 @@
- #
- CONFIG_PACKET=y
- CONFIG_PACKET_MMAP=y
--CONFIG_NETLINK_DEV=y
- CONFIG_UNIX=y
- CONFIG_NET_KEY=m
- CONFIG_INET=y
-@@ -449,7 +456,6 @@
- CONFIG_BONDING=m
- # CONFIG_EQUALIZER is not set
- CONFIG_TUN=m
--# CONFIG_ETHERTAP is not set
- 
- #
- # ARCnet devices
-@@ -491,7 +497,6 @@
- # CONFIG_DGRS is not set
- CONFIG_EEPRO100=m
- CONFIG_E100=m
--CONFIG_E100_NAPI=y
- # CONFIG_FEALNX is not set
- CONFIG_NATSEMI=m
- # CONFIG_NE2K_PCI is not set
-@@ -633,13 +638,6 @@
- # CONFIG_INPUT_EVBUG is not set
- 
- #
--# Input I/O drivers
--#
--# CONFIG_GAMEPORT is not set
--CONFIG_SOUND_GAMEPORT=y
--# CONFIG_SERIO is not set
--
--#
- # Input Device Drivers
- #
- # CONFIG_INPUT_KEYBOARD is not set
-@@ -649,6 +647,13 @@
- # CONFIG_INPUT_MISC is not set
- 
- #
-+# Hardware I/O ports
-+#
-+# CONFIG_SERIO is not set
-+# CONFIG_GAMEPORT is not set
-+CONFIG_SOUND_GAMEPORT=y
-+
-+#
- # Character devices
- #
- CONFIG_VT=y
-@@ -677,6 +682,7 @@
- CONFIG_PDC_CONSOLE=y
- CONFIG_SERIAL_CORE=y
- CONFIG_SERIAL_CORE_CONSOLE=y
-+# CONFIG_SERIAL_JSM is not set
- CONFIG_UNIX98_PTYS=y
- # CONFIG_LEGACY_PTYS is not set
- 
-@@ -708,6 +714,11 @@
- CONFIG_MAX_RAW_DEVS=256
- 
- #
-+# TPM devices
-+#
-+# CONFIG_TCG_TPM is not set
-+
-+#
- # I2C support
- #
- # CONFIG_I2C is not set
-@@ -742,6 +753,10 @@
- CONFIG_DUMMY_CONSOLE=y
- CONFIG_DUMMY_CONSOLE_COLUMNS=160
- CONFIG_DUMMY_CONSOLE_ROWS=64
-+CONFIG_STI_CONSOLE=y
-+# CONFIG_FONTS is not set
-+CONFIG_FONT_8x8=y
-+CONFIG_FONT_8x16=y
- 
- #
- # Sound
-@@ -751,13 +766,9 @@
- #
- # USB support
- #
--# CONFIG_USB is not set
- CONFIG_USB_ARCH_HAS_HCD=y
- CONFIG_USB_ARCH_HAS_OHCI=y
--
--#
--# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
--#
-+# CONFIG_USB is not set
- 
- #
- # USB Gadget Support
-@@ -950,11 +961,14 @@
- #
- # Kernel hacking
- #
-+# CONFIG_PRINTK_TIME is not set
- CONFIG_DEBUG_KERNEL=y
- CONFIG_MAGIC_SYSRQ=y
-+CONFIG_LOG_BUF_SHIFT=16
- # CONFIG_SCHEDSTATS is not set
- # CONFIG_DEBUG_SLAB is not set
- # CONFIG_DEBUG_SPINLOCK is not set
-+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
- # CONFIG_DEBUG_KOBJECT is not set
- # CONFIG_DEBUG_INFO is not set
- # CONFIG_DEBUG_IOREMAP is not set
-@@ -980,6 +994,7 @@
- CONFIG_CRYPTO_SHA256=m
- CONFIG_CRYPTO_SHA512=m
- CONFIG_CRYPTO_WP512=m
-+CONFIG_CRYPTO_TGR192=m
- CONFIG_CRYPTO_DES=m
- CONFIG_CRYPTO_BLOWFISH=m
- CONFIG_CRYPTO_TWOFISH=m
-Index: linux-2.6-2.6.12/arch/parisc/configs/b180_defconfig
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/configs/b180_defconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/configs/b180_defconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -1,12 +1,16 @@
- #
- # Automatically generated make config: don't edit
--# Linux kernel version: 2.6.10-pa5
--# Wed Jan  5 13:35:54 2005
-+# Linux kernel version: 2.6.12-rc4-pa2
-+# Wed May 11 23:04:20 2005
- #
- CONFIG_PARISC=y
- CONFIG_MMU=y
- CONFIG_STACK_GROWSUP=y
- CONFIG_RWSEM_GENERIC_SPINLOCK=y
-+CONFIG_GENERIC_CALIBRATE_DELAY=y
-+CONFIG_GENERIC_HARDIRQS=y
-+CONFIG_GENERIC_IRQ_PROBE=y
-+CONFIG_ISA_DMA_API=y
- 
- #
- # Code maturity level options
-@@ -14,6 +18,7 @@
- # CONFIG_EXPERIMENTAL is not set
- CONFIG_CLEAN_COMPILE=y
- CONFIG_BROKEN_ON_SMP=y
-+CONFIG_INIT_ENV_ARG_LIMIT=32
- 
- #
- # General setup
-@@ -24,23 +29,26 @@
- # CONFIG_BSD_PROCESS_ACCT is not set
- CONFIG_SYSCTL=y
- # CONFIG_AUDIT is not set
--CONFIG_LOG_BUF_SHIFT=16
- # CONFIG_HOTPLUG is not set
- CONFIG_KOBJECT_UEVENT=y
--# CONFIG_IKCONFIG is not set
-+CONFIG_IKCONFIG=y
-+CONFIG_IKCONFIG_PROC=y
- # CONFIG_EMBEDDED is not set
- CONFIG_KALLSYMS=y
- # CONFIG_KALLSYMS_ALL is not set
- # CONFIG_KALLSYMS_EXTRA_PASS is not set
-+CONFIG_PRINTK=y
-+CONFIG_BUG=y
-+CONFIG_BASE_FULL=y
- CONFIG_FUTEX=y
- CONFIG_EPOLL=y
--# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
- CONFIG_SHMEM=y
- CONFIG_CC_ALIGN_FUNCTIONS=0
- CONFIG_CC_ALIGN_LABELS=0
- CONFIG_CC_ALIGN_LOOPS=0
- CONFIG_CC_ALIGN_JUMPS=0
- # CONFIG_TINY_SHMEM is not set
-+CONFIG_BASE_SMALL=0
- 
- #
- # Loadable module support
-@@ -60,7 +68,6 @@
- # CONFIG_PA7300LC is not set
- # CONFIG_PA8X00 is not set
- CONFIG_PA11=y
--# CONFIG_64BIT is not set
- # CONFIG_SMP is not set
- # CONFIG_PREEMPT is not set
- # CONFIG_HPUX is not set
-@@ -79,10 +86,25 @@
- CONFIG_PCI=y
- CONFIG_PCI_LEGACY_PROC=y
- CONFIG_PCI_NAMES=y
-+# CONFIG_PCI_DEBUG is not set
- CONFIG_GSC_DINO=y
- # CONFIG_PCI_LBA is not set
-+
-+#
-+# PCCARD (PCMCIA/CardBus) support
-+#
-+# CONFIG_PCCARD is not set
-+
-+#
-+# PCI Hotplug Support
-+#
-+
-+#
-+# PA-RISC specific drivers
-+#
- CONFIG_CHASSIS_LCD_LED=y
- # CONFIG_PDC_CHASSIS is not set
-+CONFIG_PDC_STABLE=y
- 
- #
- # Executable file formats
-@@ -99,6 +121,7 @@
- #
- CONFIG_STANDALONE=y
- # CONFIG_PREVENT_FIRMWARE_BUILD is not set
-+# CONFIG_FW_LOADER is not set
- # CONFIG_DEBUG_DRIVER is not set
- 
- #
-@@ -111,10 +134,8 @@
- #
- CONFIG_PARPORT=y
- CONFIG_PARPORT_PC=y
--CONFIG_PARPORT_PC_CML1=y
- # CONFIG_PARPORT_SERIAL is not set
- CONFIG_PARPORT_GSC=y
--# CONFIG_PARPORT_OTHER is not set
- # CONFIG_PARPORT_1284 is not set
- 
- #
-@@ -131,6 +152,7 @@
- # CONFIG_BLK_CPQ_DA is not set
- # CONFIG_BLK_CPQ_CISS_DA is not set
- # CONFIG_BLK_DEV_DAC960 is not set
-+# CONFIG_BLK_DEV_COW_COMMON is not set
- CONFIG_BLK_DEV_LOOP=y
- CONFIG_BLK_DEV_CRYPTOLOOP=y
- # CONFIG_BLK_DEV_NBD is not set
-@@ -149,6 +171,7 @@
- CONFIG_IOSCHED_AS=y
- CONFIG_IOSCHED_DEADLINE=y
- CONFIG_IOSCHED_CFQ=y
-+CONFIG_ATA_OVER_ETH=y
- 
- #
- # ATA/ATAPI/MFM/RLL support
-@@ -183,6 +206,7 @@
- #
- CONFIG_SCSI_SPI_ATTRS=y
- # CONFIG_SCSI_FC_ATTRS is not set
-+# CONFIG_SCSI_ISCSI_ATTRS is not set
- 
- #
- # SCSI low-level drivers
-@@ -207,7 +231,6 @@
- # CONFIG_SCSI_DMX3191D is not set
- # CONFIG_SCSI_DTC3280 is not set
- # CONFIG_SCSI_EATA is not set
--# CONFIG_SCSI_EATA_PIO is not set
- # CONFIG_SCSI_FUTURE_DOMAIN is not set
- # CONFIG_SCSI_GDTH is not set
- # CONFIG_SCSI_GENERIC_NCR5380 is not set
-@@ -219,7 +242,6 @@
- # CONFIG_SCSI_IMM is not set
- # CONFIG_SCSI_NCR53C406A is not set
- CONFIG_SCSI_LASI700=y
--CONFIG_53C700_MEM_MAPPED=y
- CONFIG_53C700_LE_ON_BE=y
- CONFIG_SCSI_SYM53C8XX_2=y
- CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
-@@ -231,7 +253,6 @@
- # CONFIG_SCSI_PAS16 is not set
- # CONFIG_SCSI_PSI240I is not set
- # CONFIG_SCSI_QLOGIC_FAS is not set
--# CONFIG_SCSI_QLOGIC_ISP is not set
- # CONFIG_SCSI_QLOGIC_FC is not set
- # CONFIG_SCSI_QLOGIC_1280 is not set
- CONFIG_SCSI_QLA2XXX=y
-@@ -240,7 +261,7 @@
- # CONFIG_SCSI_QLA2300 is not set
- # CONFIG_SCSI_QLA2322 is not set
- # CONFIG_SCSI_QLA6312 is not set
--# CONFIG_SCSI_QLA6322 is not set
-+# CONFIG_SCSI_LPFC is not set
- # CONFIG_SCSI_SIM710 is not set
- # CONFIG_SCSI_SYM53C416 is not set
- # CONFIG_SCSI_DC390T is not set
-@@ -263,6 +284,7 @@
- CONFIG_MD_RAID0=y
- CONFIG_MD_RAID1=y
- CONFIG_MD_RAID5=y
-+CONFIG_MD_RAID6=y
- # CONFIG_MD_MULTIPATH is not set
- # CONFIG_MD_FAULTY is not set
- # CONFIG_BLK_DEV_DM is not set
-@@ -292,7 +314,6 @@
- #
- CONFIG_PACKET=y
- CONFIG_PACKET_MMAP=y
--CONFIG_NETLINK_DEV=y
- CONFIG_UNIX=y
- # CONFIG_NET_KEY is not set
- CONFIG_INET=y
-@@ -311,7 +332,14 @@
- # CONFIG_INET_IPCOMP is not set
- # CONFIG_INET_TUNNEL is not set
- CONFIG_IP_TCPDIAG=y
--# CONFIG_IP_TCPDIAG_IPV6 is not set
-+CONFIG_IP_TCPDIAG_IPV6=y
-+CONFIG_IPV6=y
-+# CONFIG_IPV6_PRIVACY is not set
-+# CONFIG_INET6_AH is not set
-+# CONFIG_INET6_ESP is not set
-+# CONFIG_INET6_IPCOMP is not set
-+# CONFIG_INET6_TUNNEL is not set
-+# CONFIG_IPV6_TUNNEL is not set
- # CONFIG_NETFILTER is not set
- # CONFIG_BRIDGE is not set
- # CONFIG_VLAN_8021Q is not set
-@@ -464,23 +492,12 @@
- # CONFIG_INPUT_EVBUG is not set
- 
- #
--# Input I/O drivers
--#
--# CONFIG_GAMEPORT is not set
--CONFIG_SOUND_GAMEPORT=y
--CONFIG_SERIO=y
--# CONFIG_SERIO_SERPORT is not set
--# CONFIG_SERIO_PARKBD is not set
--CONFIG_SERIO_GSCPS2=y
--# CONFIG_HP_SDC is not set
--# CONFIG_SERIO_PCIPS2 is not set
--# CONFIG_SERIO_RAW is not set
--
--#
- # Input Device Drivers
- #
- CONFIG_INPUT_KEYBOARD=y
--# CONFIG_KEYBOARD_ATKBD is not set
-+CONFIG_KEYBOARD_ATKBD=y
-+CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y
-+# CONFIG_KEYBOARD_ATKBD_RDI_KEYCODES is not set
- # CONFIG_KEYBOARD_SUNKBD is not set
- # CONFIG_KEYBOARD_LKKBD is not set
- # CONFIG_KEYBOARD_XTKBD is not set
-@@ -488,7 +505,7 @@
- # CONFIG_KEYBOARD_HIL_OLD is not set
- # CONFIG_KEYBOARD_HIL is not set
- CONFIG_INPUT_MOUSE=y
--# CONFIG_MOUSE_PS2 is not set
-+CONFIG_MOUSE_PS2=y
- # CONFIG_MOUSE_SERIAL is not set
- # CONFIG_MOUSE_INPORT is not set
- # CONFIG_MOUSE_LOGIBM is not set
-@@ -502,6 +519,20 @@
- # CONFIG_HP_SDC_RTC is not set
- 
- #
-+# Hardware I/O ports
-+#
-+CONFIG_SERIO=y
-+# CONFIG_SERIO_SERPORT is not set
-+# CONFIG_SERIO_PARKBD is not set
-+CONFIG_SERIO_GSCPS2=y
-+# CONFIG_HP_SDC is not set
-+# CONFIG_SERIO_PCIPS2 is not set
-+CONFIG_SERIO_LIBPS2=y
-+# CONFIG_SERIO_RAW is not set
-+# CONFIG_GAMEPORT is not set
-+CONFIG_SOUND_GAMEPORT=y
-+
-+#
- # Character devices
- #
- CONFIG_VT=y
-@@ -529,6 +560,7 @@
- # CONFIG_PDC_CONSOLE is not set
- CONFIG_SERIAL_CORE=y
- CONFIG_SERIAL_CORE_CONSOLE=y
-+# CONFIG_SERIAL_JSM is not set
- CONFIG_UNIX98_PTYS=y
- CONFIG_LEGACY_PTYS=y
- CONFIG_LEGACY_PTY_COUNT=256
-@@ -555,11 +587,14 @@
- #
- # Ftape, the floppy tape device driver
- #
--# CONFIG_AGP is not set
- # CONFIG_DRM is not set
- # CONFIG_RAW_DRIVER is not set
- 
- #
-+# TPM devices
-+#
-+
-+#
- # I2C support
- #
- # CONFIG_I2C is not set
-@@ -587,6 +622,11 @@
- # Graphics support
- #
- CONFIG_FB=y
-+CONFIG_FB_CFB_FILLRECT=y
-+CONFIG_FB_CFB_COPYAREA=y
-+CONFIG_FB_CFB_IMAGEBLIT=y
-+CONFIG_FB_SOFT_CURSOR=y
-+# CONFIG_FB_MACMODES is not set
- # CONFIG_FB_MODE_HELPERS is not set
- # CONFIG_FB_TILEBLITTING is not set
- # CONFIG_FB_CIRRUS is not set
-@@ -595,6 +635,7 @@
- # CONFIG_FB_ASILIANT is not set
- # CONFIG_FB_IMSTT is not set
- CONFIG_FB_STI=y
-+# CONFIG_FB_NVIDIA is not set
- # CONFIG_FB_RIVA is not set
- # CONFIG_FB_MATROX is not set
- # CONFIG_FB_RADEON_OLD is not set
-@@ -607,17 +648,17 @@
- # CONFIG_FB_3DFX is not set
- # CONFIG_FB_VOODOO1 is not set
- # CONFIG_FB_TRIDENT is not set
-+# CONFIG_FB_S1D13XXX is not set
- # CONFIG_FB_VIRTUAL is not set
- 
- #
- # Console display driver support
- #
--# CONFIG_MDA_CONSOLE is not set
--CONFIG_STI_CONSOLE=y
-+CONFIG_DUMMY_CONSOLE=y
- CONFIG_DUMMY_CONSOLE_COLUMNS=160
- CONFIG_DUMMY_CONSOLE_ROWS=64
--CONFIG_DUMMY_CONSOLE=y
- CONFIG_FRAMEBUFFER_CONSOLE=y
-+CONFIG_STI_CONSOLE=y
- # CONFIG_FONTS is not set
- CONFIG_FONT_8x8=y
- CONFIG_FONT_8x16=y
-@@ -630,6 +671,7 @@
- CONFIG_LOGO_LINUX_VGA16=y
- CONFIG_LOGO_LINUX_CLUT224=y
- CONFIG_LOGO_PARISC_CLUT224=y
-+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
- 
- #
- # Sound
-@@ -639,13 +681,9 @@
- #
- # USB support
- #
--# CONFIG_USB is not set
- CONFIG_USB_ARCH_HAS_HCD=y
- CONFIG_USB_ARCH_HAS_OHCI=y
--
--#
--# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
--#
-+# CONFIG_USB is not set
- 
- #
- # USB Gadget Support
-@@ -658,6 +696,11 @@
- # CONFIG_MMC is not set
- 
- #
-+# InfiniBand support
-+#
-+# CONFIG_INFINIBAND is not set
-+
-+#
- # File systems
- #
- CONFIG_EXT2_FS=y
-@@ -668,6 +711,10 @@
- # CONFIG_JBD_DEBUG is not set
- # CONFIG_REISERFS_FS is not set
- # CONFIG_JFS_FS is not set
-+
-+#
-+# XFS support
-+#
- # CONFIG_XFS_FS is not set
- # CONFIG_MINIX_FS is not set
- # CONFIG_ROMFS_FS is not set
-@@ -727,7 +774,8 @@
- CONFIG_LOCKD_V4=y
- CONFIG_EXPORTFS=y
- CONFIG_SUNRPC=y
--# CONFIG_SMB_FS is not set
-+CONFIG_SMB_FS=y
-+# CONFIG_SMB_NLS_DEFAULT is not set
- # CONFIG_CIFS is not set
- # CONFIG_NCP_FS is not set
- # CONFIG_CODA_FS is not set
-@@ -785,13 +833,18 @@
- #
- # Kernel hacking
- #
-+# CONFIG_PRINTK_TIME is not set
- CONFIG_DEBUG_KERNEL=y
- CONFIG_MAGIC_SYSRQ=y
-+CONFIG_LOG_BUF_SHIFT=16
- # CONFIG_SCHEDSTATS is not set
- # CONFIG_DEBUG_SLAB is not set
- # CONFIG_DEBUG_SPINLOCK is not set
-+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
- # CONFIG_DEBUG_KOBJECT is not set
- # CONFIG_DEBUG_INFO is not set
-+# CONFIG_DEBUG_IOREMAP is not set
-+# CONFIG_DEBUG_FS is not set
- 
- #
- # Security options
-@@ -815,6 +868,7 @@
- # CONFIG_CRYPTO_SHA256 is not set
- # CONFIG_CRYPTO_SHA512 is not set
- # CONFIG_CRYPTO_WP512 is not set
-+# CONFIG_CRYPTO_TGR192 is not set
- # CONFIG_CRYPTO_DES is not set
- # CONFIG_CRYPTO_BLOWFISH is not set
- # CONFIG_CRYPTO_TWOFISH is not set
-@@ -832,6 +886,10 @@
- # CONFIG_CRYPTO_TEST is not set
- 
- #
-+# Hardware crypto devices
-+#
-+
-+#
- # Library routines
- #
- # CONFIG_CRC_CCITT is not set
-Index: linux-2.6-2.6.12/arch/parisc/configs/c3000_defconfig
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/configs/c3000_defconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/configs/c3000_defconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -1,12 +1,16 @@
- #
- # Automatically generated make config: don't edit
--# Linux kernel version: 2.6.10-pa5
--# Wed Jan  5 13:26:49 2005
-+# Linux kernel version: 2.6.12-rc4-pa2
-+# Wed May 11 23:06:15 2005
- #
- CONFIG_PARISC=y
- CONFIG_MMU=y
- CONFIG_STACK_GROWSUP=y
- CONFIG_RWSEM_GENERIC_SPINLOCK=y
-+CONFIG_GENERIC_CALIBRATE_DELAY=y
-+CONFIG_GENERIC_HARDIRQS=y
-+CONFIG_GENERIC_IRQ_PROBE=y
-+CONFIG_ISA_DMA_API=y
- 
- #
- # Code maturity level options
-@@ -15,6 +19,7 @@
- # CONFIG_CLEAN_COMPILE is not set
- CONFIG_BROKEN=y
- CONFIG_BROKEN_ON_SMP=y
-+CONFIG_INIT_ENV_ARG_LIMIT=32
- 
- #
- # General setup
-@@ -26,7 +31,6 @@
- # CONFIG_BSD_PROCESS_ACCT is not set
- CONFIG_SYSCTL=y
- # CONFIG_AUDIT is not set
--CONFIG_LOG_BUF_SHIFT=16
- CONFIG_HOTPLUG=y
- CONFIG_KOBJECT_UEVENT=y
- CONFIG_IKCONFIG=y
-@@ -35,6 +39,9 @@
- CONFIG_KALLSYMS=y
- CONFIG_KALLSYMS_ALL=y
- # CONFIG_KALLSYMS_EXTRA_PASS is not set
-+CONFIG_PRINTK=y
-+CONFIG_BUG=y
-+CONFIG_BASE_FULL=y
- CONFIG_FUTEX=y
- CONFIG_EPOLL=y
- # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-@@ -44,6 +51,7 @@
- CONFIG_CC_ALIGN_LOOPS=0
- CONFIG_CC_ALIGN_JUMPS=0
- # CONFIG_TINY_SHMEM is not set
-+CONFIG_BASE_SMALL=0
- 
- #
- # Loadable module support
-@@ -66,10 +74,8 @@
- CONFIG_PA8X00=y
- CONFIG_PA20=y
- CONFIG_PREFETCH=y
--# CONFIG_PARISC64 is not set
- # CONFIG_64BIT is not set
- # CONFIG_SMP is not set
--# CONFIG_DISCONTIGMEM is not set
- # CONFIG_PREEMPT is not set
- # CONFIG_HPUX is not set
- 
-@@ -80,12 +86,10 @@
- CONFIG_PCI=y
- CONFIG_PCI_LEGACY_PROC=y
- CONFIG_PCI_NAMES=y
-+# CONFIG_PCI_DEBUG is not set
- CONFIG_PCI_LBA=y
- CONFIG_IOSAPIC=y
- CONFIG_IOMMU_SBA=y
--CONFIG_SUPERIO=y
--CONFIG_CHASSIS_LCD_LED=y
--# CONFIG_PDC_CHASSIS is not set
- 
- #
- # PCCARD (PCMCIA/CardBus) support
-@@ -93,13 +97,17 @@
- # CONFIG_PCCARD is not set
- 
- #
--# PC-card bridges
-+# PCI Hotplug Support
- #
-+# CONFIG_HOTPLUG_PCI is not set
- 
- #
--# PCI Hotplug Support
-+# PA-RISC specific drivers
- #
--# CONFIG_HOTPLUG_PCI is not set
-+CONFIG_SUPERIO=y
-+CONFIG_CHASSIS_LCD_LED=y
-+# CONFIG_PDC_CHASSIS is not set
-+CONFIG_PDC_STABLE=y
- 
- #
- # Executable file formats
-@@ -141,6 +149,7 @@
- # CONFIG_BLK_CPQ_CISS_DA is not set
- # CONFIG_BLK_DEV_DAC960 is not set
- CONFIG_BLK_DEV_UMEM=m
-+# CONFIG_BLK_DEV_COW_COMMON is not set
- CONFIG_BLK_DEV_LOOP=y
- # CONFIG_BLK_DEV_CRYPTOLOOP is not set
- # CONFIG_BLK_DEV_NBD is not set
-@@ -158,6 +167,7 @@
- CONFIG_IOSCHED_AS=y
- CONFIG_IOSCHED_DEADLINE=y
- CONFIG_IOSCHED_CFQ=y
-+# CONFIG_ATA_OVER_ETH is not set
- 
- #
- # ATA/ATAPI/MFM/RLL support
-@@ -243,6 +253,7 @@
- #
- CONFIG_SCSI_SPI_ATTRS=y
- CONFIG_SCSI_FC_ATTRS=m
-+CONFIG_SCSI_ISCSI_ATTRS=m
- 
- #
- # SCSI low-level drivers
-@@ -264,6 +275,7 @@
- CONFIG_SCSI_ATA_PIIX=m
- # CONFIG_SCSI_SATA_NV is not set
- CONFIG_SCSI_SATA_PROMISE=m
-+# CONFIG_SCSI_SATA_QSTOR is not set
- # CONFIG_SCSI_SATA_SX4 is not set
- CONFIG_SCSI_SATA_SIL=m
- # CONFIG_SCSI_SATA_SIS is not set
-@@ -299,7 +311,7 @@
- CONFIG_SCSI_QLA2300=m
- CONFIG_SCSI_QLA2322=m
- CONFIG_SCSI_QLA6312=m
--CONFIG_SCSI_QLA6322=m
-+# CONFIG_SCSI_LPFC is not set
- # CONFIG_SCSI_DC395x is not set
- # CONFIG_SCSI_DC390T is not set
- # CONFIG_SCSI_NSP32 is not set
-@@ -323,6 +335,8 @@
- # CONFIG_DM_SNAPSHOT is not set
- # CONFIG_DM_MIRROR is not set
- # CONFIG_DM_ZERO is not set
-+CONFIG_DM_MULTIPATH=m
-+# CONFIG_DM_MULTIPATH_EMC is not set
- 
- #
- # Fusion MPT device support
-@@ -351,7 +365,6 @@
- #
- CONFIG_PACKET=y
- CONFIG_PACKET_MMAP=y
--CONFIG_NETLINK_DEV=y
- CONFIG_UNIX=y
- CONFIG_NET_KEY=m
- CONFIG_INET=y
-@@ -443,8 +456,6 @@
- CONFIG_IP_NF_ARPTABLES=m
- CONFIG_IP_NF_ARPFILTER=m
- CONFIG_IP_NF_ARP_MANGLE=m
--CONFIG_IP_NF_COMPAT_IPCHAINS=m
--CONFIG_IP_NF_COMPAT_IPFWADM=m
- CONFIG_XFRM=y
- CONFIG_XFRM_USER=m
- 
-@@ -486,7 +497,6 @@
- CONFIG_BONDING=m
- # CONFIG_EQUALIZER is not set
- CONFIG_TUN=m
--# CONFIG_ETHERTAP is not set
- 
- #
- # ARCnet devices
-@@ -524,9 +534,7 @@
- # CONFIG_FORCEDETH is not set
- # CONFIG_DGRS is not set
- CONFIG_EEPRO100=m
--# CONFIG_EEPRO100_PIO is not set
- CONFIG_E100=m
--# CONFIG_E100_NAPI is not set
- # CONFIG_FEALNX is not set
- CONFIG_NATSEMI=m
- # CONFIG_NE2K_PCI is not set
-@@ -622,16 +630,6 @@
- # CONFIG_INPUT_EVBUG is not set
- 
- #
--# Input I/O drivers
--#
--# CONFIG_GAMEPORT is not set
--CONFIG_SOUND_GAMEPORT=y
--CONFIG_SERIO=m
--CONFIG_SERIO_SERPORT=m
--# CONFIG_SERIO_PCIPS2 is not set
--# CONFIG_SERIO_RAW is not set
--
--#
- # Input Device Drivers
- #
- CONFIG_INPUT_KEYBOARD=y
-@@ -649,6 +647,17 @@
- # CONFIG_INPUT_MISC is not set
- 
- #
-+# Hardware I/O ports
-+#
-+CONFIG_SERIO=m
-+CONFIG_SERIO_SERPORT=m
-+# CONFIG_SERIO_PCIPS2 is not set
-+CONFIG_SERIO_LIBPS2=m
-+# CONFIG_SERIO_RAW is not set
-+# CONFIG_GAMEPORT is not set
-+CONFIG_SOUND_GAMEPORT=y
-+
-+#
- # Character devices
- #
- CONFIG_VT=y
-@@ -676,6 +685,7 @@
- # CONFIG_PDC_CONSOLE is not set
- CONFIG_SERIAL_CORE=y
- CONFIG_SERIAL_CORE_CONSOLE=y
-+# CONFIG_SERIAL_JSM is not set
- CONFIG_UNIX98_PTYS=y
- CONFIG_LEGACY_PTYS=y
- CONFIG_LEGACY_PTY_COUNT=256
-@@ -698,12 +708,16 @@
- #
- # Ftape, the floppy tape device driver
- #
--# CONFIG_AGP is not set
- # CONFIG_DRM is not set
- CONFIG_RAW_DRIVER=y
- CONFIG_MAX_RAW_DEVS=256
- 
- #
-+# TPM devices
-+#
-+# CONFIG_TCG_TPM is not set
-+
-+#
- # I2C support
- #
- # CONFIG_I2C is not set
-@@ -731,6 +745,11 @@
- # Graphics support
- #
- CONFIG_FB=y
-+CONFIG_FB_CFB_FILLRECT=y
-+CONFIG_FB_CFB_COPYAREA=y
-+CONFIG_FB_CFB_IMAGEBLIT=y
-+CONFIG_FB_SOFT_CURSOR=y
-+# CONFIG_FB_MACMODES is not set
- # CONFIG_FB_MODE_HELPERS is not set
- # CONFIG_FB_TILEBLITTING is not set
- # CONFIG_FB_CIRRUS is not set
-@@ -739,6 +758,7 @@
- # CONFIG_FB_ASILIANT is not set
- # CONFIG_FB_IMSTT is not set
- CONFIG_FB_STI=y
-+# CONFIG_FB_NVIDIA is not set
- # CONFIG_FB_RIVA is not set
- # CONFIG_FB_MATROX is not set
- # CONFIG_FB_RADEON_OLD is not set
-@@ -753,16 +773,17 @@
- # CONFIG_FB_VOODOO1 is not set
- # CONFIG_FB_TRIDENT is not set
- # CONFIG_FB_PM3 is not set
-+# CONFIG_FB_S1D13XXX is not set
- # CONFIG_FB_VIRTUAL is not set
- 
- #
- # Console display driver support
- #
--CONFIG_STI_CONSOLE=y
-+CONFIG_DUMMY_CONSOLE=y
- CONFIG_DUMMY_CONSOLE_COLUMNS=160
- CONFIG_DUMMY_CONSOLE_ROWS=64
--CONFIG_DUMMY_CONSOLE=y
- CONFIG_FRAMEBUFFER_CONSOLE=y
-+CONFIG_STI_CONSOLE=y
- # CONFIG_FONTS is not set
- CONFIG_FONT_8x8=y
- CONFIG_FONT_8x16=y
-@@ -775,6 +796,7 @@
- # CONFIG_LOGO_LINUX_VGA16 is not set
- # CONFIG_LOGO_LINUX_CLUT224 is not set
- CONFIG_LOGO_PARISC_CLUT224=y
-+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
- 
- #
- # Sound
-@@ -794,6 +816,8 @@
- #
- # USB support
- #
-+CONFIG_USB_ARCH_HAS_HCD=y
-+CONFIG_USB_ARCH_HAS_OHCI=y
- CONFIG_USB=y
- CONFIG_USB_DEBUG=y
- 
-@@ -804,14 +828,14 @@
- # CONFIG_USB_BANDWIDTH is not set
- # CONFIG_USB_DYNAMIC_MINORS is not set
- # CONFIG_USB_OTG is not set
--CONFIG_USB_ARCH_HAS_HCD=y
--CONFIG_USB_ARCH_HAS_OHCI=y
- 
- #
- # USB Host Controller Drivers
- #
- # CONFIG_USB_EHCI_HCD is not set
- CONFIG_USB_OHCI_HCD=y
-+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
-+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
- # CONFIG_USB_UHCI_HCD is not set
- # CONFIG_USB_SL811_HCD is not set
- 
-@@ -829,12 +853,11 @@
- #
- CONFIG_USB_STORAGE=m
- # CONFIG_USB_STORAGE_DEBUG is not set
--# CONFIG_USB_STORAGE_RW_DETECT is not set
- CONFIG_USB_STORAGE_DATAFAB=y
- CONFIG_USB_STORAGE_FREECOM=y
- # CONFIG_USB_STORAGE_ISD200 is not set
- CONFIG_USB_STORAGE_DPCM=y
--CONFIG_USB_STORAGE_HP8200e=y
-+CONFIG_USB_STORAGE_USBAT=y
- CONFIG_USB_STORAGE_SDDR09=y
- CONFIG_USB_STORAGE_SDDR55=y
- CONFIG_USB_STORAGE_JUMPSHOT=y
-@@ -860,7 +883,6 @@
- #
- CONFIG_USB_MDC800=m
- CONFIG_USB_MICROTEK=m
--CONFIG_USB_HPUSBSCSI=m
- 
- #
- # USB Multimedia devices
-@@ -879,6 +901,7 @@
- # CONFIG_USB_PEGASUS is not set
- # CONFIG_USB_RTL8150 is not set
- # CONFIG_USB_USBNET is not set
-+CONFIG_USB_MON=m
- 
- #
- # USB port drivers
-@@ -894,7 +917,6 @@
- #
- # CONFIG_USB_EMI62 is not set
- # CONFIG_USB_EMI26 is not set
--# CONFIG_USB_TIGL is not set
- # CONFIG_USB_AUERSWALD is not set
- # CONFIG_USB_RIO500 is not set
- CONFIG_USB_LEGOTOWER=m
-@@ -903,6 +925,7 @@
- # CONFIG_USB_CYTHERM is not set
- # CONFIG_USB_PHIDGETKIT is not set
- # CONFIG_USB_PHIDGETSERVO is not set
-+# CONFIG_USB_IDMOUSE is not set
- # CONFIG_USB_TEST is not set
- 
- #
-@@ -920,6 +943,15 @@
- # CONFIG_MMC is not set
- 
- #
-+# InfiniBand support
-+#
-+CONFIG_INFINIBAND=m
-+CONFIG_INFINIBAND_MTHCA=m
-+# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
-+CONFIG_INFINIBAND_IPOIB=m
-+# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
-+
-+#
- # File systems
- #
- CONFIG_EXT2_FS=y
-@@ -930,7 +962,12 @@
- # CONFIG_JBD_DEBUG is not set
- # CONFIG_REISERFS_FS is not set
- # CONFIG_JFS_FS is not set
-+
-+#
-+# XFS support
-+#
- CONFIG_XFS_FS=m
-+CONFIG_XFS_EXPORT=y
- # CONFIG_XFS_RT is not set
- # CONFIG_XFS_QUOTA is not set
- # CONFIG_XFS_SECURITY is not set
-@@ -1074,13 +1111,18 @@
- #
- # Kernel hacking
- #
-+# CONFIG_PRINTK_TIME is not set
- CONFIG_DEBUG_KERNEL=y
- CONFIG_MAGIC_SYSRQ=y
-+CONFIG_LOG_BUF_SHIFT=16
- # CONFIG_SCHEDSTATS is not set
- # CONFIG_DEBUG_SLAB is not set
- # CONFIG_DEBUG_SPINLOCK is not set
-+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
- # CONFIG_DEBUG_KOBJECT is not set
- # CONFIG_DEBUG_INFO is not set
-+# CONFIG_DEBUG_IOREMAP is not set
-+# CONFIG_DEBUG_FS is not set
- 
- #
- # Security options
-@@ -1100,6 +1142,7 @@
- CONFIG_CRYPTO_SHA256=m
- # CONFIG_CRYPTO_SHA512 is not set
- # CONFIG_CRYPTO_WP512 is not set
-+CONFIG_CRYPTO_TGR192=m
- CONFIG_CRYPTO_DES=m
- CONFIG_CRYPTO_BLOWFISH=m
- CONFIG_CRYPTO_TWOFISH=m
-@@ -1117,6 +1160,10 @@
- CONFIG_CRYPTO_TEST=m
- 
- #
-+# Hardware crypto devices
-+#
-+
-+#
- # Library routines
- #
- CONFIG_CRC_CCITT=m
-Index: linux-2.6-2.6.12/arch/parisc/kernel/entry.S
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/entry.S	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/entry.S	2005-08-09 17:53:35.000000000 -0400
-@@ -30,14 +30,14 @@
-  *  - save registers to kernel stack and handle in assembly or C */
- 
- 
-+#include <asm/psw.h>
- #include <asm/assembly.h>	/* for LDREG/STREG defines */
- #include <asm/pgtable.h>
--#include <asm/psw.h>
- #include <asm/signal.h>
- #include <asm/unistd.h>
- #include <asm/thread_info.h>
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- #define CMPIB           cmpib,*
- #define CMPB            cmpb,*
- #define COND(x)		*x
-@@ -67,19 +67,22 @@
- 
- 	/* Switch to virtual mapping, trashing only %r1 */
- 	.macro  virt_map
--	rsm     PSW_SM_Q,%r0
--	tovirt_r1 %r29
--	mfsp	%sr7, %r1
--	or,=    %r0,%r1,%r0 /* Only save sr7 in sr3 if sr7 != 0 */
--	mtsp	%r1, %sr3
-+	/* pcxt_ssm_bug */
-+	rsm	PSW_SM_I, %r0	/* barrier for "Relied upon Translation */
- 	mtsp	%r0, %sr4
- 	mtsp	%r0, %sr5
-+	mfsp	%sr7, %r1
-+	or,=    %r0,%r1,%r0	/* Only save sr7 in sr3 if sr7 != 0 */
-+	mtsp	%r1, %sr3
-+	tovirt_r1 %r29
-+	load32	KERNEL_PSW, %r1
-+
-+	rsm     PSW_SM_QUIET,%r0	/* second "heavy weight" ctl op */
- 	mtsp	%r0, %sr6
- 	mtsp	%r0, %sr7
--	load32	KERNEL_PSW, %r1
--	mtctl	%r1, %cr22
- 	mtctl	%r0, %cr17	/* Clear IIASQ tail */
- 	mtctl	%r0, %cr17	/* Clear IIASQ head */
-+	mtctl	%r1, %ipsw
- 	load32	4f, %r1
- 	mtctl	%r1, %cr18	/* Set IIAOQ tail */
- 	ldo	4(%r1), %r1
-@@ -214,7 +217,7 @@
- 	va  = r8	/* virtual address for which the trap occured */
- 	spc = r24	/* space for which the trap occured */
- 
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 
- 	/*
- 	 * itlb miss interruption handler (parisc 1.1 - 32 bit)
-@@ -236,7 +239,7 @@
- 
- 	.macro	itlb_20 code
- 	mfctl	%pcsq, spc
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	b       itlb_miss_20w
- #else
- 	b	itlb_miss_20
-@@ -246,7 +249,7 @@
- 	.align		32
- 	.endm
- 	
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 	/*
- 	 * naitlb miss interruption handler (parisc 1.1 - 32 bit)
- 	 *
-@@ -283,7 +286,7 @@
- 	.macro	naitlb_20 code
- 
- 	mfctl	%isr,spc
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	b       itlb_miss_20w
- #else
- 	b	itlb_miss_20
-@@ -296,7 +299,7 @@
- 	.align		32
- 	.endm
- 	
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 	/*
- 	 * dtlb miss interruption handler (parisc 1.1 - 32 bit)
- 	 */
-@@ -318,7 +321,7 @@
- 	.macro	dtlb_20 code
- 
- 	mfctl	%isr, spc
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	b       dtlb_miss_20w
- #else
- 	b	dtlb_miss_20
-@@ -328,7 +331,7 @@
- 	.align		32
- 	.endm
- 	
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 	/* nadtlb miss interruption handler (parisc 1.1 - 32 bit) */
- 
- 	.macro	nadtlb_11 code
-@@ -346,7 +349,7 @@
- 	.macro	nadtlb_20 code
- 
- 	mfctl	%isr,spc
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	b       nadtlb_miss_20w
- #else
- 	b       nadtlb_miss_20
-@@ -356,7 +359,7 @@
- 	.align		32
- 	.endm
- 	
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 	/*
- 	 * dirty bit trap interruption handler (parisc 1.1 - 32 bit)
- 	 */
-@@ -378,7 +381,7 @@
- 	.macro	dbit_20 code
- 
- 	mfctl	%isr,spc
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	b       dbit_trap_20w
- #else
- 	b	dbit_trap_20
-@@ -391,7 +394,7 @@
- 	/* The following are simple 32 vs 64 bit instruction
- 	 * abstractions for the macros */
- 	.macro		EXTR	reg1,start,length,reg2
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	extrd,u		\reg1,32+\start,\length,\reg2
- #else
- 	extrw,u		\reg1,\start,\length,\reg2
-@@ -399,7 +402,7 @@
- 	.endm
- 
- 	.macro		DEP	reg1,start,length,reg2
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depd		\reg1,32+\start,\length,\reg2
- #else
- 	depw		\reg1,\start,\length,\reg2
-@@ -407,7 +410,7 @@
- 	.endm
- 
- 	.macro		DEPI	val,start,length,reg
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi		\val,32+\start,\length,\reg
- #else
- 	depwi		\val,\start,\length,\reg
-@@ -418,7 +421,7 @@
- 	 * fault.  We have to extract this and place it in the va,
- 	 * zeroing the corresponding bits in the space register */
- 	.macro		space_adjust	spc,va,tmp
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	extrd,u		\spc,63,SPACEID_SHIFT,\tmp
- 	depd		%r0,63,SPACEID_SHIFT,\spc
- 	depd		\tmp,31,SPACEID_SHIFT,\va
-@@ -476,7 +479,7 @@
- 	bb,>=,n		\pmd,_PxD_PRESENT_BIT,\fault
- 	DEP		%r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */
- 	copy		\pmd,%r9
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	shld		%r9,PxD_VALUE_SHIFT,\pmd
- #else
- 	shlw		%r9,PxD_VALUE_SHIFT,\pmd
-@@ -607,7 +610,7 @@
- 	.macro		do_alias	spc,tmp,tmp1,va,pte,prot,fault
- 	cmpib,COND(<>),n 0,\spc,\fault
- 	ldil		L%(TMPALIAS_MAP_START),\tmp
--#if defined(__LP64__) && (TMPALIAS_MAP_START >= 0x80000000)
-+#if defined(CONFIG_64BIT) && (TMPALIAS_MAP_START >= 0x80000000)
- 	/* on LP64, ldi will sign extend into the upper 32 bits,
- 	 * which is behaviour we don't want */
- 	depdi		0,31,32,\tmp
-@@ -621,7 +624,7 @@
- 	 * OK, it is in the temp alias region, check whether "from" or "to".
- 	 * Check "subtle" note in pacache.S re: r23/r26.
- 	 */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	extrd,u,*=	\va,41,1,%r0
- #else
- 	extrw,u,=	\va,9,1,%r0
-@@ -688,7 +691,7 @@
- 	def		30
- 	def		31
- 
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 
- 	.export fault_vector_11
- 	
-@@ -761,7 +764,7 @@
- 
- 	copy	%r30, %r1
- 	ldo	PT_SZ_ALGN(%r30),%r30
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* Yo, function pointers in wide mode are little structs... -PB */
- 	ldd	24(%r26), %r2
- 	STREG	%r2, PT_GR27(%r1)	/* Store childs %dp */
-@@ -777,7 +780,7 @@
- 	or	%r26, %r24, %r26      /* will have kernel mappings.	 */
- 	ldi	1, %r25			/* stack_start, signals kernel thread */
- 	stw	%r0, -52(%r30)	     	/* user_tid */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #endif
- 	BL	do_fork, %r2
-@@ -806,7 +809,7 @@
- 
- 	LDREG	TI_TASK-THREAD_SZ_ALGN(%r30), %r1
- 	LDREG	TASK_PT_GR25(%r1), %r26
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	LDREG	TASK_PT_GR27(%r1), %r27
- 	LDREG	TASK_PT_GR22(%r1), %r22
- #endif
-@@ -814,11 +817,16 @@
- 	ble	0(%sr7, %r1)
- 	copy	%r31, %r2
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- 	loadgp				/* Thread could have been in a module */
- #endif
-+#ifndef CONFIG_64BIT
- 	b	sys_exit
-+#else
-+	load32	sys_exit, %r1
-+	bv	%r0(%r1)
-+#endif
- 	ldi	0, %r26
- 
- 	.import	sys_execve, code
-@@ -830,7 +838,7 @@
- 	STREG	%r26, PT_GR26(%r16)
- 	STREG	%r25, PT_GR25(%r16)
- 	STREG	%r24, PT_GR24(%r16)
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #endif
- 	BL	sys_execve, %r2
-@@ -888,9 +896,6 @@
- 	 * this way, then we will need to copy %sr3 in to PT_SR[3..7], and
- 	 * adjust IASQ[0..1].
- 	 *
--	 * Note that the following code uses a "relied upon translation".
--	 * See the parisc ACD for details. The ssm is necessary due to a
--	 * PCXT bug.
- 	 */
- 
- 	.align 4096
-@@ -911,7 +916,7 @@
- 	STREG	%r19,PT_IAOQ1(%r16)
- 	LDREG   PT_PSW(%r16),%r19
- 	load32	USER_PSW_MASK,%r1
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	load32	USER_PSW_HI_MASK,%r20
- 	depd    %r20,31,32,%r1
- #endif
-@@ -955,7 +960,7 @@
- 	/* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) amount
- 	** irq_stat[] is defined using ____cacheline_aligned.
- 	*/
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	shld	%r1, 6, %r20
- #else
- 	shlw	%r1, 5, %r20
-@@ -985,24 +990,19 @@
- 	rest_fp         %r1
- 	rest_general    %r29
- 
--	/* Create a "relied upon translation" PA 2.0 Arch. F-5 */
--	ssm		0,%r0
--	nop
--	nop
--	nop
--	nop
--	nop
--	nop
--	nop
-+	/* inverse of virt_map */
-+	pcxt_ssm_bug
-+	rsm             PSW_SM_QUIET,%r0	/* prepare for rfi */
- 	tophys_r1       %r29
--	rsm             (PSW_SM_Q|PSW_SM_P|PSW_SM_D|PSW_SM_I),%r0
- 
- 	/* Restore space id's and special cr's from PT_REGS
--	 * structure pointed to by r29 */
-+	 * structure pointed to by r29
-+	 */
- 	rest_specials	%r29
- 
--	/* Important: Note that rest_stack restores r29
--	 * last (we are using it)! It also restores r1 and r30. */
-+	/* IMPORTANT: rest_stack restores r29 last (we are using it)!
-+	 * It also restores r1 and r30.
-+	 */
- 	rest_stack
- 
- 	rfi
-@@ -1017,8 +1017,8 @@
- 
- 	.import do_softirq,code
- intr_do_softirq:
--	bl      do_softirq,%r2
--#ifdef __LP64__
-+	BL      do_softirq,%r2
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #else
- 	nop
-@@ -1036,12 +1036,17 @@
- 	CMPIB= 0,%r20,intr_restore /* backward */
- 	nop
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #endif
- 
- 	ldil	L%intr_check_sig, %r2
-+#ifndef CONFIG_64BIT
- 	b	schedule
-+#else
-+	load32	schedule, %r20
-+	bv	%r0(%r20)
-+#endif
- 	ldo	R%intr_check_sig(%r2), %r2
- 
- 
-@@ -1064,7 +1069,7 @@
- 
- 	copy	%r0, %r24			/* unsigned long in_syscall */
- 	copy	%r16, %r25			/* struct pt_regs *regs */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29			/* Reference param save area */
- #endif
- 
-@@ -1088,7 +1093,7 @@
- 	mfctl	%cr31,%r1
- 	copy	%r30,%r17
- 	/* FIXME! depi below has hardcoded idea of interrupt stack size (32k)*/
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi	0,63,15,%r17
- #else
- 	depi	0,31,15,%r17
-@@ -1115,7 +1120,7 @@
- 
- 	ldil	L%intr_return, %r2
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29	/* Reference param save area */
- #endif
- 
-@@ -1153,15 +1158,17 @@
- 
- 	CMPIB=,n        6,%r26,skip_save_ior
- 
--	/* save_specials left ipsw value in r8 for us to test */
- 
- 	mfctl           %cr20, %r16 /* isr */
-+	nop		/* serialize mfctl on PA 2.0 to avoid 4 cycle penalty */
- 	mfctl           %cr21, %r17 /* ior */
- 
--#ifdef __LP64__
-+
-+#ifdef CONFIG_64BIT
- 	/*
- 	 * If the interrupted code was running with W bit off (32 bit),
- 	 * clear the b bits (bits 0 & 1) in the ior.
-+	 * save_specials left ipsw value in r8 for us to test.
- 	 */
- 	extrd,u,*<>     %r8,PSW_W_BIT,1,%r0
- 	depdi           0,1,2,%r17
-@@ -1192,7 +1199,7 @@
- 	loadgp
- 
- 	copy		%r29, %r25	/* arg1 is pt_regs */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo		-16(%r30),%r29	/* Reference param save area */
- #endif
- 
-@@ -1230,7 +1237,7 @@
- 	spc  = r24	/* space for which the trap occured */
- 	ptp = r25	/* page directory/page table pointer */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 
- dtlb_miss_20w:
- 	space_adjust	spc,va,t0
-@@ -1487,10 +1494,10 @@
- 	add,l           %r1,%r24,%r1           /* doesn't affect c/b bits */
- 
- nadtlb_nullify:
--	mfctl           %cr22,%r8              /* Get ipsw */
-+	mfctl           %ipsw,%r8
- 	ldil            L%PSW_N,%r9
- 	or              %r8,%r9,%r8            /* Set PSW_N */
--	mtctl           %r8,%cr22
-+	mtctl           %r8,%ipsw
- 
- 	rfir
- 	nop
-@@ -1521,7 +1528,7 @@
- 	nop
- 
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- itlb_miss_20w:
- 
- 	/*
-@@ -1588,7 +1595,7 @@
- 
- #endif
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 
- dbit_trap_20w:
- 	space_adjust	spc,va,t0
-@@ -1797,7 +1804,7 @@
- 
- 	STREG	%r2,-RP_OFFSET(%r30)
- 	ldo	FRAME_SIZE(%r30),%r30
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #endif
- 
-@@ -1847,7 +1854,7 @@
- 
- 	STREG	%r2,-RP_OFFSET(%r30)
- 	ldo	FRAME_SIZE(%r30),%r30
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #endif
- 
-@@ -1869,7 +1876,7 @@
- 
- 	STREG	%r2,-RP_OFFSET(%r30)
- 	ldo	FRAME_SIZE(%r30),%r30
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #endif
- 
-@@ -1897,10 +1904,10 @@
- 
- 	STREG %r2,-RP_OFFSET(%r30)
- 	ldo FRAME_SIZE(%r30),%r30
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #endif
--	bl \execve,%r2
-+	BL \execve,%r2
- 	copy %r1,%arg0
- 
- 	ldo -FRAME_SIZE(%r30),%r30
-@@ -1923,7 +1930,7 @@
- sys_execve_wrapper:
- 	execve_wrapper sys_execve
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	.export sys32_execve_wrapper
- 	.import sys32_execve
- 
-@@ -1937,7 +1944,7 @@
- 	ldo	TASK_REGS(%r26),%r26	/* get pt regs */
- 	/* Don't save regs, we are going to restore them from sigcontext. */
- 	STREG	%r2, -RP_OFFSET(%r30)
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	FRAME_SIZE(%r30), %r30
- 	BL	sys_rt_sigreturn,%r2
- 	ldo	-16(%r30),%r29		/* Reference param save area */
-@@ -1968,7 +1975,7 @@
- 	ldo	TASK_REGS(%r1),%r24	/* get pt regs */
- 	LDREG	TASK_PT_GR30(%r24),%r24
- 	STREG	%r2, -RP_OFFSET(%r30)
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	FRAME_SIZE(%r30), %r30
- 	b,l	do_sigaltstack,%r2
- 	ldo	-16(%r30),%r29		/* Reference param save area */
-@@ -1982,7 +1989,7 @@
- 	bv	%r0(%r2)
- 	nop
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	.export sys32_sigaltstack_wrapper
- sys32_sigaltstack_wrapper:
- 	/* Get the user stack pointer */
-@@ -2006,7 +2013,7 @@
- 	reg_save %r24
- 
- 	STREG	%r2, -RP_OFFSET(%r30)
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	FRAME_SIZE(%r30), %r30
- 	b,l	sys_rt_sigsuspend,%r2
- 	ldo	-16(%r30),%r29		/* Reference param save area */
-@@ -2079,7 +2086,7 @@
- 	ldw     TI_CPU-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 /* cpu # */
- 
- 	/* shift left ____cacheline_aligned (aka L1_CACHE_BYTES) bits */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	shld	%r26, 6, %r20
- #else
- 	shlw	%r26, 5, %r20
-@@ -2144,7 +2151,7 @@
- 
- 	depi	3,31,2,%r31			   /* ensure return to user mode. */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* decide whether to reset the wide mode bit
- 	 *
- 	 * For a syscall, the W bit is stored in the lowest bit
-@@ -2229,7 +2236,7 @@
- 
- 	.import do_softirq,code
- syscall_do_softirq:
--	bl      do_softirq,%r2
-+	BL      do_softirq,%r2
- 	nop
- 	/* NOTE: We enable I-bit incase we schedule later,
- 	 * and we might be going back to userspace if we were
-@@ -2240,7 +2247,7 @@
- 	.import schedule,code
- syscall_do_resched:
- 	BL	schedule,%r2
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29		/* Reference param save area */
- #else
- 	nop
-@@ -2260,7 +2267,7 @@
- 
- 	ldi	1, %r24				/* unsigned long in_syscall */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29			/* Reference param save area */
- #endif
- 	BL	do_signal,%r2
-Index: linux-2.6-2.6.12/arch/parisc/kernel/head.S
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/head.S	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/head.S	2005-08-09 17:53:35.000000000 -0400
-@@ -12,7 +12,7 @@
-  * Initial Version 04-23-1999 by Helge Deller <deller at gmx.de>
-  */
- 
--#include <linux/autoconf.h>	/* for CONFIG_SMP */
-+#include <linux/config.h>	/* for CONFIG_SMP */
- 
- #include <asm/offsets.h>
- #include <asm/psw.h>
-@@ -36,10 +36,10 @@
- 	.align	4
- 	.import init_thread_union,data
- 	.import fault_vector_20,code    /* IVA parisc 2.0 32 bit */
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
-         .import fault_vector_11,code    /* IVA parisc 1.1 32 bit */
- 	.import	$global$		/* forward declaration */
--#endif /*!LP64*/
-+#endif /*!CONFIG_64BIT*/
- 	.export stext
- 	.export _stext,data		/* Kernel want it this way! */
- _stext:
-@@ -76,7 +76,7 @@
- 	mtctl		%r4,%cr24	/* Initialize kernel root pointer */
- 	mtctl		%r4,%cr25	/* Initialize user root pointer */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* Set pmd in pgd */
- 	load32		PA(pmd0),%r5
- 	shrd            %r5,PxD_VALUE_SHIFT,%r3	
-@@ -99,7 +99,7 @@
- 	stw		%r3,0(%r4)
- 	ldo		(ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
- 	addib,>		-1,%r1,1b
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo             ASM_PMD_ENTRY_SIZE(%r4),%r4
- #else
- 	ldo             ASM_PGD_ENTRY_SIZE(%r4),%r4
-@@ -170,7 +170,7 @@
- 	stw		%r0,0x28(%r0)	/* MEM_RENDEZ_HI */
- #endif /*CONFIG_SMP*/
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	tophys_r1	%sp
- 
- 	/* Save the rfi target address */
-@@ -224,8 +224,6 @@
- 	mtctl	%r0,%cr12
- 	mtctl	%r0,%cr13
- 
--	/* Prepare to RFI! Man all the cannons! */
--
- 	/* Initialize the global data pointer */
- 	loadgp
- 
-@@ -235,7 +233,7 @@
- 	 * following short sequence of instructions can determine this
- 	 * (without being illegal on a PA1.1 machine).
- 	 */
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 	ldi		32,%r10
- 	mtctl		%r10,%cr11
- 	.level 2.0
-@@ -248,52 +246,22 @@
- 
- $is_pa20:
- 	.level		LEVEL /* restore 1.1 || 2.0w */
--#endif /*!LP64*/
-+#endif /*!CONFIG_64BIT*/
- 	load32		PA(fault_vector_20),%r10
- 
- $install_iva:
- 	mtctl		%r10,%cr14
- 
--#ifdef __LP64__
--	b		aligned_rfi
-+	b		aligned_rfi  /* Prepare to RFI! Man all the cannons! */
- 	nop
- 
--	.align          256
-+	.align 128
- aligned_rfi:
--	ssm             0,0
--	nop             /* 1 */
--	nop             /* 2 */
--	nop             /* 3 */
--	nop             /* 4 */
--	nop             /* 5 */
--	nop             /* 6 */
--	nop             /* 7 */
--	nop             /* 8 */
--#endif
--
--#ifdef __LP64__ /* move to psw.h? */
--#define		PSW_BITS	PSW_Q+PSW_I+PSW_D+PSW_P+PSW_R
--#else
--#define		PSW_BITS	PSW_SM_Q
--#endif
-+	pcxt_ssm_bug
- 
--$rfi:	
--	/* turn off troublesome PSW bits */
--	rsm		PSW_BITS,%r0
--
--	/* kernel PSW:
--	 *  - no interruptions except HPMC and TOC (which are handled by PDC)
--	 *  - Q bit set (IODC / PDC interruptions)
--	 *  - big-endian
--	 *  - virtually mapped
--	 */
--	load32		KERNEL_PSW,%r10
--	mtctl		%r10,%ipsw
-+	rsm		PSW_SM_QUIET,%r0	/* off troublesome PSW bits */
-+	/* Don't need NOPs, have 8 compliant insn before rfi */
- 
--	/* Set the space pointers for the post-RFI world
--	** Clear the two-level IIA Space Queue, effectively setting
--	** Kernel space.
--	*/
- 	mtctl		%r0,%cr17	/* Clear IIASQ tail */
- 	mtctl		%r0,%cr17	/* Clear IIASQ head */
- 
-@@ -301,8 +269,11 @@
- 	mtctl		%r11,%cr18	/* IIAOQ head */
- 	ldo		4(%r11),%r11
- 	mtctl		%r11,%cr18	/* IIAOQ tail */
-+
-+	load32		KERNEL_PSW,%r10
-+	mtctl		%r10,%ipsw
- 	
--	/* Jump to hyperspace */
-+	/* Jump through hyperspace to Virt Mode */
- 	rfi
- 	nop
- 
-@@ -313,7 +284,7 @@
- 	.import smp_init_current_idle_task,data
- 	.import	smp_callin,code
- 
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- smp_callin_rtn:
-         .proc
- 	.callinfo
-@@ -321,7 +292,7 @@
- 	nop
- 	nop
-         .procend
--#endif /*!LP64*/
-+#endif /*!CONFIG_64BIT*/
- 
- /***************************************************************************
- * smp_slave_stext is executed by all non-monarch Processors when the Monarch
-@@ -356,7 +327,7 @@
- 	mtctl		%r4,%cr24	/* Initialize kernel root pointer */
- 	mtctl		%r4,%cr25	/* Initialize user root pointer */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* Setup PDCE_PROC entry */
- 	copy            %arg0,%r3
- #else
-@@ -373,7 +344,7 @@
- 
- 	.procend
- #endif /* CONFIG_SMP */
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 	.data
- 
- 	.align	4
-@@ -383,4 +354,4 @@
- 	.size	$global$,4
- $global$:	
- 	.word 0
--#endif /*!LP64*/
-+#endif /*!CONFIG_64BIT*/
-Index: linux-2.6-2.6.12/arch/parisc/kernel/ioctl32.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/ioctl32.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/ioctl32.c	2005-08-09 17:53:35.000000000 -0400
-@@ -104,12 +104,9 @@
- 	}
- 
- out:
--	if (kversion.name)
--		kfree(kversion.name);
--	if (kversion.date)
--		kfree(kversion.date);
--	if (kversion.desc)
--		kfree(kversion.desc);
-+	kfree(kversion.name);
-+	kfree(kversion.date);
-+	kfree(kversion.desc);
- 	return ret;
- }
- 
-@@ -166,9 +163,7 @@
- 			ret = -EFAULT;
- 	}
- 
--	if (karg.unique != NULL)
--		kfree(karg.unique);
--
-+	kfree(karg.unique);
- 	return ret;
- }
- 
-@@ -265,7 +260,6 @@
- 	}
- 
- 	kfree(karg.list);
--
- 	return ret;
- }
- 
-@@ -305,7 +299,6 @@
- 
- out:
- 	kfree(karg.list);
--
- 	return ret;
- }
- 
-@@ -494,15 +487,10 @@
- 	}
- 
- out:
--	if (karg.send_indices)
--		kfree(karg.send_indices);
--	if (karg.send_sizes)
--		kfree(karg.send_sizes);
--	if (karg.request_indices)
--		kfree(karg.request_indices);
--	if (karg.request_sizes)
--		kfree(karg.request_sizes);
--
-+	kfree(karg.send_indices);
-+	kfree(karg.send_sizes);
-+	kfree(karg.request_indices);
-+	kfree(karg.request_sizes);
- 	return ret;
- }
- 
-@@ -555,9 +543,7 @@
- 			ret = -EFAULT;
- 	}
- 
--	if (karg.contexts)
--		kfree(karg.contexts);
--
-+	kfree(karg.contexts);
- 	return ret;
- }
- 
-Index: linux-2.6-2.6.12/arch/parisc/kernel/pacache.S
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/pacache.S	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/pacache.S	2005-08-09 17:53:35.000000000 -0400
-@@ -26,7 +26,7 @@
-  *       can be used.
-  */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- #define ADDIB	addib,*
- #define CMPB	cmpb,*
- #define ANDCM	andcm,*
-@@ -40,8 +40,10 @@
- 	.level	2.0
- #endif
- 
--#include <asm/assembly.h>
-+#include <linux/config.h>
-+
- #include <asm/psw.h>
-+#include <asm/assembly.h>
- #include <asm/pgtable.h>
- #include <asm/cache.h>
- 
-@@ -62,32 +64,23 @@
- 	 * to happen in real mode with all interruptions disabled.
- 	 */
- 
--	/*
--	 * Once again, we do the rfi dance ... some day we need examine
--	 * all of our uses of this type of code and see what can be
--	 * consolidated.
--	 */
--
--	rsm		PSW_SM_I, %r19		/* relied upon translation! PA 2.0 Arch. F-5 */
-+	/* pcxt_ssm_bug	- relied upon translation! PA 2.0 Arch. F-4 and F-5 */
-+	rsm	PSW_SM_I, %r19		/* save I-bit state */
-+	load32		PA(1f), %r1
- 	nop
- 	nop
- 	nop
- 	nop
- 	nop
--	nop
--	nop
--	
--	rsm		PSW_SM_Q, %r0		/* Turn off Q bit to load iia queue */
--	ldil		L%REAL_MODE_PSW, %r1
--	ldo		R%REAL_MODE_PSW(%r1), %r1
--	mtctl		%r1, %cr22
-+
-+	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */
- 	mtctl		%r0, %cr17		/* Clear IIASQ tail */
- 	mtctl		%r0, %cr17		/* Clear IIASQ head */
--	ldil		L%PA(1f), %r1
--	ldo		R%PA(1f)(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ head */
- 	ldo		4(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ tail */
-+	load32		REAL_MODE_PSW, %r1
-+	mtctl           %r1, %ipsw
- 	rfi
- 	nop
- 
-@@ -178,29 +171,36 @@
- 	ADDIB>		-1, %r22, fdtoneloop	/* Outer loop count decr */
- 	add		%r21, %r20, %r20	/* increment space */
- 
--fdtdone:
- 
--	/* Switch back to virtual mode */
-+fdtdone:
-+	/*
-+	 * Switch back to virtual mode
-+	 */
-+	/* pcxt_ssm_bug */
-+	rsm		PSW_SM_I, %r0
-+	load32		2f, %r1
-+	nop
-+	nop
-+	nop
-+	nop
-+	nop
- 
--	rsm		PSW_SM_Q, %r0		/* clear Q bit to load iia queue */
--	ldil		L%KERNEL_PSW, %r1
--	ldo		R%KERNEL_PSW(%r1), %r1
--	or		%r1, %r19, %r1		/* Set I bit if set on entry */
--	mtctl		%r1, %cr22
-+	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */
- 	mtctl		%r0, %cr17		/* Clear IIASQ tail */
- 	mtctl		%r0, %cr17		/* Clear IIASQ head */
--	ldil		L%(2f), %r1
--	ldo		R%(2f)(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ head */
- 	ldo		4(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ tail */
-+	load32		KERNEL_PSW, %r1
-+	or		%r1, %r19, %r1	/* I-bit to state on entry */
-+	mtctl		%r1, %ipsw	/* restore I-bit (entire PSW) */
- 	rfi
- 	nop
- 
- 2:      bv		%r0(%r2)
- 	nop
--	.exit
- 
-+	.exit
- 	.procend
- 
- 	.export flush_instruction_cache_local,code
-@@ -238,7 +238,7 @@
- 
- fisync:
- 	sync
--	mtsm		%r22
-+	mtsm		%r22			/* restore I-bit */
- 	bv		%r0(%r2)
- 	nop
- 	.exit
-@@ -281,7 +281,7 @@
- fdsync:
- 	syncdma
- 	sync
--	mtsm		%r22
-+	mtsm		%r22			/* restore I-bit */
- 	bv		%r0(%r2)
- 	nop
- 	.exit
-@@ -296,7 +296,7 @@
- 	.callinfo NO_CALLS
- 	.entry
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* PA8x00 CPUs can consume 2 loads or 1 store per cycle.
- 	 * Unroll the loop by hand and arrange insn appropriately.
- 	 * GCC probably can do this just as well.
-@@ -351,7 +351,11 @@
- 	std		%r22, 120(%r26)
- 	ldo		128(%r26), %r26
- 
--	ADDIB>		-1, %r1, 1b		/* bundle 10 */
-+	/* conditional branches nullify on forward taken branch, and on
-+	 * non-taken backward branch. Note that .+4 is a backwards branch.
-+	 * The ldd should only get executed if the branch is taken.
-+	 */
-+	ADDIB>,n	-1, %r1, 1b		/* bundle 10 */
- 	ldd		0(%r25), %r19		/* start next loads */
- 
- #else
-@@ -363,10 +367,10 @@
- 	 * the full 64 bit register values on interrupt, we can't
- 	 * use ldd/std on a 32 bit kernel.
- 	 */
-+	ldw		0(%r25), %r19
- 	ldi		64, %r1		/* PAGE_SIZE/64 == 64 */
- 
- 1:
--	ldw		0(%r25), %r19
- 	ldw		4(%r25), %r20
- 	ldw		8(%r25), %r21
- 	ldw		12(%r25), %r22
-@@ -396,11 +400,12 @@
- 	ldw		60(%r25), %r22
- 	stw		%r19, 48(%r26)
- 	stw		%r20, 52(%r26)
-+	ldo		64(%r25), %r25
- 	stw		%r21, 56(%r26)
- 	stw		%r22, 60(%r26)
- 	ldo		64(%r26), %r26
--	ADDIB>		-1, %r1, 1b
--	ldo		64(%r25), %r25
-+	ADDIB>,n	-1, %r1, 1b
-+	ldw		0(%r25), %r19
- #endif
- 	bv		%r0(%r2)
- 	nop
-@@ -456,7 +461,7 @@
- 	sub		%r25, %r1, %r23		/* move physical addr into non shadowed reg */
- 
- 	ldil		L%(TMPALIAS_MAP_START), %r28
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	extrd,u		%r26,56,32, %r26		/* convert phys addr to tlb insert format */
- 	extrd,u		%r23,56,32, %r23		/* convert phys addr to tlb insert format */
- 	depd		%r24,63,22, %r28		/* Form aliased virtual address 'to' */
-@@ -543,7 +548,7 @@
- 	tophys_r1	%r26
- 
- 	ldil		L%(TMPALIAS_MAP_START), %r28
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- #if (TMPALIAS_MAP_START >= 0x80000000)
- 	depdi		0, 31,32, %r28		/* clear any sign extension */
- #endif
-@@ -560,7 +565,7 @@
- 
- 	pdtlb		0(%r28)
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldi		32, %r1			/* PAGE_SIZE/128 == 32 */
- 
- 	/* PREFETCH (Write) has not (yet) been proven to help here */
-@@ -585,7 +590,7 @@
- 	ADDIB>		-1, %r1, 1b
- 	ldo		128(%r28), %r28
- 
--#else	/* ! __LP64 */
-+#else	/* ! CONFIG_64BIT */
- 
- 	ldi		64, %r1			/* PAGE_SIZE/64 == 64 */
- 
-@@ -608,7 +613,7 @@
- 	stw		%r0, 60(%r28)
- 	ADDIB>		-1, %r1, 1b
- 	ldo		64(%r28), %r28
--#endif	/* __LP64 */
-+#endif	/* CONFIG_64BIT */
- 
- 	bv		%r0(%r2)
- 	nop
-@@ -626,7 +631,7 @@
- 	ldil		L%dcache_stride, %r1
- 	ldw		R%dcache_stride(%r1), %r23
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi,z		1, 63-PAGE_SHIFT,1, %r25
- #else
- 	depwi,z		1, 31-PAGE_SHIFT,1, %r25
-@@ -670,7 +675,7 @@
- 	ldil		L%dcache_stride, %r1
- 	ldw		R%dcache_stride(%r1), %r23
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi,z		1,63-PAGE_SHIFT,1, %r25
- #else
- 	depwi,z		1,31-PAGE_SHIFT,1, %r25
-@@ -714,7 +719,7 @@
- 	ldil		L%dcache_stride, %r1
- 	ldw		R%dcache_stride(%r1), %r23
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi,z		1, 63-PAGE_SHIFT,1, %r25
- #else
- 	depwi,z		1, 31-PAGE_SHIFT,1, %r25
-@@ -759,7 +764,7 @@
- 	ldil		L%dcache_stride, %r1
- 	ldw		R%dcache_stride(%r1), %r23
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi,z		1, 63-PAGE_SHIFT,1, %r25
- #else
- 	depwi,z		1, 31-PAGE_SHIFT,1, %r25
-@@ -807,7 +812,7 @@
- 	tophys_r1		%r26
- 
- 	ldil		L%(TMPALIAS_MAP_START), %r28
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	extrd,u		%r26, 56,32, %r26	/* convert phys addr to tlb insert format */
- 	depd		%r25, 63,22, %r28	/* Form aliased virtual address 'to' */
- 	depdi		0, 63,12, %r28		/* Clear any offset bits */
-@@ -824,7 +829,7 @@
- 	ldil		L%dcache_stride, %r1
- 	ldw		R%dcache_stride(%r1), %r23
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi,z		1, 63-PAGE_SHIFT,1, %r29
- #else
- 	depwi,z		1, 31-PAGE_SHIFT,1, %r29
-@@ -935,7 +940,7 @@
- 	ldil		L%icache_stride, %r1
- 	ldw		R%icache_stride(%r1), %r23
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	depdi,z		1, 63-PAGE_SHIFT,1, %r25
- #else
- 	depwi,z		1, 31-PAGE_SHIFT,1, %r25
-@@ -988,11 +993,12 @@
- 	bv		%r0(%r2)
- 	nop
- 	.exit
--
- 	.procend
- 
--	.align	128
--
-+	/* align should cover use of rfi in disable_sr_hashing_asm and
-+	 * srdis_done.
-+	 */
-+	.align	256
- 	.export disable_sr_hashing_asm,code
- 
- disable_sr_hashing_asm:
-@@ -1000,28 +1006,26 @@
- 	.callinfo NO_CALLS
- 	.entry
- 
--	/* Switch to real mode */
--
--	ssm		0, %r0			/* relied upon translation! */
--	nop
--	nop
-+	/*
-+	 * Switch to real mode
-+	 */
-+	/* pcxt_ssm_bug */
-+	rsm		PSW_SM_I, %r0
-+	load32		PA(1f), %r1
- 	nop
- 	nop
- 	nop
- 	nop
- 	nop
--	
--	rsm		(PSW_SM_Q|PSW_SM_I), %r0 /* disable Q&I to load the iia queue */
--	ldil		L%REAL_MODE_PSW, %r1
--	ldo		R%REAL_MODE_PSW(%r1), %r1
--	mtctl		%r1, %cr22
-+
-+	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */
- 	mtctl		%r0, %cr17		/* Clear IIASQ tail */
- 	mtctl		%r0, %cr17		/* Clear IIASQ head */
--	ldil		L%PA(1f), %r1
--	ldo		R%PA(1f)(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ head */
- 	ldo		4(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ tail */
-+	load32		REAL_MODE_PSW, %r1
-+	mtctl		%r1, %ipsw
- 	rfi
- 	nop
- 
-@@ -1053,27 +1057,31 @@
- 
- srdis_pa20:
- 
--	/* Disable Space Register Hashing for PCXU,PCXU+,PCXW,PCXW+ */
-+	/* Disable Space Register Hashing for PCXU,PCXU+,PCXW,PCXW+,PCXW2 */
- 
- 	.word		0x144008bc		/* mfdiag %dr2, %r28 */
- 	depdi		0, 54,1, %r28		/* clear DIAG_SPHASH_ENAB (bit 54) */
- 	.word		0x145c1840		/* mtdiag %r28, %dr2 */
- 
--srdis_done:
- 
-+srdis_done:
- 	/* Switch back to virtual mode */
-+	rsm		PSW_SM_I, %r0		/* prep to load iia queue */
-+	load32 	   	2f, %r1
-+	nop
-+	nop
-+	nop
-+	nop
-+	nop
- 
--	rsm		PSW_SM_Q, %r0		/* clear Q bit to load iia queue */
--	ldil		L%KERNEL_PSW, %r1
--	ldo		R%KERNEL_PSW(%r1), %r1
--	mtctl		%r1, %cr22
-+	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */
- 	mtctl		%r0, %cr17		/* Clear IIASQ tail */
- 	mtctl		%r0, %cr17		/* Clear IIASQ head */
--	ldil 	   	L%(2f), %r1
--	ldo     	R%(2f)(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ head */
- 	ldo		4(%r1), %r1
- 	mtctl		%r1, %cr18		/* IIAOQ tail */
-+	load32		KERNEL_PSW, %r1
-+	mtctl		%r1, %ipsw
- 	rfi
- 	nop
- 
-Index: linux-2.6-2.6.12/arch/parisc/kernel/pci-dma.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/pci-dma.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/pci-dma.c	2005-08-09 17:53:35.000000000 -0400
-@@ -31,7 +31,7 @@
- #include <asm/page.h>	/* get_order */
- #include <asm/pgalloc.h>
- #include <asm/uaccess.h>
--
-+#include <asm/tlbflush.h>	/* for purge_tlb_*() macros */
- 
- static struct proc_dir_entry * proc_gsc_root = NULL;
- static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length);
-Index: linux-2.6-2.6.12/arch/parisc/kernel/pci.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/pci.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/pci.c	2005-08-09 17:53:35.000000000 -0400
-@@ -202,7 +202,8 @@
- pcibios_link_hba_resources( struct resource *hba_res, struct resource *r)
- {
- 	if (!r->parent) {
--		printk(KERN_EMERG "PCI: Tell willy he's wrong\n");
-+		printk(KERN_EMERG "PCI: resource not parented! [%lx-%lx]\n",
-+				r->start, r->end);
- 		r->parent = hba_res;
- 
- 		/* reverse link is harder *sigh*  */
-Index: linux-2.6-2.6.12/arch/parisc/kernel/pdc_cons.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/pdc_cons.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/pdc_cons.c	2005-08-09 17:53:35.000000000 -0400
-@@ -41,7 +41,7 @@
- 
- /* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems. 
-  * On production kernels EARLY_BOOTUP_DEBUG should be undefined. */
--#undef EARLY_BOOTUP_DEBUG
-+#define EARLY_BOOTUP_DEBUG
- 
- 
- #include <linux/config.h>
-@@ -49,14 +49,8 @@
- #include <linux/console.h>
- #include <linux/string.h>
- #include <linux/init.h>
--#include <linux/delay.h>
--#include <linux/sched.h>
--#include <linux/interrupt.h>
- #include <linux/major.h>
- #include <linux/tty.h>
--#include <asm/page.h>
--#include <asm/types.h>
--#include <asm/system.h>
- #include <asm/pdc.h>		/* for iodc_call() proto and friends */
- 
- 
-@@ -96,7 +90,6 @@
- }
- 
- #if defined(CONFIG_PDC_CONSOLE)
--#define PDC_CONSOLE_DEVICE pdc_console_device
- static struct tty_driver * pdc_console_device (struct console *c, int *index)
- {
- 	extern struct tty_driver console_driver;
-@@ -104,22 +97,19 @@
- 	return &console_driver;
- }
- #else
--#define PDC_CONSOLE_DEVICE NULL
-+#define pdc_console_device NULL
- #endif
- 
- static struct console pdc_cons = {
- 	.name =		"ttyB",
- 	.write =	pdc_console_write,
--	.device =	PDC_CONSOLE_DEVICE,
-+	.device =	pdc_console_device,
- 	.setup =	pdc_console_setup,
--	.flags =	CON_BOOT|CON_PRINTBUFFER|CON_ENABLED,
-+	.flags =	CON_BOOT | CON_PRINTBUFFER | CON_ENABLED,
- 	.index =	-1,
- };
- 
- static int pdc_console_initialized;
--extern unsigned long con_start;	/* kernel/printk.c */
--extern unsigned long log_end;	/* kernel/printk.c */
--
- 
- static void pdc_console_init_force(void)
- {
-@@ -146,27 +136,11 @@
- }
- 
- 
--/* Unregister the pdc console with the printk console layer */
--void pdc_console_die(void)
--{
--	if (!pdc_console_initialized)
--		return;
--	--pdc_console_initialized;
--
--	printk(KERN_INFO "Switching from PDC console\n");
--
--	/* Don't repeat what we've already printed */
--	con_start = log_end;
--
--	unregister_console(&pdc_cons);
--}
--
--
- /*
-  * Used for emergencies. Currently only used if an HPMC occurs. If an
-  * HPMC occurs, it is possible that the current console may not be
-- * properly initialed after the PDC IO reset. This routine unregisters all
-- * of the current consoles, reinitializes the pdc console and
-+ * properly initialised after the PDC IO reset. This routine unregisters
-+ * all of the current consoles, reinitializes the pdc console and
-  * registers it.
-  */
- 
-@@ -177,13 +151,13 @@
- 	if (pdc_console_initialized)
- 		return;
- 
-+	/* If we've already seen the output, don't bother to print it again */
-+	if (console_drivers != NULL)
-+		pdc_cons.flags &= ~CON_PRINTBUFFER;
-+
- 	while ((console = console_drivers) != NULL)
- 		unregister_console(console_drivers);
- 
--	/* Don't repeat what we've already printed */
--	con_start = log_end;
--	
- 	/* force registering the pdc console */
- 	pdc_console_init_force();
- }
--
-Index: linux-2.6-2.6.12/arch/parisc/kernel/perf.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/perf.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/perf.c	2005-08-09 17:53:35.000000000 -0400
-@@ -746,7 +746,8 @@
- 	uint64_t *bptr;
- 	uint32_t dwords;
- 	uint32_t *intrigue_rdr;
--	uint64_t *intrigue_bitmask, tmp64, proc_hpa;
-+	uint64_t *intrigue_bitmask, tmp64;
-+	void __iomem *runway;
- 	struct rdr_tbl_ent *tentry;
- 	int i;
- 
-@@ -798,15 +799,16 @@
- 		return -1;
- 	}
- 
--	proc_hpa = cpu_device->hpa;
-+	runway = ioremap(cpu_device->hpa, 4096);
- 
- 	/* Merge intrigue bits into Runway STATUS 0 */
--	tmp64 = __raw_readq(proc_hpa + RUNWAY_STATUS) & 0xffecfffffffffffful;
--	__raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul), proc_hpa + RUNWAY_STATUS);
-+	tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful;
-+	__raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul), 
-+		     runway + RUNWAY_STATUS);
- 	
- 	/* Write RUNWAY DEBUG registers */
- 	for (i = 0; i < 8; i++) {
--		__raw_writeq(*memaddr++, proc_hpa + RUNWAY_DEBUG + i);
-+		__raw_writeq(*memaddr++, runway + RUNWAY_DEBUG);
- 	}
- 
- 	return 0; 
-Index: linux-2.6-2.6.12/arch/parisc/kernel/process.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/process.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/process.c	2005-08-09 17:53:35.000000000 -0400
-@@ -9,7 +9,7 @@
-  *    Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
-  *    Copyright (C) 2000 Philipp Rumpf <prumpf with tux.org>
-  *    Copyright (C) 2000 David Kennedy <dkennedy with linuxcare.com>
-- *    Copyright (C) 2000 Richard Hirst <rhirst with parisc-lixux.org>
-+ *    Copyright (C) 2000 Richard Hirst <rhirst with parisc-linux.org>
-  *    Copyright (C) 2000 Grant Grundler <grundler with parisc-linux.org>
-  *    Copyright (C) 2001 Alan Modra <amodra at parisc-linux.org>
-  *    Copyright (C) 2001-2002 Ryan Bradetich <rbrad at parisc-linux.org>
-Index: linux-2.6-2.6.12/arch/parisc/kernel/real2.S
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/real2.S	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/real2.S	2005-08-09 17:53:35.000000000 -0400
-@@ -7,8 +7,10 @@
-  * Copyright (C) 2000 Hewlett Packard (Paul Bame bame at puffin.external.hp.com)
-  *
-  */
--#include <asm/assembly.h>
-+#include <linux/config.h>
-+
- #include <asm/psw.h>
-+#include <asm/assembly.h>
- 
- 	.section	.bss
- 	.export real_stack
-@@ -20,7 +22,7 @@
- real64_stack:
- 	.block	8192
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- #  define REG_SZ 8
- #else
- #  define REG_SZ 4
-@@ -50,7 +52,7 @@
- 
- real32_call_asm:
- 	STREG	%rp, -RP_OFFSET(%sp)	/* save RP */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	callee_save
- 	ldo	2*REG_SZ(%sp), %sp	/* room for a couple more saves */
- 	STREG	%r27, -1*REG_SZ(%sp)
-@@ -77,7 +79,7 @@
- 	b,l	save_control_regs,%r2		/* modifies r1, r2, r28 */
- 	nop
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	rsm	PSW_SM_W, %r0		/* go narrow */
- #endif
- 
-@@ -85,7 +87,7 @@
- 	bv	0(%r31)
- 	nop
- ric_ret:
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ssm	PSW_SM_W, %r0		/* go wide */
- #endif
- 	/* restore CRs before going virtual in case we page fault */
-@@ -97,7 +99,7 @@
- 
- 	tovirt_r1 %sp
- 	LDREG	-REG_SZ(%sp), %sp	/* restore SP */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	LDREG	-1*REG_SZ(%sp), %r27
- 	LDREG	-2*REG_SZ(%sp), %r29
- 	ldo	-2*REG_SZ(%sp), %sp
-@@ -143,24 +145,21 @@
- /* rfi_virt2real() and rfi_real2virt() could perhaps be adapted for
-  * more general-purpose use by the several places which need RFIs
-  */
--	.align 128
- 	.text
-+	.align 128
- rfi_virt2real:
- 	/* switch to real mode... */
--	ssm		0,0		/* See "relied upon translation" */
--	nop				/* PA 2.0 Arch. F-5 */
--	nop
--	nop
-+	rsm		PSW_SM_I,%r0
-+	load32		PA(rfi_v2r_1), %r1
- 	nop
- 	nop
- 	nop
- 	nop
- 	nop
- 	
--	rsm             (PSW_SM_Q|PSW_SM_I),%r0  /* disable Q & I bits to load iia queue */
-+	rsm             PSW_SM_Q,%r0  /* disable Q & I bits to load iia queue */
- 	mtctl		%r0, %cr17	/* Clear IIASQ tail */
- 	mtctl		%r0, %cr17	/* Clear IIASQ head */
--	load32		PA(rfi_v2r_1), %r1
- 	mtctl		%r1, %cr18	/* IIAOQ head */
- 	ldo		4(%r1), %r1
- 	mtctl		%r1, %cr18	/* IIAOQ tail */
-@@ -184,10 +183,8 @@
- 	.text
- 	.align 128
- rfi_real2virt:
--	ssm		0,0		/* See "relied upon translation" */
--	nop				/* PA 2.0 Arch. F-5 */
--	nop
--	nop
-+	rsm		PSW_SM_I,%r0
-+	load32		(rfi_r2v_1), %r1
- 	nop
- 	nop
- 	nop
-@@ -197,7 +194,6 @@
- 	rsm             PSW_SM_Q,%r0    /* disable Q bit to load iia queue */
- 	mtctl		%r0, %cr17	/* Clear IIASQ tail */
- 	mtctl		%r0, %cr17	/* Clear IIASQ head */
--	load32		(rfi_r2v_1), %r1
- 	mtctl		%r1, %cr18	/* IIAOQ head */
- 	ldo		4(%r1), %r1
- 	mtctl		%r1, %cr18	/* IIAOQ tail */
-@@ -218,7 +214,7 @@
- 	bv	0(%r2)
- 	nop
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 
- /************************ 64-bit real-mode calls ***********************/
- /* This is only usable in wide kernels right now and will probably stay so */
-@@ -296,7 +292,7 @@
- 	**	comparing function pointers.
- 	*/
- __canonicalize_funcptr_for_compare:
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	bve (%r2)
- #else
- 	bv %r0(%r2)
-Index: linux-2.6-2.6.12/arch/parisc/kernel/signal.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/signal.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/signal.c	2005-08-09 17:53:35.000000000 -0400
-@@ -637,6 +637,7 @@
- 			/* Stack is 64-byte aligned, and we only 
- 			 * need to flush 1 cache line */
- 			asm("fdc 0(%%sr3, %0)\n"
-+			    "sync\n"
- 			    "fic 0(%%sr3, %0)\n"
- 			    "sync\n"
- 			    : : "r"(regs->gr[30]));
-Index: linux-2.6-2.6.12/arch/parisc/kernel/smp.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/smp.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/smp.c	2005-08-09 17:53:35.000000000 -0400
-@@ -18,7 +18,7 @@
- */
- #undef ENTRY_SYS_CPUS	/* syscall support for iCOD-like functionality */
- 
--#include <linux/autoconf.h>
-+#include <linux/config.h>
- 
- #include <linux/types.h>
- #include <linux/spinlock.h>
-Index: linux-2.6-2.6.12/arch/parisc/kernel/syscall.S
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/syscall.S	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/syscall.S	2005-08-09 17:53:35.000000000 -0400
-@@ -4,8 +4,9 @@
-  * System call entry code Copyright (c) Matthew Wilcox 1999 <willy at bofh.ai>
-  * Licensed under the GNU GPL.
-  * thanks to Philipp Rumpf, Mike Shaver and various others
-- * sorry about the wall, puffin..
-+ * sorry about the wall, puffin.
-  */
-+#include <linux/config.h> /* for CONFIG_SMP */
- 
- #include <asm/offsets.h>
- #include <asm/unistd.h>
-@@ -22,15 +23,13 @@
- 	 */
- #define KILL_INSN	break	0,0
- 
--#include <linux/config.h> /* for CONFIG_SMP */
--
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	.level          2.0w
- #else
- 	.level		1.1
- #endif
- 
--#ifndef __LP64__
-+#ifndef CONFIG_64BIT
- 	.macro fixup_branch,lbl
- 	b	    \lbl
- 	.endm
-@@ -103,7 +102,7 @@
- 	mfsp    %sr7,%r1                        /* save user sr7 */
- 	mtsp    %r1,%sr3                        /* and store it in sr3 */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* for now we can *always* set the W bit on entry to the syscall
- 	 * since we don't support wide userland processes.  We could
- 	 * also save the current SM other than in r0 and restore it on
-@@ -155,7 +154,7 @@
- 	STREG	%r19, TASK_PT_GR19(%r1)
- 
- 	LDREGM	-FRAME_SIZE(%r30), %r2		/* get users sp back */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	extrd,u	%r2,63,1,%r19			/* W hidden in bottom bit */
- #if 0
- 	xor	%r19,%r2,%r2			/* clear bottom bit */
-@@ -186,7 +185,7 @@
- 
- 	loadgp
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29			/* Reference param save area */
- 	copy	%r19,%r2			/* W bit back to r2 */
- #else
-@@ -205,7 +204,7 @@
- 	/* Note!  We cannot use the syscall table that is mapped
- 	nearby since the gateway page is mapped execute-only. */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldil	L%sys_call_table, %r1
- 	or,=	%r2,%r2,%r2
- 	addil	L%(sys_call_table64-sys_call_table), %r1
-@@ -321,7 +320,7 @@
- 	LDREG   TASK_PT_GR25(%r1), %r25
- 	LDREG   TASK_PT_GR24(%r1), %r24
- 	LDREG   TASK_PT_GR23(%r1), %r23
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	LDREG   TASK_PT_GR22(%r1), %r22
- 	LDREG   TASK_PT_GR21(%r1), %r21
- 	ldo	-16(%r30),%r29			/* Reference param save area */
-@@ -350,7 +349,7 @@
- tracesys_exit:
- 	ldo     -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1      /* get task ptr */
- 	LDREG	TI_TASK(%r1), %r1
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29			/* Reference param save area */
- #endif
- 	bl	syscall_trace, %r2
-@@ -371,7 +370,7 @@
- tracesys_sigexit:
- 	ldo     -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1      /* get task ptr */
- 	LDREG	0(%r1), %r1
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	ldo	-16(%r30),%r29			/* Reference param save area */
- #endif
- 	bl	syscall_trace, %r2
-@@ -404,7 +403,7 @@
- 	gate	.+8, %r0
- 	depi	3, 31, 2, %r31	/* Ensure we return to userspace */
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* FIXME: If we are a 64-bit kernel just
- 	 *        turn this on unconditionally.
- 	 */
-@@ -440,7 +439,7 @@
- 	/* Fall through: Return to userspace */
- 
- lws_exit:
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* decide whether to reset the wide mode bit
- 	 *
- 	 * For a syscall, the W bit is stored in the lowest bit
-@@ -486,7 +485,7 @@
- 
- 	/* ELF64 Process entry path */
- lws_compare_and_swap64:
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	b,n	lws_compare_and_swap
- #else
- 	/* If we are not a 64-bit kernel, then we don't
-@@ -497,7 +496,7 @@
- 
- 	/* ELF32 Process entry path */
- lws_compare_and_swap32:
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* Clip all the input registers */
- 	depdi	0, 31, 32, %r26
- 	depdi	0, 31, 32, %r25
-@@ -528,6 +527,7 @@
- 		We *must* giveup this call and fail.
- 	*/
- 	ldw	4(%sr2,%r20), %r28			/* Load thread register */
-+	/* WARNING: If cr27 cycles to the same value we have problems */
- 	mfctl	%cr27, %r21				/* Get current thread register */
- 	cmpb,<>,n	%r21, %r28, cas_lock		/* Called recursive? */
- 	b	lws_exit				/* Return error! */
-@@ -608,7 +608,7 @@
- 	   the other for the store. Either return -EFAULT.
- 	   Each of the entries must be relocated. */
- 	.section __ex_table,"aw"
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* Pad the address calculation */
- 	.word	0,(2b - linux_gateway_page)
- 	.word	0,(3b - linux_gateway_page)
-@@ -619,7 +619,7 @@
- 	.previous
- 
- 	.section __ex_table,"aw"
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* Pad the address calculation */
- 	.word	0,(1b - linux_gateway_page)
- 	.word	0,(3b - linux_gateway_page)
-@@ -638,7 +638,7 @@
- 
- 	/* Relocate symbols assuming linux_gateway_page is mapped
- 	   to virtual address 0x0 */
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/* FIXME: The code will always be on the gateay page
- 		  and thus it will be on the first 4k, the
- 		  assembler seems to think that the final
-@@ -666,7 +666,7 @@
- sys_call_table:
- #include "syscall_table.S"
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	.align 4096
- 	.export sys_call_table64
- .Lsys_call_table64:
-Index: linux-2.6-2.6.12/arch/parisc/kernel/syscall_table.S
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/syscall_table.S	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/syscall_table.S	2005-08-09 17:53:35.000000000 -0400
-@@ -35,7 +35,7 @@
- #undef ENTRY_UHOH
- #undef ENTRY_COMP
- #undef ENTRY_OURS
--#if defined(__LP64__) && !defined(SYSCALL_TABLE_64BIT)
-+#if defined(CONFIG_64BIT) && !defined(SYSCALL_TABLE_64BIT)
- /* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and
-  * narrow palinux.  Use ENTRY_DIFF for those where a 32-bit specific
-  * implementation is required on wide palinux.  Use ENTRY_COMP where
-@@ -46,7 +46,7 @@
- #define ENTRY_UHOH(_name_) .dword sys32_##unimplemented
- #define ENTRY_OURS(_name_) .dword parisc_##_name_
- #define ENTRY_COMP(_name_) .dword compat_sys_##_name_
--#elif defined(__LP64__) && defined(SYSCALL_TABLE_64BIT)
-+#elif defined(CONFIG_64BIT) && defined(SYSCALL_TABLE_64BIT)
- #define ENTRY_SAME(_name_) .dword sys_##_name_
- #define ENTRY_DIFF(_name_) .dword sys_##_name_
- #define ENTRY_UHOH(_name_) .dword sys_##_name_
-@@ -368,5 +368,9 @@
- 	ENTRY_COMP(mbind)		/* 260 */
- 	ENTRY_COMP(get_mempolicy)
- 	ENTRY_COMP(set_mempolicy)
-+	ENTRY_SAME(ni_syscall)	/* 263: reserved for vserver */
-+	ENTRY_SAME(add_key)
-+	ENTRY_SAME(request_key)		/* 265 */
-+	ENTRY_SAME(keyctl)
- 	/* Nothing yet */
- 
-Index: linux-2.6-2.6.12/arch/parisc/kernel/time.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/time.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/time.c	2005-08-09 17:53:35.000000000 -0400
-@@ -89,14 +89,6 @@
- 		}
- 	}
-     
--#ifdef CONFIG_CHASSIS_LCD_LED
--	/* Only schedule the led tasklet on cpu 0, and only if it
--	 * is enabled.
--	 */
--	if (cpu == 0 && !atomic_read(&led_tasklet.count))
--		tasklet_schedule(&led_tasklet);
--#endif
--
- 	/* check soft power switch status */
- 	if (cpu == 0 && !atomic_read(&power_tasklet.count))
- 		tasklet_schedule(&power_tasklet);
-@@ -104,6 +96,24 @@
- 	return IRQ_HANDLED;
- }
- 
-+
-+unsigned long profile_pc(struct pt_regs *regs)
-+{
-+	unsigned long pc = instruction_pointer(regs);
-+
-+	if (regs->gr[0] & PSW_N)
-+		pc -= 4;
-+
-+#ifdef CONFIG_SMP
-+	if (in_lock_functions(pc))
-+		pc = regs->gr[2];
-+#endif
-+
-+	return pc;
-+}
-+EXPORT_SYMBOL(profile_pc);
-+
-+
- /*** converted from ia64 ***/
- /*
-  * Return the number of micro-seconds that elapsed since the last
-Index: linux-2.6-2.6.12/arch/parisc/kernel/unaligned.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/kernel/unaligned.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/kernel/unaligned.c	2005-08-09 17:53:35.000000000 -0400
-@@ -513,15 +513,18 @@
- 	register int flop=0;	/* true if this is a flop */
- 
- 	/* log a message with pacing */
--	if (user_mode(regs))
--	{
--		if (unaligned_count > 5 && jiffies - last_time > 5*HZ)
--		{
-+	if (user_mode(regs)) {
-+                if (current->thread.flags & PARISC_UAC_SIGBUS) {
-+                        goto force_sigbus;
-+                }
-+
-+		if (unaligned_count > 5 && jiffies - last_time > 5*HZ) {
- 			unaligned_count = 0;
- 			last_time = jiffies;
- 		}
--		if (++unaligned_count < 5)
--		{
-+
-+		if (!(current->thread.flags & PARISC_UAC_NOPRINT) 
-+                    && ++unaligned_count < 5) {
- 			char buf[256];
- 			sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n",
- 				current->comm, current->pid, regs->ior, regs->iaoq[0]);
-@@ -530,6 +533,7 @@
- 			show_regs(regs);
- #endif		
- 		}
-+
- 		if (!unaligned_enabled)
- 			goto force_sigbus;
- 	}
-Index: linux-2.6-2.6.12/arch/parisc/lib/memcpy.c
-===================================================================
---- linux-2.6-2.6.12.orig/arch/parisc/lib/memcpy.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/arch/parisc/lib/memcpy.c	2005-08-09 17:53:35.000000000 -0400
-@@ -339,6 +339,7 @@
- 	pds = (double *)pcs;
- 	pdd = (double *)pcd;
- 
-+#if 0
- 	/* Copy 8 doubles at a time */
- 	while (len >= 8*sizeof(double)) {
- 		register double r1, r2, r3, r4, r5, r6, r7, r8;
-@@ -366,6 +367,7 @@
- 		fstdma(d_space, r8, pdd, pmc_store_exc);
- 		len -= 8*sizeof(double);
- 	}
-+#endif
- 
- 	pws = (unsigned int *)pds;
- 	pwd = (unsigned int *)pdd;
-Index: linux-2.6-2.6.12/drivers/block/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/block/Kconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/block/Kconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -6,7 +6,7 @@
- 
- config BLK_DEV_FD
- 	tristate "Normal floppy disk support"
--	depends on (!ARCH_S390 && !M68K && !IA64 && !UML && !ARM) || Q40 || (SUN3X && BROKEN) || ARCH_RPC || ARCH_EBSA285
-+	depends on (!ARCH_S390 && !M68K && !IA64 && !UML && !ARM) || Q40 || (SUN3X && BROKEN) || ARCH_RPC || ARCH_EBSA285 || (PARISC && BROKEN)
- 	---help---
- 	  If you want to use the floppy disk drive(s) of your PC under Linux,
- 	  say Y. Information about this driver, especially important for IBM
-Index: linux-2.6-2.6.12/drivers/ide/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/ide/Kconfig	2005-08-09 17:50:50.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/ide/Kconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -610,7 +610,7 @@
- 	tristate "NS87415 chipset support"
- 	help
- 	  This driver adds detection and support for the NS87415 chip
--	  (used in SPARC64, among others).
-+	  (used mainly on SPARC64 and PA-RISC machines).
- 
- 	  Please read the comments at the top of <file:drivers/ide/pci/ns87415.c>.
- 
-Index: linux-2.6-2.6.12/drivers/input/keyboard/hil_kbd.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/input/keyboard/hil_kbd.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/input/keyboard/hil_kbd.c	2005-08-09 17:53:35.000000000 -0400
-@@ -204,7 +204,7 @@
- 	hil_packet packet;
- 	int idx;
- 
--	kbd = (struct hil_kbd *)serio->private;
-+	kbd = serio_get_drvdata(serio);
- 	if (kbd == NULL) {
- 		BUG();
- 		return IRQ_HANDLED;
-@@ -234,7 +234,7 @@
- {
- 	struct hil_kbd *kbd;
- 
--	kbd = (struct hil_kbd *)serio->private;
-+	kbd = serio_get_drvdata(serio);
- 	if (kbd == NULL) {
- 		BUG();
- 		return;
-@@ -245,20 +245,20 @@
- 	kfree(kbd);
- }
- 
--static void hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
-+static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
- {
- 	struct hil_kbd	*kbd;
- 	uint8_t		did, *idd;
- 	int		i;
- 	
--	if (serio->type != (SERIO_HIL_MLC | SERIO_HIL)) return;
--
--	if (!(kbd = kmalloc(sizeof(struct hil_kbd), GFP_KERNEL))) return;
-+	kbd = kmalloc(sizeof(*kbd), GFP_KERNEL);
-+	if (!kbd)
-+		return -ENOMEM;
- 	memset(kbd, 0, sizeof(struct hil_kbd));
- 
- 	if (serio_open(serio, drv)) goto bail0;
- 
--	serio->private = kbd;
-+	serio_set_drvdata(serio, kbd);
- 	kbd->serio = serio;
- 	kbd->dev.private = kbd;
- 
-@@ -342,19 +342,31 @@
- 	down(&(kbd->sem));
- 	up(&(kbd->sem));
- 
--	return;
-+	return 0;
-  bail1:
- 	serio_close(serio);
-  bail0:
- 	kfree(kbd);
-+	serio_set_drvdata(serio, NULL);
-+	return -EIO;
- }
- 
-+static struct serio_device_id hil_kbd_ids[] = {
-+	{
-+		.type = SERIO_HIL_MLC,
-+		.proto = SERIO_HIL,
-+		.id = SERIO_ANY,
-+		.extra = SERIO_ANY,
-+	},
-+	{ 0 }
-+};
- 
- struct serio_driver hil_kbd_serio_drv = {
- 	.driver		= {
- 		.name	= "hil_kbd",
- 	},
- 	.description	= "HP HIL keyboard driver",
-+	.id_table	= hil_kbd_ids,
- 	.connect 	= hil_kbd_connect,
- 	.disconnect 	= hil_kbd_disconnect,
- 	.interrupt 	= hil_kbd_interrupt
-Index: linux-2.6-2.6.12/drivers/input/keyboard/hilkbd.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/input/keyboard/hilkbd.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/input/keyboard/hilkbd.c	2005-08-09 17:53:35.000000000 -0400
-@@ -22,7 +22,7 @@
- #include <linux/errno.h>
- #include <linux/input.h>
- #include <linux/init.h>
--#include <linux/irq.h>
-+#include <linux/interrupt.h>
- #include <linux/hil.h>
- #include <linux/spinlock.h>
- 
-Index: linux-2.6-2.6.12/drivers/input/mouse/hil_ptr.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/input/mouse/hil_ptr.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/input/mouse/hil_ptr.c	2005-08-09 17:53:35.000000000 -0400
-@@ -196,7 +196,7 @@
- 	hil_packet packet;
- 	int idx;
- 
--	ptr = (struct hil_ptr *)serio->private;
-+	ptr = serio_get_drvdata(serio);
- 	if (ptr == NULL) {
- 		BUG();
- 		return IRQ_HANDLED;
-@@ -227,7 +227,7 @@
- {
- 	struct hil_ptr *ptr;
- 
--	ptr = (struct hil_ptr *)serio->private;
-+	ptr = serio_get_drvdata(serio);
- 	if (ptr == NULL) {
- 		BUG();
- 		return;
-@@ -238,21 +238,19 @@
- 	kfree(ptr);
- }
- 
--static void hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
-+static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
- {
- 	struct hil_ptr	*ptr;
- 	char		*txt;
- 	unsigned int	i, naxsets, btntype;
- 	uint8_t		did, *idd;
- 
--	if (serio->type != (SERIO_HIL_MLC | SERIO_HIL)) return;
--
--	if (!(ptr = kmalloc(sizeof(struct hil_ptr), GFP_KERNEL))) return;
-+	if (!(ptr = kmalloc(sizeof(struct hil_ptr), GFP_KERNEL))) return -ENOMEM;
- 	memset(ptr, 0, sizeof(struct hil_ptr));
- 
- 	if (serio_open(serio, driver)) goto bail0;
- 
--	serio->private = ptr;
-+	serio_set_drvdata(serio, ptr);
- 	ptr->serio = serio;
- 	ptr->dev.private = ptr;
- 
-@@ -380,23 +378,34 @@
- 		(btntype == BTN_MOUSE) ? "HIL mouse":"HIL tablet or touchpad",
- 		did);
- 
--	return;
-+	return 0;
-  bail1:
- 	serio_close(serio);
-  bail0:
- 	kfree(ptr);
--	return;
-+	serio_set_drvdata(serio, NULL);
-+	return -ENODEV;
- }
- 
-+static struct serio_device_id hil_ptr_ids[] = {
-+	{
-+		.type = SERIO_HIL_MLC,
-+		.proto = SERIO_HIL,
-+		.id = SERIO_ANY,
-+		.extra = SERIO_ANY,
-+	},
-+	{ 0 }
-+};
- 
- static struct serio_driver hil_ptr_serio_driver = {
- 	.driver		= {
- 		.name	= "hil_ptr",
- 	},
- 	.description	= "HP HIL mouse/tablet driver",
--	.connect =	hil_ptr_connect,
--	.disconnect =	hil_ptr_disconnect,
--	.interrupt =	hil_ptr_interrupt
-+	.id_table	= hil_ptr_ids,
-+	.connect	= hil_ptr_connect,
-+	.disconnect	= hil_ptr_disconnect,
-+	.interrupt	= hil_ptr_interrupt
- };
- 
- static int __init hil_ptr_init(void)
-Index: linux-2.6-2.6.12/drivers/input/serio/hil_mlc.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/input/serio/hil_mlc.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/input/serio/hil_mlc.c	2005-08-09 17:53:35.000000000 -0400
-@@ -801,7 +801,8 @@
- 	struct hil_mlc_serio_map *map;
- 	struct hil_mlc *mlc;
- 
--	if (serio->private != NULL) return -EBUSY;
-+	if (serio_get_drvdata(serio) != NULL)
-+		return -EBUSY;
- 
- 	map = serio->port_data;
- 	if (map == NULL) {
-@@ -832,11 +833,18 @@
- 		return;
- 	}
- 
--	serio->private = NULL;
-+	serio_set_drvdata(serio, NULL);
- 	serio->drv = NULL;
- 	/* TODO wake up interruptable */
- }
- 
-+static struct serio_device_id hil_mlc_serio_id = {
-+	.type = SERIO_HIL_MLC,
-+	.proto = SERIO_HIL,
-+	.extra = SERIO_ANY,
-+	.id = SERIO_ANY,
-+};
-+
- int hil_mlc_register(hil_mlc *mlc) {
- 	int i;
-         unsigned long flags;
-@@ -867,7 +875,7 @@
- 		mlc_serio = kmalloc(sizeof(*mlc_serio), GFP_KERNEL);
- 		mlc->serio[i] = mlc_serio;
- 		memset(mlc_serio, 0, sizeof(*mlc_serio));
--		mlc_serio->type			= SERIO_HIL | SERIO_HIL_MLC;
-+		mlc_serio->id			= hil_mlc_serio_id;
- 		mlc_serio->write		= hil_mlc_serio_write;
- 		mlc_serio->open			= hil_mlc_serio_open;
- 		mlc_serio->close		= hil_mlc_serio_close;
-Index: linux-2.6-2.6.12/drivers/isdn/hisax/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/isdn/hisax/Kconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/isdn/hisax/Kconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -110,7 +110,7 @@
- 
- config HISAX_TELESPCI
- 	bool "Teles PCI"
--	depends on PCI && (BROKEN || !(SPARC64 || PPC))
-+	depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K))
- 	help
- 	  This enables HiSax support for the Teles PCI.
- 	  See <file:Documentation/isdn/README.HiSax> on how to configure it.
-@@ -237,7 +237,7 @@
- 
- config HISAX_NETJET
- 	bool "NETjet card"
--	depends on PCI && (BROKEN || !(SPARC64 || PPC))
-+	depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K))
- 	help
- 	  This enables HiSax support for the NetJet from Traverse
- 	  Technologies.
-@@ -248,7 +248,7 @@
- 
- config HISAX_NETJET_U
- 	bool "NETspider U card"
--	depends on PCI && (BROKEN || !(SPARC64 || PPC))
-+	depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K))
- 	help
- 	  This enables HiSax support for the Netspider U interface ISDN card
- 	  from Traverse Technologies.
-@@ -316,7 +316,7 @@
- 
- config HISAX_HFC_PCI
- 	bool "HFC PCI-Bus cards"
--	depends on PCI && (BROKEN || !(SPARC64 || PPC))
-+	depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K))
- 	help
- 	  This enables HiSax support for the HFC-S PCI 2BDS0 based cards.
- 
-@@ -343,14 +343,14 @@
- 
- config HISAX_ENTERNOW_PCI
- 	bool "Formula-n enter:now PCI card"
--	depends on PCI && (BROKEN || !(SPARC64 || PPC))
-+	depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K))
- 	help
- 	  This enables HiSax support for the Formula-n enter:now PCI
- 	  ISDN card.
- 
- config HISAX_AMD7930
- 	bool "Am7930 (EXPERIMENTAL)"
--	depends on EXPERIMENTAL && (SPARC32 || SPARC64)
-+	depends on EXPERIMENTAL && SPARC
- 	help
- 	  This enables HiSax support for the AMD7930 chips on some SPARCs.
- 	  This code is not finished yet.
-Index: linux-2.6-2.6.12/drivers/isdn/pcbit/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/isdn/pcbit/Kconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/isdn/pcbit/Kconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -3,7 +3,7 @@
- #
- config ISDN_DRV_PCBIT
- 	tristate "PCBIT-D support"
--	depends on ISDN_I4L && ISA && (BROKEN || !PPC)
-+	depends on ISDN_I4L && ISA && (BROKEN || X86)
- 	help
- 	  This enables support for the PCBIT ISDN-card.  This card is
- 	  manufactured in Portugal by Octal.  For running this card,
-Index: linux-2.6-2.6.12/drivers/net/tulip/media.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/net/tulip/media.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/net/tulip/media.c	2005-08-09 17:53:35.000000000 -0400
-@@ -44,8 +44,10 @@
- 
- /* MII transceiver control section.
-    Read and write the MII registers using software-generated serial
--   MDIO protocol.  See the MII specifications or DP83840A data sheet
--   for details. */
-+   MDIO protocol.
-+   See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management functions")
-+   or DP83840A data sheet for more details.
-+   */
- 
- int tulip_mdio_read(struct net_device *dev, int phy_id, int location)
- {
-@@ -297,24 +299,56 @@
- 				u16 *reset_sequence = &((u16*)(p+3))[init_length];
- 				int reset_length = p[2 + init_length*2];
- 				misc_info = reset_sequence + reset_length;
--				if (startup)
-+				if (startup) {
-+					int timeout = 10;	/* max 1 ms */
- 					for (i = 0; i < reset_length; i++)
- 						iowrite32(get_u16(&reset_sequence[i]) << 16, ioaddr + CSR15);
-+				
-+					/* flush posted writes */
-+					ioread32(ioaddr + CSR15);
-+
-+					/* Sect 3.10.3 in DP83840A.pdf (p39) */
-+					udelay(500);
-+
-+					/* Section 4.2 in DP83840A.pdf (p43) */
-+					/* and IEEE 802.3 "22.2.4.1.1 Reset" */
-+					while (timeout-- &&
-+						(tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
-+						udelay(100);
-+				}
- 				for (i = 0; i < init_length; i++)
- 					iowrite32(get_u16(&init_sequence[i]) << 16, ioaddr + CSR15);
-+
-+				ioread32(ioaddr + CSR15);	/* flush posted writes */
- 			} else {
- 				u8 *init_sequence = p + 2;
- 				u8 *reset_sequence = p + 3 + init_length;
- 				int reset_length = p[2 + init_length];
- 				misc_info = (u16*)(reset_sequence + reset_length);
- 				if (startup) {
-+					int timeout = 10;	/* max 1 ms */
- 					iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
- 					for (i = 0; i < reset_length; i++)
- 						iowrite32(reset_sequence[i], ioaddr + CSR12);
-+
-+					/* flush posted writes */
-+					ioread32(ioaddr + CSR12);
-+
-+					/* Sect 3.10.3 in DP83840A.pdf (p39) */
-+					udelay(500);
-+
-+					/* Section 4.2 in DP83840A.pdf (p43) */
-+					/* and IEEE 802.3 "22.2.4.1.1 Reset" */
-+					while (timeout-- &&
-+						(tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
-+						udelay(100);
- 				}
- 				for (i = 0; i < init_length; i++)
- 					iowrite32(init_sequence[i], ioaddr + CSR12);
-+
-+				ioread32(ioaddr + CSR12);	/* flush posted writes */
- 			}
-+
- 			tmp_info = get_u16(&misc_info[1]);
- 			if (tmp_info)
- 				tp->advertising[phy_num] = tmp_info | 1;
-Index: linux-2.6-2.6.12/drivers/net/tulip/tulip.h
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/net/tulip/tulip.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/net/tulip/tulip.h	2005-08-09 17:53:35.000000000 -0400
-@@ -475,8 +475,11 @@
- 			udelay(10);
- 
- 		if (!i)
--			printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
--					pci_name(tp->pdev));
-+			printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed"
-+					" (CSR5 0x%x CSR6 0x%x)\n",
-+					pci_name(tp->pdev),
-+					ioread32(ioaddr + CSR5),
-+					ioread32(ioaddr + CSR6));
- 	}
- }
- 
-Index: linux-2.6-2.6.12/drivers/net/tulip/tulip_core.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/net/tulip/tulip_core.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/net/tulip/tulip_core.c	2005-08-09 17:53:35.000000000 -0400
-@@ -22,7 +22,7 @@
- #else
- #define DRV_VERSION	"1.1.13"
- #endif
--#define DRV_RELDATE	"May 11, 2002"
-+#define DRV_RELDATE	"December 15, 2004"
- 
- 
- #include <linux/module.h>
-@@ -148,7 +148,7 @@
- 	HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI, tulip_timer },
- 
-   /* DC21142, DC21143 */
--  { "Digital DS21143 Tulip", 128, 0x0801fbff,
-+  { "Digital DS21142/DS21143 Tulip", 128, 0x0801fbff,
- 	HAS_MII | HAS_MEDIA_TABLE | ALWAYS_CHECK_MII | HAS_ACPI | HAS_NWAY
- 	| HAS_INTR_MITIGATION | HAS_PCI_MWI, t21142_timer },
- 
-Index: linux-2.6-2.6.12/drivers/parisc/ccio-dma.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/parisc/ccio-dma.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/parisc/ccio-dma.c	2005-08-09 17:53:35.000000000 -0400
-@@ -100,9 +100,9 @@
- #define DBG_RUN_SG(x...)
- #endif
- 
--#define CCIO_INLINE	/* inline */
--#define WRITE_U32(value, addr) gsc_writel(value, (u32 *)(addr))
--#define READ_U32(addr) gsc_readl((u32 *)(addr))
-+#define CCIO_INLINE	inline
-+#define WRITE_U32(value, addr) __raw_writel(value, addr)
-+#define READ_U32(addr) __raw_readl(addr)
- 
- #define U2_IOA_RUNWAY 0x580
- #define U2_BC_GSC     0x501
-@@ -115,28 +115,28 @@
- 
- struct ioa_registers {
-         /* Runway Supervisory Set */
--        volatile int32_t    unused1[12];
--        volatile uint32_t   io_command;             /* Offset 12 */
--        volatile uint32_t   io_status;              /* Offset 13 */
--        volatile uint32_t   io_control;             /* Offset 14 */
--        volatile int32_t    unused2[1];
-+        int32_t    unused1[12];
-+        uint32_t   io_command;             /* Offset 12 */
-+        uint32_t   io_status;              /* Offset 13 */
-+        uint32_t   io_control;             /* Offset 14 */
-+        int32_t    unused2[1];
- 
-         /* Runway Auxiliary Register Set */
--        volatile uint32_t   io_err_resp;            /* Offset  0 */
--        volatile uint32_t   io_err_info;            /* Offset  1 */
--        volatile uint32_t   io_err_req;             /* Offset  2 */
--        volatile uint32_t   io_err_resp_hi;         /* Offset  3 */
--        volatile uint32_t   io_tlb_entry_m;         /* Offset  4 */
--        volatile uint32_t   io_tlb_entry_l;         /* Offset  5 */
--        volatile uint32_t   unused3[1];
--        volatile uint32_t   io_pdir_base;           /* Offset  7 */
--        volatile uint32_t   io_io_low_hv;           /* Offset  8 */
--        volatile uint32_t   io_io_high_hv;          /* Offset  9 */
--        volatile uint32_t   unused4[1];
--        volatile uint32_t   io_chain_id_mask;       /* Offset 11 */
--        volatile uint32_t   unused5[2];
--        volatile uint32_t   io_io_low;              /* Offset 14 */
--        volatile uint32_t   io_io_high;             /* Offset 15 */
-+        uint32_t   io_err_resp;            /* Offset  0 */
-+        uint32_t   io_err_info;            /* Offset  1 */
-+        uint32_t   io_err_req;             /* Offset  2 */
-+        uint32_t   io_err_resp_hi;         /* Offset  3 */
-+        uint32_t   io_tlb_entry_m;         /* Offset  4 */
-+        uint32_t   io_tlb_entry_l;         /* Offset  5 */
-+        uint32_t   unused3[1];
-+        uint32_t   io_pdir_base;           /* Offset  7 */
-+        uint32_t   io_io_low_hv;           /* Offset  8 */
-+        uint32_t   io_io_high_hv;          /* Offset  9 */
-+        uint32_t   unused4[1];
-+        uint32_t   io_chain_id_mask;       /* Offset 11 */
-+        uint32_t   unused5[2];
-+        uint32_t   io_io_low;              /* Offset 14 */
-+        uint32_t   io_io_high;             /* Offset 15 */
- };
- 
- /*
-@@ -226,7 +226,7 @@
- */
- 
- struct ioc {
--	struct ioa_registers *ioc_hpa;  /* I/O MMU base address */
-+	struct ioa_registers __iomem *ioc_regs;  /* I/O MMU base address */
- 	u8  *res_map;	                /* resource map, bit == pdir entry */
- 	u64 *pdir_base;	                /* physical base address */
- 	u32 pdir_size; 			/* bytes, function of IOV Space size */
-@@ -636,7 +636,7 @@
- 	byte_cnt += chain_size;
- 
- 	while(byte_cnt > chain_size) {
--		WRITE_U32(CMD_TLB_PURGE | iovp, &ioc->ioc_hpa->io_command);
-+		WRITE_U32(CMD_TLB_PURGE | iovp, &ioc->ioc_regs->io_command);
- 		iovp += chain_size;
- 		byte_cnt -= chain_size;
- 	}
-@@ -1314,14 +1314,13 @@
- 
- 	ioc->pdir_size = (iova_space_size / IOVP_SIZE) * sizeof(u64);
- 
--	BUG_ON(ioc->pdir_size >= 4 * 1024 * 1024);   /* max pdir size < 4MB */
-+	BUG_ON(ioc->pdir_size > 8 * 1024 * 1024);   /* max pdir size <= 8MB */
- 
- 	/* Verify it's a power of two */
- 	BUG_ON((1 << get_order(ioc->pdir_size)) != (ioc->pdir_size >> PAGE_SHIFT));
- 
--	DBG_INIT("%s() hpa 0x%lx mem %luMB IOV %dMB (%d bits)\n",
--			__FUNCTION__,
--			ioc->ioc_hpa,
-+	DBG_INIT("%s() hpa 0x%p mem %luMB IOV %dMB (%d bits)\n",
-+			__FUNCTION__, ioc->ioc_regs,
- 			(unsigned long) num_physpages >> (20 - PAGE_SHIFT),
- 			iova_space_size>>20,
- 			iov_order + PAGE_SHIFT);
-@@ -1329,13 +1328,12 @@
- 	ioc->pdir_base = (u64 *)__get_free_pages(GFP_KERNEL, 
- 						 get_order(ioc->pdir_size));
- 	if(NULL == ioc->pdir_base) {
--		panic("%s:%s() could not allocate I/O Page Table\n", __FILE__,
--		      __FUNCTION__);
-+		panic("%s() could not allocate I/O Page Table\n", __FUNCTION__);
- 	}
- 	memset(ioc->pdir_base, 0, ioc->pdir_size);
- 
- 	BUG_ON((((unsigned long)ioc->pdir_base) & PAGE_MASK) != (unsigned long)ioc->pdir_base);
--	DBG_INIT(" base %p", ioc->pdir_base);
-+	DBG_INIT(" base %p\n", ioc->pdir_base);
- 
- 	/* resource map size dictated by pdir_size */
-  	ioc->res_size = (ioc->pdir_size / sizeof(u64)) >> 3;
-@@ -1344,8 +1342,7 @@
- 	ioc->res_map = (u8 *)__get_free_pages(GFP_KERNEL, 
- 					      get_order(ioc->res_size));
- 	if(NULL == ioc->res_map) {
--		panic("%s:%s() could not allocate resource map\n", __FILE__,
--		      __FUNCTION__);
-+		panic("%s() could not allocate resource map\n", __FUNCTION__);
- 	}
- 	memset(ioc->res_map, 0, ioc->res_size);
- 
-@@ -1366,44 +1363,52 @@
- 	** Initialize IOA hardware
- 	*/
- 	WRITE_U32(CCIO_CHAINID_MASK << ioc->chainid_shift, 
--		  &ioc->ioc_hpa->io_chain_id_mask);
-+		  &ioc->ioc_regs->io_chain_id_mask);
- 
- 	WRITE_U32(virt_to_phys(ioc->pdir_base), 
--		  &ioc->ioc_hpa->io_pdir_base);
-+		  &ioc->ioc_regs->io_pdir_base);
- 
- 	/*
- 	** Go to "Virtual Mode"
- 	*/
--	WRITE_U32(IOA_NORMAL_MODE, &ioc->ioc_hpa->io_control);
-+	WRITE_U32(IOA_NORMAL_MODE, &ioc->ioc_regs->io_control);
- 
- 	/*
- 	** Initialize all I/O TLB entries to 0 (Valid bit off).
- 	*/
--	WRITE_U32(0, &ioc->ioc_hpa->io_tlb_entry_m);
--	WRITE_U32(0, &ioc->ioc_hpa->io_tlb_entry_l);
-+	WRITE_U32(0, &ioc->ioc_regs->io_tlb_entry_m);
-+	WRITE_U32(0, &ioc->ioc_regs->io_tlb_entry_l);
- 
- 	for(i = 1 << CCIO_CHAINID_SHIFT; i ; i--) {
- 		WRITE_U32((CMD_TLB_DIRECT_WRITE | (i << ioc->chainid_shift)),
--			  &ioc->ioc_hpa->io_command);
-+			  &ioc->ioc_regs->io_command);
- 	}
- }
- 
- static void
--ccio_init_resource(struct resource *res, char *name, unsigned long ioaddr)
-+ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr)
- {
- 	int result;
- 
- 	res->parent = NULL;
- 	res->flags = IORESOURCE_MEM;
--	res->start = (unsigned long)(signed) __raw_readl(ioaddr) << 16;
--	res->end = (unsigned long)(signed) (__raw_readl(ioaddr + 4) << 16) - 1;
-+	/*
-+	 * bracing ((signed) ...) are required for 64bit kernel because
-+	 * we only want to sign extend the lower 16 bits of the register.
-+	 * The upper 16-bits of range registers are hardcoded to 0xffff.
-+	 */
-+	res->start = (unsigned long)((signed) READ_U32(ioaddr) << 16);
-+	res->end = (unsigned long)((signed) (READ_U32(ioaddr + 4) << 16) - 1);
- 	res->name = name;
-+	/*
-+	 * Check if this MMIO range is disable
-+	 */
- 	if (res->end + 1 == res->start)
- 		return;
- 	result = request_resource(&iomem_resource, res);
- 	if (result < 0) {
--		printk(KERN_ERR "%s: failed to claim CCIO bus address space (%08lx,%08lx)\n", 
--		       __FILE__, res->start, res->end);
-+		printk(KERN_ERR "%s() failed to claim CCIO bus address space (%08lx,%08lx)\n", 
-+	 		__FUNCTION__, res->start, res->end);
- 	}
- }
- 
-@@ -1414,9 +1419,8 @@
- 
- 	sprintf(name, "GSC Bus [%d/]", ioc->hw_path);
- 
--	ccio_init_resource(res, name, (unsigned long)&ioc->ioc_hpa->io_io_low);
--	ccio_init_resource(res + 1, name,
--			(unsigned long)&ioc->ioc_hpa->io_io_low_hv);
-+	ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low);
-+	ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv);
- }
- 
- static int new_ioc_area(struct resource *res, unsigned long size,
-@@ -1486,15 +1490,15 @@
- 
- 	if (!expand_ioc_area(parent, size, min, max, align)) {
- 		__raw_writel(((parent->start)>>16) | 0xffff0000,
--			     (unsigned long)&(ioc->ioc_hpa->io_io_low));
-+			     &ioc->ioc_regs->io_io_low);
- 		__raw_writel(((parent->end)>>16) | 0xffff0000,
--			     (unsigned long)&(ioc->ioc_hpa->io_io_high));
-+			     &ioc->ioc_regs->io_io_high);
- 	} else if (!expand_ioc_area(parent + 1, size, min, max, align)) {
- 		parent++;
- 		__raw_writel(((parent->start)>>16) | 0xffff0000,
--			     (unsigned long)&(ioc->ioc_hpa->io_io_low_hv));
-+			     &ioc->ioc_regs->io_io_low_hv);
- 		__raw_writel(((parent->end)>>16) | 0xffff0000,
--			     (unsigned long)&(ioc->ioc_hpa->io_io_high_hv));
-+			     &ioc->ioc_regs->io_io_high_hv);
- 	} else {
- 		return -EBUSY;
- 	}
-@@ -1554,7 +1558,7 @@
- 	*ioc_p = ioc;
- 
- 	ioc->hw_path = dev->hw_path;
--	ioc->ioc_hpa = (struct ioa_registers *)dev->hpa;
-+	ioc->ioc_regs = ioremap(dev->hpa, 4096);
- 	ccio_ioc_init(ioc);
- 	ccio_init_resources(ioc);
- 	hppa_dma_ops = &ccio_ops;
-Index: linux-2.6-2.6.12/drivers/parisc/led.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/parisc/led.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/parisc/led.c	2005-08-09 17:53:35.000000000 -0400
-@@ -18,6 +18,9 @@
-  * Changes:
-  *      - Audit copy_from_user in led_proc_write.
-  *                                Daniele Bellucci <bellucda at tiscali.it>
-+ *	- Switch from using a tasklet to a work queue, so the led_LCD_driver
-+ *	  	can sleep.
-+ *	  			  David Pye <dmp at davidmpye.dyndns.org>
-  */
- 
- #include <linux/config.h>
-@@ -37,6 +40,7 @@
- #include <linux/proc_fs.h>
- #include <linux/ctype.h>
- #include <linux/blkdev.h>
-+#include <linux/workqueue.h>
- #include <asm/io.h>
- #include <asm/processor.h>
- #include <asm/hardware.h>
-@@ -46,25 +50,30 @@
- #include <asm/uaccess.h>
- 
- /* The control of the LEDs and LCDs on PARISC-machines have to be done 
--   completely in software. The necessary calculations are done in a tasklet
--   which is scheduled at every timer interrupt and since the calculations 
--   may consume relatively much CPU-time some of the calculations can be 
-+   completely in software. The necessary calculations are done in a work queue
-+   task which is scheduled regularly, and since the calculations may consume a 
-+   relatively large amount of CPU time, some of the calculations can be 
-    turned off with the following variables (controlled via procfs) */
- 
- static int led_type = -1;
--static int led_heartbeat = 1;
--static int led_diskio = 1;
--static int led_lanrxtx = 1;
-+static unsigned char lastleds;	/* LED state from most recent update */
-+static unsigned int led_heartbeat = 1;
-+static unsigned int led_diskio = 1;
-+static unsigned int led_lanrxtx = 1;
- static char lcd_text[32];
- static char lcd_text_default[32];
- 
-+
-+static struct workqueue_struct *led_wq;
-+static void led_work_func(void *);
-+static DECLARE_WORK(led_task, led_work_func, NULL);
-+
- #if 0
- #define DPRINTK(x)	printk x
- #else
- #define DPRINTK(x)
- #endif
- 
--
- struct lcd_block {
- 	unsigned char command;	/* stores the command byte      */
- 	unsigned char on;	/* value for turning LED on     */
-@@ -115,12 +124,27 @@
- #define LCD_DATA_REG	lcd_info.lcd_data_reg_addr	 
- #define LED_DATA_REG	lcd_info.lcd_cmd_reg_addr	/* LASI & ASP only */
- 
-+#define LED_HASLCD 1
-+#define LED_NOLCD  0
-+
-+/* The workqueue must be created at init-time */
-+static int start_task(void) 
-+{	
-+	/* Display the default text now */
-+	if (led_type == LED_HASLCD) lcd_print( lcd_text_default );
-+
-+	/* Create the work queue and queue the LED task */
-+	led_wq = create_singlethread_workqueue("led_wq");	
-+	queue_work(led_wq, &led_task);
-+
-+	return 0;
-+}
-+
-+device_initcall(start_task);
- 
- /* ptr to LCD/LED-specific function */
- static void (*led_func_ptr) (unsigned char);
- 
--#define LED_HASLCD 1
--#define LED_NOLCD  0
- #ifdef CONFIG_PROC_FS
- static int led_proc_read(char *page, char **start, off_t off, int count, 
- 	int *eof, void *data)
-@@ -285,52 +309,35 @@
- /*
-    ** 
-    ** led_LCD_driver()
--   ** 
--   ** The logic of the LCD driver is, that we write at every scheduled call
--   ** only to one of LCD_CMD_REG _or_ LCD_DATA_REG - registers.
--   ** That way we don't need to let this tasklet busywait for min_cmd_delay
--   ** milliseconds.
--   **
--   ** TODO: check the value of "min_cmd_delay" against the value of HZ.
-    **   
-  */
- static void led_LCD_driver(unsigned char leds)
- {
--	static int last_index;	/* 0:heartbeat, 1:disk, 2:lan_in, 3:lan_out */
--	static int last_was_cmd;/* 0: CMD was written last, 1: DATA was last */
--	struct lcd_block *block_ptr;
--	int value;
--
--	switch (last_index) {
--	    case 0:	block_ptr = &lcd_info.heartbeat;
--			value = leds & LED_HEARTBEAT;
--			break;
--	    case 1:	block_ptr = &lcd_info.disk_io;
--			value = leds & LED_DISK_IO;
--			break;					
--	    case 2:	block_ptr = &lcd_info.lan_rcv;
--			value = leds & LED_LAN_RCV;
--			break;					
--	    case 3:	block_ptr = &lcd_info.lan_tx;
--			value = leds & LED_LAN_TX;
--			break;
--	    default:	/* should never happen: */
--			return;
--	}
-+	static int i;
-+	static unsigned char mask[4] = { LED_HEARTBEAT, LED_DISK_IO,
-+		LED_LAN_RCV, LED_LAN_TX };
-+	
-+	static struct lcd_block * blockp[4] = {
-+		&lcd_info.heartbeat,
-+		&lcd_info.disk_io,
-+		&lcd_info.lan_rcv,
-+		&lcd_info.lan_tx
-+	};
- 
--	if (last_was_cmd) {
--	    /* write the value to the LCD data port */
--    	    gsc_writeb( value ? block_ptr->on : block_ptr->off, LCD_DATA_REG );
--	} else {
--	    /* write the command-byte to the LCD command register */
--    	    gsc_writeb( block_ptr->command, LCD_CMD_REG );
--	}    
--	
--	/* now update the vars for the next interrupt iteration */ 
--	if (++last_was_cmd == 2) { /* switch between cmd & data */
--	    last_was_cmd = 0;
--	    if (++last_index == 4) 
--		last_index = 0;	 /* switch back to heartbeat index */
-+	/* Convert min_cmd_delay to milliseconds */
-+	unsigned int msec_cmd_delay = 1 + (lcd_info.min_cmd_delay / 1000);
-+	
-+	for (i=0; i<4; ++i) 
-+	{
-+		if ((leds & mask[i]) != (lastleds & mask[i])) 
-+		{
-+			gsc_writeb( blockp[i]->command, LCD_CMD_REG );
-+			msleep(msec_cmd_delay);
-+			
-+			gsc_writeb( leds & mask[i] ? blockp[i]->on : 
-+					blockp[i]->off, LCD_DATA_REG );
-+			msleep(msec_cmd_delay);
-+		}
- 	}
- }
- 
-@@ -355,7 +362,7 @@
- 
- 	rx_total = tx_total = 0;
- 	
--	/* we are running as tasklet, so locking dev_base 
-+	/* we are running as a workqueue task, so locking dev_base 
- 	 * for reading should be OK */
- 	read_lock(&dev_base_lock);
- 	for (dev = dev_base; dev; dev = dev->next) {
-@@ -402,7 +409,7 @@
- 	static unsigned long last_pgpgin, last_pgpgout;
- 	struct page_state pgstat;
- 	int changed;
--	
-+
- 	get_full_page_state(&pgstat); /* get no of sectors in & out */
- 
- 	/* Just use a very simple calculation here. Do not care about overflow,
-@@ -410,86 +417,70 @@
- 	changed = (pgstat.pgpgin != last_pgpgin) || (pgstat.pgpgout != last_pgpgout);
- 	last_pgpgin  = pgstat.pgpgin;
- 	last_pgpgout = pgstat.pgpgout;
--	
-+
- 	return (changed ? LED_DISK_IO : 0);
- }
- 
- 
- 
- /*
--   ** led_tasklet_func()
-+   ** led_work_func()
-    ** 
--   ** is scheduled at every timer interrupt from time.c and
--   ** updates the chassis LCD/LED 
-+   ** manages when and which chassis LCD/LED gets updated
- 
-     TODO:
-     - display load average (older machines like 715/64 have 4 "free" LED's for that)
-     - optimizations
-  */
- 
--#define HEARTBEAT_LEN (HZ*6/100)
--#define HEARTBEAT_2ND_RANGE_START (HZ*22/100)
-+#define HEARTBEAT_LEN (HZ*10/100)
-+#define HEARTBEAT_2ND_RANGE_START (HZ*28/100)
- #define HEARTBEAT_2ND_RANGE_END   (HEARTBEAT_2ND_RANGE_START + HEARTBEAT_LEN)
- 
--#define NORMALIZED_COUNT(count) (count/(HZ/100))
-+#define LED_UPDATE_INTERVAL (1 + (HZ*19/1000))
- 
--static void led_tasklet_func(unsigned long unused)
-+static void led_work_func (void *unused)
- {
--	static unsigned char lastleds;
--	unsigned char currentleds; /* stores current value of the LEDs */
--	static unsigned long count; /* static incremented value, not wrapped */
-+	static unsigned long last_jiffies;
- 	static unsigned long count_HZ; /* counter in range 0..HZ */
-+	unsigned char currentleds = 0; /* stores current value of the LEDs */
- 
- 	/* exit if not initialized */
- 	if (!led_func_ptr)
- 	    return;
- 
--	/* increment the local counters */
--	++count;
--	if (++count_HZ == HZ)
-+	/* increment the heartbeat timekeeper */
-+	count_HZ += jiffies - last_jiffies;
-+	last_jiffies = jiffies;
-+	if (count_HZ >= HZ)
- 	    count_HZ = 0;
- 
--	currentleds = lastleds;
--
--	if (led_heartbeat)
--	{
--		/* flash heartbeat-LED like a real heart (2 x short then a long delay) */
--		if (count_HZ<HEARTBEAT_LEN || 
--		    (count_HZ>=HEARTBEAT_2ND_RANGE_START && count_HZ<HEARTBEAT_2ND_RANGE_END)) 
--		    currentleds |= LED_HEARTBEAT;
--		else
--		    currentleds &= ~LED_HEARTBEAT;
--	}
--
--	/* look for network activity and flash LEDs respectively */
--	if (led_lanrxtx && ((NORMALIZED_COUNT(count)+(8/2)) & 7) == 0)
-+	if (likely(led_heartbeat))
- 	{
--		currentleds &= ~(LED_LAN_RCV | LED_LAN_TX);
--		currentleds |= led_get_net_activity();
-+		/* flash heartbeat-LED like a real heart
-+		 * (2 x short then a long delay)
-+		 */
-+		if (count_HZ < HEARTBEAT_LEN || 
-+				(count_HZ >= HEARTBEAT_2ND_RANGE_START &&
-+				count_HZ < HEARTBEAT_2ND_RANGE_END)) 
-+			currentleds |= LED_HEARTBEAT;
- 	}
- 
--	/* avoid to calculate diskio-stats at same irq  as netio-stats */
--	if (led_diskio && (NORMALIZED_COUNT(count) & 7) == 0)
--	{
--		currentleds &= ~LED_DISK_IO;
--		currentleds |= led_get_diskio_activity();
--	}
-+	if (likely(led_lanrxtx))  currentleds |= led_get_net_activity();
-+	if (likely(led_diskio))   currentleds |= led_get_diskio_activity();
- 
- 	/* blink all LEDs twice a second if we got an Oops (HPMC) */
--	if (oops_in_progress) {
-+	if (unlikely(oops_in_progress)) 
- 		currentleds = (count_HZ<=(HZ/2)) ? 0 : 0xff;
--	}
--	
--	/* update the LCD/LEDs */
--	if (currentleds != lastleds) {
--	    led_func_ptr(currentleds);
--	    lastleds = currentleds;
--	}
--}
- 
--/* main led tasklet struct (scheduled from time.c) */
--DECLARE_TASKLET_DISABLED(led_tasklet, led_tasklet_func, 0);
-+	if (currentleds != lastleds)
-+	{
-+		led_func_ptr(currentleds);	/* Update the LCD/LEDs */
-+		lastleds = currentleds;
-+	}
- 
-+	queue_delayed_work(led_wq, &led_task, LED_UPDATE_INTERVAL);
-+}
- 
- /*
-    ** led_halt()
-@@ -519,9 +510,13 @@
- 	default:		return NOTIFY_DONE;
- 	}
- 	
--	/* completely stop the LED/LCD tasklet */
--	tasklet_disable(&led_tasklet);
--
-+	/* Cancel the work item and delete the queue */
-+	if (led_wq) {
-+		cancel_rearming_delayed_workqueue(led_wq, &led_task);
-+		destroy_workqueue(led_wq);
-+		led_wq = NULL;
-+	}
-+ 
- 	if (lcd_info.model == DISPLAY_MODEL_LCD)
- 		lcd_print(txt);
- 	else
-@@ -556,7 +551,6 @@
- 		printk(KERN_INFO "LCD display at %lx,%lx registered\n", 
- 			LCD_CMD_REG , LCD_DATA_REG);
- 		led_func_ptr = led_LCD_driver;
--		lcd_print( lcd_text_default );
- 		led_type = LED_HASLCD;
- 		break;
- 
-@@ -586,9 +580,11 @@
- 	initialized++;
- 	register_reboot_notifier(&led_notifier);
- 
--	/* start the led tasklet for the first time */
--	tasklet_enable(&led_tasklet);
--	
-+	/* Ensure the work is queued */
-+	if (led_wq) {
-+		queue_work(led_wq, &led_task);
-+	}
-+
- 	return 0;
- }
- 
-@@ -623,8 +619,8 @@
-    ** lcd_print()
-    ** 
-    ** Displays the given string on the LCD-Display of newer machines.
--   ** lcd_print() disables the timer-based led tasklet during its 
--   ** execution and enables it afterwards again.
-+   ** lcd_print() disables/enables the timer-based led work queue to
-+   ** avoid a race condition while writing the CMD/DATA register pair.
-    **
-  */
- int lcd_print( char *str )
-@@ -634,12 +630,13 @@
- 	if (!led_func_ptr || lcd_info.model != DISPLAY_MODEL_LCD)
- 	    return 0;
- 	
--	/* temporarily disable the led tasklet */
--	tasklet_disable(&led_tasklet);
-+	/* temporarily disable the led work task */
-+	if (led_wq)
-+		cancel_rearming_delayed_workqueue(led_wq, &led_task);
- 
- 	/* copy display string to buffer for procfs */
- 	strlcpy(lcd_text, str, sizeof(lcd_text));
--	
-+
- 	/* Set LCD Cursor to 1st character */
- 	gsc_writeb(lcd_info.reset_cmd1, LCD_CMD_REG);
- 	udelay(lcd_info.min_cmd_delay);
-@@ -653,8 +650,10 @@
- 	    udelay(lcd_info.min_cmd_delay);
- 	}
- 	
--	/* re-enable the led tasklet */
--	tasklet_enable(&led_tasklet);
-+	/* re-queue the work */
-+	if (led_wq) {
-+		queue_work(led_wq, &led_task);
-+	}
- 
- 	return lcd_info.lcd_width;
- }
-Index: linux-2.6-2.6.12/drivers/parisc/pdc_stable.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/parisc/pdc_stable.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/parisc/pdc_stable.c	2005-08-09 17:53:35.000000000 -0400
-@@ -536,7 +536,7 @@
- 
- 	out += sprintf(out, "Memory tested: ");
- 	if ((result & 0x0F) < 0x0E)
--		out += sprintf(out, "%.3f MB", 0.256*(1<<(result & 0x0F)));
-+		out += sprintf(out, "%d kB", (1<<(result & 0x0F))*256);
- 	else
- 		out += sprintf(out, "All");
- 	out += sprintf(out, "\n");
-Index: linux-2.6-2.6.12/drivers/parisc/sba_iommu.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/parisc/sba_iommu.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/parisc/sba_iommu.c	2005-08-09 17:53:35.000000000 -0400
-@@ -91,7 +91,7 @@
- #define DBG_RES(x...)
- #endif
- 
--#if defined(__LP64__) && !defined(CONFIG_PDC_NARROW)
-+#if defined(CONFIG_64BIT) && !defined(CONFIG_PDC_NARROW)
- /* "low end" PA8800 machines use ZX1 chipset */
- #define ZX1_SUPPORT
- #endif
-@@ -231,7 +231,7 @@
- 	spinlock_t	res_lock;
- 	unsigned int	res_bitshift;	/* from the LEFT! */
- 	unsigned int	res_size;	/* size of resource map in bytes */
--#if SBA_HINT_SUPPORT
-+#ifdef SBA_HINT_SUPPORT
- /* FIXME : DMA HINTs not used */
- 	unsigned long	hint_mask_pdir;	/* bits used for DMA hints */
- 	unsigned int	hint_shift_pdir;
-@@ -294,7 +294,7 @@
- /* Looks nice and keeps the compiler happy */
- #define SBA_DEV(d) ((struct sba_device *) (d))
- 
--#if SBA_AGP_SUPPORT
-+#ifdef SBA_AGP_SUPPORT
- static int reserve_sba_gart = 1;
- #endif
- 
-@@ -314,7 +314,7 @@
- #define WRITE_REG32(val, addr) __raw_writel(cpu_to_le32(val), addr)
- #define WRITE_REG64(val, addr) __raw_writeq(cpu_to_le64(val), addr)
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- #define READ_REG(addr)		READ_REG64(addr)
- #define WRITE_REG(value, addr)	WRITE_REG64(value, addr)
- #else
-@@ -324,7 +324,7 @@
- 
- #ifdef DEBUG_SBA_INIT
- 
--/* NOTE: When __LP64__ isn't defined, READ_REG64() is two 32-bit reads */
-+/* NOTE: When CONFIG_64BIT isn't defined, READ_REG64() is two 32-bit reads */
- 
- /**
-  * sba_dump_ranges - debugging only - print ranges assigned to this IOA
-@@ -364,7 +364,7 @@
- #else
- #define sba_dump_ranges(x)
- #define sba_dump_tlb(x)
--#endif
-+#endif	/* DEBUG_SBA_INIT */
- 
- 
- #ifdef ASSERT_PDIR_SANITY
-@@ -674,7 +674,7 @@
- *
- ***************************************************************/
- 
--#if SBA_HINT_SUPPORT
-+#ifdef SBA_HINT_SUPPORT
- #define SBA_DMA_HINT(ioc, val) ((val) << (ioc)->hint_shift_pdir)
- #endif
- 
-@@ -819,18 +819,29 @@
- static int sba_dma_supported( struct device *dev, u64 mask)
- {
- 	struct ioc *ioc;
-+
- 	if (dev == NULL) {
- 		printk(KERN_ERR MODULE_NAME ": EISA/ISA/et al not supported\n");
- 		BUG();
- 		return(0);
- 	}
- 
--	ioc = GET_IOC(dev);
-+	/* Documentation/DMA-mapping.txt tells drivers to try 64-bit first,
-+	 * then fall back to 32-bit if that fails.
-+	 * We are just "encouraging" 32-bit DMA masks here since we can
-+	 * never allow IOMMU bypass unless we add special support for ZX1.
-+	 */
-+	if (mask > ~0U)
-+		return 0;
- 
--	/* check if mask is > than the largest IO Virt Address */
-+	ioc = GET_IOC(dev);
- 
--	return((int) (mask >= (ioc->ibase +
--				(ioc->pdir_size / sizeof(u64) * IOVP_SIZE) )));
-+	/*
-+	 * check if mask is >= than the current max IO Virt Address
-+	 * The max IO Virt address will *always* < 30 bits.
-+	 */
-+	return((int)(mask >= (ioc->ibase - 1 +
-+			(ioc->pdir_size / sizeof(u64) * IOVP_SIZE) )));
- }
- 
- 
-@@ -1234,8 +1245,10 @@
- 	unsigned long pdir_order = get_order(pdir_size);
- 
- 	pdir_base = __get_free_pages(GFP_KERNEL, pdir_order);
--	if (NULL == (void *) pdir_base)
--		panic("sba_ioc_init() could not allocate I/O Page Table\n");
-+	if (NULL == (void *) pdir_base)	{
-+		panic("%s() could not allocate I/O Page Table\n",
-+			__FUNCTION__);
-+	}
- 
- 	/* If this is not PA8700 (PCX-W2)
- 	**	OR newer than ver 2.2
-@@ -1343,7 +1356,7 @@
- 	u32 iova_space_mask;
- 	u32 iova_space_size;
- 	int iov_order, tcnfg;
--#if SBA_AGP_SUPPORT
-+#ifdef SBA_AGP_SUPPORT
- 	int agp_found = 0;
- #endif
- 	/*
-@@ -1380,7 +1393,7 @@
- 	DBG_INIT("%s() pdir %p size %x\n",
- 			__FUNCTION__, ioc->pdir_base, ioc->pdir_size);
- 
--#if SBA_HINT_SUPPORT
-+#ifdef SBA_HINT_SUPPORT
- 	ioc->hint_shift_pdir = iov_order + PAGE_SHIFT;
- 	ioc->hint_mask_pdir = ~(0x3 << (iov_order + PAGE_SHIFT));
- 
-@@ -1404,7 +1417,7 @@
- 
- 	WRITE_REG(ioc->imask, ioc->ioc_hpa + IOC_IMASK);
- 
--#ifdef __LP64__
-+#ifdef CONFIG_64BIT
- 	/*
- 	** Setting the upper bits makes checking for bypass addresses
- 	** a little faster later on.
-@@ -1437,7 +1450,7 @@
- 	*/
- 	WRITE_REG(ioc->ibase | 31, ioc->ioc_hpa + IOC_PCOM);
- 
--#if SBA_AGP_SUPPORT
-+#ifdef SBA_AGP_SUPPORT
- 	/*
- 	** If an AGP device is present, only use half of the IOV space
- 	** for PCI DMA.  Unfortunately we can't know ahead of time
-@@ -1489,11 +1502,9 @@
- 	if (iova_space_size < (1 << (20 - PAGE_SHIFT))) {
- 		iova_space_size = 1 << (20 - PAGE_SHIFT);
- 	}
--#ifdef __LP64__
- 	else if (iova_space_size > (1 << (30 - PAGE_SHIFT))) {
- 		iova_space_size = 1 << (30 - PAGE_SHIFT);
- 	}
--#endif
- 
- 	/*
- 	** iova space must be log2() in size.
-@@ -1519,7 +1530,7 @@
- 	DBG_INIT("%s() pdir %p size %x\n",
- 			__FUNCTION__, ioc->pdir_base, pdir_size);
- 
--#if SBA_HINT_SUPPORT
-+#ifdef SBA_HINT_SUPPORT
- 	/* FIXME : DMA HINTs not used */
- 	ioc->hint_shift_pdir = iov_order + PAGE_SHIFT;
- 	ioc->hint_mask_pdir = ~(0x3 << (iov_order + PAGE_SHIFT));
-Index: linux-2.6-2.6.12/drivers/pcmcia/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/pcmcia/Kconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/pcmcia/Kconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -166,7 +166,11 @@
- 
- config PCMCIA_PROBE
- 	bool
--	default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X
-+	default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X && !PARISC
-+
-+config PCMCIA_PROBE_MEM
-+	bool
-+	default y if !PARISC
- 
- config M32R_PCC
- 	bool "M32R PCMCIA I/F"
-Index: linux-2.6-2.6.12/drivers/pcmcia/rsrc_nonstatic.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/pcmcia/rsrc_nonstatic.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/pcmcia/rsrc_nonstatic.c	2005-08-09 17:53:35.000000000 -0400
-@@ -43,7 +43,11 @@
- 
- #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
- 
-+#ifdef CONFIG_PCMCIA_PROBE_MEM
- INT_MODULE_PARM(probe_mem,	1);		/* memory probe? */
-+#else
-+INT_MODULE_PARM(probe_mem,	0);		/* memory probe? */
-+#endif
- #ifdef CONFIG_PCMCIA_PROBE
- INT_MODULE_PARM(probe_io,	1);		/* IO port probe? */
- INT_MODULE_PARM(mem_limit,	0x10000);
-Index: linux-2.6-2.6.12/drivers/scsi/53c700.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/53c700.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/53c700.c	2005-08-09 17:53:35.000000000 -0400
-@@ -302,6 +302,7 @@
- 	__u8 *memory;
- 	__u32 *script;
- 	struct Scsi_Host *host;
-+	const char *chipname;
- 	static int banner = 0;
- 	int j;
- 
-@@ -403,11 +404,11 @@
- 		printk(KERN_NOTICE "53c700: Version " NCR_700_VERSION " By James.Bottomley at HansenPartnership.com\n");
- 		banner = 1;
- 	}
-+	chipname = hostdata->chip710 ? "53c710" : \
-+		   (hostdata->fast ? "53c700-66" : "53c700");
- 	printk(KERN_NOTICE "scsi%d: %s rev %d %s\n", host->host_no,
--	       hostdata->chip710 ? "53c710" : 
--	       (hostdata->fast ? "53c700-66" : "53c700"),
--	       hostdata->rev, hostdata->differential ?
--	       "(Differential)" : "");
-+			chipname, hostdata->rev,
-+			hostdata->differential ?  "(Differential)" : "");
- 	/* reset the chip */
- 	NCR_700_chip_reset(host);
- 
-Index: linux-2.6-2.6.12/drivers/scsi/lasi700.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/lasi700.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/lasi700.c	2005-08-09 17:53:35.000000000 -0400
-@@ -125,8 +125,6 @@
- 		hostdata->dmode_extra = DMODE_FC2;
- 	}
- 
--	NCR_700_set_mem_mapped(hostdata);
--
- 	host = NCR_700_detect(&lasi700_template, hostdata, &dev->dev);
- 	if (!host)
- 		goto out_kfree;
-Index: linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_defs.h
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/sym53c8xx_2/sym_defs.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_defs.h	2005-08-09 17:53:35.000000000 -0400
-@@ -40,7 +40,7 @@
- #ifndef SYM_DEFS_H
- #define SYM_DEFS_H
- 
--#define SYM_VERSION "2.2.0"
-+#define SYM_VERSION "2.2.1"
- #define SYM_DRIVER_NAME	"sym-" SYM_VERSION
- 
- /*
-Index: linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_glue.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/sym53c8xx_2/sym_glue.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_glue.c	2005-08-09 17:53:35.000000000 -0400
-@@ -155,10 +155,11 @@
- 	base = tmp;
- 	if ((tmp & 0x7) == PCI_BASE_ADDRESS_MEM_TYPE_64) {
- 		pci_read_config_dword(pdev, PCI_BAR_OFFSET(index++), &tmp);
--		if (tmp > 0)
-+		if (tmp > 0) {
- 			dev_err(&pdev->dev,
- 				"BAR %d is 64-bit, disabling\n", index - 1);
--		base = 0;
-+			base = 0;
-+		}
- 	}
- 
- 	if ((base & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) {
-@@ -389,13 +390,20 @@
- {
- 	struct sym_tblmove *data = &cp->phys.data[SYM_CONF_MAX_SG-1];
- 	int segment;
-+	unsigned int len = cmd->request_bufflen;
- 
--	cp->data_len = cmd->request_bufflen;
--
--	if (cmd->request_bufflen) {
-+	if (len) {
- 		dma_addr_t baddr = map_scsi_single_data(np, cmd);
- 		if (baddr) {
--			sym_build_sge(np, data, baddr, cmd->request_bufflen);
-+			if (len & 1) {
-+				struct sym_tcb *tp = &np->target[cp->target];
-+				if (tp->head.wval & EWS) {
-+					len++;
-+					cp->odd_byte_adjustment++;
-+				}
-+			}
-+			cp->data_len = len;
-+			sym_build_sge(np, data, baddr, len);
- 			segment = 1;
- 		} else {
- 			segment = -2;
-@@ -418,6 +426,7 @@
- 		segment = sym_scatter_no_sglist(np, cp, cmd);
- 	else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) {
- 		struct scatterlist *scatter = (struct scatterlist *)cmd->buffer;
-+		struct sym_tcb *tp = &np->target[cp->target];
- 		struct sym_tblmove *data;
- 
- 		if (use_sg > SYM_CONF_MAX_SG) {
-@@ -431,6 +440,11 @@
- 			dma_addr_t baddr = sg_dma_address(&scatter[segment]);
- 			unsigned int len = sg_dma_len(&scatter[segment]);
- 
-+			if ((len & 1) && (tp->head.wval & EWS)) {
-+				len++;
-+				cp->odd_byte_adjustment++;
-+			}
-+
- 			sym_build_sge(np, &data[segment], baddr, len);
- 			cp->data_len += len;
- 		}
-@@ -456,10 +470,8 @@
- 	 *  Minimal checkings, so that we will not 
- 	 *  go outside our tables.
- 	 */
--	if (sdev->id == np->myaddr ||
--	    sdev->id >= SYM_CONF_MAX_TARGET ||
--	    sdev->lun >= SYM_CONF_MAX_LUN) {
--		sym_xpt_done2(np, cmd, CAM_DEV_NOT_THERE);
-+	if (sdev->id == np->myaddr) {
-+		sym_xpt_done2(np, cmd, DID_NO_CONNECT);
- 		return 0;
- 	}
- 
-@@ -469,28 +481,6 @@
- 	tp = &np->target[sdev->id];
- 
- 	/*
--	 *  Complete the 1st INQUIRY command with error 
--	 *  condition if the device is flagged NOSCAN 
--	 *  at BOOT in the NVRAM. This may speed up 
--	 *  the boot and maintain coherency with BIOS 
--	 *  device numbering. Clearing the flag allows 
--	 *  user to rescan skipped devices later.
--	 *  We also return error for devices not flagged 
--	 *  for SCAN LUNS in the NVRAM since some mono-lun 
--	 *  devices behave badly when asked for some non 
--	 *  zero LUN. Btw, this is an absolute hack.:-)
--	 */
--	if (cmd->cmnd[0] == 0x12 || cmd->cmnd[0] == 0x0) {
--		if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) ||
--		    ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) && 
--		     sdev->lun != 0)) {
--			tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED;
--			sym_xpt_done2(np, cmd, CAM_DEV_NOT_THERE);
--			return 0;
--		}
--	}
--
--	/*
- 	 *  Select tagged/untagged.
- 	 */
- 	lp = sym_lp(tp, sdev->lun);
-@@ -511,23 +501,10 @@
-  */
- static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp)
- {
--	u32	cmd_ba;
--	int	cmd_len;
--
--	/*
--	 *  CDB is 16 bytes max.
--	 */
--	if (cmd->cmd_len > sizeof(cp->cdb_buf)) {
--		sym_set_cam_status(cp->cmd, CAM_REQ_INVALID);
--		return -1;
--	}
--
- 	memcpy(cp->cdb_buf, cmd->cmnd, cmd->cmd_len);
--	cmd_ba  = CCB_BA (cp, cdb_buf[0]);
--	cmd_len = cmd->cmd_len;
- 
--	cp->phys.cmd.addr	= cpu_to_scr(cmd_ba);
--	cp->phys.cmd.size	= cpu_to_scr(cmd_len);
-+	cp->phys.cmd.addr = CCB_BA(cp, cdb_buf[0]);
-+	cp->phys.cmd.size = cpu_to_scr(cmd->cmd_len);
- 
- 	return 0;
- }
-@@ -554,10 +531,7 @@
- 	if (dir != DMA_NONE) {
- 		cp->segments = sym_scatter(np, cp, cmd);
- 		if (cp->segments < 0) {
--			if (cp->segments == -2)
--				sym_set_cam_status(cmd, CAM_RESRC_UNAVAIL);
--			else
--				sym_set_cam_status(cmd, CAM_REQ_TOO_BIG);
-+			sym_set_cam_status(cmd, DID_ERROR);
- 			goto out_abort;
- 		}
- 	} else {
-@@ -855,7 +829,7 @@
- 	ep->to_do = to_do;
- 	/* Complete the command with locks held as required by the driver */
- 	if (to_do == SYM_EH_DO_COMPLETE)
--		sym_xpt_done2(np, cmd, CAM_REQ_ABORTED);
-+		sym_xpt_done2(np, cmd, DID_ABORT);
- 
- 	/* Wait for completion with locks released, as required by kernel */
- 	if (to_do == SYM_EH_DO_WAIT) {
-@@ -921,7 +895,7 @@
- 	lp->s.reqtags     = reqtags;
- 
- 	if (reqtags != oldtags) {
--		dev_info(&tp->sdev->sdev_target->dev,
-+		dev_info(&tp->starget->dev,
- 		         "tagged command queuing %s, command queue depth %d.\n",
- 		          lp->s.reqtags ? "enabled" : "disabled",
-  		          lp->started_limit);
-@@ -981,22 +955,34 @@
- 	return DEF_DEPTH;
- }
- 
--static int sym53c8xx_slave_alloc(struct scsi_device *device)
-+static int sym53c8xx_slave_alloc(struct scsi_device *sdev)
- {
--	struct sym_hcb *np = sym_get_hcb(device->host);
--	struct sym_tcb *tp = &np->target[device->id];
--	if (!tp->sdev)
--		tp->sdev = device;
-+	struct sym_hcb *np;
-+	struct sym_tcb *tp;
- 
--	return 0;
--}
-+	if (sdev->id >= SYM_CONF_MAX_TARGET || sdev->lun >= SYM_CONF_MAX_LUN)
-+		return -ENXIO;
- 
--static void sym53c8xx_slave_destroy(struct scsi_device *device)
--{
--	struct sym_hcb *np = sym_get_hcb(device->host);
--	struct sym_tcb *tp = &np->target[device->id];
--	if (tp->sdev == device)
--		tp->sdev = NULL;
-+	np = sym_get_hcb(sdev->host);
-+	tp = &np->target[sdev->id];
-+
-+	/*
-+	 * Fail the device init if the device is flagged NOSCAN at BOOT in
-+	 * the NVRAM.  This may speed up boot and maintain coherency with
-+	 * BIOS device numbering.  Clearing the flag allows the user to
-+	 * rescan skipped devices later.  We also return an error for
-+	 * devices not flagged for SCAN LUNS in the NVRAM since some single
-+	 * lun devices behave badly when asked for a non zero LUN.
-+	 */
-+
-+	if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) ||
-+	    ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) && sdev->lun != 0)) {
-+		tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED;
-+		return -ENXIO;
-+	}
-+
-+	tp->starget = sdev->sdev_target;
-+	return 0;
- }
- 
- /*
-@@ -1897,6 +1883,7 @@
- 	 */
- 	printk("%s: resetting chip\n", sym_name(np));
- 	OUTB(np, nc_istat, SRST);
-+	INB(np, nc_mbox1);
- 	udelay(10);
- 	OUTB(np, nc_istat, 0);
- 
-@@ -1915,7 +1902,6 @@
- 	.queuecommand		= sym53c8xx_queue_command,
- 	.slave_alloc		= sym53c8xx_slave_alloc,
- 	.slave_configure	= sym53c8xx_slave_configure,
--	.slave_destroy		= sym53c8xx_slave_destroy,
- 	.eh_abort_handler	= sym53c8xx_eh_abort_handler,
- 	.eh_device_reset_handler = sym53c8xx_eh_device_reset_handler,
- 	.eh_bus_reset_handler	= sym53c8xx_eh_bus_reset_handler,
-Index: linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_glue.h
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/sym53c8xx_2/sym_glue.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_glue.h	2005-08-09 17:53:35.000000000 -0400
-@@ -142,33 +142,6 @@
- #define scr_to_cpu(dw)	le32_to_cpu(dw)
- 
- /*
-- *  Remap some status field values.
-- */
--#define CAM_REQ_CMP		DID_OK
--#define CAM_SEL_TIMEOUT		DID_NO_CONNECT
--#define CAM_CMD_TIMEOUT		DID_TIME_OUT
--#define CAM_REQ_ABORTED		DID_ABORT
--#define CAM_UNCOR_PARITY	DID_PARITY
--#define CAM_SCSI_BUS_RESET	DID_RESET	
--#define CAM_REQUEUE_REQ		DID_SOFT_ERROR
--#define	CAM_UNEXP_BUSFREE	DID_ERROR
--#define	CAM_SCSI_BUSY		DID_BUS_BUSY
--
--#define	CAM_DEV_NOT_THERE	DID_NO_CONNECT
--#define	CAM_REQ_INVALID		DID_ERROR
--#define	CAM_REQ_TOO_BIG		DID_ERROR
--
--#define	CAM_RESRC_UNAVAIL	DID_ERROR
--
--/*
-- *  Remap data direction values.
-- */
--#define CAM_DIR_NONE		DMA_NONE
--#define CAM_DIR_IN		DMA_FROM_DEVICE
--#define CAM_DIR_OUT		DMA_TO_DEVICE
--#define CAM_DIR_UNKNOWN		DMA_BIDIRECTIONAL
--
--/*
-  *  These ones are used as return code from 
-  *  error recovery handlers under Linux.
-  */
-Index: linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_hipd.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/sym53c8xx_2/sym_hipd.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_hipd.c	2005-08-09 17:53:35.000000000 -0400
-@@ -97,7 +97,7 @@
- static void sym_print_nego_msg(struct sym_hcb *np, int target, char *label, u_char *msg)
- {
- 	struct sym_tcb *tp = &np->target[target];
--	dev_info(&tp->sdev->sdev_target->dev, "%s: ", label);
-+	dev_info(&tp->starget->dev, "%s: ", label);
- 
- 	sym_show_msg(msg);
- 	printf(".\n");
-@@ -149,8 +149,10 @@
- static void sym_chip_reset (struct sym_hcb *np)
- {
- 	OUTB(np, nc_istat, SRST);
-+	INB(np, nc_mbox1);
- 	udelay(10);
- 	OUTB(np, nc_istat, 0);
-+	INB(np, nc_mbox1);
- 	udelay(2000);	/* For BUS MODE to settle */
- }
- 
-@@ -216,6 +218,7 @@
- 	OUTB(np, nc_stest3, TE);
- 	OUTB(np, nc_dcntl, (np->rv_dcntl & IRQM));
- 	OUTB(np, nc_scntl1, CRST);
-+	INB(np, nc_mbox1);
- 	udelay(200);
- 
- 	if (!SYM_SETUP_SCSI_BUS_CHECK)
-@@ -280,8 +283,10 @@
- 		if (!i)
- 			printf("%s: the chip cannot lock the frequency\n",
- 				sym_name(np));
--	} else
--		udelay((50+10));
-+	} else {
-+		INB(np, nc_mbox1);
-+		udelay(50+10);
-+	}
- 	OUTB(np, nc_stest3, HSC);		/* Halt the scsi clock	*/
- 	OUTB(np, nc_scntl3, scntl3);
- 	OUTB(np, nc_stest1, (DBLEN|DBLSEL));/* Select clock multiplier	*/
-@@ -1445,7 +1450,7 @@
- static int sym_prepare_nego(struct sym_hcb *np, struct sym_ccb *cp, u_char *msgptr)
- {
- 	struct sym_tcb *tp = &np->target[cp->target];
--	struct scsi_target *starget = tp->sdev->sdev_target;
-+	struct scsi_target *starget = tp->starget;
- 	struct sym_trans *goal = &tp->tgoal;
- 	int msglen = 0;
- 	int nego;
-@@ -1690,7 +1695,7 @@
- 		if (cam_status)
- 			sym_set_cam_status(cmd, cam_status);
- #ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING
--		if (sym_get_cam_status(cmd) == CAM_REQUEUE_REQ) {
-+		if (sym_get_cam_status(cmd) == DID_SOFT_ERROR) {
- 			struct sym_tcb *tp = &np->target[cp->target];
- 			struct sym_lcb *lp = sym_lp(tp, cp->lun);
- 			if (lp) {
-@@ -1791,12 +1796,13 @@
- 	/*
- 	 *  Wakeup all pending jobs.
- 	 */
--	sym_flush_busy_queue(np, CAM_SCSI_BUS_RESET);
-+	sym_flush_busy_queue(np, DID_RESET);
- 
- 	/*
- 	 *  Init chip.
- 	 */
- 	OUTB(np, nc_istat,  0x00);			/*  Remove Reset, abort */
-+	INB(np, nc_mbox1);
- 	udelay(2000); /* The 895 needs time for the bus mode to settle */
- 
- 	OUTB(np, nc_scntl0, np->rv_scntl0 | 0xc0);
-@@ -1905,6 +1911,7 @@
- 	if (np->features & (FE_ULTRA2|FE_ULTRA3)) {
- 		OUTONW(np, nc_sien, SBMC);
- 		if (reason == 0) {
-+			INB(np, nc_mbox1);
- 			mdelay(100);
- 			INW(np, nc_sist);
- 		}
-@@ -2074,7 +2081,7 @@
- static void sym_setwide(struct sym_hcb *np, int target, u_char wide)
- {
- 	struct sym_tcb *tp = &np->target[target];
--	struct scsi_target *starget = tp->sdev->sdev_target;
-+	struct scsi_target *starget = tp->starget;
- 
- 	if (spi_width(starget) == wide)
- 		return;
-@@ -2102,7 +2109,7 @@
-             u_char ofs, u_char per, u_char div, u_char fak)
- {
- 	struct sym_tcb *tp = &np->target[target];
--	struct scsi_target *starget = tp->sdev->sdev_target;
-+	struct scsi_target *starget = tp->starget;
- 	u_char wide = (tp->head.wval & EWS) ? BUS_16_BIT : BUS_8_BIT;
- 
- 	sym_settrans(np, target, 0, ofs, per, wide, div, fak);
-@@ -2129,7 +2136,7 @@
-              u_char per, u_char wide, u_char div, u_char fak)
- {
- 	struct sym_tcb *tp = &np->target[target];
--	struct scsi_target *starget = tp->sdev->sdev_target;
-+	struct scsi_target *starget = tp->starget;
- 
- 	sym_settrans(np, target, opts, ofs, per, wide, div, fak);
- 
-@@ -2944,7 +2951,7 @@
-  *  Dequeue from the START queue all CCBs that match 
-  *  a given target/lun/task condition (-1 means all),
-  *  and move them from the BUSY queue to the COMP queue 
-- *  with CAM_REQUEUE_REQ status condition.
-+ *  with DID_SOFT_ERROR status condition.
-  *  This function is used during error handling/recovery.
-  *  It is called with SCRIPTS not running.
-  */
-@@ -2974,7 +2981,7 @@
- 		if ((target == -1 || cp->target == target) &&
- 		    (lun    == -1 || cp->lun    == lun)    &&
- 		    (task   == -1 || cp->tag    == task)) {
--			sym_set_cam_status(cp->cmd, CAM_REQUEUE_REQ);
-+			sym_set_cam_status(cp->cmd, DID_SOFT_ERROR);
- 			sym_remque(&cp->link_ccbq);
- 			sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq);
- 		}
-@@ -3093,13 +3100,13 @@
- 		/*
- 		 *  Message table indirect structure.
- 		 */
--		cp->phys.smsg.addr	= cpu_to_scr(CCB_BA(cp, scsi_smsg2));
-+		cp->phys.smsg.addr	= CCB_BA(cp, scsi_smsg2);
- 		cp->phys.smsg.size	= cpu_to_scr(msglen);
- 
- 		/*
- 		 *  sense command
- 		 */
--		cp->phys.cmd.addr	= cpu_to_scr(CCB_BA(cp, sensecmd));
-+		cp->phys.cmd.addr	= CCB_BA(cp, sensecmd);
- 		cp->phys.cmd.size	= cpu_to_scr(6);
- 
- 		/*
-@@ -3116,7 +3123,7 @@
- 		 *  sense data
- 		 */
- 		memset(cp->sns_bbuf, 0, SYM_SNS_BBUF_LEN);
--		cp->phys.sense.addr	= cpu_to_scr(CCB_BA(cp, sns_bbuf));
-+		cp->phys.sense.addr	= CCB_BA(cp, sns_bbuf);
- 		cp->phys.sense.size	= cpu_to_scr(SYM_SNS_BBUF_LEN);
- 
- 		/*
-@@ -3198,7 +3205,7 @@
- 		sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq);
- 
- 		/* Preserve the software timeout condition */
--		if (sym_get_cam_status(cmd) != CAM_CMD_TIMEOUT)
-+		if (sym_get_cam_status(cmd) != DID_TIME_OUT)
- 			sym_set_cam_status(cmd, cam_status);
- 		++i;
- #if 0
-@@ -3366,7 +3373,7 @@
- 		 *  Make sure at least our IO to abort has been dequeued.
- 		 */
- #ifndef SYM_OPT_HANDLE_DEVICE_QUEUEING
--		assert(i && sym_get_cam_status(cp->cmd) == CAM_REQUEUE_REQ);
-+		assert(i && sym_get_cam_status(cp->cmd) == DID_SOFT_ERROR);
- #else
- 		sym_remque(&cp->link_ccbq);
- 		sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq);
-@@ -3375,9 +3382,9 @@
- 		 *  Keep track in cam status of the reason of the abort.
- 		 */
- 		if (cp->to_abort == 2)
--			sym_set_cam_status(cp->cmd, CAM_CMD_TIMEOUT);
-+			sym_set_cam_status(cp->cmd, DID_TIME_OUT);
- 		else
--			sym_set_cam_status(cp->cmd, CAM_REQ_ABORTED);
-+			sym_set_cam_status(cp->cmd, DID_ABORT);
- 
- 		/*
- 		 *  Complete with error everything that we have dequeued.
-@@ -3491,7 +3498,7 @@
- 		 *  conditions not due to timeout.
- 		 */
- 		if (cp->to_abort == 2)
--			sym_set_cam_status(cp->cmd, CAM_CMD_TIMEOUT);
-+			sym_set_cam_status(cp->cmd, DID_TIME_OUT);
- 		cp->to_abort = 0; /* We donnot expect to fail here */
- 		break;
- 
-@@ -3502,7 +3509,7 @@
- 	case SIR_ABORT_SENT:
- 		target = INB(np, nc_sdid) & 0xf;
- 		tp = &np->target[target];
--		starget = tp->sdev->sdev_target;
-+		starget = tp->starget;
- 		
- 		/*
- 		**  If we didn't abort anything, leave here.
-@@ -3551,7 +3558,7 @@
- 		 */
- 		i = (INL(np, nc_scratcha) - np->squeue_ba) / 4;
- 		sym_dequeue_from_squeue(np, i, target, lun, -1);
--		sym_clear_tasks(np, CAM_REQ_ABORTED, target, lun, task);
-+		sym_clear_tasks(np, DID_ABORT, target, lun, task);
- 		sym_flush_comp_queue(np, 0);
- 
-  		/*
-@@ -3566,7 +3573,7 @@
- 	 *  Print to the log the message we intend to send.
- 	 */
- 	if (num == SIR_TARGET_SELECTED) {
--		dev_info(&tp->sdev->sdev_target->dev, "control msgout:");
-+		dev_info(&tp->starget->dev, "control msgout:");
- 		sym_printl_hex(np->abrt_msg, np->abrt_tbl.size);
- 		np->abrt_tbl.size = cpu_to_scr(np->abrt_tbl.size);
- 	}
-@@ -3877,6 +3884,8 @@
- 		resid += (tmp & 0xffffff);
- 	}
- 
-+	resid -= cp->odd_byte_adjustment;
-+
- 	/*
- 	 *  Hopefully, the result is not too wrong.
- 	 */
-@@ -4758,10 +4767,8 @@
- 	}
- 
- #endif
--	/*
--	 *  Remember all informations needed to free this CCB.
--	 */
- 	cp->to_abort = 0;
-+	cp->odd_byte_adjustment = 0;
- 	cp->tag	   = tag;
- 	cp->order  = tag_order;
- 	cp->target = tn;
-@@ -5104,7 +5111,7 @@
- 	lp->itlq_tbl = sym_calloc_dma(SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
- 	if (!lp->itlq_tbl)
- 		goto fail;
--	lp->cb_tags = kcalloc(SYM_CONF_MAX_TASK, 1, GFP_KERNEL);
-+	lp->cb_tags = kcalloc(SYM_CONF_MAX_TASK, 1, GFP_ATOMIC);
- 	if (!lp->cb_tags) {
- 		sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
- 		lp->itlq_tbl = NULL;
-@@ -5243,7 +5250,7 @@
- 	/*
- 	 *  message
- 	 */
--	cp->phys.smsg.addr	= cpu_to_scr(CCB_BA(cp, scsi_smsg));
-+	cp->phys.smsg.addr	= CCB_BA(cp, scsi_smsg);
- 	cp->phys.smsg.size	= cpu_to_scr(msglen);
- 
- 	/*
-@@ -5343,7 +5350,7 @@
- }
- 
- /*
-- *  Complete execution of a SCSI command with extented 
-+ *  Complete execution of a SCSI command with extended 
-  *  error, SCSI status error, or having been auto-sensed.
-  *
-  *  The SCRIPTS processor is not running there, so we 
-@@ -5441,7 +5448,7 @@
- 		/*
- 		 *  Let's requeue it to device.
- 		 */
--		sym_set_cam_status(cmd, CAM_REQUEUE_REQ);
-+		sym_set_cam_status(cmd, DID_SOFT_ERROR);
- 		goto finish;
- 	}
- weirdness:
-Index: linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_hipd.h
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/sym53c8xx_2/sym_hipd.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_hipd.h	2005-08-09 17:53:35.000000000 -0400
-@@ -444,7 +444,7 @@
- 	 */
- 	u_char	usrflags;
- 	u_short	usrtags;
--	struct scsi_device *sdev;
-+	struct scsi_target *starget;
- };
- 
- /*
-@@ -754,10 +754,8 @@
- 	int	segments;	/* Number of SG segments	*/
- 
- 	u8	order;		/* Tag type (if tagged command)	*/
-+	unsigned char odd_byte_adjustment;	/* odd-sized req on wide bus */
- 
--	/*
--	 *  Miscellaneous status'.
--	 */
- 	u_char	nego_status;	/* Negotiation status		*/
- 	u_char	xerr_status;	/* Extended error flags		*/
- 	u32	extra_bytes;	/* Extraneous bytes transferred	*/
-@@ -809,7 +807,7 @@
- #endif
- };
- 
--#define CCB_BA(cp,lbl)	(cp->ccb_ba + offsetof(struct sym_ccb, lbl))
-+#define CCB_BA(cp,lbl)	cpu_to_scr(cp->ccb_ba + offsetof(struct sym_ccb, lbl))
- 
- #ifdef	SYM_OPT_HANDLE_DIR_UNKNOWN
- #define	sym_goalp(cp) ((cp->host_flags & HF_DATA_IN) ? cp->goalp : cp->wgoalp)
-@@ -1138,33 +1136,33 @@
- 	 *  No segments means no data.
- 	 */
- 	if (!cp->segments)
--		dir = CAM_DIR_NONE;
-+		dir = DMA_NONE;
- 
- 	/*
- 	 *  Set the data pointer.
- 	 */
- 	switch(dir) {
- #ifdef	SYM_OPT_HANDLE_DIR_UNKNOWN
--	case CAM_DIR_UNKNOWN:
-+	case DMA_BIDIRECTIONAL:
- #endif
--	case CAM_DIR_OUT:
-+	case DMA_TO_DEVICE:
- 		goalp = SCRIPTA_BA(np, data_out2) + 8;
- 		lastp = goalp - 8 - (cp->segments * (2*4));
- #ifdef	SYM_OPT_HANDLE_DIR_UNKNOWN
- 		cp->wgoalp = cpu_to_scr(goalp);
--		if (dir != CAM_DIR_UNKNOWN)
-+		if (dir != DMA_BIDIRECTIONAL)
- 			break;
- 		cp->phys.head.wlastp = cpu_to_scr(lastp);
- 		/* fall through */
- #else
- 		break;
- #endif
--	case CAM_DIR_IN:
-+	case DMA_FROM_DEVICE:
- 		cp->host_flags |= HF_DATA_IN;
- 		goalp = SCRIPTA_BA(np, data_in2) + 8;
- 		lastp = goalp - 8 - (cp->segments * (2*4));
- 		break;
--	case CAM_DIR_NONE:
-+	case DMA_NONE:
- 	default:
- #ifdef	SYM_OPT_HANDLE_DIR_UNKNOWN
- 		cp->host_flags |= HF_DATA_IN;
-@@ -1185,7 +1183,7 @@
- 	/*
- 	 *  If direction is unknown, start at data_io.
- 	 */
--	if (dir == CAM_DIR_UNKNOWN)
-+	if (dir == DMA_BIDIRECTIONAL)
- 		cp->phys.head.savep = cpu_to_scr(SCRIPTB_BA(np, data_io));
- #endif
- }
-Index: linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_nvram.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/scsi/sym53c8xx_2/sym_nvram.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/scsi/sym53c8xx_2/sym_nvram.c	2005-08-09 17:53:35.000000000 -0400
-@@ -270,6 +270,7 @@
- 
- 	}
- 	OUTB(np, nc_gpreg, *gpreg);
-+	INB(np, nc_mbox1);
- 	udelay(5);
- }
- 
-@@ -547,6 +548,7 @@
- static void T93C46_Clk(struct sym_device *np, u_char *gpreg)
- {
- 	OUTB(np, nc_gpreg, *gpreg | 0x04);
-+	INB(np, nc_mbox1);
- 	udelay(2);
- 	OUTB(np, nc_gpreg, *gpreg);
- }
-@@ -574,6 +576,7 @@
- 	*gpreg |= 0x10;
- 		
- 	OUTB(np, nc_gpreg, *gpreg);
-+	INB(np, nc_mbox1);
- 	udelay(2);
- 
- 	T93C46_Clk(np, gpreg);
-@@ -586,6 +589,7 @@
- {
- 	*gpreg &= 0xef;
- 	OUTB(np, nc_gpreg, *gpreg);
-+	INB(np, nc_mbox1);
- 	udelay(2);
- 
- 	T93C46_Clk(np, gpreg);
-@@ -733,7 +737,8 @@
- 	return SYM_PARISC_PDC;
- }
- #else
--static int sym_read_parisc_pdc(struct sym_device *np, struct pdc_initiator *x)
-+static inline int sym_read_parisc_pdc(struct sym_device *np,
-+					struct pdc_initiator *x)
- {
- 	return 0;
- }
-Index: linux-2.6-2.6.12/drivers/serial/mux.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/serial/mux.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/serial/mux.c	2005-08-09 17:53:35.000000000 -0400
-@@ -27,6 +27,7 @@
- #include <linux/delay.h> /* for udelay */
- #include <linux/device.h>
- #include <asm/io.h>
-+#include <asm/irq.h>
- #include <asm/parisc-device.h>
- 
- #ifdef CONFIG_MAGIC_SYSRQ
-@@ -475,7 +476,7 @@
- 		port->membase	= ioremap(port->mapbase, MUX_LINE_OFFSET);
- 		port->iotype	= SERIAL_IO_MEM;
- 		port->type	= PORT_MUX;
--		port->irq	= SERIAL_IRQ_NONE;
-+		port->irq	= NO_IRQ;
- 		port->uartclk	= 0;
- 		port->fifosize	= MUX_FIFO_SIZE;
- 		port->ops	= &mux_pops;
-Index: linux-2.6-2.6.12/drivers/serial/serial_core.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/serial/serial_core.c	2005-08-09 17:50:50.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/serial/serial_core.c	2005-08-09 17:53:35.000000000 -0400
-@@ -1930,7 +1930,14 @@
- 		printk("MMIO 0x%lx", port->mapbase);
- 		break;
- 	}
--	printk(" (irq = %d) is a %s\n", port->irq, uart_type(port));
-+#ifndef NO_IRQ
-+#define NO_IRQ (-1)
-+#endif
-+	if (port->irq == NO_IRQ) {
-+		printk(" (polled) is a %s\n", uart_type(port));
-+	} else {
-+		printk(" (irq = %d) is a %s\n", port->irq, uart_type(port));
-+	}
- }
- 
- static void
-Index: linux-2.6-2.6.12/drivers/usb/input/hid-core.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/usb/input/hid-core.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/usb/input/hid-core.c	2005-08-09 17:53:35.000000000 -0400
-@@ -759,21 +759,31 @@
- }
- 
- /*
-- * Extract/implement a data field from/to a report.
-+ * Extract/implement a data field from/to a little endian report (bit array).
-  */
- 
- static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
- {
--	report += (offset >> 5) << 2; offset &= 31;
--	return (le64_to_cpu(get_unaligned((__le64*)report)) >> offset) & ((1 << n) - 1);
-+	u32 x;
-+
-+	report += offset >> 3;  /* adjust byte index */
-+	offset &= 8 - 1;
-+	x = get_unaligned((u32 *) report);
-+	x = le32_to_cpu(x);
-+	x = (x >> offset) & ((1 << n) - 1);
-+	return x;
- }
- 
- static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)
- {
--	report += (offset >> 5) << 2; offset &= 31;
--	put_unaligned((get_unaligned((__le64*)report)
--		& cpu_to_le64(~((((__u64) 1 << n) - 1) << offset)))
--		| cpu_to_le64((__u64)value << offset), (__le64*)report);
-+	u32 x;
-+
-+	report += offset >> 3;
-+	offset &= 8 - 1;
-+	x = get_unaligned((u32 *)report);
-+	x &= cpu_to_le32(~((((__u32) 1 << n) - 1) << offset));
-+	x |= cpu_to_le32(value << offset);
-+	put_unaligned(x,(u32 *)report);
- }
- 
- /*
-Index: linux-2.6-2.6.12/drivers/usb/storage/transport.c
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/usb/storage/transport.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/usb/storage/transport.c	2005-08-09 17:53:35.000000000 -0400
-@@ -266,8 +266,9 @@
- 		NULL, 0, 3*HZ);
- 
- 	/* reset the endpoint toggle */
--	usb_settoggle(us->pusb_dev, usb_pipeendpoint(pipe),
--		usb_pipeout(pipe), 0);
-+	if (result >= 0)
-+		usb_settoggle(us->pusb_dev, usb_pipeendpoint(pipe),
-+				usb_pipeout(pipe), 0);
- 
- 	US_DEBUGP("%s: result = %d\n", __FUNCTION__, result);
- 	return result;
-@@ -1124,7 +1125,7 @@
-  * It's handy that every transport mechanism uses the control endpoint for
-  * resets.
-  *
-- * Basically, we send a reset with a 20-second timeout, so we don't get
-+ * Basically, we send a reset with a 5-second timeout, so we don't get
-  * jammed attempting to do the reset.
-  */
- static int usb_stor_reset_common(struct us_data *us,
-@@ -1145,13 +1146,9 @@
- 	clear_bit(US_FLIDX_ABORTING, &us->flags);
- 	scsi_unlock(us_to_host(us));
- 
--	/* A 20-second timeout may seem rather long, but a LaCie
--	 * StudioDrive USB2 device takes 16+ seconds to get going
--	 * following a powerup or USB attach event.
--	 */
- 	result = usb_stor_control_msg(us, us->send_ctrl_pipe,
- 			request, requesttype, value, index, data, size,
--			20*HZ);
-+			5*HZ);
- 	if (result < 0) {
- 		US_DEBUGP("Soft reset failed: %d\n", result);
- 		goto Done;
-@@ -1173,8 +1170,10 @@
- 	US_DEBUGP("Soft reset: clearing bulk-out endpoint halt\n");
- 	result2 = usb_stor_clear_halt(us, us->send_bulk_pipe);
- 
--	/* return a result code based on the result of the control message */
--	if (result < 0 || result2 < 0) {
-+	/* return a result code based on the result of the clear-halts */
-+	if (result >= 0)
-+		result = result2;
-+	if (result < 0) {
- 		US_DEBUGP("Soft reset failed\n");
- 		goto Done;
- 	}
-Index: linux-2.6-2.6.12/drivers/video/console/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/drivers/video/console/Kconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/drivers/video/console/Kconfig	2005-08-09 17:53:35.000000000 -0400
-@@ -110,7 +110,7 @@
- 
- config FONTS
- 	bool "Select compiled-in fonts"
--	depends on FRAMEBUFFER_CONSOLE
-+	depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE
- 	help
- 	  Say Y here if you would like to use fonts other than the default
- 	  your frame buffer console usually use.
-@@ -123,7 +123,7 @@
- 
- config FONT_8x8
- 	bool "VGA 8x8 font" if FONTS
--	depends on FRAMEBUFFER_CONSOLE
-+	depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE
- 	default y if !SPARC32 && !SPARC64 && !FONTS
- 	help
- 	  This is the "high resolution" font for the VGA frame buffer (the one
-@@ -137,7 +137,7 @@
- 
- config FONT_8x16
- 	bool "VGA 8x16 font" if FONTS
--	depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y
-+	depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y || STI_CONSOLE
- 	default y if !SPARC32 && !SPARC64 && !FONTS
- 	help
- 	  This is the "high resolution" font for the VGA frame buffer (the one
-@@ -147,7 +147,7 @@
- 
- config FONT_6x11
- 	bool "Mac console 6x11 font (not supported by all drivers)" if FONTS
--	depends on FRAMEBUFFER_CONSOLE
-+	depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE
- 	default y if !SPARC32 && !SPARC64 && !FONTS && MAC
- 	help
- 	  Small console font with Macintosh-style high-half glyphs.  Some Mac
-Index: linux-2.6-2.6.12/fs/ioctl.c
-===================================================================
---- linux-2.6-2.6.12.orig/fs/ioctl.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/fs/ioctl.c	2005-08-09 17:53:35.000000000 -0400
-@@ -71,7 +71,11 @@
- 				return -EBADF;
- 			return put_user(inode->i_sb->s_blocksize, p);
- 		case FIONREAD:
--			return put_user(i_size_read(inode) - filp->f_pos, p);
-+		{
-+			int sz;
-+			sz = i_size_read(inode) - filp->f_pos;
-+			return put_user(sz, p);
-+		}
- 	}
- 
- 	return do_ioctl(filp, cmd, arg);
-Index: linux-2.6-2.6.12/include/asm-generic/compat_signal.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/include/asm-generic/compat_signal.h	2005-08-09 17:53:35.000000000 -0400
-@@ -0,0 +1,25 @@
-+#ifndef _ASM_GENERIC_COMPAT_SIGNAL_H
-+#define _ASM_GENERIC_COMPAT_SIGNAL_H
-+
-+#ifndef __ASSEMBLY__
-+#include <linux/compat.h>
-+
-+typedef compat_uptr_t compat_sighandler_t;
-+
-+typedef struct compat_sigaltstack {
-+	compat_uptr_t ss_sp;
-+	compat_int_t ss_flags;
-+	compat_size_t ss_size;
-+} compat_stack_t;
-+
-+/* Most things should be clean enough to redefine this at will, if care
-+   is taken to make libc match.  */
-+
-+struct compat_sigaction {
-+	compat_sighandler_t sa_handler;
-+	compat_uint_t sa_flags;
-+	compat_sigset_t sa_mask;		/* mask last for extensibility */
-+};
-+
-+#endif /* !__ASSEMBLY__ */
-+#endif /* !_ASM_GENERIC_COMPAT_SIGNAL_H */
-Index: linux-2.6-2.6.12/include/asm-ia64/compat.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-ia64/compat.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-ia64/compat.h	2005-08-09 17:53:35.000000000 -0400
-@@ -15,6 +15,9 @@
- typedef s32		compat_pid_t;
- typedef u16		compat_uid_t;
- typedef u16		compat_gid_t;
-+/* Define for use in compat_siginfo_t */
-+#undef __ARCH_SI_COMPAT_UID_T
-+#define __ARCH_SI_COMPAT_UID_T	compat_uid32_t
- typedef u32		compat_uid32_t;
- typedef u32		compat_gid32_t;
- typedef u16		compat_mode_t;
-@@ -27,6 +30,7 @@
- typedef s32		compat_daddr_t;
- typedef u32		compat_caddr_t;
- typedef __kernel_fsid_t	compat_fsid_t;
-+typedef s32		compat_timer_t;
- 
- typedef s32		compat_int_t;
- typedef s32		compat_long_t;
-Index: linux-2.6-2.6.12/include/asm-parisc/assembly.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/assembly.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/assembly.h	2005-08-09 17:53:35.000000000 -0400
-@@ -450,5 +450,30 @@
- 	REST_CR	(%cr22, PT_PSW	(\regs))
- 	.endm
- 
-+
-+	/* First step to create a "relied upon translation"
-+	 * See PA 2.0 Arch. page F-4 and F-5.
-+	 *
-+	 * The ssm was originally necessary due to a "PCxT bug".
-+	 * But someone decided it needed to be added to the architecture
-+	 * and this "feature" went into rev3 of PA-RISC 1.1 Arch Manual.
-+	 * It's been carried forward into PA 2.0 Arch as well. :^(
-+	 *
-+	 * "ssm 0,%r0" is a NOP with side effects (prefetch barrier).
-+	 * rsm/ssm prevents the ifetch unit from speculatively fetching
-+	 * instructions past this line in the code stream.
-+	 * PA 2.0 processor will single step all insn in the same QUAD (4 insn).
-+	 */
-+	.macro	pcxt_ssm_bug
-+	rsm	PSW_SM_I,%r0
-+	nop	/* 1 */
-+	nop	/* 2 */
-+	nop	/* 3 */
-+	nop	/* 4 */
-+	nop	/* 5 */
-+	nop	/* 6 */
-+	nop	/* 7 */
-+	.endm
-+
- #endif /* __ASSEMBLY__ */
- #endif
-Index: linux-2.6-2.6.12/include/asm-parisc/bitops.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/bitops.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/bitops.h	2005-08-09 17:53:35.000000000 -0400
-@@ -2,6 +2,7 @@
- #define _PARISC_BITOPS_H
- 
- #include <linux/compiler.h>
-+#include <asm/types.h>		/* for BITS_PER_LONG/SHIFT_PER_LONG */
- #include <asm/system.h>
- #include <asm/byteorder.h>
- #include <asm/atomic.h>
-@@ -12,193 +13,157 @@
-  * to include/asm-i386/bitops.h or kerneldoc
-  */
- 
--#ifdef __LP64__
--#   define SHIFT_PER_LONG 6
--#ifndef BITS_PER_LONG
--#   define BITS_PER_LONG 64
--#endif
--#else
--#   define SHIFT_PER_LONG 5
--#ifndef BITS_PER_LONG
--#   define BITS_PER_LONG 32
--#endif
--#endif
--
--#define CHOP_SHIFTCOUNT(x) ((x) & (BITS_PER_LONG - 1))
-+#define CHOP_SHIFTCOUNT(x) (((unsigned long) (x)) & (BITS_PER_LONG - 1))
- 
- 
- #define smp_mb__before_clear_bit()      smp_mb()
- #define smp_mb__after_clear_bit()       smp_mb()
- 
--static __inline__ void set_bit(int nr, volatile unsigned long * address)
-+/* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion
-+ * on use of volatile and __*_bit() (set/clear/change):
-+ *	*_bit() want use of volatile.
-+ *	__*_bit() are "relaxed" and don't use spinlock or volatile.
-+ */
-+
-+static __inline__ void set_bit(int nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
- 	unsigned long flags;
- 
- 	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
- 	_atomic_spin_lock_irqsave(addr, flags);
- 	*addr |= mask;
- 	_atomic_spin_unlock_irqrestore(addr, flags);
- }
- 
--static __inline__ void __set_bit(int nr, volatile unsigned long * address)
-+static __inline__ void __set_bit(unsigned long nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
-+	unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG);
- 
--	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	*addr |= mask;
-+	*m |= 1UL << CHOP_SHIFTCOUNT(nr);
- }
- 
--static __inline__ void clear_bit(int nr, volatile unsigned long * address)
-+static __inline__ void clear_bit(int nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
-+	unsigned long mask = ~(1UL << CHOP_SHIFTCOUNT(nr));
- 	unsigned long flags;
- 
- 	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
- 	_atomic_spin_lock_irqsave(addr, flags);
--	*addr &= ~mask;
-+	*addr &= mask;
- 	_atomic_spin_unlock_irqrestore(addr, flags);
- }
- 
--static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address)
-+static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
-+	unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG);
- 
--	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	*addr &= ~mask;
-+	*m &= ~(1UL << CHOP_SHIFTCOUNT(nr));
- }
- 
--static __inline__ void change_bit(int nr, volatile unsigned long * address)
-+static __inline__ void change_bit(int nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
- 	unsigned long flags;
- 
- 	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
- 	_atomic_spin_lock_irqsave(addr, flags);
- 	*addr ^= mask;
- 	_atomic_spin_unlock_irqrestore(addr, flags);
- }
- 
--static __inline__ void __change_bit(int nr, volatile unsigned long * address)
-+static __inline__ void __change_bit(unsigned long nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
-+	unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG);
- 
--	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	*addr ^= mask;
-+	*m ^= 1UL << CHOP_SHIFTCOUNT(nr);
- }
- 
--static __inline__ int test_and_set_bit(int nr, volatile unsigned long * address)
-+static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
--	int oldbit;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
-+	unsigned long oldbit;
- 	unsigned long flags;
- 
- 	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
- 	_atomic_spin_lock_irqsave(addr, flags);
--	oldbit = (*addr & mask) ? 1 : 0;
--	*addr |= mask;
-+	oldbit = *addr;
-+	*addr = oldbit | mask;
- 	_atomic_spin_unlock_irqrestore(addr, flags);
- 
--	return oldbit;
-+	return (oldbit & mask) ? 1 : 0;
- }
- 
- static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
--	int oldbit;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
-+	unsigned long oldbit;
-+	unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG);
- 
--	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	oldbit = (*addr & mask) ? 1 : 0;
--	*addr |= mask;
-+	oldbit = *addr;
-+	*addr = oldbit | mask;
- 
--	return oldbit;
-+	return (oldbit & mask) ? 1 : 0;
- }
- 
--static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * address)
-+static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
--	int oldbit;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
-+	unsigned long oldbit;
- 	unsigned long flags;
- 
- 	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
- 	_atomic_spin_lock_irqsave(addr, flags);
--	oldbit = (*addr & mask) ? 1 : 0;
--	*addr &= ~mask;
-+	oldbit = *addr;
-+	*addr = oldbit & ~mask;
- 	_atomic_spin_unlock_irqrestore(addr, flags);
- 
--	return oldbit;
-+	return (oldbit & mask) ? 1 : 0;
- }
- 
- static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
--	int oldbit;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
-+	unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG);
-+	unsigned long oldbit;
- 
--	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	oldbit = (*addr & mask) ? 1 : 0;
--	*addr &= ~mask;
-+	oldbit = *addr;
-+	*addr = oldbit & ~mask;
- 
--	return oldbit;
-+	return (oldbit & mask) ? 1 : 0;
- }
- 
--static __inline__ int test_and_change_bit(int nr, volatile unsigned long * address)
-+static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
--	int oldbit;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
-+	unsigned long oldbit;
- 	unsigned long flags;
- 
- 	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
- 	_atomic_spin_lock_irqsave(addr, flags);
--	oldbit = (*addr & mask) ? 1 : 0;
--	*addr ^= mask;
-+	oldbit = *addr;
-+	*addr = oldbit ^ mask;
- 	_atomic_spin_unlock_irqrestore(addr, flags);
- 
--	return oldbit;
-+	return (oldbit & mask) ? 1 : 0;
- }
- 
- static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address)
- {
--	unsigned long mask;
--	unsigned long *addr = (unsigned long *) address;
--	int oldbit;
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
-+	unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG);
-+	unsigned long oldbit;
- 
--	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	oldbit = (*addr & mask) ? 1 : 0;
--	*addr ^= mask;
-+	oldbit = *addr;
-+	*addr = oldbit ^ mask;
- 
--	return oldbit;
-+	return (oldbit & mask) ? 1 : 0;
- }
- 
- static __inline__ int test_bit(int nr, const volatile unsigned long *address)
- {
--	unsigned long mask;
--	const unsigned long *addr = (const unsigned long *)address;
--	
--	addr += (nr >> SHIFT_PER_LONG);
--	mask = 1L << CHOP_SHIFTCOUNT(nr);
-+	unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr);
-+	const unsigned long *addr = (const unsigned long *)address + (nr >> SHIFT_PER_LONG);
- 	
- 	return !!(*addr & mask);
- }
-@@ -229,7 +194,7 @@
- 	unsigned long ret;
- 
- 	__asm__(
--#if BITS_PER_LONG > 32
-+#ifdef __LP64__
- 		" ldi       63,%1\n"
- 		" extrd,u,*<>  %0,63,32,%%r0\n"
- 		" extrd,u,*TR  %0,31,32,%0\n"	/* move top 32-bits down */
-@@ -304,14 +269,7 @@
-  * hweightN: returns the hamming weight (i.e. the number
-  * of bits set) of a N-bit word
-  */
--#define hweight64(x)						\
--({								\
--	unsigned long __x = (x);				\
--	unsigned int __w;					\
--	__w = generic_hweight32((unsigned int) __x);		\
--	__w += generic_hweight32((unsigned int) (__x>>32));	\
--	__w;							\
--})
-+#define hweight64(x) generic_hweight64(x)
- #define hweight32(x) generic_hweight32(x)
- #define hweight16(x) generic_hweight16(x)
- #define hweight8(x) generic_hweight8(x)
-@@ -324,7 +282,13 @@
-  */
- static inline int sched_find_first_bit(const unsigned long *b)
- {
--#ifndef __LP64__
-+#ifdef __LP64__
-+	if (unlikely(b[0]))
-+		return __ffs(b[0]);
-+	if (unlikely(b[1]))
-+		return __ffs(b[1]) + 64;
-+	return __ffs(b[2]) + 128;
-+#else
- 	if (unlikely(b[0]))
- 		return __ffs(b[0]);
- 	if (unlikely(b[1]))
-@@ -334,14 +298,6 @@
- 	if (b[3])
- 		return __ffs(b[3]) + 96;
- 	return __ffs(b[4]) + 128;
--#else
--	if (unlikely(b[0]))
--		return __ffs(b[0]);
--	if (unlikely(((unsigned int)b[1])))
--		return __ffs(b[1]) + 64;
--	if (b[1] >> 32)
--		return __ffs(b[1] >> 32) + 96;
--	return __ffs(b[2]) + 128;
- #endif
- }
- 
-@@ -391,7 +347,7 @@
- 
- static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset)
- {
--	const unsigned long *p = addr + (offset >> 6);
-+	const unsigned long *p = addr + (offset >> SHIFT_PER_LONG);
- 	unsigned long result = offset & ~(BITS_PER_LONG-1);
- 	unsigned long tmp;
- 
-@@ -445,71 +401,90 @@
-  * test_and_{set,clear}_bit guarantee atomicity without
-  * disabling interrupts.
-  */
--#ifdef __LP64__
--#define ext2_set_bit(nr, addr)		__test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
--#define ext2_set_bit_atomic(l,nr,addr)  test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
--#define ext2_clear_bit(nr, addr)	__test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
--#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
--#else
--#define ext2_set_bit(nr, addr)		__test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
--#define ext2_set_bit_atomic(l,nr,addr)  test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
--#define ext2_clear_bit(nr, addr)	__test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
--#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
--#endif
- 
--#endif	/* __KERNEL__ */
-+/* '3' is bits per byte */
-+#define LE_BYTE_ADDR ((sizeof(unsigned long) - 1) << 3)
- 
--static __inline__ int ext2_test_bit(int nr, __const__ void * addr)
--{
--	__const__ unsigned char	*ADDR = (__const__ unsigned char *) addr;
-+#define ext2_test_bit(nr, addr) \
-+			test_bit((nr)	^ LE_BYTE_ADDR, (unsigned long *)addr)
-+#define ext2_set_bit(nr, addr)	\
-+		__test_and_set_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
-+#define ext2_clear_bit(nr, addr) \
-+		__test_and_clear_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
-+
-+#define ext2_set_bit_atomic(l,nr,addr) \
-+		test_and_set_bit((nr)   ^ LE_BYTE_ADDR, (unsigned long *)addr)
-+#define ext2_clear_bit_atomic(l,nr,addr) \
-+		test_and_clear_bit( (nr) ^ LE_BYTE_ADDR, (unsigned long *)addr)
- 
--	return (ADDR[nr >> 3] >> (nr & 7)) & 1;
--}
-+#endif	/* __KERNEL__ */
- 
--/*
-- * This implementation of ext2_find_{first,next}_zero_bit was stolen from
-- * Linus' asm-alpha/bitops.h and modified for a big-endian machine.
-- */
- 
- #define ext2_find_first_zero_bit(addr, size) \
--        ext2_find_next_zero_bit((addr), (size), 0)
-+	ext2_find_next_zero_bit((addr), (size), 0)
-+
-+/* include/linux/byteorder does not support "unsigned long" type */
-+static inline unsigned long ext2_swabp(unsigned long * x)
-+{
-+#ifdef __LP64__
-+	return (unsigned long) __swab64p((u64 *) x);
-+#else
-+	return (unsigned long) __swab32p((u32 *) x);
-+#endif
-+}
-+
-+/* include/linux/byteorder doesn't support "unsigned long" type */
-+static inline unsigned long ext2_swab(unsigned long y)
-+{
-+#ifdef __LP64__
-+	return (unsigned long) __swab64((u64) y);
-+#else
-+	return (unsigned long) __swab32((u32) y);
-+#endif
-+}
- 
--extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr,
--	unsigned long size, unsigned long offset)
-+static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
- {
--	unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
--	unsigned int result = offset & ~31UL;
--	unsigned int tmp;
-+	unsigned long *p = (unsigned long *) addr + (offset >> SHIFT_PER_LONG);
-+	unsigned long result = offset & ~(BITS_PER_LONG - 1);
-+	unsigned long tmp;
- 
- 	if (offset >= size)
- 		return size;
- 	size -= result;
--	offset &= 31UL;
-+	offset &= (BITS_PER_LONG - 1UL);
- 	if (offset) {
--		tmp = cpu_to_le32p(p++);
--		tmp |= ~0UL >> (32-offset);
--		if (size < 32)
-+		tmp = ext2_swabp(p++);
-+		tmp |= (~0UL >> (BITS_PER_LONG - offset));
-+		if (size < BITS_PER_LONG)
- 			goto found_first;
--		if (tmp != ~0U)
-+		if (~tmp)
- 			goto found_middle;
--		size -= 32;
--		result += 32;
-+		size -= BITS_PER_LONG;
-+		result += BITS_PER_LONG;
- 	}
--	while (size >= 32) {
--		if ((tmp = cpu_to_le32p(p++)) != ~0U)
--			goto found_middle;
--		result += 32;
--		size -= 32;
-+
-+	while (size & ~(BITS_PER_LONG - 1)) {
-+		if (~(tmp = *(p++)))
-+			goto found_middle_swap;
-+		result += BITS_PER_LONG;
-+		size -= BITS_PER_LONG;
- 	}
- 	if (!size)
- 		return result;
--	tmp = cpu_to_le32p(p);
-+	tmp = ext2_swabp(p);
- found_first:
--	tmp |= ~0U << size;
-+	tmp |= ~0UL << size;
-+	if (tmp == ~0UL)	/* Are any bits zero? */
-+		return result + size; /* Nope. Skip ffz */
- found_middle:
- 	return result + ffz(tmp);
-+
-+found_middle_swap:
-+	return result + ffz(ext2_swab(tmp));
- }
- 
-+
- /* Bitmap functions for the minix filesystem.  */
- #define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr)
- #define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr))
-Index: linux-2.6-2.6.12/include/asm-parisc/errno.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/errno.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/errno.h	2005-08-09 17:53:35.000000000 -0400
-@@ -114,6 +114,7 @@
- 
- #define ENOTSUP		252	/* Function not implemented (POSIX.4 / HPUX) */
- #define ECANCELLED	253	/* aio request was canceled before complete (POSIX.4 / HPUX) */
-+#define ECANCELED	ECANCELLED	/* SuSv3 and Solaris wants one 'L' */
- 
- /* for robust mutexes */
- #define EOWNERDEAD	254	/* Owner died */
-Index: linux-2.6-2.6.12/include/asm-parisc/led.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/led.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/led.h	2005-08-09 17:53:35.000000000 -0400
-@@ -23,9 +23,6 @@
- 
- #define LED_CMD_REG_NONE 0		/* NULL == no addr for the cmd register */
- 
--/* led tasklet struct */
--extern struct tasklet_struct led_tasklet;
--
- /* register_led_driver() */
- int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg);
- 
-Index: linux-2.6-2.6.12/include/asm-parisc/processor.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/processor.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/processor.h	2005-08-09 17:53:35.000000000 -0400
-@@ -121,8 +121,27 @@
- }; 
- 
- /* Thread struct flags. */
-+#define PARISC_UAC_NOPRINT	(1UL << 0)	/* see prctl and unaligned.c */
-+#define PARISC_UAC_SIGBUS	(1UL << 1)
- #define PARISC_KERNEL_DEATH	(1UL << 31)	/* see die_if_kernel()... */
- 
-+#define PARISC_UAC_SHIFT	0
-+#define PARISC_UAC_MASK		(PARISC_UAC_NOPRINT|PARISC_UAC_SIGBUS)
-+
-+#define SET_UNALIGN_CTL(task,value)                                       \
-+        ({                                                                \
-+        (task)->thread.flags = (((task)->thread.flags & ~PARISC_UAC_MASK) \
-+                                | (((value) << PARISC_UAC_SHIFT) &        \
-+                                   PARISC_UAC_MASK));                     \
-+        0;                                                                \
-+        })
-+
-+#define GET_UNALIGN_CTL(task,addr)                                        \
-+        ({                                                                \
-+        put_user(((task)->thread.flags & PARISC_UAC_MASK)                 \
-+                 >> PARISC_UAC_SHIFT, (int __user *) (addr));             \
-+        })
-+
- #define INIT_THREAD { \
- 	regs:	{	gr: { 0, }, \
- 			fr: { 0, }, \
-Index: linux-2.6-2.6.12/include/asm-parisc/psw.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/psw.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/psw.h	2005-08-09 17:53:35.000000000 -0400
-@@ -1,4 +1,7 @@
- #ifndef _PARISC_PSW_H
-+
-+#include <linux/config.h>
-+
- #define	PSW_I	0x00000001
- #define	PSW_D	0x00000002
- #define	PSW_P	0x00000004
-@@ -9,6 +12,16 @@
- #define	PSW_G	0x00000040	/* PA1.x only */
- #define PSW_O	0x00000080	/* PA2.0 only */
- 
-+/* ssm/rsm instructions number PSW_W and PSW_E differently */
-+#define PSW_SM_I	PSW_I	/* Enable External Interrupts */
-+#define PSW_SM_D	PSW_D
-+#define PSW_SM_P	PSW_P
-+#define PSW_SM_Q	PSW_Q	/* Enable Interrupt State Collection */
-+#define PSW_SM_R	PSW_R	/* Enable Recover Counter Trap */
-+#define PSW_SM_W	0x200	/* PA2.0 only : Enable Wide Mode */
-+
-+#define PSW_SM_QUIET	PSW_SM_R+PSW_SM_Q+PSW_SM_P+PSW_SM_D+PSW_SM_I
-+
- #define PSW_CB	0x0000ff00
- 
- #define	PSW_M	0x00010000
-@@ -30,33 +43,21 @@
- #define	PSW_Z	0x40000000	/* PA1.x only */
- #define	PSW_Y	0x80000000	/* PA1.x only */
- 
--#ifdef __LP64__
--#define PSW_HI_CB 0x000000ff    /* PA2.0 only */
-+#ifdef CONFIG_64BIT
-+#  define PSW_HI_CB 0x000000ff    /* PA2.0 only */
- #endif
- 
--/* PSW bits to be used with ssm/rsm */
--#define PSW_SM_I        0x1
--#define PSW_SM_D        0x2
--#define PSW_SM_P        0x4
--#define PSW_SM_Q        0x8
--#define PSW_SM_R        0x10
--#define PSW_SM_F        0x20
--#define PSW_SM_G        0x40
--#define PSW_SM_O        0x80
--#define PSW_SM_E        0x100
--#define PSW_SM_W        0x200
--
--#ifdef __LP64__
--#  define USER_PSW      (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
--#  define KERNEL_PSW    (PSW_W | PSW_C | PSW_Q | PSW_P | PSW_D)
--#  define REAL_MODE_PSW (PSW_W | PSW_Q)
--#  define USER_PSW_MASK (PSW_W | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
--#  define USER_PSW_HI_MASK (PSW_HI_CB)
--#else
--#  define USER_PSW      (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
--#  define KERNEL_PSW    (PSW_C | PSW_Q | PSW_P | PSW_D)
--#  define REAL_MODE_PSW (PSW_Q)
--#  define USER_PSW_MASK (PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
-+#ifdef CONFIG_64BIT
-+#  define USER_PSW_HI_MASK	PSW_HI_CB
-+#  define WIDE_PSW		PSW_W
-+#else 
-+#  define WIDE_PSW		0
- #endif
- 
-+/* Used when setting up for rfi */
-+#define KERNEL_PSW    (WIDE_PSW | PSW_C | PSW_Q | PSW_P | PSW_D)
-+#define REAL_MODE_PSW (WIDE_PSW | PSW_Q)
-+#define USER_PSW_MASK (WIDE_PSW | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
-+#define USER_PSW      (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
-+
- #endif
-Index: linux-2.6-2.6.12/include/asm-parisc/ptrace.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/ptrace.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/ptrace.h	2005-08-09 17:53:35.000000000 -0400
-@@ -49,7 +49,7 @@
- #define user_mode(regs)			(((regs)->iaoq[0] & 3) ? 1 : 0)
- #define user_space(regs)		(((regs)->iasq[1] != 0) ? 1 : 0)
- #define instruction_pointer(regs)	((regs)->iaoq[0] & ~3)
--#define profile_pc(regs) instruction_pointer(regs)
-+unsigned long profile_pc(struct pt_regs *);
- extern void show_regs(struct pt_regs *);
- #endif
- 
-Index: linux-2.6-2.6.12/include/asm-parisc/spinlock.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/spinlock.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/spinlock.h	2005-08-09 17:53:35.000000000 -0400
-@@ -8,9 +8,15 @@
-  * the semaphore address has to be 16-byte aligned.
-  */
- 
-+#ifdef CONFIG_PA20
-+#define __SPIN_FIELD_UNLOCKED	1
-+#else
-+#define __SPIN_FIELD_UNLOCKED	{ 1, 1, 1, 1 }
-+#endif
-+
- #ifndef CONFIG_DEBUG_SPINLOCK
- 
--#define __SPIN_LOCK_UNLOCKED	{ { 1, 1, 1, 1 } }
-+#define __SPIN_LOCK_UNLOCKED    { .lock = __SPIN_FIELD_UNLOCKED, }
- #undef SPIN_LOCK_UNLOCKED
- #define SPIN_LOCK_UNLOCKED (spinlock_t) __SPIN_LOCK_UNLOCKED
- 
-@@ -64,7 +70,15 @@
- 
- #define SPINLOCK_MAGIC	0x1D244B3C
- 
--#define __SPIN_LOCK_UNLOCKED	{ { 1, 1, 1, 1 }, SPINLOCK_MAGIC, 10, __FILE__ , NULL, 0, -1, NULL, NULL }
-+#define __SPIN_LOCK_UNLOCKED	{ .lock = __SPIN_FIELD_UNLOCKED, 	\
-+				  .magic = SPINLOCK_MAGIC, 		\
-+				  .babble = 10, 			\
-+				  .module = __FILE__, 			\
-+				  .bfile = NULL, 			\
-+				  .bline = 0, 				\
-+				  .oncpu = -1, 				\
-+				  .previous = NULL, 			\
-+				  .task = NULL }
- #undef SPIN_LOCK_UNLOCKED
- #define SPIN_LOCK_UNLOCKED (spinlock_t) __SPIN_LOCK_UNLOCKED
- 
-@@ -72,7 +86,7 @@
- 
- #define CHECK_LOCK(x)							\
- 	do {								\
--	 	if (unlikely((x)->magic != SPINLOCK_MAGIC)) {			\
-+	 	if (unlikely((x)->magic != SPINLOCK_MAGIC)) {		\
- 			printk(KERN_ERR "%s:%d: spin_is_locked"		\
- 			" on uninitialized spinlock %p.\n",		\
- 				__FILE__, __LINE__, (x)); 		\
-@@ -81,9 +95,10 @@
- 
- #define spin_is_locked(x)						\
- 	({								\
-+		volatile unsigned int *a;				\
- 	 	CHECK_LOCK(x);						\
--		volatile unsigned int *a = __ldcw_align(x);		\
--		if (unlikely((*a == 0) && (x)->babble)) {				\
-+		a = __ldcw_align(x);					\
-+		if (unlikely((*a == 0) && (x)->babble)) {		\
- 			(x)->babble--;					\
- 			printk("KERN_WARNING				\
- 				%s:%d: spin_is_locked(%s/%p) already"	\
-@@ -97,9 +112,10 @@
- 
- #define spin_unlock_wait(x)						\
- 	do {								\
-+		volatile unsigned int *a;				\
- 	 	CHECK_LOCK(x);						\
--		volatile unsigned int *a = __ldcw_align(x);		\
--		if (unlikely((*a == 0) && (x)->babble)) {				\
-+		a = __ldcw_align(x);					\
-+		if (unlikely((*a == 0) && (x)->babble)) {		\
- 			(x)->babble--;					\
- 			printk("KERN_WARNING				\
- 				%s:%d: spin_unlock_wait(%s/%p)"		\
-Index: linux-2.6-2.6.12/include/asm-parisc/system.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/system.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/system.h	2005-08-09 17:53:35.000000000 -0400
-@@ -138,13 +138,7 @@
- #define set_wmb(var, value)		do { var = value; wmb(); } while (0)
- 
- 
--/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*.  */
--#define __ldcw(a) ({ \
--	unsigned __ret; \
--	__asm__ __volatile__("ldcw 0(%1),%0" : "=r" (__ret) : "r" (a)); \
--	__ret; \
--})
--
-+#ifndef CONFIG_PA20
- /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data,
-    and GCC only guarantees 8-byte alignment for stack locals, we can't
-    be assured of 16-byte alignment for atomic lock data even if we
-@@ -152,12 +146,35 @@
-    we use a struct containing an array of four ints for the atomic lock
-    type and dynamically select the 16-byte aligned int from the array
-    for the semaphore.  */
-+
- #define __PA_LDCW_ALIGNMENT 16
- #define __ldcw_align(a) ({ \
-   unsigned long __ret = (unsigned long) &(a)->lock[0];        		\
-   __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \
-   (volatile unsigned int *) __ret;                                      \
- })
-+#define LDCW	"ldcw"
-+
-+#else /*CONFIG_PA20*/
-+/* From: "Jim Hull" <jim.hull of hp.com>
-+   I've attached a summary of the change, but basically, for PA 2.0, as
-+   long as the ",CO" (coherent operation) completer is specified, then the
-+   16-byte alignment requirement for ldcw and ldcd is relaxed, and instead
-+   they only require "natural" alignment (4-byte for ldcw, 8-byte for
-+   ldcd). */
-+
-+#define __PA_LDCW_ALIGNMENT 4
-+#define __ldcw_align(a) ((volatile unsigned int *)a)
-+#define LDCW	"ldcw,co"
-+
-+#endif /*!CONFIG_PA20*/
-+
-+/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*.  */
-+#define __ldcw(a) ({ \
-+	unsigned __ret; \
-+	__asm__ __volatile__(LDCW " 0(%1),%0" : "=r" (__ret) : "r" (a)); \
-+	__ret; \
-+})
- 
- #ifdef CONFIG_SMP
- /*
-@@ -165,7 +182,11 @@
-  */
- 
- typedef struct {
--	volatile unsigned int lock[4];
-+#ifdef CONFIG_PA20
-+	volatile unsigned int lock;
-+#else
-+        volatile unsigned int lock[4];
-+#endif
- #ifdef CONFIG_DEBUG_SPINLOCK
- 	unsigned long magic;
- 	volatile unsigned int babble;
-@@ -186,25 +207,6 @@
- #endif
- 
- #define KERNEL_START (0x10100000 - 0x1000)
--
--/* This is for the serialisation of PxTLB broadcasts.  At least on the
-- * N class systems, only one PxTLB inter processor broadcast can be
-- * active at any one time on the Merced bus.  This tlb purge
-- * synchronisation is fairly lightweight and harmless so we activate
-- * it on all SMP systems not just the N class. */
--#ifdef CONFIG_SMP
--extern spinlock_t pa_tlb_lock;
--
--#define purge_tlb_start(x) spin_lock(&pa_tlb_lock)
--#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock)
--
--#else
--
--#define purge_tlb_start(x) do { } while(0)
--#define purge_tlb_end(x) do { } while (0)
--
--#endif
--
- #define arch_align_stack(x) (x)
- 
- #endif
-Index: linux-2.6-2.6.12/include/asm-parisc/tlbflush.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/tlbflush.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/tlbflush.h	2005-08-09 17:53:35.000000000 -0400
-@@ -7,6 +7,26 @@
- #include <linux/mm.h>
- #include <asm/mmu_context.h>
- 
-+
-+/* This is for the serialisation of PxTLB broadcasts.  At least on the
-+ * N class systems, only one PxTLB inter processor broadcast can be
-+ * active at any one time on the Merced bus.  This tlb purge
-+ * synchronisation is fairly lightweight and harmless so we activate
-+ * it on all SMP systems not just the N class. */
-+#ifdef CONFIG_SMP
-+extern spinlock_t pa_tlb_lock;
-+
-+#define purge_tlb_start(x) spin_lock(&pa_tlb_lock)
-+#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock)
-+
-+#else
-+
-+#define purge_tlb_start(x) do { } while(0)
-+#define purge_tlb_end(x) do { } while (0)
-+
-+#endif
-+
-+
- extern void flush_tlb_all(void);
- 
- /*
-@@ -64,29 +84,26 @@
- {
- 	unsigned long npages;
- 
--	
- 	npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
--	if (npages >= 512)  /* XXX arbitrary, should be tuned */
-+	if (npages >= 512)  /* 2MB of space: arbitrary, should be tuned */
- 		flush_tlb_all();
- 	else {
- 
- 		mtsp(vma->vm_mm->context,1);
-+		purge_tlb_start();
- 		if (split_tlb) {
--			purge_tlb_start();
- 			while (npages--) {
- 				pdtlb(start);
- 				pitlb(start);
- 				start += PAGE_SIZE;
- 			}
--			purge_tlb_end();
- 		} else {
--			purge_tlb_start();
- 			while (npages--) {
- 				pdtlb(start);
- 				start += PAGE_SIZE;
- 			}
--			purge_tlb_end();
- 		}
-+		purge_tlb_end();
- 	}
- }
- 
-Index: linux-2.6-2.6.12/include/asm-parisc/types.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/types.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/types.h	2005-08-09 17:53:35.000000000 -0400
-@@ -33,8 +33,10 @@
- 
- #ifdef __LP64__
- #define BITS_PER_LONG 64
-+#define SHIFT_PER_LONG 6
- #else
- #define BITS_PER_LONG 32
-+#define SHIFT_PER_LONG 5
- #endif
- 
- #ifndef __ASSEMBLY__
-Index: linux-2.6-2.6.12/include/asm-parisc/unistd.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-parisc/unistd.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-parisc/unistd.h	2005-08-09 17:53:35.000000000 -0400
-@@ -687,8 +687,8 @@
- #define __NR_shmget             (__NR_Linux + 194)
- #define __NR_shmctl             (__NR_Linux + 195)
- 
--#define __NR_getpmsg            (__NR_Linux + 196)      /* some people actually want streams */
--#define __NR_putpmsg            (__NR_Linux + 197)      /* some people actually want streams */
-+#define __NR_getpmsg		(__NR_Linux + 196) /* Somebody *wants* streams? */
-+#define __NR_putpmsg		(__NR_Linux + 197)
- 
- #define __NR_lstat64            (__NR_Linux + 198)
- #define __NR_truncate64         (__NR_Linux + 199)
-@@ -755,8 +755,12 @@
- #define __NR_mbind		(__NR_Linux + 260)
- #define __NR_get_mempolicy	(__NR_Linux + 261)
- #define __NR_set_mempolicy	(__NR_Linux + 262)
-+#define __NR_vserver		(__NR_Linux + 263)
-+#define __NR_add_key		(__NR_Linux + 264)
-+#define __NR_request_key	(__NR_Linux + 265)
-+#define __NR_keyctl		(__NR_Linux + 266)
- 
--#define __NR_Linux_syscalls     263
-+#define __NR_Linux_syscalls     267
- 
- #define HPUX_GATEWAY_ADDR       0xC0000004
- #define LINUX_GATEWAY_ADDR      0x100
-@@ -807,10 +811,10 @@
- #define K_INLINE_SYSCALL(name, nr, args...)	({			\
- 	long __sys_res;							\
- 	{								\
--		register unsigned long __res asm("r28");		\
-+		register unsigned long __res __asm__("r28");		\
- 		K_LOAD_ARGS_##nr(args)					\
- 		/* FIXME: HACK stw/ldw r19 around syscall */		\
--		asm volatile(						\
-+		__asm__ volatile(					\
- 			K_STW_ASM_PIC					\
- 			"	ble  0x100(%%sr2, %%r0)\n"		\
- 			"	ldi %1, %%r20\n"			\
-Index: linux-2.6-2.6.12/include/asm-s390/compat.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-s390/compat.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-s390/compat.h	2005-08-09 17:53:35.000000000 -0400
-@@ -15,6 +15,9 @@
- typedef s32		compat_pid_t;
- typedef u16		compat_uid_t;
- typedef u16		compat_gid_t;
-+/* Define for use in compat_siginfo_t */
-+#undef __ARCH_SI_COMPAT_UID_T
-+#define __ARCH_SI_COMPAT_UID_T compat_uid32_t
- typedef u32		compat_uid32_t;
- typedef u32		compat_gid32_t;
- typedef u16		compat_mode_t;
-Index: linux-2.6-2.6.12/include/asm-sparc64/compat.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/asm-sparc64/compat.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/asm-sparc64/compat.h	2005-08-09 17:53:35.000000000 -0400
-@@ -12,6 +12,9 @@
- typedef s32		compat_time_t;
- typedef s32		compat_clock_t;
- typedef s32		compat_pid_t;
-+/* Define for use in the compat_siginfo_t */
-+#undef __ARCH_SI_COMPAT_UID_T
-+#define __ARCH_SI_COMPAT_UID_T compat_uint_t
- typedef u16		compat_uid_t;
- typedef u16		compat_gid_t;
- typedef u16		compat_mode_t;
-Index: linux-2.6-2.6.12/include/linux/compat.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/linux/compat.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/linux/compat.h	2005-08-09 17:53:35.000000000 -0400
-@@ -6,10 +6,16 @@
-  */
- #include <linux/config.h>
- 
--#ifdef CONFIG_COMPAT
-+#ifndef CONFIG_COMPAT
-+
-+/* Non-native task requiring compat... doesn't exist */
-+#define is_compat_task(x) 0
-+
-+#else
- 
- #include <linux/stat.h>
- #include <linux/param.h>	/* for HZ */
-+#include <linux/personality.h>  /* Conditional process compat */
- #include <linux/sem.h>
- 
- #include <asm/compat.h>
-@@ -18,6 +24,11 @@
- #define compat_jiffies_to_clock_t(x)	\
- 		(((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
- 
-+/* Non-native task requiring compat */
-+#ifndef HAVE_ARCH_IS_COMPAT_TASK
-+#define is_compat_task(x) (personality(x->personality) == PER_LINUX32)
-+#endif
-+	
- struct rusage;
- 
- struct compat_itimerspec { 
-@@ -96,28 +107,6 @@
- 	char		d_name[256];
- };
- 
--typedef union compat_sigval {
--	compat_int_t	sival_int;
--	compat_uptr_t	sival_ptr;
--} compat_sigval_t;
--
--#define COMPAT_SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE/sizeof(int)) - 3)
--
--typedef struct compat_sigevent {
--	compat_sigval_t sigev_value;
--	compat_int_t sigev_signo;
--	compat_int_t sigev_notify;
--	union {
--		compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
--		compat_int_t _tid;
--
--		struct {
--			compat_uptr_t _function;
--			compat_uptr_t _attribute;
--		} _sigev_thread;
--	} _sigev_un;
--} compat_sigevent_t;
--
- 
- long compat_sys_semctl(int first, int second, int third, void __user *uptr);
- long compat_sys_msgsnd(int first, int second, int third, void __user *uptr);
-@@ -153,10 +142,6 @@
- 		       unsigned long bitmap_size);
- long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
- 		       unsigned long bitmap_size);
--int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from);
--int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
--int get_compat_sigevent(struct sigevent *event,
--		const struct compat_sigevent __user *u_event);
- 
- #endif /* CONFIG_COMPAT */
- #endif /* _LINUX_COMPAT_H */
-Index: linux-2.6-2.6.12/include/linux/compat_siginfo.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/include/linux/compat_siginfo.h	2005-08-09 17:53:35.000000000 -0400
-@@ -0,0 +1,181 @@
-+#ifndef _ASM_GENERIC_COMPAT_SIGINFO_H
-+#define _ASM_GENERIC_COMPAT_SIGINFO_H
-+
-+#include <linux/config.h>
-+#include <linux/compat.h>
-+
-+#ifndef CONFIG_COMPAT
-+
-+/* No compatibility layer required, add empty definitions for the compiler */
-+
-+typedef struct compat_siginfo{
-+} compat_siginfo_t;
-+
-+static inline int compat_copy_siginfo_to_user(compat_siginfo_t __user *to, 
-+						struct siginfo *from)
-+{
-+	return -1;
-+}
-+
-+static inline int compat_copy_siginfo_from_user(struct siginfo *to,
-+                                                compat_siginfo_t __user *from)
-+{
-+        return -1;
-+}
-+
-+#else
-+
-+#include <linux/compiler.h>
-+#include <asm/siginfo.h>
-+
-+/* compat view of sigval_t */
-+typedef union compat_sigval {
-+	compat_int_t sival_int;
-+	compat_uptr_t sival_ptr;
-+} compat_sigval_t;
-+
-+/*
-+ * This is the size (including padding) of the part of the
-+ * struct siginfo that is before the union.
-+ */
-+#ifndef __ARCH_SI_COMPAT_PREAMBLE_SIZE
-+#define __ARCH_SI_COMPAT_PREAMBLE_SIZE	(3 * sizeof(compat_int_t))
-+#endif
-+
-+#define SI_COMPAT_MAX_SIZE	128
-+#ifndef SI_COMPAT_PAD_SIZE
-+#define SI_COMPAT_PAD_SIZE \
-+  ((SI_COMPAT_MAX_SIZE - __ARCH_SI_COMPAT_PREAMBLE_SIZE) / sizeof(compat_int_t))
-+#endif
-+
-+/* 32-bit view of si.uid_t */
-+#ifndef __ARCH_SI_COMPAT_UID_T
-+#define __ARCH_SI_COMPAT_UID_T compat_uid_t
-+#endif
-+
-+/* 32-bit view of si.band_t */
-+#ifndef __ARCH_SI_COMPAT_BAND_T
-+#define __ARCH_SI_COMPAT_BAND_T compat_int_t
-+#endif
-+
-+#ifndef HAVE_ARCH_COMPAT_SIGINFO_T
-+
-+/* Compat view of siginfo_t */
-+typedef struct compat_siginfo {
-+	compat_int_t si_signo;
-+	compat_int_t si_errno;
-+	compat_int_t si_code;
-+
-+	union {
-+		compat_int_t _pad[SI_COMPAT_PAD_SIZE];
-+
-+		/* kill() */
-+		struct {
-+			compat_pid_t _pid;	/* sender's pid */
-+			__ARCH_SI_COMPAT_UID_T _uid;	/* sender's uid */
-+		} _kill;
-+
-+		/* POSIX.1b timers */
-+		struct {
-+			compat_timer_t _tid;	/* timer id */
-+			compat_int_t _overrun;		/* overrun count */
-+			char _pad[sizeof(__ARCH_SI_COMPAT_UID_T) - sizeof(compat_int_t)];
-+			compat_sigval_t _sigval;	/* same as below */
-+			compat_int_t _sys_private;       /* not to be passed to user */
-+		} _timer;
-+
-+		/* POSIX.1b signals */
-+		struct {
-+			compat_pid_t _pid;		/* sender's pid */
-+			__ARCH_SI_COMPAT_UID_T _uid;	/* sender's uid */
-+			compat_sigval_t _sigval;
-+		} _rt;
-+
-+		/* SIGCHLD */
-+		struct {
-+			compat_pid_t _pid;		/* which child */
-+			__ARCH_SI_COMPAT_UID_T _uid;	/* sender's uid */
-+			compat_int_t _status;		/* exit code */
-+			compat_clock_t _utime;
-+			compat_clock_t _stime;
-+		} _sigchld;
-+
-+		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
-+		struct {
-+			compat_uptr_t _addr; /* faulting insn/memory ref. */
-+#ifdef __ARCH_SI_COMPAT_TRAPNO
-+			compat_int_t _trapno;	/* TRAP # which caused the signal */
-+#endif
-+		} _sigfault;
-+
-+		/* SIGPOLL */
-+		struct {
-+			__ARCH_SI_COMPAT_BAND_T _band;	/* POLL_IN, POLL_OUT, POLL_MSG */
-+			compat_int_t _fd;
-+		} _sigpoll;
-+	} _sifields;
-+} compat_siginfo_t;
-+#endif /* !HAVE_ARCH_COMPAT_SIGINFO_T */
-+
-+#ifdef __ARCH_SI_COMPAT_TRAPNO
-+#define si_trapno	_sifields._sigfault._trapno
-+#endif
-+
-+/*
-+ * sigevent definitions
-+ * 
-+ * It seems likely that SIGEV_THREAD will have to be handled from 
-+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
-+ * thread manager then catches and does the appropriate nonsense.
-+ * However, everything is written out here so as to not get lost.
-+ */
-+
-+#ifndef __ARCH_SIGEV_COMPAT_PREAMBLE_SIZE
-+#define __ARCH_SIGEV_COMPAT_PREAMBLE_SIZE (sizeof(compat_int_t) * 2 + sizeof(compat_sigval_t))
-+#endif
-+
-+#define COMPAT_SIGEV_PAD_SIZE	((SIGEV_MAX_SIZE/sizeof(int)) - 3)
-+
-+#ifndef HAVE_ARCH_COMPAT_SIGEVENT_T
-+
-+/* 32-bit view of sigevent_t */
-+typedef struct compat_sigevent {
-+	compat_sigval_t sigev_value;
-+	compat_int_t sigev_signo;
-+	compat_int_t sigev_notify;
-+	union {
-+		compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
-+		compat_int_t _tid;
-+
-+		struct {
-+			compat_uptr_t _function;
-+			compat_uptr_t _attribute;  /* really pthread_attr_t */
-+		} _sigev_thread;
-+	} _sigev_un;
-+} compat_sigevent_t;
-+
-+#endif /* HAVE_ARCH_COMPAT_SIGEVENT_T */
-+
-+#ifndef HAVE_ARCH_COMPAT_COPY_SIGINFO
-+
-+#include <linux/string.h>
-+
-+static inline void compat_copy_siginfo(struct compat_siginfo *to, struct compat_siginfo *from)
-+{
-+	if (from->si_code < 0)
-+		memcpy(to, from, sizeof(*to));
-+	else
-+		/* _sigchld is currently the largest know union member */
-+		memcpy(to, from, __ARCH_SI_COMPAT_PREAMBLE_SIZE + sizeof(from->_sifields._sigchld));
-+}
-+
-+#endif /* !HAVE_ARCH_COMPAT_COPY_SIGINFO */
-+
-+extern int compat_copy_siginfo_to_user(compat_siginfo_t __user *to, struct siginfo *from);
-+extern int compat_copy_siginfo_from_user(struct siginfo *to, compat_siginfo_t __user *from);
-+
-+extern int compat_copy_sigevent_from_user(struct sigevent *to, compat_sigevent_t __user *from);
-+
-+#endif /* CONFIG_COMPAT */
-+#endif /* _ASM_GENERIC_COMPAT_SIGINFO_H */
-+
-Index: linux-2.6-2.6.12/include/linux/hil.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/include/linux/hil.h	2005-08-09 17:53:35.000000000 -0400
-@@ -0,0 +1,483 @@
-+#ifndef _HIL_H_
-+#define _HIL_H_
-+
-+/*
-+ * Hewlett Packard Human Interface Loop (HP-HIL) Protocol -- header.
-+ *
-+ * Copyright (c) 2001 Brian S. Julin
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions, and the following disclaimer,
-+ *    without modification.
-+ * 2. The name of the author may not be used to endorse or promote products
-+ *    derived from this software without specific prior written permission.
-+ *
-+ * Alternatively, this software may be distributed under the terms of the
-+ * GNU General Public License ("GPL").
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
-+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ *
-+ * References:
-+ * HP-HIL Technical Reference Manual.  Hewlett Packard Product No. 45918A
-+ *
-+ * A note of thanks to HP for providing and shipping reference materials
-+ * free of charge to help in the development of HIL support for Linux.
-+ *
-+ */
-+
-+#include <asm/types.h>
-+
-+/* Physical constants relevant to raw loop/device timing. 
-+ */ 
-+
-+#define HIL_CLOCK		8MHZ
-+#define HIL_EK1_CLOCK		30HZ
-+#define HIL_EK2_CLOCK		60HZ
-+
-+#define HIL_TIMEOUT_DEV         5	/* ms */
-+#define HIL_TIMEOUT_DEVS	10	/* ms */
-+#define HIL_TIMEOUT_NORESP	10	/* ms */
-+#define HIL_TIMEOUT_DEVS_DATA	16	/* ms */
-+#define HIL_TIMEOUT_SELFTEST	200	/* ms */
-+
-+
-+/* Actual wire line coding.  These will only be useful if someone is 
-+ * implementing a software MLC to run HIL devices on a non-parisc machine.
-+ */
-+
-+#define HIL_WIRE_PACKET_LEN	15
-+enum hil_wire_bitpos {
-+	HIL_WIRE_START		= 0,
-+	HIL_WIRE_ADDR2,
-+	HIL_WIRE_ADDR1,
-+	HIL_WIRE_ADDR0,
-+	HIL_WIRE_COMMAND,
-+	HIL_WIRE_DATA7,
-+	HIL_WIRE_DATA6,
-+	HIL_WIRE_DATA5,
-+	HIL_WIRE_DATA4,
-+	HIL_WIRE_DATA3,
-+	HIL_WIRE_DATA2,
-+	HIL_WIRE_DATA1,
-+	HIL_WIRE_DATA0,
-+	HIL_WIRE_PARITY,
-+	HIL_WIRE_STOP
-+};
-+
-+/* HP documentation uses these bit positions to refer to commands;
-+ * we will call these "packets".
-+ */
-+enum hil_pkt_bitpos {
-+	HIL_PKT_CMD		= 0x00000800,
-+	HIL_PKT_ADDR2		= 0x00000400,
-+	HIL_PKT_ADDR1		= 0x00000200,
-+	HIL_PKT_ADDR0		= 0x00000100,
-+	HIL_PKT_ADDR_MASK	= 0x00000700,
-+	HIL_PKT_ADDR_SHIFT	= 8,
-+	HIL_PKT_DATA7		= 0x00000080,
-+	HIL_PKT_DATA6		= 0x00000040,
-+	HIL_PKT_DATA5		= 0x00000020,
-+	HIL_PKT_DATA4		= 0x00000010,
-+	HIL_PKT_DATA3		= 0x00000008,
-+	HIL_PKT_DATA2		= 0x00000004,
-+	HIL_PKT_DATA1		= 0x00000002,
-+	HIL_PKT_DATA0		= 0x00000001,
-+	HIL_PKT_DATA_MASK	= 0x000000FF,
-+	HIL_PKT_DATA_SHIFT	= 0
-+};
-+
-+/* The HIL MLC also has several error/status/control bits.  We extend the 
-+ * "packet" to include these when direct access to the MLC is available,
-+ * or emulate them in cases where they are not available. 
-+ *
-+ * This way the device driver knows that the underlying MLC driver
-+ * has had to deal with loop errors.
-+ */
-+enum hil_error_bitpos {
-+	HIL_ERR_OB	= 0x00000800, /* MLC is busy sending an auto-poll, 
-+					 or we have filled up the output 
-+					 buffer and must wait. */
-+	HIL_ERR_INT	= 0x00010000, /* A normal interrupt has occurred. */
-+	HIL_ERR_NMI	= 0x00020000, /* An NMI has occurred. */
-+	HIL_ERR_LERR	= 0x00040000, /* A poll didn't come back. */
-+	HIL_ERR_PERR	= 0x01000000, /* There was a Parity Error. */
-+	HIL_ERR_FERR	= 0x02000000, /* There was a Framing Error. */
-+	HIL_ERR_FOF	= 0x04000000  /* Input FIFO Overflowed. */
-+};
-+
-+enum hil_control_bitpos {
-+	HIL_CTRL_TEST	= 0x00010000,
-+	HIL_CTRL_IPF	= 0x00040000,
-+	HIL_CTRL_APE	= 0x02000000
-+};
-+
-+/* Bits 30,31 are unused, we use them to control write behavior. */
-+#define HIL_DO_ALTER_CTRL  0x40000000 /* Write MSW of packet to control 
-+                                          before writing LSW to loop */
-+#define HIL_CTRL_ONLY      0xc0000000 /* *Only* alter the control registers */
-+
-+/* This gives us a 32-bit "packet" 
-+ */
-+typedef u32 hil_packet;
-+
-+
-+/* HIL Loop commands 
-+ */
-+enum hil_command {
-+	HIL_CMD_IFC	= 0x00,	/* Interface Clear */
-+	HIL_CMD_EPT	= 0x01,	/* Enter Pass-Thru Mode */
-+	HIL_CMD_ELB	= 0x02,	/* Enter Loop-Back Mode */
-+	HIL_CMD_IDD	= 0x03,	/* Identify and Describe */
-+	HIL_CMD_DSR	= 0x04,	/* Device Soft Reset */
-+	HIL_CMD_PST	= 0x05,	/* Perform Self Test */
-+	HIL_CMD_RRG	= 0x06,	/* Read Register */
-+	HIL_CMD_WRG	= 0x07,	/* Write Register */
-+	HIL_CMD_ACF	= 0x08,	/* Auto Configure */
-+	HIL_CMDID_ACF	= 0x07,	/* Auto Configure bits with incremented ID */
-+	HIL_CMD_POL	= 0x10,	/* Poll */
-+	HIL_CMDCT_POL	= 0x0f,	/* Poll command bits with item count  */
-+	HIL_CMD_RPL	= 0x20,	/* RePoll */
-+	HIL_CMDCT_RPL	= 0x0f,	/* RePoll command bits with item count */
-+	HIL_CMD_RNM	= 0x30,	/* Report Name */
-+	HIL_CMD_RST	= 0x31,	/* Report Status */
-+	HIL_CMD_EXD	= 0x32,	/* Extended Describe */
-+	HIL_CMD_RSC	= 0x33,	/* Report Security Code */
-+
-+	/* 0x34 to 0x3c reserved for future use  */
-+
-+	HIL_CMD_DKA	= 0x3d,	/* Disable Keyswitch Autorepeat */
-+	HIL_CMD_EK1	= 0x3e,	/* Enable Keyswitch Autorepeat 1 */
-+	HIL_CMD_EK2	= 0x3f,	/* Enable Keyswitch Autorepeat 2 */
-+	HIL_CMD_PR1	= 0x40,	/* Prompt1 */  
-+	HIL_CMD_PR2	= 0x41,	/* Prompt2 */
-+	HIL_CMD_PR3	= 0x42,	/* Prompt3 */
-+	HIL_CMD_PR4	= 0x43,	/* Prompt4 */
-+	HIL_CMD_PR5	= 0x44,	/* Prompt5 */
-+	HIL_CMD_PR6	= 0x45,	/* Prompt6 */
-+	HIL_CMD_PR7	= 0x46,	/* Prompt7 */
-+	HIL_CMD_PRM	= 0x47,	/* Prompt (General Purpose) */
-+	HIL_CMD_AK1	= 0x48,	/* Acknowlege1 */  
-+	HIL_CMD_AK2	= 0x49,	/* Acknowlege2 */
-+	HIL_CMD_AK3	= 0x4a,	/* Acknowlege3 */
-+	HIL_CMD_AK4	= 0x4b,	/* Acknowlege4 */
-+	HIL_CMD_AK5	= 0x4c,	/* Acknowlege5 */
-+	HIL_CMD_AK6	= 0x4d,	/* Acknowlege6 */
-+	HIL_CMD_AK7	= 0x4e,	/* Acknowlege7 */
-+	HIL_CMD_ACK	= 0x4f,	/* Acknowlege (General Purpose) */
-+
-+	/* 0x50 to 0x78 reserved for future use  */
-+	/* 0x80 to 0xEF device-specific commands */
-+	/* 0xf0 to 0xf9 reserved for future use  */
-+
-+	HIL_CMD_RIO	= 0xfa,	/* Register I/O Error */
-+	HIL_CMD_SHR	= 0xfb,	/* System Hard Reset */
-+	HIL_CMD_TER	= 0xfc,	/* Transmission Error */
-+	HIL_CMD_CAE	= 0xfd,	/* Configuration Address Error */
-+	HIL_CMD_DHR	= 0xfe,	/* Device Hard Reset */
-+
-+	/* 0xff is prohibited from use. */
-+};
-+
-+
-+/* 
-+ * Response "records" to HIL commands
-+ */
-+
-+/* Device ID byte 
-+ */
-+#define HIL_IDD_DID_TYPE_MASK		0xe0	/* Primary type bits */
-+#define HIL_IDD_DID_TYPE_KB_INTEGRAL	0xa0	/* Integral keyboard */
-+#define HIL_IDD_DID_TYPE_KB_ITF		0xc0	/* ITD keyboard */
-+#define HIL_IDD_DID_TYPE_KB_RSVD	0xe0	/* Reserved keyboard type */
-+#define HIL_IDD_DID_TYPE_KB_LANG_MASK	0x1f	/* Keyboard locale bits */
-+#define HIL_IDD_DID_KBLANG_USE_ESD	0x00	/* Use ESD Locale instead */
-+#define HIL_IDD_DID_TYPE_ABS		0x80    /* Absolute Positioners */
-+#define HIL_IDD_DID_ABS_RSVD1_MASK	0xf8	/* Reserved */
-+#define HIL_IDD_DID_ABS_RSVD1		0x98
-+#define HIL_IDD_DID_ABS_TABLET_MASK	0xf8	/* Tablets and digitizers */
-+#define HIL_IDD_DID_ABS_TABLET		0x90
-+#define HIL_IDD_DID_ABS_TSCREEN_MASK	0xfc	/* Touch screens */
-+#define HIL_IDD_DID_ABS_TSCREEN		0x8c
-+#define HIL_IDD_DID_ABS_RSVD2_MASK	0xfc	/* Reserved */
-+#define HIL_IDD_DID_ABS_RSVD2		0x88
-+#define HIL_IDD_DID_ABS_RSVD3_MASK	0xfc	/* Reserved */
-+#define HIL_IDD_DID_ABS_RSVD3		0x80
-+#define HIL_IDD_DID_TYPE_REL		0x60    /* Relative Positioners */
-+#define HIL_IDD_DID_REL_RSVD1_MASK	0xf0	/* Reserved */
-+#define HIL_IDD_DID_REL_RSVD1		0x70
-+#define HIL_IDD_DID_REL_RSVD2_MASK	0xfc	/* Reserved */
-+#define HIL_IDD_DID_REL_RSVD2		0x6c
-+#define HIL_IDD_DID_REL_MOUSE_MASK	0xfc	/* Mouse */
-+#define HIL_IDD_DID_REL_MOUSE		0x68
-+#define HIL_IDD_DID_REL_QUAD_MASK	0xf8	/* Other Quadrature Devices */
-+#define HIL_IDD_DID_REL_QUAD		0x60
-+#define HIL_IDD_DID_TYPE_CHAR		0x40    /* Character Entry */
-+#define HIL_IDD_DID_CHAR_BARCODE_MASK	0xfc	/* Barcode Reader */
-+#define HIL_IDD_DID_CHAR_BARCODE	0x5c
-+#define HIL_IDD_DID_CHAR_RSVD1_MASK	0xfc	/* Reserved */
-+#define HIL_IDD_DID_CHAR_RSVD1		0x58
-+#define HIL_IDD_DID_CHAR_RSVD2_MASK	0xf8	/* Reserved */
-+#define HIL_IDD_DID_CHAR_RSVD2		0x50
-+#define HIL_IDD_DID_CHAR_RSVD3_MASK	0xf0	/* Reserved */
-+#define HIL_IDD_DID_CHAR_RSVD3		0x40
-+#define HIL_IDD_DID_TYPE_OTHER		0x20    /* Miscellaneous */
-+#define HIL_IDD_DID_OTHER_RSVD1_MASK	0xf0	/* Reserved */
-+#define HIL_IDD_DID_OTHER_RSVD1		0x30
-+#define HIL_IDD_DID_OTHER_BARCODE_MASK	0xfc	/* Tone Generator */
-+#define HIL_IDD_DID_OTHER_BARCODE	0x2c
-+#define HIL_IDD_DID_OTHER_RSVD2_MASK	0xfc	/* Reserved */
-+#define HIL_IDD_DID_OTHER_RSVD2		0x28
-+#define HIL_IDD_DID_OTHER_RSVD3_MASK	0xf8	/* Reserved */
-+#define HIL_IDD_DID_OTHER_RSVD3		0x20
-+#define HIL_IDD_DID_TYPE_KEYPAD		0x00	/* Vectra Keyboard */
-+
-+/* IDD record header 
-+ */
-+#define HIL_IDD_HEADER_AXSET_MASK	0x03    /* Number of axis in a set */
-+#define HIL_IDD_HEADER_RSC		0x04	/* Supports RSC command */
-+#define HIL_IDD_HEADER_EXD		0x08	/* Supports EXD command */
-+#define HIL_IDD_HEADER_IOD		0x10	/* IOD byte to follow */
-+#define HIL_IDD_HEADER_16BIT		0x20	/* 16 (vs. 8) bit resolution */
-+#define HIL_IDD_HEADER_ABS		0x40	/* Reports Absolute Position */
-+#define HIL_IDD_HEADER_2X_AXIS		0x80	/* Two sets of 1-3 axis */
-+
-+/* I/O Descriptor
-+ */
-+#define HIL_IDD_IOD_NBUTTON_MASK	0x07	/* Number of buttons */
-+#define HIL_IDD_IOD_PROXIMITY		0x08	/* Proximity in/out events */
-+#define HIL_IDD_IOD_PROMPT_MASK		0x70	/* Number of prompts/acks */
-+#define HIL_IDD_IOD_PROMPT_SHIFT	4
-+#define HIL_IDD_IOD_PROMPT		0x80	/* Generic prompt/ack */
-+
-+#define HIL_IDD_NUM_AXES_PER_SET(header_packet) \
-+((header_packet) & HIL_IDD_HEADER_AXSET_MASK)
-+
-+#define HIL_IDD_NUM_AXSETS(header_packet) \
-+(2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS))
-+
-+#define HIL_IDD_LEN(header_packet) \
-+((4 - !(header_packet & HIL_IDD_HEADER_IOD) -			\
-+  2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) +		\
-+  2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) *			\
-+ !!((header_packet) & HIL_IDD_HEADER_ABS))
-+
-+/* The following HIL_IDD_* macros assume you have an array of 
-+ * packets and/or unpacked 8-bit data in the order that they 
-+ * were received.
-+ */
-+
-+#define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr) \
-+(!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 :			\
-+(((*(header_ptr + 1) & HIL_PKT_DATA_MASK) +			\
-+  ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8)		\
-+* ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1)))
-+
-+#define HIL_IDD_AXIS_MAX(header_ptr, __axnum) \
-+((!(*(header_ptr) & HIL_IDD_HEADER_ABS) ||			\
-+  (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 :	\
-+ ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) +	\
-+  ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8)))
-+
-+#define HIL_IDD_IOD(header_ptr) \
-+(*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1))
-+
-+#define HIL_IDD_HAS_GEN_PROMPT(header_ptr) \
-+((*header_ptr & HIL_IDD_HEADER_IOD) &&				\
-+ (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT))
-+
-+#define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr) \
-+((*header_ptr & HIL_IDD_HEADER_IOD) &&				\
-+ (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY))
-+
-+#define HIL_IDD_NUM_BUTTONS(header_ptr) \
-+((*header_ptr & HIL_IDD_HEADER_IOD) ?				\
-+ (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0)
-+
-+#define HIL_IDD_NUM_PROMPTS(header_ptr) \
-+((*header_ptr & HIL_IDD_HEADER_IOD) ?				\
-+ ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK)		\
-+  >> HIL_IDD_IOD_PROMPT_SHIFT) : 0)
-+
-+/* The response to HIL EXD commands -- the "extended describe record" */
-+#define	HIL_EXD_HEADER_WRG		0x03	/* Supports type2 WRG */
-+#define HIL_EXD_HEADER_WRG_TYPE1	0x01	/* Supports type1 WRG */
-+#define	HIL_EXD_HEADER_WRG_TYPE2	0x02	/* Supports type2 WRG */
-+#define	HIL_EXD_HEADER_RRG		0x04	/* Supports RRG command */
-+#define	HIL_EXD_HEADER_RNM		0x10	/* Supports RNM command */
-+#define HIL_EXD_HEADER_RST		0x20	/* Supports RST command */
-+#define HIL_EXD_HEADER_LOCALE		0x40	/* Contains locale code */
-+
-+#define HIL_EXD_NUM_RRG(header_ptr) \
-+((*header_ptr & HIL_EXD_HEADER_RRG) ? \
-+ (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0)
-+
-+#define HIL_EXD_NUM_WWG(header_ptr) \
-+((*header_ptr & HIL_EXD_HEADER_WRG) ?				\
-+ (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) &	\
-+    HIL_PKT_DATA_MASK) : 0)
-+
-+#define HIL_EXD_LEN(header_ptr) \
-+(!!(*header_ptr & HIL_EXD_HEADER_RRG) +				\
-+ !!(*header_ptr & HIL_EXD_HEADER_WRG) +				\
-+ !!(*header_ptr & HIL_EXD_HEADER_LOCALE) +			\
-+ 2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1)
-+
-+#define HIL_EXD_LOCALE(header_ptr) \
-+(!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 :			\
-+ (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK))
-+
-+#define HIL_EXD_WRG_TYPE2_LEN(header_ptr) \
-+(!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1	:			\
-+ (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 -                  	\
-+    !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) +	\
-+ ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 -				\
-+     !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8))
-+
-+/* Device locale codes. */ 
-+
-+/* Last defined locale code.  Everything above this is "Reserved",
-+   and note that this same table applies to the Device ID Byte where 
-+   keyboards may have a nationality code which is only 5 bits. */
-+#define HIL_LOCALE_MAX 0x1f
-+
-+/* Map to hopefully useful strings.  I was trying to make these look
-+   like locale.aliases strings do; maybe that isn't the right table to
-+   emulate.  In either case, I didn't have much to work on. */
-+#define HIL_LOCALE_MAP \
-+"",			/* 0x00 Reserved */		\
-+"",			/* 0x01 Reserved */		\
-+"",			/* 0x02 Reserved */		\
-+"swiss.french",		/* 0x03 Swiss/French */		\
-+"portuguese",		/* 0x04 Portuguese */		\
-+"arabic",		/* 0x05 Arabic */		\
-+"hebrew",		/* 0x06 Hebrew */		\
-+"english.canadian",	/* 0x07 Canadian English */	\
-+"turkish",		/* 0x08 Turkish */		\
-+"greek",		/* 0x09 Greek */		\
-+"thai",			/* 0x0a Thai (Thailand) */	\
-+"italian",		/* 0x0b Italian */		\
-+"korean",		/* 0x0c Hangul (Korea) */	\
-+"dutch",		/* 0x0d Dutch */		\
-+"swedish",		/* 0x0e Swedish */		\
-+"german",		/* 0x0f German */		\
-+"chinese",		/* 0x10 Chinese-PRC */		\
-+"chinese",		/* 0x11 Chinese-ROC */		\
-+"swiss.french",		/* 0x12 Swiss/French II */	\
-+"spanish",		/* 0x13 Spanish */		\
-+"swiss.german",		/* 0x14 Swiss/German II */	\
-+"flemish",		/* 0x15 Belgian (Flemish) */	\
-+"finnish",		/* 0x16 Finnish	*/		\
-+"english.uk",		/* 0x17 United Kingdom */	\
-+"french.canadian",	/* 0x18 French/Canadian */	\
-+"swiss.german",		/* 0x19 Swiss/German */		\
-+"norwegian",		/* 0x1a Norwegian */		\
-+"french",		/* 0x1b French */		\
-+"danish",		/* 0x1c Danish */		\
-+"japanese",		/* 0x1d Katakana */		\
-+"spanish",		/* 0x1e Latin American/Spanish*/\
-+"english.us"		/* 0x1f United States */	\
-+
-+
-+/* HIL keycodes */
-+#define HIL_KEYCODES_SET1_TBLSIZE 128
-+#define HIL_KEYCODES_SET1 	\
-+   KEY_5,		KEY_RESERVED,	KEY_RIGHTALT,	KEY_LEFTALT,	\
-+   KEY_RIGHTSHIFT,	KEY_LEFTSHIFT,	KEY_LEFTCTRL,	KEY_SYSRQ,	\
-+   KEY_KP4,		KEY_KP8,	KEY_KP5,	KEY_KP9,	\
-+   KEY_KP6,		KEY_KP7,	KEY_KPCOMMA,	KEY_KPENTER,	\
-+   KEY_KP1,		KEY_KPSLASH,	KEY_KP2,	KEY_KPPLUS,	\
-+   KEY_KP3,		KEY_KPASTERISK,	KEY_KP0,	KEY_KPMINUS,	\
-+   KEY_B,		KEY_V,		KEY_C,		KEY_X,		\
-+   KEY_Z,		KEY_RESERVED,	KEY_RESERVED,   KEY_ESC,	\
-+   KEY_6,		KEY_F10,	KEY_3,		KEY_F11,	\
-+   KEY_KPDOT,		KEY_F9,		KEY_TAB /*KP*/,	KEY_F12,	\
-+   KEY_H,		KEY_G,		KEY_F,		KEY_D,		\
-+   KEY_S,		KEY_A,		KEY_RESERVED,	KEY_CAPSLOCK,	\
-+   KEY_U,		KEY_Y,		KEY_T,		KEY_R,		\
-+   KEY_E,		KEY_W,		KEY_Q,		KEY_TAB,	\
-+   KEY_7,		KEY_6,		KEY_5,		KEY_4,		\
-+   KEY_3,		KEY_2,		KEY_1,		KEY_GRAVE,	\
-+   KEY_F13,		KEY_F14,	KEY_F15,	KEY_F16,	\
-+   KEY_F17,		KEY_F18,	KEY_F19,	KEY_F20,	\
-+   KEY_MENU,		KEY_F4,		KEY_F3,		KEY_F2,		\
-+   KEY_F1,		KEY_VOLUMEUP,	KEY_STOP,	KEY_SENDFILE,	\
-+   KEY_SYSRQ,		KEY_F5,		KEY_F6,		KEY_F7,		\
-+   KEY_F8,		KEY_VOLUMEDOWN,	KEY_DEL_EOL,	KEY_DEL_EOS,	\
-+   KEY_8,		KEY_9,		KEY_0,		KEY_MINUS,	\
-+   KEY_EQUAL,		KEY_BACKSPACE,	KEY_INS_LINE,	KEY_DEL_LINE,	\
-+   KEY_I,		KEY_O,		KEY_P,		KEY_LEFTBRACE,	\
-+   KEY_RIGHTBRACE,	KEY_BACKSLASH,	KEY_INSERT,	KEY_DELETE,	\
-+   KEY_J,		KEY_K,		KEY_L,		KEY_SEMICOLON,	\
-+   KEY_APOSTROPHE,	KEY_ENTER,	KEY_HOME,	KEY_PAGEUP,	\
-+   KEY_M,		KEY_COMMA,	KEY_DOT,	KEY_SLASH,	\
-+   KEY_BACKSLASH,	KEY_SELECT,	KEY_102ND,	KEY_PAGEDOWN,	\
-+   KEY_N,		KEY_SPACE,	KEY_NEXT,	KEY_RESERVED,	\
-+   KEY_LEFT,		KEY_DOWN,	KEY_UP,		KEY_RIGHT
-+
-+
-+#define HIL_KEYCODES_SET3_TBLSIZE 128
-+#define HIL_KEYCODES_SET3 	\
-+  KEY_RESERVED,	KEY_ESC,	KEY_1,		KEY_2,			\
-+  KEY_3,	KEY_4,		KEY_5,		KEY_6,			\
-+  KEY_7,	KEY_8,		KEY_9,		KEY_0,			\
-+  KEY_MINUS,	KEY_EQUAL,	KEY_BACKSPACE,	KEY_TAB,		\
-+  KEY_Q,	KEY_W,		KEY_E,		KEY_R,			\
-+  KEY_T,	KEY_Y,		KEY_U,		KEY_I,			\
-+  KEY_O,	KEY_P,		KEY_LEFTBRACE,	KEY_RIGHTBRACE,		\
-+  KEY_ENTER,	KEY_LEFTCTRL,	KEY_A,		KEY_S,			\
-+  KEY_D,	KEY_F,		KEY_G,		KEY_H,			\
-+  KEY_J,	KEY_K,		KEY_L,		KEY_SEMICOLON,		\
-+  KEY_APOSTROPHE,KEY_GRAVE,	KEY_LEFTSHIFT,	KEY_BACKSLASH,		\
-+  KEY_Z,	KEY_X,		KEY_C,		KEY_V,			\
-+  KEY_B,	KEY_N,		KEY_M,		KEY_COMMA,		\
-+  KEY_DOT,	KEY_SLASH,	KEY_RIGHTSHIFT,	KEY_KPASTERISK,		\
-+  KEY_LEFTALT,	KEY_SPACE,	KEY_CAPSLOCK,	KEY_F1,			\
-+  KEY_F2,	KEY_F3,		KEY_F4,		KEY_F5,			\
-+  KEY_F6,	KEY_F7,		KEY_F8,		KEY_F9,			\
-+  KEY_F10,	KEY_NUMLOCK,	KEY_SCROLLLOCK,	KEY_KP7,		\
-+  KEY_KP8,	KEY_KP9,	KEY_KPMINUS,	KEY_KP4,		\
-+  KEY_KP5,	KEY_KP6,	KEY_KPPLUS,	KEY_KP1,		\
-+  KEY_KP2,	KEY_KP3,	KEY_KP0,	KEY_KPDOT,		\
-+  KEY_SYSRQ,	KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,		\
-+  KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,		\
-+  KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,		\
-+  KEY_UP,	KEY_LEFT,	KEY_DOWN,	KEY_RIGHT,		\
-+  KEY_HOME,	KEY_PAGEUP,	KEY_END,	KEY_PAGEDOWN,		\
-+  KEY_INSERT,	KEY_DELETE,	KEY_102ND,	KEY_RESERVED,		\
-+  KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,		\
-+  KEY_F1,	KEY_F2,		KEY_F3,		KEY_F4,			\
-+  KEY_F5,	KEY_F6,		KEY_F7,		KEY_F8,			\
-+  KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,		\
-+  KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED,	KEY_RESERVED
-+
-+
-+/* Response to POL command, the "poll record header" */
-+
-+#define HIL_POL_NUM_AXES_MASK	0x03	/* Number of axis reported */
-+#define HIL_POL_CTS		0x04	/* Device ready to receive data */
-+#define HIL_POL_STATUS_PENDING	0x08	/* Device has status to report */
-+#define HIL_POL_CHARTYPE_MASK	0x70	/* Type of character data to follow */
-+#define HIL_POL_CHARTYPE_NONE	0x00	/* No character data to follow */
-+#define HIL_POL_CHARTYPE_RSVD1	0x10	/* Reserved Set 1 */
-+#define HIL_POL_CHARTYPE_ASCII	0x20	/* U.S. ASCII */
-+#define HIL_POL_CHARTYPE_BINARY	0x30	/* Binary data */
-+#define HIL_POL_CHARTYPE_SET1	0x40	/* Keycode Set 1 */
-+#define HIL_POL_CHARTYPE_RSVD2	0x50	/* Reserved Set 2 */
-+#define HIL_POL_CHARTYPE_SET2	0x60	/* Keycode Set 2 */
-+#define HIL_POL_CHARTYPE_SET3	0x70	/* Keycode Set 3 */
-+#define HIL_POL_AXIS_ALT	0x80	/* Data is from axis set 2 */
-+
-+
-+#endif /* _HIL_H_ */
-Index: linux-2.6-2.6.12/include/linux/hil_mlc.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/include/linux/hil_mlc.h	2005-08-09 17:53:35.000000000 -0400
-@@ -0,0 +1,168 @@
-+/*
-+ * HP Human Interface Loop Master Link Controller driver.
-+ *
-+ * Copyright (c) 2001 Brian S. Julin
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions, and the following disclaimer,
-+ *    without modification.
-+ * 2. The name of the author may not be used to endorse or promote products
-+ *    derived from this software without specific prior written permission.
-+ *
-+ * Alternatively, this software may be distributed under the terms of the
-+ * GNU General Public License ("GPL").
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
-+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ *
-+ * References:
-+ * HP-HIL Technical Reference Manual.  Hewlett Packard Product No. 45918A
-+ *
-+ */
-+
-+#include <linux/hil.h>
-+#include <linux/time.h>
-+#include <linux/interrupt.h>
-+#include <asm/semaphore.h>
-+#include <linux/serio.h>
-+#include <linux/list.h>
-+
-+typedef struct hil_mlc hil_mlc;
-+
-+/* The HIL has a complicated state engine.
-+ * We define the structure of nodes in the state engine here.
-+ */
-+enum hilse_act {
-+  	/* HILSE_OUT prepares to receive input if the next node
-+	 * is an IN or EXPECT, and then sends the given packet.
-+	 */
-+	HILSE_OUT = 0,
-+
-+  	/* HILSE_CTS checks if the loop is busy. */
-+	HILSE_CTS,
-+
-+	/* HILSE_OUT_LAST sends the given command packet to 
-+	 * the last configured/running device on the loop.
-+	 */
-+	HILSE_OUT_LAST,
-+
-+	/* HILSE_OUT_DISC sends the given command packet to
-+	 * the next device past the last configured/running one.
-+	 */
-+	HILSE_OUT_DISC,
-+
-+	/* HILSE_FUNC runs a callback function with given arguments.
-+	 * a positive return value causes the "ugly" branch to be taken.
-+	 */
-+	HILSE_FUNC,
-+
-+  	/* HILSE_IN simply expects any non-errored packet to arrive 
-+	 * within arg usecs.
-+	 */
-+	HILSE_IN		= 0x100,
-+
-+  	/* HILSE_EXPECT expects a particular packet to arrive 
-+	 * within arg usecs, any other packet is considered an error.
-+	 */
-+	HILSE_EXPECT,
-+
-+  	/* HILSE_EXPECT_LAST as above but dev field should be last 
-+	 * discovered/operational device.
-+	 */
-+	HILSE_EXPECT_LAST,
-+
-+  	/* HILSE_EXPECT_LAST as above but dev field should be first 
-+	 * undiscovered/inoperational device.
-+	 */
-+	HILSE_EXPECT_DISC
-+};
-+
-+typedef int	(hilse_func) (hil_mlc *mlc, int arg);
-+struct hilse_node {
-+	enum hilse_act		act;	/* How to process this node         */
-+	union {
-+		hilse_func	*func;	/* Function to call if HILSE_FUNC   */
-+		hil_packet	packet;	/* Packet to send or to compare     */
-+	} object;
-+	int			arg;	/* Timeout in usec or parm for func */
-+	int			good;	/* Node to jump to on success       */
-+	int			bad;	/* Node to jump to on error         */
-+	int			ugly;	/* Node to jump to on timeout       */
-+};
-+
-+/* Methods for back-end drivers, e.g. hp_sdc_mlc */
-+typedef int	(hil_mlc_cts) (hil_mlc *mlc);
-+typedef void	(hil_mlc_out) (hil_mlc *mlc);
-+typedef int	(hil_mlc_in)  (hil_mlc *mlc, suseconds_t timeout);
-+
-+struct hil_mlc_devinfo {
-+	uint8_t	idd[16];	/* Device ID Byte and Describe Record */
-+	uint8_t	rsc[16];	/* Security Code Header and Record */
-+	uint8_t	exd[16];	/* Extended Describe Record */
-+	uint8_t	rnm[16];	/* Device name as returned by RNM command */
-+};
-+
-+struct hil_mlc_serio_map {
-+	hil_mlc *mlc;
-+	int di_revmap;
-+	int didx;
-+};
-+
-+/* How many (possibly old/detached) devices the we try to keep track of */
-+#define HIL_MLC_DEVMEM 16
-+
-+struct hil_mlc {
-+	struct list_head	list;	/* hil_mlc is organized as linked list */
-+
-+	rwlock_t		lock;
-+
-+	void *priv; /* Data specific to a particular type of MLC */
-+
-+	int 			seidx;	/* Current node in state engine */
-+	int			istarted, ostarted;
-+
-+	hil_mlc_cts		*cts;
-+	struct semaphore	csem;   /* Raised when loop idle */
-+
-+	hil_mlc_out		*out;
-+	struct semaphore	osem;   /* Raised when outpacket dispatched */
-+	hil_packet		opacket;
-+
-+	hil_mlc_in		*in;
-+	struct semaphore	isem;   /* Raised when a packet arrives */
-+	hil_packet		ipacket[16];
-+	hil_packet		imatch;
-+	int			icount;
-+	struct timeval		instart;
-+	suseconds_t		intimeout;
-+
-+	int			ddi;	/* Last operational device id */
-+	int			lcv;	/* LCV to throttle loops */
-+	struct timeval		lcv_tv; /* Time loop was started */
-+
-+	int			di_map[7]; /* Maps below items to live devs */
-+	struct hil_mlc_devinfo	di[HIL_MLC_DEVMEM];
-+	struct serio		*serio[HIL_MLC_DEVMEM];
-+	struct hil_mlc_serio_map serio_map[HIL_MLC_DEVMEM];
-+	hil_packet		serio_opacket[HIL_MLC_DEVMEM];
-+	int			serio_oidx[HIL_MLC_DEVMEM];
-+	struct hil_mlc_devinfo	di_scratch; /* Temporary area */
-+
-+	int			opercnt;
-+
-+	struct tasklet_struct	*tasklet;
-+};
-+
-+int hil_mlc_register(hil_mlc *mlc);
-+int hil_mlc_unregister(hil_mlc *mlc);
-Index: linux-2.6-2.6.12/include/linux/hp_sdc.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/include/linux/hp_sdc.h	2005-08-09 17:53:35.000000000 -0400
-@@ -0,0 +1,300 @@
-+/*
-+ * HP i8042 System Device Controller -- header
-+ *
-+ * Copyright (c) 2001 Brian S. Julin
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions, and the following disclaimer,
-+ *    without modification.
-+ * 2. The name of the author may not be used to endorse or promote products
-+ *    derived from this software without specific prior written permission.
-+ *
-+ * Alternatively, this software may be distributed under the terms of the
-+ * GNU General Public License ("GPL").
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
-+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ *
-+ * References:
-+ * 
-+ * HP-HIL Technical Reference Manual.  Hewlett Packard Product No. 45918A
-+ *
-+ * System Device Controller Microprocessor Firmware Theory of Operation
-+ * 	for Part Number 1820-4784 Revision B.  Dwg No. A-1820-4784-2
-+ *
-+ */
-+
-+#ifndef _LINUX_HP_SDC_H
-+#define _LINUX_HP_SDC_H
-+
-+#include <linux/interrupt.h>
-+#include <linux/types.h>
-+#include <linux/time.h>
-+#include <linux/timer.h>
-+#if defined(__hppa__)
-+#include <asm/hardware.h>
-+#endif
-+
-+
-+/* No 4X status reads take longer than this (in usec).
-+ */
-+#define HP_SDC_MAX_REG_DELAY 20000
-+
-+typedef void (hp_sdc_irqhook) (int irq, void *dev_id, 
-+			       uint8_t status, uint8_t data);
-+
-+int hp_sdc_request_timer_irq(hp_sdc_irqhook *callback);
-+int hp_sdc_request_hil_irq(hp_sdc_irqhook *callback);
-+int hp_sdc_request_cooked_irq(hp_sdc_irqhook *callback);
-+int hp_sdc_release_timer_irq(hp_sdc_irqhook *callback);
-+int hp_sdc_release_hil_irq(hp_sdc_irqhook *callback);
-+int hp_sdc_release_cooked_irq(hp_sdc_irqhook *callback);
-+
-+typedef struct {
-+	int actidx;	/* Start of act.  Acts are atomic WRT I/O to SDC */
-+	int idx;	/* Index within the act */
-+	int endidx;	/* transaction is over and done if idx == endidx */
-+	uint8_t *seq;	/* commands/data for the transaction */
-+	union {
-+	  hp_sdc_irqhook   *irqhook;	/* Callback, isr or tasklet context */
-+	  struct semaphore *semaphore;	/* Semaphore to sleep on. */
-+	} act;
-+} hp_sdc_transaction;
-+int hp_sdc_enqueue_transaction(hp_sdc_transaction *this);
-+int hp_sdc_dequeue_transaction(hp_sdc_transaction *this);
-+
-+/* The HP_SDC_ACT* values are peculiar to this driver.
-+ * Nuance: never HP_SDC_ACT_DATAIN | HP_SDC_ACT_DEALLOC, use another
-+ * act to perform the dealloc.
-+ */
-+#define HP_SDC_ACT_PRECMD	0x01		/* Send a command first */
-+#define HP_SDC_ACT_DATAREG	0x02		/* Set data registers */
-+#define HP_SDC_ACT_DATAOUT	0x04		/* Send data bytes */
-+#define HP_SDC_ACT_POSTCMD      0x08            /* Send command after */
-+#define HP_SDC_ACT_DATAIN	0x10		/* Collect data after */
-+#define HP_SDC_ACT_DURING	0x1f
-+#define HP_SDC_ACT_SEMAPHORE    0x20            /* Raise semaphore after */
-+#define HP_SDC_ACT_CALLBACK	0x40		/* Pass data to IRQ handler */
-+#define HP_SDC_ACT_DEALLOC	0x80		/* Destroy transaction after */
-+#define HP_SDC_ACT_AFTER	0xe0
-+#define HP_SDC_ACT_DEAD		0x60		/* Act timed out. */
-+
-+/* Rest of the flags are straightforward representation of the SDC interface */
-+#define HP_SDC_STATUS_IBF	0x02	/* Input buffer full */
-+
-+#define HP_SDC_STATUS_IRQMASK	0xf0	/* Bits containing "level 1" irq */
-+#define HP_SDC_STATUS_PERIODIC  0x10    /* Periodic 10ms timer */
-+#define HP_SDC_STATUS_USERTIMER 0x20    /* "Special purpose" timer */
-+#define HP_SDC_STATUS_TIMER     0x30    /* Both PERIODIC and USERTIMER */
-+#define HP_SDC_STATUS_REG	0x40	/* Data from an i8042 register */
-+#define HP_SDC_STATUS_HILCMD    0x50	/* Command from HIL MLC */
-+#define HP_SDC_STATUS_HILDATA   0x60	/* Data from HIL MLC */
-+#define HP_SDC_STATUS_PUP	0x70	/* Sucessful power-up self test */
-+#define HP_SDC_STATUS_KCOOKED	0x80	/* Key from cooked kbd */
-+#define HP_SDC_STATUS_KRPG	0xc0	/* Key from Repeat Gen */
-+#define HP_SDC_STATUS_KMOD_SUP	0x10	/* Shift key is up */
-+#define HP_SDC_STATUS_KMOD_CUP	0x20	/* Control key is up */
-+
-+#define HP_SDC_NMISTATUS_FHS	0x40	/* NMI is a fast handshake irq */
-+
-+/* Internal i8042 registers (there are more, but they are not too useful). */
-+
-+#define HP_SDC_USE		0x02	/* Resource usage (including OB bit) */
-+#define HP_SDC_IM		0x04	/* Interrupt mask */
-+#define HP_SDC_CFG		0x11	/* Configuration register */
-+#define HP_SDC_KBLANGUAGE	0x12	/* Keyboard language */
-+
-+#define HP_SDC_D0		0x70	/* General purpose data buffer 0 */
-+#define HP_SDC_D1		0x71	/* General purpose data buffer 1 */
-+#define HP_SDC_D2		0x72	/* General purpose data buffer 2 */
-+#define HP_SDC_D3		0x73	/* General purpose data buffer 3 */
-+#define HP_SDC_VT1		0x74	/* Timer for voice 1 */
-+#define HP_SDC_VT2		0x75	/* Timer for voice 2 */
-+#define HP_SDC_VT3		0x76	/* Timer for voice 3 */
-+#define HP_SDC_VT4		0x77	/* Timer for voice 4 */
-+#define HP_SDC_KBN		0x78	/* Which HIL devs are Nimitz */
-+#define HP_SDC_KBC		0x79	/* Which HIL devs are cooked kbds */
-+#define HP_SDC_LPS		0x7a	/* i8042's view of HIL status */
-+#define HP_SDC_LPC		0x7b	/* i8042's view of HIL "control" */
-+#define HP_SDC_RSV  		0x7c	/* Reserved "for testing" */
-+#define HP_SDC_LPR		0x7d    /* i8042 count of HIL reconfigs */
-+#define HP_SDC_XTD		0x7e    /* "Extended Configuration" register */
-+#define HP_SDC_STR		0x7f    /* i8042 self-test result */
-+
-+/* Bitfields for above registers */
-+#define HP_SDC_USE_LOOP		0x04	/* Command is currently on the loop. */
-+
-+#define HP_SDC_IM_MASK          0x1f    /* these bits not part of cmd/status */
-+#define HP_SDC_IM_FH		0x10	/* Mask the fast handshake irq */
-+#define HP_SDC_IM_PT		0x08	/* Mask the periodic timer irq */
-+#define HP_SDC_IM_TIMERS	0x04	/* Mask the MT/DT/CT irq */
-+#define HP_SDC_IM_RESET		0x02	/* Mask the reset key irq */
-+#define HP_SDC_IM_HIL		0x01	/* Mask the HIL MLC irq */
-+
-+#define HP_SDC_CFG_ROLLOVER	0x08	/* WTF is "N-key rollover"? */
-+#define HP_SDC_CFG_KBD		0x10	/* There is a keyboard */
-+#define HP_SDC_CFG_NEW		0x20	/* Supports/uses HIL MLC */
-+#define HP_SDC_CFG_KBD_OLD	0x03	/* keyboard code for non-HIL */
-+#define HP_SDC_CFG_KBD_NEW	0x07	/* keyboard code from HIL autoconfig */
-+#define HP_SDC_CFG_REV		0x40	/* Code revision bit */
-+#define HP_SDC_CFG_IDPROM	0x80	/* IDPROM present in kbd (not HIL) */
-+
-+#define HP_SDC_LPS_NDEV		0x07	/* # devices autoconfigured on HIL */
-+#define HP_SDC_LPS_ACSUCC	0x08	/* loop autoconfigured successfully */
-+#define HP_SDC_LPS_ACFAIL	0x80	/* last loop autoconfigure failed */
-+
-+#define HP_SDC_LPC_APE_IPF	0x01	/* HIL MLC APE/IPF (autopoll) set */
-+#define HP_SDC_LPC_ARCONERR	0x02	/* i8042 autoreconfigs loop on err */
-+#define HP_SDC_LPC_ARCQUIET	0x03	/* i8042 doesn't report autoreconfigs*/
-+#define HP_SDC_LPC_COOK		0x10	/* i8042 cooks devices in _KBN */
-+#define HP_SDC_LPC_RC		0x80	/* causes autoreconfig */
-+
-+#define HP_SDC_XTD_REV		0x07	/* contains revision code */
-+#define HP_SDC_XTD_REV_STRINGS(val, str) \
-+switch (val) {						\
-+	case 0x1: str = "1820-3712"; break;		\
-+	case 0x2: str = "1820-4379"; break;		\
-+	case 0x3: str = "1820-4784"; break;		\
-+	default: str = "unknown";			\
-+};
-+#define HP_SDC_XTD_BEEPER	0x08	/* TI SN76494 beeper available */
-+#define HP_SDC_XTD_BBRTC	0x20	/* OKI MSM-58321 BBRTC present */
-+
-+#define HP_SDC_CMD_LOAD_RT	0x31	/* Load real time (from 8042) */
-+#define HP_SDC_CMD_LOAD_FHS	0x36	/* Load the fast handshake timer */
-+#define HP_SDC_CMD_LOAD_MT	0x38	/* Load the match timer */
-+#define HP_SDC_CMD_LOAD_DT	0x3B	/* Load the delay timer */
-+#define HP_SDC_CMD_LOAD_CT	0x3E	/* Load the cycle timer */
-+
-+#define HP_SDC_CMD_SET_IM	0x40    /* 010xxxxx == set irq mask */
-+
-+/* The documents provided do not explicitly state that all registers betweem 
-+ * 0x01 and 0x1f inclusive can be read by sending their register index as a 
-+ * command, but this is implied and appears to be the case.
-+ */
-+#define HP_SDC_CMD_READ_RAM	0x00	/* Load from i8042 RAM (autoinc) */
-+#define HP_SDC_CMD_READ_USE	0x02	/* Undocumented! Load from usage reg */
-+#define HP_SDC_CMD_READ_IM	0x04	/* Load current interrupt mask */
-+#define HP_SDC_CMD_READ_KCC	0x11	/* Load primary kbd config code */
-+#define HP_SDC_CMD_READ_KLC	0x12	/* Load primary kbd language code */
-+#define HP_SDC_CMD_READ_T1	0x13	/* Load timer output buffer byte 1 */
-+#define HP_SDC_CMD_READ_T2	0x14	/* Load timer output buffer byte 1 */
-+#define HP_SDC_CMD_READ_T3	0x15	/* Load timer output buffer byte 1 */
-+#define HP_SDC_CMD_READ_T4	0x16	/* Load timer output buffer byte 1 */
-+#define HP_SDC_CMD_READ_T5	0x17	/* Load timer output buffer byte 1 */
-+#define HP_SDC_CMD_READ_D0	0xf0	/* Load from i8042 RAM location 0x70 */
-+#define HP_SDC_CMD_READ_D1	0xf1	/* Load from i8042 RAM location 0x71 */
-+#define HP_SDC_CMD_READ_D2	0xf2	/* Load from i8042 RAM location 0x72 */
-+#define HP_SDC_CMD_READ_D3	0xf3	/* Load from i8042 RAM location 0x73 */
-+#define HP_SDC_CMD_READ_VT1	0xf4	/* Load from i8042 RAM location 0x74 */
-+#define HP_SDC_CMD_READ_VT2	0xf5	/* Load from i8042 RAM location 0x75 */
-+#define HP_SDC_CMD_READ_VT3	0xf6	/* Load from i8042 RAM location 0x76 */
-+#define HP_SDC_CMD_READ_VT4	0xf7	/* Load from i8042 RAM location 0x77 */
-+#define HP_SDC_CMD_READ_KBN	0xf8	/* Load from i8042 RAM location 0x78 */
-+#define HP_SDC_CMD_READ_KBC	0xf9	/* Load from i8042 RAM location 0x79 */
-+#define HP_SDC_CMD_READ_LPS	0xfa	/* Load from i8042 RAM location 0x7a */
-+#define HP_SDC_CMD_READ_LPC	0xfb	/* Load from i8042 RAM location 0x7b */
-+#define HP_SDC_CMD_READ_RSV	0xfc	/* Load from i8042 RAM location 0x7c */
-+#define HP_SDC_CMD_READ_LPR	0xfd	/* Load from i8042 RAM location 0x7d */
-+#define HP_SDC_CMD_READ_XTD	0xfe	/* Load from i8042 RAM location 0x7e */
-+#define HP_SDC_CMD_READ_STR	0xff	/* Load from i8042 RAM location 0x7f */
-+
-+#define HP_SDC_CMD_SET_ARD	0xA0	/* Set emulated autorepeat delay */
-+#define HP_SDC_CMD_SET_ARR	0xA2	/* Set emulated autorepeat rate */
-+#define HP_SDC_CMD_SET_BELL	0xA3	/* Set voice 3 params for "beep" cmd */
-+#define HP_SDC_CMD_SET_RPGR	0xA6	/* Set "RPG" irq rate (doesn't work) */
-+#define HP_SDC_CMD_SET_RTMS	0xAD	/* Set the RTC time (milliseconds) */
-+#define HP_SDC_CMD_SET_RTD	0xAF	/* Set the RTC time (days) */
-+#define HP_SDC_CMD_SET_FHS	0xB2	/* Set fast handshake timer */
-+#define HP_SDC_CMD_SET_MT	0xB4	/* Set match timer */
-+#define HP_SDC_CMD_SET_DT	0xB7	/* Set delay timer */
-+#define HP_SDC_CMD_SET_CT	0xBA	/* Set cycle timer */
-+#define HP_SDC_CMD_SET_RAMP	0xC1	/* Reset READ_RAM autoinc counter */
-+#define HP_SDC_CMD_SET_D0	0xe0	/* Load to i8042 RAM location 0x70 */
-+#define HP_SDC_CMD_SET_D1	0xe1	/* Load to i8042 RAM location 0x71 */
-+#define HP_SDC_CMD_SET_D2	0xe2	/* Load to i8042 RAM location 0x72 */
-+#define HP_SDC_CMD_SET_D3	0xe3	/* Load to i8042 RAM location 0x73 */
-+#define HP_SDC_CMD_SET_VT1	0xe4	/* Load to i8042 RAM location 0x74 */
-+#define HP_SDC_CMD_SET_VT2	0xe5	/* Load to i8042 RAM location 0x75 */
-+#define HP_SDC_CMD_SET_VT3	0xe6	/* Load to i8042 RAM location 0x76 */
-+#define HP_SDC_CMD_SET_VT4	0xe7	/* Load to i8042 RAM location 0x77 */
-+#define HP_SDC_CMD_SET_KBN	0xe8	/* Load to i8042 RAM location 0x78 */
-+#define HP_SDC_CMD_SET_KBC	0xe9	/* Load to i8042 RAM location 0x79 */
-+#define HP_SDC_CMD_SET_LPS	0xea	/* Load to i8042 RAM location 0x7a */
-+#define HP_SDC_CMD_SET_LPC	0xeb	/* Load to i8042 RAM location 0x7b */
-+#define HP_SDC_CMD_SET_RSV	0xec	/* Load to i8042 RAM location 0x7c */
-+#define HP_SDC_CMD_SET_LPR	0xed	/* Load to i8042 RAM location 0x7d */
-+#define HP_SDC_CMD_SET_XTD	0xee	/* Load to i8042 RAM location 0x7e */
-+#define HP_SDC_CMD_SET_STR	0xef	/* Load to i8042 RAM location 0x7f */
-+
-+#define HP_SDC_CMD_DO_RTCW	0xc2	/* i8042 RAM 0x70 --> RTC */
-+#define HP_SDC_CMD_DO_RTCR	0xc3	/* RTC[0x70 0:3] --> irq/status/data */
-+#define HP_SDC_CMD_DO_BEEP	0xc4	/* i8042 RAM 0x70-74  --> beeper,VT3 */
-+#define HP_SDC_CMD_DO_HIL	0xc5	/* i8042 RAM 0x70-73 --> 
-+					   HIL MLC R0,R1 i8042 HIL watchdog */
-+
-+/* Values used to (de)mangle input/output to/from the HIL MLC */
-+#define HP_SDC_DATA		0x40	/* Data from an 8042 register */
-+#define HP_SDC_HIL_CMD		0x50	/* Data from HIL MLC R1/8042 */
-+#define HP_SDC_HIL_R1MASK	0x0f	/* Contents of HIL MLC R1 0:3 */
-+#define HP_SDC_HIL_AUTO		0x10	/* Set if POL results from i8042 */   
-+#define HP_SDC_HIL_ISERR	0x80	/* Has meaning as in next 4 values */
-+#define HP_SDC_HIL_RC_DONE	0x80	/* i8042 auto-configured loop */
-+#define HP_SDC_HIL_ERR		0x81	/* HIL MLC R2 had a bit set */
-+#define HP_SDC_HIL_TO		0x82	/* i8042 HIL watchdog expired */
-+#define HP_SDC_HIL_RC		0x84	/* i8042 is auto-configuring loop */
-+#define HP_SDC_HIL_DAT		0x60	/* Data from HIL MLC R0 */
-+
-+
-+typedef struct {
-+	rwlock_t	ibf_lock;
-+	rwlock_t	lock;		/* user/tasklet lock */
-+	rwlock_t	rtq_lock;	/* isr/tasklet lock */
-+	rwlock_t	hook_lock;	/* isr/user lock for handler add/del */
-+
-+	unsigned int	irq, nmi;	/* Our IRQ lines */
-+	unsigned long	base_io, status_io, data_io; /* Our IO ports */
-+
-+	uint8_t		im;		/* Interrupt mask */
-+	int		set_im; 	/* Interrupt mask needs to be set. */
-+
-+	int		ibf;		/* Last known status of IBF flag */
-+	uint8_t		wi;		/* current i8042 write index */
-+	uint8_t		r7[4];          /* current i8042[0x70 - 0x74] values */
-+	uint8_t		r11, r7e;	/* Values from version/revision regs */
-+
-+	hp_sdc_irqhook	*timer, *reg, *hil, *pup, *cooked;
-+
-+#define HP_SDC_QUEUE_LEN 16
-+	hp_sdc_transaction *tq[HP_SDC_QUEUE_LEN]; /* All pending read/writes */
-+
-+	int		rcurr, rqty;	/* Current read transact in process */
-+	struct timeval	rtv;		/* Time when current read started */
-+	int		wcurr;		/* Current write transact in process */
-+
-+	int		dev_err;	/* carries status from registration */
-+#if defined(__hppa__)
-+	struct parisc_device	*dev;
-+#elif defined(__mc68000__)
-+	void		*dev;
-+#else
-+#error No support for device registration on this arch yet.
-+#endif
-+
-+	struct timer_list kicker;	/* Keeps below task alive */
-+	struct tasklet_struct	task;
-+
-+} hp_i8042_sdc;
-+
-+#endif /* _LINUX_HP_SDC_H */
-Index: linux-2.6-2.6.12/include/linux/input.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/linux/input.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/linux/input.h	2005-08-09 17:53:35.000000000 -0400
-@@ -620,6 +620,7 @@
- #define BUS_ADB			0x17
- #define BUS_I2C			0x18
- #define BUS_HOST		0x19
-+#define BUS_GSC			0x1A
- 
- /*
-  * Values describing the status of an effect
-Index: linux-2.6-2.6.12/include/linux/serio.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/linux/serio.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/linux/serio.h	2005-08-09 17:53:35.000000000 -0400
-@@ -179,7 +179,7 @@
- #define SERIO_8042_XL	0x06
- 
- /*
-- * Serio types
-+ * Serio protos
-  */
- #define SERIO_UNKNOWN	0x00
- #define SERIO_MSC	0x01
-Index: linux-2.6-2.6.12/include/linux/signal.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/linux/signal.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/linux/signal.h	2005-08-09 17:53:35.000000000 -0400
-@@ -234,6 +234,9 @@
- struct pt_regs;
- extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
- 
-+int copy_siginfo_from_user(siginfo_t *to, siginfo_t __user *from);
-+int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from);
-+
- #endif /* __KERNEL__ */
- 
- #endif /* _LINUX_SIGNAL_H */
-Index: linux-2.6-2.6.12/include/sound/opl3.h
-===================================================================
---- linux-2.6-2.6.12.orig/include/sound/opl3.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/include/sound/opl3.h	2005-08-09 17:53:35.000000000 -0400
-@@ -261,8 +261,8 @@
- } snd_opl3_voice_t;
- 
- struct snd_opl3 {
--	unsigned long l_port;
--	unsigned long r_port;
-+	void __iomem *l_port;
-+	void __iomem *r_port;
- 	struct resource *res_l_port;
- 	struct resource *res_r_port;
- 	unsigned short hardware;
-@@ -319,6 +319,9 @@
- void snd_opl3_interrupt(snd_hwdep_t * hw);
- int snd_opl3_new(snd_card_t *card, unsigned short hardware, opl3_t **ropl3);
- int snd_opl3_init(opl3_t *opl3);
-+int snd_opl3_create_mapped(snd_card_t * card,
-+			   void __iomem * l_port, void __iomem * r_port,
-+			   unsigned short hardware, opl3_t ** opl3);
- int snd_opl3_create(snd_card_t * card,
- 		    unsigned long l_port, unsigned long r_port,
- 		    unsigned short hardware,
-Index: linux-2.6-2.6.12/ipc/compat_mq.c
-===================================================================
---- linux-2.6-2.6.12.orig/ipc/compat_mq.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/ipc/compat_mq.c	2005-08-09 17:53:35.000000000 -0400
-@@ -7,6 +7,7 @@
-  */
- 
- #include <linux/compat.h>
-+#include <linux/compat_siginfo.h>
- #include <linux/fs.h>
- #include <linux/kernel.h>
- #include <linux/mqueue.h>
-Index: linux-2.6-2.6.12/kernel/Makefile
-===================================================================
---- linux-2.6-2.6.12.orig/kernel/Makefile	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/kernel/Makefile	2005-08-09 17:53:35.000000000 -0400
-@@ -17,7 +17,7 @@
- obj-$(CONFIG_KALLSYMS) += kallsyms.o
- obj-$(CONFIG_PM) += power/
- obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
--obj-$(CONFIG_COMPAT) += compat.o
-+obj-$(CONFIG_COMPAT) += compat.o compat_signal.o
- obj-$(CONFIG_CPUSETS) += cpuset.o
- obj-$(CONFIG_IKCONFIG) += configs.o
- obj-$(CONFIG_IKCONFIG_PROC) += configs.o
-Index: linux-2.6-2.6.12/kernel/compat.c
-===================================================================
---- linux-2.6-2.6.12.orig/kernel/compat.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/kernel/compat.c	2005-08-09 17:53:35.000000000 -0400
-@@ -13,6 +13,7 @@
- 
- #include <linux/linkage.h>
- #include <linux/compat.h>
-+#include <linux/compat_siginfo.h>
- #include <linux/errno.h>
- #include <linux/time.h>
- #include <linux/signal.h>
-@@ -441,7 +442,11 @@
- 
- 	BUG_ON(info.si_code & __SI_MASK);
- 	info.si_code |= __SI_CHLD;
--	return copy_siginfo_to_user32(uinfo, &info);
-+	
-+	if (compat_copy_siginfo_to_user(uinfo, &info) != 0)
-+		return -EFAULT;
-+
-+	return 0;
- }
- 
- static int compat_get_user_cpu_mask(compat_ulong_t __user *user_mask_ptr,
-@@ -653,6 +658,26 @@
- 
- /* timer_create is architecture specific because it needs sigevent conversion */
- 
-+long compat_sys_timer_create(clockid_t which_clock,
-+			     compat_sigevent_t __user *timer_event_spec,
-+			     compat_timer_t __user * created_timer_id)
-+{
-+	sigevent_t kevent;
-+	mm_segment_t old_fs = get_fs();
-+	long ret;
-+
-+	if (timer_event_spec != NULL)
-+		if (compat_copy_sigevent_from_user(&kevent, timer_event_spec) != 0)
-+			return -EFAULT;
-+
-+	set_fs(KERNEL_DS);
-+	ret = sys_timer_create(which_clock, timer_event_spec ? (sigevent_t __user *)&kevent : NULL, created_timer_id);
-+	set_fs(old_fs);
-+
-+	return ret;
-+}
-+
-+
- long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask,
- 		       unsigned long bitmap_size)
- {
-@@ -810,7 +835,7 @@
- 	if (sig) {
- 		ret = sig;
- 		if (uinfo) {
--			if (copy_siginfo_to_user32(uinfo, &info))
-+			if (compat_copy_siginfo_to_user(uinfo, &info))
- 				ret = -EFAULT;
- 		}
- 	}else {
-Index: linux-2.6-2.6.12/kernel/compat_signal.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/kernel/compat_signal.c	2005-08-09 17:53:35.000000000 -0400
-@@ -0,0 +1,244 @@
-+/*
-+ *  Copyright (C) 2003 Carlos O'Donell
-+ * 
-+ *  2003-12-20  Carlos O'Donell
-+ *              Copied linux/kernel/compat_signal.c (copy_siginfo_to_user)
-+ *              and modified to use compat_siginfo_t for thunking down to
-+ *              32-bit userspace from a 64-bit kernel.
-+ *              
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or (at
-+ * your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
-+ * NON INFRINGEMENT.  See the GNU General Public License for more
-+ * details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
-+ *
-+ */
-+
-+#include <linux/compat_siginfo.h>
-+#include <asm/errno.h>
-+#include <asm/uaccess.h>
-+#include <asm/siginfo.h>
-+
-+#ifndef HAVE_ARCH_COMPAT_COPY_SIGINFO_TO_USER
-+int compat_copy_siginfo_to_user(compat_siginfo_t __user *to, siginfo_t *from)
-+{
-+	int err;
-+	compat_siginfo_t compat_from;	
-+
-+	if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
-+		return -EFAULT;
-+	
-+	/*
-+	 * If you change compat_siginfo_t structure *or* siginfo_t, 
-+	 * please be sure this code is fixed accordingly.
-+	 * It should never copy any pad contained in the structure
-+	 * to avoid security leaks, but must copy the generic
-+	 * 3 ints plus the relevant union member.
-+	 */
-+
-+	/* Convert structure, don't leak anything in the copy */
-+	memset(&compat_from,'\0',sizeof(compat_siginfo_t));
-+
-+        /* Always copy si_signo, si_errno, and si_code */
-+	compat_from.si_signo = (compat_int_t)(from->si_signo);
-+	compat_from.si_errno = (compat_int_t)(from->si_errno);
-+	/* si_code is only a (short) value, remove kernel bits. */
-+	compat_from.si_code = (short)(from->si_code);
-+        
-+	err = __put_user(compat_from.si_signo, &to->si_signo);
-+	err |= __put_user(compat_from.si_errno, &to->si_errno);
-+	err |= __put_user(compat_from.si_code, &to->si_code);
-+
-+        /* siginfo_t came from userspace, so it is the right
-+         * size, no need for conversion
-+         */        
-+	if (from->si_code < 0) {
-+		return __copy_to_user(&to->_sifields._pad, 
-+                                      &from->_sifields._pad, 
-+                                      SI_COMPAT_PAD_SIZE)
-+			? -EFAULT : 0;
-+        }
-+	
-+	switch (from->si_code & __SI_MASK) {
-+	case __SI_KILL:
-+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
-+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
-+		err |= __put_user(compat_from.si_pid, &to->si_pid);
-+		err |= __put_user(compat_from.si_uid, &to->si_uid);
-+		break;
-+	case __SI_TIMER:
-+		compat_from.si_pid = (compat_timer_t)(from->si_tid);
-+		compat_from.si_overrun = (compat_int_t)(from->si_overrun);
-+		compat_from.si_ptr = (compat_uptr_t)((u64 __force)(from->si_ptr) & 0xffffffffUL);
-+		err |= __put_user(compat_from.si_tid, &to->si_tid);
-+		err |= __put_user(compat_from.si_overrun, &to->si_overrun);
-+		err |= __put_user(compat_from.si_ptr, &to->si_ptr);
-+		break;
-+	case __SI_POLL:
-+		compat_from.si_band = (__ARCH_SI_COMPAT_BAND_T)(from->si_band);
-+		compat_from.si_fd = (compat_int_t)(from->si_fd);
-+		err |= __put_user(compat_from.si_band, &to->si_band);
-+		err |= __put_user(compat_from.si_fd, &to->si_fd);
-+		break;
-+	case __SI_FAULT:
-+		compat_from.si_addr = (compat_uptr_t)((u64 __force)(from->si_addr) & 0xffffffffUL);
-+		err |= __put_user(compat_from.si_addr, &to->si_addr);
-+#ifdef __ARCH_SI_COMPAT_TRAPNO
-+		compat_from.si_trapno = (compat_int_t)(from->si_addr);
-+		err |= __put_user(compat_from.si_trapno, &to->si_trapno);
-+#endif
-+		break;
-+	case __SI_CHLD:
-+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
-+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
-+		compat_from.si_status = (compat_int_t)(from->si_status);
-+		compat_from.si_utime = (compat_clock_t)(from->si_utime);
-+		compat_from.si_stime = (compat_clock_t)(from->si_stime);
-+		err |= __put_user(compat_from.si_pid, &to->si_pid);
-+		err |= __put_user(compat_from.si_uid, &to->si_uid);
-+		err |= __put_user(compat_from.si_status, &to->si_status);
-+		err |= __put_user(compat_from.si_utime, &to->si_utime);
-+		err |= __put_user(compat_from.si_stime, &to->si_stime);
-+		break;
-+	case __SI_RT: /* This is not generated by the kernel as of now. */
-+	case __SI_MESGQ: /* But this is */
-+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
-+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
-+		compat_from.si_int = (compat_int_t)(from->si_int);
-+		compat_from.si_ptr = (compat_uptr_t)((u64 __force)(from->si_ptr) & 0xffffffffUL);
-+		err |= __put_user(compat_from.si_pid, &to->si_pid);
-+		err |= __put_user(compat_from.si_uid, &to->si_uid);
-+		err |= __put_user(compat_from.si_int, &to->si_int);
-+		err |= __put_user(compat_from.si_ptr, &to->si_ptr);
-+		break;
-+	default: /* this is just in case for now ... */
-+		compat_from.si_pid = (compat_pid_t)(from->si_pid);
-+		compat_from.si_uid = (__ARCH_SI_COMPAT_UID_T)(from->si_uid);
-+		err |= __put_user(compat_from.si_pid, &to->si_pid);
-+		err |= __put_user(compat_from.si_uid, &to->si_uid);
-+		break;
-+	}
-+	return err;
-+}
-+#endif
-+
-+#ifndef HAVE_ARCH_COPY_SIGINFO_FROM_USER
-+int compat_copy_siginfo_from_user(siginfo_t *to, compat_siginfo_t __user *from)
-+{
-+	int err;
-+        u64 scratch;
-+
-+	if (!access_ok (VERIFY_READ, from, sizeof(compat_siginfo_t)))
-+		return -EFAULT;
-+	
-+	/*
-+	 * If you change compat_siginfo_t structure *or* siginfo_t, 
-+	 * please be sure this code is fixed accordingly.
-+	 */
-+
-+        /* Always copy si_signo, si_errno, and si_code */
-+	err = __get_user(to->si_signo, &from->si_signo);
-+	err |= __get_user(to->si_errno, &from->si_errno);
-+	err |= __get_user(to->si_code, &from->si_code);
-+        
-+        /* siginfo_t came from userspace, so it is the right
-+         * size, no need for conversion
-+         */        
-+	if (to->si_code < 0) {
-+		return __copy_from_user(&to->_sifields._pad, 
-+                                        &from->_sifields._pad, 
-+                                        SI_COMPAT_PAD_SIZE)
-+			? -EFAULT : 0;
-+        }
-+	
-+	switch (to->si_code & __SI_MASK) {
-+	case __SI_KILL:
-+		err |= __get_user(to->si_pid, &from->si_pid);
-+		err |= __get_user(to->si_uid, &from->si_uid);
-+		break;
-+	case __SI_TIMER:
-+		err |= __get_user(to->si_tid, &from->si_tid);
-+		err |= __get_user(to->si_overrun, &from->si_overrun);
-+		err |= __get_user(scratch, &from->si_ptr);
-+                to->si_ptr = (u64 __user*)scratch;                
-+		break;
-+	case __SI_POLL:
-+		err |= __get_user(to->si_band, &from->si_band);
-+		err |= __get_user(to->si_fd, &from->si_fd);
-+		break;
-+	case __SI_FAULT:
-+		err |= __get_user(scratch, &from->si_addr);
-+                to->si_addr = (u64 __user*)scratch;
-+#ifdef __ARCH_SI_COMPAT_TRAPNO
-+		err |= __get_user(to->si_trapno, &from->si_trapno);
-+#endif
-+		break;
-+	case __SI_CHLD:
-+		err |= __get_user(to->si_pid, &from->si_pid);
-+		err |= __get_user(to->si_uid, &from->si_uid);
-+		err |= __get_user(to->si_status, &from->si_status);
-+		err |= __get_user(to->si_utime, &from->si_utime);
-+		err |= __get_user(to->si_stime, &from->si_stime);
-+		break;
-+	case __SI_RT: /* This is not generated by the kernel as of now. */
-+	case __SI_MESGQ: /* But this is */
-+		err |= __get_user(to->si_pid, &from->si_pid);
-+		err |= __get_user(to->si_uid, &from->si_uid);
-+		err |= __get_user(to->si_int, &from->si_int);
-+		err |= __get_user(scratch, &from->si_ptr);
-+                to->si_ptr = (u64 __user*)scratch;
-+		break;
-+	default: /* this is just in case for now ... */
-+		err |= __get_user(to->si_pid, &from->si_pid);
-+		err |= __get_user(to->si_uid, &from->si_uid);
-+		break;
-+	}
-+	return err;
-+}
-+#endif
-+
-+#ifndef HAVE_ARCH_COPY_SIGEVENT_FROM_USER
-+int compat_copy_sigevent_from_user(sigevent_t *to, compat_sigevent_t __user *from)
-+{
-+	int err;
-+	u64 scratch;
-+	
-+	/* copy sigval_t sigev_value 
-+	 	int_t sival_int		(same)
-+	 	uptr_t sival_ptr	(32 vs 64)*/
-+	err = __get_user(to->sigev_value.sival_int, 
-+	    		 &from->sigev_value.sival_int);
-+	err |= __get_user(scratch, &from->sigev_value.sival_ptr);
-+	to->sigev_value.sival_ptr = (u64 __user *)scratch;
-+	
-+	/* copy int_t sigev_signo 	(same)*/
-+	err |= __get_user(to->sigev_signo, &from->sigev_signo);
-+	
-+	/* copy int_t sigev_notify	(same)*/
-+	err |= __get_user(to->sigev_notify, &from->sigev_notify);
-+
-+	/* never copy _sigev_un padding */
-+
-+	/* copy int_t _tid 		(same),
-+	   good_sigevent() uses this value of */
-+	err |= __get_user(to->sigev_notify_thread_id, &from->sigev_notify_thread_id);
-+	
-+	/* XXX: Do not copy these, they aren't used by
-+	   anyone. We would need to distinguish the uses of the union.
-+	   copy _sigev_thread
-+	  	uptr_t _function	(32 vs 64)
-+	  	uptr_t _attribute	(32 vs 64)*/
-+	
-+	return err;
-+}
-+#endif
-+
-Index: linux-2.6-2.6.12/kernel/posix-cpu-timers.c
-===================================================================
---- linux-2.6-2.6.12.orig/kernel/posix-cpu-timers.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/kernel/posix-cpu-timers.c	2005-08-09 17:53:35.000000000 -0400
-@@ -1270,8 +1270,6 @@
- 	LIST_HEAD(firing);
- 	struct k_itimer *timer, *next;
- 
--	BUG_ON(!irqs_disabled());
--
- #define UNEXPIRED(clock) \
- 		(cputime_eq(tsk->it_##clock##_expires, cputime_zero) || \
- 		 cputime_lt(clock##_ticks(tsk), tsk->it_##clock##_expires))
-Index: linux-2.6-2.6.12/kernel/ptrace.c
-===================================================================
---- linux-2.6-2.6.12.orig/kernel/ptrace.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/kernel/ptrace.c	2005-08-09 17:53:35.000000000 -0400
-@@ -344,7 +344,7 @@
- 	siginfo_t newinfo;
- 	int error = -ESRCH;
- 
--	if (copy_from_user(&newinfo, data, sizeof (siginfo_t)))
-+	if (copy_siginfo_from_user(&newinfo, data) != 0)
- 		return -EFAULT;
- 
- 	read_lock(&tasklist_lock);
-Index: linux-2.6-2.6.12/kernel/resource.c
-===================================================================
---- linux-2.6-2.6.12.orig/kernel/resource.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/kernel/resource.c	2005-08-09 17:53:35.000000000 -0400
-@@ -181,6 +181,8 @@
- {
- 	struct resource *tmp, **p;
- 
-+	BUG_ON(old->child);
-+
- 	p = &old->parent->child;
- 	for (;;) {
- 		tmp = *p;
-Index: linux-2.6-2.6.12/kernel/signal.c
-===================================================================
---- linux-2.6-2.6.12.orig/kernel/signal.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/kernel/signal.c	2005-08-09 17:53:35.000000000 -0400
-@@ -22,6 +22,7 @@
- #include <linux/security.h>
- #include <linux/syscalls.h>
- #include <linux/ptrace.h>
-+#include <linux/compat_siginfo.h>
- #include <linux/posix-timers.h>
- #include <linux/signal.h>
- #include <asm/param.h>
-@@ -2107,17 +2108,35 @@
- 	return do_sigpending(set, sigsetsize);
- }
- 
-+#ifndef HAVE_ARCH_COPY_SIGINFO_FROM_USER
-+
-+int copy_siginfo_from_user(siginfo_t *to, siginfo_t __user *from)
-+{
-+        if(is_compat_task(current))
-+                return compat_copy_siginfo_from_user(to,(compat_siginfo_t __user *)from);
-+  
-+        return copy_from_user(&to, from, sizeof(siginfo_t));
-+}
-+
-+#endif
-+
- #ifndef HAVE_ARCH_COPY_SIGINFO_TO_USER
- 
- int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from)
- {
- 	int err;
-+	
-+	/* Use compat_siginfo_t with 32-bit signals */
-+	if(is_compat_task(current)){
-+		return compat_copy_siginfo_to_user((compat_siginfo_t __user *)to,from);
-+	}
- 
- 	if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
- 		return -EFAULT;
- 	if (from->si_code < 0)
- 		return __copy_to_user(to, from, sizeof(siginfo_t))
- 			? -EFAULT : 0;
-+	
- 	/*
- 	 * If you change siginfo_t structure, please be sure
- 	 * this code is fixed accordingly.
-@@ -2356,7 +2375,7 @@
- {
- 	siginfo_t info;
- 
--	if (copy_from_user(&info, uinfo, sizeof(siginfo_t)))
-+	if (copy_siginfo_from_user(&info, uinfo))
- 		return -EFAULT;
- 
- 	/* Not even root can pretend to send signals from the kernel.
-Index: linux-2.6-2.6.12/kernel/sys.c
-===================================================================
---- linux-2.6-2.6.12.orig/kernel/sys.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/kernel/sys.c	2005-08-09 17:53:35.000000000 -0400
-@@ -30,6 +30,7 @@
- #include <linux/compat.h>
- #include <linux/syscalls.h>
- 
-+#include <asm/processor.h>
- #include <asm/uaccess.h>
- #include <asm/io.h>
- #include <asm/unistd.h>
-Index: linux-2.6-2.6.12/mm/shmem.c
-===================================================================
---- linux-2.6-2.6.12.orig/mm/shmem.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/mm/shmem.c	2005-08-09 17:53:35.000000000 -0400
-@@ -461,7 +461,7 @@
- 	} while (next);
- }
- 
--static void shmem_truncate(struct inode *inode)
-+/* static gcc-3.3 OPD bug - GGG */ void shmem_truncate(struct inode *inode)
- {
- 	struct shmem_inode_info *info = SHMEM_I(inode);
- 	unsigned long idx;
-Index: linux-2.6-2.6.12/sound/drivers/opl3/opl3_lib.c
-===================================================================
---- linux-2.6-2.6.12.orig/sound/drivers/opl3/opl3_lib.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/sound/drivers/opl3/opl3_lib.c	2005-08-09 17:53:35.000000000 -0400
-@@ -40,7 +40,7 @@
- static void snd_opl2_command(opl3_t * opl3, unsigned short cmd, unsigned char val)
- {
- 	unsigned long flags;
--	unsigned long port;
-+	void __iomem *port;
- 
- 	/*
- 	 * The original 2-OP synth requires a quite long delay
-@@ -51,10 +51,10 @@
- 
- 	spin_lock_irqsave(&opl3->reg_lock, flags);
- 
--	outb((unsigned char) cmd, port);
-+	iowrite8((unsigned char) cmd, port);
- 	udelay(10);
- 
--	outb((unsigned char) val, port + 1);
-+	iowrite8((unsigned char) val, port + 1);
- 	udelay(30);
- 
- 	spin_unlock_irqrestore(&opl3->reg_lock, flags);
-@@ -63,7 +63,7 @@
- static void snd_opl3_command(opl3_t * opl3, unsigned short cmd, unsigned char val)
- {
- 	unsigned long flags;
--	unsigned long port;
-+	void __iomem *port;
- 
- 	/*
- 	 * The OPL-3 survives with just two INBs
-@@ -74,13 +74,13 @@
- 
- 	spin_lock_irqsave(&opl3->reg_lock, flags);
- 
--	outb((unsigned char) cmd, port);
--	inb(opl3->l_port);
--	inb(opl3->l_port);
--
--	outb((unsigned char) val, port + 1);
--	inb(opl3->l_port);
--	inb(opl3->l_port);
-+	iowrite8((unsigned char) cmd, port);
-+	ioread8(opl3->l_port);
-+	ioread8(opl3->l_port);
-+
-+	iowrite8((unsigned char) val, port + 1);
-+	ioread8(opl3->l_port);
-+	ioread8(opl3->l_port);
- 
- 	spin_unlock_irqrestore(&opl3->reg_lock, flags);
- }
-@@ -104,7 +104,7 @@
- 	opl3->command(opl3, OPL3_LEFT | OPL3_REG_TIMER_CONTROL, OPL3_TIMER1_MASK | OPL3_TIMER2_MASK);
- 	/* Reset the IRQ of the FM chip */
- 	opl3->command(opl3, OPL3_LEFT | OPL3_REG_TIMER_CONTROL, OPL3_IRQ_RESET);
--	signature = stat1 = inb(opl3->l_port);	/* Status register */
-+	signature = stat1 = ioread8(opl3->l_port);	/* Status register */
- 	if ((stat1 & 0xe0) != 0x00) {	/* Should be 0x00 */
- 		snd_printd("OPL3: stat1 = 0x%x\n", stat1);
- 		return -ENODEV;
-@@ -116,7 +116,7 @@
- 	/* Now we have to delay at least 80us */
- 	udelay(200);
- 	/* Read status after timers have expired */
--	stat2 = inb(opl3->l_port);
-+	stat2 = ioread8(opl3->l_port);
- 	/* Stop the timers */
- 	opl3->command(opl3, OPL3_LEFT | OPL3_REG_TIMER_CONTROL, OPL3_TIMER1_MASK | OPL3_TIMER2_MASK);
- 	/* Reset the IRQ of the FM chip */
-@@ -299,7 +299,7 @@
- 		return;
- 
- 	opl3 = hw->private_data;
--	status = inb(opl3->l_port);
-+	status = ioread8(opl3->l_port);
- #if 0
- 	snd_printk("AdLib IRQ status = 0x%x\n", status);
- #endif
-@@ -333,6 +333,8 @@
- 		release_resource(opl3->res_r_port);
- 		kfree_nocheck(opl3->res_r_port);
- 	}
-+	iounmap(opl3->l_port);
-+	iounmap(opl3->r_port);
- 	kfree(opl3);
- 	return 0;
- }
-@@ -397,12 +399,13 @@
- 	return 0;
- }
- 
--int snd_opl3_create(snd_card_t * card,
--		    unsigned long l_port,
--		    unsigned long r_port,
--		    unsigned short hardware,
--		    int integrated,
--		    opl3_t ** ropl3)
-+static int snd_opl3_create_main(snd_card_t * card,
-+				void __iomem *l_port,
-+				void __iomem *r_port,
-+				struct resource *res_l_port,
-+				struct resource *res_r_port,
-+				unsigned short hardware,
-+				opl3_t ** ropl3)
- {
- 	opl3_t *opl3;
- 	int err;
-@@ -410,21 +413,10 @@
- 	*ropl3 = NULL;
- 	if ((err = snd_opl3_new(card, hardware, &opl3)) < 0)
- 		return err;
--	if (! integrated) {
--		if ((opl3->res_l_port = request_region(l_port, 2, "OPL2/3 (left)")) == NULL) {
--			snd_printk(KERN_ERR "opl3: can't grab left port 0x%lx\n", l_port);
--			snd_opl3_free(opl3);
--			return -EBUSY;
--		}
--		if (r_port != 0 &&
--		    (opl3->res_r_port = request_region(r_port, 2, "OPL2/3 (right)")) == NULL) {
--			snd_printk(KERN_ERR "opl3: can't grab right port 0x%lx\n", r_port);
--			snd_opl3_free(opl3);
--			return -EBUSY;
--		}
--	}
- 	opl3->l_port = l_port;
- 	opl3->r_port = r_port;
-+	opl3->res_l_port = res_l_port;
-+	opl3->res_r_port = res_r_port;
- 
- 	switch (opl3->hardware) {
- 	/* some hardware doesn't support timers */
-@@ -455,6 +447,67 @@
- 	return 0;
- }
- 
-+int snd_opl3_create_mapped(snd_card_t * card,
-+			   void __iomem * l_port,
-+			   void __iomem * r_port,
-+			   unsigned short hardware,
-+			   opl3_t ** ropl3)
-+{
-+	return snd_opl3_create_main(card, l_port, r_port, NULL, NULL, hardware, ropl3);
-+}
-+
-+int snd_opl3_create(snd_card_t * card,
-+		    unsigned long l_port,
-+		    unsigned long r_port,
-+		    unsigned short hardware,
-+		    int integrated,
-+		    opl3_t ** ropl3) {
-+	struct resource *res_l_port = NULL;
-+	struct resource *res_r_port = NULL;
-+	void __iomem *l_mapped = NULL;
-+	void __iomem *r_mapped = NULL;
-+	
-+	if (! integrated) {
-+		if ((res_l_port = request_region(l_port, 2, "OPL2/3 (left)")) == NULL) {
-+			snd_printk(KERN_ERR "opl3: can't grab left port 0x%lx\n", l_port);
-+			goto fail;
-+		}
-+		if (r_port != 0 &&
-+		    (res_r_port = request_region(r_port, 2, "OPL2/3 (right)")) == NULL) {
-+			snd_printk(KERN_ERR "opl3: can't grab right port 0x%lx\n", r_port);
-+			goto fail;
-+		}
-+	}
-+	
-+	l_mapped = ioport_map(l_port, 2);
-+	if (l_mapped == NULL) {
-+		snd_printk(KERN_ERR "opl3: failed to map port 0x%lx\n", l_port);
-+		goto fail;
-+	}
-+	r_mapped = ioport_map(r_port, 2);
-+	if (r_mapped == NULL) {
-+		snd_printk(KERN_ERR "opl3: failed to map port 0x%lx\n", r_port);
-+		goto fail;
-+	}
-+	
-+	return snd_opl3_create_main(card, l_mapped, r_mapped, res_l_port, res_r_port, hardware, ropl3);
-+
-+fail:
-+	if (res_l_port) {
-+		release_resource(res_l_port);
-+		kfree_nocheck(res_l_port);
-+	}
-+	if (res_r_port) {
-+		release_resource(res_r_port);
-+		kfree_nocheck(res_r_port);
-+	}
-+	if (l_mapped)
-+		iounmap(l_mapped);
-+	if (r_mapped)
-+		iounmap(r_mapped);
-+	return -EBUSY;
-+}
-+
- int snd_opl3_timer_new(opl3_t * opl3, int timer1_dev, int timer2_dev)
- {
- 	int err;
-@@ -534,6 +587,7 @@
- EXPORT_SYMBOL(snd_opl3_new);
- EXPORT_SYMBOL(snd_opl3_init);
- EXPORT_SYMBOL(snd_opl3_create);
-+EXPORT_SYMBOL(snd_opl3_create_mapped);
- EXPORT_SYMBOL(snd_opl3_timer_new);
- EXPORT_SYMBOL(snd_opl3_hwdep_new);
- 
-Index: linux-2.6-2.6.12/sound/oss/ad1889.c
-===================================================================
---- linux-2.6-2.6.12.orig/sound/oss/ad1889.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/sound/oss/ad1889.c	2005-08-09 17:53:35.000000000 -0400
-@@ -74,7 +74,7 @@
- 
- 	DBG("Setting WAV rate to %d\n", rate);
- 	dev->state[AD_WAV_STATE].dmabuf.rate = rate;
--	AD1889_WRITEW(dev, AD_DSWAS, rate);
-+	AD1889_WRITEW(dev, AD_DS_WAS, rate);
- 
- 	/* Cycle the DAC to enable the new rate */
- 	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200);
-@@ -88,14 +88,14 @@
- 
- 	DBG("Setting WAV format to 0x%x\n", fmt);
- 
--	tmp = AD1889_READW(ad1889_dev, AD_DSWSMC);
-+	tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
- 	if (fmt & AFMT_S16_LE) {
- 		//tmp |= 0x0100; /* set WA16 */
- 		tmp |= 0x0300; /* set WA16 stereo */
- 	} else if (fmt & AFMT_U8) {
- 		tmp &= ~0x0100; /* clear WA16 */
- 	} 
--	AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp);
-+	AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
- }
- 
- static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt)
-@@ -104,13 +104,13 @@
- 
- 	DBG("Setting ADC format to 0x%x\n", fmt);
- 
--	tmp = AD1889_READW(ad1889_dev, AD_DSRAMC);
-+	tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
- 	if (fmt & AFMT_S16_LE) {
- 		tmp |= 0x0100; /* set WA16 */
- 	} else if (fmt & AFMT_U8) {
- 		tmp &= ~0x0100; /* clear WA16 */
- 	} 
--	AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp);
-+	AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
- }
- 
- static void ad1889_start_wav(ad1889_state_t *state)
-@@ -144,21 +144,21 @@
- 	    dmabuf->rd_ptr, dmabuf->dma_len);
- 
-         /* load up the current register set */
--	AD1889_WRITEL(ad1889_dev, AD_DMAWAVCC, cnt);
--	AD1889_WRITEL(ad1889_dev, AD_DMAWAVICC, cnt);
--	AD1889_WRITEL(ad1889_dev, AD_DMAWAVCA, dmabuf->dma_handle);
-+	AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCC, cnt);
-+	AD1889_WRITEL(ad1889_dev, AD_DMA_WAVICC, cnt);
-+	AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCA, dmabuf->dma_handle);
- 
- 	/* TODO: for now we load the base registers with the same thing */
--	AD1889_WRITEL(ad1889_dev, AD_DMAWAVBC, cnt);
--	AD1889_WRITEL(ad1889_dev, AD_DMAWAVIBC, cnt);
--	AD1889_WRITEL(ad1889_dev, AD_DMAWAVBA, dmabuf->dma_handle);
-+	AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBC, cnt);
-+	AD1889_WRITEL(ad1889_dev, AD_DMA_WAVIBC, cnt);
-+	AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBA, dmabuf->dma_handle);
- 
- 	/* and we're off to the races... */
--	AD1889_WRITEL(ad1889_dev, AD_DMACHSS, 0x8);
--	tmp = AD1889_READW(ad1889_dev, AD_DSWSMC);
-+	AD1889_WRITEL(ad1889_dev, AD_DMA_CHSS, 0x8);
-+	tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
- 	tmp |= 0x0400; /* set WAEN */
--	AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp);
--	(void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */
-+	AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
-+	(void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
- 
- 	dmabuf->enable |= DAC_RUNNING;
- 
-@@ -178,10 +178,10 @@
- 		u16 tmp;
- 		unsigned long cnt = dmabuf->dma_len;
- 
--		tmp = AD1889_READW(ad1889_dev, AD_DSWSMC);
-+		tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC);
- 		tmp &= ~0x0400; /* clear WAEN */
--		AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp);
--		(void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */
-+		AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp);
-+		(void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */
- 		pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle, 
- 				cnt, PCI_DMA_TODEVICE);
- 
-@@ -210,7 +210,7 @@
- 
- 	spin_lock_irqsave(&state->card->lock, flags);
- 	
--	tmp = AD1889_READW(ad1889_dev, AD_DSRAMC);
-+	tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC);
- 	if (start) {
- 		state->dmabuf.enable |= ADC_RUNNING;
- 		tmp |= 0x0004; /* set ADEN */
-@@ -218,7 +218,7 @@
- 		state->dmabuf.enable &= ~ADC_RUNNING;
- 		tmp &= ~0x0004; /* clear ADEN */
- 	}
--	AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp);
-+	AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp);
- 
- 	spin_unlock_irqrestore(&state->card->lock, flags);
- }
-@@ -301,53 +301,53 @@
- 	int len, i;
- 	ad1889_dev_t *dev = data;
- 	ad1889_reg_t regs[] = {
--		{ "WSMC", AD_DSWSMC, 16 },
--		{ "RAMC", AD_DSRAMC, 16 },
--		{ "WADA", AD_DSWADA, 16 },
--		{ "SYDA", AD_DSSYDA, 16 },
--		{ "WAS", AD_DSWAS, 16 },
--		{ "RES", AD_DSRES, 16 },
--		{ "CCS", AD_DSCCS, 16 },
--		{ "ADCBA", AD_DMAADCBA, 32 },
--		{ "ADCCA", AD_DMAADCCA, 32 },
--		{ "ADCBC", AD_DMAADCBC, 32 },
--		{ "ADCCC", AD_DMAADCCC, 32 },
--		{ "ADCIBC", AD_DMAADCIBC, 32 },
--		{ "ADCICC", AD_DMAADCICC, 32 },
--		{ "ADCCTRL", AD_DMAADCCTRL, 16 },
--		{ "WAVBA", AD_DMAWAVBA, 32 },
--		{ "WAVCA", AD_DMAWAVCA, 32 },
--		{ "WAVBC", AD_DMAWAVBC, 32 },
--		{ "WAVCC", AD_DMAWAVCC, 32 },
--		{ "WAVIBC", AD_DMAWAVIBC, 32 },
--		{ "WAVICC", AD_DMAWAVICC, 32 },
--		{ "WAVCTRL", AD_DMAWAVCTRL, 16 },
--		{ "DISR", AD_DMADISR, 32 },
--		{ "CHSS", AD_DMACHSS, 32 },
--		{ "IPC", AD_GPIOIPC, 16 },
--		{ "OP", AD_GPIOOP, 16 },
--		{ "IP", AD_GPIOIP, 16 },
--		{ "ACIC", AD_ACIC, 16 },
--		{ "AC97_RESET", 0x100 + AC97_RESET, 16 },
--		{ "AC97_MASTER_VOL_STEREO", 0x100 + AC97_MASTER_VOL_STEREO, 16 },
--		{ "AC97_HEADPHONE_VOL", 0x100 + AC97_HEADPHONE_VOL, 16 },
--		{ "AC97_MASTER_VOL_MONO", 0x100 + AC97_MASTER_VOL_MONO, 16 },
--		{ "AC97_MASTER_TONE", 0x100 + AC97_MASTER_TONE, 16 },
--		{ "AC97_PCBEEP_VOL", 0x100 + AC97_PCBEEP_VOL, 16 },
--		{ "AC97_PHONE_VOL", 0x100 + AC97_PHONE_VOL, 16 },
--		{ "AC97_MIC_VOL", 0x100 + AC97_MIC_VOL, 16 },
--		{ "AC97_LINEIN_VOL", 0x100 + AC97_LINEIN_VOL, 16 },
--		{ "AC97_CD_VOL", 0x100 + AC97_CD_VOL, 16 },
--		{ "AC97_VIDEO_VOL", 0x100 + AC97_VIDEO_VOL, 16 },
--		{ "AC97_AUX_VOL", 0x100 + AC97_AUX_VOL, 16 },
--		{ "AC97_PCMOUT_VOL", 0x100 + AC97_PCMOUT_VOL, 16 },
--		{ "AC97_RECORD_SELECT", 0x100 + AC97_RECORD_SELECT, 16 },
--		{ "AC97_RECORD_GAIN", 0x100 + AC97_RECORD_GAIN, 16 },
--		{ "AC97_RECORD_GAIN_MIC", 0x100 + AC97_RECORD_GAIN_MIC, 16 },
--		{ "AC97_GENERAL_PURPOSE", 0x100 + AC97_GENERAL_PURPOSE, 16 },
--		{ "AC97_3D_CONTROL", 0x100 + AC97_3D_CONTROL, 16 },
--		{ "AC97_MODEM_RATE", 0x100 + AC97_MODEM_RATE, 16 },
--		{ "AC97_POWER_CONTROL", 0x100 + AC97_POWER_CONTROL, 16 },
-+		{ "WSMC", AD_DS_WSMC, 16 },
-+		{ "RAMC", AD_DS_RAMC, 16 },
-+		{ "WADA", AD_DS_WADA, 16 },
-+		{ "SYDA", AD_DS_SYDA, 16 },
-+		{ "WAS", AD_DS_WAS, 16 },
-+		{ "RES", AD_DS_RES, 16 },
-+		{ "CCS", AD_DS_CCS, 16 },
-+		{ "ADCBA", AD_DMA_ADCBA, 32 },
-+		{ "ADCCA", AD_DMA_ADCCA, 32 },
-+		{ "ADCBC", AD_DMA_ADCBC, 32 },
-+		{ "ADCCC", AD_DMA_ADCCC, 32 },
-+		{ "ADCIBC", AD_DMA_ADCIBC, 32 },
-+		{ "ADCICC", AD_DMA_ADCICC, 32 },
-+		{ "ADCCTRL", AD_DMA_ADCCTRL, 16 },
-+		{ "WAVBA", AD_DMA_WAVBA, 32 },
-+		{ "WAVCA", AD_DMA_WAVCA, 32 },
-+		{ "WAVBC", AD_DMA_WAVBC, 32 },
-+		{ "WAVCC", AD_DMA_WAVCC, 32 },
-+		{ "WAVIBC", AD_DMA_WAVIBC, 32 },
-+		{ "WAVICC", AD_DMA_WAVICC, 32 },
-+		{ "WAVCTRL", AD_DMA_WAVCTRL, 16 },
-+		{ "DISR", AD_DMA_DISR, 32 },
-+		{ "CHSS", AD_DMA_CHSS, 32 },
-+		{ "IPC", AD_GPIO_IPC, 16 },
-+		{ "OP", AD_GPIO_OP, 16 },
-+		{ "IP", AD_GPIO_IP, 16 },
-+		{ "ACIC", AD_AC97_ACIC, 16 },
-+		{ "AC97_RESET", AD_AC97_BASE + AC97_RESET, 16 },
-+		{ "AC97_MASTER_VOL_STEREO", AD_AC97_BASE + AC97_MASTER_VOL_STEREO, 16 },
-+		{ "AC97_HEADPHONE_VOL", AD_AC97_BASE + AC97_HEADPHONE_VOL, 16 },
-+		{ "AC97_MASTER_VOL_MONO", AD_AC97_BASE + AC97_MASTER_VOL_MONO, 16 },
-+		{ "AC97_MASTER_TONE", AD_AC97_BASE + AC97_MASTER_TONE, 16 },
-+		{ "AC97_PCBEEP_VOL", AD_AC97_BASE + AC97_PCBEEP_VOL, 16 },
-+		{ "AC97_PHONE_VOL", AD_AC97_BASE + AC97_PHONE_VOL, 16 },
-+		{ "AC97_MIC_VOL", AD_AC97_BASE + AC97_MIC_VOL, 16 },
-+		{ "AC97_LINEIN_VOL", AD_AC97_BASE + AC97_LINEIN_VOL, 16 },
-+		{ "AC97_CD_VOL", AD_AC97_BASE + AC97_CD_VOL, 16 },
-+		{ "AC97_VIDEO_VOL", AD_AC97_BASE + AC97_VIDEO_VOL, 16 },
-+		{ "AC97_AUX_VOL", AD_AC97_BASE + AC97_AUX_VOL, 16 },
-+		{ "AC97_PCMOUT_VOL", AD_AC97_BASE + AC97_PCMOUT_VOL, 16 },
-+		{ "AC97_RECORD_SELECT", AD_AC97_BASE + AC97_RECORD_SELECT, 16 },
-+		{ "AC97_RECORD_GAIN", AD_AC97_BASE + AC97_RECORD_GAIN, 16 },
-+		{ "AC97_RECORD_GAIN_MIC", AD_AC97_BASE + AC97_RECORD_GAIN_MIC, 16 },
-+		{ "AC97_GENERAL_PURPOSE", AD_AC97_BASE + AC97_GENERAL_PURPOSE, 16 },
-+		{ "AC97_3D_CONTROL", AD_AC97_BASE + AC97_3D_CONTROL, 16 },
-+		{ "AC97_MODEM_RATE", AD_AC97_BASE + AC97_MODEM_RATE, 16 },
-+		{ "AC97_POWER_CONTROL", AD_AC97_BASE + AC97_POWER_CONTROL, 16 },
- 		{ NULL }
- 	};
- 
-@@ -400,9 +400,9 @@
- 	}
- 	
- 	if (dmabuf->enable & DAC_RUNNING)
--		offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAWAVBA));
-+		offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_WAVBA));
- 	else
--		offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAADCBA));
-+		offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_ADCBA));
- 
- 	return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf;
- }
-@@ -639,9 +639,9 @@
- 		if (val > 5400 && val < 48000)
- 		{
- 			if (file->f_mode & FMODE_WRITE)
--				AD1889_WRITEW(ad1889_dev, AD_DSWAS, val);
-+				AD1889_WRITEW(ad1889_dev, AD_DS_WAS, val);
- 			if (file->f_mode & FMODE_READ)
--				AD1889_WRITEW(ad1889_dev, AD_DSRES, val);
-+				AD1889_WRITEW(ad1889_dev, AD_DS_RES, val);
- 		}
- 		return 0;
- 
-@@ -649,22 +649,22 @@
- 		if (get_user(val, p))
- 			return -EFAULT;
- 		if (file->f_mode & FMODE_READ) {
--			val = AD1889_READW(ad1889_dev, AD_DSWSMC);
-+			val = AD1889_READW(ad1889_dev, AD_DS_WSMC);
- 			if (val) {
- 				val |= 0x0200;  /* set WAST */
- 			} else {
- 				val &= ~0x0200; /* clear WAST */
- 			}
--			AD1889_WRITEW(ad1889_dev, AD_DSWSMC, val);
-+			AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, val);
- 		}
- 		if (file->f_mode & FMODE_WRITE) {
--			val = AD1889_READW(ad1889_dev, AD_DSRAMC);
-+			val = AD1889_READW(ad1889_dev, AD_DS_RAMC);
- 			if (val) {
- 				val |= 0x0002;  /* set ADST */
- 			} else {
- 				val &= ~0x0002; /* clear ADST */
- 			}
--			AD1889_WRITEW(ad1889_dev, AD_DSRAMC, val);
-+			AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, val);
- 		}
- 
- 		return 0;
-@@ -739,7 +739,7 @@
- 		break;
- 
- 	case SOUND_PCM_READ_RATE:
--		return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), p);
-+		return put_user(AD1889_READW(ad1889_dev, AD_DS_WAS), p);
- 
- 	case SOUND_PCM_READ_CHANNELS:
- 	case SOUND_PCM_READ_BITS:
-@@ -769,7 +769,7 @@
- 
- 	ad1889_set_wav_rate(ad1889_dev, 48000);
- 	ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
--	AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */
-+	AD1889_WRITEW(ad1889_dev, AD_DS_WADA, 0x0404); /* attenuation */
- 	return nonseekable_open(inode, file);
- }
- 
-@@ -826,15 +826,15 @@
- {
- 	ad1889_dev_t *dev = ac97->private_data;
- 
--	//DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + 0x100 + reg);
--	AD1889_WRITEW(dev, 0x100 + reg, val);
-+	//DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + AD_AC97_BASE + reg);
-+	AD1889_WRITEW(dev, AD_AC97_BASE + reg, val);
- }
- 
- static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg)
- {
- 	ad1889_dev_t *dev = ac97->private_data;
--	//DBG("Reading from 0x%lx\n", dev->regbase + 0x100 + reg);
--	return AD1889_READW(dev, 0x100 + reg);
-+	//DBG("Reading from 0x%lx\n", dev->regbase + AD_AC97_BASE + reg);
-+	return AD1889_READW(dev, AD_AC97_BASE + reg);
- }	
- 
- static int ad1889_ac97_init(ad1889_dev_t *dev, int id)
-@@ -883,24 +883,24 @@
- 	int retry = 200;
- 	ad1889_dev_t *dev = pci_get_drvdata(pcidev);
- 
--	AD1889_WRITEW(dev, AD_DSCCS, 0x8000); /* turn on clock */
--	AD1889_READW(dev, AD_DSCCS); 
-+	AD1889_WRITEW(dev, AD_DS_CCS, 0x8000); /* turn on clock */
-+	AD1889_READW(dev, AD_DS_CCS); 
- 
- 	WAIT_10MS();
- 
--	stat = AD1889_READW(dev, AD_ACIC);
-+	stat = AD1889_READW(dev, AD_AC97_ACIC);
- 	stat |= 0x0002;				/* Reset Disable */
--	AD1889_WRITEW(dev, AD_ACIC, stat);
--	(void) AD1889_READW(dev, AD_ACIC);	/* flush posted write */
-+	AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
-+	(void) AD1889_READW(dev, AD_AC97_ACIC);	/* flush posted write */
- 
- 	udelay(10);
- 
--	stat = AD1889_READW(dev, AD_ACIC);
-+	stat = AD1889_READW(dev, AD_AC97_ACIC);
- 	stat |= 0x0001;				/* Interface Enable */
--	AD1889_WRITEW(dev, AD_ACIC, stat);
-+	AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
- 
- 	do {
--		if (AD1889_READW(dev, AD_ACIC) & 0x8000)	/* Ready */
-+		if (AD1889_READW(dev, AD_AC97_ACIC) & 0x8000)	/* Ready */
- 			break;
- 		WAIT_10MS();
- 		retry--;
-@@ -908,16 +908,16 @@
- 
- 	if (!retry) {
- 		printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n",
--			    AD1889_READW(dev, AD_ACIC));
-+			    AD1889_READW(dev, AD_AC97_ACIC));
- 		return -EBUSY;
- 	}
- 
- 	/* TODO reset AC97 codec */
- 	/* TODO set wave/adc pci ctrl status */
- 
--	stat = AD1889_READW(dev, AD_ACIC);
-+	stat = AD1889_READW(dev, AD_AC97_ACIC);
- 	stat |= 0x0004;				/* Audio Stream Output Enable */
--	AD1889_WRITEW(dev, AD_ACIC, stat);
-+	AD1889_WRITEW(dev, AD_AC97_ACIC, stat);
- 	return 0;
- }
- 
-@@ -935,10 +935,10 @@
- 	u32 stat;
- 	ad1889_dev_t *dev = (ad1889_dev_t *)dev_id;
- 
--	stat = AD1889_READL(dev, AD_DMADISR);
-+	stat = AD1889_READL(dev, AD_DMA_DISR);
- 
- 	/* clear ISR */
--	AD1889_WRITEL(dev, AD_DMADISR, stat);
-+	AD1889_WRITEL(dev, AD_DMA_DISR, stat);
- 
- 	if (stat & 0x8) {		/* WAVI */
- 		DBG("WAV interrupt\n");
-@@ -964,15 +964,15 @@
- 	u32 tmp32;
- 
- 	/* make sure the interrupt bits are setup the way we want */
--	tmp32 = AD1889_READL(dev, AD_DMAWAVCTRL);
-+	tmp32 = AD1889_READL(dev, AD_DMA_WAVCTRL);
- 	tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */
- 	tmp32 |= 0x6;  /* intr on count, loop */
--	AD1889_WRITEL(dev, AD_DMAWAVCTRL, tmp32);
-+	AD1889_WRITEL(dev, AD_DMA_WAVCTRL, tmp32);
- 
- 	/* unmute... */
--	tmp16 = AD1889_READW(dev, AD_DSWADA);
-+	tmp16 = AD1889_READW(dev, AD_DS_WADA);
- 	tmp16 &= ~0x8080;
--	AD1889_WRITEW(dev, AD_DSWADA, tmp16);
-+	AD1889_WRITEW(dev, AD_DS_WADA, tmp16);
- }
- 
- static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
-@@ -1005,7 +1005,7 @@
- 		goto out1;
- 	}
- 
--	dev->regbase = ioremap_nocache(bar, AD_DSIOMEMSIZE);
-+	dev->regbase = ioremap_nocache(bar, AD_DS_IOMEMSIZE);
- 	if (!dev->regbase) {
- 		printk(KERN_ERR DEVNAME ": unable to remap iomem\n");
- 		goto out2;
-Index: linux-2.6-2.6.12/sound/oss/ad1889.h
-===================================================================
---- linux-2.6-2.6.12.orig/sound/oss/ad1889.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/sound/oss/ad1889.h	2005-08-09 17:53:36.000000000 -0400
-@@ -1,57 +1,58 @@
- #ifndef _AD1889_H_
- #define _AD1889_H_
- 
--#define AD_DSWSMC	0x00	/* DMA input wave/syn mixer control */
--#define AD_DSRAMC	0x02	/* DMA output resamp/ADC mixer control */
--#define AD_DSWADA	0x04	/* DMA input wave attenuation */
--#define AD_DSSYDA	0x06	/* DMA input syn attentuation */
--#define AD_DSWAS	0x08	/* wave input sample rate */
--#define AD_DSRES	0x0a	/* resampler output sample rate */
--#define AD_DSCCS	0x0c	/* chip control/status */
--
--#define AD_DMARESBA	0x40	/* RES base addr */
--#define AD_DMARESCA	0x44	/* RES current addr */
--#define AD_DMARESBC	0x48	/* RES base cnt */
--#define AD_DMARESCC	0x4c	/* RES current count */
--#define AD_DMAADCBA	0x50	/* ADC */
--#define AD_DMAADCCA	0x54
--#define AD_DMAADCBC	0x58
--#define AD_DMAADCCC	0x5c
--#define AD_DMASYNBA	0x60	/* SYN */
--#define AD_DMASYNCA	0x64
--#define AD_DMASYNBC	0x68
--#define AD_DMASYNCC	0x6c
--#define AD_DMAWAVBA	0x70	/* WAV */
--#define AD_DMAWAVCA	0x74
--#define AD_DMAWAVBC	0x78
--#define AD_DMAWAVCC	0x7c
--#define AD_DMARESICC	0x80	/* RES interrupt current count */
--#define AD_DMARESIBC	0x84	/* RES interrupt base count */
--#define AD_DMAADCICC	0x88	/* ADC interrupt current count */
--#define AD_DMAADCIBC	0x8c	/* ADC interrupt base count */
--#define AD_DMASYNICC	0x90	/* SYN interrupt current count */
--#define AD_DMASYNIBC	0x94	/* SYN interrupt base count */
--#define AD_DMAWAVICC	0x98	/* WAV interrupt current count */
--#define AD_DMAWAVIBC	0x9c	/* WAV interrupt base count */
--#define AD_DMARESCTRL	0xa0	/* RES PCI control/status */
--#define AD_DMAADCCTRL	0xa8	/* ADC PCI control/status */
--#define AD_DMASYNCTRL	0xb0	/* SYN PCI control/status */
--#define AD_DMAWAVCTRL	0xb8	/* WAV PCI control/status */
--#define AD_DMADISR	0xc0	/* PCI DMA intr status */
--#define AD_DMACHSS	0xc4	/* PCI DMA channel stop status */
--
--#define AD_GPIOIPC	0xc8	/* IO port ctrl */
--#define AD_GPIOOP	0xca	/* IO output status */
--#define AD_GPIOIP	0xcc	/* IO input status */
-+#define AD_DS_WSMC	0x00	/* DMA input wave/syn mixer control */
-+#define AD_DS_RAMC	0x02	/* DMA output resamp/ADC mixer control */
-+#define AD_DS_WADA	0x04	/* DMA input wave attenuation */
-+#define AD_DS_SYDA	0x06	/* DMA input syn attentuation */
-+#define AD_DS_WAS	0x08	/* wave input sample rate */
-+#define AD_DS_RES	0x0a	/* resampler output sample rate */
-+#define AD_DS_CCS	0x0c	/* chip control/status */
-+
-+#define AD_DMA_RESBA	0x40	/* RES base addr */
-+#define AD_DMA_RESCA	0x44	/* RES current addr */
-+#define AD_DMA_RESBC	0x48	/* RES base cnt */
-+#define AD_DMA_RESCC	0x4c	/* RES current count */
-+#define AD_DMA_ADCBA	0x50	/* ADC */
-+#define AD_DMA_ADCCA	0x54
-+#define AD_DMA_ADCBC	0x58
-+#define AD_DMA_ADCCC	0x5c
-+#define AD_DMA_SYNBA	0x60	/* SYN */
-+#define AD_DMA_SYNCA	0x64
-+#define AD_DMA_SYNBC	0x68
-+#define AD_DMA_SYNCC	0x6c
-+#define AD_DMA_WAVBA	0x70	/* WAV */
-+#define AD_DMA_WAVCA	0x74
-+#define AD_DMA_WAVBC	0x78
-+#define AD_DMA_WAVCC	0x7c
-+#define AD_DMA_RESICC	0x80	/* RES interrupt current count */
-+#define AD_DMA_RESIBC	0x84	/* RES interrupt base count */
-+#define AD_DMA_ADCICC	0x88	/* ADC interrupt current count */
-+#define AD_DMA_ADCIBC	0x8c	/* ADC interrupt base count */
-+#define AD_DMA_SYNICC	0x90	/* SYN interrupt current count */
-+#define AD_DMA_SYNIBC	0x94	/* SYN interrupt base count */
-+#define AD_DMA_WAVICC	0x98	/* WAV interrupt current count */
-+#define AD_DMA_WAVIBC	0x9c	/* WAV interrupt base count */
-+#define AD_DMA_RESCTRL	0xa0	/* RES PCI control/status */
-+#define AD_DMA_ADCCTRL	0xa8	/* ADC PCI control/status */
-+#define AD_DMA_SYNCTRL	0xb0	/* SYN PCI control/status */
-+#define AD_DMA_WAVCTRL	0xb8	/* WAV PCI control/status */
-+#define AD_DMA_DISR	0xc0	/* PCI DMA intr status */
-+#define AD_DMA_CHSS	0xc4	/* PCI DMA channel stop status */
-+
-+#define AD_GPIO_IPC	0xc8	/* IO port ctrl */
-+#define AD_GPIO_OP	0xca	/* IO output status */
-+#define AD_GPIO_IP	0xcc	/* IO input status */
- 
- /* AC97 registers, 0x100 - 0x17f; see ac97.h */
--#define AD_ACIC		0x180	/* AC Link interface ctrl */
-+#define AD_AC97_BASE    0x100   /* ac97 base register */
-+#define AD_AC97_ACIC	0x180	/* AC Link interface ctrl */
- 
- /* OPL3; BAR1 */
--#define AD_OPLM0AS	0x00	/* Music0 address/status */
--#define AD_OPLM0DATA	0x01	/* Music0 data */
--#define AD_OPLM1A	0x02	/* Music1 address */
--#define AD_OPLM1DATA	0x03	/* Music1 data */
-+#define AD_OPL_M0AS	0x00	/* Music0 address/status */
-+#define AD_OPL_M0DATA	0x01	/* Music0 data */
-+#define AD_OPL_M1A	0x02	/* Music1 address */
-+#define AD_OPL_M1DATA	0x03	/* Music1 data */
- /* 0x04-0x0f reserved */
- 
- /* MIDI; BAR2 */
-@@ -59,9 +60,9 @@
- #define AD_MISC		0x01	/* MIDI status/cmd */
- /* 0x02-0xff reserved */
- 
--#define AD_DSIOMEMSIZE	512
--#define AD_OPLMEMSIZE	16
--#define AD_MIDIMEMSIZE	16
-+#define AD_DS_IOMEMSIZE	512
-+#define AD_OPL_MEMSIZE	16
-+#define AD_MIDI_MEMSIZE	16
- 
- #define AD_WAV_STATE	0
- #define AD_ADC_STATE	1
-Index: linux-2.6-2.6.12/sound/parisc/harmony.c
-===================================================================
---- linux-2.6-2.6.12.orig/sound/parisc/harmony.c	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/sound/parisc/harmony.c	2005-08-09 17:53:36.000000000 -0400
-@@ -197,7 +197,7 @@
- 	spin_unlock(&h->lock);
- 
- 	if (dstatus & HARMONY_DSTATUS_PN) {
--		if (h->psubs) {
-+		if (h->psubs && h->st.playing) {
- 			spin_lock(&h->lock);
- 			h->pbuf.buf += h->pbuf.count; /* PAGE_SIZE */
- 			h->pbuf.buf %= h->pbuf.size; /* MAX_BUFS*PAGE_SIZE */
-@@ -216,7 +216,7 @@
- 	}
- 
- 	if (dstatus & HARMONY_DSTATUS_RN) {
--		if (h->csubs) {
-+		if (h->csubs && h->st.capturing) {
- 			spin_lock(&h->lock);
- 			h->cbuf.buf += h->cbuf.count;
- 			h->cbuf.buf %= h->cbuf.size;
-@@ -316,6 +316,7 @@
- 	case SNDRV_PCM_TRIGGER_STOP:
- 		h->st.playing = 0;
- 		harmony_mute(h);
-+		harmony_write(h, HARMONY_PNXTADD, h->sdma.addr);
- 		harmony_disable_interrupts(h);
- 		break;
- 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-@@ -351,8 +352,9 @@
- 		break;
-         case SNDRV_PCM_TRIGGER_STOP:
- 		h->st.capturing = 0;
--                harmony_mute(h);
--                harmony_disable_interrupts(h);
-+		harmony_mute(h);
-+		harmony_write(h, HARMONY_RNXTADD, h->gdma.addr);
-+		harmony_disable_interrupts(h);
- 		break;
-         case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-         case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-@@ -408,7 +410,8 @@
- 	
- 	h->pbuf.size = snd_pcm_lib_buffer_bytes(ss);
- 	h->pbuf.count = snd_pcm_lib_period_bytes(ss);
--	h->pbuf.buf = 0;
-+	if (h->pbuf.buf >= h->pbuf.size)
-+		h->pbuf.buf = 0;
- 	h->st.playing = 0;
- 
- 	h->st.rate = snd_harmony_rate_bits(rt->rate);
-@@ -437,7 +440,8 @@
- 
-         h->cbuf.size = snd_pcm_lib_buffer_bytes(ss);
-         h->cbuf.count = snd_pcm_lib_period_bytes(ss);
--        h->cbuf.buf = 0;
-+	if (h->cbuf.buf >= h->cbuf.size)
-+	        h->cbuf.buf = 0;
- 	h->st.capturing = 0;
- 
-         h->st.rate = snd_harmony_rate_bits(rt->rate);
-@@ -712,13 +716,14 @@
- 
- 	left = (h->st.gain >> shift_left) & mask;
- 	right = (h->st.gain >> shift_right) & mask;
--
- 	if (invert) {
- 		left = mask - left;
- 		right = mask - right;
- 	}
-+	
- 	ucontrol->value.integer.value[0] = left;
--	ucontrol->value.integer.value[1] = right;
-+	if (shift_left != shift_right)
-+		ucontrol->value.integer.value[1] = right;
- 
- 	spin_unlock_irqrestore(&h->mixer_lock, flags);
- 
-@@ -738,22 +743,82 @@
- 	int old_gain = h->st.gain;
- 	unsigned long flags;
- 	
-+	spin_lock_irqsave(&h->mixer_lock, flags);
-+
- 	left = ucontrol->value.integer.value[0] & mask;
--	right = ucontrol->value.integer.value[1] & mask;
--	if (invert) {
-+	if (invert)
- 		left = mask - left;
--		right = mask - right;
-+	h->st.gain &= ~( (mask << shift_left ) );
-+ 	h->st.gain |= (left << shift_left);
-+
-+	if (shift_left != shift_right) {
-+		right = ucontrol->value.integer.value[1] & mask;
-+		if (invert)
-+			right = mask - right;
-+		h->st.gain &= ~( (mask << shift_right) );
-+		h->st.gain |= (right << shift_right);
- 	}
-+
-+	snd_harmony_set_new_gain(h);
-+
-+	spin_unlock_irqrestore(&h->mixer_lock, flags);
-+	
-+	return h->st.gain != old_gain;
-+}
-+
-+static int 
-+snd_harmony_captureroute_info(snd_kcontrol_t *kc, 
-+			      snd_ctl_elem_info_t *uinfo)
-+{
-+	static char *texts[2] = { "Line", "Mic" };
-+	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-+	uinfo->count = 1;
-+	uinfo->value.enumerated.items = 2;
-+	if (uinfo->value.enumerated.item > 1)
-+		uinfo->value.enumerated.item = 1;
-+	strcpy(uinfo->value.enumerated.name,
-+	       texts[uinfo->value.enumerated.item]);
-+	return 0;
-+}
-+
-+static int 
-+snd_harmony_captureroute_get(snd_kcontrol_t *kc, 
-+			     snd_ctl_elem_value_t *ucontrol)
-+{
-+	harmony_t *h = snd_kcontrol_chip(kc);
-+	int value;
-+	unsigned long flags;
- 	
- 	spin_lock_irqsave(&h->mixer_lock, flags);
- 
--	h->st.gain &= ~( (mask << shift_right) | (mask << shift_left) );
-- 	h->st.gain |=  ( (left << shift_left) | (right << shift_right) );
-+	value = (h->st.gain >> HARMONY_GAIN_IS_SHIFT) & 1;
-+	ucontrol->value.enumerated.item[0] = value;
-+
-+	spin_unlock_irqrestore(&h->mixer_lock, flags);
-+
-+	return 0;
-+}  
-+
-+static int 
-+snd_harmony_captureroute_put(snd_kcontrol_t *kc, 
-+			     snd_ctl_elem_value_t *ucontrol)
-+{
-+	harmony_t *h = snd_kcontrol_chip(kc);
-+	int value;
-+	int old_gain = h->st.gain;
-+	unsigned long flags;
-+	
-+	spin_lock_irqsave(&h->mixer_lock, flags);
-+
-+	value = ucontrol->value.enumerated.item[0] & 1;
-+	h->st.gain &= ~HARMONY_GAIN_IS_MASK;
-+ 	h->st.gain |= value << HARMONY_GAIN_IS_SHIFT;
-+
- 	snd_harmony_set_new_gain(h);
- 
- 	spin_unlock_irqrestore(&h->mixer_lock, flags);
- 	
--	return (old_gain - h->st.gain);
-+	return h->st.gain != old_gain;
- }
- 
- #define HARMONY_CONTROLS (sizeof(snd_harmony_controls)/ \
-@@ -767,10 +832,25 @@
-                    ((mask) << 16) | ((invert) << 24)) }
- 
- static snd_kcontrol_new_t snd_harmony_controls[] = {
--	HARMONY_VOLUME("Playback Volume", HARMONY_GAIN_LO_SHIFT, 
-+	HARMONY_VOLUME("Master Playback Volume", HARMONY_GAIN_LO_SHIFT, 
- 		       HARMONY_GAIN_RO_SHIFT, HARMONY_GAIN_OUT, 1),
- 	HARMONY_VOLUME("Capture Volume", HARMONY_GAIN_LI_SHIFT,
- 		       HARMONY_GAIN_RI_SHIFT, HARMONY_GAIN_IN, 0),
-+	HARMONY_VOLUME("Monitor Volume", HARMONY_GAIN_MA_SHIFT,
-+		       HARMONY_GAIN_MA_SHIFT, HARMONY_GAIN_MA, 1),
-+	{
-+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-+		.name = "Input Route",
-+		.info = snd_harmony_captureroute_info,
-+		.get = snd_harmony_captureroute_get,
-+		.put = snd_harmony_captureroute_put
-+	},
-+	HARMONY_VOLUME("Internal Speaker Switch", HARMONY_GAIN_SE_SHIFT,
-+		       HARMONY_GAIN_SE_SHIFT, 1, 0),
-+	HARMONY_VOLUME("Line-Out Switch", HARMONY_GAIN_LE_SHIFT,
-+		       HARMONY_GAIN_LE_SHIFT, 1, 0),
-+	HARMONY_VOLUME("Headphones Switch", HARMONY_GAIN_HE_SHIFT,
-+		       HARMONY_GAIN_HE_SHIFT, 1, 0),
- };
- 
- static void __init 
-Index: linux-2.6-2.6.12/sound/parisc/harmony.h
-===================================================================
---- linux-2.6-2.6.12.orig/sound/parisc/harmony.h	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/sound/parisc/harmony.h	2005-08-09 17:53:36.000000000 -0400
-@@ -61,7 +61,7 @@
- #define HARMONY_SIZE       64
- 
- #define BUF_SIZE     PAGE_SIZE
--#define MAX_BUFS     10
-+#define MAX_BUFS     16
- #define MAX_BUF_SIZE (MAX_BUFS * BUF_SIZE)
- 
- #define PLAYBACK_BUFS    MAX_BUFS
-@@ -101,28 +101,31 @@
- #define HARMONY_SS_MONO         0x00000000
- #define HARMONY_SS_STEREO       0x00000001
- 
--#define HARMONY_GAIN_SILENCE    0x00F00FFF
--#define HARMONY_GAIN_DEFAULT    0x0FF00000
-+#define HARMONY_GAIN_SILENCE    0x01F00FFF
-+#define HARMONY_GAIN_DEFAULT    0x01F00FFF
- 
--#define HARMONY_GAIN_HE_SHIFT   27
-+#define HARMONY_GAIN_HE_SHIFT   27 /* headphones enabled */
- #define HARMONY_GAIN_HE_MASK    (1 << HARMONY_GAIN_HE_SHIFT)
--#define HARMONY_GAIN_LE_SHIFT   26
-+#define HARMONY_GAIN_LE_SHIFT   26 /* line-out enabled */
- #define HARMONY_GAIN_LE_MASK    (1 << HARMONY_GAIN_LE_SHIFT)
--#define HARMONY_GAIN_SE_SHIFT   25
-+#define HARMONY_GAIN_SE_SHIFT   25 /* internal-speaker enabled */
- #define HARMONY_GAIN_SE_MASK    (1 << HARMONY_GAIN_SE_SHIFT)
--#define HARMONY_GAIN_IS_SHIFT   24
-+#define HARMONY_GAIN_IS_SHIFT   24 /* input select - 0 for line, 1 for mic */
- #define HARMONY_GAIN_IS_MASK    (1 << HARMONY_GAIN_IS_SHIFT)
- 
-+/* monitor attenuation */
- #define HARMONY_GAIN_MA         0x0f
- #define HARMONY_GAIN_MA_SHIFT   20
- #define HARMONY_GAIN_MA_MASK    (HARMONY_GAIN_MA << HARMONY_GAIN_MA_SHIFT)
- 
-+/* input gain */
- #define HARMONY_GAIN_IN         0x0f
- #define HARMONY_GAIN_LI_SHIFT   16
- #define HARMONY_GAIN_LI_MASK    (HARMONY_GAIN_IN << HARMONY_GAIN_LI_SHIFT)
- #define HARMONY_GAIN_RI_SHIFT   12
- #define HARMONY_GAIN_RI_MASK    (HARMONY_GAIN_IN << HARMONY_GAIN_RI_SHIFT)
- 
-+/* output gain (master volume) */
- #define HARMONY_GAIN_OUT        0x3f
- #define HARMONY_GAIN_LO_SHIFT   6
- #define HARMONY_GAIN_LO_MASK    (HARMONY_GAIN_OUT << HARMONY_GAIN_LO_SHIFT)
-Index: linux-2.6-2.6.12/sound/pci/Kconfig
-===================================================================
---- linux-2.6-2.6.12.orig/sound/pci/Kconfig	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/sound/pci/Kconfig	2005-08-09 17:53:36.000000000 -0400
-@@ -21,6 +21,26 @@
- 	  To compile this driver as a module, choose M here: the module
- 	  will be called snd-ali5451.
- 
-+config SND_AD1889
-+	tristate "Analog Devices AD1889"
-+	depends on SND && PARISC
-+	select SND_AC97_CODEC
-+	help
-+	  Say Y here to include support for the integrated AC97 sound
-+	  device on the Hewlett-Packard [BCJ]-xxx0 class PA-RISC
-+	  workstations, using the AD1819 codec.
-+
-+	  To compile this as a module, choose M here: the module
-+	  will be called snd-ad1889.
-+
-+config SND_AD1889_OPL3
-+	bool "Analog Devices AD1889 OPL3 Support"
-+	depends on SND_AD1889
-+	select SND_OPL3_LIB
-+	help
-+	  Say Y here to include support for the OPL3-compatible interface
-+	  provided on an Analog Devices AD1889.
-+
- config SND_ATIIXP
- 	tristate "ATI IXP AC97 Controller"
- 	depends on SND
-Index: linux-2.6-2.6.12/sound/pci/Makefile
-===================================================================
---- linux-2.6-2.6.12.orig/sound/pci/Makefile	2005-08-09 09:52:27.000000000 -0400
-+++ linux-2.6-2.6.12/sound/pci/Makefile	2005-08-09 17:53:36.000000000 -0400
-@@ -4,6 +4,7 @@
- #
- 
- snd-als4000-objs := als4000.o
-+snd-ad1889-objs := ad1889.o
- snd-atiixp-objs := atiixp.o
- snd-atiixp-modem-objs := atiixp_modem.o
- snd-azt3328-objs := azt3328.o
-@@ -26,6 +27,7 @@
- 
- # Toplevel Module Dependency
- obj-$(CONFIG_SND_ALS4000) += snd-als4000.o
-+obj-$(CONFIG_SND_AD1889) += snd-ad1889.o
- obj-$(CONFIG_SND_ATIIXP) += snd-atiixp.o
- obj-$(CONFIG_SND_ATIIXP_MODEM) += snd-atiixp-modem.o
- obj-$(CONFIG_SND_AZT3328) += snd-azt3328.o
-Index: linux-2.6-2.6.12/sound/pci/ad1889.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/sound/pci/ad1889.c	2005-08-09 17:53:36.000000000 -0400
-@@ -0,0 +1,1210 @@
-+/* Analog Devices 1889 audio driver
-+ *
-+ * This is a driver for the AD1889 PCI audio chipset found
-+ * on the HP PA-RISC [BCJ]-xxx0 workstations.
-+ *
-+ * Copyright (C) 2004-2005, Kyle McMartin <kyle at parisc-linux.org>
-+ * Copyright (C) 2005, Thibaut Varene <varenet at parisc-linux.org>
-+ *   Based on the OSS AD1889 driver by Randolph Chung <tausq at debian.org>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License, version 2, as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ *
-+ * TODO:
-+ *	Do we need to take care of CCS register?
-+ *	Maybe we could use finer grained locking (separate locks for pb/cap)?
-+ * Wishlist:
-+ *	Control Interface (mixer) support
-+ *	Better AC97 support (VSR...)?
-+ *	PM support
-+ *	MIDI support
-+ *	Game Port support
-+ *	SG DMA support (this will need *alot* of work)
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/pci.h>
-+#include <linux/slab.h>
-+#include <linux/interrupt.h>
-+#include <linux/compiler.h>
-+#include <linux/delay.h>
-+
-+#include <sound/driver.h>
-+#include <sound/core.h>
-+#include <sound/pcm.h>
-+#include <sound/initval.h>
-+#include <sound/ac97_codec.h>
-+
-+#ifdef CONFIG_SND_AD1889_OPL3
-+#include <sound/opl3.h>
-+#endif
-+
-+#include <asm/io.h>
-+
-+#include "ad1889.h"
-+#include "ac97/ac97_id.h"
-+
-+#define	AD1889_DRVVER	"$Revision: 1.31 $"
-+
-+MODULE_AUTHOR("Kyle McMartin <kyle at parisc-linux.org>, Thibaut Varene <t-bone at parisc-linux.org>");
-+MODULE_DESCRIPTION("Analog Devices AD1889 ALSA sound driver");
-+MODULE_LICENSE("GPL");
-+MODULE_VERSION(AD1889_DRVVER);
-+MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1889}}");
-+
-+static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
-+module_param_array(index, int, NULL, 0444);
-+MODULE_PARM_DESC(index, "Index value for the AD1889 soundcard.");
-+
-+static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
-+module_param_array(id, charp, NULL, 0444);
-+MODULE_PARM_DESC(id, "ID string for the AD1889 soundcard.");
-+
-+static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
-+module_param_array(enable, bool, NULL, 0444);
-+MODULE_PARM_DESC(enable, "Enable AD1889 soundcard.");
-+
-+static char *ac97_quirk[SNDRV_CARDS];
-+module_param_array(ac97_quirk, charp, NULL, 0444);
-+MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
-+
-+#define DEVNAME "ad1889"
-+#define PFX	DEVNAME ": "
-+
-+/* let's use the global sound debug interfaces */
-+#define ad1889_debug(fmt, arg...) snd_printd(KERN_DEBUG fmt, ## arg)
-+
-+/* keep track of each hw register */
-+struct ad1889_register_state {
-+	u16 reg;	/* reg setup */
-+	u32 addr;	/* dma base address */
-+	u16 rate;	/* sample rate */
-+	unsigned long pos;	/* last recorded DMA buffer position */
-+	unsigned long buf;	/* period # */
-+	unsigned long size;	/* DMA buffer size */
-+	unsigned long count;	/* period size, aka nb bytes sent in the current DMA transfer */
-+};
-+
-+struct snd_ad1889 {
-+	snd_card_t *card;
-+	struct pci_dev *pci;
-+
-+	int irq;
-+	unsigned long bar;
-+	void __iomem *iobase;
-+
-+#ifdef CONFIG_SND_AD1889_OPL3
-+	unsigned long opl3_bar;
-+	void __iomem *opl3_iobase;
-+
-+	opl3_t *opl3;
-+	snd_hwdep_t *opl3hwdep;
-+#endif
-+
-+	ac97_t *ac97;
-+	ac97_bus_t *ac97_bus;
-+	snd_pcm_t *pcm;
-+	snd_info_entry_t *proc;
-+
-+	struct snd_dma_device dma;
-+	snd_pcm_substream_t *psubs;
-+	snd_pcm_substream_t *csubs;
-+
-+	/* playback register state */
-+	struct ad1889_register_state wave;
-+	struct ad1889_register_state ramc;
-+
-+	struct {
-+		unsigned long wav_intr;
-+		unsigned long adc_intr;
-+		unsigned long syn_intr;
-+		unsigned long res_intr;
-+	} stats;
-+
-+	spinlock_t lock;
-+};
-+
-+static inline u16
-+ad1889_readw(struct snd_ad1889 *chip, unsigned reg)
-+{
-+	return ioread16(chip->iobase + reg);
-+}
-+
-+static inline void
-+ad1889_writew(struct snd_ad1889 *chip, unsigned reg, u16 val)
-+{
-+	iowrite16(val, chip->iobase + reg);
-+}
-+
-+static inline u32
-+ad1889_readl(struct snd_ad1889 *chip, unsigned reg)
-+{
-+	return ioread32(chip->iobase + reg);
-+}
-+
-+static inline void
-+ad1889_writel(struct snd_ad1889 *chip, unsigned reg, u32 val)
-+{
-+	iowrite32(val, chip->iobase + reg);
-+}
-+
-+static inline void
-+ad1889_unmute(struct snd_ad1889 *chip)
-+{
-+	u16 st;
-+	st = ad1889_readw(chip, AD_DS_WADA) & 
-+		~(AD_DS_WADA_RWAM | AD_DS_WADA_LWAM);
-+	ad1889_writew(chip, AD_DS_WADA, st);
-+	ad1889_readw(chip, AD_DS_WADA);
-+}
-+
-+static inline void
-+ad1889_mute(struct snd_ad1889 *chip)
-+{
-+	u16 st;
-+	st = ad1889_readw(chip, AD_DS_WADA) | AD_DS_WADA_RWAM | AD_DS_WADA_LWAM;
-+	ad1889_writew(chip, AD_DS_WADA, st);
-+	ad1889_readw(chip, AD_DS_WADA);
-+}
-+
-+static inline void
-+ad1889_load_adc_count(struct snd_ad1889 *chip, u32 count)
-+{
-+	ad1889_writel(chip, AD_DMA_ADCBC, count);
-+	ad1889_writel(chip, AD_DMA_ADCCC, count);
-+	ad1889_writel(chip, AD_DMA_ADCIB, count);
-+	ad1889_writel(chip, AD_DMA_ADCIC, count);
-+}	
-+
-+static inline void
-+ad1889_load_wave_count(struct snd_ad1889 *chip, u32 count)
-+{
-+	ad1889_writel(chip, AD_DMA_WAVBC, count);
-+	ad1889_writel(chip, AD_DMA_WAVCC, count);
-+	ad1889_writel(chip, AD_DMA_WAVIB, count);
-+	ad1889_writel(chip, AD_DMA_WAVIC, count);
-+}	
-+
-+static void
-+ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
-+{
-+	u16 reg;
-+	
-+	if (channel & AD_CHAN_WAV) {
-+		/* Disable wave channel */
-+		reg = ad1889_readw(chip, AD_DS_WSMC) & ~AD_DS_WSMC_WAEN;
-+		ad1889_writew(chip, AD_DS_WSMC, reg);
-+		chip->wave.reg = reg;
-+		
-+		/* disable IRQs */
-+		reg = ad1889_readw(chip, AD_DMA_WAV);
-+		reg &= AD_DMA_IM_DIS;
-+		reg &= ~AD_DMA_LOOP;
-+		ad1889_writew(chip, AD_DMA_WAV, reg);
-+
-+		/* clear IRQ and address counters and pointers */
-+		ad1889_load_wave_count(chip, 0x0);
-+		ad1889_writel(chip, AD_DMA_WAVBA, 0x0);
-+		ad1889_writel(chip, AD_DMA_WAVCA, 0x0);
-+
-+		/* flush */
-+		ad1889_readw(chip, AD_DMA_WAV);
-+	}
-+	
-+	if (channel & AD_CHAN_ADC) {
-+		/* Disable ADC channel */
-+		reg = ad1889_readw(chip, AD_DS_RAMC) & ~AD_DS_RAMC_ADEN;
-+		ad1889_writew(chip, AD_DS_RAMC, reg);
-+		chip->ramc.reg = reg;
-+
-+		reg = ad1889_readw(chip, AD_DMA_ADC);
-+		reg &= AD_DMA_IM_DIS;
-+		reg &= ~AD_DMA_LOOP;
-+		ad1889_writew(chip, AD_DMA_ADC, reg);
-+	
-+		ad1889_load_adc_count(chip, 0x0);
-+		ad1889_writel(chip, AD_DMA_ADCBA, 0x0);
-+		ad1889_writel(chip, AD_DMA_ADCCA, 0x0);
-+
-+		/* flush */
-+		ad1889_readw(chip, AD_DMA_ADC);
-+	}
-+}
-+
-+static inline u16
-+snd_ad1889_ac97_read(ac97_t *ac97, unsigned short reg)
-+{
-+	struct snd_ad1889 *chip = ac97->private_data;
-+	return ad1889_readw(chip, AD_AC97_BASE + reg);
-+}
-+
-+static inline void
-+snd_ad1889_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short val)
-+{
-+	struct snd_ad1889 *chip = ac97->private_data;
-+	ad1889_writew(chip, AD_AC97_BASE + reg, val);
-+}
-+
-+static int
-+snd_ad1889_ac97_ready(struct snd_ad1889 *chip)
-+{
-+	int retry = 400; /* average needs 352 msec */
-+	
-+	while (!(ad1889_readw(chip, AD_AC97_ACIC) & AD_AC97_ACIC_ACRDY) 
-+			&& --retry)
-+		mdelay(1);
-+	if (!retry) {
-+		snd_printk(KERN_ERR PFX "[%s] Link is not ready.\n",
-+		       __FUNCTION__);
-+		return -EIO;
-+	}
-+	ad1889_debug("[%s] ready after %d ms\n", __FUNCTION__, 400 - retry);
-+
-+	return 0;
-+}
-+
-+static int 
-+snd_ad1889_hw_params(snd_pcm_substream_t *substream,
-+			snd_pcm_hw_params_t *hw_params)
-+{
-+	return snd_pcm_lib_malloc_pages(substream, 
-+					params_buffer_bytes(hw_params));
-+}
-+
-+static int
-+snd_ad1889_hw_free(snd_pcm_substream_t *substream)
-+{
-+	return snd_pcm_lib_free_pages(substream);
-+}
-+
-+static snd_pcm_hardware_t snd_ad1889_playback_hw = {
-+	.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
-+		SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BLOCK_TRANSFER,
-+	.formats = SNDRV_PCM_FMTBIT_S16_LE,
-+	.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
-+	.rate_min = 8000,	/* docs say 7000, but we're lazy */
-+	.rate_max = 48000,
-+	.channels_min = 1,
-+	.channels_max = 2,
-+	.buffer_bytes_max = DMA_SIZE,	/* max DMA buffer size in bytes */
-+	.period_bytes_min = BUF_SIZE,	/* min size of period in bytes */
-+	.period_bytes_max = DMA_SIZE,	/* max size of period in bytes */
-+	.periods_min = 1,		/* min nb of periods in buffer */
-+	.periods_max = MAX_BUFS,
-+	/*.fifo_size = 0,*/
-+};
-+
-+static snd_pcm_hardware_t snd_ad1889_capture_hw = {
-+	.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
-+		SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BLOCK_TRANSFER,
-+	.formats = SNDRV_PCM_FMTBIT_S16_LE,
-+	.rates = SNDRV_PCM_RATE_48000,
-+	.rate_min = 48000,	/* docs say we could to VSR, but we're lazy */
-+	.rate_max = 48000,
-+	.channels_min = 1,
-+	.channels_max = 2,
-+	.buffer_bytes_max = DMA_SIZE,	/* max DMA buffer size in bytes */
-+	.period_bytes_min = BUF_SIZE,	/* min size of period in bytes */
-+	.period_bytes_max = DMA_SIZE,	/* max size of period in bytes */
-+	.periods_min = 1,		/* min nb of periods in buffer */
-+	.periods_max = MAX_BUFS,
-+	/*.fifo_size = 0,*/
-+};
-+
-+static int
-+snd_ad1889_playback_open(snd_pcm_substream_t *ss)
-+{
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+	snd_pcm_runtime_t *rt = ss->runtime;
-+
-+	chip->psubs = ss;
-+	rt->hw = snd_ad1889_playback_hw;
-+
-+	return 0;
-+}
-+
-+static int
-+snd_ad1889_capture_open(snd_pcm_substream_t *ss)
-+{
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+	snd_pcm_runtime_t *rt = ss->runtime;
-+
-+	chip->csubs = ss;
-+	rt->hw = snd_ad1889_capture_hw;
-+
-+	return 0;
-+}
-+
-+static int
-+snd_ad1889_playback_close(snd_pcm_substream_t *ss)
-+{
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+	chip->psubs = NULL;
-+	return 0;
-+}
-+
-+static int
-+snd_ad1889_capture_close(snd_pcm_substream_t *ss)
-+{
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+	chip->csubs = NULL;
-+	return 0;
-+}
-+
-+static int
-+snd_ad1889_playback_prepare(snd_pcm_substream_t *ss)
-+{
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+	snd_pcm_runtime_t *rt = ss->runtime;
-+	unsigned int size = snd_pcm_lib_buffer_bytes(ss);
-+	unsigned int count = snd_pcm_lib_period_bytes(ss);
-+	u16 reg;
-+
-+	ad1889_channel_reset(chip, AD_CHAN_WAV);
-+
-+	reg = ad1889_readw(chip, AD_DS_WSMC);
-+	
-+	/* Mask out 16-bit / Stereo */
-+	reg &= ~(AD_DS_WSMC_WA16 | AD_DS_WSMC_WAST);
-+
-+	if (snd_pcm_format_width(rt->format) == 16)
-+		reg |= AD_DS_WSMC_WA16;
-+
-+	if (rt->channels > 1)
-+		reg |= AD_DS_WSMC_WAST;
-+
-+	/* let's make sure we don't clobber ourselves */
-+	spin_lock_irq(&chip->lock);
-+	
-+	chip->wave.size = size;
-+	chip->wave.count = count;
-+	chip->wave.reg = reg;
-+	chip->wave.buf = 0;
-+	chip->wave.pos = 0;
-+	chip->wave.rate = rt->rate;
-+	chip->wave.addr = rt->dma_addr;
-+
-+	ad1889_writew(chip, AD_DS_WSMC, chip->wave.reg);
-+	
-+	/* Set sample rates on the codec */
-+	ad1889_writew(chip, AD_DS_WAS, chip->wave.rate);
-+
-+	/* Set up DMA: first chunk address in curr addr, next one in base addr.
-+	   Base will be loaded into curr by the hardware upon interrupt
-+	   (as we use LOOP). Count holds the size of the chunk. */
-+	ad1889_writel(chip, AD_DMA_WAVCA, chip->wave.addr);
-+	ad1889_writel(chip, AD_DMA_WAVBA, chip->wave.addr + (count % size));
-+	ad1889_load_wave_count(chip, chip->wave.count);
-+
-+	/* writes flush */
-+	ad1889_readw(chip, AD_DS_WSMC);
-+	
-+	spin_unlock_irq(&chip->lock);
-+	
-+	ad1889_debug("prepare playback: addr = 0x%x, count = %u, "
-+			"size = %u, reg = 0x%x, rate = %u\n", chip->wave.addr,
-+			count, size, reg, chip->wave.rate);
-+	return 0;
-+}
-+
-+static int
-+snd_ad1889_capture_prepare(snd_pcm_substream_t *ss)
-+{
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+	snd_pcm_runtime_t *rt = ss->runtime;
-+	unsigned int size = snd_pcm_lib_buffer_bytes(ss);
-+	unsigned int count = snd_pcm_lib_period_bytes(ss);
-+	u16 reg;
-+
-+	ad1889_channel_reset(chip, AD_CHAN_ADC);
-+	
-+	reg = ad1889_readw(chip, AD_DS_RAMC);
-+
-+	/* Mask out 16-bit / Stereo */
-+	reg &= ~(AD_DS_RAMC_AD16 | AD_DS_RAMC_ADST);
-+
-+	if (snd_pcm_format_width(rt->format) == 16)
-+		reg |= AD_DS_RAMC_AD16;
-+
-+	if (rt->channels > 1)
-+		reg |= AD_DS_RAMC_ADST;
-+
-+	/* let's make sure we don't clobber ourselves */
-+	spin_lock_irq(&chip->lock);
-+	
-+	chip->ramc.size = size;
-+	chip->ramc.count = count;
-+	chip->ramc.reg = reg;
-+	chip->ramc.buf = 0;
-+	chip->ramc.pos = 0;
-+	chip->ramc.rate = rt->rate;
-+	chip->ramc.addr = rt->dma_addr;
-+
-+	ad1889_writew(chip, AD_DS_RAMC, chip->ramc.reg);
-+
-+	/* Set up DMA: first chunk address in curr addr, next one in base addr.
-+	   Base will be loaded into curr by the hardware upon interrupt
-+	   (as we use LOOP). Count holds the size of the chunk. */
-+	ad1889_writel(chip, AD_DMA_ADCCA, chip->ramc.addr);
-+	ad1889_writel(chip, AD_DMA_ADCBA, chip->ramc.addr + (count % size));
-+	ad1889_load_adc_count(chip, chip->ramc.count);
-+
-+	/* writes flush */
-+	ad1889_readw(chip, AD_DS_RAMC);
-+	
-+	spin_unlock_irq(&chip->lock);
-+	
-+	ad1889_debug("prepare capture: addr = 0x%x, count = %u, "
-+			"size = %u, reg = 0x%x, rate = %u\n", chip->ramc.addr,
-+			count, size, reg, chip->ramc.rate);
-+	return 0;
-+}
-+
-+/* this is called in atomic context with IRQ disabled.
-+   Must be as fast as possible and not sleep.
-+   DMA should be *triggered* by this call.
-+   The WSMC "WAEN" bit triggers DMA Wave On/Off */
-+static int
-+snd_ad1889_playback_trigger(snd_pcm_substream_t *ss, int cmd)
-+{
-+	u16 wsmc;
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+	
-+	wsmc = ad1889_readw(chip, AD_DS_WSMC);
-+
-+	switch (cmd) {
-+	case SNDRV_PCM_TRIGGER_START:
-+		/* enable DMA loop & interrupts */
-+		ad1889_writew(chip, AD_DMA_WAV, AD_DMA_LOOP | AD_DMA_IM_CNT);
-+		wsmc |= AD_DS_WSMC_WAEN;
-+		/* 1 to clear CHSS bit */
-+		ad1889_writel(chip, AD_DMA_CHSS, AD_DMA_CHSS_WAVS);
-+		ad1889_unmute(chip);
-+		break;
-+	case SNDRV_PCM_TRIGGER_STOP:
-+		ad1889_mute(chip);
-+		wsmc &= ~AD_DS_WSMC_WAEN;
-+		break;
-+	default:
-+		snd_BUG();
-+		return -EINVAL;
-+	}
-+	
-+	chip->wave.reg = wsmc;
-+	ad1889_writew(chip, AD_DS_WSMC, wsmc);	
-+	ad1889_readw(chip, AD_DS_WSMC);	/* flush */
-+
-+	/* reset the chip when STOP - will disable IRQs */
-+	if (cmd == SNDRV_PCM_TRIGGER_STOP)
-+		ad1889_channel_reset(chip, AD_CHAN_WAV);
-+
-+	return 0;
-+}
-+
-+/* this is called in atomic context with IRQ disabled.
-+   Must be as fast as possible and not sleep.
-+   DMA should be *triggered* by this call.
-+   The RAMC "ADEN" bit triggers DMA ADC On/Off */
-+static int
-+snd_ad1889_capture_trigger(snd_pcm_substream_t *ss, int cmd)
-+{
-+	u16 ramc;
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+
-+	ramc = ad1889_readw(chip, AD_DS_RAMC);
-+	
-+	switch (cmd) {
-+	case SNDRV_PCM_TRIGGER_START:
-+		/* enable DMA loop & interrupts */
-+		ad1889_writew(chip, AD_DMA_ADC, AD_DMA_LOOP | AD_DMA_IM_CNT);
-+		ramc |= AD_DS_RAMC_ADEN;
-+		/* 1 to clear CHSS bit */
-+		ad1889_writel(chip, AD_DMA_CHSS, AD_DMA_CHSS_ADCS);
-+		break;
-+	case SNDRV_PCM_TRIGGER_STOP:
-+		ramc &= ~AD_DS_RAMC_ADEN;
-+		break;
-+	default:
-+		return -EINVAL;
-+	}
-+	
-+	chip->ramc.reg = ramc;
-+	ad1889_writew(chip, AD_DS_RAMC, ramc);	
-+	ad1889_readw(chip, AD_DS_RAMC);	/* flush */
-+	
-+	/* reset the chip when STOP - will disable IRQs */
-+	if (cmd == SNDRV_PCM_TRIGGER_STOP)
-+		ad1889_channel_reset(chip, AD_CHAN_ADC);
-+		
-+	return 0;
-+}
-+
-+/* Called in atomic context with IRQ disabled */
-+static snd_pcm_uframes_t
-+snd_ad1889_playback_pointer(snd_pcm_substream_t *ss)
-+{
-+	size_t ptr = 0;
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+
-+	if (unlikely(!(chip->wave.reg & AD_DS_WSMC_WAEN)))
-+		return 0;
-+
-+	ptr = ad1889_readl(chip, AD_DMA_WAVCA);
-+	ptr -= chip->wave.addr;
-+	
-+	snd_assert((ptr >= 0) && (ptr < chip->wave.size), return 0);
-+	
-+	return bytes_to_frames(ss->runtime, ptr);
-+}
-+
-+/* Called in atomic context with IRQ disabled */
-+static snd_pcm_uframes_t
-+snd_ad1889_capture_pointer(snd_pcm_substream_t *ss)
-+{
-+	size_t ptr = 0;
-+	struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-+
-+	if (unlikely(!(chip->ramc.reg & AD_DS_RAMC_ADEN)))
-+		return 0;
-+
-+	ptr = ad1889_readl(chip, AD_DMA_ADCCA);
-+	ptr -= chip->ramc.addr;
-+
-+	snd_assert((ptr >= 0) && (ptr < chip->ramc.size), return 0);
-+	
-+	return bytes_to_frames(ss->runtime, ptr);
-+}
-+
-+static snd_pcm_ops_t snd_ad1889_playback_ops = {
-+	.open = snd_ad1889_playback_open,
-+	.close = snd_ad1889_playback_close,
-+	.ioctl = snd_pcm_lib_ioctl,
-+	.hw_params = snd_ad1889_hw_params,
-+	.hw_free = snd_ad1889_hw_free,
-+	.prepare = snd_ad1889_playback_prepare,
-+	.trigger = snd_ad1889_playback_trigger,
-+	.pointer = snd_ad1889_playback_pointer, 
-+};
-+
-+static snd_pcm_ops_t snd_ad1889_capture_ops = {
-+	.open = snd_ad1889_capture_open,
-+	.close = snd_ad1889_capture_close,
-+	.ioctl = snd_pcm_lib_ioctl,
-+	.hw_params = snd_ad1889_hw_params,
-+	.hw_free = snd_ad1889_hw_free,
-+	.prepare = snd_ad1889_capture_prepare,
-+	.trigger = snd_ad1889_capture_trigger,
-+	.pointer = snd_ad1889_capture_pointer, 
-+};
-+
-+static irqreturn_t
-+snd_ad1889_interrupt(int irq, 
-+		     void *dev_id, 
-+		     struct pt_regs *regs)
-+{
-+	unsigned long st;
-+	unsigned long next;
-+	struct snd_ad1889 *chip = dev_id;
-+
-+	st = ad1889_readl(chip, AD_DMA_DISR);
-+
-+	/* clear ISR */
-+	ad1889_writel(chip, AD_DMA_DISR, st);
-+
-+	st &= AD_INTR_MASK;
-+
-+	if (unlikely(!st))
-+		return IRQ_NONE;
-+
-+	if (st & (AD_DMA_DISR_PMAI|AD_DMA_DISR_PTAI))
-+		ad1889_debug("Unexpected master or target abort interrupt!\n");
-+
-+	if (chip->pcm && (st & AD_DMA_DISR_WAVI) && chip->psubs) {
-+		spin_lock(&chip->lock);
-+
-+		chip->stats.wav_intr++;
-+
-+		chip->wave.buf++;
-+
-+		/* calculate the current position: we get interrupts everytime
-+		   the buffer empties, thus every wave.count bytes transfered */
-+		chip->wave.pos += chip->wave.count;
-+		chip->wave.pos %= chip->wave.size;
-+
-+		/* the next buffer will thus be current position + wave.count
-+		   bytes away */
-+		next = chip->wave.pos + chip->wave.count;
-+		next %= chip->wave.size;
-+		
-+		/* Load new DMA parameters (aka "the next chunk" in Base
-+		   registers: upon next interrupt, they'll be automatically
-+		   loaded in the Current registers, and we'll end up here
-+		   preparing the new ones. Since "count" never gets modified
-+		   elsewhere than in _prepare, we don't need to rewrite it. */
-+		ad1889_writel(chip, AD_DMA_WAVBA, chip->wave.addr + next);
-+		
-+		ad1889_readl(chip, AD_DMA_WAVBA); /* flush all those writes */
-+
-+		spin_unlock(&chip->lock);
-+
-+		snd_pcm_period_elapsed(chip->psubs);
-+#if 0
-+		ad1889_debug("chip->wave.pos = %d, chip->wave.count = %d, "
-+				"chip->wave.size = %d\n", chip->wave.pos,
-+				chip->wave.count, chip->wave.size);
-+		ad1889_debug("chip->wave.addr (0x%lx) + next (0x%lx) = 0x%lx\n",
-+				chip->wave.addr, next, chip->wave.addr + next);
-+#endif		
-+	}
-+
-+	if (chip->pcm && (st & AD_DMA_DISR_ADCI) && chip->csubs) {
-+		spin_lock(&chip->lock);
-+		
-+		chip->stats.adc_intr++;
-+
-+		chip->ramc.buf++;
-+		
-+		/* calculate the current position: we get interrupts everytime
-+		   the buffer empties, thus every wave.count bytes transfered */
-+		chip->ramc.pos += chip->ramc.count;
-+		chip->ramc.pos %= chip->ramc.size;
-+
-+		/* the next buffer will thus be current position + wave.count
-+		   bytes away */
-+		next = chip->ramc.pos + chip->ramc.count;
-+		next %= chip->ramc.size;
-+
-+		/* Load new DMA parameters (aka "the next chunk" in Base
-+		   registers: upon next interrupt, they'll be automatically
-+		   loaded in the Current registers, and we'll end up here
-+		   preparing the new ones. Since "count" never gets modified
-+		   elsewhere than in _prepare, we don't need to rewrite it. */
-+		ad1889_writel(chip, AD_DMA_ADCBA, chip->ramc.addr + next);
-+		
-+		ad1889_readl(chip, AD_DMA_ADCBA); /* flush all those writes */
-+
-+		spin_unlock(&chip->lock);
-+		
-+		snd_pcm_period_elapsed(chip->csubs);
-+#if 0
-+		ad1889_debug("chip->ramc.pos = %d, chip->ramc.count = %d, "
-+				"chip->ramc.size = %d\n", chip->ramc.pos,
-+				chip->ramc.count, chip->ramc.size);
-+		ad1889_debug("chip->ramc.addr (0x%lx) + next (0x%lx) = 0x%lx\n",
-+				chip->ramc.addr, next, chip->ramc.addr + next);
-+#endif		
-+	}
-+
-+	/* XXX under some circumstances the DISR write flush may not happen */
-+
-+	return IRQ_HANDLED;
-+}
-+
-+static void 
-+snd_ad1889_pcm_free(snd_pcm_t *pcm)
-+{
-+	struct snd_ad1889 *chip = pcm->private_data;
-+	chip->pcm = NULL;
-+	snd_pcm_lib_preallocate_free_for_all(pcm);
-+}
-+
-+static int __devinit
-+snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, snd_pcm_t **rpcm)
-+{
-+	int err;
-+	snd_pcm_t *pcm;
-+
-+	if (rpcm)
-+		*rpcm = NULL;
-+
-+	err = snd_pcm_new(chip->card, chip->card->driver, device, 1, 1, &pcm);
-+	if (err < 0)
-+		return err;
-+
-+	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, 
-+			&snd_ad1889_playback_ops);
-+	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
-+			&snd_ad1889_capture_ops);
-+
-+	pcm->private_data = chip;
-+	pcm->private_free = snd_ad1889_pcm_free;
-+	pcm->info_flags = 0;
-+	strcpy(pcm->name, chip->card->shortname);
-+	
-+	chip->pcm = pcm;
-+	chip->psubs = NULL;
-+	chip->csubs = NULL;
-+
-+	chip->dma.dev = &chip->pci->dev;
-+	chip->dma.type = SNDRV_DMA_TYPE_DEV;
-+
-+	err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-+						snd_dma_pci_data(chip->pci),
-+						DMA_SIZE, DMA_SIZE);
-+
-+	if (err < 0) {
-+		snd_printk(KERN_ERR PFX "buffer allocation error: %d\n", err);
-+		return err;
-+	}
-+	
-+	if (rpcm)
-+		*rpcm = pcm;
-+	
-+	return 0;
-+}
-+
-+static void
-+snd_ad1889_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
-+{
-+	struct snd_ad1889 *chip = entry->private_data;
-+	u16 reg;
-+	int tmp;
-+
-+	reg = ad1889_readw(chip, AD_DS_WSMC);
-+	snd_iprintf(buffer, "Wave output: %s\n",
-+			(reg & AD_DS_WSMC_WAEN) ? "enabled" : "disabled");
-+	snd_iprintf(buffer, "Wave Channels: %s\n",
-+			(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-+	snd_iprintf(buffer, "Wave Quality: %d-bit linear\n",
-+			(reg & AD_DS_WSMC_WA16) ? 16 : 8);
-+	
-+	/* WARQ is at offset 12 */
-+	tmp = (reg & AD_DS_WSMC_WARQ) ?
-+			(((reg & AD_DS_WSMC_WARQ >> 12) & 0x01) ? 12 : 18) : 4;
-+	tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1;
-+	
-+	snd_iprintf(buffer, "Wave FIFO: %d %s words\n\n", tmp,
-+			(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-+				
-+	
-+	snd_iprintf(buffer, "Synthesis output: %s\n",
-+			reg & AD_DS_WSMC_SYEN ? "enabled" : "disabled");
-+	
-+	/* SYRQ is at offset 4 */
-+	tmp = (reg & AD_DS_WSMC_SYRQ) ?
-+			(((reg & AD_DS_WSMC_SYRQ >> 4) & 0x01) ? 12 : 18) : 4;
-+	tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1;
-+	
-+	snd_iprintf(buffer, "Synthesis FIFO: %d %s words\n\n", tmp,
-+			(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-+
-+	reg = ad1889_readw(chip, AD_DS_RAMC);
-+	snd_iprintf(buffer, "ADC input: %s\n",
-+			(reg & AD_DS_RAMC_ADEN) ? "enabled" : "disabled");
-+	snd_iprintf(buffer, "ADC Channels: %s\n",
-+			(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
-+	snd_iprintf(buffer, "ADC Quality: %d-bit linear\n",
-+			(reg & AD_DS_RAMC_AD16) ? 16 : 8);
-+	
-+	/* ACRQ is at offset 4 */
-+	tmp = (reg & AD_DS_RAMC_ACRQ) ?
-+			(((reg & AD_DS_RAMC_ACRQ >> 4) & 0x01) ? 12 : 18) : 4;
-+	tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1;
-+	
-+	snd_iprintf(buffer, "ADC FIFO: %d %s words\n\n", tmp,
-+			(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
-+	
-+	snd_iprintf(buffer, "Resampler input: %s\n",
-+			reg & AD_DS_RAMC_REEN ? "enabled" : "disabled");
-+			
-+	/* RERQ is at offset 12 */
-+	tmp = (reg & AD_DS_RAMC_RERQ) ?
-+			(((reg & AD_DS_RAMC_RERQ >> 12) & 0x01) ? 12 : 18) : 4;
-+	tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1;
-+	
-+	snd_iprintf(buffer, "Resampler FIFO: %d %s words\n\n", tmp,
-+			(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-+				
-+	
-+	/* doc says LSB represents -1.5dB, but the max value (-94.5dB)
-+	suggests that LSB is -3dB, which is more coherent with the logarithmic
-+	nature of the dB scale */
-+	reg = ad1889_readw(chip, AD_DS_WADA);
-+	snd_iprintf(buffer, "Left: %s, -%d dB\n",
-+			(reg & AD_DS_WADA_LWAM) ? "mute" : "unmute",
-+			((reg & AD_DS_WADA_LWAA) >> 8) * 3);
-+	reg = ad1889_readw(chip, AD_DS_WADA);
-+	snd_iprintf(buffer, "Right: %s, -%d dB\n",
-+			(reg & AD_DS_WADA_RWAM) ? "mute" : "unmute",
-+			((reg & AD_DS_WADA_RWAA) >> 8) * 3);
-+	
-+	reg = ad1889_readw(chip, AD_DS_WAS);
-+	snd_iprintf(buffer, "Wave samplerate: %u Hz\n", reg);
-+	reg = ad1889_readw(chip, AD_DS_RES);
-+	snd_iprintf(buffer, "Resampler samplerate: %u Hz\n", reg);
-+}
-+
-+static void __devinit
-+snd_ad1889_proc_init(struct snd_ad1889 *chip)
-+{
-+	snd_info_entry_t *entry;
-+
-+	if (!snd_card_proc_new(chip->card, chip->card->driver, &entry))
-+		snd_info_set_text_ops(entry, chip, 1024, snd_ad1889_proc_read);
-+}
-+
-+static struct ac97_quirk ac97_quirks[] = {
-+	{
-+		.vendor = 0x11d4,	/* AD */
-+		.device = 0x1889,	/* AD1889 */
-+		.codec_id = AC97_ID_AD1819,
-+		.name = "AD1889",
-+		.type = AC97_TUNE_HP_ONLY
-+	},
-+	{ } /* terminator */
-+};
-+
-+static void __devinit
-+snd_ad1889_ac97_xinit(struct snd_ad1889 *chip)
-+{
-+	u16 reg;
-+
-+	reg = ad1889_readw(chip, AD_AC97_ACIC);
-+	reg |= AD_AC97_ACIC_ACRD;		/* Reset Disable */
-+	ad1889_writew(chip, AD_AC97_ACIC, reg);
-+	ad1889_readw(chip, AD_AC97_ACIC);	/* flush posted write */
-+	udelay(10);
-+	/* Interface Enable */
-+	reg |= AD_AC97_ACIC_ACIE;
-+	ad1889_writew(chip, AD_AC97_ACIC, reg);
-+	
-+	snd_ad1889_ac97_ready(chip);
-+
-+	/* Audio Stream Output | Variable Sample Rate Mode */
-+	reg = ad1889_readw(chip, AD_AC97_ACIC);
-+	reg |= AD_AC97_ACIC_ASOE | AD_AC97_ACIC_VSRM;
-+	ad1889_writew(chip, AD_AC97_ACIC, reg);
-+	ad1889_readw(chip, AD_AC97_ACIC); /* flush posted write */
-+
-+}
-+
-+static void
-+snd_ad1889_ac97_bus_free(ac97_bus_t *bus)
-+{
-+	struct snd_ad1889 *chip = bus->private_data;
-+	chip->ac97_bus = NULL;
-+}
-+
-+static void
-+snd_ad1889_ac97_free(ac97_t *ac97)
-+{
-+	struct snd_ad1889 *chip = ac97->private_data;
-+	chip->ac97 = NULL;
-+}
-+
-+static int __devinit
-+snd_ad1889_ac97_init(struct snd_ad1889 *chip, const char *quirk_override)
-+{
-+	int err;
-+	ac97_template_t ac97;
-+	static ac97_bus_ops_t ops = {
-+		.write = snd_ad1889_ac97_write,
-+		.read = snd_ad1889_ac97_read,
-+	};
-+
-+	/* doing that here, it works. */
-+	snd_ad1889_ac97_xinit(chip);
-+
-+	err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus);
-+	if (err < 0)
-+		return err;
-+	
-+	chip->ac97_bus->private_free = snd_ad1889_ac97_bus_free;
-+
-+	memset(&ac97, 0, sizeof(ac97));
-+	ac97.private_data = chip;
-+	ac97.private_free = snd_ad1889_ac97_free;
-+	ac97.pci = chip->pci;
-+
-+	err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97);
-+	if (err < 0)
-+		return err;
-+		
-+	snd_ac97_tune_hardware(chip->ac97, ac97_quirks, quirk_override);
-+	
-+	return 0;
-+}
-+
-+static int
-+snd_ad1889_free(struct snd_ad1889 *chip)
-+{
-+	if (chip->irq < 0)
-+		goto skip_hw;
-+
-+	spin_lock_irq(&chip->lock);
-+
-+	ad1889_mute(chip);
-+
-+	/* Turn off interrupt on count and zero DMA registers */
-+	ad1889_channel_reset(chip, AD_CHAN_WAV | AD_CHAN_ADC);
-+
-+	/* clear DISR. If we don't, we'd better jump off the Eiffel Tower */
-+	ad1889_writel(chip, AD_DMA_DISR, AD_DMA_DISR_PTAI | AD_DMA_DISR_PMAI);
-+	ad1889_readl(chip, AD_DMA_DISR);	/* flush, dammit! */
-+
-+	spin_unlock_irq(&chip->lock);
-+
-+	synchronize_irq(chip->irq);
-+	
-+	if (chip->irq >= 0)
-+		free_irq(chip->irq, (void*)chip);
-+
-+skip_hw:
-+	if (chip->iobase)
-+		iounmap(chip->iobase);
-+
-+#ifdef CONFIG_SND_AD1889_OPL3
-+	if (chip->opl3_iobase)
-+		iounmap(chip->opl3_iobase);
-+#endif
-+	
-+	pci_release_regions(chip->pci);
-+	pci_disable_device(chip->pci);
-+
-+	kfree(chip);
-+	return 0;
-+}
-+
-+static inline int
-+snd_ad1889_dev_free(snd_device_t *device) 
-+{
-+	struct snd_ad1889 *chip = device->device_data;
-+	return snd_ad1889_free(chip);
-+}
-+
-+static int __devinit
-+snd_ad1889_init(struct snd_ad1889 *chip) 
-+{
-+	ad1889_writew(chip, AD_DS_CCS, AD_DS_CCS_CLKEN); /* turn on clock */
-+	ad1889_readw(chip, AD_DS_CCS);	/* flush posted write */
-+
-+	mdelay(10);
-+
-+	/* enable Master and Target abort interrupts */
-+	ad1889_writel(chip, AD_DMA_DISR, AD_DMA_DISR_PMAE | AD_DMA_DISR_PTAE);
-+
-+	return 0;
-+}
-+
-+static int __devinit
-+snd_ad1889_create(snd_card_t *card,
-+		  struct pci_dev *pci,
-+		  struct snd_ad1889 **rchip)
-+{
-+	int err;
-+
-+	struct snd_ad1889 *chip;
-+	static snd_device_ops_t ops = {
-+		.dev_free = snd_ad1889_dev_free,
-+	};
-+
-+	*rchip = NULL;
-+
-+	if ((err = pci_enable_device(pci)) < 0)
-+		return err;
-+	
-+	/* check PCI availability (32bit DMA) */
-+	if (pci_set_dma_mask(pci, 0xffffffff) < 0 ||
-+	    pci_set_consistent_dma_mask(pci, 0xffffffff) < 0) {
-+		printk(KERN_ERR PFX "error setting 32-bit DMA mask.\n");
-+		pci_disable_device(pci);
-+		return -ENXIO;
-+	}
-+
-+	/* allocate chip specific data with zero-filled memory */
-+	if ((chip = kcalloc(1, sizeof(*chip), GFP_KERNEL)) == NULL) {
-+		pci_disable_device(pci);
-+		return -ENOMEM;
-+	}
-+
-+	chip->card = card;
-+	card->private_data = chip;
-+	chip->pci = pci;
-+	chip->irq = -1;
-+
-+	/* (1) PCI resource allocation */
-+	if ((err = pci_request_regions(pci, card->driver)) < 0)
-+		goto free_and_ret;
-+
-+	chip->bar = pci_resource_start(pci, 0);
-+	chip->iobase = ioremap_nocache(chip->bar, pci_resource_len(pci, 0));
-+	if (chip->iobase == NULL) {
-+		printk(KERN_ERR PFX "unable to reserve region.\n");
-+		err = -EBUSY;
-+		goto free_and_ret;
-+	}
-+	
-+	pci_set_master(pci);
-+
-+	spin_lock_init(&chip->lock);	/* only now can we call ad1889_free */
-+
-+#ifdef CONFIG_SND_AD1889_OPL3
-+	chip->opl3_bar = pci_resource_start(pci, 1);
-+	chip->opl3_iobase = ioremap_nocache(chip->opl3_bar, 
-+					   pci_resource_len(pci, 1));
-+	if (chip->opl3_iobase == NULL) {
-+		printk(KERN_ERR PFX "unable to reserve region.\n");
-+		snd_ad1889_free(chip);
-+		return -EBUSY;
-+	}
-+#endif
-+
-+	if (request_irq(pci->irq, snd_ad1889_interrupt,
-+			SA_INTERRUPT|SA_SHIRQ, card->driver, (void*)chip)) {
-+		printk(KERN_ERR PFX "cannot obtain IRQ %d\n", pci->irq);
-+		snd_ad1889_free(chip);
-+		return -EBUSY;
-+	}
-+
-+	chip->irq = pci->irq;
-+	synchronize_irq(chip->irq);
-+
-+	/* (2) initialization of the chip hardware */
-+	if ((err = snd_ad1889_init(chip)) < 0) {
-+		snd_ad1889_free(chip);
-+		return err;
-+	}
-+
-+	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
-+		snd_ad1889_free(chip);
-+		return err;
-+	}
-+
-+	snd_card_set_dev(card, &pci->dev);
-+
-+	*rchip = chip;
-+
-+	return 0;
-+
-+free_and_ret:
-+	if (chip)
-+		kfree(chip);
-+	pci_disable_device(pci);
-+
-+	return err;
-+}
-+
-+static int __devinit
-+snd_ad1889_probe(struct pci_dev *pci,
-+		 const struct pci_device_id *pci_id)
-+{
-+	int err;
-+	static int devno;
-+	snd_card_t *card;
-+	struct snd_ad1889 *chip;
-+
-+	/* (1) */
-+	if (devno >= SNDRV_CARDS)
-+		return -ENODEV;
-+	if (!enable[devno]) {
-+		devno++;
-+		return -ENOENT;
-+	}
-+
-+	/* (2) */
-+	card = snd_card_new(index[devno], id[devno], THIS_MODULE, 0);
-+	/* XXX REVISIT: we can probably allocate chip in this call */
-+	if (card == NULL)
-+		return -ENOMEM;
-+
-+	strcpy(card->driver, "AD1889");
-+	strcpy(card->shortname, "Analog Devices AD1889");
-+
-+	/* (3) */
-+	err = snd_ad1889_create(card, pci, &chip);
-+	if (err < 0)
-+		goto free_and_ret;
-+
-+	/* (4) */
-+	sprintf(card->longname, "%s at 0x%lx irq %i",
-+		card->shortname, chip->bar, chip->irq);
-+
-+	/* (5) */
-+	/* register AC97 mixer */
-+	err = snd_ad1889_ac97_init(chip, ac97_quirk[devno]);
-+	if (err < 0)
-+		goto free_and_ret;
-+	
-+#ifdef CONFIG_SND_AD1889_OPL3
-+	err = snd_opl3_create_mapped(card, chip->opl3_iobase,
-+				     chip->opl3_iobase + 2, OPL3_HW_OPL3,
-+				     &chip->opl3);
-+	if (err) {
-+		printk(KERN_ERR PFX "failed to create opl3\n");
-+		goto free_and_ret;
-+	}
-+
-+	err = snd_opl3_hwdep_new(chip->opl3, 0, 0, &chip->opl3hwdep);
-+	if (err) {
-+		printk(KERN_ERR PFX "failed to create opl3hwdep\n");
-+		goto free_and_ret;
-+	}
-+#endif
-+
-+	err = snd_ad1889_pcm_init(chip, 0, NULL);
-+	if (err < 0)
-+		goto free_and_ret;
-+
-+	/* register proc interface */
-+	snd_ad1889_proc_init(chip);
-+
-+	/* (6) */
-+	err = snd_card_register(card);
-+	if (err < 0)
-+		goto free_and_ret;
-+
-+	/* (7) */
-+	pci_set_drvdata(pci, card);
-+
-+	devno++;
-+	return 0;
-+
-+free_and_ret:
-+	snd_card_free(card);
-+	return err;
-+}
-+
-+static void __devexit
-+snd_ad1889_remove(struct pci_dev *pci)
-+{
-+	snd_card_free(pci_get_drvdata(pci));
-+	pci_set_drvdata(pci, NULL);
-+}
-+
-+static struct pci_device_id snd_ad1889_ids[] = {
-+	{ PCI_DEVICE(PCI_VENDOR_ID_ANALOG_DEVICES, PCI_DEVICE_ID_AD1889JS) },
-+	{ 0, },
-+};
-+MODULE_DEVICE_TABLE(pci, snd_ad1889_ids);
-+
-+static struct pci_driver ad1889_pci = {
-+	.name = "AD1889 Audio",
-+	.id_table = snd_ad1889_ids,
-+	.probe = snd_ad1889_probe,
-+	.remove = __devexit_p(snd_ad1889_remove),
-+};
-+
-+static int __init
-+alsa_ad1889_init(void)
-+{
-+	return pci_register_driver(&ad1889_pci);
-+}
-+
-+static void __exit
-+alsa_ad1889_fini(void)
-+{
-+	pci_unregister_driver(&ad1889_pci);
-+}
-+
-+module_init(alsa_ad1889_init);
-+module_exit(alsa_ad1889_fini);
-Index: linux-2.6-2.6.12/sound/pci/ad1889.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6-2.6.12/sound/pci/ad1889.h	2005-08-09 17:53:36.000000000 -0400
-@@ -0,0 +1,187 @@
-+/* Analog Devices 1889 audio driver
-+ * Copyright (C) 2004, Kyle McMartin <kyle at parisc-linux.org>
-+ */
-+
-+#ifndef __AD1889_H__
-+#define __AD1889_H__
-+
-+#define AD_DS_WSMC	0x00 /* wave/synthesis channel mixer control */
-+#define  AD_DS_WSMC_SYEN 0x0004 /* synthesis channel enable */
-+#define  AD_DS_WSMC_SYRQ 0x0030 /* synth. fifo request point */
-+#define  AD_DS_WSMC_WA16 0x0100 /* wave channel 16bit select */
-+#define  AD_DS_WSMC_WAST 0x0200 /* wave channel stereo select */
-+#define  AD_DS_WSMC_WAEN 0x0400 /* wave channel enable */
-+#define  AD_DS_WSMC_WARQ 0x3000 /* wave fifo request point */
-+
-+#define AD_DS_RAMC	0x02 /* resampler/ADC channel mixer control */
-+#define  AD_DS_RAMC_AD16 0x0001 /* ADC channel 16bit select */
-+#define  AD_DS_RAMC_ADST 0x0002 /* ADC channel stereo select */
-+#define  AD_DS_RAMC_ADEN 0x0004 /* ADC channel enable */
-+#define  AD_DS_RAMC_ACRQ 0x0030 /* ADC fifo request point */
-+#define  AD_DS_RAMC_REEN 0x0400 /* resampler channel enable */
-+#define  AD_DS_RAMC_RERQ 0x3000 /* res. fifo request point */
-+
-+#define AD_DS_WADA	0x04 /* wave channel mix attenuation */
-+#define  AD_DS_WADA_RWAM 0x0080 /* right wave mute */
-+#define  AD_DS_WADA_RWAA 0x001f /* right wave attenuation */
-+#define  AD_DS_WADA_LWAM 0x8000 /* left wave mute */
-+#define  AD_DS_WADA_LWAA 0x3e00 /* left wave attenuation */
-+
-+#define AD_DS_SYDA	0x06 /* synthesis channel mix attenuation */
-+#define  AD_DS_SYDA_RSYM 0x0080 /* right synthesis mute */
-+#define  AD_DS_SYDA_RSYA 0x001f /* right synthesis attenuation */
-+#define  AD_DS_SYDA_LSYM 0x8000 /* left synthesis mute */
-+#define  AD_DS_SYDA_LSYA 0x3e00 /* left synthesis attenuation */
-+
-+#define AD_DS_WAS	0x08 /* wave channel sample rate */
-+#define  AD_DS_WAS_WAS   0xffff /* sample rate mask */
-+
-+#define AD_DS_RES	0x0a /* resampler channel sample rate */
-+#define  AD_DS_RES_RES   0xffff /* sample rate mask */
-+
-+#define AD_DS_CCS	0x0c /* chip control/status */
-+#define  AD_DS_CCS_ADO   0x0001 /* ADC channel overflow */
-+#define  AD_DS_CCS_REO   0x0002 /* resampler channel overflow */
-+#define  AD_DS_CCS_SYU   0x0004 /* synthesis channel underflow */
-+#define  AD_DS_CCS_WAU   0x0008 /* wave channel underflow */
-+/* bits 4 -> 7, 9, 11 -> 14 reserved */
-+#define  AD_DS_CCS_XTD   0x0100 /* xtd delay control (4096 clock cycles) */
-+#define  AD_DS_CCS_PDALL 0x0400 /* power */
-+#define  AD_DS_CCS_CLKEN 0x8000 /* clock */
-+
-+#define AD_DMA_RESBA	0x40 /* RES base address */
-+#define AD_DMA_RESCA	0x44 /* RES current address */
-+#define AD_DMA_RESBC	0x48 /* RES base count */
-+#define AD_DMA_RESCC	0x4c /* RES current count */
-+
-+#define AD_DMA_ADCBA	0x50 /* ADC base address */
-+#define AD_DMA_ADCCA	0x54 /* ADC current address */
-+#define AD_DMA_ADCBC	0x58 /* ADC base count */
-+#define AD_DMA_ADCCC	0x5c /* ADC current count */
-+
-+#define AD_DMA_SYNBA	0x60 /* synth base address */
-+#define AD_DMA_SYNCA	0x64 /* synth current address */
-+#define AD_DMA_SYNBC	0x68 /* synth base count */
-+#define AD_DMA_SYNCC	0x6c /* synth current count */
-+
-+#define AD_DMA_WAVBA	0x70 /* wave base address */
-+#define AD_DMA_WAVCA	0x74 /* wave current address */
-+#define AD_DMA_WAVBC	0x78 /* wave base count */
-+#define AD_DMA_WAVCC	0x7c /* wave current count */
-+
-+#define AD_DMA_RESIC	0x80 /* RES dma interrupt current byte count */
-+#define AD_DMA_RESIB	0x84 /* RES dma interrupt base byte count */
-+
-+#define AD_DMA_ADCIC	0x88 /* ADC dma interrupt current byte count */
-+#define AD_DMA_ADCIB	0x8c /* ADC dma interrupt base byte count */
-+
-+#define AD_DMA_SYNIC	0x90 /* synth dma interrupt current byte count */
-+#define AD_DMA_SYNIB	0x94 /* synth dma interrupt base byte count */
-+
-+#define AD_DMA_WAVIC	0x98 /* wave dma interrupt current byte count */
-+#define AD_DMA_WAVIB	0x9c /* wave dma interrupt base byte count */
-+
-+#define  AD_DMA_ICC	0xffffff /* current byte count mask */
-+#define  AD_DMA_IBC	0xffffff /* base byte count mask */
-+/* bits 24 -> 31 reserved */
-+
-+/* 4 bytes pad */
-+#define AD_DMA_ADC	0xa8	/* ADC      dma control and status */
-+#define AD_DMA_SYNTH	0xb0	/* Synth    dma control and status */
-+#define AD_DMA_WAV	0xb8	/* wave     dma control and status */
-+#define AD_DMA_RES	0xa0	/* Resample dma control and status */
-+
-+#define  AD_DMA_SGDE	0x0001 /* SGD mode enable */
-+#define  AD_DMA_LOOP	0x0002 /* loop enable */
-+#define  AD_DMA_IM	0x000c /* interrupt mode mask */
-+#define  AD_DMA_IM_DIS	(~AD_DMA_IM)	/* disable */
-+#define  AD_DMA_IM_CNT	0x0004 /* interrupt on count */
-+#define  AD_DMA_IM_SGD	0x0008 /* interrupt on SGD flag */
-+#define  AD_DMA_IM_EOL	0x000c /* interrupt on End of Linked List */
-+#define  AD_DMA_SGDS	0x0030 /* SGD status */
-+#define  AD_DMA_SFLG	0x0040 /* SGD flag */
-+#define  AD_DMA_EOL	0x0080 /* SGD end of list */
-+/* bits 8 -> 15 reserved */
-+
-+#define AD_DMA_DISR	0xc0 /* dma interrupt status */
-+#define  AD_DMA_DISR_RESI 0x000001 /* resampler channel interrupt */
-+#define  AD_DMA_DISR_ADCI 0x000002 /* ADC channel interrupt */
-+#define  AD_DMA_DISR_SYNI 0x000004 /* synthesis channel interrupt */
-+#define  AD_DMA_DISR_WAVI 0x000008 /* wave channel interrupt */
-+/* bits 4, 5 reserved */
-+#define  AD_DMA_DISR_SEPS 0x000040 /* serial eeprom status */
-+/* bits 7 -> 13 reserved */
-+#define  AD_DMA_DISR_PMAI 0x004000 /* pci master abort interrupt */
-+#define  AD_DMA_DISR_PTAI 0x008000 /* pci target abort interrupt */
-+#define  AD_DMA_DISR_PTAE 0x010000 /* pci target abort interrupt enable */
-+#define  AD_DMA_DISR_PMAE 0x020000 /* pci master abort interrupt enable */
-+/* bits 19 -> 31 reserved */
-+
-+/* interrupt mask */
-+#define  AD_INTR_MASK     (AD_DMA_DISR_RESI|AD_DMA_DISR_ADCI| \
-+                           AD_DMA_DISR_WAVI|AD_DMA_DISR_SYNI| \
-+                           AD_DMA_DISR_PMAI|AD_DMA_DISR_PTAI)
-+
-+#define AD_DMA_CHSS	0xc4 /* dma channel stop status */
-+#define  AD_DMA_CHSS_RESS 0x000001 /* resampler channel stopped */
-+#define  AD_DMA_CHSS_ADCS 0x000002 /* ADC channel stopped */
-+#define  AD_DMA_CHSS_SYNS 0x000004 /* synthesis channel stopped */
-+#define  AD_DMA_CHSS_WAVS 0x000008 /* wave channel stopped */
-+
-+#define AD_GPIO_IPC	0xc8	/* gpio port control */
-+#define AD_GPIO_OP	0xca	/* gpio output port status */
-+#define AD_GPIO_IP	0xcc	/* gpio  input port status */
-+
-+#define AD_AC97_BASE	0x100	/* ac97 base register */
-+
-+#define AD_AC97_RESET   0x100   /* reset */
-+
-+#define AD_AC97_PWR_CTL	0x126	/* == AC97_POWERDOWN */
-+#define  AD_AC97_PWR_ADC 0x0001 /* ADC ready status */
-+#define  AD_AC97_PWR_DAC 0x0002 /* DAC ready status */
-+#define  AD_AC97_PWR_PR0 0x0100 /* PR0 (ADC) powerdown */
-+#define  AD_AC97_PWR_PR1 0x0200 /* PR1 (DAC) powerdown */
-+
-+#define AD_MISC_CTL     0x176 /* misc control */
-+#define  AD_MISC_CTL_DACZ   0x8000 /* set for zero fill, unset for repeat */
-+#define  AD_MISC_CTL_ARSR   0x0001 /* set for SR1, unset for SR0 */
-+#define  AD_MISC_CTL_ALSR   0x0100
-+#define  AD_MISC_CTL_DLSR   0x0400
-+#define  AD_MISC_CTL_DRSR   0x0004
-+
-+#define AD_AC97_SR0     0x178 /* sample rate 0, 0xbb80 == 48K */
-+#define  AD_AC97_SR0_48K 0xbb80 /* 48KHz */
-+#define AD_AC97_SR1     0x17a /* sample rate 1 */
-+
-+#define AD_AC97_ACIC	0x180 /* ac97 codec interface control */
-+#define  AD_AC97_ACIC_ACIE  0x0001 /* analog codec interface enable */
-+#define  AD_AC97_ACIC_ACRD  0x0002 /* analog codec reset disable */
-+#define  AD_AC97_ACIC_ASOE  0x0004 /* audio stream output enable */
-+#define  AD_AC97_ACIC_VSRM  0x0008 /* variable sample rate mode */
-+#define  AD_AC97_ACIC_FSDH  0x0100 /* force SDATA_OUT high */
-+#define  AD_AC97_ACIC_FSYH  0x0200 /* force sync high */
-+#define  AD_AC97_ACIC_ACRDY 0x8000 /* analog codec ready status */
-+/* bits 10 -> 14 reserved */
-+
-+
-+#define AD_DS_MEMSIZE	512
-+#define AD_OPL_MEMSIZE	16
-+#define AD_MIDI_MEMSIZE	16
-+
-+#define AD_WAV_STATE	0
-+#define AD_ADC_STATE	1
-+#define AD_MAX_STATES	2
-+
-+/* "<ggg> T-Bone: parisc IOMMU can start DMA at any address.
-+   But the IOMMU can only map at page size granularity."
-+   This affects in particular .period_bytes_min */
-+#define BUF_SIZE        PAGE_SIZE
-+#define MAX_BUFS        32
-+#define DMA_SIZE	(MAX_BUFS*BUF_SIZE)
-+
-+#define AD_CHAN_WAV	0x0001
-+#define AD_CHAN_ADC	0x0002
-+#define AD_CHAN_RES	0x0004
-+#define AD_CHAN_SYN	0x0008
-+
-+#endif /* __AD1889_H__ */

Deleted: dists/trunk/linux-2.4/debian/patches-arch/m68k.diff
===================================================================
--- dists/trunk/linux-2.4/debian/patches-arch/m68k.diff	2005-09-22 09:33:55 UTC (rev 4257)
+++ dists/trunk/linux-2.4/debian/patches-arch/m68k.diff	2005-09-22 09:36:43 UTC (rev 4258)
@@ -1,6009 +0,0 @@
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/Makefile linux-2.6.13/Makefile
---- linux-2.6.13-i386/Makefile	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/Makefile	2005-08-30 16:30:50.000000000 +0200
-@@ -190,7 +190,7 @@
- # Default value for CROSS_COMPILE is not to prefix executables
- # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
- 
--ARCH		?= $(SUBARCH)
-+ARCH		?= m68k
- CROSS_COMPILE	?=
- 
- # Architecture as present in compile.h
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/fpsp040/skeleton.S linux-2.6.13/arch/m68k/fpsp040/skeleton.S
---- linux-2.6.13-i386/arch/m68k/fpsp040/skeleton.S	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/fpsp040/skeleton.S	2005-05-30 16:31:21.000000000 +0200
-@@ -381,10 +381,8 @@
- .Lnotkern:
- 	SAVE_ALL_INT
- 	GET_CURRENT(%d0)
--	tstb	%curptr@(TASK_NEEDRESCHED)
--	jne	ret_from_exception	| deliver signals,
--					| reschedule etc..
--	RESTORE_ALL
-+	| deliver signals, reschedule etc..
-+	jra	ret_from_exception
- 
- |
- |	mem_write --- write to user or supervisor address space
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/ifpsp060/iskeleton.S linux-2.6.13/arch/m68k/ifpsp060/iskeleton.S
---- linux-2.6.13-i386/arch/m68k/ifpsp060/iskeleton.S	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/ifpsp060/iskeleton.S	2005-05-30 16:31:22.000000000 +0200
-@@ -75,10 +75,8 @@
- .Lnotkern:
- 	SAVE_ALL_INT
- 	GET_CURRENT(%d0)
--	tstb	%curptr@(TASK_NEEDRESCHED)
--	jne	ret_from_exception	| deliver signals,
--					| reschedule etc..
--	RESTORE_ALL
-+	| deliver signals, reschedule etc..
-+	jra	ret_from_exception
- 
- |
- | _060_real_chk():
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/kernel/asm-offsets.c linux-2.6.13/arch/m68k/kernel/asm-offsets.c
---- linux-2.6.13-i386/arch/m68k/kernel/asm-offsets.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/kernel/asm-offsets.c	2005-05-30 16:31:22.000000000 +0200
-@@ -25,12 +25,8 @@
- 	DEFINE(TASK_STATE, offsetof(struct task_struct, state));
- 	DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
- 	DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
--	DEFINE(TASK_WORK, offsetof(struct task_struct, thread.work));
--	DEFINE(TASK_NEEDRESCHED, offsetof(struct task_struct, thread.work.need_resched));
--	DEFINE(TASK_SYSCALL_TRACE, offsetof(struct task_struct, thread.work.syscall_trace));
--	DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, thread.work.sigpending));
--	DEFINE(TASK_NOTIFY_RESUME, offsetof(struct task_struct, thread.work.notify_resume));
- 	DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
-+	DEFINE(TASK_INFO, offsetof(struct task_struct, thread.info));
- 	DEFINE(TASK_MM, offsetof(struct task_struct, mm));
- 	DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
- 
-@@ -45,6 +41,10 @@
- 	DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl));
- 	DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate));
- 
-+	/* offsets into the thread_info struct */
-+	DEFINE(TINFO_PREEMPT, offsetof(struct thread_info, preempt_count));
-+	DEFINE(TINFO_FLAGS, offsetof(struct thread_info, flags));
-+
- 	/* offsets into the pt_regs */
- 	DEFINE(PT_D0, offsetof(struct pt_regs, d0));
- 	DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0));
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/kernel/bios32.c linux-2.6.13/arch/m68k/kernel/bios32.c
---- linux-2.6.13-i386/arch/m68k/kernel/bios32.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/kernel/bios32.c	2004-10-20 16:38:00.000000000 +0200
-@@ -285,7 +285,7 @@
- 
- 	DBG_DEVS(("layout_bus: starting bus %d\n", bus->number));
- 
--	if (!bus->devices && !bus->children)
-+	if (list_empty(&bus->devices) && list_empty(&bus->children))
- 		return;
- 
- 	/*
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/kernel/entry.S linux-2.6.13/arch/m68k/kernel/entry.S
---- linux-2.6.13-i386/arch/m68k/kernel/entry.S	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/kernel/entry.S	2005-05-30 16:31:22.000000000 +0200
-@@ -44,9 +44,7 @@
- 
- #include <asm/offsets.h>
- 
--.globl system_call, buserr, trap
--.globl resume, ret_from_exception
--.globl ret_from_signal
-+.globl system_call, buserr, trap, resume
- .globl inthandler, sys_call_table
- .globl sys_fork, sys_clone, sys_vfork
- .globl ret_from_interrupt, bad_interrupt
-@@ -58,7 +56,7 @@
- 	movel	%sp,%sp at -		| stack frame pointer argument
- 	bsrl	buserr_c
- 	addql	#4,%sp
--	jra	ret_from_exception
-+	jra	.Lret_from_exception
- 
- ENTRY(trap)
- 	SAVE_ALL_INT
-@@ -66,7 +64,7 @@
- 	movel	%sp,%sp at -		| stack frame pointer argument
- 	bsrl	trap_c
- 	addql	#4,%sp
--	jra	ret_from_exception
-+	jra	.Lret_from_exception
- 
- 	| After a fork we jump here directly from resume,
- 	| so that %d1 contains the previous task
-@@ -75,30 +73,31 @@
- 	movel	%d1,%sp at -
- 	jsr	schedule_tail
- 	addql	#4,%sp
--	jra	ret_from_exception
-+	jra	.Lret_from_exception
- 
--badsys:
--	movel	#-ENOSYS,%sp@(PT_D0)
--	jra	ret_from_exception
--
--do_trace:
-+do_trace_entry:
- 	movel	#-ENOSYS,%sp@(PT_D0)	| needed for strace
- 	subql	#4,%sp
- 	SAVE_SWITCH_STACK
- 	jbsr	syscall_trace
- 	RESTORE_SWITCH_STACK
- 	addql	#4,%sp
--	movel	%sp@(PT_ORIG_D0),%d1
--	movel	#-ENOSYS,%d0
--	cmpl	#NR_syscalls,%d1
--	jcc	1f
--	jbsr	@(sys_call_table,%d1:l:4)@(0)
--1:	movel	%d0,%sp@(PT_D0)		| save the return value
--	subql	#4,%sp			| dummy return address
-+	movel	%sp@(PT_ORIG_D0),%d0
-+	cmpl	#NR_syscalls,%d0
-+	jcs	syscall
-+badsys:
-+	movel	#-ENOSYS,%sp@(PT_D0)
-+	jra	ret_from_syscall
-+
-+do_trace_exit:
-+	subql	#4,%sp
- 	SAVE_SWITCH_STACK
- 	jbsr	syscall_trace
-+	RESTORE_SWITCH_STACK
-+	addql	#4,%sp
-+	jra	.Lret_from_exception
- 
--ret_from_signal:
-+ENTRY(ret_from_signal)
- 	RESTORE_SWITCH_STACK
- 	addql	#4,%sp
- /* on 68040 complete pending writebacks if any */
-@@ -111,7 +110,7 @@
- 	addql	#4,%sp
- 1:
- #endif
--	jra	ret_from_exception
-+	jra	.Lret_from_exception
- 
- ENTRY(system_call)
- 	SAVE_ALL_SYS
-@@ -120,30 +119,34 @@
- 	| save top of frame
- 	movel	%sp,%curptr@(TASK_THREAD+THREAD_ESP0)
- 
--	tstb	%curptr@(TASK_SYSCALL_TRACE)
--	jne	do_trace
-+	| syscall trace?
-+	tstb	%curptr@(TASK_INFO+TINFO_FLAGS+2)
-+	jmi	do_trace_entry
- 	cmpl	#NR_syscalls,%d0
- 	jcc	badsys
-+syscall:
- 	jbsr	@(sys_call_table,%d0:l:4)@(0)
- 	movel	%d0,%sp@(PT_D0)		| save the return value
--
-+ret_from_syscall:
- 	|oriw	#0x0700,%sr
--	movel	%curptr@(TASK_WORK),%d0
-+	movew	%curptr@(TASK_INFO+TINFO_FLAGS+2),%d0
- 	jne	syscall_exit_work
- 1:	RESTORE_ALL
- 
- syscall_exit_work:
- 	btst	#5,%sp@(PT_SR)		| check if returning to kernel
- 	bnes	1b			| if so, skip resched, signals
--	tstw	%d0
--	jeq	do_signal_return
--	tstb	%d0
--	jne	do_delayed_trace
--
-+	lslw	#1,%d0
-+	jcs	do_trace_exit
-+	jmi	do_delayed_trace
-+	lslw	#8,%d0
-+	jmi	do_signal_return
- 	pea	resume_userspace
--	jmp	schedule
-+	jra	schedule
-+
- 
--ret_from_exception:
-+ENTRY(ret_from_exception)
-+.Lret_from_exception:
- 	btst	#5,%sp@(PT_SR)		| check if returning to kernel
- 	bnes	1f			| if so, skip resched, signals
- 	| only allow interrupts when we are really the last one on the
-@@ -152,19 +155,18 @@
- 	andw	#ALLOWINT,%sr
- 
- resume_userspace:
--	movel	%curptr@(TASK_WORK),%d0
--	lsrl	#8,%d0
-+	moveb	%curptr@(TASK_INFO+TINFO_FLAGS+3),%d0
- 	jne	exit_work
- 1:	RESTORE_ALL
- 
- exit_work:
- 	| save top of frame
- 	movel	%sp,%curptr@(TASK_THREAD+THREAD_ESP0)
--	tstb	%d0
--	jeq	do_signal_return
--
-+	lslb	#1,%d0
-+	jmi	do_signal_return
- 	pea	resume_userspace
--	jmp	schedule
-+	jra	schedule
-+
- 
- do_signal_return:
- 	|andw	#ALLOWINT,%sr
-@@ -254,7 +256,7 @@
- 
- 	/* check if we need to do software interrupts */
- 	tstl	irq_stat+CPUSTAT_SOFTIRQ_PENDING
--	jeq	ret_from_exception
-+	jeq	.Lret_from_exception
- 	pea	ret_from_exception
- 	jra	do_softirq
- 
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/kernel/m68k_ksyms.c linux-2.6.13/arch/m68k/kernel/m68k_ksyms.c
---- linux-2.6.13-i386/arch/m68k/kernel/m68k_ksyms.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/kernel/m68k_ksyms.c	2005-08-30 16:31:36.000000000 +0200
-@@ -74,9 +74,6 @@
- EXPORT_SYMBOL(__ashldi3);
- EXPORT_SYMBOL(__ashrdi3);
- EXPORT_SYMBOL(__lshrdi3);
--EXPORT_SYMBOL(memcpy);
--EXPORT_SYMBOL(memset);
--EXPORT_SYMBOL(memcmp);
- EXPORT_SYMBOL(memscan);
- EXPORT_SYMBOL(__muldi3);
- 
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/kernel/process.c linux-2.6.13/arch/m68k/kernel/process.c
---- linux-2.6.13-i386/arch/m68k/kernel/process.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/kernel/process.c	2005-08-30 16:31:36.000000000 +0200
-@@ -239,7 +239,7 @@
- 	unsigned long stack_offset, *retp;
- 
- 	stack_offset = THREAD_SIZE - sizeof(struct pt_regs);
--	childregs = (struct pt_regs *) ((unsigned long) (p->thread_info) + stack_offset);
-+	childregs = (struct pt_regs *) ((unsigned long)p->stack + stack_offset);
- 
- 	*childregs = *regs;
- 	childregs->d0 = 0;
-@@ -384,7 +384,7 @@
- 	if (!p || p == current || p->state == TASK_RUNNING)
- 		return 0;
- 
--	stack_page = (unsigned long)(p->thread_info);
-+	stack_page = (unsigned long)p->stack;
- 	fp = ((struct switch_stack *)p->thread.ksp)->a6;
- 	do {
- 		if (fp < stack_page+sizeof(struct thread_info) ||
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/kernel/ptrace.c linux-2.6.13/arch/m68k/kernel/ptrace.c
---- linux-2.6.13-i386/arch/m68k/kernel/ptrace.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/kernel/ptrace.c	2005-06-19 16:32:04.000000000 +0200
-@@ -95,7 +95,7 @@
- 	if (regno == PT_USP)
- 		addr = &task->thread.usp;
- 	else if (regno < sizeof(regoff)/sizeof(regoff[0]))
--		addr = (unsigned long *) (task->thread.esp0 + regoff[regno]);
-+		addr = (unsigned long *)(task->thread.esp0 + regoff[regno]);
- 	else
- 		return -1;
- 	*addr = data;
-@@ -103,48 +103,56 @@
- }
- 
- /*
-- * Called by kernel/ptrace.c when detaching..
-- *
-  * Make sure the single step bit is not set.
-  */
--void ptrace_disable(struct task_struct *child)
-+static inline void singlestep_disable(struct task_struct *child)
- {
--	unsigned long tmp;
--	/* make sure the single step bit is not set. */
--	tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
-+	unsigned long tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
- 	put_reg(child, PT_SR, tmp);
--	child->thread.work.delayed_trace = 0;
--	child->thread.work.syscall_trace = 0;
-+	clear_tsk_thread_flag(child, TIF_DELAYED_TRACE);
-+}
-+
-+/*
-+ * Called by kernel/ptrace.c when detaching..
-+ */
-+void ptrace_disable(struct task_struct *child)
-+{
-+	singlestep_disable(child);
-+	clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
- }
- 
- asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
- {
- 	struct task_struct *child;
--	int ret;
-+	unsigned long tmp;
-+	int i, ret = 0;
- 
- 	lock_kernel();
--	ret = -EPERM;
- 	if (request == PTRACE_TRACEME) {
- 		/* are we already being traced? */
--		if (current->ptrace & PT_PTRACED)
-+		if (current->ptrace & PT_PTRACED) {
-+			ret = -EPERM;
- 			goto out;
-+		}
- 		/* set the ptrace bit in the process flags. */
- 		current->ptrace |= PT_PTRACED;
--		ret = 0;
- 		goto out;
- 	}
--	ret = -ESRCH;
- 	read_lock(&tasklist_lock);
- 	child = find_task_by_pid(pid);
- 	if (child)
- 		get_task_struct(child);
- 	read_unlock(&tasklist_lock);
--	if (!child)
-+	if (unlikely(!child)) {
-+		ret = -ESRCH;
- 		goto out;
-+	}
- 
--	ret = -EPERM;
--	if (pid == 1)		/* you may not mess with init */
-+	/* you may not mess with init */
-+	if (unlikely(pid == 1)) {
-+		ret = -EPERM;
- 		goto out_tsk;
-+	}
- 
- 	if (request == PTRACE_ATTACH) {
- 		ret = ptrace_attach(child);
-@@ -152,234 +160,175 @@
- 	}
- 
- 	ret = ptrace_check_attach(child, request == PTRACE_KILL);
--	if (ret < 0)
-+	if (ret)
- 		goto out_tsk;
- 
- 	switch (request) {
- 	/* when I and D space are separate, these will need to be fixed. */
--		case PTRACE_PEEKTEXT: /* read word at location addr. */
--		case PTRACE_PEEKDATA: {
--			unsigned long tmp;
--			int copied;
--
--			copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
--			ret = -EIO;
--			if (copied != sizeof(tmp))
--				break;
--			ret = put_user(tmp,(unsigned long *) data);
--			break;
--		}
-+	case PTRACE_PEEKTEXT:	/* read word at location addr. */
-+	case PTRACE_PEEKDATA:
-+		i = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
-+		if (i != sizeof(tmp))
-+			goto out_eio;
-+		ret = put_user(tmp, (unsigned long *)data);
-+		break;
- 
- 	/* read the word at location addr in the USER area. */
--		case PTRACE_PEEKUSR: {
--			unsigned long tmp;
--
--			ret = -EIO;
--			if ((addr & 3) || addr < 0 ||
--			    addr > sizeof(struct user) - 3)
--				break;
--
--			tmp = 0;  /* Default return condition */
--			addr = addr >> 2; /* temporary hack. */
--			ret = -EIO;
--			if (addr < 19) {
--				tmp = get_reg(child, addr);
--				if (addr == PT_SR)
--					tmp >>= 16;
--			} else if (addr >= 21 && addr < 49) {
--				tmp = child->thread.fp[addr - 21];
--#ifdef CONFIG_M68KFPU_EMU
--				/* Convert internal fpu reg representation
--				 * into long double format
--				 */
--				if (FPU_IS_EMU && (addr < 45) && !(addr % 3))
--					tmp = ((tmp & 0xffff0000) << 15) |
--					      ((tmp & 0x0000ffff) << 16);
--#endif
--			} else
--				break;
--			ret = put_user(tmp,(unsigned long *) data);
--			break;
--		}
--
--      /* when I and D space are separate, this will have to be fixed. */
--		case PTRACE_POKETEXT: /* write the word at location addr. */
--		case PTRACE_POKEDATA:
--			ret = 0;
--			if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
--				break;
--			ret = -EIO;
--			break;
--
--		case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
--			ret = -EIO;
--			if ((addr & 3) || addr < 0 ||
--			    addr > sizeof(struct user) - 3)
--				break;
--
--			addr = addr >> 2; /* temporary hack. */
--
--			if (addr == PT_SR) {
--				data &= SR_MASK;
--				data <<= 16;
--				data |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
--			}
--			if (addr < 19) {
--				if (put_reg(child, addr, data))
--					break;
--				ret = 0;
--				break;
--			}
--			if (addr >= 21 && addr < 48)
--			{
--#ifdef CONFIG_M68KFPU_EMU
--				/* Convert long double format
--				 * into internal fpu reg representation
--				 */
--				if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) {
--					data = (unsigned long)data << 15;
--					data = (data & 0xffff0000) |
--					       ((data & 0x0000ffff) >> 1);
--				}
--#endif
--				child->thread.fp[addr - 21] = data;
--				ret = 0;
--			}
--			break;
--
--		case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
--		case PTRACE_CONT: { /* restart after signal. */
--			long tmp;
--
--			ret = -EIO;
--			if (!valid_signal(data))
--				break;
--			if (request == PTRACE_SYSCALL) {
--					child->thread.work.syscall_trace = ~0;
--			} else {
--					child->thread.work.syscall_trace = 0;
--			}
--			child->exit_code = data;
--			/* make sure the single step bit is not set. */
--			tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
--			put_reg(child, PT_SR, tmp);
--			child->thread.work.delayed_trace = 0;
--			wake_up_process(child);
--			ret = 0;
--			break;
--		}
--
--/*
-- * make the child exit.  Best I can do is send it a sigkill.
-- * perhaps it should be put in the status that it wants to
-- * exit.
-- */
--		case PTRACE_KILL: {
--			long tmp;
--
--			ret = 0;
--			if (child->exit_state == EXIT_ZOMBIE) /* already dead */
--				break;
--			child->exit_code = SIGKILL;
--	/* make sure the single step bit is not set. */
--			tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
--			put_reg(child, PT_SR, tmp);
--			child->thread.work.delayed_trace = 0;
--			wake_up_process(child);
--			break;
--		}
--
--		case PTRACE_SINGLESTEP: {  /* set the trap flag. */
--			long tmp;
--
--			ret = -EIO;
--			if (!valid_signal(data))
--				break;
--			child->thread.work.syscall_trace = 0;
--			tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
--			put_reg(child, PT_SR, tmp);
--			child->thread.work.delayed_trace = 1;
--
--			child->exit_code = data;
--	/* give it a chance to run. */
--			wake_up_process(child);
--			ret = 0;
--			break;
--		}
-+	case PTRACE_PEEKUSR:
-+		if (addr & 3)
-+			goto out_eio;
-+		addr >>= 2;	/* temporary hack. */
-+
-+		if (addr >= 0 && addr < 19) {
-+			tmp = get_reg(child, addr);
-+			if (addr == PT_SR)
-+				tmp >>= 16;
-+		} else if (addr >= 21 && addr < 49) {
-+			tmp = child->thread.fp[addr - 21];
-+			/* Convert internal fpu reg representation
-+			 * into long double format
-+			 */
-+			if (FPU_IS_EMU && (addr < 45) && !(addr % 3))
-+				tmp = ((tmp & 0xffff0000) << 15) |
-+				      ((tmp & 0x0000ffff) << 16);
-+		} else
-+			break;
-+		ret = put_user(tmp, (unsigned long *)data);
-+		break;
-+
-+	/* when I and D space are separate, this will have to be fixed. */
-+	case PTRACE_POKETEXT:	/* write the word at location addr. */
-+	case PTRACE_POKEDATA:
-+		if (access_process_vm(child, addr, &data, sizeof(data), 1) != sizeof(data))
-+			goto out_eio;
-+		break;
-+
-+	case PTRACE_POKEUSR:	/* write the word at location addr in the USER area */
-+		if (addr & 3)
-+			goto out_eio;
-+		addr >>= 2;	/* temporary hack. */
-+
-+		if (addr == PT_SR) {
-+			data &= SR_MASK;
-+			data <<= 16;
-+			data |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
-+		} else if (addr >= 0 && addr < 19) {
-+			if (put_reg(child, addr, data))
-+				goto out_eio;
-+		} else if (addr >= 21 && addr < 48) {
-+			/* Convert long double format
-+			 * into internal fpu reg representation
-+			 */
-+			if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) {
-+				data = (unsigned long)data << 15;
-+				data = (data & 0xffff0000) |
-+				       ((data & 0x0000ffff) >> 1);
-+			}
-+			child->thread.fp[addr - 21] = data;
-+		} else
-+			goto out_eio;
-+		break;
-+
-+	case PTRACE_SYSCALL:	/* continue and stop at next (return from) syscall */
-+	case PTRACE_CONT:	/* restart after signal. */
-+		if (!valid_signal(data))
-+			goto out_eio;
-+
-+		if (request == PTRACE_SYSCALL)
-+			set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-+		else
-+			clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-+		child->exit_code = data;
-+		singlestep_disable(child);
-+		wake_up_process(child);
-+		break;
- 
--		case PTRACE_DETACH:	/* detach a process that was attached. */
--			ret = ptrace_detach(child, data);
-+	/*
-+	 * make the child exit.  Best I can do is send it a sigkill.
-+	 * perhaps it should be put in the status that it wants to
-+	 * exit.
-+	 */
-+	case PTRACE_KILL:
-+		if (child->exit_state == EXIT_ZOMBIE) /* already dead */
- 			break;
--
--		case PTRACE_GETREGS: { /* Get all gp regs from the child. */
--			int i;
--			unsigned long tmp;
--			for (i = 0; i < 19; i++) {
--			    tmp = get_reg(child, i);
--			    if (i == PT_SR)
-+		child->exit_code = SIGKILL;
-+		singlestep_disable(child);
-+		wake_up_process(child);
-+		break;
-+
-+	case PTRACE_SINGLESTEP:	/* set the trap flag. */
-+		if (!valid_signal(data))
-+			goto out_eio;
-+
-+		clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-+		tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
-+		put_reg(child, PT_SR, tmp);
-+		set_tsk_thread_flag(child, TIF_DELAYED_TRACE);
-+
-+		child->exit_code = data;
-+		/* give it a chance to run. */
-+		wake_up_process(child);
-+		break;
-+
-+	case PTRACE_DETACH:	/* detach a process that was attached. */
-+		ret = ptrace_detach(child, data);
-+		break;
-+
-+	case PTRACE_GETREGS:	/* Get all gp regs from the child. */
-+		for (i = 0; i < 19; i++) {
-+			tmp = get_reg(child, i);
-+			if (i == PT_SR)
- 				tmp >>= 16;
--			    if (put_user(tmp, (unsigned long *) data)) {
--				ret = -EFAULT;
-+			ret = put_user(tmp, (unsigned long *)data);
-+			if (ret)
- 				break;
--			    }
--			    data += sizeof(long);
--			}
--			ret = 0;
--			break;
-+			data += sizeof(long);
- 		}
-+		break;
- 
--		case PTRACE_SETREGS: { /* Set all gp regs in the child. */
--			int i;
--			unsigned long tmp;
--			for (i = 0; i < 19; i++) {
--			    if (get_user(tmp, (unsigned long *) data)) {
--				ret = -EFAULT;
-+	case PTRACE_SETREGS:	/* Set all gp regs in the child. */
-+		for (i = 0; i < 19; i++) {
-+			ret = get_user(tmp, (unsigned long *)data);
-+			if (ret)
- 				break;
--			    }
--			    if (i == PT_SR) {
-+			if (i == PT_SR) {
- 				tmp &= SR_MASK;
- 				tmp <<= 16;
- 				tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
--			    }
--			    put_reg(child, i, tmp);
--			    data += sizeof(long);
- 			}
--			ret = 0;
--			break;
--		}
--
--		case PTRACE_GETFPREGS: { /* Get the child FPU state. */
--			ret = 0;
--			if (copy_to_user((void *)data, &child->thread.fp,
--					 sizeof(struct user_m68kfp_struct)))
--				ret = -EFAULT;
--			break;
-+			put_reg(child, i, tmp);
-+			data += sizeof(long);
- 		}
-+		break;
- 
--		case PTRACE_SETFPREGS: { /* Set the child FPU state. */
--			ret = 0;
--			if (copy_from_user(&child->thread.fp, (void *)data,
--					   sizeof(struct user_m68kfp_struct)))
--				ret = -EFAULT;
--			break;
--		}
--
--		default:
--			ret = ptrace_request(child, request, addr, data);
--			break;
-+	case PTRACE_GETFPREGS:	/* Get the child FPU state. */
-+		if (copy_to_user((void *)data, &child->thread.fp,
-+				 sizeof(struct user_m68kfp_struct)))
-+			ret = -EFAULT;
-+		break;
-+
-+	case PTRACE_SETFPREGS:	/* Set the child FPU state. */
-+		if (copy_from_user(&child->thread.fp, (void *)data,
-+				   sizeof(struct user_m68kfp_struct)))
-+			ret = -EFAULT;
-+		break;
-+
-+	default:
-+		ret = ptrace_request(child, request, addr, data);
-+		break;
- 	}
- out_tsk:
- 	put_task_struct(child);
- out:
- 	unlock_kernel();
- 	return ret;
-+out_eio:
-+	ret = -EIO;
-+	goto out_tsk;
- }
- 
- asmlinkage void syscall_trace(void)
- {
--	if (!current->thread.work.delayed_trace &&
--	    !current->thread.work.syscall_trace)
--		return;
- 	ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
- 				 ? 0x80 : 0));
- 	/*
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/lib/Makefile linux-2.6.13/arch/m68k/lib/Makefile
---- linux-2.6.13-i386/arch/m68k/lib/Makefile	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/lib/Makefile	2005-08-30 16:31:36.000000000 +0200
-@@ -5,4 +5,4 @@
- EXTRA_AFLAGS := -traditional
- 
- lib-y		:= ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
--			checksum.o memcmp.o memcpy.o memset.o semaphore.o
-+			checksum.o string.o semaphore.o
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/lib/memcmp.c linux-2.6.13/arch/m68k/lib/memcmp.c
---- linux-2.6.13-i386/arch/m68k/lib/memcmp.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/lib/memcmp.c	1970-01-01 01:00:00.000000000 +0100
-@@ -1,11 +0,0 @@
--#include <linux/types.h>
--
--int memcmp(const void * cs,const void * ct,size_t count)
--{
--  const unsigned char *su1, *su2;
--
--  for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
--    if (*su1 != *su2)
--      return((*su1 < *su2) ? -1 : +1);
--  return(0);
--}
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/lib/memcpy.c linux-2.6.13/arch/m68k/lib/memcpy.c
---- linux-2.6.13-i386/arch/m68k/lib/memcpy.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/lib/memcpy.c	1970-01-01 01:00:00.000000000 +0100
-@@ -1,75 +0,0 @@
--#include <linux/types.h>
--
--void * memcpy(void * to, const void * from, size_t n)
--{
--  void *xto = to;
--  size_t temp, temp1;
--
--  if (!n)
--    return xto;
--  if ((long) to & 1)
--    {
--      char *cto = to;
--      const char *cfrom = from;
--      *cto++ = *cfrom++;
--      to = cto;
--      from = cfrom;
--      n--;
--    }
--  if (n > 2 && (long) to & 2)
--    {
--      short *sto = to;
--      const short *sfrom = from;
--      *sto++ = *sfrom++;
--      to = sto;
--      from = sfrom;
--      n -= 2;
--    }
--  temp = n >> 2;
--  if (temp)
--    {
--      long *lto = to;
--      const long *lfrom = from;
--
--      __asm__ __volatile__("movel %2,%3\n\t"
--			   "andw  #7,%3\n\t"
--			   "lsrl  #3,%2\n\t"
--			   "negw  %3\n\t"
--			   "jmp   %%pc@(1f,%3:w:2)\n\t"
--			   "4:\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "movel %0 at +,%1 at +\n\t"
--			   "1:\t"
--			   "dbra  %2,4b\n\t"
--			   "clrw  %2\n\t"
--			   "subql #1,%2\n\t"
--			   "jpl   4b\n\t"
--			   : "=a" (lfrom), "=a" (lto), "=d" (temp),
--			   "=&d" (temp1)
--			   : "0" (lfrom), "1" (lto), "2" (temp)
--			   );
--      to = lto;
--      from = lfrom;
--    }
--  if (n & 2)
--    {
--      short *sto = to;
--      const short *sfrom = from;
--      *sto++ = *sfrom++;
--      to = sto;
--      from = sfrom;
--    }
--  if (n & 1)
--    {
--      char *cto = to;
--      const char *cfrom = from;
--      *cto = *cfrom;
--    }
--  return xto;
--}
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/lib/memset.c linux-2.6.13/arch/m68k/lib/memset.c
---- linux-2.6.13-i386/arch/m68k/lib/memset.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/lib/memset.c	1970-01-01 01:00:00.000000000 +0100
-@@ -1,68 +0,0 @@
--#include <linux/types.h>
--
--void * memset(void * s, int c, size_t count)
--{
--  void *xs = s;
--  size_t temp, temp1;
--
--  if (!count)
--    return xs;
--  c &= 0xff;
--  c |= c << 8;
--  c |= c << 16;
--  if ((long) s & 1)
--    {
--      char *cs = s;
--      *cs++ = c;
--      s = cs;
--      count--;
--    }
--  if (count > 2 && (long) s & 2)
--    {
--      short *ss = s;
--      *ss++ = c;
--      s = ss;
--      count -= 2;
--    }
--  temp = count >> 2;
--  if (temp)
--    {
--      long *ls = s;
--
--      __asm__ __volatile__("movel %1,%2\n\t"
--			   "andw  #7,%2\n\t"
--			   "lsrl  #3,%1\n\t"
--			   "negw  %2\n\t"
--			   "jmp   %%pc@(2f,%2:w:2)\n\t"
--			   "1:\t"
--			   "movel %3,%0 at +\n\t"
--			   "movel %3,%0 at +\n\t"
--			   "movel %3,%0 at +\n\t"
--			   "movel %3,%0 at +\n\t"
--			   "movel %3,%0 at +\n\t"
--			   "movel %3,%0 at +\n\t"
--			   "movel %3,%0 at +\n\t"
--			   "movel %3,%0 at +\n\t"
--			   "2:\t"
--			   "dbra  %1,1b\n\t"
--			   "clrw  %1\n\t"
--			   "subql #1,%1\n\t"
--			   "jpl   1b\n\t"
--			   : "=a" (ls), "=d" (temp), "=&d" (temp1)
--			   : "d" (c), "0" (ls), "1" (temp)
--			   );
--      s = ls;
--    }
--  if (count & 2)
--    {
--      short *ss = s;
--      *ss++ = c;
--      s = ss;
--    }
--  if (count & 1)
--    {
--      char *cs = s;
--      *cs = c;
--    }
--  return xs;
--}
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/lib/string.c linux-2.6.13/arch/m68k/lib/string.c
---- linux-2.6.13-i386/arch/m68k/lib/string.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.13/arch/m68k/lib/string.c	2005-08-30 13:26:30.000000000 +0200
-@@ -0,0 +1,237 @@
-+
-+#include <linux/types.h>
-+#include <linux/module.h>
-+
-+void *memset(void *s, int c, size_t count)
-+{
-+	void *xs = s;
-+	size_t temp, temp1;
-+
-+	if (!count)
-+		return xs;
-+	c &= 0xff;
-+	c |= c << 8;
-+	c |= c << 16;
-+	if ((long)s & 1) {
-+		char *cs = s;
-+		*cs++ = c;
-+		s = cs;
-+		count--;
-+	}
-+	if (count > 2 && (long)s & 2) {
-+		short *ss = s;
-+		*ss++ = c;
-+		s = ss;
-+		count -= 2;
-+	}
-+	temp = count >> 2;
-+	if (temp) {
-+		long *ls = s;
-+
-+		asm volatile (
-+			"	movel %1,%2\n"
-+			"	andw  #7,%2\n"
-+			"	lsrl  #3,%1\n"
-+			"	negw  %2\n"
-+			"	jmp   %%pc@(2f,%2:w:2)\n"
-+			"1:	movel %3,%0 at +\n"
-+			"	movel %3,%0 at +\n"
-+			"	movel %3,%0 at +\n"
-+			"	movel %3,%0 at +\n"
-+			"	movel %3,%0 at +\n"
-+			"	movel %3,%0 at +\n"
-+			"	movel %3,%0 at +\n"
-+			"	movel %3,%0 at +\n"
-+			"2:	dbra  %1,1b\n"
-+			"	clrw  %1\n"
-+			"	subql #1,%1\n"
-+			"	jpl   1b"
-+			: "=a" (ls), "=d" (temp), "=&d" (temp1)
-+			: "d" (c), "0" (ls), "1" (temp));
-+		s = ls;
-+	}
-+	if (count & 2) {
-+		short *ss = s;
-+		*ss++ = c;
-+		s = ss;
-+	}
-+	if (count & 1) {
-+		char *cs = s;
-+		*cs = c;
-+	}
-+	return xs;
-+}
-+EXPORT_SYMBOL(memset);
-+
-+void *memcpy(void *to, const void *from, size_t n)
-+{
-+	void *xto = to;
-+	size_t temp, temp1;
-+
-+	if (!n)
-+		return xto;
-+	if ((long)to & 1) {
-+		char *cto = to;
-+		const char *cfrom = from;
-+		*cto++ = *cfrom++;
-+		to = cto;
-+		from = cfrom;
-+		n--;
-+	}
-+	if (n > 2 && (long)to & 2) {
-+		short *sto = to;
-+		const short *sfrom = from;
-+		*sto++ = *sfrom++;
-+		to = sto;
-+		from = sfrom;
-+		n -= 2;
-+	}
-+	temp = n >> 2;
-+	if (temp) {
-+		long *lto = to;
-+		const long *lfrom = from;
-+
-+		asm volatile (
-+			"	movel %2,%3\n"
-+			"	andw  #7,%3\n"
-+			"	lsrl  #3,%2\n"
-+			"	negw  %3\n"
-+			"	jmp   %%pc@(1f,%3:w:2)\n"
-+			"4:	movel %0 at +,%1 at +\n"
-+			"	movel %0 at +,%1 at +\n"
-+			"	movel %0 at +,%1 at +\n"
-+			"	movel %0 at +,%1 at +\n"
-+			"	movel %0 at +,%1 at +\n"
-+			"	movel %0 at +,%1 at +\n"
-+			"	movel %0 at +,%1 at +\n"
-+			"	movel %0 at +,%1 at +\n"
-+			"1:	dbra  %2,4b\n"
-+			"	clrw  %2\n"
-+			"	subql #1,%2\n"
-+			"	jpl   4b"
-+			: "=a" (lfrom), "=a" (lto), "=d" (temp), "=&d" (temp1)
-+			: "0" (lfrom), "1" (lto), "2" (temp));
-+		to = lto;
-+		from = lfrom;
-+	}
-+	if (n & 2) {
-+		short *sto = to;
-+		const short *sfrom = from;
-+		*sto++ = *sfrom++;
-+		to = sto;
-+		from = sfrom;
-+	}
-+	if (n & 1) {
-+		char *cto = to;
-+		const char *cfrom = from;
-+		*cto = *cfrom;
-+	}
-+	return xto;
-+}
-+EXPORT_SYMBOL(memcpy);
-+
-+void *memmove(void *dest, const void *src, size_t n)
-+{
-+	void *xdest = dest;
-+	size_t temp;
-+
-+	if (!n)
-+		return xdest;
-+
-+	if (dest < src) {
-+		if ((long)dest & 1) {
-+			char *cdest = dest;
-+			const char *csrc = src;
-+			*cdest++ = *csrc++;
-+			dest = cdest;
-+			src = csrc;
-+			n--;
-+		}
-+		if (n > 2 && (long)dest & 2) {
-+			short *sdest = dest;
-+			const short *ssrc = src;
-+			*sdest++ = *ssrc++;
-+			dest = sdest;
-+			src = ssrc;
-+			n -= 2;
-+		}
-+		temp = n >> 2;
-+		if (temp) {
-+			long *ldest = dest;
-+			const long *lsrc = src;
-+			temp--;
-+			do
-+				*ldest++ = *lsrc++;
-+			while (temp--);
-+			dest = ldest;
-+			src = lsrc;
-+		}
-+		if (n & 2) {
-+			short *sdest = dest;
-+			const short *ssrc = src;
-+			*sdest++ = *ssrc++;
-+			dest = sdest;
-+			src = ssrc;
-+		}
-+		if (n & 1) {
-+			char *cdest = dest;
-+			const char *csrc = src;
-+			*cdest = *csrc;
-+		}
-+	} else {
-+		dest = (char *)dest + n;
-+		src = (const char *)src + n;
-+		if ((long)dest & 1) {
-+			char *cdest = dest;
-+			const char *csrc = src;
-+			*--cdest = *--csrc;
-+			dest = cdest;
-+			src = csrc;
-+			n--;
-+		}
-+		if (n > 2 && (long)dest & 2) {
-+			short *sdest = dest;
-+			const short *ssrc = src;
-+			*--sdest = *--ssrc;
-+			dest = sdest;
-+			src = ssrc;
-+			n -= 2;
-+		}
-+		temp = n >> 2;
-+		if (temp) {
-+			long *ldest = dest;
-+			const long *lsrc = src;
-+			temp--;
-+			do
-+				*--ldest = *--lsrc;
-+			while (temp--);
-+			dest = ldest;
-+			src = lsrc;
-+		}
-+		if (n & 2) {
-+			short *sdest = dest;
-+			const short *ssrc = src;
-+			*--sdest = *--ssrc;
-+			dest = sdest;
-+			src = ssrc;
-+		}
-+		if (n & 1) {
-+			char *cdest = dest;
-+			const char *csrc = src;
-+			*--cdest = *--csrc;
-+		}
-+	}
-+	return xdest;
-+}
-+EXPORT_SYMBOL(memmove);
-+
-+int memcmp(const void *cs, const void *ct, size_t count)
-+{
-+	const unsigned char *su1, *su2;
-+
-+	for (su1 = cs, su2 = ct; count > 0; ++su1, ++su2, count--)
-+		if (*su1 != *su2)
-+			return *su1 < *su2 ? -1 : +1;
-+	return 0;
-+}
-+EXPORT_SYMBOL(memcmp);
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/mm/Makefile linux-2.6.13/arch/m68k/mm/Makefile
---- linux-2.6.13-i386/arch/m68k/mm/Makefile	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/mm/Makefile	2004-02-06 14:59:40.000000000 +0100
-@@ -2,7 +2,7 @@
- # Makefile for the linux m68k-specific parts of the memory manager.
- #
- 
--obj-y		:= init.o fault.o hwtest.o
-+obj-y		:= cache.o init.o fault.o hwtest.o
- 
- obj-$(CONFIG_MMU_MOTOROLA)	+= kmap.o memory.o motorola.o
- obj-$(CONFIG_MMU_SUN3)		+= sun3kmap.o sun3mmu.o
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/mm/cache.c linux-2.6.13/arch/m68k/mm/cache.c
---- linux-2.6.13-i386/arch/m68k/mm/cache.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.13/arch/m68k/mm/cache.c	2005-08-30 16:31:37.000000000 +0200
-@@ -0,0 +1,118 @@
-+/*
-+ *  linux/arch/m68k/mm/cache.c
-+ *
-+ *  Instruction cache handling
-+ *
-+ *  Copyright (C) 1995  Hamish Macdonald
-+ */
-+
-+#include <linux/module.h>
-+#include <asm/pgalloc.h>
-+#include <asm/traps.h>
-+
-+
-+static unsigned long virt_to_phys_slow(unsigned long vaddr)
-+{
-+	if (CPU_IS_060) {
-+		unsigned long paddr;
-+
-+		/* The PLPAR instruction causes an access error if the translation
-+		 * is not possible. To catch this we use the same exception mechanism
-+		 * as for user space accesses in <asm/uaccess.h>. */
-+		asm volatile (".chip 68060\n"
-+			      "1: plpar (%0)\n"
-+			      ".chip 68k\n"
-+			      "2:\n"
-+			      ".section .fixup,\"ax\"\n"
-+			      "   .even\n"
-+			      "3: sub.l %0,%0\n"
-+			      "   jra 2b\n"
-+			      ".previous\n"
-+			      ".section __ex_table,\"a\"\n"
-+			      "   .align 4\n"
-+			      "   .long 1b,3b\n"
-+			      ".previous"
-+			      : "=a" (paddr)
-+			      : "0" (vaddr));
-+		return paddr;
-+	} else if (CPU_IS_040) {
-+		unsigned long mmusr;
-+
-+		asm volatile (".chip 68040\n\t"
-+			      "ptestr (%1)\n\t"
-+			      "movec %%mmusr, %0\n\t"
-+			      ".chip 68k"
-+			      : "=r" (mmusr)
-+			      : "a" (vaddr));
-+
-+		if (mmusr & MMU_R_040)
-+			return (mmusr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
-+	} else {
-+		unsigned short mmusr;
-+		unsigned long *descaddr;
-+
-+		asm volatile ("ptestr %3,%2@,#7,%0\n\t"
-+			      "pmove %%psr,%1@"
-+			      : "=a&" (descaddr)
-+			      : "a" (&mmusr), "a" (vaddr), "d" (get_fs().seg));
-+		if (mmusr & (MMU_I|MMU_B|MMU_L))
-+			return 0;
-+		descaddr = phys_to_virt((unsigned long)descaddr);
-+		switch (mmusr & MMU_NUM) {
-+		case 1:
-+			return (*descaddr & 0xfe000000) | (vaddr & 0x01ffffff);
-+		case 2:
-+			return (*descaddr & 0xfffc0000) | (vaddr & 0x0003ffff);
-+		case 3:
-+			return (*descaddr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
-+		}
-+	}
-+	return 0;
-+}
-+
-+/* Push n pages at kernel virtual address and clear the icache */
-+/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
-+void flush_icache_range(unsigned long address, unsigned long endaddr)
-+{
-+
-+	if (CPU_IS_040_OR_060) {
-+		address &= PAGE_MASK;
-+
-+		do {
-+			asm volatile ("nop\n\t"
-+				      ".chip 68040\n\t"
-+				      "cpushp %%bc,(%0)\n\t"
-+				      ".chip 68k"
-+				      : : "a" (virt_to_phys_slow(address)));
-+			address += PAGE_SIZE;
-+		} while (address < endaddr);
-+	} else {
-+		unsigned long tmp;
-+		asm volatile ("movec %%cacr,%0\n\t"
-+			      "orw %1,%0\n\t"
-+			      "movec %0,%%cacr"
-+			      : "=&d" (tmp)
-+			      : "di" (FLUSH_I));
-+	}
-+}
-+EXPORT_SYMBOL(flush_icache_range);
-+
-+void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
-+			     unsigned long addr, int len)
-+{
-+	if (CPU_IS_040_OR_060) {
-+		asm volatile ("nop\n\t"
-+			      ".chip 68040\n\t"
-+			      "cpushp %%bc,(%0)\n\t"
-+			      ".chip 68k"
-+			      : : "a" (page_to_phys(page)));
-+	} else {
-+		unsigned long tmp;
-+		asm volatile ("movec %%cacr,%0\n\t"
-+			      "orw %1,%0\n\t"
-+			      "movec %0,%%cacr"
-+			      : "=&d" (tmp)
-+			      : "di" (FLUSH_I));
-+	}
-+}
-+
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/arch/m68k/mm/memory.c linux-2.6.13/arch/m68k/mm/memory.c
---- linux-2.6.13-i386/arch/m68k/mm/memory.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/arch/m68k/mm/memory.c	2004-10-03 16:35:42.000000000 +0200
-@@ -354,110 +354,6 @@
- #endif
- }
- 
--static unsigned long virt_to_phys_slow(unsigned long vaddr)
--{
--	if (CPU_IS_060) {
--		mm_segment_t fs = get_fs();
--		unsigned long paddr;
--
--		set_fs(get_ds());
--
--		/* The PLPAR instruction causes an access error if the translation
--		 * is not possible. To catch this we use the same exception mechanism
--		 * as for user space accesses in <asm/uaccess.h>. */
--		asm volatile (".chip 68060\n"
--			      "1: plpar (%0)\n"
--			      ".chip 68k\n"
--			      "2:\n"
--			      ".section .fixup,\"ax\"\n"
--			      "   .even\n"
--			      "3: sub.l %0,%0\n"
--			      "   jra 2b\n"
--			      ".previous\n"
--			      ".section __ex_table,\"a\"\n"
--			      "   .align 4\n"
--			      "   .long 1b,3b\n"
--			      ".previous"
--			      : "=a" (paddr)
--			      : "0" (vaddr));
--		set_fs(fs);
--		return paddr;
--	} else if (CPU_IS_040) {
--		mm_segment_t fs = get_fs();
--		unsigned long mmusr;
--
--		set_fs(get_ds());
--
--		asm volatile (".chip 68040\n\t"
--			      "ptestr (%1)\n\t"
--			      "movec %%mmusr, %0\n\t"
--			      ".chip 68k"
--			      : "=r" (mmusr)
--			      : "a" (vaddr));
--		set_fs(fs);
--
--		if (mmusr & MMU_R_040)
--			return (mmusr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
--	} else {
--		unsigned short mmusr;
--		unsigned long *descaddr;
--
--		asm volatile ("ptestr #5,%2@,#7,%0\n\t"
--			      "pmove %%psr,%1@"
--			      : "=a&" (descaddr)
--			      : "a" (&mmusr), "a" (vaddr));
--		if (mmusr & (MMU_I|MMU_B|MMU_L))
--			return 0;
--		descaddr = phys_to_virt((unsigned long)descaddr);
--		switch (mmusr & MMU_NUM) {
--		case 1:
--			return (*descaddr & 0xfe000000) | (vaddr & 0x01ffffff);
--		case 2:
--			return (*descaddr & 0xfffc0000) | (vaddr & 0x0003ffff);
--		case 3:
--			return (*descaddr & PAGE_MASK) | (vaddr & ~PAGE_MASK);
--		}
--	}
--	return 0;
--}
--
--/* Push n pages at kernel virtual address and clear the icache */
--/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
--void flush_icache_range(unsigned long address, unsigned long endaddr)
--{
--	if (CPU_IS_040_OR_060) {
--		address &= PAGE_MASK;
--
--		if (address >= PAGE_OFFSET && address < (unsigned long)high_memory) {
--			do {
--				asm volatile ("nop\n\t"
--					      ".chip 68040\n\t"
--					      "cpushp %%bc,(%0)\n\t"
--					      ".chip 68k"
--					      : : "a" (virt_to_phys((void *)address)));
--				address += PAGE_SIZE;
--			} while (address < endaddr);
--		} else {
--			do {
--				asm volatile ("nop\n\t"
--					      ".chip 68040\n\t"
--					      "cpushp %%bc,(%0)\n\t"
--					      ".chip 68k"
--					      : : "a" (virt_to_phys_slow(address)));
--				address += PAGE_SIZE;
--			} while (address < endaddr);
--		}
--	} else {
--		unsigned long tmp;
--		asm volatile ("movec %%cacr,%0\n\t"
--			      "orw %1,%0\n\t"
--			      "movec %0,%%cacr"
--			      : "=&d" (tmp)
--			      : "di" (FLUSH_I));
--	}
--}
--
--
- #ifndef CONFIG_SINGLE_MEMORY_CHUNK
- int mm_end_of_chunk (unsigned long addr, int len)
- {
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/block/swim3.c linux-2.6.13/drivers/block/swim3.c
---- linux-2.6.13-i386/drivers/block/swim3.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/block/swim3.c	2005-08-30 16:32:28.000000000 +0200
-@@ -304,7 +304,7 @@
- #endif /* CONFIG_PMAC_MEDIABAY */
- 		start_request(&floppy_states[i]);
- 	}
--	sti();
-+	local_irq_enable();
- }
- 
- static void start_request(struct floppy_state *fs)
-@@ -370,7 +370,7 @@
- {
- 	unsigned long flags;
- 
--	save_flags(flags); cli();
-+	local_irq_save(flags);
- 	if (fs->timeout_pending)
- 		del_timer(&fs->timeout);
- 	fs->timeout.expires = jiffies + nticks;
-@@ -378,7 +378,7 @@
- 	fs->timeout.data = (unsigned long) fs;
- 	add_timer(&fs->timeout);
- 	fs->timeout_pending = 1;
--	restore_flags(flags);
-+	local_irq_restore(flags);
- }
- 
- static inline void scan_track(struct floppy_state *fs)
-@@ -790,14 +790,13 @@
- {
- 	unsigned long flags;
- 
--	save_flags(flags);
--	cli();
-+	local_irq_save(flags);
- 	if (fs->state != idle) {
- 		++fs->wanted;
- 		while (fs->state != available) {
- 			if (interruptible && signal_pending(current)) {
- 				--fs->wanted;
--				restore_flags(flags);
-+				local_irq_restore(flags);
- 				return -EINTR;
- 			}
- 			interruptible_sleep_on(&fs->wait);
-@@ -805,7 +804,7 @@
- 		--fs->wanted;
- 	}
- 	fs->state = state;
--	restore_flags(flags);
-+	local_irq_restore(flags);
- 	return 0;
- }
- 
-@@ -813,11 +812,10 @@
- {
- 	unsigned long flags;
- 
--	save_flags(flags);
--	cli();
-+	local_irq_save(flags);
- 	fs->state = idle;
- 	start_request(fs);
--	restore_flags(flags);
-+	local_irq_restore(flags);
- }
- 
- static int fd_eject(struct floppy_state *fs)
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/char/16c552.h linux-2.6.13/drivers/char/16c552.h
---- linux-2.6.13-i386/drivers/char/16c552.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.13/drivers/char/16c552.h	2001-10-22 11:34:32.000000000 +0200
-@@ -0,0 +1,165 @@
-+/*
-+ * Definitions for the 16c552 DACE
-+ * (dual-asynchronous-communications-element) used on the GVP
-+ * IO-Extender. 
-+ *
-+ * Basically this is two 16c550 uarts's and a parallel port, which is
-+ * why the serial definitions should be valid for the 16c550 uart
-+ * aswell.
-+ *
-+ * Data was taken from National Semiconductors duart 16c552
-+ * data-sheets and the Texas Instruments DACE 16c552 data-sheets (the
-+ * NS version of the chip is _non_ standard and their data-sheets did
-+ * cost me several wasted hours of work).
-+ *
-+ * This file is (C) 1995 Jes Sorensen (jds at kom.auc.dk)
-+ *
-+ * Moved from drivers/char/ to include/linux/, because it's useful
-+ * on more than just the one card. I'm using it on the hp300 DCA
-+ * serial driver, for example.  
-+ *      -- Peter Maydell <pmaydell at chiark.greenend.org.uk> 05/1998
-+ */
-+
-+#ifndef _16C552_H_
-+#define _16C552_H_
-+
-+/* Serial stuff */
-+
-+struct uart_16c550 {
-+	volatile u_char skip0;
-+	volatile u_char RBR;
-+	volatile u_char skip1;
-+	volatile u_char IER;
-+	volatile u_char skip2;
-+	volatile u_char IIR;
-+	volatile u_char skip3;
-+	volatile u_char LCR;
-+	volatile u_char skip4;
-+	volatile u_char MCR;
-+	volatile u_char skip5;
-+	volatile u_char LSR;
-+	volatile u_char skip6;
-+	volatile u_char MSR;
-+	volatile u_char skip7;
-+	volatile u_char SCR;
-+};
-+
-+#define THR RBR
-+#define FCR IIR
-+#define DLL RBR
-+#define DLM IER
-+#define AFR IIR
-+
-+/*
-+ * Bit-defines for the various registers.
-+ */
-+
-+
-+/* IER */
-+
-+#define ERDAI         (1<<0)
-+#define ETHREI        (1<<1)
-+#define ELSI          (1<<2)
-+#define EMSI          (1<<3)
-+
-+/* IIR - Interrupt Ident. Register */
-+
-+#define IRQ_PEND      (1<<0) /* NOTE: IRQ_PEND=0 implies irq pending */
-+#define IRQ_ID1       (1<<1)
-+#define IRQ_ID2       (1<<2)
-+#define IRQ_ID3       (1<<3)
-+#define FIFO_ENA0     (1<<6) /* Both these are set when FCR(1<<0)=1 */
-+#define FIFO_ENA1     (1<<7)
-+
-+#define IRQ_RLS  (IRQ_ID1 | IRQ_ID2)
-+#define IRQ_RDA  (IRQ_ID2)
-+#define IRQ_CTI  (IRQ_ID2 | IRQ_ID3)
-+#define IRQ_THRE (IRQ_ID1)
-+#define IRQ_MS   0
-+
-+/* FCR - FIFO Control Register */
-+
-+#define FIFO_ENA      (1<<0)
-+#define RCVR_FIFO_RES (1<<1)
-+#define XMIT_FIFO_RES (1<<2)
-+#define DMA_MODE_SEL  (1<<3)
-+#define RCVR_TRIG_LSB (1<<6)
-+#define RCVR_TRIG_MSB (1<<7)
-+
-+#define FIFO_TRIG_1   0x00
-+#define FIFO_TRIG_4   RCVR_TRIG_LSB
-+#define FIFO_TRIG_8   RCVR_TRIG_MSB
-+#define FIFO_TRIG_14  RCVR_TRIG_LSB|RCVR_TRIG_MSB
-+
-+/* LCR - Line Control Register */
-+
-+#define WLS0          (1<<0)
-+#define WLS1          (1<<1)
-+#define STB           (1<<2)
-+#define PEN           (1<<3)
-+#define EPS           (1<<4)
-+#define STICK_PARITY  (1<<5)
-+#define SET_BREAK     (1<<6)
-+#define DLAB          (1<<7)
-+
-+#define data_5bit      0x00
-+#define data_6bit      0x01
-+#define data_7bit      0x02
-+#define data_8bit      0x03
-+
-+
-+/* MCR - Modem Control Register */
-+
-+#define DTR           (1<<0)
-+#define RTS           (1<<1)
-+#define OUT1          (1<<2)
-+#define OUT2          (1<<3)
-+#define LOOP          (1<<4)
-+
-+/* LSR - Line Status Register */
-+
-+#define DR            (1<<0)
-+#define OE            (1<<1)
-+#define PE            (1<<2)
-+#define FE            (1<<3)
-+#define BI            (1<<4)
-+#define THRE          (1<<5)
-+#define TEMT          (1<<6)
-+#define RCVR_FIFO_ERR (1<<7)
-+
-+/* MSR - Modem Status Register */
-+
-+#define DCTS          (1<<0)
-+#define DDSR          (1<<1)
-+#define TERI          (1<<2)
-+#define DDCD          (1<<3)
-+#define CTS           (1<<4)
-+#define DSR           (1<<5)
-+#define RING_I        (1<<6)
-+#define DCD           (1<<7)
-+
-+/* AFR - Alternate Function Register */
-+
-+#define CONCUR_WRITE  (1<<0)
-+#define BAUDOUT       (1<<1)
-+#define RXRDY         (1<<2)
-+
-+/* Parallel stuff */
-+
-+/*
-+ * Unfortunately National Semiconductors did not supply the
-+ * specifications for the parallel port in the chip :-(
-+ * TI succed though, so here they are :-)
-+ *
-+ * Defines for the bits can be found by including <linux/lp.h>
-+ */
-+struct IOEXT_par {
-+	volatile u_char skip0;
-+	volatile u_char DATA;
-+	volatile u_char skip1;
-+	volatile u_char STATUS;
-+	volatile u_char skip2;
-+	volatile u_char CTRL;
-+};
-+
-+#endif
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/char/ioext.h linux-2.6.13/drivers/char/ioext.h
---- linux-2.6.13-i386/drivers/char/ioext.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.13/drivers/char/ioext.h	2001-10-22 11:34:32.000000000 +0200
-@@ -0,0 +1,108 @@
-+/*
-+ * Shared data structure for GVP IO-Extender support.
-+ *
-+ * Merge of ioext.h and ser_ioext.h
-+ */
-+#ifndef _IOEXT_H_
-+#define _IOEXT_H_
-+
-+#include <linux/config.h>
-+#include <linux/netdevice.h>
-+
-+#include "16c552.h"
-+
-+#define MAX_IOEXT 5 /*
-+		     * The maximum number of io-extenders is 5, as you
-+		     * can't have more than 5 ZII boards in any Amiga.
-+		     */
-+
-+#define UART_CLK 7372800
-+
-+#define IOEXT_BAUD_BASE (UART_CLK / 16)
-+
-+#define IOEXT_MAX_LINES 2
-+
-+#define IOEXT_PAR_PLIP  0x0001
-+#define IOEXT_PAR_LP    0x0002
-+
-+
-+/*
-+ * Macros for the serial driver.
-+ */
-+#define curruart(info) ((struct uart_16c550 *)(info->port))
-+
-+#define ser_DTRon(info)  curruart(info)->MCR |=  DTR
-+#define ser_RTSon(info)  curruart(info)->MCR |=  RTS
-+#define ser_DTRoff(info) curruart(info)->MCR &= ~DTR
-+#define ser_RTSoff(info) curruart(info)->MCR &= ~RTS
-+
-+
-+/*
-+ * CNTR defines (copied from the GVP SCSI-driver file gvp11.h
-+ */
-+#define GVP_BUSY	(1<<0)
-+#define GVP_IRQ_PEND	(1<<1)
-+#define GVP_IRQ_ENA 	(1<<3)
-+#define GVP_DIR_WRITE   (1<<4)
-+
-+
-+/*
-+ * CTRL defines 
-+ */
-+#define PORT0_MIDI   (1<<0)  /* CLR = DRIVERS         SET = MIDI      */
-+#define PORT1_MIDI   (1<<1)  /* CLR = DRIVERS         SET = MIDI      */
-+#define PORT0_DRIVER (1<<2)  /* CLR = RS232,          SET = MIDI      */
-+#define PORT1_DRIVER (1<<3)  /* CLR = RS232,          SET = MIDI      */
-+#define IRQ_SEL      (1<<4)  /* CLR = INT2,           SET = INT6      */
-+#define ROM_BANK_SEL (1<<5)  /* CLR = LOW 32K,        SET = HIGH 32K  */
-+#define PORT0_CTRL   (1<<6)  /* CLR = RTSx or RXRDYx, SET = RTSx ONLY */
-+#define PORT1_CTRL   (1<<7)  /* CLR = RTSx or RXRDYx, SET = RTSx ONLY */
-+
-+
-+/*
-+ * This is the struct describing the registers on the IO-Extender.
-+ * NOTE: The board uses a dual uart (16c552), which should be equal to
-+ * two 16c550 uarts.
-+ */
-+typedef struct {
-+	char gap0[0x41];
-+	volatile unsigned char CNTR;	/* GVP DMAC CNTR (status register)   */
-+	char gap1[0x11e];
-+	struct uart_16c550 uart0;	/* The first uart                    */
-+	char gap2[0xf0];
-+	struct uart_16c550 uart1;	/* The second uart                   */
-+	char gap3[0xf0];
-+	struct IOEXT_par par;		/* The parallel port                 */
-+	char gap4[0xfb];
-+	volatile unsigned char CTRL;	/* The control-register on the board */
-+} IOEXT_struct;
-+
-+
-+typedef struct {
-+	int num_uarts;
-+	int line[IOEXT_MAX_LINES];
-+	volatile struct uart_16c550 *uart[IOEXT_MAX_LINES];
-+	IOEXT_struct *board;
-+	int spurious_count;
-+	unsigned char par_use;		/* IOEXT_PAR_xxx */
-+#if defined(CONFIG_GVPIOEXT_PLIP) || defined(CONFIG_GVPIOEXT_PLIP_MODULE)
-+	struct nt_device *dev;
-+#endif
-+#if defined(CONFIG_GVPIOEXT_LP) || defined(CONFIG_GVPIOEXT_LP_MODULE)
-+	struct lp_struct *lp_table;
-+	int lp_dev;
-+	int lp_interrupt;
-+#endif
-+} IOExtInfoType;
-+
-+/* Number of detected boards.  */
-+extern int ioext_num;
-+extern IOExtInfoType ioext_info[MAX_IOEXT];
-+
-+void ioext_plip_interrupt(struct net_device *dev, int *spurious_count);
-+void ioext_lp_interrupt(int dev, int *spurious_count);
-+
-+extern struct net_device ioext_dev_plip[3];
-+extern struct lp_struct ioext_lp_table[1];
-+
-+#endif
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/char/mc68681.h linux-2.6.13/drivers/char/mc68681.h
---- linux-2.6.13-i386/drivers/char/mc68681.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.13/drivers/char/mc68681.h	2001-10-22 11:34:32.000000000 +0200
-@@ -0,0 +1,131 @@
-+#ifndef _MC68681_H_
-+#define _MC68681_H_
-+
-+/* 
-+ * This describes an MC68681 DUART. It has almost only overlayed registers, which
-+ * the structure very ugly.
-+ * Note that the ri-register isn't really a register of the duart but a kludge of bsc
-+ * to make the ring indicator available.
-+ * 
-+ * The data came from the MFC-31-Developer Kit (from Ralph Seidel,
-+ * zodiac at darkness.gun.de) and the data sheet of Phillip's clone device (SCN68681)
-+ * (from Richard Hirst, srh at gpt.co.uk)
-+ *
-+ * 11.11.95 copyright Joerg Dorchain (dorchain at mpi-sb.mpg.de)
-+ *
-+ */
-+
-+struct duarthalf {
-+union {
-+volatile u_char mr1; /* rw */
-+volatile u_char mr2; /* rw */
-+}  mr;
-+volatile u_char ri;   /* special, read */
-+union {
-+volatile u_char sr;  /* read */
-+volatile u_char csr; /* write */
-+} sr_csr;
-+u_char pad1;
-+volatile u_char cr; /* write */
-+u_char pad2;
-+union {
-+volatile u_char rhr; /* read */
-+volatile u_char thr; /* write */
-+} hr;
-+u_char pad3;
-+};
-+
-+struct duart {
-+struct duarthalf pa;
-+union {
-+volatile u_char ipcr; /* read */
-+volatile u_char acr;  /* write */
-+} ipcr_acr;
-+u_char pad1;
-+union {
-+volatile u_char isr; /* read */
-+volatile u_char imr; /* write */
-+} ir;
-+u_char pad2;
-+volatile u_char ctu;
-+u_char pad3;
-+volatile u_char ctl;
-+u_char pad4;
-+struct duarthalf pb;
-+volatile u_char ivr;
-+u_char pad5;
-+union {
-+volatile u_char ipr; /* read */
-+volatile u_char opcr; /* write */
-+} ipr_opcr;
-+u_char pad6;
-+union {
-+volatile u_char start; /* read */
-+volatile u_char sopc; /* write */
-+} start_sopc;
-+u_char pad7;
-+union {
-+volatile u_char stop; /* read */
-+volatile u_char ropc; /* write */
-+} stop_ropc;
-+u_char pad8;
-+};
-+
-+#define MR1_BITS 3
-+#define MR1_5BITS 0
-+#define MR1_6BITS 1
-+#define MR1_7BITS 2
-+#define MR1_8BITS 3
-+
-+#define MR1_PARITY_ODD 4
-+
-+#define MR1_PARITY 24
-+#define MR1_PARITY_WITH 0
-+#define MR1_PARITY_FORCE 8
-+#define MR1_PARITY_NO 16
-+#define MR1_PARITY_MULTIDROP 24
-+
-+#define MR1_ERROR_BLOCK 32
-+#define MR1_FFULL_IRQ 64
-+#define MR1_RxRTS_ON 128
-+
-+#define MR2_STOPS 15
-+#define MR2_1STOP 7
-+#define MR2_2STOP 15
-+
-+#define MR2_CTS_ON 16
-+#define MR2_TxRTS_ON 32
-+
-+#define MR2_MODE 192
-+#define MR2_NORMAL 0
-+#define MR2_ECHO 64
-+#define MR2_LOCALLOOP 128
-+#define MR2_REMOTELOOP 192
-+
-+#define CR_RXCOMMAND 3
-+#define CR_NONE 0
-+#define CR_RX_ON 1
-+#define CR_RX_OFF 2
-+#define CR_TXCOMMAND 12
-+#define CR_TX_ON 4
-+#define CR_TX_OFF 8
-+#define CR_MISC 112
-+#define CR_RESET_MR 16
-+#define CR_RESET_RX 32
-+#define CR_RESET_TX 48
-+#define CR_RESET_ERR 64
-+#define CR_RESET_BREAK 80
-+#define CR_START_BREAK 96
-+#define CR_STOP_BREAK 112
-+
-+#define SR_RXRDY 1
-+#define SR_FFULL 2
-+#define SR_TXRDY 4
-+#define SR_TXEMPT 8
-+#define SR_OVERRUN 16
-+#define SR_PARITY 32
-+#define SR_FRAMING 64
-+#define SR_BREAK 128
-+
-+
-+#endif
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/char/plip_ioext.c linux-2.6.13/drivers/char/plip_ioext.c
---- linux-2.6.13-i386/drivers/char/plip_ioext.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.13/drivers/char/plip_ioext.c	2004-10-25 16:38:25.000000000 +0200
-@@ -0,0 +1,1058 @@
-+/*
-+ * plip_ioext: A parallel port "network" driver for GVP IO-Extender.
-+ *
-+ * Authors:	See drivers/net/plip.c
-+ *              IO-Extender version by Steve Bennett, <msteveb at ozemail.com.au>
-+ *
-+ * This driver is for use with a 5-bit cable (LapLink (R) cable).
-+ */
-+
-+static const char *version = "NET3 PLIP version 2.2/m68k";
-+
-+#define __NO_VERSION__
-+
-+#include <linux/module.h>
-+#include <linux/types.h>
-+#include <linux/sched.h>
-+#include <linux/errno.h>
-+#include <linux/interrupt.h>
-+#include <linux/slab.h>
-+#include <linux/termios.h>
-+#include <linux/tty.h>
-+#include <linux/serial.h>
-+
-+#include <asm/setup.h>
-+#include <asm/irq.h>
-+#include <asm/amigahw.h>
-+#include <asm/amigaints.h>
-+#include <linux/zorro.h>
-+
-+#include <linux/config.h>
-+#include <linux/kernel.h>
-+#include <linux/fcntl.h>
-+#include <linux/string.h>
-+#include <linux/ptrace.h>
-+#include <linux/if_ether.h>
-+
-+#include <asm/system.h>
-+
-+#include <linux/in.h>
-+#include <linux/delay.h>
-+/*#include <linux/lp_m68k.h>*/
-+
-+#include <linux/netdevice.h>
-+#include <linux/etherdevice.h>
-+#include <linux/inetdevice.h>
-+#include <linux/skbuff.h>
-+#include <linux/if_plip.h>
-+
-+#include <linux/tqueue.h>
-+#include <linux/ioport.h>
-+#include <linux/bitops.h>
-+#include <asm/byteorder.h>
-+
-+#include "ioext.h"
-+
-+#define DEBUG 0
-+
-+/* Map 'struct device *' to our control structure */
-+#define PLIP_DEV(DEV) (&ioext_info[(DEV)->irq])
-+
-+/************************************************************************
-+**
-+** PLIP definitions
-+**
-+*************************************************************************
-+*/
-+
-+/* Use 0 for production, 1 for verification, >2 for debug */
-+#ifndef NET_DEBUG
-+#define NET_DEBUG 2
-+#endif
-+static unsigned int net_debug = NET_DEBUG;
-+
-+/* In micro second */
-+#define PLIP_DELAY_UNIT       1
-+
-+/* Connection time out = PLIP_TRIGGER_WAIT * PLIP_DELAY_UNIT usec */
-+#define PLIP_TRIGGER_WAIT	 500
-+
-+/* Nibble time out = PLIP_NIBBLE_WAIT * PLIP_DELAY_UNIT usec */
-+#define PLIP_NIBBLE_WAIT        3000
-+
-+#define PAR_DATA(dev)     ((dev)->base_addr+0)
-+#define PAR_STATUS(dev)   ((dev)->base_addr+2)
-+#define PAR_CONTROL(dev)  ((dev)->base_addr+4)
-+
-+static void enable_par_irq(struct device *dev, int on);
-+static int plip_init(struct device *dev);
-+
-+/* Bottom halfs */
-+static void plip_kick_bh(struct device *dev);
-+static void plip_bh(struct device *dev);
-+
-+/* Functions for DEV methods */
-+static int plip_rebuild_header(struct sk_buff *skb);
-+static int plip_tx_packet(struct sk_buff *skb, struct device *dev);
-+static int plip_open(struct device *dev);
-+static int plip_close(struct device *dev);
-+static struct enet_statistics *plip_get_stats(struct device *dev);
-+static int plip_config(struct device *dev, struct ifmap *map);
-+static int plip_ioctl(struct device *dev, struct ifreq *ifr, int cmd);
-+
-+enum plip_connection_state {
-+	PLIP_CN_NONE=0,
-+	PLIP_CN_RECEIVE,
-+	PLIP_CN_SEND,
-+	PLIP_CN_CLOSING,
-+	PLIP_CN_ERROR
-+};
-+
-+enum plip_packet_state {
-+	PLIP_PK_DONE=0,
-+	PLIP_PK_TRIGGER,
-+	PLIP_PK_LENGTH_LSB,
-+	PLIP_PK_LENGTH_MSB,
-+	PLIP_PK_DATA,
-+	PLIP_PK_CHECKSUM
-+};
-+
-+enum plip_nibble_state {
-+	PLIP_NB_BEGIN,
-+	PLIP_NB_1,
-+	PLIP_NB_2,
-+};
-+
-+struct plip_local {
-+	enum plip_packet_state state;
-+	enum plip_nibble_state nibble;
-+	union {
-+		struct {
-+#if defined(__LITTLE_ENDIAN)
-+			unsigned char lsb;
-+			unsigned char msb;
-+#elif defined(__BIG_ENDIAN)
-+			unsigned char msb;
-+			unsigned char lsb;
-+#else
-+#error  "Please fix the endianness defines in <asm/byteorder.h>"
-+#endif            
-+		} b;
-+		unsigned short h;
-+	} length;
-+	unsigned short byte;
-+	unsigned char  checksum;
-+	unsigned char  data;
-+	struct sk_buff *skb;
-+};
-+
-+struct net_local {
-+	struct enet_statistics enet_stats;
-+	struct tq_struct immediate;
-+	struct tq_struct deferred;
-+	struct plip_local snd_data;
-+	struct plip_local rcv_data;
-+	unsigned long  trigger;
-+	unsigned long  nibble;
-+	enum plip_connection_state connection;
-+	unsigned short timeout_count;
-+	char is_deferred;
-+	int (*orig_rebuild_header)(struct sk_buff *skb);
-+};
-+
-+struct device ioext_dev_plip[] = {
-+	{
-+		"plip0",
-+		0, 0, 0, 0,    /* memory */
-+		0, 0,    /* base, irq */
-+		0, 0, 0, NULL, plip_init 
-+	},
-+	{
-+		"plip1",
-+		0, 0, 0, 0,    /* memory */
-+		0, 0,    /* base, irq */
-+		0, 0, 0, NULL, plip_init 
-+	},
-+	{
-+		"plip2",
-+		0, 0, 0, 0,    /* memory */
-+		0, 0,    /* base, irq */
-+		0, 0, 0, NULL, plip_init 
-+	}
-+};
-+
-+/*
-+ * Check for and handle an interrupt for this PLIP device.
-+ *
-+ */
-+void ioext_plip_interrupt(struct device *dev, int *spurious_count)
-+{
-+	struct net_local *nl;
-+	struct plip_local *rcv;
-+	unsigned char c0;
-+	unsigned long flags;
-+
-+	nl = (struct net_local *)dev->priv;
-+	rcv = &nl->rcv_data;
-+
-+	c0 = z_readb(PAR_STATUS(dev));
-+
-+	if (dev->interrupt) {
-+		return;
-+	}
-+
-+	if ((c0 & 0xf8) != 0xc0) {
-+		/* Not for us */
-+		++*spurious_count;
-+		return;
-+	}
-+
-+	*spurious_count = 0;
-+	dev->interrupt = 1;
-+
-+	local_irq_save(flags);
-+
-+	switch (nl->connection) {
-+	case PLIP_CN_CLOSING:
-+		dev->tbusy = 0;
-+	case PLIP_CN_NONE:
-+	case PLIP_CN_SEND:
-+		dev->last_rx = jiffies;
-+		rcv->state = PLIP_PK_TRIGGER;
-+		nl->connection = PLIP_CN_RECEIVE;
-+		nl->timeout_count = 0;
-+		queue_task(&nl->immediate, &tq_immediate);
-+		mark_bh(IMMEDIATE_BH);
-+		local_irq_restore(flags);
-+#if 0
-+		printk("%s: receive irq in SEND/NONE/CLOSING (%d) ok\n",
-+		       dev->name, nl->connection);
-+#endif
-+		break;
-+
-+	case PLIP_CN_RECEIVE:
-+		local_irq_restore(flags);
-+		printk("%s: receive interrupt when receiving packet\n",
-+		       dev->name);
-+		break;
-+
-+	case PLIP_CN_ERROR:
-+		local_irq_restore(flags);
-+		printk("%s: receive interrupt in error state\n", dev->name);
-+		break;
-+	}
-+}
-+
-+
-+/* Bottom half handler for the delayed request.
-+   This routine is kicked by do_timer().
-+   Request `plip_bh' to be invoked. */
-+static void
-+plip_kick_bh(struct device *dev)
-+{
-+	struct net_local *nl = (struct net_local *)dev->priv;
-+
-+	if (nl->is_deferred) {
-+		queue_task(&nl->immediate, &tq_immediate);
-+		mark_bh(IMMEDIATE_BH);
-+	}
-+}
-+
-+/* Forward declarations of internal routines */
-+static int plip_none(struct device *, struct net_local *,
-+		     struct plip_local *, struct plip_local *);
-+static int plip_receive_packet(struct device *, struct net_local *,
-+			       struct plip_local *, struct plip_local *);
-+static int plip_send_packet(struct device *, struct net_local *,
-+			    struct plip_local *, struct plip_local *);
-+static int plip_connection_close(struct device *, struct net_local *,
-+				 struct plip_local *, struct plip_local *);
-+static int plip_error(struct device *, struct net_local *,
-+		      struct plip_local *, struct plip_local *);
-+static int plip_bh_timeout_error(struct device *dev, struct net_local *nl,
-+				 struct plip_local *snd,
-+				 struct plip_local *rcv,
-+				 int error);
-+
-+#define OK        0
-+#define TIMEOUT   1
-+#define ERROR     2
-+
-+typedef int (*plip_func)(struct device *dev, struct net_local *nl,
-+			 struct plip_local *snd, struct plip_local *rcv);
-+
-+static plip_func connection_state_table[] =
-+{
-+	plip_none,
-+	plip_receive_packet,
-+	plip_send_packet,
-+	plip_connection_close,
-+	plip_error
-+};
-+
-+/*
-+** enable_par_irq()
-+** 
-+** Enable or disable parallel irq for 'dev' according to 'on'.
-+**
-+** It is NOT possible to disable only the parallel irq.
-+** So we disable the board interrupt instead. This means that
-+** during reception of a PLIP packet, no serial interrupts can
-+** happen. Sorry.
-+*/
-+static void enable_par_irq(struct device *dev, int on)
-+{
-+	if (on) {
-+		PLIP_DEV(dev)->board->CNTR |= GVP_IRQ_ENA;
-+	}
-+	else {
-+		PLIP_DEV(dev)->board->CNTR &= ~GVP_IRQ_ENA;
-+	}
-+}
-+
-+/* Bottom half handler of PLIP. */
-+static void
-+plip_bh(struct device *dev)
-+{
-+	struct net_local *nl = (struct net_local *)dev->priv;
-+	struct plip_local *snd = &nl->snd_data;
-+	struct plip_local *rcv = &nl->rcv_data;
-+	plip_func f;
-+	int r;
-+
-+	nl->is_deferred = 0;
-+	f = connection_state_table[nl->connection];
-+	if ((r = (*f)(dev, nl, snd, rcv)) != OK
-+	    && (r = plip_bh_timeout_error(dev, nl, snd, rcv, r)) != OK) {
-+		nl->is_deferred = 1;
-+		queue_task(&nl->deferred, &tq_timer);
-+	}
-+}
-+
-+static int
-+plip_bh_timeout_error(struct device *dev, struct net_local *nl,
-+		      struct plip_local *snd, struct plip_local *rcv,
-+		      int error)
-+{
-+	unsigned char c0;
-+	unsigned long flags;
-+
-+	local_irq_save(flags);
-+	if (nl->connection == PLIP_CN_SEND) {
-+
-+		if (error != ERROR) { /* Timeout */
-+			nl->timeout_count++;
-+			if ((snd->state == PLIP_PK_TRIGGER
-+			     && nl->timeout_count <= 10)
-+			    || nl->timeout_count <= 3) {
-+				local_irq_restore(flags);
-+				/* Try again later */
-+				return TIMEOUT;
-+			}
-+			c0 = z_readb(PAR_STATUS(dev));
-+			printk(KERN_INFO "%s: transmit timeout(%d,%02x)\n",
-+			       dev->name, snd->state, c0);
-+		}
-+		nl->enet_stats.tx_errors++;
-+		nl->enet_stats.tx_aborted_errors++;
-+	} else if (nl->connection == PLIP_CN_RECEIVE) {
-+		if (rcv->state == PLIP_PK_TRIGGER) {
-+			/* Transmission was interrupted. */
-+			local_irq_restore(flags);
-+			return OK;
-+		}
-+		if (error != ERROR) { /* Timeout */
-+			if (++nl->timeout_count <= 3) {
-+				local_irq_restore(flags);
-+				/* Try again later */
-+				return TIMEOUT;
-+			}
-+			c0 = z_readb(PAR_STATUS(dev));
-+			printk(KERN_INFO "%s: receive timeout(%d,%02x)\n",
-+			       dev->name, rcv->state, c0);
-+		}
-+		nl->enet_stats.rx_dropped++;
-+	}
-+	rcv->state = PLIP_PK_DONE;
-+	if (rcv->skb) {
-+		kfree_skb(rcv->skb);
-+		rcv->skb = NULL;
-+	}
-+	snd->state = PLIP_PK_DONE;
-+	if (snd->skb) {
-+		dev_kfree_skb(snd->skb);
-+		snd->skb = NULL;
-+	}
-+	enable_par_irq(dev, 0);
-+	dev->tbusy = 1;
-+	nl->connection = PLIP_CN_ERROR;
-+	z_writeb(0x00, PAR_DATA(dev));
-+	local_irq_restore(flags);
-+
-+	return TIMEOUT;
-+}
-+
-+static int
-+plip_none(struct device *dev, struct net_local *nl,
-+	  struct plip_local *snd, struct plip_local *rcv)
-+{
-+	return OK;
-+}
-+
-+/* PLIP_RECEIVE --- receive a byte(two nibbles)
-+   Returns OK on success, TIMEOUT on timeout */
-+inline static int
-+plip_receive(struct device *dev, unsigned short nibble_timeout, 
-+	     enum plip_nibble_state *ns_p, unsigned char *data_p)
-+{
-+	unsigned char c0, c1;
-+	unsigned int cx;
-+
-+	switch (*ns_p) {
-+	case PLIP_NB_BEGIN:
-+		cx = nibble_timeout;
-+		while (1) {
-+			c0 = z_readb(PAR_STATUS(dev));
-+			udelay(PLIP_DELAY_UNIT);
-+			if ((c0 & 0x80) == 0) {
-+				c1 = z_readb(PAR_STATUS(dev));
-+				if (c0 == c1)
-+					break;
-+			}
-+			if (--cx == 0)
-+				return TIMEOUT;
-+		}
-+#if 0
-+		printk("received first nybble: %02X -> %02X\n",
-+		       c0, (c0 >> 3) & 0x0F);
-+#endif
-+		*data_p = (c0 >> 3) & 0x0f;
-+		z_writeb(0x10, PAR_DATA(dev)); /* send ACK */
-+		*ns_p = PLIP_NB_1;
-+
-+	case PLIP_NB_1:
-+		cx = nibble_timeout;
-+		while (1) {
-+			c0 = z_readb(PAR_STATUS(dev));
-+			udelay(PLIP_DELAY_UNIT);
-+			if (c0 & 0x80) {
-+				c1 = z_readb(PAR_STATUS(dev));
-+				if (c0 == c1)
-+					break;
-+			}
-+			if (--cx == 0)
-+				return TIMEOUT;
-+		}
-+#if 0
-+		printk("received second nybble: %02X -> %02X\n",
-+		       c0, (c0 << 1) & 0xF0);
-+#endif
-+		*data_p |= (c0 << 1) & 0xf0;
-+		z_writeb(0x00, PAR_DATA(dev)); /* send ACK */
-+		*ns_p = PLIP_NB_BEGIN;
-+	case PLIP_NB_2:
-+		break;
-+	}
-+	return OK;
-+}
-+
-+/* PLIP_RECEIVE_PACKET --- receive a packet */
-+static int
-+plip_receive_packet(struct device *dev, struct net_local *nl,
-+		    struct plip_local *snd, struct plip_local *rcv)
-+{
-+	unsigned short nibble_timeout = nl->nibble;
-+	unsigned char *lbuf;
-+	unsigned long flags;
-+
-+	switch (rcv->state) {
-+	case PLIP_PK_TRIGGER:
-+		enable_par_irq(dev, 0);
-+		dev->interrupt = 0;
-+		z_writeb(0x01, PAR_DATA(dev)); /* send ACK */
-+		if (net_debug > 2)
-+			printk(KERN_DEBUG "%s: receive start\n", dev->name);
-+		rcv->state = PLIP_PK_LENGTH_LSB;
-+		rcv->nibble = PLIP_NB_BEGIN;
-+
-+	case PLIP_PK_LENGTH_LSB:
-+		if (snd->state != PLIP_PK_DONE) {
-+			if (plip_receive(dev, nl->trigger,
-+					 &rcv->nibble, &rcv->length.b.lsb)) {
-+				/* collision, here dev->tbusy == 1 */
-+				rcv->state = PLIP_PK_DONE;
-+				nl->is_deferred = 1;
-+				nl->connection = PLIP_CN_SEND;
-+				queue_task(&nl->deferred, &tq_timer);
-+				enable_par_irq(dev, 1);
-+				return OK;
-+			}
-+		} else {
-+			if (plip_receive(dev, nibble_timeout, 
-+					 &rcv->nibble, &rcv->length.b.lsb))
-+				return TIMEOUT;
-+		}
-+		rcv->state = PLIP_PK_LENGTH_MSB;
-+
-+	case PLIP_PK_LENGTH_MSB:
-+		if (plip_receive(dev, nibble_timeout, 
-+				 &rcv->nibble, &rcv->length.b.msb))
-+			return TIMEOUT;
-+		if (rcv->length.h > dev->mtu + dev->hard_header_len
-+		    || rcv->length.h < 8) {
-+			printk(KERN_INFO "%s: bogus packet size %d.\n",
-+			       dev->name, rcv->length.h);
-+			return ERROR;
-+		}
-+		/* Malloc up new buffer. */
-+		rcv->skb = dev_alloc_skb(rcv->length.h);
-+		if (rcv->skb == NULL) {
-+			printk(KERN_INFO "%s: Memory squeeze.\n", dev->name);
-+			return ERROR;
-+		}
-+		skb_put(rcv->skb,rcv->length.h);
-+		rcv->skb->dev = dev;
-+		rcv->state = PLIP_PK_DATA;
-+		rcv->byte = 0;
-+		rcv->checksum = 0;
-+
-+	case PLIP_PK_DATA:
-+		lbuf = rcv->skb->data;
-+		do
-+			if (plip_receive(dev, nibble_timeout, 
-+					 &rcv->nibble, &lbuf[rcv->byte]))
-+				return TIMEOUT;
-+		while (++rcv->byte < rcv->length.h);
-+		do
-+			rcv->checksum += lbuf[--rcv->byte];
-+		while (rcv->byte);
-+		rcv->state = PLIP_PK_CHECKSUM;
-+
-+	case PLIP_PK_CHECKSUM:
-+		if (plip_receive(dev, nibble_timeout, 
-+				 &rcv->nibble, &rcv->data))
-+			return TIMEOUT;
-+		if (rcv->data != rcv->checksum) {
-+			nl->enet_stats.rx_crc_errors++;
-+			if (net_debug)
-+				printk(KERN_INFO "%s: checksum error\n",
-+				       dev->name);
-+			return ERROR;
-+		}
-+		rcv->state = PLIP_PK_DONE;
-+
-+	case PLIP_PK_DONE:
-+		/* Inform the upper layer for the arrival of a packet. */
-+		rcv->skb->protocol=eth_type_trans(rcv->skb, dev);
-+		netif_rx(rcv->skb);
-+		nl->enet_stats.rx_packets++;
-+		rcv->skb = NULL;
-+		if (net_debug > 2)
-+			printk(KERN_DEBUG "%s: receive end\n", dev->name);
-+
-+		/* Close the connection. */
-+		z_writeb (0x00, PAR_DATA(dev));
-+
-+		local_irq_save(flags);
-+		if (snd->state != PLIP_PK_DONE) {
-+			nl->connection = PLIP_CN_SEND;
-+			local_irq_restore(flags);
-+			queue_task(&nl->immediate, &tq_immediate);
-+			mark_bh(IMMEDIATE_BH);
-+			enable_par_irq(dev, 1);
-+			return OK;
-+		} else {
-+			nl->connection = PLIP_CN_NONE;
-+			local_irq_restore(flags);
-+			enable_par_irq(dev, 1);
-+			return OK;
-+		}
-+	}
-+	return OK;
-+}
-+
-+/* PLIP_SEND --- send a byte (two nibbles) 
-+   Returns OK on success, TIMEOUT when timeout    */
-+inline static int
-+plip_send(struct device *dev, unsigned short nibble_timeout, 
-+	  enum plip_nibble_state *ns_p, unsigned char data)
-+{
-+	unsigned char c0;
-+	unsigned int cx;
-+
-+	switch (*ns_p) {
-+	case PLIP_NB_BEGIN:
-+		z_writeb((data & 0x0f), PAR_DATA(dev));
-+		*ns_p = PLIP_NB_1;
-+
-+	case PLIP_NB_1:
-+		z_writeb(0x10 | (data & 0x0f), PAR_DATA(dev));
-+		cx = nibble_timeout;
-+		while (1) {
-+			c0 = z_readb(PAR_STATUS(dev));
-+			if ((c0 & 0x80) == 0) 
-+				break;
-+			if (--cx == 0)
-+				return TIMEOUT;
-+			udelay(PLIP_DELAY_UNIT);
-+		}
-+		z_writeb(0x10 | (data >> 4), PAR_DATA(dev));
-+		*ns_p = PLIP_NB_2;
-+
-+	case PLIP_NB_2:
-+		z_writeb((data >> 4), PAR_DATA(dev));
-+		cx = nibble_timeout;
-+		while (1) {
-+			c0 = z_readb(PAR_STATUS(dev));
-+			if (c0 & 0x80)
-+				break;
-+			if (--cx == 0)
-+				return TIMEOUT;
-+			udelay(PLIP_DELAY_UNIT);
-+		}
-+		*ns_p = PLIP_NB_BEGIN;
-+		return OK;
-+	}
-+	return OK;
-+}
-+
-+/* PLIP_SEND_PACKET --- send a packet */
-+static int
-+plip_send_packet(struct device *dev, struct net_local *nl,
-+		 struct plip_local *snd, struct plip_local *rcv)
-+{
-+	unsigned short nibble_timeout = nl->nibble;
-+	unsigned char *lbuf;
-+	unsigned char c0;
-+	unsigned int cx;
-+	unsigned long flags;
-+
-+	if (snd->skb == NULL || (lbuf = snd->skb->data) == NULL) {
-+		printk(KERN_INFO "%s: send skb lost\n", dev->name);
-+		snd->state = PLIP_PK_DONE;
-+		snd->skb = NULL;
-+		return ERROR;
-+	}
-+
-+	if (snd->length.h == 0) {
-+		return OK;
-+	}
-+
-+	switch (snd->state) {
-+	case PLIP_PK_TRIGGER:
-+		if ((z_readb(PAR_STATUS(dev)) & 0xf8) != 0x80)
-+			return TIMEOUT;
-+
-+		/* Trigger remote rx interrupt. */
-+		z_writeb(0x08, PAR_DATA(dev));
-+		cx = nl->trigger;
-+		while (1) {
-+			udelay(PLIP_DELAY_UNIT);
-+                        local_irq_save(flags);
-+			if (nl->connection == PLIP_CN_RECEIVE) {
-+				local_irq_restore(flags);
-+				/* interrupted */
-+				nl->enet_stats.collisions++;
-+				if (net_debug > 1)
-+					printk(KERN_INFO "%s: collision.\n",
-+					       dev->name);
-+				return OK;
-+			}
-+			c0 = z_readb(PAR_STATUS(dev));
-+			if (c0 & 0x08) {
-+				enable_par_irq(dev, 0);
-+				if (net_debug > 2)
-+					printk(KERN_DEBUG "%s: send start\n",
-+					       dev->name);
-+				snd->state = PLIP_PK_LENGTH_LSB;
-+				snd->nibble = PLIP_NB_BEGIN;
-+				nl->timeout_count = 0;
-+				local_irq_restore(flags);
-+				break;
-+			}
-+			local_irq_restore(flags);
-+			if (--cx == 0) {
-+				z_writeb(0x00, PAR_DATA(dev));
-+				return TIMEOUT;
-+			}
-+		}
-+
-+	case PLIP_PK_LENGTH_LSB:
-+		if (plip_send(dev, nibble_timeout, 
-+			      &snd->nibble, snd->length.b.lsb))
-+			return TIMEOUT;
-+		snd->state = PLIP_PK_LENGTH_MSB;
-+
-+	case PLIP_PK_LENGTH_MSB:
-+		if (plip_send(dev, nibble_timeout, 
-+			      &snd->nibble, snd->length.b.msb))
-+			return TIMEOUT;
-+		snd->state = PLIP_PK_DATA;
-+		snd->byte = 0;
-+		snd->checksum = 0;
-+
-+	case PLIP_PK_DATA:
-+		do
-+			if (plip_send(dev, nibble_timeout, 
-+				      &snd->nibble, lbuf[snd->byte]))
-+				return TIMEOUT;
-+		while (++snd->byte < snd->length.h);
-+		do
-+			snd->checksum += lbuf[--snd->byte];
-+		while (snd->byte);
-+		snd->state = PLIP_PK_CHECKSUM;
-+
-+	case PLIP_PK_CHECKSUM:
-+		if (plip_send(dev, nibble_timeout, 
-+			      &snd->nibble, snd->checksum))
-+			return TIMEOUT;
-+
-+		dev_kfree_skb(snd->skb);
-+		nl->enet_stats.tx_packets++;
-+		snd->state = PLIP_PK_DONE;
-+
-+	case PLIP_PK_DONE:
-+		/* Close the connection */
-+		z_writeb (0x00, PAR_DATA(dev));
-+		snd->skb = NULL;
-+		if (net_debug > 2)
-+			printk(KERN_DEBUG "%s: send end\n", dev->name);
-+		nl->connection = PLIP_CN_CLOSING;
-+		nl->is_deferred = 1;
-+		queue_task(&nl->deferred, &tq_timer);
-+		enable_par_irq(dev, 1);
-+		return OK;
-+	}
-+	return OK;
-+}
-+
-+static int
-+plip_connection_close(struct device *dev, struct net_local *nl,
-+		      struct plip_local *snd, struct plip_local *rcv)
-+{
-+	unsigned long flags;
-+
-+        local_irq_save(flags);
-+	if (nl->connection == PLIP_CN_CLOSING) {
-+		nl->connection = PLIP_CN_NONE;
-+		dev->tbusy = 0;
-+		mark_bh(NET_BH);
-+	}
-+	local_irq_restore(flags);
-+	return OK;
-+}
-+
-+/* PLIP_ERROR --- wait till other end settled */
-+static int
-+plip_error(struct device *dev, struct net_local *nl,
-+	   struct plip_local *snd, struct plip_local *rcv)
-+{
-+	unsigned char status;
-+
-+	status = z_readb(PAR_STATUS(dev));
-+	if ((status & 0xf8) == 0x80) {
-+		if (net_debug > 2)
-+			printk(KERN_DEBUG "%s: reset interface.\n", dev->name);
-+		nl->connection = PLIP_CN_NONE;
-+		dev->tbusy = 0;
-+		dev->interrupt = 0;
-+		enable_par_irq(dev, 1);
-+		mark_bh(NET_BH);
-+	} else {
-+		nl->is_deferred = 1;
-+		queue_task(&nl->deferred, &tq_timer);
-+	}
-+
-+	return OK;
-+}
-+
-+/* We don't need to send arp, for plip is point-to-point. */
-+static int
-+plip_rebuild_header(struct sk_buff *skb)
-+{
-+	struct device *dev = skb->dev;
-+	struct net_local *nl = (struct net_local *)dev->priv;
-+	struct ethhdr *eth = (struct ethhdr *)skb->data;
-+	int i;
-+
-+	if ((dev->flags & IFF_NOARP)==0)
-+		return nl->orig_rebuild_header(skb);
-+
-+	if (eth->h_proto != __constant_htons(ETH_P_IP)
-+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-+	    && eth->h_proto != __constant_htons(ETH_P_IPV6)
-+#endif
-+		) {
-+		printk(KERN_ERR "plip_rebuild_header: Don't know how to resolve type %d addresses?\n", (int)eth->h_proto);
-+		memcpy(eth->h_source, dev->dev_addr, dev->addr_len);
-+		return 0;
-+	}
-+
-+	for (i=0; i < ETH_ALEN - sizeof(u32); i++)
-+		eth->h_dest[i] = 0xfc;
-+#if 0
-+	*(u32 *)(eth->h_dest+i) = dst;
-+#else
-+	/* Do not want to include net/route.h here.
-+	 * In any case, it is TOP of silliness to emulate
-+	 * hardware addresses on PtP link. --ANK
-+	 */
-+	*(u32 *)(eth->h_dest+i) = 0;
-+#endif
-+	return 0;
-+}
-+
-+static int
-+plip_tx_packet(struct sk_buff *skb, struct device *dev)
-+{
-+	struct net_local *nl = (struct net_local *)dev->priv;
-+	struct plip_local *snd = &nl->snd_data;
-+	unsigned long flags;
-+
-+	if (dev->tbusy)
-+		return 1;
-+
-+	if (test_and_set_bit(0, (void*)&dev->tbusy) != 0) {
-+		printk(KERN_ERR "%s: Transmitter access conflict.\n",
-+		       dev->name);
-+		return 1;
-+	}
-+
-+	if (skb->len > dev->mtu + dev->hard_header_len) {
-+		printk(KERN_ERR "%s: packet too big, %d.\n",
-+		       dev->name, (int)skb->len);
-+		dev->tbusy = 0;
-+		return 0;
-+	}
-+
-+	if (net_debug > 2)
-+		printk(KERN_DEBUG "%s: send request\n", dev->name);
-+
-+	local_irq_save(flags);
-+	dev->trans_start = jiffies;
-+	snd->skb = skb;
-+	snd->length.h = skb->len;
-+	snd->state = PLIP_PK_TRIGGER;
-+	if (nl->connection == PLIP_CN_NONE) {
-+		nl->connection = PLIP_CN_SEND;
-+		nl->timeout_count = 0;
-+	}
-+	queue_task(&nl->immediate, &tq_immediate);
-+	mark_bh(IMMEDIATE_BH);
-+	local_irq_restore(flags);
-+
-+	return 0;
-+}
-+
-+/* Open/initialize the board.  This is called (in the current kernel)
-+   sometime after booting when the 'ifconfig' program is run.
-+
-+ */
-+static int
-+plip_open(struct device *dev)
-+{
-+	struct net_local *nl = (struct net_local *)dev->priv;
-+	struct in_device *in_dev;
-+
-+#if defined(CONFIG_GVPIOEXT_LP) || defined(CONFIG_GVPIOEXT_LP_MODULE)
-+	/* Yes, there is a race condition here. Fix it later */
-+	if (PLIP_DEV(dev)->par_use & IOEXT_PAR_LP) {
-+		/* Can't open if lp is in use */
-+#if DEBUG
-+		printk("par is in use by lp\n");
-+#endif
-+		return(-EBUSY);
-+	}
-+#endif
-+	PLIP_DEV(dev)->par_use |= IOEXT_PAR_PLIP;
-+
-+#if DEBUG
-+	printk("plip_open(): sending 00 to data port\n");
-+#endif
-+
-+	/* Clear the data port. */
-+	z_writeb (0x00, PAR_DATA(dev));
-+
-+#if DEBUG
-+	printk("plip_open(): sent\n");
-+#endif
-+
-+	/* Initialize the state machine. */
-+	nl->rcv_data.state = nl->snd_data.state = PLIP_PK_DONE;
-+	nl->rcv_data.skb = nl->snd_data.skb = NULL;
-+	nl->connection = PLIP_CN_NONE;
-+	nl->is_deferred = 0;
-+
-+	/* Fill in the MAC-level header.
-+	   (ab)Use "dev->broadcast" to store point-to-point MAC address.
-+
-+	   PLIP doesn't have a real mac address, but we need to create one
-+	   to be DOS compatible.  */
-+	memset(dev->dev_addr,  0xfc, ETH_ALEN);
-+	memset(dev->broadcast, 0xfc, ETH_ALEN);
-+
-+	if ((in_dev=dev->ip_ptr) != NULL) {
-+		/*
-+		 *	Any address will do - we take the first
-+		 */
-+		struct in_ifaddr *ifa=in_dev->ifa_list;
-+		if (ifa != NULL) {
-+			memcpy(dev->dev_addr+2, &ifa->ifa_local, 4);
-+			memcpy(dev->broadcast+2, &ifa->ifa_address, 4);
-+		}
-+	}
-+
-+	dev->interrupt = 0;
-+	dev->start = 1;
-+	dev->tbusy = 0;
-+
-+	MOD_INC_USE_COUNT;
-+
-+	/* Enable rx interrupt. */
-+	enable_par_irq(dev, 1);
-+
-+	return 0;
-+}
-+
-+/* The inverse routine to plip_open (). */
-+static int
-+plip_close(struct device *dev)
-+{
-+	struct net_local *nl = (struct net_local *)dev->priv;
-+	struct plip_local *snd = &nl->snd_data;
-+	struct plip_local *rcv = &nl->rcv_data;
-+	unsigned long flags;
-+
-+	dev->tbusy = 1;
-+	dev->start = 0;
-+        local_irq_save(flags);
-+	nl->is_deferred = 0;
-+	nl->connection = PLIP_CN_NONE;
-+	local_irq_restore(flags);
-+	z_writeb(0x00, PAR_DATA(dev));
-+
-+	snd->state = PLIP_PK_DONE;
-+	if (snd->skb) {
-+		dev_kfree_skb(snd->skb);
-+		snd->skb = NULL;
-+	}
-+	rcv->state = PLIP_PK_DONE;
-+	if (rcv->skb) {
-+		kfree_skb(rcv->skb);
-+		rcv->skb = NULL;
-+	}
-+
-+	PLIP_DEV(dev)->par_use &= ~IOEXT_PAR_PLIP;
-+
-+	MOD_DEC_USE_COUNT;
-+	return 0;
-+}
-+
-+static struct enet_statistics *
-+plip_get_stats(struct device *dev)
-+{
-+	struct net_local *nl = (struct net_local *)dev->priv;
-+	struct enet_statistics *r = &nl->enet_stats;
-+
-+	return r;
-+}
-+
-+static int
-+plip_config(struct device *dev, struct ifmap *map)
-+{
-+	if (dev->flags & IFF_UP)
-+		return -EBUSY;
-+
-+	printk(KERN_INFO "%s: This interface is autodetected (ignored).\n",
-+	       dev->name);
-+
-+	return 0;
-+}
-+
-+static int
-+plip_ioctl(struct device *dev, struct ifreq *rq, int cmd)
-+{
-+	struct net_local *nl = (struct net_local *) dev->priv;
-+	struct plipconf *pc = (struct plipconf *) &rq->ifr_data;
-+  
-+	switch(pc->pcmd) {
-+	case PLIP_GET_TIMEOUT:
-+		pc->trigger = nl->trigger;
-+		pc->nibble  = nl->nibble;
-+		break;
-+	case PLIP_SET_TIMEOUT:
-+		nl->trigger = pc->trigger;
-+		nl->nibble  = pc->nibble;
-+		break;
-+	default:
-+		return -EOPNOTSUPP;
-+	}
-+	return 0;
-+}
-+
-+/*
-+ * Detect and initialize all IO-Extenders in this system.
-+ *
-+ * Both PLIP and serial devices are configured.
-+ */
-+int plip_init(struct device *dev)
-+{
-+	IOEXT_struct *board;
-+	struct net_local *nl;
-+
-+	if (ioext_num == 0) {
-+		printk(KERN_INFO "%s\n", version);
-+	}
-+
-+	board = PLIP_DEV(dev)->board;
-+	dev->base_addr = (unsigned long)&board->par.DATA;
-+
-+	/* Cheat and use irq to index into our table */
-+	dev->irq = ioext_num;
-+
-+	printk(KERN_INFO "%s: IO-Extender parallel port at 0x%08lX\n", dev->name, dev->base_addr);
-+
-+	/* Fill in the generic fields of the device structure. */
-+	ether_setup(dev);
-+
-+	/* Then, override parts of it */
-+	dev->hard_start_xmit  = plip_tx_packet;
-+	dev->open    = plip_open;
-+	dev->stop    = plip_close;
-+	dev->get_stats     = plip_get_stats;
-+	dev->set_config    = plip_config;
-+	dev->do_ioctl    = plip_ioctl;
-+	dev->tx_queue_len  = 10;
-+	dev->flags          = IFF_POINTOPOINT|IFF_NOARP;
-+
-+	/* Set the private structure */
-+	dev->priv = kmalloc(sizeof (struct net_local), GFP_KERNEL);
-+	if (dev->priv == NULL) {
-+		printk(KERN_ERR "%s: out of memory\n", dev->name);
-+		return -ENOMEM;
-+	}
-+	memset(dev->priv, 0, sizeof(struct net_local));
-+	nl = (struct net_local *) dev->priv;
-+
-+	nl->orig_rebuild_header = dev->rebuild_header;
-+	dev->rebuild_header   = plip_rebuild_header;
-+
-+	/* Initialize constants */
-+	nl->trigger  = PLIP_TRIGGER_WAIT;
-+	nl->nibble  = PLIP_NIBBLE_WAIT;
-+
-+	/* Initialize task queue structures */
-+	nl->immediate.next = NULL;
-+	nl->immediate.sync = 0;
-+	nl->immediate.routine = (void *)(void *)plip_bh;
-+	nl->immediate.data = dev;
-+
-+	nl->deferred.next = NULL;
-+	nl->deferred.sync = 0;
-+	nl->deferred.routine = (void *)(void *)plip_kick_bh;
-+	nl->deferred.data = dev;
-+
-+	/* Don't enable interrupts yet */
-+
-+	return 0;
-+}
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/ide/ide-iops.c linux-2.6.13/drivers/ide/ide-iops.c
---- linux-2.6.13-i386/drivers/ide/ide-iops.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/ide/ide-iops.c	2005-08-30 16:32:55.000000000 +0200
-@@ -341,6 +341,23 @@
- 	int i;
- 	u16 *stringcast;
- 
-+#ifdef __mc68000__
-+	if (!MACH_IS_AMIGA && !MACH_IS_MAC && !MACH_IS_Q40 && !MACH_IS_ATARI)
-+		return;
-+
-+#ifdef M68K_IDE_SWAPW
-+	if (M68K_IDE_SWAPW) {	/* fix bus byteorder first */
-+		u_char *p = (u_char *)id;
-+		u_char t;
-+		for (i = 0; i < 512; i += 2) {
-+			t = p[i];
-+			p[i] = p[i+1];
-+			p[i+1] = t;
-+		}
-+	}
-+#endif
-+#endif /* __mc68000__ */
-+
- 	id->config         = __le16_to_cpu(id->config);
- 	id->cyls           = __le16_to_cpu(id->cyls);
- 	id->reserved2      = __le16_to_cpu(id->reserved2);
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/ide/legacy/gayle.c linux-2.6.13/drivers/ide/legacy/gayle.c
---- linux-2.6.13-i386/drivers/ide/legacy/gayle.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/ide/legacy/gayle.c	2005-09-02 16:32:11.000000000 +0200
-@@ -161,6 +161,7 @@
- 	base = (unsigned long)ZTWO_VADDR(phys_base);
- 	ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0;
- 
-+	memset(&hw, 0, sizeof(hw));
- 	ide_setup_ports(&hw, base, gayle_offsets,
- 			ctrlport, irqport, ack_intr,
- //			&gayle_iops,
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/input/keyboard/Kconfig linux-2.6.13/drivers/input/keyboard/Kconfig
---- linux-2.6.13-i386/drivers/input/keyboard/Kconfig	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/input/keyboard/Kconfig	2005-08-30 16:33:05.000000000 +0200
-@@ -154,7 +154,7 @@
- 
- config KEYBOARD_HIL_OLD
- 	tristate "HP HIL keyboard support (simple driver)"
--	depends on GSC
-+	depends on GSC || HP300
- 	default y
- 	help
- 	  The "Human Interface Loop" is a older, 8-channel USB-like
-@@ -171,7 +171,7 @@
- 
- config KEYBOARD_HIL
- 	tristate "HP HIL keyboard support"
--	depends on GSC
-+	depends on GSC || HP300
- 	default y
- 	select HP_SDC
- 	select HIL_MLC
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/input/misc/Kconfig linux-2.6.13/drivers/input/misc/Kconfig
---- linux-2.6.13-i386/drivers/input/misc/Kconfig	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/input/misc/Kconfig	2005-08-30 16:33:05.000000000 +0200
-@@ -51,7 +51,7 @@
- 
- config HP_SDC_RTC
- 	tristate "HP SDC Real Time Clock"       
--	depends on GSC
-+	depends on GSC || HP300
- 	select HP_SDC
- 	help
- 	  Say Y here if you want to support the built-in real time clock
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/input/mouse/Kconfig linux-2.6.13/drivers/input/mouse/Kconfig
---- linux-2.6.13-i386/drivers/input/mouse/Kconfig	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/input/mouse/Kconfig	2005-08-30 16:33:05.000000000 +0200
-@@ -129,7 +129,7 @@
- 
- config MOUSE_HIL
- 	tristate "HIL pointers (mice etc)."     
--	depends on GSC
-+	depends on GSC || HP300
- 	select HP_SDC
- 	select HIL_MLC
- 	help
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/input/serio/Kconfig linux-2.6.13/drivers/input/serio/Kconfig
---- linux-2.6.13-i386/drivers/input/serio/Kconfig	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/input/serio/Kconfig	2005-08-30 16:33:05.000000000 +0200
-@@ -112,7 +112,7 @@
- 
- config HP_SDC
- 	tristate "HP System Device Controller i8042 Support"
--	depends on GSC && SERIO
-+	depends on (GSC || HP300) && SERIO
- 	default y
- 	---help---
- 	  This option enables supports for the the "System Device
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/macintosh/adb.c linux-2.6.13/drivers/macintosh/adb.c
---- linux-2.6.13-i386/drivers/macintosh/adb.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/macintosh/adb.c	2005-08-30 16:33:07.000000000 +0200
-@@ -476,13 +476,15 @@
- 		use_sreq = 1;
- 	} else
- 		use_sreq = 0;
--	req->nbytes = nbytes+1;
-+	i = (flags & ADBREQ_RAW) ? 0 : 1;
-+	req->nbytes = nbytes+i;
- 	req->done = done;
- 	req->reply_expected = flags & ADBREQ_REPLY;
- 	req->data[0] = ADB_PACKET;
- 	va_start(list, nbytes);
--	for (i = 0; i < nbytes; ++i)
--		req->data[i+1] = va_arg(list, int);
-+	while (i < req->nbytes) {
-+		req->data[i++] = va_arg(list, int);
-+	}
- 	va_end(list);
- 
- 	if (flags & ADBREQ_NOSEND)
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/net/Kconfig linux-2.6.13/drivers/net/Kconfig
---- linux-2.6.13-i386/drivers/net/Kconfig	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/net/Kconfig	2005-08-30 16:33:24.000000000 +0200
-@@ -294,7 +294,7 @@
- 
- config MAC89x0
- 	tristate "Macintosh CS89x0 based ethernet cards"
--	depends on NET_ETHERNET && MAC && BROKEN
-+	depends on NET_ETHERNET && MAC
- 	---help---
- 	  Support for CS89x0 chipset based Ethernet cards.  If you have a
- 	  Nubus or LC-PDS network (Ethernet) card of this type, say Y and
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/net/mac89x0.c linux-2.6.13/drivers/net/mac89x0.c
---- linux-2.6.13-i386/drivers/net/mac89x0.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/net/mac89x0.c	2004-12-30 16:38:24.000000000 +0100
-@@ -128,7 +128,7 @@
- extern void reset_chip(struct net_device *dev);
- #endif
- static int net_open(struct net_device *dev);
--static int	net_send_packet(struct sk_buff *skb, struct net_device *dev);
-+static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
- static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs *regs);
- static void set_multicast_list(struct net_device *dev);
- static void net_rx(struct net_device *dev);
-@@ -374,56 +374,37 @@
- static int
- net_send_packet(struct sk_buff *skb, struct net_device *dev)
- {
--	if (dev->tbusy) {
--		/* If we get here, some higher level has decided we are broken.
--		   There should really be a "kick me" function call instead. */
--		int tickssofar = jiffies - dev->trans_start;
--		if (tickssofar < 5)
--			return 1;
--		if (net_debug > 0) printk("%s: transmit timed out, %s?\n", dev->name,
--			   tx_done(dev) ? "IRQ conflict" : "network cable problem");
--		/* Try to restart the adaptor. */
--		dev->tbusy=0;
--		dev->trans_start = jiffies;
--	}
--
--	/* Block a timer-based transmit from overlapping.  This could better be
--	   done with atomic_swap(1, dev->tbusy), but set_bit() works as well. */
--	if (test_and_set_bit(0, (void*)&dev->tbusy) != 0)
--		printk("%s: Transmitter access conflict.\n", dev->name);
--	else {
--		struct net_local *lp = netdev_priv(dev);
--		unsigned long flags;
--
--		if (net_debug > 3)
--			printk("%s: sent %d byte packet of type %x\n",
--			       dev->name, skb->len,
--			       (skb->data[ETH_ALEN+ETH_ALEN] << 8)
--			       | skb->data[ETH_ALEN+ETH_ALEN+1]);
--
--		/* keep the upload from being interrupted, since we
--                   ask the chip to start transmitting before the
--                   whole packet has been completely uploaded. */
--		local_irq_save(flags);
--
--		/* initiate a transmit sequence */
--		writereg(dev, PP_TxCMD, lp->send_cmd);
--		writereg(dev, PP_TxLength, skb->len);
--
--		/* Test to see if the chip has allocated memory for the packet */
--		if ((readreg(dev, PP_BusST) & READY_FOR_TX_NOW) == 0) {
--			/* Gasp!  It hasn't.  But that shouldn't happen since
--			   we're waiting for TxOk, so return 1 and requeue this packet. */
--			local_irq_restore(flags);
--			return 1;
--		}
-+	struct net_local *lp = netdev_priv(dev);
-+	unsigned long flags;
- 
--		/* Write the contents of the packet */
--		memcpy_toio(dev->mem_start + PP_TxFrame, skb->data, skb->len+1);
-+	if (net_debug > 3)
-+		printk("%s: sent %d byte packet of type %x\n",
-+		       dev->name, skb->len,
-+		       (skb->data[ETH_ALEN+ETH_ALEN] << 8)
-+		       | skb->data[ETH_ALEN+ETH_ALEN+1]);
-+
-+	/* keep the upload from being interrupted, since we
-+	   ask the chip to start transmitting before the
-+	   whole packet has been completely uploaded. */
-+	local_irq_save(flags);
- 
-+	/* initiate a transmit sequence */
-+	writereg(dev, PP_TxCMD, lp->send_cmd);
-+	writereg(dev, PP_TxLength, skb->len);
-+
-+	/* Test to see if the chip has allocated memory for the packet */
-+	if ((readreg(dev, PP_BusST) & READY_FOR_TX_NOW) == 0) {
-+		/* Gasp!  It hasn't.  But that shouldn't happen since
-+		   we're waiting for TxOk, so return 1 and requeue this packet. */
- 		local_irq_restore(flags);
--		dev->trans_start = jiffies;
-+		return 1;
- 	}
-+
-+	/* Write the contents of the packet */
-+	memcpy((void *)(dev->mem_start + PP_TxFrame), skb->data, skb->len+1);
-+
-+	local_irq_restore(flags);
-+	dev->trans_start = jiffies;
- 	dev_kfree_skb (skb);
- 
- 	return 0;
-@@ -441,9 +422,6 @@
- 		printk ("net_interrupt(): irq %d for unknown device.\n", irq);
- 		return IRQ_NONE;
- 	}
--	if (dev->interrupt)
--		printk("%s: Re-entering the interrupt handler.\n", dev->name);
--	dev->interrupt = 1;
- 
- 	ioaddr = dev->base_addr;
- 	lp = netdev_priv(dev);
-@@ -464,8 +442,7 @@
- 			break;
- 		case ISQ_TRANSMITTER_EVENT:
- 			lp->stats.tx_packets++;
--			dev->tbusy = 0;
--			mark_bh(NET_BH);	/* Inform upper layers. */
-+			netif_wake_queue(dev);
- 			if ((status & TX_OK) == 0) lp->stats.tx_errors++;
- 			if (status & TX_LOST_CRS) lp->stats.tx_carrier_errors++;
- 			if (status & TX_SQE_ERROR) lp->stats.tx_heartbeat_errors++;
-@@ -479,8 +456,7 @@
-                                    That shouldn't happen since we only ever
-                                    load one packet.  Shrug.  Do the right
-                                    thing anyway. */
--				dev->tbusy = 0;
--				mark_bh(NET_BH);	/* Inform upper layers. */
-+				netif_wake_queue(dev);
- 			}
- 			if (status & TX_UNDERRUN) {
- 				if (net_debug > 0) printk("%s: transmit underrun\n", dev->name);
-@@ -497,7 +473,6 @@
- 			break;
- 		}
- 	}
--	dev->interrupt = 0;
- 	return IRQ_HANDLED;
- }
- 
-@@ -532,7 +507,7 @@
- 	skb_put(skb, length);
- 	skb->dev = dev;
- 
--	memcpy_fromio(skb->data, dev->mem_start + PP_RxFrame, length);
-+	memcpy(skb->data, (void *)(dev->mem_start + PP_RxFrame), length);
- 
- 	if (net_debug > 3)printk("%s: received %d byte packet of type %x\n",
-                                  dev->name, length,
-@@ -611,8 +586,6 @@
- static int set_mac_address(struct net_device *dev, void *addr)
- {
- 	int i;
--	if (dev->start)
--		return -EBUSY;
- 	printk("%s: Setting MAC address to ", dev->name);
- 	for (i = 0; i < 6; i++)
- 		printk(" %2.2x", dev->dev_addr[i] = ((unsigned char *)addr)[i]);
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/53c7xx.c linux-2.6.13/drivers/scsi/53c7xx.c
---- linux-2.6.13-i386/drivers/scsi/53c7xx.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/53c7xx.c	2005-06-19 16:34:18.000000000 +0200
-@@ -307,7 +307,7 @@
- 
- static int check_address (unsigned long addr, int size);
- static void dump_events (struct Scsi_Host *host, int count);
--static Scsi_Cmnd * return_outstanding_commands (struct Scsi_Host *host, 
-+static struct scsi_cmnd * return_outstanding_commands (struct Scsi_Host *host, 
-     int free, int issue);
- static void hard_reset (struct Scsi_Host *host);
- static void ncr_scsi_reset (struct Scsi_Host *host);
-@@ -316,7 +316,7 @@
-     int scntl3, int now_connected);
- static int datapath_residual (struct Scsi_Host *host);
- static const char * sbcl_to_phase (int sbcl);
--static void print_progress (Scsi_Cmnd *cmd);
-+static void print_progress (struct scsi_cmnd *cmd);
- static void print_queues (struct Scsi_Host *host);
- static void process_issue_queue (unsigned long flags);
- static int shutdown (struct Scsi_Host *host);
-@@ -341,9 +341,8 @@
- static void NCR53c7x0_soft_reset (struct Scsi_Host *host);
- 
- /* Size of event list (per host adapter) */
--static int track_events = 0;
--static struct Scsi_Host *first_host = NULL;	/* Head of list of NCR boards */
--static Scsi_Host_Template *the_template = NULL;	
-+static int track_events;
-+static Scsi_Host_Template *the_template;
- 
- /* NCR53c710 script handling code */
- 
-@@ -666,8 +665,11 @@
- 
- static struct Scsi_Host *
- find_host (int host) {
--    struct Scsi_Host *h;
--    for (h = first_host; h && h->host_no != host; h = h->next);
-+    struct Scsi_Host *h, *s;
-+    list_for_each_entry_safe(h, s, &the_template->legacy_hosts, sht_legacy_list) {
-+	if (h->host_no == host)
-+	    break;
-+    }
-     if (!h) {
- 	printk (KERN_ALERT "scsi%d not found\n", host);
- 	return NULL;
-@@ -715,14 +717,14 @@
-     }
-     hostdata = (struct NCR53c7x0_hostdata *)h->hostdata[0];
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     if (hostdata->initiate_sdtr & (1 << target)) {
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
- 	printk (KERN_ALERT "target %d already doing SDTR\n", target);
- 	return -1;
-     } 
-     hostdata->initiate_sdtr |= (1 << target);
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     return 0;
- }
- #endif
-@@ -1033,9 +1035,6 @@
-    
-     ccf = clock_to_ccf_710 (expected_clock);
- 
--    for (i = 0; i < 16; ++i) 
--	hostdata->cmd_allocated[i] = 0;
--
-     if (hostdata->init_save_regs)
-     	hostdata->init_save_regs (host);
-     if (hostdata->init_fixup)
-@@ -1043,7 +1042,6 @@
- 
-     if (!the_template) {
- 	the_template = host->hostt;
--	first_host = host;
-     }
- 
-     /* 
-@@ -1306,7 +1304,6 @@
-     hostdata->free->size = max_cmd_size;
-     hostdata->free->free = NULL;
-     hostdata->free->next = NULL;
--    hostdata->extra_allocate = 0;
- 
-     /* Allocate command start code space */
-     hostdata->schedule = (chip == 700 || chip == 70066) ?
-@@ -1589,10 +1586,10 @@
- 
-     /* The NCR chip _must_ be idle to run the test scripts */
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     if (!hostdata->idle) {
- 	printk ("scsi%d : chip not idle, aborting tests\n", host->host_no);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
- 	return -1;
-     }
- 
-@@ -1616,7 +1613,7 @@
- 	    NCR53c7x0_write8 (DCNTL_REG, hostdata->saved_dcntl | DCNTL_SSM |
- 						DCNTL_STD);
- 	printk (" started\n");
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
- 
- 	/* 
- 	 * This is currently a .5 second timeout, since (in theory) no slow 
-@@ -1655,7 +1652,7 @@
- 		hostdata->script, start);
- 	    printk ("scsi%d : DSPS = 0x%x\n", host->host_no,
- 		NCR53c7x0_read32(DSPS_REG));
--	    local_irq_restore(flags);
-+	    spin_unlock_irqrestore(host->host_lock, flags);
- 	    return -1;
- 	}
-     	hostdata->test_running = 0;
-@@ -1693,7 +1690,7 @@
- 	    local_irq_disable();
- 	    if (!hostdata->idle) {
- 		printk ("scsi%d : chip not idle, aborting tests\n", host->host_no);
--		local_irq_restore(flags);
-+		spin_unlock_irqrestore(host->host_lock, flags);
- 		return -1;
- 	    }
- 
-@@ -1709,7 +1706,7 @@
- 	    if (hostdata->options & OPTION_DEBUG_TRACE)
- 	        NCR53c7x0_write8 (DCNTL_REG, hostdata->saved_dcntl |
- 				DCNTL_SSM | DCNTL_STD);
--	    local_irq_restore(flags);
-+	    spin_unlock_irqrestore(host->host_lock, flags);
- 
- 	    timeout = jiffies + 5 * HZ;	/* arbitrary */
- 	    while ((hostdata->test_completed == -1) && time_before(jiffies, timeout))
-@@ -1731,19 +1728,19 @@
- 		    host->host_no, i);
- 		if (!hostdata->idle) {
- 		    printk("scsi%d : not idle\n", host->host_no);
--		    local_irq_restore(flags);
-+		    spin_unlock_irqrestore(host->host_lock, flags);
- 		    return -1;
- 		}
- 	    } else if (hostdata->test_completed == -1) {
- 		printk ("scsi%d : test 2 timed out\n", host->host_no);
--		local_irq_restore(flags);
-+		spin_unlock_irqrestore(host->host_lock, flags);
- 		return -1;
- 	    } 
- 	    hostdata->test_running = 0;
- 	}
-     }
- 
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     return 0;
- }
- 
-@@ -1759,7 +1756,7 @@
- 
- static void 
- NCR53c7xx_dsa_fixup (struct NCR53c7x0_cmd *cmd) {
--    Scsi_Cmnd *c = cmd->cmd;
-+    struct scsi_cmnd *c = cmd->cmd;
-     struct Scsi_Host *host = c->device->host;
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
-     	host->hostdata[0];
-@@ -1845,7 +1842,7 @@
-  *
-  * Purpose : mark SCSI command as finished, OR'ing the host portion 
-  *	of the result word into the result field of the corresponding
-- *	Scsi_Cmnd structure, and removing it from the internal queues.
-+ *	scsi_cmnd structure, and removing it from the internal queues.
-  *
-  * Inputs : cmd - command, result - entire result field
-  *
-@@ -1856,7 +1853,7 @@
- 
- static void 
- abnormal_finished (struct NCR53c7x0_cmd *cmd, int result) {
--    Scsi_Cmnd *c = cmd->cmd;
-+    struct scsi_cmnd *c = cmd->cmd;
-     struct Scsi_Host *host = c->device->host;
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
-     	host->hostdata[0];
-@@ -1870,7 +1867,7 @@
-     printk ("scsi%d: abnormal finished\n", host->host_no);
- #endif
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     found = 0;
-     /* 
-      * Traverse the NCR issue array until we find a match or run out 
-@@ -1953,7 +1950,7 @@
-     c->result = result;
-     c->scsi_done(c);
- 
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     run_process_issue_queue();
- }
- 
-@@ -1975,7 +1972,7 @@
-     NCR53c7x0_local_declare();
-     struct NCR53c7x0_break *bp;
- #if 0
--    Scsi_Cmnd *c = cmd ? cmd->cmd : NULL;
-+    struct scsi_cmnd *c = cmd ? cmd->cmd : NULL;
- #endif
-     u32 *dsp;
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
-@@ -1988,7 +1985,7 @@
-      * dump the appropriate debugging information to standard 
-      * output.  
-      */
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     dsp = (u32 *) bus_to_virt(NCR53c7x0_read32(DSP_REG));
-     for (bp = hostdata->breakpoints; bp && bp->address != dsp; 
-     	bp = bp->next);
-@@ -2010,7 +2007,7 @@
-      * instruction in bytes.
-      */
- 
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
- }
- /*
-  * Function : static void print_synchronous (const char *prefix, 
-@@ -2252,7 +2249,7 @@
-     NCR53c7x0_cmd *cmd) {
-     NCR53c7x0_local_declare();
-     int print;
--    Scsi_Cmnd *c = cmd ? cmd->cmd : NULL;
-+    struct scsi_cmnd *c = cmd ? cmd->cmd : NULL;
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
- 	host->hostdata[0];		
-     u32 dsps,*dsp;	/* Argument of the INT instruction */
-@@ -2916,7 +2913,7 @@
- 	host->hostdata[0];
-     NCR53c7x0_local_setup(host);
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
- 
-     /* Disable scsi chip and s/w level 7 ints */
- 
-@@ -3017,12 +3014,12 @@
-     }
- #endif
-     /* Anything needed for your hardware? */
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
- }
- 
- 
- /*
-- * Function static struct NCR53c7x0_cmd *allocate_cmd (Scsi_Cmnd *cmd)
-+ * Function static struct NCR53c7x0_cmd *allocate_cmd (struct scsi_cmnd *cmd)
-  * 
-  * Purpose : Return the first free NCR53c7x0_cmd structure (which are 
-  * 	reused in a LIFO manner to minimize cache thrashing).
-@@ -3049,86 +3046,25 @@
- }
- 
- static struct NCR53c7x0_cmd *
--allocate_cmd (Scsi_Cmnd *cmd) {
-+allocate_cmd (struct scsi_cmnd *cmd) {
-     struct Scsi_Host *host = cmd->device->host;
-     struct NCR53c7x0_hostdata *hostdata = 
- 	(struct NCR53c7x0_hostdata *) host->hostdata[0];
--    u32 real;			/* Real address */
--    int size;			/* Size of *tmp */
-     struct NCR53c7x0_cmd *tmp;
-     unsigned long flags;
- 
-     if (hostdata->options & OPTION_DEBUG_ALLOCATION)
- 	printk ("scsi%d : num_cmds = %d, can_queue = %d\n"
--		"         target = %d, lun = %d, %s\n",
-+		"         target = %d, lun = %d\n",
- 	    host->host_no, hostdata->num_cmds, host->can_queue,
--	    cmd->device->id, cmd->device->lun, (hostdata->cmd_allocated[cmd->device->id] &
--		(1 << cmd->device->lun)) ? "already allocated" : "not allocated");
--
--/*
-- * If we have not yet reserved commands for this I_T_L nexus, and
-- * the device exists (as indicated by permanent Scsi_Cmnd structures
-- * being allocated under 1.3.x, or being outside of scan_scsis in
-- * 1.2.x), do so now.
-- */
--    if (!(hostdata->cmd_allocated[cmd->device->id] & (1 << cmd->device->lun)) &&
--				cmd->device && cmd->device->has_cmdblocks) {
--      if ((hostdata->extra_allocate + hostdata->num_cmds) < host->can_queue)
--          hostdata->extra_allocate += host->cmd_per_lun;
--      hostdata->cmd_allocated[cmd->device->id] |= (1 << cmd->device->lun);
--    }
--
--    for (; hostdata->extra_allocate > 0 ; --hostdata->extra_allocate, 
--    	++hostdata->num_cmds) {
--    /* historically, kmalloc has returned unaligned addresses; pad so we
--       have enough room to ROUNDUP */
--	size = hostdata->max_cmd_size + sizeof (void *);
--#ifdef FORCE_DSA_ALIGNMENT
--	/*
--	 * 53c710 rev.0 doesn't have an add-with-carry instruction.
--	 * Ensure we allocate enough memory to force alignment.
--	 */
--	size += 256;
--#endif
--/* FIXME: for ISA bus '7xx chips, we need to or GFP_DMA in here */
-+	    cmd->device->id, cmd->device->lun);
- 
--        if (size > 4096) {
--            printk (KERN_ERR "53c7xx: allocate_cmd size > 4K\n");
--	    return NULL;
--	}
--        real = get_zeroed_page(GFP_ATOMIC);
--        if (real == 0)
--        	return NULL;
--        memset((void *)real, 0, 4096);
--        cache_push(virt_to_phys((void *)real), 4096);
--        cache_clear(virt_to_phys((void *)real), 4096);
--        kernel_set_cachemode((void *)real, 4096, IOMAP_NOCACHE_SER);
--	tmp = ROUNDUP(real, void *);
--#ifdef FORCE_DSA_ALIGNMENT
--	{
--	    if (((u32)tmp & 0xff) > CmdPageStart)
--		tmp = (struct NCR53c7x0_cmd *)((u32)tmp + 255);
--	    tmp = (struct NCR53c7x0_cmd *)(((u32)tmp & ~0xff) + CmdPageStart);
--#if 0
--	    printk ("scsi: size = %d, real = 0x%08x, tmp set to 0x%08x\n",
--			size, real, (u32)tmp);
--#endif
--	}
--#endif
--	tmp->real = (void *)real;
--	tmp->size = size;			
--	tmp->free = ((void (*)(void *, int)) my_free_page);
--	local_irq_save(flags);
--	tmp->next = hostdata->free;
--	hostdata->free = tmp;
--	local_irq_restore(flags);
--    }
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     tmp = (struct NCR53c7x0_cmd *) hostdata->free;
-     if (tmp) {
- 	hostdata->free = tmp->next;
-     }
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     if (!tmp)
- 	printk ("scsi%d : can't allocate command for target %d lun %d\n",
- 	    host->host_no, cmd->device->id, cmd->device->lun);
-@@ -3136,11 +3072,11 @@
- }
- 
- /*
-- * Function static struct NCR53c7x0_cmd *create_cmd (Scsi_Cmnd *cmd) 
-+ * Function static struct NCR53c7x0_cmd *create_cmd (struct scsi_cmnd *cmd) 
-  *
-  *
-  * Purpose : allocate a NCR53c7x0_cmd structure, initialize it based on the 
-- * 	Scsi_Cmnd structure passed in cmd, including dsa and Linux field 
-+ * 	scsi_cmnd structure passed in cmd, including dsa and Linux field 
-  * 	initialization, and dsa code relocation.
-  *
-  * Inputs : cmd - SCSI command
-@@ -3149,7 +3085,7 @@
-  *	NULL on failure.
-  */
- static struct NCR53c7x0_cmd *
--create_cmd (Scsi_Cmnd *cmd) {
-+create_cmd (struct scsi_cmnd *cmd) {
-     NCR53c7x0_local_declare();
-     struct Scsi_Host *host = cmd->device->host;
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
-@@ -3173,7 +3109,7 @@
- 	return NULL;
- 
-     /*
--     * Copy CDB and initialised result fields from Scsi_Cmnd to NCR53c7x0_cmd.
-+     * Copy CDB and initialised result fields from scsi_cmnd to NCR53c7x0_cmd.
-      * We do this because NCR53c7x0_cmd may have a special cache mode
-      * selected to cope with lack of bus snooping, etc.
-      */
-@@ -3316,7 +3252,7 @@
- 
-     patch_dsa_32(tmp->dsa, dsa_next, 0, 0);
-     /*
--     * XXX is this giving 53c710 access to the Scsi_Cmnd in some way?
-+     * XXX is this giving 53c710 access to the scsi_cmnd in some way?
-      * Do we need to change it for caching reasons?
-      */
-     patch_dsa_32(tmp->dsa, dsa_cmnd, 0, virt_to_bus(cmd));
-@@ -3347,17 +3283,17 @@
- 	memcpy ((void *) (tmp->select + 1), (void *) wdtr_message,
- 	    sizeof(wdtr_message));
-     	patch_dsa_32(tmp->dsa, dsa_msgout, 0, 1 + sizeof(wdtr_message));
--	local_irq_save(flags);
-+	spin_lock_irqsave(host->host_lock, flags);
- 	hostdata->initiate_wdtr &= ~(1 << cmd->device->id);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
-     } else if (hostdata->initiate_sdtr & (1 << cmd->device->id)) {
- 	memcpy ((void *) (tmp->select + 1), (void *) sdtr_message, 
- 	    sizeof(sdtr_message));
-     	patch_dsa_32(tmp->dsa, dsa_msgout, 0, 1 + sizeof(sdtr_message));
- 	tmp->flags |= CMD_FLAG_SDTR;
--	local_irq_save(flags);
-+	spin_lock_irqsave(host->host_lock, flags);
- 	hostdata->initiate_sdtr &= ~(1 << cmd->device->id);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
-     
-     }
- #if 1
-@@ -3570,8 +3506,8 @@
- }
- 
- /*
-- * Function : int NCR53c7xx_queue_command (Scsi_Cmnd *cmd,
-- *      void (*done)(Scsi_Cmnd *))
-+ * Function : int NCR53c7xx_queue_command (struct scsi_cmnd *cmd,
-+ *      void (*done)(struct scsi_cmnd *))
-  *
-  * Purpose :  enqueues a SCSI command
-  *
-@@ -3585,18 +3521,18 @@
-  *      twiddling done to the host specific fields of cmd.  If the
-  *      process_issue_queue coroutine isn't running, it is restarted.
-  * 
-- * NOTE : we use the host_scribble field of the Scsi_Cmnd structure to 
-+ * NOTE : we use the host_scribble field of the scsi_cmnd structure to 
-  *	hold our own data, and pervert the ptr field of the SCp field
-  *	to create a linked list.
-  */
- 
- int
--NCR53c7xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) {
-+NCR53c7xx_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) {
-     struct Scsi_Host *host = cmd->device->host;
-     struct NCR53c7x0_hostdata *hostdata = 
- 	(struct NCR53c7x0_hostdata *) host->hostdata[0];
-     unsigned long flags;
--    Scsi_Cmnd *tmp;
-+    struct scsi_cmnd *tmp;
- 
-     cmd->scsi_done = done;
-     cmd->host_scribble = NULL;
-@@ -3614,7 +3550,7 @@
-     }
- #endif
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     if ((hostdata->options & (OPTION_DEBUG_INIT_ONLY|OPTION_DEBUG_PROBE_ONLY)) 
- 	|| ((hostdata->options & OPTION_DEBUG_TARGET_LIMIT) &&
- 	    !(hostdata->debug_lun_limit[cmd->device->id] & (1 << cmd->device->lun)))
-@@ -3629,7 +3565,7 @@
- 	    cmd->device->id, cmd->device->lun);
- 	cmd->result = (DID_BAD_TARGET << 16);
- 	done(cmd);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
- 	return 0;
-     }
- 
-@@ -3638,7 +3574,7 @@
- 	printk("scsi%d : maximum commands exceeded\n", host->host_no);
- 	cmd->result = (DID_BAD_TARGET << 16);
- 	done(cmd);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
- 	return 0;
-     }
- 
-@@ -3650,7 +3586,7 @@
- 		host->host_no);
- 	    cmd->result = (DID_BAD_TARGET << 16);
- 	    done(cmd);
--	    local_irq_restore(flags);
-+	    spin_unlock_irqrestore(host->host_lock, flags);
- 	    return 0;
- 	}
-     }
-@@ -3673,18 +3609,18 @@
- 	cmd->SCp.ptr = (unsigned char *) hostdata->issue_queue;
- 	hostdata->issue_queue = cmd;
-     } else {
--	for (tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp->SCp.ptr; 
--		tmp = (Scsi_Cmnd *) tmp->SCp.ptr);
-+	for (tmp = (struct scsi_cmnd *) hostdata->issue_queue; tmp->SCp.ptr; 
-+		tmp = (struct scsi_cmnd *) tmp->SCp.ptr);
- 	tmp->SCp.ptr = (unsigned char *) cmd;
-     }
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     run_process_issue_queue();
-     return 0;
- }
- 
- /*
-  * Function : void to_schedule_list (struct Scsi_Host *host,
-- * 	struct NCR53c7x0_hostdata * hostdata, Scsi_Cmnd *cmd)
-+ * 	struct NCR53c7x0_hostdata * hostdata, struct scsi_cmnd *cmd)
-  *
-  * Purpose : takes a SCSI command which was just removed from the 
-  *	issue queue, and deals with it by inserting it in the first
-@@ -3705,7 +3641,7 @@
- to_schedule_list (struct Scsi_Host *host, struct NCR53c7x0_hostdata *hostdata,
-     struct NCR53c7x0_cmd *cmd) {
-     NCR53c7x0_local_declare();
--    Scsi_Cmnd *tmp = cmd->cmd;
-+    struct scsi_cmnd *tmp = cmd->cmd;
-     unsigned long flags;
-     /* dsa start is negative, so subtraction is used */
-     volatile u32 *ncrcurrent;
-@@ -3717,7 +3653,7 @@
- 	virt_to_bus(hostdata->dsa), hostdata->dsa);
- #endif
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     
-     /* 
-      * Work around race condition : if an interrupt fired and we 
-@@ -3730,7 +3666,7 @@
- 	cmd->next = (struct NCR53c7x0_cmd *) hostdata->free;
- 	hostdata->free = cmd;
- 	tmp->scsi_done(tmp);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
- 	return;
-     }
- 
-@@ -3760,7 +3696,7 @@
- 	cmd->next = (struct NCR53c7x0_cmd *) hostdata->free;
- 	hostdata->free = cmd;
- 	tmp->scsi_done(tmp);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
- 	return;
-     }
- 
-@@ -3781,12 +3717,12 @@
- 	NCR53c7x0_write8(hostdata->istat, ISTAT_10_SIGP);
-     }
- 
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
- }
- 
- /*
-  * Function : busyp (struct Scsi_Host *host, struct NCR53c7x0_hostdata 
-- *	*hostdata, Scsi_Cmnd *cmd)
-+ *	*hostdata, struct scsi_cmnd *cmd)
-  *
-  * Purpose : decide if we can pass the given SCSI command on to the 
-  *	device in question or not.
-@@ -3796,7 +3732,7 @@
- 
- static __inline__ int
- busyp (struct Scsi_Host *host, struct NCR53c7x0_hostdata *hostdata, 
--    Scsi_Cmnd *cmd) {
-+    struct scsi_cmnd *cmd) {
-     /* FIXME : in the future, this needs to accommodate SCSI-II tagged
-        queuing, and we may be able to play with fairness here a bit.
-      */
-@@ -3822,8 +3758,8 @@
- 
- static void 
- process_issue_queue (unsigned long flags) {
--    Scsi_Cmnd *tmp, *prev;
--    struct Scsi_Host *host;
-+    struct scsi_cmnd *tmp, *prev;
-+    struct Scsi_Host *host, *s;
-     struct NCR53c7x0_hostdata *hostdata;
-     int done;
- 
-@@ -3841,14 +3777,13 @@
-     do {
- 	local_irq_disable(); /* Freeze request queues */
- 	done = 1;
--	for (host = first_host; host && host->hostt == the_template;
--	    host = host->next) {
-+	list_for_each_entry_safe(host, s, &the_template->legacy_hosts, sht_legacy_list) {
- 	    hostdata = (struct NCR53c7x0_hostdata *) host->hostdata[0];
--	    local_irq_disable();
-+	    spin_lock_irq(host->host_lock);
- 	    if (hostdata->issue_queue) {
- 	    	if (hostdata->state == STATE_DISABLED) {
--		    tmp = (Scsi_Cmnd *) hostdata->issue_queue;
--		    hostdata->issue_queue = (Scsi_Cmnd *) tmp->SCp.ptr;
-+		    tmp = (struct scsi_cmnd *) hostdata->issue_queue;
-+		    hostdata->issue_queue = (struct scsi_cmnd *) tmp->SCp.ptr;
- 		    tmp->result = (DID_BAD_TARGET << 16);
- 		    if (tmp->host_scribble) {
- 			((struct NCR53c7x0_cmd *)tmp->host_scribble)->next = 
-@@ -3860,15 +3795,15 @@
- 		    tmp->scsi_done (tmp);
- 		    done = 0;
- 		} else 
--		    for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, 
--			prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) 
-+		    for (tmp = (struct scsi_cmnd *) hostdata->issue_queue, 
-+			prev = NULL; tmp; prev = tmp, tmp = (struct scsi_cmnd *) 
- 			tmp->SCp.ptr) 
- 			if (!tmp->host_scribble || 
- 			    !busyp (host, hostdata, tmp)) {
- 				if (prev)
- 				    prev->SCp.ptr = tmp->SCp.ptr;
- 				else
--				    hostdata->issue_queue = (Scsi_Cmnd *) 
-+				    hostdata->issue_queue = (struct scsi_cmnd *) 
- 					tmp->SCp.ptr;
- 			    tmp->SCp.ptr = NULL;
- 			    if (tmp->host_scribble) {
-@@ -3893,6 +3828,7 @@
- 			    done = 0;
- 			} /* if target/lun is not busy */
- 	    } /* if hostdata->issue_queue */
-+	    spin_unlock(host->host_lock);
- 	    if (!done)
- 		local_irq_restore(flags);
-     	} /* for host */
-@@ -4103,7 +4039,7 @@
- 	int cnt = 0;
- 	int i = insn_log_index;
- 	int size;
--	struct Scsi_Host *host = first_host;
-+	struct Scsi_Host *host = (struct Scsi_Host *)the_template->legacy_hosts->next;
- 
- 	while (cnt < 4096) {
- 		printk ("%08x (+%6x): ", insn_log[i], (insn_log[i] - (u32)&(((struct NCR53c7x0_hostdata *)host->hostdata[0])->script))/4);
-@@ -4161,14 +4097,14 @@
-     * completion.
-     */
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
- restart:
-     for (cmd_prev_ptr = (struct NCR53c7x0_cmd **)&(hostdata->running_list),
- 	cmd = (struct NCR53c7x0_cmd *) hostdata->running_list; cmd ;
- 	cmd_prev_ptr = (struct NCR53c7x0_cmd **) &(cmd->next), 
-     	cmd = (struct NCR53c7x0_cmd *) cmd->next)
-     {
--	Scsi_Cmnd *tmp;
-+	struct scsi_cmnd *tmp;
- 
- 	if (!cmd) {
- 	    printk("scsi%d : very weird.\n", host->host_no);
-@@ -4176,7 +4112,7 @@
- 	}
- 
- 	if (!(tmp = cmd->cmd)) {
--	    printk("scsi%d : weird.  NCR53c7x0_cmd has no Scsi_Cmnd\n",
-+	    printk("scsi%d : weird.  NCR53c7x0_cmd has no scsi_cmnd\n",
- 		    host->host_no);
- 	    continue;
- 	}
-@@ -4215,7 +4151,7 @@
- 	tmp->scsi_done(tmp);
- 	goto restart;
-     }
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
- 
-     if (!search_found)  {
- 	printk ("scsi%d : WARNING : INTFLY with no completed commands.\n",
-@@ -4250,7 +4186,7 @@
-     struct NCR53c7x0_cmd *cmd;			/* command which halted */
-     u32 *dsa;					/* DSA */
-     int handled = 0;
--
-+    unsigned long flags;
- #ifdef NCR_DEBUG
-     char buf[80];				/* Debugging sprintf buffer */
-     size_t buflen;				/* Length of same */
-@@ -4259,6 +4195,7 @@
-     host     = (struct Scsi_Host *)dev_id;
-     hostdata = (struct NCR53c7x0_hostdata *) host->hostdata[0];
-     NCR53c7x0_local_setup(host);
-+    spin_lock_irqsave(host->host_lock, flags);
- 
-     /*
-      * Only read istat once per loop, since reading it again will unstack
-@@ -4351,7 +4288,8 @@
- 	    }
- 	}
-     }
--    return IRQ_HANDLED;
-+    spin_unlock_irqrestore(host->host_lock, flags);
-+    return IRQ_RETVAL(handled);
- }
- 
- 
-@@ -4360,7 +4298,7 @@
-  *
-  * Purpose : Assuming that the NCR SCSI processor is currently 
-  * 	halted, break the currently established nexus.  Clean
-- *	up of the NCR53c7x0_cmd and Scsi_Cmnd structures should
-+ *	up of the NCR53c7x0_cmd and scsi_cmnd structures should
-  *	be done on receipt of the abort interrupt.
-  *
-  * Inputs : host - SCSI host
-@@ -4899,12 +4837,12 @@
- 	    /* Don't print instr. until we write DSP at end of intr function */
- 	} else if (hostdata->options & OPTION_DEBUG_SINGLE) {
- 	    print_insn (host, dsp, "s ", 0);
--	    local_irq_save(flags);
-+	    spin_lock_irqsave(host->host_lock, flags);
- /* XXX - should we do this, or can we get away with writing dsp? */
- 
- 	    NCR53c7x0_write8 (DCNTL_REG, (NCR53c7x0_read8(DCNTL_REG) & 
-     	    	~DCNTL_SSM) | DCNTL_STD);
--	    local_irq_restore(flags);
-+	    spin_unlock_irqrestore(host->host_lock, flags);
- 	} else {
- 	    printk(KERN_ALERT "scsi%d : unexpected single step interrupt at\n"
- 		   "         ", host->host_no);
-@@ -5127,7 +5065,7 @@
- }
- 
- /*
-- * Function : int NCR53c7xx_abort (Scsi_Cmnd *cmd)
-+ * Function : int NCR53c7xx_abort (struct scsi_cmnd *cmd)
-  * 
-  * Purpose : Abort an errant SCSI command, doing all necessary
-  *	cleanup of the issue_queue, running_list, shared Linux/NCR
-@@ -5139,14 +5077,14 @@
-  */
- 
- int 
--NCR53c7xx_abort (Scsi_Cmnd *cmd) {
-+NCR53c7xx_abort (struct scsi_cmnd *cmd) {
-     NCR53c7x0_local_declare();
-     struct Scsi_Host *host = cmd->device->host;
-     struct NCR53c7x0_hostdata *hostdata = host ? (struct NCR53c7x0_hostdata *) 
- 	host->hostdata[0] : NULL;
-     unsigned long flags;
-     struct NCR53c7x0_cmd *curr, **prev;
--    Scsi_Cmnd *me, **last;
-+    struct scsi_cmnd *me, **last;
- #if 0
-     static long cache_pid = -1;
- #endif
-@@ -5155,10 +5093,10 @@
-     if (!host) {
- 	printk ("Bogus SCSI command pid %ld; no host structure\n",
- 	    cmd->pid);
--	return SCSI_ABORT_ERROR;
-+	return FAILED;
-     } else if (!hostdata) {
- 	printk ("Bogus SCSI host %d; no hostdata\n", host->host_no);
--	return SCSI_ABORT_ERROR;
-+	return FAILED;
-     }
-     NCR53c7x0_local_setup(host);
- 
-@@ -5179,10 +5117,10 @@
- 	printk ("scsi%d : dropped interrupt for command %ld\n", host->host_no,
- 	    cmd->pid);
- 	NCR53c7x0_intr (host->irq, NULL, NULL);
--	return SCSI_ABORT_BUSY;
-+	return FAILED;
-     }
- 	
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
- #if 0
-     if (cache_pid == cmd->pid) 
- 	panic ("scsi%d : bloody fetus %d\n", host->host_no, cmd->pid);
-@@ -5201,13 +5139,13 @@
-  * pull the command out of the old queue, and call it aborted.
-  */
- 
--    for (me = (Scsi_Cmnd *) hostdata->issue_queue, 
--         last = (Scsi_Cmnd **) &(hostdata->issue_queue);
--	 me && me != cmd;  last = (Scsi_Cmnd **)&(me->SCp.ptr), 
--	 me = (Scsi_Cmnd *)me->SCp.ptr);
-+    for (me = (struct scsi_cmnd *) hostdata->issue_queue, 
-+         last = (struct scsi_cmnd **) &(hostdata->issue_queue);
-+	 me && me != cmd;  last = (struct scsi_cmnd **)&(me->SCp.ptr), 
-+	 me = (struct scsi_cmnd *)me->SCp.ptr);
- 
-     if (me) {
--	*last = (Scsi_Cmnd *) me->SCp.ptr;
-+	*last = (struct scsi_cmnd *) me->SCp.ptr;
- 	if (me->host_scribble) {
- 	    ((struct NCR53c7x0_cmd *)me->host_scribble)->next = hostdata->free;
- 	    hostdata->free = (struct NCR53c7x0_cmd *) me->host_scribble;
-@@ -5217,9 +5155,9 @@
- 	cmd->scsi_done(cmd);
- 	printk ("scsi%d : found command %ld in Linux issue queue\n", 
- 	    host->host_no, me->pid);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
-     	run_process_issue_queue();
--	return SCSI_ABORT_SUCCESS;
-+	return SUCCESS;
-     }
- 
- /* 
-@@ -5243,13 +5181,13 @@
- 	    cmd->scsi_done(cmd);
- 	printk ("scsi%d : found finished command %ld in running list\n", 
- 	    host->host_no, cmd->pid);
--	    local_irq_restore(flags);
--	    return SCSI_ABORT_NOT_RUNNING;
-+	    spin_unlock_irqrestore(host->host_lock, flags);
-+	    return SUCCESS;
- 	} else {
- 	    printk ("scsi%d : DANGER : command running, can not abort.\n",
- 		cmd->device->host->host_no);
--	    local_irq_restore(flags);
--	    return SCSI_ABORT_BUSY;
-+	    spin_unlock_irqrestore(host->host_lock, flags);
-+	    return FAILED;
- 	}
-     }
- 
-@@ -5280,21 +5218,20 @@
-  */
-         --hostdata->busy[cmd->device->id][cmd->device->lun];
-     }
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     cmd->scsi_done(cmd);
- 
- /* 
-  * We need to run process_issue_queue since termination of this command 
-  * may allow another queued command to execute first? 
-  */
--    return SCSI_ABORT_NOT_RUNNING;
-+    return SUCCESS;
- }
- 
- /*
-- * Function : int NCR53c7xx_reset (Scsi_Cmnd *cmd) 
-+ * Function : int NCR53c7xx_reset (struct scsi_cmnd *cmd) 
-  * 
-- * Purpose : perform a hard reset of the SCSI bus and NCR
-- * 	chip.
-+ * Purpose : perform a hard reset of the SCSI bus.
-  *
-  * Inputs : cmd - command which caused the SCSI RESET
-  *
-@@ -5302,12 +5239,12 @@
-  */
-  
- int 
--NCR53c7xx_reset (Scsi_Cmnd *cmd, unsigned int reset_flags) {
-+NCR53c7xx_reset (struct scsi_cmnd *cmd) {
-     NCR53c7x0_local_declare();
-     unsigned long flags;
-     int found = 0;
-     struct NCR53c7x0_cmd * c;
--    Scsi_Cmnd *tmp;
-+    struct scsi_cmnd *tmp;
-     /*
-      * When we call scsi_done(), it's going to wake up anything sleeping on the
-      * resources which were in use by the aborted commands, and we'll start to 
-@@ -5322,19 +5259,19 @@
-      * pointer), do our reinitialization, and then call the done function for
-      * each command.  
-      */
--    Scsi_Cmnd *nuke_list = NULL;
-+    struct scsi_cmnd *nuke_list = NULL;
-     struct Scsi_Host *host = cmd->device->host;
-     struct NCR53c7x0_hostdata *hostdata = 
-     	(struct NCR53c7x0_hostdata *) host->hostdata[0];
- 
-     NCR53c7x0_local_setup(host);
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     ncr_halt (host);
-     print_lots (host);
-     dump_events (host, 30);
-     ncr_scsi_reset (host);
-     for (tmp = nuke_list = return_outstanding_commands (host, 1 /* free */,
--	0 /* issue */ ); tmp; tmp = (Scsi_Cmnd *) tmp->SCp.buffer)
-+	0 /* issue */ ); tmp; tmp = (struct scsi_cmnd *) tmp->SCp.buffer)
- 	if (tmp == cmd) {
- 	    found = 1;
- 	    break;
-@@ -5357,19 +5294,21 @@
-     }
- 
-     NCR53c7x0_driver_init (host);
-+#if 0
-     hostdata->soft_reset (host);
-+#endif
-     if (hostdata->resets == 0) 
- 	disable(host);
-     else if (hostdata->resets != -1)
- 	--hostdata->resets;
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     for (; nuke_list; nuke_list = tmp) {
--	tmp = (Scsi_Cmnd *) nuke_list->SCp.buffer;
-+	tmp = (struct scsi_cmnd *) nuke_list->SCp.buffer;
-     	nuke_list->result = DID_RESET << 16;
- 	nuke_list->scsi_done (nuke_list);
-     }
--    local_irq_restore(flags);
--    return SCSI_RESET_SUCCESS;
-+    spin_unlock_irqrestore(host->host_lock, flags);
-+    return SUCCESS;
- }
- 
- /*
-@@ -5378,7 +5317,7 @@
-  */
- 
- /*
-- * Function : int insn_to_offset (Scsi_Cmnd *cmd, u32 *insn)
-+ * Function : int insn_to_offset (struct scsi_cmnd *cmd, u32 *insn)
-  *
-  * Purpose : convert instructions stored at NCR pointer into data 
-  *	pointer offset.
-@@ -5391,7 +5330,7 @@
- 
- 
- static int 
--insn_to_offset (Scsi_Cmnd *cmd, u32 *insn) {
-+insn_to_offset (struct scsi_cmnd *cmd, u32 *insn) {
-     struct NCR53c7x0_hostdata *hostdata = 
- 	(struct NCR53c7x0_hostdata *) cmd->device->host->hostdata[0];
-     struct NCR53c7x0_cmd *ncmd = 
-@@ -5445,7 +5384,7 @@
- 
- 
- /*
-- * Function : void print_progress (Scsi_Cmnd *cmd) 
-+ * Function : void print_progress (struct scsi_cmnd *cmd) 
-  * 
-  * Purpose : print the current location of the saved data pointer
-  *
-@@ -5454,7 +5393,7 @@
-  */
- 
- static void 
--print_progress (Scsi_Cmnd *cmd) {
-+print_progress (struct scsi_cmnd *cmd) {
-     NCR53c7x0_local_declare();
-     struct NCR53c7x0_cmd *ncmd = 
- 	(struct NCR53c7x0_cmd *) cmd->host_scribble;
-@@ -5512,7 +5451,7 @@
- 	host->hostdata[0];
-     int i, len;
-     char *ptr;
--    Scsi_Cmnd *cmd;
-+    struct scsi_cmnd *cmd;
- 
-     if (check_address ((unsigned long) dsa, hostdata->dsa_end - 
- 	hostdata->dsa_start) == -1) {
-@@ -5548,7 +5487,7 @@
- 
-     printk("        + %d : select_indirect = 0x%x\n",
- 	hostdata->dsa_select, dsa[hostdata->dsa_select / sizeof(u32)]);
--    cmd = (Scsi_Cmnd *) bus_to_virt(dsa[hostdata->dsa_cmnd / sizeof(u32)]);
-+    cmd = (struct scsi_cmnd *) bus_to_virt(dsa[hostdata->dsa_cmnd / sizeof(u32)]);
-     printk("        + %d : dsa_cmnd = 0x%x ", hostdata->dsa_cmnd,
- 	   (u32) virt_to_bus(cmd));
-     /* XXX Maybe we should access cmd->host_scribble->result here. RGH */
-@@ -5588,16 +5527,16 @@
-     u32 *dsa, *next_dsa;
-     volatile u32 *ncrcurrent;
-     int left;
--    Scsi_Cmnd *cmd, *next_cmd;
-+    struct scsi_cmnd *cmd, *next_cmd;
-     unsigned long flags;
- 
-     printk ("scsi%d : issue queue\n", host->host_no);
- 
--    for (left = host->can_queue, cmd = (Scsi_Cmnd *) hostdata->issue_queue; 
-+    for (left = host->can_queue, cmd = (struct scsi_cmnd *) hostdata->issue_queue; 
- 	    left >= 0 && cmd; 
- 	    cmd = next_cmd) {
--	next_cmd = (Scsi_Cmnd *) cmd->SCp.ptr;
--	local_irq_save(flags);
-+	next_cmd = (struct scsi_cmnd *) cmd->SCp.ptr;
-+	spin_lock_irqsave(host->host_lock, flags);
- 	if (cmd->host_scribble) {
- 	    if (check_address ((unsigned long) (cmd->host_scribble), 
- 		sizeof (cmd->host_scribble)) == -1)
-@@ -5610,7 +5549,7 @@
- 	} else 
- 	    printk ("scsi%d : scsi pid %ld for target %d lun %d has no NCR53c7x0_cmd\n",
- 		host->host_no, cmd->pid, cmd->device->id, cmd->device->lun);
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
-     }
- 
-     if (left <= 0) {
-@@ -5642,7 +5581,7 @@
- 	dsa = bus_to_virt (hostdata->reconnect_dsa_head);
- 	left >= 0 && dsa; 
- 	dsa = next_dsa) {
--	local_irq_save(flags);
-+	spin_lock_irqsave(host->host_lock, flags);
- 	if (check_address ((unsigned long) dsa, sizeof(dsa)) == -1) {
- 	    printk ("scsi%d: bad DSA pointer 0x%p", host->host_no,
- 		dsa);
-@@ -5653,7 +5592,7 @@
- 	    next_dsa = bus_to_virt(dsa[hostdata->dsa_next / sizeof(u32)]);
- 	    print_dsa (host, dsa, "");
- 	}
--	local_irq_restore(flags);
-+	spin_unlock_irqrestore(host->host_lock, flags);
-     }
-     printk ("scsi%d : end reconnect_dsa_head\n", host->host_no);
-     if (left < 0)
-@@ -5743,14 +5682,14 @@
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
- 	host->hostdata[0];
-     NCR53c7x0_local_setup(host);
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
- /* Get in a state where we can reset the SCSI bus */
-     ncr_halt (host);
-     ncr_scsi_reset (host);
-     hostdata->soft_reset(host);
- 
-     disable (host);
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     return 0;
- }
- 
-@@ -5765,11 +5704,11 @@
-     NCR53c7x0_local_declare();
-     unsigned long flags;
-     NCR53c7x0_local_setup(host);
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     NCR53c7x0_write8(SCNTL1_REG, SCNTL1_RST);
-     udelay(25);	/* Minimum amount of time to assert RST */
-     NCR53c7x0_write8(SCNTL1_REG, 0);
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
- }
- 
- /* 
-@@ -5782,26 +5721,26 @@
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
- 	host->hostdata[0];
-     unsigned long flags;
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     ncr_scsi_reset(host);
-     NCR53c7x0_driver_init (host);
-     if (hostdata->soft_reset)
- 	hostdata->soft_reset (host);
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
- }
- 
- 
- /*
-- * Function : Scsi_Cmnd *return_outstanding_commands (struct Scsi_Host *host,
-+ * Function : struct scsi_cmnd *return_outstanding_commands (struct Scsi_Host *host,
-  *	int free, int issue)
-  *
-  * Purpose : return a linked list (using the SCp.buffer field as next,
-  *	so we don't perturb hostdata.  We don't use a field of the 
-  *	NCR53c7x0_cmd structure since we may not have allocated one 
-- *	for the command causing the reset.) of Scsi_Cmnd structures that 
-+ *	for the command causing the reset.) of scsi_cmnd structures that 
-  *  	had propagated below the Linux issue queue level.  If free is set, 
-  *	free the NCR53c7x0_cmd structures which are associated with 
-- *	the Scsi_Cmnd structures, and clean up any internal 
-+ *	the scsi_cmnd structures, and clean up any internal 
-  *	NCR lists that the commands were on.  If issue is set,
-  *	also return commands in the issue queue.
-  *
-@@ -5811,14 +5750,14 @@
-  *	if the free flag is set. 
-  */
- 
--static Scsi_Cmnd *
-+static struct scsi_cmnd *
- return_outstanding_commands (struct Scsi_Host *host, int free, int issue) {
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
- 	host->hostdata[0];
-     struct NCR53c7x0_cmd *c;
-     int i;
-     u32 *ncrcurrent;
--    Scsi_Cmnd *list = NULL, *tmp;
-+    struct scsi_cmnd *list = NULL, *tmp, *next_cmd;
-     for (c = (struct NCR53c7x0_cmd *) hostdata->running_list; c; 
-     	c = (struct NCR53c7x0_cmd *) c->next)  {
- 	if (c->cmd->SCp.buffer) {
-@@ -5847,7 +5786,9 @@
-     }
- 
-     if (issue) {
--	for (tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp; tmp = tmp->next) {
-+	for (tmp = (struct scsi_cmnd *) hostdata->issue_queue; tmp; tmp = next_cmd) {
-+	    next_cmd = (struct scsi_cmnd *) tmp->SCp.ptr;
-+
- 	    if (tmp->SCp.buffer) {
- 		printk ("scsi%d : loop detected in issue queue!\n", 
- 			host->host_no);
-@@ -5882,17 +5823,17 @@
-     struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
- 	host->hostdata[0];
-     unsigned long flags;
--    Scsi_Cmnd *nuke_list, *tmp;
--    local_irq_save(flags);
-+    struct scsi_cmnd *nuke_list, *tmp;
-+    spin_lock_irqsave(host->host_lock, flags);
-     if (hostdata->state != STATE_HALTED)
- 	ncr_halt (host);
-     nuke_list = return_outstanding_commands (host, 1 /* free */, 1 /* issue */);
-     hard_reset (host);
-     hostdata->state = STATE_DISABLED;
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
-     printk ("scsi%d : nuking commands\n", host->host_no);
-     for (; nuke_list; nuke_list = tmp) {
--	    tmp = (Scsi_Cmnd *) nuke_list->SCp.buffer;
-+	    tmp = (struct scsi_cmnd *) nuke_list->SCp.buffer;
- 	    nuke_list->result = DID_ERROR << 16;
- 	    nuke_list->scsi_done(nuke_list);
-     }
-@@ -5922,7 +5863,7 @@
-     int stage;
-     NCR53c7x0_local_setup(host);
- 
--    local_irq_save(flags);
-+    spin_lock_irqsave(host->host_lock, flags);
-     /* Stage 0 : eat all interrupts
-        Stage 1 : set ABORT
-        Stage 2 : eat all but abort interrupts
-@@ -5957,7 +5898,7 @@
- 	}
-     }
-     hostdata->state = STATE_HALTED;
--    local_irq_restore(flags);
-+    spin_unlock_irqrestore(host->host_lock, flags);
- #if 0
-     print_lots (host);
- #endif
-@@ -6011,7 +5952,7 @@
-  * still be guaranteed that they're happening on the same 
-  * event structure.
-  */
--	    local_irq_save(flags);
-+	    spin_lock_irqsave(host->host_lock, flags);
- #if 0
- 	    event = hostdata->events[i];
- #else
-@@ -6019,7 +5960,7 @@
- 		sizeof(event));
- #endif
- 
--	    local_irq_restore(flags);
-+	    spin_unlock_irqrestore(host->host_lock, flags);
- 	    printk ("scsi%d : %s event %d at %ld secs %ld usecs target %d lun %d\n",
- 		host->host_no, event_name (event.event), count,
- 		(long) event.time.tv_sec, (long) event.time.tv_usec,
-@@ -6054,6 +5995,72 @@
-     return (virt_to_phys((void *)addr) < PAGE_SIZE || virt_to_phys((void *)(addr + size)) > virt_to_phys(high_memory) ?  -1 : 0);
- }
- 
-+int
-+NCR53c7xx_slave_configure(struct scsi_device *sdev) {
-+    struct Scsi_Host *host = sdev->host;
-+    struct NCR53c7x0_hostdata *hostdata = 
-+	(struct NCR53c7x0_hostdata *) host->hostdata[0];
-+    struct NCR53c7x0_cmd *tmp;
-+    u32 real;			/* Real address */
-+    int size;			/* Size of *tmp */
-+    unsigned long flags;
-+    int extra_allocate = 0;
-+
-+/*
-+ * Reserve commands for this I_T_L nexus.
-+ */
-+    if (hostdata->num_cmds < host->can_queue)
-+        extra_allocate = host->cmd_per_lun;
-+
-+    for (; extra_allocate > 0 ; --extra_allocate, 
-+    	++hostdata->num_cmds) {
-+    /* historically, kmalloc has returned unaligned addresses; pad so we
-+       have enough room to ROUNDUP */
-+	size = hostdata->max_cmd_size + sizeof (void *);
-+#ifdef FORCE_DSA_ALIGNMENT
-+	/*
-+	 * 53c710 rev.0 doesn't have an add-with-carry instruction.
-+	 * Ensure we allocate enough memory to force alignment.
-+	 */
-+	size += 256;
-+#endif
-+/* FIXME: for ISA bus '7xx chips, we need to or GFP_DMA in here */
-+
-+        if (size > 4096) {
-+            printk (KERN_ERR "53c7xx: slave_configure size > 4K\n");
-+	    return -ENOMEM;
-+	}
-+        real = get_zeroed_page(GFP_ATOMIC);
-+        if (real == 0)
-+        	return -ENOMEM;
-+        memset((void *)real, 0, 4096);
-+        cache_push(virt_to_phys((void *)real), 4096);
-+        cache_clear(virt_to_phys((void *)real), 4096);
-+        kernel_set_cachemode((void *)real, 4096, IOMAP_NOCACHE_SER);
-+	tmp = ROUNDUP(real, void *);
-+#ifdef FORCE_DSA_ALIGNMENT
-+	{
-+	    if (((u32)tmp & 0xff) > CmdPageStart)
-+		tmp = (struct NCR53c7x0_cmd *)((u32)tmp + 255);
-+	    tmp = (struct NCR53c7x0_cmd *)(((u32)tmp & ~0xff) + CmdPageStart);
-+#if 0
-+	    printk ("scsi: size = %d, real = 0x%08x, tmp set to 0x%08x\n",
-+			size, real, (u32)tmp);
-+#endif
-+	}
-+#endif
-+	tmp->real = (void *)real;
-+	tmp->size = size;			
-+	tmp->free = ((void (*)(void *, int)) my_free_page);
-+	spin_lock_irqsave(host->host_lock, flags);
-+	tmp->next = hostdata->free;
-+	hostdata->free = tmp;
-+	spin_unlock_irqrestore(host->host_lock, flags);
-+    }
-+
-+    return 0;
-+}
-+
- #ifdef MODULE
- int 
- NCR53c7x0_release(struct Scsi_Host *host) {
-@@ -6063,19 +6070,22 @@
-     shutdown (host);
-     if (host->irq != SCSI_IRQ_NONE)
- 	{
--	    int irq_count;
--	    struct Scsi_Host *tmp;
--	    for (irq_count = 0, tmp = first_host; tmp; tmp = tmp->next)
--		if (tmp->hostt == the_template && tmp->irq == host->irq)
-+	    int irq_count = 0;
-+	    struct Scsi_Host *tmp, *s;
-+	    list_for_each_entry_safe(tmp, s, &the_template->legacy_hosts, sht_legacy_list) {
-+		if (tmp->irq == host->irq)
- 		    ++irq_count;
-+	    }
- 	    if (irq_count == 1)
- 		free_irq(host->irq, NULL);
- 	}
-+#ifdef CONFIG_ISA
-     if (host->dma_channel != DMA_NONE)
- 	free_dma(host->dma_channel);
-+#endif
-     if (host->io_port)
- 	release_region(host->io_port, host->n_io_port);
--    
-+
-     for (cmd = (struct NCR53c7x0_cmd *) hostdata->free; cmd; cmd = tmp, 
- 	--hostdata->num_cmds) {
- 	tmp = (struct NCR53c7x0_cmd *) cmd->next;
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/53c7xx.h linux-2.6.13/drivers/scsi/53c7xx.h
---- linux-2.6.13-i386/drivers/scsi/53c7xx.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/53c7xx.h	2004-10-30 16:35:43.000000000 +0200
-@@ -997,7 +997,7 @@
-     u32 *dsa;			/* What's in the DSA register now (virt) */
- /* 
-  * A few things from that SCSI pid so we know what happened after 
-- * the Scsi_Cmnd structure in question may have disappeared.
-+ * the scsi_cmnd structure in question may have disappeared.
-  */
-     unsigned long pid;		/* The SCSI PID which caused this 
- 				   event */
-@@ -1029,8 +1029,8 @@
-     void (* free)(void *, int);		/* Command to deallocate; NULL
- 					   for structures allocated with
- 					   scsi_register, etc. */
--    Scsi_Cmnd *cmd;			/* Associated Scsi_Cmnd 
--					   structure, Scsi_Cmnd points
-+    struct scsi_cmnd *cmd;		/* Associated scsi_cmnd 
-+					   structure, scsi_cmnd points
- 					   at NCR53c7x0_cmd using 
- 					   host_scribble structure */
- 
-@@ -1039,8 +1039,8 @@
- 
-     int flags;				/* CMD_* flags */
- 
--    unsigned char      cmnd[12];	/* CDB, copied from Scsi_Cmnd */
--    int                result;		/* Copy to Scsi_Cmnd when done */
-+    unsigned char      cmnd[12];	/* CDB, copied from scsi_cmnd */
-+    int                result;		/* Copy to scsi_cmnd when done */
- 
-     struct {				/* Private non-cached bounce buffer */
-         unsigned char buf[256];
-@@ -1339,7 +1339,7 @@
-     volatile struct NCR53c7x0_synchronous sync[16]
- 	__attribute__ ((aligned (4)));
- 
--    volatile Scsi_Cmnd *issue_queue
-+    volatile struct scsi_cmnd *issue_queue
- 	__attribute__ ((aligned (4)));
- 						/* waiting to be issued by
- 						   Linux driver */
-@@ -1363,10 +1363,6 @@
- 						   */
-     volatile int num_cmds;			/* Number of commands 
- 						   allocated */
--    volatile int extra_allocate;
--    volatile unsigned char cmd_allocated[16];	/* Have we allocated commands
--						   for this target yet?  If not,
--						   do so ASAP */
-     volatile unsigned char busy[16][8];     	/* number of commands 
- 						   executing on each target
-     	    	    	    	    	    	 */
-@@ -1589,20 +1585,26 @@
- /* Patch field in dsa structure (assignment should be +=?) */
- #define patch_dsa_32(dsa, symbol, word, value)				\
- 	{								\
--	(dsa)[(hostdata->##symbol - hostdata->dsa_start) / sizeof(u32)	\
-+	(dsa)[(hostdata->symbol - hostdata->dsa_start) / sizeof(u32)	\
- 	    + (word)] = (value);					\
- 	if (hostdata->options & OPTION_DEBUG_DSA)			\
- 	    printk("scsi : dsa %s symbol %s(%d) word %d now 0x%x\n",	\
--		#dsa, #symbol, hostdata->##symbol, 			\
-+		#dsa, #symbol, hostdata->symbol, 			\
- 		(word), (u32) (value));					\
- 	}
- 
- /* Paranoid people could use panic() here. */
- #define FATAL(host) shutdown((host));
- 
--extern int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, int chip,
-+extern int ncr53c7xx_init(struct scsi_host_template *tpnt, int board, int chip,
- 			  unsigned long base, int io_port, int irq, int dma,
- 			  long long options, int clock);
-+extern const char *NCR53c7x0_info(void);
-+extern int NCR53c7xx_queue_command(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *));
-+extern int NCR53c7xx_abort(struct scsi_cmnd *);
-+extern int NCR53c7x0_release (struct Scsi_Host *);
-+extern int NCR53c7xx_reset(struct scsi_cmnd *);
-+extern int NCR53c7xx_slave_configure(struct scsi_device *);
- 
- #endif /* NCR53c710_C */
- #endif /* NCR53c710_H */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/Kconfig linux-2.6.13/drivers/scsi/Kconfig
---- linux-2.6.13-i386/drivers/scsi/Kconfig	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/Kconfig	2005-08-30 16:33:54.000000000 +0200
-@@ -1627,7 +1627,7 @@
- 
- config SCSI_AMIGA7XX
- 	bool "Amiga NCR53c710 SCSI support (EXPERIMENTAL)"
--	depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN
-+	depends on AMIGA && SCSI && EXPERIMENTAL
- 	help
- 	  Support for various NCR53c710-based SCSI controllers on the Amiga.
- 	  This includes:
-@@ -1724,7 +1724,7 @@
- 
- config MVME16x_SCSI
- 	bool "NCR53C710 SCSI driver for MVME16x"
--	depends on MVME16x && SCSI && BROKEN
-+	depends on MVME16x && SCSI
- 	help
- 	  The Motorola MVME162, 166, 167, 172 and 177 boards use the NCR53C710
- 	  SCSI controller chip.  Almost everyone using one of these boards
-@@ -1732,7 +1732,7 @@
- 
- config BVME6000_SCSI
- 	bool "NCR53C710 SCSI driver for BVME6000"
--	depends on BVME6000 && SCSI && BROKEN
-+	depends on BVME6000 && SCSI
- 	help
- 	  The BVME4000 and BVME6000 boards from BVM Ltd use the NCR53C710
- 	  SCSI controller chip.  Almost everyone using one of these boards
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/NCR5380.c linux-2.6.13/drivers/scsi/NCR5380.c
---- linux-2.6.13-i386/drivers/scsi/NCR5380.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/NCR5380.c	2005-08-30 16:33:54.000000000 +0200
-@@ -346,6 +346,7 @@
- 	return -ETIMEDOUT;
- }
- 
-+#ifdef NDEBUG
- static struct {
- 	unsigned char value;
- 	const char *name;
-@@ -359,7 +360,6 @@
- 	{PHASE_UNKNOWN, "UNKNOWN"}
- };
- 
--#ifdef NDEBUG
- static struct {
- 	unsigned char mask;
- 	const char *name;
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/amiga7xx.c linux-2.6.13/drivers/scsi/amiga7xx.c
---- linux-2.6.13-i386/drivers/scsi/amiga7xx.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/amiga7xx.c	2004-10-30 16:35:43.000000000 +0200
-@@ -27,8 +27,14 @@
- #include "scsi.h"
- #include <scsi/scsi_host.h>
- #include "53c7xx.h"
--#include "amiga7xx.h"
- 
-+#ifndef CMD_PER_LUN
-+#define CMD_PER_LUN 3
-+#endif
-+
-+#ifndef CAN_QUEUE
-+#define CAN_QUEUE 24
-+#endif
- 
- static int amiga7xx_register_one(Scsi_Host_Template *tpnt,
- 				 unsigned long address)
-@@ -115,8 +121,10 @@
- {
- 	if (shost->irq)
- 		free_irq(shost->irq, NULL);
-+#ifdef CONFIG_ISA
- 	if (shost->dma_channel != 0xff)
- 		free_dma(shost->dma_channel);
-+#endif
- 	if (shost->io_port && shost->n_io_port)
- 		release_region(shost->io_port, shost->n_io_port);
- 	scsi_unregister(shost);
-@@ -128,8 +136,9 @@
- 	.detect			= amiga7xx_detect,
- 	.release		= amiga7xx_release,
- 	.queuecommand		= NCR53c7xx_queue_command,
--	.abort			= NCR53c7xx_abort,
--	.reset			= NCR53c7xx_reset,
-+	.eh_abort_handler	= NCR53c7xx_abort,
-+	.eh_bus_reset_handler	= NCR53c7xx_reset,
-+	.slave_configure	= NCR53c7xx_slave_configure,
- 	.can_queue		= 24,
- 	.this_id		= 7,
- 	.sg_tablesize		= 63,
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/amiga7xx.h linux-2.6.13/drivers/scsi/amiga7xx.h
---- linux-2.6.13-i386/drivers/scsi/amiga7xx.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/amiga7xx.h	1970-01-01 01:00:00.000000000 +0100
-@@ -1,23 +0,0 @@
--#ifndef AMIGA7XX_H
--
--#include <linux/types.h>
--
--int amiga7xx_detect(Scsi_Host_Template *);
--const char *NCR53c7x0_info(void);
--int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
--int NCR53c7xx_abort(Scsi_Cmnd *);
--int NCR53c7x0_release (struct Scsi_Host *);
--int NCR53c7xx_reset(Scsi_Cmnd *, unsigned int);
--void NCR53c7x0_intr(int irq, void *dev_id, struct pt_regs * regs);
--
--#ifndef CMD_PER_LUN
--#define CMD_PER_LUN 3
--#endif
--
--#ifndef CAN_QUEUE
--#define CAN_QUEUE 24
--#endif
--
--#include <scsi/scsicam.h>
--
--#endif /* AMIGA7XX_H */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/bvme6000.c linux-2.6.13/drivers/scsi/bvme6000.c
---- linux-2.6.13-i386/drivers/scsi/bvme6000.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/bvme6000.c	2004-10-30 16:35:43.000000000 +0200
-@@ -19,10 +19,16 @@
- #include "scsi.h"
- #include <scsi/scsi_host.h>
- #include "53c7xx.h"
--#include "bvme6000.h"
- 
- #include<linux/stat.h>
- 
-+#ifndef CMD_PER_LUN
-+#define CMD_PER_LUN 3
-+#endif
-+
-+#ifndef CAN_QUEUE
-+#define CAN_QUEUE 24
-+#endif
- 
- int bvme6000_scsi_detect(Scsi_Host_Template *tpnt)
- {
-@@ -52,8 +58,10 @@
- {
- 	if (shost->irq)
- 		free_irq(shost->irq, NULL);
-+#ifdef CONFIG_ISA
- 	if (shost->dma_channel != 0xff)
- 		free_dma(shost->dma_channel);
-+#endif
- 	if (shost->io_port && shost->n_io_port)
- 		release_region(shost->io_port, shost->n_io_port);
- 	scsi_unregister(shost);
-@@ -65,8 +73,9 @@
- 	.detect			= bvme6000_scsi_detect,
- 	.release		= bvme6000_scsi_release,
- 	.queuecommand		= NCR53c7xx_queue_command,
--	.abort			= NCR53c7xx_abort,
--	.reset			= NCR53c7xx_reset,
-+	.eh_abort_handler	= NCR53c7xx_abort,
-+	.eh_bus_reset_handler	= NCR53c7xx_reset,
-+	.slave_configure	= NCR53c7xx_slave_configure,
- 	.can_queue		= 24,
- 	.this_id		= 7,
- 	.sg_tablesize		= 63,
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/bvme6000.h linux-2.6.13/drivers/scsi/bvme6000.h
---- linux-2.6.13-i386/drivers/scsi/bvme6000.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/bvme6000.h	1970-01-01 01:00:00.000000000 +0100
-@@ -1,24 +0,0 @@
--#ifndef BVME6000_SCSI_H
--#define BVME6000_SCSI_H
--
--#include <linux/types.h>
--
--int bvme6000_scsi_detect(Scsi_Host_Template *);
--const char *NCR53c7x0_info(void);
--int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
--int NCR53c7xx_abort(Scsi_Cmnd *);
--int NCR53c7x0_release (struct Scsi_Host *);
--int NCR53c7xx_reset(Scsi_Cmnd *, unsigned int);
--void NCR53c7x0_intr(int irq, void *dev_id, struct pt_regs * regs);
--
--#ifndef CMD_PER_LUN
--#define CMD_PER_LUN 3
--#endif
--
--#ifndef CAN_QUEUE
--#define CAN_QUEUE 24
--#endif
--
--#include <scsi/scsicam.h>
--
--#endif /* BVME6000_SCSI_H */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/mvme16x.c linux-2.6.13/drivers/scsi/mvme16x.c
---- linux-2.6.13-i386/drivers/scsi/mvme16x.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/mvme16x.c	2004-10-30 16:35:43.000000000 +0200
-@@ -17,10 +17,16 @@
- #include "scsi.h"
- #include <scsi/scsi_host.h>
- #include "53c7xx.h"
--#include "mvme16x.h"
- 
- #include<linux/stat.h>
- 
-+#ifndef CMD_PER_LUN
-+#define CMD_PER_LUN 3
-+#endif
-+
-+#ifndef CAN_QUEUE
-+#define CAN_QUEUE 24
-+#endif
- 
- int mvme16x_scsi_detect(Scsi_Host_Template *tpnt)
- {
-@@ -54,8 +60,10 @@
- {
- 	if (shost->irq)
- 		free_irq(shost->irq, NULL);
-+#ifdef CONFIG_ISA
- 	if (shost->dma_channel != 0xff)
- 		free_dma(shost->dma_channel);
-+#endif
- 	if (shost->io_port && shost->n_io_port)
- 		release_region(shost->io_port, shost->n_io_port);
- 	scsi_unregister(shost);
-@@ -67,8 +75,9 @@
- 	.detect			= mvme16x_scsi_detect,
- 	.release		= mvme16x_scsi_release,
- 	.queuecommand		= NCR53c7xx_queue_command,
--	.abort			= NCR53c7xx_abort,
--	.reset			= NCR53c7xx_reset,
-+	.eh_abort_handler	= NCR53c7xx_abort,
-+	.eh_bus_reset_handler	= NCR53c7xx_reset,
-+	.slave_configure	= NCR53c7xx_slave_configure,
- 	.can_queue		= 24,
- 	.this_id		= 7,
- 	.sg_tablesize		= 63,
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/drivers/scsi/mvme16x.h linux-2.6.13/drivers/scsi/mvme16x.h
---- linux-2.6.13-i386/drivers/scsi/mvme16x.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/drivers/scsi/mvme16x.h	1970-01-01 01:00:00.000000000 +0100
-@@ -1,24 +0,0 @@
--#ifndef MVME16x_SCSI_H
--#define MVME16x_SCSI_H
--
--#include <linux/types.h>
--
--int mvme16x_scsi_detect(Scsi_Host_Template *);
--const char *NCR53c7x0_info(void);
--int NCR53c7xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
--int NCR53c7xx_abort(Scsi_Cmnd *);
--int NCR53c7x0_release (struct Scsi_Host *);
--int NCR53c7xx_reset(Scsi_Cmnd *, unsigned int);
--void NCR53c7x0_intr(int irq, void *dev_id, struct pt_regs * regs);
--
--#ifndef CMD_PER_LUN
--#define CMD_PER_LUN 3
--#endif
--
--#ifndef CAN_QUEUE
--#define CAN_QUEUE 24
--#endif
--
--#include <scsi/scsicam.h>
--
--#endif /* MVME16x_SCSI_H */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/fs/fat/inode.c linux-2.6.13/fs/fat/inode.c
---- linux-2.6.13-i386/fs/fat/inode.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/fs/fat/inode.c	2005-08-30 16:35:05.000000000 +0200
-@@ -11,12 +11,14 @@
-  */
- 
- #include <linux/module.h>
-+#include <linux/config.h>
- #include <linux/init.h>
- #include <linux/time.h>
- #include <linux/slab.h>
- #include <linux/smp_lock.h>
- #include <linux/seq_file.h>
- #include <linux/msdos_fs.h>
-+#include <linux/major.h>
- #include <linux/pagemap.h>
- #include <linux/buffer_head.h>
- #include <linux/mount.h>
-@@ -751,7 +753,7 @@
- 	Opt_check_n, Opt_check_r, Opt_check_s, Opt_uid, Opt_gid,
- 	Opt_umask, Opt_dmask, Opt_fmask, Opt_codepage, Opt_nocase,
- 	Opt_quiet, Opt_showexec, Opt_debug, Opt_immutable,
--	Opt_dots, Opt_nodots,
-+	Opt_dots, Opt_nodots, Opt_atari_no, Opt_atari_yes,
- 	Opt_charset, Opt_shortname_lower, Opt_shortname_win95,
- 	Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes,
- 	Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes,
-@@ -776,6 +778,9 @@
- 	{Opt_showexec, "showexec"},
- 	{Opt_debug, "debug"},
- 	{Opt_immutable, "sys_immutable"},
-+	{Opt_atari_yes, "atari=yes"},
-+	{Opt_atari_yes, "atari"},
-+	{Opt_atari_no, "atari=no"},
- 	{Opt_obsolate, "conv=binary"},
- 	{Opt_obsolate, "conv=text"},
- 	{Opt_obsolate, "conv=auto"},
-@@ -850,6 +855,13 @@
- 	opts->utf8 = opts->unicode_xlate = 0;
- 	opts->numtail = 1;
- 	opts->nocase = 0;
-+	opts->atari = 0;
-+
-+#ifdef CONFIG_ATARI
-+	if(MACH_IS_ATARI)
-+	/* make Atari GEMDOS format the default if machine is an Atari */
-+		opts->atari = 1;
-+#endif
- 	*debug = 0;
- 
- 	if (!options)
-@@ -898,6 +910,12 @@
- 		case Opt_immutable:
- 			opts->sys_immutable = 1;
- 			break;
-+		case Opt_atari_yes:
-+			opts->atari = 1;
-+			break;
-+		case Opt_atari_no:
-+			opts->atari = 0;
-+			break;
- 		case Opt_uid:
- 			if (match_int(&args[0], &option))
- 				return 0;
-@@ -1230,8 +1248,31 @@
- 
- 	total_clusters = (total_sectors - sbi->data_start) / sbi->sec_per_clus;
- 
--	if (sbi->fat_bits != 32)
--		sbi->fat_bits = (total_clusters > MAX_FAT12) ? 16 : 12;
-+	if (!sbi->options.atari) {
-+		if (sbi->fat_bits != 32)
-+			sbi->fat_bits = (total_clusters > MAX_FAT12) ? 16 : 12;
-+	} else {
-+		int sectors;
-+		/* Atari GEMDOS partitions always have 16-bit fat */
-+		if (sbi->fat_bits != 32)
-+			sbi->fat_bits = 16;
-+		/* If more clusters than fat entries in 16-bit fat, we assume
-+		 * it's a real MSDOS partition with 12-bit fat.
-+		 */
-+		if (sbi->fat_bits != 32 && total_clusters+2 > sbi->
-+			fat_length*SECTOR_SIZE*8/sbi->fat_bits)
-+			sbi->fat_bits = 12;
-+		/* if it's a floppy disk --> 12bit fat */
-+		if (sbi->fat_bits != 32 && MAJOR(sb->s_dev) == FLOPPY_MAJOR)
-+			sbi->fat_bits = 12;
-+		/* if it's a ramdisk or loopback device and has one of the usual
-+		 * floppy sizes -> 12bit FAT  */
-+		sectors = total_sectors + sbi->data_start;
-+		if (sbi->fat_bits != 32 && (MAJOR(sb->s_dev) == RAMDISK_MAJOR ||
-+			 MAJOR(sb->s_dev) == LOOP_MAJOR) &&
-+			(sectors == 720 || sectors == 1440 || sectors == 2880))
-+			sbi->fat_bits = 12;
-+	}
- 
- 	/* check that FAT table does not overflow */
- 	fat_clusters = sbi->fat_length * sb->s_blocksize * 8 / sbi->fat_bits;
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/cacheflush.h linux-2.6.13/include/asm-m68k/cacheflush.h
---- linux-2.6.13-i386/include/asm-m68k/cacheflush.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/asm-m68k/cacheflush.h	2005-08-30 16:36:03.000000000 +0200
-@@ -130,20 +130,25 @@
- #define flush_dcache_mmap_lock(mapping)		do { } while (0)
- #define flush_dcache_mmap_unlock(mapping)	do { } while (0)
- #define flush_icache_page(vma, page)	__flush_page_to_ram(page_address(page))
--#define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)
--
--#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
--	do {							\
--		flush_cache_page(vma, vaddr, page_to_pfn(page));\
--		memcpy(dst, src, len);				\
--	} while (0)
--
--#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
--	do {							\
--		flush_cache_page(vma, vaddr, page_to_pfn(page));\
--		memcpy(dst, src, len);				\
--	} while (0)
- 
-+extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
-+				    unsigned long addr, int len);
- extern void flush_icache_range(unsigned long address, unsigned long endaddr);
- 
-+static inline void copy_to_user_page(struct vm_area_struct *vma,
-+				     struct page *page, unsigned long vaddr,
-+				     void *dst, void *src, int len)
-+{
-+	flush_cache_page(vma, vaddr, page_to_pfn(page));
-+	memcpy(dst, src, len);
-+	flush_icache_user_range(vma, page, vaddr, len);
-+}
-+static inline void copy_from_user_page(struct vm_area_struct *vma,
-+				       struct page *page, unsigned long vaddr,
-+				       void *dst, void *src, int len)
-+{
-+	flush_cache_page(vma, vaddr, page_to_pfn(page));
-+	memcpy(dst, src, len);
-+}
-+
- #endif /* _M68K_CACHEFLUSH_H */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/io.h linux-2.6.13/include/asm-m68k/io.h
---- linux-2.6.13-i386/include/asm-m68k/io.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/asm-m68k/io.h	2005-06-19 16:35:42.000000000 +0200
-@@ -324,8 +324,6 @@
- #define writel(val,addr) out_le32((addr),(val))
- #endif
- 
--#define mmiowb()
--
- static inline void *ioremap(unsigned long physaddr, unsigned long size)
- {
- 	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/processor.h linux-2.6.13/include/asm-m68k/processor.h
---- linux-2.6.13-i386/include/asm-m68k/processor.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/asm-m68k/processor.h	2005-05-30 16:33:26.000000000 +0200
-@@ -14,6 +14,7 @@
- #define current_text_addr() ({ __label__ _l; _l: &&_l;})
- 
- #include <linux/config.h>
-+#include <linux/thread_info.h>
- #include <asm/segment.h>
- #include <asm/fpu.h>
- #include <asm/ptrace.h>
-@@ -55,17 +56,6 @@
- #endif
- #define TASK_UNMAPPED_ALIGN(addr, off)	PAGE_ALIGN(addr)
- 
--struct task_work {
--	unsigned char sigpending;
--	unsigned char notify_resume;	/* request for notification on
--					   userspace execution resumption */
--	char          need_resched;
--	unsigned char delayed_trace;	/* single step a syscall */
--	unsigned char syscall_trace;	/* count of syscall interceptors */
--	unsigned char memdie;		/* task was selected to be killed */
--	unsigned char pad[2];
--};
--
- struct thread_struct {
- 	unsigned long  ksp;		/* kernel stack pointer */
- 	unsigned long  usp;		/* user stack pointer */
-@@ -78,7 +68,7 @@
- 	unsigned long  fp[8*3];
- 	unsigned long  fpcntl[3];	/* fp control regs */
- 	unsigned char  fpstate[FPSTATESIZE];  /* floating point state */
--	struct task_work work;
-+	struct thread_info info;
- };
- 
- #define INIT_THREAD  {							\
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/serial.h linux-2.6.13/include/asm-m68k/serial.h
---- linux-2.6.13-i386/include/asm-m68k/serial.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/asm-m68k/serial.h	2005-08-30 16:36:03.000000000 +0200
-@@ -26,9 +26,11 @@
- #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
- #endif
- 
-+#ifdef CONFIG_ISA
- #define SERIAL_PORT_DFNS			\
- 	/* UART CLK   PORT IRQ     FLAGS        */			\
- 	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\
- 	{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },	/* ttyS1 */	\
- 	{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },	/* ttyS2 */	\
- 	{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },	/* ttyS3 */
-+#endif
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/string.h linux-2.6.13/include/asm-m68k/string.h
---- linux-2.6.13-i386/include/asm-m68k/string.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/asm-m68k/string.h	2005-08-30 16:36:03.000000000 +0200
-@@ -80,43 +80,6 @@
-   return( (char *) s);
- }
- 
--#if 0
--#define __HAVE_ARCH_STRPBRK
--static inline char *strpbrk(const char *cs,const char *ct)
--{
--  const char *sc1,*sc2;
--
--  for( sc1 = cs; *sc1 != '\0'; ++sc1)
--    for( sc2 = ct; *sc2 != '\0'; ++sc2)
--      if (*sc1 == *sc2)
--	return((char *) sc1);
--  return( NULL );
--}
--#endif
--
--#if 0
--#define __HAVE_ARCH_STRSPN
--static inline size_t strspn(const char *s, const char *accept)
--{
--  const char *p;
--  const char *a;
--  size_t count = 0;
--
--  for (p = s; *p != '\0'; ++p)
--    {
--      for (a = accept; *a != '\0'; ++a)
--        if (*p == *a)
--          break;
--      if (*a == '\0')
--        return count;
--      else
--        ++count;
--    }
--
--  return count;
--}
--#endif
--
- /* strstr !! */
- 
- #define __HAVE_ARCH_STRLEN
-@@ -173,370 +136,18 @@
- }
- 
- #define __HAVE_ARCH_MEMSET
--/*
-- * This is really ugly, but its highly optimizatiable by the
-- * compiler and is meant as compensation for gcc's missing
-- * __builtin_memset(). For the 680[23]0	it might be worth considering
-- * the optimal number of misaligned writes compared to the number of
-- * tests'n'branches needed to align the destination address. The
-- * 680[46]0 doesn't really care due to their copy-back caches.
-- *						10/09/96 - Jes Sorensen
-- */
--static inline void * __memset_g(void * s, int c, size_t count)
--{
--  void *xs = s;
--  size_t temp;
--
--  if (!count)
--    return xs;
--
--  c &= 0xff;
--  c |= c << 8;
--  c |= c << 16;
--
--  if (count < 36){
--	  long *ls = s;
--
--	  switch(count){
--	  case 32: case 33: case 34: case 35:
--		  *ls++ = c;
--	  case 28: case 29: case 30: case 31:
--		  *ls++ = c;
--	  case 24: case 25: case 26: case 27:
--		  *ls++ = c;
--	  case 20: case 21: case 22: case 23:
--		  *ls++ = c;
--	  case 16: case 17: case 18: case 19:
--		  *ls++ = c;
--	  case 12: case 13: case 14: case 15:
--		  *ls++ = c;
--	  case 8: case 9: case 10: case 11:
--		  *ls++ = c;
--	  case 4: case 5: case 6: case 7:
--		  *ls++ = c;
--		  break;
--	  default:
--		  break;
--	  }
--	  s = ls;
--	  if (count & 0x02){
--		  short *ss = s;
--		  *ss++ = c;
--		  s = ss;
--	  }
--	  if (count & 0x01){
--		  char *cs = s;
--		  *cs++ = c;
--		  s = cs;
--	  }
--	  return xs;
--  }
--
--  if ((long) s & 1)
--    {
--      char *cs = s;
--      *cs++ = c;
--      s = cs;
--      count--;
--    }
--  if (count > 2 && (long) s & 2)
--    {
--      short *ss = s;
--      *ss++ = c;
--      s = ss;
--      count -= 2;
--    }
--  temp = count >> 2;
--  if (temp)
--    {
--      long *ls = s;
--      temp--;
--      do
--	*ls++ = c;
--      while (temp--);
--      s = ls;
--    }
--  if (count & 2)
--    {
--      short *ss = s;
--      *ss++ = c;
--      s = ss;
--    }
--  if (count & 1)
--    {
--      char *cs = s;
--      *cs = c;
--    }
--  return xs;
--}
--
--/*
-- * __memset_page assumes that data is longword aligned. Most, if not
-- * all, of these page sized memsets are performed on page aligned
-- * areas, thus we do not need to check if the destination is longword
-- * aligned. Of course we suffer a serious performance loss if this is
-- * not the case but I think the risk of this ever happening is
-- * extremely small. We spend a lot of time clearing pages in
-- * get_empty_page() so I think it is worth it anyway. Besides, the
-- * 680[46]0 do not really care about misaligned writes due to their
-- * copy-back cache.
-- *
-- * The optimized case for the 680[46]0 is implemented using the move16
-- * instruction. My tests showed that this implementation is 35-45%
-- * faster than the original implementation using movel, the only
-- * caveat is that the destination address must be 16-byte aligned.
-- *                                            01/09/96 - Jes Sorensen
-- */
--static inline void * __memset_page(void * s,int c,size_t count)
--{
--  unsigned long data, tmp;
--  void *xs = s;
--
--  c = c & 255;
--  data = c | (c << 8);
--  data |= data << 16;
--
--#ifdef CPU_M68040_OR_M68060_ONLY
--
--  if (((unsigned long) s) & 0x0f)
--	  __memset_g(s, c, count);
--  else{
--	  unsigned long *sp = s;
--	  *sp++ = data;
--	  *sp++ = data;
--	  *sp++ = data;
--	  *sp++ = data;
--
--	  __asm__ __volatile__("1:\t"
--			       ".chip 68040\n\t"
--			       "move16 %2 at +,%0 at +\n\t"
--			       ".chip 68k\n\t"
--			       "subqw  #8,%2\n\t"
--			       "subqw  #8,%2\n\t"
--			       "dbra   %1,1b\n\t"
--			       : "=a" (sp), "=d" (tmp)
--			       : "a" (s), "0" (sp), "1" ((count - 16) / 16 - 1)
--			       );
--  }
--
--#else
--  __asm__ __volatile__("1:\t"
--		       "movel %2,%0 at +\n\t"
--		       "movel %2,%0 at +\n\t"
--		       "movel %2,%0 at +\n\t"
--		       "movel %2,%0 at +\n\t"
--		       "movel %2,%0 at +\n\t"
--		       "movel %2,%0 at +\n\t"
--		       "movel %2,%0 at +\n\t"
--		       "movel %2,%0 at +\n\t"
--		       "dbra  %1,1b\n\t"
--		       : "=a" (s), "=d" (tmp)
--		       : "d" (data), "0" (s), "1" (count / 32 - 1)
--		       );
--#endif
--
--  return xs;
--}
--
--extern void *memset(void *,int,__kernel_size_t);
--
--#define __memset_const(s,c,count) \
--((count==PAGE_SIZE) ? \
--  __memset_page((s),(c),(count)) : \
--  __memset_g((s),(c),(count)))
--
--#define memset(s, c, count) \
--(__builtin_constant_p(count) ? \
-- __memset_const((s),(c),(count)) : \
-- __memset_g((s),(c),(count)))
-+extern void *memset(void *, int, __kernel_size_t);
-+#define memset(d, c, n) __builtin_memset(d, c, n)
- 
- #define __HAVE_ARCH_MEMCPY
--extern void * memcpy(void *, const void *, size_t );
--/*
-- * __builtin_memcpy() does not handle page-sized memcpys very well,
-- * thus following the same assumptions as for page-sized memsets, this
-- * function copies page-sized areas using an unrolled loop, without
-- * considering alignment.
-- *
-- * For the 680[46]0 only kernels we use the move16 instruction instead
-- * as it writes through the data-cache, invalidating the cache-lines
-- * touched. In this way we do not use up the entire data-cache (well,
-- * half of it on the 68060) by copying a page. An unrolled loop of two
-- * move16 instructions seem to the fastest. The only caveat is that
-- * both source and destination must be 16-byte aligned, if not we fall
-- * back to the generic memcpy function.  - Jes
-- */
--static inline void * __memcpy_page(void * to, const void * from, size_t count)
--{
--  unsigned long tmp;
--  void *xto = to;
--
--#ifdef CPU_M68040_OR_M68060_ONLY
--
--  if (((unsigned long) to | (unsigned long) from) & 0x0f)
--	  return memcpy(to, from, count);
--
--  __asm__ __volatile__("1:\t"
--		       ".chip 68040\n\t"
--		       "move16 %1 at +,%0 at +\n\t"
--		       "move16 %1 at +,%0 at +\n\t"
--		       ".chip 68k\n\t"
--		       "dbra  %2,1b\n\t"
--		       : "=a" (to), "=a" (from), "=d" (tmp)
--		       : "0" (to), "1" (from) , "2" (count / 32 - 1)
--		       );
--#else
--  __asm__ __volatile__("1:\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "movel %1 at +,%0 at +\n\t"
--		       "dbra  %2,1b\n\t"
--		       : "=a" (to), "=a" (from), "=d" (tmp)
--		       : "0" (to), "1" (from) , "2" (count / 32 - 1)
--		       );
--#endif
--  return xto;
--}
--
--#define __memcpy_const(to, from, n) \
--((n==PAGE_SIZE) ? \
--  __memcpy_page((to),(from),(n)) : \
--  __builtin_memcpy((to),(from),(n)))
--
--#define memcpy(to, from, n) \
--(__builtin_constant_p(n) ? \
-- __memcpy_const((to),(from),(n)) : \
-- memcpy((to),(from),(n)))
-+extern void *memcpy(void *, const void *, __kernel_size_t);
-+#define memcpy(d, s, n) __builtin_memcpy(d, s, n)
- 
- #define __HAVE_ARCH_MEMMOVE
--static inline void * memmove(void * dest,const void * src, size_t n)
--{
--  void *xdest = dest;
--  size_t temp;
--
--  if (!n)
--    return xdest;
--
--  if (dest < src)
--    {
--      if ((long) dest & 1)
--	{
--	  char *cdest = dest;
--	  const char *csrc = src;
--	  *cdest++ = *csrc++;
--	  dest = cdest;
--	  src = csrc;
--	  n--;
--	}
--      if (n > 2 && (long) dest & 2)
--	{
--	  short *sdest = dest;
--	  const short *ssrc = src;
--	  *sdest++ = *ssrc++;
--	  dest = sdest;
--	  src = ssrc;
--	  n -= 2;
--	}
--      temp = n >> 2;
--      if (temp)
--	{
--	  long *ldest = dest;
--	  const long *lsrc = src;
--	  temp--;
--	  do
--	    *ldest++ = *lsrc++;
--	  while (temp--);
--	  dest = ldest;
--	  src = lsrc;
--	}
--      if (n & 2)
--	{
--	  short *sdest = dest;
--	  const short *ssrc = src;
--	  *sdest++ = *ssrc++;
--	  dest = sdest;
--	  src = ssrc;
--	}
--      if (n & 1)
--	{
--	  char *cdest = dest;
--	  const char *csrc = src;
--	  *cdest = *csrc;
--	}
--    }
--  else
--    {
--      dest = (char *) dest + n;
--      src = (const char *) src + n;
--      if ((long) dest & 1)
--	{
--	  char *cdest = dest;
--	  const char *csrc = src;
--	  *--cdest = *--csrc;
--	  dest = cdest;
--	  src = csrc;
--	  n--;
--	}
--      if (n > 2 && (long) dest & 2)
--	{
--	  short *sdest = dest;
--	  const short *ssrc = src;
--	  *--sdest = *--ssrc;
--	  dest = sdest;
--	  src = ssrc;
--	  n -= 2;
--	}
--      temp = n >> 2;
--      if (temp)
--	{
--	  long *ldest = dest;
--	  const long *lsrc = src;
--	  temp--;
--	  do
--	    *--ldest = *--lsrc;
--	  while (temp--);
--	  dest = ldest;
--	  src = lsrc;
--	}
--      if (n & 2)
--	{
--	  short *sdest = dest;
--	  const short *ssrc = src;
--	  *--sdest = *--ssrc;
--	  dest = sdest;
--	  src = ssrc;
--	}
--      if (n & 1)
--	{
--	  char *cdest = dest;
--	  const char *csrc = src;
--	  *--cdest = *--csrc;
--	}
--    }
--  return xdest;
--}
-+extern void *memmove(void *, const void *, __kernel_size_t);
- 
- #define __HAVE_ARCH_MEMCMP
--extern int memcmp(const void * ,const void * ,size_t );
--#define memcmp(cs, ct, n) \
--(__builtin_constant_p(n) ? \
-- __builtin_memcmp((cs),(ct),(n)) : \
-- memcmp((cs),(ct),(n)))
--
--#define __HAVE_ARCH_MEMCHR
--static inline void *memchr(const void *cs, int c, size_t count)
--{
--	/* Someone else can optimize this, I don't care - tonym at mac.linux-m68k.org */
--	unsigned char *ret = (unsigned char *)cs;
--	for(;count>0;count--,ret++)
--		if(*ret == c) return ret;
--
--	return NULL;
--}
-+extern int memcmp(const void *, const void *, __kernel_size_t);
-+#define memcmp(d, s, n) __builtin_memcmp(d, s, n)
- 
- #endif /* _M68K_STRING_H_ */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/thread_info.h linux-2.6.13/include/asm-m68k/thread_info.h
---- linux-2.6.13-i386/include/asm-m68k/thread_info.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/asm-m68k/thread_info.h	2005-08-30 16:36:04.000000000 +0200
-@@ -2,17 +2,15 @@
- #define _ASM_M68K_THREAD_INFO_H
- 
- #include <asm/types.h>
--#include <asm/processor.h>
- #include <asm/page.h>
- 
- struct thread_info {
- 	struct task_struct	*task;		/* main task structure */
-+	unsigned long		flags;
- 	struct exec_domain	*exec_domain;	/* execution domain */
- 	int			preempt_count;	/* 0 => preemptable, <0 => BUG */
- 	__u32 cpu; /* should always be 0 on m68k */
- 	struct restart_block    restart_block;
--
--	__u8			supervisor_stack[0];
- };
- 
- #define PREEMPT_ACTIVE		0x4000000
-@@ -28,91 +26,34 @@
- 
- /* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */
- #if PAGE_SHIFT == 13 /* 8k machines */
--#define alloc_thread_info(tsk)   ((struct thread_info *)__get_free_pages(GFP_KERNEL,0))
--#define free_thread_info(ti)  free_pages((unsigned long)(ti),0)
-+#define alloc_thread_stack(tsk) ((void *)__get_free_pages(GFP_KERNEL,0))
-+#define free_thread_stack(ti)  free_pages((unsigned long)(ti),0)
- #else /* otherwise assume 4k pages */
--#define alloc_thread_info(tsk)   ((struct thread_info *)__get_free_pages(GFP_KERNEL,1))
--#define free_thread_info(ti)  free_pages((unsigned long)(ti),1)
-+#define alloc_thread_stack(tsk) ((void *)__get_free_pages(GFP_KERNEL,1))
-+#define free_thread_stack(ti)  free_pages((unsigned long)(ti),1)
- #endif /* PAGE_SHIFT == 13 */
- 
- //#define init_thread_info	(init_task.thread.info)
- #define init_stack		(init_thread_union.stack)
- 
--#define current_thread_info()	(current->thread_info)
-+#define task_thread_info(tsk)	(&(tsk)->thread.info)
-+#define current_thread_info()	task_thread_info(current)
- 
-+#define setup_thread_stack(p, org) ({			\
-+	*(struct task_struct **)(p)->stack = (p);	\
-+	task_thread_info(p)->task = (p);		\
-+})
- 
- #define __HAVE_THREAD_FUNCTIONS
- 
--#define TIF_SYSCALL_TRACE	0	/* syscall trace active */
--#define TIF_DELAYED_TRACE	1	/* single step a syscall */
--#define TIF_NOTIFY_RESUME	2	/* resumption notification requested */
--#define TIF_SIGPENDING		3	/* signal pending */
--#define TIF_NEED_RESCHED	4	/* rescheduling necessary */
--#define TIF_MEMDIE		5
--
--extern int thread_flag_fixme(void);
--
--/*
-- * flag set/clear/test wrappers
-- * - pass TIF_xxxx constants to these functions
-+/* entry.S relies on these definitions!
-+ * bits 0-7 are tested at every exception exit
-+ * bits 8-15 are also tested at syscall exit
-  */
--
--#define __set_tsk_thread_flag(tsk, flag, val) ({	\
--	switch (flag) {					\
--	case TIF_SIGPENDING:				\
--		tsk->thread.work.sigpending = val;	\
--		break;					\
--	case TIF_NEED_RESCHED:				\
--		tsk->thread.work.need_resched = val;	\
--		break;					\
--	case TIF_SYSCALL_TRACE:				\
--		tsk->thread.work.syscall_trace = val;	\
--		break;					\
--	case TIF_MEMDIE:				\
--		tsk->thread.work.memdie = val;		\
--		break;					\
--	default:					\
--		thread_flag_fixme();			\
--	}						\
--})
--
--#define __get_tsk_thread_flag(tsk, flag) ({		\
--	int ___res;					\
--	switch (flag) {					\
--	case TIF_SIGPENDING:				\
--		___res = tsk->thread.work.sigpending;	\
--		break;					\
--	case TIF_NEED_RESCHED:				\
--		___res = tsk->thread.work.need_resched;	\
--		break;					\
--	case TIF_SYSCALL_TRACE:				\
--		___res = tsk->thread.work.syscall_trace;\
--		break;					\
--	case TIF_MEMDIE:				\
--		___res = tsk->thread.work.memdie;\
--		break;					\
--	default:					\
--		___res = thread_flag_fixme();		\
--	}						\
--	___res;						\
--})
--
--#define __get_set_tsk_thread_flag(tsk, flag, val) ({	\
--	int __res = __get_tsk_thread_flag(tsk, flag);	\
--	__set_tsk_thread_flag(tsk, flag, val);		\
--	__res;						\
--})
--
--#define set_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, ~0)
--#define clear_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, 0)
--#define test_and_set_tsk_thread_flag(tsk, flag) __get_set_tsk_thread_flag(tsk, flag, ~0)
--#define test_tsk_thread_flag(tsk, flag) __get_tsk_thread_flag(tsk, flag)
--
--#define set_thread_flag(flag) set_tsk_thread_flag(current, flag)
--#define clear_thread_flag(flag) clear_tsk_thread_flag(current, flag)
--#define test_thread_flag(flag) test_tsk_thread_flag(current, flag)
--
--#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED)
--#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED)
-+#define TIF_SIGPENDING		6	/* signal pending */
-+#define TIF_NEED_RESCHED	7	/* rescheduling necessary */
-+#define TIF_DELAYED_TRACE	14	/* single step a syscall */
-+#define TIF_SYSCALL_TRACE	15	/* syscall trace active */
-+#define TIF_MEMDIE		16
- 
- #endif	/* _ASM_M68K_THREAD_INFO_H */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/adb.h linux-2.6.13/include/linux/adb.h
---- linux-2.6.13-i386/include/linux/adb.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/adb.h	2003-03-25 20:25:16.000000000 +0100
-@@ -76,6 +76,7 @@
- #define ADBREQ_REPLY	1	/* expect reply */
- #define ADBREQ_SYNC	2	/* poll until done */
- #define ADBREQ_NOSEND	4	/* build the request, but don't send it */
-+#define ADBREQ_RAW	8	/* send raw packet (don't prepend ADB_PACKET) */
- 
- /* Messages sent thru the client_list notifier. You should NOT stop
-    the operation, at least not with this version */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/bootmem.h linux-2.6.13/include/linux/bootmem.h
---- linux-2.6.13-i386/include/linux/bootmem.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/bootmem.h	2005-08-30 16:36:32.000000000 +0200
-@@ -49,11 +49,11 @@
- #define alloc_bootmem(x) \
- 	__alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
- #define alloc_bootmem_low(x) \
--	__alloc_bootmem((x), SMP_CACHE_BYTES, 0)
-+	__alloc_bootmem((x), SMP_CACHE_BYTES, __pa(PAGE_OFFSET))
- #define alloc_bootmem_pages(x) \
- 	__alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
- #define alloc_bootmem_low_pages(x) \
--	__alloc_bootmem((x), PAGE_SIZE, 0)
-+	__alloc_bootmem((x), PAGE_SIZE, __pa(PAGE_OFFSET))
- #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
- extern unsigned long __init free_all_bootmem (void);
- 
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/ide.h linux-2.6.13/include/linux/ide.h
---- linux-2.6.13-i386/include/linux/ide.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/ide.h	2005-08-30 16:36:33.000000000 +0200
-@@ -592,7 +592,7 @@
-  * sense_key	: Sense key of the last failed packet command
-  */
- typedef union {
--	unsigned all			:8;
-+	u8 all;
- 	struct {
- #if defined(__LITTLE_ENDIAN_BITFIELD)
- 		unsigned ili		:1;
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/init_task.h linux-2.6.13/include/linux/init_task.h
---- linux-2.6.13-i386/include/linux/init_task.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/init_task.h	2005-08-30 16:36:33.000000000 +0200
-@@ -70,7 +70,7 @@
- #define INIT_TASK(tsk)	\
- {									\
- 	.state		= 0,						\
--	.thread_info	= &init_thread_info,				\
-+	.stack		= &init_stack,					\
- 	.usage		= ATOMIC_INIT(2),				\
- 	.flags		= 0,						\
- 	.lock_depth	= -1,						\
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/interrupt.h linux-2.6.13/include/linux/interrupt.h
---- linux-2.6.13-i386/include/linux/interrupt.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/interrupt.h	2005-05-30 16:33:46.000000000 +0200
-@@ -9,6 +9,7 @@
- #include <linux/preempt.h>
- #include <linux/cpumask.h>
- #include <linux/hardirq.h>
-+#include <linux/sched.h>
- #include <asm/atomic.h>
- #include <asm/ptrace.h>
- #include <asm/system.h>
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/sched.h linux-2.6.13/include/linux/sched.h
---- linux-2.6.13-i386/include/linux/sched.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/sched.h	2005-08-30 16:36:35.000000000 +0200
-@@ -598,7 +598,8 @@
- 
- struct task_struct {
- 	volatile long state;	/* -1 unrunnable, 0 runnable, >0 stopped */
--	struct thread_info *thread_info;
-+	//struct thread_info *thread_info;
-+	void *stack;
- 	atomic_t usage;
- 	unsigned long flags;	/* per process flags, defined below */
- 	unsigned long ptrace;
-@@ -1136,32 +1137,50 @@
- 	spin_unlock(&p->alloc_lock);
- }
- 
-+#ifndef __HAVE_THREAD_FUNCTIONS
-+
-+#define task_thread_info(task) ((struct thread_info *)(task)->stack)
-+
-+static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org)
-+{
-+	*task_thread_info(p) = *task_thread_info(org);
-+	task_thread_info(p)->task = p;
-+}
-+
-+static inline unsigned long *end_of_stack(struct task_struct *p)
-+{
-+	return (unsigned long *)(task_thread_info(p)(p) + 1);
-+}
-+
-+#endif
-+
- /* set thread flags in other task's structures
-  * - see asm/thread_info.h for TIF_xxxx flags available
-  */
-+
- static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
- {
--	set_ti_thread_flag(tsk->thread_info,flag);
-+	set_ti_thread_flag(task_thread_info(tsk), flag);
- }
- 
- static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
- {
--	clear_ti_thread_flag(tsk->thread_info,flag);
-+	clear_ti_thread_flag(task_thread_info(tsk), flag);
- }
- 
- static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
- {
--	return test_and_set_ti_thread_flag(tsk->thread_info,flag);
-+	return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
- }
- 
- static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
- {
--	return test_and_clear_ti_thread_flag(tsk->thread_info,flag);
-+	return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
- }
- 
- static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
- {
--	return test_ti_thread_flag(tsk->thread_info,flag);
-+	return test_ti_thread_flag(task_thread_info(tsk), flag);
- }
- 
- static inline void set_tsk_need_resched(struct task_struct *tsk)
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/smp_lock.h linux-2.6.13/include/linux/smp_lock.h
---- linux-2.6.13-i386/include/linux/smp_lock.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/smp_lock.h	2005-04-25 23:13:18.000000000 +0200
-@@ -2,7 +2,6 @@
- #define __LINUX_SMPLOCK_H
- 
- #include <linux/config.h>
--#include <linux/sched.h>
- #include <linux/spinlock.h>
- 
- #ifdef CONFIG_LOCK_KERNEL
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/linux/thread_info.h linux-2.6.13/include/linux/thread_info.h
---- linux-2.6.13-i386/include/linux/thread_info.h	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/include/linux/thread_info.h	2005-05-30 16:33:47.000000000 +0200
-@@ -27,31 +27,6 @@
-  * - pass TIF_xxxx constants to these functions
-  */
- 
--static inline void set_thread_flag(int flag)
--{
--	set_bit(flag,&current_thread_info()->flags);
--}
--
--static inline void clear_thread_flag(int flag)
--{
--	clear_bit(flag,&current_thread_info()->flags);
--}
--
--static inline int test_and_set_thread_flag(int flag)
--{
--	return test_and_set_bit(flag,&current_thread_info()->flags);
--}
--
--static inline int test_and_clear_thread_flag(int flag)
--{
--	return test_and_clear_bit(flag,&current_thread_info()->flags);
--}
--
--static inline int test_thread_flag(int flag)
--{
--	return test_bit(flag,&current_thread_info()->flags);
--}
--
- static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
- {
- 	set_bit(flag,&ti->flags);
-@@ -77,16 +52,20 @@
- 	return test_bit(flag,&ti->flags);
- }
- 
--static inline void set_need_resched(void)
--{
--	set_thread_flag(TIF_NEED_RESCHED);
--}
-+#define set_thread_flag(flag) \
-+	set_ti_thread_flag(current_thread_info(), flag)
-+#define clear_thread_flag(flag) \
-+	clear_ti_thread_flag(current_thread_info(), flag)
-+#define test_and_set_thread_flag(flag) \
-+	test_and_set_ti_thread_flag(current_thread_info(), flag)
-+#define test_and_clear_thread_flag(flag) \
-+	test_and_clear_ti_thread_flag(current_thread_info(), flag)
-+#define test_thread_flag(flag) \
-+	test_ti_thread_flag(current_thread_info(), flag)
- 
--static inline void clear_need_resched(void)
--{
--	clear_thread_flag(TIF_NEED_RESCHED);
--}
-+#define set_need_resched()	set_thread_flag(TIF_NEED_RESCHED)
-+#define clear_need_resched()	clear_thread_flag(TIF_NEED_RESCHED)
- 
--#endif
-+#endif	/* __KERNEL__ */
- 
- #endif /* _LINUX_THREAD_INFO_H */
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/kernel/exit.c linux-2.6.13/kernel/exit.c
---- linux-2.6.13-i386/kernel/exit.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/kernel/exit.c	2005-08-30 16:36:41.000000000 +0200
-@@ -846,7 +846,7 @@
- 	if (group_dead && tsk->signal->leader)
- 		disassociate_ctty(1);
- 
--	module_put(tsk->thread_info->exec_domain->module);
-+	module_put(task_thread_info(tsk)->exec_domain->module);
- 	if (tsk->binfmt)
- 		module_put(tsk->binfmt->module);
- 
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/kernel/fork.c linux-2.6.13/kernel/fork.c
---- linux-2.6.13-i386/kernel/fork.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/kernel/fork.c	2005-08-30 16:36:41.000000000 +0200
-@@ -100,7 +100,7 @@
- 
- void free_task(struct task_struct *tsk)
- {
--	free_thread_info(tsk->thread_info);
-+	free_thread_stack(tsk->stack);
- 	free_task_struct(tsk);
- }
- EXPORT_SYMBOL(free_task);
-@@ -155,7 +155,7 @@
- static struct task_struct *dup_task_struct(struct task_struct *orig)
- {
- 	struct task_struct *tsk;
--	struct thread_info *ti;
-+	void *stack;
- 
- 	prepare_to_copy(orig);
- 
-@@ -163,16 +163,16 @@
- 	if (!tsk)
- 		return NULL;
- 
--	ti = alloc_thread_info(tsk);
--	if (!ti) {
-+	stack = alloc_thread_stack(tsk);
-+	if (!stack) {
- 		free_task_struct(tsk);
- 		return NULL;
- 	}
- 
--	*ti = *orig->thread_info;
- 	*tsk = *orig;
--	tsk->thread_info = ti;
--	ti->task = tsk;
-+	tsk->stack = stack;
-+	*(struct task_struct **)tsk->stack = tsk;
-+	setup_thread_stack(tsk, orig);
- 
- 	/* One for us, one for whoever does the "release_task()" (usually parent) */
- 	atomic_set(&tsk->usage,2);
-@@ -898,7 +898,7 @@
- 	if (nr_threads >= max_threads)
- 		goto bad_fork_cleanup_count;
- 
--	if (!try_module_get(p->thread_info->exec_domain->module))
-+	if (!try_module_get(task_thread_info(p)->exec_domain->module))
- 		goto bad_fork_cleanup_count;
- 
- 	if (p->binfmt && !try_module_get(p->binfmt->module))
-@@ -1151,7 +1151,7 @@
- 	if (p->binfmt)
- 		module_put(p->binfmt->module);
- bad_fork_cleanup_put_domain:
--	module_put(p->thread_info->exec_domain->module);
-+	module_put(task_thread_info(p)->exec_domain->module);
- bad_fork_cleanup_count:
- 	put_group_info(p->group_info);
- 	atomic_dec(&p->user->processes);
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/kernel/sched.c linux-2.6.13/kernel/sched.c
---- linux-2.6.13-i386/kernel/sched.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/kernel/sched.c	2005-08-30 16:36:43.000000000 +0200
-@@ -4121,10 +4121,10 @@
- #endif
- #ifdef CONFIG_DEBUG_STACK_USAGE
- 	{
--		unsigned long * n = (unsigned long *) (p->thread_info+1);
-+		unsigned long * n = end_of_stack(p);
- 		while (!*n)
- 			n++;
--		free = (unsigned long) n - (unsigned long)(p->thread_info+1);
-+		free = (unsigned long) n - (unsigned long) end_of_stack(p);
- 	}
- #endif
- 	printk("%5lu %5d %6d ", free, p->pid, p->parent->pid);
-@@ -4204,9 +4204,9 @@
- 
- 	/* Set the preempt count _outside_ the spinlocks! */
- #if defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_BKL)
--	idle->thread_info->preempt_count = (idle->lock_depth >= 0);
-+	task_thread_info(idle)->preempt_count = (idle->lock_depth >= 0);
- #else
--	idle->thread_info->preempt_count = 0;
-+	task_thread_info(idle)->preempt_count = 0;
- #endif
- }
- 
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/mm/bootmem.c linux-2.6.13/mm/bootmem.c
---- linux-2.6.13-i386/mm/bootmem.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/mm/bootmem.c	2005-08-30 16:36:44.000000000 +0200
-@@ -275,7 +275,6 @@
- 
- 	count = 0;
- 	/* first extant page of the node */
--	pfn = bdata->node_boot_start >> PAGE_SHIFT;
- 	idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT);
- 	map = bdata->node_bootmem_map;
- 	/* Check physaddr is O(LOG2(BITS_PER_LONG)) page aligned */
-@@ -288,7 +287,8 @@
- 		if (gofast && v == ~0UL) {
- 			int j, order;
- 
--			page = pfn_to_page(pfn);
-+			page = virt_to_page(phys_to_virt((i << PAGE_SHIFT) +
-+							 bdata->node_boot_start));
- 			count += BITS_PER_LONG;
- 			__ClearPageReserved(page);
- 			order = ffs(BITS_PER_LONG) - 1;
-@@ -300,23 +300,20 @@
- 			}
- 			__free_pages(page, order);
- 			i += BITS_PER_LONG;
--			page += BITS_PER_LONG;
- 		} else if (v) {
- 			unsigned long m;
--
--			page = pfn_to_page(pfn);
--			for (m = 1; m && i < idx; m<<=1, page++, i++) {
-+			for (m = 1; m && i < idx; m<<=1, i++) {
- 				if (v & m) {
-+					page = virt_to_page(phys_to_virt((i << PAGE_SHIFT) +
-+									 bdata->node_boot_start));
- 					count++;
- 					__ClearPageReserved(page);
- 					set_page_refs(page, 0);
- 					__free_page(page);
- 				}
- 			}
--		} else {
-+		} else
- 			i+=BITS_PER_LONG;
--		}
--		pfn += BITS_PER_LONG;
- 	}
- 	total += count;
- 
-diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/sound/oss/dmasound/dmasound_paula.c linux-2.6.13/sound/oss/dmasound/dmasound_paula.c
---- linux-2.6.13-i386/sound/oss/dmasound/dmasound_paula.c	2005-08-29 01:41:01.000000000 +0200
-+++ linux-2.6.13/sound/oss/dmasound/dmasound_paula.c	2005-05-30 16:34:14.000000000 +0200
-@@ -244,6 +244,7 @@
- 			u_char frame[], ssize_t *frameUsed,		\
- 			ssize_t frameLeft)				\
- {									\
-+	const u_short *ptr = (const u_short *)userPtr;			\
- 	ssize_t count, used;						\
- 	u_short data;							\
- 									\
-@@ -253,7 +254,7 @@
- 		count = min_t(size_t, userCount, frameLeft)>>1 & ~1;	\
- 		used = count*2;						\
- 		while (count > 0) {					\
--			if (get_user(data, ((u_short *)userPtr)++))	\
-+			if (get_user(data, ptr++))			\
- 				return -EFAULT;				\
- 			data = convsample(data);			\
- 			*high++ = data>>8;				\
-@@ -268,12 +269,12 @@
- 		count = min_t(size_t, userCount, frameLeft)>>2 & ~1;	\
- 		used = count*4;						\
- 		while (count > 0) {					\
--			if (get_user(data, ((u_short *)userPtr)++))	\
-+			if (get_user(data, ptr++))			\
- 				return -EFAULT;				\
- 			data = convsample(data);			\
- 			*lefth++ = data>>8;				\
- 			*leftl++ = (data>>2) & 0x3f;			\
--			if (get_user(data, ((u_short *)userPtr)++))	\
-+			if (get_user(data, ptr++))			\
- 				return -EFAULT;				\
- 			data = convsample(data);			\
- 			*righth++ = data>>8;				\

Copied: dists/trunk/linux-2.4/debian/patches-debian (from rev 4255, dists/trunk/kernel-2.4/source/kernel-source-2.4.27-2.4.27/debian/patches)




More information about the Kernel-svn-changes mailing list