http://linux.bkbits.net/linux-2.5
benh@kernel.crashing.org|ChangeSet|20040321034002|65532 benh
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/03/20 19:40:02-08:00 benh@kernel.crashing.org 
#   [PATCH] pmac: Improved G4 "windtunnel" fan controller
#   
#   This is an improved version of the G4 "windtunnel" fan controller.  It
#   depends on the keywest bugfix...
# 
# drivers/macintosh/therm_windtunnel.c
#   2004/03/20 06:45:16-08:00 benh@kernel.crashing.org +276 -196
#   pmac: Improved G4 "windtunnel" fan controller
# 
# ChangeSet
#   2004/03/20 19:39:50-08:00 samuel@ibrium.se 
#   [PATCH] keywest bugfix
#   
#   This fixes a deadlock in I2C probing.
#   
#    - keywest holds the pmac_low_i2c_lock while registering the i2c adapter.
#    - i2c_add_adapter() notifies registered drivers by calling
#      driver->attach_adapter().
#    - a driver might access the i2c bus from attach_adapter() which
#      deadlocks since all xfer routines take the lock.
# 
# drivers/i2c/busses/i2c-keywest.c
#   2004/03/20 06:33:07-08:00 samuel@ibrium.se +1 -1
#   keywest bugfix
# 
# ChangeSet
#   2004/03/20 11:20:25-08:00 torvalds@osdl.org 
#   [PATCH] Fix missing part of x86-64 update, part 2
#   
#   One more missing doc-file update
# 
# Documentation/x86_64/boot-options.txt
#   2004/03/20 11:16:19-08:00 torvalds@osdl.org +5 -1
#   Fix missing part of x86-64 update, part 2
# 
# ChangeSet
#   2004/03/20 11:01:39-08:00 torvalds@osdl.org 
#   [PATCH] Fix missing part of x86-64 update
#   
#   Three quarters of the update from Andi was uncommitted due to a bad
#   patch date and a bug in "bk import -temail"..
#   
#   Here are the missing parts..
# 
# include/asm-x86_64/mpspec.h
#   2004/03/19 10:37:08-08:00 torvalds@osdl.org +3 -3
#   Fix missing part of x86-64 update
# 
# include/asm-x86_64/hpet.h
#   2004/03/19 10:37:08-08:00 torvalds@osdl.org +0 -3
#   Fix missing part of x86-64 update
# 
# include/asm-x86_64/hardirq.h
#   2004/03/19 10:03:21-08:00 torvalds@osdl.org +1 -0
#   Fix missing part of x86-64 update
# 
# include/asm-x86_64/calling.h
#   2004/03/17 07:52:48-08:00 torvalds@osdl.org +15 -15
#   Fix missing part of x86-64 update
# 
# include/asm-x86_64/acpi.h
#   2004/03/16 06:05:14-08:00 torvalds@osdl.org +2 -0
#   Fix missing part of x86-64 update
# 
# drivers/char/rtc.c
#   2004/03/19 10:19:28-08:00 torvalds@osdl.org +2 -0
#   Fix missing part of x86-64 update
# 
# arch/x86_64/pci/mmconfig.c
#   2004/03/16 06:53:50-08:00 torvalds@osdl.org +1 -1
#   Fix missing part of x86-64 update
# 
# arch/x86_64/mm/init.c
#   2004/03/18 13:03:55-08:00 torvalds@osdl.org +3 -3
#   Fix missing part of x86-64 update
# 
# arch/x86_64/kernel/setup.c
#   2004/03/16 19:45:56-08:00 torvalds@osdl.org +2 -4
#   Fix missing part of x86-64 update
# 
# arch/x86_64/kernel/process.c
#   2004/03/16 06:05:14-08:00 torvalds@osdl.org +3 -1
#   Fix missing part of x86-64 update
# 
# arch/x86_64/kernel/pci-gart.c
#   2004/03/19 10:38:17-08:00 torvalds@osdl.org +36 -21
#   Fix missing part of x86-64 update
# 
# arch/x86_64/kernel/mpparse.c
#   2004/03/19 10:38:17-08:00 torvalds@osdl.org +40 -44
#   Fix missing part of x86-64 update
# 
# ChangeSet
#   2004/03/20 10:29:59-08:00 torvalds@ppc970.osdl.org 
#   Merge alpha Kconfig
# 
# arch/alpha/Kconfig
#   2004/03/20 10:29:54-08:00 torvalds@ppc970.osdl.org +0 -2
#   Merge alpha Kconfig
# 
# ChangeSet
#   2004/03/20 10:02:00-08:00 rth@kanga.twiddle.home 
#   [ALPHA] Update defconfig.
# 
# arch/alpha/defconfig
#   2004/03/20 10:01:44-08:00 rth@kanga.twiddle.home +308 -137
#   Update.
# 
# ChangeSet
#   2004/03/20 09:48:18-08:00 bunk@fs.tum.de 
#   [PATCH] fix scsi_transport_spi.c compile with gcc 2.95
#   
#   Fix token pasting to work with older gcc versions.
#   
#   We need a space before the "," that may get pasted away.
# 
# drivers/scsi/scsi_transport_spi.c
#   2004/03/14 02:45:30-08:00 bunk@fs.tum.de +1 -1
#   fix scsi_transport_spi.c compile with gcc 2.95
# 
# ChangeSet
#   2004/03/20 09:45:57-08:00 akpm@osdl.org 
#   [PATCH] fix console oops/race
#   
#   Finally nailed this sucker.
#   
#   con_close() checks the tty->count and then sleeps in acquire_console_sem().
#   But another process can come in and grab a ref against the tty while
#   con_close() dropped the BKL.  But con_close() then proceeds to deallocate the
#   tty->driver_data anyway, even though the tty now has ->count == 2.
#   
#   Fix that by moving the check for ->tty_count inside console_sem.
# 
# drivers/char/vt.c
#   2004/03/20 02:16:46-08:00 akpm@osdl.org +10 -11
#   fix console oops/race
# 
# ChangeSet
#   2004/03/20 09:44:56-08:00 ak@suse.de 
#   [PATCH] critical x86-64 merge
#   
#   There were some nasty bugs in the x86-64 code, including one race that
#   could cause random reboots, especially on Intel machines, with the NMI
#   watchdog.  This patch fixes them and also includes some harmless
#   cleanups.
#   
#   Main fixes were for some buglets in the IOMMU code and the plugging of a
#   race in the exception stack handling.  Also disables an broken MCE on K8
#   explicitely.
#   
#   Also finally the preempt compile issues are fixed.
#   
#    - Declare hpet interrupt separately in drivers/char/rtc.c
#    - Fix rtc.h/hpet.h to not depend on interrupt.h
#    - Finally include smp_lock.h in hardirq.h
#    - Update defconfig
#    - Export bad_dma_address
#    - Merge with 2.6.5rc2
#    - Never schedule on interrupt stacks.
#    - Add option to force software iotlb (iommu=soft)
#    - Add ifdefs to gsi patch to match i386 (Bjorn Helgaas)
#    - Fix K8 GART TLB MCE workaround to actually work
#    - Fix dwarf2 unwind table in SAVE_ARGS (Jim Houston)
#    - Disable APIC on VIA/NVidia even with acpi=off (Gwenole Beauchesne)
#    - Fix parsing bug in "apic" option (Gwenole Beauchesne)
#    - Fix dma mask handling in pci_alloc_consistent
#    - Make pci_alloc_consistent more robust in low memory situations.
#    - Print version number in oopses (from i386)
#    - ACPI GSI cleanup (Bjorn Helgaas)
#    - Disable K8 GART TLB walk error MCE explicitely
#    - Add support to disable individual MCEs in the various banks.
# 
# arch/x86_64/kernel/mce.c
#   2004/03/19 19:10:05-08:00 ak@suse.de +37 -26
#   critical x86-64 merge
# 
# arch/x86_64/kernel/entry.S
#   2004/03/18 19:56:27-08:00 ak@suse.de +9 -5
#   critical x86-64 merge
# 
# arch/x86_64/kernel/acpi/boot.c
#   2004/03/18 14:25:51-08:00 ak@suse.de +11 -0
#   critical x86-64 merge
# 
# arch/x86_64/defconfig
#   2004/03/19 17:36:01-08:00 ak@suse.de +89 -392
#   critical x86-64 merge
# 
# ChangeSet
#   2004/03/20 09:42:56-08:00 torvalds@ppc970.osdl.org 
#   Rename therm_adt7467.c to match the new reality.
# 
# drivers/macintosh/therm_adt746x.c
#   2004/03/20 09:42:13-08:00 torvalds@ppc970.osdl.org +0 -0
#   Rename: drivers/macintosh/therm_adt7467.c -> drivers/macintosh/therm_adt746x.c
# 
# ChangeSet
#   2004/03/20 09:41:51-08:00 akpm@osdl.org 
#   [PATCH] therm_adt7467 update
#   
#   From: "Colin Leroy" <colin@colino.net>
#   
#   The fan driver I wrote for adt746x looks like it only handles the adt7467
#   chip found in iBooks G4; but it also handles the adt7460 chip found in the
#   Powerbook G4 Alu.  Here's a patch that updates therm_adt7467.c, Kconfig and
#   Makefile.
# 
# drivers/macintosh/therm_adt7467.c
#   2004/03/19 10:32:33-08:00 akpm@osdl.org +2 -5
#   therm_adt7467 update
# 
# drivers/macintosh/Makefile
#   2004/03/19 10:32:33-08:00 akpm@osdl.org +1 -1
#   therm_adt7467 update
# 
# drivers/macintosh/Kconfig
#   2004/03/19 10:32:33-08:00 akpm@osdl.org +2 -2
#   therm_adt7467 update
# 
# CREDITS
#   2004/03/19 10:32:33-08:00 akpm@osdl.org +7 -0
#   therm_adt7467 update
# 
# ChangeSet
#   2004/03/19 12:29:20-08:00 rth@kanga.twiddle.home 
#   [TRIVIAL] Tighten sanity in time_init to 250 ppm.
#   From:  "Bailey, Scott" <scott.bailey@eds.com>
# 
# arch/alpha/kernel/time.c
#   2004/03/19 12:29:04-08:00 rth@kanga.twiddle.home +6 -4
#   Tighten sanity in time_init to 250 ppm.
# 
# ChangeSet
#   2004/03/18 20:36:25-08:00 rth@kanga.twiddle.home 
#   [ALPHA] Streamline opDEC_check and the actual fixup bits in do_entIF.
# 
# arch/alpha/kernel/traps.c
#   2004/03/18 20:36:09-08:00 rth@kanga.twiddle.home +35 -40
#   Streamline opDEC_check and the actual fixup bits in do_entIF.
# 
# ChangeSet
#   2004/03/17 17:15:25-08:00 rth@kanga.twiddle.home 
#   [TRIVIAL] Remove x86 instructions on alpha.
#   From <adobriyan@mail.ru>.
# 
# arch/alpha/Kconfig
#   2004/03/17 17:15:09-08:00 rth@kanga.twiddle.home +2 -13
#   Remove x86 instructions on alpha.
# 
# ChangeSet
#   2004/03/17 17:11:34-08:00 rth@kanga.twiddle.home 
#   [TRIVIAL] Miata url update.
#   From: "Petri T. Koistinen" <petri.koistinen@iki.fi>
# 
# arch/alpha/Kconfig
#   2004/03/17 17:11:18-08:00 rth@kanga.twiddle.home +1 -1
#   Miata url update.
# 
# ChangeSet
#   2004/03/17 17:06:15-08:00 rth@kanga.twiddle.home 
#   [ALPHA] Fix build in alpha_ksyms.c.
# 
# arch/alpha/kernel/alpha_ksyms.c
#   2004/03/17 16:58:10-08:00 rth@kanga.twiddle.home +3 -0
#   Include <asm/unistd.h>.
# 
diff -Nru a/CREDITS b/CREDITS
--- a/CREDITS	Sun Mar 21 00:23:35 2004
+++ b/CREDITS	Sun Mar 21 00:23:35 2004
@@ -1864,6 +1864,13 @@
 S: D53424 Remagen
 S: Germany
 
+N: Colin Leroy
+E: colin@colino.net
+W: http://www.geekounet.org/
+D: PowerMac adt7467 fan driver
+S: Toulouse
+S: France
+
 N: Achim Leubner
 E: achim_leubner@adaptec.com
 D: GDT Disk Array Controller/Storage RAID controller driver
diff -Nru a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
--- a/Documentation/x86_64/boot-options.txt	Sun Mar 21 00:23:35 2004
+++ b/Documentation/x86_64/boot-options.txt	Sun Mar 21 00:23:35 2004
@@ -136,7 +136,7 @@
 
 IOMMU
 
-  iommu=[size][,noagp][,off][,force][,noforce][,leak][,memaper[=order]]
+  iommu=[size][,noagp][,off][,force][,noforce][,leak][,memaper[=order]][,soft]
    size  set size of iommu (in bytes)
    noagp don't initialize the AGP driver and use full aperture.
    off   don't use the IOMMU
@@ -144,5 +144,9 @@
    memaper[=order] allocate an own aperture over RAM with size 32MB^order.
    noforce don't force IOMMU usage. Default.
    force  Force IOMMU
+   soft   Use software bounce buffering for non 32bit IO. Default on Intel
+          machines. 
 
+  swiotlb=pages
 
+  Prereserve that many 4K pages for the software IO bounce buffering.
diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig
--- a/arch/alpha/Kconfig	Sun Mar 21 00:23:35 2004
+++ b/arch/alpha/Kconfig	Sun Mar 21 00:23:35 2004
@@ -188,7 +188,7 @@
 	help
 	  The Digital PersonalWorkStation (PWS 433a, 433au, 500a, 500au, 600a,
 	  or 600au).  There is an Installation HOWTO for this hardware at
-	  <http://members.brabant.chello.nl/~s.vandereijk/miata.html>.
+	  <http://eijk.homelinux.org/~stefan/miata.html>.
 
 config ALPHA_MIKASA
 	bool "Mikasa"
@@ -486,19 +486,8 @@
 	  singleprocessor machines. On a singleprocessor machine, the kernel
 	  will run faster if you say N here.
 
-	  Note that if you say Y here and choose architecture "586" or
-	  "Pentium" under "Processor family", the kernel will not work on 486
-	  architectures. Similarly, multiprocessor kernels for the "PPro"
-	  architecture may not work on all Pentium based boards.
-
-	  People using multiprocessor machines who say Y here should also say
-	  Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
-	  Management" code will be disabled if you say Y here.
-
-	  See also the <file:Documentation/smp.txt>,
-	  <file:Documentation/i386/IO-APIC.txt>,
-	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-	  <http://www.tldp.org/docs.html#howto>.
+	  See also the <file:Documentation/smp.tex>, and the SMP-HOWTO
+	  available at <http://www.tldp.org/docs.html#howto>.
 
 	  If you don't know what to do here, say N.
 
diff -Nru a/arch/alpha/defconfig b/arch/alpha/defconfig
--- a/arch/alpha/defconfig	Sun Mar 21 00:23:35 2004
+++ b/arch/alpha/defconfig	Sun Mar 21 00:23:35 2004
@@ -2,8 +2,8 @@
 # Automatically generated make config: don't edit
 #
 CONFIG_ALPHA=y
+CONFIG_64BIT=y
 CONFIG_MMU=y
-CONFIG_SWAP=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_GENERIC_ISA_DMA=y
 
@@ -11,14 +11,28 @@
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
 
 #
 # General setup
 #
-CONFIG_NET=y
+CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_HOTPLUG is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
 # Loadable module support
@@ -26,6 +40,8 @@
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
 CONFIG_KMOD=y
 
 #
@@ -45,6 +61,8 @@
 # CONFIG_ALPHA_EIGER is not set
 # CONFIG_ALPHA_JENSEN is not set
 # CONFIG_ALPHA_LX164 is not set
+# CONFIG_ALPHA_LYNX is not set
+# CONFIG_ALPHA_MARVEL is not set
 # CONFIG_ALPHA_MIATA is not set
 # CONFIG_ALPHA_MIKASA is not set
 # CONFIG_ALPHA_NAUTILUS is not set
@@ -62,26 +80,35 @@
 # CONFIG_ALPHA_TITAN is not set
 # CONFIG_ALPHA_WILDFIRE is not set
 CONFIG_ISA=y
-CONFIG_EISA=y
 CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_ALPHA_CORE_AGP=y
 CONFIG_ALPHA_BROKEN_IRQ_MASK=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_EISA=y
 # CONFIG_SMP is not set
 # CONFIG_DISCONTIGMEM is not set
 CONFIG_VERBOSE_MCHECK=y
+CONFIG_VERBOSE_MCHECK_ON=1
+CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
-# CONFIG_HOTPLUG is not set
-CONFIG_KCORE_ELF=y
-# CONFIG_KCORE_AOUT is not set
+CONFIG_EISA_PCI_EISA=y
+CONFIG_EISA_VIRTUAL_ROOT=y
+CONFIG_EISA_NAMES=y
 CONFIG_SRM_ENV=m
-# CONFIG_BINFMT_AOUT is not set
 CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
+# CONFIG_BINFMT_AOUT is not set
 # CONFIG_BINFMT_EM86 is not set
+# CONFIG_BINFMT_MISC is not set
 
 #
-# Parallel port support
+# Device Drivers
 #
-# CONFIG_PARPORT is not set
+
+#
+# Generic Driver Options
+#
+# CONFIG_DEBUG_DRIVER is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -89,10 +116,14 @@
 # CONFIG_MTD is not set
 
 #
-# Plug and Play configuration
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
 #
 CONFIG_PNP=y
-# CONFIG_PNP_NAMES is not set
 # CONFIG_PNP_DEBUG is not set
 
 #
@@ -111,63 +142,60 @@
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
 # CONFIG_BLK_DEV_RAM is not set
 
 #
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
 # ATA/ATAPI/MFM/RLL support
 #
 CONFIG_IDE=y
-
-#
-# IDE, ATA and ATAPI Block devices
-#
+CONFIG_IDE_MAX_HWIFS=4
 CONFIG_BLK_DEV_IDE=y
 
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
-# CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
 # CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
 # CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
 
 #
 # IDE chipset support/bugfixes
 #
-# CONFIG_BLK_DEV_ISAPNP is not set
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_IDEPNP is not set
 CONFIG_BLK_DEV_IDEPCI=y
-CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
-CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
 CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
-CONFIG_BLK_DEV_IDEDMA=y
 CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 CONFIG_BLK_DEV_ALI15X3=y
 # CONFIG_WDC_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD74XX is not set
 CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_TRIFLEX is not set
 CONFIG_BLK_DEV_CY82C693=y
+# CONFIG_BLK_DEV_CS5520 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
 # CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
 # CONFIG_BLK_DEV_PIIX is not set
 # CONFIG_BLK_DEV_NS87415 is not set
-# CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
 # CONFIG_BLK_DEV_PDC202XX_NEW is not set
 # CONFIG_BLK_DEV_SVWKS is not set
@@ -176,13 +204,17 @@
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
 # CONFIG_IDE_CHIPSETS is not set
-CONFIG_IDEDMA_AUTO=y
+CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_HD is not set
 
 #
-# SCSI support
+# SCSI device support
 #
 CONFIG_SCSI=y
+CONFIG_SCSI_PROC_FS=y
 
 #
 # SCSI support type (disk, tape, CD-ROM)
@@ -203,85 +235,104 @@
 # CONFIG_SCSI_LOGGING is not set
 
 #
+# SCSI Transport Attributes
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+
+#
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_7000FASST is not set
 # CONFIG_SCSI_ACARD is not set
