r2429 - in trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8: . debian

Kyle McMartin kyle at costa.debian.org
Fri Oct 19 10:58:29 UTC 2007


Author: kyle
Date: 2005-02-01 07:46:34 +0100 (Tue, 01 Feb 2005)
New Revision: 2429

Modified:
   trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/debian/changelog
   trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/hppa_2.6.8.diff
Log:
Add backport of patch to support PCI-PCI bridges on more than
just PDC_PAT type machines.


Modified: trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/debian/changelog
===================================================================
--- trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/debian/changelog	2005-01-30 16:30:55 UTC (rev 2428)
+++ trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/debian/changelog	2005-02-01 06:46:34 UTC (rev 2429)
@@ -1,6 +1,9 @@
 kernel-patch-2.6.8-hppa (2.6.8-5) UNRELEASED; urgency=low
 
   * Fix a reject in drivers/serial/8250.c.
+  * Backport patch from Ryan Bradetich to support
+     PCI-PCI bridges on non-PDC_PAT machines.
+    Message-Id: <20050102062645.65799495689 at palinux.hppa>
 
  -- Kyle McMartin <kyle at debian.org>  Sat, 15 Jan 2005 21:49:11 -0500
 

Modified: trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/hppa_2.6.8.diff
===================================================================
--- trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/hppa_2.6.8.diff	2005-01-30 16:30:55 UTC (rev 2428)
+++ trunk/kernel/hppa/kernel-patch-2.6.8-hppa-2.6.8/hppa_2.6.8.diff	2005-02-01 06:46:34 UTC (rev 2429)
@@ -1,68 +1,375 @@
-Index: debian-kernel-hppa-2.6.8/kernel/resource.c
+Index: debian-kernel-hppa-2.6.8/Documentation/parisc/00-INDEX
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/kernel/resource.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/kernel/resource.c	2005-01-15 20:15:09.000000000 -0500
-@@ -179,6 +179,8 @@
- {
- 	struct resource *tmp, **p;
+--- debian-kernel-hppa-2.6.8.orig/Documentation/parisc/00-INDEX	2004-08-14 01:37:25.000000000 -0400
++++ debian-kernel-hppa-2.6.8/Documentation/parisc/00-INDEX	2005-02-01 01:38:33.000000000 -0500
+@@ -2,9 +2,16 @@
+ 	- this file.
+ IODC.txt
+ 	- Documentation IODC
++	= Removed.
++
+ debugging
+ 	- some debugging hints for real-mode code
+ mm
+ 	- Documentation on parisc mm status
++	= Removed.
++
+ registers
+ 	- current/planned usage of registers
++
++todo
++	- The things we need to work on...
+Index: debian-kernel-hppa-2.6.8/Documentation/parisc/todo
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/Documentation/parisc/todo	2005-02-01 01:38:33.000000000 -0500
+@@ -0,0 +1,83 @@
++Status 2004-08-16 :
++-------------------
++ - Merged to 2.6.8.1, boots on 712, 715, C3000, and A500
++   (AFAIK, probably every machine we used to support boots on this kernel.)
++ - Changes to the 2.4 branch are pretty much non-existant,
++   Matthew does a good job of merging from upstream though.
++ - SMP compiles, and seems to work on certain boxes.
++ - No preemptible support
++
++Todo:
++-----
++
++ - 2004-08-16 (Carlos)
++   Review the gettimeofday implementation, possibly use a
++   light-weight-syscall and rely on cr16 and cpu speed for
++   more accurate timing?
++ - 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
++ - syscall signal return path needs work, we don't loop on signal
++   delivery like other archs
++ - parisc is the only arch that defines __kernel_clock_t as int instead
++   of long, find out if we can use long (check compat_signals.c)
++
++ - REVIEW ALL THE TODO ENTRIES BELOW!
++
++ - the fix for do_fork needs checking
++ - our PDC early debug console hacks need to be cleaned up somehow
++ - ad1889 driver: only works with .wav;  Convert to ALSA (ggg, tausq, tbone)
++ - 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.5)
++ - write floppy driver for lasi
++ - write floppy driver for suckyio
++ - spifi driver (rbrad)
++ - write optimized versions of lcopy_{to,from}_user. Can we port the
++   hpux versions?
++ - NPTL kernel support (CLONE_*TID flags need to be correctly handled by 
++   sys_clone() and friends)
++ - fix ALSA harmony driver to reflect changes in ALSA architecture.
++
++
++ Started and in progress:
++ ------------------------
++ - 2004-08-16 (Carlos)
++   64-bit binutils needs to be fixed to get multiple stub
++   section support.
++
++ - 2004-08-16 (Carlos)
++   Working on light-weight-syscall to implement atomic
++   compare and swap primitive.
++
++ - IRQ code (use arch-indep scheme & cpu-affinity support) (jejb, ggg, t-bone)
++
++ - REVIEW THE ENTRIES BELOW!
++
++ - Some options still need Kconfig help entries (see below!)
++ - Look at Config.help too. (tbone, HIL -> helge?)
++ - port hil_kbd.c to new input layer
++ - port hil_ptr.c to new input layer
++
++ - 64-bit userspace (Leandro)
++
++
++ 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)
++
+Index: debian-kernel-hppa-2.6.8/arch/parisc/Makefile
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/Makefile	2004-08-14 01:37:41.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/Makefile	2005-02-01 01:38:33.000000000 -0500
+@@ -52,7 +52,6 @@
+ cflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
  
-+	BUG_ON(old->child);
+ head-y			:= arch/parisc/kernel/head.o 
+-head-$(CONFIG_PARISC64)	:= arch/parisc/kernel/head64.o
+ 
+ CFLAGS	+= $(cflags-y)
+ 
+Index: debian-kernel-hppa-2.6.8/arch/parisc/configs/a500_defconfig
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/configs/a500_defconfig	2004-08-14 01:36:32.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/configs/a500_defconfig	2005-02-01 01:38:33.000000000 -0500
+@@ -11,7 +11,6 @@
+ #
+ CONFIG_EXPERIMENTAL=y
+ # CONFIG_CLEAN_COMPILE is not set
+-# CONFIG_STANDALONE is not set
+ CONFIG_BROKEN=y
+ CONFIG_BROKEN_ON_SMP=y
+ 
+@@ -31,6 +30,7 @@
+ CONFIG_EMBEDDED=y
+ CONFIG_KALLSYMS=y
+ CONFIG_KALLSYMS_ALL=y
++# CONFIG_KALLSYMS_EXTRA_PASS is not set
+ CONFIG_FUTEX=y
+ CONFIG_EPOLL=y
+ CONFIG_IOSCHED_NOOP=y
+@@ -48,6 +48,7 @@
+ CONFIG_OBSOLETE_MODPARM=y
+ # CONFIG_MODVERSIONS is not set
+ CONFIG_KMOD=y
++CONFIG_STOP_MACHINE=y
+ 
+ #
+ # Processor type and features
+@@ -61,9 +62,12 @@
+ CONFIG_PREFETCH=y
+ CONFIG_PARISC64=y
+ CONFIG_64BIT=y
+-# CONFIG_SMP is not set
++CONFIG_SMP=y
++CONFIG_HOTPLUG_CPU=y
++# CONFIG_DISCONTIGMEM is not set
+ # CONFIG_PREEMPT is not set
+ CONFIG_COMPAT=y
++CONFIG_NR_CPUS=4
+ 
+ #
+ # Bus options (PCI, PCMCIA, EISA, GSC, ISA)
+@@ -86,6 +90,7 @@
+ CONFIG_PCMCIA_DEBUG=y
+ CONFIG_YENTA=m
+ CONFIG_CARDBUS=y
++# CONFIG_PD6729 is not set
+ # CONFIG_I82092 is not set
+ # CONFIG_TCIC is not set
+ 
+@@ -107,6 +112,8 @@
+ #
+ # Generic Driver Options
+ #
++# CONFIG_STANDALONE is not set
++CONFIG_PREVENT_FIRMWARE_BUILD=y
+ # CONFIG_FW_LOADER is not set
+ CONFIG_DEBUG_DRIVER=y
+ 
+@@ -135,7 +142,7 @@
+ CONFIG_BLK_DEV_LOOP=y
+ # CONFIG_BLK_DEV_CRYPTOLOOP is not set
+ # CONFIG_BLK_DEV_NBD is not set
+-# CONFIG_BLK_DEV_CARMEL is not set
++# CONFIG_BLK_DEV_SX8 is not set
+ CONFIG_BLK_DEV_RAM=y
+ CONFIG_BLK_DEV_RAM_SIZE=6144
+ CONFIG_BLK_DEV_INITRD=y
+@@ -165,7 +172,6 @@
+ # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+ #
+ CONFIG_SCSI_MULTI_LUN=y
+-CONFIG_SCSI_REPORT_LUNS=y
+ # CONFIG_SCSI_CONSTANTS is not set
+ # CONFIG_SCSI_LOGGING is not set
+ 
+@@ -179,6 +185,7 @@
+ # SCSI low-level drivers
+ #
+ # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
++# CONFIG_SCSI_3W_9XXX is not set
+ # CONFIG_SCSI_ACARD is not set
+ # CONFIG_SCSI_AACRAID is not set
+ # CONFIG_SCSI_AIC7XXX is not set
+@@ -353,6 +360,8 @@
+ # CONFIG_IP_NF_COMPAT_IPFWADM is not set
+ CONFIG_IP_NF_TARGET_NOTRACK=m
+ CONFIG_IP_NF_RAW=m
++# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
++# CONFIG_IP_NF_MATCH_REALM is not set
+ CONFIG_XFRM=y
+ CONFIG_XFRM_USER=m
+ 
+@@ -379,6 +388,7 @@
+ # QoS and/or fair queueing
+ #
+ # CONFIG_NET_SCHED is not set
++# CONFIG_NET_CLS_ROUTE is not set
+ 
+ #
+ # Network testing
+@@ -452,6 +462,7 @@
+ # CONFIG_SUNDANCE is not set
+ CONFIG_VIA_RHINE=m
+ CONFIG_VIA_RHINE_MMIO=y
++# CONFIG_VIA_VELOCITY is not set
+ 
+ #
+ # Ethernet (1000 Mbit)
+@@ -501,7 +512,6 @@
+ #
+ # Wireless 802.11b ISA/PCI cards support
+ #
+-# CONFIG_AIRO is not set
+ CONFIG_HERMES=m
+ CONFIG_PLX_HERMES=m
+ CONFIG_TMD_HERMES=m
+@@ -644,7 +654,6 @@
+ #
+ # Ftape, the floppy tape device driver
+ #
+-# CONFIG_FTAPE is not set
+ # CONFIG_AGP is not set
+ # CONFIG_DRM is not set
+ 
+@@ -661,6 +670,11 @@
+ # CONFIG_I2C is not set
+ 
+ #
++# Dallas's 1-wire bus
++#
++# CONFIG_W1 is not set
 +
- 	p = &old->parent->child;
- 	for (;;) {
- 		tmp = *p;
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_conf.h
++#
+ # Misc devices
+ #
+ 
+@@ -734,6 +748,7 @@
+ CONFIG_JOLIET=y
+ # CONFIG_ZISOFS is not set
+ CONFIG_UDF_FS=m
++CONFIG_UDF_NLS=y
+ 
+ #
+ # DOS/FAT/NT Filesystems
+@@ -741,6 +756,8 @@
+ CONFIG_FAT_FS=m
+ CONFIG_MSDOS_FS=m
+ CONFIG_VFAT_FS=m
++CONFIG_FAT_DEFAULT_CODEPAGE=437
++CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+ # CONFIG_NTFS_FS is not set
+ 
+ #
+@@ -795,6 +812,9 @@
+ CONFIG_SMB_NLS_DEFAULT=y
+ CONFIG_SMB_NLS_REMOTE="cp437"
+ CONFIG_CIFS=m
++# CONFIG_CIFS_STATS is not set
++# CONFIG_CIFS_XATTR is not set
++# CONFIG_CIFS_POSIX is not set
+ # CONFIG_NCP_FS is not set
+ # CONFIG_CODA_FS is not set
+ # CONFIG_AFS_FS is not set
+@@ -833,6 +853,7 @@
+ # CONFIG_NLS_ISO8859_8 is not set
+ # CONFIG_NLS_CODEPAGE_1250 is not set
+ # CONFIG_NLS_CODEPAGE_1251 is not set
++# CONFIG_NLS_ASCII is not set
+ CONFIG_NLS_ISO8859_1=m
+ CONFIG_NLS_ISO8859_2=m
+ CONFIG_NLS_ISO8859_3=m
+@@ -860,6 +881,8 @@
+ CONFIG_DEBUG_KERNEL=y
+ # CONFIG_DEBUG_SLAB is not set
+ CONFIG_MAGIC_SYSRQ=y
++# CONFIG_DEBUG_SPINLOCK is not set
++# CONFIG_DEBUG_RWLOCK is not set
+ # CONFIG_FRAME_POINTER is not set
+ # CONFIG_DEBUG_INFO is not set
+ 
+@@ -886,7 +909,9 @@
+ CONFIG_CRYPTO_AES=m
+ CONFIG_CRYPTO_CAST5=m
+ CONFIG_CRYPTO_CAST6=m
++# CONFIG_CRYPTO_TEA is not set
+ # CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_KHAZAD is not set
+ CONFIG_CRYPTO_DEFLATE=m
+ # CONFIG_CRYPTO_MICHAEL_MIC is not set
+ CONFIG_CRYPTO_CRC32C=m
+@@ -895,6 +920,7 @@
+ #
+ # Library routines
+ #
++CONFIG_CRC_CCITT=m
+ CONFIG_CRC32=y
+ CONFIG_LIBCRC32C=m
+ CONFIG_ZLIB_INFLATE=m
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/Makefile
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_conf.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_conf.h	2005-01-15 20:15:09.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
-  */
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/Makefile	2004-08-14 01:36:44.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/Makefile	2005-02-01 01:38:33.000000000 -0500
+@@ -3,7 +3,6 @@
+ #
  
- #ifndef SYM_CONF_H
+ head-y			:= head.o
+-head-$(CONFIG_PARISC64)	:= head64.o
+ extra-y			:= init_task.o $(head-y) vmlinux.lds.s
+ 
+ AFLAGS_entry.o	:= -traditional
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/cache.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/cache.c	2004-08-14 01:36:56.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/cache.c	2005-02-01 01:38:33.000000000 -0500
+@@ -33,6 +33,17 @@
+ int icache_stride;
+ EXPORT_SYMBOL(dcache_stride);
+ 
++
++#if defined(CONFIG_SMP)
++/* On some machines (e.g. ones with the Merced bus), there can be
++ * only a single PxTLB broadcast at a time; this must be guaranteed
++ * by software.  We put a spinlock around all TLB flushes  to
++ * ensure this.
++ */
++spinlock_t pa_tlb_lock = SPIN_LOCK_UNLOCKED;
++EXPORT_SYMBOL(pa_tlb_lock);
++#endif
++
+ struct pdc_cache_info cache_info;
+ #ifndef CONFIG_PA20
+ static struct pdc_btlb_info btlb_info;
+@@ -307,3 +318,13 @@
+ EXPORT_SYMBOL(flush_kernel_dcache_page);
+ EXPORT_SYMBOL(flush_data_cache_local);
+ EXPORT_SYMBOL(flush_kernel_icache_range_asm);
++
++void clear_user_page_asm(void *page, unsigned long vaddr)
++{
++	/* This function is implemented in assembly in pacache.S */
++	extern void __clear_user_page_asm(void *page, unsigned long vaddr);
++
++	purge_tlb_start();
++	__clear_user_page_asm(page, vaddr);
++	purge_tlb_end();
++}
 Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/entry.S
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/entry.S	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/entry.S	2005-01-15 20:15:09.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/entry.S	2004-08-14 01:36:32.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/entry.S	2005-02-01 01:38:32.000000000 -0500
 @@ -440,8 +440,17 @@
  	mfctl		%cr25,\reg
  	.endm
@@ -370,10 +677,23 @@
  	copy	%r0, %r26			/* sigset_t *oldset = NULL */
  
  	LDREG	TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/firmware.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/firmware.c	2004-08-14 01:36:16.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/firmware.c	2005-02-01 01:38:33.000000000 -0500
+@@ -1276,7 +1276,7 @@
+ long real64_call(unsigned long fn, ...)
+ {
+ 	va_list args;
+-	extern struct wide_stack real64_stack __attribute__ ((alias ("real_stack")));
++	extern struct wide_stack real64_stack;
+ 	extern unsigned long real64_call_asm(unsigned long *,
+ 					     unsigned long *, 
+ 					     unsigned long);
 Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/head.S
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/head.S	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/head.S	2005-01-15 20:15:09.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/head.S	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/head.S	2005-02-01 01:38:32.000000000 -0500
 @@ -1,12 +1,13 @@
 -/*
 - *
@@ -785,662 +1105,2903 @@
  $global$:	
  	.word 0
 +#endif /*!LP64*/
-Index: debian-kernel-hppa-2.6.8/include/linux/compat_siginfo.h
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/pacache.S
 ===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/include/linux/compat_siginfo.h	2005-01-15 20:15:09.000000000 -0500
-@@ -0,0 +1,178 @@
-+#ifndef _ASM_GENERIC_COMPAT_SIGINFO_H
-+#define _ASM_GENERIC_COMPAT_SIGINFO_H
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/pacache.S	2004-08-14 01:36:31.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/pacache.S	2005-02-01 01:38:33.000000000 -0500
+@@ -68,7 +68,7 @@
+ 	 * consolidated.
+ 	 */
+ 
+-	rsm     PSW_SM_I,%r19      /* relied upon translation! */
++	rsm     PSW_SM_I,%r19	/* relied upon translation! PA 2.0 Arch. F-5 */
+ 	nop
+ 	nop
+ 	nop
+@@ -475,9 +475,9 @@
+ 	.procend
+ #endif
+ 
+-	.export clear_user_page_asm,code
++	.export __clear_user_page_asm,code
+ 
+-clear_user_page_asm:
++__clear_user_page_asm:
+ 	.proc
+ 	.callinfo NO_CALLS
+ 	.entry
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/pci-dma.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/pci-dma.c	2004-08-14 01:37:42.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/pci-dma.c	2005-02-01 01:38:33.000000000 -0500
+@@ -104,7 +104,9 @@
+ 		if (!pte_none(*pte))
+ 			printk(KERN_ERR "map_pte_uncached: page already exists\n");
+ 		set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC));
++		purge_tlb_start();
+ 		pdtlb_kernel(orig_vaddr);
++		purge_tlb_end();
+ 		vaddr += PAGE_SIZE;
+ 		orig_vaddr += PAGE_SIZE;
+ 		(*paddr_ptr) += PAGE_SIZE;
+@@ -179,7 +181,9 @@
+ 	do {
+ 		pte_t page = *pte;
+ 		pte_clear(pte);
++		purge_tlb_start();
+ 		pdtlb_kernel(orig_vaddr);
++		purge_tlb_end();
+ 		vaddr += PAGE_SIZE;
+ 		orig_vaddr += PAGE_SIZE;
+ 		pte++;
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/pdc_cons.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/pdc_cons.c	2004-08-14 01:38:11.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/pdc_cons.c	2005-02-01 01:38:32.000000000 -0500
+@@ -71,6 +71,19 @@
+ 	pdc_iodc_outc(c);
+ }
+ 
++void pdc_printf(const char *fmt, ...)
++{
++	va_list args;
++	char buf[1024];
++	int i, len;
 +
-+#include <linux/config.h>
-+#include <linux/compat.h>
++	va_start(args, fmt);
++	len = vscnprintf(buf, sizeof(buf), fmt, args);
++	va_end(args);
 +
-+#ifndef CONFIG_COMPAT
++	for (i = 0; i < len; i++)
++		pdc_iodc_outc(buf[i]);
++}
+ 
+ int pdc_console_poll_key(struct console *co)
+ {
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_asm.S
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/perf_asm.S	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_asm.S	2005-02-01 01:38:33.000000000 -0500
+@@ -1,18 +1,19 @@
+ 
+ /*    low-level asm for "intrigue" (PA8500-8700 CPU perf counters)
+- *
++ * 
+  *    Copyright (C) 2001 Randolph Chung <tausq at parisc-linux.org>
+- *
++ *    Copyright (C) 2001 Hewlett-Packard (Grant Grundler)
++ * 
+  *    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.  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
+@@ -48,7 +49,7 @@
+ 	.proc
+ 	.callinfo  frame=0,NO_CALLS
+ 	.entry
+-	
 +
-+/* No compatibility layer required, add empty definitions for the compiler */
+ 	ldi     0x20,%r25                ; load up perfmon bit
+ 	mfctl   ccr,%r26                 ; get coprocessor register
+ 	or      %r25,%r26,%r26             ; set bit
+@@ -87,35 +88,35 @@
+ 	.exit
+ 	.procend
+ 
+-;************************************************************************
+-;*																		*
+-;* Name: perf_rdr_shift_in_W												*
+-;*																		*
+-;* Description:															*
+-;*	This routine shifts data in from the RDR in arg0 and returns		*
+-;*	the result in ret0.  If the RDR is <= 64 bits in length, it			*
+-;*	is shifted shifted backup immediately.  This is to compensate		*
+-;*	for RDR10 which has bits that preclude PDC stack operations			*
+-;*	when they are in the wrong state.									*
+-;*																		*
+-;* Arguments:															*
+-;*	arg0 : rdr to be read												*
+-;*	arg1 : bit length of rdr											*
+-;*																		*
+-;* Returns:																*
+-;*	ret0 = next 64 bits of rdr data from staging register				*
+-;*																		*
+-;* Register usage:														*
+-;*	arg0 : rdr to be read												*
+-;*	arg1 : bit length of rdr											*
+-;*	%r24  - original DR2 value											*
+-;*	%r1   - scratch														*
+-;*  %r29  - scratch														*
+-;*																		*
+-;* Returns:																*
+-;*	ret0 = RDR data (right justified)									*
+-;*																		*
+-;************************************************************************
++;***********************************************************************
++;*
++;* Name: perf_rdr_shift_in_W
++;*
++;* Description:
++;*	This routine shifts data in from the RDR in arg0 and returns
++;*	the result in ret0.  If the RDR is <= 64 bits in length, it
++;*	is shifted shifted backup immediately.  This is to compensate
++;*	for RDR10 which has bits that preclude PDC stack operations
++;*	when they are in the wrong state.
++;*
++;* Arguments:
++;*	arg0 : rdr to be read
++;*	arg1 : bit length of rdr
++;*
++;* Returns:
++;*	ret0 = next 64 bits of rdr data from staging register
++;*
++;* Register usage:
++;*	arg0 : rdr to be read
++;*	arg1 : bit length of rdr
++;*	%r24  - original DR2 value
++;*	%r1   - scratch
++;*  %r29  - scratch
++;*
++;* Returns:
++;*	ret0 = RDR data (right justified)
++;*
++;***********************************************************************
+ 
+ 	.export perf_rdr_shift_in_W,code
+ perf_rdr_shift_in_W:
+@@ -138,7 +139,7 @@
+ 	nop
+ 	nop
+ 	nop
+-	nop	
++	nop
+ 
+ ;
+ ; Cacheline start (32-byte cacheline)
+@@ -146,11 +147,11 @@
+ 	nop
+ 	nop
+ 	nop
+-	extrd,u		arg1,63,6,%r1    ; setup shift amount based on bits to move 
++	extrd,u		arg1,63,6,%r1	; setup shift amount by bits to move 
+ 
+ 	mtsar		%r1
+ 	shladd		arg0,2,%r0,%r1	; %r1 = 4 * RDR number
+-	blr  		%r1,%r0		    ; branch to 8-instruction sequence
++	blr  		%r1,%r0		; branch to 8-instruction sequence
+ 	nop
+ 
+ ;
+@@ -160,19 +161,19 @@
+ 	;
+ 	; RDR 0 sequence
+ 	;
+-	SFDIAG		(0)		
++	SFDIAG		(0)
+ 	ssm		    0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+-	MTDIAG_1	(1)					; mtdiag %dr1, %r1 
++	MTDIAG_1	(1)			; mtdiag %dr1, %r1 
+ 	STDIAG		(0)
+ 	ssm		    0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+typedef struct compat_siginfo{
-+} compat_siginfo_t;
+ 	;
+ 	; RDR 1 sequence
+ 	;
+-	sync			
++	sync
+ 	ssm		    0,0
+ 	SFDIAG		(1)
+ 	ssm		    0,0
+@@ -180,11 +181,11 @@
+ 	ssm		    0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+ 	nop
+-	
 +
-+static inline int compat_copy_siginfo_to_user(compat_siginfo_t __user *to, 
-+						struct siginfo *from)
-+{
-+	return -1;
-+}
+ 	;
+ 	; RDR 2 read sequence
+ 	;
+-	SFDIAG		(2)		
++	SFDIAG		(2)
+ 	ssm		    0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+@@ -192,7 +193,7 @@
+ 	STDIAG		(2)
+ 	ssm		    0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+static inline int compat_copy_siginfo_from_user(struct siginfo *to,
-+                                                compat_siginfo_t __user *from)
-+{
-+        return -1;
-+}
+ 	;
+ 	; RDR 3 read sequence
+ 	;
+@@ -208,39 +209,39 @@
+ 	;
+ 	; RDR 4 read sequence
+ 	;
+-	sync				
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(4)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+#else
+ 	; 
+ 	; RDR 5 read sequence
+ 	;
+-	sync	
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(5)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+#include <linux/compiler.h>
-+#include <asm/siginfo.h>
+ 	;
+ 	; RDR 6 read sequence
+ 	;
+-	sync	
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(6)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+/* compat view of sigval_t */
-+typedef union compat_sigval {
-+	compat_int_t sival_int;
-+	compat_uptr_t sival_ptr;
-+} compat_sigval_t;
+ 	;
+ 	; RDR 7 read sequence
+ 	;
+@@ -281,26 +282,26 @@
+ 	; RDR 10 read sequence
+ 	;
+ 	SFDIAG		(10)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(10)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+/*
-+ * 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
+ 	;
+ 	; RDR 11 read sequence
+ 	;
+ 	SFDIAG		(11)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(11)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+#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
+ 	;
+ 	; RDR 12 read sequence
+ 	;
+@@ -317,77 +318,77 @@
+ 	; RDR 13 read sequence
+ 	;
+ 	sync
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(13)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+/* 32-bit view of si.uid_t */
-+#ifndef __ARCH_SI_COMPAT_UID_T
-+#define __ARCH_SI_COMPAT_UID_T compat_uid_t
-+#endif
+ 	;
+ 	; RDR 14 read sequence
+ 	;
+-	SFDIAG		(14)	
+-	ssm			0,0
++	SFDIAG		(14)
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(14)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+/* 32-bit view of si.band_t */
-+#ifndef __ARCH_SI_COMPAT_BAND_T
-+#define __ARCH_SI_COMPAT_BAND_T compat_int_t
-+#endif
+ 	;
+ 	; RDR 15 read sequence
+ 	;
+-	sync				; RDR 15 read sequence
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(15)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+ 	nop
+-	
 +
-+#ifndef HAVE_ARCH_COMPAT_SIGINFO_T
+ 	;
+ 	; RDR 16 read sequence
+ 	;
+-	sync				; RDR 16 read sequence
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(16)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+/* Compat view of siginfo_t */
-+typedef struct compat_siginfo {
-+	compat_int_t si_signo;
-+	compat_int_t si_errno;
-+	compat_int_t si_code;
+ 	;
+ 	; RDR 17 read sequence
+ 	;
+-	SFDIAG		(17)	
+-	ssm			0,0
++	SFDIAG		(17)
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(17)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+	union {
-+		compat_int_t _pad[SI_COMPAT_PAD_SIZE];
+ 	;
+ 	; RDR 18 read sequence
+ 	;
+-	SFDIAG		(18)	
+-	ssm			0,0
++	SFDIAG		(18)
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(18)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
+-;
+-; RDR 19 read sequence
+-;
 +
-+		/* kill() */
-+		struct {
-+			compat_pid_t _pid;	/* sender's pid */
-+			__ARCH_SI_COMPAT_UID_T _uid;	/* sender's uid */
-+		} _kill;
++	;
++	; RDR 19 read sequence
++	;
+ 	b,n         perf_rdr_shift_in_W_leave
+ 	nop
+ 	nop
+@@ -401,144 +402,144 @@
+ 	; RDR 20 read sequence
+ 	;
+ 	sync
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(20)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+		/* 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;
+ 	;
+ 	; RDR 21 read sequence
+ 	;
+ 	sync
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(21)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+		/* 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;
+ 	;
+ 	; RDR 22 read sequence
+ 	;
+ 	sync
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(22)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+		/* 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;
+ 	;
+ 	; RDR 23 read sequence
+ 	;
+-	sync		
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(23)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+		/* 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;
+ 	;
+ 	; RDR 24 read sequence
+ 	;
+-	sync	
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(24)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+		/* 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 */
+ 	;
+ 	; RDR 25 read sequence
+ 	;
+ 	sync
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(25)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+#ifdef __ARCH_SI_COMPAT_TRAPNO
-+#define si_trapno	_sifields._sigfault._trapno
-+#endif
+ 	;
+ 	; RDR 26 read sequence
+ 	;
+-	SFDIAG		(26)		
+-	ssm			0,0
++	SFDIAG		(26)
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(26)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+/*
-+ * 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.
-+ */
+ 	;
+ 	; RDR 27 read sequence
+ 	;
+ 	SFDIAG		(27)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(27)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+#define SIGEV_COMPAT_MAX_SIZE	64
-+#ifndef SIGEV_COMPAT_PAD_SIZE
-+#define SIGEV_COMPAT_PAD_SIZE	((SIGEV_COMPAT_MAX_SIZE/sizeof(int)) - 3)
-+#endif
+ 	;
+ 	; RDR 28 read sequence
+ 	;
+-	sync				
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(28)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+#ifndef HAVE_ARCH_COMPAT_SIGEVENT_T
+ 	;
+ 	; RDR 29 read sequence
+ 	;
+-	sync		
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(29)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_W_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+/* 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[SIGEV_COMPAT_PAD_SIZE];
-+		compat_int_t _tid;
+ 	;
+ 	; RDR 30 read sequence
+ 	;
+ 	SFDIAG		(30)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(30)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_W_leave
+-	
 +
-+		struct {
-+			compat_uptr_t _function;
-+			compat_uptr_t _attribute;	/* really pthread_attr_t */
-+		} _sigev_thread;
-+	} _sigev_un;
-+} compat_sigevent_t;
+ 	;
+ 	; RDR 31 read sequence
+ 	;
+-	sync		
+-	ssm			0,0
++	sync
++	ssm		0,0
+ 	SFDIAG		(31)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	;
+@@ -552,28 +553,28 @@
+ 	.procend
+ 
+ 
+-;************************************************************************
+-;*																		*
+-;* Name: perf_rdr_shift_out_W												*
+-;*																		*
+-;* Description:															*
+-;*	This routine moves data to the RDR's.  The double-word that			*
+-;*	arg1 points to is loaded and moved into the staging register.		*
+-;*	Then the STDIAG instruction for the RDR # in arg0 is called			*
+-;*	to move the data to the RDR.										*
+-;*																		*
+-;* Arguments:															*
+-;*	arg0 = rdr number													*
+-;*	arg1 = 64-bit value to write										*
+-;*	%r24 - DR2 | DR2_SLOW_RET											*
+-;*	%r23 - original DR2 value											*
+-;*																		*
+-;* Returns:																*
+-;*	None																*
+-;*																		*
+-;* Register usage:														*
+-;*																		*
+-;************************************************************************
++;***********************************************************************
++;*
++;* Name: perf_rdr_shift_out_W
++;*
++;* Description:
++;*	This routine moves data to the RDR's.  The double-word that
++;*	arg1 points to is loaded and moved into the staging register.
++;*	Then the STDIAG instruction for the RDR # in arg0 is called
++;*	to move the data to the RDR.
++;*
++;* Arguments:
++;*	arg0 = rdr number
++;*	arg1 = 64-bit value to write
++;*	%r24 - DR2 | DR2_SLOW_RET
++;*	%r23 - original DR2 value
++;*
++;* Returns:
++;*	None
++;*
++;* Register usage:
++;*
++;***********************************************************************
+ 
+ 	.export perf_rdr_shift_out_W,code
+ perf_rdr_shift_out_W:
+@@ -587,24 +588,23 @@
+ 
+ 	depdi,z		1,DR2_SLOW_RET,1,%r24
+ 	MFDIAG_2	(23)
+-	or		     %r24,%r23,%r24
+-	MTDIAG_2	(24)			; set DR2_SLOW_RET
+-
+-	MTDIAG_1	(25)			; data to the staging register
++	or		%r24,%r23,%r24
++	MTDIAG_2	(24)		; set DR2_SLOW_RET
++	MTDIAG_1	(25)		; data to the staging register
+ 	shladd		arg0,2,%r0,%r1	; %r1 = 4 * RDR number
+-	blr		    %r1,%r0		    ; branch to 8-instruction sequence
++	blr		    %r1,%r0	; branch to 8-instruction sequence
+ 	nop
+ 
+ 	;
+ 	; RDR 0 write sequence
+ 	;
+ 	sync				; RDR 0 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(0)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_W_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	;
+@@ -718,7 +718,7 @@
+ 	;
+ 	; RDR 10 write sequence
+ 	;
+-	sync	
++	sync
+ 	ssm		0,0
+ 	STDIAG		(10)
+ 	STDIAG		(26)
+@@ -862,7 +862,7 @@
+ 	;
+ 	; RDR 22 write sequence
+ 	;
+-	sync	
++	sync
+ 	ssm		0,0
+ 	STDIAG		(22)
+ 	ssm		0,0
+@@ -910,7 +910,7 @@
+ 	;
+ 	; RDR 26 write sequence
+ 	;
+-	sync	
++	sync
+ 	ssm		0,0
+ 	STDIAG		(10)
+ 	STDIAG		(26)
+@@ -958,7 +958,7 @@
+ 	;
+ 	; RDR 30 write sequence
+ 	;
+-	sync	
++	sync
+ 	ssm		0,0
+ 	STDIAG		(30)
+ 	ssm		0,0
+@@ -970,7 +970,7 @@
+ 	;
+ 	; RDR 31 write sequence
+ 	;
+-	sync				
++	sync
+ 	ssm		0,0
+ 	STDIAG		(31)
+ 	ssm		0,0
+@@ -986,34 +986,32 @@
+ 	.procend
+ 
+ 
+-;**************************** CHRIS ***********************************
+-
+-;************************************************************************
+-;*																		*
+-;* Name: rdr_shift_in_U													*
+-;*																		*
+-;* Description:															*
+-;*	This routine shifts data in from the RDR in arg0 and returns		*
+-;*	the result in ret0.  If the RDR is <= 64 bits in length, it			*
+-;*	is shifted shifted backup immediately.  This is to compensate		*
+-;*	for RDR10 which has bits that preclude PDC stack operations			*
+-;*	when they are in the wrong state.									*
+-;*																		*
+-;* Arguments:															*
+-;*	arg0 : rdr to be read												*
+-;*	arg1 : bit length of rdr											*
+-;*																		*
+-;* Returns:																*
+-;*	ret0 = next 64 bits of rdr data from staging register				*
+-;*																		*
+-;* Register usage:														*
+-;*	arg0 : rdr to be read						                        *
+-;*	arg1 : bit length of rdr					                        *
+-;*	%r24 - original DR2 value											*
+-;*	%r23 - DR2 | DR2_SLOW_RET											*
+-;*	%r1  - scratch														*
+-;*																		*
+-;************************************************************************
++;***********************************************************************
++;*
++;* Name: rdr_shift_in_U
++;*
++;* Description:
++;*	This routine shifts data in from the RDR in arg0 and returns
++;*	the result in ret0.  If the RDR is <= 64 bits in length, it
++;*	is shifted shifted backup immediately.  This is to compensate
++;*	for RDR10 which has bits that preclude PDC stack operations
++;*	when they are in the wrong state.
++;*
++;* Arguments:
++;*	arg0 : rdr to be read
++;*	arg1 : bit length of rdr
++;*
++;* Returns:
++;*	ret0 = next 64 bits of rdr data from staging register
++;*
++;* Register usage:
++;*	arg0 : rdr to be read						                        
++;*	arg1 : bit length of rdr					                        
++;*	%r24 - original DR2 value
++;*	%r23 - DR2 | DR2_SLOW_RET
++;*	%r1  - scratch
++;*
++;***********************************************************************
+ 
+ 	.export perf_rdr_shift_in_U,code
+ perf_rdr_shift_in_U:
+@@ -1053,75 +1051,75 @@
+ ; Start of next 32-byte cacheline
+ ;
+ 	SFDIAG		(0)		; RDR 0 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(0)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
 +
-+#endif /* HAVE_ARCH_COMPAT_SIGEVENT_T */
+ 	SFDIAG		(1)		; RDR 1 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(1)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
 +
-+#ifndef HAVE_ARCH_COMPAT_COPY_SIGINFO
+ 	sync				; RDR 2 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(4)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+#include <linux/string.h>
+ 	sync				; RDR 3 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(3)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 4 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(4)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+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));
-+}
+ 	sync				; RDR 5 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(5)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+#endif /* !HAVE_ARCH_COMPAT_COPY_SIGINFO */
+ 	sync				; RDR 6 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(6)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
 +
-+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);
+ 	sync				; RDR 7 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(7)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	b,n         perf_rdr_shift_in_U_leave
+@@ -1134,95 +1132,95 @@
+ 	nop
+ 
+ 	SFDIAG		(9)		; RDR 9 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(9)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+ 
+ 	SFDIAG		(10)		; RDR 10 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(10)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
 +
-+#endif /* CONFIG_COMPAT */
-+#endif /* _ASM_GENERIC_COMPAT_SIGINFO_H */
+ 	SFDIAG		(11)		; RDR 11 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(11)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
 +
-Index: debian-kernel-hppa-2.6.8/drivers/char/Kconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/char/Kconfig	2005-01-15 20:14:13.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/char/Kconfig	2005-01-15 20:15:09.000000000 -0500
-@@ -689,7 +689,7 @@
+ 	SFDIAG		(12)		; RDR 12 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(12)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
  
- config HW_RANDOM
- 	tristate "Intel/AMD/VIA HW Random Number Generator support"
--	depends on (X86 || IA64) && PCI
-+	depends on X86 && PCI
- 	---help---
- 	  This driver provides kernel-side support for the Random Number
- 	  Generator hardware found on Intel i8xx-based motherboards,
-Index: debian-kernel-hppa-2.6.8/drivers/serial/Kconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/serial/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/serial/Kconfig	2005-01-15 20:15:09.000000000 -0500
-@@ -450,7 +450,7 @@
+ 	SFDIAG		(13)		; RDR 13 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(13)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	SFDIAG		(14)		; RDR 14 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(14)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	SFDIAG		(15)		; RDR 15 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(15)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	sync				; RDR 16 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(16)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	SFDIAG		(17)		; RDR 17 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(17)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	SFDIAG		(18)		; RDR 18 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(18)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	b,n         perf_rdr_shift_in_U_leave
+ 	nop
+ 	nop
+@@ -1233,86 +1231,86 @@
+ 	nop
  
- config PDC_CONSOLE
- 	bool "PDC software console support"
--	depends on PARISC && !SERIAL_MUX
-+	depends on PARISC && !SERIAL_MUX && VT
- 	default n
- 	help
- 	  Saying Y here will enable the software based PDC console to be 
-Index: debian-kernel-hppa-2.6.8/drivers/serial/8250_gsc.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/serial/8250_gsc.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/serial/8250_gsc.c	2005-01-15 20:15:09.000000000 -0500
-@@ -82,7 +82,11 @@
- 		kfree(serial);
- 		return -ENODEV;
- 	}
--
-+        
-+#ifdef CONFIG_SERIAL_8250_CONSOLE        
-+	serial8250_console_init();
-+#endif
-+        
- 	return 0;
- }
+ 	sync				; RDR 20 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(20)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	sync				; RDR 21 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(21)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	sync				; RDR 22 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(22)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	sync				; RDR 23 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(23)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	sync				; RDR 24 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(24)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	sync				; RDR 25 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(25)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	SFDIAG		(26)		; RDR 26 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(26)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	SFDIAG		(27)		; RDR 27 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(27)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	sync				; RDR 28 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	SFDIAG		(28)
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	b,n         perf_rdr_shift_in_U_leave
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+-	
++
+ 	b,n         perf_rdr_shift_in_U_leave
+ 	nop
+ 	nop
+@@ -1321,23 +1319,23 @@
+ 	nop
+ 	nop
+ 	nop
+-	
++
+ 	SFDIAG		(30)		; RDR 30 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(30)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+-	
++
+ 	SFDIAG		(31)		; RDR 31 read sequence
+-	ssm			0,0
++	ssm		0,0
+ 	MFDIAG_1	(28)
+ 	shrpd		ret0,%r0,%sar,%r1
+ 	MTDIAG_1	(1)
+ 	STDIAG		(31)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_in_U_leave
+ 	nop
  
-Index: debian-kernel-hppa-2.6.8/drivers/input/serio/gscps2.c
+@@ -1347,30 +1345,30 @@
+ 	MTDIAG_2	(24)			; restore DR2
+ 	.procend
+ 
+-;************************************************************************
+-;*																		*
+-;* Name: rdr_shift_out_U												*
+-;*																		*
+-;* Description:															*
+-;*	This routine moves data to the RDR's.  The double-word that			*
+-;*	arg1 points to is loaded and moved into the staging register.		*
+-;*	Then the STDIAG instruction for the RDR # in arg0 is called			*
+-;*	to move the data to the RDR.										*
+-;*																		*
+-;* Arguments:															*
+-;*	arg0 = rdr target													*
+-;*	arg1 = buffer pointer												*
+-;*																		*
+-;* Returns:																*
+-;*	None																*
+-;*																		*
+-;* Register usage:														*
+-;*	arg0 = rdr target													*
+-;*	arg1 = buffer pointer												*
+-;*	%r24 - DR2 | DR2_SLOW_RET											*
+-;*	%r23 - original DR2 value											*
+-;*																		*
+-;************************************************************************
++;***********************************************************************
++;*
++;* Name: rdr_shift_out_U
++;*
++;* Description:
++;*	This routine moves data to the RDR's.  The double-word that
++;*	arg1 points to is loaded and moved into the staging register.
++;*	Then the STDIAG instruction for the RDR # in arg0 is called
++;*	to move the data to the RDR.
++;*
++;* Arguments:
++;*	arg0 = rdr target
++;*	arg1 = buffer pointer
++;*
++;* Returns:
++;*	None
++;*
++;* Register usage:
++;*	arg0 = rdr target
++;*	arg1 = buffer pointer
++;*	%r24 - DR2 | DR2_SLOW_RET
++;*	%r23 - original DR2 value
++;*
++;***********************************************************************
+ 
+ 	.export perf_rdr_shift_out_U,code
+ perf_rdr_shift_out_U:
+@@ -1386,11 +1384,11 @@
+ 	depdi,z		1,DR2_SLOW_RET,1,%r24
+ 	MFDIAG_2	(23)
+ 	or		%r24,%r23,%r24
+-	MTDIAG_2	(24)			; set DR2_SLOW_RET
++	MTDIAG_2	(24)		; set DR2_SLOW_RET
+ 
+-	MTDIAG_1	(25)			; data to the staging register
+-	shladd		 arg0,2,%r0,%r1	; %r1 = 4 * RDR number
+-	blr		    %r1,%r0		    ; branch to 8-instruction sequence
++	MTDIAG_1	(25)		; data to the staging register
++	shladd		arg0,2,%r0,%r1	; %r1 = 4 * RDR number
++	blr		%r1,%r0		; branch to 8-instruction sequence
+ 	nop
+ 
+ ;
+@@ -1398,291 +1396,291 @@
+ ;
+ 
+ 	sync				; RDR 0 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(0)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 1 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(1)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 2 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(2)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 3 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(3)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 4 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(4)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 5 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(5)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 6 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(6)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 7 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(7)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 8 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(8)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 9 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(9)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 10 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(10)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 11 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(11)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 12 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(12)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 13 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(13)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 14 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(14)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 15 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(15)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 16 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(16)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 17 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(17)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 18 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(18)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 19 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(19)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 20 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(20)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 21 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(21)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 22 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(22)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 23 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(23)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 24 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(24)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 25 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(25)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 26 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(26)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 27 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(27)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 28 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(28)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 29 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(29)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 30 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(30)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ 	sync				; RDR 31 write sequence
+-	ssm			0,0
++	ssm		0,0
+ 	STDIAG		(31)
+-	ssm			0,0
++	ssm		0,0
+ 	b,n         perf_rdr_shift_out_U_leave
+ 	nop
+-	ssm			0,0
++	ssm		0,0
+ 	nop
+ 
+ perf_rdr_shift_out_U_leave:
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_images.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/serio/gscps2.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/serio/gscps2.c	2005-01-15 20:15:09.000000000 -0500
-@@ -38,7 +38,7 @@
- #include <asm/parisc-device.h>
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/perf_images.h	2004-08-14 01:36:17.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_images.h	2005-02-01 01:38:33.000000000 -0500
+@@ -2,6 +2,7 @@
+  *    Imagine for use with the Onyx (PCX-U) CPU interface 
+  *
+  *    Copyright (C) 2001 Randolph Chung <tausq at parisc-linux.org>
++ *    Copyright (C) 2001 Hewlett-Packard (Grant Grundler)
+  *
+  *    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
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/real2.S
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/real2.S	2004-08-14 01:36:58.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/real2.S	2005-02-01 01:38:33.000000000 -0500
+@@ -149,7 +149,7 @@
+ rfi_virt2real:
+ 	/* switch to real mode... */
+ 	ssm		0,0		/* See "relied upon translation" */
+-	nop				/* comment in interruption.S */
++	nop				/* PA 2.0 Arch. F-5 */
+ 	nop
+ 	nop
+ 	nop
+@@ -186,7 +186,7 @@
+ 	.align 128
+ rfi_real2virt:
+ 	ssm		0,0		/* See "relied upon translation" */
+-	nop				/* comment in interruption.S */
++	nop				/* PA 2.0 Arch. F-5 */
+ 	nop
+ 	nop
+ 	nop
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/smp.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/smp.c	2004-08-14 01:38:08.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/smp.c	2005-02-01 01:38:33.000000000 -0500
+@@ -333,6 +333,7 @@
+ 	struct smp_call_struct data;
+ 	unsigned long timeout;
+ 	static spinlock_t lock = SPIN_LOCK_UNLOCKED;
++	int retries = 0;
  
- MODULE_AUTHOR("Laurent Canet <canetl at esiee.fr>, Thibaut Varene <varenet at esiee.fr>, Helge Deller <deller at gmx.de>");
--MODULE_DESCRIPTION("HP GSC PS/2 port driver");
-+MODULE_DESCRIPTION("HP GSC PS2 port driver");
- MODULE_LICENSE("GPL");
- MODULE_DEVICE_TABLE(parisc, gscps2_device_tbl);
+ 	if (num_online_cpus() < 2)
+ 		return 0;
+@@ -365,21 +366,22 @@
+ 	/*  Send a message to all other CPUs and wait for them to respond  */
+ 	send_IPI_allbutself(IPI_CALL_FUNC);
  
-@@ -325,7 +325,7 @@
++ retry:
+ 	/*  Wait for response  */
+ 	timeout = jiffies + HZ;
+ 	while ( (atomic_read (&data.unstarted_count) > 0) &&
+ 		time_before (jiffies, timeout) )
+ 		barrier ();
  
- static struct serio gscps2_serio_port =
- {
--	.name =		"GSC PS/2",
-+	.name =		"GSC PS2",
- 	.idbus =	BUS_GSC,
- 	.idvendor =	PCI_VENDOR_ID_HP,
- 	.idproduct =	0x0001,
-@@ -447,7 +447,7 @@
- };
++	if (atomic_read (&data.unstarted_count) > 0) {
++		printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d), try %d\n",
++		      smp_processor_id(), ++retries);
++		goto retry;
++	}
+ 	/* We either got one or timed out. Release the lock */
  
- static struct parisc_driver parisc_ps2_driver = {
--	.name		= "GSC PS/2",
-+	.name		= "GSC PS2",
- 	.id_table	= gscps2_device_tbl,
- 	.probe		= gscps2_probe,
- 	.remove		= gscps2_remove,
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/pdc_cons.c
+ 	mb();
+ 	smp_call_function_data = NULL;
+-	if (atomic_read (&data.unstarted_count) > 0) {
+-		printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d)\n",
+-		      smp_processor_id());
+-		return -ETIMEDOUT;
+-	}
+ 
+ 	while (wait && atomic_read (&data.unfinished_count) > 0)
+ 			barrier ();
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall.S
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/pdc_cons.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/pdc_cons.c	2005-01-15 20:15:09.000000000 -0500
-@@ -71,6 +71,19 @@
- 	pdc_iodc_outc(c);
- }
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/syscall.S	2004-08-14 01:38:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall.S	2005-02-01 01:38:33.000000000 -0500
+@@ -16,6 +16,14 @@
+ #include <asm/assembly.h>
+ #include <asm/processor.h>
  
-+void pdc_printf(const char *fmt, ...)
-+{
-+	va_list args;
-+	char buf[1024];
-+	int i, len;
++	/* We fill the empty parts of the gateway page with
++ 	 * something that will kill the kernel or a
++ 	 * userspace application.
++	 */
++#define KILL_INSN	break	0,0
 +
-+	va_start(args, fmt);
-+	len = vscnprintf(buf, sizeof(buf), fmt, args);
-+	va_end(args);
++#include <linux/config.h> /* for CONFIG_SMP */
 +
-+	for (i = 0; i < len; i++)
-+		pdc_iodc_outc(buf[i]);
-+}
+ #ifdef __LP64__
+ 	.level          2.0w
+ #else
+@@ -38,21 +46,41 @@
+ 	.align 4096
+ linux_gateway_page:
  
- int pdc_console_poll_key(struct console *co)
- {
-Index: debian-kernel-hppa-2.6.8/include/linux/hil_mlc.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/include/linux/hil_mlc.h	2005-01-15 20:15:09.000000000 -0500
-@@ -0,0 +1,171 @@
-+/*
-+ * 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
-+ *
-+ */
+-	.rept 56
+-	break   0,0
++        /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */
++	.rept 44
++	KILL_INSN
+ 	.endr
+ 
++	/* ADDRESS 0xb0 to 0xb4, lws uses 1 insns for entry */
++	/* Light-weight-syscall entry must always be located at 0xb0 */
++	/* WARNING: Keep this number updated with table size changes */
++#define __NR_lws_entries (2)
 +
-+#include <linux/hil.h>
-+#include <linux/time.h>
-+#include <linux/interrupt.h>
-+#include <asm/semaphore.h>
-+#include <linux/serio.h>
-+#include <linux/list.h>
++lws_entry:
++	/* Unconditional branch to lws_start, located on the 
++	   same gateway page */
++	b,n	lws_start
 +
-+typedef struct hil_mlc hil_mlc;
++	/* Fill from 0xb4 to 0xe0 */
++	.rept 11
++	KILL_INSN
++	.endr
 +
-+/* 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,
++	/* This function MUST be located at 0xe0 for glibc's threading 
++	mechanism to work. DO NOT MOVE THIS CODE EVER! */
+ set_thread_pointer:
+ 	gate	.+8, %r0		/* increase privilege */
+ 	depi	3, 31, 2, %r31		/* Ensure we return into user mode. */
+ 	be	0(%sr7,%r31)		/* return to user space */
+ 	mtctl	%r26, %cr27		/* move arg0 to the control register */
+ 
++	/* Increase the chance of trapping if random jumps occur to this
++	address, fill from 0xf0 to 0x100 */
+ 	.rept 4
+-	break   0,0
++	KILL_INSN
+ 	.endr
+ 
+-/* This address must remain fixed, or user binaries go splat. */
++/* This address must remain fixed at 0x100 for glibc's syscalls to work */
+ 	.align 256
+ linux_gateway_entry:
+ 	gate	.+8, %r0			/* become privileged */
+@@ -157,6 +185,7 @@
+ 
+ 	/* Are we being ptraced? */
+ 	mfctl	%cr30, %r1
++	LDREG	TI_TASK(%r1),%r1
+ 	LDREG	TASK_PTRACE(%r1), %r1
+ 	bb,<,n	%r1,31,.Ltracesys
+ 	
+@@ -177,11 +206,8 @@
+ 	comiclr,>>=	__NR_Linux_syscalls, %r20, %r0
+ 	b,n	.Lsyscall_nosys
+ 	
+-#ifdef __LP64__
+-	ldd,s   %r20(%r19), %r19
+-#else
+-	ldwx,s  %r20(%r19), %r19
+-#endif
++	LDREGX  %r20(%r19), %r19
 +
-+  	/* HILSE_CTS checks if the loop is busy. */
-+	HILSE_CTS,
+ 	/* If this is a sys_rt_sigreturn call, and the signal was received
+ 	 * when not in_syscall, then we want to return via syscall_exit_rfi,
+ 	 * not syscall_exit.  Signal no. in r20, in_syscall in r25 (see
+@@ -291,11 +317,8 @@
+ 	comiclr,>>=	__NR_Linux_syscalls, %r20, %r0
+ 	b,n	.Lsyscall_nosys
+ 
+-#ifdef __LP64__
+-	ldd,s   %r20(%r19), %r19
+-#else
+-	ldwx,s  %r20(%r19), %r19
+-#endif
++	LDREGX  %r20(%r19), %r19
 +
-+	/* HILSE_OUT_LAST sends the given command packet to 
-+	 * the last configured/running device on the loop.
-+	 */
-+	HILSE_OUT_LAST,
+ 	/* If this is a sys_rt_sigreturn call, and the signal was received
+ 	 * when not in_syscall, then we want to return via syscall_exit_rfi,
+ 	 * not syscall_exit.  Signal no. in r20, in_syscall in r25 (see
+@@ -344,12 +367,295 @@
+ 	ldil	L%syscall_exit_rfi,%r1
+ 	be,n	R%syscall_exit_rfi(%sr7,%r1)
+ 
 +
-+	/* HILSE_OUT_DISC sends the given command packet to
-+	 * the next device past the last configured/running one.
-+	 */
-+	HILSE_OUT_DISC,
++	/*********************************************************
++		Light-weight-syscall code
 +
-+	/* HILSE_FUNC runs a callback function with given arguments.
-+	 * a positive return value causes the "ugly" branch to be taken.
-+	 */
-+	HILSE_FUNC,
++		r20 - lws number
++		r26,r25,r24,r23,r22 - Input registers
++		r28 - Function return register
++		r21 - Error code.
 +
-+  	/* HILSE_IN simply expects any non-errored packet to arrive 
-+	 * within arg usecs.
-+	 */
-+	HILSE_IN		= 0x100,
++		Scracth: Any of the above that aren't being
++		currently used, including r1. 
 +
-+  	/* HILSE_EXPECT expects a particular packet to arrive 
-+	 * within arg usecs, any other packet is considered an error.
-+	 */
-+	HILSE_EXPECT,
++		Return pointer: r31 (Not usable)
 +
-+  	/* HILSE_EXPECT_LAST as above but dev field should be last 
-+	 * discovered/operational device.
++		Error codes returned by entry path:
++
++		ENOSYS - r20 was an invalid LWS number.
++
++	*********************************************************/
++lws_start:
++	/* Gate and ensure we return to userspace */
++	gate	.+8, %r0
++	depi	3, 31, 2, %r31	/* Ensure we return to userspace */
++
++#ifdef __LP64__
++	/* FIXME: If we are a 64-bit kernel just
++	 *        turn this on unconditionally.
 +	 */
-+	HILSE_EXPECT_LAST,
++	ssm	PSW_SM_W, %r1
++	extrd,u	%r1,PSW_W_BIT,1,%r1
++	/* sp must be aligned on 4, so deposit the W bit setting into
++	 * the bottom of sp temporarily */
++	or,ev	%r1,%r30,%r30
 +
-+  	/* HILSE_EXPECT_LAST as above but dev field should be first 
-+	 * undiscovered/inoperational device.
++	/* Clip LWS number to a 32-bit value always */
++	depdi	0, 31, 32, %r20
++#endif	
++
++        /* Is the lws entry number valid? */
++	comiclr,>>=	__NR_lws_entries, %r20, %r0
++	b,n	lws_exit_nosys
++
++	/* WARNING: Trashing sr2 and sr3 */
++	mfsp	%sr7,%r1			/* get userspace into sr3 */
++	mtsp	%r1,%sr3
++	mtsp	%r0,%sr2			/* get kernel space into sr2 */
++
++	/* Load table start */
++	ldil	L%lws_table, %r1
++	ldo	R%lws_table(%r1), %r28	/* Scratch use of r28 */
++	LDREGX	%r20(%sr2,r28), %r21	/* Scratch use of r21 */
++
++	/* Jump to lws, lws table pointers already relocated */
++	be,n	0(%sr2,%r21)
++
++lws_exit_nosys:
++	ldo	-ENOSYS(%r0),%r21		   /* set errno */
++	/* Fall through: Return to userspace */
++
++lws_exit:
++#ifdef __LP64__
++	/* decide whether to reset the wide mode bit
++	 *
++	 * For a syscall, the W bit is stored in the lowest bit
++	 * of sp.  Extract it and reset W if it is zero */
++	extrd,u,*<>	%r30,63,1,%r1
++	rsm	PSW_SM_W, %r0
++	/* now reset the lowest bit of sp if it was set */
++	xor	%r30,%r1,%r30
++#endif
++	be,n	0(%sr3, %r31)
++
++
++	
++	/***************************************************
++		Implementing CAS as an atomic operation:
++
++		%r26 - Address to examine
++		%r25 - Old value to check (old)
++		%r24 - New value to set (new)
++		%r28 - Return prev through this register.
++		%r21 - Kernel error code
++
++		If debugging is DISabled:
++
++		%r21 has the following meanings:
++
++		EAGAIN - CAS is busy, ldcw failed, try again.
++		EFAULT - Read or write failed.		
++
++		If debugging is enabled:
++
++		EDEADLOCK - CAS called recursively.
++		EAGAIN && r28 == 1 - CAS is busy. Lock contended.
++		EAGAIN && r28 == 2 - CAS is busy. ldcw failed.
++		EFAULT - Read or write failed.
++
++		Scratch: r20, r28, r1
++
++	****************************************************/
++
++	/* Do not enable LWS debugging */
++#define ENABLE_LWS_DEBUG 0 
++
++	/* ELF64 Process entry path */
++lws_compare_and_swap64:
++#ifdef __LP64__
++	b,n	lws_compare_and_swap
++#else
++	/* If we are not a 64-bit kernel, then we don't
++	 * implement having 64-bit input registers
 +	 */
-+	HILSE_EXPECT_DISC
-+};
++	b,n	lws_exit_nosys
++#endif
 +
-+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       */
-+};
++	/* ELF32 Process entry path */
++lws_compare_and_swap32:
++#ifdef __LP64__
++	/* Clip all the input registers */
++	depdi	0, 31, 32, %r26
++	depdi	0, 31, 32, %r25
++	depdi	0, 31, 32, %r24
++#endif
 +
-+/* 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);
++lws_compare_and_swap:
++#ifdef CONFIG_SMP
++	/* Load start of lock table */
++	ldil	L%lws_lock_start, %r20
++	ldo	R%lws_lock_start(%r20), %r28
 +
-+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 */
-+};
++	/* Extract four bits from r26 and hash lock (Bits 4-7) */
++	extru  %r26, 27, 4, %r20
 +
-+struct hil_mlc_serio_map {
-+	hil_mlc *mlc;
-+	int di_revmap;
-+	int didx;
-+};
++	/* Find lock to use, the hash is either one of 0 to
++	   15, multiplied by 16 (keep it 16-byte aligned)
++	   and add to the lock table offset. */
++	shlw	%r20, 4, %r20
++	add	%r20, %r28, %r20
 +
-+/* How many (possibly old/detached) devices the we try to keep track of */
-+#define HIL_MLC_DEVMEM 16
++# ifdef ENABLE_LWS_DEBUG
++	/*	
++		DEBUG, check for deadlock! 
++		If the thread register values are the same
++		then we were the one that locked it last and
++		this is a recurisve call that will deadlock.
++		We *must* giveup this call and fail.
++	*/
++	ldw	4(%sr2,%r20), %r28			/* Load thread register */
++	mfctl	%cr27, %r21				/* Get current thread register */
++	cmpb,<>,n	%r21, %r28, cas_lock		/* Called recursive? */
++	b	lws_exit				/* Return error! */
++	ldo	-EDEADLOCK(%r0), %r21
++cas_lock:
++	/* FIXME: This check is required! */
++	cmpb,=,n	%r0, %r28, cas_nocontend	/* Is nobody using it? */
++	ldo	1(%r0), %r28				/* 1st case */
++	b	lws_exit				/* Contended... */
++	ldo	-EAGAIN(%r0), %r21			/* Spin in userspace */
++cas_nocontend:
++# endif
++/* ENABLE_LWS_DEBUG */
 +
-+struct hil_mlc {
-+	struct list_head	list;	/* hil_mlc is organized as linked list */
++	ldcw	0(%sr2,%r20), %r28			/* Try to acquire the lock */
++	cmpb,<>,n	%r0, %r28, cas_action		/* Did we get it? */
++cas_wouldblock:
++	ldo	2(%r0), %r28				/* 2nd case */
++	b	lws_exit				/* Contended... */
++	ldo	-EAGAIN(%r0), %r21			/* Spin in userspace */
++#endif
++/* CONFIG_SMP */
 +
-+	rwlock_t		lock;
++	/*
++		prev = *addr;
++		if ( prev == old )
++		  *addr = new;
++		return prev;
++	*/
 +
-+	void *priv; /* Data specific to a particular type of MLC */
++	/* NOTES:
++		This all works becuse intr_do_signal
++		and schedule both check the return iasq
++		and see that we are on the kernel page
++		so this process is never scheduled off
++		or is ever sent any signal of any sort,
++		thus it is wholly atomic from usrspaces
++		perspective
++	*/
++cas_action:
++#if defined CONFIG_SMP && defined ENABLE_LWS_DEBUG
++	/* DEBUG */
++	mfctl	%cr27, %r1
++	stw	%r1, 4(%sr2,%r20)
++#endif
++	/* The load and store could fail */
++1:	ldw	0(%sr3,%r26), %r28
++	sub,<>	%r28, %r25, %r0
++2:	stw	%r24, 0(%sr3,%r26)
++#ifdef CONFIG_SMP
++	/* Free lock */
++	stw	%r20, 0(%sr2,%r20)
++# ifdef ENABLE_LWS_DEBUG
++	/* Clear thread register indicator */
++	stw	%r0, 4(%sr2,%r20)
++# endif
++#endif
++	/* Return to userspace, set no error */
++	b	lws_exit
++	copy	%r0, %r21
++	nop	/* Add some visual space in objdump */
++	nop
++	nop
++	nop
++3:		
++	/* Error occured on load or store */
++#ifdef CONFIG_SMP
++	/* Free lock */
++	stw	%r20, 0(%sr2,%r20)
++# ifdef ENABLE_LWS_DEBUG
++	stw	%r0, 4(%sr2,%r20)
++# endif
++#endif
++	b	lws_exit
++	ldo	-EFAULT(%r0),%r21	/* set errno */
++	nop
++	nop
++	nop
++	nop
 +
-+	int 			seidx;	/* Current node in state engine */
-+	int			istarted, ostarted;
++	/* Two exception table entries, one for the load,
++	   the other for the store. Either return -EFAULT */
++	.section __ex_table,"aw"
++#ifdef __LP64__
++	/* Pad the address calculation */
++	.word	0,(2b - linux_gateway_page)
++	.dword	(3b - 2b) 
++#else
++	.word	2b - linux_gateway_page
++	.word	(3b - 2b) 
++#endif
++	.previous
 +
-+	hil_mlc_cts		*cts;
-+	struct semaphore	csem;   /* Raised when loop idle */
++	.section __ex_table,"aw"
++#ifdef __LP64__
++	/* Pad the address calculation */
++	.word	0,(1b - linux_gateway_page)
++	.dword	(3b - 1b) 
++#else
++	.word	1b - linux_gateway_page
++	.word	(3b - 1b) 
++#endif
++	.previous
 +
-+	hil_mlc_out		*out;
-+	struct semaphore	osem;   /* Raised when outpacket dispatched */
-+	hil_packet		opacket;
++end_compare_and_swap:
 +
-+	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;
++	/* Make sure nothing else is placed on this page */
++	.align 4096
++	.export end_linux_gateway_page
++end_linux_gateway_page:
 +
-+	int			ddi;	/* Last operational device id */
-+	int			lcv;	/* LCV to throttle loops */
-+	struct timeval		lcv_tv; /* Time loop was started */
++	/* Relocate symbols assuming linux_gateway_page is mapped
++	   to virtual address 0x0 */
++#ifdef __LP64__
++	/* 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
++		  subtraction result is only a word in
++		  length, so we pad the value.
++	*/
++#define LWS_ENTRY(_name_) .word 0,(lws_##_name_ - linux_gateway_page)
++#else
++#define LWS_ENTRY(_name_) .word  (lws_##_name_ - linux_gateway_page)
++#endif
 +
-+	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 */
++	.align 4096
++	/* Light-weight-syscall table */
++	/* Start of lws table. */
++	.export lws_table
++.Llws_table:
++lws_table:
++	LWS_ENTRY(compare_and_swap32)	/* 0 - ELF32 Atomic compare and swap */
++	LWS_ENTRY(compare_and_swap64)	/* 1 - ELF64 Atomic compare and swap */
++	/* End of lws table */
 +
-+	void			(*inc_use_count)(void);
-+	void			(*dec_use_count)(void);
+ 	.align 4096
+ 	.export sys_call_table
+ .Lsys_call_table:
+ sys_call_table:
+ #include "syscall_table.S"
+-.end
 +
-+	int			opercnt;
+ #ifdef __LP64__
+ 	.align 4096
+ 	.export sys_call_table64
+@@ -359,10 +665,29 @@
+ #include "syscall_table.S"
+ #endif
+ 
++#ifdef CONFIG_SMP
++	/*
++		All light-weight-syscall atomic operations 
++		will use this set of locks 
++	*/
++	.section .data
++	.align 4096
++	.export lws_lock_start
++.Llws_lock_start:
++lws_lock_start:
++	/* lws locks */
++	.align 16
++	.rept 16
++	/* Keep locks aligned at 16-bytes */
++	.word 1
++	.word 0 
++	.word 0
++	.word 0
++	.endr
++	.previous
++#endif
++/* CONFIG_SMP for lws_lock_start */
+ 
+-	/* Make sure nothing else is placed on this page */
++.end
+ 
+-	.align 4096
+-	.export end_linux_gateway_page
+-end_linux_gateway_page:
+ 
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall_table.S
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/syscall_table.S	2004-08-14 01:36:13.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall_table.S	2005-02-01 01:38:33.000000000 -0500
+@@ -334,12 +334,12 @@
+ 	ENTRY_SAME(epoll_ctl)		/* 225 */
+ 	ENTRY_SAME(epoll_wait)
+  	ENTRY_SAME(remap_file_pages)
+-  ENTRY_SAME(semtimedop)
+-  ENTRY_SAME(mq_open)
+-  ENTRY_SAME(mq_unlink)   /* 230 */
+-  ENTRY_SAME(mq_timedsend)
+-  ENTRY_SAME(mq_timedreceive)
+-  ENTRY_SAME(mq_notify)
+-  ENTRY_SAME(mq_getsetattr)
+-  /* Nothing yet */       /* 235 */
++	ENTRY_SAME(semtimedop)
++	ENTRY_SAME(mq_open)
++	ENTRY_SAME(mq_unlink)   /* 230 */
++	ENTRY_SAME(mq_timedsend)
++	ENTRY_SAME(mq_timedreceive)
++	ENTRY_SAME(mq_notify)
++	ENTRY_SAME(mq_getsetattr)
++	/* Nothing yet */       /* 235 */
+ 
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/traps.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/traps.c	2004-08-14 01:38:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/traps.c	2005-02-01 01:38:33.000000000 -0500
+@@ -135,32 +135,19 @@
+ 
+ EXPORT_SYMBOL(dump_stack);
+ 
+-void show_stack(struct task_struct *task, unsigned long *s)
++static void do_show_stack(struct unwind_frame_info *info)
+ {
+ 	int i = 1;
+-	struct unwind_frame_info info;
+-
+-	if (!task) {
+-		unsigned long sp, ip, rp;
+-
+-HERE:
+-		asm volatile ("copy %%r30, %0" : "=r"(sp));
+-		ip = (unsigned long)&&HERE;
+-		rp = (unsigned long)__builtin_return_address(0);
+-		unwind_frame_init(&info, current, sp, ip, rp);
+-	} else {
+-		unwind_frame_init_from_blocked_task(&info, task);
+-	}
+ 
+ 	printk("Backtrace:\n");
+ 	while (i <= 16) {
+-		if (unwind_once(&info) < 0 || info.ip == 0)
++		if (unwind_once(info) < 0 || info->ip == 0)
+ 			break;
+ 
+-		if (__kernel_text_address(info.ip)) {
+-			printk(" [<" RFMT ">] ", info.ip);
++		if (__kernel_text_address(info->ip)) {
++			printk(" [<" RFMT ">] ", info->ip);
+ #ifdef CONFIG_KALLSYMS
+-			print_symbol("%s\n", info.ip);
++			print_symbol("%s\n", info->ip);
+ #else
+ 			if ((i & 0x03) == 0)
+ 				printk("\n");
+@@ -171,6 +158,25 @@
+ 	printk("\n");
+ }
+ 
++void show_stack(struct task_struct *task, unsigned long *s)
++{
++	struct unwind_frame_info info;
 +
-+	struct tasklet_struct	*tasklet;
-+};
++	if (!task) {
++		unsigned long sp, ip, rp;
 +
-+int hil_mlc_register(hil_mlc *mlc);
-+int hil_mlc_unregister(hil_mlc *mlc);
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_malloc.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_malloc.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_malloc.c	2005-01-15 20:15:09.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
++HERE:
++		asm volatile ("copy %%r30, %0" : "=r"(sp));
++		ip = (unsigned long)&&HERE;
++		rp = (unsigned long)__builtin_return_address(0);
++		unwind_frame_init(&info, current, sp, ip, rp);
++	} else {
++		unwind_frame_init_from_blocked_task(&info, task);
++	}
++
++	do_show_stack(&info);
++}
++
+ void die_if_kernel(char *str, struct pt_regs *regs, long err)
+ {
+ 	if (user_mode(regs)) {
+@@ -373,9 +379,9 @@
+ 
+ 
+ /*
+- * This routine handles page faults.  It determines the address,
+- * and the problem, and then passes it off to one of the appropriate
+- * routines.
++ * This routine is called as a last resort when everything else
++ * has gone clearly wrong. We get called for faults in kernel space,
++ * and HPMC's.
   */
+ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long offset)
+ {
+@@ -407,7 +413,12 @@
  
- #ifdef __FreeBSD__
-Index: debian-kernel-hppa-2.6.8/include/asm-parisc/bitops.h
+ 	}
+ 	    
+-	show_stack(NULL, (unsigned long *)regs->gr[30]);
++	{
++		/* show_stack(NULL, (unsigned long *)regs->gr[30]); */
++		struct unwind_frame_info info;
++		unwind_frame_init(&info, current, regs->gr[30], regs->iaoq[0], regs->gr[2]);
++		do_show_stack(&info);
++	}
+ 
+ 	printk("\n");
+ 	printk(KERN_CRIT "%s: Code=%d regs=%p (Addr=" RFMT ")\n",
+@@ -421,9 +432,16 @@
+ 	 * system will shut down immediately right here. */
+ 	pdc_soft_power_button(0);
+ 	
+-	/* Gutter the processor! */
+-	for(;;)
+-	    ;
++	/* Call kernel panic() so reboot timeouts work properly 
++	 * FIXME: This function should be on the list of
++	 * panic notifiers, and we should call panic
++	 * directly from the location that we wish. 
++	 * e.g. We should not call panic from
++	 * parisc_terminate, but rather the oter way around.
++	 * This hack works, prints the panic message twice,
++	 * and it enables reboot timers!
++	 */
++	panic(msg);
+ }
+ 
+ void handle_interruption(int code, struct pt_regs *regs)
+@@ -437,6 +455,36 @@
+ 	else
+ 	    local_irq_enable();
+ 
++	/* Security check:
++	 * If the priority level is still user, and the
++	 * faulting space is not equal to the active space
++	 * then the user is attempting something in a space
++	 * that does not belong to them. Kill the process.
++	 *
++	 * This is normally the situation when the user
++	 * attempts to jump into the kernel space at the
++	 * wrong offset, be it at the gateway page or a
++	 * random location.
++	 *
++	 * We cannot normally signal the process because it
++	 * could *be* on the gateway page, and processes
++	 * executing on the gateway page can't have signals
++	 * delivered.
++	 * 
++	 * We merely readjust the address into the users
++	 * space, at a destination address of zero, and
++	 * allow processing to continue.
++	 */
++	if (((unsigned long)regs->iaoq[0] & 3) &&
++	    ((unsigned long)regs->iasq[0] != (unsigned long)regs->sr[7])) { 
++	  	/* Kill the user process later */
++	  	regs->iaoq[0] = 0 | 3;
++		regs->iaoq[1] = regs->iaoq[0] + 4;
++	 	regs->iasq[0] = regs->iasq[0] = regs->sr[7];
++		regs->gr[0] &= ~PSW_B;
++		return;
++	}
++	
+ #if 0
+ 	printk(KERN_CRIT "Interruption # %d\n", code);
+ #endif
+@@ -461,7 +509,7 @@
+ 	case  3:
+ 		/* Recovery counter trap */
+ 		regs->gr[0] &= ~PSW_R;
+-		if (regs->iasq[0])
++		if (user_space(regs))
+ 			handle_gdb_break(regs, TRAP_TRACE);
+ 		/* else this must be the start of a syscall - just let it run */
+ 		return;
+@@ -565,9 +613,16 @@
+ 		/* Fall through */
+ 	case 17:
+ 		/* Non-access data TLB miss fault/Non-access data page fault */
+-		/* TODO: Still need to add slow path emulation code here */
+-		/* TODO: Understand what is meant by the TODO listed
+-		         above this one. (Carlos) */
++		/* FIXME: 
++		 	 Still need to add slow path emulation code here!
++		         If the insn used a non-shadow register, then the tlb
++			 handlers could not have their side-effect (e.g. probe
++			 writing to a target register) emulated since rfir would
++			 erase the changes to said register. Instead we have to
++			 setup everything, call this function we are in, and emulate
++			 by hand. Technically we need to emulate:
++			 fdc,fdce,pdc,"fic,4f",prober,probeir,probew, probeiw
++		*/			  
+ 		fault_address = regs->ior;
+ 		fault_space = regs->isr;
+ 		break;
+@@ -598,7 +653,7 @@
+ 	case 25:
+ 		/* Taken branch trap */
+ 		regs->gr[0] &= ~PSW_T;
+-		if (regs->iasq[0])
++		if (user_space(regs))
+ 			handle_gdb_break(regs, TRAP_BRANCH);
+ 		/* else this must be the start of a syscall - just let it
+ 		 * run.
+@@ -677,7 +732,7 @@
+ 	}
+ 
+ 	if (user_mode(regs)) {
+-	    if ((fault_space>>SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) {
++	    if ((fault_space >> SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) {
+ #ifdef PRINT_USER_FAULTS
+ 		if (fault_space == 0)
+ 			printk(KERN_DEBUG "User Fault on Kernel Space ");
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/unaligned.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/bitops.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/bitops.h	2005-01-15 20:15:09.000000000 -0500
-@@ -38,9 +38,9 @@
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/unaligned.c	2004-08-14 01:36:44.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/unaligned.c	2005-02-01 01:38:33.000000000 -0500
+@@ -559,7 +559,7 @@
  
- 	addr += (nr >> SHIFT_PER_LONG);
- 	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_lock_irqsave(addr, flags);
- 	*addr |= mask;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_unlock_irqrestore(addr, flags);
+ 	if (regs->isr != regs->sr[7])
+ 	{
+-		printk(KERN_CRIT "isr verification failed (isr: " RFMT ", sr7: " RFMT "\n",
++		printk(KERN_CRIT "isr verification failed (isr: " RFMT ", sr7: " RFMT ")\n",
+ 			regs->isr, regs->sr[7]);
+ 
+ 		/* don't kill him though, since he has appropriate access to the page, or we
+Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/unwind.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/unwind.c	2004-08-14 01:36:13.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/unwind.c	2005-02-01 01:38:33.000000000 -0500
+@@ -12,8 +12,10 @@
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/slab.h>
++#include <linux/kallsyms.h>
+ 
+ #include <asm/uaccess.h>
++#include <asm/assembly.h>
+ 
+ #include <asm/unwind.h>
+ 
+@@ -43,22 +45,24 @@
+ 	const struct unwind_table_entry *e = 0;
+ 	unsigned long lo, hi, mid;
+ 
+-	for (lo = 0, hi = table->length; lo < hi; )
+-	{
+-		mid = (lo + hi) / 2;
++	lo = 0; 
++	hi = table->length - 1; 
++	
++	while (lo <= hi) {
++		mid = (hi - lo) / 2 + lo;
+ 		e = &table->table[mid];
+ 		if (addr < e->region_start)
+-			hi = mid;
++			hi = mid - 1;
+ 		else if (addr > e->region_end)
+ 			lo = mid + 1;
+ 		else
+-			break;
++			return e;
+ 	}
+ 
+-	return e;
++	return NULL;
  }
  
- static __inline__ void __set_bit(int nr, volatile unsigned long * address)
-@@ -61,9 +61,9 @@
+-static inline const struct unwind_table_entry *
++static const struct unwind_table_entry *
+ find_unwind_entry(unsigned long addr)
+ {
+ 	struct unwind_table *table = unwind_tables;
+@@ -68,8 +72,7 @@
+ 	    addr <= kernel_unwind_table.end)
+ 		e = find_unwind_entry_in_table(&kernel_unwind_table, addr);
+ 	else
+-		for (; table; table = table->next)
+-		{
++		for (; table; table = table->next) {
+ 			if (addr >= table->start && 
+ 			    addr <= table->end)
+ 				e = find_unwind_entry_in_table(table, addr);
+@@ -99,6 +102,11 @@
+ 	table->next = NULL;
  
- 	addr += (nr >> SHIFT_PER_LONG);
- 	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_lock_irqsave(addr, flags);
- 	*addr &= ~mask;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_unlock_irqrestore(addr, flags);
+ 	for (; start <= end; start++) {
++		if (start < end && 
++		    start->region_end > (start+1)->region_start) {
++			printk("WARNING: Out of order unwind entry! %p and %p\n", start, start+1);
++		}
++
+ 		start->region_start += base_addr;
+ 		start->region_end += base_addr;
+ 	}
+@@ -170,12 +178,40 @@
+ 	int looking_for_rp, rpoffset = 0;
+ 
+ 	e = find_unwind_entry(info->ip);
+-	if (!e) {
++	if (e == NULL) {
+ 		unsigned long sp;
+ 		extern char _stext[], _etext[];
+ 
+ 		dbg("Cannot find unwind entry for 0x%lx; forced unwinding\n", info->ip);
+ 
++#ifdef CONFIG_KALLSYMS
++		/* Handle some frequent special cases.... */
++		{
++			char symname[KSYM_NAME_LEN+1];
++			char *modname;
++			unsigned long symsize, offset;
++
++			kallsyms_lookup(info->ip, &symsize, &offset,
++					&modname, symname);
++
++			dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname);
++
++			if (strcmp(symname, "_switch_to_ret") == 0) {
++				info->prev_sp = info->sp - CALLEE_SAVE_FRAME_SIZE;
++				info->prev_ip = *(unsigned long *)(info->prev_sp - RP_OFFSET);
++				dbg("_switch_to_ret @ %lx - setting "
++				    "prev_sp=%lx prev_ip=%lx\n", 
++				    info->ip, info->prev_sp, 
++				    info->prev_ip);
++				return;
++			} else if (strcmp(symname, "ret_from_kernel_thread") == 0 ||
++				   strcmp(symname, "syscall_exit") == 0) {
++				info->prev_ip = info->prev_sp = 0;
++				return;
++			}
++		}
++#endif
++
+ 		/* Since we are doing the unwinding blind, we don't know if
+ 		   we are adjusting the stack correctly or extracting the rp
+ 		   correctly. The rp is checked to see if it belongs to the
+@@ -185,30 +221,33 @@
+ 		   modules. */
+ 		sp = info->sp & ~63;
+ 		do {
+-			info->prev_sp = sp - 64;
+-
+-			/* FIXME: what happens if we unwind too far so that 
+-			   sp no longer falls in a mapped kernel page? */
+-#ifndef __LP64__
+-			info->prev_ip = *(unsigned long *)(info->prev_sp - 20);
+-#else
+-			info->prev_ip = *(unsigned long *)(info->prev_sp - 16);
+-#endif
++			unsigned long tmp;
+ 
++			info->prev_sp = sp - 64;
++			info->prev_ip = 0;
++			if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET))) 
++				break;
++			info->prev_ip = tmp;
+ 			sp = info->prev_sp;
+ 		} while (info->prev_ip < (unsigned long)_stext ||
+ 			 info->prev_ip > (unsigned long)_etext);
+ 
+-		dbg("analyzing func @ %lx with no unwind info, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
+-	} else {
++		info->rp = 0;
+ 
+-		dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, Save_RP = %d size = %u\n",
+-				e->region_start, e->region_end, e->Save_SP, e->Save_RP, e->Total_frame_size);
++		dbg("analyzing func @ %lx with no unwind info, setting "
++		    "prev_sp=%lx prev_ip=%lx\n", info->ip, 
++		    info->prev_sp, info->prev_ip);
++	} else {
++		dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, "
++		    "Save_RP = %d size = %u\n", e->region_start, 
++		    e->region_end, e->Save_SP, e->Save_RP, 
++		    e->Total_frame_size);
+ 
+ 		looking_for_rp = e->Save_RP;
+ 
+ 		for (npc = e->region_start; 
+-		     (frame_size < (e->Total_frame_size << 3) || looking_for_rp) && 
++		     (frame_size < (e->Total_frame_size << 3) || 
++		      looking_for_rp) && 
+ 		     npc < info->ip; 
+ 		     npc += 4) {
+ 
+@@ -219,22 +258,28 @@
+ 				/* ldo X(sp), sp, or stwm X,D(sp) */
+ 				frame_size += (insn & 0x1 ? -1 << 13 : 0) | 
+ 					((insn & 0x3fff) >> 1);
+-				dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
+-			} else if ((insn & 0xffe00008) == 0x7ec00008) {
++				dbg("analyzing func @ %lx, insn=%08x @ "
++				    "%lx, frame_size = %ld\n", info->ip,
++				    insn, npc, frame_size);
++			} else if ((insn & 0xffe00008) == 0x73c00008) {
+ 				/* std,ma X,D(sp) */
+ 				frame_size += (insn & 0x1 ? -1 << 13 : 0) | 
+ 					(((insn >> 4) & 0x3ff) << 3);
+-				dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
++				dbg("analyzing func @ %lx, insn=%08x @ "
++				    "%lx, frame_size = %ld\n", info->ip,
++				    insn, npc, frame_size);
+ 			} else if (insn == 0x6bc23fd9) { 
+ 				/* stw rp,-20(sp) */
+ 				rpoffset = 20;
+ 				looking_for_rp = 0;
+-				dbg("analyzing func @ %lx, insn=stw rp,-20(sp) @ %lx\n", info->ip, npc);
++				dbg("analyzing func @ %lx, insn=stw rp,"
++				    "-20(sp) @ %lx\n", info->ip, npc);
+ 			} else if (insn == 0x0fc212c1) {
+ 				/* std rp,-16(sr0,sp) */
+ 				rpoffset = 16;
+ 				looking_for_rp = 0;
+-				dbg("analyzing func @ %lx, insn=std rp,-16(sp) @ %lx\n", info->ip, npc);
++				dbg("analyzing func @ %lx, insn=std rp,"
++				    "-16(sp) @ %lx\n", info->ip, npc);
+ 			}
+ 		}
+ 
+@@ -244,7 +289,9 @@
+ 		info->prev_ip = info->rp;
+ 		info->rp = 0;
+ 
+-		dbg("analyzing func @ %lx, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
++		dbg("analyzing func @ %lx, setting prev_sp=%lx "
++		    "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, 
++		    info->prev_ip, npc);
+ 	}
  }
  
- static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address)
-@@ -84,9 +84,9 @@
+@@ -257,7 +304,8 @@
+ 	info->ip = ip;
+ 	info->rp = rp;
  
- 	addr += (nr >> SHIFT_PER_LONG);
- 	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_lock_irqsave(addr, flags);
- 	*addr ^= mask;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_unlock_irqrestore(addr, flags);
+-	dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", t ? (int)t->pid : 0, info->sp, info->ip);
++	dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", 
++	    t ? (int)t->pid : -1, info->sp, info->ip);
  }
  
- static __inline__ void __change_bit(int nr, volatile unsigned long * address)
-@@ -108,10 +108,10 @@
+ void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t)
+@@ -285,7 +333,9 @@
+ 	next_frame->prev_sp = 0;
+ 	next_frame->prev_ip = 0;
  
- 	addr += (nr >> SHIFT_PER_LONG);
- 	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_lock_irqsave(addr, flags);
- 	oldbit = (*addr & mask) ? 1 : 0;
- 	*addr |= mask;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_unlock_irqrestore(addr, flags);
+-	dbg("(%d) Continue unwind to sp=%08lx ip=%08lx\n", (int)next_frame->t->pid, next_frame->sp, next_frame->ip);
++	dbg("(%d) Continue unwind to sp=%08lx ip=%08lx\n", 
++	    next_frame->t ? (int)next_frame->t->pid : -1, 
++	    next_frame->sp, next_frame->ip);
  
- 	return oldbit;
+ 	return 0;
  }
-@@ -139,10 +139,10 @@
+Index: debian-kernel-hppa-2.6.8/arch/parisc/lib/bitops.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/lib/bitops.c	2004-08-14 01:36:16.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/lib/bitops.c	2005-02-01 01:38:33.000000000 -0500
+@@ -13,8 +13,8 @@
+ #include <asm/atomic.h>
  
- 	addr += (nr >> SHIFT_PER_LONG);
- 	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_lock_irqsave(addr, flags);
- 	oldbit = (*addr & mask) ? 1 : 0;
- 	*addr &= ~mask;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_unlock_irqrestore(addr, flags);
+ #ifdef CONFIG_SMP
+-atomic_lock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
+-	[0 ... (ATOMIC_HASH_SIZE-1)]  = (atomic_lock_t) { { 1, 1, 1, 1 } }
++spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
++	[0 ... (ATOMIC_HASH_SIZE-1)]  = SPIN_LOCK_UNLOCKED
+ };
+ #endif
  
- 	return oldbit;
+@@ -23,10 +23,10 @@
+ {
+ 	unsigned long temp, flags;
+ 
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_lock_irqsave(ptr, flags);
+ 	temp = *ptr;
+ 	*ptr = x;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_unlock_irqrestore(ptr, flags);
+ 	return temp;
  }
-@@ -170,10 +170,10 @@
+ #endif
+@@ -36,10 +36,10 @@
+ 	unsigned long flags;
+ 	long temp;
  
- 	addr += (nr >> SHIFT_PER_LONG);
- 	mask = 1L << CHOP_SHIFTCOUNT(nr);
--	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_lock_irqsave(addr, flags);
- 	oldbit = (*addr & mask) ? 1 : 0;
- 	*addr ^= mask;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
-+	_atomic_spin_unlock_irqrestore(addr, flags);
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_lock_irqsave(ptr, flags);
+ 	temp = (long) *ptr;	/* XXX - sign extension wanted? */
+ 	*ptr = x;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_unlock_irqrestore(ptr, flags);
+ 	return (unsigned long)temp;
+ }
  
- 	return oldbit;
+@@ -49,10 +49,10 @@
+ 	unsigned long flags;
+ 	long temp;
+ 
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_lock_irqsave(ptr, flags);
+ 	temp = (long) *ptr;	/* XXX - sign extension wanted? */
+ 	*ptr = x;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_unlock_irqrestore(ptr, flags);
+ 	return (unsigned long)temp;
  }
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/lasi700.c
+ 
+@@ -63,10 +63,10 @@
+ 	unsigned long flags;
+ 	unsigned long prev;
+ 
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_lock_irqsave(ptr, flags);
+ 	if ((prev = *ptr) == old)
+ 		*ptr = new;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_unlock_irqrestore(ptr, flags);
+ 	return prev;
+ }
+ #endif
+@@ -76,9 +76,9 @@
+ 	unsigned long flags;
+ 	unsigned int prev;
+ 
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_lock_irqsave(ptr, flags);
+ 	if ((prev = *ptr) == old)
+ 		*ptr = new;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
++	_atomic_spin_unlock_irqrestore(ptr, flags);
+ 	return (unsigned long)prev;
+ }
+Index: debian-kernel-hppa-2.6.8/arch/parisc/lib/debuglocks.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/lasi700.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/lasi700.c	2005-01-15 20:15:09.000000000 -0500
-@@ -110,7 +110,7 @@
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/lib/debuglocks.c	2004-08-14 01:37:25.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/lib/debuglocks.c	2005-02-01 01:38:33.000000000 -0500
+@@ -18,6 +18,11 @@
+  *    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
++ *
++ *    We use pdc_printf() throughout the file for all output messages, to avoid
++ *    losing messages because of disabled interrupts. Since we're using these
++ *    messages for debugging purposes, it makes sense not to send them to the
++ *    linux console.
+  */
  
- 	host->irq = dev->irq;
- 	if (request_irq(dev->irq, NCR_700_intr, SA_SHIRQ,
--				dev->dev.bus_id, host)) {
-+				"lasi700", host)) {
- 		printk(KERN_ERR "%s: irq problem, detaching\n",
- 		       dev->dev.bus_id);
- 		goto out_put_host;
-Index: debian-kernel-hppa-2.6.8/include/asm-ia64/compat_siginfo.h
+ 
+@@ -27,12 +32,14 @@
+ #include <linux/spinlock.h>
+ #include <asm/system.h>
+ #include <asm/hardirq.h>	/* in_interrupt() */
++#include <asm/pdc.h>
+ 
+ #undef INIT_STUCK
+ #define INIT_STUCK 1L << 30
+ 
+ #ifdef CONFIG_DEBUG_SPINLOCK
+ 
++
+ void _dbg_spin_lock(spinlock_t * lock, const char *base_file, int line_no)
+ {
+ 	volatile unsigned int *a;
+@@ -59,12 +66,14 @@
+ 	 * <tausq> __ldcw() returns 1 if we get the lock; otherwise we
+ 	 * 	spin until the value of the lock changes, or we time out.
+ 	 */
++	mb();
+ 	a = __ldcw_align(lock);
+ 	while (stuck && (__ldcw(a) == 0))
+ 		while ((*a == 0) && --stuck);
++	mb();
+ 
+ 	if (unlikely(stuck <= 0)) {
+-		printk(KERN_WARNING
++		pdc_printf(
+ 			"%s:%d: spin_lock(%s/%p) stuck in %s at %p(%d)"
+ 			" owned by %s:%d in %s at %p(%d)\n",
+ 			base_file, line_no, lock->module, lock,
+@@ -84,7 +93,7 @@
+ 	lock->bline = line_no;
+ 
+ 	if (unlikely(printed)) {
+-		printk(KERN_WARNING
++		pdc_printf(
+ 			"%s:%d: spin_lock grabbed in %s at %p(%d) %ld ticks\n",
+ 			base_file, line_no, current->comm, inline_pc,
+ 			cpu, jiffies - started);
+@@ -94,21 +103,28 @@
+ void _dbg_spin_unlock(spinlock_t * lock, const char *base_file, int line_no)
+ {
+ 	CHECK_LOCK(lock);
+-	volatile unsigned int *a = __ldcw_align(lock);
++	volatile unsigned int *a;
++	mb();
++	a = __ldcw_align(lock);
+ 	if (unlikely((*a != 0) && lock->babble)) {
+ 		lock->babble--;
+-		printk(KERN_WARNING
++		pdc_printf(
+ 			"%s:%d: spin_unlock(%s:%p) not locked\n",
+ 			base_file, line_no, lock->module, lock);
+ 	}
+ 	*a = 1;	
++	mb();
+ }
+ 
+ int _dbg_spin_trylock(spinlock_t * lock, const char *base_file, int line_no)
+ {
+ 	int ret;
+-	volatile unsigned int *a = __ldcw_align(lock);
+-	if ((ret = (__ldcw(a) != 0))) {
++	volatile unsigned int *a;
++	mb();
++	a = __ldcw_align(lock);
++	ret = (__ldcw(a) != 0);
++	mb();
++	if (ret) {
+ 		lock->oncpu = smp_processor_id();
+ 		lock->previous = __builtin_return_address(0);
+ 		lock->task = current;
+@@ -150,7 +166,7 @@
+ 	int cpu = smp_processor_id();
+ 	
+ 	if(unlikely(in_interrupt())) {	/* acquiring write lock in interrupt context, bad idea */
+-		printk(KERN_WARNING "write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline);
++		pdc_printf("write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline);
+ 		BUG();
+ 	}
+ 
+@@ -167,7 +183,7 @@
+ 		
+ 		stuck--;
+ 		if ((unlikely(stuck <= 0)) && (rw->counter < 0)) {
+-			printk(KERN_WARNING
++			pdc_printf(
+ 				"%s:%d: write_lock stuck on writer"
+ 				" in %s at %p(%d) %ld ticks\n",
+ 				bfile, bline, current->comm, inline_pc,
+@@ -176,7 +192,7 @@
+ 			printed = 1;
+ 		}
+ 		else if (unlikely(stuck <= 0)) {
+-			printk(KERN_WARNING
++			pdc_printf(
+ 				"%s:%d: write_lock stuck on reader"
+ 				" in %s at %p(%d) %ld ticks\n",
+ 				bfile, bline, current->comm, inline_pc,
+@@ -194,7 +210,7 @@
+ 	rw->counter = -1; /* remember we are locked */
+ 
+ 	if (unlikely(printed)) {
+-		printk(KERN_WARNING
++		pdc_printf(
+ 			"%s:%d: write_lock grabbed in %s at %p(%d) %ld ticks\n",
+ 			bfile, bline, current->comm, inline_pc,
+ 			cpu, jiffies - started);
+@@ -215,7 +231,7 @@
+ 
+ 	rw->counter++;
+ #if 0
+-	printk(KERN_WARNING
++	pdc_printf(
+ 		"%s:%d: read_lock grabbed in %s at %p(%d) %ld ticks\n",
+ 		bfile, bline, current->comm, inline_pc,
+ 		cpu, jiffies - started);
+Index: debian-kernel-hppa-2.6.8/arch/parisc/mm/init.c
 ===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/include/asm-ia64/compat_siginfo.h	2005-01-15 20:15:09.000000000 -0500
-@@ -0,0 +1,2 @@
-+/* We use the generic compat struct */
-+#include <asm-generic/compat_siginfo.h>
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw1.h
+--- debian-kernel-hppa-2.6.8.orig/arch/parisc/mm/init.c	2004-08-14 01:36:58.000000000 -0400
++++ debian-kernel-hppa-2.6.8/arch/parisc/mm/init.c	2005-02-01 01:38:33.000000000 -0500
+@@ -750,7 +750,7 @@
+ #if PTRS_PER_PMD == 1
+ 	pmd = (pmd_t *)__pa(pg_dir);
+ #else
+-	pmd = (pmd_t *) (PAGE_MASK & pgd_val(*pg_dir));
++	pmd = (pmd_t *) pgd_address(*pg_dir);
+ 
+ 	/*
+ 	 * pmd is physical at this point
+@@ -761,7 +761,7 @@
+ 		pmd = (pmd_t *) __pa(pmd);
+ 	}
+ 
+-	pgd_val(*pg_dir) = _PAGE_TABLE | (unsigned long) pmd;
++	__pgd_val_set(*pg_dir, PxD_FLAG_PRESENT | PxD_FLAG_VALID | (unsigned long) pmd);
+ #endif
+ 	/* now change pmd to kernel virtual addresses */
+ 
+@@ -771,11 +771,11 @@
+ 	 * pg_table is physical at this point
+ 	 */
+ 
+-	pg_table = (pte_t *) (PAGE_MASK & pmd_val(*pmd));
++	pg_table = (pte_t *) pmd_address(*pmd);
+ 	if (!pg_table)
+ 		pg_table = (pte_t *) __pa(get_zeroed_page(GFP_KERNEL));
+ 
+-	pmd_val(*pmd) = _PAGE_TABLE | (unsigned long) pg_table;
++	__pmd_val_set(*pmd, PxD_FLAG_PRESENT | PxD_FLAG_VALID | (unsigned long) pg_table);
+ 
+ 	/* now change pg_table to kernel virtual addresses */
+ 
+Index: debian-kernel-hppa-2.6.8/drivers/char/Kconfig
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw1.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw1.h	2005-01-15 20:15:09.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
-  */
+--- debian-kernel-hppa-2.6.8.orig/drivers/char/Kconfig	2005-02-01 01:36:40.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/char/Kconfig	2005-02-01 01:38:32.000000000 -0500
+@@ -689,7 +689,7 @@
  
- /*
+ config HW_RANDOM
+ 	tristate "Intel/AMD/VIA HW Random Number Generator support"
+-	depends on (X86 || IA64) && PCI
++	depends on X86 && PCI
+ 	---help---
+ 	  This driver provides kernel-side support for the Random Number
+ 	  Generator hardware found on Intel i8xx-based motherboards,
 Index: debian-kernel-hppa-2.6.8/drivers/ide/pci/ns87415.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/ide/pci/ns87415.c	2005-01-15 20:14:01.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/ide/pci/ns87415.c	2005-01-15 20:15:09.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/drivers/ide/pci/ns87415.c	2005-02-01 01:36:40.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/ide/pci/ns87415.c	2005-02-01 01:38:32.000000000 -0500
 @@ -24,6 +24,9 @@
  #include <linux/init.h>
  
@@ -1451,35 +4012,48 @@
  
  static unsigned int ns87415_count = 0, ns87415_control[MAX_HWIFS] = { 0 };
  
-Index: debian-kernel-hppa-2.6.8/include/asm-parisc/posix_types.h
+Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/Kconfig
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/posix_types.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/posix_types.h	2005-01-15 20:15:09.000000000 -0500
-@@ -15,7 +15,7 @@
- typedef unsigned int		__kernel_uid_t;
- typedef unsigned int		__kernel_gid_t;
- typedef int			__kernel_suseconds_t;
--typedef int			__kernel_clock_t;
-+typedef long			__kernel_clock_t;
- typedef int			__kernel_timer_t;
- typedef int			__kernel_clockid_t;
- typedef int			__kernel_daddr_t;
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/Makefile
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/Makefile	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/Makefile	2005-01-15 20:15:10.000000000 -0500
-@@ -3,7 +3,6 @@
- #
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/Kconfig	2004-08-14 01:38:04.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/Kconfig	2005-02-01 01:38:33.000000000 -0500
+@@ -96,3 +96,33 @@
  
- head-y			:= head.o
--head-$(CONFIG_PARISC64)	:= head64.o
- extra-y			:= init_task.o $(head-y) vmlinux.lds.s
- 
- AFLAGS_entry.o	:= -traditional
+ 	  To compile this driver as a module, choose M here: the
+ 	  module will be called amikbd.
++
++config KEYBOARD_HIL_OLD
++	tristate "HP HIL keyboard support (simple driver)"
++	depends on PARISC && INPUT && INPUT_KEYBOARD && !HIL_MLC
++	default y
++	help
++	  The "Human Interface Loop" is a older, 8-channel USB-like
++	  controller used in several Hewlett Packard models. This driver
++	  was adapted from the one written for m68k/hp300, and implements
++	  support for a keyboard attached to the HIL port, but not for
++	  any other types of HIL input devices like mice or tablets.
++	  However, it has been thoroughly tested and is stable.
++
++	  If you want full HIL support including support for multiple
++	  keyboards, mices and tablets, you have to enable the
++	  "HP System Device Controller i8042 Support" in the input/serio
++	  submenu.
++
++config KEYBOARD_HIL
++	tristate "HP HIL keyboard support"
++	depends on PARISC && INPUT && INPUT_KEYBOARD
++	default y
++	select HP_SDC
++ 	select HIL_MLC
++	help
++	  The "Human Interface Loop" is a older, 8-channel USB-like
++	  controller used in several Hewlett Packard models.
++	  This driver implements support for HIL-keyboards attached
++	  to your machine, so normally you should say Y here.
++
 Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/Makefile
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/Makefile	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/Makefile	2005-01-15 20:15:10.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/Makefile	2004-08-14 01:38:11.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/Makefile	2005-02-01 01:38:33.000000000 -0500
 @@ -2,8 +2,6 @@
  # Makefile for the input core drivers.
  #
@@ -1495,80 +4069,10 @@
  obj-$(CONFIG_KEYBOARD_98KBD)		+= 98kbd.o
 +obj-$(CONFIG_KEYBOARD_HIL)		+= hil_kbd.o
 +obj-$(CONFIG_KEYBOARD_HIL_OLD)		+= hilkbd.o
-Index: debian-kernel-hppa-2.6.8/include/linux/serial_core.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/linux/serial_core.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/linux/serial_core.h	2005-01-15 20:15:10.000000000 -0500
-@@ -89,6 +89,8 @@
- /* MPC52xx type numbers */
- #define PORT_MPC52xx	59
- 
-+#define SERIAL_IRQ_NONE -1
-+
- #ifdef __KERNEL__
- 
- #include <linux/config.h>
-Index: debian-kernel-hppa-2.6.8/include/asm-generic/compat_signal.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/include/asm-generic/compat_signal.h	2005-01-15 20:15:10.000000000 -0500
-@@ -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: debian-kernel-hppa-2.6.8/drivers/serial/serial_core.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/serial/serial_core.c	2005-01-15 20:14:30.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/serial/serial_core.c	2005-01-15 20:15:10.000000000 -0500
-@@ -231,7 +231,8 @@
- 	/*
- 	 * Ensure that the IRQ handler isn't running on another CPU.
- 	 */
--	synchronize_irq(port->irq);
-+	if (port->irq != SERIAL_IRQ_NONE)
-+		synchronize_irq(port->irq);
- 
- 	/*
- 	 * Free the transmit buffer page.
-@@ -1972,7 +1973,11 @@
- 		printk("MMIO 0x%lx", port->mapbase);
- 		break;
- 	}
--	printk(" (irq = %d) is a %s\n", port->irq, uart_type(port));
-+	if (port->irq == SERIAL_IRQ_NONE) {
-+		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: debian-kernel-hppa-2.6.8/drivers/input/keyboard/atkbd.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/atkbd.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/atkbd.c	2005-01-15 20:15:10.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/atkbd.c	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/atkbd.c	2005-02-01 01:38:33.000000000 -0500
 @@ -64,12 +64,13 @@
   * are loadable via an userland utility.
   */
@@ -1633,221 +4137,13 @@
  	if (atkbd_reset)
  		if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
  			printk(KERN_WARNING "atkbd.c: keyboard reset failed on %s\n", atkbd->serio->phys);
-Index: debian-kernel-hppa-2.6.8/drivers/pcmcia/rsrc_mgr.c
+Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/hil_kbd.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/pcmcia/rsrc_mgr.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/pcmcia/rsrc_mgr.c	2005-01-15 20:15:10.000000000 -0500
-@@ -59,10 +59,12 @@
- 
- #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
- 
--INT_MODULE_PARM(probe_mem,	1);		/* memory probe? */
- #ifdef CONFIG_PCMCIA_PROBE
-+INT_MODULE_PARM(probe_mem,	1);		/* memory probe? */
- INT_MODULE_PARM(probe_io,	1);		/* IO port probe? */
- INT_MODULE_PARM(mem_limit,	0x10000);
-+#else
-+INT_MODULE_PARM(probe_mem,	0);		/* memory probe? */
- #endif
- 
- /*======================================================================
-Index: debian-kernel-hppa-2.6.8/fs/smbfs/inode.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/fs/smbfs/inode.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/fs/smbfs/inode.c	2005-01-15 20:15:10.000000000 -0500
-@@ -558,6 +558,7 @@
- 
- 	mnt->ttl = SMB_TTL_DEFAULT;
- 	if (ver == SMB_MOUNT_OLDVERSION) {
-+#ifdef CONFIG_UID16
- 		mnt->version = oldmnt->version;
- 
- 		SET_UID(mnt->uid, oldmnt->uid);
-@@ -567,6 +568,9 @@
- 		mnt->dir_mode = (oldmnt->dir_mode & S_IRWXUGO) | S_IFDIR;
- 
- 		mnt->flags = (oldmnt->file_mode >> 9);
-+#else
-+		goto out_bad_option;
-+#endif
- 	} else {
- 		if (parse_options(mnt, raw_data))
- 			goto out_bad_option;
-Index: debian-kernel-hppa-2.6.8/drivers/video/console/Kconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/video/console/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/video/console/Kconfig	2005-01-15 20:15:10.000000000 -0500
-@@ -6,7 +6,7 @@
- 
- config VGA_CONSOLE
- 	bool "VGA text console" if EMBEDDED || !X86
--	depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K
-+	depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC
- 	default y
- 	help
- 	  Saying Y here will allow you to use Linux in text mode through a
-@@ -67,7 +67,7 @@
- #  bool 'IODC console' CONFIG_IODC_CONSOLE
- config STI_CONSOLE
-         tristate "STI text console" 
--        depends on PARISC
-+        depends on PARISC && FRAMEBUFFER_CONSOLE
-         default y
-         help
-           The STI console is the builtin display/keyboard on HP-PARISC
-Index: debian-kernel-hppa-2.6.8/include/asm-parisc/tlbflush.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/tlbflush.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/tlbflush.h	2005-01-15 20:15:10.000000000 -0500
-@@ -51,9 +51,12 @@
- {
- 	/* For one page, it's not worth testing the split_tlb variable */
- 
-+	mb();
- 	mtsp(vma->vm_mm->context,1);
-+	purge_tlb_start();
- 	pdtlb(addr);
- 	pitlb(addr);
-+	purge_tlb_end();
- }
- 
- static inline void flush_tlb_range(struct vm_area_struct *vma,
-@@ -61,6 +64,7 @@
- {
- 	unsigned long npages;
- 
-+	
- 	npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
- 	if (npages >= 512)  /* XXX arbitrary, should be tuned */
- 		flush_tlb_all();
-@@ -68,16 +72,20 @@
- 
- 		mtsp(vma->vm_mm->context,1);
- 		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();
- 		}
- 	}
- }
-Index: debian-kernel-hppa-2.6.8/Documentation/parisc/todo
-===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/Documentation/parisc/todo	2005-01-15 20:15:10.000000000 -0500
-@@ -0,0 +1,83 @@
-+Status 2004-08-16 :
-+-------------------
-+ - Merged to 2.6.8.1, boots on 712, 715, C3000, and A500
-+   (AFAIK, probably every machine we used to support boots on this kernel.)
-+ - Changes to the 2.4 branch are pretty much non-existant,
-+   Matthew does a good job of merging from upstream though.
-+ - SMP compiles, and seems to work on certain boxes.
-+ - No preemptible support
-+
-+Todo:
-+-----
-+
-+ - 2004-08-16 (Carlos)
-+   Review the gettimeofday implementation, possibly use a
-+   light-weight-syscall and rely on cr16 and cpu speed for
-+   more accurate timing?
-+ - 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
-+ - syscall signal return path needs work, we don't loop on signal
-+   delivery like other archs
-+ - parisc is the only arch that defines __kernel_clock_t as int instead
-+   of long, find out if we can use long (check compat_signals.c)
-+
-+ - REVIEW ALL THE TODO ENTRIES BELOW!
-+
-+ - the fix for do_fork needs checking
-+ - our PDC early debug console hacks need to be cleaned up somehow
-+ - ad1889 driver: only works with .wav;  Convert to ALSA (ggg, tausq, tbone)
-+ - 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.5)
-+ - write floppy driver for lasi
-+ - write floppy driver for suckyio
-+ - spifi driver (rbrad)
-+ - write optimized versions of lcopy_{to,from}_user. Can we port the
-+   hpux versions?
-+ - NPTL kernel support (CLONE_*TID flags need to be correctly handled by 
-+   sys_clone() and friends)
-+ - fix ALSA harmony driver to reflect changes in ALSA architecture.
-+
-+
-+ Started and in progress:
-+ ------------------------
-+ - 2004-08-16 (Carlos)
-+   64-bit binutils needs to be fixed to get multiple stub
-+   section support.
-+
-+ - 2004-08-16 (Carlos)
-+   Working on light-weight-syscall to implement atomic
-+   compare and swap primitive.
-+
-+ - IRQ code (use arch-indep scheme & cpu-affinity support) (jejb, ggg, t-bone)
-+
-+ - REVIEW THE ENTRIES BELOW!
-+
-+ - Some options still need Kconfig help entries (see below!)
-+ - Look at Config.help too. (tbone, HIL -> helge?)
-+ - port hil_kbd.c to new input layer
-+ - port hil_ptr.c to new input layer
-+
-+ - 64-bit userspace (Leandro)
-+
-+
-+ 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)
-+
-Index: debian-kernel-hppa-2.6.8/include/linux/input.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/linux/input.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/linux/input.h	2005-01-15 20:15:10.000000000 -0500
-@@ -586,6 +586,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: debian-kernel-hppa-2.6.8/drivers/input/mouse/hil_ptr.c
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/drivers/input/mouse/hil_ptr.c	2005-01-15 20:15:10.000000000 -0500
-@@ -0,0 +1,409 @@
++++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/hil_kbd.c	2005-02-01 01:38:33.000000000 -0500
+@@ -0,0 +1,372 @@
 +/*
-+ * Generic linux-input device driver for axis-bearing devices
++ * Generic linux-input device driver for keyboard devices
 + *
 + * Copyright (c) 2001 Brian S. Julin
 + * All rights reserved.
@@ -1888,52 +4184,58 @@
 +#include <linux/slab.h>
 +#include <linux/pci_ids.h>
 +
-+#define PREFIX "HIL PTR: "
-+#define HIL_GENERIC_NAME "HIL pointer device"
++#define PREFIX "HIL KEYB: "
++#define HIL_GENERIC_NAME "HIL keyboard"
 +
 +MODULE_AUTHOR("Brian S. Julin <bri at calyx.com>");
 +MODULE_DESCRIPTION(HIL_GENERIC_NAME " driver");
 +MODULE_LICENSE("Dual BSD/GPL");
 +
++#define HIL_KBD_MAX_LENGTH 16
 +
-+#define TABLET_SIMULATES_MOUSE	/* allow tablet to be used as mouse */
-+#undef  TABLET_AUTOADJUST	/* auto-adjust valid tablet ranges */
++#define HIL_KBD_SET1_UPBIT 0x01
++#define HIL_KBD_SET1_SHIFT 1
++static unsigned int hil_kbd_set1[HIL_KEYCODES_SET1_TBLSIZE] = 
++	{ HIL_KEYCODES_SET1 };
 +
++#define HIL_KBD_SET2_UPBIT 0x01
++#define HIL_KBD_SET2_SHIFT 1
++/* Set2 is user defined */
 +
-+#define HIL_PTR_MAX_LENGTH 16
++#define HIL_KBD_SET3_UPBIT 0x80
++#define HIL_KBD_SET3_SHIFT 0
++static unsigned int hil_kbd_set3[HIL_KEYCODES_SET3_TBLSIZE] =
++	{ HIL_KEYCODES_SET3 };
 +
-+struct hil_ptr {
++static char hil_language[][16] = { HIL_LOCALE_MAP };
++
++struct hil_kbd {
 +	struct input_dev dev;
 +	struct serio *serio;
 +
 +	/* Input buffer and index for packets from HIL bus. */
-+	hil_packet data[HIL_PTR_MAX_LENGTH];
++	hil_packet data[HIL_KBD_MAX_LENGTH];
 +	int idx4; /* four counts per packet */
 +
 +	/* Raw device info records from HIL bus, see hil.h for fields. */
-+	char	idd[HIL_PTR_MAX_LENGTH];	/* DID byte and IDD record */
-+	char	rsc[HIL_PTR_MAX_LENGTH];	/* RSC record */
-+	char	exd[HIL_PTR_MAX_LENGTH];	/* EXD record */
-+	char	rnm[HIL_PTR_MAX_LENGTH + 1];	/* RNM record + NULL term. */
++	char	idd[HIL_KBD_MAX_LENGTH];	/* DID byte and IDD record */
++	char	rsc[HIL_KBD_MAX_LENGTH];	/* RSC record */
++	char	exd[HIL_KBD_MAX_LENGTH];	/* EXD record */
++	char	rnm[HIL_KBD_MAX_LENGTH + 1];	/* RNM record + NULL term. */
 +
-+	/* Extra device details not contained in struct input_dev. */
-+	unsigned int nbtn, naxes;
-+	unsigned int btnmap[7];
-+
 +	/* Something to sleep around with. */
 +	struct semaphore sem;
 +};
 +
 +/* Process a complete packet after transfer from the HIL */
-+static void hil_ptr_process_record(struct hil_ptr *ptr)
++static void hil_kbd_process_record(struct hil_kbd *kbd)
 +{
-+	struct input_dev *dev = &ptr->dev;
-+	hil_packet *data = ptr->data;
++	struct input_dev *dev = &kbd->dev;
++	hil_packet *data = kbd->data;
 +	hil_packet p;
-+	int idx, i, cnt, laxis;
-+	int ax16, absdev;
++	int idx, i, cnt;
 +
-+	idx = ptr->idx4/4;
++	idx = kbd->idx4/4;
 +	p = data[idx - 1];
 +
 +	if ((p & ~HIL_CMDCT_POL) == 
@@ -1945,27 +4247,27 @@
 +	switch (p & HIL_PKT_DATA_MASK) {
 +	case HIL_CMD_IDD:
 +		for (i = 0; i < idx; i++)
-+			ptr->idd[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_PTR_MAX_LENGTH; i++)
-+			ptr->idd[i] = 0;
++			kbd->idd[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_KBD_MAX_LENGTH; i++)
++			kbd->idd[i] = 0;
 +		break;
 +	case HIL_CMD_RSC:
 +		for (i = 0; i < idx; i++)
-+			ptr->rsc[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_PTR_MAX_LENGTH; i++)
-+			ptr->rsc[i] = 0;
++			kbd->rsc[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_KBD_MAX_LENGTH; i++)
++			kbd->rsc[i] = 0;
 +		break;
 +	case HIL_CMD_EXD:
 +		for (i = 0; i < idx; i++)
-+			ptr->exd[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_PTR_MAX_LENGTH; i++)
-+			ptr->exd[i] = 0;
++			kbd->exd[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_KBD_MAX_LENGTH; i++)
++			kbd->exd[i] = 0;
 +		break;
 +	case HIL_CMD_RNM:
 +		for (i = 0; i < idx; i++)
-+			ptr->rnm[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_PTR_MAX_LENGTH + 1; i++)
-+			ptr->rnm[i] = '\0';
++			kbd->rnm[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_KBD_MAX_LENGTH + 1; i++)
++			kbd->rnm[i] = '\0';
 +		break;
 +	default:
 +		/* These occur when device isn't present */
@@ -1977,2029 +4279,245 @@
 +	goto out;
 +
 + report:
-+	if ((p & HIL_CMDCT_POL) != idx - 1) {
-+		printk(KERN_WARNING PREFIX "Malformed poll packet %x (idx = %i)\n", p, idx);
-+		goto out;
-+	}
-+
-+	i = (ptr->data[0] & HIL_POL_AXIS_ALT) ? 3 : 0;
-+	laxis = ptr->data[0] & HIL_POL_NUM_AXES_MASK;
-+	laxis += i;
-+
-+	ax16 = ptr->idd[1] & HIL_IDD_HEADER_16BIT; /* 8 or 16bit resolution */
-+	absdev = ptr->idd[1] & HIL_IDD_HEADER_ABS; 
-+
-+	for (cnt = 1; i < laxis; i++) {
-+		unsigned int lo,hi,val;
-+		lo = ptr->data[cnt++] & HIL_PKT_DATA_MASK;
-+		hi = ax16 ? (ptr->data[cnt++] & HIL_PKT_DATA_MASK) : 0;
-+		if (absdev) {
-+			val = lo + (hi<<8);
-+#ifdef TABLET_AUTOADJUST
-+			if (val < ptr->dev.absmin[ABS_X + i])
-+				ptr->dev.absmin[ABS_X + i] = val;
-+			if (val > ptr->dev.absmax[ABS_X + i])
-+				ptr->dev.absmax[ABS_X + i] = val;
-+#endif
-+			if (i%3) val = ptr->dev.absmax[ABS_X + i] - val;
-+			input_report_abs(dev, ABS_X + i, val);
-+		} else {
-+			val = (int) (((int8_t)lo) | ((int8_t)hi<<8));
-+			if (i%3) val *= -1;
-+			input_report_rel(dev, REL_X + i, val);
++	cnt = 1;
++	switch (kbd->data[0] & HIL_POL_CHARTYPE_MASK) {
++	case HIL_POL_CHARTYPE_NONE:
++		break;
++	case HIL_POL_CHARTYPE_ASCII:
++		while (cnt < idx - 1)
++			input_report_key(dev, kbd->data[cnt++] & 0x7f, 1);
++		break;
++	case HIL_POL_CHARTYPE_RSVD1:
++	case HIL_POL_CHARTYPE_RSVD2:
++	case HIL_POL_CHARTYPE_BINARY:
++		while (cnt < idx - 1)
++			input_report_key(dev, kbd->data[cnt++], 1);
++		break;
++	case HIL_POL_CHARTYPE_SET1:
++		while (cnt < idx - 1) {
++			unsigned int key;
++			int up;
++			key = kbd->data[cnt++];
++			up = key & HIL_KBD_SET1_UPBIT;
++			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
++			key = hil_kbd_set1[key >> HIL_KBD_SET1_SHIFT];
++			if (key != KEY_RESERVED)
++				input_report_key(dev, key, !up);
 +		}
-+	}
-+
-+	while (cnt < idx - 1) {
-+		unsigned int btn;
-+		int up;
-+		btn = ptr->data[cnt++];
-+		up = btn & 1;
-+		btn &= 0xfe;
-+		if (btn == 0x8e) {
-+			continue; /* TODO: proximity == touch? */
++		break;
++	case HIL_POL_CHARTYPE_SET2:
++		while (cnt < idx - 1) {
++			unsigned int key;
++			int up;
++			key = kbd->data[cnt++];
++			up = key & HIL_KBD_SET2_UPBIT;
++			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
++			key = key >> HIL_KBD_SET2_SHIFT;
++			if (key != KEY_RESERVED)
++				input_report_key(dev, key, !up);
 +		}
-+		else if ((btn > 0x8c) || (btn < 0x80)) continue;
-+		btn = (btn - 0x80) >> 1;
-+		btn = ptr->btnmap[btn];
-+		input_report_key(dev, btn, !up);
++		break;
++	case HIL_POL_CHARTYPE_SET3:
++		while (cnt < idx - 1) {
++			unsigned int key;
++			int up;
++			key = kbd->data[cnt++];
++			up = key & HIL_KBD_SET3_UPBIT;
++			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
++			key = hil_kbd_set3[key >> HIL_KBD_SET3_SHIFT];
++			if (key != KEY_RESERVED)
++				input_report_key(dev, key, !up);
++		}
++		break;
 +	}
-+	input_sync(dev);
 + out:
-+	ptr->idx4 = 0;
-+	up(&ptr->sem);
++	kbd->idx4 = 0;
++	up(&kbd->sem);
 +}
 +
-+static void hil_ptr_process_err(struct hil_ptr *ptr) {
++static void hil_kbd_process_err(struct hil_kbd *kbd) {
 +	printk(KERN_WARNING PREFIX "errored HIL packet\n");
-+	ptr->idx4 = 0;
-+	up(&ptr->sem);
-+	return;
++	kbd->idx4 = 0;
++	up(&kbd->sem);
 +}
 +
-+static irqreturn_t hil_ptr_interrupt(struct serio *serio, 
-+        unsigned char data, unsigned int flags, struct pt_regs *regs)
++static irqreturn_t hil_kbd_interrupt(struct serio *serio, 
++	      unsigned char data, unsigned int flags, struct pt_regs *regs)
 +{
-+	struct hil_ptr *ptr;
++	struct hil_kbd *kbd;
 +	hil_packet packet;
 +	int idx;
 +
-+	ptr = (struct hil_ptr *)serio->private;
-+	if (ptr == NULL) {
++	kbd = (struct hil_kbd *)serio->private;
++	if (kbd == NULL) {
 +		BUG();
 +		return IRQ_HANDLED;
 +	}
 +
-+	if (ptr->idx4 >= (HIL_PTR_MAX_LENGTH * sizeof(hil_packet))) {
-+		hil_ptr_process_err(ptr);
++	if (kbd->idx4 >= (HIL_KBD_MAX_LENGTH * sizeof(hil_packet))) {
++		hil_kbd_process_err(kbd);
 +		return IRQ_HANDLED;
 +	}
-+	idx = ptr->idx4/4;
-+	if (!(ptr->idx4 % 4)) ptr->data[idx] = 0;
-+	packet = ptr->data[idx];
-+	packet |= ((hil_packet)data) << ((3 - (ptr->idx4 % 4)) * 8);
-+	ptr->data[idx] = packet;
++	idx = kbd->idx4/4;
++	if (!(kbd->idx4 % 4)) kbd->data[idx] = 0;
++	packet = kbd->data[idx];
++	packet |= ((hil_packet)data) << ((3 - (kbd->idx4 % 4)) * 8);
++	kbd->data[idx] = packet;
 +
 +	/* Records of N 4-byte hil_packets must terminate with a command. */
-+	if ((++(ptr->idx4)) % 4) return IRQ_HANDLED;
++	if ((++(kbd->idx4)) % 4) return IRQ_HANDLED;
 +	if ((packet & 0xffff0000) != HIL_ERR_INT) {
-+		hil_ptr_process_err(ptr);
++		hil_kbd_process_err(kbd);
 +		return IRQ_HANDLED;
 +	}
-+	if (packet & HIL_PKT_CMD) 
-+		hil_ptr_process_record(ptr);
++	if (packet & HIL_PKT_CMD) hil_kbd_process_record(kbd);
 +	return IRQ_HANDLED;
 +}
 +
-+static void hil_ptr_disconnect(struct serio *serio)
++static void hil_kbd_disconnect(struct serio *serio)
 +{
-+	struct hil_ptr *ptr;
++	struct hil_kbd *kbd;
 +
-+	ptr = (struct hil_ptr *)serio->private;
-+	if (ptr == NULL) {
++	kbd = (struct hil_kbd *)serio->private;
++	if (kbd == NULL) {
 +		BUG();
 +		return;
 +	}
 +
-+	input_unregister_device(&ptr->dev);
++	input_unregister_device(&kbd->dev);
 +	serio_close(serio);
-+	kfree(ptr);
++	kfree(kbd);
 +}
 +
-+static void hil_ptr_connect(struct serio *serio, struct serio_dev *dev)
++static void hil_kbd_connect(struct serio *serio, struct serio_dev *dev)
 +{
-+	struct hil_ptr	*ptr;
-+	char		*txt;
-+	unsigned int	i, naxsets, btntype;
++	struct hil_kbd	*kbd;
 +	uint8_t		did, *idd;
-+
++	int		i;
++	
 +	if (serio->type != (SERIO_HIL_MLC | SERIO_HIL)) return;
 +
-+	if (!(ptr = kmalloc(sizeof(struct hil_ptr), GFP_KERNEL))) return;
-+	memset(ptr, 0, sizeof(struct hil_ptr));
++	if (!(kbd = kmalloc(sizeof(struct hil_kbd), GFP_KERNEL))) return;
++	memset(kbd, 0, sizeof(struct hil_kbd));
 +
 +	if (serio_open(serio, dev)) goto bail0;
 +
-+	serio->private = ptr;
-+	ptr->serio = serio;
-+	ptr->dev.private = ptr;
++	serio->private = kbd;
++	kbd->serio = serio;
++	kbd->dev.private = kbd;
 +
-+	init_MUTEX_LOCKED(&(ptr->sem));
++	init_MUTEX_LOCKED(&(kbd->sem));
 +
 +	/* Get device info.  MLC driver supplies devid/status/etc. */
 +	serio->write(serio, 0);
 +	serio->write(serio, 0);
 +	serio->write(serio, HIL_PKT_CMD >> 8);
 +	serio->write(serio, HIL_CMD_IDD);
-+	down(&(ptr->sem));
++	down(&(kbd->sem));
 +
 +	serio->write(serio, 0);
 +	serio->write(serio, 0);
 +	serio->write(serio, HIL_PKT_CMD >> 8);
 +	serio->write(serio, HIL_CMD_RSC);
-+	down(&(ptr->sem));
++	down(&(kbd->sem));
 +
 +	serio->write(serio, 0);
 +	serio->write(serio, 0);
 +	serio->write(serio, HIL_PKT_CMD >> 8);
 +	serio->write(serio, HIL_CMD_RNM);
-+	down(&(ptr->sem));
++	down(&(kbd->sem));
 +
 +	serio->write(serio, 0);
 +	serio->write(serio, 0);
 +	serio->write(serio, HIL_PKT_CMD >> 8);
 +	serio->write(serio, HIL_CMD_EXD);
-+	down(&(ptr->sem));
++	down(&(kbd->sem));
 +
-+	up(&(ptr->sem));
++	up(&(kbd->sem));
 +
-+	init_input_dev(&ptr->dev);
-+	did = ptr->idd[0];
-+	idd = ptr->idd + 1;
-+	txt = "unknown";
-+	if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) {
-+		ptr->dev.evbit[0] = BIT(EV_REL);
-+		txt = "relative";
++	did = kbd->idd[0];
++	idd = kbd->idd + 1;
++	switch (did & HIL_IDD_DID_TYPE_MASK) {
++	case HIL_IDD_DID_TYPE_KB_INTEGRAL:
++	case HIL_IDD_DID_TYPE_KB_ITF:
++	case HIL_IDD_DID_TYPE_KB_RSVD:
++	case HIL_IDD_DID_TYPE_CHAR:
++		printk(KERN_INFO PREFIX "HIL keyboard found (did = 0x%02x, lang = %s)\n",
++			did, hil_language[did & HIL_IDD_DID_TYPE_KB_LANG_MASK]);
++		break;
++	default:
++		goto bail1;
 +	}
 +
-+	if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) {
-+		ptr->dev.evbit[0] = BIT(EV_ABS);
-+		txt = "absolute";
-+	}
-+	if (!ptr->dev.evbit[0]) {
++	if(HIL_IDD_NUM_BUTTONS(idd) || HIL_IDD_NUM_AXES_PER_SET(*idd)) {
++		printk(KERN_INFO PREFIX "keyboards only, no combo devices supported.\n");
 +		goto bail1;
 +	}
 +
-+	ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd);
-+	if (ptr->nbtn) ptr->dev.evbit[0] |= BIT(EV_KEY);
 +
-+	naxsets = HIL_IDD_NUM_AXSETS(*idd);
-+	ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd);
++	kbd->dev.evbit[0]	= BIT(EV_KEY) | BIT(EV_REP);
++	kbd->dev.ledbit[0]	= BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
++	kbd->dev.keycodemax	= HIL_KEYCODES_SET1_TBLSIZE;
++	kbd->dev.keycodesize	= sizeof(hil_kbd_set1[0]);
++	kbd->dev.keycode	= hil_kbd_set1;
++	kbd->dev.name		= strlen(kbd->rnm) ? kbd->rnm : HIL_GENERIC_NAME;
++	kbd->dev.phys		= "hpkbd/input0";	/* XXX */
++	kbd->dev.rep[REP_DELAY] = HZ/4; /* auto-repeat values */
++	kbd->dev.rep[REP_PERIOD]= HZ/8;
 +
-+	printk(KERN_INFO PREFIX "HIL pointer device found (did: 0x%02x, axis: %s)\n",
-+			did, txt);
-+	printk(KERN_INFO PREFIX "HIL pointer has %i buttons and %i sets of %i axes\n",
-+			ptr->nbtn, naxsets, ptr->naxes);
-+	
-+	btntype = BTN_MISC;
-+	if ((did & HIL_IDD_DID_ABS_TABLET_MASK) == HIL_IDD_DID_ABS_TABLET)
-+#ifdef TABLET_SIMULATES_MOUSE
-+		btntype = BTN_TOUCH;
-+#else
-+		btntype = BTN_DIGI;
-+#endif
-+	if ((did & HIL_IDD_DID_ABS_TSCREEN_MASK) == HIL_IDD_DID_ABS_TSCREEN)
-+		btntype = BTN_TOUCH;
-+		
-+	if ((did & HIL_IDD_DID_REL_MOUSE_MASK) == HIL_IDD_DID_REL_MOUSE)
-+		btntype = BTN_MOUSE;
++	kbd->dev.id.bustype	= BUS_HIL;
++	kbd->dev.id.vendor	= PCI_VENDOR_ID_HP;
++	kbd->dev.id.product	= 0x0001; /* TODO: get from kbd->rsc */
++	kbd->dev.id.version	= 0x0100; /* TODO: get from kbd->rsc */
 +
-+	for (i = 0; i < ptr->nbtn; i++) {
-+		set_bit(btntype | i, ptr->dev.keybit);
-+		ptr->btnmap[i] = btntype | i;
++	for (i = 0; i < 128; i++) {
++		set_bit(hil_kbd_set1[i], kbd->dev.keybit);
++		set_bit(hil_kbd_set3[i], kbd->dev.keybit);
 +	}
++	clear_bit(0, kbd->dev.keybit);
 +
-+	if (btntype == BTN_MOUSE) {
-+		/* Swap buttons 2 and 3 */
-+		ptr->btnmap[1] = BTN_MIDDLE;
-+		ptr->btnmap[2] = BTN_RIGHT;
-+	}
++	input_register_device(&kbd->dev);
++	printk(KERN_INFO "input: %s, ID: %d\n",
++		kbd->dev.name, did);
 +
-+	if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) {
-+		for (i = 0; i < ptr->naxes; i++) {
-+			set_bit(REL_X + i, ptr->dev.relbit);
-+		}
-+		for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) {
-+			set_bit(REL_X + i, ptr->dev.relbit);
-+		}
-+	} else {
-+		for (i = 0; i < ptr->naxes; i++) {
-+	  		set_bit(ABS_X + i, ptr->dev.absbit);
-+			ptr->dev.absmin[ABS_X + i] = 0;
-+			ptr->dev.absmax[ABS_X + i] = 
-+				HIL_IDD_AXIS_MAX((ptr->idd + 1), i);
-+		}
-+		for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) {
-+			set_bit(ABS_X + i, ptr->dev.absbit);
-+			ptr->dev.absmin[ABS_X + i] = 0;
-+			ptr->dev.absmax[ABS_X + i] = 
-+				HIL_IDD_AXIS_MAX((ptr->idd + 1), (i - 3));
-+		}
-+#ifdef TABLET_AUTOADJUST
-+		for (i = 0; i < ABS_MAX; i++) {
-+			int diff = ptr->dev.absmax[ABS_X + i] / 10;
-+			ptr->dev.absmin[ABS_X + i] += diff;
-+			ptr->dev.absmax[ABS_X + i] -= diff;
-+		}
-+#endif
-+	}
++	serio->write(serio, 0);
++	serio->write(serio, 0);
++	serio->write(serio, HIL_PKT_CMD >> 8);
++	serio->write(serio, HIL_CMD_EK1); /* Enable Keyswitch Autorepeat 1 */
++	down(&(kbd->sem));
++	up(&(kbd->sem));
 +
-+	ptr->dev.name = strlen(ptr->rnm) ? ptr->rnm : HIL_GENERIC_NAME;
-+
-+	ptr->dev.id.bustype = BUS_HIL;
-+	ptr->dev.id.vendor = PCI_VENDOR_ID_HP;
-+	ptr->dev.id.product = 0x0001; /* TODO: get from ptr->rsc */
-+	ptr->dev.id.version = 0x0100; /* TODO: get from ptr->rsc */
-+
-+	input_register_device(&ptr->dev);
-+	printk(KERN_INFO "input: %s (%s), ID: %d\n",
-+                ptr->dev.name, 
-+		(btntype == BTN_MOUSE) ? "HIL mouse":"HIL tablet or touchpad",
-+		did);
-+
 +	return;
 + bail1:
 +	serio_close(serio);
 + bail0:
-+	kfree(ptr);
-+	return;
++	kfree(kbd);
 +}
 +
 +
-+static struct serio_dev hil_ptr_serio_dev = {
-+	.connect =	hil_ptr_connect,
-+	.disconnect =	hil_ptr_disconnect,
-+	.interrupt =	hil_ptr_interrupt
++struct serio_dev hil_kbd_serio_dev = {
++	.connect =	hil_kbd_connect,
++	.disconnect =	hil_kbd_disconnect,
++	.interrupt =	hil_kbd_interrupt
 +};
 +
-+static int __init hil_ptr_init(void)
++static int __init hil_kbd_init(void)
 +{
-+	serio_register_device(&hil_ptr_serio_dev);
++	serio_register_device(&hil_kbd_serio_dev);
 +        return 0;
 +}
 +                
-+static void __exit hil_ptr_exit(void)
++static void __exit hil_kbd_exit(void)
 +{
-+	serio_unregister_device(&hil_ptr_serio_dev);
++	serio_unregister_device(&hil_kbd_serio_dev);
 +}
 +                        
-+module_init(hil_ptr_init);
-+module_exit(hil_ptr_exit);
-Index: debian-kernel-hppa-2.6.8/include/linux/signal.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/linux/signal.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/linux/signal.h	2005-01-15 20:15:10.000000000 -0500
-@@ -220,6 +220,9 @@
- extern int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs, void *cookie);
- #endif
- 
-+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: debian-kernel-hppa-2.6.8/include/asm-parisc/atomic.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/atomic.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/atomic.h	2005-01-15 20:15:10.000000000 -0500
-@@ -14,10 +14,9 @@
-  */
- 
- #ifdef CONFIG_SMP
-+#include <asm/spinlock.h>
- #include <asm/cache.h>		/* we use L1_CACHE_BYTES */
- 
--typedef spinlock_t atomic_lock_t;
--
- /* Use an array of spinlocks for our atomic_ts.
-  * Hash function to index into a different SPINLOCK.
-  * Since "a" is usually an address, use one spinlock per cacheline.
-@@ -25,44 +24,35 @@
- #  define ATOMIC_HASH_SIZE 4
- #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
- 
--extern atomic_lock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
-+extern spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
- 
--static inline void atomic_spin_lock(atomic_lock_t *a)
--{
--	while (__ldcw(a) == 0)
--		while (a->lock[0] == 0);
--}
-+/* Can't use _raw_spin_lock_irq because of #include problems, so
-+ * this is the substitute */
-+#define _atomic_spin_lock_irqsave(l,f) do {	\
-+	spinlock_t *s = ATOMIC_HASH(l);		\
-+	local_irq_save(f);			\
-+	_raw_spin_lock(s);			\
-+} while(0)
-+
-+#define _atomic_spin_unlock_irqrestore(l,f) do {	\
-+	spinlock_t *s = ATOMIC_HASH(l);			\
-+	_raw_spin_unlock(s);				\
-+	local_irq_restore(f);				\
-+} while(0)
- 
--static inline void atomic_spin_unlock(atomic_lock_t *a)
--{
--	a->lock[0] = 1;
--}
- 
- #else
--#  define ATOMIC_HASH_SIZE 1
--#  define ATOMIC_HASH(a)	(0)
--#  define atomic_spin_lock(x) (void)(x)
--#  define atomic_spin_unlock(x) do { } while(0)
-+#  define _atomic_spin_lock_irqsave(l,f) do { local_irq_save(f); } while (0)
-+#  define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
- #endif
- 
--/* copied from <linux/spinlock.h> and modified */
--#define atomic_spin_lock_irqsave(lock, flags)	do { 	\
--	local_irq_save(flags);				\
--	atomic_spin_lock(lock); 			\
--} while (0)
--
--#define atomic_spin_unlock_irqrestore(lock, flags) do {	\
--	atomic_spin_unlock(lock);			\
--	local_irq_restore(flags);			\
--} while (0)
--
- /* Note that we need not lock read accesses - aligned word writes/reads
-  * are atomic, so a reader never sees unconsistent values.
-  *
-  * Cache-line alignment would conflict with, for example, linux/module.h
-  */
- 
--typedef struct { volatile long counter; } atomic_t;
-+typedef struct { volatile int counter; } atomic_t;
- 
- 
- /* This should get optimized out since it's never called.
-@@ -150,22 +140,22 @@
- {
- 	int ret;
- 	unsigned long flags;
--	atomic_spin_lock_irqsave(ATOMIC_HASH(v), flags);
-+	_atomic_spin_lock_irqsave(v, flags);
- 
- 	ret = (v->counter += i);
- 
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
-+	_atomic_spin_unlock_irqrestore(v, flags);
- 	return ret;
- }
- 
- static __inline__ void atomic_set(atomic_t *v, int i) 
- {
- 	unsigned long flags;
--	atomic_spin_lock_irqsave(ATOMIC_HASH(v), flags);
-+	_atomic_spin_lock_irqsave(v, flags);
- 
- 	v->counter = i;
- 
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
-+	_atomic_spin_unlock_irqrestore(v, flags);
- }
- 
- static __inline__ int atomic_read(const atomic_t *v)
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_nvram.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.c	2005-01-15 20:15:10.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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 "sym_glue.h"
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_nvram.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.h	2005-01-15 20:15:10.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
-  */
- 
- #ifndef SYM_NVRAM_H
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_images.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/perf_images.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_images.h	2005-01-15 20:15:10.000000000 -0500
-@@ -2,6 +2,7 @@
-  *    Imagine for use with the Onyx (PCX-U) CPU interface 
-  *
-  *    Copyright (C) 2001 Randolph Chung <tausq at parisc-linux.org>
-+ *    Copyright (C) 2001 Hewlett-Packard (Grant Grundler)
-  *
-  *    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
-Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/Kconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/Kconfig	2005-01-15 20:15:10.000000000 -0500
-@@ -96,3 +96,33 @@
- 
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called amikbd.
-+
-+config KEYBOARD_HIL_OLD
-+	tristate "HP HIL keyboard support (simple driver)"
-+	depends on PARISC && INPUT && INPUT_KEYBOARD && !HIL_MLC
-+	default y
-+	help
-+	  The "Human Interface Loop" is a older, 8-channel USB-like
-+	  controller used in several Hewlett Packard models. This driver
-+	  was adapted from the one written for m68k/hp300, and implements
-+	  support for a keyboard attached to the HIL port, but not for
-+	  any other types of HIL input devices like mice or tablets.
-+	  However, it has been thoroughly tested and is stable.
-+
-+	  If you want full HIL support including support for multiple
-+	  keyboards, mices and tablets, you have to enable the
-+	  "HP System Device Controller i8042 Support" in the input/serio
-+	  submenu.
-+
-+config KEYBOARD_HIL
-+	tristate "HP HIL keyboard support"
-+	depends on PARISC && INPUT && INPUT_KEYBOARD
-+	default y
-+	select HP_SDC
-+ 	select HIL_MLC
-+	help
-+	  The "Human Interface Loop" is a older, 8-channel USB-like
-+	  controller used in several Hewlett Packard models.
-+	  This driver implements support for HIL-keyboards attached
-+	  to your machine, so normally you should say Y here.
-+
-Index: debian-kernel-hppa-2.6.8/sound/oss/ad1889.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/sound/oss/ad1889.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/sound/oss/ad1889.c	2005-01-15 20:15:10.000000000 -0500
-@@ -1,5 +1,5 @@
- /*
-- *  Copyright 2001 Randolph Chung <tausq at debian.org>
-+ *  Copyright 2001-2004 Randolph Chung <tausq at debian.org>
-  *
-  *  Analog Devices 1889 PCI audio driver (AD1819 AC97-compatible codec)
-  *
-@@ -61,6 +61,7 @@
- #define AD1889_WRITEL(dev,reg,val) writel((val), dev->regbase + reg)
- 
- //now 100ms
-+/* #define WAIT_10MS()	schedule_timeout(HZ/10) */
- #define WAIT_10MS()	do { int __i; for (__i = 0; __i < 100; __i++) udelay(1000); } while(0)
- 
- /* currently only support a single device */
-@@ -69,25 +70,43 @@
- /************************* helper routines ***************************** */
- static inline void ad1889_set_wav_rate(ad1889_dev_t *dev, int rate)
- {
-+	struct ac97_codec *ac97_codec = dev->ac97_codec;
-+
-+	DBG("Setting WAV rate to %d\n", rate);
- 	dev->state[AD_WAV_STATE].dmabuf.rate = rate;
- 	AD1889_WRITEW(dev, AD_DSWAS, rate);
-+
-+	/* Cycle the DAC to enable the new rate */
-+	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200);
-+	WAIT_10MS();
-+	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0);
- }
- 
- static inline void ad1889_set_adc_rate(ad1889_dev_t *dev, int rate)
- {
-+	struct ac97_codec *ac97_codec = dev->ac97_codec;
-+
-+	DBG("Setting ADC rate to %d\n", rate);
- 	dev->state[AD_ADC_STATE].dmabuf.rate = rate;
- 	AD1889_WRITEW(dev, AD_DSRES, rate);
-+
-+	/* Cycle the ADC to enable the new rate */
-+	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0100);
-+	WAIT_10MS();
-+	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0);
- }
- 
- static inline void ad1889_set_wav_fmt(ad1889_dev_t *dev, int fmt)
- {
- 	u16 tmp;
- 
-+	DBG("Setting WAV format to 0x%x\n", fmt);
-+
- 	tmp = AD1889_READW(ad1889_dev, AD_DSWSMC);
--	if (fmt == AFMT_S16_LE) {
-+	if (fmt & AFMT_S16_LE) {
- 		//tmp |= 0x0100; /* set WA16 */
- 		tmp |= 0x0300; /* set WA16 stereo */
--	} else if (fmt == AFMT_U8) {
-+	} else if (fmt & AFMT_U8) {
- 		tmp &= ~0x0100; /* clear WA16 */
- 	} 
- 	AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp);
-@@ -97,10 +116,12 @@
- {
- 	u16 tmp;
- 
-+	DBG("Setting ADC format to 0x%x\n", fmt);
-+
- 	tmp = AD1889_READW(ad1889_dev, AD_DSRAMC);
--	if (fmt == AFMT_S16_LE) {
-+	if (fmt & AFMT_S16_LE) {
- 		tmp |= 0x0100; /* set WA16 */
--	} else if (fmt == AFMT_U8) {
-+	} else if (fmt & AFMT_U8) {
- 		tmp &= ~0x0100; /* clear WA16 */
- 	} 
- 	AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp);
-@@ -133,6 +154,9 @@
- 	dmabuf->dma_len = cnt;
- 	dmabuf->ready = 1;
- 
-+	DBG("Starting playback at 0x%p for %ld bytes\n", dmabuf->rawbuf +
-+	    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);
-@@ -243,7 +267,7 @@
- 		dmabuf->dma_handle = 0;
- 		dmabuf->rd_ptr = dmabuf->wr_ptr = dmabuf->dma_len = 0UL;
- 		dmabuf->ready = 0;
--		dmabuf->rate = 44100;
-+		dmabuf->rate = 48000;
- 	}
- 	return dev;
- 
-@@ -472,7 +496,6 @@
- 		long cnt = count;
- 		unsigned long flags;
- 
--
- 		for (;;) {
- 			long used_bytes;
- 			long timeout;	/* max time for DMA in jiffies */
-@@ -498,17 +521,11 @@
- 			}
- 
- 			set_current_state(TASK_INTERRUPTIBLE);
--			if (!schedule_timeout(timeout + 1))
--				printk(KERN_WARNING "AD1889 timeout(%ld) r/w %lx/%lx len %lx\n",
--				    timeout+1,
--				    dmabuf->rd_ptr, dmabuf->wr_ptr,
--				    dmabuf->dma_len);
--
-+			schedule_timeout(timeout + 1);
- 			if (signal_pending(current)) {
- 				ret = -ERESTARTSYS;
- 				goto err2;
- 			}
--
- 		}
- 
- 		/* watch out for wrapping around static buffer */
-@@ -616,6 +633,8 @@
- 	audio_buf_info abinfo;
- 	int __user *p = (int __user *)arg;
- 
-+	DBG("ad1889_ioctl cmd 0x%x arg %lu\n", cmd, arg);
-+
- 	switch (cmd)
- 	{
- 	case OSS_GETVERSION:
-@@ -674,11 +693,15 @@
- 		if (get_user(val, p))
- 			return -EFAULT;
- 
--		if (file->f_mode & FMODE_READ) 
--			ad1889_set_adc_fmt(dev, val);
-+		if (val == 0) {
-+			if (file->f_mode & FMODE_READ) 
-+				ad1889_set_adc_fmt(dev, val);
- 
--		if (file->f_mode & FMODE_WRITE) 
--			ad1889_set_wav_fmt(dev, val);
-+			if (file->f_mode & FMODE_WRITE) 
-+				ad1889_set_wav_fmt(dev, val);
-+		} else {
-+			val = AFMT_S16_LE | AFMT_U8;
-+		}
- 
- 		return put_user(val, p);
- 
-@@ -758,7 +781,7 @@
- 	
- 	file->private_data = ad1889_dev;
- 
--	ad1889_set_wav_rate(ad1889_dev, 44100);
-+	ad1889_set_wav_rate(ad1889_dev, 48000);
- 	ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
- 	AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */
- 	return nonseekable_open(inode, file);
-@@ -938,7 +961,6 @@
- 			ad1889_stop_wav(&dev->state[AD_WAV_STATE]);	/* clean up */
- 			ad1889_start_wav(&dev->state[AD_WAV_STATE]);	/* start new */
- 		}
--
- 	}
- 
- 	if ((stat & 0x2) && dev->state[AD_ADC_STATE].dmabuf.ready) { /* ADCI */
-@@ -952,18 +974,19 @@
- 
- static void ad1889_initcfg(ad1889_dev_t *dev)
- {
--	u16 tmp;
-+	u16 tmp16;
-+	u32 tmp32;
- 
- 	/* make sure the interrupt bits are setup the way we want */
--	tmp = AD1889_READW(dev, AD_DMAWAVCTRL);
--	tmp &= ~0x00ff; /* flat dma, no sg, mask out the intr bits */
--	tmp |= 0x0004;  /* intr on count, loop */
--	AD1889_WRITEW(dev, AD_DMAWAVCTRL, tmp);
-+	tmp32 = AD1889_READL(dev, AD_DMAWAVCTRL);
-+	tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */
-+	tmp32 |= 0x6;  /* intr on count, loop */
-+	AD1889_WRITEL(dev, AD_DMAWAVCTRL, tmp32);
- 
- 	/* unmute... */
--	tmp = AD1889_READW(dev, AD_DSWADA);
--	tmp &= ~0x8080;
--	AD1889_WRITEW(dev, AD_DSWADA, tmp);
-+	tmp16 = AD1889_READW(dev, AD_DSWADA);
-+	tmp16 &= ~0x8080;
-+	AD1889_WRITEW(dev, AD_DSWADA, tmp16);
- }
- 
- static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
-Index: debian-kernel-hppa-2.6.8/include/linux/hp_sdc.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/include/linux/hp_sdc.h	2005-01-15 20:15:11.000000000 -0500
-@@ -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: debian-kernel-hppa-2.6.8/include/asm-parisc/pdc.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/pdc.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/pdc.h	2005-01-15 20:15:11.000000000 -0500
-@@ -754,6 +754,7 @@
- int pdc_iodc_getc(void);
- void pdc_iodc_putc(unsigned char c);
- void pdc_iodc_outc(unsigned char c);
-+void pdc_printf(const char *fmt, ...);
- 
- void pdc_emergency_unlock(void);
- int pdc_sti_call(unsigned long func, unsigned long flags,
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw2.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw2.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw2.h	2005-01-15 20:15:11.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
-  */
- 
- /*
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/unaligned.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/unaligned.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/unaligned.c	2005-01-15 20:15:11.000000000 -0500
-@@ -559,7 +559,7 @@
- 
- 	if (regs->isr != regs->sr[7])
- 	{
--		printk(KERN_CRIT "isr verification failed (isr: " RFMT ", sr7: " RFMT "\n",
-+		printk(KERN_CRIT "isr verification failed (isr: " RFMT ", sr7: " RFMT ")\n",
- 			regs->isr, regs->sr[7]);
- 
- 		/* don't kill him though, since he has appropriate access to the page, or we
-Index: debian-kernel-hppa-2.6.8/sound/oss/harmony.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/sound/oss/harmony.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/sound/oss/harmony.c	2005-01-15 20:15:11.000000000 -0500
-@@ -12,6 +12,7 @@
- 	Copyright 2000-2003 (c) Helge Deller <deller at gmx.de>
- 	Copyright 2001 (c) Matthieu Delahaye <delahaym at esiee.fr>
- 	Copyright 2001 (c) Jean-Christophe Vaugeois <vaugeoij at esiee.fr>
-+	Copyright 2004 (c) Stuart Brady <sdbrady at ntlworld.com>
- 
- 				
- TODO:
-@@ -124,9 +125,17 @@
- #define GAIN_RO_MASK    ( 0x3f << GAIN_RO_SHIFT) 
- 
- 
--#define MAX_OUTPUT_LEVEL (GAIN_RO_MASK >> GAIN_RO_SHIFT)
--#define MAX_INPUT_LEVEL  (GAIN_RI_MASK >> GAIN_RI_SHIFT)
--#define MAX_VOLUME_LEVEL (GAIN_MA_MASK >> GAIN_MA_SHIFT)
-+#define MAX_OUTPUT_LEVEL  (GAIN_RO_MASK >> GAIN_RO_SHIFT)
-+#define MAX_INPUT_LEVEL   (GAIN_RI_MASK >> GAIN_RI_SHIFT)
-+#define MAX_MONITOR_LEVEL (GAIN_MA_MASK >> GAIN_MA_SHIFT)
-+
-+#define MIXER_INTERNAL   SOUND_MIXER_LINE1
-+#define MIXER_LINEOUT    SOUND_MIXER_LINE2
-+#define MIXER_HEADPHONES SOUND_MIXER_LINE3
-+
-+#define MASK_INTERNAL   SOUND_MASK_LINE1
-+#define MASK_LINEOUT    SOUND_MASK_LINE2
-+#define MASK_HEADPHONES SOUND_MASK_LINE3
- 
- /*
-  * Channels Mask in mixer register
-@@ -543,6 +552,7 @@
- 	int count = 0;
- 	int frame_size;
- 	int buf_to_fill;
-+	int fresh_buffer;
- 
- 	if (!harmony.format_initialized) {
- 		if (harmony_format_auto_detect(buffer, total_count))
-@@ -564,12 +574,16 @@
- 		
- 		
- 		buf_to_fill = (harmony.first_filled_play+harmony.nb_filled_play); 
--		if (harmony.play_offset)
-+		if (harmony.play_offset) {
- 			buf_to_fill--;
-+			buf_to_fill += MAX_BUFS;
-+		}
- 		buf_to_fill %= MAX_BUFS;
--
-+		
-+		fresh_buffer = (harmony.play_offset == 0);
-+		
- 		/* Figure out the size of the frame */
--		if ((total_count-count) > HARMONY_BUF_SIZE - harmony.play_offset) {
-+		if ((total_count-count) >= HARMONY_BUF_SIZE - harmony.play_offset) {
- 			frame_size = HARMONY_BUF_SIZE - harmony.play_offset;
- 		} else {
- 			frame_size = total_count - count;
-@@ -587,7 +601,7 @@
- 		CHECK_WBACK_INV_OFFSET(played_buf, (HARMONY_BUF_SIZE*buf_to_fill + harmony.play_offset), 
- 				frame_size);
- 	
--		if (!harmony.play_offset)
-+		if (fresh_buffer)
- 			harmony.nb_filled_play++;
- 		
- 		count += frame_size;
-@@ -650,18 +664,17 @@
- 			switch (ival) {
- 			case AFMT_MU_LAW:	new_format = HARMONY_DF_8BIT_ULAW; break;
- 			case AFMT_A_LAW:	new_format = HARMONY_DF_8BIT_ALAW; break;
--			case AFMT_S16_LE:	/* fall through, but not really supported */
--			case AFMT_S16_BE:	new_format = HARMONY_DF_16BIT_LINEAR;
--						ival = AFMT_S16_BE;
--						break; 
-+			case AFMT_S16_BE:	new_format = HARMONY_DF_16BIT_LINEAR; break;
- 			default: {
- 				DPRINTK(KERN_WARNING PFX 
- 					"unsupported sound format 0x%04x requested.\n",
- 					ival);
--				return -EINVAL;
-+				ival = AFMT_S16_BE;
-+				return put_user(ival, (int *) arg);
- 			}
- 			}
- 			harmony_set_format(new_format);
-+			return 0;
- 		} else {
- 			switch (harmony.data_format) {
- 			case HARMONY_DF_8BIT_ULAW:	ival = AFMT_MU_LAW; break;
-@@ -669,8 +682,8 @@
- 			case HARMONY_DF_16BIT_LINEAR:	ival = AFMT_U16_BE; break;
- 			default: ival = 0;
- 			}
-+			return put_user(ival, (int *) arg);
- 		}
--		return put_user(ival, (int *) arg);
- 
- 	case SOUND_PCM_READ_RATE:
- 		ival = harmony.dac_rate;
-@@ -689,7 +702,17 @@
- 		if (ival != 0 && ival != 1)
- 			return -EINVAL;
- 		harmony_set_stereo(ival);
--		return put_user(ival, (int *) arg);
-+ 		return 0;
-+ 
-+ 	case SNDCTL_DSP_CHANNELS:
-+ 		if (get_user(ival, (int *) arg))
-+ 			return -EFAULT;
-+ 		if (ival != 1 && ival != 2) {
-+ 			ival = harmony.stereo_select == HARMONY_SS_MONO ? 1 : 2;
-+ 			return put_user(ival, (int *) arg);
-+ 		}
-+ 		harmony_set_stereo(ival-1);
-+ 		return 0;
- 
- 	case SNDCTL_DSP_GETBLKSIZE:
- 		ival = HARMONY_BUF_SIZE;
-@@ -887,7 +910,7 @@
- 	int right_level;
- 
- 	switch (channel) {
--		case SOUND_MIXER_OGAIN:
-+		case SOUND_MIXER_VOLUME:
- 			left_level  = (harmony.current_gain & GAIN_LO_MASK) >> GAIN_LO_SHIFT;
- 			right_level = (harmony.current_gain & GAIN_RO_MASK) >> GAIN_RO_SHIFT;
- 			left_level  = to_oss_level(MAX_OUTPUT_LEVEL - left_level, MAX_OUTPUT_LEVEL);
-@@ -901,10 +924,10 @@
- 			right_level= to_oss_level(right_level, MAX_INPUT_LEVEL);
- 			return (right_level << 8)+left_level;
- 			
--		case SOUND_MIXER_VOLUME:
-+		case SOUND_MIXER_MONITOR:
- 			left_level = (harmony.current_gain & GAIN_MA_MASK) >> GAIN_MA_SHIFT;
--			left_level = to_oss_level(MAX_VOLUME_LEVEL-left_level, MAX_VOLUME_LEVEL);
--			return left_level;
-+			left_level = to_oss_level(MAX_MONITOR_LEVEL-left_level, MAX_MONITOR_LEVEL);
-+			return (left_level << 8)+left_level;
- 	}
- 	return -EINVAL;
- }
-@@ -926,9 +949,11 @@
- 
- 	right_level = (value & 0x0000ff00) >> 8;
- 	left_level = value & 0x000000ff;
-+	if (right_level > 100) right_level = 100;
-+	if (left_level > 100) left_level = 100;
-   
- 	switch (channel) {
--		case SOUND_MIXER_OGAIN:
-+		case SOUND_MIXER_VOLUME:
- 			right_level = to_harmony_level(100-right_level, MAX_OUTPUT_LEVEL);
- 			left_level  = to_harmony_level(100-left_level, MAX_OUTPUT_LEVEL);
- 			new_right_level = to_oss_level(MAX_OUTPUT_LEVEL - right_level, MAX_OUTPUT_LEVEL);
-@@ -948,12 +973,12 @@
- 			harmony_mixer_set_gain();
- 			return (new_right_level << 8) + new_left_level;
- 	
--		case SOUND_MIXER_VOLUME:
--			left_level = to_harmony_level(100-left_level, MAX_VOLUME_LEVEL);
--			new_left_level = to_oss_level(MAX_VOLUME_LEVEL-left_level, MAX_VOLUME_LEVEL);
--			harmony.current_gain = (harmony.current_gain & ~GAIN_MA_MASK)| (left_level << GAIN_MA_SHIFT);
-+		case SOUND_MIXER_MONITOR:
-+			left_level = to_harmony_level(100-left_level, MAX_MONITOR_LEVEL);
-+			new_left_level = to_oss_level(MAX_MONITOR_LEVEL-left_level, MAX_MONITOR_LEVEL);
-+			harmony.current_gain = (harmony.current_gain & ~GAIN_MA_MASK) | (left_level << GAIN_MA_SHIFT);
- 			harmony_mixer_set_gain();
--			return new_left_level;
-+			return (new_left_level << 8) + new_left_level;
- 	}
- 
- 	return -EINVAL;
-@@ -986,11 +1011,15 @@
- {
- 	int new_input_line;
- 	int new_input_mask;
--
--	if ((recmask & SOUND_MASK_LINE)) {
-+	int current_input_line;
-+	
-+	current_input_line = (harmony.current_gain & GAIN_IS_MASK)
-+				    >> GAIN_IS_SHIFT;
-+	if ((current_input_line && ((recmask & SOUND_MASK_LINE) || !(recmask & SOUND_MASK_MIC))) ||
-+		(!current_input_line && ((recmask & SOUND_MASK_LINE) && !(recmask & SOUND_MASK_MIC)))) {
- 		new_input_line = 0;
- 		new_input_mask = SOUND_MASK_LINE;
--	} else  {
-+	} else {
- 		new_input_line = 1;
- 		new_input_mask = SOUND_MASK_MIC;
- 	}
-@@ -1009,9 +1038,9 @@
- {
- 	int outmask = 0;
- 	
--	if (harmony.current_gain & GAIN_HE_MASK) outmask |=SOUND_MASK_PHONEOUT;
--	if (harmony.current_gain & GAIN_LE_MASK) outmask |=SOUND_MASK_LINE;
--	if (harmony.current_gain & GAIN_SE_MASK) outmask |=SOUND_MASK_SPEAKER;
-+	if (harmony.current_gain & GAIN_SE_MASK) outmask |= MASK_INTERNAL;
-+	if (harmony.current_gain & GAIN_LE_MASK) outmask |= MASK_LINEOUT;
-+	if (harmony.current_gain & GAIN_HE_MASK) outmask |= MASK_HEADPHONES;
- 	
- 	return outmask;
- }
-@@ -1019,24 +1048,24 @@
- 
- static int harmony_mixer_set_outmask(int outmask)
- {
--	if (outmask & SOUND_MASK_PHONEOUT) 
--		harmony.current_gain |= GAIN_HE_MASK; 
-+	if (outmask & MASK_INTERNAL) 
-+		harmony.current_gain |= GAIN_SE_MASK;
- 	else 
--		harmony.current_gain &= ~GAIN_HE_MASK;
-+		harmony.current_gain &= ~GAIN_SE_MASK;
- 	
--	if (outmask & SOUND_MASK_LINE) 
-+	if (outmask & MASK_LINEOUT) 
- 		harmony.current_gain |= GAIN_LE_MASK;
- 	else 
- 		harmony.current_gain &= ~GAIN_LE_MASK;
- 	
--	if (outmask & SOUND_MASK_SPEAKER) 
--		harmony.current_gain |= GAIN_SE_MASK;
-+	if (outmask & MASK_HEADPHONES) 
-+		harmony.current_gain |= GAIN_HE_MASK; 
- 	else 
--		harmony.current_gain &= ~GAIN_SE_MASK;
-+		harmony.current_gain &= ~GAIN_HE_MASK;
- 	
- 	harmony_mixer_set_gain();
- 
--	return (outmask & (SOUND_MASK_PHONEOUT | SOUND_MASK_LINE | SOUND_MASK_SPEAKER));
-+	return (outmask & (MASK_INTERNAL | MASK_LINEOUT | MASK_HEADPHONES));
- }
- 
- /*
-@@ -1074,19 +1103,19 @@
- 		ret = SOUND_CAP_EXCL_INPUT;
- 		break;
- 	case MIXER_READ(SOUND_MIXER_STEREODEVS):
--		ret = SOUND_MASK_IGAIN | SOUND_MASK_OGAIN;
-+		ret = SOUND_MASK_VOLUME | SOUND_MASK_IGAIN;
- 		break;
- 		
- 	case MIXER_READ(SOUND_MIXER_RECMASK):
- 		ret = SOUND_MASK_MIC | SOUND_MASK_LINE;
- 		break;
- 	case MIXER_READ(SOUND_MIXER_DEVMASK):
--		ret = SOUND_MASK_OGAIN | SOUND_MASK_IGAIN |
--			SOUND_MASK_VOLUME;
-+		ret = SOUND_MASK_VOLUME | SOUND_MASK_IGAIN |
-+			SOUND_MASK_MONITOR;
- 		break;
- 	case MIXER_READ(SOUND_MIXER_OUTMASK):
--		ret = SOUND_MASK_SPEAKER | SOUND_MASK_LINE |
--			SOUND_MASK_PHONEOUT;
-+		ret = MASK_INTERNAL | MASK_LINEOUT |
-+			MASK_HEADPHONES;
- 		break;
- 		
- 	case MIXER_WRITE(SOUND_MIXER_RECSRC):
-@@ -1103,15 +1132,15 @@
- 		ret = harmony_mixer_get_outmask();
- 		break;
- 	
--	case MIXER_WRITE(SOUND_MIXER_OGAIN):
--	case MIXER_WRITE(SOUND_MIXER_IGAIN):
- 	case MIXER_WRITE(SOUND_MIXER_VOLUME):
-+	case MIXER_WRITE(SOUND_MIXER_IGAIN):
-+	case MIXER_WRITE(SOUND_MIXER_MONITOR):
- 		ret = harmony_mixer_set_level(cmd & 0xff, val);
- 		break;
- 
--	case MIXER_READ(SOUND_MIXER_OGAIN):
--	case MIXER_READ(SOUND_MIXER_IGAIN):
- 	case MIXER_READ(SOUND_MIXER_VOLUME):
-+	case MIXER_READ(SOUND_MIXER_IGAIN):
-+	case MIXER_READ(SOUND_MIXER_MONITOR):
- 		ret = harmony_mixer_get_level(cmd & 0xff);
- 		break;
- 
-@@ -1201,16 +1230,15 @@
- 		return -EBUSY;
- 	}
- 
--	harmony.dev = dev;
--
--	/* Set the HPA of harmony */
--	harmony.hpa = (struct harmony_hpa *)dev->hpa;
--
--	if (!harmony.dev->irq) {
-+	if (!dev->irq) {
- 		printk(KERN_ERR PFX "no irq found\n");
- 		return -ENODEV;
- 	}
- 
-+	/* Set the HPA of harmony */
-+	harmony.hpa = (struct harmony_hpa *)dev->hpa;
-+	harmony.dev = dev;
-+
- 	/* Grab the ID and revision from the device */
- 	id = gsc_readb(&harmony.hpa->id);
- 	if ((id | 1) != 0x15) {
-Index: debian-kernel-hppa-2.6.8/sound/oss/ad1889.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/sound/oss/ad1889.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/sound/oss/ad1889.h	2005-01-15 20:15:11.000000000 -0500
-@@ -34,9 +34,9 @@
- #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	/* RES PCI control/status */
--#define AD_DMASYNCTRL	0xb0	/* RES PCI control/status */
--#define AD_DMAWAVCTRL	0xb8	/* 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 */
- 
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_defs.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_defs.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_defs.h	2005-01-15 20:15:11.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-- *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-- *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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.  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
-  */
- 
- #ifndef SYM_DEFS_H
-Index: debian-kernel-hppa-2.6.8/include/asm-parisc/thread_info.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/thread_info.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/thread_info.h	2005-01-15 20:15:11.000000000 -0500
-@@ -18,12 +18,15 @@
- 
- #define INIT_THREAD_INFO(tsk)			\
- {						\
--	task:		&tsk,			\
--	exec_domain:	&default_exec_domain,	\
--	flags:		0,			\
--	cpu:		0,			\
--	addr_limit:	KERNEL_DS,		\
--	preempt_count:	0,			\
-+	.task		= &tsk,			\
-+	.exec_domain	= &default_exec_domain,	\
-+	.flags		= 0,			\
-+	.cpu		= 0,			\
-+	.addr_limit	= KERNEL_DS,		\
-+	.preempt_count	= 0,			\
-+  	.restart_block	= {			\
-+		.fn = do_no_restart_syscall	\
-+	}					\
- }
- 
- #define init_thread_info        (init_thread_union.thread_info)
-Index: debian-kernel-hppa-2.6.8/drivers/input/misc/Makefile
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/misc/Makefile	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/misc/Makefile	2005-01-15 20:15:11.000000000 -0500
-@@ -9,3 +9,4 @@
- obj-$(CONFIG_INPUT_M68K_BEEP)		+= m68kspkr.o
- obj-$(CONFIG_INPUT_98SPKR)		+= 98spkr.o
- obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
-+obj-$(CONFIG_HP_SDC_RTC)		+= hp_sdc_rtc.o
-Index: debian-kernel-hppa-2.6.8/include/linux/hil.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/include/linux/hil.h	2005-01-15 20:15:11.000000000 -0500
-@@ -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_RESERVED,	KEY_SELECT,	KEY_RESERVED,	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_ */
++module_init(hil_kbd_init);
++module_exit(hil_kbd_exit);
 Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/hilkbd.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/hilkbd.c	2005-01-15 20:15:11.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/hilkbd.c	2005-02-01 01:38:33.000000000 -0500
 @@ -0,0 +1,345 @@
 +/*
 + *  linux/drivers/hil/hilkbd.c
@@ -4346,358 +4864,1314 @@
 +module_init(hil_init);
 +module_exit(hil_exit);
 +
-Index: debian-kernel-hppa-2.6.8/drivers/serial/8250_pci.c
+Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/hpps2atkbd.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/serial/8250_pci.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/serial/8250_pci.c	2005-01-15 20:15:11.000000000 -0500
-@@ -2177,7 +2177,14 @@
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/hpps2atkbd.h	2004-08-14 01:36:13.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/hpps2atkbd.h	2005-02-01 01:38:33.000000000 -0500
+@@ -50,10 +50,10 @@
+ /* 60 */  KEY_DOWN,     C_61,          KEY_PAUSE,     KEY_UP,        KEY_DELETE,    KEY_END,      KEY_BACKSPACE, KEY_INSERT,
+ /* 68 */  KEY_RESERVED, KEY_KP1,       KEY_RIGHT,     KEY_KP4,       KEY_KP7,       KEY_PAGEDOWN, KEY_HOME,      KEY_PAGEUP,
+ /* 70 */  KEY_KP0,      KEY_KPDOT,     KEY_KP2,       KEY_KP5,       KEY_KP6,       KEY_KP8,      KEY_ESC,       KEY_NUMLOCK,
+-/* 78 */  KEY_F11,      KEY_KPPLUS,    KEY_KP3,       KEY_KPMINUS,   KEY_KPASTERISK,KEY_KP9,      KEY_SCROLLLOCK,KEY_103RD,
++/* 78 */  KEY_F11,      KEY_KPPLUS,    KEY_KP3,       KEY_KPMINUS,   KEY_KPASTERISK,KEY_KP9,      KEY_SCROLLLOCK,KEY_102ND,
+ /* 80 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+ /* 88 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+-/* 90 */  KEY_RESERVED, KEY_RIGHTALT,  KEY_SYSRQ,     KEY_RESERVED,  KEY_RIGHTCTRL, KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
++/* 90 */  KEY_RESERVED, KEY_RIGHTALT,  255,           KEY_RESERVED,  KEY_RIGHTCTRL, KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
+ /* 98 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_CAPSLOCK, KEY_RESERVED,  KEY_LEFTMETA,
+ /* a0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RIGHTMETA,
+ /* a8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_COMPOSE,
+Index: debian-kernel-hppa-2.6.8/drivers/input/misc/Kconfig
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/misc/Kconfig	2004-08-14 01:36:56.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/misc/Kconfig	2005-02-01 01:38:33.000000000 -0500
+@@ -50,3 +50,11 @@
+ 	  To compile this driver as a module, choose M here: the
+ 	  module will be called uinput.
  
- static int __init serial8250_pci_init(void)
- {
--	return pci_module_init(&serial_pci_driver);
-+	int ret;
-+	ret = pci_module_init(&serial_pci_driver);
++config HP_SDC_RTC
++	tristate "HP SDC Real Time Clock"
++	depends on INPUT && INPUT_MISC && GSC
++	select HP_SDC
++	help
++	  Say Y here if you want to support the built-in real time clock
++	  of the HP SDC controller.
 +
-+#if defined(__hppa__) && defined(CONFIG_SERIAL_8250_CONSOLE)
-+	serial8250_console_init();
-+#endif
-+
-+	return ret;
- }
- 
- static void __exit serial8250_pci_exit(void)
-Index: debian-kernel-hppa-2.6.8/kernel/compat_signal.c
+Index: debian-kernel-hppa-2.6.8/drivers/input/misc/Makefile
 ===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/misc/Makefile	2004-08-14 01:37:15.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/misc/Makefile	2005-02-01 01:38:33.000000000 -0500
+@@ -9,3 +9,4 @@
+ obj-$(CONFIG_INPUT_M68K_BEEP)		+= m68kspkr.o
+ obj-$(CONFIG_INPUT_98SPKR)		+= 98spkr.o
+ obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
++obj-$(CONFIG_HP_SDC_RTC)		+= hp_sdc_rtc.o
+Index: debian-kernel-hppa-2.6.8/drivers/input/misc/hp_sdc_rtc.c
+===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/kernel/compat_signal.c	2005-01-15 20:15:11.000000000 -0500
-@@ -0,0 +1,206 @@
++++ debian-kernel-hppa-2.6.8/drivers/input/misc/hp_sdc_rtc.c	2005-02-01 01:38:33.000000000 -0500
+@@ -0,0 +1,726 @@
 +/*
-+ *  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.
++ * HP i8042 SDC + MSM-58321 BBRTC driver.
 + *
-+ * 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.
++ * Copyright (c) 2001 Brian S. Julin
++ * All rights reserved.
 + *
-+ * 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 
++ * 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:
++ * System Device Controller Microprocessor Firmware Theory of Operation
++ *      for Part Number 1820-4784 Revision B.  Dwg No. A-1820-4784-2
++ * efirtc.c by Stephane Eranian/Hewlett Packard
++ *
 + */
 +
-+#include <linux/compat_siginfo.h>
-+#include <asm/errno.h>
-+#include <asm/uaccess.h>
-+#include <asm/siginfo.h>
++#include <linux/hp_sdc.h>
++#include <linux/errno.h>
++#include <linux/types.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/time.h>
++#include <linux/miscdevice.h>
++#include <linux/proc_fs.h>
++#include <linux/poll.h>
++#include <linux/rtc.h>
 +
-+#ifndef HAVE_ARCH_COMPAT_COPY_SIGINFO_TO_USER
++MODULE_AUTHOR("Brian S. Julin <bri at calyx.com>");
++MODULE_DESCRIPTION("HP i8042 SDC + MSM-58321 RTC Driver");
++MODULE_LICENSE("Dual BSD/GPL");
 +
-+int compat_copy_siginfo_to_user(compat_siginfo_t __user *to, siginfo_t *from)
++#define RTC_VERSION "1.10d"
++
++static unsigned long epoch = 2000;
++
++static struct semaphore i8042tregs;
++
++static hp_sdc_irqhook hp_sdc_rtc_isr;
++
++static struct fasync_struct *hp_sdc_rtc_async_queue;
++
++static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait);
++
++static loff_t hp_sdc_rtc_llseek(struct file *file, loff_t offset, int origin);
++
++static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
++			       size_t count, loff_t *ppos);
++
++static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
++			    unsigned int cmd, unsigned long arg);
++
++static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait);
++
++static int hp_sdc_rtc_open(struct inode *inode, struct file *file);
++static int hp_sdc_rtc_release(struct inode *inode, struct file *file);
++static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on);
++
++static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off,
++				int count, int *eof, void *data);
++
++static void hp_sdc_rtc_isr (int irq, void *dev_id, 
++			    uint8_t status, uint8_t data) 
 +{
-+	int err;
-+	compat_siginfo_t compat_from;	
++	return;
++}
 +
-+	if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
-+		return -EFAULT;
++static int hp_sdc_rtc_do_read_bbrtc (struct rtc_time *rtctm)
++{
++	struct semaphore tsem;
++	hp_sdc_transaction t;
++	uint8_t tseq[91];
++	int i;
 +	
-+	/*
-+	 * 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.
-+	 */
++	i = 0;
++	while (i < 91) {
++		tseq[i++] = HP_SDC_ACT_DATAREG |
++			HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN;
++		tseq[i++] = 0x01;			/* write i8042[0x70] */
++	  	tseq[i]   = i / 7;			/* BBRTC reg address */
++		i++;
++		tseq[i++] = HP_SDC_CMD_DO_RTCR;		/* Trigger command   */
++		tseq[i++] = 2;		/* expect 1 stat/dat pair back.   */
++		i++; i++;               /* buffer for stat/dat pair       */
++	}
++	tseq[84] |= HP_SDC_ACT_SEMAPHORE;
++	t.endidx =		91;
++	t.seq =			tseq;
++	t.act.semaphore =	&tsem;
++	init_MUTEX_LOCKED(&tsem);
++	
++	if (hp_sdc_enqueue_transaction(&t)) return -1;
++	
++	down_interruptible(&tsem);  /* Put ourselves to sleep for results. */
++	
++	/* Check for nonpresence of BBRTC */
++	if (!((tseq[83] | tseq[90] | tseq[69] | tseq[76] |
++	       tseq[55] | tseq[62] | tseq[34] | tseq[41] |
++	       tseq[20] | tseq[27] | tseq[6]  | tseq[13]) & 0x0f))
++		return -1;
 +
-+	/* Convert structure, don't leak anything in the copy */
-+	memset(&compat_from,'\0',sizeof(compat_siginfo_t));
++	memset(rtctm, 0, sizeof(struct rtc_time));
++	rtctm->tm_year = (tseq[83] & 0x0f) + (tseq[90] & 0x0f) * 10;
++	rtctm->tm_mon  = (tseq[69] & 0x0f) + (tseq[76] & 0x0f) * 10;
++	rtctm->tm_mday = (tseq[55] & 0x0f) + (tseq[62] & 0x0f) * 10;
++	rtctm->tm_wday = (tseq[48] & 0x0f);
++	rtctm->tm_hour = (tseq[34] & 0x0f) + (tseq[41] & 0x0f) * 10;
++	rtctm->tm_min  = (tseq[20] & 0x0f) + (tseq[27] & 0x0f) * 10;
++	rtctm->tm_sec  = (tseq[6]  & 0x0f) + (tseq[13] & 0x0f) * 10;
++	
++	return 0;
++}
 +
-+        /* 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);
-+	compat_from.si_code = (compat_int_t)(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);
++static int hp_sdc_rtc_read_bbrtc (struct rtc_time *rtctm)
++{
++	struct rtc_time tm, tm_last;
++	int i = 0;
 +
-+        /* 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;
++	/* MSM-58321 has no read latch, so must read twice and compare. */
++
++	if (hp_sdc_rtc_do_read_bbrtc(&tm_last)) return -1;
++	if (hp_sdc_rtc_do_read_bbrtc(&tm)) return -1;
++
++	while (memcmp(&tm, &tm_last, sizeof(struct rtc_time))) {
++		if (i++ > 4) return -1;
++		memcpy(&tm_last, &tm, sizeof(struct rtc_time));
++		if (hp_sdc_rtc_do_read_bbrtc(&tm)) return -1;
++	}
++
++	memcpy(rtctm, &tm, sizeof(struct rtc_time));
++
++	return 0;
++}
++
++
++static int64_t hp_sdc_rtc_read_i8042timer (uint8_t loadcmd, int numreg)
++{
++	hp_sdc_transaction t;
++	uint8_t tseq[26] = {
++		HP_SDC_ACT_PRECMD | HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN,
++		0,
++		HP_SDC_CMD_READ_T1, 2, 0, 0,
++		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
++		HP_SDC_CMD_READ_T2, 2, 0, 0,
++		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
++		HP_SDC_CMD_READ_T3, 2, 0, 0,
++		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
++		HP_SDC_CMD_READ_T4, 2, 0, 0,
++		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
++		HP_SDC_CMD_READ_T5, 2, 0, 0
++	};
++
++	t.endidx = numreg * 5;
++
++	tseq[1] = loadcmd;
++	tseq[t.endidx - 4] |= HP_SDC_ACT_SEMAPHORE; /* numreg assumed > 1 */
++
++	t.seq =			tseq;
++	t.act.semaphore =	&i8042tregs;
++
++	down_interruptible(&i8042tregs);  /* Sleep if output regs in use. */
++
++	if (hp_sdc_enqueue_transaction(&t)) return -1;
++	
++	down_interruptible(&i8042tregs);  /* Sleep until results come back. */
++	up(&i8042tregs);
++
++	return (tseq[5] | 
++		((uint64_t)(tseq[10]) << 8)  | ((uint64_t)(tseq[15]) << 16) |
++		((uint64_t)(tseq[20]) << 24) | ((uint64_t)(tseq[25]) << 32));
++}
++
++
++/* Read the i8042 real-time clock */
++static inline int hp_sdc_rtc_read_rt(struct timeval *res) {
++	int64_t raw;
++	uint32_t tenms; 
++	unsigned int days;
++
++	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_RT, 5);
++	if (raw < 0) return -1;
++
++	tenms = (uint32_t)raw & 0xffffff;
++	days  = (unsigned int)(raw >> 24) & 0xffff;
++
++	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
++	res->tv_sec =  (time_t)(tenms / 100) + days * 86400;
++
++	return 0;
++}
++
++
++/* Read the i8042 fast handshake timer */
++static inline int hp_sdc_rtc_read_fhs(struct timeval *res) {
++	uint64_t raw;
++	unsigned int tenms;
++
++	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_FHS, 2);
++	if (raw < 0) return -1;
++
++	tenms = (unsigned int)raw & 0xffff;
++
++	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
++	res->tv_sec  = (time_t)(tenms / 100);
++
++	return 0;
++}
++
++
++/* Read the i8042 match timer (a.k.a. alarm) */
++static inline int hp_sdc_rtc_read_mt(struct timeval *res) {
++	int64_t raw;	
++	uint32_t tenms; 
++
++	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_MT, 3);
++	if (raw < 0) return -1;
++
++	tenms = (uint32_t)raw & 0xffffff;
++
++	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
++	res->tv_sec  = (time_t)(tenms / 100);
++
++	return 0;
++}
++
++
++/* Read the i8042 delay timer */
++static inline int hp_sdc_rtc_read_dt(struct timeval *res) {
++	int64_t raw;
++	uint32_t tenms;
++
++	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_DT, 3);
++	if (raw < 0) return -1;
++
++	tenms = (uint32_t)raw & 0xffffff;
++
++	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
++	res->tv_sec  = (time_t)(tenms / 100);
++
++	return 0;
++}
++
++
++/* Read the i8042 cycle timer (a.k.a. periodic) */
++static inline int hp_sdc_rtc_read_ct(struct timeval *res) {
++	int64_t raw;
++	uint32_t tenms;
++
++	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_CT, 3);
++	if (raw < 0) return -1;
++
++	tenms = (uint32_t)raw & 0xffffff;
++
++	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
++	res->tv_sec  = (time_t)(tenms / 100);
++
++	return 0;
++}
++
++
++/* Set the i8042 real-time clock */
++static int hp_sdc_rtc_set_rt (struct timeval *setto)
++{
++	uint32_t tenms;
++	unsigned int days;
++	hp_sdc_transaction t;
++	uint8_t tseq[11] = {
++		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
++		HP_SDC_CMD_SET_RTMS, 3, 0, 0, 0,
++		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
++		HP_SDC_CMD_SET_RTD, 2, 0, 0 
++	};
++
++	t.endidx = 10;
++
++	if (0xffff < setto->tv_sec / 86400) return -1;
++	days = setto->tv_sec / 86400;
++	if (0xffff < setto->tv_usec / 1000000 / 86400) return -1;
++	days += ((setto->tv_sec % 86400) + setto->tv_usec / 1000000) / 86400;
++	if (days > 0xffff) return -1;
++
++	if (0xffffff < setto->tv_sec) return -1;
++	tenms  = setto->tv_sec * 100;
++	if (0xffffff < setto->tv_usec / 10000) return -1;
++	tenms += setto->tv_usec / 10000;
++	if (tenms > 0xffffff) return -1;
++
++	tseq[3] = (uint8_t)(tenms & 0xff);
++	tseq[4] = (uint8_t)((tenms >> 8)  & 0xff);
++	tseq[5] = (uint8_t)((tenms >> 16) & 0xff);
++
++	tseq[9] = (uint8_t)(days & 0xff);
++	tseq[10] = (uint8_t)((days >> 8) & 0xff);
++
++	t.seq =	tseq;
++
++	if (hp_sdc_enqueue_transaction(&t)) return -1;
++	return 0;
++}
++
++/* Set the i8042 fast handshake timer */
++static int hp_sdc_rtc_set_fhs (struct timeval *setto)
++{
++	uint32_t tenms;
++	hp_sdc_transaction t;
++	uint8_t tseq[5] = {
++		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
++		HP_SDC_CMD_SET_FHS, 2, 0, 0
++	};
++
++	t.endidx = 4;
++
++	if (0xffff < setto->tv_sec) return -1;
++	tenms  = setto->tv_sec * 100;
++	if (0xffff < setto->tv_usec / 10000) return -1;
++	tenms += setto->tv_usec / 10000;
++	if (tenms > 0xffff) return -1;
++
++	tseq[3] = (uint8_t)(tenms & 0xff);
++	tseq[4] = (uint8_t)((tenms >> 8)  & 0xff);
++
++	t.seq =	tseq;
++
++	if (hp_sdc_enqueue_transaction(&t)) return -1;
++	return 0;
++}
++
++
++/* Set the i8042 match timer (a.k.a. alarm) */
++#define hp_sdc_rtc_set_mt (setto) \
++	hp_sdc_rtc_set_i8042timer(setto, HP_SDC_CMD_SET_MT)
++
++/* Set the i8042 delay timer */
++#define hp_sdc_rtc_set_dt (setto) \
++	hp_sdc_rtc_set_i8042timer(setto, HP_SDC_CMD_SET_DT)
++
++/* Set the i8042 cycle timer (a.k.a. periodic) */
++#define hp_sdc_rtc_set_ct (setto) \
++	hp_sdc_rtc_set_i8042timer(setto, HP_SDC_CMD_SET_CT)
++
++/* Set one of the i8042 3-byte wide timers */
++static int hp_sdc_rtc_set_i8042timer (struct timeval *setto, uint8_t setcmd)
++{
++	uint32_t tenms;
++	hp_sdc_transaction t;
++	uint8_t tseq[6] = {
++		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
++		0, 3, 0, 0, 0
++	};
++
++	t.endidx = 6;
++
++	if (0xffffff < setto->tv_sec) return -1;
++	tenms  = setto->tv_sec * 100;
++	if (0xffffff < setto->tv_usec / 10000) return -1;
++	tenms += setto->tv_usec / 10000;
++	if (tenms > 0xffffff) return -1;
++
++	tseq[1] = setcmd;
++	tseq[3] = (uint8_t)(tenms & 0xff);
++	tseq[4] = (uint8_t)((tenms >> 8)  & 0xff);
++	tseq[5] = (uint8_t)((tenms >> 16)  & 0xff);
++
++	t.seq =			tseq;
++
++	if (hp_sdc_enqueue_transaction(&t)) { 
++		return -1;
++	}
++	return 0;
++}
++
++static loff_t hp_sdc_rtc_llseek(struct file *file, loff_t offset, int origin)
++{
++        return -ESPIPE;
++}
++
++static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
++			       size_t count, loff_t *ppos) {
++	ssize_t retval;
++
++        if (count < sizeof(unsigned long))
++                return -EINVAL;
++
++	retval = put_user(68, (unsigned long *)buf);
++	return retval;
++}
++
++static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait)
++{
++        unsigned long l;
++
++	l = 0;
++        if (l != 0)
++                return POLLIN | POLLRDNORM;
++        return 0;
++}
++
++static int hp_sdc_rtc_open(struct inode *inode, struct file *file)
++{
++	MOD_INC_USE_COUNT;
++        return 0;
++}
++
++static int hp_sdc_rtc_release(struct inode *inode, struct file *file)
++{
++	/* Turn off interrupts? */
++
++        if (file->f_flags & FASYNC) {
++                hp_sdc_rtc_fasync (-1, file, 0);
 +        }
++
++	MOD_DEC_USE_COUNT;
++        return 0;
++}
++
++static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on)
++{
++        return fasync_helper (fd, filp, on, &hp_sdc_rtc_async_queue);
++}
++
++static int hp_sdc_rtc_proc_output (char *buf)
++{
++#define YN(bit) ("no")
++#define NY(bit) ("yes")
++        char *p;
++        struct rtc_time tm;
++	struct timeval tv;
++
++	memset(&tm, 0, sizeof(struct rtc_time));
++
++	p = buf;
++
++	if (hp_sdc_rtc_read_bbrtc(&tm)) {
++		p += sprintf(p, "BBRTC\t\t: READ FAILED!\n");
++	} else {
++		p += sprintf(p,
++			     "rtc_time\t: %02d:%02d:%02d\n"
++			     "rtc_date\t: %04d-%02d-%02d\n"
++			     "rtc_epoch\t: %04lu\n",
++			     tm.tm_hour, tm.tm_min, tm.tm_sec,
++			     tm.tm_year + 1900, tm.tm_mon + 1, 
++			     tm.tm_mday, epoch);
++	}
++
++	if (hp_sdc_rtc_read_rt(&tv)) {
++		p += sprintf(p, "i8042 rtc\t: READ FAILED!\n");
++	} else {
++		p += sprintf(p, "i8042 rtc\t: %d.%02d seconds\n", 
++			     tv.tv_sec, tv.tv_usec/1000);
++	}
++
++	if (hp_sdc_rtc_read_fhs(&tv)) {
++		p += sprintf(p, "handshake\t: READ FAILED!\n");
++	} else {
++        	p += sprintf(p, "handshake\t: %d.%02d seconds\n", 
++			     tv.tv_sec, tv.tv_usec/1000);
++	}
++
++	if (hp_sdc_rtc_read_mt(&tv)) {
++		p += sprintf(p, "alarm\t\t: READ FAILED!\n");
++	} else {
++		p += sprintf(p, "alarm\t\t: %d.%02d seconds\n", 
++			     tv.tv_sec, tv.tv_usec/1000);
++	}
++
++	if (hp_sdc_rtc_read_dt(&tv)) {
++		p += sprintf(p, "delay\t\t: READ FAILED!\n");
++	} else {
++		p += sprintf(p, "delay\t\t: %d.%02d seconds\n", 
++			     tv.tv_sec, tv.tv_usec/1000);
++	}
++
++	if (hp_sdc_rtc_read_ct(&tv)) {
++		p += sprintf(p, "periodic\t: READ FAILED!\n");
++	} else {
++		p += sprintf(p, "periodic\t: %d.%02d seconds\n", 
++			     tv.tv_sec, tv.tv_usec/1000);
++	}
++
++        p += sprintf(p,
++                     "DST_enable\t: %s\n"
++                     "BCD\t\t: %s\n"
++                     "24hr\t\t: %s\n"
++                     "square_wave\t: %s\n"
++                     "alarm_IRQ\t: %s\n"
++                     "update_IRQ\t: %s\n"
++                     "periodic_IRQ\t: %s\n"
++		     "periodic_freq\t: %ld\n"
++                     "batt_status\t: %s\n",
++                     YN(RTC_DST_EN),
++                     NY(RTC_DM_BINARY),
++                     YN(RTC_24H),
++                     YN(RTC_SQWE),
++                     YN(RTC_AIE),
++                     YN(RTC_UIE),
++                     YN(RTC_PIE),
++                     1UL,
++                     1 ? "okay" : "dead");
++
++        return  p - buf;
++#undef YN
++#undef NY
++}
++
++static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off,
++                         int count, int *eof, void *data)
++{
++	int len = hp_sdc_rtc_proc_output (page);
++        if (len <= off+count) *eof = 1;
++        *start = page + off;
++        len -= off;
++        if (len>count) len = count;
++        if (len<0) len = 0;
++        return len;
++}
++
++static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, 
++			    unsigned int cmd, unsigned long arg)
++{
++#if 1
++	return -EINVAL;
++#else
 +	
-+	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);
++        struct rtc_time wtime; 
++	struct timeval ttime;
++	int use_wtime = 0;
++
++	/* This needs major work. */
++
++        switch (cmd) {
++
++        case RTC_AIE_OFF:       /* Mask alarm int. enab. bit    */
++        case RTC_AIE_ON:        /* Allow alarm interrupts.      */
++	case RTC_PIE_OFF:       /* Mask periodic int. enab. bit */
++        case RTC_PIE_ON:        /* Allow periodic ints          */
++        case RTC_UIE_ON:        /* Allow ints for RTC updates.  */
++        case RTC_UIE_OFF:       /* Allow ints for RTC updates.  */
++        {
++		/* We cannot mask individual user timers and we
++		   cannot tell them apart when they occur, so it 
++		   would be disingenuous to succeed these IOCTLs */
++		return -EINVAL;
++        }
++        case RTC_ALM_READ:      /* Read the present alarm time */
++        {
++		if (hp_sdc_rtc_read_mt(&ttime)) return -EFAULT;
++		if (hp_sdc_rtc_read_bbrtc(&wtime)) return -EFAULT;
++
++		wtime.tm_hour = ttime.tv_sec / 3600;  ttime.tv_sec %= 3600;
++		wtime.tm_min  = ttime.tv_sec / 60;    ttime.tv_sec %= 60;
++		wtime.tm_sec  = ttime.tv_sec;
++                
 +		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)(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);
++        }
++        case RTC_IRQP_READ:     /* Read the periodic IRQ rate.  */
++        {
++                return put_user(hp_sdc_rtc_freq, (unsigned long *)arg);
++        }
++        case RTC_IRQP_SET:      /* Set periodic IRQ rate.       */
++        {
++                /* 
++                 * The max we can do is 100Hz.
++		 */
++
++                if ((arg < 1) || (arg > 100)) return -EINVAL;
++		ttime.tv_sec = 0;
++		ttime.tv_usec = 1000000 / arg;
++		if (hp_sdc_rtc_set_ct(&ttime)) return -EFAULT;
++		hp_sdc_rtc_freq = arg;
++                return 0;
++        }
++        case RTC_ALM_SET:       /* Store a time into the alarm */
++        {
++                /*
++                 * This expects a struct hp_sdc_rtc_time. Writing 0xff means
++                 * "don't care" or "match all" for PC timers.  The HP SDC
++		 * does not support that perk, but it could be emulated fairly
++		 * easily.  Only the tm_hour, tm_min and tm_sec are used.
++		 * We could do it with 10ms accuracy with the HP SDC, if the 
++		 * rtc interface left us a way to do that.
++                 */
++                struct hp_sdc_rtc_time alm_tm;
++
++                if (copy_from_user(&alm_tm, (struct hp_sdc_rtc_time*)arg,
++                                   sizeof(struct hp_sdc_rtc_time)))
++                       return -EFAULT;
++
++                if (alm_tm.tm_hour > 23) return -EINVAL;
++		if (alm_tm.tm_min  > 59) return -EINVAL;
++		if (alm_tm.tm_sec  > 59) return -EINVAL;  
++
++		ttime.sec = alm_tm.tm_hour * 3600 + 
++		  alm_tm.tm_min * 60 + alm_tm.tm_sec;
++		ttime.usec = 0;
++		if (hp_sdc_rtc_set_mt(&ttime)) return -EFAULT;
++                return 0;
++        }
++        case RTC_RD_TIME:       /* Read the time/date from RTC  */
++        {
++		if (hp_sdc_rtc_read_bbrtc(&wtime)) return -EFAULT;
++                break;
++        }
++        case RTC_SET_TIME:      /* Set the RTC */
++        {
++                struct rtc_time hp_sdc_rtc_tm;
++                unsigned char mon, day, hrs, min, sec, leap_yr;
++                unsigned int yrs;
++
++                if (!capable(CAP_SYS_TIME))
++                        return -EACCES;
++		if (copy_from_user(&hp_sdc_rtc_tm, (struct rtc_time *)arg,
++                                   sizeof(struct rtc_time)))
++                        return -EFAULT;
++
++                yrs = hp_sdc_rtc_tm.tm_year + 1900;
++                mon = hp_sdc_rtc_tm.tm_mon + 1;   /* tm_mon starts at zero */
++                day = hp_sdc_rtc_tm.tm_mday;
++                hrs = hp_sdc_rtc_tm.tm_hour;
++                min = hp_sdc_rtc_tm.tm_min;
++                sec = hp_sdc_rtc_tm.tm_sec;
++
++                if (yrs < 1970)
++                        return -EINVAL;
++
++                leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400));
++
++                if ((mon > 12) || (day == 0))
++                        return -EINVAL;
++                if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr)))
++                        return -EINVAL;
++		if ((hrs >= 24) || (min >= 60) || (sec >= 60))
++                        return -EINVAL;
++
++                if ((yrs -= eH) > 255)    /* They are unsigned */
++                        return -EINVAL;
++
++
++                return 0;
++        }
++        case RTC_EPOCH_READ:    /* Read the epoch.      */
++        {
++                return put_user (epoch, (unsigned long *)arg);
++        }
++        case RTC_EPOCH_SET:     /* Set the epoch.       */
++        {
++                /* 
++                 * There were no RTC clocks before 1900.
++                 */
++                if (arg < 1900)
++		  return -EINVAL;
++		if (!capable(CAP_SYS_TIME))
++		  return -EACCES;
++		
++                epoch = arg;
++                return 0;
++        }
++        default:
++                return -EINVAL;
++        }
++        return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
++#endif
++}
++
++static struct file_operations hp_sdc_rtc_fops = {
++        .owner =	THIS_MODULE,
++        .llseek =	hp_sdc_rtc_llseek,
++        .read =		hp_sdc_rtc_read,
++        .poll =		hp_sdc_rtc_poll,
++        .ioctl =	hp_sdc_rtc_ioctl,
++        .open =		hp_sdc_rtc_open,
++        .release =	hp_sdc_rtc_release,
++        .fasync =	hp_sdc_rtc_fasync,
++};
++
++static struct miscdevice hp_sdc_rtc_dev = {
++        .minor =	RTC_MINOR,
++        .name =		"rtc",
++        .fops =		&hp_sdc_rtc_fops
++};
++
++static int __init hp_sdc_rtc_init(void)
++{
++	int ret;
++
++	init_MUTEX(&i8042tregs);
++
++	if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr)))
++		return ret;
++	misc_register(&hp_sdc_rtc_dev);
++        create_proc_read_entry ("driver/rtc", 0, 0, 
++				hp_sdc_rtc_read_proc, NULL);
++
++	printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded "
++			 "(RTC v " RTC_VERSION ")\n");
++
++	return 0;
++}
++
++static void __exit hp_sdc_rtc_exit(void)
++{
++	remove_proc_entry ("driver/rtc", NULL);
++        misc_deregister(&hp_sdc_rtc_dev);
++	hp_sdc_release_timer_irq(hp_sdc_rtc_isr);
++        printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support unloaded\n");
++}
++
++module_init(hp_sdc_rtc_init);
++module_exit(hp_sdc_rtc_exit);
+Index: debian-kernel-hppa-2.6.8/drivers/input/mouse/Kconfig
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/mouse/Kconfig	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/mouse/Kconfig	2005-02-01 01:38:33.000000000 -0500
+@@ -130,3 +130,11 @@
+ 	  described in the source file). This driver should, in theory,
+ 	  also work with the digitizer DEC produced, but it isn't tested
+ 	  with that (I don't have the hardware yet).
++
++config MOUSE_HIL
++	tristate "HIL pointers (mice etc)."
++	depends on PARISC && INPUT_MOUSE
++	select HP_SDC
++	select HIL_MLC
++	help
++	  Say Y here to support HIL pointers.
+Index: debian-kernel-hppa-2.6.8/drivers/input/mouse/Makefile
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/mouse/Makefile	2004-08-14 01:36:32.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/mouse/Makefile	2005-02-01 01:38:33.000000000 -0500
+@@ -12,6 +12,7 @@
+ obj-$(CONFIG_MOUSE_PC110PAD)	+= pc110pad.o
+ obj-$(CONFIG_MOUSE_PS2)		+= psmouse.o
+ obj-$(CONFIG_MOUSE_SERIAL)	+= sermouse.o
++obj-$(CONFIG_MOUSE_HIL)		+= hil_ptr.o
+ obj-$(CONFIG_MOUSE_VSXXXAA)	+= vsxxxaa.o
+ 
+ psmouse-objs  := psmouse-base.o logips2pp.o synaptics.o
+Index: debian-kernel-hppa-2.6.8/drivers/input/mouse/hil_ptr.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/drivers/input/mouse/hil_ptr.c	2005-02-01 01:38:33.000000000 -0500
+@@ -0,0 +1,409 @@
++/*
++ * Generic linux-input device driver for axis-bearing devices
++ *
++ * 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/input.h>
++#include <linux/serio.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/pci_ids.h>
++
++#define PREFIX "HIL PTR: "
++#define HIL_GENERIC_NAME "HIL pointer device"
++
++MODULE_AUTHOR("Brian S. Julin <bri at calyx.com>");
++MODULE_DESCRIPTION(HIL_GENERIC_NAME " driver");
++MODULE_LICENSE("Dual BSD/GPL");
++
++
++#define TABLET_SIMULATES_MOUSE	/* allow tablet to be used as mouse */
++#undef  TABLET_AUTOADJUST	/* auto-adjust valid tablet ranges */
++
++
++#define HIL_PTR_MAX_LENGTH 16
++
++struct hil_ptr {
++	struct input_dev dev;
++	struct serio *serio;
++
++	/* Input buffer and index for packets from HIL bus. */
++	hil_packet data[HIL_PTR_MAX_LENGTH];
++	int idx4; /* four counts per packet */
++
++	/* Raw device info records from HIL bus, see hil.h for fields. */
++	char	idd[HIL_PTR_MAX_LENGTH];	/* DID byte and IDD record */
++	char	rsc[HIL_PTR_MAX_LENGTH];	/* RSC record */
++	char	exd[HIL_PTR_MAX_LENGTH];	/* EXD record */
++	char	rnm[HIL_PTR_MAX_LENGTH + 1];	/* RNM record + NULL term. */
++
++	/* Extra device details not contained in struct input_dev. */
++	unsigned int nbtn, naxes;
++	unsigned int btnmap[7];
++
++	/* Something to sleep around with. */
++	struct semaphore sem;
++};
++
++/* Process a complete packet after transfer from the HIL */
++static void hil_ptr_process_record(struct hil_ptr *ptr)
++{
++	struct input_dev *dev = &ptr->dev;
++	hil_packet *data = ptr->data;
++	hil_packet p;
++	int idx, i, cnt, laxis;
++	int ax16, absdev;
++
++	idx = ptr->idx4/4;
++	p = data[idx - 1];
++
++	if ((p & ~HIL_CMDCT_POL) == 
++	    (HIL_ERR_INT | HIL_PKT_CMD | HIL_CMD_POL)) goto report;
++	if ((p & ~HIL_CMDCT_RPL) == 
++	    (HIL_ERR_INT | HIL_PKT_CMD | HIL_CMD_RPL)) goto report;
++
++	/* Not a poll response.  See if we are loading config records. */
++	switch (p & HIL_PKT_DATA_MASK) {
++	case HIL_CMD_IDD:
++		for (i = 0; i < idx; i++)
++			ptr->idd[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_PTR_MAX_LENGTH; i++)
++			ptr->idd[i] = 0;
 +		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);
++	case HIL_CMD_RSC:
++		for (i = 0; i < idx; i++)
++			ptr->rsc[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_PTR_MAX_LENGTH; i++)
++			ptr->rsc[i] = 0;
 +		break;
-+	case __SI_FAULT:
-+		compat_from.si_addr = (compat_uptr_t)((u64)(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
++	case HIL_CMD_EXD:
++		for (i = 0; i < idx; i++)
++			ptr->exd[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_PTR_MAX_LENGTH; i++)
++			ptr->exd[i] = 0;
 +		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);
++	case HIL_CMD_RNM:
++		for (i = 0; i < idx; i++)
++			ptr->rnm[i] = ptr->data[i] & HIL_PKT_DATA_MASK;
++		for (; i < HIL_PTR_MAX_LENGTH + 1; i++)
++			ptr->rnm[i] = '\0';
 +		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)(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);
++	default:
++		/* These occur when device isn't present */
++		if (p == (HIL_ERR_INT | HIL_PKT_CMD)) break; 
++		/* Anything else we'd like to know about. */
++		printk(KERN_WARNING PREFIX "Device sent unknown record %x\n", p);
 +		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;
++	goto out;
++
++ report:
++	if ((p & HIL_CMDCT_POL) != idx - 1) {
++		printk(KERN_WARNING PREFIX "Malformed poll packet %x (idx = %i)\n", p, idx);
++		goto out;
++	}
++
++	i = (ptr->data[0] & HIL_POL_AXIS_ALT) ? 3 : 0;
++	laxis = ptr->data[0] & HIL_POL_NUM_AXES_MASK;
++	laxis += i;
++
++	ax16 = ptr->idd[1] & HIL_IDD_HEADER_16BIT; /* 8 or 16bit resolution */
++	absdev = ptr->idd[1] & HIL_IDD_HEADER_ABS; 
++
++	for (cnt = 1; i < laxis; i++) {
++		unsigned int lo,hi,val;
++		lo = ptr->data[cnt++] & HIL_PKT_DATA_MASK;
++		hi = ax16 ? (ptr->data[cnt++] & HIL_PKT_DATA_MASK) : 0;
++		if (absdev) {
++			val = lo + (hi<<8);
++#ifdef TABLET_AUTOADJUST
++			if (val < ptr->dev.absmin[ABS_X + i])
++				ptr->dev.absmin[ABS_X + i] = val;
++			if (val > ptr->dev.absmax[ABS_X + i])
++				ptr->dev.absmax[ABS_X + i] = val;
++#endif
++			if (i%3) val = ptr->dev.absmax[ABS_X + i] - val;
++			input_report_abs(dev, ABS_X + i, val);
++		} else {
++			val = (int) (((int8_t)lo) | ((int8_t)hi<<8));
++			if (i%3) val *= -1;
++			input_report_rel(dev, REL_X + i, val);
++		}
++	}
++
++	while (cnt < idx - 1) {
++		unsigned int btn;
++		int up;
++		btn = ptr->data[cnt++];
++		up = btn & 1;
++		btn &= 0xfe;
++		if (btn == 0x8e) {
++			continue; /* TODO: proximity == touch? */
++		}
++		else if ((btn > 0x8c) || (btn < 0x80)) continue;
++		btn = (btn - 0x80) >> 1;
++		btn = ptr->btnmap[btn];
++		input_report_key(dev, btn, !up);
++	}
++	input_sync(dev);
++ out:
++	ptr->idx4 = 0;
++	up(&ptr->sem);
 +}
 +
-+int compat_copy_siginfo_from_user(siginfo_t *to, compat_siginfo_t __user *from)
++static void hil_ptr_process_err(struct hil_ptr *ptr) {
++	printk(KERN_WARNING PREFIX "errored HIL packet\n");
++	ptr->idx4 = 0;
++	up(&ptr->sem);
++	return;
++}
++
++static irqreturn_t hil_ptr_interrupt(struct serio *serio, 
++        unsigned char data, unsigned int flags, struct pt_regs *regs)
 +{
-+	int err;
-+        u64 scratch;
++	struct hil_ptr *ptr;
++	hil_packet packet;
++	int idx;
 +
-+	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.
-+	 */
++	ptr = (struct hil_ptr *)serio->private;
++	if (ptr == NULL) {
++		BUG();
++		return IRQ_HANDLED;
++	}
 +
-+        /* 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;
-+        }
++	if (ptr->idx4 >= (HIL_PTR_MAX_LENGTH * sizeof(hil_packet))) {
++		hil_ptr_process_err(ptr);
++		return IRQ_HANDLED;
++	}
++	idx = ptr->idx4/4;
++	if (!(ptr->idx4 % 4)) ptr->data[idx] = 0;
++	packet = ptr->data[idx];
++	packet |= ((hil_packet)data) << ((3 - (ptr->idx4 % 4)) * 8);
++	ptr->data[idx] = packet;
++
++	/* Records of N 4-byte hil_packets must terminate with a command. */
++	if ((++(ptr->idx4)) % 4) return IRQ_HANDLED;
++	if ((packet & 0xffff0000) != HIL_ERR_INT) {
++		hil_ptr_process_err(ptr);
++		return IRQ_HANDLED;
++	}
++	if (packet & HIL_PKT_CMD) 
++		hil_ptr_process_record(ptr);
++	return IRQ_HANDLED;
++}
++
++static void hil_ptr_disconnect(struct serio *serio)
++{
++	struct hil_ptr *ptr;
++
++	ptr = (struct hil_ptr *)serio->private;
++	if (ptr == NULL) {
++		BUG();
++		return;
++	}
++
++	input_unregister_device(&ptr->dev);
++	serio_close(serio);
++	kfree(ptr);
++}
++
++static void hil_ptr_connect(struct serio *serio, struct serio_dev *dev)
++{
++	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;
++	memset(ptr, 0, sizeof(struct hil_ptr));
++
++	if (serio_open(serio, dev)) goto bail0;
++
++	serio->private = ptr;
++	ptr->serio = serio;
++	ptr->dev.private = ptr;
++
++	init_MUTEX_LOCKED(&(ptr->sem));
++
++	/* Get device info.  MLC driver supplies devid/status/etc. */
++	serio->write(serio, 0);
++	serio->write(serio, 0);
++	serio->write(serio, HIL_PKT_CMD >> 8);
++	serio->write(serio, HIL_CMD_IDD);
++	down(&(ptr->sem));
++
++	serio->write(serio, 0);
++	serio->write(serio, 0);
++	serio->write(serio, HIL_PKT_CMD >> 8);
++	serio->write(serio, HIL_CMD_RSC);
++	down(&(ptr->sem));
++
++	serio->write(serio, 0);
++	serio->write(serio, 0);
++	serio->write(serio, HIL_PKT_CMD >> 8);
++	serio->write(serio, HIL_CMD_RNM);
++	down(&(ptr->sem));
++
++	serio->write(serio, 0);
++	serio->write(serio, 0);
++	serio->write(serio, HIL_PKT_CMD >> 8);
++	serio->write(serio, HIL_CMD_EXD);
++	down(&(ptr->sem));
++
++	up(&(ptr->sem));
++
++	init_input_dev(&ptr->dev);
++	did = ptr->idd[0];
++	idd = ptr->idd + 1;
++	txt = "unknown";
++	if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) {
++		ptr->dev.evbit[0] = BIT(EV_REL);
++		txt = "relative";
++	}
++
++	if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) {
++		ptr->dev.evbit[0] = BIT(EV_ABS);
++		txt = "absolute";
++	}
++	if (!ptr->dev.evbit[0]) {
++		goto bail1;
++	}
++
++	ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd);
++	if (ptr->nbtn) ptr->dev.evbit[0] |= BIT(EV_KEY);
++
++	naxsets = HIL_IDD_NUM_AXSETS(*idd);
++	ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd);
++
++	printk(KERN_INFO PREFIX "HIL pointer device found (did: 0x%02x, axis: %s)\n",
++			did, txt);
++	printk(KERN_INFO PREFIX "HIL pointer has %i buttons and %i sets of %i axes\n",
++			ptr->nbtn, naxsets, ptr->naxes);
 +	
-+	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*)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*)scratch;
-+#ifdef __ARCH_SI_COMPAT_TRAPNO
-+		err |= __get_user(to->si_trapno, &from->si_trapno);
++	btntype = BTN_MISC;
++	if ((did & HIL_IDD_DID_ABS_TABLET_MASK) == HIL_IDD_DID_ABS_TABLET)
++#ifdef TABLET_SIMULATES_MOUSE
++		btntype = BTN_TOUCH;
++#else
++		btntype = BTN_DIGI;
 +#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*)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;
++	if ((did & HIL_IDD_DID_ABS_TSCREEN_MASK) == HIL_IDD_DID_ABS_TSCREEN)
++		btntype = BTN_TOUCH;
++		
++	if ((did & HIL_IDD_DID_REL_MOUSE_MASK) == HIL_IDD_DID_REL_MOUSE)
++		btntype = BTN_MOUSE;
++
++	for (i = 0; i < ptr->nbtn; i++) {
++		set_bit(btntype | i, ptr->dev.keybit);
++		ptr->btnmap[i] = btntype | i;
 +	}
-+	return err;
++
++	if (btntype == BTN_MOUSE) {
++		/* Swap buttons 2 and 3 */
++		ptr->btnmap[1] = BTN_MIDDLE;
++		ptr->btnmap[2] = BTN_RIGHT;
++	}
++
++	if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) {
++		for (i = 0; i < ptr->naxes; i++) {
++			set_bit(REL_X + i, ptr->dev.relbit);
++		}
++		for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) {
++			set_bit(REL_X + i, ptr->dev.relbit);
++		}
++	} else {
++		for (i = 0; i < ptr->naxes; i++) {
++	  		set_bit(ABS_X + i, ptr->dev.absbit);
++			ptr->dev.absmin[ABS_X + i] = 0;
++			ptr->dev.absmax[ABS_X + i] = 
++				HIL_IDD_AXIS_MAX((ptr->idd + 1), i);
++		}
++		for (i = 3; (i < ptr->naxes + 3) && (naxsets > 1); i++) {
++			set_bit(ABS_X + i, ptr->dev.absbit);
++			ptr->dev.absmin[ABS_X + i] = 0;
++			ptr->dev.absmax[ABS_X + i] = 
++				HIL_IDD_AXIS_MAX((ptr->idd + 1), (i - 3));
++		}
++#ifdef TABLET_AUTOADJUST
++		for (i = 0; i < ABS_MAX; i++) {
++			int diff = ptr->dev.absmax[ABS_X + i] / 10;
++			ptr->dev.absmin[ABS_X + i] += diff;
++			ptr->dev.absmax[ABS_X + i] -= diff;
++		}
++#endif
++	}
++
++	ptr->dev.name = strlen(ptr->rnm) ? ptr->rnm : HIL_GENERIC_NAME;
++
++	ptr->dev.id.bustype = BUS_HIL;
++	ptr->dev.id.vendor = PCI_VENDOR_ID_HP;
++	ptr->dev.id.product = 0x0001; /* TODO: get from ptr->rsc */
++	ptr->dev.id.version = 0x0100; /* TODO: get from ptr->rsc */
++
++	input_register_device(&ptr->dev);
++	printk(KERN_INFO "input: %s (%s), ID: %d\n",
++                ptr->dev.name, 
++		(btntype == BTN_MOUSE) ? "HIL mouse":"HIL tablet or touchpad",
++		did);
++
++	return;
++ bail1:
++	serio_close(serio);
++ bail0:
++	kfree(ptr);
++	return;
 +}
 +
-+#endif
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.c
++
++static struct serio_dev hil_ptr_serio_dev = {
++	.connect =	hil_ptr_connect,
++	.disconnect =	hil_ptr_disconnect,
++	.interrupt =	hil_ptr_interrupt
++};
++
++static int __init hil_ptr_init(void)
++{
++	serio_register_device(&hil_ptr_serio_dev);
++        return 0;
++}
++                
++static void __exit hil_ptr_exit(void)
++{
++	serio_unregister_device(&hil_ptr_serio_dev);
++}
++                        
++module_init(hil_ptr_init);
++module_exit(hil_ptr_exit);
+Index: debian-kernel-hppa-2.6.8/drivers/input/serio/Kconfig
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_hipd.c	2005-01-15 20:14:07.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.c	2005-01-15 20:15:11.000000000 -0500
-@@ -3,6 +3,7 @@
-  * of PCI-SCSI IO processors.
-  *
-  * Copyright (C) 1999-2001  Gerard Roudier <groudier at free.fr>
-+ * Copyright (c) 2003-2004  Matthew Wilcox <matthew at wil.cx>
-  *
-  * This driver is derived from the Linux sym53c8xx driver.
-  * Copyright (C) 1998-2000  Gerard Roudier
-@@ -22,35 +23,22 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-- *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-- *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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.  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
-  */
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/serio/Kconfig	2004-08-14 01:36:59.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/serio/Kconfig	2005-02-01 01:38:33.000000000 -0500
+@@ -111,6 +111,32 @@
+ 	  To compile this driver as a module, choose M here: the
+ 	  module will be called gscps2.
  
--#define SYM_VERSION "2.1.18j"
-+#define SYM_VERSION "2.1.18k"
- #define SYM_DRIVER_NAME	"sym-" SYM_VERSION
++config HP_SDC
++	tristate "HP System Device Controller i8042 Support"
++	depends on GSC && SERIO
++	default y
++	---help---
++	  This option enables supports for the the "System Device
++	  Controller", an i8042 carrying microcode to manage a
++	  few miscellanous devices on some Hewlett Packard systems.
++	  The SDC itself contains a 10ms resolution timer/clock capable
++	  of delivering interrupts on a periodic and one-shot basis.
++	  The SDC may also be connected to a battery-backed real-time
++	  clock, a basic audio waveform generator, and an HP-HIL Master
++	  Link Controller serving up to seven input devices.
++
++	  By itself this option is rather useless, but enabling it will
++	  enable selection of drivers for the abovementioned devices.
++	  It is, however, incompatible with the old, reliable HIL keyboard
++	  driver, and the new HIL driver is experimental, so if you plan
++	  to use a HIL keyboard as your primary keyboard, you may wish
++	  to keep using that driver until the new HIL drivers have had
++	  more testing.
++
++config HIL_MLC
++	tristate "HIL MLC Support (needed for HIL input devices)"
++	depends on HP_SDC
++
+ config SERIO_PCIPS2
+ 	tristate "PCI PS/2 keyboard and PS/2 mouse controller"
+ 	depends on PCI && SERIO
+Index: debian-kernel-hppa-2.6.8/drivers/input/serio/Makefile
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/serio/Makefile	2004-08-14 01:36:13.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/serio/Makefile	2005-02-01 01:38:33.000000000 -0500
+@@ -2,8 +2,6 @@
+ # Makefile for the input core drivers.
+ #
  
- #include "sym_glue.h"
-@@ -303,7 +291,6 @@
- 	}
- out:
- 	OUTB (nc_scntl1, 0);
--	/* MDELAY(100); */
- 	return retv;
- }
+-# Each configuration option enables a list of files.
+-
+ obj-$(CONFIG_SERIO)		+= serio.o
+ obj-$(CONFIG_SERIO_I8042)	+= i8042.o
+ obj-$(CONFIG_SERIO_PARKBD)	+= parkbd.o
+@@ -15,5 +13,7 @@
+ obj-$(CONFIG_SERIO_Q40KBD)	+= q40kbd.o
+ obj-$(CONFIG_SERIO_98KBD)	+= 98kbd-io.o
+ obj-$(CONFIG_SERIO_GSCPS2)	+= gscps2.o
++obj-$(CONFIG_HP_SDC)		+= hp_sdc.o
++obj-$(CONFIG_HIL_MLC)		+= hp_sdc_mlc.o hil_mlc.o
+ obj-$(CONFIG_SERIO_PCIPS2)	+= pcips2.o
+ obj-$(CONFIG_SERIO_MACEPS2)	+= maceps2.o
+Index: debian-kernel-hppa-2.6.8/drivers/input/serio/gscps2.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/input/serio/gscps2.c	2004-08-14 01:38:09.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/input/serio/gscps2.c	2005-02-01 01:38:32.000000000 -0500
+@@ -38,7 +38,7 @@
+ #include <asm/parisc-device.h>
  
-@@ -1921,7 +1908,7 @@
- 	if (np->features & (FE_ULTRA2|FE_ULTRA3)) {
- 		OUTONW (nc_sien, SBMC);
- 		if (reason == 0) {
--			MDELAY(100);
-+			mdelay(100);
- 			INW (nc_sist);
- 		}
- 		np->scsi_mode = INB (nc_stest4) & SMODE;
-@@ -5510,7 +5497,6 @@
- 		printf ("CCB=%lx STAT=%x/%x/%x DEV=%d/%d\n", (unsigned long)cp,
- 			cp->host_status, cp->ssss_status, cp->host_flags,
- 			cp->target, cp->lun);
--		MDELAY(100);
- 	}
+ MODULE_AUTHOR("Laurent Canet <canetl at esiee.fr>, Thibaut Varene <varenet at esiee.fr>, Helge Deller <deller at gmx.de>");
+-MODULE_DESCRIPTION("HP GSC PS/2 port driver");
++MODULE_DESCRIPTION("HP GSC PS2 port driver");
+ MODULE_LICENSE("GPL");
+ MODULE_DEVICE_TABLE(parisc, gscps2_device_tbl);
  
- 	/*
-@@ -5738,15 +5724,8 @@
- /*
-  *  Soft-attach the controller.
-  */
--#ifdef SYM_OPT_NVRAM_PRE_READ
- int sym_hcb_attach(hcb_p np, struct sym_fw *fw, struct sym_nvram *nvram)
--#else
--int sym_hcb_attach(hcb_p np, struct sym_fw *fw)
--#endif
+@@ -325,7 +325,7 @@
+ 
+ static struct serio gscps2_serio_port =
  {
--#ifndef SYM_OPT_NVRAM_PRE_READ
--	struct sym_nvram nvram_buf, *nvram = &nvram_buf;
--#endif
- 	int i;
+-	.name =		"GSC PS/2",
++	.name =		"GSC PS2",
+ 	.idbus =	BUS_GSC,
+ 	.idvendor =	PCI_VENDOR_ID_HP,
+ 	.idproduct =	0x0001,
+@@ -447,7 +447,7 @@
+ };
  
- 	/*
-@@ -5773,13 +5752,6 @@
- 	sym_chip_reset (np);
- 
- 	/*
--	 *  Try to read the user set-up.
--	 */
--#ifndef SYM_OPT_NVRAM_PRE_READ
--	(void) sym_read_nvram(np, nvram);
--#endif
--
--	/*
- 	 *  Prepare controller and devices settings, according 
- 	 *  to chip features, user set-up and driver set-up.
- 	 */
+ static struct parisc_driver parisc_ps2_driver = {
+-	.name		= "GSC PS/2",
++	.name		= "GSC PS2",
+ 	.id_table	= gscps2_device_tbl,
+ 	.probe		= gscps2_probe,
+ 	.remove		= gscps2_remove,
 Index: debian-kernel-hppa-2.6.8/drivers/input/serio/hil_mlc.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/drivers/input/serio/hil_mlc.c	2005-01-15 20:15:11.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/input/serio/hil_mlc.c	2005-02-01 01:38:33.000000000 -0500
 @@ -0,0 +1,951 @@
 +/*
 + * HIL MLC state machine and serio interface driver
@@ -5650,2353 +7124,10 @@
 +                        
 +module_init(hil_mlc_init);
 +module_exit(hil_mlc_exit);
-Index: debian-kernel-hppa-2.6.8/drivers/input/misc/Kconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/misc/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/misc/Kconfig	2005-01-15 20:15:11.000000000 -0500
-@@ -50,3 +50,11 @@
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called uinput.
- 
-+config HP_SDC_RTC
-+	tristate "HP SDC Real Time Clock"
-+	depends on INPUT && INPUT_MISC && GSC
-+	select HP_SDC
-+	help
-+	  Say Y here if you want to support the built-in real time clock
-+	  of the HP SDC controller.
-+
-Index: debian-kernel-hppa-2.6.8/drivers/input/serio/Kconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/serio/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/serio/Kconfig	2005-01-15 20:15:11.000000000 -0500
-@@ -111,6 +111,32 @@
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called gscps2.
- 
-+config HP_SDC
-+	tristate "HP System Device Controller i8042 Support"
-+	depends on GSC && SERIO
-+	default y
-+	---help---
-+	  This option enables supports for the the "System Device
-+	  Controller", an i8042 carrying microcode to manage a
-+	  few miscellanous devices on some Hewlett Packard systems.
-+	  The SDC itself contains a 10ms resolution timer/clock capable
-+	  of delivering interrupts on a periodic and one-shot basis.
-+	  The SDC may also be connected to a battery-backed real-time
-+	  clock, a basic audio waveform generator, and an HP-HIL Master
-+	  Link Controller serving up to seven input devices.
-+
-+	  By itself this option is rather useless, but enabling it will
-+	  enable selection of drivers for the abovementioned devices.
-+	  It is, however, incompatible with the old, reliable HIL keyboard
-+	  driver, and the new HIL driver is experimental, so if you plan
-+	  to use a HIL keyboard as your primary keyboard, you may wish
-+	  to keep using that driver until the new HIL drivers have had
-+	  more testing.
-+
-+config HIL_MLC
-+	tristate "HIL MLC Support (needed for HIL input devices)"
-+	depends on HP_SDC
-+
- config SERIO_PCIPS2
- 	tristate "PCI PS/2 keyboard and PS/2 mouse controller"
- 	depends on PCI && SERIO
-Index: debian-kernel-hppa-2.6.8/arch/parisc/configs/a500_defconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/configs/a500_defconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/configs/a500_defconfig	2005-01-15 20:15:11.000000000 -0500
-@@ -11,7 +11,6 @@
- #
- CONFIG_EXPERIMENTAL=y
- # CONFIG_CLEAN_COMPILE is not set
--# CONFIG_STANDALONE is not set
- CONFIG_BROKEN=y
- CONFIG_BROKEN_ON_SMP=y
- 
-@@ -31,6 +30,7 @@
- CONFIG_EMBEDDED=y
- CONFIG_KALLSYMS=y
- CONFIG_KALLSYMS_ALL=y
-+# CONFIG_KALLSYMS_EXTRA_PASS is not set
- CONFIG_FUTEX=y
- CONFIG_EPOLL=y
- CONFIG_IOSCHED_NOOP=y
-@@ -48,6 +48,7 @@
- CONFIG_OBSOLETE_MODPARM=y
- # CONFIG_MODVERSIONS is not set
- CONFIG_KMOD=y
-+CONFIG_STOP_MACHINE=y
- 
- #
- # Processor type and features
-@@ -61,9 +62,12 @@
- CONFIG_PREFETCH=y
- CONFIG_PARISC64=y
- CONFIG_64BIT=y
--# CONFIG_SMP is not set
-+CONFIG_SMP=y
-+CONFIG_HOTPLUG_CPU=y
-+# CONFIG_DISCONTIGMEM is not set
- # CONFIG_PREEMPT is not set
- CONFIG_COMPAT=y
-+CONFIG_NR_CPUS=4
- 
- #
- # Bus options (PCI, PCMCIA, EISA, GSC, ISA)
-@@ -86,6 +90,7 @@
- CONFIG_PCMCIA_DEBUG=y
- CONFIG_YENTA=m
- CONFIG_CARDBUS=y
-+# CONFIG_PD6729 is not set
- # CONFIG_I82092 is not set
- # CONFIG_TCIC is not set
- 
-@@ -107,6 +112,8 @@
- #
- # Generic Driver Options
- #
-+# CONFIG_STANDALONE is not set
-+CONFIG_PREVENT_FIRMWARE_BUILD=y
- # CONFIG_FW_LOADER is not set
- CONFIG_DEBUG_DRIVER=y
- 
-@@ -135,7 +142,7 @@
- CONFIG_BLK_DEV_LOOP=y
- # CONFIG_BLK_DEV_CRYPTOLOOP is not set
- # CONFIG_BLK_DEV_NBD is not set
--# CONFIG_BLK_DEV_CARMEL is not set
-+# CONFIG_BLK_DEV_SX8 is not set
- CONFIG_BLK_DEV_RAM=y
- CONFIG_BLK_DEV_RAM_SIZE=6144
- CONFIG_BLK_DEV_INITRD=y
-@@ -165,7 +172,6 @@
- # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
- #
- CONFIG_SCSI_MULTI_LUN=y
--CONFIG_SCSI_REPORT_LUNS=y
- # CONFIG_SCSI_CONSTANTS is not set
- # CONFIG_SCSI_LOGGING is not set
- 
-@@ -179,6 +185,7 @@
- # SCSI low-level drivers
- #
- # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
-+# CONFIG_SCSI_3W_9XXX is not set
- # CONFIG_SCSI_ACARD is not set
- # CONFIG_SCSI_AACRAID is not set
- # CONFIG_SCSI_AIC7XXX is not set
-@@ -353,6 +360,8 @@
- # CONFIG_IP_NF_COMPAT_IPFWADM is not set
- CONFIG_IP_NF_TARGET_NOTRACK=m
- CONFIG_IP_NF_RAW=m
-+# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
-+# CONFIG_IP_NF_MATCH_REALM is not set
- CONFIG_XFRM=y
- CONFIG_XFRM_USER=m
- 
-@@ -379,6 +388,7 @@
- # QoS and/or fair queueing
- #
- # CONFIG_NET_SCHED is not set
-+# CONFIG_NET_CLS_ROUTE is not set
- 
- #
- # Network testing
-@@ -452,6 +462,7 @@
- # CONFIG_SUNDANCE is not set
- CONFIG_VIA_RHINE=m
- CONFIG_VIA_RHINE_MMIO=y
-+# CONFIG_VIA_VELOCITY is not set
- 
- #
- # Ethernet (1000 Mbit)
-@@ -501,7 +512,6 @@
- #
- # Wireless 802.11b ISA/PCI cards support
- #
--# CONFIG_AIRO is not set
- CONFIG_HERMES=m
- CONFIG_PLX_HERMES=m
- CONFIG_TMD_HERMES=m
-@@ -644,7 +654,6 @@
- #
- # Ftape, the floppy tape device driver
- #
--# CONFIG_FTAPE is not set
- # CONFIG_AGP is not set
- # CONFIG_DRM is not set
- 
-@@ -661,6 +670,11 @@
- # CONFIG_I2C is not set
- 
- #
-+# Dallas's 1-wire bus
-+#
-+# CONFIG_W1 is not set
-+
-+#
- # Misc devices
- #
- 
-@@ -734,6 +748,7 @@
- CONFIG_JOLIET=y
- # CONFIG_ZISOFS is not set
- CONFIG_UDF_FS=m
-+CONFIG_UDF_NLS=y
- 
- #
- # DOS/FAT/NT Filesystems
-@@ -741,6 +756,8 @@
- CONFIG_FAT_FS=m
- CONFIG_MSDOS_FS=m
- CONFIG_VFAT_FS=m
-+CONFIG_FAT_DEFAULT_CODEPAGE=437
-+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
- # CONFIG_NTFS_FS is not set
- 
- #
-@@ -795,6 +812,9 @@
- CONFIG_SMB_NLS_DEFAULT=y
- CONFIG_SMB_NLS_REMOTE="cp437"
- CONFIG_CIFS=m
-+# CONFIG_CIFS_STATS is not set
-+# CONFIG_CIFS_XATTR is not set
-+# CONFIG_CIFS_POSIX is not set
- # CONFIG_NCP_FS is not set
- # CONFIG_CODA_FS is not set
- # CONFIG_AFS_FS is not set
-@@ -833,6 +853,7 @@
- # CONFIG_NLS_ISO8859_8 is not set
- # CONFIG_NLS_CODEPAGE_1250 is not set
- # CONFIG_NLS_CODEPAGE_1251 is not set
-+# CONFIG_NLS_ASCII is not set
- CONFIG_NLS_ISO8859_1=m
- CONFIG_NLS_ISO8859_2=m
- CONFIG_NLS_ISO8859_3=m
-@@ -860,6 +881,8 @@
- CONFIG_DEBUG_KERNEL=y
- # CONFIG_DEBUG_SLAB is not set
- CONFIG_MAGIC_SYSRQ=y
-+# CONFIG_DEBUG_SPINLOCK is not set
-+# CONFIG_DEBUG_RWLOCK is not set
- # CONFIG_FRAME_POINTER is not set
- # CONFIG_DEBUG_INFO is not set
- 
-@@ -886,7 +909,9 @@
- CONFIG_CRYPTO_AES=m
- CONFIG_CRYPTO_CAST5=m
- CONFIG_CRYPTO_CAST6=m
-+# CONFIG_CRYPTO_TEA is not set
- # CONFIG_CRYPTO_ARC4 is not set
-+# CONFIG_CRYPTO_KHAZAD is not set
- CONFIG_CRYPTO_DEFLATE=m
- # CONFIG_CRYPTO_MICHAEL_MIC is not set
- CONFIG_CRYPTO_CRC32C=m
-@@ -895,6 +920,7 @@
- #
- # Library routines
- #
-+CONFIG_CRC_CCITT=m
- CONFIG_CRC32=y
- CONFIG_LIBCRC32C=m
- CONFIG_ZLIB_INFLATE=m
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_hipd.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.h	2005-01-15 20:15:11.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
-  */
- 
- #ifndef SYM_HIPD_H
-@@ -1139,12 +1126,7 @@
- int sym_abort_ccb(hcb_p np, ccb_p cp, int timed_out);
- int sym_reset_scsi_target(hcb_p np, int target);
- void sym_hcb_free(hcb_p np);
--
--#ifdef SYM_OPT_NVRAM_PRE_READ
- int sym_hcb_attach(hcb_p np, struct sym_fw *fw, struct sym_nvram *nvram);
--#else
--int sym_hcb_attach(hcb_p np, struct sym_fw *fw);
--#endif
- 
- /*
-  *  Optionnaly, the driver may handle IO timeouts.
-@@ -1388,7 +1370,6 @@
- #define PRINT_ADDR	sym_print_addr
- #define PRINT_TARGET	sym_print_target
- #define PRINT_LUN	sym_print_lun
--#define MDELAY		sym_mdelay
- #define UDELAY		sym_udelay
- 
- #endif /* SYM_HIPD_H */
-Index: debian-kernel-hppa-2.6.8/include/linux/compat.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/linux/compat.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/linux/compat.h	2005-01-15 20:15:11.000000000 -0500
-@@ -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 compat_itimerspec { 
- 	struct compat_timespec it_interval;
- 	struct compat_timespec it_value;
-@@ -86,27 +97,6 @@
- 	char		d_name[256];
- };
- 
--typedef union compat_sigval {
--	compat_int_t	sival_int;
--	compat_uptr_t	sival_ptr;
--} compat_sigval_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[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);
- long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
-Index: debian-kernel-hppa-2.6.8/drivers/pcmcia/Kconfig
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/pcmcia/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/pcmcia/Kconfig	2005-01-15 20:15:11.000000000 -0500
-@@ -136,7 +136,7 @@
- 
- config PCMCIA_PROBE
- 	bool
--	default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X
-+	default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X && !PARISC
- 
- endmenu
- 
-Index: debian-kernel-hppa-2.6.8/arch/parisc/lib/debuglocks.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/lib/debuglocks.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/lib/debuglocks.c	2005-01-15 20:15:11.000000000 -0500
-@@ -18,6 +18,11 @@
-  *    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
-+ *
-+ *    We use pdc_printf() throughout the file for all output messages, to avoid
-+ *    losing messages because of disabled interrupts. Since we're using these
-+ *    messages for debugging purposes, it makes sense not to send them to the
-+ *    linux console.
-  */
- 
- 
-@@ -27,12 +32,14 @@
- #include <linux/spinlock.h>
- #include <asm/system.h>
- #include <asm/hardirq.h>	/* in_interrupt() */
-+#include <asm/pdc.h>
- 
- #undef INIT_STUCK
- #define INIT_STUCK 1L << 30
- 
- #ifdef CONFIG_DEBUG_SPINLOCK
- 
-+
- void _dbg_spin_lock(spinlock_t * lock, const char *base_file, int line_no)
- {
- 	volatile unsigned int *a;
-@@ -59,12 +66,14 @@
- 	 * <tausq> __ldcw() returns 1 if we get the lock; otherwise we
- 	 * 	spin until the value of the lock changes, or we time out.
- 	 */
-+	mb();
- 	a = __ldcw_align(lock);
- 	while (stuck && (__ldcw(a) == 0))
- 		while ((*a == 0) && --stuck);
-+	mb();
- 
- 	if (unlikely(stuck <= 0)) {
--		printk(KERN_WARNING
-+		pdc_printf(
- 			"%s:%d: spin_lock(%s/%p) stuck in %s at %p(%d)"
- 			" owned by %s:%d in %s at %p(%d)\n",
- 			base_file, line_no, lock->module, lock,
-@@ -84,7 +93,7 @@
- 	lock->bline = line_no;
- 
- 	if (unlikely(printed)) {
--		printk(KERN_WARNING
-+		pdc_printf(
- 			"%s:%d: spin_lock grabbed in %s at %p(%d) %ld ticks\n",
- 			base_file, line_no, current->comm, inline_pc,
- 			cpu, jiffies - started);
-@@ -94,21 +103,28 @@
- void _dbg_spin_unlock(spinlock_t * lock, const char *base_file, int line_no)
- {
- 	CHECK_LOCK(lock);
--	volatile unsigned int *a = __ldcw_align(lock);
-+	volatile unsigned int *a;
-+	mb();
-+	a = __ldcw_align(lock);
- 	if (unlikely((*a != 0) && lock->babble)) {
- 		lock->babble--;
--		printk(KERN_WARNING
-+		pdc_printf(
- 			"%s:%d: spin_unlock(%s:%p) not locked\n",
- 			base_file, line_no, lock->module, lock);
- 	}
- 	*a = 1;	
-+	mb();
- }
- 
- int _dbg_spin_trylock(spinlock_t * lock, const char *base_file, int line_no)
- {
- 	int ret;
--	volatile unsigned int *a = __ldcw_align(lock);
--	if ((ret = (__ldcw(a) != 0))) {
-+	volatile unsigned int *a;
-+	mb();
-+	a = __ldcw_align(lock);
-+	ret = (__ldcw(a) != 0);
-+	mb();
-+	if (ret) {
- 		lock->oncpu = smp_processor_id();
- 		lock->previous = __builtin_return_address(0);
- 		lock->task = current;
-@@ -150,7 +166,7 @@
- 	int cpu = smp_processor_id();
- 	
- 	if(unlikely(in_interrupt())) {	/* acquiring write lock in interrupt context, bad idea */
--		printk(KERN_WARNING "write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline);
-+		pdc_printf("write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline);
- 		BUG();
- 	}
- 
-@@ -167,7 +183,7 @@
- 		
- 		stuck--;
- 		if ((unlikely(stuck <= 0)) && (rw->counter < 0)) {
--			printk(KERN_WARNING
-+			pdc_printf(
- 				"%s:%d: write_lock stuck on writer"
- 				" in %s at %p(%d) %ld ticks\n",
- 				bfile, bline, current->comm, inline_pc,
-@@ -176,7 +192,7 @@
- 			printed = 1;
- 		}
- 		else if (unlikely(stuck <= 0)) {
--			printk(KERN_WARNING
-+			pdc_printf(
- 				"%s:%d: write_lock stuck on reader"
- 				" in %s at %p(%d) %ld ticks\n",
- 				bfile, bline, current->comm, inline_pc,
-@@ -194,7 +210,7 @@
- 	rw->counter = -1; /* remember we are locked */
- 
- 	if (unlikely(printed)) {
--		printk(KERN_WARNING
-+		pdc_printf(
- 			"%s:%d: write_lock grabbed in %s at %p(%d) %ld ticks\n",
- 			bfile, bline, current->comm, inline_pc,
- 			cpu, jiffies - started);
-@@ -215,7 +231,7 @@
- 
- 	rw->counter++;
- #if 0
--	printk(KERN_WARNING
-+	pdc_printf(
- 		"%s:%d: read_lock grabbed in %s at %p(%d) %ld ticks\n",
- 		bfile, bline, current->comm, inline_pc,
- 		cpu, jiffies - started);
-Index: debian-kernel-hppa-2.6.8/include/asm-parisc/spinlock.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/spinlock.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/spinlock.h	2005-01-15 20:15:12.000000000 -0500
-@@ -27,21 +27,35 @@
- 
- static inline void _raw_spin_lock(spinlock_t *x)
- {
--	volatile unsigned int *a = __ldcw_align(x);
-+	volatile unsigned int *a;
-+
-+	mb();
-+	a = __ldcw_align(x);
- 	while (__ldcw(a) == 0)
- 		while (*a == 0);
-+	mb();
- }
- 
- static inline void _raw_spin_unlock(spinlock_t *x)
- {
--	volatile unsigned int *a = __ldcw_align(x);
-+	volatile unsigned int *a;
-+	mb();
-+	a = __ldcw_align(x);
- 	*a = 1;
-+	mb();
- }
- 
- static inline int _raw_spin_trylock(spinlock_t *x)
- {
--	volatile unsigned int *a = __ldcw_align(x);
--	return __ldcw(a) != 0;
-+	volatile unsigned int *a;
-+	int ret;
-+
-+	mb();
-+	a = __ldcw_align(x);
-+        ret = __ldcw(a) != 0;
-+	mb();
-+
-+	return ret;
- }
- 	
- #define spin_lock_own(LOCK, LOCATION)	((void)0)
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_asm.S
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/perf_asm.S	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/perf_asm.S	2005-01-15 20:15:12.000000000 -0500
-@@ -1,18 +1,19 @@
- 
- /*    low-level asm for "intrigue" (PA8500-8700 CPU perf counters)
-- *
-+ * 
-  *    Copyright (C) 2001 Randolph Chung <tausq at parisc-linux.org>
-- *
-+ *    Copyright (C) 2001 Hewlett-Packard (Grant Grundler)
-+ * 
-  *    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.  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
-@@ -48,7 +49,7 @@
- 	.proc
- 	.callinfo  frame=0,NO_CALLS
- 	.entry
--	
-+
- 	ldi     0x20,%r25                ; load up perfmon bit
- 	mfctl   ccr,%r26                 ; get coprocessor register
- 	or      %r25,%r26,%r26             ; set bit
-@@ -87,35 +88,35 @@
- 	.exit
- 	.procend
- 
--;************************************************************************
--;*																		*
--;* Name: perf_rdr_shift_in_W												*
--;*																		*
--;* Description:															*
--;*	This routine shifts data in from the RDR in arg0 and returns		*
--;*	the result in ret0.  If the RDR is <= 64 bits in length, it			*
--;*	is shifted shifted backup immediately.  This is to compensate		*
--;*	for RDR10 which has bits that preclude PDC stack operations			*
--;*	when they are in the wrong state.									*
--;*																		*
--;* Arguments:															*
--;*	arg0 : rdr to be read												*
--;*	arg1 : bit length of rdr											*
--;*																		*
--;* Returns:																*
--;*	ret0 = next 64 bits of rdr data from staging register				*
--;*																		*
--;* Register usage:														*
--;*	arg0 : rdr to be read												*
--;*	arg1 : bit length of rdr											*
--;*	%r24  - original DR2 value											*
--;*	%r1   - scratch														*
--;*  %r29  - scratch														*
--;*																		*
--;* Returns:																*
--;*	ret0 = RDR data (right justified)									*
--;*																		*
--;************************************************************************
-+;***********************************************************************
-+;*
-+;* Name: perf_rdr_shift_in_W
-+;*
-+;* Description:
-+;*	This routine shifts data in from the RDR in arg0 and returns
-+;*	the result in ret0.  If the RDR is <= 64 bits in length, it
-+;*	is shifted shifted backup immediately.  This is to compensate
-+;*	for RDR10 which has bits that preclude PDC stack operations
-+;*	when they are in the wrong state.
-+;*
-+;* Arguments:
-+;*	arg0 : rdr to be read
-+;*	arg1 : bit length of rdr
-+;*
-+;* Returns:
-+;*	ret0 = next 64 bits of rdr data from staging register
-+;*
-+;* Register usage:
-+;*	arg0 : rdr to be read
-+;*	arg1 : bit length of rdr
-+;*	%r24  - original DR2 value
-+;*	%r1   - scratch
-+;*  %r29  - scratch
-+;*
-+;* Returns:
-+;*	ret0 = RDR data (right justified)
-+;*
-+;***********************************************************************
- 
- 	.export perf_rdr_shift_in_W,code
- perf_rdr_shift_in_W:
-@@ -138,7 +139,7 @@
- 	nop
- 	nop
- 	nop
--	nop	
-+	nop
- 
- ;
- ; Cacheline start (32-byte cacheline)
-@@ -146,11 +147,11 @@
- 	nop
- 	nop
- 	nop
--	extrd,u		arg1,63,6,%r1    ; setup shift amount based on bits to move 
-+	extrd,u		arg1,63,6,%r1	; setup shift amount by bits to move 
- 
- 	mtsar		%r1
- 	shladd		arg0,2,%r0,%r1	; %r1 = 4 * RDR number
--	blr  		%r1,%r0		    ; branch to 8-instruction sequence
-+	blr  		%r1,%r0		; branch to 8-instruction sequence
- 	nop
- 
- ;
-@@ -160,19 +161,19 @@
- 	;
- 	; RDR 0 sequence
- 	;
--	SFDIAG		(0)		
-+	SFDIAG		(0)
- 	ssm		    0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
--	MTDIAG_1	(1)					; mtdiag %dr1, %r1 
-+	MTDIAG_1	(1)			; mtdiag %dr1, %r1 
- 	STDIAG		(0)
- 	ssm		    0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 1 sequence
- 	;
--	sync			
-+	sync
- 	ssm		    0,0
- 	SFDIAG		(1)
- 	ssm		    0,0
-@@ -180,11 +181,11 @@
- 	ssm		    0,0
- 	b,n         perf_rdr_shift_in_W_leave
- 	nop
--	
-+
- 	;
- 	; RDR 2 read sequence
- 	;
--	SFDIAG		(2)		
-+	SFDIAG		(2)
- 	ssm		    0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
-@@ -192,7 +193,7 @@
- 	STDIAG		(2)
- 	ssm		    0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 3 read sequence
- 	;
-@@ -208,39 +209,39 @@
- 	;
- 	; RDR 4 read sequence
- 	;
--	sync				
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(4)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	; 
- 	; RDR 5 read sequence
- 	;
--	sync	
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(5)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 6 read sequence
- 	;
--	sync	
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(6)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 7 read sequence
- 	;
-@@ -281,26 +282,26 @@
- 	; RDR 10 read sequence
- 	;
- 	SFDIAG		(10)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(10)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 11 read sequence
- 	;
- 	SFDIAG		(11)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(11)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 12 read sequence
- 	;
-@@ -317,77 +318,77 @@
- 	; RDR 13 read sequence
- 	;
- 	sync
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(13)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 14 read sequence
- 	;
--	SFDIAG		(14)	
--	ssm			0,0
-+	SFDIAG		(14)
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(14)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 15 read sequence
- 	;
--	sync				; RDR 15 read sequence
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(15)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
- 	nop
--	
-+
- 	;
- 	; RDR 16 read sequence
- 	;
--	sync				; RDR 16 read sequence
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(16)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 17 read sequence
- 	;
--	SFDIAG		(17)	
--	ssm			0,0
-+	SFDIAG		(17)
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(17)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 18 read sequence
- 	;
--	SFDIAG		(18)	
--	ssm			0,0
-+	SFDIAG		(18)
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(18)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
--;
--; RDR 19 read sequence
--;
-+
-+	;
-+	; RDR 19 read sequence
-+	;
- 	b,n         perf_rdr_shift_in_W_leave
- 	nop
- 	nop
-@@ -401,144 +402,144 @@
- 	; RDR 20 read sequence
- 	;
- 	sync
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(20)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 21 read sequence
- 	;
- 	sync
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(21)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 22 read sequence
- 	;
- 	sync
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(22)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 23 read sequence
- 	;
--	sync		
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(23)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 24 read sequence
- 	;
--	sync	
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(24)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 25 read sequence
- 	;
- 	sync
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(25)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 26 read sequence
- 	;
--	SFDIAG		(26)		
--	ssm			0,0
-+	SFDIAG		(26)
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(26)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 27 read sequence
- 	;
- 	SFDIAG		(27)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(27)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 28 read sequence
- 	;
--	sync				
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(28)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 29 read sequence
- 	;
--	sync		
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(29)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_W_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	;
- 	; RDR 30 read sequence
- 	;
- 	SFDIAG		(30)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(30)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_W_leave
--	
-+
- 	;
- 	; RDR 31 read sequence
- 	;
--	sync		
--	ssm			0,0
-+	sync
-+	ssm		0,0
- 	SFDIAG		(31)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	;
-@@ -552,28 +553,28 @@
- 	.procend
- 
- 
--;************************************************************************
--;*																		*
--;* Name: perf_rdr_shift_out_W												*
--;*																		*
--;* Description:															*
--;*	This routine moves data to the RDR's.  The double-word that			*
--;*	arg1 points to is loaded and moved into the staging register.		*
--;*	Then the STDIAG instruction for the RDR # in arg0 is called			*
--;*	to move the data to the RDR.										*
--;*																		*
--;* Arguments:															*
--;*	arg0 = rdr number													*
--;*	arg1 = 64-bit value to write										*
--;*	%r24 - DR2 | DR2_SLOW_RET											*
--;*	%r23 - original DR2 value											*
--;*																		*
--;* Returns:																*
--;*	None																*
--;*																		*
--;* Register usage:														*
--;*																		*
--;************************************************************************
-+;***********************************************************************
-+;*
-+;* Name: perf_rdr_shift_out_W
-+;*
-+;* Description:
-+;*	This routine moves data to the RDR's.  The double-word that
-+;*	arg1 points to is loaded and moved into the staging register.
-+;*	Then the STDIAG instruction for the RDR # in arg0 is called
-+;*	to move the data to the RDR.
-+;*
-+;* Arguments:
-+;*	arg0 = rdr number
-+;*	arg1 = 64-bit value to write
-+;*	%r24 - DR2 | DR2_SLOW_RET
-+;*	%r23 - original DR2 value
-+;*
-+;* Returns:
-+;*	None
-+;*
-+;* Register usage:
-+;*
-+;***********************************************************************
- 
- 	.export perf_rdr_shift_out_W,code
- perf_rdr_shift_out_W:
-@@ -587,24 +588,23 @@
- 
- 	depdi,z		1,DR2_SLOW_RET,1,%r24
- 	MFDIAG_2	(23)
--	or		     %r24,%r23,%r24
--	MTDIAG_2	(24)			; set DR2_SLOW_RET
--
--	MTDIAG_1	(25)			; data to the staging register
-+	or		%r24,%r23,%r24
-+	MTDIAG_2	(24)		; set DR2_SLOW_RET
-+	MTDIAG_1	(25)		; data to the staging register
- 	shladd		arg0,2,%r0,%r1	; %r1 = 4 * RDR number
--	blr		    %r1,%r0		    ; branch to 8-instruction sequence
-+	blr		    %r1,%r0	; branch to 8-instruction sequence
- 	nop
- 
- 	;
- 	; RDR 0 write sequence
- 	;
- 	sync				; RDR 0 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(0)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_W_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	;
-@@ -718,7 +718,7 @@
- 	;
- 	; RDR 10 write sequence
- 	;
--	sync	
-+	sync
- 	ssm		0,0
- 	STDIAG		(10)
- 	STDIAG		(26)
-@@ -862,7 +862,7 @@
- 	;
- 	; RDR 22 write sequence
- 	;
--	sync	
-+	sync
- 	ssm		0,0
- 	STDIAG		(22)
- 	ssm		0,0
-@@ -910,7 +910,7 @@
- 	;
- 	; RDR 26 write sequence
- 	;
--	sync	
-+	sync
- 	ssm		0,0
- 	STDIAG		(10)
- 	STDIAG		(26)
-@@ -958,7 +958,7 @@
- 	;
- 	; RDR 30 write sequence
- 	;
--	sync	
-+	sync
- 	ssm		0,0
- 	STDIAG		(30)
- 	ssm		0,0
-@@ -970,7 +970,7 @@
- 	;
- 	; RDR 31 write sequence
- 	;
--	sync				
-+	sync
- 	ssm		0,0
- 	STDIAG		(31)
- 	ssm		0,0
-@@ -986,34 +986,32 @@
- 	.procend
- 
- 
--;**************************** CHRIS ***********************************
--
--;************************************************************************
--;*																		*
--;* Name: rdr_shift_in_U													*
--;*																		*
--;* Description:															*
--;*	This routine shifts data in from the RDR in arg0 and returns		*
--;*	the result in ret0.  If the RDR is <= 64 bits in length, it			*
--;*	is shifted shifted backup immediately.  This is to compensate		*
--;*	for RDR10 which has bits that preclude PDC stack operations			*
--;*	when they are in the wrong state.									*
--;*																		*
--;* Arguments:															*
--;*	arg0 : rdr to be read												*
--;*	arg1 : bit length of rdr											*
--;*																		*
--;* Returns:																*
--;*	ret0 = next 64 bits of rdr data from staging register				*
--;*																		*
--;* Register usage:														*
--;*	arg0 : rdr to be read						                        *
--;*	arg1 : bit length of rdr					                        *
--;*	%r24 - original DR2 value											*
--;*	%r23 - DR2 | DR2_SLOW_RET											*
--;*	%r1  - scratch														*
--;*																		*
--;************************************************************************
-+;***********************************************************************
-+;*
-+;* Name: rdr_shift_in_U
-+;*
-+;* Description:
-+;*	This routine shifts data in from the RDR in arg0 and returns
-+;*	the result in ret0.  If the RDR is <= 64 bits in length, it
-+;*	is shifted shifted backup immediately.  This is to compensate
-+;*	for RDR10 which has bits that preclude PDC stack operations
-+;*	when they are in the wrong state.
-+;*
-+;* Arguments:
-+;*	arg0 : rdr to be read
-+;*	arg1 : bit length of rdr
-+;*
-+;* Returns:
-+;*	ret0 = next 64 bits of rdr data from staging register
-+;*
-+;* Register usage:
-+;*	arg0 : rdr to be read						                        
-+;*	arg1 : bit length of rdr					                        
-+;*	%r24 - original DR2 value
-+;*	%r23 - DR2 | DR2_SLOW_RET
-+;*	%r1  - scratch
-+;*
-+;***********************************************************************
- 
- 	.export perf_rdr_shift_in_U,code
- perf_rdr_shift_in_U:
-@@ -1053,75 +1051,75 @@
- ; Start of next 32-byte cacheline
- ;
- 	SFDIAG		(0)		; RDR 0 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(0)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(1)		; RDR 1 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(1)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	sync				; RDR 2 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(4)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 3 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(3)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 4 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(4)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 5 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(5)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 6 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(6)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 7 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(7)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	b,n         perf_rdr_shift_in_U_leave
-@@ -1134,95 +1132,95 @@
- 	nop
- 
- 	SFDIAG		(9)		; RDR 9 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(9)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
- 
- 	SFDIAG		(10)		; RDR 10 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(10)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(11)		; RDR 11 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(11)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(12)		; RDR 12 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(12)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
- 
- 	SFDIAG		(13)		; RDR 13 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(13)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(14)		; RDR 14 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(14)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(15)		; RDR 15 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(15)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	sync				; RDR 16 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(16)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	SFDIAG		(17)		; RDR 17 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(17)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(18)		; RDR 18 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(18)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	b,n         perf_rdr_shift_in_U_leave
- 	nop
- 	nop
-@@ -1233,86 +1231,86 @@
- 	nop
- 
- 	sync				; RDR 20 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(20)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 21 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(21)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 22 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(22)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 23 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(23)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 24 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(24)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	sync				; RDR 25 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(25)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	SFDIAG		(26)		; RDR 26 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(26)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(27)		; RDR 27 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(27)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	sync				; RDR 28 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	SFDIAG		(28)
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	b,n         perf_rdr_shift_in_U_leave
--	ssm			0,0
-+	ssm		0,0
- 	nop
--	
-+
- 	b,n         perf_rdr_shift_in_U_leave
- 	nop
- 	nop
-@@ -1321,23 +1319,23 @@
- 	nop
- 	nop
- 	nop
--	
-+
- 	SFDIAG		(30)		; RDR 30 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(30)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
--	
-+
- 	SFDIAG		(31)		; RDR 31 read sequence
--	ssm			0,0
-+	ssm		0,0
- 	MFDIAG_1	(28)
- 	shrpd		ret0,%r0,%sar,%r1
- 	MTDIAG_1	(1)
- 	STDIAG		(31)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_in_U_leave
- 	nop
- 
-@@ -1347,30 +1345,30 @@
- 	MTDIAG_2	(24)			; restore DR2
- 	.procend
- 
--;************************************************************************
--;*																		*
--;* Name: rdr_shift_out_U												*
--;*																		*
--;* Description:															*
--;*	This routine moves data to the RDR's.  The double-word that			*
--;*	arg1 points to is loaded and moved into the staging register.		*
--;*	Then the STDIAG instruction for the RDR # in arg0 is called			*
--;*	to move the data to the RDR.										*
--;*																		*
--;* Arguments:															*
--;*	arg0 = rdr target													*
--;*	arg1 = buffer pointer												*
--;*																		*
--;* Returns:																*
--;*	None																*
--;*																		*
--;* Register usage:														*
--;*	arg0 = rdr target													*
--;*	arg1 = buffer pointer												*
--;*	%r24 - DR2 | DR2_SLOW_RET											*
--;*	%r23 - original DR2 value											*
--;*																		*
--;************************************************************************
-+;***********************************************************************
-+;*
-+;* Name: rdr_shift_out_U
-+;*
-+;* Description:
-+;*	This routine moves data to the RDR's.  The double-word that
-+;*	arg1 points to is loaded and moved into the staging register.
-+;*	Then the STDIAG instruction for the RDR # in arg0 is called
-+;*	to move the data to the RDR.
-+;*
-+;* Arguments:
-+;*	arg0 = rdr target
-+;*	arg1 = buffer pointer
-+;*
-+;* Returns:
-+;*	None
-+;*
-+;* Register usage:
-+;*	arg0 = rdr target
-+;*	arg1 = buffer pointer
-+;*	%r24 - DR2 | DR2_SLOW_RET
-+;*	%r23 - original DR2 value
-+;*
-+;***********************************************************************
- 
- 	.export perf_rdr_shift_out_U,code
- perf_rdr_shift_out_U:
-@@ -1386,11 +1384,11 @@
- 	depdi,z		1,DR2_SLOW_RET,1,%r24
- 	MFDIAG_2	(23)
- 	or		%r24,%r23,%r24
--	MTDIAG_2	(24)			; set DR2_SLOW_RET
-+	MTDIAG_2	(24)		; set DR2_SLOW_RET
- 
--	MTDIAG_1	(25)			; data to the staging register
--	shladd		 arg0,2,%r0,%r1	; %r1 = 4 * RDR number
--	blr		    %r1,%r0		    ; branch to 8-instruction sequence
-+	MTDIAG_1	(25)		; data to the staging register
-+	shladd		arg0,2,%r0,%r1	; %r1 = 4 * RDR number
-+	blr		%r1,%r0		; branch to 8-instruction sequence
- 	nop
- 
- ;
-@@ -1398,291 +1396,291 @@
- ;
- 
- 	sync				; RDR 0 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(0)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 1 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(1)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 2 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(2)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 3 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(3)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 4 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(4)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 5 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(5)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 6 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(6)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 7 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(7)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 8 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(8)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 9 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(9)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 10 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(10)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 11 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(11)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 12 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(12)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 13 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(13)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 14 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(14)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 15 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(15)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 16 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(16)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 17 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(17)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 18 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(18)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 19 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(19)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 20 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(20)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 21 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(21)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 22 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(22)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 23 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(23)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 24 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(24)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 25 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(25)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 26 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(26)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 27 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(27)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 28 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(28)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 29 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(29)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 30 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(30)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- 	sync				; RDR 31 write sequence
--	ssm			0,0
-+	ssm		0,0
- 	STDIAG		(31)
--	ssm			0,0
-+	ssm		0,0
- 	b,n         perf_rdr_shift_out_U_leave
- 	nop
--	ssm			0,0
-+	ssm		0,0
- 	nop
- 
- perf_rdr_shift_out_U_leave:
-Index: debian-kernel-hppa-2.6.8/include/linux/console.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/linux/console.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/linux/console.h	2005-01-15 20:15:12.000000000 -0500
-@@ -84,6 +84,7 @@
- #define CON_PRINTBUFFER	(1)
- #define CON_CONSDEV	(2) /* Last on the command line */
- #define CON_ENABLED	(4)
-+#define CON_BOOT	(8)
- 
- struct console
- {
-Index: debian-kernel-hppa-2.6.8/include/asm-parisc/system.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/system.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/system.h	2005-01-15 20:15:12.000000000 -0500
-@@ -80,7 +80,7 @@
- #define mtctl(gr, cr) \
- 	__asm__ __volatile__("mtctl %0,%1" \
- 		: /* no outputs */ \
--		: "r" (gr), "i" (cr))
-+		: "r" (gr), "i" (cr) : "memory")
- 
- /* these are here to de-mystefy the calling code, and to provide hooks */
- /* which I needed for debugging EIEM problems -PB */
-@@ -102,7 +102,7 @@
- #define mtsp(gr, cr) \
- 	__asm__ __volatile__("mtsp %0,%1" \
- 		: /* no outputs */ \
--		: "r" (gr), "i" (cr))
-+		: "r" (gr), "i" (cr) : "memory")
- 
- 
- /*
-@@ -154,7 +154,7 @@
-    for the semaphore.  */
- #define __PA_LDCW_ALIGNMENT 16
- #define __ldcw_align(a) ({ \
--  unsigned long __ret = (unsigned long) a;                     		\
-+  unsigned long __ret = (unsigned long) &(a)->lock[0];        		\
-   __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \
-   (volatile unsigned int *) __ret;                                      \
- })
-@@ -184,4 +184,22 @@
- 
- #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
-+
- #endif
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/pci-dma.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/pci-dma.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/pci-dma.c	2005-01-15 20:15:12.000000000 -0500
-@@ -104,7 +104,9 @@
- 		if (!pte_none(*pte))
- 			printk(KERN_ERR "map_pte_uncached: page already exists\n");
- 		set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC));
-+		purge_tlb_start();
- 		pdtlb_kernel(orig_vaddr);
-+		purge_tlb_end();
- 		vaddr += PAGE_SIZE;
- 		orig_vaddr += PAGE_SIZE;
- 		(*paddr_ptr) += PAGE_SIZE;
-@@ -179,7 +181,9 @@
- 	do {
- 		pte_t page = *pte;
- 		pte_clear(pte);
-+		purge_tlb_start();
- 		pdtlb_kernel(orig_vaddr);
-+		purge_tlb_end();
- 		vaddr += PAGE_SIZE;
- 		orig_vaddr += PAGE_SIZE;
- 		pte++;
-Index: debian-kernel-hppa-2.6.8/drivers/parisc/power.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/parisc/power.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/parisc/power.c	2005-01-15 20:15:12.000000000 -0500
-@@ -54,9 +54,9 @@
- 
- 
- #ifdef DEBUG
--# define DPRINTK(x) printk x
-+# define DPRINTK(x...) printk(x)
- #else
--# define DPRINTK(x) do { } while (0)
-+# define DPRINTK(x...)
- #endif
- 
- 
-@@ -120,14 +120,14 @@
- static void process_shutdown(void)
- {
- 	if (shutdown_timer == 0)
--		DPRINTK((KERN_INFO "Shutdown requested...\n"));
-+		DPRINTK(KERN_INFO "Shutdown requested...\n");
- 
- 	shutdown_timer++;
- 	
- 	/* wait until the button was pressed for 1 second */
- 	if (shutdown_timer == HZ) {
- 		static char msg[] = "Shutting down...";
--		DPRINTK((KERN_INFO "%s\n", msg));
-+		DPRINTK(KERN_INFO "%s\n", msg);
- #ifdef CONFIG_CHASSIS_LCD_LED
- 		lcd_print(msg);
- #endif
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_glue.c	2005-01-15 20:14:08.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.c	2005-01-15 20:15:12.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
-  */
- #define SYM_GLUE_C
- 
-@@ -636,7 +623,6 @@
- 	switch (cp->cdb_buf[0]) {
- 	case 0x0A: case 0x2A: case 0xAA:
- 		panic("XXXXXXXXXXXXX WRITE NOT YET ALLOWED XXXXXXXXXXXXXX\n");
--		MDELAY(10000);
- 		break;
- 	default:
- 		break;
 Index: debian-kernel-hppa-2.6.8/drivers/input/serio/hp_sdc.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/drivers/input/serio/hp_sdc.c	2005-01-15 20:15:12.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/input/serio/hp_sdc.c	2005-02-01 01:38:33.000000000 -0500
 @@ -0,0 +1,1067 @@
 +/*
 + * HP i8042-based System Device Controller driver.
@@ -9065,274 +8196,10 @@
 + * task       1655209 cycles 6937 calls (includes put)
 + *
 + */
-Index: debian-kernel-hppa-2.6.8/Documentation/parisc/00-INDEX
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/Documentation/parisc/00-INDEX	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/Documentation/parisc/00-INDEX	2005-01-15 20:15:12.000000000 -0500
-@@ -2,9 +2,16 @@
- 	- this file.
- IODC.txt
- 	- Documentation IODC
-+	= Removed.
-+
- debugging
- 	- some debugging hints for real-mode code
- mm
- 	- Documentation on parisc mm status
-+	= Removed.
-+
- registers
- 	- current/planned usage of registers
-+
-+todo
-+	- The things we need to work on...
-Index: debian-kernel-hppa-2.6.8/arch/parisc/lib/bitops.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/lib/bitops.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/lib/bitops.c	2005-01-15 20:15:12.000000000 -0500
-@@ -13,8 +13,8 @@
- #include <asm/atomic.h>
- 
- #ifdef CONFIG_SMP
--atomic_lock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
--	[0 ... (ATOMIC_HASH_SIZE-1)]  = (atomic_lock_t) { { 1, 1, 1, 1 } }
-+spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
-+	[0 ... (ATOMIC_HASH_SIZE-1)]  = SPIN_LOCK_UNLOCKED
- };
- #endif
- 
-@@ -23,10 +23,10 @@
- {
- 	unsigned long temp, flags;
- 
--	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_lock_irqsave(ptr, flags);
- 	temp = *ptr;
- 	*ptr = x;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_unlock_irqrestore(ptr, flags);
- 	return temp;
- }
- #endif
-@@ -36,10 +36,10 @@
- 	unsigned long flags;
- 	long temp;
- 
--	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_lock_irqsave(ptr, flags);
- 	temp = (long) *ptr;	/* XXX - sign extension wanted? */
- 	*ptr = x;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_unlock_irqrestore(ptr, flags);
- 	return (unsigned long)temp;
- }
- 
-@@ -49,10 +49,10 @@
- 	unsigned long flags;
- 	long temp;
- 
--	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_lock_irqsave(ptr, flags);
- 	temp = (long) *ptr;	/* XXX - sign extension wanted? */
- 	*ptr = x;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_unlock_irqrestore(ptr, flags);
- 	return (unsigned long)temp;
- }
- 
-@@ -63,10 +63,10 @@
- 	unsigned long flags;
- 	unsigned long prev;
- 
--	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_lock_irqsave(ptr, flags);
- 	if ((prev = *ptr) == old)
- 		*ptr = new;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_unlock_irqrestore(ptr, flags);
- 	return prev;
- }
- #endif
-@@ -76,9 +76,9 @@
- 	unsigned long flags;
- 	unsigned int prev;
- 
--	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_lock_irqsave(ptr, flags);
- 	if ((prev = *ptr) == old)
- 		*ptr = new;
--	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-+	_atomic_spin_unlock_irqrestore(ptr, flags);
- 	return (unsigned long)prev;
- }
-Index: debian-kernel-hppa-2.6.8/mm/shmem.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/mm/shmem.c	2005-01-15 20:14:29.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/mm/shmem.c	2005-01-15 20:15:12.000000000 -0500
-@@ -410,7 +410,7 @@
- 	return freed;
- }
- 
--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: debian-kernel-hppa-2.6.8/kernel/signal.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/kernel/signal.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/kernel/signal.c	2005-01-15 20:15:12.000000000 -0500
-@@ -21,6 +21,7 @@
- #include <linux/binfmts.h>
- #include <linux/security.h>
- #include <linux/ptrace.h>
-+#include <linux/compat_siginfo.h>
- #include <asm/param.h>
- #include <asm/uaccess.h>
- #include <asm/unistd.h>
-@@ -2024,17 +2025,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.
-@@ -2271,7 +2290,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: debian-kernel-hppa-2.6.8/include/asm-ia64/compat.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-ia64/compat.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-ia64/compat.h	2005-01-15 20:15:12.000000000 -0500
-@@ -27,6 +27,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: debian-kernel-hppa-2.6.8/include/asm-parisc/ptrace.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/ptrace.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/ptrace.h	2005-01-15 20:15:12.000000000 -0500
-@@ -46,7 +46,8 @@
- #ifdef __KERNEL__
- 
- /* XXX should we use iaoq[1] or iaoq[0] ? */
--#define user_mode(regs)			(((regs)->iaoq[0] &  3) ? 1 : 0)
-+#define user_mode(regs)			(((regs)->iaoq[0] & 3) ? 1 : 0)
-+#define user_space(regs)		(((regs)->iasq[0] != 0) ? 1 : 0)
- #define instruction_pointer(regs)	((regs)->iaoq[0] & ~3)
- extern void show_regs(struct pt_regs *);
- #endif
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_glue.h	2005-01-15 20:14:07.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.h	2005-01-15 20:15:12.000000000 -0500
-@@ -22,32 +22,19 @@
-  *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
-  */
- 
- #ifndef SYM_GLUE_H
-@@ -89,7 +76,6 @@
- 
- #define SYM_OPT_HANDLE_DIR_UNKNOWN
- #define SYM_OPT_HANDLE_DEVICE_QUEUEING
--#define SYM_OPT_NVRAM_PRE_READ
- #define SYM_OPT_SNIFF_INQUIRY
- #define SYM_OPT_LIMIT_COMMAND_REORDERING
- #define	SYM_OPT_ANNOUNCE_TRANSFER_RATE
-@@ -108,10 +94,9 @@
- #define	printf(args...)		printk(args)
- 
- /*
-- *  Insert a delay in micro-seconds and milli-seconds.
-+ *  Insert a delay in micro-seconds
-  */
- #define sym_udelay(us)	udelay(us)
--#define sym_mdelay(ms)	mdelay(ms)
- 
- /*
-  *  A 'read barrier' flushes any data that have been prefetched 
 Index: debian-kernel-hppa-2.6.8/drivers/input/serio/hp_sdc_mlc.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/drivers/input/serio/hp_sdc_mlc.c	2005-01-15 20:15:12.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/input/serio/hp_sdc_mlc.c	2005-02-01 01:38:33.000000000 -0500
 @@ -0,0 +1,370 @@
 +/*
 + * Access to HP-HIL MLC through HP System Device Controller.
@@ -9704,1544 +8571,298 @@
 +
 +module_init(hp_sdc_mlc_init);
 +module_exit(hp_sdc_mlc_exit);
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/smp.c
+Index: debian-kernel-hppa-2.6.8/drivers/net/tulip/media.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/smp.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/smp.c	2005-01-15 20:15:12.000000000 -0500
-@@ -333,6 +333,7 @@
- 	struct smp_call_struct data;
- 	unsigned long timeout;
- 	static spinlock_t lock = SPIN_LOCK_UNLOCKED;
-+	int retries = 0;
+--- debian-kernel-hppa-2.6.8.orig/drivers/net/tulip/media.c	2004-08-14 01:36:32.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/net/tulip/media.c	2005-02-01 01:38:33.000000000 -0500
+@@ -43,8 +43,10 @@
  
- 	if (num_online_cpus() < 2)
- 		return 0;
-@@ -365,21 +366,22 @@
- 	/*  Send a message to all other CPUs and wait for them to respond  */
- 	send_IPI_allbutself(IPI_CALL_FUNC);
+ /* 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.
++   */
  
-+ retry:
- 	/*  Wait for response  */
- 	timeout = jiffies + HZ;
- 	while ( (atomic_read (&data.unstarted_count) > 0) &&
- 		time_before (jiffies, timeout) )
- 		barrier ();
- 
-+	if (atomic_read (&data.unstarted_count) > 0) {
-+		printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d), try %d\n",
-+		      smp_processor_id(), ++retries);
-+		goto retry;
-+	}
- 	/* We either got one or timed out. Release the lock */
- 
- 	mb();
- 	smp_call_function_data = NULL;
--	if (atomic_read (&data.unstarted_count) > 0) {
--		printk(KERN_CRIT "SMP CALL FUNCTION TIMED OUT! (cpu=%d)\n",
--		      smp_processor_id());
--		return -ETIMEDOUT;
--	}
- 
- 	while (wait && atomic_read (&data.unfinished_count) > 0)
- 			barrier ();
-Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/hpps2atkbd.h
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/keyboard/hpps2atkbd.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/hpps2atkbd.h	2005-01-15 20:15:12.000000000 -0500
-@@ -50,10 +50,10 @@
- /* 60 */  KEY_DOWN,     C_61,          KEY_PAUSE,     KEY_UP,        KEY_DELETE,    KEY_END,      KEY_BACKSPACE, KEY_INSERT,
- /* 68 */  KEY_RESERVED, KEY_KP1,       KEY_RIGHT,     KEY_KP4,       KEY_KP7,       KEY_PAGEDOWN, KEY_HOME,      KEY_PAGEUP,
- /* 70 */  KEY_KP0,      KEY_KPDOT,     KEY_KP2,       KEY_KP5,       KEY_KP6,       KEY_KP8,      KEY_ESC,       KEY_NUMLOCK,
--/* 78 */  KEY_F11,      KEY_KPPLUS,    KEY_KP3,       KEY_KPMINUS,   KEY_KPASTERISK,KEY_KP9,      KEY_SCROLLLOCK,KEY_103RD,
-+/* 78 */  KEY_F11,      KEY_KPPLUS,    KEY_KP3,       KEY_KPMINUS,   KEY_KPASTERISK,KEY_KP9,      KEY_SCROLLLOCK,KEY_102ND,
- /* 80 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
- /* 88 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
--/* 90 */  KEY_RESERVED, KEY_RIGHTALT,  KEY_SYSRQ,     KEY_RESERVED,  KEY_RIGHTCTRL, KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
-+/* 90 */  KEY_RESERVED, KEY_RIGHTALT,  255,           KEY_RESERVED,  KEY_RIGHTCTRL, KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,
- /* 98 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_CAPSLOCK, KEY_RESERVED,  KEY_LEFTMETA,
- /* a0 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_RIGHTMETA,
- /* a8 */  KEY_RESERVED, KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED,  KEY_RESERVED, KEY_RESERVED,  KEY_COMPOSE,
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/real2.S
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/real2.S	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/real2.S	2005-01-15 20:15:12.000000000 -0500
-@@ -149,7 +149,7 @@
- rfi_virt2real:
- 	/* switch to real mode... */
- 	ssm		0,0		/* See "relied upon translation" */
--	nop				/* comment in interruption.S */
-+	nop				/* PA 2.0 Arch. F-5 */
- 	nop
- 	nop
- 	nop
-@@ -186,7 +186,7 @@
- 	.align 128
- rfi_real2virt:
- 	ssm		0,0		/* See "relied upon translation" */
--	nop				/* comment in interruption.S */
-+	nop				/* PA 2.0 Arch. F-5 */
- 	nop
- 	nop
- 	nop
-Index: debian-kernel-hppa-2.6.8/sound/parisc/harmony.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/sound/parisc/harmony.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/sound/parisc/harmony.c	2005-01-15 20:15:13.000000000 -0500
-@@ -6,7 +6,7 @@
-  *
-  *	Harmony is found in HP 712s, 715/new and many other GSC based machines.
-  *	On older 715 machines you'll find the technically identical chip 
-- *	called 'Vivace'. Both Harmony and Vicace are supported by this driver.
-+ *	called 'Vivace'. Both Harmony and Vivace are supported by this driver.
-  *
-  *  this ALSA driver is based on OSS driver by:
-  *	Copyright 2000 (c) Linuxcare Canada, Alex deVries <alex at linuxcare.com>
-@@ -43,7 +43,7 @@
-  * to be recorded is put in RNXTADD. There is 2 read-only registers, PCURADD and 
-  * RCURADD that provides adress of current page.
-  * 
-- * Harmony has no way to controll full duplex or half duplex mode. It means
-+ * Harmony has no way to control full duplex or half duplex mode. It means
-  * that we always need to provide adresses of playback and capture data, even
-  * when this is not needed. That's why we statically alloc one graveyard
-  * buffer (to put recorded data in play-only mode) and a silence buffer.
-@@ -556,7 +556,7 @@
- 	harmony->sample_rate = snd_card_harmony_rate_bits(runtime->rate);
- 
- 	/* data format */
--	harmony->data_format = snd_harmony_set_data_format(haromny, runtime->format);
-+	harmony->data_format = snd_harmony_set_data_format(harmony, runtime->format);
- 
- 	/* number of channels */
- 	if (runtime->channels == 2)
-@@ -587,7 +587,7 @@
- 	harmony->sample_rate = snd_card_harmony_rate_bits(runtime->rate);
- 	
- 	/* data format */
--	harmony->data_format = snd_harmony_set_data_format(haromny, runtime->format);
-+	harmony->data_format = snd_harmony_set_data_format(harmony, runtime->format);
- 	
- 	/* number of channels */
- 	if (runtime->channels == 1)
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/traps.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/traps.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/traps.c	2005-01-15 20:15:13.000000000 -0500
-@@ -135,32 +135,19 @@
- 
- EXPORT_SYMBOL(dump_stack);
- 
--void show_stack(struct task_struct *task, unsigned long *s)
-+static void do_show_stack(struct unwind_frame_info *info)
+ int tulip_mdio_read(struct net_device *dev, int phy_id, int location)
  {
- 	int i = 1;
--	struct unwind_frame_info info;
--
--	if (!task) {
--		unsigned long sp, ip, rp;
--
--HERE:
--		asm volatile ("copy %%r30, %0" : "=r"(sp));
--		ip = (unsigned long)&&HERE;
--		rp = (unsigned long)__builtin_return_address(0);
--		unwind_frame_init(&info, current, sp, ip, rp);
--	} else {
--		unwind_frame_init_from_blocked_task(&info, task);
--	}
- 
- 	printk("Backtrace:\n");
- 	while (i <= 16) {
--		if (unwind_once(&info) < 0 || info.ip == 0)
-+		if (unwind_once(info) < 0 || info->ip == 0)
- 			break;
- 
--		if (__kernel_text_address(info.ip)) {
--			printk(" [<" RFMT ">] ", info.ip);
-+		if (__kernel_text_address(info->ip)) {
-+			printk(" [<" RFMT ">] ", info->ip);
- #ifdef CONFIG_KALLSYMS
--			print_symbol("%s\n", info.ip);
-+			print_symbol("%s\n", info->ip);
- #else
- 			if ((i & 0x03) == 0)
- 				printk("\n");
-@@ -171,6 +158,25 @@
- 	printk("\n");
- }
- 
-+void show_stack(struct task_struct *task, unsigned long *s)
-+{
-+	struct unwind_frame_info info;
+@@ -271,13 +273,29 @@
+ 				int reset_length = p[2 + init_length];
+ 				misc_info = (u16*)(reset_sequence + reset_length);
+ 				if (startup) {
++					int timeout = 10;	/* max 1 ms */
+ 					outl(mtable->csr12dir | 0x100, ioaddr + CSR12);
+ 					for (i = 0; i < reset_length; i++)
+ 						outl(reset_sequence[i], ioaddr + CSR12);
 +
-+	if (!task) {
-+		unsigned long sp, ip, rp;
++					/* flush posted writes */
++					inl(ioaddr + CSR12);
 +
-+HERE:
-+		asm volatile ("copy %%r30, %0" : "=r"(sp));
-+		ip = (unsigned long)&&HERE;
-+		rp = (unsigned long)__builtin_return_address(0);
-+		unwind_frame_init(&info, current, sp, ip, rp);
-+	} else {
-+		unwind_frame_init_from_blocked_task(&info, task);
-+	}
++					/* Sect 3.10.3 in DP83840A.pdf (p39) */
++					udelay(500);
 +
-+	do_show_stack(&info);
-+}
++					/* 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++)
+ 					outl(init_sequence[i], ioaddr + CSR12);
 +
- void die_if_kernel(char *str, struct pt_regs *regs, long err)
- {
- 	if (user_mode(regs)) {
-@@ -373,9 +379,9 @@
++				inl(ioaddr + CSR12);	/* flush posted writes */
+ 			}
++
+ 			tmp_info = get_u16(&misc_info[1]);
+ 			if (tmp_info)
+ 				tp->advertising[phy_num] = tmp_info | 1;
+Index: debian-kernel-hppa-2.6.8/drivers/parisc/power.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/parisc/power.c	2004-08-14 01:36:16.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/parisc/power.c	2005-02-01 01:38:33.000000000 -0500
+@@ -54,9 +54,9 @@
  
  
- /*
-- * This routine handles page faults.  It determines the address,
-- * and the problem, and then passes it off to one of the appropriate
-- * routines.
-+ * This routine is called as a last resort when everything else
-+ * has gone clearly wrong. We get called for faults in kernel space,
-+ * and HPMC's.
-  */
- void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long offset)
+ #ifdef DEBUG
+-# define DPRINTK(x) printk x
++# define DPRINTK(x...) printk(x)
+ #else
+-# define DPRINTK(x) do { } while (0)
++# define DPRINTK(x...)
+ #endif
+ 
+ 
+@@ -120,14 +120,14 @@
+ static void process_shutdown(void)
  {
-@@ -407,7 +413,12 @@
+ 	if (shutdown_timer == 0)
+-		DPRINTK((KERN_INFO "Shutdown requested...\n"));
++		DPRINTK(KERN_INFO "Shutdown requested...\n");
  
- 	}
- 	    
--	show_stack(NULL, (unsigned long *)regs->gr[30]);
-+	{
-+		/* show_stack(NULL, (unsigned long *)regs->gr[30]); */
-+		struct unwind_frame_info info;
-+		unwind_frame_init(&info, current, regs->gr[30], regs->iaoq[0], regs->gr[2]);
-+		do_show_stack(&info);
-+	}
- 
- 	printk("\n");
- 	printk(KERN_CRIT "%s: Code=%d regs=%p (Addr=" RFMT ")\n",
-@@ -421,9 +432,16 @@
- 	 * system will shut down immediately right here. */
- 	pdc_soft_power_button(0);
+ 	shutdown_timer++;
  	
--	/* Gutter the processor! */
--	for(;;)
--	    ;
-+	/* Call kernel panic() so reboot timeouts work properly 
-+	 * FIXME: This function should be on the list of
-+	 * panic notifiers, and we should call panic
-+	 * directly from the location that we wish. 
-+	 * e.g. We should not call panic from
-+	 * parisc_terminate, but rather the oter way around.
-+	 * This hack works, prints the panic message twice,
-+	 * and it enables reboot timers!
-+	 */
-+	panic(msg);
- }
+ 	/* wait until the button was pressed for 1 second */
+ 	if (shutdown_timer == HZ) {
+ 		static char msg[] = "Shutting down...";
+-		DPRINTK((KERN_INFO "%s\n", msg));
++		DPRINTK(KERN_INFO "%s\n", msg);
+ #ifdef CONFIG_CHASSIS_LCD_LED
+ 		lcd_print(msg);
+ #endif
+Index: debian-kernel-hppa-2.6.8/drivers/parisc/sba_iommu.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/parisc/sba_iommu.c	2004-08-14 01:37:37.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/parisc/sba_iommu.c	2005-02-01 01:38:33.000000000 -0500
+@@ -1,8 +1,9 @@
+ /*
+ **  System Bus Adapter (SBA) I/O MMU manager
+ **
+-**	(c) Copyright 2000 Grant Grundler
+-**	(c) Copyright 2000 Hewlett-Packard Company
++**	(c) Copyright 2000-2004 Grant Grundler <grundler @ parisc-linux x org>
++**	(c) Copyright 2004 Naresh Kumar Inna <knaresh at india x hp x com>
++**	(c) Copyright 2000-2004 Hewlett-Packard Company
+ **
+ **	Portions (c) 1999 Dave S. Miller (from sparc64 I/O MMU code)
+ **
+Index: debian-kernel-hppa-2.6.8/drivers/pcmcia/Kconfig
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/pcmcia/Kconfig	2004-08-14 01:37:37.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/pcmcia/Kconfig	2005-02-01 01:38:33.000000000 -0500
+@@ -136,7 +136,7 @@
  
- void handle_interruption(int code, struct pt_regs *regs)
-@@ -437,6 +455,36 @@
- 	else
- 	    local_irq_enable();
+ config PCMCIA_PROBE
+ 	bool
+-	default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X
++	default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X && !PARISC
  
-+	/* Security check:
-+	 * If the priority level is still user, and the
-+	 * faulting space is not equal to the active space
-+	 * then the user is attempting something in a space
-+	 * that does not belong to them. Kill the process.
-+	 *
-+	 * This is normally the situation when the user
-+	 * attempts to jump into the kernel space at the
-+	 * wrong offset, be it at the gateway page or a
-+	 * random location.
-+	 *
-+	 * We cannot normally signal the process because it
-+	 * could *be* on the gateway page, and processes
-+	 * executing on the gateway page can't have signals
-+	 * delivered.
-+	 * 
-+	 * We merely readjust the address into the users
-+	 * space, at a destination address of zero, and
-+	 * allow processing to continue.
-+	 */
-+	if (((unsigned long)regs->iaoq[0] & 3) &&
-+	    ((unsigned long)regs->iasq[0] != (unsigned long)regs->sr[7])) { 
-+	  	/* Kill the user process later */
-+	  	regs->iaoq[0] = 0 | 3;
-+		regs->iaoq[1] = regs->iaoq[0] + 4;
-+	 	regs->iasq[0] = regs->iasq[0] = regs->sr[7];
-+		regs->gr[0] &= ~PSW_B;
-+		return;
-+	}
-+	
- #if 0
- 	printk(KERN_CRIT "Interruption # %d\n", code);
- #endif
-@@ -461,7 +509,7 @@
- 	case  3:
- 		/* Recovery counter trap */
- 		regs->gr[0] &= ~PSW_R;
--		if (regs->iasq[0])
-+		if (user_space(regs))
- 			handle_gdb_break(regs, TRAP_TRACE);
- 		/* else this must be the start of a syscall - just let it run */
- 		return;
-@@ -565,9 +613,16 @@
- 		/* Fall through */
- 	case 17:
- 		/* Non-access data TLB miss fault/Non-access data page fault */
--		/* TODO: Still need to add slow path emulation code here */
--		/* TODO: Understand what is meant by the TODO listed
--		         above this one. (Carlos) */
-+		/* FIXME: 
-+		 	 Still need to add slow path emulation code here!
-+		         If the insn used a non-shadow register, then the tlb
-+			 handlers could not have their side-effect (e.g. probe
-+			 writing to a target register) emulated since rfir would
-+			 erase the changes to said register. Instead we have to
-+			 setup everything, call this function we are in, and emulate
-+			 by hand. Technically we need to emulate:
-+			 fdc,fdce,pdc,"fic,4f",prober,probeir,probew, probeiw
-+		*/			  
- 		fault_address = regs->ior;
- 		fault_space = regs->isr;
- 		break;
-@@ -598,7 +653,7 @@
- 	case 25:
- 		/* Taken branch trap */
- 		regs->gr[0] &= ~PSW_T;
--		if (regs->iasq[0])
-+		if (user_space(regs))
- 			handle_gdb_break(regs, TRAP_BRANCH);
- 		/* else this must be the start of a syscall - just let it
- 		 * run.
-@@ -677,7 +732,7 @@
- 	}
+ endmenu
  
- 	if (user_mode(regs)) {
--	    if ((fault_space>>SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) {
-+	    if ((fault_space >> SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) {
- #ifdef PRINT_USER_FAULTS
- 		if (fault_space == 0)
- 			printk(KERN_DEBUG "User Fault on Kernel Space ");
-Index: debian-kernel-hppa-2.6.8/drivers/serial/8250.c
+Index: debian-kernel-hppa-2.6.8/drivers/pcmcia/rsrc_mgr.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/serial/8250.c	2005-01-15 20:14:34.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/serial/8250.c	2005-01-15 20:18:20.000000000 -0500
-@@ -2023,8 +2023,18 @@
- 	.data		= &serial8250_reg,
- };
+--- debian-kernel-hppa-2.6.8.orig/drivers/pcmcia/rsrc_mgr.c	2004-08-14 01:37:15.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/pcmcia/rsrc_mgr.c	2005-02-01 01:38:33.000000000 -0500
+@@ -59,10 +59,12 @@
  
-+#ifdef CONFIG_PARISC
-+int __init serial8250_console_init(void)
-+{
-+	static int serial8250_console_initialised;
-+	if (serial8250_console_initialised)
-+		return 0;
-+	serial8250_console_initialised = 1;
-+
+ #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
+ 
+-INT_MODULE_PARM(probe_mem,	1);		/* memory probe? */
+ #ifdef CONFIG_PCMCIA_PROBE
++INT_MODULE_PARM(probe_mem,	1);		/* memory probe? */
+ INT_MODULE_PARM(probe_io,	1);		/* IO port probe? */
+ INT_MODULE_PARM(mem_limit,	0x10000);
 +#else
- static int __init serial8250_console_init(void)
- {
-+#endif /* CONFIG_PARISC */
- #ifdef CONFIG_PPC_MULTIPLATFORM
- 	if(_machine == _MACH_Pmac) {
- 		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
-@@ -2035,7 +2045,9 @@
- 	register_console(&serial8250_console);
- 	return 0;
- }
-+#ifndef CONFIG_PARISC
- console_initcall(serial8250_console_init);
-+#endif /* !CONFIG_PARISC */
++INT_MODULE_PARM(probe_mem,	0);		/* memory probe? */
+ #endif
  
- static int __init serial8250_late_console_init(void)
- {
-Index: debian-kernel-hppa-2.6.8/drivers/input/mouse/Makefile
+ /*======================================================================
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/lasi700.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/mouse/Makefile	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/mouse/Makefile	2005-01-15 20:15:13.000000000 -0500
-@@ -12,6 +12,7 @@
- obj-$(CONFIG_MOUSE_PC110PAD)	+= pc110pad.o
- obj-$(CONFIG_MOUSE_PS2)		+= psmouse.o
- obj-$(CONFIG_MOUSE_SERIAL)	+= sermouse.o
-+obj-$(CONFIG_MOUSE_HIL)		+= hil_ptr.o
- obj-$(CONFIG_MOUSE_VSXXXAA)	+= vsxxxaa.o
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/lasi700.c	2004-08-14 01:36:16.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/lasi700.c	2005-02-01 01:38:32.000000000 -0500
+@@ -110,7 +110,7 @@
  
- psmouse-objs  := psmouse-base.o logips2pp.o synaptics.o
-Index: debian-kernel-hppa-2.6.8/drivers/input/keyboard/hil_kbd.c
+ 	host->irq = dev->irq;
+ 	if (request_irq(dev->irq, NCR_700_intr, SA_SHIRQ,
+-				dev->dev.bus_id, host)) {
++				"lasi700", host)) {
+ 		printk(KERN_ERR "%s: irq problem, detaching\n",
+ 		       dev->dev.bus_id);
+ 		goto out_put_host;
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym53c8xx.h
 ===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/drivers/input/keyboard/hil_kbd.c	2005-01-15 20:15:13.000000000 -0500
-@@ -0,0 +1,372 @@
-+/*
-+ * Generic linux-input device driver for keyboard devices
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym53c8xx.h	2004-08-14 01:38:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym53c8xx.h	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
+- *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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.
 + *
-+ * Copyright (c) 2001 Brian S. Julin
-+ * All rights reserved.
++ * 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.
 + *
-+ * 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/input.h>
-+#include <linux/serio.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/slab.h>
-+#include <linux/pci_ids.h>
-+
-+#define PREFIX "HIL KEYB: "
-+#define HIL_GENERIC_NAME "HIL keyboard"
-+
-+MODULE_AUTHOR("Brian S. Julin <bri at calyx.com>");
-+MODULE_DESCRIPTION(HIL_GENERIC_NAME " driver");
-+MODULE_LICENSE("Dual BSD/GPL");
-+
-+#define HIL_KBD_MAX_LENGTH 16
-+
-+#define HIL_KBD_SET1_UPBIT 0x01
-+#define HIL_KBD_SET1_SHIFT 1
-+static unsigned int hil_kbd_set1[HIL_KEYCODES_SET1_TBLSIZE] = 
-+	{ HIL_KEYCODES_SET1 };
-+
-+#define HIL_KBD_SET2_UPBIT 0x01
-+#define HIL_KBD_SET2_SHIFT 1
-+/* Set2 is user defined */
-+
-+#define HIL_KBD_SET3_UPBIT 0x80
-+#define HIL_KBD_SET3_SHIFT 0
-+static unsigned int hil_kbd_set3[HIL_KEYCODES_SET3_TBLSIZE] =
-+	{ HIL_KEYCODES_SET3 };
-+
-+static char hil_language[][16] = { HIL_LOCALE_MAP };
-+
-+struct hil_kbd {
-+	struct input_dev dev;
-+	struct serio *serio;
-+
-+	/* Input buffer and index for packets from HIL bus. */
-+	hil_packet data[HIL_KBD_MAX_LENGTH];
-+	int idx4; /* four counts per packet */
-+
-+	/* Raw device info records from HIL bus, see hil.h for fields. */
-+	char	idd[HIL_KBD_MAX_LENGTH];	/* DID byte and IDD record */
-+	char	rsc[HIL_KBD_MAX_LENGTH];	/* RSC record */
-+	char	exd[HIL_KBD_MAX_LENGTH];	/* EXD record */
-+	char	rnm[HIL_KBD_MAX_LENGTH + 1];	/* RNM record + NULL term. */
-+
-+	/* Something to sleep around with. */
-+	struct semaphore sem;
-+};
-+
-+/* Process a complete packet after transfer from the HIL */
-+static void hil_kbd_process_record(struct hil_kbd *kbd)
-+{
-+	struct input_dev *dev = &kbd->dev;
-+	hil_packet *data = kbd->data;
-+	hil_packet p;
-+	int idx, i, cnt;
-+
-+	idx = kbd->idx4/4;
-+	p = data[idx - 1];
-+
-+	if ((p & ~HIL_CMDCT_POL) == 
-+	    (HIL_ERR_INT | HIL_PKT_CMD | HIL_CMD_POL)) goto report;
-+	if ((p & ~HIL_CMDCT_RPL) == 
-+	    (HIL_ERR_INT | HIL_PKT_CMD | HIL_CMD_RPL)) goto report;
-+
-+	/* Not a poll response.  See if we are loading config records. */
-+	switch (p & HIL_PKT_DATA_MASK) {
-+	case HIL_CMD_IDD:
-+		for (i = 0; i < idx; i++)
-+			kbd->idd[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_KBD_MAX_LENGTH; i++)
-+			kbd->idd[i] = 0;
-+		break;
-+	case HIL_CMD_RSC:
-+		for (i = 0; i < idx; i++)
-+			kbd->rsc[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_KBD_MAX_LENGTH; i++)
-+			kbd->rsc[i] = 0;
-+		break;
-+	case HIL_CMD_EXD:
-+		for (i = 0; i < idx; i++)
-+			kbd->exd[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_KBD_MAX_LENGTH; i++)
-+			kbd->exd[i] = 0;
-+		break;
-+	case HIL_CMD_RNM:
-+		for (i = 0; i < idx; i++)
-+			kbd->rnm[i] = kbd->data[i] & HIL_PKT_DATA_MASK;
-+		for (; i < HIL_KBD_MAX_LENGTH + 1; i++)
-+			kbd->rnm[i] = '\0';
-+		break;
-+	default:
-+		/* These occur when device isn't present */
-+		if (p == (HIL_ERR_INT | HIL_PKT_CMD)) break; 
-+		/* Anything else we'd like to know about. */
-+		printk(KERN_WARNING PREFIX "Device sent unknown record %x\n", p);
-+		break;
-+	}
-+	goto out;
-+
-+ report:
-+	cnt = 1;
-+	switch (kbd->data[0] & HIL_POL_CHARTYPE_MASK) {
-+	case HIL_POL_CHARTYPE_NONE:
-+		break;
-+	case HIL_POL_CHARTYPE_ASCII:
-+		while (cnt < idx - 1)
-+			input_report_key(dev, kbd->data[cnt++] & 0x7f, 1);
-+		break;
-+	case HIL_POL_CHARTYPE_RSVD1:
-+	case HIL_POL_CHARTYPE_RSVD2:
-+	case HIL_POL_CHARTYPE_BINARY:
-+		while (cnt < idx - 1)
-+			input_report_key(dev, kbd->data[cnt++], 1);
-+		break;
-+	case HIL_POL_CHARTYPE_SET1:
-+		while (cnt < idx - 1) {
-+			unsigned int key;
-+			int up;
-+			key = kbd->data[cnt++];
-+			up = key & HIL_KBD_SET1_UPBIT;
-+			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
-+			key = hil_kbd_set1[key >> HIL_KBD_SET1_SHIFT];
-+			if (key != KEY_RESERVED)
-+				input_report_key(dev, key, !up);
-+		}
-+		break;
-+	case HIL_POL_CHARTYPE_SET2:
-+		while (cnt < idx - 1) {
-+			unsigned int key;
-+			int up;
-+			key = kbd->data[cnt++];
-+			up = key & HIL_KBD_SET2_UPBIT;
-+			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
-+			key = key >> HIL_KBD_SET2_SHIFT;
-+			if (key != KEY_RESERVED)
-+				input_report_key(dev, key, !up);
-+		}
-+		break;
-+	case HIL_POL_CHARTYPE_SET3:
-+		while (cnt < idx - 1) {
-+			unsigned int key;
-+			int up;
-+			key = kbd->data[cnt++];
-+			up = key & HIL_KBD_SET3_UPBIT;
-+			key &= (~HIL_KBD_SET1_UPBIT & 0xff);
-+			key = hil_kbd_set3[key >> HIL_KBD_SET3_SHIFT];
-+			if (key != KEY_RESERVED)
-+				input_report_key(dev, key, !up);
-+		}
-+		break;
-+	}
-+ out:
-+	kbd->idx4 = 0;
-+	up(&kbd->sem);
-+}
-+
-+static void hil_kbd_process_err(struct hil_kbd *kbd) {
-+	printk(KERN_WARNING PREFIX "errored HIL packet\n");
-+	kbd->idx4 = 0;
-+	up(&kbd->sem);
-+}
-+
-+static irqreturn_t hil_kbd_interrupt(struct serio *serio, 
-+	      unsigned char data, unsigned int flags, struct pt_regs *regs)
-+{
-+	struct hil_kbd *kbd;
-+	hil_packet packet;
-+	int idx;
-+
-+	kbd = (struct hil_kbd *)serio->private;
-+	if (kbd == NULL) {
-+		BUG();
-+		return IRQ_HANDLED;
-+	}
-+
-+	if (kbd->idx4 >= (HIL_KBD_MAX_LENGTH * sizeof(hil_packet))) {
-+		hil_kbd_process_err(kbd);
-+		return IRQ_HANDLED;
-+	}
-+	idx = kbd->idx4/4;
-+	if (!(kbd->idx4 % 4)) kbd->data[idx] = 0;
-+	packet = kbd->data[idx];
-+	packet |= ((hil_packet)data) << ((3 - (kbd->idx4 % 4)) * 8);
-+	kbd->data[idx] = packet;
-+
-+	/* Records of N 4-byte hil_packets must terminate with a command. */
-+	if ((++(kbd->idx4)) % 4) return IRQ_HANDLED;
-+	if ((packet & 0xffff0000) != HIL_ERR_INT) {
-+		hil_kbd_process_err(kbd);
-+		return IRQ_HANDLED;
-+	}
-+	if (packet & HIL_PKT_CMD) hil_kbd_process_record(kbd);
-+	return IRQ_HANDLED;
-+}
-+
-+static void hil_kbd_disconnect(struct serio *serio)
-+{
-+	struct hil_kbd *kbd;
-+
-+	kbd = (struct hil_kbd *)serio->private;
-+	if (kbd == NULL) {
-+		BUG();
-+		return;
-+	}
-+
-+	input_unregister_device(&kbd->dev);
-+	serio_close(serio);
-+	kfree(kbd);
-+}
-+
-+static void hil_kbd_connect(struct serio *serio, struct serio_dev *dev)
-+{
-+	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;
-+	memset(kbd, 0, sizeof(struct hil_kbd));
-+
-+	if (serio_open(serio, dev)) goto bail0;
-+
-+	serio->private = kbd;
-+	kbd->serio = serio;
-+	kbd->dev.private = kbd;
-+
-+	init_MUTEX_LOCKED(&(kbd->sem));
-+
-+	/* Get device info.  MLC driver supplies devid/status/etc. */
-+	serio->write(serio, 0);
-+	serio->write(serio, 0);
-+	serio->write(serio, HIL_PKT_CMD >> 8);
-+	serio->write(serio, HIL_CMD_IDD);
-+	down(&(kbd->sem));
-+
-+	serio->write(serio, 0);
-+	serio->write(serio, 0);
-+	serio->write(serio, HIL_PKT_CMD >> 8);
-+	serio->write(serio, HIL_CMD_RSC);
-+	down(&(kbd->sem));
-+
-+	serio->write(serio, 0);
-+	serio->write(serio, 0);
-+	serio->write(serio, HIL_PKT_CMD >> 8);
-+	serio->write(serio, HIL_CMD_RNM);
-+	down(&(kbd->sem));
-+
-+	serio->write(serio, 0);
-+	serio->write(serio, 0);
-+	serio->write(serio, HIL_PKT_CMD >> 8);
-+	serio->write(serio, HIL_CMD_EXD);
-+	down(&(kbd->sem));
-+
-+	up(&(kbd->sem));
-+
-+	did = kbd->idd[0];
-+	idd = kbd->idd + 1;
-+	switch (did & HIL_IDD_DID_TYPE_MASK) {
-+	case HIL_IDD_DID_TYPE_KB_INTEGRAL:
-+	case HIL_IDD_DID_TYPE_KB_ITF:
-+	case HIL_IDD_DID_TYPE_KB_RSVD:
-+	case HIL_IDD_DID_TYPE_CHAR:
-+		printk(KERN_INFO PREFIX "HIL keyboard found (did = 0x%02x, lang = %s)\n",
-+			did, hil_language[did & HIL_IDD_DID_TYPE_KB_LANG_MASK]);
-+		break;
-+	default:
-+		goto bail1;
-+	}
-+
-+	if(HIL_IDD_NUM_BUTTONS(idd) || HIL_IDD_NUM_AXES_PER_SET(*idd)) {
-+		printk(KERN_INFO PREFIX "keyboards only, no combo devices supported.\n");
-+		goto bail1;
-+	}
-+
-+
-+	kbd->dev.evbit[0]	= BIT(EV_KEY) | BIT(EV_REP);
-+	kbd->dev.ledbit[0]	= BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
-+	kbd->dev.keycodemax	= HIL_KEYCODES_SET1_TBLSIZE;
-+	kbd->dev.keycodesize	= sizeof(hil_kbd_set1[0]);
-+	kbd->dev.keycode	= hil_kbd_set1;
-+	kbd->dev.name		= strlen(kbd->rnm) ? kbd->rnm : HIL_GENERIC_NAME;
-+	kbd->dev.phys		= "hpkbd/input0";	/* XXX */
-+	kbd->dev.rep[REP_DELAY] = HZ/4; /* auto-repeat values */
-+	kbd->dev.rep[REP_PERIOD]= HZ/8;
-+
-+	kbd->dev.id.bustype	= BUS_HIL;
-+	kbd->dev.id.vendor	= PCI_VENDOR_ID_HP;
-+	kbd->dev.id.product	= 0x0001; /* TODO: get from kbd->rsc */
-+	kbd->dev.id.version	= 0x0100; /* TODO: get from kbd->rsc */
-+
-+	for (i = 0; i < 128; i++) {
-+		set_bit(hil_kbd_set1[i], kbd->dev.keybit);
-+		set_bit(hil_kbd_set3[i], kbd->dev.keybit);
-+	}
-+	clear_bit(0, kbd->dev.keybit);
-+
-+	input_register_device(&kbd->dev);
-+	printk(KERN_INFO "input: %s, ID: %d\n",
-+		kbd->dev.name, did);
-+
-+	serio->write(serio, 0);
-+	serio->write(serio, 0);
-+	serio->write(serio, HIL_PKT_CMD >> 8);
-+	serio->write(serio, HIL_CMD_EK1); /* Enable Keyswitch Autorepeat 1 */
-+	down(&(kbd->sem));
-+	up(&(kbd->sem));
-+
-+	return;
-+ bail1:
-+	serio_close(serio);
-+ bail0:
-+	kfree(kbd);
-+}
-+
-+
-+struct serio_dev hil_kbd_serio_dev = {
-+	.connect =	hil_kbd_connect,
-+	.disconnect =	hil_kbd_disconnect,
-+	.interrupt =	hil_kbd_interrupt
-+};
-+
-+static int __init hil_kbd_init(void)
-+{
-+	serio_register_device(&hil_kbd_serio_dev);
-+        return 0;
-+}
-+                
-+static void __exit hil_kbd_exit(void)
-+{
-+	serio_unregister_device(&hil_kbd_serio_dev);
-+}
-+                        
-+module_init(hil_kbd_init);
-+module_exit(hil_kbd_exit);
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/cache.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/cache.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/cache.c	2005-01-15 20:15:13.000000000 -0500
-@@ -33,6 +33,17 @@
- int icache_stride;
- EXPORT_SYMBOL(dcache_stride);
++ * 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
+  */
  
-+
-+#if defined(CONFIG_SMP)
-+/* On some machines (e.g. ones with the Merced bus), there can be
-+ * only a single PxTLB broadcast at a time; this must be guaranteed
-+ * by software.  We put a spinlock around all TLB flushes  to
-+ * ensure this.
-+ */
-+spinlock_t pa_tlb_lock = SPIN_LOCK_UNLOCKED;
-+EXPORT_SYMBOL(pa_tlb_lock);
-+#endif
-+
- struct pdc_cache_info cache_info;
- #ifndef CONFIG_PA20
- static struct pdc_btlb_info btlb_info;
-@@ -307,3 +318,13 @@
- EXPORT_SYMBOL(flush_kernel_dcache_page);
- EXPORT_SYMBOL(flush_data_cache_local);
- EXPORT_SYMBOL(flush_kernel_icache_range_asm);
-+
-+void clear_user_page_asm(void *page, unsigned long vaddr)
-+{
-+	/* This function is implemented in assembly in pacache.S */
-+	extern void __clear_user_page_asm(void *page, unsigned long vaddr);
-+
-+	purge_tlb_start();
-+	__clear_user_page_asm(page, vaddr);
-+	purge_tlb_end();
-+}
-Index: debian-kernel-hppa-2.6.8/kernel/printk.c
+ #ifndef SYM53C8XX_H
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_conf.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/kernel/printk.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/kernel/printk.c	2005-01-15 20:15:13.000000000 -0500
-@@ -91,8 +91,8 @@
-  * must be masked before subscripting
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_conf.h	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_conf.h	2005-02-01 01:38:32.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
   */
- static unsigned long log_start;	/* Index into log_buf: next char to be read by syslog() */
--static unsigned long con_start;	/* Index into log_buf: next char to be sent to consoles */
--static unsigned long log_end;	/* Index into log_buf: most-recently-written-char + 1 */
-+unsigned long con_start;	/* Index into log_buf: next char to be sent to consoles */
-+unsigned long log_end;	/* Index into log_buf: most-recently-written-char + 1 */
- static unsigned long logged_chars; /* Number of chars produced since last read+clear operation */
  
- /*
-@@ -775,6 +775,11 @@
- 	if (!(console->flags & CON_ENABLED))
- 		return;
- 
-+	if (console_drivers && (console_drivers->flags & CON_BOOT)) {
-+		unregister_console(console_drivers);
-+		console->flags &= ~CON_PRINTBUFFER;
-+	}
-+
- 	/*
- 	 *	Put this console in the list - keep the
- 	 *	preferred driver at the head of the list.
-Index: debian-kernel-hppa-2.6.8/drivers/input/misc/hp_sdc_rtc.c
+ #ifndef SYM_CONF_H
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_defs.h
 ===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ debian-kernel-hppa-2.6.8/drivers/input/misc/hp_sdc_rtc.c	2005-01-15 20:15:13.000000000 -0500
-@@ -0,0 +1,726 @@
-+/*
-+ * HP i8042 SDC + MSM-58321 BBRTC driver.
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_defs.h	2004-08-14 01:36:56.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_defs.h	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
+- *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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.
 + *
-+ * Copyright (c) 2001 Brian S. Julin
-+ * All rights reserved.
++ * 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.
 + *
-+ * 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:
-+ * System Device Controller Microprocessor Firmware Theory of Operation
-+ *      for Part Number 1820-4784 Revision B.  Dwg No. A-1820-4784-2
-+ * efirtc.c by Stephane Eranian/Hewlett Packard
-+ *
-+ */
-+
-+#include <linux/hp_sdc.h>
-+#include <linux/errno.h>
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/module.h>
-+#include <linux/time.h>
-+#include <linux/miscdevice.h>
-+#include <linux/proc_fs.h>
-+#include <linux/poll.h>
-+#include <linux/rtc.h>
-+
-+MODULE_AUTHOR("Brian S. Julin <bri at calyx.com>");
-+MODULE_DESCRIPTION("HP i8042 SDC + MSM-58321 RTC Driver");
-+MODULE_LICENSE("Dual BSD/GPL");
-+
-+#define RTC_VERSION "1.10d"
-+
-+static unsigned long epoch = 2000;
-+
-+static struct semaphore i8042tregs;
-+
-+static hp_sdc_irqhook hp_sdc_rtc_isr;
-+
-+static struct fasync_struct *hp_sdc_rtc_async_queue;
-+
-+static DECLARE_WAIT_QUEUE_HEAD(hp_sdc_rtc_wait);
-+
-+static loff_t hp_sdc_rtc_llseek(struct file *file, loff_t offset, int origin);
-+
-+static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
-+			       size_t count, loff_t *ppos);
-+
-+static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file,
-+			    unsigned int cmd, unsigned long arg);
-+
-+static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait);
-+
-+static int hp_sdc_rtc_open(struct inode *inode, struct file *file);
-+static int hp_sdc_rtc_release(struct inode *inode, struct file *file);
-+static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on);
-+
-+static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off,
-+				int count, int *eof, void *data);
-+
-+static void hp_sdc_rtc_isr (int irq, void *dev_id, 
-+			    uint8_t status, uint8_t data) 
-+{
-+	return;
-+}
-+
-+static int hp_sdc_rtc_do_read_bbrtc (struct rtc_time *rtctm)
-+{
-+	struct semaphore tsem;
-+	hp_sdc_transaction t;
-+	uint8_t tseq[91];
-+	int i;
-+	
-+	i = 0;
-+	while (i < 91) {
-+		tseq[i++] = HP_SDC_ACT_DATAREG |
-+			HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN;
-+		tseq[i++] = 0x01;			/* write i8042[0x70] */
-+	  	tseq[i]   = i / 7;			/* BBRTC reg address */
-+		i++;
-+		tseq[i++] = HP_SDC_CMD_DO_RTCR;		/* Trigger command   */
-+		tseq[i++] = 2;		/* expect 1 stat/dat pair back.   */
-+		i++; i++;               /* buffer for stat/dat pair       */
-+	}
-+	tseq[84] |= HP_SDC_ACT_SEMAPHORE;
-+	t.endidx =		91;
-+	t.seq =			tseq;
-+	t.act.semaphore =	&tsem;
-+	init_MUTEX_LOCKED(&tsem);
-+	
-+	if (hp_sdc_enqueue_transaction(&t)) return -1;
-+	
-+	down_interruptible(&tsem);  /* Put ourselves to sleep for results. */
-+	
-+	/* Check for nonpresence of BBRTC */
-+	if (!((tseq[83] | tseq[90] | tseq[69] | tseq[76] |
-+	       tseq[55] | tseq[62] | tseq[34] | tseq[41] |
-+	       tseq[20] | tseq[27] | tseq[6]  | tseq[13]) & 0x0f))
-+		return -1;
-+
-+	memset(rtctm, 0, sizeof(struct rtc_time));
-+	rtctm->tm_year = (tseq[83] & 0x0f) + (tseq[90] & 0x0f) * 10;
-+	rtctm->tm_mon  = (tseq[69] & 0x0f) + (tseq[76] & 0x0f) * 10;
-+	rtctm->tm_mday = (tseq[55] & 0x0f) + (tseq[62] & 0x0f) * 10;
-+	rtctm->tm_wday = (tseq[48] & 0x0f);
-+	rtctm->tm_hour = (tseq[34] & 0x0f) + (tseq[41] & 0x0f) * 10;
-+	rtctm->tm_min  = (tseq[20] & 0x0f) + (tseq[27] & 0x0f) * 10;
-+	rtctm->tm_sec  = (tseq[6]  & 0x0f) + (tseq[13] & 0x0f) * 10;
-+	
-+	return 0;
-+}
-+
-+static int hp_sdc_rtc_read_bbrtc (struct rtc_time *rtctm)
-+{
-+	struct rtc_time tm, tm_last;
-+	int i = 0;
-+
-+	/* MSM-58321 has no read latch, so must read twice and compare. */
-+
-+	if (hp_sdc_rtc_do_read_bbrtc(&tm_last)) return -1;
-+	if (hp_sdc_rtc_do_read_bbrtc(&tm)) return -1;
-+
-+	while (memcmp(&tm, &tm_last, sizeof(struct rtc_time))) {
-+		if (i++ > 4) return -1;
-+		memcpy(&tm_last, &tm, sizeof(struct rtc_time));
-+		if (hp_sdc_rtc_do_read_bbrtc(&tm)) return -1;
-+	}
-+
-+	memcpy(rtctm, &tm, sizeof(struct rtc_time));
-+
-+	return 0;
-+}
-+
-+
-+static int64_t hp_sdc_rtc_read_i8042timer (uint8_t loadcmd, int numreg)
-+{
-+	hp_sdc_transaction t;
-+	uint8_t tseq[26] = {
-+		HP_SDC_ACT_PRECMD | HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN,
-+		0,
-+		HP_SDC_CMD_READ_T1, 2, 0, 0,
-+		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
-+		HP_SDC_CMD_READ_T2, 2, 0, 0,
-+		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
-+		HP_SDC_CMD_READ_T3, 2, 0, 0,
-+		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
-+		HP_SDC_CMD_READ_T4, 2, 0, 0,
-+		HP_SDC_ACT_POSTCMD | HP_SDC_ACT_DATAIN, 
-+		HP_SDC_CMD_READ_T5, 2, 0, 0
-+	};
-+
-+	t.endidx = numreg * 5;
-+
-+	tseq[1] = loadcmd;
-+	tseq[t.endidx - 4] |= HP_SDC_ACT_SEMAPHORE; /* numreg assumed > 1 */
-+
-+	t.seq =			tseq;
-+	t.act.semaphore =	&i8042tregs;
-+
-+	down_interruptible(&i8042tregs);  /* Sleep if output regs in use. */
-+
-+	if (hp_sdc_enqueue_transaction(&t)) return -1;
-+	
-+	down_interruptible(&i8042tregs);  /* Sleep until results come back. */
-+	up(&i8042tregs);
-+
-+	return (tseq[5] | 
-+		((uint64_t)(tseq[10]) << 8)  | ((uint64_t)(tseq[15]) << 16) |
-+		((uint64_t)(tseq[20]) << 24) | ((uint64_t)(tseq[25]) << 32));
-+}
-+
-+
-+/* Read the i8042 real-time clock */
-+static inline int hp_sdc_rtc_read_rt(struct timeval *res) {
-+	int64_t raw;
-+	uint32_t tenms; 
-+	unsigned int days;
-+
-+	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_RT, 5);
-+	if (raw < 0) return -1;
-+
-+	tenms = (uint32_t)raw & 0xffffff;
-+	days  = (unsigned int)(raw >> 24) & 0xffff;
-+
-+	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
-+	res->tv_sec =  (time_t)(tenms / 100) + days * 86400;
-+
-+	return 0;
-+}
-+
-+
-+/* Read the i8042 fast handshake timer */
-+static inline int hp_sdc_rtc_read_fhs(struct timeval *res) {
-+	uint64_t raw;
-+	unsigned int tenms;
-+
-+	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_FHS, 2);
-+	if (raw < 0) return -1;
-+
-+	tenms = (unsigned int)raw & 0xffff;
-+
-+	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
-+	res->tv_sec  = (time_t)(tenms / 100);
-+
-+	return 0;
-+}
-+
-+
-+/* Read the i8042 match timer (a.k.a. alarm) */
-+static inline int hp_sdc_rtc_read_mt(struct timeval *res) {
-+	int64_t raw;	
-+	uint32_t tenms; 
-+
-+	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_MT, 3);
-+	if (raw < 0) return -1;
-+
-+	tenms = (uint32_t)raw & 0xffffff;
-+
-+	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
-+	res->tv_sec  = (time_t)(tenms / 100);
-+
-+	return 0;
-+}
-+
-+
-+/* Read the i8042 delay timer */
-+static inline int hp_sdc_rtc_read_dt(struct timeval *res) {
-+	int64_t raw;
-+	uint32_t tenms;
-+
-+	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_DT, 3);
-+	if (raw < 0) return -1;
-+
-+	tenms = (uint32_t)raw & 0xffffff;
-+
-+	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
-+	res->tv_sec  = (time_t)(tenms / 100);
-+
-+	return 0;
-+}
-+
-+
-+/* Read the i8042 cycle timer (a.k.a. periodic) */
-+static inline int hp_sdc_rtc_read_ct(struct timeval *res) {
-+	int64_t raw;
-+	uint32_t tenms;
-+
-+	raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_CT, 3);
-+	if (raw < 0) return -1;
-+
-+	tenms = (uint32_t)raw & 0xffffff;
-+
-+	res->tv_usec = (suseconds_t)(tenms % 100) * 10000;
-+	res->tv_sec  = (time_t)(tenms / 100);
-+
-+	return 0;
-+}
-+
-+
-+/* Set the i8042 real-time clock */
-+static int hp_sdc_rtc_set_rt (struct timeval *setto)
-+{
-+	uint32_t tenms;
-+	unsigned int days;
-+	hp_sdc_transaction t;
-+	uint8_t tseq[11] = {
-+		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
-+		HP_SDC_CMD_SET_RTMS, 3, 0, 0, 0,
-+		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
-+		HP_SDC_CMD_SET_RTD, 2, 0, 0 
-+	};
-+
-+	t.endidx = 10;
-+
-+	if (0xffff < setto->tv_sec / 86400) return -1;
-+	days = setto->tv_sec / 86400;
-+	if (0xffff < setto->tv_usec / 1000000 / 86400) return -1;
-+	days += ((setto->tv_sec % 86400) + setto->tv_usec / 1000000) / 86400;
-+	if (days > 0xffff) return -1;
-+
-+	if (0xffffff < setto->tv_sec) return -1;
-+	tenms  = setto->tv_sec * 100;
-+	if (0xffffff < setto->tv_usec / 10000) return -1;
-+	tenms += setto->tv_usec / 10000;
-+	if (tenms > 0xffffff) return -1;
-+
-+	tseq[3] = (uint8_t)(tenms & 0xff);
-+	tseq[4] = (uint8_t)((tenms >> 8)  & 0xff);
-+	tseq[5] = (uint8_t)((tenms >> 16) & 0xff);
-+
-+	tseq[9] = (uint8_t)(days & 0xff);
-+	tseq[10] = (uint8_t)((days >> 8) & 0xff);
-+
-+	t.seq =	tseq;
-+
-+	if (hp_sdc_enqueue_transaction(&t)) return -1;
-+	return 0;
-+}
-+
-+/* Set the i8042 fast handshake timer */
-+static int hp_sdc_rtc_set_fhs (struct timeval *setto)
-+{
-+	uint32_t tenms;
-+	hp_sdc_transaction t;
-+	uint8_t tseq[5] = {
-+		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
-+		HP_SDC_CMD_SET_FHS, 2, 0, 0
-+	};
-+
-+	t.endidx = 4;
-+
-+	if (0xffff < setto->tv_sec) return -1;
-+	tenms  = setto->tv_sec * 100;
-+	if (0xffff < setto->tv_usec / 10000) return -1;
-+	tenms += setto->tv_usec / 10000;
-+	if (tenms > 0xffff) return -1;
-+
-+	tseq[3] = (uint8_t)(tenms & 0xff);
-+	tseq[4] = (uint8_t)((tenms >> 8)  & 0xff);
-+
-+	t.seq =	tseq;
-+
-+	if (hp_sdc_enqueue_transaction(&t)) return -1;
-+	return 0;
-+}
-+
-+
-+/* Set the i8042 match timer (a.k.a. alarm) */
-+#define hp_sdc_rtc_set_mt (setto) \
-+	hp_sdc_rtc_set_i8042timer(setto, HP_SDC_CMD_SET_MT)
-+
-+/* Set the i8042 delay timer */
-+#define hp_sdc_rtc_set_dt (setto) \
-+	hp_sdc_rtc_set_i8042timer(setto, HP_SDC_CMD_SET_DT)
-+
-+/* Set the i8042 cycle timer (a.k.a. periodic) */
-+#define hp_sdc_rtc_set_ct (setto) \
-+	hp_sdc_rtc_set_i8042timer(setto, HP_SDC_CMD_SET_CT)
-+
-+/* Set one of the i8042 3-byte wide timers */
-+static int hp_sdc_rtc_set_i8042timer (struct timeval *setto, uint8_t setcmd)
-+{
-+	uint32_t tenms;
-+	hp_sdc_transaction t;
-+	uint8_t tseq[6] = {
-+		HP_SDC_ACT_PRECMD | HP_SDC_ACT_DATAOUT,
-+		0, 3, 0, 0, 0
-+	};
-+
-+	t.endidx = 6;
-+
-+	if (0xffffff < setto->tv_sec) return -1;
-+	tenms  = setto->tv_sec * 100;
-+	if (0xffffff < setto->tv_usec / 10000) return -1;
-+	tenms += setto->tv_usec / 10000;
-+	if (tenms > 0xffffff) return -1;
-+
-+	tseq[1] = setcmd;
-+	tseq[3] = (uint8_t)(tenms & 0xff);
-+	tseq[4] = (uint8_t)((tenms >> 8)  & 0xff);
-+	tseq[5] = (uint8_t)((tenms >> 16)  & 0xff);
-+
-+	t.seq =			tseq;
-+
-+	if (hp_sdc_enqueue_transaction(&t)) { 
-+		return -1;
-+	}
-+	return 0;
-+}
-+
-+static loff_t hp_sdc_rtc_llseek(struct file *file, loff_t offset, int origin)
-+{
-+        return -ESPIPE;
-+}
-+
-+static ssize_t hp_sdc_rtc_read(struct file *file, char *buf,
-+			       size_t count, loff_t *ppos) {
-+	ssize_t retval;
-+
-+        if (count < sizeof(unsigned long))
-+                return -EINVAL;
-+
-+	retval = put_user(68, (unsigned long *)buf);
-+	return retval;
-+}
-+
-+static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait)
-+{
-+        unsigned long l;
-+
-+	l = 0;
-+        if (l != 0)
-+                return POLLIN | POLLRDNORM;
-+        return 0;
-+}
-+
-+static int hp_sdc_rtc_open(struct inode *inode, struct file *file)
-+{
-+	MOD_INC_USE_COUNT;
-+        return 0;
-+}
-+
-+static int hp_sdc_rtc_release(struct inode *inode, struct file *file)
-+{
-+	/* Turn off interrupts? */
-+
-+        if (file->f_flags & FASYNC) {
-+                hp_sdc_rtc_fasync (-1, file, 0);
-+        }
-+
-+	MOD_DEC_USE_COUNT;
-+        return 0;
-+}
-+
-+static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on)
-+{
-+        return fasync_helper (fd, filp, on, &hp_sdc_rtc_async_queue);
-+}
-+
-+static int hp_sdc_rtc_proc_output (char *buf)
-+{
-+#define YN(bit) ("no")
-+#define NY(bit) ("yes")
-+        char *p;
-+        struct rtc_time tm;
-+	struct timeval tv;
-+
-+	memset(&tm, 0, sizeof(struct rtc_time));
-+
-+	p = buf;
-+
-+	if (hp_sdc_rtc_read_bbrtc(&tm)) {
-+		p += sprintf(p, "BBRTC\t\t: READ FAILED!\n");
-+	} else {
-+		p += sprintf(p,
-+			     "rtc_time\t: %02d:%02d:%02d\n"
-+			     "rtc_date\t: %04d-%02d-%02d\n"
-+			     "rtc_epoch\t: %04lu\n",
-+			     tm.tm_hour, tm.tm_min, tm.tm_sec,
-+			     tm.tm_year + 1900, tm.tm_mon + 1, 
-+			     tm.tm_mday, epoch);
-+	}
-+
-+	if (hp_sdc_rtc_read_rt(&tv)) {
-+		p += sprintf(p, "i8042 rtc\t: READ FAILED!\n");
-+	} else {
-+		p += sprintf(p, "i8042 rtc\t: %d.%02d seconds\n", 
-+			     tv.tv_sec, tv.tv_usec/1000);
-+	}
-+
-+	if (hp_sdc_rtc_read_fhs(&tv)) {
-+		p += sprintf(p, "handshake\t: READ FAILED!\n");
-+	} else {
-+        	p += sprintf(p, "handshake\t: %d.%02d seconds\n", 
-+			     tv.tv_sec, tv.tv_usec/1000);
-+	}
-+
-+	if (hp_sdc_rtc_read_mt(&tv)) {
-+		p += sprintf(p, "alarm\t\t: READ FAILED!\n");
-+	} else {
-+		p += sprintf(p, "alarm\t\t: %d.%02d seconds\n", 
-+			     tv.tv_sec, tv.tv_usec/1000);
-+	}
-+
-+	if (hp_sdc_rtc_read_dt(&tv)) {
-+		p += sprintf(p, "delay\t\t: READ FAILED!\n");
-+	} else {
-+		p += sprintf(p, "delay\t\t: %d.%02d seconds\n", 
-+			     tv.tv_sec, tv.tv_usec/1000);
-+	}
-+
-+	if (hp_sdc_rtc_read_ct(&tv)) {
-+		p += sprintf(p, "periodic\t: READ FAILED!\n");
-+	} else {
-+		p += sprintf(p, "periodic\t: %d.%02d seconds\n", 
-+			     tv.tv_sec, tv.tv_usec/1000);
-+	}
-+
-+        p += sprintf(p,
-+                     "DST_enable\t: %s\n"
-+                     "BCD\t\t: %s\n"
-+                     "24hr\t\t: %s\n"
-+                     "square_wave\t: %s\n"
-+                     "alarm_IRQ\t: %s\n"
-+                     "update_IRQ\t: %s\n"
-+                     "periodic_IRQ\t: %s\n"
-+		     "periodic_freq\t: %ld\n"
-+                     "batt_status\t: %s\n",
-+                     YN(RTC_DST_EN),
-+                     NY(RTC_DM_BINARY),
-+                     YN(RTC_24H),
-+                     YN(RTC_SQWE),
-+                     YN(RTC_AIE),
-+                     YN(RTC_UIE),
-+                     YN(RTC_PIE),
-+                     1UL,
-+                     1 ? "okay" : "dead");
-+
-+        return  p - buf;
-+#undef YN
-+#undef NY
-+}
-+
-+static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off,
-+                         int count, int *eof, void *data)
-+{
-+	int len = hp_sdc_rtc_proc_output (page);
-+        if (len <= off+count) *eof = 1;
-+        *start = page + off;
-+        len -= off;
-+        if (len>count) len = count;
-+        if (len<0) len = 0;
-+        return len;
-+}
-+
-+static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, 
-+			    unsigned int cmd, unsigned long arg)
-+{
-+#if 1
-+	return -EINVAL;
-+#else
-+	
-+        struct rtc_time wtime; 
-+	struct timeval ttime;
-+	int use_wtime = 0;
-+
-+	/* This needs major work. */
-+
-+        switch (cmd) {
-+
-+        case RTC_AIE_OFF:       /* Mask alarm int. enab. bit    */
-+        case RTC_AIE_ON:        /* Allow alarm interrupts.      */
-+	case RTC_PIE_OFF:       /* Mask periodic int. enab. bit */
-+        case RTC_PIE_ON:        /* Allow periodic ints          */
-+        case RTC_UIE_ON:        /* Allow ints for RTC updates.  */
-+        case RTC_UIE_OFF:       /* Allow ints for RTC updates.  */
-+        {
-+		/* We cannot mask individual user timers and we
-+		   cannot tell them apart when they occur, so it 
-+		   would be disingenuous to succeed these IOCTLs */
-+		return -EINVAL;
-+        }
-+        case RTC_ALM_READ:      /* Read the present alarm time */
-+        {
-+		if (hp_sdc_rtc_read_mt(&ttime)) return -EFAULT;
-+		if (hp_sdc_rtc_read_bbrtc(&wtime)) return -EFAULT;
-+
-+		wtime.tm_hour = ttime.tv_sec / 3600;  ttime.tv_sec %= 3600;
-+		wtime.tm_min  = ttime.tv_sec / 60;    ttime.tv_sec %= 60;
-+		wtime.tm_sec  = ttime.tv_sec;
-+                
-+		break;
-+        }
-+        case RTC_IRQP_READ:     /* Read the periodic IRQ rate.  */
-+        {
-+                return put_user(hp_sdc_rtc_freq, (unsigned long *)arg);
-+        }
-+        case RTC_IRQP_SET:      /* Set periodic IRQ rate.       */
-+        {
-+                /* 
-+                 * The max we can do is 100Hz.
-+		 */
-+
-+                if ((arg < 1) || (arg > 100)) return -EINVAL;
-+		ttime.tv_sec = 0;
-+		ttime.tv_usec = 1000000 / arg;
-+		if (hp_sdc_rtc_set_ct(&ttime)) return -EFAULT;
-+		hp_sdc_rtc_freq = arg;
-+                return 0;
-+        }
-+        case RTC_ALM_SET:       /* Store a time into the alarm */
-+        {
-+                /*
-+                 * This expects a struct hp_sdc_rtc_time. Writing 0xff means
-+                 * "don't care" or "match all" for PC timers.  The HP SDC
-+		 * does not support that perk, but it could be emulated fairly
-+		 * easily.  Only the tm_hour, tm_min and tm_sec are used.
-+		 * We could do it with 10ms accuracy with the HP SDC, if the 
-+		 * rtc interface left us a way to do that.
-+                 */
-+                struct hp_sdc_rtc_time alm_tm;
-+
-+                if (copy_from_user(&alm_tm, (struct hp_sdc_rtc_time*)arg,
-+                                   sizeof(struct hp_sdc_rtc_time)))
-+                       return -EFAULT;
-+
-+                if (alm_tm.tm_hour > 23) return -EINVAL;
-+		if (alm_tm.tm_min  > 59) return -EINVAL;
-+		if (alm_tm.tm_sec  > 59) return -EINVAL;  
-+
-+		ttime.sec = alm_tm.tm_hour * 3600 + 
-+		  alm_tm.tm_min * 60 + alm_tm.tm_sec;
-+		ttime.usec = 0;
-+		if (hp_sdc_rtc_set_mt(&ttime)) return -EFAULT;
-+                return 0;
-+        }
-+        case RTC_RD_TIME:       /* Read the time/date from RTC  */
-+        {
-+		if (hp_sdc_rtc_read_bbrtc(&wtime)) return -EFAULT;
-+                break;
-+        }
-+        case RTC_SET_TIME:      /* Set the RTC */
-+        {
-+                struct rtc_time hp_sdc_rtc_tm;
-+                unsigned char mon, day, hrs, min, sec, leap_yr;
-+                unsigned int yrs;
-+
-+                if (!capable(CAP_SYS_TIME))
-+                        return -EACCES;
-+		if (copy_from_user(&hp_sdc_rtc_tm, (struct rtc_time *)arg,
-+                                   sizeof(struct rtc_time)))
-+                        return -EFAULT;
-+
-+                yrs = hp_sdc_rtc_tm.tm_year + 1900;
-+                mon = hp_sdc_rtc_tm.tm_mon + 1;   /* tm_mon starts at zero */
-+                day = hp_sdc_rtc_tm.tm_mday;
-+                hrs = hp_sdc_rtc_tm.tm_hour;
-+                min = hp_sdc_rtc_tm.tm_min;
-+                sec = hp_sdc_rtc_tm.tm_sec;
-+
-+                if (yrs < 1970)
-+                        return -EINVAL;
-+
-+                leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400));
-+
-+                if ((mon > 12) || (day == 0))
-+                        return -EINVAL;
-+                if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr)))
-+                        return -EINVAL;
-+		if ((hrs >= 24) || (min >= 60) || (sec >= 60))
-+                        return -EINVAL;
-+
-+                if ((yrs -= eH) > 255)    /* They are unsigned */
-+                        return -EINVAL;
-+
-+
-+                return 0;
-+        }
-+        case RTC_EPOCH_READ:    /* Read the epoch.      */
-+        {
-+                return put_user (epoch, (unsigned long *)arg);
-+        }
-+        case RTC_EPOCH_SET:     /* Set the epoch.       */
-+        {
-+                /* 
-+                 * There were no RTC clocks before 1900.
-+                 */
-+                if (arg < 1900)
-+		  return -EINVAL;
-+		if (!capable(CAP_SYS_TIME))
-+		  return -EACCES;
-+		
-+                epoch = arg;
-+                return 0;
-+        }
-+        default:
-+                return -EINVAL;
-+        }
-+        return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
-+#endif
-+}
-+
-+static struct file_operations hp_sdc_rtc_fops = {
-+        .owner =	THIS_MODULE,
-+        .llseek =	hp_sdc_rtc_llseek,
-+        .read =		hp_sdc_rtc_read,
-+        .poll =		hp_sdc_rtc_poll,
-+        .ioctl =	hp_sdc_rtc_ioctl,
-+        .open =		hp_sdc_rtc_open,
-+        .release =	hp_sdc_rtc_release,
-+        .fasync =	hp_sdc_rtc_fasync,
-+};
-+
-+static struct miscdevice hp_sdc_rtc_dev = {
-+        .minor =	RTC_MINOR,
-+        .name =		"rtc",
-+        .fops =		&hp_sdc_rtc_fops
-+};
-+
-+static int __init hp_sdc_rtc_init(void)
-+{
-+	int ret;
-+
-+	init_MUTEX(&i8042tregs);
-+
-+	if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr)))
-+		return ret;
-+	misc_register(&hp_sdc_rtc_dev);
-+        create_proc_read_entry ("driver/rtc", 0, 0, 
-+				hp_sdc_rtc_read_proc, NULL);
-+
-+	printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded "
-+			 "(RTC v " RTC_VERSION ")\n");
-+
-+	return 0;
-+}
-+
-+static void __exit hp_sdc_rtc_exit(void)
-+{
-+	remove_proc_entry ("driver/rtc", NULL);
-+        misc_deregister(&hp_sdc_rtc_dev);
-+	hp_sdc_release_timer_irq(hp_sdc_rtc_isr);
-+        printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support unloaded\n");
-+}
-+
-+module_init(hp_sdc_rtc_init);
-+module_exit(hp_sdc_rtc_exit);
++ * 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
+  */
+ 
+ #ifndef SYM_DEFS_H
 Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw.c	2005-01-15 20:15:13.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw.c	2004-08-14 01:38:08.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw.c	2005-02-01 01:38:33.000000000 -0500
 @@ -22,32 +22,19 @@
   *
   *-----------------------------------------------------------------------------
@@ -11302,47 +8923,10 @@
  			}
  			/*
  			 *  If PREFETCH feature not enabled, remove 
-Index: debian-kernel-hppa-2.6.8/drivers/parisc/sba_iommu.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/parisc/sba_iommu.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/parisc/sba_iommu.c	2005-01-15 20:15:13.000000000 -0500
-@@ -1,8 +1,9 @@
- /*
- **  System Bus Adapter (SBA) I/O MMU manager
- **
--**	(c) Copyright 2000 Grant Grundler
--**	(c) Copyright 2000 Hewlett-Packard Company
-+**	(c) Copyright 2000-2004 Grant Grundler <grundler @ parisc-linux x org>
-+**	(c) Copyright 2004 Naresh Kumar Inna <knaresh at india x hp x com>
-+**	(c) Copyright 2000-2004 Hewlett-Packard Company
- **
- **	Portions (c) 1999 Dave S. Miller (from sparc64 I/O MMU code)
- **
-Index: debian-kernel-hppa-2.6.8/drivers/input/serio/Makefile
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/serio/Makefile	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/serio/Makefile	2005-01-15 20:15:13.000000000 -0500
-@@ -2,8 +2,6 @@
- # Makefile for the input core drivers.
- #
- 
--# Each configuration option enables a list of files.
--
- obj-$(CONFIG_SERIO)		+= serio.o
- obj-$(CONFIG_SERIO_I8042)	+= i8042.o
- obj-$(CONFIG_SERIO_PARKBD)	+= parkbd.o
-@@ -15,5 +13,7 @@
- obj-$(CONFIG_SERIO_Q40KBD)	+= q40kbd.o
- obj-$(CONFIG_SERIO_98KBD)	+= 98kbd-io.o
- obj-$(CONFIG_SERIO_GSCPS2)	+= gscps2.o
-+obj-$(CONFIG_HP_SDC)		+= hp_sdc.o
-+obj-$(CONFIG_HIL_MLC)		+= hp_sdc_mlc.o hil_mlc.o
- obj-$(CONFIG_SERIO_PCIPS2)	+= pcips2.o
- obj-$(CONFIG_SERIO_MACEPS2)	+= maceps2.o
 Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw.h	2005-01-15 20:15:13.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw.h	2004-08-14 01:37:14.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw.h	2005-02-01 01:38:33.000000000 -0500
 @@ -22,32 +22,19 @@
   *
   *-----------------------------------------------------------------------------
@@ -11389,10 +8973,10 @@
   */
  
  #ifndef	SYM_FW_H
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.c
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw1.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_misc.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.c	2005-01-15 20:15:13.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw1.h	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw1.h	2005-02-01 01:38:32.000000000 -0500
 @@ -22,32 +22,19 @@
   *
   *-----------------------------------------------------------------------------
@@ -11436,249 +9020,845 @@
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
- #ifdef __FreeBSD__
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/unwind.c
+ /*
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw2.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/unwind.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/unwind.c	2005-01-15 20:15:13.000000000 -0500
-@@ -12,8 +12,10 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/slab.h>
-+#include <linux/kallsyms.h>
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_fw2.h	2004-08-14 01:37:40.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_fw2.h	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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 <asm/uaccess.h>
-+#include <asm/assembly.h>
+ /*
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_glue.c	2005-02-01 01:36:43.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.c	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
+  */
+ #define SYM_GLUE_C
  
- #include <asm/unwind.h>
+@@ -636,7 +623,6 @@
+ 	switch (cp->cdb_buf[0]) {
+ 	case 0x0A: case 0x2A: case 0xAA:
+ 		panic("XXXXXXXXXXXXX WRITE NOT YET ALLOWED XXXXXXXXXXXXXX\n");
+-		MDELAY(10000);
+ 		break;
+ 	default:
+ 		break;
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_glue.h	2004-08-14 01:38:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_glue.h	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
+  */
  
-@@ -43,22 +45,24 @@
- 	const struct unwind_table_entry *e = 0;
- 	unsigned long lo, hi, mid;
+ #ifndef SYM_GLUE_H
+@@ -89,7 +76,6 @@
  
--	for (lo = 0, hi = table->length; lo < hi; )
--	{
--		mid = (lo + hi) / 2;
-+	lo = 0; 
-+	hi = table->length - 1; 
-+	
-+	while (lo <= hi) {
-+		mid = (hi - lo) / 2 + lo;
- 		e = &table->table[mid];
- 		if (addr < e->region_start)
--			hi = mid;
-+			hi = mid - 1;
- 		else if (addr > e->region_end)
- 			lo = mid + 1;
- 		else
--			break;
-+			return e;
- 	}
+ #define SYM_OPT_HANDLE_DIR_UNKNOWN
+ #define SYM_OPT_HANDLE_DEVICE_QUEUEING
+-#define SYM_OPT_NVRAM_PRE_READ
+ #define SYM_OPT_SNIFF_INQUIRY
+ #define SYM_OPT_LIMIT_COMMAND_REORDERING
+ #define	SYM_OPT_ANNOUNCE_TRANSFER_RATE
+@@ -108,10 +94,9 @@
+ #define	printf(args...)		printk(args)
  
--	return e;
-+	return NULL;
- }
+ /*
+- *  Insert a delay in micro-seconds and milli-seconds.
++ *  Insert a delay in micro-seconds
+  */
+ #define sym_udelay(us)	udelay(us)
+-#define sym_mdelay(ms)	mdelay(ms)
  
--static inline const struct unwind_table_entry *
-+static const struct unwind_table_entry *
- find_unwind_entry(unsigned long addr)
- {
- 	struct unwind_table *table = unwind_tables;
-@@ -68,8 +72,7 @@
- 	    addr <= kernel_unwind_table.end)
- 		e = find_unwind_entry_in_table(&kernel_unwind_table, addr);
- 	else
--		for (; table; table = table->next)
--		{
-+		for (; table; table = table->next) {
- 			if (addr >= table->start && 
- 			    addr <= table->end)
- 				e = find_unwind_entry_in_table(table, addr);
-@@ -99,6 +102,11 @@
- 	table->next = NULL;
+ /*
+  *  A 'read barrier' flushes any data that have been prefetched 
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_hipd.c	2004-08-14 01:36:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.c	2005-02-01 01:38:33.000000000 -0500
+@@ -3,6 +3,7 @@
+  * of PCI-SCSI IO processors.
+  *
+  * Copyright (C) 1999-2001  Gerard Roudier <groudier at free.fr>
++ * Copyright (c) 2003-2004  Matthew Wilcox <matthew at wil.cx>
+  *
+  * This driver is derived from the Linux sym53c8xx driver.
+  * Copyright (C) 1998-2000  Gerard Roudier
+@@ -22,35 +23,22 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
+- *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  */
  
- 	for (; start <= end; start++) {
-+		if (start < end && 
-+		    start->region_end > (start+1)->region_start) {
-+			printk("WARNING: Out of order unwind entry! %p and %p\n", start, start+1);
-+		}
-+
- 		start->region_start += base_addr;
- 		start->region_end += base_addr;
+-#define SYM_VERSION "2.1.18j"
++#define SYM_VERSION "2.1.18k"
+ #define SYM_DRIVER_NAME	"sym-" SYM_VERSION
+ 
+ #include "sym_glue.h"
+@@ -303,7 +291,6 @@
  	}
-@@ -170,12 +178,40 @@
- 	int looking_for_rp, rpoffset = 0;
+ out:
+ 	OUTB (nc_scntl1, 0);
+-	/* MDELAY(100); */
+ 	return retv;
+ }
  
- 	e = find_unwind_entry(info->ip);
--	if (!e) {
-+	if (e == NULL) {
- 		unsigned long sp;
- 		extern char _stext[], _etext[];
+@@ -1921,7 +1908,7 @@
+ 	if (np->features & (FE_ULTRA2|FE_ULTRA3)) {
+ 		OUTONW (nc_sien, SBMC);
+ 		if (reason == 0) {
+-			MDELAY(100);
++			mdelay(100);
+ 			INW (nc_sist);
+ 		}
+ 		np->scsi_mode = INB (nc_stest4) & SMODE;
+@@ -5510,7 +5497,6 @@
+ 		printf ("CCB=%lx STAT=%x/%x/%x DEV=%d/%d\n", (unsigned long)cp,
+ 			cp->host_status, cp->ssss_status, cp->host_flags,
+ 			cp->target, cp->lun);
+-		MDELAY(100);
+ 	}
  
- 		dbg("Cannot find unwind entry for 0x%lx; forced unwinding\n", info->ip);
+ 	/*
+@@ -5738,15 +5724,8 @@
+ /*
+  *  Soft-attach the controller.
+  */
+-#ifdef SYM_OPT_NVRAM_PRE_READ
+ int sym_hcb_attach(hcb_p np, struct sym_fw *fw, struct sym_nvram *nvram)
+-#else
+-int sym_hcb_attach(hcb_p np, struct sym_fw *fw)
+-#endif
+ {
+-#ifndef SYM_OPT_NVRAM_PRE_READ
+-	struct sym_nvram nvram_buf, *nvram = &nvram_buf;
+-#endif
+ 	int i;
  
-+#ifdef CONFIG_KALLSYMS
-+		/* Handle some frequent special cases.... */
-+		{
-+			char symname[KSYM_NAME_LEN+1];
-+			char *modname;
-+			unsigned long symsize, offset;
-+
-+			kallsyms_lookup(info->ip, &symsize, &offset,
-+					&modname, symname);
-+
-+			dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname);
-+
-+			if (strcmp(symname, "_switch_to_ret") == 0) {
-+				info->prev_sp = info->sp - CALLEE_SAVE_FRAME_SIZE;
-+				info->prev_ip = *(unsigned long *)(info->prev_sp - RP_OFFSET);
-+				dbg("_switch_to_ret @ %lx - setting "
-+				    "prev_sp=%lx prev_ip=%lx\n", 
-+				    info->ip, info->prev_sp, 
-+				    info->prev_ip);
-+				return;
-+			} else if (strcmp(symname, "ret_from_kernel_thread") == 0 ||
-+				   strcmp(symname, "syscall_exit") == 0) {
-+				info->prev_ip = info->prev_sp = 0;
-+				return;
-+			}
-+		}
-+#endif
-+
- 		/* Since we are doing the unwinding blind, we don't know if
- 		   we are adjusting the stack correctly or extracting the rp
- 		   correctly. The rp is checked to see if it belongs to the
-@@ -185,30 +221,33 @@
- 		   modules. */
- 		sp = info->sp & ~63;
- 		do {
--			info->prev_sp = sp - 64;
+ 	/*
+@@ -5773,13 +5752,6 @@
+ 	sym_chip_reset (np);
+ 
+ 	/*
+-	 *  Try to read the user set-up.
+-	 */
+-#ifndef SYM_OPT_NVRAM_PRE_READ
+-	(void) sym_read_nvram(np, nvram);
+-#endif
 -
--			/* FIXME: what happens if we unwind too far so that 
--			   sp no longer falls in a mapped kernel page? */
--#ifndef __LP64__
--			info->prev_ip = *(unsigned long *)(info->prev_sp - 20);
+-	/*
+ 	 *  Prepare controller and devices settings, according 
+ 	 *  to chip features, user set-up and driver set-up.
+ 	 */
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_hipd.h	2004-08-14 01:36:48.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_hipd.h	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
+  */
+ 
+ #ifndef SYM_HIPD_H
+@@ -1139,12 +1126,7 @@
+ int sym_abort_ccb(hcb_p np, ccb_p cp, int timed_out);
+ int sym_reset_scsi_target(hcb_p np, int target);
+ void sym_hcb_free(hcb_p np);
+-
+-#ifdef SYM_OPT_NVRAM_PRE_READ
+ int sym_hcb_attach(hcb_p np, struct sym_fw *fw, struct sym_nvram *nvram);
 -#else
--			info->prev_ip = *(unsigned long *)(info->prev_sp - 16);
+-int sym_hcb_attach(hcb_p np, struct sym_fw *fw);
 -#endif
-+			unsigned long tmp;
  
-+			info->prev_sp = sp - 64;
-+			info->prev_ip = 0;
-+			if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET))) 
-+				break;
-+			info->prev_ip = tmp;
- 			sp = info->prev_sp;
- 		} while (info->prev_ip < (unsigned long)_stext ||
- 			 info->prev_ip > (unsigned long)_etext);
+ /*
+  *  Optionnaly, the driver may handle IO timeouts.
+@@ -1388,7 +1370,6 @@
+ #define PRINT_ADDR	sym_print_addr
+ #define PRINT_TARGET	sym_print_target
+ #define PRINT_LUN	sym_print_lun
+-#define MDELAY		sym_mdelay
+ #define UDELAY		sym_udelay
  
--		dbg("analyzing func @ %lx with no unwind info, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
--	} else {
-+		info->rp = 0;
+ #endif /* SYM_HIPD_H */
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_malloc.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_malloc.c	2004-08-14 01:37:39.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_malloc.c	2005-02-01 01:38:32.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
+  */
  
--		dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, Save_RP = %d size = %u\n",
--				e->region_start, e->region_end, e->Save_SP, e->Save_RP, e->Total_frame_size);
-+		dbg("analyzing func @ %lx with no unwind info, setting "
-+		    "prev_sp=%lx prev_ip=%lx\n", info->ip, 
-+		    info->prev_sp, info->prev_ip);
-+	} else {
-+		dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, "
-+		    "Save_RP = %d size = %u\n", e->region_start, 
-+		    e->region_end, e->Save_SP, e->Save_RP, 
-+		    e->Total_frame_size);
+ #ifdef __FreeBSD__
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_misc.c	2004-08-14 01:37:40.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.c	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
+  */
  
- 		looking_for_rp = e->Save_RP;
+ #ifdef __FreeBSD__
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_misc.h	2004-08-14 01:38:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.h	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  */
  
- 		for (npc = e->region_start; 
--		     (frame_size < (e->Total_frame_size << 3) || looking_for_rp) && 
-+		     (frame_size < (e->Total_frame_size << 3) || 
-+		      looking_for_rp) && 
- 		     npc < info->ip; 
- 		     npc += 4) {
+ #ifndef SYM_MISC_H
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_nvram.c	2004-08-14 01:37:15.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.c	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
+  */
  
-@@ -219,22 +258,28 @@
- 				/* ldo X(sp), sp, or stwm X,D(sp) */
- 				frame_size += (insn & 0x1 ? -1 << 13 : 0) | 
- 					((insn & 0x3fff) >> 1);
--				dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
--			} else if ((insn & 0xffe00008) == 0x7ec00008) {
-+				dbg("analyzing func @ %lx, insn=%08x @ "
-+				    "%lx, frame_size = %ld\n", info->ip,
-+				    insn, npc, frame_size);
-+			} else if ((insn & 0xffe00008) == 0x73c00008) {
- 				/* std,ma X,D(sp) */
- 				frame_size += (insn & 0x1 ? -1 << 13 : 0) | 
- 					(((insn >> 4) & 0x3ff) << 3);
--				dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
-+				dbg("analyzing func @ %lx, insn=%08x @ "
-+				    "%lx, frame_size = %ld\n", info->ip,
-+				    insn, npc, frame_size);
- 			} else if (insn == 0x6bc23fd9) { 
- 				/* stw rp,-20(sp) */
- 				rpoffset = 20;
- 				looking_for_rp = 0;
--				dbg("analyzing func @ %lx, insn=stw rp,-20(sp) @ %lx\n", info->ip, npc);
-+				dbg("analyzing func @ %lx, insn=stw rp,"
-+				    "-20(sp) @ %lx\n", info->ip, npc);
- 			} else if (insn == 0x0fc212c1) {
- 				/* std rp,-16(sr0,sp) */
- 				rpoffset = 16;
- 				looking_for_rp = 0;
--				dbg("analyzing func @ %lx, insn=std rp,-16(sp) @ %lx\n", info->ip, npc);
-+				dbg("analyzing func @ %lx, insn=std rp,"
-+				    "-16(sp) @ %lx\n", info->ip, npc);
- 			}
- 		}
+ #include "sym_glue.h"
+Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_nvram.h	2004-08-14 01:37:40.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_nvram.h	2005-02-01 01:38:33.000000000 -0500
+@@ -22,32 +22,19 @@
+  *
+  *-----------------------------------------------------------------------------
+  *
+- * 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.
+- * 2. The name of the author may not be used to endorse or promote products
+- *    derived from this software without specific prior written permission.
++ * 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.
+  *
+- * Where this Software is combined with software released under the terms of 
+- * the GNU Public License ("GPL") and the terms of the GPL would require the 
+- * combined work to also be released under the terms of the GPL, the terms
+- * and conditions of this License will apply in addition to those of the
+- * GPL with the exception of any terms or conditions of this License that
+- * conflict with, or are expressly prohibited by, the GPL.
++ * 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.
+  *
+- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
++ * 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
+  */
  
-@@ -244,7 +289,9 @@
- 		info->prev_ip = info->rp;
- 		info->rp = 0;
+ #ifndef SYM_NVRAM_H
+Index: debian-kernel-hppa-2.6.8/drivers/serial/8250.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/serial/8250.c	2005-02-01 01:36:43.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/serial/8250.c	2005-02-01 01:38:33.000000000 -0500
+@@ -2023,8 +2023,18 @@
+ 	.data		= &serial8250_reg,
+ };
  
--		dbg("analyzing func @ %lx, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
-+		dbg("analyzing func @ %lx, setting prev_sp=%lx "
-+		    "prev_ip=%lx npc=%lx\n", info->ip, info->prev_sp, 
-+		    info->prev_ip, npc);
++#ifdef CONFIG_PARISC
++int __init serial8250_console_init(void)
++{
++	static int serial8250_console_initialised;
++	if (serial8250_console_initialised)
++		return 0;
++	serial8250_console_initialised = 1;
++
++#else
+ static int __init serial8250_console_init(void)
+ {
++#endif /* CONFIG_PARISC */
+ #ifdef CONFIG_PPC_MULTIPLATFORM
+ 	if(_machine == _MACH_Pmac) {
+ 		printk("%s: nothing to do on PowerMac\n",__FUNCTION__);
+@@ -2035,7 +2045,9 @@
+ 	register_console(&serial8250_console);
+ 	return 0;
+ }
++#ifndef CONFIG_PARISC
+ console_initcall(serial8250_console_init);
++#endif /* !CONFIG_PARISC */
+ 
+ static int __init serial8250_late_console_init(void)
+ {
+Index: debian-kernel-hppa-2.6.8/drivers/serial/8250_gsc.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/serial/8250_gsc.c	2004-08-14 01:37:28.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/serial/8250_gsc.c	2005-02-01 01:38:32.000000000 -0500
+@@ -82,7 +82,11 @@
+ 		kfree(serial);
+ 		return -ENODEV;
  	}
+-
++        
++#ifdef CONFIG_SERIAL_8250_CONSOLE        
++	serial8250_console_init();
++#endif
++        
+ 	return 0;
  }
  
-@@ -257,7 +304,8 @@
- 	info->ip = ip;
- 	info->rp = rp;
+Index: debian-kernel-hppa-2.6.8/drivers/serial/8250_pci.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/serial/8250_pci.c	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/serial/8250_pci.c	2005-02-01 01:38:33.000000000 -0500
+@@ -2177,7 +2177,14 @@
  
--	dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", t ? (int)t->pid : 0, info->sp, info->ip);
-+	dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", 
-+	    t ? (int)t->pid : -1, info->sp, info->ip);
+ static int __init serial8250_pci_init(void)
+ {
+-	return pci_module_init(&serial_pci_driver);
++	int ret;
++	ret = pci_module_init(&serial_pci_driver);
++
++#if defined(__hppa__) && defined(CONFIG_SERIAL_8250_CONSOLE)
++	serial8250_console_init();
++#endif
++
++	return ret;
  }
  
- void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t)
-@@ -285,7 +333,9 @@
- 	next_frame->prev_sp = 0;
- 	next_frame->prev_ip = 0;
+ static void __exit serial8250_pci_exit(void)
+Index: debian-kernel-hppa-2.6.8/drivers/serial/Kconfig
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/serial/Kconfig	2004-08-14 01:37:42.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/serial/Kconfig	2005-02-01 01:38:32.000000000 -0500
+@@ -450,7 +450,7 @@
  
--	dbg("(%d) Continue unwind to sp=%08lx ip=%08lx\n", (int)next_frame->t->pid, next_frame->sp, next_frame->ip);
-+	dbg("(%d) Continue unwind to sp=%08lx ip=%08lx\n", 
-+	    next_frame->t ? (int)next_frame->t->pid : -1, 
-+	    next_frame->sp, next_frame->ip);
+ config PDC_CONSOLE
+ 	bool "PDC software console support"
+-	depends on PARISC && !SERIAL_MUX
++	depends on PARISC && !SERIAL_MUX && VT
+ 	default n
+ 	help
+ 	  Saying Y here will enable the software based PDC console to be 
+Index: debian-kernel-hppa-2.6.8/drivers/serial/serial_core.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/serial/serial_core.c	2005-02-01 01:36:43.000000000 -0500
++++ debian-kernel-hppa-2.6.8/drivers/serial/serial_core.c	2005-02-01 01:38:33.000000000 -0500
+@@ -231,7 +231,8 @@
+ 	/*
+ 	 * Ensure that the IRQ handler isn't running on another CPU.
+ 	 */
+-	synchronize_irq(port->irq);
++	if (port->irq != SERIAL_IRQ_NONE)
++		synchronize_irq(port->irq);
  
- 	return 0;
+ 	/*
+ 	 * Free the transmit buffer page.
+@@ -1972,7 +1973,11 @@
+ 		printk("MMIO 0x%lx", port->mapbase);
+ 		break;
+ 	}
+-	printk(" (irq = %d) is a %s\n", port->irq, uart_type(port));
++	if (port->irq == SERIAL_IRQ_NONE) {
++		printk(" (polled) is a %s\n", uart_type(port));
++	} else {
++		printk(" (irq = %d) is a %s\n", port->irq, uart_type(port));
++	}
  }
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/firmware.c
+ 
+ static void
+Index: debian-kernel-hppa-2.6.8/drivers/video/console/Kconfig
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/firmware.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/firmware.c	2005-01-15 20:15:13.000000000 -0500
-@@ -1276,7 +1276,7 @@
- long real64_call(unsigned long fn, ...)
+--- debian-kernel-hppa-2.6.8.orig/drivers/video/console/Kconfig	2004-08-14 01:36:32.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/video/console/Kconfig	2005-02-01 01:38:33.000000000 -0500
+@@ -6,7 +6,7 @@
+ 
+ config VGA_CONSOLE
+ 	bool "VGA text console" if EMBEDDED || !X86
+-	depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K
++	depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC
+ 	default y
+ 	help
+ 	  Saying Y here will allow you to use Linux in text mode through a
+@@ -67,7 +67,7 @@
+ #  bool 'IODC console' CONFIG_IODC_CONSOLE
+ config STI_CONSOLE
+         tristate "STI text console" 
+-        depends on PARISC
++        depends on PARISC && FRAMEBUFFER_CONSOLE
+         default y
+         help
+           The STI console is the builtin display/keyboard on HP-PARISC
+Index: debian-kernel-hppa-2.6.8/drivers/video/stifb.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/drivers/video/stifb.c	2004-08-14 01:38:11.000000000 -0400
++++ debian-kernel-hppa-2.6.8/drivers/video/stifb.c	2005-02-01 01:38:33.000000000 -0500
+@@ -1379,6 +1379,7 @@
+ stifb_init(void)
  {
- 	va_list args;
--	extern struct wide_stack real64_stack __attribute__ ((alias ("real_stack")));
-+	extern struct wide_stack real64_stack;
- 	extern unsigned long real64_call_asm(unsigned long *,
- 					     unsigned long *, 
- 					     unsigned long);
+ 	struct sti_struct *sti;
++	struct sti_struct *def_sti;
+ 	int i;
+ 	
+ 	if (stifb_disabled) {
+@@ -1386,9 +1387,19 @@
+ 		return -ENXIO;
+ 	}
+ 	
++	def_sti = sti_get_rom(0);
++	if (def_sti) {
++		for (i = 1; i < MAX_STI_ROMS; i++) {
++			sti = sti_get_rom(i);
++			if (sti == def_sti && bpp > 0)
++				stifb_force_bpp[i] = bpp;
++		}
++		stifb_init_fb(def_sti, stifb_force_bpp[i]);
++	}
++
+ 	for (i = 1; i < MAX_STI_ROMS; i++) {
+ 		sti = sti_get_rom(i);
+-		if (!sti)
++		if (!sti || sti==def_sti)
+ 			break;
+ 		if (bpp > 0)
+ 			stifb_force_bpp[i] = bpp;
+Index: debian-kernel-hppa-2.6.8/fs/smbfs/inode.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/fs/smbfs/inode.c	2004-08-14 01:36:17.000000000 -0400
++++ debian-kernel-hppa-2.6.8/fs/smbfs/inode.c	2005-02-01 01:38:33.000000000 -0500
+@@ -558,6 +558,7 @@
+ 
+ 	mnt->ttl = SMB_TTL_DEFAULT;
+ 	if (ver == SMB_MOUNT_OLDVERSION) {
++#ifdef CONFIG_UID16
+ 		mnt->version = oldmnt->version;
+ 
+ 		SET_UID(mnt->uid, oldmnt->uid);
+@@ -567,6 +568,9 @@
+ 		mnt->dir_mode = (oldmnt->dir_mode & S_IRWXUGO) | S_IFDIR;
+ 
+ 		mnt->flags = (oldmnt->file_mode >> 9);
++#else
++		goto out_bad_option;
++#endif
+ 	} else {
+ 		if (parse_options(mnt, raw_data))
+ 			goto out_bad_option;
+Index: debian-kernel-hppa-2.6.8/include/asm-generic/compat_signal.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/include/asm-generic/compat_signal.h	2005-02-01 01:38:33.000000000 -0500
+@@ -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: debian-kernel-hppa-2.6.8/include/asm-ia64/compat.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/asm-ia64/compat.h	2004-08-14 01:38:04.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-ia64/compat.h	2005-02-01 01:38:33.000000000 -0500
+@@ -27,6 +27,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: debian-kernel-hppa-2.6.8/include/asm-ia64/compat_siginfo.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/include/asm-ia64/compat_siginfo.h	2005-02-01 01:38:32.000000000 -0500
+@@ -0,0 +1,2 @@
++/* We use the generic compat struct */
++#include <asm-generic/compat_siginfo.h>
 Index: debian-kernel-hppa-2.6.8/include/asm-parisc/assembly.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/assembly.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/include/asm-parisc/assembly.h	2005-01-15 20:15:13.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/assembly.h	2004-08-14 01:36:59.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/assembly.h	2005-02-01 01:38:33.000000000 -0500
 @@ -27,8 +27,10 @@
  #define LDREGX  ldd,s
  #define LDREGM	ldd,mb
@@ -11744,625 +9924,2067 @@
  	.endm
  #endif /* ! __LP64__ */
  
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.h
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/atomic.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym_misc.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym_misc.h	2005-01-15 20:15:13.000000000 -0500
-@@ -22,32 +22,19 @@
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/atomic.h	2004-08-14 01:36:45.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/atomic.h	2005-02-01 01:38:33.000000000 -0500
+@@ -14,10 +14,9 @@
+  */
+ 
+ #ifdef CONFIG_SMP
++#include <asm/spinlock.h>
+ #include <asm/cache.h>		/* we use L1_CACHE_BYTES */
+ 
+-typedef spinlock_t atomic_lock_t;
+-
+ /* Use an array of spinlocks for our atomic_ts.
+  * Hash function to index into a different SPINLOCK.
+  * Since "a" is usually an address, use one spinlock per cacheline.
+@@ -25,44 +24,35 @@
+ #  define ATOMIC_HASH_SIZE 4
+ #  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
+ 
+-extern atomic_lock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
++extern spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
+ 
+-static inline void atomic_spin_lock(atomic_lock_t *a)
+-{
+-	while (__ldcw(a) == 0)
+-		while (a->lock[0] == 0);
+-}
++/* Can't use _raw_spin_lock_irq because of #include problems, so
++ * this is the substitute */
++#define _atomic_spin_lock_irqsave(l,f) do {	\
++	spinlock_t *s = ATOMIC_HASH(l);		\
++	local_irq_save(f);			\
++	_raw_spin_lock(s);			\
++} while(0)
++
++#define _atomic_spin_unlock_irqrestore(l,f) do {	\
++	spinlock_t *s = ATOMIC_HASH(l);			\
++	_raw_spin_unlock(s);				\
++	local_irq_restore(f);				\
++} while(0)
+ 
+-static inline void atomic_spin_unlock(atomic_lock_t *a)
+-{
+-	a->lock[0] = 1;
+-}
+ 
+ #else
+-#  define ATOMIC_HASH_SIZE 1
+-#  define ATOMIC_HASH(a)	(0)
+-#  define atomic_spin_lock(x) (void)(x)
+-#  define atomic_spin_unlock(x) do { } while(0)
++#  define _atomic_spin_lock_irqsave(l,f) do { local_irq_save(f); } while (0)
++#  define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
+ #endif
+ 
+-/* copied from <linux/spinlock.h> and modified */
+-#define atomic_spin_lock_irqsave(lock, flags)	do { 	\
+-	local_irq_save(flags);				\
+-	atomic_spin_lock(lock); 			\
+-} while (0)
+-
+-#define atomic_spin_unlock_irqrestore(lock, flags) do {	\
+-	atomic_spin_unlock(lock);			\
+-	local_irq_restore(flags);			\
+-} while (0)
+-
+ /* Note that we need not lock read accesses - aligned word writes/reads
+  * are atomic, so a reader never sees unconsistent values.
   *
-  *-----------------------------------------------------------------------------
-  *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-+ * 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.
-  *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-+ * 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.
-  *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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
+  * Cache-line alignment would conflict with, for example, linux/module.h
   */
  
- #ifndef SYM_MISC_H
-Index: debian-kernel-hppa-2.6.8/kernel/Makefile
+-typedef struct { volatile long counter; } atomic_t;
++typedef struct { volatile int counter; } atomic_t;
+ 
+ 
+ /* This should get optimized out since it's never called.
+@@ -150,22 +140,22 @@
+ {
+ 	int ret;
+ 	unsigned long flags;
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(v), flags);
++	_atomic_spin_lock_irqsave(v, flags);
+ 
+ 	ret = (v->counter += i);
+ 
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
++	_atomic_spin_unlock_irqrestore(v, flags);
+ 	return ret;
+ }
+ 
+ static __inline__ void atomic_set(atomic_t *v, int i) 
+ {
+ 	unsigned long flags;
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(v), flags);
++	_atomic_spin_lock_irqsave(v, flags);
+ 
+ 	v->counter = i;
+ 
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
++	_atomic_spin_unlock_irqrestore(v, flags);
+ }
+ 
+ static __inline__ int atomic_read(const atomic_t *v)
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/bitops.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/kernel/Makefile	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/kernel/Makefile	2005-01-15 20:15:13.000000000 -0500
-@@ -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_IKCONFIG) += configs.o
- obj-$(CONFIG_IKCONFIG_PROC) += configs.o
- obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/pacache.S
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/bitops.h	2004-08-14 01:36:11.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/bitops.h	2005-02-01 01:38:32.000000000 -0500
+@@ -38,9 +38,9 @@
+ 
+ 	addr += (nr >> SHIFT_PER_LONG);
+ 	mask = 1L << CHOP_SHIFTCOUNT(nr);
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
++	_atomic_spin_lock_irqsave(addr, flags);
+ 	*addr |= mask;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
++	_atomic_spin_unlock_irqrestore(addr, flags);
+ }
+ 
+ static __inline__ void __set_bit(int nr, volatile unsigned long * address)
+@@ -61,9 +61,9 @@
+ 
+ 	addr += (nr >> SHIFT_PER_LONG);
+ 	mask = 1L << CHOP_SHIFTCOUNT(nr);
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
++	_atomic_spin_lock_irqsave(addr, flags);
+ 	*addr &= ~mask;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
++	_atomic_spin_unlock_irqrestore(addr, flags);
+ }
+ 
+ static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address)
+@@ -84,9 +84,9 @@
+ 
+ 	addr += (nr >> SHIFT_PER_LONG);
+ 	mask = 1L << CHOP_SHIFTCOUNT(nr);
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
++	_atomic_spin_lock_irqsave(addr, flags);
+ 	*addr ^= mask;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
++	_atomic_spin_unlock_irqrestore(addr, flags);
+ }
+ 
+ static __inline__ void __change_bit(int nr, volatile unsigned long * address)
+@@ -108,10 +108,10 @@
+ 
+ 	addr += (nr >> SHIFT_PER_LONG);
+ 	mask = 1L << CHOP_SHIFTCOUNT(nr);
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
++	_atomic_spin_lock_irqsave(addr, flags);
+ 	oldbit = (*addr & mask) ? 1 : 0;
+ 	*addr |= mask;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
++	_atomic_spin_unlock_irqrestore(addr, flags);
+ 
+ 	return oldbit;
+ }
+@@ -139,10 +139,10 @@
+ 
+ 	addr += (nr >> SHIFT_PER_LONG);
+ 	mask = 1L << CHOP_SHIFTCOUNT(nr);
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
++	_atomic_spin_lock_irqsave(addr, flags);
+ 	oldbit = (*addr & mask) ? 1 : 0;
+ 	*addr &= ~mask;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
++	_atomic_spin_unlock_irqrestore(addr, flags);
+ 
+ 	return oldbit;
+ }
+@@ -170,10 +170,10 @@
+ 
+ 	addr += (nr >> SHIFT_PER_LONG);
+ 	mask = 1L << CHOP_SHIFTCOUNT(nr);
+-	atomic_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
++	_atomic_spin_lock_irqsave(addr, flags);
+ 	oldbit = (*addr & mask) ? 1 : 0;
+ 	*addr ^= mask;
+-	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
++	_atomic_spin_unlock_irqrestore(addr, flags);
+ 
+ 	return oldbit;
+ }
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/pci.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/pacache.S	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/pacache.S	2005-01-15 20:15:13.000000000 -0500
-@@ -68,7 +68,7 @@
- 	 * consolidated.
- 	 */
- 
--	rsm     PSW_SM_I,%r19      /* relied upon translation! */
-+	rsm     PSW_SM_I,%r19	/* relied upon translation! PA 2.0 Arch. F-5 */
- 	nop
- 	nop
- 	nop
-@@ -475,9 +475,9 @@
- 	.procend
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/pci.h	2004-08-14 01:37:29.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/pci.h	2005-02-01 01:38:33.000000000 -0500
+@@ -150,16 +150,25 @@
  #endif
  
--	.export clear_user_page_asm,code
-+	.export __clear_user_page_asm,code
+ /*
+-** used by drivers/pci/pci.c:pci_do_scan_bus()
+-**   0 == check if bridge is numbered before re-numbering.
+-**   1 == pci_do_scan_bus() should automatically number all PCI-PCI bridges.
+-**
+-** REVISIT:
+-**   To date, only alpha sets this to one. We'll need to set this
+-**   to zero for legacy platforms and one for PAT platforms.
+-*/
+-#define pcibios_assign_all_busses()     (pdc_type == PDC_TYPE_PAT)
+-#define pcibios_scan_all_fns(a, b)	0
++ * pcibios_assign_all_busses() is used in drivers/pci/pci.c:pci_do_scan_bus()
++ *   0 == check if bridge is numbered before re-numbering.
++ *   1 == pci_do_scan_bus() should automatically number all PCI-PCI bridges.
++ *
++ *   We *should* set this to zero for "legacy" platforms and one
++ *   for PAT platforms.
++ *
++ *   But legacy platforms also need to *re*-enumerate the busses below
++ *   a Host Bus controller.  Adding a 4-port Tulip card under dino (bus 0)
++ *   in a C200 resulted in the secondary bus being enumerated to 1.
++ *   The second PCI host bus controller (cujo) had been enumerated by
++ *   firmware as bus 1 and sysfs complained.
++ *
++ *   The firmware is correct since the second controller is a seperate
++ *   PCI domain.  This problem could have been fixed by making dino
++ *   support use seperate PCI domains but this is alot simpler/easier.
++ */
++#define pcibios_assign_all_busses()     (1)
++#define pcibios_scan_all_fns(a, b)	(0)
  
--clear_user_page_asm:
-+__clear_user_page_asm:
- 	.proc
- 	.callinfo NO_CALLS
- 	.entry
-Index: debian-kernel-hppa-2.6.8/ipc/compat_mq.c
+ #define PCIBIOS_MIN_IO          0x10
+ #define PCIBIOS_MIN_MEM         0x1000 /* NBPG - but pci/setup-res.c dies */
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/pdc.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/ipc/compat_mq.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/ipc/compat_mq.c	2005-01-15 20:15:14.000000000 -0500
-@@ -7,6 +7,7 @@
-  */
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/pdc.h	2004-08-14 01:36:09.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/pdc.h	2005-02-01 01:38:33.000000000 -0500
+@@ -754,6 +754,7 @@
+ int pdc_iodc_getc(void);
+ void pdc_iodc_putc(unsigned char c);
+ void pdc_iodc_outc(unsigned char c);
++void pdc_printf(const char *fmt, ...);
  
- #include <linux/compat.h>
-+#include <linux/compat_siginfo.h>
- #include <linux/fs.h>
- #include <linux/kernel.h>
- #include <linux/mqueue.h>
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall_table.S
+ void pdc_emergency_unlock(void);
+ int pdc_sti_call(unsigned long func, unsigned long flags,
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/posix_types.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/syscall_table.S	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall_table.S	2005-01-15 20:15:14.000000000 -0500
-@@ -334,12 +334,12 @@
- 	ENTRY_SAME(epoll_ctl)		/* 225 */
- 	ENTRY_SAME(epoll_wait)
-  	ENTRY_SAME(remap_file_pages)
--  ENTRY_SAME(semtimedop)
--  ENTRY_SAME(mq_open)
--  ENTRY_SAME(mq_unlink)   /* 230 */
--  ENTRY_SAME(mq_timedsend)
--  ENTRY_SAME(mq_timedreceive)
--  ENTRY_SAME(mq_notify)
--  ENTRY_SAME(mq_getsetattr)
--  /* Nothing yet */       /* 235 */
-+	ENTRY_SAME(semtimedop)
-+	ENTRY_SAME(mq_open)
-+	ENTRY_SAME(mq_unlink)   /* 230 */
-+	ENTRY_SAME(mq_timedsend)
-+	ENTRY_SAME(mq_timedreceive)
-+	ENTRY_SAME(mq_notify)
-+	ENTRY_SAME(mq_getsetattr)
-+	/* Nothing yet */       /* 235 */
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/posix_types.h	2004-08-14 01:37:39.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/posix_types.h	2005-02-01 01:38:33.000000000 -0500
+@@ -15,7 +15,7 @@
+ typedef unsigned int		__kernel_uid_t;
+ typedef unsigned int		__kernel_gid_t;
+ typedef int			__kernel_suseconds_t;
+-typedef int			__kernel_clock_t;
++typedef long			__kernel_clock_t;
+ typedef int			__kernel_timer_t;
+ typedef int			__kernel_clockid_t;
+ typedef int			__kernel_daddr_t;
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/ptrace.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/ptrace.h	2004-08-14 01:36:57.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/ptrace.h	2005-02-01 01:38:33.000000000 -0500
+@@ -46,7 +46,8 @@
+ #ifdef __KERNEL__
  
-Index: debian-kernel-hppa-2.6.8/kernel/ptrace.c
+ /* XXX should we use iaoq[1] or iaoq[0] ? */
+-#define user_mode(regs)			(((regs)->iaoq[0] &  3) ? 1 : 0)
++#define user_mode(regs)			(((regs)->iaoq[0] & 3) ? 1 : 0)
++#define user_space(regs)		(((regs)->iasq[0] != 0) ? 1 : 0)
+ #define instruction_pointer(regs)	((regs)->iaoq[0] & ~3)
+ extern void show_regs(struct pt_regs *);
+ #endif
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/spinlock.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/kernel/ptrace.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/kernel/ptrace.c	2005-01-15 20:15:14.000000000 -0500
-@@ -290,7 +290,7 @@
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/spinlock.h	2004-08-14 01:38:11.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/spinlock.h	2005-02-01 01:38:33.000000000 -0500
+@@ -27,21 +27,35 @@
+ 
+ static inline void _raw_spin_lock(spinlock_t *x)
  {
- 	if (child->last_siginfo == NULL)
- 		return -EINVAL;
--	if (copy_from_user(child->last_siginfo, data, sizeof (siginfo_t)) != 0)
-+	if (copy_siginfo_from_user(child->last_siginfo, data) != 0)
- 		return -EFAULT;
- 	return 0;
+-	volatile unsigned int *a = __ldcw_align(x);
++	volatile unsigned int *a;
++
++	mb();
++	a = __ldcw_align(x);
+ 	while (__ldcw(a) == 0)
+ 		while (*a == 0);
++	mb();
  }
-Index: debian-kernel-hppa-2.6.8/drivers/net/tulip/media.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/net/tulip/media.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/net/tulip/media.c	2005-01-15 20:15:14.000000000 -0500
-@@ -43,8 +43,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.
-+   */
+ static inline void _raw_spin_unlock(spinlock_t *x)
+ {
+-	volatile unsigned int *a = __ldcw_align(x);
++	volatile unsigned int *a;
++	mb();
++	a = __ldcw_align(x);
+ 	*a = 1;
++	mb();
+ }
  
- int tulip_mdio_read(struct net_device *dev, int phy_id, int location)
+ static inline int _raw_spin_trylock(spinlock_t *x)
  {
-@@ -271,13 +273,29 @@
- 				int reset_length = p[2 + init_length];
- 				misc_info = (u16*)(reset_sequence + reset_length);
- 				if (startup) {
-+					int timeout = 10;	/* max 1 ms */
- 					outl(mtable->csr12dir | 0x100, ioaddr + CSR12);
- 					for (i = 0; i < reset_length; i++)
- 						outl(reset_sequence[i], ioaddr + CSR12);
+-	volatile unsigned int *a = __ldcw_align(x);
+-	return __ldcw(a) != 0;
++	volatile unsigned int *a;
++	int ret;
 +
-+					/* flush posted writes */
-+					inl(ioaddr + CSR12);
++	mb();
++	a = __ldcw_align(x);
++        ret = __ldcw(a) != 0;
++	mb();
 +
-+					/* Sect 3.10.3 in DP83840A.pdf (p39) */
-+					udelay(500);
++	return ret;
+ }
+ 	
+ #define spin_lock_own(LOCK, LOCATION)	((void)0)
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/system.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/system.h	2004-08-14 01:37:14.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/system.h	2005-02-01 01:38:33.000000000 -0500
+@@ -80,7 +80,7 @@
+ #define mtctl(gr, cr) \
+ 	__asm__ __volatile__("mtctl %0,%1" \
+ 		: /* no outputs */ \
+-		: "r" (gr), "i" (cr))
++		: "r" (gr), "i" (cr) : "memory")
+ 
+ /* these are here to de-mystefy the calling code, and to provide hooks */
+ /* which I needed for debugging EIEM problems -PB */
+@@ -102,7 +102,7 @@
+ #define mtsp(gr, cr) \
+ 	__asm__ __volatile__("mtsp %0,%1" \
+ 		: /* no outputs */ \
+-		: "r" (gr), "i" (cr))
++		: "r" (gr), "i" (cr) : "memory")
+ 
+ 
+ /*
+@@ -154,7 +154,7 @@
+    for the semaphore.  */
+ #define __PA_LDCW_ALIGNMENT 16
+ #define __ldcw_align(a) ({ \
+-  unsigned long __ret = (unsigned long) a;                     		\
++  unsigned long __ret = (unsigned long) &(a)->lock[0];        		\
+   __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \
+   (volatile unsigned int *) __ret;                                      \
+ })
+@@ -184,4 +184,22 @@
+ 
+ #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;
 +
-+					/* 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++)
- 					outl(init_sequence[i], ioaddr + CSR12);
++#define purge_tlb_start(x) spin_lock(&pa_tlb_lock)
++#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock)
 +
-+				inl(ioaddr + CSR12);	/* flush posted writes */
- 			}
++#else
 +
- 			tmp_info = get_u16(&misc_info[1]);
- 			if (tmp_info)
- 				tp->advertising[phy_num] = tmp_info | 1;
-Index: debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall.S
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/kernel/syscall.S	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/kernel/syscall.S	2005-01-15 20:15:14.000000000 -0500
-@@ -16,6 +16,14 @@
- #include <asm/assembly.h>
- #include <asm/processor.h>
- 
-+	/* We fill the empty parts of the gateway page with
-+ 	 * something that will kill the kernel or a
-+ 	 * userspace application.
-+	 */
-+#define KILL_INSN	break	0,0
++#define purge_tlb_start(x) do { } while(0)
++#define purge_tlb_end(x) do { } while (0)
 +
-+#include <linux/config.h> /* for CONFIG_SMP */
++#endif
 +
- #ifdef __LP64__
- 	.level          2.0w
- #else
-@@ -38,21 +46,41 @@
- 	.align 4096
- linux_gateway_page:
+ #endif
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/thread_info.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/thread_info.h	2004-08-14 01:36:44.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/thread_info.h	2005-02-01 01:38:33.000000000 -0500
+@@ -18,12 +18,15 @@
  
--	.rept 56
--	break   0,0
-+        /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */
-+	.rept 44
-+	KILL_INSN
- 	.endr
+ #define INIT_THREAD_INFO(tsk)			\
+ {						\
+-	task:		&tsk,			\
+-	exec_domain:	&default_exec_domain,	\
+-	flags:		0,			\
+-	cpu:		0,			\
+-	addr_limit:	KERNEL_DS,		\
+-	preempt_count:	0,			\
++	.task		= &tsk,			\
++	.exec_domain	= &default_exec_domain,	\
++	.flags		= 0,			\
++	.cpu		= 0,			\
++	.addr_limit	= KERNEL_DS,		\
++	.preempt_count	= 0,			\
++  	.restart_block	= {			\
++		.fn = do_no_restart_syscall	\
++	}					\
+ }
  
-+	/* ADDRESS 0xb0 to 0xb4, lws uses 1 insns for entry */
-+	/* Light-weight-syscall entry must always be located at 0xb0 */
-+	/* WARNING: Keep this number updated with table size changes */
-+#define __NR_lws_entries (2)
+ #define init_thread_info        (init_thread_union.thread_info)
+Index: debian-kernel-hppa-2.6.8/include/asm-parisc/tlbflush.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/asm-parisc/tlbflush.h	2004-08-14 01:38:09.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/asm-parisc/tlbflush.h	2005-02-01 01:38:33.000000000 -0500
+@@ -51,9 +51,12 @@
+ {
+ 	/* For one page, it's not worth testing the split_tlb variable */
+ 
++	mb();
+ 	mtsp(vma->vm_mm->context,1);
++	purge_tlb_start();
+ 	pdtlb(addr);
+ 	pitlb(addr);
++	purge_tlb_end();
+ }
+ 
+ static inline void flush_tlb_range(struct vm_area_struct *vma,
+@@ -61,6 +64,7 @@
+ {
+ 	unsigned long npages;
+ 
++	
+ 	npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
+ 	if (npages >= 512)  /* XXX arbitrary, should be tuned */
+ 		flush_tlb_all();
+@@ -68,16 +72,20 @@
+ 
+ 		mtsp(vma->vm_mm->context,1);
+ 		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();
+ 		}
+ 	}
+ }
+Index: debian-kernel-hppa-2.6.8/include/linux/compat.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/linux/compat.h	2004-08-14 01:36:57.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/linux/compat.h	2005-02-01 01:38:33.000000000 -0500
+@@ -6,10 +6,16 @@
+  */
+ #include <linux/config.h>
+ 
+-#ifdef CONFIG_COMPAT
++#ifndef CONFIG_COMPAT
 +
-+lws_entry:
-+	/* Unconditional branch to lws_start, located on the 
-+	   same gateway page */
-+	b,n	lws_start
++/* Non-native task requiring compat... doesn't exist */
++#define is_compat_task(x) 0
 +
-+	/* Fill from 0xb4 to 0xe0 */
-+	.rept 11
-+	KILL_INSN
-+	.endr
-+
-+	/* This function MUST be located at 0xe0 for glibc's threading 
-+	mechanism to work. DO NOT MOVE THIS CODE EVER! */
- set_thread_pointer:
- 	gate	.+8, %r0		/* increase privilege */
- 	depi	3, 31, 2, %r31		/* Ensure we return into user mode. */
- 	be	0(%sr7,%r31)		/* return to user space */
- 	mtctl	%r26, %cr27		/* move arg0 to the control register */
++#else
  
-+	/* Increase the chance of trapping if random jumps occur to this
-+	address, fill from 0xf0 to 0x100 */
- 	.rept 4
--	break   0,0
-+	KILL_INSN
- 	.endr
+ #include <linux/stat.h>
+ #include <linux/param.h>	/* for HZ */
++#include <linux/personality.h>  /* Conditional process compat */
+ #include <linux/sem.h>
  
--/* This address must remain fixed, or user binaries go splat. */
-+/* This address must remain fixed at 0x100 for glibc's syscalls to work */
- 	.align 256
- linux_gateway_entry:
- 	gate	.+8, %r0			/* become privileged */
-@@ -157,6 +185,7 @@
+ #include <asm/compat.h>
+@@ -18,6 +24,11 @@
+ #define compat_jiffies_to_clock_t(x)	\
+ 		(((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
  
- 	/* Are we being ptraced? */
- 	mfctl	%cr30, %r1
-+	LDREG	TI_TASK(%r1),%r1
- 	LDREG	TASK_PTRACE(%r1), %r1
- 	bb,<,n	%r1,31,.Ltracesys
- 	
-@@ -177,11 +206,8 @@
- 	comiclr,>>=	__NR_Linux_syscalls, %r20, %r0
- 	b,n	.Lsyscall_nosys
- 	
--#ifdef __LP64__
--	ldd,s   %r20(%r19), %r19
--#else
--	ldwx,s  %r20(%r19), %r19
--#endif
-+	LDREGX  %r20(%r19), %r19
-+
- 	/* If this is a sys_rt_sigreturn call, and the signal was received
- 	 * when not in_syscall, then we want to return via syscall_exit_rfi,
- 	 * not syscall_exit.  Signal no. in r20, in_syscall in r25 (see
-@@ -291,11 +317,8 @@
- 	comiclr,>>=	__NR_Linux_syscalls, %r20, %r0
- 	b,n	.Lsyscall_nosys
++/* Non-native task requiring compat */
++#ifndef HAVE_ARCH_IS_COMPAT_TASK
++#define is_compat_task(x) (personality(x->personality) == PER_LINUX32)
++#endif
++	
+ struct compat_itimerspec { 
+ 	struct compat_timespec it_interval;
+ 	struct compat_timespec it_value;
+@@ -86,27 +97,6 @@
+ 	char		d_name[256];
+ };
  
--#ifdef __LP64__
--	ldd,s   %r20(%r19), %r19
--#else
--	ldwx,s  %r20(%r19), %r19
--#endif
-+	LDREGX  %r20(%r19), %r19
+-typedef union compat_sigval {
+-	compat_int_t	sival_int;
+-	compat_uptr_t	sival_ptr;
+-} compat_sigval_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[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);
+ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
+Index: debian-kernel-hppa-2.6.8/include/linux/compat_siginfo.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/include/linux/compat_siginfo.h	2005-02-01 01:38:32.000000000 -0500
+@@ -0,0 +1,178 @@
++#ifndef _ASM_GENERIC_COMPAT_SIGINFO_H
++#define _ASM_GENERIC_COMPAT_SIGINFO_H
 +
- 	/* If this is a sys_rt_sigreturn call, and the signal was received
- 	 * when not in_syscall, then we want to return via syscall_exit_rfi,
- 	 * not syscall_exit.  Signal no. in r20, in_syscall in r25 (see
-@@ -344,12 +367,295 @@
- 	ldil	L%syscall_exit_rfi,%r1
- 	be,n	R%syscall_exit_rfi(%sr7,%r1)
++#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.
++ */
++
++#define SIGEV_COMPAT_MAX_SIZE	64
++#ifndef SIGEV_COMPAT_PAD_SIZE
++#define SIGEV_COMPAT_PAD_SIZE	((SIGEV_COMPAT_MAX_SIZE/sizeof(int)) - 3)
++#endif
++
++#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[SIGEV_COMPAT_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);
++
++#endif /* CONFIG_COMPAT */
++#endif /* _ASM_GENERIC_COMPAT_SIGINFO_H */
++
+Index: debian-kernel-hppa-2.6.8/include/linux/console.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/linux/console.h	2004-08-14 01:36:56.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/linux/console.h	2005-02-01 01:38:33.000000000 -0500
+@@ -84,6 +84,7 @@
+ #define CON_PRINTBUFFER	(1)
+ #define CON_CONSDEV	(2) /* Last on the command line */
+ #define CON_ENABLED	(4)
++#define CON_BOOT	(8)
  
+ struct console
+ {
+Index: debian-kernel-hppa-2.6.8/include/linux/hil.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/include/linux/hil.h	2005-02-01 01:38:33.000000000 -0500
+@@ -0,0 +1,483 @@
++#ifndef _HIL_H_
++#define _HIL_H_
 +
-+	/*********************************************************
-+		Light-weight-syscall code
++/*
++ * 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.
++ *
++ */
 +
-+		r20 - lws number
-+		r26,r25,r24,r23,r22 - Input registers
-+		r28 - Function return register
-+		r21 - Error code.
++#include <asm/types.h>
 +
-+		Scracth: Any of the above that aren't being
-+		currently used, including r1. 
++/* Physical constants relevant to raw loop/device timing. 
++ */ 
 +
-+		Return pointer: r31 (Not usable)
++#define HIL_CLOCK		8MHZ
++#define HIL_EK1_CLOCK		30HZ
++#define HIL_EK2_CLOCK		60HZ
 +
-+		Error codes returned by entry path:
++#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 */
 +
-+		ENOSYS - r20 was an invalid LWS number.
 +
-+	*********************************************************/
-+lws_start:
-+	/* Gate and ensure we return to userspace */
-+	gate	.+8, %r0
-+	depi	3, 31, 2, %r31	/* Ensure we return to userspace */
++/* 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.
++ */
 +
-+#ifdef __LP64__
-+	/* FIXME: If we are a 64-bit kernel just
-+	 *        turn this on unconditionally.
++#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_RESERVED,	KEY_SELECT,	KEY_RESERVED,	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: debian-kernel-hppa-2.6.8/include/linux/hil_mlc.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/include/linux/hil_mlc.h	2005-02-01 01:38:32.000000000 -0500
+@@ -0,0 +1,171 @@
++/*
++ * 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.
 +	 */
-+	ssm	PSW_SM_W, %r1
-+	extrd,u	%r1,PSW_W_BIT,1,%r1
-+	/* sp must be aligned on 4, so deposit the W bit setting into
-+	 * the bottom of sp temporarily */
-+	or,ev	%r1,%r30,%r30
++	HILSE_OUT = 0,
 +
-+	/* Clip LWS number to a 32-bit value always */
-+	depdi	0, 31, 32, %r20
-+#endif	
++  	/* HILSE_CTS checks if the loop is busy. */
++	HILSE_CTS,
 +
-+        /* Is the lws entry number valid? */
-+	comiclr,>>=	__NR_lws_entries, %r20, %r0
-+	b,n	lws_exit_nosys
++	/* HILSE_OUT_LAST sends the given command packet to 
++	 * the last configured/running device on the loop.
++	 */
++	HILSE_OUT_LAST,
 +
-+	/* WARNING: Trashing sr2 and sr3 */
-+	mfsp	%sr7,%r1			/* get userspace into sr3 */
-+	mtsp	%r1,%sr3
-+	mtsp	%r0,%sr2			/* get kernel space into sr2 */
++	/* HILSE_OUT_DISC sends the given command packet to
++	 * the next device past the last configured/running one.
++	 */
++	HILSE_OUT_DISC,
 +
-+	/* Load table start */
-+	ldil	L%lws_table, %r1
-+	ldo	R%lws_table(%r1), %r28	/* Scratch use of r28 */
-+	LDREGX	%r20(%sr2,r28), %r21	/* Scratch use of r21 */
++	/* HILSE_FUNC runs a callback function with given arguments.
++	 * a positive return value causes the "ugly" branch to be taken.
++	 */
++	HILSE_FUNC,
 +
-+	/* Jump to lws, lws table pointers already relocated */
-+	be,n	0(%sr2,%r21)
++  	/* HILSE_IN simply expects any non-errored packet to arrive 
++	 * within arg usecs.
++	 */
++	HILSE_IN		= 0x100,
 +
-+lws_exit_nosys:
-+	ldo	-ENOSYS(%r0),%r21		   /* set errno */
-+	/* Fall through: Return to userspace */
++  	/* HILSE_EXPECT expects a particular packet to arrive 
++	 * within arg usecs, any other packet is considered an error.
++	 */
++	HILSE_EXPECT,
 +
-+lws_exit:
-+#ifdef __LP64__
-+	/* decide whether to reset the wide mode bit
-+	 *
-+	 * For a syscall, the W bit is stored in the lowest bit
-+	 * of sp.  Extract it and reset W if it is zero */
-+	extrd,u,*<>	%r30,63,1,%r1
-+	rsm	PSW_SM_W, %r0
-+	/* now reset the lowest bit of sp if it was set */
-+	xor	%r30,%r1,%r30
++  	/* 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 */
++
++	void			(*inc_use_count)(void);
++	void			(*dec_use_count)(void);
++
++	int			opercnt;
++
++	struct tasklet_struct	*tasklet;
++};
++
++int hil_mlc_register(hil_mlc *mlc);
++int hil_mlc_unregister(hil_mlc *mlc);
+Index: debian-kernel-hppa-2.6.8/include/linux/hp_sdc.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/include/linux/hp_sdc.h	2005-02-01 01:38:33.000000000 -0500
+@@ -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
-+	be,n	0(%sr3, %r31)
 +
 +
-+	
-+	/***************************************************
-+		Implementing CAS as an atomic operation:
++/* No 4X status reads take longer than this (in usec).
++ */
++#define HP_SDC_MAX_REG_DELAY 20000
 +
-+		%r26 - Address to examine
-+		%r25 - Old value to check (old)
-+		%r24 - New value to set (new)
-+		%r28 - Return prev through this register.
-+		%r21 - Kernel error code
++typedef void (hp_sdc_irqhook) (int irq, void *dev_id, 
++			       uint8_t status, uint8_t data);
 +
-+		If debugging is DISabled:
++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);
 +
-+		%r21 has the following meanings:
++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);
 +
-+		EAGAIN - CAS is busy, ldcw failed, try again.
-+		EFAULT - Read or write failed.		
++/* 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. */
 +
-+		If debugging is enabled:
++/* Rest of the flags are straightforward representation of the SDC interface */
++#define HP_SDC_STATUS_IBF	0x02	/* Input buffer full */
 +
-+		EDEADLOCK - CAS called recursively.
-+		EAGAIN && r28 == 1 - CAS is busy. Lock contended.
-+		EAGAIN && r28 == 2 - CAS is busy. ldcw failed.
-+		EFAULT - Read or write failed.
++#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 */
 +
-+		Scratch: r20, r28, r1
++#define HP_SDC_NMISTATUS_FHS	0x40	/* NMI is a fast handshake irq */
 +
-+	****************************************************/
++/* Internal i8042 registers (there are more, but they are not too useful). */
 +
-+	/* Do not enable LWS debugging */
-+#define ENABLE_LWS_DEBUG 0 
++#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 */
 +
-+	/* ELF64 Process entry path */
-+lws_compare_and_swap64:
-+#ifdef __LP64__
-+	b,n	lws_compare_and_swap
++#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
-+	/* If we are not a 64-bit kernel, then we don't
-+	 * implement having 64-bit input registers
-+	 */
-+	b,n	lws_exit_nosys
++#error No support for device registration on this arch yet.
 +#endif
 +
-+	/* ELF32 Process entry path */
-+lws_compare_and_swap32:
-+#ifdef __LP64__
-+	/* Clip all the input registers */
-+	depdi	0, 31, 32, %r26
-+	depdi	0, 31, 32, %r25
-+	depdi	0, 31, 32, %r24
-+#endif
++	struct timer_list kicker;	/* Keeps below task alive */
++	struct tasklet_struct	task;
 +
-+lws_compare_and_swap:
-+#ifdef CONFIG_SMP
-+	/* Load start of lock table */
-+	ldil	L%lws_lock_start, %r20
-+	ldo	R%lws_lock_start(%r20), %r28
++} hp_i8042_sdc;
 +
-+	/* Extract four bits from r26 and hash lock (Bits 4-7) */
-+	extru  %r26, 27, 4, %r20
++#endif /* _LINUX_HP_SDC_H */
+Index: debian-kernel-hppa-2.6.8/include/linux/input.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/linux/input.h	2004-08-14 01:36:57.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/linux/input.h	2005-02-01 01:38:33.000000000 -0500
+@@ -586,6 +586,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: debian-kernel-hppa-2.6.8/include/linux/serial_core.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/linux/serial_core.h	2004-08-14 01:36:16.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/linux/serial_core.h	2005-02-01 01:38:33.000000000 -0500
+@@ -89,6 +89,8 @@
+ /* MPC52xx type numbers */
+ #define PORT_MPC52xx	59
+ 
++#define SERIAL_IRQ_NONE -1
 +
-+	/* Find lock to use, the hash is either one of 0 to
-+	   15, multiplied by 16 (keep it 16-byte aligned)
-+	   and add to the lock table offset. */
-+	shlw	%r20, 4, %r20
-+	add	%r20, %r28, %r20
+ #ifdef __KERNEL__
+ 
+ #include <linux/config.h>
+Index: debian-kernel-hppa-2.6.8/include/linux/signal.h
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/include/linux/signal.h	2004-08-14 01:36:17.000000000 -0400
++++ debian-kernel-hppa-2.6.8/include/linux/signal.h	2005-02-01 01:38:33.000000000 -0500
+@@ -220,6 +220,9 @@
+ extern int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs, void *cookie);
+ #endif
+ 
++int copy_siginfo_from_user(siginfo_t *to, siginfo_t __user *from);
++int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from);
 +
-+# ifdef ENABLE_LWS_DEBUG
-+	/*	
-+		DEBUG, check for deadlock! 
-+		If the thread register values are the same
-+		then we were the one that locked it last and
-+		this is a recurisve call that will deadlock.
-+		We *must* giveup this call and fail.
-+	*/
-+	ldw	4(%sr2,%r20), %r28			/* Load thread register */
-+	mfctl	%cr27, %r21				/* Get current thread register */
-+	cmpb,<>,n	%r21, %r28, cas_lock		/* Called recursive? */
-+	b	lws_exit				/* Return error! */
-+	ldo	-EDEADLOCK(%r0), %r21
-+cas_lock:
-+	/* FIXME: This check is required! */
-+	cmpb,=,n	%r0, %r28, cas_nocontend	/* Is nobody using it? */
-+	ldo	1(%r0), %r28				/* 1st case */
-+	b	lws_exit				/* Contended... */
-+	ldo	-EAGAIN(%r0), %r21			/* Spin in userspace */
-+cas_nocontend:
-+# endif
-+/* ENABLE_LWS_DEBUG */
+ #endif /* __KERNEL__ */
+ 
+ #endif /* _LINUX_SIGNAL_H */
+Index: debian-kernel-hppa-2.6.8/ipc/compat_mq.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/ipc/compat_mq.c	2004-08-14 01:36:46.000000000 -0400
++++ debian-kernel-hppa-2.6.8/ipc/compat_mq.c	2005-02-01 01:38:33.000000000 -0500
+@@ -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: debian-kernel-hppa-2.6.8/kernel/Makefile
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/kernel/Makefile	2004-08-14 01:36:32.000000000 -0400
++++ debian-kernel-hppa-2.6.8/kernel/Makefile	2005-02-01 01:38:33.000000000 -0500
+@@ -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_IKCONFIG) += configs.o
+ obj-$(CONFIG_IKCONFIG_PROC) += configs.o
+ obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
+Index: debian-kernel-hppa-2.6.8/kernel/compat_signal.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ debian-kernel-hppa-2.6.8/kernel/compat_signal.c	2005-02-01 01:38:33.000000000 -0500
+@@ -0,0 +1,206 @@
++/*
++ *  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 
++ *
++ */
 +
-+	ldcw	0(%sr2,%r20), %r28			/* Try to acquire the lock */
-+	cmpb,<>,n	%r0, %r28, cas_action		/* Did we get it? */
-+cas_wouldblock:
-+	ldo	2(%r0), %r28				/* 2nd case */
-+	b	lws_exit				/* Contended... */
-+	ldo	-EAGAIN(%r0), %r21			/* Spin in userspace */
-+#endif
-+/* CONFIG_SMP */
++#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;
++	
 +	/*
-+		prev = *addr;
-+		if ( prev == old )
-+		  *addr = new;
-+		return prev;
-+	*/
++	 * 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.
++	 */
 +
-+	/* NOTES:
-+		This all works becuse intr_do_signal
-+		and schedule both check the return iasq
-+		and see that we are on the kernel page
-+		so this process is never scheduled off
-+		or is ever sent any signal of any sort,
-+		thus it is wholly atomic from usrspaces
-+		perspective
-+	*/
-+cas_action:
-+#if defined CONFIG_SMP && defined ENABLE_LWS_DEBUG
-+	/* DEBUG */
-+	mfctl	%cr27, %r1
-+	stw	%r1, 4(%sr2,%r20)
-+#endif
-+	/* The load and store could fail */
-+1:	ldw	0(%sr3,%r26), %r28
-+	sub,<>	%r28, %r25, %r0
-+2:	stw	%r24, 0(%sr3,%r26)
-+#ifdef CONFIG_SMP
-+	/* Free lock */
-+	stw	%r20, 0(%sr2,%r20)
-+# ifdef ENABLE_LWS_DEBUG
-+	/* Clear thread register indicator */
-+	stw	%r0, 4(%sr2,%r20)
-+# endif
-+#endif
-+	/* Return to userspace, set no error */
-+	b	lws_exit
-+	copy	%r0, %r21
-+	nop	/* Add some visual space in objdump */
-+	nop
-+	nop
-+	nop
-+3:		
-+	/* Error occured on load or store */
-+#ifdef CONFIG_SMP
-+	/* Free lock */
-+	stw	%r20, 0(%sr2,%r20)
-+# ifdef ENABLE_LWS_DEBUG
-+	stw	%r0, 4(%sr2,%r20)
-+# endif
-+#endif
-+	b	lws_exit
-+	ldo	-EFAULT(%r0),%r21	/* set errno */
-+	nop
-+	nop
-+	nop
-+	nop
++	/* Convert structure, don't leak anything in the copy */
++	memset(&compat_from,'\0',sizeof(compat_siginfo_t));
 +
-+	/* Two exception table entries, one for the load,
-+	   the other for the store. Either return -EFAULT */
-+	.section __ex_table,"aw"
-+#ifdef __LP64__
-+	/* Pad the address calculation */
-+	.word	0,(2b - linux_gateway_page)
-+	.dword	(3b - 2b) 
-+#else
-+	.word	2b - linux_gateway_page
-+	.word	(3b - 2b) 
-+#endif
-+	.previous
++        /* 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);
++	compat_from.si_code = (compat_int_t)(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);
 +
-+	.section __ex_table,"aw"
-+#ifdef __LP64__
-+	/* Pad the address calculation */
-+	.word	0,(1b - linux_gateway_page)
-+	.dword	(3b - 1b) 
-+#else
-+	.word	1b - linux_gateway_page
-+	.word	(3b - 1b) 
++        /* 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)(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)(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
-+	.previous
++		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)(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;
++}
 +
-+end_compare_and_swap:
++int compat_copy_siginfo_from_user(siginfo_t *to, compat_siginfo_t __user *from)
++{
++	int err;
++        u64 scratch;
 +
-+	/* Make sure nothing else is placed on this page */
-+	.align 4096
-+	.export end_linux_gateway_page
-+end_linux_gateway_page:
++	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.
++	 */
 +
-+	/* Relocate symbols assuming linux_gateway_page is mapped
-+	   to virtual address 0x0 */
-+#ifdef __LP64__
-+	/* 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
-+		  subtraction result is only a word in
-+		  length, so we pad the value.
-+	*/
-+#define LWS_ENTRY(_name_) .word 0,(lws_##_name_ - linux_gateway_page)
-+#else
-+#define LWS_ENTRY(_name_) .word  (lws_##_name_ - linux_gateway_page)
++        /* 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*)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*)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*)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;
++}
 +
-+	.align 4096
-+	/* Light-weight-syscall table */
-+	/* Start of lws table. */
-+	.export lws_table
-+.Llws_table:
-+lws_table:
-+	LWS_ENTRY(compare_and_swap32)	/* 0 - ELF32 Atomic compare and swap */
-+	LWS_ENTRY(compare_and_swap64)	/* 1 - ELF64 Atomic compare and swap */
-+	/* End of lws table */
++#endif
+Index: debian-kernel-hppa-2.6.8/kernel/printk.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/kernel/printk.c	2004-08-14 01:38:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/kernel/printk.c	2005-02-01 01:38:33.000000000 -0500
+@@ -91,8 +91,8 @@
+  * must be masked before subscripting
+  */
+ static unsigned long log_start;	/* Index into log_buf: next char to be read by syslog() */
+-static unsigned long con_start;	/* Index into log_buf: next char to be sent to consoles */
+-static unsigned long log_end;	/* Index into log_buf: most-recently-written-char + 1 */
++unsigned long con_start;	/* Index into log_buf: next char to be sent to consoles */
++unsigned long log_end;	/* Index into log_buf: most-recently-written-char + 1 */
+ static unsigned long logged_chars; /* Number of chars produced since last read+clear operation */
+ 
+ /*
+@@ -775,6 +775,11 @@
+ 	if (!(console->flags & CON_ENABLED))
+ 		return;
+ 
++	if (console_drivers && (console_drivers->flags & CON_BOOT)) {
++		unregister_console(console_drivers);
++		console->flags &= ~CON_PRINTBUFFER;
++	}
 +
- 	.align 4096
- 	.export sys_call_table
- .Lsys_call_table:
- sys_call_table:
- #include "syscall_table.S"
--.end
+ 	/*
+ 	 *	Put this console in the list - keep the
+ 	 *	preferred driver at the head of the list.
+Index: debian-kernel-hppa-2.6.8/kernel/ptrace.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/kernel/ptrace.c	2004-08-14 01:38:10.000000000 -0400
++++ debian-kernel-hppa-2.6.8/kernel/ptrace.c	2005-02-01 01:38:33.000000000 -0500
+@@ -290,7 +290,7 @@
+ {
+ 	if (child->last_siginfo == NULL)
+ 		return -EINVAL;
+-	if (copy_from_user(child->last_siginfo, data, sizeof (siginfo_t)) != 0)
++	if (copy_siginfo_from_user(child->last_siginfo, data) != 0)
+ 		return -EFAULT;
+ 	return 0;
+ }
+Index: debian-kernel-hppa-2.6.8/kernel/resource.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/kernel/resource.c	2004-08-14 01:37:25.000000000 -0400
++++ debian-kernel-hppa-2.6.8/kernel/resource.c	2005-02-01 01:38:32.000000000 -0500
+@@ -179,6 +179,8 @@
+ {
+ 	struct resource *tmp, **p;
+ 
++	BUG_ON(old->child);
 +
- #ifdef __LP64__
- 	.align 4096
- 	.export sys_call_table64
-@@ -359,10 +665,29 @@
- #include "syscall_table.S"
- #endif
+ 	p = &old->parent->child;
+ 	for (;;) {
+ 		tmp = *p;
+Index: debian-kernel-hppa-2.6.8/kernel/signal.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/kernel/signal.c	2004-08-14 01:36:56.000000000 -0400
++++ debian-kernel-hppa-2.6.8/kernel/signal.c	2005-02-01 01:38:33.000000000 -0500
+@@ -21,6 +21,7 @@
+ #include <linux/binfmts.h>
+ #include <linux/security.h>
+ #include <linux/ptrace.h>
++#include <linux/compat_siginfo.h>
+ #include <asm/param.h>
+ #include <asm/uaccess.h>
+ #include <asm/unistd.h>
+@@ -2024,17 +2025,35 @@
+ 	return do_sigpending(set, sigsetsize);
+ }
  
-+#ifdef CONFIG_SMP
-+	/*
-+		All light-weight-syscall atomic operations 
-+		will use this set of locks 
-+	*/
-+	.section .data
-+	.align 4096
-+	.export lws_lock_start
-+.Llws_lock_start:
-+lws_lock_start:
-+	/* lws locks */
-+	.align 16
-+	.rept 16
-+	/* Keep locks aligned at 16-bytes */
-+	.word 1
-+	.word 0 
-+	.word 0
-+	.word 0
-+	.endr
-+	.previous
++#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
-+/* CONFIG_SMP for lws_lock_start */
++
+ #ifndef HAVE_ARCH_COPY_SIGINFO_TO_USER
  
--	/* Make sure nothing else is placed on this page */
-+.end
+ 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);
++	}
  
--	.align 4096
--	.export end_linux_gateway_page
--end_linux_gateway_page:
+ 	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.
+@@ -2271,7 +2290,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: debian-kernel-hppa-2.6.8/mm/shmem.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/mm/shmem.c	2005-02-01 01:36:44.000000000 -0500
++++ debian-kernel-hppa-2.6.8/mm/shmem.c	2005-02-01 01:38:33.000000000 -0500
+@@ -410,7 +410,7 @@
+ 	return freed;
+ }
+ 
+-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: debian-kernel-hppa-2.6.8/sound/oss/Kconfig
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/sound/oss/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/sound/oss/Kconfig	2005-01-15 20:15:14.000000000 -0500
+--- debian-kernel-hppa-2.6.8.orig/sound/oss/Kconfig	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/sound/oss/Kconfig	2005-02-01 01:38:33.000000000 -0500
 @@ -162,7 +162,10 @@
  
  config SOUND_HARMONY
@@ -12375,150 +11997,568 @@
  
  config SOUND_SONICVIBES
  	tristate "S3 SonicVibes"
-Index: debian-kernel-hppa-2.6.8/arch/parisc/mm/init.c
+Index: debian-kernel-hppa-2.6.8/sound/oss/ad1889.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/mm/init.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/mm/init.c	2005-01-15 20:15:14.000000000 -0500
-@@ -750,7 +750,7 @@
- #if PTRS_PER_PMD == 1
- 	pmd = (pmd_t *)__pa(pg_dir);
- #else
--	pmd = (pmd_t *) (PAGE_MASK & pgd_val(*pg_dir));
-+	pmd = (pmd_t *) pgd_address(*pg_dir);
+--- debian-kernel-hppa-2.6.8.orig/sound/oss/ad1889.c	2004-08-14 01:36:45.000000000 -0400
++++ debian-kernel-hppa-2.6.8/sound/oss/ad1889.c	2005-02-01 01:38:33.000000000 -0500
+@@ -1,5 +1,5 @@
+ /*
+- *  Copyright 2001 Randolph Chung <tausq at debian.org>
++ *  Copyright 2001-2004 Randolph Chung <tausq at debian.org>
+  *
+  *  Analog Devices 1889 PCI audio driver (AD1819 AC97-compatible codec)
+  *
+@@ -61,6 +61,7 @@
+ #define AD1889_WRITEL(dev,reg,val) writel((val), dev->regbase + reg)
  
- 	/*
- 	 * pmd is physical at this point
-@@ -761,7 +761,7 @@
- 		pmd = (pmd_t *) __pa(pmd);
+ //now 100ms
++/* #define WAIT_10MS()	schedule_timeout(HZ/10) */
+ #define WAIT_10MS()	do { int __i; for (__i = 0; __i < 100; __i++) udelay(1000); } while(0)
+ 
+ /* currently only support a single device */
+@@ -69,25 +70,43 @@
+ /************************* helper routines ***************************** */
+ static inline void ad1889_set_wav_rate(ad1889_dev_t *dev, int rate)
+ {
++	struct ac97_codec *ac97_codec = dev->ac97_codec;
++
++	DBG("Setting WAV rate to %d\n", rate);
+ 	dev->state[AD_WAV_STATE].dmabuf.rate = rate;
+ 	AD1889_WRITEW(dev, AD_DSWAS, rate);
++
++	/* Cycle the DAC to enable the new rate */
++	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200);
++	WAIT_10MS();
++	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0);
+ }
+ 
+ static inline void ad1889_set_adc_rate(ad1889_dev_t *dev, int rate)
+ {
++	struct ac97_codec *ac97_codec = dev->ac97_codec;
++
++	DBG("Setting ADC rate to %d\n", rate);
+ 	dev->state[AD_ADC_STATE].dmabuf.rate = rate;
+ 	AD1889_WRITEW(dev, AD_DSRES, rate);
++
++	/* Cycle the ADC to enable the new rate */
++	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0100);
++	WAIT_10MS();
++	ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0);
+ }
+ 
+ static inline void ad1889_set_wav_fmt(ad1889_dev_t *dev, int fmt)
+ {
+ 	u16 tmp;
+ 
++	DBG("Setting WAV format to 0x%x\n", fmt);
++
+ 	tmp = AD1889_READW(ad1889_dev, AD_DSWSMC);
+-	if (fmt == AFMT_S16_LE) {
++	if (fmt & AFMT_S16_LE) {
+ 		//tmp |= 0x0100; /* set WA16 */
+ 		tmp |= 0x0300; /* set WA16 stereo */
+-	} else if (fmt == AFMT_U8) {
++	} else if (fmt & AFMT_U8) {
+ 		tmp &= ~0x0100; /* clear WA16 */
+ 	} 
+ 	AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp);
+@@ -97,10 +116,12 @@
+ {
+ 	u16 tmp;
+ 
++	DBG("Setting ADC format to 0x%x\n", fmt);
++
+ 	tmp = AD1889_READW(ad1889_dev, AD_DSRAMC);
+-	if (fmt == AFMT_S16_LE) {
++	if (fmt & AFMT_S16_LE) {
+ 		tmp |= 0x0100; /* set WA16 */
+-	} else if (fmt == AFMT_U8) {
++	} else if (fmt & AFMT_U8) {
+ 		tmp &= ~0x0100; /* clear WA16 */
+ 	} 
+ 	AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp);
+@@ -133,6 +154,9 @@
+ 	dmabuf->dma_len = cnt;
+ 	dmabuf->ready = 1;
+ 
++	DBG("Starting playback at 0x%p for %ld bytes\n", dmabuf->rawbuf +
++	    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);
+@@ -243,7 +267,7 @@
+ 		dmabuf->dma_handle = 0;
+ 		dmabuf->rd_ptr = dmabuf->wr_ptr = dmabuf->dma_len = 0UL;
+ 		dmabuf->ready = 0;
+-		dmabuf->rate = 44100;
++		dmabuf->rate = 48000;
  	}
+ 	return dev;
  
--	pgd_val(*pg_dir) = _PAGE_TABLE | (unsigned long) pmd;
-+	__pgd_val_set(*pg_dir, PxD_FLAG_PRESENT | PxD_FLAG_VALID | (unsigned long) pmd);
- #endif
- 	/* now change pmd to kernel virtual addresses */
+@@ -472,7 +496,6 @@
+ 		long cnt = count;
+ 		unsigned long flags;
  
-@@ -771,11 +771,11 @@
- 	 * pg_table is physical at this point
- 	 */
+-
+ 		for (;;) {
+ 			long used_bytes;
+ 			long timeout;	/* max time for DMA in jiffies */
+@@ -498,17 +521,11 @@
+ 			}
  
--	pg_table = (pte_t *) (PAGE_MASK & pmd_val(*pmd));
-+	pg_table = (pte_t *) pmd_address(*pmd);
- 	if (!pg_table)
- 		pg_table = (pte_t *) __pa(get_zeroed_page(GFP_KERNEL));
+ 			set_current_state(TASK_INTERRUPTIBLE);
+-			if (!schedule_timeout(timeout + 1))
+-				printk(KERN_WARNING "AD1889 timeout(%ld) r/w %lx/%lx len %lx\n",
+-				    timeout+1,
+-				    dmabuf->rd_ptr, dmabuf->wr_ptr,
+-				    dmabuf->dma_len);
+-
++			schedule_timeout(timeout + 1);
+ 			if (signal_pending(current)) {
+ 				ret = -ERESTARTSYS;
+ 				goto err2;
+ 			}
+-
+ 		}
  
--	pmd_val(*pmd) = _PAGE_TABLE | (unsigned long) pg_table;
-+	__pmd_val_set(*pmd, PxD_FLAG_PRESENT | PxD_FLAG_VALID | (unsigned long) pg_table);
+ 		/* watch out for wrapping around static buffer */
+@@ -616,6 +633,8 @@
+ 	audio_buf_info abinfo;
+ 	int __user *p = (int __user *)arg;
  
- 	/* now change pg_table to kernel virtual addresses */
++	DBG("ad1889_ioctl cmd 0x%x arg %lu\n", cmd, arg);
++
+ 	switch (cmd)
+ 	{
+ 	case OSS_GETVERSION:
+@@ -674,11 +693,15 @@
+ 		if (get_user(val, p))
+ 			return -EFAULT;
  
-Index: debian-kernel-hppa-2.6.8/drivers/input/mouse/Kconfig
+-		if (file->f_mode & FMODE_READ) 
+-			ad1889_set_adc_fmt(dev, val);
++		if (val == 0) {
++			if (file->f_mode & FMODE_READ) 
++				ad1889_set_adc_fmt(dev, val);
+ 
+-		if (file->f_mode & FMODE_WRITE) 
+-			ad1889_set_wav_fmt(dev, val);
++			if (file->f_mode & FMODE_WRITE) 
++				ad1889_set_wav_fmt(dev, val);
++		} else {
++			val = AFMT_S16_LE | AFMT_U8;
++		}
+ 
+ 		return put_user(val, p);
+ 
+@@ -758,7 +781,7 @@
+ 	
+ 	file->private_data = ad1889_dev;
+ 
+-	ad1889_set_wav_rate(ad1889_dev, 44100);
++	ad1889_set_wav_rate(ad1889_dev, 48000);
+ 	ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
+ 	AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */
+ 	return nonseekable_open(inode, file);
+@@ -938,7 +961,6 @@
+ 			ad1889_stop_wav(&dev->state[AD_WAV_STATE]);	/* clean up */
+ 			ad1889_start_wav(&dev->state[AD_WAV_STATE]);	/* start new */
+ 		}
+-
+ 	}
+ 
+ 	if ((stat & 0x2) && dev->state[AD_ADC_STATE].dmabuf.ready) { /* ADCI */
+@@ -952,18 +974,19 @@
+ 
+ static void ad1889_initcfg(ad1889_dev_t *dev)
+ {
+-	u16 tmp;
++	u16 tmp16;
++	u32 tmp32;
+ 
+ 	/* make sure the interrupt bits are setup the way we want */
+-	tmp = AD1889_READW(dev, AD_DMAWAVCTRL);
+-	tmp &= ~0x00ff; /* flat dma, no sg, mask out the intr bits */
+-	tmp |= 0x0004;  /* intr on count, loop */
+-	AD1889_WRITEW(dev, AD_DMAWAVCTRL, tmp);
++	tmp32 = AD1889_READL(dev, AD_DMAWAVCTRL);
++	tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */
++	tmp32 |= 0x6;  /* intr on count, loop */
++	AD1889_WRITEL(dev, AD_DMAWAVCTRL, tmp32);
+ 
+ 	/* unmute... */
+-	tmp = AD1889_READW(dev, AD_DSWADA);
+-	tmp &= ~0x8080;
+-	AD1889_WRITEW(dev, AD_DSWADA, tmp);
++	tmp16 = AD1889_READW(dev, AD_DSWADA);
++	tmp16 &= ~0x8080;
++	AD1889_WRITEW(dev, AD_DSWADA, tmp16);
+ }
+ 
+ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
+Index: debian-kernel-hppa-2.6.8/sound/oss/ad1889.h
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/input/mouse/Kconfig	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/input/mouse/Kconfig	2005-01-15 20:15:14.000000000 -0500
-@@ -130,3 +130,11 @@
- 	  described in the source file). This driver should, in theory,
- 	  also work with the digitizer DEC produced, but it isn't tested
- 	  with that (I don't have the hardware yet).
+--- debian-kernel-hppa-2.6.8.orig/sound/oss/ad1889.h	2004-08-14 01:37:25.000000000 -0400
++++ debian-kernel-hppa-2.6.8/sound/oss/ad1889.h	2005-02-01 01:38:33.000000000 -0500
+@@ -34,9 +34,9 @@
+ #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	/* RES PCI control/status */
+-#define AD_DMASYNCTRL	0xb0	/* RES PCI control/status */
+-#define AD_DMAWAVCTRL	0xb8	/* 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 */
+ 
+Index: debian-kernel-hppa-2.6.8/sound/oss/harmony.c
+===================================================================
+--- debian-kernel-hppa-2.6.8.orig/sound/oss/harmony.c	2004-08-14 01:37:38.000000000 -0400
++++ debian-kernel-hppa-2.6.8/sound/oss/harmony.c	2005-02-01 01:38:33.000000000 -0500
+@@ -12,6 +12,7 @@
+ 	Copyright 2000-2003 (c) Helge Deller <deller at gmx.de>
+ 	Copyright 2001 (c) Matthieu Delahaye <delahaym at esiee.fr>
+ 	Copyright 2001 (c) Jean-Christophe Vaugeois <vaugeoij at esiee.fr>
++	Copyright 2004 (c) Stuart Brady <sdbrady at ntlworld.com>
+ 
+ 				
+ TODO:
+@@ -124,9 +125,17 @@
+ #define GAIN_RO_MASK    ( 0x3f << GAIN_RO_SHIFT) 
+ 
+ 
+-#define MAX_OUTPUT_LEVEL (GAIN_RO_MASK >> GAIN_RO_SHIFT)
+-#define MAX_INPUT_LEVEL  (GAIN_RI_MASK >> GAIN_RI_SHIFT)
+-#define MAX_VOLUME_LEVEL (GAIN_MA_MASK >> GAIN_MA_SHIFT)
++#define MAX_OUTPUT_LEVEL  (GAIN_RO_MASK >> GAIN_RO_SHIFT)
++#define MAX_INPUT_LEVEL   (GAIN_RI_MASK >> GAIN_RI_SHIFT)
++#define MAX_MONITOR_LEVEL (GAIN_MA_MASK >> GAIN_MA_SHIFT)
 +
-+config MOUSE_HIL
-+	tristate "HIL pointers (mice etc)."
-+	depends on PARISC && INPUT_MOUSE
-+	select HP_SDC
-+	select HIL_MLC
-+	help
-+	  Say Y here to support HIL pointers.
-Index: debian-kernel-hppa-2.6.8/drivers/video/stifb.c
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/video/stifb.c	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/video/stifb.c	2005-01-15 20:15:14.000000000 -0500
-@@ -1379,6 +1379,7 @@
- stifb_init(void)
++#define MIXER_INTERNAL   SOUND_MIXER_LINE1
++#define MIXER_LINEOUT    SOUND_MIXER_LINE2
++#define MIXER_HEADPHONES SOUND_MIXER_LINE3
++
++#define MASK_INTERNAL   SOUND_MASK_LINE1
++#define MASK_LINEOUT    SOUND_MASK_LINE2
++#define MASK_HEADPHONES SOUND_MASK_LINE3
+ 
+ /*
+  * Channels Mask in mixer register
+@@ -543,6 +552,7 @@
+ 	int count = 0;
+ 	int frame_size;
+ 	int buf_to_fill;
++	int fresh_buffer;
+ 
+ 	if (!harmony.format_initialized) {
+ 		if (harmony_format_auto_detect(buffer, total_count))
+@@ -564,12 +574,16 @@
+ 		
+ 		
+ 		buf_to_fill = (harmony.first_filled_play+harmony.nb_filled_play); 
+-		if (harmony.play_offset)
++		if (harmony.play_offset) {
+ 			buf_to_fill--;
++			buf_to_fill += MAX_BUFS;
++		}
+ 		buf_to_fill %= MAX_BUFS;
+-
++		
++		fresh_buffer = (harmony.play_offset == 0);
++		
+ 		/* Figure out the size of the frame */
+-		if ((total_count-count) > HARMONY_BUF_SIZE - harmony.play_offset) {
++		if ((total_count-count) >= HARMONY_BUF_SIZE - harmony.play_offset) {
+ 			frame_size = HARMONY_BUF_SIZE - harmony.play_offset;
+ 		} else {
+ 			frame_size = total_count - count;
+@@ -587,7 +601,7 @@
+ 		CHECK_WBACK_INV_OFFSET(played_buf, (HARMONY_BUF_SIZE*buf_to_fill + harmony.play_offset), 
+ 				frame_size);
+ 	
+-		if (!harmony.play_offset)
++		if (fresh_buffer)
+ 			harmony.nb_filled_play++;
+ 		
+ 		count += frame_size;
+@@ -650,18 +664,17 @@
+ 			switch (ival) {
+ 			case AFMT_MU_LAW:	new_format = HARMONY_DF_8BIT_ULAW; break;
+ 			case AFMT_A_LAW:	new_format = HARMONY_DF_8BIT_ALAW; break;
+-			case AFMT_S16_LE:	/* fall through, but not really supported */
+-			case AFMT_S16_BE:	new_format = HARMONY_DF_16BIT_LINEAR;
+-						ival = AFMT_S16_BE;
+-						break; 
++			case AFMT_S16_BE:	new_format = HARMONY_DF_16BIT_LINEAR; break;
+ 			default: {
+ 				DPRINTK(KERN_WARNING PFX 
+ 					"unsupported sound format 0x%04x requested.\n",
+ 					ival);
+-				return -EINVAL;
++				ival = AFMT_S16_BE;
++				return put_user(ival, (int *) arg);
+ 			}
+ 			}
+ 			harmony_set_format(new_format);
++			return 0;
+ 		} else {
+ 			switch (harmony.data_format) {
+ 			case HARMONY_DF_8BIT_ULAW:	ival = AFMT_MU_LAW; break;
+@@ -669,8 +682,8 @@
+ 			case HARMONY_DF_16BIT_LINEAR:	ival = AFMT_U16_BE; break;
+ 			default: ival = 0;
+ 			}
++			return put_user(ival, (int *) arg);
+ 		}
+-		return put_user(ival, (int *) arg);
+ 
+ 	case SOUND_PCM_READ_RATE:
+ 		ival = harmony.dac_rate;
+@@ -689,7 +702,17 @@
+ 		if (ival != 0 && ival != 1)
+ 			return -EINVAL;
+ 		harmony_set_stereo(ival);
+-		return put_user(ival, (int *) arg);
++ 		return 0;
++ 
++ 	case SNDCTL_DSP_CHANNELS:
++ 		if (get_user(ival, (int *) arg))
++ 			return -EFAULT;
++ 		if (ival != 1 && ival != 2) {
++ 			ival = harmony.stereo_select == HARMONY_SS_MONO ? 1 : 2;
++ 			return put_user(ival, (int *) arg);
++ 		}
++ 		harmony_set_stereo(ival-1);
++ 		return 0;
+ 
+ 	case SNDCTL_DSP_GETBLKSIZE:
+ 		ival = HARMONY_BUF_SIZE;
+@@ -887,7 +910,7 @@
+ 	int right_level;
+ 
+ 	switch (channel) {
+-		case SOUND_MIXER_OGAIN:
++		case SOUND_MIXER_VOLUME:
+ 			left_level  = (harmony.current_gain & GAIN_LO_MASK) >> GAIN_LO_SHIFT;
+ 			right_level = (harmony.current_gain & GAIN_RO_MASK) >> GAIN_RO_SHIFT;
+ 			left_level  = to_oss_level(MAX_OUTPUT_LEVEL - left_level, MAX_OUTPUT_LEVEL);
+@@ -901,10 +924,10 @@
+ 			right_level= to_oss_level(right_level, MAX_INPUT_LEVEL);
+ 			return (right_level << 8)+left_level;
+ 			
+-		case SOUND_MIXER_VOLUME:
++		case SOUND_MIXER_MONITOR:
+ 			left_level = (harmony.current_gain & GAIN_MA_MASK) >> GAIN_MA_SHIFT;
+-			left_level = to_oss_level(MAX_VOLUME_LEVEL-left_level, MAX_VOLUME_LEVEL);
+-			return left_level;
++			left_level = to_oss_level(MAX_MONITOR_LEVEL-left_level, MAX_MONITOR_LEVEL);
++			return (left_level << 8)+left_level;
+ 	}
+ 	return -EINVAL;
+ }
+@@ -926,9 +949,11 @@
+ 
+ 	right_level = (value & 0x0000ff00) >> 8;
+ 	left_level = value & 0x000000ff;
++	if (right_level > 100) right_level = 100;
++	if (left_level > 100) left_level = 100;
+   
+ 	switch (channel) {
+-		case SOUND_MIXER_OGAIN:
++		case SOUND_MIXER_VOLUME:
+ 			right_level = to_harmony_level(100-right_level, MAX_OUTPUT_LEVEL);
+ 			left_level  = to_harmony_level(100-left_level, MAX_OUTPUT_LEVEL);
+ 			new_right_level = to_oss_level(MAX_OUTPUT_LEVEL - right_level, MAX_OUTPUT_LEVEL);
+@@ -948,12 +973,12 @@
+ 			harmony_mixer_set_gain();
+ 			return (new_right_level << 8) + new_left_level;
+ 	
+-		case SOUND_MIXER_VOLUME:
+-			left_level = to_harmony_level(100-left_level, MAX_VOLUME_LEVEL);
+-			new_left_level = to_oss_level(MAX_VOLUME_LEVEL-left_level, MAX_VOLUME_LEVEL);
+-			harmony.current_gain = (harmony.current_gain & ~GAIN_MA_MASK)| (left_level << GAIN_MA_SHIFT);
++		case SOUND_MIXER_MONITOR:
++			left_level = to_harmony_level(100-left_level, MAX_MONITOR_LEVEL);
++			new_left_level = to_oss_level(MAX_MONITOR_LEVEL-left_level, MAX_MONITOR_LEVEL);
++			harmony.current_gain = (harmony.current_gain & ~GAIN_MA_MASK) | (left_level << GAIN_MA_SHIFT);
+ 			harmony_mixer_set_gain();
+-			return new_left_level;
++			return (new_left_level << 8) + new_left_level;
+ 	}
+ 
+ 	return -EINVAL;
+@@ -986,11 +1011,15 @@
  {
- 	struct sti_struct *sti;
-+	struct sti_struct *def_sti;
- 	int i;
+ 	int new_input_line;
+ 	int new_input_mask;
+-
+-	if ((recmask & SOUND_MASK_LINE)) {
++	int current_input_line;
++	
++	current_input_line = (harmony.current_gain & GAIN_IS_MASK)
++				    >> GAIN_IS_SHIFT;
++	if ((current_input_line && ((recmask & SOUND_MASK_LINE) || !(recmask & SOUND_MASK_MIC))) ||
++		(!current_input_line && ((recmask & SOUND_MASK_LINE) && !(recmask & SOUND_MASK_MIC)))) {
+ 		new_input_line = 0;
+ 		new_input_mask = SOUND_MASK_LINE;
+-	} else  {
++	} else {
+ 		new_input_line = 1;
+ 		new_input_mask = SOUND_MASK_MIC;
+ 	}
+@@ -1009,9 +1038,9 @@
+ {
+ 	int outmask = 0;
  	
- 	if (stifb_disabled) {
-@@ -1386,9 +1387,19 @@
- 		return -ENXIO;
+-	if (harmony.current_gain & GAIN_HE_MASK) outmask |=SOUND_MASK_PHONEOUT;
+-	if (harmony.current_gain & GAIN_LE_MASK) outmask |=SOUND_MASK_LINE;
+-	if (harmony.current_gain & GAIN_SE_MASK) outmask |=SOUND_MASK_SPEAKER;
++	if (harmony.current_gain & GAIN_SE_MASK) outmask |= MASK_INTERNAL;
++	if (harmony.current_gain & GAIN_LE_MASK) outmask |= MASK_LINEOUT;
++	if (harmony.current_gain & GAIN_HE_MASK) outmask |= MASK_HEADPHONES;
+ 	
+ 	return outmask;
+ }
+@@ -1019,24 +1048,24 @@
+ 
+ static int harmony_mixer_set_outmask(int outmask)
+ {
+-	if (outmask & SOUND_MASK_PHONEOUT) 
+-		harmony.current_gain |= GAIN_HE_MASK; 
++	if (outmask & MASK_INTERNAL) 
++		harmony.current_gain |= GAIN_SE_MASK;
+ 	else 
+-		harmony.current_gain &= ~GAIN_HE_MASK;
++		harmony.current_gain &= ~GAIN_SE_MASK;
+ 	
+-	if (outmask & SOUND_MASK_LINE) 
++	if (outmask & MASK_LINEOUT) 
+ 		harmony.current_gain |= GAIN_LE_MASK;
+ 	else 
+ 		harmony.current_gain &= ~GAIN_LE_MASK;
+ 	
+-	if (outmask & SOUND_MASK_SPEAKER) 
+-		harmony.current_gain |= GAIN_SE_MASK;
++	if (outmask & MASK_HEADPHONES) 
++		harmony.current_gain |= GAIN_HE_MASK; 
+ 	else 
+-		harmony.current_gain &= ~GAIN_SE_MASK;
++		harmony.current_gain &= ~GAIN_HE_MASK;
+ 	
+ 	harmony_mixer_set_gain();
+ 
+-	return (outmask & (SOUND_MASK_PHONEOUT | SOUND_MASK_LINE | SOUND_MASK_SPEAKER));
++	return (outmask & (MASK_INTERNAL | MASK_LINEOUT | MASK_HEADPHONES));
+ }
+ 
+ /*
+@@ -1074,19 +1103,19 @@
+ 		ret = SOUND_CAP_EXCL_INPUT;
+ 		break;
+ 	case MIXER_READ(SOUND_MIXER_STEREODEVS):
+-		ret = SOUND_MASK_IGAIN | SOUND_MASK_OGAIN;
++		ret = SOUND_MASK_VOLUME | SOUND_MASK_IGAIN;
+ 		break;
+ 		
+ 	case MIXER_READ(SOUND_MIXER_RECMASK):
+ 		ret = SOUND_MASK_MIC | SOUND_MASK_LINE;
+ 		break;
+ 	case MIXER_READ(SOUND_MIXER_DEVMASK):
+-		ret = SOUND_MASK_OGAIN | SOUND_MASK_IGAIN |
+-			SOUND_MASK_VOLUME;
++		ret = SOUND_MASK_VOLUME | SOUND_MASK_IGAIN |
++			SOUND_MASK_MONITOR;
+ 		break;
+ 	case MIXER_READ(SOUND_MIXER_OUTMASK):
+-		ret = SOUND_MASK_SPEAKER | SOUND_MASK_LINE |
+-			SOUND_MASK_PHONEOUT;
++		ret = MASK_INTERNAL | MASK_LINEOUT |
++			MASK_HEADPHONES;
+ 		break;
+ 		
+ 	case MIXER_WRITE(SOUND_MIXER_RECSRC):
+@@ -1103,15 +1132,15 @@
+ 		ret = harmony_mixer_get_outmask();
+ 		break;
+ 	
+-	case MIXER_WRITE(SOUND_MIXER_OGAIN):
+-	case MIXER_WRITE(SOUND_MIXER_IGAIN):
+ 	case MIXER_WRITE(SOUND_MIXER_VOLUME):
++	case MIXER_WRITE(SOUND_MIXER_IGAIN):
++	case MIXER_WRITE(SOUND_MIXER_MONITOR):
+ 		ret = harmony_mixer_set_level(cmd & 0xff, val);
+ 		break;
+ 
+-	case MIXER_READ(SOUND_MIXER_OGAIN):
+-	case MIXER_READ(SOUND_MIXER_IGAIN):
+ 	case MIXER_READ(SOUND_MIXER_VOLUME):
++	case MIXER_READ(SOUND_MIXER_IGAIN):
++	case MIXER_READ(SOUND_MIXER_MONITOR):
+ 		ret = harmony_mixer_get_level(cmd & 0xff);
+ 		break;
+ 
+@@ -1201,16 +1230,15 @@
+ 		return -EBUSY;
  	}
- 	
-+	def_sti = sti_get_rom(0);
-+	if (def_sti) {
-+		for (i = 1; i < MAX_STI_ROMS; i++) {
-+			sti = sti_get_rom(i);
-+			if (sti == def_sti && bpp > 0)
-+				stifb_force_bpp[i] = bpp;
-+		}
-+		stifb_init_fb(def_sti, stifb_force_bpp[i]);
-+	}
+ 
+-	harmony.dev = dev;
+-
+-	/* Set the HPA of harmony */
+-	harmony.hpa = (struct harmony_hpa *)dev->hpa;
+-
+-	if (!harmony.dev->irq) {
++	if (!dev->irq) {
+ 		printk(KERN_ERR PFX "no irq found\n");
+ 		return -ENODEV;
+ 	}
+ 
++	/* Set the HPA of harmony */
++	harmony.hpa = (struct harmony_hpa *)dev->hpa;
++	harmony.dev = dev;
 +
- 	for (i = 1; i < MAX_STI_ROMS; i++) {
- 		sti = sti_get_rom(i);
--		if (!sti)
-+		if (!sti || sti==def_sti)
- 			break;
- 		if (bpp > 0)
- 			stifb_force_bpp[i] = bpp;
-Index: debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym53c8xx.h
+ 	/* Grab the ID and revision from the device */
+ 	id = gsc_readb(&harmony.hpa->id);
+ 	if ((id | 1) != 0x15) {
+Index: debian-kernel-hppa-2.6.8/sound/parisc/harmony.c
 ===================================================================
---- debian-kernel-hppa-2.6.8.orig/drivers/scsi/sym53c8xx_2/sym53c8xx.h	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/drivers/scsi/sym53c8xx_2/sym53c8xx.h	2005-01-15 20:15:14.000000000 -0500
-@@ -22,32 +22,19 @@
+--- debian-kernel-hppa-2.6.8.orig/sound/parisc/harmony.c	2004-08-14 01:36:56.000000000 -0400
++++ debian-kernel-hppa-2.6.8/sound/parisc/harmony.c	2005-02-01 01:38:33.000000000 -0500
+@@ -6,7 +6,7 @@
   *
-  *-----------------------------------------------------------------------------
+  *	Harmony is found in HP 712s, 715/new and many other GSC based machines.
+  *	On older 715 machines you'll find the technically identical chip 
+- *	called 'Vivace'. Both Harmony and Vicace are supported by this driver.
++ *	called 'Vivace'. Both Harmony and Vivace are supported by this driver.
   *
-- * 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.
-- * 2. The name of the author may not be used to endorse or promote products
-- *    derived from this software without specific prior written permission.
-- *
-- * Where this Software is combined with software released under the terms of 
-- * the GNU Public License ("GPL") and the terms of the GPL would require the 
-- * combined work to also be released under the terms of the GPL, the terms
-- * and conditions of this License will apply in addition to those of the
-- * GPL with the exception of any terms or conditions of this License that
-- * conflict with, or are expressly prohibited by, the GPL.
-- *
-- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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
-- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- * SUCH DAMAGE.
-+ * 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.  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
-  */
+  *  this ALSA driver is based on OSS driver by:
+  *	Copyright 2000 (c) Linuxcare Canada, Alex deVries <alex at linuxcare.com>
+@@ -43,7 +43,7 @@
+  * to be recorded is put in RNXTADD. There is 2 read-only registers, PCURADD and 
+  * RCURADD that provides adress of current page.
+  * 
+- * Harmony has no way to controll full duplex or half duplex mode. It means
++ * Harmony has no way to control full duplex or half duplex mode. It means
+  * that we always need to provide adresses of playback and capture data, even
+  * when this is not needed. That's why we statically alloc one graveyard
+  * buffer (to put recorded data in play-only mode) and a silence buffer.
+@@ -556,7 +556,7 @@
+ 	harmony->sample_rate = snd_card_harmony_rate_bits(runtime->rate);
  
- #ifndef SYM53C8XX_H
-Index: debian-kernel-hppa-2.6.8/arch/parisc/Makefile
-===================================================================
---- debian-kernel-hppa-2.6.8.orig/arch/parisc/Makefile	2005-01-15 20:12:36.000000000 -0500
-+++ debian-kernel-hppa-2.6.8/arch/parisc/Makefile	2005-01-15 20:15:14.000000000 -0500
-@@ -52,7 +52,6 @@
- cflags-$(CONFIG_PA8X00)		+= -march=2.0 -mschedule=8000
+ 	/* data format */
+-	harmony->data_format = snd_harmony_set_data_format(haromny, runtime->format);
++	harmony->data_format = snd_harmony_set_data_format(harmony, runtime->format);
  
- head-y			:= arch/parisc/kernel/head.o 
--head-$(CONFIG_PARISC64)	:= arch/parisc/kernel/head64.o
- 
- CFLAGS	+= $(cflags-y)
- 
+ 	/* number of channels */
+ 	if (runtime->channels == 2)
+@@ -587,7 +587,7 @@
+ 	harmony->sample_rate = snd_card_harmony_rate_bits(runtime->rate);
+ 	
+ 	/* data format */
+-	harmony->data_format = snd_harmony_set_data_format(haromny, runtime->format);
++	harmony->data_format = snd_harmony_set_data_format(harmony, runtime->format);
+ 	
+ 	/* number of channels */
+ 	if (runtime->channels == 1)




More information about the Kernel-svn-changes mailing list