-# CONFIG_SCSI_AHA152X is not set
 # CONFIG_SCSI_AHA1542 is not set
 # CONFIG_SCSI_AHA1740 is not set
 # CONFIG_SCSI_AACRAID is not set
 CONFIG_SCSI_AIC7XXX=m
 CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
 CONFIG_AIC7XXX_RESET_DELAY_MS=5000
+# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 # CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_IN2000 is not set
-# CONFIG_SCSI_AM53C974 is not set
 # CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_DTC3280 is not set
 # CONFIG_SCSI_EATA is not set
-# CONFIG_SCSI_EATA_DMA is not set
 # CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
 # CONFIG_SCSI_GDTH is not set
 # CONFIG_SCSI_GENERIC_NCR5380 is not set
 # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
-# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_NCR53C406A is not set
-# CONFIG_SCSI_NCR53C7xx is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
-CONFIG_SCSI_NCR53C8XX=y
-CONFIG_SCSI_SYM53C8XX=y
-CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
-CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
-CONFIG_SCSI_NCR53C8XX_SYNC=20
-# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
-# CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set
-# CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set
-# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set
 # CONFIG_SCSI_PAS16 is not set
-# CONFIG_SCSI_PCI2000 is not set
-# CONFIG_SCSI_PCI2220I is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
+CONFIG_SCSI_QLA2XXX=y
+# CONFIG_SCSI_QLA21XX is not set
+# CONFIG_SCSI_QLA22XX is not set
+# CONFIG_SCSI_QLA2300 is not set
+# CONFIG_SCSI_QLA2322 is not set
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_SIM710 is not set
 # CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_T128 is not set
 # CONFIG_SCSI_U14_34F is not set
-# CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 
 #
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
 # Fusion MPT device support
 #
 # CONFIG_FUSION is not set
 
 #
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+# IEEE 1394 (FireWire) support
 #
 # CONFIG_IEEE1394 is not set
 
 #
+# I2O device support
+#
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
 # Networking options
 #
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_NETLINK_DEV=y
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-# CONFIG_FILTER is not set
 CONFIG_UNIX=y
 CONFIG_NET_KEY=m
 CONFIG_INET=y
@@ -296,7 +347,17 @@
 # CONFIG_SYN_COOKIES is not set
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
-CONFIG_XFRM_USER=m
+# CONFIG_INET_IPCOMP is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+# CONFIG_IPV6 is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
 
 #
 # IP: Netfilter Configuration
@@ -304,14 +365,18 @@
 CONFIG_IP_NF_CONNTRACK=m
 CONFIG_IP_NF_FTP=m
 CONFIG_IP_NF_IRC=m
+# CONFIG_IP_NF_TFTP is not set
+# CONFIG_IP_NF_AMANDA is not set
 CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
 # CONFIG_IP_NF_MATCH_LIMIT is not set
+# CONFIG_IP_NF_MATCH_IPRANGE is not set
 # CONFIG_IP_NF_MATCH_MAC is not set
 # CONFIG_IP_NF_MATCH_PKTTYPE is not set
 # CONFIG_IP_NF_MATCH_MARK is not set
 # CONFIG_IP_NF_MATCH_MULTIPORT is not set
 # CONFIG_IP_NF_MATCH_TOS is not set
+# CONFIG_IP_NF_MATCH_RECENT is not set
 # CONFIG_IP_NF_MATCH_ECN is not set
 # CONFIG_IP_NF_MATCH_DSCP is not set
 # CONFIG_IP_NF_MATCH_AH_ESP is not set
@@ -321,15 +386,15 @@
 # CONFIG_IP_NF_MATCH_HELPER is not set
 # CONFIG_IP_NF_MATCH_STATE is not set
 # CONFIG_IP_NF_MATCH_CONNTRACK is not set
-# CONFIG_IP_NF_MATCH_UNCLEAN is not set
 # CONFIG_IP_NF_MATCH_OWNER is not set
 CONFIG_IP_NF_FILTER=m
 # CONFIG_IP_NF_TARGET_REJECT is not set
-# CONFIG_IP_NF_TARGET_MIRROR is not set
 CONFIG_IP_NF_NAT=m
 CONFIG_IP_NF_NAT_NEEDED=y
 CONFIG_IP_NF_TARGET_MASQUERADE=m
 # CONFIG_IP_NF_TARGET_REDIRECT is not set
+# CONFIG_IP_NF_TARGET_NETMAP is not set
+# CONFIG_IP_NF_TARGET_SAME is not set
 # CONFIG_IP_NF_NAT_LOCAL is not set
 # CONFIG_IP_NF_NAT_SNMP_BASIC is not set
 CONFIG_IP_NF_NAT_IRC=m
@@ -340,7 +405,8 @@
 # CONFIG_IP_NF_TARGET_TCPMSS is not set
 # CONFIG_IP_NF_ARPTABLES is not set
 CONFIG_IP_NF_COMPAT_IPCHAINS=y
-# CONFIG_IPV6 is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
 
 #
 # SCTP Configuration (EXPERIMENTAL)
@@ -349,9 +415,9 @@
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 CONFIG_VLAN_8021Q=m
-# CONFIG_LLC is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
@@ -369,10 +435,6 @@
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
 
 #
@@ -390,6 +452,7 @@
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 CONFIG_NET_VENDOR_3COM=y
@@ -400,6 +463,7 @@
 # CONFIG_EL3 is not set
 # CONFIG_3C515 is not set
 CONFIG_VORTEX=y
+# CONFIG_TYPHOON is not set
 # CONFIG_LANCE is not set
 # CONFIG_NET_VENDOR_SMC is not set
 # CONFIG_NET_VENDOR_RACAL is not set
@@ -412,6 +476,7 @@
 CONFIG_TULIP=y
 # CONFIG_TULIP_MWI is not set
 CONFIG_TULIP_MMIO=y
+# CONFIG_TULIP_NAPI is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_WINBOND_840 is not set
 # CONFIG_DM9102 is not set
@@ -421,10 +486,12 @@
 # CONFIG_NET_ISA is not set
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_AC3200 is not set
 # CONFIG_APRICOT is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_CS89x0 is not set
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
@@ -440,7 +507,6 @@
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
-# CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
 # CONFIG_NET_POCKET is not set
 
@@ -448,13 +514,20 @@
 # Ethernet (1000 Mbit)
 #
 # CONFIG_ACENIC is not set
-CONFIG_DL2K=m
+# CONFIG_DL2K is not set
 # CONFIG_E1000 is not set
-CONFIG_NS83820=m
+# CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 CONFIG_YELLOWFIN=y
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
@@ -470,8 +543,8 @@
 #
 # CONFIG_TR is not set
 # CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Wan interfaces
@@ -484,34 +557,74 @@
 # CONFIG_HAMRADIO is not set
 
 #
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BT is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
-# Old CD-ROM drivers (not SCSI, not IDE)
+# Telephony Support
 #
-# CONFIG_CD_NO_IDESCSI is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
 #
-# CONFIG_INPUT is not set
+CONFIG_INPUT=y
 
 #
 # Userland interfaces
 #
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
 
 #
 # Input I/O drivers
 #
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
-# CONFIG_SERIO is not set
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
 
 #
 # Input Device Drivers
 #
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
 
 #
 # Character devices
@@ -524,32 +637,30 @@
 #
 # Serial drivers
 #
-CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_CORE=m
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
 
 #
-# Mice
+# IPMI
 #
-# CONFIG_BUSMOUSE is not set
-# CONFIG_QIC02_TAPE is not set
+# CONFIG_IPMI_HANDLER is not set
 
 #
 # Watchdog Cards
 #
 # CONFIG_WATCHDOG is not set
-# CONFIG_NVRAM is not set
 CONFIG_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
@@ -564,72 +675,134 @@
 # CONFIG_RAW_DRIVER is not set
 
 #
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Misc devices
+#
+
+#
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
 
 #
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
 # File systems
 #
-# CONFIG_QUOTA is not set
-CONFIG_AUTOFS_FS=m
-# CONFIG_AUTOFS4_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=m
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
-CONFIG_TMPFS=y
-CONFIG_RAMFS=y
-CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
-# CONFIG_ZISOFS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_MINIX_FS is not set
 # CONFIG_VXFS_FS is not set
-# CONFIG_NTFS_FS is not set
 # CONFIG_HPFS_FS is not set
-CONFIG_PROC_FS=y
-# CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_SYSV_FS is not set
-# CONFIG_UDF_FS is not set
 # CONFIG_UFS_FS is not set
-# CONFIG_XFS_FS is not set
 
 #
 # Network File Systems
 #
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=m
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
 # CONFIG_NFSD_TCP is not set
-CONFIG_SUNRPC=m
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
-# CONFIG_CIFS is not set
+CONFIG_SUNRPC=m
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -638,11 +811,11 @@
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_OSF_PARTITION=y
 CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
 # CONFIG_NLS_CODEPAGE_737 is not set
@@ -683,29 +856,9 @@
 # CONFIG_NLS_UTF8 is not set
 
 #
-# Console drivers
-#
-CONFIG_VGA_CONSOLE=y
-
-#
-# Frame-buffer support
-#
-# CONFIG_FB is not set
-
+# Profiling support
 #
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# USB support
-#
-# CONFIG_USB is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
+# CONFIG_PROFILING is not set
 
 #
 # Kernel hacking
@@ -718,16 +871,34 @@
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_RWLOCK is not set
 # CONFIG_DEBUG_SEMAPHORE is not set
+CONFIG_DEBUG_INFO=y
 
 #
 # Security options
 #
-CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY is not set
 
 #
 # Cryptographic options
 #
-# CONFIG_CRYPTO is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_SHA1=m
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+CONFIG_CRYPTO_DES=m
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
diff -Nru a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
--- a/arch/alpha/kernel/alpha_ksyms.c	Sun Mar 21 00:23:35 2004
+++ b/arch/alpha/kernel/alpha_ksyms.c	Sun Mar 21 00:23:35 2004
@@ -35,6 +35,9 @@
 #include <asm/cacheflush.h>
 #include <asm/vga.h>
 
+#define __KERNEL_SYSCALLS__
+#include <asm/unistd.h>
+
 extern struct hwrpb_struct *hwrpb;
 extern void dump_thread(struct pt_regs *, struct user *);
 extern spinlock_t rtc_lock;
diff -Nru a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
--- a/arch/alpha/kernel/time.c	Sun Mar 21 00:23:35 2004
+++ b/arch/alpha/kernel/time.c	Sun Mar 21 00:23:35 2004
@@ -24,6 +24,8 @@
  * 2000-08-13	Jan-Benedict Glaw <jbglaw@lug-owl.de>
  * 	Fixed time_init to be aware of epoches != 1900. This prevents
  * 	booting up in 2048 for me;) Code is stolen from rtc.c.
+ * 2003-06-03	R. Scott Bailey <scott.bailey@eds.com>
+ *	Tighten sanity in time_init from 1% (10,000 PPM) to 250 PPM
  */
 #include <linux/config.h>
 #include <linux/errno.h>
@@ -306,7 +308,7 @@
 time_init(void)
 {
 	unsigned int year, mon, day, hour, min, sec, cc1, cc2, epoch;
-	unsigned long cycle_freq, one_percent;
+	unsigned long cycle_freq, tolerance;
 	long diff;
 
 	/* Calibrate CPU clock -- attempt #1.  */
@@ -324,13 +326,13 @@
 
 	cycle_freq = hwrpb->cycle_freq;
 	if (est_cycle_freq) {
-		/* If the given value is within 1% of what we calculated, 
+		/* If the given value is within 250 PPM of what we calculated,
 		   accept it.  Otherwise, use what we found.  */
-		one_percent = cycle_freq / 100;
+		tolerance = cycle_freq / 4000;
 		diff = cycle_freq - est_cycle_freq;
 		if (diff < 0)
 			diff = -diff;
-		if ((unsigned long)diff > one_percent) {
+		if ((unsigned long)diff > tolerance) {
 			cycle_freq = est_cycle_freq;
 			printk("HWRPB cycle frequency bogus.  "
 			       "Estimated %lu Hz\n", cycle_freq);
diff -Nru a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
--- a/arch/alpha/kernel/traps.c	Sun Mar 21 00:23:35 2004
+++ b/arch/alpha/kernel/traps.c	Sun Mar 21 00:23:35 2004
@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/smp_lock.h>
 #include <linux/module.h>
+#include <linux/init.h>
 
 #include <asm/gentrap.h>
 #include <asm/uaccess.h>
@@ -25,35 +26,37 @@
 
 #include "proto.h"
 
-/* data/code implementing a work-around for some SRMs which
-   mishandle opDEC faults
-*/
-static int opDEC_testing = 0;
-static int opDEC_fix = 0;
-static int opDEC_checked = 0;
-static unsigned long opDEC_test_pc = 0;
+/* Work-around for some SRMs which mishandle opDEC faults.  */
 
-static void
+static int opDEC_fix;
+
+static void __init
 opDEC_check(void)
 {
-	unsigned long test_pc;
-
-	if (opDEC_checked) return;
-
-	lock_kernel();
-	opDEC_testing = 1;
+	__asm__ __volatile__ (
+	/* Load the address of... */
+	"	br	$16, 1f\n"
+	/* A stub instruction fault handler.  Just add 4 to the
+	   pc and continue.  */
+	"	ldq	$16, 8($sp)\n"
+	"	addq	$16, 4, $16\n"
+	"	stq	$16, 8($sp)\n"
+	"	call_pal %[rti]\n"
+	/* Install the instruction fault handler.  */
+	"1:	lda	$17, 3\n"
+	"	call_pal %[wrent]\n"
+	/* With that in place, the fault from the round-to-minf fp
+	   insn will arrive either at the "lda 4" insn (bad) or one
+	   past that (good).  This places the correct fixup in %0.  */
+	"	lda %[fix], 0\n"
+	"	cvttq/svm $f31,$f31\n"
+	"	lda %[fix], 4"
+	: [fix] "=r" (opDEC_fix)
+	: [rti] "n" (PAL_rti), [wrent] "n" (PAL_wrent)
+	: "$0", "$1", "$16", "$17", "$22", "$23", "$24", "$25");
 
-	__asm__ __volatile__(
-		"       br      %0,1f\n"
-		"1:     addq    %0,8,%0\n"
-		"       stq     %0,%1\n"
-		"       cvttq/svm $f31,$f31\n"
-		: "=&r"(test_pc), "=m"(opDEC_test_pc)
-		: );
-
-	opDEC_testing = 0;
-	opDEC_checked = 1;
-	unlock_kernel();
+	if (opDEC_fix)
+		printk("opDEC fixup enabled.\n");
 }
 
 void
@@ -244,7 +247,7 @@
 	siginfo_t info;
 	int signo, code;
 
-	if (!opDEC_testing || type != 4) {
+	if (regs->ps == 0) {
 		if (type == 1) {
 			const unsigned int *data
 			  = (const unsigned int *) regs->pc;
@@ -359,14 +362,6 @@
 			   fault during the boot sequence and testing if
 			   we get the correct PC.  If not, we set a flag
 			   to correct it every time through.  */
-			if (opDEC_testing) {
-				if (regs->pc == opDEC_test_pc) {
-					opDEC_fix = 4;
-					regs->pc += 4;
-					printk("opDEC fixup enabled.\n");
-				}
-				return;
-			}
 			regs->pc += opDEC_fix; 
 			
 			/* EV4 does not implement anything except normal
@@ -1083,22 +1078,22 @@
 	return;
 }
 
-void
+void __init
 trap_init(void)
 {
 	/* Tell PAL-code what global pointer we want in the kernel.  */
 	register unsigned long gptr __asm__("$29");
 	wrkgp(gptr);
 
+	/* Hack for Multia (UDB) and JENSEN: some of their SRMs have
+	   a bug in the handling of the opDEC fault.  Fix it up if so.  */
+	if (implver() == IMPLVER_EV4)
+		opDEC_check();
+
 	wrent(entArith, 1);
 	wrent(entMM, 2);
 	wrent(entIF, 3);
 	wrent(entUna, 4);
 	wrent(entSys, 5);
 	wrent(entDbg, 6);
-
-	/* Hack for Multia (UDB) and JENSEN: some of their SRMs have
-	   a bug in the handling of the opDEC fault.  Fix it up if so.  */
-	if (implver() == IMPLVER_EV4)
-		opDEC_check();
 }
diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig
--- a/arch/x86_64/defconfig	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/defconfig	Sun Mar 21 00:23:35 2004
@@ -26,7 +26,7 @@
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
-CONFIG_LOG_BUF_SHIFT=17
+CONFIG_LOG_BUF_SHIFT=18
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
@@ -47,7 +47,7 @@
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
-CONFIG_KMOD=y
+# CONFIG_KMOD is not set
 CONFIG_STOP_MACHINE=y
 
 #
@@ -94,14 +94,14 @@
 CONFIG_ACPI_SLEEP=y
 CONFIG_ACPI_SLEEP_PROC_FS=y
 CONFIG_ACPI_AC=y
-# CONFIG_ACPI_BATTERY is not set
+CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
 CONFIG_ACPI_FAN=y
 CONFIG_ACPI_PROCESSOR=y
 CONFIG_ACPI_THERMAL=y
 # CONFIG_ACPI_ASUS is not set
-# CONFIG_ACPI_TOSHIBA is not set
-# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_TOSHIBA=y
+CONFIG_ACPI_DEBUG=y
 CONFIG_ACPI_BUS=y
 CONFIG_ACPI_EC=y
 CONFIG_ACPI_POWER=y
@@ -120,17 +120,18 @@
 CONFIG_PCI=y
 CONFIG_PCI_DIRECT=y
 CONFIG_PCI_MMCONFIG=y
-CONFIG_PCI_LEGACY_PROC=y
+# CONFIG_PCI_LEGACY_PROC is not set
 # CONFIG_PCI_NAMES is not set
 
 #
 # Executable file formats / Emulations
 #
 CONFIG_BINFMT_ELF=y
-CONFIG_BINFMT_MISC=y
+# CONFIG_BINFMT_MISC is not set
 CONFIG_IA32_EMULATION=y
 CONFIG_IA32_AOUT=y
 CONFIG_COMPAT=y
+CONFIG_SYSVIPC_COMPAT=y
 CONFIG_UID16=y
 
 #
@@ -150,14 +151,7 @@
 #
 # Parallel port support
 #
-CONFIG_PARPORT=y
-CONFIG_PARPORT_PC=y
-CONFIG_PARPORT_PC_CML1=y
-# CONFIG_PARPORT_SERIAL is not set
-# CONFIG_PARPORT_PC_FIFO is not set
-# CONFIG_PARPORT_PC_SUPERIO is not set
-# CONFIG_PARPORT_OTHER is not set
-CONFIG_PARPORT_1284=y
+# CONFIG_PARPORT is not set
 
 #
 # Plug and Play support
@@ -167,7 +161,6 @@
 # Block devices
 #
 CONFIG_BLK_DEV_FD=y
-# CONFIG_PARIDE is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
@@ -175,8 +168,11 @@
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_RAM is not set
-# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_CARMEL is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_LBD=y
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -194,7 +190,7 @@
 CONFIG_BLK_DEV_IDECD=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
-CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 # CONFIG_IDE_TASKFILE_IO is not set
 
@@ -202,12 +198,11 @@
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
-CONFIG_BLK_DEV_CMD640=y
-# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_CMD640 is not set
 CONFIG_BLK_DEV_IDEPCI=y
-CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
-CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_GENERIC is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
 # CONFIG_BLK_DEV_RZ1000 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
@@ -218,6 +213,7 @@
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 CONFIG_BLK_DEV_AMD74XX=y
+# CONFIG_BLK_DEV_ATIIXP is not set
 # CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_TRIFLEX is not set
 # CONFIG_BLK_DEV_CY82C693 is not set
@@ -226,16 +222,16 @@
 # CONFIG_BLK_DEV_HPT34X is not set
 # CONFIG_BLK_DEV_HPT366 is not set
 # CONFIG_BLK_DEV_SC1200 is not set
-# CONFIG_BLK_DEV_PIIX is not set
+CONFIG_BLK_DEV_PIIX=y
 # CONFIG_BLK_DEV_NS87415 is not set
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
 # CONFIG_BLK_DEV_PDC202XX_NEW is not set
 # CONFIG_BLK_DEV_SVWKS is not set
 # CONFIG_BLK_DEV_SIIMAGE is not set
-CONFIG_BLK_DEV_SIS5513=y
+# CONFIG_BLK_DEV_SIS5513 is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
-CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_BLK_DEV_VIA82CXXX is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 CONFIG_IDEDMA_AUTO=y
@@ -254,9 +250,8 @@
 CONFIG_BLK_DEV_SD=y
 # CONFIG_CHR_DEV_ST is not set
 # CONFIG_CHR_DEV_OSST is not set
-CONFIG_BLK_DEV_SR=m
-# CONFIG_BLK_DEV_SR_VENDOR is not set
-CONFIG_CHR_DEV_SG=m
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
 
 #
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -267,6 +262,12 @@
 # CONFIG_SCSI_LOGGING is not set
 
 #
+# SCSI Transport Attributes
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+
+#
 # SCSI low-level drivers
 #
 CONFIG_BLK_DEV_3W_XXXX_RAID=y
@@ -282,6 +283,7 @@
 CONFIG_SCSI_ATA_PIIX=y
 # CONFIG_SCSI_SATA_PROMISE is not set
 CONFIG_SCSI_SATA_VIA=y
+# CONFIG_SCSI_SATA_VITESSE is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -291,8 +293,6 @@
 # CONFIG_SCSI_GDTH is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
-# CONFIG_SCSI_PPA is not set
-# CONFIG_SCSI_IMM is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
@@ -317,7 +317,6 @@
 # Fusion MPT device support
 #
 CONFIG_FUSION=y
-CONFIG_FUSION_BOOT=y
 CONFIG_FUSION_MAX_SGE=40
 # CONFIG_FUSION_ISENSE is not set
 # CONFIG_FUSION_CTL is not set
@@ -332,10 +331,6 @@
 #
 
 #
-# Macintosh device drivers
-#
-
-#
 # Networking support
 #
 CONFIG_NET=y
@@ -345,111 +340,37 @@
 #
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
-CONFIG_NETLINK_DEV=y
+# CONFIG_NETLINK_DEV is not set
 CONFIG_UNIX=y
-CONFIG_NET_KEY=m
+# CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 # CONFIG_IP_PNP is not set
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
-CONFIG_IP_MROUTE=y
-# CONFIG_IP_PIMSM_V1 is not set
-# CONFIG_IP_PIMSM_V2 is not set
+# CONFIG_IP_MROUTE is not set
 # CONFIG_ARPD is not set
 # CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
-CONFIG_INET_AH=m
-CONFIG_INET_ESP=m
-CONFIG_INET_IPCOMP=m
-
-#
-# IP: Virtual Server Configuration
-#
-# CONFIG_IP_VS is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
 CONFIG_IPV6=y
-CONFIG_IPV6_PRIVACY=y
+# CONFIG_IPV6_PRIVACY is not set
 # CONFIG_INET6_AH is not set
-CONFIG_INET6_ESP=m
-CONFIG_INET6_IPCOMP=m
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
 # CONFIG_IPV6_TUNNEL is not set
 # CONFIG_DECNET is not set
 # CONFIG_BRIDGE is not set
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-
-#
-# IP: Netfilter Configuration
-#
-CONFIG_IP_NF_CONNTRACK=m
-CONFIG_IP_NF_FTP=m
-CONFIG_IP_NF_IRC=m
-# CONFIG_IP_NF_TFTP is not set
-# CONFIG_IP_NF_AMANDA is not set
-# CONFIG_IP_NF_QUEUE is not set
-CONFIG_IP_NF_IPTABLES=m
-# CONFIG_IP_NF_MATCH_LIMIT is not set
-# CONFIG_IP_NF_MATCH_IPRANGE is not set
-# CONFIG_IP_NF_MATCH_MAC is not set
-# CONFIG_IP_NF_MATCH_PKTTYPE is not set
-# CONFIG_IP_NF_MATCH_MARK is not set
-# CONFIG_IP_NF_MATCH_MULTIPORT is not set
-# CONFIG_IP_NF_MATCH_TOS is not set
-# CONFIG_IP_NF_MATCH_RECENT is not set
-# CONFIG_IP_NF_MATCH_ECN is not set
-# CONFIG_IP_NF_MATCH_DSCP is not set
-# CONFIG_IP_NF_MATCH_AH_ESP is not set
-# CONFIG_IP_NF_MATCH_LENGTH is not set
-# CONFIG_IP_NF_MATCH_TTL is not set
-# CONFIG_IP_NF_MATCH_TCPMSS is not set
-# CONFIG_IP_NF_MATCH_HELPER is not set
-CONFIG_IP_NF_MATCH_STATE=m
-CONFIG_IP_NF_MATCH_CONNTRACK=m
-# CONFIG_IP_NF_MATCH_OWNER is not set
-CONFIG_IP_NF_FILTER=m
-CONFIG_IP_NF_TARGET_REJECT=m
-CONFIG_IP_NF_NAT=m
-CONFIG_IP_NF_NAT_NEEDED=y
-CONFIG_IP_NF_TARGET_MASQUERADE=m
-# CONFIG_IP_NF_TARGET_REDIRECT is not set
-# CONFIG_IP_NF_TARGET_NETMAP is not set
-# CONFIG_IP_NF_TARGET_SAME is not set
-# CONFIG_IP_NF_NAT_LOCAL is not set
-# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
-CONFIG_IP_NF_NAT_IRC=m
-CONFIG_IP_NF_NAT_FTP=m
-CONFIG_IP_NF_MANGLE=m
-# CONFIG_IP_NF_TARGET_TOS is not set
-# CONFIG_IP_NF_TARGET_ECN is not set
-# CONFIG_IP_NF_TARGET_DSCP is not set
-CONFIG_IP_NF_TARGET_MARK=m
-# CONFIG_IP_NF_TARGET_CLASSIFY is not set
-CONFIG_IP_NF_TARGET_LOG=m
-# CONFIG_IP_NF_TARGET_ULOG is not set
-CONFIG_IP_NF_TARGET_TCPMSS=m
-# CONFIG_IP_NF_ARPTABLES is not set
-# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
-# CONFIG_IP_NF_COMPAT_IPFWADM is not set
-
-#
-# IPv6: Netfilter Configuration
-#
-# CONFIG_IP6_NF_QUEUE is not set
-# CONFIG_IP6_NF_IPTABLES is not set
-CONFIG_XFRM=y
-CONFIG_XFRM_USER=m
+# CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
 CONFIG_IPV6_SCTP__=y
-CONFIG_IP_SCTP=m
-# CONFIG_SCTP_DBG_MSG is not set
-# CONFIG_SCTP_DBG_OBJCNT is not set
-CONFIG_SCTP_HMAC_NONE=y
-# CONFIG_SCTP_HMAC_SHA1 is not set
-# CONFIG_SCTP_HMAC_MD5 is not set
+# CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_LLC2 is not set
@@ -478,11 +399,10 @@
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-CONFIG_DUMMY=m
+# CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
-CONFIG_TUN=m
-CONFIG_ETHERTAP=m
+# CONFIG_TUN is not set
 
 #
 # Ethernet (10 or 100Mbit)
@@ -491,9 +411,7 @@
 CONFIG_MII=y
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
-CONFIG_NET_VENDOR_3COM=y
-CONFIG_VORTEX=m
-# CONFIG_TYPHOON is not set
+# CONFIG_NET_VENDOR_3COM is not set
 
 #
 # Tulip family network device support
@@ -501,25 +419,25 @@
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 CONFIG_NET_PCI=y
-CONFIG_PCNET32=y
-CONFIG_AMD8111_ETH=m
+# CONFIG_PCNET32 is not set
+CONFIG_AMD8111_ETH=y
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
-# CONFIG_FORCEDETH is not set
+CONFIG_FORCEDETH=y
 # CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
-# CONFIG_8139CP is not set
-CONFIG_8139TOO=y
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
 # CONFIG_8139TOO_PIO is not set
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
 CONFIG_8139_RXBUF_IDX=2
-CONFIG_SIS900=m
+# CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_VIA_RHINE is not set
@@ -529,7 +447,7 @@
 #
 # CONFIG_ACENIC is not set
 # CONFIG_DL2K is not set
-CONFIG_E1000=m
+CONFIG_E1000=y
 # CONFIG_E1000_NAPI is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
@@ -545,15 +463,7 @@
 # CONFIG_IXGB is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
-# CONFIG_PLIP is not set
-CONFIG_PPP=m
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-# CONFIG_PPP_ASYNC is not set
-# CONFIG_PPP_SYNC_TTY is not set
-# CONFIG_PPP_DEFLATE is not set
-# CONFIG_PPP_BSDCOMP is not set
-CONFIG_PPPOE=m
+# CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 
 #
@@ -567,6 +477,7 @@
 # CONFIG_TR is not set
 # CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=y
 
 #
 # Wan interfaces
@@ -587,6 +498,10 @@
 # Bluetooth support
 #
 # CONFIG_BT is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
 
 #
 # ISDN subsystem
@@ -612,7 +527,7 @@
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
 # CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
+CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
 
 #
@@ -624,7 +539,6 @@
 CONFIG_SERIO_I8042=y
 # CONFIG_SERIO_SERPORT is not set
 # CONFIG_SERIO_CT82C710 is not set
-# CONFIG_SERIO_PARKBD is not set
 # CONFIG_SERIO_PCIPS2 is not set
 
 #
@@ -633,11 +547,13 @@
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
 # CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
@@ -648,12 +564,7 @@
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
-CONFIG_SERIAL_NONSTANDARD=y
-CONFIG_ROCKETPORT=m
-# CONFIG_SYNCLINK is not set
-# CONFIG_SYNCLINKMP is not set
-# CONFIG_N_HDLC is not set
-# CONFIG_STALDRV is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
 
 #
 # Serial drivers
@@ -670,16 +581,8 @@
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-# CONFIG_LEGACY_PTYS is not set
-CONFIG_PRINTER=y
-# CONFIG_LP_CONSOLE is not set
-# CONFIG_PPDEV is not set
-# CONFIG_TIPAR is not set
-
-#
-# Mice
-#
-CONFIG_BUSMOUSE=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -703,17 +606,12 @@
 #
 CONFIG_AGP=y
 CONFIG_AGP_AMD64=y
-# CONFIG_AGP_INTEL is not set
-CONFIG_DRM=y
-# CONFIG_DRM_TDFX is not set
-# CONFIG_DRM_GAMMA is not set
-# CONFIG_DRM_R128 is not set
-CONFIG_DRM_RADEON=m
-# CONFIG_DRM_SIS is not set
+CONFIG_AGP_INTEL=y
+# CONFIG_DRM is not set
 # CONFIG_MWAVE is not set
-CONFIG_RAW_DRIVER=m
+CONFIG_RAW_DRIVER=y
 CONFIG_MAX_RAW_DEVS=256
-# CONFIG_HANGCHECK_TIMER is not set
+CONFIG_HANGCHECK_TIMER=y
 
 #
 # I2C support
@@ -761,11 +659,10 @@
 #
 # Open Sound System
 #
-CONFIG_SOUND_PRIME=m
+CONFIG_SOUND_PRIME=y
 # CONFIG_SOUND_BT878 is not set
 # CONFIG_SOUND_CMPCI is not set
-CONFIG_SOUND_EMU10K1=m
-# CONFIG_MIDI_EMU10K1 is not set
+# CONFIG_SOUND_EMU10K1 is not set
 # CONFIG_SOUND_FUSION is not set
 # CONFIG_SOUND_CS4281 is not set
 # CONFIG_SOUND_ES1370 is not set
@@ -773,13 +670,12 @@
 # CONFIG_SOUND_ESSSOLO1 is not set
 # CONFIG_SOUND_MAESTRO is not set
 # CONFIG_SOUND_MAESTRO3 is not set
-CONFIG_SOUND_ICH=m
+CONFIG_SOUND_ICH=y
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
 # CONFIG_SOUND_MSNDPIN is not set
-CONFIG_SOUND_VIA82CXXX=m
-# CONFIG_MIDI_VIA82CXXX is not set
+# CONFIG_SOUND_VIA82CXXX is not set
 # CONFIG_SOUND_OSS is not set
 # CONFIG_SOUND_ALI5455 is not set
 # CONFIG_SOUND_FORTE is not set
@@ -789,151 +685,7 @@
 #
 # USB support
 #
-CONFIG_USB=m
-# CONFIG_USB_DEBUG is not set
-
-#
-# Miscellaneous USB options
-#
-CONFIG_USB_DEVICEFS=y
-CONFIG_USB_BANDWIDTH=y
-# CONFIG_USB_DYNAMIC_MINORS is not set
-
-#
-# USB Host Controller Drivers
-#
-CONFIG_USB_EHCI_HCD=m
-CONFIG_USB_OHCI_HCD=m
-CONFIG_USB_UHCI_HCD=m
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_BLUETOOTH_TTY is not set
-# CONFIG_USB_MIDI is not set
-# CONFIG_USB_ACM is not set
-CONFIG_USB_PRINTER=m
-CONFIG_USB_STORAGE=m
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_HP8200e is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-
-#
-# USB Human Interface Devices (HID)
-#
-CONFIG_USB_HID=m
-CONFIG_USB_HIDINPUT=y
-# CONFIG_HID_FF is not set
-# CONFIG_USB_HIDDEV is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_XPAD is not set
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
-# CONFIG_USB_HPUSBSCSI is not set
-
-#
-# USB Multimedia devices
-#
-# CONFIG_USB_DABUSB is not set
-
-#
-# Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network adaptors
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-CONFIG_USB_USBNET=m
-
-#
-# USB Host-to-Host Cables
-#
-CONFIG_USB_AN2720=y
-CONFIG_USB_BELKIN=y
-CONFIG_USB_GENESYS=y
-CONFIG_USB_NET1080=y
-CONFIG_USB_PL2301=y
-
-#
-# Intelligent USB Devices/Gadgets
-#
-CONFIG_USB_ARMLINUX=y
-CONFIG_USB_EPSON2888=y
-# CONFIG_USB_ZAURUS is not set
-# CONFIG_USB_CDCETHER is not set
-
-#
-# USB Network Adapters
-#
-CONFIG_USB_AX8817X=y
-
-#
-# USB port drivers
-#
-# CONFIG_USB_USS720 is not set
-
-#
-# USB Serial Converter support
-#
-CONFIG_USB_SERIAL=m
-CONFIG_USB_SERIAL_GENERIC=y
-CONFIG_USB_SERIAL_BELKIN=m
-# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
-# CONFIG_USB_SERIAL_EMPEG is not set
-# CONFIG_USB_SERIAL_FTDI_SIO is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_KOBIL_SCT is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_PL2303 is not set
-# CONFIG_USB_SERIAL_SAFE is not set
-# CONFIG_USB_SERIAL_CYBERJACK is not set
-# CONFIG_USB_SERIAL_XIRCOM is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-
-#
-# USB Miscellaneous drivers
-#
-# CONFIG_USB_EMI62 is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_TIGL is not set
-# CONFIG_USB_AUERSWALD is not set
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_LEGOTOWER is not set
-# CONFIG_USB_BRLVGER is not set
-# CONFIG_USB_LCD is not set
-# CONFIG_USB_LED is not set
-# CONFIG_USB_TEST is not set
+# CONFIG_USB is not set
 
 #
 # USB Gadget Support
@@ -945,17 +697,20 @@
 #
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
-# CONFIG_EXT2_FS_POSIX_ACL is not set
+CONFIG_EXT2_FS_POSIX_ACL=y
 # CONFIG_EXT2_FS_SECURITY is not set
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+# CONFIG_EXT3_FS_SECURITY is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=y
 # CONFIG_REISERFS_CHECK is not set
-CONFIG_REISERFS_PROC_INFO=y
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -967,16 +722,14 @@
 # CD-ROM/DVD Filesystems
 #
 CONFIG_ISO9660_FS=y
-CONFIG_JOLIET=y
+# CONFIG_JOLIET is not set
 # CONFIG_ZISOFS is not set
-CONFIG_UDF_FS=m
+# CONFIG_UDF_FS is not set
 
 #
 # DOS/FAT/NT Filesystems
 #
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=m
+# CONFIG_FAT_FS is not set
 # CONFIG_NTFS_FS is not set
 
 #
@@ -987,8 +740,8 @@
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
-# CONFIG_HUGETLBFS is not set
-# CONFIG_HUGETLB_PAGE is not set
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
 CONFIG_RAMFS=y
 
 #
@@ -1014,7 +767,7 @@
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V4 is not set
-CONFIG_NFS_DIRECTIO=y
+# CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
@@ -1023,11 +776,12 @@
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -1039,45 +793,7 @@
 #
 # Native Language Support
 #
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
+# CONFIG_NLS is not set
 
 #
 # Profiling support
@@ -1105,28 +821,9 @@
 #
 # Cryptographic options
 #
-CONFIG_CRYPTO=y
-CONFIG_CRYPTO_HMAC=y
-# CONFIG_CRYPTO_NULL is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_SHA1=m
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-CONFIG_CRYPTO_DES=m
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-# CONFIG_CRYPTO_ARC4 is not set
-CONFIG_CRYPTO_DEFLATE=m
-# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO is not set
 
 #
 # Library routines
 #
 CONFIG_CRC32=y
-CONFIG_ZLIB_INFLATE=m
-CONFIG_ZLIB_DEFLATE=m
diff -Nru a/arch/x86_64/kernel/acpi/boot.c b/arch/x86_64/kernel/acpi/boot.c
--- a/arch/x86_64/kernel/acpi/boot.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/kernel/acpi/boot.c	Sun Mar 21 00:23:35 2004
@@ -366,6 +366,17 @@
 
 #endif /* CONFIG_ACPI_BUS */
 
+int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
+{
+#ifdef CONFIG_X86_IO_APIC
+	if (use_pci_vector() && !platform_legacy_irq(gsi))
+ 		*irq = IO_APIC_VECTOR(gsi);
+	else
+#endif
+		*irq = gsi;
+	return 0;
+}
+
 static unsigned long __init
 acpi_scan_rsdp (
 	unsigned long		start,
diff -Nru a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
--- a/arch/x86_64/kernel/entry.S	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/kernel/entry.S	Sun Mar 21 00:23:35 2004
@@ -402,9 +402,9 @@
 /* 0(%rsp): interrupt number */ 
 	.macro interrupt func
 	CFI_STARTPROC	simple
-	CFI_DEF_CFA	rsp,(SS-ORIG_RAX)
-	CFI_OFFSET	rsp,(RSP-SS)
-	CFI_OFFSET	rip,(RIP-SS)
+	CFI_DEF_CFA	rsp,(SS-RDI)
+	CFI_REL_OFFSET	rsp,(RSP-ORIG_RAX)
+	CFI_REL_OFFSET	rip,(RIP-ORIG_RAX)
 	cld
 #ifdef CONFIG_DEBUG_INFO
 	SAVE_ALL	
@@ -805,6 +805,8 @@
 	paranoidentry do_debug
 	/* switch back to process stack to restore the state ptrace touched */
 	movq %rax,%rsp	
+	testl $3,CS(%rsp)
+	jnz   paranoid_userspace	
 	jmp paranoid_exit
 	CFI_ENDPROC
 
@@ -816,8 +818,6 @@
 	paranoidentry do_nmi
 	/* ebx:	no swapgs flag */
 paranoid_exit:
-	testl $3,CS(%rsp)
-	jnz   paranoid_userspace	
 	testl %ebx,%ebx				/* swapgs needed? */
 	jnz paranoid_restore
 paranoid_swapgs:	
@@ -870,6 +870,8 @@
 	CFI_STARTPROC
 	paranoidentry do_double_fault
 	movq %rax,%rsp
+	testl $3,CS(%rsp)
+	jnz paranoid_userspace		
 	jmp paranoid_exit
 	CFI_ENDPROC
 
@@ -884,6 +886,8 @@
 	CFI_STARTPROC
 	paranoidentry do_stack_segment
 	movq %rax,%rsp
+	testl $3,CS(%rsp)
+	jnz paranoid_userspace
 	jmp paranoid_exit
 	CFI_ENDPROC
 
diff -Nru a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
--- a/arch/x86_64/kernel/mce.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/kernel/mce.c	Sun Mar 21 00:23:35 2004
@@ -22,12 +22,13 @@
 #include <asm/uaccess.h>
 
 #define MISC_MCELOG_MINOR 227
+#define NR_BANKS 5
 
 static int mce_disabled __initdata;
 /* 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic */ 
 static int tolerant = 2;
 static int banks;
-static unsigned long disabled_banks;
+static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL };
 
 /*
  * Lockless MCE logging infrastructure.
@@ -144,7 +145,7 @@
 	mb();
 
 	for (i = 0; i < banks; i++) {
-		if (test_bit(i, &disabled_banks))
+		if (!bank[i])
 			continue;
 
 		rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status);
@@ -179,7 +180,7 @@
 		   confused it's normally not necessary to panic, unless you are 
 		   paranoid (tolerant == 0) */ 
 		if (!user_space && (panic_on_oops || tolerant < 2))
-			mce_panic("Uncorrected machine check in kernel", &m, mcestart);
+			mce_panic("Uncorrected machine check", &m, mcestart);
 
 		/* do_exit takes an awful lot of locks and has as slight risk 
 		   of deadlocking. If you don't want that don't set tolerant >= 2 */
@@ -238,17 +239,31 @@
 		wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
 
 	banks = cap & 0xff;
+	if (banks > NR_BANKS) { 
+		printk(KERN_INFO "MCE: warning: using only %d banks\n", banks);
+		banks = NR_BANKS; 
+	}
 
 	mce_clear_all(); 
 	for (i = 0; i < banks; i++) {
-		u64 val = test_bit(i, &disabled_banks) ? 0 : ~0UL;
-		wrmsrl(MSR_IA32_MC0_CTL+4*i, val);
+		wrmsrl(MSR_IA32_MC0_CTL+4*i, bank[i]);
 		wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0);
 	}	
 
 	set_in_cr4(X86_CR4_MCE);
 }
 
+/* Add per CPU specific workarounds here */
+static void __init mce_cpu_quirks(struct cpuinfo_x86 *c) 
+{ 
+	/* This should be disabled by the BIOS, but isn't always */
+	if (c->x86_vendor == X86_VENDOR_AMD && c->x86 == 15) {
+		/* disable GART TBL walk error reporting, which trips off 
+		   incorrectly with the IOMMU & 3ware & Cerberus. */
+		clear_bit(10, &bank[4]);
+	}
+}			
+
 /* 
  * Called for each booted CPU to set up machine checks.
  * Must be called with preempt off. 
@@ -257,6 +272,8 @@
 {
 	static unsigned long mce_cpus __initdata = 0;
 
+	mce_cpu_quirks(c); 
+
 	if (test_and_set_bit(smp_processor_id(), &mce_cpus) || !mce_available(c))
 		return;
 
@@ -343,23 +360,9 @@
 	} 
 }
 
-#if 0 /* for testing */
-static ssize_t mce_write(struct file *f, const char __user *buf, size_t sz, loff_t *off)
-{
-	struct mce m;
-	if (sz != sizeof(struct mce))
-		return -EINVAL;
-	copy_from_user(&m, buf, sizeof(struct mce));
-	m.finished = 0;
-	mce_log(&m);
-	return sizeof(struct mce);
-}
-#endif
-
 static struct file_operations mce_chrdev_ops = {
 	.read = mce_read,
 	.ioctl = mce_ioctl,
-	//.write = mce_write
 };
 
 static struct miscdevice mce_log_device = {
@@ -425,23 +428,27 @@
 };
 
 /* Why are there no generic functions for this? */
-#define ACCESSOR(name, start) \
+#define ACCESSOR(name, var, start) \
 	static ssize_t show_ ## name(struct sys_device *s, char *buf) { 	   	   \
-		return sprintf(buf, "%lu\n", (unsigned long)name);		   \
+		return sprintf(buf, "%lu\n", (unsigned long)var);		   \
 	} 									   \
 	static ssize_t set_ ## name(struct sys_device *s,const char *buf,size_t siz) { \
 		char *end; 							   \
 		unsigned long new = simple_strtoul(buf, &end, 0); 		   \
 		if (end == buf) return -EINVAL;					   \
-		name = new;							   \
+		var = new;							   \
 		start; 								   \
 		return end-buf;		     					   \
 	}									   \
 	static SYSDEV_ATTR(name, 0644, show_ ## name, set_ ## name);
 
-ACCESSOR(disabled_banks,mce_restart())
-ACCESSOR(tolerant,)
-ACCESSOR(check_interval,mce_restart())
+ACCESSOR(bank0ctl,bank[0],mce_restart())
+ACCESSOR(bank1ctl,bank[1],mce_restart())
+ACCESSOR(bank2ctl,bank[2],mce_restart())
+ACCESSOR(bank3ctl,bank[3],mce_restart())
+ACCESSOR(bank4ctl,bank[4],mce_restart())
+ACCESSOR(tolerant,tolerant,)
+ACCESSOR(check_interval,check_interval,mce_restart())
 
 static __init int mce_init_device(void)
 {
@@ -453,7 +460,11 @@
 		err = sysdev_register(&device_mce);
 	if (!err) { 
 		/* could create per CPU objects, but is not worth it. */
-		sysdev_create_file(&device_mce, &attr_disabled_banks); 
+		sysdev_create_file(&device_mce, &attr_bank0ctl); 
+		sysdev_create_file(&device_mce, &attr_bank1ctl); 
+		sysdev_create_file(&device_mce, &attr_bank2ctl); 
+		sysdev_create_file(&device_mce, &attr_bank3ctl); 
+		sysdev_create_file(&device_mce, &attr_bank4ctl); 
 		sysdev_create_file(&device_mce, &attr_tolerant); 
 		sysdev_create_file(&device_mce, &attr_check_interval);
 	} 
diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
--- a/arch/x86_64/kernel/mpparse.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/kernel/mpparse.c	Sun Mar 21 00:23:35 2004
@@ -9,7 +9,7 @@
  *		Erich Boleyn	:	MP v1.4 and additional changes.
  *		Alan Cox	:	Added EBDA scanning
  *		Ingo Molnar	:	various cleanups and rewrites
- *	Maciej W. Rozycki	:	Bits for default MP configurations
+ *		Maciej W. Rozycki:	Bits for default MP configurations
  *		Paul Diefenbaugh:	Added full ACPI support
  */
 
@@ -690,25 +690,25 @@
 
 struct mp_ioapic_routing {
 	int			apic_id;
-	int			irq_start;
-	int			irq_end;
+	int			gsi_start;
+	int			gsi_end;
 	u32			pin_programmed[4];
 } mp_ioapic_routing[MAX_IO_APICS];
 
 
 static int __init mp_find_ioapic (
-	int			irq)
+	int			gsi)
 {
 	int			i = 0;
 
-	/* Find the IOAPIC that manages this IRQ. */
+	/* Find the IOAPIC that manages this GSI. */
 	for (i = 0; i < nr_ioapics; i++) {
-		if ((irq >= mp_ioapic_routing[i].irq_start)
-			&& (irq <= mp_ioapic_routing[i].irq_end))
+		if ((gsi >= mp_ioapic_routing[i].gsi_start)
+			&& (gsi <= mp_ioapic_routing[i].gsi_end))
 			return i;
 	}
 
-	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d\n", irq);
+	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for GSI %d\n", gsi);
 
 	return -1;
 }
@@ -717,7 +717,7 @@
 void __init mp_register_ioapic (
 	u8			id, 
 	u32			address,
-	u32			irq_base)
+	u32			gsi_base)
 {
 	int			idx = 0;
 
@@ -743,19 +743,19 @@
 	mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx);
 	
 	/* 
-	 * Build basic IRQ lookup table to facilitate irq->io_apic lookups
+	 * Build basic IRQ lookup table to facilitate gsi->io_apic lookups
 	 * and to prevent reprogramming of IOAPIC pins (PCI IRQs).
 	 */
 	mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].mpc_apicid;
-	mp_ioapic_routing[idx].irq_start = irq_base;
-	mp_ioapic_routing[idx].irq_end = irq_base + 
+	mp_ioapic_routing[idx].gsi_start = gsi_base;
+	mp_ioapic_routing[idx].gsi_end = gsi_base + 
 		io_apic_get_redir_entries(idx);
 
 	printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
-		"IRQ %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, 
+		"GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, 
 		mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr,
-		mp_ioapic_routing[idx].irq_start,
-		mp_ioapic_routing[idx].irq_end);
+		mp_ioapic_routing[idx].gsi_start,
+		mp_ioapic_routing[idx].gsi_end);
 
 	return;
 }
@@ -765,7 +765,7 @@
 	u8			bus_irq,
 	u8			polarity, 
 	u8			trigger, 
-	u32			global_irq)
+	u32			gsi)
 {
 	struct mpc_config_intsrc intsrc;
 	int			i = 0;
@@ -774,12 +774,12 @@
 	int			pin = -1;
 
 	/* 
-	 * Convert 'global_irq' to 'ioapic.pin'.
+	 * Convert 'gsi' to 'ioapic.pin'.
 	 */
-	ioapic = mp_find_ioapic(global_irq);
+	ioapic = mp_find_ioapic(gsi);
 	if (ioapic < 0)
 		return;
-	pin = global_irq - mp_ioapic_routing[ioapic].irq_start;
+	pin = gsi - mp_ioapic_routing[ioapic].gsi_start;
 
 	/*
 	 * TBD: This check is for faulty timer entries, where the override
@@ -804,7 +804,7 @@
 
 	/* 
 	 * If an existing [IOAPIC.PIN -> IRQ] routing entry exists we override it.
-	 * Otherwise create a new entry (e.g. global_irq == 2).
+	 * Otherwise create a new entry (e.g. gsi == 2).
 	 */
 	for (i = 0; i < mp_irq_entries; i++) {
 		if ((mp_irqs[i].mpc_srcbus == intsrc.mpc_srcbus) 
@@ -878,7 +878,7 @@
 
 extern FADT_DESCRIPTOR acpi_fadt;
 
-void __init mp_config_ioapic_for_sci(int irq)
+void __init mp_config_ioapic_for_sci(u32 gsi)
 {
 #ifdef CONFIG_ACPI_INTERPRETER
 	int ioapic;
@@ -926,11 +926,11 @@
 	 */
 	flags = entry->flags;
 	acpi_fadt.sci_int = entry->global_irq;
-	irq = entry->global_irq;
+	gsi = entry->global_irq;
 
-	ioapic = mp_find_ioapic(irq);
+	ioapic = mp_find_ioapic(gsi);
 
-	ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
+	ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start;
 
 	/*
 	 * MPS INTI flags:
@@ -938,7 +938,7 @@
 	 *  polarity: 0=default, 1=high, 3=low
 	 * Per ACPI spec, default for SCI means level/low.
 	 */
-	io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 
+	io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, 
 		(flags.trigger == 1 ? 0 : 1), (flags.polarity == 1 ? 0 : 1));
 #endif
 }
@@ -951,7 +951,7 @@
 	struct acpi_prt_entry	*entry = NULL;
 	int			ioapic = -1;
 	int			ioapic_pin = 0;
-	int			irq = 0;
+	int			gsi = 0;
 	int			idx, bit = 0;
 	int			edge_level = 0;
 	int			active_high_low = 0;
@@ -963,30 +963,30 @@
 	list_for_each(node, &acpi_prt.entries) {
 		entry = list_entry(node, struct acpi_prt_entry, node);
 
-		/* Need to get irq for dynamic entry */
+		/* Need to get gsi for dynamic entry */
 		if (entry->link.handle) {
-			irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low);
-			if (!irq)
+			gsi = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low);
+			if (!gsi)
 				continue;
 		} else {
-			/* Hardwired IRQ. Assume PCI standard settings */
-			irq = entry->link.index;
+			/* Hardwired GSI. Assume PCI standard settings */
+			gsi = entry->link.index;
 			edge_level = 1;
 			active_high_low = 1;
 		}
 
 		/* Don't set up the ACPI SCI because it's already set up */
-		if (acpi_fadt.sci_int == irq)
+		if (acpi_fadt.sci_int == gsi)
 			continue;
 
-		ioapic = mp_find_ioapic(irq);
+		ioapic = mp_find_ioapic(gsi);
 		if (ioapic < 0)
 			continue;
-		ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
+		ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start;
 
 		/* 
 		 * Avoid pin reprogramming.  PRTs typically include entries  
-		 * with redundant pin->irq mappings (but unique PCI devices);
+		 * with redundant pin->gsi mappings (but unique PCI devices);
 		 * we only only program the IOAPIC on the first.
 		 */
 		bit = ioapic_pin % 32;
@@ -1000,20 +1000,16 @@
 		if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
 			Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n",
 				mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
- 			if (use_pci_vector() && !platform_legacy_irq(irq))
- 				irq = IO_APIC_VECTOR(irq);
-			entry->irq = irq;
+			acpi_gsi_to_irq(gsi, &entry->irq);
 			continue;
 		}
 
 		mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
-		if (!io_apic_set_pci_routing(ioapic, ioapic_pin, irq, edge_level, active_high_low)) {
- 			if (use_pci_vector() && !platform_legacy_irq(irq))
- 				irq = IO_APIC_VECTOR(irq);
-			entry->irq = irq;
+		if (!io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, edge_level, active_high_low)) {
+			acpi_gsi_to_irq(gsi, &entry->irq);
  		}
-		printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d"
-			" -> IRQ %d\n", entry->id.segment, entry->id.bus, 
+		printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n",
+			entry->id.segment, entry->id.bus,
 			entry->id.device, ('A' + entry->pin), 
 			mp_ioapic_routing[ioapic].apic_id, ioapic_pin,
 			entry->irq);
diff -Nru a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
--- a/arch/x86_64/kernel/pci-gart.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/kernel/pci-gart.c	Sun Mar 21 00:23:35 2004
@@ -21,6 +21,7 @@
 #include <linux/pci.h>
 #include <linux/module.h>
 #include <linux/topology.h>
+#include <linux/interrupt.h>
 #include <asm/atomic.h>
 #include <asm/io.h>
 #include <asm/mtrr.h>
@@ -31,6 +32,12 @@
 #include <asm/kdebug.h>
 #include <asm/proto.h>
 
+#ifdef CONFIG_PREEMPT
+#define preempt_atomic() in_atomic()
+#else
+#define preempt_atomic() 1
+#endif
+
 dma_addr_t bad_dma_address;
 
 unsigned long iommu_bus_base;	/* GART remapping area (physical) */
@@ -96,6 +103,8 @@
 
 static unsigned long next_bit;  /* protected by iommu_bitmap_lock */
 static int need_flush; 		/* global flush state. set for each gart wrap */
+static dma_addr_t pci_map_area(struct pci_dev *dev, unsigned long phys_mem, 
+			       size_t size, int dir);
 
 static unsigned long alloc_iommu(int size) 
 { 	
@@ -169,43 +178,44 @@
 
 /* 
  * Allocate memory for a consistent mapping.
- * All mappings are consistent here, so this is just a wrapper around
- * pci_map_single.
  */
 void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
 			   dma_addr_t *dma_handle)
 {
 	void *memory;
-	int gfp = GFP_ATOMIC;
-	unsigned long dma_mask;
+	int gfp = preempt_atomic() ? GFP_ATOMIC : GFP_KERNEL; 
+	unsigned long dma_mask = 0;
+	u64 bus;
 
-	if (hwdev == NULL) {
-		gfp |= GFP_DMA; 
-		dma_mask = 0xffffffff; 
-	} else {
+	if (hwdev) 
 		dma_mask = hwdev->dev.coherent_dma_mask;
-	}
-
 	if (dma_mask == 0) 
 		dma_mask = 0xffffffff; 
-	if (dma_mask < 0xffffffff || no_iommu)
-		gfp |= GFP_DMA;
 
 	/* Kludge to make it bug-to-bug compatible with i386. i386
 	   uses the normal dma_mask for alloc_consistent. */
 	dma_mask &= hwdev->dma_mask;
 
+ again:
 	memory = (void *)__get_free_pages(gfp, get_order(size));
-	if (memory == NULL) {
+	if (memory == NULL)
 		return NULL; 
-	} else {
+
+	{
 		int high, mmu;
-	        high = ((unsigned long)virt_to_bus(memory) + size) >= dma_mask;
+		bus = virt_to_bus(memory);
+	        high = (bus + size) >= dma_mask;
 		mmu = high;
 		if (force_iommu && !(gfp & GFP_DMA)) 
 			mmu = 1;
-		if (no_iommu) { 
-			if (high) goto error;
+		if (no_iommu || dma_mask < 0xffffffffUL) { 
+			if (high) {
+				if (!(gfp & GFP_DMA)) { 
+					gfp |= GFP_DMA; 
+					goto again;
+				}
+				goto free;
+			}
 			mmu = 0; 
 		} 	
 		memset(memory, 0, size); 
@@ -215,15 +225,16 @@
 		}
 	} 
 
-	*dma_handle = pci_map_single(hwdev, memory, size, 0);
+	*dma_handle = pci_map_area(hwdev, bus, size, PCI_DMA_BIDIRECTIONAL);
 	if (*dma_handle == bad_dma_address)
 		goto error; 
-
+	flush_gart(hwdev);	
 	return memory; 
 	
 error:
 	if (panic_on_overflow)
-		panic("pci_map_single: overflow %lu bytes\n", size); 
+		panic("pci_alloc_consistent: overflow %lu bytes\n", size); 
+free:
 	free_pages((unsigned long)memory, get_order(size)); 
 	return NULL; 
 }
@@ -608,6 +619,7 @@
 EXPORT_SYMBOL(pci_dma_supported);
 EXPORT_SYMBOL(no_iommu);
 EXPORT_SYMBOL(force_iommu); 
+EXPORT_SYMBOL(bad_dma_address);
 
 static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size)
 { 
@@ -733,7 +745,7 @@
 
 	if (swiotlb) { 
 		no_iommu = 1;
-		printk(KERN_INFO "PCI-DMA: Using SWIOTLB :-(\n"); 
+		printk(KERN_INFO "PCI-DMA: Using software bounce buffering for  IO (SWIOTLB)\n"); 
 		return -1; 
 	} 
 	
@@ -837,6 +849,7 @@
    forcesac For SAC mode for masks <40bits  (experimental)
    fullflush Flush IOMMU on each allocation (default) 
    nofullflush Don't use IOMMU fullflush
+   soft	 Use software bounce buffering (default for Intel machines)
 */
 __init int iommu_setup(char *opt) 
 { 
@@ -876,6 +889,8 @@
 		    iommu_fullflush = 1;
 	    if (!memcmp(p, "nofullflush", 11))
 		    iommu_fullflush = 0;
+	    if (!memcmp(p, "soft", 4))
+		    swiotlb = 1;
 #ifdef CONFIG_IOMMU_LEAK
 	    if (!memcmp(p,"leak", 4)) { 
 		    leak_trace = 1;
diff -Nru a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
--- a/arch/x86_64/kernel/process.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/kernel/process.c	Sun Mar 21 00:23:35 2004
@@ -32,6 +32,7 @@
 #include <linux/delay.h>
 #include <linux/irq.h>
 #include <linux/ptrace.h>
+#include <linux/version.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -205,7 +206,8 @@
 
 	printk("\n");
 	print_modules();
-	printk("Pid: %d, comm: %.20s %s\n", current->pid, current->comm, print_tainted());
+	printk("Pid: %d, comm: %.20s %s %s\n", 
+	       current->pid, current->comm, print_tainted(), UTS_RELEASE);
 	printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip);
 	printk_address(regs->rip); 
 	printk("\nRSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss, regs->rsp, regs->eflags);
diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/kernel/setup.c	Sun Mar 21 00:23:35 2004
@@ -232,7 +232,7 @@
 		if (!memcmp(from, "noapic", 6)) 
 			skip_ioapic_setup = 1;
 
-		if (!memcmp(from, "apic", 6)) { 
+		if (!memcmp(from, "apic", 4)) { 
 			skip_ioapic_setup = 0;
 			ioapic_force = 1;
 		}
@@ -453,9 +453,7 @@
 	paging_init();
 
 #ifndef CONFIG_SMP
-	/* Temporary hack: disable the IO-APIC for UP Nvidia and 
-	   This is until we sort out the ACPI problems. */
-	if (!acpi_disabled) 
+	/* Temporary hack: disable the IO-APIC for UP Nvidia and VIA. */
 		check_ioapic();
 #endif
 #ifdef CONFIG_ACPI_BOOT
diff -Nru a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
--- a/arch/x86_64/mm/init.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/mm/init.c	Sun Mar 21 00:23:35 2004
@@ -405,10 +405,10 @@
 	int tmp;
 
 #ifdef CONFIG_SWIOTLB
-       if (!iommu_aperture && end_pfn >= 0xffffffff>>PAGE_SHIFT) { 
-	       swiotlb_init();
+	if (!iommu_aperture && end_pfn >= 0xffffffff>>PAGE_SHIFT)
 	       swiotlb = 1;
-       }
+	if (swiotlb)
+		swiotlb_init();	
 #endif
 
 	/* How many end-of-memory variables you have, grandma! */
diff -Nru a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
--- a/arch/x86_64/pci/mmconfig.c	Sun Mar 21 00:23:35 2004
+++ b/arch/x86_64/pci/mmconfig.c	Sun Mar 21 00:23:35 2004
@@ -88,7 +88,7 @@
 		return 0;
 	}	
 
-	printk(KERN_INFO "PCI: Using MMCONFIG at %lx\n", pci_mmcfg_base_addr);
+	printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_base_addr);
 	raw_pci_ops = &pci_mmcfg;
 	pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
 
diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c
--- a/drivers/char/rtc.c	Sun Mar 21 00:23:35 2004
+++ b/drivers/char/rtc.c	Sun Mar 21 00:23:35 2004
@@ -110,6 +110,8 @@
 #define hpet_rtc_timer_init() 			do { } while (0)
 #define hpet_rtc_dropped_irq() 			0
 static inline irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) {return 0;}
+#else
+extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 #endif
 
 /*
diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c
--- a/drivers/char/vt.c	Sun Mar 21 00:23:35 2004
+++ b/drivers/char/vt.c	Sun Mar 21 00:23:35 2004
@@ -2481,19 +2481,18 @@
 	return 0;
 }
 
-static void con_close(struct tty_struct *tty, struct file * filp)
+static void con_close(struct tty_struct *tty, struct file *filp)
 {
-	struct vt_struct *vt;
-	
-	if (!tty || tty->count != 1)
-		return;
-
-	vcs_remove_devfs(tty);
 	acquire_console_sem();
-	vt = (struct vt_struct*)tty->driver_data;
-	if (vt)
-		vc_cons[vt->vc_num].d->vc_tty = NULL;
-	tty->driver_data = 0;
+	if (tty && tty->count == 1) {
+		struct vt_struct *vt;
+
+		vcs_remove_devfs(tty);
+		vt = tty->driver_data;
+		if (vt)
+			vc_cons[vt->vc_num].d->vc_tty = NULL;
+		tty->driver_data = 0;
+	}
 	release_console_sem();
 }
 
diff -Nru a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c
--- a/drivers/i2c/busses/i2c-keywest.c	Sun Mar 21 00:23:35 2004
+++ b/drivers/i2c/busses/i2c-keywest.c	Sun Mar 21 00:23:35 2004
@@ -608,6 +608,7 @@
 	}
 #endif /* POLLED_MODE */
 
+	pmac_low_i2c_unlock(np);
 	dev_set_drvdata(dev, iface);
 	
 	for (i=0; i<nchan; i++) {
@@ -645,7 +646,6 @@
 	printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n",
 		np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps);
 		
-	pmac_low_i2c_unlock(np);
 	return 0;
 }
 
diff -Nru a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
--- a/drivers/macintosh/Kconfig	Sun Mar 21 00:23:35 2004
+++ b/drivers/macintosh/Kconfig	Sun Mar 21 00:23:35 2004
@@ -175,8 +175,8 @@
 	  This driver provides some thermostat and fan control for the desktop
 	  G4 "Windtunnel"
 
-config THERM_ADT7467
-	tristate "Support for thermal mgmnt on laptops with ADT 7467 chipset"
+config THERM_ADT746X
+	tristate "Support for thermal mgmnt on laptops with ADT 746x chipset"
 	depends on I2C && I2C_KEYWEST && PPC_PMAC && !PPC_PMAC64
 	help
 	  This driver provides some thermostat and fan control for the
diff -Nru a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile
--- a/drivers/macintosh/Makefile	Sun Mar 21 00:23:35 2004
+++ b/drivers/macintosh/Makefile	Sun Mar 21 00:23:35 2004
@@ -25,4 +25,4 @@
 
 obj-$(CONFIG_THERM_PM72)	+= therm_pm72.o
 obj-$(CONFIG_THERM_WINDTUNNEL)	+= therm_windtunnel.o
-obj-$(CONFIG_THERM_ADT7467)	+= therm_adt7467.o
+obj-$(CONFIG_THERM_ADT746X)	+= therm_adt746x.o
diff -Nru a/drivers/macintosh/therm_adt7467.c b/drivers/macintosh/therm_adt7467.c
--- a/drivers/macintosh/therm_adt7467.c	Sun Mar 21 00:23:35 2004
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,562 +0,0 @@
-/*
- * Device driver for the i2c thermostat found on the iBook G4, Albook G4
- *
- * Copyright (C) 2003, 2004 Colin Leroy, Rasmus Rohde, Benjamin Herrenschmidt
- *
- * Documentation from
- * http://www.analog.com/UploadedFiles/Data_Sheets/115254175ADT7467_pra.pdf
- * http://www.analog.com/UploadedFiles/Data_Sheets/3686221171167ADT7460_b.pdf
- *
- */
-
-#include <linux/config.h>
-#include <linux/types.h>
-#include <linux/module.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/i2c.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <linux/smp_lock.h>
-#include <linux/wait.h>
-#include <asm/prom.h>
-#include <asm/machdep.h>
-#include <asm/io.h>
-#include <asm/system.h>
-#include <asm/sections.h>
-#include <asm/of_device.h>
-
-#undef DEBUG
-
-#define CONFIG_REG   0x40
-#define MANUAL_MASK  0xe0
-#define AUTO_MASK    0x20
-
-static u8 TEMP_REG[3]    = {0x26, 0x25, 0x27}; /* local, cpu, gpu */
-static u8 LIMIT_REG[3]   = {0x6b, 0x6a, 0x6c}; /* local, cpu, gpu */
-static u8 MANUAL_MODE[2] = {0x5c, 0x5d};       
-static u8 REM_CONTROL[2] = {0x00, 0x40};
-static u8 FAN_SPEED[2]   = {0x28, 0x2a};
-static u8 FAN_SPD_SET[2] = {0x30, 0x31};
-
-static u8 default_limits_local[3] = {70, 50, 70};    /* local, cpu, gpu */
-static u8 default_limits_chip[3] = {80, 65, 80};    /* local, cpu, gpu */
-
-static int limit_adjust = 0;
-static int fan_speed = -1;
-
-MODULE_AUTHOR("Colin Leroy <colin@colino.net>");
-MODULE_DESCRIPTION("Driver for ADT7467 thermostat in iBook G4");
-MODULE_LICENSE("GPL");
-
-MODULE_PARM(limit_adjust,"i");
-MODULE_PARM_DESC(limit_adjust,"Adjust maximum temperatures (50°C cpu, 70°C gpu) by N °C.");
-MODULE_PARM(fan_speed,"i");
-MODULE_PARM_DESC(fan_speed,"Specify fan speed (0-255) when lim < temp < lim+8 (default 128)");
-
-struct thermostat {
-	struct i2c_client	clt;
-	u8			cached_temp[3];
-	u8			initial_limits[3];
-	u8			limits[3];
-	int			last_speed[2];
-	int			overriding[2];
-};
-
-static enum {ADT7460, ADT7467} therm_type;
-static int therm_bus, therm_address;
-static struct of_device * of_dev;
-static struct thermostat* thermostat;
-static pid_t monitor_thread_id;
-static int monitor_running;
-static struct completion monitor_task_compl;
-
-static int attach_one_thermostat(struct i2c_adapter *adapter, int addr, int busno);
-static void write_both_fan_speed(struct thermostat *th, int speed);
-static void write_fan_speed(struct thermostat *th, int speed, int fan);
-
-static int
-write_reg(struct thermostat* th, int reg, u8 data)
-{
-	u8 tmp[2];
-	int rc;
-	
-	tmp[0] = reg;
-	tmp[1] = data;
-	rc = i2c_master_send(&th->clt, (const char *)tmp, 2);
-	if (rc < 0)
-		return rc;
-	if (rc != 2)
-		return -ENODEV;
-	return 0;
-}
-
-static int
-read_reg(struct thermostat* th, int reg)
-{
-	u8 reg_addr, data;
-	int rc;
-
-	reg_addr = (u8)reg;
-	rc = i2c_master_send(&th->clt, &reg_addr, 1);
-	if (rc < 0)
-		return rc;
-	if (rc != 1)
-		return -ENODEV;
-	rc = i2c_master_recv(&th->clt, (char *)&data, 1);
-	if (rc < 0)
-		return rc;
-	return data;
-}
-
-static int
-attach_thermostat(struct i2c_adapter *adapter)
-{
-	unsigned long bus_no;
-
-	if (strncmp(adapter->name, "uni-n", 5))
-		return -ENODEV;
-	bus_no = simple_strtoul(adapter->name + 6, NULL, 10);
-	if (bus_no != therm_bus)
-		return -ENODEV;
-	return attach_one_thermostat(adapter, therm_address, bus_no);
-}
-
-static int
-detach_thermostat(struct i2c_adapter *adapter)
-{
-	struct thermostat* th;
-	int i;
-	
-	if (thermostat == NULL)
-		return 0;
-
-	th = thermostat;
-
-	if (monitor_running) {
-		monitor_running = 0;
-		wait_for_completion(&monitor_task_compl);
-	}
-		
-	printk(KERN_INFO "adt746x: Putting max temperatures back from %d, %d, %d,"
-		" to %d, %d, %d, (°C)\n", 
-		th->limits[0], th->limits[1], th->limits[2],
-		th->initial_limits[0], th->initial_limits[1], th->initial_limits[2]);
-	
-	for (i = 0; i < 3; i++)
-		write_reg(th, LIMIT_REG[i], th->initial_limits[i]);
-
-	write_both_fan_speed(th, -1);
-
-	i2c_detach_client(&th->clt);
-
-	thermostat = NULL;
-
-	kfree(th);
-
-	return 0;
-}
-
-static struct i2c_driver thermostat_driver = {  
-	.name		="Apple Thermostat ADT7467",
-	.id		=0xDEAD7467,
-	.flags		=I2C_DF_NOTIFY,
-	.attach_adapter	=&attach_thermostat,
-	.detach_adapter	=&detach_thermostat,
-};
-
-static int read_fan_speed(struct thermostat *th, u8 addr)
-{
-	u8 tmp[2];
-	u16 res;
-	
-	/* should start with low byte */
-	tmp[1] = read_reg(th, addr);
-	tmp[0] = read_reg(th, addr + 1);
-	
-	res = tmp[1] + (tmp[0] << 8);
-	return (90000*60)/res;
-}
-
-static void write_both_fan_speed(struct thermostat *th, int speed)
-{
-	write_fan_speed(th, speed, 0);
-	if (therm_type == ADT7460)
-		write_fan_speed(th, speed, 1);
-}
-
-static void write_fan_speed(struct thermostat *th, int speed, int fan)
-{
-	u8 manual;
-	
-	if (speed > 0xff) 
-		speed = 0xff;
-	else if (speed < -1) 
-		speed = 0;
-	
-	if (therm_type == ADT7467 && fan == 1)
-		return;
-	
-	if (th->last_speed[fan] != speed) {
-		if (speed == -1)
-			printk(KERN_INFO "adt746x: Setting speed to: automatic for %s fan.\n",
-				fan?"GPU":"CPU");
-		else
-			printk(KERN_INFO "adt746x: Setting speed to: %d for %s fan.\n",
-				speed, fan?"GPU":"CPU");
-	} else
-		return;
-	
-	if (speed >= 0) {
-		manual = read_reg(th, MANUAL_MODE[fan]);
-		write_reg(th, MANUAL_MODE[fan], manual|MANUAL_MASK);
-		write_reg(th, FAN_SPD_SET[fan], speed);
-	} else {
-		/* back to automatic */
-		if(therm_type == ADT7460) {
-			manual = read_reg(th, MANUAL_MODE[fan]) & (~MANUAL_MASK);
-			write_reg(th, MANUAL_MODE[fan], manual|REM_CONTROL[fan]);
-		} else {
-			manual = read_reg(th, MANUAL_MODE[fan]);
-			write_reg(th, MANUAL_MODE[fan], manual&(~AUTO_MASK));
-		}
-	}
-	
-	th->last_speed[fan] = speed;			
-}
-
-static int monitor_task(void *arg)
-{
-	struct thermostat* th = arg;
-	u8 temps[3];
-	u8 lims[3];
-	int i;
-#ifdef DEBUG
-	int mfan_speed;
-#endif
-	
-	lock_kernel();
-	daemonize("kfand");
-	unlock_kernel();
-	strcpy(current->comm, "thermostat");
-	monitor_running = 1;
-
-	while(monitor_running)
-	{
-		set_task_state(current, TASK_UNINTERRUPTIBLE);
-		schedule_timeout(2*HZ);
-
-		/* Check status */
-		/* local   : chip */
-		/* remote 1: CPU ?*/
-		/* remote 2: GPU ?*/
-#ifndef DEBUG
-		if (fan_speed != -1) {
-#endif
-			for (i = 0; i < 3; i++) {
-				temps[i]  = read_reg(th, TEMP_REG[i]);
-				lims[i]   = th->limits[i];
-			}
-#ifndef DEBUG
-		}
-#endif		
-		if (fan_speed != -1) {
-			int lastvar = 0;		/* for iBook */
-			for (i = 1; i < 3; i++) {	/* we don't care about local sensor */
-				int started = 0;
-				int fan_number = (therm_type == ADT7460 && i == 2);
-				int var = temps[i] - lims[i];
-				if (var > 8) {
-					if (th->overriding[fan_number] == 0)
-						printk(KERN_INFO "adt746x: Limit exceeded by %d°C, overriding specified fan speed for %s.\n",
-							var, fan_number?"GPU":"CPU");
-					th->overriding[fan_number] = 1;
-					write_fan_speed(th, 255, fan_number);
-					started = 1;
-				} else if ((!th->overriding[fan_number] || var < 6) && var > 0) {
-					if (th->overriding[fan_number] == 1)
-						printk(KERN_INFO "adt746x: Limit exceeded by %d°C, setting speed to specified for %s.\n",
-							var, fan_number?"GPU":"CPU");					
-					th->overriding[fan_number] = 0;
-					write_fan_speed(th, fan_speed, fan_number);
-					started = 1;
-				} else if (var < -1) {
-					/* don't stop iBook fan if GPU is cold and CPU is not
-					 * so cold (lastvar >= -1) */
-					if (therm_type == ADT7460 || lastvar < -1 || i == 1) {
-						if (th->last_speed[fan_number] != 0)
-							printk(KERN_INFO "adt746x: Stopping %s fan.\n",
-								fan_number?"GPU":"CPU");
-						write_fan_speed(th, 0, fan_number);
-					}
-				}
-				
-				lastvar = var;
-				
-				if (started && therm_type == ADT7467)
-					break; /* we don't want to re-stop the fan
-						* if CPU is heating and GPU is not */
-			}
-		}
-#ifdef DEBUG
-		mfan_speed = read_fan_speed(th, FAN_SPEED[0]);
-		/* only one fan in the iBook G4 */
-				
-		if (temps[0] != th->cached_temp[0]
-		||  temps[1] != th->cached_temp[1]
-		||  temps[2] != th->cached_temp[2]) {
-			printk(KERN_INFO "adt746x: Temperature infos:"
-					 " thermostats: %d,%d,%d °C;"
-					 " limits: %d,%d,%d °C;"
-					 " fan speed: %d RPM\n",
-				temps[0], temps[1], temps[2],
-				lims[0],  lims[1],  lims[2],
-				mfan_speed);
-		}
-		th->cached_temp[0] = temps[0];
-		th->cached_temp[1] = temps[1];
-		th->cached_temp[2] = temps[2];
-#endif		
-	}
-
-	complete_and_exit(&monitor_task_compl, 0);
-	return 0;
-}
-
-static void
-set_limit(struct thermostat *th, int i)
-{
-		/* Set CPU limit higher to avoid powerdowns */ 
-		th->limits[i] = default_limits_chip[i] + limit_adjust;
-		write_reg(th, LIMIT_REG[i], th->limits[i]);
-		
-		/* set our limits to normal */
-		th->limits[i] = default_limits_local[i] + limit_adjust;
-}
-	
-static int
-attach_one_thermostat(struct i2c_adapter *adapter, int addr, int busno)
-{
-	struct thermostat* th;
-	int rc;
-	int i;
-
-	if (thermostat)
-		return 0;
-	th = (struct thermostat *)kmalloc(sizeof(struct thermostat), GFP_KERNEL);
-	if (!th)
-		return -ENOMEM;
-	memset(th, 0, sizeof(*th));
-	th->clt.addr = addr;
-	th->clt.adapter = adapter;
-	th->clt.driver = &thermostat_driver;
-	th->clt.id = 0xDEAD7467;
-	strcpy(th->clt.name, "thermostat");
-
-	rc = read_reg(th, 0);
-	if (rc < 0) {
-		printk(KERN_ERR "adt746x: Thermostat failed to read config from bus %d !\n",
-			busno);
-		kfree(th);
-		return -ENODEV;
-	}
-	/* force manual control to start the fan quieter */
-	
-	if (fan_speed == -1)
-		fan_speed=128;
-	
-	if(therm_type == ADT7460) {
-		printk(KERN_INFO "adt746x: ADT7460 initializing\n");
-		/* The 7460 needs to be started explicitly */
-		write_reg(th, CONFIG_REG, 1);
-	} else
-		printk(KERN_INFO "adt746x: ADT7467 initializing\n");
-
-	for (i = 0; i < 3; i++) {
-		th->initial_limits[i] = read_reg(th, LIMIT_REG[i]);
-		set_limit(th, i);
-	}
-	
-	printk(KERN_INFO "adt746x: Lowering max temperatures from %d, %d, %d"
-		" to %d, %d, %d (°C)\n", 
-		th->initial_limits[0], th->initial_limits[1], th->initial_limits[2], 
-		th->limits[0], th->limits[1], th->limits[2]);
-
-	thermostat = th;
-
-	if (i2c_attach_client(&th->clt)) {
-		printk("adt746x: Thermostat failed to attach client !\n");
-		thermostat = NULL;
-		kfree(th);
-		return -ENODEV;
-	}
-
-	/* be sure to really write fan speed the first time */
-	th->last_speed[0] = -2;
-	th->last_speed[1] = -2;
-	
-	if (fan_speed != -1) {
-		write_both_fan_speed(th, 0);
-	} else {
-		write_both_fan_speed(th, -1);
-	}
-	
-	init_completion(&monitor_task_compl);
-	
-	monitor_thread_id = kernel_thread(monitor_task, th,
-		SIGCHLD | CLONE_KERNEL);
-
-	return 0;
-}
-
-/* 
- * Now, unfortunately, sysfs doesn't give us a nice void * we could
- * pass around to the attribute functions, so we don't really have
- * choice but implement a bunch of them...
- *
- */
-#define BUILD_SHOW_FUNC_DEG(name, data)				\
-static ssize_t show_##name(struct device *dev, char *buf)	\
-{								\
-	return sprintf(buf, "%d°C\n", data);			\
-}
-#define BUILD_SHOW_FUNC_INT(name, data)				\
-static ssize_t show_##name(struct device *dev, char *buf)	\
-{								\
-	return sprintf(buf, "%d\n", data);			\
-}
-
-#define BUILD_STORE_FUNC_DEG(name, data)			\
-static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
-{								\
-	int val;						\
-	int i;							\
-	val = simple_strtol(buf, NULL, 10);			\
-	printk(KERN_INFO "Adjusting limits by %d°C\n", val);	\
-	limit_adjust = val;					\
-	for (i=0; i < 3; i++)					\
-		set_limit(thermostat, i);			\
-	return n;						\
-}
-
-#define BUILD_STORE_FUNC_INT(name, data)			\
-static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
-{								\
-	u32 val;						\
-	val = simple_strtoul(buf, NULL, 10);			\
-	if (val < 0 || val > 255)				\
-		return -EINVAL;					\
-	printk(KERN_INFO "Setting fan speed to %d\n", val);	\
-	data = val;						\
-	return n;						\
-}
-
-BUILD_SHOW_FUNC_DEG(cpu_temperature,	 (read_reg(thermostat, TEMP_REG[1])))
-BUILD_SHOW_FUNC_DEG(gpu_temperature,	 (read_reg(thermostat, TEMP_REG[2])))
-BUILD_SHOW_FUNC_DEG(cpu_limit,		 thermostat->limits[1])
-BUILD_SHOW_FUNC_DEG(gpu_limit,		 thermostat->limits[2])
-
-BUILD_SHOW_FUNC_INT(specified_fan_speed, fan_speed)
-BUILD_SHOW_FUNC_INT(cpu_fan_speed,	 (read_fan_speed(thermostat, FAN_SPEED[0])))
-BUILD_SHOW_FUNC_INT(gpu_fan_speed,	 (read_fan_speed(thermostat, FAN_SPEED[1])))
-
-BUILD_STORE_FUNC_INT(specified_fan_speed,fan_speed)
-BUILD_SHOW_FUNC_INT(limit_adjust,	 limit_adjust)
-BUILD_STORE_FUNC_DEG(limit_adjust,	 thermostat)
-		
-static DEVICE_ATTR(cpu_temperature,	S_IRUGO,
-		   show_cpu_temperature,NULL);
-static DEVICE_ATTR(gpu_temperature,	S_IRUGO,
-		   show_gpu_temperature,NULL);
-static DEVICE_ATTR(cpu_limit,		S_IRUGO,
-		   show_cpu_limit,	NULL);
-static DEVICE_ATTR(gpu_limit,		S_IRUGO,
-		   show_gpu_limit,	NULL);
-
-static DEVICE_ATTR(specified_fan_speed,	S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
-		   show_specified_fan_speed,store_specified_fan_speed);
-
-static DEVICE_ATTR(cpu_fan_speed,	S_IRUGO,
-		   show_cpu_fan_speed,	NULL);
-static DEVICE_ATTR(gpu_fan_speed,	S_IRUGO,
-		   show_gpu_fan_speed,	NULL);
-
-static DEVICE_ATTR(limit_adjust,	S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
-		   show_limit_adjust,	store_limit_adjust);
-
-
-static int __init
-thermostat_init(void)
-{
-	struct device_node* np;
-	u32 *prop;
-	
-	/* Currently, we only deal with the iBook G4, we will support
-	 * all "2003" powerbooks later on
-	 */
-	np = of_find_node_by_name(NULL, "fan");
-	if (!np)
-		return -ENODEV;
-	if (device_is_compatible(np, "adt7460"))
-		therm_type = ADT7460;
-	else if (device_is_compatible(np, "adt7467"))
-		therm_type = ADT7467;
-	else
-		return -ENODEV;
-
-	prop = (u32 *)get_property(np, "reg", NULL);
-	if (!prop)
-		return -ENODEV;
-	therm_bus = ((*prop) >> 8) & 0x0f;
-	therm_address = ((*prop) & 0xff) >> 1;
-
-	printk(KERN_INFO "adt746x: Thermostat bus: %d, address: 0x%02x, limit_adjust: %d, fan_speed: %d\n",
-		therm_bus, therm_address, limit_adjust, fan_speed);
-
-	of_dev = of_platform_device_create(np, "temperatures");
-	
-	if (of_dev == NULL) {
-		printk(KERN_ERR "Can't register temperatures device !\n");
-		return -ENODEV;
-	}
-	
-	device_create_file(&of_dev->dev, &dev_attr_cpu_temperature);
-	device_create_file(&of_dev->dev, &dev_attr_gpu_temperature);
-	device_create_file(&of_dev->dev, &dev_attr_cpu_limit);
-	device_create_file(&of_dev->dev, &dev_attr_gpu_limit);
-	device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
-	device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
-	device_create_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
-	if(therm_type == ADT7460)
-		device_create_file(&of_dev->dev, &dev_attr_gpu_fan_speed);
-
-#ifndef CONFIG_I2C_KEYWEST
-	request_module("i2c-keywest");
-#endif
-
-	return i2c_add_driver(&thermostat_driver);
-}
-
-static void __exit
-thermostat_exit(void)
-{
-	if (of_dev) {
-		device_remove_file(&of_dev->dev, &dev_attr_cpu_temperature);
-		device_remove_file(&of_dev->dev, &dev_attr_gpu_temperature);
-		device_remove_file(&of_dev->dev, &dev_attr_cpu_limit);
-		device_remove_file(&of_dev->dev, &dev_attr_gpu_limit);
-		device_remove_file(&of_dev->dev, &dev_attr_limit_adjust);
-		device_remove_file(&of_dev->dev, &dev_attr_specified_fan_speed);
-		device_remove_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
-		if(therm_type == ADT7460)
-			device_remove_file(&of_dev->dev, &dev_attr_gpu_fan_speed);
-		of_device_unregister(of_dev);
-	}
-	i2c_del_driver(&thermostat_driver);
-}
-
-module_init(thermostat_init);
-module_exit(thermostat_exit);
diff -Nru a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/macintosh/therm_adt746x.c	Sun Mar 21 00:23:35 2004
@@ -0,0 +1,559 @@
+/*
+ * Device driver for the i2c thermostat found on the iBook G4, Albook G4
+ *
+ * Copyright (C) 2003, 2004 Colin Leroy, Rasmus Rohde, Benjamin Herrenschmidt
+ *
+ * Documentation from
+ * http://www.analog.com/UploadedFiles/Data_Sheets/115254175ADT7467_pra.pdf
+ * http://www.analog.com/UploadedFiles/Data_Sheets/3686221171167ADT7460_b.pdf
+ *
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/i2c.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/smp_lock.h>
+#include <linux/wait.h>
+#include <asm/prom.h>
+#include <asm/machdep.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/sections.h>
+#include <asm/of_device.h>
+
+#undef DEBUG
+
+#define CONFIG_REG   0x40
+#define MANUAL_MASK  0xe0
+#define AUTO_MASK    0x20
+
+static u8 TEMP_REG[3]    = {0x26, 0x25, 0x27}; /* local, cpu, gpu */
+static u8 LIMIT_REG[3]   = {0x6b, 0x6a, 0x6c}; /* local, cpu, gpu */
+static u8 MANUAL_MODE[2] = {0x5c, 0x5d};       
+static u8 REM_CONTROL[2] = {0x00, 0x40};
+static u8 FAN_SPEED[2]   = {0x28, 0x2a};
+static u8 FAN_SPD_SET[2] = {0x30, 0x31};
+
+static u8 default_limits_local[3] = {70, 50, 70};    /* local, cpu, gpu */
+static u8 default_limits_chip[3] = {80, 65, 80};    /* local, cpu, gpu */
+
+static int limit_adjust = 0;
+static int fan_speed = -1;
+
+MODULE_AUTHOR("Colin Leroy <colin@colino.net>");
+MODULE_DESCRIPTION("Driver for ADT746x thermostat in iBook G4 and Powerbook G4 Alu");
+MODULE_LICENSE("GPL");
+
+MODULE_PARM(limit_adjust,"i");
+MODULE_PARM_DESC(limit_adjust,"Adjust maximum temperatures (50°C cpu, 70°C gpu) by N °C.");
+MODULE_PARM(fan_speed,"i");
+MODULE_PARM_DESC(fan_speed,"Specify fan speed (0-255) when lim < temp < lim+8 (default 128)");
+
+struct thermostat {
+	struct i2c_client	clt;
+	u8			cached_temp[3];
+	u8			initial_limits[3];
+	u8			limits[3];
+	int			last_speed[2];
+	int			overriding[2];
+};
+
+static enum {ADT7460, ADT7467} therm_type;
+static int therm_bus, therm_address;
+static struct of_device * of_dev;
+static struct thermostat* thermostat;
+static pid_t monitor_thread_id;
+static int monitor_running;
+static struct completion monitor_task_compl;
+
+static int attach_one_thermostat(struct i2c_adapter *adapter, int addr, int busno);
+static void write_both_fan_speed(struct thermostat *th, int speed);
+static void write_fan_speed(struct thermostat *th, int speed, int fan);
+
+static int
+write_reg(struct thermostat* th, int reg, u8 data)
+{
+	u8 tmp[2];
+	int rc;
+	
+	tmp[0] = reg;
+	tmp[1] = data;
+	rc = i2c_master_send(&th->clt, (const char *)tmp, 2);
+	if (rc < 0)
+		return rc;
+	if (rc != 2)
+		return -ENODEV;
+	return 0;
+}
+
+static int
+read_reg(struct thermostat* th, int reg)
+{
+	u8 reg_addr, data;
+	int rc;
+
+	reg_addr = (u8)reg;
+	rc = i2c_master_send(&th->clt, &reg_addr, 1);
+	if (rc < 0)
+		return rc;
+	if (rc != 1)
+		return -ENODEV;
+	rc = i2c_master_recv(&th->clt, (char *)&data, 1);
+	if (rc < 0)
+		return rc;
+	return data;
+}
+
+static int
+attach_thermostat(struct i2c_adapter *adapter)
+{
+	unsigned long bus_no;
+
+	if (strncmp(adapter->name, "uni-n", 5))
+		return -ENODEV;
+	bus_no = simple_strtoul(adapter->name + 6, NULL, 10);
+	if (bus_no != therm_bus)
+		return -ENODEV;
+	return attach_one_thermostat(adapter, therm_address, bus_no);
+}
+
+static int
+detach_thermostat(struct i2c_adapter *adapter)
+{
+	struct thermostat* th;
+	int i;
+	
+	if (thermostat == NULL)
+		return 0;
+
+	th = thermostat;
+
+	if (monitor_running) {
+		monitor_running = 0;
+		wait_for_completion(&monitor_task_compl);
+	}
+		
+	printk(KERN_INFO "adt746x: Putting max temperatures back from %d, %d, %d,"
+		" to %d, %d, %d, (°C)\n", 
+		th->limits[0], th->limits[1], th->limits[2],
+		th->initial_limits[0], th->initial_limits[1], th->initial_limits[2]);
+	
+	for (i = 0; i < 3; i++)
+		write_reg(th, LIMIT_REG[i], th->initial_limits[i]);
+
+	write_both_fan_speed(th, -1);
+
+	i2c_detach_client(&th->clt);
+
+	thermostat = NULL;
+
+	kfree(th);
+
+	return 0;
+}
+
+static struct i2c_driver thermostat_driver = {  
+	.name		="Apple Thermostat ADT746x",
+	.id		=0xDEAD7467,
+	.flags		=I2C_DF_NOTIFY,
+	.attach_adapter	=&attach_thermostat,
+	.detach_adapter	=&detach_thermostat,
+};
+
+static int read_fan_speed(struct thermostat *th, u8 addr)
+{
+	u8 tmp[2];
+	u16 res;
+	
+	/* should start with low byte */
+	tmp[1] = read_reg(th, addr);
+	tmp[0] = read_reg(th, addr + 1);
+	
+	res = tmp[1] + (tmp[0] << 8);
+	return (90000*60)/res;
+}
+
+static void write_both_fan_speed(struct thermostat *th, int speed)
+{
+	write_fan_speed(th, speed, 0);
+	if (therm_type == ADT7460)
+		write_fan_speed(th, speed, 1);
+}
+
+static void write_fan_speed(struct thermostat *th, int speed, int fan)
+{
+	u8 manual;
+	
+	if (speed > 0xff) 
+		speed = 0xff;
+	else if (speed < -1) 
+		speed = 0;
+	
+	if (therm_type == ADT7467 && fan == 1)
+		return;
+	
+	if (th->last_speed[fan] != speed) {
+		if (speed == -1)
+			printk(KERN_INFO "adt746x: Setting speed to: automatic for %s fan.\n",
+				fan?"GPU":"CPU");
+		else
+			printk(KERN_INFO "adt746x: Setting speed to: %d for %s fan.\n",
+				speed, fan?"GPU":"CPU");
+	} else
+		return;
+	
+	if (speed >= 0) {
+		manual = read_reg(th, MANUAL_MODE[fan]);
+		write_reg(th, MANUAL_MODE[fan], manual|MANUAL_MASK);
+		write_reg(th, FAN_SPD_SET[fan], speed);
+	} else {
+		/* back to automatic */
+		if(therm_type == ADT7460) {
+			manual = read_reg(th, MANUAL_MODE[fan]) & (~MANUAL_MASK);
+			write_reg(th, MANUAL_MODE[fan], manual|REM_CONTROL[fan]);
+		} else {
+			manual = read_reg(th, MANUAL_MODE[fan]);
+			write_reg(th, MANUAL_MODE[fan], manual&(~AUTO_MASK));
+		}
+	}
+	
+	th->last_speed[fan] = speed;			
+}
+
+static int monitor_task(void *arg)
+{
+	struct thermostat* th = arg;
+	u8 temps[3];
+	u8 lims[3];
+	int i;
+#ifdef DEBUG
+	int mfan_speed;
+#endif
+	
+	lock_kernel();
+	daemonize("kfand");
+	unlock_kernel();
+	strcpy(current->comm, "thermostat");
+	monitor_running = 1;
+
+	while(monitor_running)
+	{
+		set_task_state(current, TASK_UNINTERRUPTIBLE);
+		schedule_timeout(2*HZ);
+
+		/* Check status */
+		/* local   : chip */
+		/* remote 1: CPU ?*/
+		/* remote 2: GPU ?*/
+#ifndef DEBUG
+		if (fan_speed != -1) {
+#endif
+			for (i = 0; i < 3; i++) {
+				temps[i]  = read_reg(th, TEMP_REG[i]);
+				lims[i]   = th->limits[i];
+			}
+#ifndef DEBUG
+		}
+#endif		
+		if (fan_speed != -1) {
+			int lastvar = 0;		/* for iBook */
+			for (i = 1; i < 3; i++) {	/* we don't care about local sensor */
+				int started = 0;
+				int fan_number = (therm_type == ADT7460 && i == 2);
+				int var = temps[i] - lims[i];
+				if (var > 8) {
+					if (th->overriding[fan_number] == 0)
+						printk(KERN_INFO "adt746x: Limit exceeded by %d°C, overriding specified fan speed for %s.\n",
+							var, fan_number?"GPU":"CPU");
+					th->overriding[fan_number] = 1;
+					write_fan_speed(th, 255, fan_number);
+					started = 1;
+				} else if ((!th->overriding[fan_number] || var < 6) && var > 0) {
+					if (th->overriding[fan_number] == 1)
+						printk(KERN_INFO "adt746x: Limit exceeded by %d°C, setting speed to specified for %s.\n",
+							var, fan_number?"GPU":"CPU");					
+					th->overriding[fan_number] = 0;
+					write_fan_speed(th, fan_speed, fan_number);
+					started = 1;
+				} else if (var < -1) {
+					/* don't stop iBook fan if GPU is cold and CPU is not
+					 * so cold (lastvar >= -1) */
+					if (therm_type == ADT7460 || lastvar < -1 || i == 1) {
+						if (th->last_speed[fan_number] != 0)
+							printk(KERN_INFO "adt746x: Stopping %s fan.\n",
+								fan_number?"GPU":"CPU");
+						write_fan_speed(th, 0, fan_number);
+					}
+				}
+				
+				lastvar = var;
+				
+				if (started && therm_type == ADT7467)
+					break; /* we don't want to re-stop the fan
+						* if CPU is heating and GPU is not */
+			}
+		}
+#ifdef DEBUG
+		mfan_speed = read_fan_speed(th, FAN_SPEED[0]);
+		/* only one fan in the iBook G4 */
+				
+		if (temps[0] != th->cached_temp[0]
+		||  temps[1] != th->cached_temp[1]
+		||  temps[2] != th->cached_temp[2]) {
+			printk(KERN_INFO "adt746x: Temperature infos:"
+					 " thermostats: %d,%d,%d °C;"
+					 " limits: %d,%d,%d °C;"
+					 " fan speed: %d RPM\n",
+				temps[0], temps[1], temps[2],
+				lims[0],  lims[1],  lims[2],
+				mfan_speed);
+		}
+		th->cached_temp[0] = temps[0];
+		th->cached_temp[1] = temps[1];
+		th->cached_temp[2] = temps[2];
+#endif		
+	}
+
+	complete_and_exit(&monitor_task_compl, 0);
+	return 0;
+}
+
+static void
+set_limit(struct thermostat *th, int i)
+{
+		/* Set CPU limit higher to avoid powerdowns */ 
+		th->limits[i] = default_limits_chip[i] + limit_adjust;
+		write_reg(th, LIMIT_REG[i], th->limits[i]);
+		
+		/* set our limits to normal */
+		th->limits[i] = default_limits_local[i] + limit_adjust;
+}
+	
+static int
+attach_one_thermostat(struct i2c_adapter *adapter, int addr, int busno)
+{
+	struct thermostat* th;
+	int rc;
+	int i;
+
+	if (thermostat)
+		return 0;
+	th = (struct thermostat *)kmalloc(sizeof(struct thermostat), GFP_KERNEL);
+	if (!th)
+		return -ENOMEM;
+	memset(th, 0, sizeof(*th));
+	th->clt.addr = addr;
+	th->clt.adapter = adapter;
+	th->clt.driver = &thermostat_driver;
+	th->clt.id = 0xDEAD7467;
+	strcpy(th->clt.name, "thermostat");
+
+	rc = read_reg(th, 0);
+	if (rc < 0) {
+		printk(KERN_ERR "adt746x: Thermostat failed to read config from bus %d !\n",
+			busno);
+		kfree(th);
+		return -ENODEV;
+	}
+	/* force manual control to start the fan quieter */
+	
+	if (fan_speed == -1)
+		fan_speed=128;
+	
+	if(therm_type == ADT7460) {
+		printk(KERN_INFO "adt746x: ADT7460 initializing\n");
+		/* The 7460 needs to be started explicitly */
+		write_reg(th, CONFIG_REG, 1);
+	} else
+		printk(KERN_INFO "adt746x: ADT7467 initializing\n");
+
+	for (i = 0; i < 3; i++) {
+		th->initial_limits[i] = read_reg(th, LIMIT_REG[i]);
+		set_limit(th, i);
+	}
+	
+	printk(KERN_INFO "adt746x: Lowering max temperatures from %d, %d, %d"
+		" to %d, %d, %d (°C)\n", 
+		th->initial_limits[0], th->initial_limits[1], th->initial_limits[2], 
+		th->limits[0], th->limits[1], th->limits[2]);
+
+	thermostat = th;
+
+	if (i2c_attach_client(&th->clt)) {
+		printk("adt746x: Thermostat failed to attach client !\n");
+		thermostat = NULL;
+		kfree(th);
+		return -ENODEV;
+	}
+
+	/* be sure to really write fan speed the first time */
+	th->last_speed[0] = -2;
+	th->last_speed[1] = -2;
+	
+	if (fan_speed != -1) {
+		write_both_fan_speed(th, 0);
+	} else {
+		write_both_fan_speed(th, -1);
+	}
+	
+	init_completion(&monitor_task_compl);
+	
+	monitor_thread_id = kernel_thread(monitor_task, th,
+		SIGCHLD | CLONE_KERNEL);
+
+	return 0;
+}
+
+/* 
+ * Now, unfortunately, sysfs doesn't give us a nice void * we could
+ * pass around to the attribute functions, so we don't really have
+ * choice but implement a bunch of them...
+ *
+ */
+#define BUILD_SHOW_FUNC_DEG(name, data)				\
+static ssize_t show_##name(struct device *dev, char *buf)	\
+{								\
+	return sprintf(buf, "%d°C\n", data);			\
+}
+#define BUILD_SHOW_FUNC_INT(name, data)				\
+static ssize_t show_##name(struct device *dev, char *buf)	\
+{								\
+	return sprintf(buf, "%d\n", data);			\
+}
+
+#define BUILD_STORE_FUNC_DEG(name, data)			\
+static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
+{								\
+	int val;						\
+	int i;							\
+	val = simple_strtol(buf, NULL, 10);			\
+	printk(KERN_INFO "Adjusting limits by %d°C\n", val);	\
+	limit_adjust = val;					\
+	for (i=0; i < 3; i++)					\
+		set_limit(thermostat, i);			\
+	return n;						\
+}
+
+#define BUILD_STORE_FUNC_INT(name, data)			\
+static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
+{								\
+	u32 val;						\
+	val = simple_strtoul(buf, NULL, 10);			\
+	if (val < 0 || val > 255)				\
+		return -EINVAL;					\
+	printk(KERN_INFO "Setting fan speed to %d\n", val);	\
+	data = val;						\
+	return n;						\
+}
+
+BUILD_SHOW_FUNC_DEG(cpu_temperature,	 (read_reg(thermostat, TEMP_REG[1])))
+BUILD_SHOW_FUNC_DEG(gpu_temperature,	 (read_reg(thermostat, TEMP_REG[2])))
+BUILD_SHOW_FUNC_DEG(cpu_limit,		 thermostat->limits[1])
+BUILD_SHOW_FUNC_DEG(gpu_limit,		 thermostat->limits[2])
+
+BUILD_SHOW_FUNC_INT(specified_fan_speed, fan_speed)
+BUILD_SHOW_FUNC_INT(cpu_fan_speed,	 (read_fan_speed(thermostat, FAN_SPEED[0])))
+BUILD_SHOW_FUNC_INT(gpu_fan_speed,	 (read_fan_speed(thermostat, FAN_SPEED[1])))
+
+BUILD_STORE_FUNC_INT(specified_fan_speed,fan_speed)
+BUILD_SHOW_FUNC_INT(limit_adjust,	 limit_adjust)
+BUILD_STORE_FUNC_DEG(limit_adjust,	 thermostat)
+		
+static DEVICE_ATTR(cpu_temperature,	S_IRUGO,
+		   show_cpu_temperature,NULL);
+static DEVICE_ATTR(gpu_temperature,	S_IRUGO,
+		   show_gpu_temperature,NULL);
+static DEVICE_ATTR(cpu_limit,		S_IRUGO,
+		   show_cpu_limit,	NULL);
+static DEVICE_ATTR(gpu_limit,		S_IRUGO,
+		   show_gpu_limit,	NULL);
+
+static DEVICE_ATTR(specified_fan_speed,	S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
+		   show_specified_fan_speed,store_specified_fan_speed);
+
+static DEVICE_ATTR(cpu_fan_speed,	S_IRUGO,
+		   show_cpu_fan_speed,	NULL);
+static DEVICE_ATTR(gpu_fan_speed,	S_IRUGO,
+		   show_gpu_fan_speed,	NULL);
+
+static DEVICE_ATTR(limit_adjust,	S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
+		   show_limit_adjust,	store_limit_adjust);
+
+
+static int __init
+thermostat_init(void)
+{
+	struct device_node* np;
+	u32 *prop;
+	
+	np = of_find_node_by_name(NULL, "fan");
+	if (!np)
+		return -ENODEV;
+	if (device_is_compatible(np, "adt7460"))
+		therm_type = ADT7460;
+	else if (device_is_compatible(np, "adt7467"))
+		therm_type = ADT7467;
+	else
+		return -ENODEV;
+
+	prop = (u32 *)get_property(np, "reg", NULL);
+	if (!prop)
+		return -ENODEV;
+	therm_bus = ((*prop) >> 8) & 0x0f;
+	therm_address = ((*prop) & 0xff) >> 1;
+
+	printk(KERN_INFO "adt746x: Thermostat bus: %d, address: 0x%02x, limit_adjust: %d, fan_speed: %d\n",
+		therm_bus, therm_address, limit_adjust, fan_speed);
+
+	of_dev = of_platform_device_create(np, "temperatures");
+	
+	if (of_dev == NULL) {
+		printk(KERN_ERR "Can't register temperatures device !\n");
+		return -ENODEV;
+	}
+	
+	device_create_file(&of_dev->dev, &dev_attr_cpu_temperature);
+	device_create_file(&of_dev->dev, &dev_attr_gpu_temperature);
+	device_create_file(&of_dev->dev, &dev_attr_cpu_limit);
+	device_create_file(&of_dev->dev, &dev_attr_gpu_limit);
+	device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
+	device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
+	device_create_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
+	if(therm_type == ADT7460)
+		device_create_file(&of_dev->dev, &dev_attr_gpu_fan_speed);
+
+#ifndef CONFIG_I2C_KEYWEST
+	request_module("i2c-keywest");
+#endif
+
+	return i2c_add_driver(&thermostat_driver);
+}
+
+static void __exit
+thermostat_exit(void)
+{
+	if (of_dev) {
+		device_remove_file(&of_dev->dev, &dev_attr_cpu_temperature);
+		device_remove_file(&of_dev->dev, &dev_attr_gpu_temperature);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu_limit);
+		device_remove_file(&of_dev->dev, &dev_attr_gpu_limit);
+		device_remove_file(&of_dev->dev, &dev_attr_limit_adjust);
+		device_remove_file(&of_dev->dev, &dev_attr_specified_fan_speed);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
+		if(therm_type == ADT7460)
+			device_remove_file(&of_dev->dev, &dev_attr_gpu_fan_speed);
+		of_device_unregister(of_dev);
+	}
+	i2c_del_driver(&thermostat_driver);
+}
+
+module_init(thermostat_init);
+module_exit(thermostat_exit);
diff -Nru a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
--- a/drivers/macintosh/therm_windtunnel.c	Sun Mar 21 00:23:35 2004
+++ b/drivers/macintosh/therm_windtunnel.c	Sun Mar 21 00:23:35 2004
@@ -1,24 +1,23 @@
 /* 
  *   Creation Date: <2003/03/14 20:54:13 samuel>
- *   Time-stamp: <2003/03/15 18:55:53 samuel>
+ *   Time-stamp: <2004/03/20 14:20:59 samuel>
  *   
  *	<therm_windtunnel.c>
  *	
- *	The G4 "windtunnel" has a single fan controlled by a
- *	DS1775 fan controller and an ADM1030 thermostat.
+ *	The G4 "windtunnel" has a single fan controlled by an
+ *	ADM1030 fan controller and a DS1775 thermostat.
  *
  *	The fan controller is equipped with a temperature sensor
- *	which measures the case temperature. The ADM censor
+ *	which measures the case temperature. The DS1775 sensor
  *	measures the CPU temperature. This driver tunes the
  *	behavior of the fan. It is based upon empirical observations
- *	of the 'AppleFan' driver under OSX.
+ *	of the 'AppleFan' driver under Mac OS X.
  *
  *	WARNING: This driver has only been testen on Apple's
- *	1.25 MHz Dual G4 (March 03). Other machines might have
- *	a different thermal design. It is tuned for a CPU
+ *	1.25 MHz Dual G4 (March 03). It is tuned for a CPU
  *	temperatur around 57 C.
  *
- *   Copyright (C) 2003 Samuel Rydh (samuel@ibrium.se)
+ *   Copyright (C) 2003, 2004 Samuel Rydh (samuel@ibrium.se)
  *
  *   Loosely based upon 'thermostat.c' written by Benjamin Herrenschmidt
  *   
@@ -38,50 +37,37 @@
 #include <linux/i2c.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/workqueue.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/sections.h>
-
-MODULE_AUTHOR("Samuel Rydh <samuel@ibrium.se>");
-MODULE_DESCRIPTION("Apple G4 (windtunnel) fan driver");
-MODULE_LICENSE("GPL");
+#include <asm/of_device.h>
 
 #define LOG_TEMP		0			/* continously log temperature */
 
-/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
-static unsigned short normal_i2c[] = { 0x49, 0x2c, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { 0x48, 0x4f, 0x2c, 0x2f, I2C_CLIENT_END };
-static struct work_struct poll_work;
-
-I2C_CLIENT_INSMOD;
-
 #define I2C_DRIVERID_G4FAN	0x9001			/* fixme */
-
 #define THERMOSTAT_CLIENT_ID	1
 #define FAN_CLIENT_ID		2
 
-struct temp_range {
-	u8			high;			/* start the fan */
-	u8			low;			/* stop the fan */
-};
-struct apple_thermal_info {
-	u8			id;			/* implementation ID */
-	u8			fan_count;		/* number of fans */
-	u8			thermostat_count;	/* number of thermostats */
-	u8			unused[5];
-	struct temp_range	ranges[4];		/* temperature ranges (may be [])*/
-};
+static int 			do_probe( struct i2c_adapter *adapter, int addr, int kind);
 
-static int do_detect( struct i2c_adapter *adapter, int addr, int kind);
+/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
+static unsigned short		normal_i2c[] = { 0x49, 0x2c, I2C_CLIENT_END };
+static unsigned short		normal_i2c_range[] = { 0x48, 0x4f, 0x2c, 0x2f, I2C_CLIENT_END };
+
+I2C_CLIENT_INSMOD;
 
 static struct {
+	volatile int		running;
+	struct completion	completion;
+	pid_t			poll_task;
+	
+	struct semaphore 	lock;
+	struct of_device	*of_dev;
+	
 	struct i2c_client	*thermostat;
 	struct i2c_client	*fan;
-	int			error;
-	struct timer_list	timer;
 
 	int			overheat_temp;		/* 100% fan at this temp */
 	int			overheat_hyst;
@@ -95,37 +81,54 @@
 	int			r0, r1, r20, r23, r25;	/* saved register */
 } x;
 
+#define T(x,y)			(((x)<<8) | (y)*0x100/10 )
+
 static struct {
+	int			fan_down_setting;
 	int			temp;
-	int			fan_setting;
-} fan_up_table[] = {
-	{ 0x0000, 11 },		/* min fan */
-	{ 0x3900, 8 },		/* 57.0 C */
-	{ 0x3a4a, 7 },		/* 58.3 C */
-	{ 0x3ad3, 6 },		/* 58.8 C */
-	{ 0x3b3c, 5 },		/* 59.2 C */
-	{ 0x3b94, 4 },		/* 59.6 C */
-	{ 0x3be3, 3 },		/* 58.9 C */
-	{ 0x3c29, 2 },		/* 59.2 C */
-	{ 0xffff, 1 }		/* on fire */
-};
-static struct {
-	int			temp;
-	int			fan_setting;
-} fan_down_table[] = {
-	{ 0x3700, 11 },		/* 55.0 C */
-	{ 0x374a, 6 },
-	{ 0x3800, 7 },		/* 56.0 C */
-	{ 0x3900, 8 },		/* 57.0 C */
-	{ 0x3a4a, 7 },		/* 58.3 C */
-	{ 0x3ad3, 6 },		/* 58.8 C */
-	{ 0x3b3c, 5 },		/* 59.2 C */
-	{ 0x3b94, 4 },		/* 58.9 C */
-	{ 0x3be3, 3 },		/* 58.9 C */
-	{ 0x3c29, 2 },		/* 59.2 C */
-	{ 0xffff, 1 }
+	int			fan_up_setting;
+} fan_table[] = {
+	{ 11, T(0,0),  11 },	/* min fan */
+	{ 11, T(55,0), 11 },
+	{  6, T(55,3), 11 },
+	{  7, T(56,0), 11 },
+	{  8, T(57,0), 8 },
+	{  7, T(58,3), 7 },
+	{  6, T(58,8), 6 },
+	{  5, T(59,2), 5 },
+	{  4, T(59,6), 4 },
+	{  3, T(59,9), 3 },
+	{  2, T(60,1), 2 },
+	{  1, 0xfffff, 1 }	/* on fire */
 };
 
+static void
+print_temp( const char *s, int temp )
+{
+	printk("%s%d.%d C", s ? s : "", temp>>8, (temp & 255)*10/256 );
+}
+
+static ssize_t
+show_cpu_temperature( struct device *dev, char *buf )
+{
+	return sprintf(buf, "%d.%d\n", x.temp>>8, (x.temp & 255)*10/256 );
+}
+
+static ssize_t
+show_case_temperature( struct device *dev, char *buf )
+{
+	return sprintf(buf, "%d.%d\n", x.casetemp>>8, (x.casetemp & 255)*10/256 );
+}
+
+static DEVICE_ATTR(cpu_temperature, S_IRUGO, show_cpu_temperature, NULL );
+static DEVICE_ATTR(case_temperature, S_IRUGO, show_case_temperature, NULL );
+
+
+
+/************************************************************************/
+/*	controller thread						*/
+/************************************************************************/
+
 static int
 write_reg( struct i2c_client *cl, int reg, int data, int len )
 {
@@ -159,37 +162,32 @@
 	return (len == 2)? ((unsigned int)buf[0] << 8) | buf[1] : buf[0];
 }
 
-
-static void
-print_temp( const char *s, int temp )
-{
-	printk("%s%d.%d C", s ? s : "", temp>>8, (temp & 255)*10/256 );
-}
-
 static void
 tune_fan( int fan_setting )
 {
 	int val = (fan_setting << 3) | 7;
-	x.fan_level = fan_setting;
-	
-	//write_reg( x.fan, 0x24, val, 1 );
+
+	/* write_reg( x.fan, 0x24, val, 1 ); */
 	write_reg( x.fan, 0x25, val, 1 );
 	write_reg( x.fan, 0x20, 0, 1 );
 	print_temp("CPU-temp: ", x.temp );
 	if( x.casetemp )
 		print_temp(", Case: ", x.casetemp );
-	printk("  Tuning fan: %d (%02x)\n", fan_setting, val );
+	printk(",  Fan: %d (tuned %+d)\n", 11-fan_setting, x.fan_level-fan_setting );
+
+	x.fan_level = fan_setting;
 }
 
 static void
-poll_temp( void *param )
+poll_temp( void )
 {
-	int temp = read_reg( x.thermostat, 0, 2 );
-	int i, level, casetemp;
+	int temp, i, level, casetemp;
+
+	temp = read_reg( x.thermostat, 0, 2 );
 
 	/* this actually occurs when the computer is loaded */
 	if( temp < 0 )
-		goto out;
+		return;
 
 	casetemp = read_reg(x.fan, 0x0b, 1) << 8;
 	casetemp |= (read_reg(x.fan, 0x06, 1) & 0x7) << 5;
@@ -197,37 +195,117 @@
 	if( LOG_TEMP && x.temp != temp ) {
 		print_temp("CPU-temp: ", temp );
 		print_temp(", Case: ", casetemp );
-		printk(",  Fan: %d\n", x.fan_level );
+		printk(",  Fan: %d\n", 11-x.fan_level );
 	}
 	x.temp = temp;
 	x.casetemp = casetemp;
 
 	level = -1;
-	for( i=0; (temp & 0xffff) > fan_down_table[i].temp ; i++ )
+	for( i=0; (temp & 0xffff) > fan_table[i].temp ; i++ )
 		;
 	if( i < x.downind )
-		level = fan_down_table[i].fan_setting;
+		level = fan_table[i].fan_down_setting;
 	x.downind = i;
 
-	for( i=0; (temp & 0xfffe) >= fan_up_table[i+1].temp ; i++ )
+	for( i=0; (temp & 0xffff) >= fan_table[i+1].temp ; i++ )
 		;
 	if( x.upind < i )
-		level = fan_up_table[i].fan_setting;
+		level = fan_table[i].fan_up_setting;
 	x.upind = i;
 
 	if( level >= 0 )
 		tune_fan( level );
- out:
-	x.timer.expires = jiffies + 8*HZ;
-	add_timer( &x.timer );
+}
+
+
+static void
+setup_hardware( void )
+{
+	int val;
+
+	/* save registers (if we unload the module) */
+	x.r0 = read_reg( x.fan, 0x00, 1 );
+	x.r1 = read_reg( x.fan, 0x01, 1 );
+	x.r20 = read_reg( x.fan, 0x20, 1 );
+	x.r23 = read_reg( x.fan, 0x23, 1 );
+	x.r25 = read_reg( x.fan, 0x25, 1 );
+
+	/* improve measurement resolution (convergence time 1.5s) */
+	if( (val=read_reg(x.thermostat, 1, 1)) >= 0 ) {
+		val |= 0x60;
+		if( write_reg( x.thermostat, 1, val, 1 ) )
+			printk("Failed writing config register\n");
+	}
+	/* disable interrupts and TAC input */
+	write_reg( x.fan, 0x01, 0x01, 1 );
+	/* enable filter */
+	write_reg( x.fan, 0x23, 0x91, 1 );
+	/* remote temp. controls fan */
+	write_reg( x.fan, 0x00, 0x95, 1 );
+
+	/* The thermostat (which besides measureing temperature controls
+	 * has a THERM output which puts the fan on 100%) is usually
+	 * set to kick in at 80 C (chip default). We reduce this a bit
+	 * to be on the safe side (OSX doesn't)...
+	 */
+	if( x.overheat_temp == (80 << 8) ) {
+		x.overheat_temp = 65 << 8;
+		x.overheat_hyst = 60 << 8;
+		write_reg( x.thermostat, 2, x.overheat_hyst, 2 );
+		write_reg( x.thermostat, 3, x.overheat_temp, 2 );
+
+		print_temp("Reducing overheating limit to ", x.overheat_temp );
+		print_temp(" (Hyst: ", x.overheat_hyst );
+		printk(")\n");
+	}
+
+	/* set an initial fan setting */
+	x.downind = 0xffff;
+	x.upind = -1;
+	/* tune_fan( fan_up_table[x.upind].fan_setting ); */
+
+	device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
+	device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
 }
 
 static void
-schedule_poll( unsigned long t )
+restore_regs( void )
 {
-	schedule_work(&poll_work);
+	device_remove_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
+	device_remove_file( &x.of_dev->dev, &dev_attr_case_temperature );
+
+	write_reg( x.fan, 0x01, x.r1, 1 );
+	write_reg( x.fan, 0x20, x.r20, 1 );
+	write_reg( x.fan, 0x23, x.r23, 1 );
+	write_reg( x.fan, 0x25, x.r25, 1 );
+	write_reg( x.fan, 0x00, x.r0, 1 );
 }
 
+static int
+control_loop( void *dummy )
+{
+	daemonize("g4fand");
+
+	down( &x.lock );
+	setup_hardware();
+
+	while( x.running ) {
+		up( &x.lock );
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout( 8*HZ );
+		
+		down( &x.lock );
+		poll_temp();
+	}
+
+	restore_regs();
+	up( &x.lock );
+
+	complete_and_exit( &x.completion, 0 );
+}
+
+
 /************************************************************************/
 /*	i2c probing and setup						*/
 /************************************************************************/
@@ -235,7 +313,20 @@
 static int
 do_attach( struct i2c_adapter *adapter )
 {
-	return i2c_probe( adapter, &addr_data, &do_detect );
+	int ret = 0;
+
+	if( strncmp(adapter->name, "uni-n", 5) )
+		return 0;
+
+	if( !x.running ) {
+		ret = i2c_probe( adapter, &addr_data, &do_probe );
+		if( x.thermostat && x.fan ) {
+			x.running = 1;
+			init_completion( &x.completion );
+			x.poll_task = kernel_thread( control_loop, NULL, SIGCHLD | CLONE_KERNEL );
+		}
+	}
+	return ret;
 }
 
 static int
@@ -243,13 +334,23 @@
 {
 	int err;
 
-	printk("do_detach: id %d\n", client->id );
-	if( (err=i2c_detach_client(client)) ) {
-		printk("failed to detach thermostat client\n");
-		return err;
+	if( (err=i2c_detach_client(client)) )
+		printk(KERN_ERR "failed to detach thermostat client\n");
+	else {
+		if( x.running ) {
+			x.running = 0;
+			wait_for_completion( &x.completion );
+		}
+		if( client == x.thermostat )
+			x.thermostat = NULL;
+		else if( client == x.fan )
+			x.fan = NULL;
+		else {
+			printk(KERN_ERR "g4fan: bad client\n");
+		}
+		kfree( client );
 	}
-	kfree( client );
-	return 0;
+	return err;
 }
 
 static struct i2c_driver g4fan_driver = {  
@@ -262,24 +363,21 @@
 };
 
 static int
-detect_fan( struct i2c_client *cl )
+attach_fan( struct i2c_client *cl )
 {
+	if( x.fan )
+		goto out;
+
 	/* check that this is an ADM1030 */
 	if( read_reg(cl, 0x3d, 1) != 0x30 || read_reg(cl, 0x3e, 1) != 0x41 )
 		goto out;
-	printk("ADM1030 fan controller detected at %02x\n", cl->addr );
+	printk("ADM1030 fan controller [@%02x]\n", cl->addr );
 
-	if( x.fan ) {
-		x.error |= 2;
-		goto out;
-	}
-	x.fan = cl;
 	cl->id = FAN_CLIENT_ID;
-	strncpy( cl->name, "ADM1030 fan controller", sizeof(cl->name) );
+	strlcpy( cl->name, "ADM1030 fan controller", sizeof(cl->name) );
 
-	if( i2c_attach_client( cl ) )
-		goto out;
-	return 0;
+	if( !i2c_attach_client(cl) )
+		x.fan = cl;
  out:
 	if( cl != x.fan )
 		kfree( cl );
@@ -287,10 +385,13 @@
 }
 
 static int
-detect_thermostat( struct i2c_client *cl ) 
+attach_thermostat( struct i2c_client *cl ) 
 {
 	int hyst_temp, os_temp, temp;
 
+	if( x.thermostat )
+		goto out;
+
 	if( (temp=read_reg(cl, 0, 2)) < 0 )
 		goto out;
 	
@@ -302,44 +403,37 @@
 	if( hyst_temp < 0 || os_temp < 0 )
 		goto out;
 
-	printk("DS1775 digital thermometer detected at %02x\n", cl->addr );
+	printk("DS1775 digital thermometer [@%02x]\n", cl->addr );
 	print_temp("Temp: ", temp );
 	print_temp("  Hyst: ", hyst_temp );
 	print_temp("  OS: ", os_temp );
 	printk("\n");
 
-	if( x.thermostat ) {
-		x.error |= 1;
-		goto out;
-	}
 	x.temp = temp;
-	x.thermostat = cl;
 	x.overheat_temp = os_temp;
 	x.overheat_hyst = hyst_temp;
 	
 	cl->id = THERMOSTAT_CLIENT_ID;
-	strncpy( cl->name, "DS1775 thermostat", sizeof(cl->name) );
+	strlcpy( cl->name, "DS1775 thermostat", sizeof(cl->name) );
 
-	if( i2c_attach_client( cl ) )
-		goto out;
-	return 0;
+	if( !i2c_attach_client(cl) )
+		x.thermostat = cl;
 out:
-	kfree( cl );
+	if( cl != x.thermostat )
+		kfree( cl );
 	return 0;
 }
 
 static int
-do_detect( struct i2c_adapter *adapter, int addr, int kind )
+do_probe( struct i2c_adapter *adapter, int addr, int kind )
 {
 	struct i2c_client *cl;
 
-	if( strncmp(adapter->name, "uni-n", 5) )
-		return 0;
 	if( !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA
 				     | I2C_FUNC_SMBUS_WRITE_BYTE) )
 		return 0;
 
-	if( !(cl=kmalloc( sizeof(struct i2c_client), GFP_KERNEL )) )
+	if( !(cl=kmalloc(sizeof(*cl), GFP_KERNEL)) )
 		return -ENOMEM;
 	memset( cl, 0, sizeof(struct i2c_client) );
 
@@ -349,108 +443,94 @@
 	cl->flags = 0;
 
 	if( addr < 0x48 )
-		return detect_fan( cl );
-	return detect_thermostat( cl );
+		return attach_fan( cl );
+	return attach_thermostat( cl );
+}
+
+
+/************************************************************************/
+/*	initialization / cleanup					*/
+/************************************************************************/
+
+static int
+therm_of_probe( struct of_device *dev, const struct of_match *match )
+{
+	return i2c_add_driver( &g4fan_driver );
 }
 
-#define PRINT_REG( r )	printk("reg %02x = %02x\n", r, read_reg(x.fan, r, 1) )
+static int
+therm_of_remove( struct of_device *dev )
+{
+	return i2c_del_driver( &g4fan_driver );
+}
+
+static struct of_match therm_of_match[] = {{
+	.name		= "fan",
+	.type		= OF_ANY_MATCH,
+	.compatible	= "adm1030"
+    }, {}
+};
+
+static struct of_platform_driver therm_of_driver = {
+	.name		= "temperature",
+	.match_table	= therm_of_match,
+	.probe		= therm_of_probe,
+	.remove		= therm_of_remove,
+};
+
+struct apple_thermal_info {
+	u8		id;			/* implementation ID */
+	u8		fan_count;		/* number of fans */
+	u8		thermostat_count;	/* number of thermostats */
+	u8		unused;
+};
 
 static int __init
 g4fan_init( void )
 {
 	struct apple_thermal_info *info;
 	struct device_node *np;
-	int ret, val;
-	
-	np = of_find_node_by_name(NULL, "power-mgt");
-	if (np == NULL)
+
+	init_MUTEX( &x.lock );
+
+	if( !(np=of_find_node_by_name(NULL, "power-mgt")) )
 		return -ENODEV;
 	info = (struct apple_thermal_info*)get_property(np, "thermal-info", NULL);
 	of_node_put(np);
-	if (info == NULL)
-		return -ENODEV;
-	
-	/* check for G4 "Windtunnel" SMP */
-	if( machine_is_compatible("PowerMac3,6") ) {
-		if( info->id != 3 ) {
-			printk(KERN_ERR "g4fan: design id %d unknown\n", info->id);
-			return -ENODEV;
-		}
-	} else {
-		printk(KERN_ERR "g4fan: unsupported machine type\n");
-		return -ENODEV;
-	}
-	if( (ret=i2c_add_driver(&g4fan_driver)) )
-		return ret;
 
-	if( !x.thermostat || !x.fan ) {
-		i2c_del_driver(&g4fan_driver );
+	if( !info || !machine_is_compatible("PowerMac3,6") )
 		return -ENODEV;
-	}
-
-	/* save registers (if we unload the module) */
-	x.r0 = read_reg( x.fan, 0x00, 1 );
-	x.r1 = read_reg( x.fan, 0x01, 1 );
-	x.r20 = read_reg( x.fan, 0x20, 1 );
-	x.r23 = read_reg( x.fan, 0x23, 1 );
-	x.r25 = read_reg( x.fan, 0x25, 1 );
 
-	/* improve measurement resolution (convergence time 1.5s) */
-	if( (val=read_reg( x.thermostat, 1, 1 )) >= 0 ) {
-		val |= 0x60;
-		if( write_reg( x.thermostat, 1, val, 1 ) )
-			printk("Failed writing config register\n");
+	if( info->id != 3 ) {
+		printk(KERN_ERR "therm_windtunnel: unsupported thermal design %d\n", info->id );
+		return -ENODEV;
 	}
-	/* disable interrupts and TAC input */
-	write_reg( x.fan, 0x01, 0x01, 1 );
-	/* enable filter */
-	write_reg( x.fan, 0x23, 0x91, 1 );
-	/* remote temp. controls fan */
-	write_reg( x.fan, 0x00, 0x95, 1 );
-
-	/* The thermostat (which besides measureing temperature controls
-	 * has a THERM output which puts the fan on 100%) is usually
-	 * set to kick in at 80 C (chip default). We reduce this a bit
-	 * to be on the safe side (OSX doesn't)...
-	 */
-	if( x.overheat_temp == (80 << 8) ) {
-		x.overheat_temp = 65 << 8;
-		x.overheat_hyst = 60 << 8;
-		write_reg( x.thermostat, 2, x.overheat_hyst, 2 );
-		write_reg( x.thermostat, 3, x.overheat_temp, 2 );
+	if( !(np=of_find_node_by_name(NULL, "fan")) )
+		return -ENODEV;
+	x.of_dev = of_platform_device_create( np, "temperature" );
+	of_node_put( np );
 
-		print_temp("Reducing overheating limit to ", x.overheat_temp );
-		print_temp(" (Hyst: ", x.overheat_hyst );
-		printk(")\n");
+	if( !x.of_dev ) {
+		printk(KERN_ERR "Can't register fan controller!\n");
+		return -ENODEV;
 	}
 
-	/* set an initial fan setting */
-	x.upind = x.downind = 1;
-	tune_fan( fan_up_table[x.upind].fan_setting );
-
-	INIT_WORK(&poll_work, poll_temp, NULL);
-
-	init_timer( &x.timer );
-	x.timer.expires = jiffies + 8*HZ;
-	x.timer.function = schedule_poll;
-	add_timer( &x.timer );
+	of_register_driver( &therm_of_driver );
 	return 0;
 }
 
 static void __exit
 g4fan_exit( void )
 {
-	del_timer( &x.timer );
+	of_unregister_driver( &therm_of_driver );
 
-	write_reg( x.fan, 0x01, x.r1, 1 );
-	write_reg( x.fan, 0x20, x.r20, 1 );
-	write_reg( x.fan, 0x23, x.r23, 1 );
-	write_reg( x.fan, 0x25, x.r25, 1 );
-	write_reg( x.fan, 0x00, x.r0, 1 );
-
-	i2c_del_driver( &g4fan_driver );
+	if( x.of_dev )
+		of_device_unregister( x.of_dev );
 }
 
 module_init(g4fan_init);
 module_exit(g4fan_exit);
 
+MODULE_AUTHOR("Samuel Rydh <samuel@ibrium.se>");
+MODULE_DESCRIPTION("Apple G4 (windtunnel) fan controller");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
--- a/drivers/scsi/scsi_transport_spi.c	Sun Mar 21 00:23:35 2004
+++ b/drivers/scsi/scsi_transport_spi.c	Sun Mar 21 00:23:35 2004
@@ -33,7 +33,7 @@
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_transport_spi.h>
 
-#define SPI_PRINTK(x, l, f, a...)	printk(l "scsi(%d:%d:%d:%d): " f, (x)->host->host_no, (x)->channel, (x)->id, (x)->lun, ##a)
+#define SPI_PRINTK(x, l, f, a...)	printk(l "scsi(%d:%d:%d:%d): " f, (x)->host->host_no, (x)->channel, (x)->id, (x)->lun , ##a)
 
 static void transport_class_release(struct class_device *class_dev);
 
diff -Nru a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
--- a/include/asm-x86_64/acpi.h	Sun Mar 21 00:23:35 2004
+++ b/include/asm-x86_64/acpi.h	Sun Mar 21 00:23:35 2004
@@ -109,6 +109,8 @@
 /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
 #define FIX_ACPI_PAGES 4
 
+extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
+
 #else	/* !CONFIG_ACPI_BOOT */
 #define acpi_lapic 0
 #define acpi_ioapic 0
diff -Nru a/include/asm-x86_64/calling.h b/include/asm-x86_64/calling.h
--- a/include/asm-x86_64/calling.h	Sun Mar 21 00:23:35 2004
+++ b/include/asm-x86_64/calling.h	Sun Mar 21 00:23:35 2004
@@ -35,28 +35,28 @@
 	subq  $9*8+\addskip,%rsp
 	CFI_ADJUST_CFA_OFFSET	9*8+\addskip
 	movq  %rdi,8*8(%rsp) 
-	CFI_OFFSET	rdi,8*8-(9*8+\addskip)
+	CFI_REL_OFFSET	rdi,8*8
 	movq  %rsi,7*8(%rsp) 
-	CFI_OFFSET	rsi,7*8-(9*8+\addskip)
+	CFI_REL_OFFSET	rsi,7*8
 	movq  %rdx,6*8(%rsp)
-	CFI_OFFSET	rdx,6*8-(9*8+\addskip)
+	CFI_REL_OFFSET	rdx,6*8
 	.if \norcx
 	.else
 	movq  %rcx,5*8(%rsp)
-	CFI_OFFSET	rcx,5*8-(9*8+\addskip)
+	CFI_REL_OFFSET	rcx,5*8
 	.endif
 	movq  %rax,4*8(%rsp) 
-	CFI_OFFSET	rax,4*8-(9*8+\addskip)
+	CFI_REL_OFFSET	rax,4*8
 	.if \nor891011
 	.else
 	movq  %r8,3*8(%rsp) 
-	CFI_OFFSET	r8,3*8-(9*8+\addskip)
+	CFI_REL_OFFSET	r8,3*8
 	movq  %r9,2*8(%rsp) 
-	CFI_OFFSET	r9,2*8-(9*8+\addskip)
+	CFI_REL_OFFSET	r9,2*8
 	movq  %r10,1*8(%rsp) 
-	CFI_OFFSET	r10,1*8-(9*8+\addskip)
+	CFI_REL_OFFSET	r10,1*8
 	movq  %r11,(%rsp) 
-	CFI_OFFSET	r11,-(9*8+\addskip)
+	CFI_OFFSET	r11
 	.endif
 	.endm
 
@@ -109,17 +109,17 @@
 	subq $REST_SKIP,%rsp
 	CFI_ADJUST_CFA_OFFSET	REST_SKIP
 	movq %rbx,5*8(%rsp) 
-	CFI_OFFSET	rbx,5*8-(REST_SKIP)
+	CFI_REL_OFFSET	rbx,5*8
 	movq %rbp,4*8(%rsp) 
-	CFI_OFFSET	rbp,4*8-(REST_SKIP)
+	CFI_REL_OFFSET	rbp,4*8
 	movq %r12,3*8(%rsp) 
-	CFI_OFFSET	r12,3*8-(REST_SKIP)
+	CFI_REL_OFFSET	r12,3*8
 	movq %r13,2*8(%rsp) 
-	CFI_OFFSET	r13,2*8-(REST_SKIP)
+	CFI_REL_OFFSET	r13,2*8
 	movq %r14,1*8(%rsp) 
-	CFI_OFFSET	r14,1*8-(REST_SKIP)
+	CFI_REL_OFFSET	r14,1*8
 	movq %r15,(%rsp) 
-	CFI_OFFSET	r15,0*8-(REST_SKIP)
+	CFI_REL_OFFSET	r15,0*8
 	.endm		
 
 	.macro RESTORE_REST
diff -Nru a/include/asm-x86_64/hardirq.h b/include/asm-x86_64/hardirq.h
--- a/include/asm-x86_64/hardirq.h	Sun Mar 21 00:23:35 2004
+++ b/include/asm-x86_64/hardirq.h	Sun Mar 21 00:23:35 2004
@@ -78,6 +78,7 @@
 
 
 #ifdef CONFIG_PREEMPT
+# include <linux/smp_lock.h>
 # define in_atomic()   ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
 # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
 #else
diff -Nru a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h
--- a/include/asm-x86_64/hpet.h	Sun Mar 21 00:23:35 2004
+++ b/include/asm-x86_64/hpet.h	Sun Mar 21 00:23:35 2004
@@ -1,8 +1,6 @@
 #ifndef _ASM_X8664_HPET_H
 #define _ASM_X8664_HPET_H 1
 
-#include <linux/interrupt.h>
-
 /*
  * Documentation on HPET can be found at:
  *      http://www.intel.com/ial/home/sp/pcmmspec.htm
@@ -53,7 +51,6 @@
 extern int hpet_set_periodic_freq(unsigned long freq);
 extern int hpet_rtc_dropped_irq(void);
 extern int hpet_rtc_timer_init(void);
-extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 #endif /* CONFIG_HPET_EMULATE_RTC */
 
 #endif
diff -Nru a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h
--- a/include/asm-x86_64/mpspec.h	Sun Mar 21 00:23:35 2004
+++ b/include/asm-x86_64/mpspec.h	Sun Mar 21 00:23:35 2004
@@ -186,14 +186,14 @@
 extern void mp_register_lapic_address (u64 address);
 
 #ifdef CONFIG_X86_IO_APIC
-extern void mp_register_ioapic (u8 id, u32 address, u32 irq_base);
-extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 global_irq);
+extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);
+extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi);
 extern void mp_config_acpi_legacy_irqs (void);
 extern void mp_parse_prt (void);
 #endif /*CONFIG_X86_IO_APIC*/
 #endif
 
-extern void mp_config_ioapic_for_sci(int irq);
+extern void mp_config_ioapic_for_sci(u32 gsi);
 
 extern int using_apic_timer;