http://linux.bkbits.net/linux-2.5 torvalds@ppc970.osdl.org|ChangeSet|20040623175909|50581 torvalds # This is a BitKeeper generated diff -Nru style patch. # # drivers/scsi/scsiiom.c # 2021/06/14 15:59:00-05:00 g.liakhovetski@gmx.de +1 -1 # tmscsim: 64-bit cleanup # # net/core/dev.c # 2004/06/23 08:05:38-07:00 davem@nuts.davemloft.net +0 -0 # SCCS merged # # net/core/dev.c # 2004/06/22 10:05:28-07:00 torvalds@ppc970.osdl.org +0 -3 # Auto merged # # net/core/dev.c # 2004/06/22 09:28:45-07:00 torvalds@ppc970.osdl.org +3 -4 # Fix C99'ism that breaks older gcc's. # # Also clean it all up - use get_cpu()/put_cpu() instead of # playing games by hand with preemption. # # net/core/dev.c # 2004/06/21 09:32:30-07:00 akm@osdl.org +3 -4 # [NET]: Fix dev_queue_xmit build with older gcc. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/core/dev.c # 2004/06/20 17:35:52-07:00 akepner@sgi.com +40 -15 # [NET]: Lockless loopback patch (version 2). # # net/core/dev.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +81 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/core/dev.c # 2004/06/17 12:11:17-07:00 davem@nuts.davemloft.net +2 -0 # [NET]: In unregister_netdevice(), do synchronize_net() before final dev_put(). # # This way we make sure that all destination cache updates # to remove references to this device are seen by entire # system before final destruction of the device. # # include/linux/sysfs.h # 2004/06/03 10:27:09-07:00 mochel@digitalimplant.org +1 -1 # [sysfs] Add attr_name() macro # # include/linux/sysfs.h # 2004/06/02 17:01:56-07:00 mochel@digitalimplant.org +21 -0 # [Driver Model] Consolidate object attribute definition. # # drivers/base/class.c # 2004/06/10 02:35:56-07:00 greg@kroah.com +18 -18 # Driver Core: more whitespace fixups # # This catches the files I had to do by hand as Dmitry's patch differed from my tree. # # Signed-off-by: Dmitry Torokhov # Signed-off-by: Greg Kroah-Hartman # # drivers/base/class.c # 2004/06/03 10:41:22-07:00 mochel@digitalimplant.org +75 -6 # [Driver Model] Add default attributes for classes class devices. # # ChangeSet # 2004/06/23 10:55:18-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] bug in V-link handling (arch/i386/pci/irq.c) # # Via southbridges use register 0x3c of the on-board devices (USB and # AC97) to control interrupt routing for those. In drivers/pci/quirks.c we # set it correctly (dev->irq & 15). However, in pirq_enable_irq() where the # second half of that stuff lives, we forget to apply the mask. # # That's what causes problems with ioapic on via motherboards in 2.6. # One-liner below ACKed by Alan, verified on via-based boxen here, obviously # doesn't affect non-via ones (we only set interrupt_line_quirk for via # chipsets). # # arch/i386/pci/irq.c # 2004/06/22 12:40:53-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # bug in V-link handling (arch/i386/pci/irq.c) # # ChangeSet # 2004/06/23 08:05:47-07:00 davem@nuts.davemloft.net # Merge # # net/sched/Kconfig # 2004/06/23 08:04:20-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/core/skbuff.c # 2004/06/23 08:04:20-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # include/net/pkt_sched.h # 2004/06/23 08:04:19-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # include/linux/skbuff.h # 2004/06/23 08:04:19-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # include/linux/pkt_sched.h # 2004/06/23 08:04:19-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # include/linux/netdevice.h # 2004/06/23 08:04:19-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/06/23 07:44:19-07:00 yoshfuji@linux-ipv6.org # [NETFILTER]: Fix iptable_raw.c build with older gcc. # # net/ipv4/netfilter/iptable_raw.c # 2004/06/23 07:44:05-07:00 yoshfuji@linux-ipv6.org +11 -5 # [NETFILTER]: Fix iptable_raw.c build with older gcc. # # ChangeSet # 2004/06/22 19:53:47-07:00 jbarnes@engr.sgi.com # [PATCH] ppc32: Support for new Apple laptop models # # This adds sound support for some of the newer PowerBooks. It appears # that this chip supports the AWACS sample rates, but has a snapper-style # mixer. Tested and works on my PowerBook5,4. # # Signed-off-by: Jesse Barnes # Signed-off-by: Linus Torvalds # # ChangeSet # 2004/06/22 19:52:14-07:00 paulus@samba.org # [PATCH] Handle altivec assist exception properly # # This is the PPC64 counterpart of the PPC32 Altivec assist exception # handler that went in recently. # # On PPC64 machines with Altivec (i.e. machines that use the PPC970 chip, # such as the G5 powermac), the altivec floating-point instructions can # operate in two modes: one where denormalized inputs or outputs are # truncated to zero, and one where they aren't. In the latter mode the # processor can take an exception when it encounters denormalized # floating-point inputs or outputs rather than dealing with them in # hardware. # # This patch adds code to deal properly with the exception, by emulating # the instruction that caused the exception. Previously the kernel just # switched the altivec unit into the truncate-to-zero mode, which works # but is a bit gross. Fortunately there are only a limited set of altivec # instructions which can generate the assist exception, so we don't have # to emulate the whole altivec instruction set. # # Note that Altivec is Motorola's name for the PowerPC vector/SIMD # instructions; IBM calls the same thing VMX, and currently only IBM makes # 64-bit PowerPC CPU chips. Nevertheless, I have used the term Altivec in # the PPC64 code for consistency with the PPC32 code. # # Signed-off-by: Paul Mackerras # Signed-off-by: Linus Torvalds # # ChangeSet # 2004/06/22 19:52:02-07:00 benh@kernel.crashing.org # [PATCH] radeonfb: Fix panel detection on some laptops # # The code in radeonfb looking for the BIOS image currently uses the BIOS # ROM if any, and falls back to the RAM image if not found. This is # unfortunatly not correct for a bunch of laptops where the real panel # data are only present in the RAM image. # # This works around this problem by preferring the RAM image on mobility # chipsets. This is definitely not the best workaround, we need some arch # support for linking the RAM image to the PCI ID (preferrably by having # the arch snapshot it during boot, isolating us completely from the # details of where this image is in memory). I'll see how we can get such # an improvement later. # # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Linus Torvalds # # ChangeSet # 2004/06/22 19:51:52-07:00 benh@kernel.crashing.org # [PATCH] ppc32: Support for new Apple laptop models # # This adds support for newer Apple laptop models. It adds the basic # identification for the new motherboards and the cpufreq support for # models using the new 7447A CPU from Motorola. # # This is mostly the work of John Steele Scott with # some bits from Sebastian Henschel and some rework by # myself. Please apply, # # Signed-off-by: John Steele Scott # Signed-off-by: Sebastian Henschel # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Linus Torvalds # # ChangeSet # 2004/06/22 19:51:41-07:00 benh@kernel.crashing.org # [PATCH] ppc32: oprofile support # # This adds basic oprofile support to ppc32. Originally from Anton # Blanchard, I just re-diffed it against current kernels. # # Signed-off-by: Anton Blanchard # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Linus Torvalds # # ChangeSet # 2004/06/22 19:51:29-07:00 benh@kernel.crashing.org # [PATCH] ppc32: Cleanups & warning fixes of traps.c # # This cleans up arch/ppc/kernel/traps.c and vecemu.c to use the same # formatting style for all functions, and fixes 2 warnings in the altivec # floating point emulation code. No functional change. # # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Linus Torvalds # # sound/ppc/pmac.c # 2004/06/22 14:40:39-07:00 jbarnes@engr.sgi.com +7 -0 # ppc32: Support for new Apple laptop models # # arch/ppc64/kernel/vector.S # 2004/06/22 19:52:07-07:00 paulus@samba.org +172 -0 # Handle altivec assist exception properly # # include/asm-ppc64/system.h # 2004/06/22 19:52:07-07:00 paulus@samba.org +1 -0 # Handle altivec assist exception properly # # arch/ppc64/kernel/vector.S # 2004/06/22 19:52:07-07:00 paulus@samba.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc64/kernel/vector.S # # arch/ppc64/kernel/vecemu.c # 2004/06/22 19:52:07-07:00 paulus@samba.org +346 -0 # Handle altivec assist exception properly # # arch/ppc64/kernel/traps.c # 2004/06/22 16:05:33-07:00 paulus@samba.org +32 -2 # Handle altivec assist exception properly # # arch/ppc64/kernel/Makefile # 2004/06/22 19:52:07-07:00 paulus@samba.org +2 -0 # Handle altivec assist exception properly # # arch/ppc64/kernel/vecemu.c # 2004/06/22 19:52:07-07:00 paulus@samba.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc64/kernel/vecemu.c # # drivers/video/aty/radeon_base.c # 2004/06/22 13:11:16-07:00 benh@kernel.crashing.org +16 -2 # radeonfb: Fix panel detection on some laptops # # include/asm-ppc/uninorth.h # 2004/06/22 13:04:07-07:00 benh@kernel.crashing.org +6 -0 # ppc32: Support for new Apple laptop models # # include/asm-ppc/reg.h # 2004/06/22 13:04:07-07:00 benh@kernel.crashing.org +1 -0 # ppc32: Support for new Apple laptop models # # include/asm-ppc/pmac_feature.h # 2004/06/22 13:04:07-07:00 benh@kernel.crashing.org +6 -0 # ppc32: Support for new Apple laptop models # # arch/ppc/platforms/pmac_feature.c # 2004/06/22 13:04:07-07:00 benh@kernel.crashing.org +32 -0 # ppc32: Support for new Apple laptop models # # arch/ppc/platforms/pmac_cpufreq.c # 2004/06/22 13:04:07-07:00 benh@kernel.crashing.org +193 -118 # ppc32: Support for new Apple laptop models # # arch/ppc/kernel/misc.S # 2004/06/22 13:04:07-07:00 benh@kernel.crashing.org +18 -0 # ppc32: Support for new Apple laptop models # # arch/ppc/oprofile/init.c # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +23 -0 # ppc32: oprofile support # # arch/ppc/oprofile/Makefile # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +9 -0 # ppc32: oprofile support # # arch/ppc/oprofile/Kconfig # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +23 -0 # ppc32: oprofile support # # arch/ppc/oprofile/init.c # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/oprofile/init.c # # arch/ppc/oprofile/Makefile # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/oprofile/Makefile # # arch/ppc/oprofile/Kconfig # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/oprofile/Kconfig # # arch/ppc/kernel/time.c # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +15 -7 # ppc32: oprofile support # # arch/ppc/Makefile # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +2 -0 # ppc32: oprofile support # # arch/ppc/Kconfig # 2004/06/22 12:05:08-07:00 benh@kernel.crashing.org +1 -0 # ppc32: oprofile support # # include/asm-ppc/processor.h # 2004/06/22 12:04:49-07:00 benh@kernel.crashing.org +2 -0 # ppc32: Cleanups & warning fixes of traps.c # # arch/ppc/kernel/vecemu.c # 2004/06/22 12:04:49-07:00 benh@kernel.crashing.org +1 -2 # ppc32: Cleanups & warning fixes of traps.c # # arch/ppc/kernel/traps.c # 2004/06/22 12:04:49-07:00 benh@kernel.crashing.org +18 -35 # ppc32: Cleanups & warning fixes of traps.c # # ChangeSet # 2004/06/22 20:42:16-04:00 jgarzik@pobox.com # [libata sata_sil] Re-fix mod15write bug # # Certain early SATA drives have problems with write requests whose # length satisfy the equation "sectors % 15 == 1", on the SiI 3112. # Other drives, and other SiI controllers, are not affected. # # The fix for this problem is to avoid such requests, in one of three # ways, for the affect drive+controller combos: # 1) Limit all writes to 15 sectors # 2) Use block layer features to avoid creating requests whose # length satisfies the above equation. # 3) When a request satisfies the above equation, split the request # into two writes, neither of which satisfies the equation. # # I chose fix #1, the most simple to implement. After discussion with # Silicon Image and others regarding the impact of this fix, I have # decided to remain with fix #1, and will not be implementing a # "better fix". This means that the affected SATA drives will see # decreased performance, but set of affected drives is small and will # never grow larger. # # Further, the complexity of implementing solution #2 or # solution #3 is rather large. # # When implementing lba48 'large request' support, I unintentionally # broke the fix for these affected drives. Kudos to Ricky Beam for # noticing this. # # This change restores the fix, by adding a flag ATA_DFLAG_LOCK_SECTORS # to indicate that the max_sectors value set by the low-level driver # should never be changed. # # include/linux/libata.h # 2004/06/22 20:42:10-04:00 jgarzik@pobox.com +1 -0 # [libata sata_sil] Re-fix mod15write bug # # Certain early SATA drives have problems with write requests whose # length satisfy the equation "sectors % 15 == 1", on the SiI 3112. # Other drives, and other SiI controllers, are not affected. # # The fix for this problem is to avoid such requests, in one of three # ways, for the affect drive+controller combos: # 1) Limit all writes to 15 sectors # 2) Use block layer features to avoid creating requests whose # length satisfies the above equation. # 3) When a request satisfies the above equation, split the request # into two writes, neither of which satisfies the equation. # # I chose fix #1, the most simple to implement. After discussion with # Silicon Image and others regarding the impact of this fix, I have # decided to remain with fix #1, and will not be implementing a # "better fix". This means that the affected SATA drives will see # decreased performance, but set of affected drives is small and will # never grow larger. # # Further, the complexity of implementing solution #2 or # solution #3 is rather large. # # When implementing lba48 'large request' support, I unintentionally # broke the fix for these affected drives. Kudos to Ricky Beam for # noticing this. # # This change restores the fix, by adding a flag ATA_DFLAG_LOCK_SECTORS # to indicate that the max_sectors value set by the low-level driver # should never be changed. # # drivers/scsi/sata_sil.c # 2004/06/22 20:42:10-04:00 jgarzik@pobox.com +1 -0 # [libata sata_sil] Re-fix mod15write bug # # Certain early SATA drives have problems with write requests whose # length satisfy the equation "sectors % 15 == 1", on the SiI 3112. # Other drives, and other SiI controllers, are not affected. # # The fix for this problem is to avoid such requests, in one of three # ways, for the affect drive+controller combos: # 1) Limit all writes to 15 sectors # 2) Use block layer features to avoid creating requests whose # length satisfies the above equation. # 3) When a request satisfies the above equation, split the request # into two writes, neither of which satisfies the equation. # # I chose fix #1, the most simple to implement. After discussion with # Silicon Image and others regarding the impact of this fix, I have # decided to remain with fix #1, and will not be implementing a # "better fix". This means that the affected SATA drives will see # decreased performance, but set of affected drives is small and will # never grow larger. # # Further, the complexity of implementing solution #2 or # solution #3 is rather large. # # When implementing lba48 'large request' support, I unintentionally # broke the fix for these affected drives. Kudos to Ricky Beam for # noticing this. # # This change restores the fix, by adding a flag ATA_DFLAG_LOCK_SECTORS # to indicate that the max_sectors value set by the low-level driver # should never be changed. # # drivers/scsi/libata-scsi.c # 2004/06/22 20:42:10-04:00 jgarzik@pobox.com +2 -1 # [libata sata_sil] Re-fix mod15write bug # # Certain early SATA drives have problems with write requests whose # length satisfy the equation "sectors % 15 == 1", on the SiI 3112. # Other drives, and other SiI controllers, are not affected. # # The fix for this problem is to avoid such requests, in one of three # ways, for the affect drive+controller combos: # 1) Limit all writes to 15 sectors # 2) Use block layer features to avoid creating requests whose # length satisfies the above equation. # 3) When a request satisfies the above equation, split the request # into two writes, neither of which satisfies the equation. # # I chose fix #1, the most simple to implement. After discussion with # Silicon Image and others regarding the impact of this fix, I have # decided to remain with fix #1, and will not be implementing a # "better fix". This means that the affected SATA drives will see # decreased performance, but set of affected drives is small and will # never grow larger. # # Further, the complexity of implementing solution #2 or # solution #3 is rather large. # # When implementing lba48 'large request' support, I unintentionally # broke the fix for these affected drives. Kudos to Ricky Beam for # noticing this. # # This change restores the fix, by adding a flag ATA_DFLAG_LOCK_SECTORS # to indicate that the max_sectors value set by the low-level driver # should never be changed. # # ChangeSet # 2004/06/23 01:07:38+01:00 dvrabel@com.rmk.(none) # [ARM PATCH] 1940/1: asm-arm/checksum.h - missing include # # Patch from David Vrabel # # Missing include (cf. include/asm-i386/checksum.h) in include/asm-arm/checksum.h. # # include/asm-arm/checksum.h # 2004/06/21 15:17:39+01:00 dvrabel@com.rmk.(none) +2 -0 # [PATCH] 1940/1: asm-arm/checksum.h - missing include # # ChangeSet # 2004/06/23 01:03:51+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 1939/1: SA1100 watchdog driver also works on PXA2xx # # Patch from Ian Campbell # # The SA1100 watchdog driver also works fine on the PXA2xx. Tested on # a PXA255 based platform. # # drivers/char/watchdog/sa1100_wdt.c # 2004/06/23 01:00:00+01:00 icampbell@com.rmk.(none) +4 -4 # [PATCH] 1939/1: SA1100 watchdog driver also works on PXA2xx # # drivers/char/watchdog/Kconfig # 2004/06/23 01:00:00+01:00 icampbell@com.rmk.(none) +6 -5 # [PATCH] 1939/1: SA1100 watchdog driver also works on PXA2xx # # ChangeSet # 2004/06/23 00:59:35+01:00 jelenz@edu.rmk.(none) # [ARM PATCH] 1936/1: Update collie fb entries to use new style initializers # # Patch from John Lenz # # Switches the collie framebuffer mach_info structure to use # the new initializers. # # Signed-off-by: John Lenz # # drivers/video/sa1100fb.c # 2004/06/22 01:00:00+01:00 jelenz@edu.rmk.(none) +8 -8 # [PATCH] 1936/1: Update collie fb entries to use new style initializers # # ChangeSet # 2004/06/23 00:55:42+01:00 jelenz@edu.rmk.(none) # [ARM PATCH] 1935/1: Fix bug in sa1111 driver # # Patch from John Lenz # # The __sa1111_probe function is declared __init, and it is called from # the sa1111_probe function, which is not declared __init. # # Signed-off-by: John Lenz # # arch/arm/common/sa1111.c # 2004/06/22 01:00:00+01:00 jelenz@edu.rmk.(none) +1 -1 # [PATCH] 1935/1: Fix bug in sa1111 driver # # ChangeSet # 2004/06/23 00:48:22+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 1933/1: Convert PXA serial driver to device model and implement suspend and resume # # Patch from Ian Campbell # # Patch 1848/1 removed the hack for preserving FFUART over sleep. # # This patch adds back that support in the correct place by converting # the PXA serial driver to use the driver model and hooking up the # suspend and resume methods. # # drivers/serial/pxa.c # 2004/06/22 01:00:00+01:00 icampbell@com.rmk.(none) +62 -11 # [PATCH] 1933/1: Convert PXA serial driver to device model and implement suspend and resume # # arch/arm/mach-pxa/generic.c # 2004/06/22 01:00:00+01:00 icampbell@com.rmk.(none) +16 -0 # [PATCH] 1933/1: Convert PXA serial driver to device model and implement suspend and resume # # ChangeSet # 2004/06/23 00:44:18+01:00 elf@com.rmk.(none) # [ARM PATCH] 1913/1: lh7a40x #3 (1/2) serial # # Patch from Marc Singer # # Serial console and port driver for the LH7a40x CPUs. The only change # made since the last patch was to change the PORT_ID (again). This # patch superceeds two serial driver patches. # # # include/linux/serial_core.h # 2004/06/05 11:30:48+01:00 elf@com.rmk.(none) +3 -0 # [PATCH] 1913/1: lh7a40x #3 (1/2) serial # # drivers/serial/Makefile # 2004/06/05 11:30:48+01:00 elf@com.rmk.(none) +1 -0 # [PATCH] 1913/1: lh7a40x #3 (1/2) serial # # drivers/serial/Kconfig # 2004/06/05 11:30:48+01:00 elf@com.rmk.(none) +23 -0 # [PATCH] 1913/1: lh7a40x #3 (1/2) serial # # drivers/serial/serial_lh7a40x.c # 2004/06/05 11:30:48+01:00 elf@com.rmk.(none) +708 -0 # [PATCH] 1913/1: lh7a40x #3 (1/2) serial # # drivers/serial/serial_lh7a40x.c # 2004/06/05 11:30:48+01:00 elf@com.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-serial/drivers/serial/serial_lh7a40x.c # # ChangeSet # 2004/06/22 23:54:18+01:00 rmk@flint.arm.linux.org.uk # Merge bk://dsaxena.bkbits.net/linux-2.6-for-rmk # into flint.arm.linux.org.uk:/usr/src/bk/linux-2.6-rmk # # arch/arm/mach-integrator/integrator_cp.c # 2004/06/22 23:53:14+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Auto merged # # ChangeSet # 2004/06/22 14:07:48-07:00 akepner@sgi.com # [NET]: In loopback, make get_stats() get correct per-cpu stats. # # Signed-off-by: Arthur Kepner # Signed-off-by: David S. Miller # # drivers/net/loopback.c # 2004/06/22 14:07:33-07:00 akepner@sgi.com +1 -2 # [NET]: In loopback, make get_stats() get correct per-cpu stats. # # Signed-off-by: Arthur Kepner # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/22 13:54:22-07:00 davem@nuts.davemloft.net # [IPSEC]: In ESP, do not put scatterlist array on stack. # # Put it in per-esp data instead. Noticed by Linus. # # Signed-off-by: David S. Miller # # net/ipv6/esp6.c # 2004/06/22 13:53:57-07:00 davem@nuts.davemloft.net +6 -10 # [IPSEC]: In ESP, do not put scatterlist array on stack. # # Put it in per-esp data instead. Noticed by Linus. # # Signed-off-by: David S. Miller # # net/ipv4/esp4.c # 2004/06/22 13:53:57-07:00 davem@nuts.davemloft.net +6 -10 # [IPSEC]: In ESP, do not put scatterlist array on stack. # # Put it in per-esp data instead. Noticed by Linus. # # Signed-off-by: David S. Miller # # include/net/esp.h # 2004/06/22 13:53:57-07:00 davem@nuts.davemloft.net +5 -0 # [IPSEC]: In ESP, do not put scatterlist array on stack. # # Put it in per-esp data instead. Noticed by Linus. # # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/22 12:59:56-07:00 davem@nuts.davemloft.net # Merge bk://kernel.bkbits.net/acme/net-2.6 # into nuts.davemloft.net:/disk1/BK/net-2.6 # # net/ipv4/tcp_input.c # 2004/06/22 12:59:47-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv4/tcp.c # 2004/06/22 12:59:46-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/06/22 10:20:50-07:00 torvalds@ppc970.osdl.org # Merge bk://gkernel.bkbits.net/libata-2.6 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # drivers/scsi/Makefile # 2004/06/22 10:20:47-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/Kconfig # 2004/06/22 10:20:47-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/ide/Kconfig # 2004/06/22 10:20:47-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2004/06/22 10:18:32-07:00 torvalds@ppc970.osdl.org # sparse: clean up warning in swapfile.c # # mm/swapfile.c # 2004/06/22 10:18:26-07:00 torvalds@ppc970.osdl.org +1 -1 # sparse: clean up warning in swapfile.c # # ChangeSet # 2004/06/22 10:05:31-07:00 torvalds@ppc970.osdl.org # Merge bk://kernel.bkbits.net/davem/net-2.6 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # ChangeSet # 2004/06/22 13:02:35-04:00 jgarzik@pobox.com # [blk carmel] s/carmel/sx8/ in the driver itself # # drivers/block/sx8.c # 2004/06/22 13:02:29-04:00 jgarzik@pobox.com +3 -3 # [blk carmel] s/carmel/sx8/ in the driver itself # # ChangeSet # 2004/06/22 09:28:50-07:00 torvalds@ppc970.osdl.org # Fix C99'ism that breaks older gcc's. # # Also clean it all up - use get_cpu()/put_cpu() instead of # playing games by hand with preemption. # # ChangeSet # 2004/06/22 09:25:34-07:00 khali@linux-fr.org # [PATCH] I2C: Drop out-of-date code in w83781d and w83627hf # # Here is a simple patch which drops some out-of-date code in the w83781d # and w83627hf i2c chip drivers. These bits are left over from the times # when chip drivers were setting default limits at init. # # # Signed-off-by: Jean Delvare # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/w83781d.c # 2004/06/19 11:22:05-07:00 khali@linux-fr.org +2 -9 # I2C: Drop out-of-date code in w83781d and w83627hf # # drivers/i2c/chips/w83627hf.c # 2004/06/19 11:21:06-07:00 khali@linux-fr.org +1 -4 # I2C: Drop out-of-date code in w83781d and w83627hf # # ChangeSet # 2004/06/22 09:20:30-07:00 greg@kroah.com # [PATCH] USB: sparse fixups for devio.c # # drivers/usb/core/devio.c # 2004/06/22 02:09:36-07:00 greg@kroah.com +10 -9 # USB: sparse fixups for devio.c # # ChangeSet # 2004/06/22 08:27:43-07:00 rddunlap@osdl.org # [PATCH] sparse: make sys_quotactl() prototype match function # # Al missed this one in his sparse fixes # # Signed-off-by: Randy Dunlap # Signed-off-by: Linus Torvalds # # include/linux/syscalls.h # 2004/06/21 21:31:11-07:00 rddunlap@osdl.org +1 -1 # sparse: make sys_quotactl() prototype match function # # ChangeSet # 2004/06/22 08:27:32-07:00 rddunlap@osdl.org # [PATCH] Fix sparse warning in drivers/block/ll_rw_blk.c # # From: Mika Kukkonen # Signed-off-by: Randy Dunlap # Signed-off-by: Linus Torvalds # # drivers/block/ll_rw_blk.c # 2004/06/21 19:20:21-07:00 rddunlap@osdl.org +1 -1 # Fix sparse warning in drivers/block/ll_rw_blk.c # # ChangeSet # 2004/06/22 08:27:21-07:00 rddunlap@osdl.org # [PATCH] Fix sparse warning in fs/proc/base.c # # From: Mika Kukkonen # Signed-off-by: Randy Dunlap # Signed-off-by: Linus Torvalds # # fs/proc/base.c # 2004/06/19 22:42:40-07:00 rddunlap@osdl.org +6 -3 # Fix sparse warning in fs/proc/base.c # # ChangeSet # 2004/06/22 08:27:10-07:00 rddunlap@osdl.org # [PATCH] Fix sparse warning in fs/devfs/base.c # # From: Mika Kukkonen # Signed-off-by: Randy Dunlap # Signed-off-by: Linus Torvalds # # fs/devfs/base.c # 2004/06/19 22:30:39-07:00 rddunlap@osdl.org +2 -1 # Fix sparse warning in fs/devfs/base.c # # ChangeSet # 2004/06/22 16:23:52+01:00 rmk@flint.arm.linux.org.uk # [ARM] Correct MMCI clock rate on Integrator/CP. # # arch/arm/mach-integrator/integrator_cp.c # 2004/06/22 16:21:27+01:00 rmk@flint.arm.linux.org.uk +2 -2 # MMCI clock is 14.7456MHz not 33MHz. # # ChangeSet # 2004/06/22 14:55:39+01:00 rmk@flint.arm.linux.org.uk # [ARM] Move cpu_switch_mm() and cpu_get_pgd() to asm/proc-fns.h # # include/asm-arm/proc-fns.h # 2004/06/22 14:53:15+01:00 rmk@flint.arm.linux.org.uk +16 -0 # Move cpu_switch_mm() and cpu_get_pgd() to asm/proc-fns.h # # include/asm-arm/cpu-single.h # 2004/06/22 14:53:15+01:00 rmk@flint.arm.linux.org.uk +2 -19 # Move cpu_switch_mm() and cpu_get_pgd() to asm/proc-fns.h # # include/asm-arm/cpu-multi32.h # 2004/06/22 14:53:15+01:00 rmk@flint.arm.linux.org.uk +1 -16 # Move cpu_switch_mm() and cpu_get_pgd() to asm/proc-fns.h # # ChangeSet # 2004/06/22 03:52:32-03:00 acme@conectiva.com.br # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_timer.c # 2004/06/22 03:52:20-03:00 acme@conectiva.com.br +2 -2 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_output.c # 2004/06/22 03:52:20-03:00 acme@conectiva.com.br +19 -17 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_minisocks.c # 2004/06/22 03:52:19-03:00 acme@conectiva.com.br +1 -1 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_input.c # 2004/06/22 03:52:19-03:00 acme@conectiva.com.br +12 -13 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/22 03:52:19-03:00 acme@conectiva.com.br +10 -10 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/sock.c # 2004/06/22 03:52:19-03:00 acme@conectiva.com.br +2 -0 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/tcp.h # 2004/06/22 03:52:19-03:00 acme@conectiva.com.br +5 -12 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/22 03:52:19-03:00 acme@conectiva.com.br +8 -0 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/linux/tcp.h # 2004/06/22 03:52:19-03:00 acme@conectiva.com.br +0 -1 # [NET] move send_head from tcp private area to struct sock # # The poor cousins also need this, LLC will be the first to use it. # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/22 02:12:28-04:00 jgarzik@pobox.com # [libata ata_piix] combined mode bug fix; improved ICH6 support # # drivers/scsi/ata_piix.c # 2004/06/22 02:12:22-04:00 jgarzik@pobox.com +14 -11 # [libata ata_piix] combined mode bug fix; improved ICH6 support # # ChangeSet # 2004/06/22 00:54:50-04:00 jgarzik@pobox.com # [libata] fix build error, minor cleanups # # include/linux/libata.h # 2004/06/22 00:54:44-04:00 jgarzik@pobox.com +0 -5 # [libata] fix build error, minor cleanups # # drivers/scsi/libata-core.c # 2004/06/22 00:54:44-04:00 jgarzik@pobox.com +2 -3 # [libata] fix build error, minor cleanups # # ChangeSet # 2004/06/21 21:39:50-07:00 torvalds@ppc970.osdl.org # Fix up permissions of some files that were not readable # by "other". The normal permissions for the kernel tree # should be -rw-r--r--. # # Documentation/scsi/ChangeLog.megaraid # 2004/06/21 21:36:23-07:00 torvalds@ppc970.osdl.org +0 -0 # Change mode to -rw-r--r-- # # Documentation/networking/netif-msg.txt # 2004/06/21 21:36:17-07:00 torvalds@ppc970.osdl.org +0 -0 # Change mode to -rw-r--r-- # # ChangeSet # 2004/06/22 00:36:09-04:00 jgarzik@pobox.com # [libata] move some code around # # Split ata_eng_timeout into the main part (ata_qc_timeout) # and the part called by the SCSI layer (ata_eng_timeout). # # Zero behavior changes. # # drivers/input/joystick/grip_mp.c # 2004/06/21 21:36:04-07:00 torvalds@ppc970.osdl.org +0 -0 # Change mode to -rw-r--r-- # # drivers/scsi/libata-core.c # 2004/06/22 00:36:02-04:00 jgarzik@pobox.com +42 -12 # [libata] move some code around # # Split ata_eng_timeout into the main part (ata_qc_timeout) # and the part called by the SCSI layer (ata_eng_timeout). # # Zero behavior changes. # # drivers/char/drm/drm_irq.h # 2004/06/21 21:35:57-07:00 torvalds@ppc970.osdl.org +0 -0 # Change mode to -rw-r--r-- # # drivers/char/agp/isoch.c # 2004/06/21 21:34:47-07:00 torvalds@ppc970.osdl.org +0 -0 # Change mode to -rw-r--r-- # # ChangeSet # 2004/06/22 01:20:08-03:00 acme@conectiva.com.br # [NET] generalise tcp_moderate_sndbuf # # Renaming it to sk_stream_moderate_sndbuf, further patches will move # all the tcp memory pressure handling support into net/core/stream.c # to make them usable by the poor cousins, starting with LLC. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/22 01:19:56-03:00 acme@conectiva.com.br +1 -1 # [NET] generalise tcp_moderate_sndbuf # # Renaming it to sk_stream_moderate_sndbuf, further patches will move # all the tcp memory pressure handling support into net/core/stream.c # to make them usable by the poor cousins, starting with LLC. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/tcp.h # 2004/06/22 01:19:56-03:00 acme@conectiva.com.br +2 -10 # [NET] generalise tcp_moderate_sndbuf # # Renaming it to sk_stream_moderate_sndbuf, further patches will move # all the tcp memory pressure handling support into net/core/stream.c # to make them usable by the poor cousins, starting with LLC. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/22 01:19:56-03:00 acme@conectiva.com.br +8 -0 # [NET] generalise tcp_moderate_sndbuf # # Renaming it to sk_stream_moderate_sndbuf, further patches will move # all the tcp memory pressure handling support into net/core/stream.c # to make them usable by the poor cousins, starting with LLC. # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/21 23:47:16-04:00 bunk@fs.tum.de # [PATCH] 2.6.7-mm1: drivers/scsi/hosts.h -> scsi/scsi_host.h # # On Sun, Jun 20, 2004 at 05:46:32PM -0700, Andrew Morton wrote: # >... # > All 226 patches: # >... # > bk-libata.patch # >... # # drivers/scsi/hosts.h is obsolete, use scsi/scsi_host.h. # # Please apply # Adrian # # drivers/scsi/sata_nv.c # 2004/06/20 21:51:17-04:00 bunk@fs.tum.de +1 -1 # 2.6.7-mm1: drivers/scsi/hosts.h -> scsi/scsi_host.h # # ChangeSet # 2004/06/22 00:46:47-03:00 acme@conectiva.com.br # [NET] generalise tcp_free_skb, renaming it to sk_stream_free_skb # # Will be used by the poor cousins # # Signed-of-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_output.c # 2004/06/22 00:46:35-03:00 acme@conectiva.com.br +2 -2 # [NET] generalise tcp_free_skb, renaming it to sk_stream_free_skb # # Will be used by the poor cousins # # Signed-of-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_input.c # 2004/06/22 00:46:35-03:00 acme@conectiva.com.br +4 -6 # [NET] generalise tcp_free_skb, renaming it to sk_stream_free_skb # # Will be used by the poor cousins # # Signed-of-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/22 00:46:35-03:00 acme@conectiva.com.br +1 -1 # [NET] generalise tcp_free_skb, renaming it to sk_stream_free_skb # # Will be used by the poor cousins # # Signed-of-by: Arnaldo Carvalho de Melo # # include/net/tcp.h # 2004/06/22 00:46:35-03:00 acme@conectiva.com.br +1 -9 # [NET] generalise tcp_free_skb, renaming it to sk_stream_free_skb # # Will be used by the poor cousins # # Signed-of-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/22 00:46:35-03:00 acme@conectiva.com.br +11 -0 # [NET] generalise tcp_free_skb, renaming it to sk_stream_free_skb # # Will be used by the poor cousins # # Signed-of-by: Arnaldo Carvalho de Melo # # include/linux/tcp.h # 2004/06/22 00:46:35-03:00 acme@conectiva.com.br +1 -1 # [NET] generalise tcp_free_skb, renaming it to sk_stream_free_skb # # Will be used by the poor cousins # # Signed-of-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/21 20:26:23-07:00 viro@www.linux.org.uk # [PATCH] sparse: the rest of ieee1394 annotation # # drivers/ieee1394/video1394.c # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +10 -9 # sparse: the rest of ieee1394 annotation # # drivers/ieee1394/dv1394.c # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +6 -5 # sparse: the rest of ieee1394 annotation # # drivers/ieee1394/amdtp.c # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +2 -2 # sparse: the rest of ieee1394 annotation # # ChangeSet # 2004/06/21 20:26:12-07:00 viro@www.linux.org.uk # [PATCH] sparse: hd.c annotation # # drivers/firmware/efivars.c # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +1 -1 # sparse: hd.c annotation # # ChangeSet # 2004/06/21 20:26:01-07:00 viro@www.linux.org.uk # [PATCH] sparse: quota annotation # # fs/quota.c # 2004/06/21 07:11:50-07:00 viro@www.linux.org.uk +2 -2 # sparse: quota annotation # # ChangeSet # 2004/06/21 20:25:50-07:00 viro@www.linux.org.uk # [PATCH] sparse: sock_fprog sanitized # # sock_fprog instances that had kernel pointer in ->filter (both of them - # in ppp_generic and isdn_ppp) replaced with explicit pairs len + kernel # pointer. Copying of userland sock_fprog (with its __user ->filter) # cleaned up and sanitized. # # Trivial annotation done in the rest of ->ioctl() in ppp_generic and # isdn_ppp. # # include/linux/isdn_ppp.h # 2004/06/21 07:11:52-07:00 viro@www.linux.org.uk +3 -2 # sparse: sock_fprog sanitized # # drivers/net/ppp_generic.c # 2004/06/21 07:11:52-07:00 viro@www.linux.org.uk +100 -70 # sparse: sock_fprog sanitized # # drivers/isdn/i4l/isdn_ppp.h # 2004/06/21 07:11:52-07:00 viro@www.linux.org.uk +2 -2 # sparse: sock_fprog sanitized # # drivers/isdn/i4l/isdn_ppp.c # 2004/06/21 07:11:52-07:00 viro@www.linux.org.uk +103 -82 # sparse: sock_fprog sanitized # # ChangeSet # 2004/06/21 20:25:39-07:00 viro@www.linux.org.uk # [PATCH] sparse: raw1394 annotation # # drivers/ieee1394/raw1394.h # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +5 -5 # sparse: raw1394 annotation # # drivers/ieee1394/raw1394.c # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +41 -48 # sparse: raw1394 annotation # # drivers/ieee1394/raw1394-private.h # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +2 -2 # sparse: raw1394 annotation # # ChangeSet # 2004/06/21 20:25:28-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/net/wan annotation # # include/linux/if.h # 2004/06/21 07:22:34-07:00 viro@www.linux.org.uk +7 -7 # sparse: drivers/net/wan annotation # # drivers/net/wan/x25_asy.c # 2004/06/21 07:22:00-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/pci200syn.c # 2004/06/21 07:21:53-07:00 viro@www.linux.org.uk +2 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/n2.c # 2004/06/21 07:21:44-07:00 viro@www.linux.org.uk +2 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/lmc/lmc_ioctl.h # 2004/06/21 07:22:15-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/net/wan annotation # # drivers/net/wan/hdlc_raw_eth.c # 2004/06/21 07:21:35-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/hdlc_raw.c # 2004/06/21 07:21:19-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/hdlc_fr.c # 2004/06/21 07:21:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/hdlc_cisco.c # 2004/06/21 07:21:08-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/dscc4.c # 2004/06/21 07:20:51-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/cosa.h # 2004/06/21 07:20:41-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/net/wan annotation # # drivers/net/wan/cosa.c # 2004/06/21 07:20:40-07:00 viro@www.linux.org.uk +21 -20 # sparse: drivers/net/wan annotation # # drivers/net/wan/c101.c # 2004/06/21 07:20:33-07:00 viro@www.linux.org.uk +2 -1 # sparse: drivers/net/wan annotation # # ChangeSet # 2004/06/21 20:25:16-07:00 viro@www.linux.org.uk # [PATCH] sparse: efivars.c initializer fix # # drivers/ide/legacy/hd.c # 2004/06/21 07:11:51-07:00 viro@www.linux.org.uk +1 -1 # sparse: efivars.c initializer fix # # ChangeSet # 2004/06/21 20:25:05-07:00 viro@www.linux.org.uk # [PATCH] sparse: zlib stray extern removal # # lib/zlib_deflate/deflate.c # 2004/06/21 07:11:50-07:00 viro@www.linux.org.uk +1 -1 # sparse: zlib stray extern removal # # ChangeSet # 2004/06/21 20:24:54-07:00 viro@www.linux.org.uk # [PATCH] sparse: ncpfs/ioctl.c annotation # # include/linux/ncp_fs.h # 2004/06/21 07:11:50-07:00 viro@www.linux.org.uk +3 -3 # sparse: ncpfs/ioctl.c annotation # # fs/ncpfs/ioctl.c # 2004/06/21 07:11:50-07:00 viro@www.linux.org.uk +37 -45 # sparse: ncpfs/ioctl.c annotation # # ChangeSet # 2004/06/21 20:24:44-07:00 viro@www.linux.org.uk # [PATCH] ibmtr missing include # # drivers/net/tokenring/ibmtr.c # 2004/06/21 07:19:31-07:00 viro@www.linux.org.uk +1 -0 # ibmtr missing include # # ChangeSet # 2004/06/21 19:56:37-07:00 torvalds@ppc970.osdl.org # Merge bk://linux-acpi.bkbits.net/linux-acpi-release-2.6.7 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # arch/i386/kernel/mpparse.c # 2004/06/21 19:56:34-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2004/06/21 23:01:24-03:00 acme@conectiva.com.br # [NET] generalise tcp_error, renaming it to sk_stream_error # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/21 23:01:13-03:00 acme@conectiva.com.br +2 -11 # [NET] generalise tcp_error, renaming it to sk_stream_error # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/stream.c # 2004/06/21 23:01:13-03:00 acme@conectiva.com.br +11 -0 # [NET] generalise tcp_error, renaming it to sk_stream_error # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/21 23:01:13-03:00 acme@conectiva.com.br +1 -0 # [NET] generalise tcp_error, renaming it to sk_stream_error # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/21 20:59:09-04:00 len.brown@intel.com # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.7 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.7 # # arch/x86_64/kernel/mpparse.c # 2004/06/21 20:59:06-04:00 len.brown@intel.com +0 -0 # Auto merged # # arch/i386/kernel/mpparse.c # 2004/06/21 20:59:06-04:00 len.brown@intel.com +0 -0 # Auto merged # # ChangeSet # 2004/06/21 20:53:04-04:00 len.brown@intel.com # [ACPI] re-factor previous mpparse IRQ override fix (Linus Torvalds) # Reflect that only the dstirq depends on the dstapic. # # arch/x86_64/kernel/mpparse.c # 2004/06/21 20:52:49-04:00 len.brown@intel.com +13 -7 # re-factor previous patch to reflect that only the dstirq # depends on the dstapic # # arch/i386/kernel/mpparse.c # 2004/06/21 20:52:49-04:00 len.brown@intel.com +16 -8 # re-factor previous patch to reflect that only the dstirq # depends on the dstapic # # ChangeSet # 2004/06/21 17:04:23-07:00 greg@kroah.com # merge fixups. # # drivers/scsi/scsi_debug.c # 2004/06/21 17:04:10-07:00 greg@kroah.com +1 -1 # merge fixups. # # ChangeSet # 2004/06/21 16:04:04-07:00 hadi@zynx.com # [PKT_SCHED]: C99'ify act_police_ops. # # net/sched/police.c # 2004/06/21 16:03:41-07:00 hadi@zynx.com +13 -13 # [PKT_SCHED]: C99'ify act_police_ops. # # ChangeSet # 2004/06/21 15:14:21-07:00 greg@kroah.com # merge # # drivers/scsi/scsi_debug.c # 2004/06/21 15:14:13-07:00 greg@kroah.com +2 -7 # merge # # ChangeSet # 2004/06/21 14:39:33-07:00 kaber@trash.net # [NETFILTER]: ip_table_raw C99 initialization # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/iptable_raw.c # 2004/06/21 14:39:19-07:00 kaber@trash.net +58 -37 # [NETFILTER]: ip_table_raw C99 initialization # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:38:44-07:00 kaber@trash.net # [NETFILTER]: Add realm match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/sched/Kconfig # 2004/06/21 14:38:11-07:00 kaber@trash.net +2 -2 # [NETFILTER]: Add realm match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/Makefile # 2004/06/21 14:38:11-07:00 kaber@trash.net +1 -0 # [NETFILTER]: Add realm match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/Kconfig # 2004/06/21 14:38:11-07:00 kaber@trash.net +14 -0 # [NETFILTER]: Add realm match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_realm.c # 2004/06/21 14:37:59-07:00 kaber@trash.net +76 -0 # [NETFILTER]: Add realm match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_realm.c # 2004/06/21 14:37:59-07:00 kaber@trash.net +0 -0 # BitKeeper file /disk1/BK/nf-2.6/net/ipv4/netfilter/ipt_realm.c # # include/linux/netfilter_ipv4/ipt_realm.h # 2004/06/21 14:37:58-07:00 kaber@trash.net +10 -0 # [NETFILTER]: Add realm match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # include/linux/netfilter_ipv4/ipt_realm.h # 2004/06/21 14:37:58-07:00 kaber@trash.net +0 -0 # BitKeeper file /disk1/BK/nf-2.6/include/linux/netfilter_ipv4/ipt_realm.h # # kernel/module.c # 2004/06/21 14:37:39-07:00 greg@kroah.com +0 -0 # Auto merged # # drivers/scsi/scsi_transport_spi.c # 2004/06/21 14:37:38-07:00 greg@kroah.com +0 -1 # Auto merged # # MAINTAINERS # 2004/06/21 14:37:38-07:00 greg@kroah.com +0 -0 # Auto merged # # ChangeSet # 2004/06/21 14:36:31-07:00 kaber@trash.net # [NETFILTER]: Add addrtype match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/Makefile # 2004/06/21 14:36:07-07:00 kaber@trash.net +1 -0 # [NETFILTER]: Add addrtype match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/Kconfig # 2004/06/21 14:36:07-07:00 kaber@trash.net +10 -0 # [NETFILTER]: Add addrtype match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_addrtype.c # 2004/06/21 14:35:54-07:00 kaber@trash.net +77 -0 # [NETFILTER]: Add addrtype match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_addrtype.c # 2004/06/21 14:35:54-07:00 kaber@trash.net +0 -0 # BitKeeper file /disk1/BK/nf-2.6/net/ipv4/netfilter/ipt_addrtype.c # # include/linux/netfilter_ipv4/ipt_addrtype.h # 2004/06/21 14:35:52-07:00 kaber@trash.net +11 -0 # [NETFILTER]: Add addrtype match # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # include/linux/netfilter_ipv4/ipt_addrtype.h # 2004/06/21 14:35:52-07:00 kaber@trash.net +0 -0 # BitKeeper file /disk1/BK/nf-2.6/include/linux/netfilter_ipv4/ipt_addrtype.h # # ChangeSet # 2004/06/21 14:34:20-07:00 kaber@trash.net # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv6/sit.c # 2004/06/21 14:34:06-07:00 kaber@trash.net +2 -14 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv6/ip6_tunnel.c # 2004/06/21 14:34:06-07:00 kaber@trash.net +1 -7 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_REJECT.c # 2004/06/21 14:34:06-07:00 kaber@trash.net +1 -5 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/ipmr.c # 2004/06/21 14:34:06-07:00 kaber@trash.net +3 -12 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/ipip.c # 2004/06/21 14:34:06-07:00 kaber@trash.net +2 -14 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/ip_input.c # 2004/06/21 14:34:06-07:00 kaber@trash.net +1 -5 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/ip_gre.c # 2004/06/21 14:34:06-07:00 kaber@trash.net +2 -14 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # include/linux/skbuff.h # 2004/06/21 14:34:06-07:00 kaber@trash.net +12 -3 # [NETFILTER]: Add new function 'nf_reset' to reset netfilter related skb-fields # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:33:48-07:00 kaber@trash.net # [NETFILTER]: Relax hook check in ipt_CLASSIFY # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_CLASSIFY.c # 2004/06/21 14:33:34-07:00 kaber@trash.net +7 -5 # [NETFILTER]: Relax hook check in ipt_CLASSIFY # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:33:13-07:00 kaber@trash.net # [NETFILTER]: Fix offset calculation in amanda conntrack helper # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_conntrack_amanda.c # 2004/06/21 14:32:59-07:00 kaber@trash.net +1 -1 # [NETFILTER]: Fix offset calculation in amanda conntrack helper # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:32:37-07:00 kaber@trash.net # [NETFILTER]: Fix expectation eviction order # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_nat_core.c # 2004/06/21 14:32:23-07:00 kaber@trash.net +1 -1 # [NETFILTER]: Fix expectation eviction order # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_conntrack_core.c # 2004/06/21 14:32:23-07:00 kaber@trash.net +7 -16 # [NETFILTER]: Fix expectation eviction order # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:32:04-07:00 kaber@trash.net # [NETFILTER]: Don't reroute on nfmark change in mangle table when routing by nfmark is not enabled # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/iptable_mangle.c # 2004/06/21 14:31:50-07:00 kaber@trash.net +2 -0 # [NETFILTER]: Don't reroute on nfmark change in mangle table when routing by nfmark is not enabled # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:31:28-07:00 kaber@trash.net # [NETFILTER]: 'any' matching in ipt_helper # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_helper.c # 2004/06/21 14:31:14-07:00 kaber@trash.net +5 -6 # [NETFILTER]: 'any' matching in ipt_helper # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:30:52-07:00 kaber@trash.net # [NETFILTER]: Fix inverted matching in ipt_helper # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_helper.c # 2004/06/21 14:30:38-07:00 kaber@trash.net +5 -6 # [NETFILTER]: Fix inverted matching in ipt_helper # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:30:19-07:00 kaber@trash.net # [NETFILTER]: skip internal targets in iptables proc listing # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv6/netfilter/ip6_tables.c # 2004/06/21 14:30:05-07:00 kaber@trash.net +10 -1 # [NETFILTER]: skip internal targets in iptables proc listing # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_tables.c # 2004/06/21 14:30:05-07:00 kaber@trash.net +10 -1 # [NETFILTER]: skip internal targets in iptables proc listing # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:29:41-07:00 kaber@trash.net # [NETFILTER]: Change permissions of /proc/net/ip_conntrack to 0440 # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_conntrack_standalone.c # 2004/06/21 14:29:27-07:00 kaber@trash.net +1 -1 # [NETFILTER]: Change permissions of /proc/net/ip_conntrack to 0440 # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:28:57-07:00 kaber@trash.net # [NETFILTER]: complain about brokeness on SMP for pid, sid and command matching in ipt_owner # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv6/netfilter/ip6t_owner.c # 2004/06/21 14:28:43-07:00 kaber@trash.net +8 -1 # [NETFILTER]: complain about brokeness on SMP for pid, sid and command matching in ipt_owner # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_owner.c # 2004/06/21 14:28:43-07:00 kaber@trash.net +9 -1 # [NETFILTER]: complain about brokeness on SMP for pid, sid and command matching in ipt_owner # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:28:23-07:00 kaber@trash.net # [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_nat_core.c # 2004/06/21 14:28:09-07:00 kaber@trash.net +3 -2 # [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_conntrack_core.c # 2004/06/21 14:28:09-07:00 kaber@trash.net +1 -3 # [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # include/linux/netfilter_ipv4/ip_conntrack.h # 2004/06/21 14:28:09-07:00 kaber@trash.net +1 -1 # [NETFILTER]: Fix non-existant config option for IP_NF_ASSERT, fix some broken assertions # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 14:07:06-07:00 herbert@gondor.apana.org.au # [NET]: In sungem driver, keep track of rx buffer alloc size based upon MTU. # # drivers/net/sungem.h # 2004/06/21 14:06:52-07:00 herbert@gondor.apana.org.au +2 -1 # [NET]: In sungem driver, keep track of rx buffer alloc size based upon MTU. # # drivers/net/sungem.c # 2004/06/21 14:06:52-07:00 herbert@gondor.apana.org.au +8 -4 # [NET]: In sungem driver, keep track of rx buffer alloc size based upon MTU. # # ChangeSet # 2004/06/21 15:22:34-04:00 len.brown@intel.com # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.7 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.7 # # arch/x86_64/kernel/mpparse.c # 2004/06/21 15:22:31-04:00 len.brown@intel.com +0 -0 # Auto merged # # arch/i386/kernel/mpparse.c # 2004/06/21 15:22:31-04:00 len.brown@intel.com +0 -0 # Auto merged # # ChangeSet # 2004/06/21 15:20:51-04:00 len.brown@intel.com # [ACPI] fix double timer interrupt mapping (Hans-Frieder Vogt) # caused by errant fix for OSDL 2835 # # arch/x86_64/kernel/mpparse.c # 2004/06/21 15:20:45-04:00 len.brown@intel.com +1 -1 # fix previous fix that caused double timer interrupts (Hans-Frieder Vogt) # # arch/i386/kernel/mpparse.c # 2004/06/21 15:20:45-04:00 len.brown@intel.com +1 -1 # fix previous fix that caused double timer interrupts (Hans-Frieder Vogt) # # ChangeSet # 2004/06/21 14:52:56-04:00 jgarzik@pobox.com # Rename 'carmel' block driver to 'sx8'. # # Requested by Promise. The hardware isn't widely deployed yet, # with almost all users being early evaluators, so this should be OK. # # drivers/block/Makefile # 2004/06/21 14:52:50-04:00 jgarzik@pobox.com +1 -1 # Rename 'carmel' block driver to 'sx8'. # # Requested by Promise. The hardware isn't widely deployed yet, # with almost all users being early evaluators, so this should be OK. # # drivers/block/Kconfig # 2004/06/21 14:52:50-04:00 jgarzik@pobox.com +4 -4 # Rename 'carmel' block driver to 'sx8'. # # Requested by Promise. The hardware isn't widely deployed yet, # with almost all users being early evaluators, so this should be OK. # # Documentation/devices.txt # 2004/06/21 14:52:50-04:00 jgarzik@pobox.com +14 -14 # Rename 'carmel' block driver to 'sx8'. # # Requested by Promise. The hardware isn't widely deployed yet, # with almost all users being early evaluators, so this should be OK. # # drivers/block/sx8.c # 2004/06/21 14:49:55-04:00 jgarzik@pobox.com +0 -0 # Rename: drivers/block/carmel.c -> drivers/block/sx8.c # # ChangeSet # 2004/06/21 09:34:33-07:00 akpm@osdl.org # [NET]: Loopback, allocate per-cpu stats statically and fix cpu refcounting. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/loopback.c # 2004/06/21 09:34:19-07:00 akpm@osdl.org +18 -17 # [NET]: Loopback, allocate per-cpu stats statically and fix cpu refcounting. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 09:32:44-07:00 akm@osdl.org # [NET]: Fix dev_queue_xmit build with older gcc. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/21 13:14:12-03:00 acme@conectiva.com.br # [NET] generalise tcp_set_owner_r and tcp_rfree # # Will be used by the poor cousins # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_input.c # 2004/06/21 13:14:00-03:00 acme@conectiva.com.br +4 -4 # [NET] generalise tcp_set_owner_r and tcp_rfree # # Will be used by the poor cousins # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/21 13:14:00-03:00 acme@conectiva.com.br +0 -8 # [NET] generalise tcp_set_owner_r and tcp_rfree # # Will be used by the poor cousins # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/stream.c # 2004/06/21 13:14:00-03:00 acme@conectiva.com.br +10 -0 # [NET] generalise tcp_set_owner_r and tcp_rfree # # Will be used by the poor cousins # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/tcp.h # 2004/06/21 13:14:00-03:00 acme@conectiva.com.br +0 -10 # [NET] generalise tcp_set_owner_r and tcp_rfree # # Will be used by the poor cousins # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/21 13:14:00-03:00 acme@conectiva.com.br +10 -0 # [NET] generalise tcp_set_owner_r and tcp_rfree # # Will be used by the poor cousins # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/20 23:44:05-07:00 axboe@suse.de # [PATCH] only clear ->last_merge when appropriate # # Make sure we only clear q->last_merge hint, if it matches the request # currently passed in. # # Signed-off-by: Jens Axboe # Signed-off-by: Linus Torvalds # # drivers/block/ll_rw_blk.c # 2004/06/20 23:39:06-07:00 axboe@suse.de +8 -4 # only clear ->last_merge when appropriate # # ChangeSet # 2004/06/20 20:46:32-07:00 sam@ravnborg.org # [PATCH] kbuild: add deb-pkg target # # To prepare kbuild for more kernel packaging formats move all packaging support # to scripts/package. # # In top-level Makefile introduce generic support for all package formats using # target names *-pkg. Included the old rpm target for backward compatibility. # # A new variable KBUILD_IMAGE is used to specify what kernel image will be part # of the final package, and is to be set by the arch specific makefile. # KBUILD_IMAGE may be overridden from command line or environment. KBUILD_IMAGE # will see wider usage later, mainly when installing kernel images. # # Introducing KBUILD_IMAGE allowed arch specific details to be deleted from the # mkspec and builddeb scripts. # # While in the process added the deb packet format. Script is From: Wichert # Akkerman # # To create a RPM packet use 'make rpm-pkg'. # To create a deb packet use 'make deb-pkg'. # Both targets are included in 'make help' # # Signed-off-by: Sam Ravnborg # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # scripts/package/mkspec # 2004/06/20 18:23:45-07:00 sam@ravnborg.org +7 -16 # kbuild: add deb-pkg target # # scripts/package/builddeb # 2004/06/20 20:46:25-07:00 sam@ravnborg.org +79 -0 # # scripts/package/Makefile # 2004/06/20 20:46:25-07:00 sam@ravnborg.org +71 -0 # # scripts/Makefile # 2004/06/20 18:23:45-07:00 sam@ravnborg.org +1 -1 # kbuild: add deb-pkg target # # arch/i386/Makefile # 2004/06/20 18:23:45-07:00 sam@ravnborg.org +7 -6 # kbuild: add deb-pkg target # # Makefile # 2004/06/20 18:23:45-07:00 sam@ravnborg.org +25 -37 # kbuild: add deb-pkg target # # scripts/package/builddeb # 2004/06/20 20:46:25-07:00 sam@ravnborg.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/scripts/package/builddeb # # scripts/package/Makefile # 2004/06/20 20:46:25-07:00 sam@ravnborg.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/scripts/package/Makefile # # ChangeSet # 2004/06/20 20:46:14-07:00 sam@ravnborg.org # [PATCH] Avoid rebuild of IKCFG when using O= # # When using a separate output directory the in-kernel config wiere rebuild # each time the kernel was compiled. Fix this by specifying correct path to # Makefile in the prerequisite to the ikconfig.h file. # # Signed-off-by: Sam Ravnborg # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/Makefile # 2004/06/20 18:23:45-07:00 sam@ravnborg.org +1 -1 # Avoid rebuild of IKCFG when using O= # # ChangeSet # 2004/06/20 20:46:03-07:00 sam@ravnborg.org # [PATCH] wanxl firware build fix # # allmodconfig and allyesconfig are currently failing because they select # wanxl firmware rebuild, and that requires an m68k assembler toolchain. # # Add a new generic option to the "Generic Driver Options" menu. The option # is defaul equals y and prevents us from building firmware unless really # needed. # # Firmware is usually provided in separate filer '_shipped', and there is no # need to rebuild them unless strictly required. First user is WanXL - which # otherwise required a m68k tool-set to compile. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/wan/Kconfig # 2004/06/20 18:23:45-07:00 sam@ravnborg.org +1 -1 # wanxl firware build fix # # drivers/base/Kconfig # 2004/06/20 18:23:45-07:00 sam@ravnborg.org +9 -0 # wanxl firware build fix # # ChangeSet # 2004/06/20 20:45:52-07:00 geert@linux-m68k.org # [PATCH] Fix idr.h comment # # Fix path in header file. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/idr.h # 2004/06/20 18:23:45-07:00 geert@linux-m68k.org +1 -1 # Fix idr.h comment # # ChangeSet # 2004/06/20 20:45:41-07:00 juhl-lkml@dif.dk # [PATCH] Fix warning in tdfxfb.c # # drivers/video/tdfxfb.c:1104: warning: initialization discards qualifiers from pointer target type # # Signed-off-by: Jesper Juhl # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/tdfxfb.c # 2004/06/20 18:23:45-07:00 juhl-lkml@dif.dk +1 -1 # Fix warning in tdfxfb.c # # ChangeSet # 2004/06/20 20:45:30-07:00 nickpiggin@yahoo.com.au # [PATCH] lindent rwsem # # Lindent rwsem.c and rwsem-spinlock.c and fix a few things by hand. Also # added a couple of comments for the memory barriers. Added the __sched # annotation that was left out of rwsem-spinlock.c. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # lib/rwsem.c # 2004/06/20 18:23:45-07:00 nickpiggin@yahoo.com.au +59 -50 # lindent rwsem # # lib/rwsem-spinlock.c # 2004/06/20 18:23:45-07:00 nickpiggin@yahoo.com.au +51 -46 # lindent rwsem # # ChangeSet # 2004/06/20 20:45:19-07:00 akpm@osdl.org # [PATCH] jfs warning fix # # On ppc64, s64 is `long'. # # In file included from fs/jfs/jfs_xtree.h:25, # from fs/jfs/jfs_incore.h:26, # from fs/jfs/super.c:29: # fs/jfs/jfs_btree.h: In function `BT_STACK_DUMP': # fs/jfs/jfs_btree.h:151: warning: long long unsigned int format, s64 arg (arg 2) # # Cc: Dave Kleikamp # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/jfs/jfs_btree.h # 2004/06/20 18:23:45-07:00 akpm@osdl.org +1 -1 # jfs warning fix # # ChangeSet # 2004/06/20 20:45:08-07:00 ralf@linux-mips.org # [PATCH] Add M48T35 RTC driver # # Add M48T35 RTC driver for the SGI IP27 aka Origin 200, Origin 2000 and # Onyx 2. # # Signed-off-by: Ralf Baechle # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/char/ip27-rtc.c # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +327 -0 # Add M48T35 RTC driver # # drivers/char/Makefile # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +1 -0 # Add M48T35 RTC driver # # drivers/char/Kconfig # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +11 -0 # Add M48T35 RTC driver # # drivers/char/ip27-rtc.c # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/char/ip27-rtc.c # # ChangeSet # 2004/06/20 20:44:57-07:00 ralf@linux-mips.org # [PATCH] Cobalt LCD Driver update # # Mostly reformatting to get the sometimes random formatting style of the LCD # driver to something Linux compliant. Use module_init/exit for module # initialization and cleanup. # # Signed-off-by: Ralf Baechle # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/char/lcd.h # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +184 -0 # Cobalt LCD Driver update # # drivers/char/lcd.h # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/char/lcd.h # # drivers/char/lcd.c # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +375 -327 # Cobalt LCD Driver update # # drivers/char/Makefile # 2004/06/20 18:30:54-07:00 ralf@linux-mips.org +1 -0 # Cobalt LCD Driver update # # drivers/char/Kconfig # 2004/06/20 18:30:54-07:00 ralf@linux-mips.org +7 -0 # Cobalt LCD Driver update # # arch/mips/configs/cobalt_defconfig # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +1 -1 # Cobalt LCD Driver update # # arch/mips/Kconfig # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +0 -5 # Cobalt LCD Driver update # # ChangeSet # 2004/06/20 20:44:45-07:00 ralf@linux-mips.org # [PATCH] DS1286 cleanups # # Remove #ifdef'ed hooks for the DS1286 driver through the kernel. While # cleaning make it work as a module also and add back the core of the driver # got lost when drivers/sgi/ was shredded. # # Signed-off-by: Ralf Baechle # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/ds1286.h # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +54 -0 # DS1286 cleanups # # include/linux/ds1286.h # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/linux/ds1286.h # # fs/proc/proc_misc.c # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +0 -15 # DS1286 cleanups # # drivers/char/misc.c # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +0 -4 # DS1286 cleanups # # drivers/char/ds1286.c # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +578 -0 # DS1286 cleanups # # drivers/char/Makefile # 2004/06/20 18:30:55-07:00 ralf@linux-mips.org +1 -0 # DS1286 cleanups # # drivers/char/Kconfig # 2004/06/20 18:30:55-07:00 ralf@linux-mips.org +11 -0 # DS1286 cleanups # # arch/mips/defconfig # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +1 -1 # DS1286 cleanups # # arch/mips/configs/ip22_defconfig # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +1 -1 # DS1286 cleanups # # drivers/char/ds1286.c # 2004/06/20 18:23:44-07:00 ralf@linux-mips.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/char/ds1286.c # # ChangeSet # 2004/06/20 20:44:34-07:00 ralf@linux-mips.org # [PATCH] mips: remove old junk # # Remove old, unused initialization stuff. # # Signed-off-by: Ralf Baechle # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/char/misc.c # 2004/06/20 18:30:55-07:00 ralf@linux-mips.org +0 -13 # mips: remove old junk # # ChangeSet # 2004/06/20 20:44:23-07:00 bjoern@j3e.de # [PATCH] NLS support for ASCII # # I created an ASCII NSL module manually based on the ISO-8859-1 NLS module. # # This might be of use for people who do not want any charset conversion to # take place. fs modules like vfat for example then could be forced to # display any non-ASCII character in the uni_xlate escaped form. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/nls/nls_ascii.c # 2004/06/20 18:23:44-07:00 bjoern@j3e.de +167 -0 # NLS support for ASCII # # fs/nls/nls_ascii.c # 2004/06/20 18:23:44-07:00 bjoern@j3e.de +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/fs/nls/nls_ascii.c # # fs/nls/Makefile # 2004/06/20 18:23:44-07:00 bjoern@j3e.de +1 -0 # NLS support for ASCII # # fs/nls/Kconfig # 2004/06/20 18:23:44-07:00 bjoern@j3e.de +8 -0 # NLS support for ASCII # # ChangeSet # 2004/06/20 20:44:11-07:00 emoenke@gwdg.de # [PATCH] CREDITS update # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # CREDITS # 2004/06/20 18:23:44-07:00 emoenke@gwdg.de +2 -2 # CREDITS update # # ChangeSet # 2004/06/20 20:44:00-07:00 akpm@osdl.org # [PATCH] move as documentation # # Move the anticipatory scheduler documentation into Documentation/block. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/block/as-iosched.txt # 2004/06/20 18:23:43-07:00 akpm@osdl.org +1 -1 # move as documentation # # ChangeSet # 2004/06/20 23:57:54-03:00 acme@conectiva.com.br # [NET] generalise wait_for_tcp_memory # # Renaming it to sk_stream_wait_memory # # Signed-off-by: Arnaldo Carvalho de Melo # # net/sctp/socket.c # 2004/06/20 23:57:40-03:00 acme@conectiva.com.br +1 -1 # [NET] generalise wait_for_tcp_memory # # Renaming it to sk_stream_wait_memory # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/20 23:57:40-03:00 acme@conectiva.com.br +2 -63 # [NET] generalise wait_for_tcp_memory # # Renaming it to sk_stream_wait_memory # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/stream.c # 2004/06/20 23:57:40-03:00 acme@conectiva.com.br +63 -0 # [NET] generalise wait_for_tcp_memory # # Renaming it to sk_stream_wait_memory # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/20 23:57:40-03:00 acme@conectiva.com.br +1 -0 # [NET] generalise wait_for_tcp_memory # # Renaming it to sk_stream_wait_memory # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/20 23:47:17-03:00 acme@conectiva.com.br # [NET] introduce sk_stream_wait_close, from tcp code # # Will be used by the poor cousins. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/20 23:46:55-03:00 acme@conectiva.com.br +1 -27 # [NET] introduce sk_stream_wait_close, from tcp code # # Will be used by the poor cousins. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/stream.c # 2004/06/20 23:46:55-03:00 acme@conectiva.com.br +28 -0 # [NET] introduce sk_stream_wait_close, from tcp code # # Will be used by the poor cousins. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/20 23:46:55-03:00 acme@conectiva.com.br +1 -0 # [NET] introduce sk_stream_wait_close, from tcp code # # Will be used by the poor cousins. # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/20 23:33:23-03:00 acme@conectiva.com.br # [NET] generalise wait_for_tcp_connect # # This will be used by the poor cousins, look, for instance, at # x25_wait_for_connection_establishment :-) # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_input.c # 2004/06/20 23:33:12-03:00 acme@conectiva.com.br +1 -1 # [NET] generalise wait_for_tcp_connect # # This will be used by the poor cousins, look, for instance, at # x25_wait_for_connection_establishment :-) # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/20 23:33:12-03:00 acme@conectiva.com.br +4 -39 # [NET] generalise wait_for_tcp_connect # # This will be used by the poor cousins, look, for instance, at # x25_wait_for_connection_establishment :-) # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/stream.c # 2004/06/20 23:33:12-03:00 acme@conectiva.com.br +37 -0 # [NET] generalise wait_for_tcp_connect # # This will be used by the poor cousins, look, for instance, at # x25_wait_for_connection_establishment :-) # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/sock.c # 2004/06/20 23:33:12-03:00 acme@conectiva.com.br +1 -0 # [NET] generalise wait_for_tcp_connect # # This will be used by the poor cousins, look, for instance, at # x25_wait_for_connection_establishment :-) # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/20 23:33:12-03:00 acme@conectiva.com.br +4 -0 # [NET] generalise wait_for_tcp_connect # # This will be used by the poor cousins, look, for instance, at # x25_wait_for_connection_establishment :-) # # Signed-off-by: Arnaldo Carvalho de Melo # # include/linux/tcp.h # 2004/06/20 23:33:12-03:00 acme@conectiva.com.br +0 -2 # [NET] generalise wait_for_tcp_connect # # This will be used by the poor cousins, look, for instance, at # x25_wait_for_connection_establishment :-) # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/20 18:58:22-07:00 axboe@suse.de # [PATCH] deadline I/O scheduler documentation # # Document the deadline scheduler and its tunables. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/block/deadline-iosched.txt # 2004/06/20 18:23:43-07:00 axboe@suse.de +78 -0 # deadline I/O scheduler documentation # # Documentation/block/deadline-iosched.txt # 2004/06/20 18:23:43-07:00 axboe@suse.de +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/block/deadline-iosched.txt # # ChangeSet # 2004/06/20 18:58:10-07:00 juhl-lkml@dif.dk # [PATCH] isp16 check_region() removal # # Convert check_region to request_region and clean up some parentheses in # return statements for drivers/cdrom/isp16.c. # # Signed-off-by: Jesper Juhl # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/cdrom/isp16.c # 2004/06/20 18:23:43-07:00 juhl-lkml@dif.dk +27 -18 # isp16 check_region() removal # # ChangeSet # 2004/06/20 18:57:59-07:00 ak@suse.de # [PATCH] NUMA API updates # # This patch three issues in NUMA API # # - When 1 was passed to set_mempolicy or mbind as maxnodes argument # get_nodes could corrupt the stack and cause a crash. Fix that. # # - Remove the restriction to do interleaving only for order 0. Together # with the patch that went in previously to use interleaving policy at boot # time this should give back the original behaviour of distributing the big # hash tables. # # - Fix some bad white space in comments # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/mempolicy.c # 2004/06/20 18:23:43-07:00 ak@suse.de +13 -10 # NUMA API updates # # ChangeSet # 2004/06/20 18:57:48-07:00 mason@suse.com # [PATCH] fix possible stack corruption during reiserfs_file_write # # With preallocation turned on, reiserfs_allocate_blocks_for_region wasn't # sending a large enough array to hold all the blocks it was asking the block # allocator to find. This can result in stack corruption. # # The fix is to kmalloc an array to hold the blocks, making sure to allocate # something large enough. # # There was also a recent optimization to force the allocator to find a free # region large enough to hold the entire preallocation size. This was # sometimes causing more blocks to be allocated then had been requested, # which would also overflow the array. Something more elegant is required # here, until then just disable the optimization. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/reiserfs/file.c # 2004/06/20 18:23:43-07:00 mason@suse.com +15 -10 # fix possible stack corruption during reiserfs_file_write # # fs/reiserfs/bitmap.c # 2004/06/20 18:23:43-07:00 mason@suse.com +1 -4 # fix possible stack corruption during reiserfs_file_write # # ChangeSet # 2004/06/20 18:57:37-07:00 fabian.frederick@skynet.be # [PATCH] sparse annotation for sys_quotactl() # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/quota.c # 2004/06/20 18:23:43-07:00 fabian.frederick@skynet.be +1 -1 # sparse annotation for sys_quotactl() # # ChangeSet # 2004/06/20 18:57:26-07:00 hugh@veritas.com # [PATCH] mprotect propagate anon_vma # # When mprotect shifts the boundary between vmas (merging the reprotected # area into the vma before or the vma after), make sure that the expanding # vma has anon_vma if the shrinking vma had, to cover anon pages imported. # Thanks to Andrea for alerting us to this oversight. # # Cc: # Signed-off-by: Hugh Dickins # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/mmap.c # 2004/06/20 18:23:42-07:00 hugh@veritas.com +14 -1 # mprotect propagate anon_vma # # ChangeSet # 2004/06/20 18:57:15-07:00 jbarnes@engr.sgi.com # [PATCH] export sys_ioctl to modules # # Small patch to export sys_ioctl if CONFIG_COMPAT is set. This allows # platforms to implement 32 bit compatibility ioctl handlers in modules. # # Submitted-by: Jesse Barnes # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ioctl.c # 2004/06/20 18:23:42-07:00 jbarnes@engr.sgi.com +10 -0 # export sys_ioctl to modules # # arch/x86_64/kernel/x8664_ksyms.c # 2004/06/20 18:23:42-07:00 jbarnes@engr.sgi.com +0 -1 # export sys_ioctl to modules # # arch/sparc64/kernel/sparc64_ksyms.c # 2004/06/20 18:23:42-07:00 jbarnes@engr.sgi.com +0 -1 # export sys_ioctl to modules # # arch/s390/kernel/s390_ksyms.c # 2004/06/20 18:23:42-07:00 jbarnes@engr.sgi.com +0 -1 # export sys_ioctl to modules # # arch/ppc64/kernel/ppc_ksyms.c # 2004/06/20 18:23:42-07:00 jbarnes@engr.sgi.com +0 -1 # export sys_ioctl to modules # # ChangeSet # 2004/06/20 18:57:04-07:00 hch@lst.de # [PATCH] fix isdn to not assume mem*io return values # # These are defined like the normal ISO C mem* routines although x86 happens # to return void by accident. Fix isdn to not assume a return value. # # Sent to the isdn list, but as usual I didn't get any reply. # # The patch is from the Debian kernel package and really old. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/isdn/sc/shmem.c # 2004/06/20 18:23:42-07:00 hch@lst.de +12 -21 # fix isdn to not assume mem*io return values # # drivers/isdn/sc/packet.c # 2004/06/20 18:23:42-07:00 hch@lst.de +2 -2 # fix isdn to not assume mem*io return values # # drivers/isdn/sc/message.c # 2004/06/20 18:23:42-07:00 hch@lst.de +0 -1 # fix isdn to not assume mem*io return values # # ChangeSet # 2004/06/20 18:56:53-07:00 kraxel@bytesex.org # [PATCH] v4l: radio-zoltrix fix. # # From: Paul Focke # # I recently upgraded from 2.4 to kernel 2.6 & noticed that the zoltrix radio # driver was not working. Seems like a little typo. I tested this on my system # and it's working fine now. I doubt there are any other linux users in the # world who still use this card ;-) # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/radio/radio-zoltrix.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +1 -1 # v4l: radio-zoltrix fix. # # ChangeSet # 2004/06/20 18:56:42-07:00 kraxel@bytesex.org # [PATCH] v4l: cx88 driver update # # This is a update for the cx88 tv card driver. Changes: # # * finally make it build with gcc 2.95 ;) # # * add new tv cards. # # * plenty of fixes for the TV sound code. # # * use v4l2 API for communication with tuner + tda9887 # # * misc other minor stuff. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/cx88/cx88.h # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +21 -13 # v4l: cx88 driver update # # drivers/media/video/cx88/cx88-video.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +99 -76 # v4l: cx88 driver update # # drivers/media/video/cx88/cx88-vbi.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +5 -8 # v4l: cx88 driver update # # drivers/media/video/cx88/cx88-tvaudio.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +240 -157 # v4l: cx88 driver update # # drivers/media/video/cx88/cx88-reg.h # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +10 -0 # v4l: cx88 driver update # # drivers/media/video/cx88/cx88-i2c.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +0 -2 # v4l: cx88 driver update # # drivers/media/video/cx88/cx88-cards.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +162 -14 # v4l: cx88 driver update # # ChangeSet # 2004/06/20 18:56:31-07:00 kraxel@bytesex.org # [PATCH] saa7134 driver update # # This is an update for the saa7134 driver. Changes: # # # * add support for more TV cards, as usual ;) # # * add support for image cropping. # # * use v4l2 API to talk to the tuner chips (thus it depends on the # tuner/tda9887 patch). # # * fixes for the audio carrier scan. # # * make transport stream packet size configurable. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/saa7134/saa7134.h # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +5 -1 # saa7134 driver update # # drivers/media/video/saa7134/saa7134-video.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +114 -87 # saa7134 driver update # # drivers/media/video/saa7134/saa7134-tvaudio.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +103 -69 # saa7134 driver update # # drivers/media/video/saa7134/saa7134-ts.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +17 -10 # saa7134 driver update # # drivers/media/video/saa7134/saa7134-oss.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +3 -2 # saa7134 driver update # # drivers/media/video/saa7134/saa7134-input.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +65 -3 # saa7134 driver update # # drivers/media/video/saa7134/saa7134-core.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +12 -4 # saa7134 driver update # # drivers/media/video/saa7134/saa7134-cards.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +102 -20 # saa7134 driver update # # drivers/media/video/saa7134/saa6752hs.c # 2004/06/20 18:23:42-07:00 kraxel@bytesex.org +0 -1 # saa7134 driver update # # ChangeSet # 2004/06/20 18:56:19-07:00 kraxel@bytesex.org # [PATCH] v4l: IR input driver update. # # This patch updates the ir-kbd-gpio and ir-kbd-i2c drivers. Nothing major, # just some keytable fixes and support for more hardware. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/ir-kbd-i2c.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +106 -16 # v4l: IR input driver update. # # drivers/media/video/ir-kbd-gpio.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +41 -41 # v4l: IR input driver update. # # ChangeSet # 2004/06/20 18:56:08-07:00 kraxel@bytesex.org # [PATCH] v4l: bttv driver update # # This is a update of the bttv driver. Changes: # # * some card-specific fixes + new cards. # # * separate buffer switching for video frames and vbi data, that should make # bttv less sensitive to high irq latencies. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/bttvp.h # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +8 -5 # v4l: bttv driver update # # drivers/media/video/bttv.h # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +2 -0 # v4l: bttv driver update # # drivers/media/video/bttv-vbi.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +4 -1 # v4l: bttv driver update # # drivers/media/video/bttv-risc.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +18 -10 # v4l: bttv driver update # # drivers/media/video/bttv-driver.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +95 -36 # v4l: bttv driver update # # drivers/media/video/bttv-cards.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +92 -3 # v4l: bttv driver update # # ChangeSet # 2004/06/20 18:55:57-07:00 kraxel@bytesex.org # [PATCH] v4l: tuner + tda9887 updates # # This is a big update for the tuner and tda9887 modules which are used for TV # card tuning. # # The tda9887 module is basically completely rewritten and understands all the # config bits now instead of having just some fixed config presets. Some of # these config bits can be changed by insmod options now. # # The other big change is that both modules allow to use the V4L2 API for # inter-module communication (i.e. when bttv/saa7134/... pass through the # tuning ioctls to the modules). That allows to specify the TV norm more # precisely (not just PAL but PAL-I, PAL-BG, ...), which is needed in some cases # to make TV audio work correctly. Using the old v4l1 API is still possible so # this shouldn't break any users of these two modules. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/tuner.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +173 -68 # v4l: tuner + tda9887 updates # # drivers/media/video/tda9887.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +414 -202 # v4l: tuner + tda9887 updates # # ChangeSet # 2004/06/20 18:55:46-07:00 kraxel@bytesex.org # [PATCH] v4l: ir-common update # # Some minor changes for the ir-common module: Update for the RC5 keytable and # increase the IR_KEYTAB_SIZE #define. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/ir-common.h # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +1 -1 # v4l: ir-common update # # drivers/media/common/ir-common.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +2 -2 # v4l: ir-common update # # ChangeSet # 2004/06/20 18:55:35-07:00 kraxel@bytesex.org # [PATCH] v4l: msp3400 cleanup. # # This patch has some cleanups for the msp3400 module: Balance is used directly # now instead of maintaining the state as left/right volume and calculate the # balance from that. The msp3400 did that only for historical reasons and it # isn't needed any more ... # # Credits for that go to Perry Gilfillan. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/msp3400.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +29 -33 # v4l: msp3400 cleanup. # # ChangeSet # 2004/06/20 18:55:24-07:00 kraxel@bytesex.org # [PATCH] v4l: video-buf fixes. # # This patch has some minor bugfixes for the video-buf module. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/video-buf.h # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +0 -2 # v4l: video-buf fixes. # # drivers/media/video/video-buf.c # 2004/06/20 18:23:41-07:00 kraxel@bytesex.org +11 -4 # v4l: video-buf fixes. # # ChangeSet # 2004/06/20 18:55:13-07:00 kraxel@bytesex.org # [PATCH] v4l: video-buf magic numbers # # This patch adds some magic IDs and checks for them to the data structs of the # video-buf module. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/video-buf.h # 2004/06/20 18:30:58-07:00 kraxel@bytesex.org +4 -0 # v4l: video-buf magic numbers # # drivers/media/video/video-buf.c # 2004/06/20 18:30:58-07:00 kraxel@bytesex.org +26 -6 # v4l: video-buf magic numbers # # ChangeSet # 2004/06/20 18:55:02-07:00 kraxel@bytesex.org # [PATCH] v4l: update video-buf for per-frame input switching. # # This patch updates the video-buf module to support the per-frame input # switching added by the v4l2 API patch. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/video-buf.h # 2004/06/20 18:30:58-07:00 kraxel@bytesex.org +5 -1 # v4l: update video-buf for per-frame input switching. # # drivers/media/video/video-buf.c # 2004/06/20 18:30:58-07:00 kraxel@bytesex.org +14 -0 # v4l: update video-buf for per-frame input switching. # # ChangeSet # 2004/06/20 18:54:51-07:00 kraxel@bytesex.org # [PATCH] v4l: v4l2 API updates # # This patch has some minor updates to v4l2 API: # # * A new pixel format (V4L2_PIX_FMT_SBGGR8). # # * Adds some #defines for tv norms for convenience. # # * Allow to specify the video source to capture from on a per-frame basis. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/videodev2.h # 2004/06/20 18:23:40-07:00 kraxel@bytesex.org +12 -5 # v4l: v4l2 API updates # # ChangeSet # 2004/06/20 18:54:40-07:00 axboe@suse.de # [PATCH] iommu max segment size # # This patch is from James, I've changed it slightly only. # # The problem is that some IOMMU implementations have a maximum limit to the # size of the number of contiguously mappable pages (admittedly, this limit # is mostly in the resource management algorithms rather than the IOMMUs # themselves). # # This patch adds this concept to the bio layer via the parameter # # BIO_VMERGE_MAX_SIZE # # which architectures can define in asm/io.h (if undefined, we assume it to # be infinite, which is current behaviour). # # While adding this, I noticed several places where bio was making incorrect # assumptions about virtual mergeability (none of which was a bug: bio was # overestimating rather than underestimating). # # - The worst offender was bio_add_page(), which seemed never to check for # virtual mergeability # # - I also fixed blk_hw_contig_segments() not to check the QUEUE_CLUSTER # flag, and not to check the phys segment boundary. # # In order to track the hw segment size across bios, I had to introduce two # extra bio parameters: bi_hw_front_size and bi_hw_back_size which store the # sizes of the front and back hw contiguous segments (and which will be equal # if there's only one hw segment). When the bio is merged into a request, # these fields are updated with the total hw contig size so they can always # be used to assess if the merger would violate the BIO_VMERGE_MAX_SIZE # parameter. # # Signed-Off-By: Jens Axboe # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/bio.h # 2004/06/20 18:23:40-07:00 axboe@suse.de +18 -0 # iommu max segment size # # fs/bio.c # 2004/06/20 18:23:40-07:00 axboe@suse.de +11 -3 # iommu max segment size # # drivers/block/ll_rw_blk.c # 2004/06/20 18:23:40-07:00 axboe@suse.de +80 -24 # iommu max segment size # # ChangeSet # 2004/06/20 18:54:29-07:00 dcn@sgi.com # [PATCH] add wait_event_interruptible_exclusive() macro # # This patch defines a macro that does exactly what # wait_event_interruptible() does except that it adds the current task to the # wait queue as an exclusive task (i.e., sets the WQ_FLAG_EXCLUSIVE flag) # rather than as a non-exclusive task as wait_event_interruptible() does. # # This allows one to do a wake_up_nr() to wake up a specific number of tasks. # I'm in the process of submitting a patch to linux-ia64 that requires this # capability. (Its subject line is "[PATCH 3/4] SGI Altix cross partition # functionality".) # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/wait.h # 2004/06/20 18:23:40-07:00 dcn@sgi.com +30 -1 # add wait_event_interruptible_exclusive() macro # # ChangeSet # 2004/06/20 18:54:18-07:00 mika@osdl.org # [PATCH] Uninline machine_specific_memory_setup() # # Cleanup arch/i386/kernel/setup.c a little bit by: # # * un-inlining machine_specific_memory_setup() (it's implementations are # pretty big to be inlined anyway) # # * remove setup_memory_region() by moving the code inside setup_arch() # # I would also recommend BK-renaming all four files # (include/asm-i386/*/setup_arch_post.h) to ".c" and moving them into # arch/i386/*/, but that obviously is not needed in anyway. But IMHO they # are clearly ".c" files, not ".h" files. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/mach-voyager/setup_arch_post.h # 2004/06/20 18:23:40-07:00 mika@osdl.org +1 -1 # Uninline machine_specific_memory_setup() # # include/asm-i386/mach-visws/setup_arch_post.h # 2004/06/20 18:23:40-07:00 mika@osdl.org +1 -1 # Uninline machine_specific_memory_setup() # # include/asm-i386/mach-default/setup_arch_post.h # 2004/06/20 18:23:40-07:00 mika@osdl.org +1 -1 # Uninline machine_specific_memory_setup() # # arch/i386/kernel/setup.c # 2004/06/20 18:23:40-07:00 mika@osdl.org +6 -12 # Uninline machine_specific_memory_setup() # # ChangeSet # 2004/06/20 18:54:07-07:00 mark@alpha.dyndns.org # [PATCH] Add ovcamchip driver # # This patch adds a new driver for the OmniVision OV6xx0 and OV7xx0 series of # CMOS image sensors. It is currently used by the w9968cf USB webcam driver, # which is already in mainline 2.6. Up until now it had to be compiled # outside the kernel tree, which is clearly suboptimal. # # It is also used by version 2 of the ov511 USB webcam driver, which will be # merged in the near future. That will reduce some code duplication, since # the existing ov511 has much of this code built-in. # # This was previously submitted to Linux-USB-Devel, and I have fixed the # concerns that came up at that time. # # Developer's Certificate of Origin 1.0 # # By making a contribution to this project, I certify that: # # (a) The contribution was created in whole or in part by me and I # have the right to submit it under the open source license # indicated in the file; or # # (b) The contribution is based upon previous work that, to the best # of my knowledge, is covered under an appropriate open source # license and I have the right under that license to submit that # work with modifications, whether created in whole or in part # by me, under the same open source license (unless I am # by me, under the same open source license (unless I am # permitted to submit under a different license), as indicated # in the file; or # # (c) The contribution was provided directly to me by some other # person who certified (a), (b) or (c) and I have not modified # it. # # Signed-off-by: Mark McClelland # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/ovcamchip.h # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +104 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/ovcamchip_priv.h # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +87 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/ovcamchip_core.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +446 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/ov7x20.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +455 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/ov7x10.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +335 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/ov76be.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +303 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/ov6x30.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +374 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/ov6x20.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +415 -0 # Add ovcamchip driver # # drivers/media/video/ovcamchip/Makefile # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +4 -0 # Add ovcamchip driver # # include/media/ovcamchip.h # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/media/ovcamchip.h # # drivers/media/video/ovcamchip/ovcamchip_priv.h # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/ovcamchip_priv.h # # drivers/media/video/ovcamchip/ovcamchip_core.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/ovcamchip_core.c # # drivers/media/video/ovcamchip/ov7x20.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/ov7x20.c # # drivers/media/video/ovcamchip/ov7x10.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/ov7x10.c # # drivers/media/video/ovcamchip/ov76be.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/ov76be.c # # drivers/media/video/ovcamchip/ov6x30.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/ov6x30.c # # drivers/media/video/ovcamchip/ov6x20.c # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/ov6x20.c # # drivers/media/video/ovcamchip/Makefile # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/ovcamchip/Makefile # # drivers/media/video/Makefile # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +1 -0 # Add ovcamchip driver # # drivers/media/video/Kconfig # 2004/06/20 18:23:40-07:00 mark@alpha.dyndns.org +11 -0 # Add ovcamchip driver # # ChangeSet # 2004/06/20 18:53:55-07:00 akpm@osdl.org # [PATCH] swapoff: activate pages # # People like to use swapoff/swapon as a way of restoring their VM to a # predictable "preconditional" state. # # Problem is, swapoff leaves mapped anon/pagecache pages on the inactive list, # so they immediately get swapped out again when swapspace becomes available. # # Let's move these pages onto the active list to the VM has to again decide # whether to swap them out. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/swapfile.c # 2004/06/20 18:21:45-07:00 akpm@osdl.org +7 -0 # swapoff: activate pages # # ChangeSet # 2004/06/20 18:53:44-07:00 shaggy@austin.ibm.com # [PATCH] jfs build fix # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/jfs/jfs_dtree.c # 2004/06/20 18:21:45-07:00 shaggy@austin.ibm.com +2 -1 # jfs build fix # # ChangeSet # 2004/06/20 18:53:33-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] airo.c broke # # But Al fixed it again. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/wireless/airo.c # 2004/06/20 18:21:44-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -0 # airo.c broke # # ChangeSet # 2004/06/20 18:53:22-07:00 paulkf@microgate.com # [PATCH] ppp_synctty.c receive/write_wakeup fix # # Allow receive and write_wakeup callbacks to be called at hard interrupt # context and/or with interrupts disabled (removes softirq warning). # # This mirrors changes by Paul Mackerras to ppp_async.c for the same purpose. # Patch has been previously posted for comments and has been tested with # success by multiple persons. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/ppp_synctty.c # 2004/06/20 18:20:58-07:00 paulkf@microgate.com +92 -69 # ppp_synctty.c receive/write_wakeup fix # # ChangeSet # 2004/06/20 18:53:11-07:00 cesarb@nitnet.com.br # [PATCH] O_NOATIME support # # This patch adds support for the O_NOATIME open flag (GNU extension): # # int O_NOATIME Macro # If this bit is set, read will not update the access time of the file. # See File Times. This is used by programs that do backups, so that # backing a file up does not count as reading it. Only the owner of the # file or the superuser may use this bit. # # It is useful if you want to do something with the file atime (for instance, # moving files that have not been accessed in a while to somewhere else, or # something like Debian's popularity-contest) but you also want to read all # files periodically (for instance, tripwire or debsums). # # Currently, the program that reads all files periodically has to use utimes, # which can race with the atime update: # # A B # open # fstat # read # open # read # close # close # utimes # # And the file still has the old atime, instead of the new one from when B # did the read from it. This problem does not happen if A uses O_NOATIME # instead of utimes to preserve the atime. # # This patch adds the O_NOATIME constant for all architectures, but it would # also be possible to add it one architecture at a time by defining it to 0 # when not defined in asm-*. # # Based on patch by Marek Michalkiewicz at # http://www.uwsg.iu.edu/hypermail/linux/kernel/9811.2/0118.html # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/fs.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +2 -1 # O_NOATIME support # # include/asm-x86_64/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-v850/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-sparc64/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-sparc/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-sh/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-s390/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-ppc64/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-ppc/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-parisc/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-mips/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-m68k/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-ia64/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-i386/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-h8300/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-cris/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-arm26/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-arm/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # include/asm-alpha/fcntl.h # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +1 -0 # O_NOATIME support # # fs/namei.c # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +5 -0 # O_NOATIME support # # fs/fcntl.c # 2004/06/20 18:20:57-07:00 cesarb@nitnet.com.br +6 -1 # O_NOATIME support # # ChangeSet # 2004/06/20 18:52:59-07:00 dhowells@redhat.com # [PATCH] Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # Here's a patch to allocate memory for big system hash tables with the # bootmem allocator rather than with main page allocator. # # It is needed for three reasons: # # (1) So that the size can be bigger than MAX_ORDER. IBM have done some # testing on their big PPC64 systems (64GB of RAM) with linux-2.4 and found # that they get better performance if the sizes of the inode cache hash, # dentry cache hash, buffer head hash and page cache hash are increased # beyond MAX_ORDER (order 11). # # Now the main allocator can't allocate anything larger than MAX_ORDER, but # the bootmem allocator can. # # In 2.6 it appears that only the inode and dentry hashes remain of those # four, but there are other hash tables that could use this service. # # (2) Changing MAX_ORDER appears to have a number of effects beyond just # limiting the maximum size that can be allocated in one go. # # (3) Should someone want a hash table in which each bucket isn't a power of # two in size, memory will be wasted as the chunk of memory allocated will # be a power of two in size (to hold a power of two number of buckets). # # On the other hand, using the bootmem allocator means the allocation # will only take up sufficient pages to hold it, rather than the next power # of two up. # # Admittedly, this point doesn't apply to the dentry and inode hashes, # but it might to another hash table that might want to use this service. # # # I've coelesced the meat of the inode and dentry allocation routines into # one such routine in mm/page_alloc.c that the the respective initialisation # functions now call before mem_init() is called. # # This routine gets it's approximation of memory size by counting up the # ZONE_NORMAL and ZONE_DMA pages (and ZONE_HIGHMEM if requested) in all the # nodes passed to the main allocator by paging_init() (or wherever the arch # does it). It does not use max_low_pfn as that doesn't seem to be available # on all archs, and it doesn't use num_physpages since that includes highmem # pages not available to the kernel for allocating data structures upon - # which may not be appropriate when calculating hash table size. # # On the off chance that the size of each hash bucket may not be exactly a # power of two, the routine will only allocate as many pages as is necessary # to ensure that the number of buckets is exactly a power of two, rather than # allocating the smallest power-of-two sized chunk of memory that will hold # the same array of buckets. # # The maximum size of any single hash table is given by # MAX_SYS_HASH_TABLE_ORDER, as is now defined in linux/mmzone.h. # # Signed-off-by: Paul Mackerras # Signed-off-by: David Howells # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/page_alloc.c # 2004/06/20 18:20:10-07:00 dhowells@redhat.com +73 -0 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # init/main.c # 2004/06/20 18:19:55-07:00 dhowells@redhat.com +1 -0 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # include/linux/mmzone.h # 2004/06/20 18:19:55-07:00 dhowells@redhat.com +12 -0 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # include/linux/kernel.h # 2004/06/20 18:20:10-07:00 dhowells@redhat.com +9 -0 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # include/linux/fs.h # 2004/06/20 18:31:00-07:00 dhowells@redhat.com +7 -4 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # include/linux/bootmem.h # 2004/06/20 18:19:55-07:00 dhowells@redhat.com +8 -0 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # fs/inode.c # 2004/06/20 18:20:10-07:00 dhowells@redhat.com +18 -42 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # fs/dcache.c # 2004/06/20 18:20:10-07:00 dhowells@redhat.com +24 -44 # Permit inode & dentry hash tables to be allocated > MAX_ORDER size # # ChangeSet # 2004/06/20 18:52:48-07:00 daniel.ritz@gmx.ch # [PATCH] pcmcia: enable read prefetch on o2micro bridges to fix HDSP # # enable read prefetching on O2micro bridges. It fixes the problems # seen with the RME Hammerfall DSP. # Thanks to Eric Still from O2micro for the input. # # Cc: Russell King # Signed-off-by: Daniel Ritz # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/pcmcia/yenta_socket.c # 2004/06/20 18:19:18-07:00 daniel.ritz@gmx.ch +9 -1 # pcmcia: enable read prefetch on o2micro bridges to fix HDSP # # drivers/pcmcia/o2micro.h # 2004/06/20 18:19:18-07:00 daniel.ritz@gmx.ch +26 -0 # pcmcia: enable read prefetch on o2micro bridges to fix HDSP # # drivers/pcmcia/i82365.c # 2004/06/20 18:19:18-07:00 daniel.ritz@gmx.ch +0 -1 # pcmcia: enable read prefetch on o2micro bridges to fix HDSP # # ChangeSet # 2004/06/20 18:52:36-07:00 pazke@donpac.ru # [PATCH] use new DMI API for HP Pavilion # # Example code for the new DMI APU - port HP Pavilion irq workaround to new # DMI probing. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/pci/visws.c # 2004/06/20 18:17:56-07:00 pazke@donpac.ru +0 -2 # use new DMI API for HP Pavilion # # arch/i386/pci/irq.c # 2004/06/20 18:19:08-07:00 pazke@donpac.ru +31 -1 # use new DMI API for HP Pavilion # # arch/i386/kernel/dmi_scan.c # 2004/06/20 18:18:45-07:00 pazke@donpac.ru +0 -25 # use new DMI API for HP Pavilion # # ChangeSet # 2004/06/20 18:52:25-07:00 pazke@donpac.ru # [PATCH] export DMI check functions # # This patch creates and exports 2 functions which can be used by the rest of # kernel code to perform DMI data checks: # # - dmi_check_system() function checks system DMI data against given blacklist # table and on each match runs corresponding callback function; # # - dmi_get_system_info() function returns DMI data value. Useful for people # wanting more complex DMI data check than simple string match. # # Also filling unused match entries with NO_MATCH made optional, but existing # NO_MATCH occurences are left intact, so people are free to continue dmi_scan.c # patching without massive reject problems. # # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/dmi.h # 2004/06/20 18:17:49-07:00 pazke@donpac.ru +47 -0 # export DMI check functions # # include/linux/dmi.h # 2004/06/20 18:17:49-07:00 pazke@donpac.ru +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/linux/dmi.h # # arch/i386/kernel/dmi_scan.c # 2004/06/20 18:31:01-07:00 pazke@donpac.ru +55 -56 # export DMI check functions # # ChangeSet # 2004/06/20 18:52:14-07:00 akpm@osdl.org # [PATCH] ppc64: eeh.h warning-fix # # In file included from include/asm/io.h:365, # from drivers/video/kyro/STG4000Reg.h:23, # from drivers/video/kyro/STG4000Ramdac.c:16: # include/asm/eeh.h:58: warning: `struct device_node' declared inside parameter list # include/asm/eeh.h:58: warning: its scope is only this definition or declaration, which is probably not what you want # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/eeh.h # 2004/06/20 18:15:35-07:00 akpm@osdl.org +1 -0 # ppc64: eeh.h warning-fix # # ChangeSet # 2004/06/20 18:52:03-07:00 akpm@osdl.org # [PATCH] ppc64 CONFIG_ALTIVEC=n build fix # # With CONFIG_ALTIVEC=n, flush_altivec_to_thread() has no implementation. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/system.h # 2004/06/20 18:15:35-07:00 akpm@osdl.org +9 -1 # ppc64 CONFIG_ALTIVEC=n build fix # # ChangeSet # 2004/06/20 18:27:13-07:00 dsaxena@omelas.(none) # Merge bk://bk.arm.linux.org.uk/linux-2.6-rmk # into omelas.(none):/home/dsaxena/src/linux-2.6-for-rmk # # BitKeeper/deleted/.del-core.c~9e662b6895b788f2 # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # BitKeeper/deleted/.del-core.c~714a718aec4a2c30 # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/kernel/entry-armv.S # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/common/Makefile # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/Makefile # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # BitKeeper/deleted/.del-time.h~e839fe4bcd9e4cf9 # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # BitKeeper/deleted/.del-time.h~730e38fa47912a2c # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # BitKeeper/deleted/.del-core.c~9e662b6895b788f2 # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Merge rename: arch/arm/mach-ftvpci/core.c -> BitKeeper/deleted/.del-core.c~9e662b6895b788f2 # # BitKeeper/deleted/.del-core.c~714a718aec4a2c30 # 2004/06/20 18:27:07-07:00 dsaxena@omelas.(none) +0 -0 # Merge rename: arch/arm/mach-tbox/core.c -> BitKeeper/deleted/.del-core.c~714a718aec4a2c30 # # ChangeSet # 2004/06/20 17:40:34-07:00 akpm@osdl.org # [SPARC64]: bug.h needs compiler.h # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # include/asm-sparc64/bug.h # 2004/06/20 17:40:08-07:00 akpm@osdl.org +2 -0 # [SPARC64]: bug.h needs compiler.h # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/20 17:36:21-07:00 akepner@sgi.com # [NET]: Lockless loopback patch (version 2). # # net/sched/sch_generic.c # 2004/06/20 17:35:53-07:00 akepner@sgi.com +29 -14 # [NET]: Lockless loopback patch (version 2). # # net/sched/sch_api.c # 2004/06/20 17:35:53-07:00 akepner@sgi.com +3 -0 # [NET]: Lockless loopback patch (version 2). # # include/net/pkt_sched.h # 2004/06/20 17:35:52-07:00 akepner@sgi.com +2 -0 # [NET]: Lockless loopback patch (version 2). # # include/linux/netdevice.h # 2004/06/20 17:35:52-07:00 akepner@sgi.com +1 -0 # [NET]: Lockless loopback patch (version 2). # # drivers/net/loopback.c # 2004/06/20 17:35:52-07:00 akepner@sgi.com +33 -8 # [NET]: Lockless loopback patch (version 2). # # ChangeSet # 2004/06/20 17:06:07-07:00 davem@nuts.davemloft.net # Merge bk://kernel.bkbits.net/acme/net-2.6 # into nuts.davemloft.net:/disk1/BK/net-2.6 # # net/ipv4/tcp.c # 2004/06/20 17:05:59-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/06/20 20:54:15-03:00 acme@conectiva.com.br # [NET] move tcp_memory_free to sk_stream_memory_free # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/20 20:54:04-03:00 acme@conectiva.com.br +5 -10 # [NET] move tcp_memory_free to sk_stream_memory_free # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/20 20:54:04-03:00 acme@conectiva.com.br +5 -0 # [NET] move tcp_memory_free to sk_stream_memory_free # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/20 16:38:03-07:00 davem@nuts.davemloft.net # Merge bk://kernel.bkbits.net/acme/net-2.6-1.1768 # into nuts.davemloft.net:/disk1/BK/acme-2.6 # # net/ipv6/udp.c # 2004/06/20 16:37:54-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv6/tcp_ipv6.c # 2004/06/20 16:37:54-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv6/raw.c # 2004/06/20 16:37:54-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv6/ndisc.c # 2004/06/20 16:37:54-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv6/mcast.c # 2004/06/20 16:37:53-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv4/tcp.c # 2004/06/20 16:37:53-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv4/netfilter/ip_conntrack_core.c # 2004/06/20 16:37:53-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # include/linux/skbuff.h # 2004/06/20 16:37:53-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/06/20 19:45:03-03:00 acme@conectiva.com.br # [NET] move skb_can_coalesce to skbuff.h # # This one also removes the duplicate can_coalesce in tcp.c and makes it # use skb_can_coalesce. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/20 19:44:45-03:00 acme@conectiva.com.br +2 -13 # [NET] move skb_can_coalesce to skbuff.h # # This one also removes the duplicate can_coalesce in tcp.c and makes it # use skb_can_coalesce. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/ip_output.c # 2004/06/20 19:44:45-03:00 acme@conectiva.com.br +0 -11 # [NET] move skb_can_coalesce to skbuff.h # # This one also removes the duplicate can_coalesce in tcp.c and makes it # use skb_can_coalesce. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/linux/skbuff.h # 2004/06/20 19:44:45-03:00 acme@conectiva.com.br +12 -0 # [NET] move skb_can_coalesce to skbuff.h # # This one also removes the duplicate can_coalesce in tcp.c and makes it # use skb_can_coalesce. # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/20 14:18:46-07:00 hadi@zynx.com # [NET]: Fix module refcounting of TC actions. # # net/sched/sch_prio.c # 2004/06/20 14:18:14-07:00 hadi@zynx.com +2 -1 # [NET]: Fix module refcounting of TC actions. # # net/sched/police.c # 2004/06/20 14:18:14-07:00 hadi@zynx.com +15 -12 # [NET]: Fix module refcounting of TC actions. # # net/sched/cls_u32.c # 2004/06/20 14:18:14-07:00 hadi@zynx.com +12 -13 # [NET]: Fix module refcounting of TC actions. # # net/sched/act_api.c # 2004/06/20 14:18:14-07:00 hadi@zynx.com +54 -16 # [NET]: Fix module refcounting of TC actions. # # net/sched/Kconfig # 2004/06/20 14:18:14-07:00 hadi@zynx.com +8 -4 # [NET]: Fix module refcounting of TC actions. # # include/net/pkt_sched.h # 2004/06/20 14:18:14-07:00 hadi@zynx.com +10 -5 # [NET]: Fix module refcounting of TC actions. # # include/net/pkt_act.h # 2004/06/20 14:18:14-07:00 hadi@zynx.com +7 -7 # [NET]: Fix module refcounting of TC actions. # # include/linux/pkt_sched.h # 2004/06/20 14:18:14-07:00 hadi@zynx.com +6 -0 # [NET]: Fix module refcounting of TC actions. # # include/linux/pkt_cls.h # 2004/06/20 14:18:14-07:00 hadi@zynx.com +19 -8 # [NET]: Fix module refcounting of TC actions. # # ChangeSet # 2004/06/20 12:32:43-07:00 davem@nuts.davemloft.net # [SPARC64]: Check _TIF_SYSCALL_SUCCESS before syscall return value. # # We might have to clear the flag, and if we do not # then subsequent syscalls can get confused. # # Bug easily triggered by suspending emacs in a pty # and then resuming, select() returns due to a pending # signal but because _TIF_SYSCALL_SUCCESS is erroneously # set by a previous syscall -514 ends up slipping into # userspace. Oops. # # arch/sparc64/kernel/entry.S # 2004/06/20 12:32:28-07:00 davem@nuts.davemloft.net +18 -16 # [SPARC64]: Check _TIF_SYSCALL_SUCCESS before syscall return value. # # We might have to clear the flag, and if we do not # then subsequent syscalls can get confused. # # Bug easily triggered by suspending emacs in a pty # and then resuming, select() returns due to a pending # signal but because _TIF_SYSCALL_SUCCESS is erroneously # set by a previous syscall -514 ends up slipping into # userspace. Oops. # # ChangeSet # 2004/06/20 10:39:30-07:00 geert@linux-m68k.org # [PATCH] m68k: I/O abstraction updates # # M68k I/O abstraction updates: # - Make I/O ports and addresses `unsigned long' # - Add casts to make operations warning-compatible with other archs # - Add {in,out}[wl]_p() and {in,out}l(), which are needed for some drivers # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # include/asm-m68k/io.h # 2004/04/12 04:56:00-07:00 geert@linux-m68k.org +32 -14 # m68k: I/O abstraction updates # # ChangeSet # 2004/06/20 10:39:19-07:00 geert@linux-m68k.org # [PATCH] m68k: atomic op fixups # # M68k: Add missing atomic operations (from Roman Zippel and me) and replace # `__inline__' by `inline' while we're at it. # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # include/asm-m68k/atomic.h # 2004/06/20 02:09:03-07:00 geert@linux-m68k.org +91 -7 # m68k: atomic op fixups # # ChangeSet # 2004/06/20 10:39:08-07:00 geert@linux-m68k.org # [PATCH] m68k: Mac IOP fix # # Mac IOP: Fix copy-and-paste bug (found by OPERA, reported by Zhenmin Li, # confirmed by Brad Boyer) # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # arch/m68k/mac/iop.c # 2004/05/26 05:49:09-07:00 geert@linux-m68k.org +1 -1 # m68k: Mac IOP fix # # ChangeSet # 2004/06/20 10:38:57-07:00 geert@linux-m68k.org # [PATCH] m68k: sparse infrastructure # # M68k: Make sparse work # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # arch/m68k/Makefile # 2004/06/20 01:49:05-07:00 geert@linux-m68k.org +2 -0 # m68k: sparse infrastructure # # ChangeSet # 2004/06/20 10:38:46-07:00 geert@linux-m68k.org # [PATCH] m68k: Mac Sonic Ethernet # # Mac Sonic Ethernet: Kill duplicate `MODULE_LICENSE("GPL");' (already defined in # included sonic.c) which causes a compile failure # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # drivers/net/macsonic.c # 2004/05/04 13:42:38-07:00 geert@linux-m68k.org +0 -1 # m68k: Mac Sonic Ethernet # # ChangeSet # 2004/06/20 10:38:35-07:00 geert@linux-m68k.org # [PATCH] affs remount fixes # # AFFS: Fix oops on write after remount (from Roman Zippel): # - Allocate/free bitmap as necessary # - Remove last uses of SF_READONLY # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # include/linux/affs_fs_sb.h # 2004/06/18 02:18:33-07:00 geert@linux-m68k.org +0 -1 # affs remount fixes # # include/linux/affs_fs.h # 2004/06/18 02:18:33-07:00 geert@linux-m68k.org +2 -1 # affs remount fixes # # fs/affs/super.c # 2004/06/18 02:17:49-07:00 geert@linux-m68k.org +12 -14 # affs remount fixes # # fs/affs/bitmap.c # 2004/06/18 02:17:49-07:00 geert@linux-m68k.org +21 -8 # affs remount fixes # # fs/affs/amigaffs.c # 2004/06/18 02:17:49-07:00 geert@linux-m68k.org +0 -1 # affs remount fixes # # ChangeSet # 2004/06/20 10:38:24-07:00 geert@linux-m68k.org # [PATCH] m68k: use set_page_count() # # M68k: From 2.6.7-rc1 on, it's no longer allowed to access page->count directly # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # arch/m68k/mm/memory.c # 2004/05/24 06:55:41-07:00 geert@linux-m68k.org +1 -1 # m68k: use set_page_count() # # ChangeSet # 2004/06/20 10:38:13-07:00 geert@linux-m68k.org # [PATCH] m68k: bus error handling # # M68k: Allow to catch a bus error via the exception mechanism (from Roman # Zippel) # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # arch/m68k/kernel/traps.c # 2004/05/23 01:55:54-07:00 geert@linux-m68k.org +4 -3 # m68k: bus error handling # # ChangeSet # 2004/06/20 10:38:02-07:00 geert@linux-m68k.org # [PATCH] m68k: new gcc optimizations # # M68k compiler updates from Roman Zippel: # - Fix various lvalue warnings from newer gcc # - Remove unnecessary volatile declarations # - Change some constraints from "a" to "m" to generate slightly better code # - Use "o" constraint for bitfield instructions # - Use generic bitmap functions for some of the ext2/minix bitmap functions # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # include/asm-m68k/string.h # 2004/05/23 01:56:37-07:00 geert@linux-m68k.org +8 -9 # m68k: new gcc optimizations # # include/asm-m68k/page.h # 2004/05/23 01:56:37-07:00 geert@linux-m68k.org +8 -10 # m68k: new gcc optimizations # # include/asm-m68k/bitops.h # 2004/05/23 10:50:20-07:00 geert@linux-m68k.org +54 -103 # m68k: new gcc optimizations # # include/asm-m68k/atomic.h # 2004/05/23 01:56:37-07:00 geert@linux-m68k.org +16 -12 # m68k: new gcc optimizations # # ChangeSet # 2004/06/20 10:37:51-07:00 geert@linux-m68k.org # [PATCH] m68k: handle new gcc's # # M68k: Fixes for when compiling with modern gcc (from Roman Zippel): # - Avoid warning 'use of memory input without lvalue in asm operand 0 is # deprecated' of newer gcc # - Replace some '%/' with offical '%%' to escape a '%' # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # include/asm-m68k/ucontext.h # 2004/05/23 01:56:37-07:00 geert@linux-m68k.org +2 -4 # m68k: handle new gcc's # # arch/m68k/kernel/signal.c # 2004/05/23 01:55:54-07:00 geert@linux-m68k.org +17 -17 # m68k: handle new gcc's # # ChangeSet # 2004/06/20 10:37:41-07:00 geert@linux-m68k.org # [PATCH] m68k: IFPSP060 update # # IFPSP060: Make sure that the destination address of a misaligned cas access is # properly mapped in, so the kernel won't oops in the emulation handler (from # Roman Zippel). # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # arch/m68k/ifpsp060/iskeleton.S # 2004/05/23 01:55:54-07:00 geert@linux-m68k.org +47 -5 # m68k: IFPSP060 update # # ChangeSet # 2004/06/20 09:59:33-07:00 hirofumi@mail.parknet.co.jp # [PATCH] FAT: don't use "utf8" charset and NLS_DEFAULT # # Recently, some distributors have set "utf8" to NLS_DEFAULT, therefore, # FAT uses the "iocharset=utf8" as default. But, since "iocharset=utf8" # doesn't provide the function (lower <-> upper conversion) which FAT # needs, so FAT can't provide suitable behavior. # # This patch does: # # - doesn't recognize "utf8" as "iocharset" # - doesn't use NLS_DEFAULT as default "iocharset" # - instead of NLS_DEFAULT, adds FAT_DEFAULT_CODEPAGE and # FAT_DEFAULT_IOCHARSET # # NOTE: the following looks like buggy, so it's not recommended # # "codepage=437,iocharset=iso8859-1,utf8" # # however, some utf8 file name can handle. (in this case, it uses the # table of iso8859-1 for lower <-> upper conversion) # # # Sign-off-by: Jesse Barnes # Sign-off-by: OGAWA Hirofumi # Sign-off-by: Linus Torvalds # # fs/fat/inode.c # 2004/06/19 11:30:39-07:00 hirofumi@mail.parknet.co.jp +46 -42 # FAT: don't use "utf8" charset and NLS_DEFAULT # # fs/Kconfig # 2004/06/19 11:30:39-07:00 hirofumi@mail.parknet.co.jp +19 -0 # FAT: don't use "utf8" charset and NLS_DEFAULT # # ChangeSet # 2004/06/20 09:56:58-07:00 torvalds@ppc970.osdl.org # Follow 2.4.x semantics for in-kernel signal sending. # # kernel/signal.c # 2004/06/20 09:56:52-07:00 torvalds@ppc970.osdl.org +7 -0 # Follow 2.4.x semantics for in-kernel signal sending. # # ChangeSet # 2004/06/20 09:33:28-07:00 arjanv@redhat.com # [PATCH] fix amd64 boot breakage # # This fixes a bug that prevent my amd64 box from booting; # numa_default_policy was __init however it's called like this in # init/main.c: # # free_initmem(); # unlock_kernel(); # system_state = SYSTEM_RUNNING; # numa_default_policy(); # # # eg after free_initmem(). This resulted in it being reused/freed and that # gives a nasty oops. # # mm/mempolicy.c # 2004/06/20 02:29:33-07:00 arjanv@redhat.com +1 -1 # fix amd64 boot breakage # # ChangeSet # 2004/06/20 07:00:13-05:00 stevef@steveft21.ltcsamba # Do not kill cifsd thread until last smb session on tcp session is # SMBulogged off. Fixes umounting bug (pointed out by Nick Millington) # when multiple mounts with different userids are mounted to the same # server from the client. # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/connect.c # 2004/06/20 06:59:52-05:00 stevef@steveft21.ltcsamba +18 -10 # Do not kill cifsd thread until last smb session on tcp session is # SMBulogged off. # # fs/cifs/cifssmb.c # 2004/06/20 06:59:51-05:00 stevef@steveft21.ltcsamba +1 -0 # return unique error, when last smb session on a tcp session is logged off. # # fs/cifs/CHANGES # 2004/06/20 06:59:51-05:00 stevef@steveft21.ltcsamba +3 -0 # update cifs change log # # fs/cifs/AUTHORS # 2004/06/20 06:59:51-05:00 stevef@steveft21.ltcsamba +1 -1 # update list of contributors of bug reports # # ChangeSet # 2004/06/20 03:03:06-03:00 acme@toy.kerneljanitors.org # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/ip6_checksum.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +94 -0 # # net/ipv6/udp.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv6/tcp_ipv6.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv6/raw.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +2 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv6/ndisc.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv6/mcast.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv6/icmp.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_output.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +0 -64 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -48 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/netfilter/ipt_MASQUERADE.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/netfilter/ip_nat_standalone.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/netfilter/ip_fw_compat_redir.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/netfilter/ip_conntrack_standalone.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/netfilter/ip_conntrack_core.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/skbuff.c # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +76 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/tcp.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +24 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/ip6_checksum.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +0 -0 # BitKeeper file /home/acme/bk/net-2.6/include/net/ip6_checksum.h # # include/net/ip.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/checksum.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +1 -69 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # include/linux/skbuff.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +24 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # include/linux/errqueue.h # 2004/06/20 03:02:54-03:00 acme@toy.kerneljanitors.org +4 -0 # [NET] generalise tcp_add_data, skb_split and tcp_copy_to_page # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/19 21:20:36-07:00 akpm@osdl.org # [NET]: Fix warning in farsync WAN driver. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/wan/farsync.c # 2004/06/19 21:20:21-07:00 akpm@osdl.org +1 -1 # [NET]: Fix warning in farsync WAN driver. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/19 16:47:14-07:00 yoshfuji@linux-ipv6.org # [ECONET]: Fix some warnings. # # net/econet/af_econet.c # 2004/06/19 16:46:52-07:00 yoshfuji@linux-ipv6.org +10 -4 # [ECONET]: Fix some warnings. # # ChangeSet # 2004/06/19 17:45:27-04:00 ralf@linux-mips.org # [PATCH] hdlcdrv needs to stop queueing # # We better stop the queue in the close call. # # Signed-off-by: Ralf Baechle # # drivers/net/hamradio/hdlcdrv.c # 2004/05/10 10:13:02-04:00 ralf@linux-mips.org +2 -0 # hdlcdrv needs to stop queueing # # ChangeSet # 2004/06/19 17:45:19-04:00 ralf@linux-mips.org # [PATCH] Cosmetic cleanups to sb1250-mac.c # # Signed-off-by: Ralf Baechle # # drivers/net/sb1250-mac.c # 2004/06/09 08:33:56-04:00 ralf@linux-mips.org +2 -2 # Cosmetic cleanups to sb1250-mac.c # # ChangeSet # 2004/06/19 17:45:10-04:00 ralf@linux-mips.org # [PATCH] Reformat # # Pure microcosmetic. # # Signed-off-by: Ralf Baechle # # drivers/net/tc35815.c # 2004/04/21 20:35:51-04:00 ralf@linux-mips.org +1 -1 # Reformat # # ChangeSet # 2004/06/19 17:45:01-04:00 ralf@linux-mips.org # [PATCH] Use netdev_priv in sgiseeq # # The combined allocation of of receive and transmit rings and driver data # so far made the use of netdev_priv impossible. Split the allocation # and use netdev_priv to access the non-ring driver_private data. # # Signed-off-by: Ralf Baechle # # drivers/net/sgiseeq.c # 2004/05/10 10:13:02-04:00 ralf@linux-mips.org +75 -70 # Use netdev_priv in sgiseeq # # ChangeSet # 2004/06/19 17:41:19-04:00 arjanv@redhat.com # [PATCH] sk98lin pci id # # drivers/net/sk98lin/h/skdrv2nd.h # 2004/06/18 20:00:00-04:00 arjanv@redhat.com +2 -1 # sk98lin pci id # # ChangeSet # 2004/06/19 17:36:14-04:00 ryan@michonline.com # [PATCH] orinoco.c rate limit lost information frame message # # Rate limit a (apparently) harmless warning in orinoco.c # # (My laptop remained connected with active X applications running over # ssh while this message was hitting every second, since I patched my # driver to include this the problem hasn't recurred.) # # Signed-Off-By: Ryan Anderson # # drivers/net/wireless/orinoco.c # 2004/06/13 17:20:20-04:00 ryan@michonline.com +2 -1 # orinoco.c rate limit lost information frame message # # ChangeSet # 2004/06/19 17:12:57-04:00 brazilnut@us.ibm.com # [PATCH] pcnet32: cleanup IRQ limitation. # # Cleanup pcnet32 IRQ handling based on suggestions from Ralf Baechle # , and Brian Murphy # # Tested by myself and Brian Murphy. # # Please also apply to 2.4.27-pre6. # # Signed-off-by: Don Fry # # drivers/net/pcnet32.c # 2004/06/17 09:14:53-04:00 brazilnut@us.ibm.com +12 -14 # pcnet32: cleanup IRQ limitation. # # ChangeSet # 2004/06/19 17:12:48-04:00 brazilnut@us.ibm.com # [PATCH] pcnet32: recover after rx hang. # # This patch fixes a receive hang that occasionally occurs after a Tx # FIFO underrun. The receive dma remains in a hung state sometimes. The # transmit operations continue to occur, but no receive activity. # # This was reproduced on several ppc64 systems and the fix has been verified # there. The patch has been tested as well on an ia32 system, which did # not experience the hang because it did not have fifo underruns, which is # a preqrequisite for the hang. The memory barriers decreased the frequency # of occurrence. The final change to reset the chip instead of just stopping # it eliminated the last hangs. # # Please also apply against 2.4.7 (with offset of -1), tested ia32. # # Signed-off by: brazilnut@us.ibm.com # # drivers/net/pcnet32.c # 2004/06/15 06:00:17-04:00 brazilnut@us.ibm.com +30 -10 # pcnet32: recover after rx hang. # # ChangeSet # 2004/06/19 17:12:39-04:00 brazilnut@us.ibm.com # [PATCH] pcnet32: discard oversize rx packets # # This patch will discard received frames that are larger than one buffer. # This has been tested on ia32 and ppc64 systems. # # Please also apply to 2.4.7 (with offset of -3), tested ia32. # # Signed-off by: brazilnut@us.ibm.com # # drivers/net/pcnet32.c # 2004/06/15 05:36:43-04:00 brazilnut@us.ibm.com +10 -3 # pcnet32: discard oversize rx packets # # ChangeSet # 2004/06/19 17:09:31-04:00 davem@redhat.com # [PATCH] hamachi DMA # # Let's get this thing not using bus_to_virt() anymore, # as follows. # # Signed-off-by: David S. Miller # # ===== drivers/net/hamachi.c 1.35 vs edited ===== # # drivers/net/hamachi.c # 2004/06/16 14:15:20-04:00 davem@redhat.com +1 -3 # hamachi DMA # # ChangeSet # 2004/06/19 17:08:21-04:00 fenlason@redhat.com # [PATCH] sunhme patch # # Without this patch, insmod-ing the sunhme module crashes on my fc2 # box. # # -- JF # # drivers/net/sunhme.c # 2004/06/16 20:29:23-04:00 fenlason@redhat.com +2 -1 # hme patch # # ChangeSet # 2004/06/19 17:07:34-04:00 jeb.j.cramer@intel.com # [PATCH] e1000 management reset fix # # * Resetting the adapter blew away management settings. So we save the # important bits before performing a reset. # # drivers/net/e1000/e1000_main.c # 2004/06/18 20:00:00-04:00 jeb.j.cramer@intel.com +9 -1 # e1000 management reset fix # # drivers/net/e1000/e1000_hw.h # 2004/06/18 20:00:00-04:00 jeb.j.cramer@intel.com +2 -0 # e1000 management reset fix # # drivers/net/e1000/e1000_hw.c # 2004/06/18 20:00:00-04:00 jeb.j.cramer@intel.com +35 -0 # e1000 management reset fix # # drivers/net/e1000/e1000.h # 2004/06/18 20:00:00-04:00 jeb.j.cramer@intel.com +1 -0 # e1000 management reset fix # # ChangeSet # 2004/06/19 17:07:25-04:00 shemminger@osdl.org # [PATCH] convert sk fddi driver to ANSI C # # Sparse does not handle K&R at all, and I think I saw Linus saying that # he has no intention of adding it to sparse while ago. So here is a blob # of patch to convert drivers/net/skfp/* from K&R to ANSI-C. Compile # tested with "make allmodconfig" on x86, as I obviously don't have the # HW. # # Mika # # Signed-off-by: Stephen Hemminger # # drivers/net/skfp/srf.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +11 -23 # convert sk fddi driver to ANSI C # # drivers/net/skfp/smttimer.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +9 -26 # convert sk fddi driver to ANSI C # # drivers/net/skfp/smtparse.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +9 -17 # convert sk fddi driver to ANSI C # # drivers/net/skfp/smtinit.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +5 -6 # convert sk fddi driver to ANSI C # # drivers/net/skfp/smtdef.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +10 -21 # convert sk fddi driver to ANSI C # # drivers/net/skfp/smt.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +142 -265 # convert sk fddi driver to ANSI C # # drivers/net/skfp/skfddi.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +2 -15 # convert sk fddi driver to ANSI C # # drivers/net/skfp/rmt.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +25 -45 # convert sk fddi driver to ANSI C # # drivers/net/skfp/queue.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +6 -18 # convert sk fddi driver to ANSI C # # drivers/net/skfp/pmf.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +24 -54 # convert sk fddi driver to ANSI C # # drivers/net/skfp/pcmplc.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +47 -117 # convert sk fddi driver to ANSI C # # drivers/net/skfp/lnkstat.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +5 -10 # convert sk fddi driver to ANSI C # # drivers/net/skfp/hwt.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +9 -18 # convert sk fddi driver to ANSI C # # drivers/net/skfp/hwmtm.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +99 -122 # convert sk fddi driver to ANSI C # # drivers/net/skfp/h/smtstate.h # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +6 -0 # convert sk fddi driver to ANSI C # # drivers/net/skfp/h/cmtdef.h # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +144 -178 # convert sk fddi driver to ANSI C # # drivers/net/skfp/fplustm.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +61 -129 # convert sk fddi driver to ANSI C # # drivers/net/skfp/ess.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +21 -41 # convert sk fddi driver to ANSI C # # drivers/net/skfp/ecm.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +11 -22 # convert sk fddi driver to ANSI C # # drivers/net/skfp/drvfbi.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +49 -132 # convert sk fddi driver to ANSI C # # drivers/net/skfp/cfm.c # 2004/06/17 17:49:49-04:00 shemminger@osdl.org +10 -25 # convert sk fddi driver to ANSI C # # ChangeSet # 2004/06/19 17:06:09-04:00 akpm@osdl.org # [PATCH] H8/300: smc9194 driver # # From: Yoshinori Sato # # - H8/300 target support # - fixed irq support # - high address (>0xffff) i/o fix # # Signed-off-by: Andrew Morton # # drivers/net/smc9194.c # 2004/06/18 01:19:59-04:00 akpm@osdl.org +65 -9 # H8/300: smc9194 driver # # ChangeSet # 2004/06/19 17:04:50-04:00 herbert@gondor.apana.org.au # [PATCH] Re: linux-2.6.7 Equalizer Load-balancer. eql.c. local non-privileged DoS # # Vitaly V. Bursov wrote: # > # > there are multiple vulns in drivers/net/eql.c # > # > if there is no such device, dev_get_by_name returns NULL and everything dies. # > Exploiting this is trivial. # # Thanks for the report. This patch should fix them. # # Signed-off-by: Herbert Xu # # Cheers, # -- # Visit Openswan at http://www.openswan.org/ # Email: Herbert Xu ~{PmV>HI~} # Home Page: http://gondor.apana.org.au/~herbert/ # PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt # -- # ===== drivers/net/eql.c 1.13 vs edited ===== # # drivers/net/eql.c # 2004/06/18 07:30:49-04:00 herbert@gondor.apana.org.au +4 -0 # Re: linux-2.6.7 Equalizer Load-balancer. eql.c. local non-privileged DoS # # ChangeSet # 2004/06/19 17:00:28-04:00 achirica@telefonica.net # [wireless airo] Clean initialization of Mini-PCI cards even from suspend # # drivers/net/wireless/airo.c # 2004/06/18 16:56:26-04:00 achirica@telefonica.net +28 -12 # Clean initialization of Mini-PCI cards even from suspend # # ChangeSet # 2004/06/19 12:48:23-07:00 davem@nuts.davemloft.net # [IPV6]: Export necessary xfrm6_tunnel functions. # # net/ipv6/xfrm6_tunnel.c # 2004/06/19 12:48:05-07:00 davem@nuts.davemloft.net +11 -0 # [IPV6]: Export necessary xfrm6_tunnel functions. # # ChangeSet # 2004/06/19 11:55:24-07:00 yoshfuji@linux-ipv6.org # [NET]: Fix some userland header bustage. # # include/linux/netfilter_ipv6/ip6_tables.h # 2004/06/19 11:55:10-07:00 yoshfuji@linux-ipv6.org +3 -0 # [NET]: Fix some userland header bustage. # # include/linux/netfilter_ipv4/ip_tables.h # 2004/06/19 11:55:10-07:00 yoshfuji@linux-ipv6.org +2 -1 # [NET]: Fix some userland header bustage. # # include/linux/netfilter_arp/arp_tables.h # 2004/06/19 11:55:10-07:00 yoshfuji@linux-ipv6.org +1 -1 # [NET]: Fix some userland header bustage. # # include/linux/netfilter.h # 2004/06/19 11:55:10-07:00 yoshfuji@linux-ipv6.org +1 -0 # [NET]: Fix some userland header bustage. # # ChangeSet # 2004/06/19 11:36:58-07:00 akpm@osdl.org # [NET]: Fix econet build bustage. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/econet/af_econet.c # 2004/06/19 11:36:43-07:00 akpm@osdl.org +2 -2 # [NET]: Fix econet build bustage. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/19 07:50:55-07:00 mikulas@artax.karlin.mff.cuni.cz # [PATCH] HPFS fixes for 2.6.7 kernel # # This contains hpfs fixes from my source ported to 2.6.7 kernel: # # updates: # - allocator fragments files less # - OS/2 Warp Server filesystem can be mounted read/only # - added reschedule points so that it doesn't hog CPU # # bug fixes: # - filesystem error message when syncing or fsyncing deleted file (or when # system just writes it on its own) # - filesystem error on extremly fragmented files # - corrupted disk structures could possibly corrupt memory # # fs/hpfs/super.c # 2004/06/18 18:13:55-07:00 mikulas@artax.karlin.mff.cuni.cz +1 -0 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/map.c # 2004/06/18 18:09:05-07:00 mikulas@artax.karlin.mff.cuni.cz +4 -2 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/inode.c # 2004/06/18 18:13:20-07:00 mikulas@artax.karlin.mff.cuni.cz +9 -7 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/hpfs_fn.h # 2004/06/18 18:01:00-07:00 mikulas@artax.karlin.mff.cuni.cz +3 -2 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/hpfs.h # 2004/06/18 17:58:08-07:00 mikulas@artax.karlin.mff.cuni.cz +1 -1 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/ea.c # 2004/06/18 17:57:50-07:00 mikulas@artax.karlin.mff.cuni.cz +3 -5 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/buffer.c # 2004/06/18 17:55:53-07:00 mikulas@artax.karlin.mff.cuni.cz +8 -0 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/anode.c # 2004/06/18 17:49:38-07:00 mikulas@artax.karlin.mff.cuni.cz +1 -2 # HPFS fixes for 2.6.7 kernel # # fs/hpfs/alloc.c # 2004/06/18 18:44:32-07:00 mikulas@artax.karlin.mff.cuni.cz +44 -26 # HPFS fixes for 2.6.7 kernel # # Documentation/filesystems/hpfs.txt # 2004/06/18 18:17:43-07:00 mikulas@artax.karlin.mff.cuni.cz +10 -2 # HPFS fixes for 2.6.7 kernel # # ChangeSet # 2004/06/19 07:50:44-07:00 akpm@osdl.org # [PATCH] mptctl.c build fix # # drivers/message/fusion/mptctl.c:89:24: asm/compat.h: No such file or directory # # Signed-off-by: Andrew Morton # # drivers/message/fusion/mptctl.c # 2004/06/19 00:22:47-07:00 akpm@osdl.org +1 -1 # mptctl.c build fix # # ChangeSet # 2004/06/19 07:49:02-07:00 torvalds@ppc970.osdl.org # Merge http://lia64.bkbits.net/to-linus-2.5 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # include/asm-ia64/pgtable.h # 2004/06/19 07:48:59-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # arch/ia64/kernel/iosapic.c # 2004/06/19 07:48:59-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # arch/ia64/ia32/ia32_entry.S # 2004/06/19 07:48:59-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2004/06/18 21:52:08-07:00 yanmin.zhang@intel.com # [PATCH] ia64: fix free_huge_page() call in hugetlb_prefault() # # In base kernel 2.6.7, there is bug in function hugetlb_prefault(). The # call to free_huge_page() is incorrect and should be replaced with a call # to page_cache_release(). # # Signed-off-by: David Mosberger # # arch/ia64/mm/hugetlbpage.c # 2004/06/18 00:26:02-07:00 yanmin.zhang@intel.com +1 -1 # ia64: fix free_huge_page() call in hugetlb_prefault() # # ChangeSet # 2004/06/18 21:49:12-07:00 eranian@hpl.hp.com # [PATCH] ia64: perfmon stack consumption fix # # This patch moves the pfm_ovfl_arg_t structure from the kernel stack # into the pfm_context_t structure. This minimizes kernel stack space # consumption. # # Signed-off-by: Stephane Eranian # Signed-off-by: David Mosberger # # arch/ia64/kernel/perfmon.c # 2004/06/18 09:17:04-07:00 eranian@hpl.hp.com +20 -18 # ia64: perfmon stack consumption fix # # ChangeSet # 2004/06/18 21:45:35-07:00 ashok.raj@intel.com # [PATCH] ia64: move move_irq() from iosapic.c to irq.c # # This patch moves move_irq() from ioaspic.c to irq.c to make this common # for ia64 subarches. # # Signed-off-by: Ashok Raj # Signed-off-by: David Mosberger # # include/asm-ia64/irq.h # 2004/06/18 15:22:57-07:00 ashok.raj@intel.com +6 -0 # ia64: move move_irq() from iosapic.c to irq.c # # arch/ia64/kernel/irq.c # 2004/06/18 15:22:57-07:00 ashok.raj@intel.com +16 -0 # ia64: move move_irq() from iosapic.c to irq.c # # arch/ia64/kernel/iosapic.c # 2004/06/18 15:22:57-07:00 ashok.raj@intel.com +0 -16 # ia64: move move_irq() from iosapic.c to irq.c # # ChangeSet # 2004/06/18 21:42:42-07:00 arun.sharma@intel.com # [PATCH] ia64: fix ia32 partial-page map support for overlapping mmaps # # - Handle the overlapping mmaps in the MAP_FIXED case # - Handle unmaps correctly i.e. call __ia32_delete_pp_range() # - There are now three clear entry points into the pp manipulation code # - ia32_set_pp # - ia32_unset_pp # - ia32_compare_pp # - Rename internal functions to __ia32_*pp_* # - Grab mmap_sem just once at the main entry point # # Signed-off-by: Gordon Jin # Signed-off-by: Arun Sharma # Signed-off-by: David Mosberger # # arch/ia64/ia32/sys_ia32.c # 2004/06/18 04:55:20-07:00 arun.sharma@intel.com +184 -134 # ia64: fix ia32 partial-page map support for overlapping mmaps # # ChangeSet # 2004/06/18 23:02:41-05:00 stevef@smfhome1.smfdom # check better for free files on writepage retry # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/file.c # 2004/06/18 23:02:34-05:00 stevef@smfhome1.smfdom +21 -7 # check better for free files on writepage retry # # ChangeSet # 2004/06/18 22:01:37-05:00 stevef@smfhome1.smfdom # Do not send junk in bcc area of oplock break SMB Lock request, and always let oplock break release # through even if requests are ahead of it waiting for responses to complete. # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/transport.c # 2004/06/18 22:01:30-05:00 stevef@smfhome1.smfdom +20 -15 # do not count oplock breaks against in flight count # # fs/cifs/connect.c # 2004/06/18 22:01:30-05:00 stevef@smfhome1.smfdom +1 -1 # do not reset inFlight count on reconnection so it does not go negative # # fs/cifs/cifssmb.c # 2004/06/18 22:01:30-05:00 stevef@smfhome1.smfdom +14 -8 # Do not send junk in bcc area of oplock break SMB Lock request # # fs/cifs/CHANGES # 2004/06/18 22:01:30-05:00 stevef@smfhome1.smfdom +2 -1 # update cifs vfs change log for 1.19 # # ChangeSet # 2004/06/18 18:26:37-07:00 rddunlap@osdl.org # [PATCH] sparse: lib/string.c sparse fix # # A classic.. # # lib/string.c:165:19: warning: assignment expression in conditional # # From: Mika Kukkonen # Signed-off-by: Randy Dunlap # # lib/string.c # 2004/06/09 12:58:48-07:00 rddunlap@osdl.org +1 -1 # sparse: lib/string.c sparse fix # # ChangeSet # 2004/06/18 18:26:26-07:00 rddunlap@osdl.org # [PATCH] sparse: kernel/module.c sparse fix # # Add __user annotation for !CONFIG_MODULE_UNLOAD case. # # From: Mika Kukkonen # Signed-off-by: Randy Dunlap # # kernel/module.c # 2004/06/09 13:11:44-07:00 rddunlap@osdl.org +1 -1 # sparse: kernel/module.c sparse fix # # ChangeSet # 2004/06/18 16:46:25-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/video/sis annotation # # drivers/video/sis/sis_main.c # 2004/06/18 09:43:52-07:00 viro@www.linux.org.uk +16 -15 # sparse: drivers/video/sis annotation # # ChangeSet # 2004/06/18 16:37:47-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/video/aty annotation # # drivers/video/aty/radeon_base.c # 2004/06/18 09:36:48-07:00 viro@www.linux.org.uk +4 -4 # sparse: drivers/video/aty annotation # # ChangeSet # 2004/06/18 16:35:56-07:00 torvalds@ppc970.osdl.org # Merge ppc970.osdl.org:/home/torvalds/v2.6/v2.6.7 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # include/linux/ipmi.h # 2004/06/18 16:35:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # include/linux/fb.h # 2004/06/18 16:35:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # fs/binfmt_aout.c # 2004/06/18 16:35:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/video/fbmem.c # 2004/06/18 16:35:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/char/ipmi/ipmi_watchdog.c # 2004/06/18 16:35:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/char/ipmi/ipmi_devintf.c # 2004/06/18 16:35:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2004/06/18 16:35:04-07:00 viro@www.linux.org.uk # [PATCH] sparse: autofs annotation # # fs/autofs/root.c # 2004/06/18 11:14:07-07:00 viro@www.linux.org.uk +7 -6 # sparse: autofs annotation # # ChangeSet # 2004/06/18 16:34:54-07:00 viro@www.linux.org.uk # [PATCH] sparse: synclinkmp annotation # # drivers/char/synclinkmp.c # 2004/06/18 11:19:11-07:00 viro@www.linux.org.uk +22 -21 # sparse: synclinkmp annotation # # ChangeSet # 2004/06/18 16:34:45-07:00 viro@www.linux.org.uk # [PATCH] sparse: cyclades annotation # # drivers/char/cyclades.c # 2004/06/18 11:16:10-07:00 viro@www.linux.org.uk +29 -30 # sparse: cyclades annotation # # ChangeSet # 2004/06/18 16:34:35-07:00 viro@www.linux.org.uk # [PATCH] sparse: ipmi annotation # # include/linux/ipmi.h # 2004/06/18 11:18:12-07:00 viro@www.linux.org.uk +2 -2 # sparse: ipmi annotation # # drivers/char/ipmi/ipmi_watchdog.c # 2004/06/18 11:18:46-07:00 viro@www.linux.org.uk +10 -13 # sparse: ipmi annotation # # drivers/char/ipmi/ipmi_devintf.c # 2004/06/18 11:18:33-07:00 viro@www.linux.org.uk +14 -13 # sparse: ipmi annotation # # ChangeSet # 2004/06/18 16:34:24-07:00 viro@www.linux.org.uk # [PATCH] sparse: amd64 bits # # - added define of __x86_64__ to sparse arguments on amd64 # - switched amd64 uaccess.h to __chk_user_ptr() # # include/asm-x86_64/uaccess.h # 2004/06/18 11:15:18-07:00 viro@www.linux.org.uk +34 -44 # sparse: amd64 bits # # arch/x86_64/Makefile # 2004/06/18 11:15:02-07:00 viro@www.linux.org.uk +2 -0 # sparse: amd64 bits # # ChangeSet # 2004/06/18 16:34:14-07:00 viro@www.linux.org.uk # [PATCH] sparse: applicom annotation # # drivers/char/applicom.c # 2004/06/18 11:19:50-07:00 viro@www.linux.org.uk +10 -9 # sparse: applicom annotation # # ChangeSet # 2004/06/18 16:34:03-07:00 viro@www.linux.org.uk # [PATCH] sparse: udf cleanups # # removed bogus externs from declarations in fs/udf/* # # fs/udf/misc.c # 2004/06/18 11:12:57-07:00 viro@www.linux.org.uk +6 -6 # sparse: udf cleanups # # fs/udf/crc.c # 2004/06/18 11:12:52-07:00 viro@www.linux.org.uk +1 -1 # sparse: udf cleanups # # ChangeSet # 2004/06/18 16:33:52-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/video/matrox annotation # # drivers/video/matrox/matroxfb_crtc2.c # 2004/06/18 11:08:45-07:00 viro@www.linux.org.uk +5 -5 # sparse: drivers/video/matrox annotation # # drivers/video/matrox/matroxfb_base.c # 2004/06/18 11:08:34-07:00 viro@www.linux.org.uk +16 -15 # sparse: drivers/video/matrox annotation # # ChangeSet # 2004/06/18 16:33:41-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/video/kyro annotation # # drivers/video/kyro/fbdev.c # 2004/06/18 11:07:54-07:00 viro@www.linux.org.uk +6 -6 # sparse: drivers/video/kyro annotation # # ChangeSet # 2004/06/18 16:33:31-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/video partial annotation # # misc annotation in drivers/video/* (nowhere near complete) # # include/linux/fb.h # 2004/06/18 11:11:09-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/video partial annotation # # drivers/video/sstfb.c # 2004/06/18 11:10:17-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/video partial annotation # # drivers/video/radeonfb.c # 2004/06/18 11:10:06-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/video partial annotation # # drivers/video/imsttfb.c # 2004/06/18 11:10:31-07:00 viro@www.linux.org.uk +10 -9 # sparse: drivers/video partial annotation # # drivers/video/fbmem.c # 2004/06/18 11:10:53-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/video partial annotation # # ChangeSet # 2004/06/18 16:33:20-07:00 viro@www.linux.org.uk # [PATCH] sparse: nfs partial annotation # # include/linux/nfs4_mount.h # 2004/06/18 11:11:45-07:00 viro@www.linux.org.uk +3 -3 # sparse: nfs partial annotation # # fs/nfs/idmap.c # 2004/06/18 11:12:29-07:00 viro@www.linux.org.uk +6 -5 # sparse: nfs partial annotation # # fs/nfs/direct.c # 2004/06/18 11:12:14-07:00 viro@www.linux.org.uk +1 -1 # sparse: nfs partial annotation # # ChangeSet # 2004/06/18 16:33:09-07:00 viro@www.linux.org.uk # [PATCH] sparse: mwave annotation # # drivers/char/mwave/tp3780i.h # 2004/06/18 11:17:27-07:00 viro@www.linux.org.uk +2 -2 # sparse: mwave annotation # # drivers/char/mwave/tp3780i.c # 2004/06/18 11:17:27-07:00 viro@www.linux.org.uk +2 -2 # sparse: mwave annotation # # drivers/char/mwave/mwavedd.c # 2004/06/18 11:17:27-07:00 viro@www.linux.org.uk +17 -20 # sparse: mwave annotation # # drivers/char/mwave/3780i.h # 2004/06/18 11:17:27-07:00 viro@www.linux.org.uk +5 -5 # sparse: mwave annotation # # drivers/char/mwave/3780i.c # 2004/06/18 11:17:27-07:00 viro@www.linux.org.uk +10 -10 # sparse: mwave annotation # # ChangeSet # 2004/06/18 16:32:59-07:00 viro@www.linux.org.uk # [PATCH] sparse: binfmt_aout annotation # # fs/binfmt_aout.c # 2004/06/18 11:13:43-07:00 viro@www.linux.org.uk +13 -12 # sparse: binfmt_aout annotation # # ChangeSet # 2004/06/18 14:14:17-07:00 akpm@osdl.org # [NET]: Fix eql.c failed dev_get_by_name() return value check. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/eql.c # 2004/06/18 14:14:03-07:00 akpm@osdl.org +5 -1 # [NET]: Fix eql.c failed dev_get_by_name() return value check. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/18 14:12:29-07:00 yoshfuji@linux-ipv6.org # [IPV6]: Fix autoconf description in ip-sysctl.txt. # # Documentation/networking/ip-sysctl.txt # 2004/06/18 14:12:15-07:00 yoshfuji@linux-ipv6.org +4 -2 # [IPV6]: Fix autoconf description in ip-sysctl.txt. # # ChangeSet # 2004/06/18 14:11:36-07:00 wli@holomorphy.com # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/irda/irda_device.c # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +2 -2 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # include/net/irda/irda_device.h # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +3 -1 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/w83977af_ir.h # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +3 -0 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/w83977af_ir.c # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +19 -12 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/via-ircc.h # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +3 -0 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/via-ircc.c # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +18 -10 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/smsc-ircc2.c # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +20 -11 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/nsc-ircc.h # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +3 -0 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/nsc-ircc.c # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +19 -11 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/ali-ircc.h # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +3 -0 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/irda/ali-ircc.c # 2004/06/18 14:11:22-07:00 wli@holomorphy.com +19 -11 # [IRDA]: Remove usage of isa_virt_to_bus() # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/18 14:09:17-07:00 dlstevens@us.ibm.com # [IPV6]: Handle user asking for any device in mcast calls. # # net/ipv6/mcast.c # 2004/06/18 14:09:03-07:00 dlstevens@us.ibm.com +1 -1 # [IPV6]: Handle user asking for any device in mcast calls. # # ChangeSet # 2004/06/18 13:54:52-07:00 shemminger@osdl.org # [PKT_SCHED]: Add loss option to network delay scheduler. # # This enhances the network simulation scheduler to do simple random loss. # # The loss parameter is a simple 32 bit value such that 0 means no loss, and # 0xffffffff is always drop. I have a new version of the tc command which takes # care of conversion from percent to this value. # # Same patch for 2.4 and 2.6 # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/sched/sch_delay.c # 2004/06/18 13:54:39-07:00 shemminger@osdl.org +9 -0 # [PKT_SCHED]: Add loss option to network delay scheduler. # # This enhances the network simulation scheduler to do simple random loss. # # The loss parameter is a simple 32 bit value such that 0 means no loss, and # 0xffffffff is always drop. I have a new version of the tc command which takes # care of conversion from percent to this value. # # Same patch for 2.4 and 2.6 # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # include/linux/pkt_sched.h # 2004/06/18 13:54:39-07:00 shemminger@osdl.org +2 -1 # [PKT_SCHED]: Add loss option to network delay scheduler. # # This enhances the network simulation scheduler to do simple random loss. # # The loss parameter is a simple 32 bit value such that 0 means no loss, and # 0xffffffff is always drop. I have a new version of the tc command which takes # care of conversion from percent to this value. # # Same patch for 2.4 and 2.6 # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/18 13:51:42-07:00 davem@nuts.davemloft.net # [PKT_SCHED]: Do not check netif_queue_stopped() in dequeue ops, races with driver. # # Based upon a patch from Stephen Hemminger. # Signed-off-by: David S. Miller # # net/sched/sch_tbf.c # 2004/06/18 13:51:18-07:00 davem@nuts.davemloft.net +5 -7 # [PKT_SCHED]: Do not check netif_queue_stopped() in dequeue ops, races with driver. # # Based upon a patch from Stephen Hemminger. # # Signed-off-by: David S. Miller # # net/sched/sch_htb.c # 2004/06/18 13:51:18-07:00 davem@nuts.davemloft.net +0 -1 # [PKT_SCHED]: Do not check netif_queue_stopped() in dequeue ops, races with driver. # # Based upon a patch from Stephen Hemminger. # # Signed-off-by: David S. Miller # # net/sched/sch_hfsc.c # 2004/06/18 13:51:18-07:00 davem@nuts.davemloft.net +1 -2 # [PKT_SCHED]: Do not check netif_queue_stopped() in dequeue ops, races with driver. # # Based upon a patch from Stephen Hemminger. # # Signed-off-by: David S. Miller # # net/sched/sch_delay.c # 2004/06/18 13:51:18-07:00 davem@nuts.davemloft.net +5 -7 # [PKT_SCHED]: Do not check netif_queue_stopped() in dequeue ops, races with driver. # # Based upon a patch from Stephen Hemminger. # # Signed-off-by: David S. Miller # # net/sched/sch_cbq.c # 2004/06/18 13:51:18-07:00 davem@nuts.davemloft.net +1 -1 # [PKT_SCHED]: Do not check netif_queue_stopped() in dequeue ops, races with driver. # # Based upon a patch from Stephen Hemminger. # # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/18 13:50:35-07:00 torvalds@ppc970.osdl.org # sparse: fix up fusion/mptctl.c after merge # # drivers/message/fusion/mptctl.c # 2004/06/18 13:50:29-07:00 torvalds@ppc970.osdl.org +8 -7 # sparse: fix up fusion/mptctl.c after merge # # ChangeSet # 2004/06/18 13:46:11-07:00 torvalds@ppc970.osdl.org # Merge # # drivers/message/fusion/mptctl.c # 2004/06/18 13:46:06-07:00 torvalds@ppc970.osdl.org +0 -2 # Merge # # drivers/scsi/scsi_syms.c # 2004/06/18 13:44:28-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/scsi_ioctl.c # 2004/06/18 13:44:28-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/fdomain.c # 2004/06/18 13:44:28-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/fd_mcs.c # 2004/06/18 13:44:28-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2004/06/18 13:43:51-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/message/fusion annotations and fixes # # Sigh... First of all, LSI folks have very quaint idea of existing # platforms and word sizes on those. Their definitions of U32 and S32 # should really be reserved for posterity (preferably chiseled into the # rock they have between the ears), but kernel is the wrong place for # that. Fixed. # # mptctl_do_mpt_command() was always called on userland pointers; # kernel/userland argument removed along with dead code, function # annotated, callers updated. # # The rest is trivial annotations in mptctl.c and in its ioctl structures # - nothing fancy there. # # drivers/message/fusion/mptctl.h # 2004/06/18 08:09:14-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -5 # sparse: drivers/message/fusion annotations and fixes # # drivers/message/fusion/mptctl.c # 2004/06/18 08:09:16-07:00 viro@parcelfarce.linux.theplanet.co.uk +68 -77 # sparse: drivers/message/fusion annotations and fixes # # drivers/message/fusion/lsi/mpi_type.h # 2004/06/18 08:09:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -11 # sparse: drivers/message/fusion annotations and fixes # # ChangeSet # 2004/06/18 13:43:40-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] crapectomy - last users of kernel_scsi_ioctl() gone # # Last 3 users of kernel_scsi_ioctl() eliminated; two of them used to read # partition table by issuing a READ6 via ioctl (instead of just calling # scsi_bios_ptable() as every other ->biosparam() instance does). # # The last one was doing a very quaint access to fields of scsi_device by # issuing SCSI_IOCLT_GET_LUN and then shuffling bits in the result. Down # with that insanity... # # ChangeSet # 2004/06/18 13:40:49-07:00 shemminger@osdl.org # [PKT_SCHED]: Delay scheduler should retry if requeue fails. # # If delay scheduler decides not to send the packet right away, it requeues # it. If the requeue fails, it should go and look again rather than waking # up prematurely. # # Same patch should apply to both 2.6 and 2.4 # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/sched/sch_delay.c # 2004/06/18 13:40:35-07:00 shemminger@osdl.org +9 -5 # [PKT_SCHED]: Delay scheduler should retry if requeue fails. # # If delay scheduler decides not to send the packet right away, it requeues # it. If the requeue fails, it should go and look again rather than waking # up prematurely. # # Same patch should apply to both 2.6 and 2.4 # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # include/scsi/scsi_ioctl.h # 2004/06/18 07:38:19-07:00 viro@parcelfarce.linux.theplanet.co.uk +0 -1 # crapectomy - last users of kernel_scsi_ioctl() gone # # drivers/scsi/scsi_syms.c # 2004/06/18 07:36:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +0 -1 # crapectomy - last users of kernel_scsi_ioctl() gone # # drivers/scsi/scsi_ioctl.c # 2004/06/18 07:36:38-07:00 viro@parcelfarce.linux.theplanet.co.uk +0 -16 # crapectomy - last users of kernel_scsi_ioctl() gone # # drivers/scsi/pcmcia/nsp_cs.c # 2004/06/18 07:37:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # crapectomy - last users of kernel_scsi_ioctl() gone # # drivers/scsi/fdomain.c # 2004/06/18 07:37:05-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -16 # crapectomy - last users of kernel_scsi_ioctl() gone # # drivers/scsi/fd_mcs.c # 2004/06/18 07:37:16-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -14 # crapectomy - last users of kernel_scsi_ioctl() gone # # ChangeSet # 2004/06/18 13:37:04-07:00 rmk+lkml@arm.linux.org.uk # [PATCH] Couple of sysfs patches # # On Wed, Jun 16, 2004 at 05:51:03PM -0500, Dmitry Torokhov wrote: # > What about freeing the resources? Can it be put in platform_device_unregister # > or is it release handler task? I'd put it in unregister because when I call # > unregister I expect device be half-dead and release as much resources as it # > can. # # # Here's the updated patch - to be applied on top of the # platform_get_resource() patch sent previously. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/18 13:36:39-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: ibmasmfs annotations # # Trivial annotations + couple of missing (void) in prototypes # # include/linux/device.h # 2004/06/10 12:15:03-07:00 rmk+lkml@arm.linux.org.uk +0 -1 # Couple of sysfs patches # # drivers/base/platform.c # 2004/06/18 13:24:02-07:00 rmk+lkml@arm.linux.org.uk +52 -39 # Couple of sysfs patches # # drivers/misc/ibmasm/ibmasmfs.c # 2004/06/18 08:05:56-07:00 viro@parcelfarce.linux.theplanet.co.uk +14 -14 # sparse: ibmasmfs annotations # # ChangeSet # 2004/06/18 13:36:27-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: ide-tape annotation # # drivers/ide/ide-tape.c # 2004/06/18 08:04:58-07:00 viro@parcelfarce.linux.theplanet.co.uk +11 -9 # sparse: ide-tape annotation # # ChangeSet # 2004/06/18 13:36:16-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/input annotations # # Trivial annotations in drivers/input # # drivers/input/tsdev.c # 2004/06/18 08:04:18-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/input annotations # # drivers/input/misc/uinput.c # 2004/06/18 08:04:24-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/input annotations # # drivers/input/joydev.c # 2004/06/18 08:04:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +21 -20 # sparse: drivers/input annotations # # ChangeSet # 2004/06/18 13:36:05-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/char/watchdog annotation # # Trivial annotations in drivers/char/watchdog/* # # drivers/char/watchdog/wdt_pci.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -7 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -7 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/wafer5823wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -7 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/w83877f_wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/w83627hf_wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/softdog.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -5 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/scx200_wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/sc520_wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/sc1200wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -7 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/sbc60xxwdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/pcwd_usb.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +11 -9 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/pcwd_pci.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +11 -9 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/mixcomwd.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -4 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/machzwd.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -4 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/ib700wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -5 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/i8xx_tco.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/eurotechwdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -8 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/cpu5wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -4 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/alim7101_wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/alim1535_wdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/advantechwdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -6 # sparse: drivers/char/watchdog annotation # # drivers/char/watchdog/acquirewdt.c # 2004/06/18 07:43:25-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -5 # sparse: drivers/char/watchdog annotation # # ChangeSet # 2004/06/18 13:35:54-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: ixj annotated # # drivers/telephony (aka ixj.c) annotated, IXJ_CADENCE split into kernel # and userland variants, ioctl structures got __user on pointers. # # include/linux/ixjuser.h # 2004/06/18 07:40:16-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: ixj annotated # # drivers/telephony/ixj.h # 2004/06/18 07:39:46-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -2 # sparse: ixj annotated # # drivers/telephony/ixj.c # 2004/06/18 07:39:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +61 -45 # sparse: ixj annotated # # ChangeSet # 2004/06/18 13:35:42-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: vm86.c annotated # # vm86.c annotated; vm86old(2) and vm86(2) switched to explicit # # int (struct pt_regs regs) # # format. # # arch/i386/kernel/vm86.c # 2004/06/18 07:35:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +19 -13 # sparse: vm86.c annotated # # ChangeSet # 2004/06/18 13:35:31-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: rt_sigsuspend/sigaltstack sanitized # # rt_sigsuspend() and sigaltstack() prototype changed; instead of # playing games with casts of argument address to struct pt_regs * and # digging through it, we declare them as # # int (struct pt_regs regs) # # instead. # # arch/i386/kernel/signal.c # 2004/06/18 07:35:29-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -9 # sparse: rt_sigsuspend/sigaltstack sanitized # # ChangeSet # 2004/06/18 13:35:20-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: i387 math-emu annotation # # arch/i386/math-emu/* annotated. # # arch/i386/math-emu/reg_ld_str.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +75 -75 # sparse: i387 math-emu annotation # # arch/i386/math-emu/reg_compare.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: i387 math-emu annotation # # arch/i386/math-emu/load_store.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +26 -26 # sparse: i387 math-emu annotation # # arch/i386/math-emu/get_address.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +15 -15 # sparse: i387 math-emu annotation # # arch/i386/math-emu/fpu_system.h # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: i387 math-emu annotation # # arch/i386/math-emu/fpu_proto.h # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +21 -21 # sparse: i387 math-emu annotation # # arch/i386/math-emu/fpu_etc.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: i387 math-emu annotation # # arch/i386/math-emu/fpu_entry.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +17 -16 # sparse: i387 math-emu annotation # # arch/i386/math-emu/fpu_aux.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +10 -10 # sparse: i387 math-emu annotation # # arch/i386/math-emu/fpu_arith.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +18 -18 # sparse: i387 math-emu annotation # # arch/i386/math-emu/errors.c # 2004/06/18 07:30:41-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -5 # sparse: i387 math-emu annotation # # ChangeSet # 2004/06/18 13:18:34-07:00 shemminger@osdl.org # [PKT_SCHED]: Delay scheduler enqueue always succeeds. # # If underlying fifo enqueue fails, return the status not 0. # Same patch should apply to both 2.6 and 2.4 # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/sched/sch_delay.c # 2004/06/18 13:18:20-07:00 shemminger@osdl.org +1 -1 # [PKT_SCHED]: Delay scheduler enqueue always succeeds. # # If underlying fifo enqueue fails, return the status not 0. # Same patch should apply to both 2.6 and 2.4 # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/18 13:15:58-07:00 shemminger@osdl.org # [BRIDGE]: Kill sysfs hotplug avoidance hacks. # # The whole effort to avoid hotplug was misguided. If it is really a problem # (which it doesn't appear to be) then it can more easily be addressed by smarter # hotplug scripts in user space. # # This patch gets rid of the whole subsystem hack for bridge kobjects. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_sysfs_if.c # 2004/06/18 13:15:34-07:00 shemminger@osdl.org +1 -1 # [BRIDGE]: Kill sysfs hotplug avoidance hacks. # # The whole effort to avoid hotplug was misguided. If it is really a problem # (which it doesn't appear to be) then it can more easily be addressed by smarter # hotplug scripts in user space. # # This patch gets rid of the whole subsystem hack for bridge kobjects. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_sysfs_br.c # 2004/06/18 13:15:34-07:00 shemminger@osdl.org +1 -18 # [BRIDGE]: Kill sysfs hotplug avoidance hacks. # # The whole effort to avoid hotplug was misguided. If it is really a problem # (which it doesn't appear to be) then it can more easily be addressed by smarter # hotplug scripts in user space. # # This patch gets rid of the whole subsystem hack for bridge kobjects. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_private.h # 2004/06/18 13:15:34-07:00 shemminger@osdl.org +0 -5 # [BRIDGE]: Kill sysfs hotplug avoidance hacks. # # The whole effort to avoid hotplug was misguided. If it is really a problem # (which it doesn't appear to be) then it can more easily be addressed by smarter # hotplug scripts in user space. # # This patch gets rid of the whole subsystem hack for bridge kobjects. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br.c # 2004/06/18 13:15:34-07:00 shemminger@osdl.org +0 -3 # [BRIDGE]: Kill sysfs hotplug avoidance hacks. # # The whole effort to avoid hotplug was misguided. If it is really a problem # (which it doesn't appear to be) then it can more easily be addressed by smarter # hotplug scripts in user space. # # This patch gets rid of the whole subsystem hack for bridge kobjects. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/18 19:53:46+01:00 rmk@flint.arm.linux.org.uk # [ARM] Remove NexusPCI/FTVPCI platform. # # This platform is no longer maintained, and its maintainer says that # the hardware is obsolete and out of circulation. # # arch/arm/common/Makefile # 2004/06/18 19:51:33+01:00 rmk@flint.arm.linux.org.uk +0 -1 # Remove FTVPCI PCI host driver. # # arch/arm/Makefile # 2004/06/18 19:51:33+01:00 rmk@flint.arm.linux.org.uk +0 -2 # Remove FTVPCI. # # arch/arm/Kconfig # 2004/06/18 19:51:32+01:00 rmk@flint.arm.linux.org.uk +4 -9 # Remove FTVPCI. # # ChangeSet # 2004/06/18 19:45:27+01:00 rmk@flint.arm.linux.org.uk # [ARM] Remove TBOX. # # This platform is no longer maintained, and its maintainer says that # the hardware is obsolete and out of circulation. # # ChangeSet # 2004/06/18 11:43:35-07:00 torvalds@ppc970.osdl.org # Merge bk://kernel.bkbits.net/davem/net-2.6 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # security/selinux/ss/services.c # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/ss/policydb.c # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/include/security.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/include/flask.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/include/class_to_string.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/include/av_permissions.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/include/av_perm_to_string.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/include/av_inherit.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/hooks.c # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/selinux/Makefile # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # security/dummy.c # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # net/netlink/af_netlink.c # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # include/linux/security.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # include/asm-ppc64/system.h # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # Documentation/filesystems/proc.txt # 2004/06/18 11:43:31-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # arch/arm/Makefile # 2004/06/18 19:42:57+01:00 rmk@flint.arm.linux.org.uk +0 -1 # Remove TBOX. # # BitKeeper/deleted/.del-plx90x0.c~6e00d8c4651bebd # 2004/06/18 19:22:53+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: arch/arm/common/plx90x0.c # # BitKeeper/deleted/.del-Makefile~743b0b21d18f48a3 # 2004/06/18 19:21:48+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: arch/arm/mach-tbox/Makefile # # BitKeeper/deleted/.del-Makefile~1bcec227c3749c2b # 2004/06/18 19:21:42+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: arch/arm/mach-ftvpci/Makefile # # BitKeeper/deleted/.del-vmalloc.h~6fe84d89a4fe0487 # 2004/06/18 19:20:44+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/vmalloc.h # # BitKeeper/deleted/.del-uncompress.h~d86deb706ce0af8c # 2004/06/18 19:20:41+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/uncompress.h # # BitKeeper/deleted/.del-timex.h~e40ee87eef3b5d82 # 2004/06/18 19:20:39+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/timex.h # # BitKeeper/deleted/.del-time.h~730e38fa47912a2c # 2004/06/18 19:20:37+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/time.h # # BitKeeper/deleted/.del-system.h~13cdaece381624c5 # 2004/06/18 19:20:34+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/system.h # # BitKeeper/deleted/.del-param.h~43f147e81e4d4aa # 2004/06/18 19:20:32+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/param.h # # BitKeeper/deleted/.del-memory.h~a8036cb472d809fd # 2004/06/18 19:20:31+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/memory.h # # BitKeeper/deleted/.del-irqs.h~4b397f62f210ba4a # 2004/06/18 19:20:29+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/irqs.h # # BitKeeper/deleted/.del-io.h~dad3ba234da9ed44 # 2004/06/18 19:20:28+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/io.h # # BitKeeper/deleted/.del-hardware.h~e2ae6d2a73466d92 # 2004/06/18 19:20:26+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/hardware.h # # BitKeeper/deleted/.del-dma.h~7c79d144ee7126 # 2004/06/18 19:20:25+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-nexuspci/dma.h # # BitKeeper/deleted/.del-vmalloc.h~9cc411fb2236e832 # 2004/06/18 19:20:24+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/vmalloc.h # # BitKeeper/deleted/.del-uncompress.h~ba1125271f695d9a # 2004/06/18 19:20:22+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/uncompress.h # # BitKeeper/deleted/.del-timex.h~21cf937463373e34 # 2004/06/18 19:20:20+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/timex.h # # BitKeeper/deleted/.del-time.h~e839fe4bcd9e4cf9 # 2004/06/18 19:20:18+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/time.h # # BitKeeper/deleted/.del-system.h~cd0858e052bb3f86 # 2004/06/18 19:20:16+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/system.h # # BitKeeper/deleted/.del-serial.h~4a4898b286343b2a # 2004/06/18 19:20:15+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/serial.h # # BitKeeper/deleted/.del-param.h~220f433111a13232 # 2004/06/18 19:20:13+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/param.h # # BitKeeper/deleted/.del-memory.h~32316a4b360340b5 # 2004/06/18 19:20:11+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/memory.h # # BitKeeper/deleted/.del-irqs.h~f8419d051722d58a # 2004/06/18 19:20:09+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/irqs.h # # BitKeeper/deleted/.del-io.h~62e0d6286c3e19bc # 2004/06/18 19:20:08+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/io.h # # BitKeeper/deleted/.del-hardware.h~7238d94368669e11 # 2004/06/18 19:20:05+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/hardware.h # # BitKeeper/deleted/.del-dma.h~4cb7553c767afee5 # 2004/06/18 19:20:03+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: include/asm-arm/arch-tbox/dma.h # # BitKeeper/deleted/.del-core.c~714a718aec4a2c30 # 2004/06/18 19:20:01+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: arch/arm/mach-tbox/core.c # # BitKeeper/deleted/.del-pci.c~550e56da56112be2 # 2004/06/18 19:19:59+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: arch/arm/mach-ftvpci/pci.c # # BitKeeper/deleted/.del-leds.c~78050371c0248352 # 2004/06/18 19:19:58+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: arch/arm/mach-ftvpci/leds.c # # BitKeeper/deleted/.del-core.c~9e662b6895b788f2 # 2004/06/18 19:19:57+01:00 rmk@flint.arm.linux.org.uk +0 -0 # Delete: arch/arm/mach-ftvpci/core.c # # ChangeSet # 2004/06/18 12:43:06-05:00 stevef@stevef95.austin.ibm.com # Merge bk://cifs.bkbits.net/linux-2.5cifs # into stevef95.austin.ibm.com:/home/stevef/linux-2.5cifs # # fs/Kconfig # 2004/06/18 12:42:54-05:00 stevef@stevef95.austin.ibm.com +0 -1 # Auto merged # # ChangeSet # 2004/06/18 10:32:19-07:00 greg@kroah.com # Merge kroah.com:/home/greg/linux/BK/bleed-2.6 # into kroah.com:/home/greg/linux/BK/usb-2.6 # # drivers/usb/storage/scsiglue.c # 2004/06/18 10:32:14-07:00 greg@kroah.com +0 -0 # Auto merged # # ChangeSet # 2004/06/18 10:06:37-07:00 torvalds@ppc970.osdl.org # Merge bk://linux-scsi.bkbits.net/scsi-for-linus-2.6 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # include/linux/pci_ids.h # 2004/06/18 10:06:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/sr.c # 2004/06/18 10:06:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/ide-scsi.c # 2004/06/18 10:06:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/Makefile # 2004/06/18 10:06:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/Kconfig # 2004/06/18 10:06:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # BitKeeper/deleted/.del-scsi_pc98.c~63183f0558d43fc2 # 2004/06/18 10:06:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # BitKeeper/deleted/.del-pc980155.c~e29865f8a9a6ed50 # 2004/06/18 10:06:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # MAINTAINERS # 2004/06/18 10:06:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # BitKeeper/deleted/.del-scsi_pc98.c~63183f0558d43fc2 # 2004/06/18 10:06:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Merge rename: drivers/scsi/scsi_pc98.c -> BitKeeper/deleted/.del-scsi_pc98.c~63183f0558d43fc2 # # BitKeeper/deleted/.del-pc980155.c~e29865f8a9a6ed50 # 2004/06/18 10:06:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Merge rename: drivers/scsi/pc980155.c -> BitKeeper/deleted/.del-pc980155.c~e29865f8a9a6ed50 # # ChangeSet # 2004/06/18 10:04:39-07:00 greg@kroah.com # USB: mark pwc driver broken again, as it still is :( # # drivers/usb/media/Kconfig # 2004/06/18 03:03:21-07:00 greg@kroah.com +1 -1 # USB: mark pwc driver broken again, as it still is :( # # ChangeSet # 2004/06/18 17:58:33+01:00 tony@com.rmk.(none) # [ARM PATCH] 1931/1: Allow device address translation in dma-mapping, version 3 # # Patch from Tony Lindgren # # Allows translation of shared memory addresses for devices using # dma-mapping. In some cases the device DMA address is different # from the ARM DMA address, for example with some USB OHCI # controllers. # # For more background information, please see the ARM Linux mailing # list thread "OHCI controller". # # include/asm-arm/memory.h # 2004/06/18 00:11:37+01:00 tony@com.rmk.(none) +10 -1 # [PATCH] 1931/1: Allow device address translation in dma-mapping, version 3 # # include/asm-arm/dma-mapping.h # 2004/06/18 00:11:37+01:00 tony@com.rmk.(none) +4 -4 # [PATCH] 1931/1: Allow device address translation in dma-mapping, version 3 # # include/asm-arm/arch-omap/memory.h # 2004/06/18 00:11:37+01:00 tony@com.rmk.(none) +20 -4 # [PATCH] 1931/1: Allow device address translation in dma-mapping, version 3 # # arch/arm/mm/consistent.c # 2004/06/18 00:11:02+01:00 tony@com.rmk.(none) +1 -1 # [PATCH] 1931/1: Allow device address translation in dma-mapping, version 3 # # arch/arm/common/dmabounce.c # 2004/06/18 00:11:01+01:00 tony@com.rmk.(none) +5 -5 # [PATCH] 1931/1: Allow device address translation in dma-mapping, version 3 # # ChangeSet # 2004/06/18 17:53:15+01:00 nico@org.rmk.(none) # [ARM PATCH] 1932/1: fix comment about cache handling syscall # # Patch from Nicolas Pitre # # Let's make it coherent with what the actual code is doing and has # always done, even in 2.4. Nobody complained about this so let's # just fix the comment. The most natural usage pattern for this is # a base address and a size so it's more efficient to have an exclusive # end address anyway. # # ChangeSet # 2004/06/18 09:52:38-07:00 stern@rowland.harvard.edu # [PATCH] USB: dummy_hcd shouldn't reject SET-ADDRESS requests # # This patch for the dummy_hcd driver prevents it from rejecting SET-ADDRESS # requests when the address is already set. The USB 2.0 spec states that if # a device is in the ADDRESS state, it should accept and start using the new # address. Behavior in the CONFIGURED state is undefined, but since # dummy_hcd doesn't keep track of the difference between the two states we # might as well accept the new address in any case. # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/dummy_hcd.c # 2004/06/18 03:18:28-07:00 stern@rowland.harvard.edu +0 -5 # USB: dummy_hcd shouldn't reject SET-ADDRESS requests # # arch/arm/kernel/traps.c # 2004/06/18 02:01:40+01:00 nico@org.rmk.(none) +1 -1 # [PATCH] 1932/1: fix comment about cache handling syscall # # ChangeSet # 2004/06/18 09:50:41-07:00 axboe@suse.de # [PATCH] cfq direct io alias problem # # This is a fix for when we encounter an alias during insert. When that # happens we move the request to dispatch, but it may happen that this # request is also the ->last_merge hint. So we may attempt to merge with # this later, when it's either in progress or already freed. Rearrange the # logic a bit so we clear the merge hint there as well. It looks more # complex than it is, the only real code change is the addition of a # cfq_remove_merge_hints() in cfq_dispatch_sort(). # # Signed-off-by: Linus Torvalds # # drivers/block/cfq-iosched.c # 2004/06/17 10:37:34-07:00 axboe@suse.de +14 -8 # cfq direct io alias problem # # ChangeSet # 2004/06/18 09:50:31-07:00 axboe@suse.de # [PATCH] cfq allocation race # # It's possible under unlucky circumstances for this race to trigger. I # described it with a comment in the code. # # Signed-Off-By: Jens Axboe # Signed-off-by: Linus Torvalds # # drivers/block/cfq-iosched.c # 2004/05/24 06:35:01-07:00 axboe@suse.de +19 -0 # cfq allocation race # # ChangeSet # 2004/06/18 09:50:20-07:00 axboe@suse.de # [PATCH] cfq sysfs support # # This makes the CFQ tunables available in sysfs, like AS and deadline. # # Signed-off-by: Jens Axboe # Signed-off-by: Linus Torvalds # # drivers/block/cfq-iosched.c # 2004/05/24 06:06:17-07:00 axboe@suse.de +113 -2 # cfq sysfs support # # ChangeSet # 2004/06/18 17:49:27+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 1934/2: Consolidate code to set CKEN on PXA # # Patch from Ian Campbell # # I've seen comments several times that various PXA drivers # update CKEN in an unsafe manner. This patch consolidates # this code into a single function pxa_set_cken() and updates # all the in tree drivers to use it. # # ChangeSet # 2004/06/18 09:48:38-07:00 torvalds@ppc970.osdl.org # Remove old stale header files that aren't referenced anywhere. # # Noted by Alexey Dobriyan. # # BitKeeper/deleted/.del-netfilter_x25.h~5e2c13d4592d8c13 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/netfilter_x25.h # # BitKeeper/deleted/.del-netfilter_ipx.h~7e5cd8fa9a3985ac # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/netfilter_ipx.h # # BitKeeper/deleted/.del-netfilter_ddp.h~2153f0da7220ca38 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/netfilter_ddp.h # # BitKeeper/deleted/.del-netbeui.h~1cf2e2f4793bcad1 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/netbeui.h # # BitKeeper/deleted/.del-mpp.h~8ebce3fa907ece97 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/mpp.h # # BitKeeper/deleted/.del-isdn_lzscomp.h~99cfe6e36b994a1 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/isdn_lzscomp.h # # BitKeeper/deleted/.del-in_systm.h~268bf1b1642e1ee5 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/in_systm.h # # BitKeeper/deleted/.del-fsfilter.h~5fc8d5fdaaa381a # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/fsfilter.h # # BitKeeper/deleted/.del-atapi.h~8a1b1aeca6c26a7 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/atapi.h # # BitKeeper/deleted/.del-adb_mouse.h~d5f39849c4abbd6e # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/adb_mouse.h # # BitKeeper/deleted/.del-acpi_serial.h~d839323d8907296b # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/acpi_serial.h # # BitKeeper/deleted/.del-802_11.h~9b6bd4cff8af7a90 # 2004/06/18 09:47:58-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/linux/802_11.h # # include/asm-arm/arch-pxa/hardware.h # 2004/06/18 01:00:00+01:00 icampbell@com.rmk.(none) +5 -0 # [PATCH] 1934/2: Consolidate code to set CKEN on PXA # # drivers/video/pxafb.c # 2004/06/18 01:00:00+01:00 icampbell@com.rmk.(none) +1 -4 # [PATCH] 1934/2: Consolidate code to set CKEN on PXA # # drivers/usb/gadget/pxa2xx_udc.c # 2004/06/18 01:00:00+01:00 icampbell@com.rmk.(none) +2 -2 # [PATCH] 1934/2: Consolidate code to set CKEN on PXA # # drivers/serial/pxa.c # 2004/06/18 01:00:00+01:00 icampbell@com.rmk.(none) +2 -7 # [PATCH] 1934/2: Consolidate code to set CKEN on PXA # # arch/arm/mach-pxa/generic.c # 2004/06/18 01:00:00+01:00 icampbell@com.rmk.(none) +18 -0 # [PATCH] 1934/2: Consolidate code to set CKEN on PXA # # ChangeSet # 2004/06/18 09:46:06-07:00 torvalds@ppc970.osdl.org # Merge # # drivers/net/at1700.c # 2004/06/18 09:46:04-07:00 torvalds@ppc970.osdl.org +0 -0 # SCCS merged # # ChangeSet # 2004/06/18 17:43:22+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 1930/1: Allocate correct number of pseudo palette entries in pxafb # # Patch from Ian Campbell # # The pxafb driver incorrectly allocates 17 u32's for a 16 entry # pseudo palette. # # drivers/net/Makefile # 2004/06/18 09:43:07-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # BitKeeper/deleted/.del-ne2k_cbus.c~db2bde9191a8ce9a # 2004/06/18 09:43:06-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/net/Kconfig # 2004/06/18 09:43:06-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/net/82596.c # 2004/06/18 09:43:06-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # BitKeeper/deleted/.del-ne2k_cbus.c~db2bde9191a8ce9a # 2004/06/18 09:43:06-07:00 torvalds@ppc970.osdl.org +0 -0 # Merge rename: drivers/net/ne2k_cbus.c -> BitKeeper/deleted/.del-ne2k_cbus.c~db2bde9191a8ce9a # # drivers/video/pxafb.c # 2004/06/18 01:00:00+01:00 icampbell@com.rmk.(none) +1 -1 # [PATCH] 1930/1: Allocate correct number of pseudo palette entries in pxafb # # ChangeSet # 2004/06/18 09:36:50-07:00 davem@nuts.davemloft.net # Merge # # security/selinux/hooks.c # 2004/06/18 09:36:41-07:00 davem@nuts.davemloft.net +0 -101 # SCCS merged # # security/selinux/ss/services.c # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -12 # Auto merged # # security/selinux/ss/policydb.c # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -9 # Auto merged # # security/selinux/include/security.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -5 # Auto merged # # security/selinux/include/flask.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -21 # Auto merged # # security/selinux/include/class_to_string.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -21 # Auto merged # # security/selinux/include/av_permissions.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -573 # Auto merged # # security/selinux/include/av_perm_to_string.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -101 # Auto merged # # security/selinux/include/av_inherit.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -9 # Auto merged # # security/selinux/Makefile # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -1 # Auto merged # # security/dummy.c # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -1 # Auto merged # # net/netlink/af_netlink.c # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -4 # Auto merged # # include/linux/security.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -11 # Auto merged # # include/asm-ppc64/system.h # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # Documentation/filesystems/proc.txt # 2004/06/18 09:35:13-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/06/18 09:33:53-07:00 torvalds@ppc970.osdl.org # This removes the files orphaned by the earlier PC9800 removal # # BitKeeper/deleted/.del-smpboot_hooks.h~5940f4c36bed59b4 # 2004/06/18 09:32:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/smpboot_hooks.h # # BitKeeper/deleted/.del-setup_arch_pre.h~1aa05e47e2ae5d10 # 2004/06/18 09:32:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/setup_arch_pre.h # # BitKeeper/deleted/.del-setup_arch_post.h~c1ce95fa8d614f4d # 2004/06/18 09:32:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/setup_arch_post.h # # BitKeeper/deleted/.del-pci-functions.h~930f4ea96f69d14 # 2004/06/18 09:32:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/pci-functions.h # # BitKeeper/deleted/.del-mach_wakecpu.h~de206fda8667a7e7 # 2004/06/18 09:32:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/mach_wakecpu.h # # BitKeeper/deleted/.del-mach_traps.h~db7e527be9d0d95b # 2004/06/18 09:32:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/mach_traps.h # # BitKeeper/deleted/.del-mach_timer.h~6faf9e0362bc9cad # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/mach_timer.h # # BitKeeper/deleted/.del-mach_time.h~4ec98fea93568edd # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/mach_time.h # # BitKeeper/deleted/.del-mach_reboot.h~666bd1054bae0a25 # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/mach_reboot.h # # BitKeeper/deleted/.del-irq_vectors.h~5a325ee32bbed31 # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/irq_vectors.h # # BitKeeper/deleted/.del-io_ports.h~8f892217bfd99be4 # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/io_ports.h # # BitKeeper/deleted/.del-do_timer.h~e73335e43b11ea32 # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/do_timer.h # # BitKeeper/deleted/.del-bios_ebda.h~4a870d9833986305 # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/bios_ebda.h # # BitKeeper/deleted/.del-apm.h~324fabc1c2354803 # 2004/06/18 09:32:53-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/mach-pc9800/apm.h # # BitKeeper/deleted/.del-video.S~284da1c1c2e38aa8 # 2004/06/18 09:32:48-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/boot98/video.S # # BitKeeper/deleted/.del-setup.S~bd07a5b2361060c # 2004/06/18 09:32:48-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/boot98/setup.S # # BitKeeper/deleted/.del-mtools.conf.in~3346efde195fa35 # 2004/06/18 09:32:48-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/boot98/mtools.conf.in # # BitKeeper/deleted/.del-install.sh~6441f5459fde0cb0 # 2004/06/18 09:32:48-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/boot98/install.sh # # BitKeeper/deleted/.del-bootsect.S~aa4f19a632039843 # 2004/06/18 09:32:48-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/boot98/bootsect.S # # BitKeeper/deleted/.del-Makefile~2700a53f2e1fb469 # 2004/06/18 09:32:48-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/boot98/Makefile # # BitKeeper/deleted/.del-topology.c~607813b1b960974f # 2004/06/18 09:32:43-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/mach-pc9800/topology.c # # BitKeeper/deleted/.del-std_resources.c~54f4a08a759f2f5f # 2004/06/18 09:32:43-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/mach-pc9800/std_resources.c # # BitKeeper/deleted/.del-setup.c~161f6c99c14ddb5d # 2004/06/18 09:32:43-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/mach-pc9800/setup.c # # BitKeeper/deleted/.del-Makefile~c002abb789b0791f # 2004/06/18 09:32:43-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/i386/mach-pc9800/Makefile # # BitKeeper/deleted/.del-sound_pc9800.h~d8dde13c75b5753b # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: sound/isa/cs423x/sound_pc9800.h # # BitKeeper/deleted/.del-pc9801_118_magic.h~479c5fdd78d01b7a # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: sound/isa/cs423x/pc9801_118_magic.h # # BitKeeper/deleted/.del-pc9800_sca.h~b52752436ddb82ea # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/pc9800_sca.h # # BitKeeper/deleted/.del-pc9800.h~e8f7c13f33846c88 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: include/asm-i386/pc9800.h # # BitKeeper/deleted/.del-pc9800.c~1af765dbb1c51b76 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/ide/legacy/pc9800.c # # BitKeeper/deleted/.del-pc98.c~e5a92ca5f2b01d36 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: sound/isa/cs423x/pc98.c # # BitKeeper/deleted/.del-nec98.h~a0b8de1e822fa884 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: fs/partitions/nec98.h # # BitKeeper/deleted/.del-nec98.c~2e65e92f56ce9a56 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: fs/partitions/nec98.c # # BitKeeper/deleted/.del-hd98.c~fc4a0b69729bf7c1 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/ide/legacy/hd98.c # # BitKeeper/deleted/.del-98spkr.c~a1a91856da60a088 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/input/misc/98spkr.c # # BitKeeper/deleted/.del-98busmouse.c~ca244def94322735 # 2004/06/18 09:32:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/input/mouse/98busmouse.c # # BitKeeper/deleted/.del-serial98.c~c69c28b9984f1cca # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/serial/serial98.c # # BitKeeper/deleted/.del-scsi_pc98.c~63183f0558d43fc2 # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/scsi/scsi_pc98.c # # BitKeeper/deleted/.del-pc980155.h~f12bd20496e02379 # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/scsi/pc980155.h # # BitKeeper/deleted/.del-pc980155.c~e29865f8a9a6ed50 # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/scsi/pc980155.c # # BitKeeper/deleted/.del-lp_old98.c~fc58ff5b2fa5c998 # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/char/lp_old98.c # # BitKeeper/deleted/.del-floppy98.c~12864e155d00fa0e # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/block/floppy98.c # # BitKeeper/deleted/.del-98kbd.c~fcb070eb5c330ed3 # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/input/keyboard/98kbd.c # # BitKeeper/deleted/.del-98kbd-io.c~37d03ba23bb15415 # 2004/06/18 09:32:32-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/input/serio/98kbd-io.c # # BitKeeper/deleted/.del-upd4990a.c~6da2f3423f9a74f # 2004/06/18 09:32:23-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/char/upd4990a.c # # BitKeeper/deleted/.del-ne2k_cbus.h~b1e2c6c8f1caf542 # 2004/06/18 09:32:23-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/net/ne2k_cbus.h # # BitKeeper/deleted/.del-ne2k_cbus.c~db2bde9191a8ce9a # 2004/06/18 09:32:23-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/net/ne2k_cbus.c # # ChangeSet # 2004/06/18 09:31:40-07:00 torvalds@ppc970.osdl.org # Merge # # arch/i386/kernel/acpi/boot.c # 2004/06/18 09:31:38-07:00 torvalds@ppc970.osdl.org +0 -0 # SCCS merged # # arch/i386/kernel/mpparse.c # 2004/06/18 09:29:48-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2004/06/18 09:24:59-07:00 torvalds@ppc970.osdl.org # Merge duplicate selinux network hooks # # security/selinux/hooks.c # 2004/06/18 09:24:54-07:00 torvalds@ppc970.osdl.org +0 -101 # Merge duplicate selinux hooks # # security/selinux/ss/services.c # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -12 # Auto merged # # security/selinux/ss/policydb.c # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -9 # Auto merged # # security/selinux/include/security.h # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -5 # Auto merged # # security/selinux/include/flask.h # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -21 # Auto merged # # security/selinux/include/class_to_string.h # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -21 # Auto merged # # security/selinux/include/av_permissions.h # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -573 # Auto merged # # security/selinux/include/av_perm_to_string.h # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -101 # Auto merged # # security/selinux/include/av_inherit.h # 2004/06/18 09:21:51-07:00 torvalds@ppc970.osdl.org +0 -9 # Auto merged # # security/selinux/Makefile # 2004/06/18 09:21:50-07:00 torvalds@ppc970.osdl.org +0 -1 # Auto merged # # security/dummy.c # 2004/06/18 09:21:50-07:00 torvalds@ppc970.osdl.org +0 -1 # Auto merged # # net/netlink/af_netlink.c # 2004/06/18 09:21:50-07:00 torvalds@ppc970.osdl.org +0 -4 # Auto merged # # include/linux/security.h # 2004/06/18 09:21:50-07:00 torvalds@ppc970.osdl.org +0 -11 # Auto merged # # include/asm-ppc64/system.h # 2004/06/18 09:21:50-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # Documentation/filesystems/proc.txt # 2004/06/18 09:21:50-07:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2004/06/18 08:25:41-07:00 chrisw@osdl.org # [PATCH] RLIM: remove unused queued_signals global accounting # # Remove unused queued_signals global accounting. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/sysctl.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +0 -18 # RLIM: remove unused queued_signals global accounting # # kernel/signal.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +0 -3 # RLIM: remove unused queued_signals global accounting # # ChangeSet # 2004/06/18 08:25:30-07:00 chrisw@osdl.org # [PATCH] RLIM: enforce rlimits on queued signals # # Add a user_struct pointer to the sigqueue structure. Charge sigqueue # allocation and destruction to the user_struct rather than a global pool. This # per user rlimit accounting obsoletes the global queued_signals accouting. # # The patch as charges the sigqueue struct allocation to the queue that it's # pending on (the receiver of the signal). So the owner of the queue is charged # for whoever writes to it (much like quota for a 777 file). # # The patch started out charging the task which allocated the sigqueue struct. # In most cases, these are always the same user (permission for sending a # signal), so those cases are moot. In the cases where it isn't the same user, # it's a privileged user sending a signal to another user. # # It seems wrong to charge the allocation to the privleged user, when the other # user could block receipt as long as it feels. The flipside is, someone else # can fill your queue (expectation is that someone else is privileged). I think # it's right the way it is. The change to revert is very small. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/signal.c # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +11 -6 # RLIM: enforce rlimits on queued signals # # include/linux/signal.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: enforce rlimits on queued signals # # ChangeSet # 2004/06/18 08:25:20-07:00 chrisw@osdl.org # [PATCH] RLIM: pass task_struct in send_signal() # # Update send_signal() api to allow passing the task receiving the signal. This # is necessary to ensure signals generated out of process context can be charged # to the correct user. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/signal.c # 2004/06/18 00:32:25-07:00 chrisw@osdl.org +4 -3 # RLIM: pass task_struct in send_signal() # # ChangeSet # 2004/06/18 08:23:45-07:00 torvalds@ppc970.osdl.org # Fix kill_pg_info(): return success if _any_ signal succeeded. # # kernel/signal.c # 2004/06/18 08:23:40-07:00 torvalds@ppc970.osdl.org +7 -11 # Fix kill_pg_info(): return success if _any_ signal succeeded. # # ChangeSet # 2004/06/18 08:17:04-07:00 kszysiu@iceberg.elsat.net.pl # [PATCH] cmpci oops on rmmod + fix # # The cmpci driver included in Linux 2.6.7 causes an oops on rmmod, I believe # cm_remove should be marked __devexit rather than __devinit. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # sound/oss/cmpci.c # 2004/06/18 00:06:08-07:00 kszysiu@iceberg.elsat.net.pl +2 -2 # cmpci oops on rmmod + fix # # ChangeSet # 2004/06/18 08:16:53-07:00 ysato@users.sourceforge.jp # [PATCH] H8/300: io.h cleanup # # - optimize byteswap # - add noswap io mode # - cleanup var type # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-h8300/io.h # 2004/06/18 00:06:08-07:00 ysato@users.sourceforge.jp +68 -24 # H8/300: io.h cleanup # # ChangeSet # 2004/06/18 08:16:42-07:00 ysato@users.sourceforge.jp # [PATCH] H8/300: ptrace fix # # - Kconfig typo fix # - PTRACE_PEEKUSER read process info support # - exr restore fix # - ptrace register offset fix # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/h8300/platform/h8s/ptrace_h8s.c # 2004/06/18 00:06:07-07:00 ysato@users.sourceforge.jp +1 -1 # H8/300: ptrace fix # # arch/h8300/platform/h8s/entry.S # 2004/06/18 00:06:07-07:00 ysato@users.sourceforge.jp +1 -1 # H8/300: ptrace fix # # arch/h8300/kernel/ptrace.c # 2004/06/18 00:06:07-07:00 ysato@users.sourceforge.jp +23 -5 # H8/300: ptrace fix # # arch/h8300/Kconfig # 2004/06/18 00:06:07-07:00 ysato@users.sourceforge.jp +1 -1 # H8/300: ptrace fix # # ChangeSet # 2004/06/18 08:16:33-07:00 kaos@ocs.com.au # [PATCH] contify some scheduler functions # # Several scheduler macros only read from the task struct, mark them const. # It may help the compiler generate better code. # # Signed-off-by: Keith Owens # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/sched.c # 2004/06/18 00:06:07-07:00 kaos@ocs.com.au +3 -3 # contify some scheduler functions # # kernel/exit.c # 2004/06/18 00:06:07-07:00 kaos@ocs.com.au +3 -3 # contify some scheduler functions # # include/linux/sched.h # 2004/06/18 00:06:07-07:00 kaos@ocs.com.au +6 -6 # contify some scheduler functions # # ChangeSet # 2004/06/18 08:16:21-07:00 greg@kroah.com # [PATCH] remove EXPORT_SYMBOL(kallsyms_lookup) # # Distros have started to ship kernels with this patch, as it seems that some # unnamed binary module authors are already abusing this function (as well as # some open source modules, like the openib code.) I could not find any valid # reason why this symbol should be exported, so here's a patch against 2.6.7 # that removes it. # # Signed-off-by: Greg Kroah-Hartman # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/kallsyms.c # 2004/06/18 00:06:07-07:00 greg@kroah.com +0 -1 # remove EXPORT_SYMBOL(kallsyms_lookup) # # ChangeSet # 2004/06/18 08:16:11-07:00 rddunlap@osdl.org # [PATCH] remove blank line in show_trace() # # Delete a blank line for more error reporting on-screen. # # Signed-off-by: Randy Dunlap # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/kernel/traps.c # 2004/06/18 00:06:07-07:00 rddunlap@osdl.org +0 -1 # remove blank line in show_trace() # # ChangeSet # 2004/06/18 08:16:00-07:00 kenneth.w.chen@intel.com # [PATCH] Hugetlb page bug fix for i386 in PAE mode # # Hit a bug check when unmap a hugetlb vma in PAE mode on i386 (and x86-64). # # Bad page state at free_hot_cold_page (in process 'a.out', page c165cc40) # flags:0x20000000 mapping:f75e1d00 mapped:0 count:0 # Backtrace: # Call Trace: # [] bad_page+0x79/0x9e # [] free_hot_cold_page+0x71/0xfa # [] unmap_hugepage_range+0xa3/0xbf # [] unmap_vmas+0xac/0x252 # [] default_wake_function+0x0/0xc # [] unmap_region+0xd8/0x145 # [] do_munmap+0xfc/0x14d # [] sys_shmdt+0xa5/0x126 # [] sys_ipc+0x23c/0x27f # [] sys_write+0x38/0x59 # [] syscall_call+0x7/0xb # # It turns out there is a bug in hugetlb_prefault(): with 3 level page table, # huge_pte_alloc() might return a pmd that points to a PTE page. It happens # if the virtual address for hugetlb mmap is recycled from previously used # normal page mmap. free_pgtables() might not scrub the pmd entry on munmap # and hugetlb_prefault skips on any pmd presence regardless what type it is. # Patch to fix the bug. # # Signed-off-by: Ken Chen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/mm/hugetlbpage.c # 2004/06/18 00:06:07-07:00 kenneth.w.chen@intel.com +9 -2 # Hugetlb page bug fix for i386 in PAE mode # # ChangeSet # 2004/06/18 08:15:49-07:00 minyard@acm.org # [PATCH] IPMI base patch to fix channel handling and add polling # # This patch fixes some problems with handling of channel detection in the # driver. Some systems that are IPMI 1.5 do not implement the channel query # command. Also, the interface has to be fully up before the command is # ready. # # This patch also adds a polling interface; this is required for situations # where interrupts are not running, but the system must still issue IPMI # commands, like when taking a crash dump. # # It also updates the driver version to v32. # # Signed-off-by: Corey Minyard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/ipmi_smi.h # 2004/06/18 00:06:07-07:00 minyard@acm.org +4 -0 # IPMI base patch to fix channel handling and add polling # # include/linux/ipmi_msgdefs.h # 2004/06/18 00:06:07-07:00 minyard@acm.org +1 -0 # IPMI base patch to fix channel handling and add polling # # include/linux/ipmi.h # 2004/06/18 00:06:07-07:00 minyard@acm.org +10 -0 # IPMI base patch to fix channel handling and add polling # # drivers/char/ipmi/ipmi_watchdog.c # 2004/06/18 00:06:07-07:00 minyard@acm.org +3 -5 # IPMI base patch to fix channel handling and add polling # # drivers/char/ipmi/ipmi_smic_sm.c # 2004/06/18 00:06:07-07:00 minyard@acm.org +1 -1 # IPMI base patch to fix channel handling and add polling # # drivers/char/ipmi/ipmi_si_intf.c # 2004/06/18 00:06:07-07:00 minyard@acm.org +45 -16 # IPMI base patch to fix channel handling and add polling # # drivers/char/ipmi/ipmi_msghandler.c # 2004/06/18 00:06:07-07:00 minyard@acm.org +29 -2 # IPMI base patch to fix channel handling and add polling # # drivers/char/ipmi/ipmi_kcs_sm.c # 2004/06/18 00:06:07-07:00 minyard@acm.org +1 -1 # IPMI base patch to fix channel handling and add polling # # drivers/char/ipmi/ipmi_devintf.c # 2004/06/18 00:06:07-07:00 minyard@acm.org +1 -1 # IPMI base patch to fix channel handling and add polling # # drivers/char/ipmi/ipmi_bt_sm.c # 2004/06/18 00:06:07-07:00 minyard@acm.org +1 -1 # IPMI base patch to fix channel handling and add polling # # ChangeSet # 2004/06/18 08:15:37-07:00 jmorris@redhat.com # [PATCH] SELinux: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Cc: David S. Miller # Signed-off-by: James Morris # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # security/selinux/nlmsgtab.c # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +153 -0 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/ss/services.c # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +12 -0 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/ss/policydb.c # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +9 -1 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/nlmsgtab.c # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/security/selinux/nlmsgtab.c # # security/selinux/include/security.h # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +5 -4 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/include/flask.h # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +9 -0 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/include/class_to_string.h # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +9 -0 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/include/av_permissions.h # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +223 -0 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/include/av_perm_to_string.h # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +12 -0 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/include/av_inherit.h # 2004/06/18 00:06:06-07:00 jmorris@redhat.com +9 -0 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/hooks.c # 2004/06/18 00:06:06-07:00 jmorris@redhat.com +80 -22 # SELinux: Fine-grained Netlink support - SELinux changes # # security/selinux/Makefile # 2004/06/18 00:06:07-07:00 jmorris@redhat.com +1 -1 # SELinux: Fine-grained Netlink support - SELinux changes # # ChangeSet # 2004/06/18 08:15:25-07:00 jmorris@redhat.com # [PATCH] SELinux: Fine-grained Netlink support - add sk to netlink_send hook # # Modifies the LSM netlink_send() hook so that it takes a struct sock parameter. # SELinux will use this parameter to lookup the class of socket, which was # assigned during socket security initialization. # # Cc: David S. Miller # Signed-off-by: James Morris # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # security/selinux/hooks.c # 2004/06/18 00:32:07-07:00 jmorris@redhat.com +1 -1 # SELinux: Fine-grained Netlink support - add sk to netlink_send hook # # security/dummy.c # 2004/06/18 00:06:06-07:00 jmorris@redhat.com +1 -1 # SELinux: Fine-grained Netlink support - add sk to netlink_send hook # # net/netlink/af_netlink.c # 2004/06/18 00:06:06-07:00 jmorris@redhat.com +1 -1 # SELinux: Fine-grained Netlink support - add sk to netlink_send hook # # include/linux/security.h # 2004/06/18 00:06:06-07:00 jmorris@redhat.com +11 -8 # SELinux: Fine-grained Netlink support - add sk to netlink_send hook # # ChangeSet # 2004/06/18 08:15:14-07:00 jmorris@redhat.com # [PATCH] SELinux: Fine-grained Netlink support - move security_netlink_send() hook # # This patch moves the security_netlink_send() LSM hook after the user copy, so # that LSM modules can safely examine skb payload content. For SELinux, we need # to look at the Netlink message type. # # Cc: David S. Miller # Signed-off-by: James Morris # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # net/netlink/af_netlink.c # 2004/06/18 00:32:07-07:00 jmorris@redhat.com +4 -4 # SELinux: Fine-grained Netlink support - move security_netlink_send() hook # # ChangeSet # 2004/06/18 08:15:04-07:00 jmorris@redhat.com # [PATCH] SELinux: Fine-grained Netlink support - SELinux headers update # # This patch regenerates the SELinux module headers to reflect new class and # access vectors definitions. The size of the diff is misleading; much of it is # simply a change in the ordering of the automatically generated definitions. # The corresponding generation script has been changed to ensure a stable order # in the future. Please apply. # # Author: Stephen Smalley # Cc: David S. Miller # Signed-off-by: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # security/selinux/include/flask.h # 2004/06/18 00:32:07-07:00 jmorris@redhat.com +12 -0 # SELinux: Fine-grained Netlink support - SELinux headers update # # security/selinux/include/class_to_string.h # 2004/06/18 00:32:07-07:00 jmorris@redhat.com +12 -0 # SELinux: Fine-grained Netlink support - SELinux headers update # # security/selinux/include/av_permissions.h # 2004/06/18 00:32:07-07:00 jmorris@redhat.com +350 -250 # SELinux: Fine-grained Netlink support - SELinux headers update # # security/selinux/include/av_perm_to_string.h # 2004/06/18 00:32:07-07:00 jmorris@redhat.com +89 -3 # SELinux: Fine-grained Netlink support - SELinux headers update # # ChangeSet # 2004/06/18 08:14:53-07:00 chrisw@osdl.org # [PATCH] fix simple_strtoul base 16 handling # # I know it's simple_strtoul, but is it meant to be that simple? Fix up for # both simple_strtoul and simple_strtoull. # # simple_strtoul(0x401b, NULL, 0) = 0x401b # simple_strtoul(0X401b, NULL, 0) = 0x0 # simple_strtoul(0x401b, NULL, 16) = 0x0 # simple_strtoul(0X401b, NULL, 16) = 0x0 # # simple_strtoull(0x401b, NULL, 0) = 0x401b # simple_strtoull(0X401b, NULL, 0) = 0x0 # simple_strtoull(0x401b, NULL, 16) = 0x0 # simple_strtoull(0X401b, NULL, 16) = 0x0 # # Signed-off-by: Chris Wright # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # lib/vsprintf.c # 2004/06/18 00:06:06-07:00 chrisw@osdl.org +8 -2 # fix simple_strtoul base 16 handling # # ChangeSet # 2004/06/18 08:14:42-07:00 eger@havoc.gtf.org # [PATCH] rivafb: fb accel capabilities # # Here's the fb accel capabilities patch for rivafb. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/riva/fbdev.c # 2004/06/18 00:06:06-07:00 eger@havoc.gtf.org +6 -1 # rivafb: fb accel capabilities # # ChangeSet # 2004/06/18 08:14:31-07:00 geert@linux-m68k.org # [PATCH] fix warning in fbmem.c # # Fix a const/non-const warning. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/fb.h # 2004/06/18 00:06:06-07:00 geert@linux-m68k.org +1 -1 # fix warning in fbmem.c # # drivers/video/fbmem.c # 2004/06/18 00:06:06-07:00 geert@linux-m68k.org +13 -9 # fix warning in fbmem.c # # ChangeSet # 2004/06/18 08:14:20-07:00 eger@havoc.gtf.org # [PATCH] fix radeonfb panning and make it play nice with copyarea() # # radeonfb: fix panning corruption on a large virtual screen, Make panning # and copyarea() play nicely with each other. # # Signed-off-by: David Eger # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/aty/radeon_base.c # 2004/06/18 00:06:05-07:00 eger@havoc.gtf.org +13 -0 # fix radeonfb panning and make it play nice with copyarea() # # drivers/video/aty/radeon_accel.c # 2004/06/18 00:06:05-07:00 eger@havoc.gtf.org +4 -4 # fix radeonfb panning and make it play nice with copyarea() # # ChangeSet # 2004/06/18 08:14:09-07:00 lethal@Linux-SH.ORG # [PATCH] asiliantfb init fix # # asiliantfb seems to have only been partially merged (the fbmem.c bits in # particular seem to have been missed entirely). This adds them back in, # though they do seem to be present in the fbdev tree, at least they were the # last time I looked. # # These are the last bit of outstanding changes I have in the LinuxSH # tree for asiliantfb, so it would be nice to get this out of the way. # # Signed-off-by: Paul Mundt # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/fbmem.c # 2004/06/18 00:32:08-07:00 lethal@Linux-SH.ORG +4 -0 # asiliantfb init fix # # ChangeSet # 2004/06/18 08:13:58-07:00 adaplas@hotpop.com # [PATCH] More updates to rivafb driver # # 1. pass info->monspecs.modedb and info->monspecs.modedb_len to # fb_find_mode() instead of NULL, 0 since its contents are specific to the # attached display. Anyway, if info->monspecs.modedb == NULL, # fb_find_mode() will use the default database. # # 2. Added best fit algo to fb_find_mode(). # # 3. Use snprintf instead of sprintf. # # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/modedb.c # 2004/06/18 00:06:05-07:00 adaplas@hotpop.com +19 -2 # More updates to rivafb driver # # drivers/video/console/fbcon.c # 2004/06/18 00:06:05-07:00 adaplas@hotpop.com +4 -3 # More updates to rivafb driver # # ChangeSet # 2004/06/18 08:13:47-07:00 adaplas@hotpop.com # [PATCH] Updates to rivafb driver # # The patch updates rivafb to the following: # # 1. Fixed cursor corruption and simplified cursor code. # # 2. Maximized var->yres_virtual on initial mode setting. Scrolling, # therefore, defaults to y-panning which is significantly faster. # # 3. Restricted var->xres_virtual and var->yres_virtual to 0x7fff # (hardware limitation?). Otherwise, var->yres_virtual > 0x7fff + panning # will hang the GPU. # # 4. Added I2C/DDC support. This feature enables independent mode setup # to rivafb. 'stty rows n cols n' should now work correctly. This is a # configurable option. # # 5. Various/minor fixes to drawing code. # # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/riva/rivafb-i2c.c # 2004/06/18 00:06:05-07:00 adaplas@hotpop.com +209 -0 # Updates to rivafb driver # # drivers/video/riva/rivafb.h # 2004/06/18 00:06:05-07:00 adaplas@hotpop.com +24 -9 # Updates to rivafb driver # # drivers/video/riva/rivafb-i2c.c # 2004/06/18 00:06:05-07:00 adaplas@hotpop.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/video/riva/rivafb-i2c.c # # drivers/video/riva/fbdev.c # 2004/06/18 00:32:08-07:00 adaplas@hotpop.com +188 -148 # Updates to rivafb driver # # drivers/video/riva/Makefile # 2004/06/18 00:06:05-07:00 adaplas@hotpop.com +6 -2 # Updates to rivafb driver # # drivers/video/Kconfig # 2004/06/18 00:06:05-07:00 adaplas@hotpop.com +5 -0 # Updates to rivafb driver # # ChangeSet # 2004/06/18 08:13:36-07:00 eger@havoc.gtf.org # [PATCH] fbcon: prefer pan when available # # Improve heuristics to favor panning over copyarea() thanks to pseudocode # from Antonino Daplas # # Signed-off-by: David Eger # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/console/fbcon.c # 2004/06/18 00:32:09-07:00 eger@havoc.gtf.org +19 -15 # fbcon: prefer pan when available # # ChangeSet # 2004/06/18 08:13:25-07:00 eger@havoc.gtf.org # [PATCH] fb accel capabilities # # Baseline patch to make framebuffer/fbcon interaction more sane by basing the # fbcon heuristics on capabilities advertized by underlying framebuffer via the # fb_info.flags field. # # This patch updates fbcon, fb.h, and skeletonfb.c. It does *not* yet update # the drivers themselves. They should compile and work, but their hinting is # not correct yet, meaning most fb drivers will be slow until I set the flags to # the right hinting driver-by-driver # # Signed-off-by: David Eger # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/fb.h # 2004/06/18 00:32:08-07:00 eger@havoc.gtf.org +46 -6 # fb accel capabilities # # drivers/video/skeletonfb.c # 2004/06/18 00:06:05-07:00 eger@havoc.gtf.org +7 -1 # fb accel capabilities # # drivers/video/console/fbcon.h # 2004/06/18 00:06:05-07:00 eger@havoc.gtf.org +19 -32 # fb accel capabilities # # drivers/video/console/fbcon.c # 2004/06/18 00:32:09-07:00 eger@havoc.gtf.org +50 -47 # fb accel capabilities # # ChangeSet # 2004/06/18 08:13:13-07:00 daniel@osdl.org # [PATCH] handle partial DIO write # # The fsx-linux hole fill failure problem was caused by # generic_file_aio_write_nolock() not handling the partial DIO write # correctly. Here's a patch lets DIO do the partial write, and the fallback # to buffered is done (correctly) for what is left. This fixes the hole # filling without retrying the entire i/o. This patch also applies to # 2.6.7-rc3 with some offset. # # I tested this (on ext3) with # fsx-linux -l 500000 -r 4096 -t 4096 -w 4096 -Z -N 10000 junk -R -W # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/filemap.c # 2004/06/18 00:06:05-07:00 daniel@osdl.org +1 -1 # handle partial DIO write # # fs/direct-io.c # 2004/06/18 00:06:05-07:00 daniel@osdl.org +7 -7 # handle partial DIO write # # ChangeSet # 2004/06/18 08:13:02-07:00 schwidefsky@de.ibm.com # [PATCH] s390: lost dirty bits # # The SetPageUptodate function is called for pages that are already up to # date. The arch_set_page_uptodate function of s390 may not clear the dirty # bit in that case otherwise a dirty bit which is set between the start of an # i/o for a writeback and a following call to SetPageUptodate is lost. # # Signed-off-by: Martin Schwidefsky # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/page-flags.h # 2004/06/18 00:06:04-07:00 schwidefsky@de.ibm.com +3 -9 # s390: lost dirty bits # # include/asm-s390/pgtable.h # 2004/06/18 00:06:04-07:00 schwidefsky@de.ibm.com +4 -2 # s390: lost dirty bits # # ChangeSet # 2004/06/18 08:12:51-07:00 hch@lst.de # [PATCH] fix standalone inclusion of asm-i386/dma-mapping.h # # Without this a usb-storage patch I sent fails on x86 because dma-mapping.h # uses struct device and various VM stuff without proper includes. It's fine # on ppc at least. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/dma-mapping.h # 2004/06/18 00:06:04-07:00 hch@lst.de +3 -0 # fix standalone inclusion of asm-i386/dma-mapping.h # # ChangeSet # 2004/06/18 08:12:41-07:00 jmorris@redhat.com # [PATCH] Fix sock_orphan race. # # The patch below fixes a race between sock_orphan() and # selinux_socket_sock_rcv_skb() which can lead to a null pointer deref oops # under heavy load. The sk_callback_lock is used in the patch to synchronize # access to the incoming socket's inode security state. # # This patch has been under test in the Fedora kernel for over a month # without incident. # # Author: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # security/selinux/hooks.c # 2004/06/18 00:32:07-07:00 jmorris@redhat.com +21 -16 # Fix sock_orphan race. # # ChangeSet # 2004/06/18 08:12:29-07:00 marcelo.tosatti@cyclades.com # [PATCH] update Marcelo CREDITS info # # Update my CREDITS information. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # CREDITS # 2004/06/18 00:06:04-07:00 marcelo.tosatti@cyclades.com +7 -6 # update Marcelo CREDITS info # # ChangeSet # 2004/06/18 08:12:18-07:00 jmorris@redhat.com # [PATCH] Add security_file_permission() to AIO paths. # # Currently, there are no LSM hooks in the AIO codepaths, which means that # LSM based access controls are not revalidated upon AIO read and write # operations. The patch below adds the security_file_permission() LSM hook # prior to the VFS aio_read()/aio_write() calls. # # Signed-off-by: James Morris # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/aio.c # 2004/06/18 00:06:04-07:00 jmorris@redhat.com +7 -0 # Add security_file_permission() to AIO paths. # # ChangeSet # 2004/06/18 08:12:08-07:00 linux@dominikbrodowski.de # [PATCH] add 1 in __const_udelay() # # The "mull" instruction in __const_udelay() cuts off the lower 32 bits -- # so, it is "rounding down". This is both an issue for small ndelay()s for # _all_ values for loops_per_jiffy and for certain {n,u}delay()s for many # loops_per_jiffy values. # # Assuming # # LPJ = 1501115 # # udelay(87) # # results in # # 130597 loops to be spent. # # However, 1000 * 130597 / 1501115 is 86.999997 us, so we're actually # _rounding down_. 1000 * 130598 / 1501115 is 87.000662841, which would be # the technically correct thing to do. Of course, for the TSC case this # won't matter as the maths take some time, so the actual delay is # # 1000 * __udelay(x) / lpj + __OVERHEAD(x) # # Anybody worried about both the additional overhead and the fact that the # overhead takes some time to run should add a check # # if (unlikely(xloops < OVERHEAD)) # return; # xloops -= OVERHEAD; # # to the delay() routines in arch/i386/kernel/timers/*.c and determine # what the OVERHEAD is. # # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/lib/delay.c # 2004/06/18 00:06:04-07:00 linux@dominikbrodowski.de +1 -1 # add 1 in __const_udelay() # # ChangeSet # 2004/06/18 08:11:56-07:00 linux@dominikbrodowski.de # [PATCH] round up in __udelay() # # Round up in __udelay(): 2**32 / 100000 is 4294.97, so it's more intuitive # to round up, and it causes more predictable results: # # n usec delay on a 1500000 BogoMIPS system: # # n before -mull after # 1 1000 ticks 1499 ticks 1500 ticks # 10 14000 ticks 14999 ticks 15000 ticks # # n usec delay on a 100000 BogoMIPS system: # # n before -mull after # 1 0 ticks 99 ticks 100 ticks # 10 0 ticks 999 ticks 1000 ticks # 100 9000 ticks 9999 ticks 10000 ticks # # While it can be argued that some time is also spent in the delay functions, # it's better to spend _at least_ the specified time sleeping, in my humble # opinion. And the overhead of a specific ->delay() implementation should be # substracted in the specific ->delay() implementation. # # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/delay.h # 2004/06/18 00:06:04-07:00 linux@dominikbrodowski.de +1 -1 # round up in __udelay() # # arch/i386/lib/delay.c # 2004/06/18 00:32:10-07:00 linux@dominikbrodowski.de +1 -1 # round up in __udelay() # # ChangeSet # 2004/06/18 08:11:46-07:00 linux@dominikbrodowski.de # [PATCH] mull'ify multiplication with HZ in __const_udelay() # # John Stultz mentioned on lkml ( http://lkml.org/lkml/2004/6/5/15 ) that # calls to udelay() don't delay long enough, causing trouble e.g. in the USB # subsystem. The following patches address this issue. # # Move the multiplication of (loops_per_jiffy * xloops) with HZ into the # "mull" asm operation. This increases the accuracy of the delay functions # largely: # # n usec delay on a system with loops_per_jiffy = 1500000 : # # n before after # 1 1000 ticks 1499 ticks # 10 14000 ticks 14999 ticks # # n usec delay on a system with loops_per_jiffy = 100000 : # # n before after # 1 0 ticks 99 ticks # 10 0 ticks 999 ticks # 100 9000 ticks 9999 ticks # # As noted by Kurt Garloff, it's necessary to adjust for large # loops_per_jiffies, as the multiplication of it with HZ fails for 4GHz or # larger. So, John Stultz suggested multiplying xloops with 4 first, and # multiplying with (HZ/4). # # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/lib/delay.c # 2004/06/18 00:32:10-07:00 linux@dominikbrodowski.de +3 -2 # mull'ify multiplication with HZ in __const_udelay() # # ChangeSet # 2004/06/18 08:11:35-07:00 neilb@cse.unsw.edu.au # [PATCH] Fix raid1 read_balancing code. # # The meaning of mddev->in_sync changed subtly a while ago, and raid1 wasn't # changed to match. This results in raid1 read_balancing not working # properly. This patch corrects the relevant test. # # Signed-off-by: Neil Brown # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/raid1.c # 2004/06/18 00:06:03-07:00 neilb@cse.unsw.edu.au +2 -1 # Fix raid1 read_balancing code. # # ChangeSet # 2004/06/18 08:11:24-07:00 alex@clusterfs.com # [PATCH] ext3: htree readdir fix # # I've observed that ext3_htree_fill_tree() doesn't ignore empty records # (de->inode == 0). test case is very simple: turn htree on, create several # hundreds of files, remove them and look at strace ls: # # [root@victim tests]# ls -a /test/1 # . .. # # [root@victim tests]# strace ls /test/1/ # .... # getdents64(3, /* 18 entries */, 4096) = 432 # getdents64(3, /* 0 entries */, 4096) = 0 # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/namei.c # 2004/06/18 00:06:03-07:00 alex@clusterfs.com +2 -0 # ext3: htree readdir fix # # ChangeSet # 2004/06/18 08:11:13-07:00 wli@holomorphy.com # [PATCH] fix isofs ignoring noexec and mode mount options # # * Removed period check for executables in fs/isofs/inode.c # This fixes Debian BTS #162190 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162190 # # From: Jan Gregor # To: Debian Bug Tracking System # Subject: kernel-source-2.4.18: kernel ignores noexec and mode option in cdrom case # Message-ID: <20020924162129.A328@pisidlo> # # In /etc/fstab i have following line: # /dev/cdrom /cdrom iso9660 gid=100,noauto,ro,noexec,mode=0444,user 0 0 # # I found on one CD that some files have exec bit set. From brief view # those files has no extension (filename.ext). # # My drive is asus-1610a (ATAPI writer) connected throught scsi-emulation. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/isofs/inode.c # 2004/06/18 00:06:03-07:00 wli@holomorphy.com +0 -8 # fix isofs ignoring noexec and mode mount options # # ChangeSet # 2004/06/18 08:11:04-07:00 wli@holomorphy.com # [PATCH] fix handling of '/' embedded in filenames in isofs # # * Fix slashes in broken Acorn ISO9660 images in fs/isofs/dir.c (Darren Salt) # This fixes Debian BTS #141660. # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=141660 # # From: Darren Salt # Message-ID: <4B238BA09A%linux@youmustbejoking.demon.co.uk> # To: submit@bugs.debian.org # Subject: Handle '/' in filenames in broken ISO9660 images # # [Also applicable to 2.2.x] # # There has been for some time a problem with certain CD-ROMs whose images # were generated using a particular tool on Acorn RISC OS. The problem is # that in certain catalogue entries, the extension separator character '/' # (RISC OS uses '.' and '/' the other way round) was not replaced with '.'; # thus Linux cannot properly parse this without this patch, thinking that it # is a directory separator. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/isofs/dir.c # 2004/06/18 00:06:03-07:00 wli@holomorphy.com +2 -1 # fix handling of '/' embedded in filenames in isofs # # ChangeSet # 2004/06/18 08:10:53-07:00 wli@holomorphy.com # [PATCH] fix duplicate environment variables passed to init # # * Fixed argument processing bug in init/main.c (Eric Delaunay) # This fixes Debian BTS #58566. # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=58566 # # From: Eric Delaunay # Message-Id: <200002201918.UAA02327@jazz.pontchartrain.fr> # Subject: pb in handling parameters on kernel command line # To: submit@bugs.debian.org (debian bug tracking system) # # Hello, I found some bugs in kernel command line parser. AFAIK, they are not # Debian nor sparc specific but I'm not subscribed to linux-kernel mailing list # and since I'm involved with boot-floppies (mainly for sparc), I think I'm right # to report it here. Feel free to forward it upstream (I checked the latest # 2.3.46 sources and it seems these bugs are still there). # # These bugs are not release critical. The latter just not gives the user a # chance to overwrite TERM env var at boot time. It could be just # inconvenient for serial console boot, and in this case, our busybox' init is # already enforcing TERM=vt102. # Nevertheless if it could not be fixed before the release, I could even write a # workaround in busybox' init (it's just a matter of rewriting getenv()). # # At last, it does not affect sysvinit package because serial console tty is # controlled by a getty process which is reading terminal settings on its command # line (take a look in inittab for T0 entries, if any). # # Ok, here is my modest contribution to kernel hacking. I don't know much about # kernel internals but it seems that argument parsing is a bit broken. # # One trivial patch for command line like "init=/bin/sh console=prom" where # console=prom is replaced by lot of spaces in previous call to setup_arch() on # sparc, therefore the line parsed by parse_options() is really # "init=/bin/sh " and a lot of null args are pushed into argv_init. # # The other patch is for command line like "TERM=vt100" where both default & user # TERM entries are pushed into the env array. # Taking a look into /proc/1/environ, it shows up: # HOME=/ # TERM=linux # TERM=vt100 # # It appears that ash (maybe other shells too) is giving the latter entry but # glibc getenv() is giving the former. It is therefore impossible to get entry # from the user in a C program like busybox' init (used in Debian boot-floppies). # # I guess getenv() is not written to support duplicate entries, therefore the # kernel should avoid such construct. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # init/main.c # 2004/06/18 00:06:03-07:00 wli@holomorphy.com +2 -0 # fix duplicate environment variables passed to init # # ChangeSet # 2004/06/18 08:10:43-07:00 wli@holomorphy.com # [PATCH] unregister driver if probing fails in sb_card.c # # * Unregister driver if probing fails in sound/oss/sb_card.c # This fixes Debian BTS #218845. # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218845 # # From: Robin Gerard # To: submit@bugs.debian.org # Subject: no sound with kernel-image-2.6.0-test9-1-386 # Message-ID: <20031103004939.GA2071@mauritius> # # I downlaoded the kernel-image-2.6.0-test9-1-386_2.6.0-test9-1_i386.deb # and I installed it successfully. Everything works fine, except the sound. # (I run also the kernel-image-2.4.20 and the sound is ok with this kernel) # My sound card is a sb. # # First I launched modconf but no module was displayed. # # I did: modprobe sb # and I got: # # sb: Init: Done # sb: Init: Starting Probe... # kobject_register failed for OSS SndBlstr (-17) # Call Trace: # [] kobject_register+0x3a/0x40 # [] bus_add_driver+0x30/0x64 # [] driver_register+0x2d/0x34 # [] preempt_schedule+0x2a/0x48 # [] pnp_register_driver+0x28/0x58 # [] pnp_register_card_driver+0x5e/0x98 # [] sb_init+0x63/0xb5 [sb] # [] sys_init_module+0xe8/0x1f0 # [] syscall_call+0x7/0xb # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # sound/oss/sb_card.c # 2004/06/18 00:06:03-07:00 wli@holomorphy.com +7 -1 # unregister driver if probing fails in sb_card.c # # ChangeSet # 2004/06/18 08:10:32-07:00 wli@holomorphy.com # [PATCH] lower priority of "too many keys" msg in atkbd.c # # From: "Jon Thackray" # # * Lowered priority of "too many keys" message in drivers/input/keyboard/atkbd.c # This fixes Debian BTS #239036. # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=239036 # # # The keyboard under 2.6.4 seems to be behaving strangely, reporting unknown # key codes and too many keys pressed, even when no keys have been pressed. # The keyboard is connected via an 8 way KVM switch, but was working quite # acceptably under 2.4.25 with no such messages. Trying 2.6.3 is not an # option as it doesn't support the hardware properly, as previously reported. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/input/keyboard/atkbd.c # 2004/06/18 00:48:49-07:00 wli@holomorphy.com +1 -1 # lower priority of "too many keys" msg in atkbd.c # # ChangeSet # 2004/06/18 08:10:21-07:00 rddunlap@osdl.org # [PATCH] istallion printk fix # # istallion: Remove duplicate "%d" in printk(); # # Signed-off-by: Randy Dunlap # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/char/istallion.c # 2004/06/18 00:06:03-07:00 rddunlap@osdl.org +1 -1 # istallion printk fix # # ChangeSet # 2004/06/18 08:10:10-07:00 egmont@uhulinux.hu # [PATCH] Shift+PgUp if nr of scrolled lines is < 4 # # Using the vga console driver, if the number of the lines scrolled out is # less than four, then Shift+PageUp doesn't work. # # The bug is closely related to the 'margin' feature of scrolling, which # means that if less than four lines should remain unvisible in the direction # we are scrolling to, then we scroll a little bit more just to see those few # lines. Kind of two small magnets at the borders of the buffer. # # This bug was also reported with maybe a less clear description by Stepan # Koltsov (cc'ed just for fun) back in 2001 and he got no answer. I found it # at http://seclists.org/lists/linux-kernel/2001/Nov/0080.html # # His patch simply disables margin support and hence everythings becomes # okay, but you lose a nice feature. # # Here's a patch that retains margin support and fixes the bug. Works for # me, tested for a week. No guarantee. As I don't fully understand the code # (see also my previous mail) I'm not 100% sure that I'm doing the right # thing, so I'd prefer if someone would take a closer look at it. # # At least 2.4 and 2.6 are affected, maybe older ones too. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/console/vgacon.c # 2004/06/18 00:06:02-07:00 egmont@uhulinux.hu +2 -0 # Shift+PgUp if nr of scrolled lines is < 4 # # ChangeSet # 2004/06/18 08:09:59-07:00 davidel@xmailserver.org # [PATCH] epoll: replace the file lookup hash with rbtrees # # The epoll allocation for the fd lookup hash used to allocate up to 1MB # (depending on the "hint" size passed to epoll_create()) with # __get_free_pages(0), and this might lead to a "malicious" user to do # something like: # # for (i = 0; i < 1024; i++) # epoll_create(BIG-NUM); # # You can replace "malicious user" with IBM-ltp test suite, and the meaning # does not change. The above code might exhaust memory badly, even before # the file creation limit is topped. Also, the allocation was independent # from the number of fds pushed into the epoll fd hash. Using an rb-tree # ther will be not pre-allocation of the hash, and the size of the memory # used will be proportional to the number of fds pushed into the epoll fd. # The patch also removes 100 lines of code, that is never a bad thing ;) # # Signed-off-by: Davide Libenzi # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/eventpoll.c # 2004/06/18 00:06:02-07:00 davidel@xmailserver.org +93 -187 # epoll: replace the file lookup hash with rbtrees # # ChangeSet # 2004/06/18 08:09:48-07:00 rtjohnso@eecs.berkeley.edu # [PATCH] drivers/char/ipmi/ipmi_devintf.c: user/kernel pointer typo # # Judging from context, I think there's a misplaced "&" in this code that can # cause stack overflows and other nasty problems. Perhaps it's left over # from when msgdata was an array instead of a pointer? # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/char/ipmi/ipmi_devintf.c # 2004/06/18 00:32:07-07:00 rtjohnso@eecs.berkeley.edu +1 -1 # drivers/char/ipmi/ipmi_devintf.c: user/kernel pointer typo # # ChangeSet # 2004/06/18 08:09:37-07:00 akpm@osdl.org # [PATCH] Make update_one_process() static # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/timer.c # 2004/06/17 23:59:01-07:00 akpm@osdl.org +1 -1 # Make update_one_process() static # # include/linux/sched.h # 2004/06/18 00:32:06-07:00 akpm@osdl.org +0 -2 # Make update_one_process() static # # ChangeSet # 2004/06/18 08:09:26-07:00 vandrove@vc.cvut.cz # [PATCH] Decrease stack usage in ncpfs's ioctl # # It decreases stack consumption in one of ncpfs's paths from 3000 to 2200 # bytes (and stack portion in ncpfs ioctl code from 1336 to 452 bytes). # # - some code used large structure (with embeded 256 bytes for filename) # while it never passed filename around. Use something smaller in # ncp_conn_logged_in. Decrease 616 => 300. # # - gcc-3.3 is very bad when it comes to parallel blocks in ioctl. Split # some branches from large switch to separate functions. ncp_ioctl now # uses 152 bytes of stack (instead of 720) and biggest child 64. # # Signed-off-by: Petr Vandrovec # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ncpfs/ncplib_kernel.h # 2004/06/17 23:59:01-07:00 vandrove@vc.cvut.cz +5 -3 # Decrease stack usage in ncpfs's ioctl # # fs/ncpfs/ncplib_kernel.c # 2004/06/17 23:59:01-07:00 vandrove@vc.cvut.cz +27 -15 # Decrease stack usage in ncpfs's ioctl # # fs/ncpfs/ioctl.c # 2004/06/17 23:59:01-07:00 vandrove@vc.cvut.cz +160 -157 # Decrease stack usage in ncpfs's ioctl # # fs/ncpfs/dir.c # 2004/06/17 23:59:01-07:00 vandrove@vc.cvut.cz +5 -5 # Decrease stack usage in ncpfs's ioctl # # ChangeSet # 2004/06/18 08:09:16-07:00 herbert@gondor.apana.org.au # [PATCH] swsusp: remove copy_pagedir # # It can be replaced by a simple memcpy. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/power/swsusp.c # 2004/06/17 23:59:00-07:00 herbert@gondor.apana.org.au +3 -16 # swsusp: remove copy_pagedir # # kernel/power/pmdisk.c # 2004/06/17 23:59:00-07:00 herbert@gondor.apana.org.au +4 -16 # swsusp: remove copy_pagedir # # ChangeSet # 2004/06/18 08:09:05-07:00 herbert@gondor.apana.org.au # [PATCH] remove unnecessary memsets from swsusp and pmdisk # # Here's the patch that removes the memset calls from both pmdisk and swsusp. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/power/swsusp.c # 2004/06/18 00:32:12-07:00 herbert@gondor.apana.org.au +0 -1 # remove unnecessary memsets from swsusp and pmdisk # # kernel/power/pmdisk.c # 2004/06/18 00:32:12-07:00 herbert@gondor.apana.org.au +0 -1 # remove unnecessary memsets from swsusp and pmdisk # # ChangeSet # 2004/06/18 08:08:54-07:00 herbert@gondor.apana.org.au # [PATCH] omdisk memory leak fix # # Fix a couple of memory leaks in the pmdisk driver. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/power/pmdisk.c # 2004/06/18 00:32:13-07:00 herbert@gondor.apana.org.au +11 -11 # omdisk memory leak fix # # ChangeSet # 2004/06/18 08:08:43-07:00 pavel@ucw.cz # [PATCH] Fix memory leak in swsusp # # This fixes 2 memory leaks in swsusp: during relocating pagedir, eaten pages # were not properly freed in error path and even regular freeing path was # freeing one page too little. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/power/swsusp.c # 2004/06/18 00:32:13-07:00 pavel@ucw.cz +16 -11 # Fix memory leak in swsusp # # ChangeSet # 2004/06/18 08:08:32-07:00 axboe@suse.de # [PATCH] blk: move threshold unplugging # # The 'unplug on queued exceeding unplug threshold' logic only works for file # system requests currently, since it's in __make_request(). Move it where # it belongs, in elv_add_request(). This way it works for queued block sg # requests as well. # # Signed-Off-By: Jens Axboe # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/blkdev.h # 2004/06/18 08:08:26-07:00 axboe@suse.de +1 -0 # blk: move threshold unplugging # # drivers/block/ll_rw_blk.c # 2004/06/18 08:08:26-07:00 axboe@suse.de +4 -7 # blk: move threshold unplugging # # drivers/block/elevator.c # 2004/06/18 08:08:26-07:00 axboe@suse.de +8 -0 # blk: move threshold unplugging # # ChangeSet # 2004/06/18 08:08:21-07:00 axboe@suse.de # [PATCH] fix cdrom mt rainier probe # # Mt rainier probe must be deferred to media load time, since it requires a # valid media (the drive may present a different capability based on what # media is loaded). This fixes that for ide-cd and sr. # # Signed-Off-By: Jens Axboe # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/scsi/sr.c # 2004/06/18 08:08:15-07:00 axboe@suse.de +1 -15 # fix cdrom mt rainier probe # # drivers/ide/ide-cd.h # 2004/06/18 08:08:15-07:00 axboe@suse.de +0 -2 # fix cdrom mt rainier probe # # drivers/ide/ide-cd.c # 2004/06/18 08:08:15-07:00 axboe@suse.de +1 -22 # fix cdrom mt rainier probe # # drivers/cdrom/cdrom.c # 2004/06/18 08:08:15-07:00 axboe@suse.de +30 -2 # fix cdrom mt rainier probe # # ChangeSet # 2004/06/18 08:08:10-07:00 mikem@beardog.cca.cpqcorp.net # [PATCH] cciss ioctl32 update # # This patch provides a conversion routine for 32-bit user space apps that # call into a 64-bit kernel on x86_64 architectures. This is required for # the HP Array Configuration utility and the HP management agents. Without # this patch the apps will not function. # # The 2 ioctls affected are the cciss pass thru ioctls. Caveat: it spits out # 2 warnings during compilation. I've tried everything I can think of to # clean them up, but... If anyone has any helpful suggestions I'm all ears. # # Code by Stephen Cameron # Tested by Stephen Cameron & Mike Miller # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/cciss_ioctl.h # 2004/06/18 08:08:04-07:00 mikem@beardog.cca.cpqcorp.net +28 -0 # cciss ioctl32 update # # drivers/block/cciss.c # 2004/06/18 08:08:04-07:00 mikem@beardog.cca.cpqcorp.net +144 -0 # cciss ioctl32 update # # ChangeSet # 2004/06/18 08:07:59-07:00 andrea@suse.de # [PATCH] remap_file_pages() speedup # # Avoid taking down_write(mmap_sem) unless we really need it. # # Seems that the only reason we're taking it for writing is to protect # vma->vm_flags. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/fremap.c # 2004/06/17 23:58:59-07:00 andrea@suse.de +12 -5 # remap_file_pages() speedup # # ChangeSet # 2004/06/18 08:07:48-07:00 arun.sharma@intel.com # [PATCH] sys_getdents64 needs compat wrapper # # Due to different structure alignment rules in the ABI between ia32 and # ia64, certain members of the dirent structure are not guaranteed to be 8 # byte aligned on ia64. This requires a compat wrapper around these 32 bit # system calls. Other architectures may or may not have the problem, # depending on the alignment rules. # # This was observed by running /emul/ia32-linux/bin/ls on 2.6.6 which produces # kernel mode unaligned faults. # # Original patch by: Arnd Bergmann # Signed-off-by: Gordon Jin # Signed-off-by: Arun Sharma # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/compat.c # 2004/06/17 23:58:59-07:00 arun.sharma@intel.com +255 -0 # sys_getdents64 needs compat wrapper # # arch/ia64/ia32/ia32_entry.S # 2004/06/17 23:58:59-07:00 arun.sharma@intel.com +2 -2 # sys_getdents64 needs compat wrapper # # ChangeSet # 2004/06/18 08:07:37-07:00 tvignaud@mandrakesoft.com # [PATCH] checksatck.pl fixes # # - "\<" and "\>" can be safely replaced with "<" and ">" # # - "$var =~ /^string$/" is better written "$var eq 'string'" # # - $i is better written without the double quotes # # - it's not safe to use for without "my"ing the iteration variable # # - "print foreach @array" is better written "print @array" # # - declare variables # # - ".*" is useless at the end of a regexp # # - "$a[@a] = $foo" is a rather obfuscated syntax for "push @a, $foo"... # let's not opencoding language basic operators... # # - ignoring return value from a regexp is very bad: this can results in # working on previous value of $1, $2, ... # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # scripts/checkstack.pl # 2004/06/17 23:58:59-07:00 tvignaud@mandrakesoft.com +14 -15 # checksatck.pl fixes # # ChangeSet # 2004/06/18 08:07:26-07:00 ashok.raj@intel.com # [PATCH] don't create cpu/online sysfs file # # This file provides ability for caller of register_cpu() to either create a # control file, or not. This can be handy if a particular platform decides # that certain CPU's are not removable. Hence would like to not create a # control file. # # Signed-off-by: Dave Hansen # Signed-off-by: Ashok Raj # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/cpu.h # 2004/06/17 23:58:59-07:00 ashok.raj@intel.com +1 -0 # don't create cpu/online sysfs file # # drivers/base/cpu.c # 2004/06/17 23:58:59-07:00 ashok.raj@intel.com +3 -1 # don't create cpu/online sysfs file # # arch/ppc64/kernel/sysfs.c # 2004/06/17 23:58:59-07:00 ashok.raj@intel.com +10 -0 # don't create cpu/online sysfs file # # ChangeSet # 2004/06/18 08:07:15-07:00 umka@namesys.com # [PATCH] memory allocation checks in cs46xx_dsp_proc_register_scb_desc() # # Adds memory allocation checks in cs46xx_dsp_proc_register_scb_desc() # # Signed-off-by: Yury Umanets # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # sound/pci/cs46xx/dsp_spos_scb_lib.c # 2004/06/17 23:57:06-07:00 umka@namesys.com +7 -1 # memory allocation checks in cs46xx_dsp_proc_register_scb_desc() # # ChangeSet # 2004/06/18 08:07:05-07:00 torque@ukrpost.net # [PATCH] memory allocation checks in mtdblock_open() # # Fixes memory allocation check in mtdblock_open() # # Signed-off-by: Yury Umanets # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/mtd/mtdblock.c # 2004/06/17 23:57:06-07:00 torque@ukrpost.net +1 -1 # memory allocation checks in mtdblock_open() # # ChangeSet # 2004/06/18 08:06:54-07:00 torque@ukrpost.net # [PATCH] memory allocation checks in eth1394_update() # # Adds memory allocation checks in eth1394_update(). # # Signed-off-by: Yury Umanets # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/ieee1394/eth1394.c # 2004/06/17 23:57:06-07:00 torque@ukrpost.net +4 -1 # memory allocation checks in eth1394_update() # # ChangeSet # 2004/06/18 08:06:43-07:00 ak@suse.de # [PATCH] Use numa policy API for boot time policy # # Suggested by Manfred Spraul. # # __get_free_pages had a hack to do node interleaving allocation at boot # time. This patch sets an interleave process policy using the NUMA API for # init and the idle threads instead. Before entering the user space init the # policy is reset to default again. Result is the same. # # Advantage is less code and removing of a check from a fast path. # # Removes more code than it adds. # # I verified that the memory distribution after boot is roughly the same. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/page_alloc.c # 2004/06/17 23:57:05-07:00 ak@suse.de +0 -41 # Use numa policy API for boot time policy # # mm/mempolicy.c # 2004/06/17 23:57:05-07:00 ak@suse.de +15 -3 # Use numa policy API for boot time policy # # init/main.c # 2004/06/18 00:32:11-07:00 ak@suse.de +4 -0 # Use numa policy API for boot time policy # # include/linux/mempolicy.h # 2004/06/17 23:57:05-07:00 ak@suse.de +11 -0 # Use numa policy API for boot time policy # # ChangeSet # 2004/06/18 08:06:32-07:00 wli@holomorphy.com # [PATCH] apic: make mach_default compile again # # While sweeping the APIC code two points were missed. The first is getting # the definition of BAD_APICID available to # include/asm-i386/mach-default/mach_apic.h by #including the right header, # and the second is UP local APIC without UP IO-APIC linking in # get_broadcast_physid(). # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/mach-default/mach_apic.h # 2004/06/17 23:56:25-07:00 wli@holomorphy.com +1 -0 # apic: make mach_default compile again # # arch/i386/kernel/io_apic.c # 2004/06/17 23:56:25-07:00 wli@holomorphy.com +0 -11 # apic: make mach_default compile again # # arch/i386/kernel/apic.c # 2004/06/17 23:56:25-07:00 wli@holomorphy.com +11 -0 # apic: make mach_default compile again # # ChangeSet # 2004/06/18 08:06:21-07:00 wli@holomorphy.com # [PATCH] apic: remove marking of non-present physids in phys_cpu_present_map # # Marking invalid APIC ID's in phys_cpu_present_map was intended to generate # "collisions" between APIC ID's in order to assist the ordinary bounds # checking against the broadcast physical APIC ID. However, this is bounds # checked everywhere it's necessary, and it's also not even possible to # properly bounds-check everywhere. So this patch removes that marking of # non-present physical APIC ID's. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/mach-visws/mpparse.c # 2004/06/17 23:56:23-07:00 wli@holomorphy.com +0 -8 # apic: remove marking of non-present physids in phys_cpu_present_map # # arch/i386/kernel/mpparse.c # 2004/06/17 23:56:23-07:00 wli@holomorphy.com +1 -13 # apic: remove marking of non-present physids in phys_cpu_present_map # # ChangeSet # 2004/06/18 08:06:09-07:00 wli@holomorphy.com # [PATCH] apic: fix kicking of non-present cpus # # The following patch repairs kicking of non-present cpus by making # cpu_present_to_apicid() bounds-check its argument. It also corrects the # same issue on NUMA-Q by correctly passing the generated artificial APIC ID # instead of the raw value discovered in the MP table. # # A miscellaneous compilefix for CONFIG_ACPI_BOOT is also included for # completeness. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/mach-visws/mach_apic.h # 2004/06/17 23:55:40-07:00 wli@holomorphy.com +4 -1 # apic: fix kicking of non-present cpus # # include/asm-i386/mach-default/mach_apic.h # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +4 -1 # apic: fix kicking of non-present cpus # # include/asm-i386/apic.h # 2004/06/17 23:55:40-07:00 wli@holomorphy.com +2 -0 # apic: fix kicking of non-present cpus # # arch/i386/kernel/mpparse.c # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +4 -4 # apic: fix kicking of non-present cpus # # arch/i386/kernel/io_apic.c # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +1 -1 # apic: fix kicking of non-present cpus # # ChangeSet # 2004/06/18 08:05:58-07:00 wli@holomorphy.com # [PATCH] APIC enumeration fixes # # The following patch appears sound according to an audit to ensure that all # of the codepaths where it was introduced were called after the APIC # fixmappings were set up. # # This patch introduces get_physical_broadcast(), which checks the version ID # of the local APIC to determine whether it's a serial APIC or xAPIC, and # returns the correct physical broadcast ID. It replaces all uses of # APIC_BROADCAST_ID and IO_APIC_MAX_ID with this in order to ensure. It also # changes the checks during MP table parsing so the APIC ID is checked in # tandem with the version number. # # I'm holding out for some kind of testing to get an idea of whether this # covers the cases or introduces regressions, or whatever. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/mpspec_def.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +1 -0 # APIC enumeration fixes # # include/asm-i386/mach-visws/mach_apic.h # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +0 -1 # APIC enumeration fixes # # include/asm-i386/mach-summit/mach_mpspec.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -5 # APIC enumeration fixes # # include/asm-i386/mach-summit/mach_apic.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -1 # APIC enumeration fixes # # include/asm-i386/mach-numaq/mach_mpspec.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -5 # APIC enumeration fixes # # include/asm-i386/mach-numaq/mach_apic.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -1 # APIC enumeration fixes # # include/asm-i386/mach-generic/mach_mpspec.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -5 # APIC enumeration fixes # # include/asm-i386/mach-generic/mach_apic.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -1 # APIC enumeration fixes # # include/asm-i386/mach-es7000/mach_mpspec.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -5 # APIC enumeration fixes # # include/asm-i386/mach-es7000/mach_apic.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -1 # APIC enumeration fixes # # include/asm-i386/mach-default/mach_mpspec.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -5 # APIC enumeration fixes # # include/asm-i386/mach-default/mach_apic.h # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +0 -6 # APIC enumeration fixes # # include/asm-i386/mach-bigsmp/mach_mpspec.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -5 # APIC enumeration fixes # # include/asm-i386/mach-bigsmp/mach_apic.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -1 # APIC enumeration fixes # # include/asm-i386/genapic.h # 2004/06/17 23:55:23-07:00 wli@holomorphy.com +0 -2 # APIC enumeration fixes # # arch/i386/mach-visws/mpparse.c # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +10 -2 # APIC enumeration fixes # # arch/i386/kernel/mpparse.c # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +30 -2 # APIC enumeration fixes # # arch/i386/kernel/io_apic.c # 2004/06/18 00:32:15-07:00 wli@holomorphy.com +18 -9 # APIC enumeration fixes # # ChangeSet # 2004/06/18 08:05:47-07:00 akpm@osdl.org # [PATCH] i386 uninline some bitops # # Uninline the non-leaf bit search functions. Saves 9 kbytes from my vmlinux. # # And gratuitously s/__inline__/inline/ # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/lib/bitops.c # 2004/06/17 23:55:22-07:00 akpm@osdl.org +70 -0 # i386 uninline some bitops # # include/asm-i386/bitops.h # 2004/06/17 23:55:22-07:00 akpm@osdl.org +27 -77 # i386 uninline some bitops # # arch/i386/lib/bitops.c # 2004/06/17 23:55:22-07:00 akpm@osdl.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/i386/lib/bitops.c # # arch/i386/lib/Makefile # 2004/06/17 23:55:22-07:00 akpm@osdl.org +2 -3 # i386 uninline some bitops # # ChangeSet # 2004/06/18 08:05:36-07:00 wli@holomorphy.com # [PATCH] x86_64 numa cpumask build fix # # arch/x86_64/mm/numa.c: In function `numa_initmem_init': # arch/x86_64/mm/numa.c:185: error: incompatible types in assignment # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/mm/numa.c # 2004/06/17 23:53:45-07:00 wli@holomorphy.com +1 -1 # x86_64 numa cpumask build fix # # ChangeSet # 2004/06/18 08:05:25-07:00 tom.l.nguyen@intel.com # [PATCH] msi TARGET_CPUS fix # # Somehow the change in TARGET_CPUS generated this error in UP environment. # Patch below will fix it. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/msi.h # 2004/06/17 23:53:44-07:00 tom.l.nguyen@intel.com +1 -1 # msi TARGET_CPUS fix # # ChangeSet # 2004/06/18 08:05:14-07:00 kevcorry@us.ibm.com # [PATCH] dm: dm-raid1.c: Use list_for_each_entry_safe # # dm-raid1.c: In rh_exit(), use list_for_each_entry_safe instead of # list_for_each_safe. # # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-raid1.c # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +2 -4 # dm: dm-raid1.c: Use list_for_each_entry_safe # # ChangeSet # 2004/06/18 08:05:03-07:00 kevcorry@us.ibm.com # [PATCH] dm: dm-raid1.c: Make delayed_bios a bio_list # # dm-raid1.c: Make struct region::delayed_bios a bio_list instead of a bio*. # This will ensure the queued bios are kept in the proper order. # # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-raid1.c # 2004/06/18 00:32:16-07:00 kevcorry@us.ibm.com +7 -10 # dm: dm-raid1.c: Make delayed_bios a bio_list # # ChangeSet # 2004/06/18 08:04:52-07:00 kevcorry@us.ibm.com # [PATCH] dm: dm-io: Error handling # # dm-io: Proper error handling when someone is trying to read from multiple # regions. # # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-io.c # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +12 -2 # dm: dm-io: Error handling # # ChangeSet # 2004/06/18 08:04:41-07:00 kevcorry@us.ibm.com # [PATCH] dm: Use structure assignments instead of memcpy # # Use structure assignments instead of memcpy's. # [Suggested by akpm during kcopyd review.] # # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/kcopyd.c # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +2 -2 # dm: Use structure assignments instead of memcpy # # drivers/md/dm.c # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +1 -1 # dm: Use structure assignments instead of memcpy # # drivers/md/dm-table.c # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +2 -2 # dm: Use structure assignments instead of memcpy # # drivers/md/dm-snap.c # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +1 -1 # dm: Use structure assignments instead of memcpy # # drivers/md/dm-raid1.c # 2004/06/18 00:32:16-07:00 kevcorry@us.ibm.com +2 -2 # dm: Use structure assignments instead of memcpy # # ChangeSet # 2004/06/18 08:04:32-07:00 kevcorry@us.ibm.com # [PATCH] dm: Create/destroy kcopyd on demand. # # Create/destroy kcopyd on demand. # # This changes kcopyd to initialize its mempool and workqueue only when a # client specifically needs to use it. # # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/kcopyd.h # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +0 -3 # dm: Create/destroy kcopyd on demand. # # drivers/md/kcopyd.c # 2004/06/18 00:32:16-07:00 kevcorry@us.ibm.com +61 -27 # dm: Create/destroy kcopyd on demand. # # drivers/md/dm.h # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +0 -3 # dm: Create/destroy kcopyd on demand. # # drivers/md/dm.c # 2004/06/18 00:32:16-07:00 kevcorry@us.ibm.com +0 -1 # dm: Create/destroy kcopyd on demand. # # ChangeSet # 2004/06/18 08:04:21-07:00 kevcorry@us.ibm.com # [PATCH] dm: Documentation # # Device-Mapper documentation. # # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/device-mapper/zero.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +37 -0 # dm: Documentation # # Documentation/device-mapper/striped.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +58 -0 # dm: Documentation # # Documentation/device-mapper/linear.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +61 -0 # dm: Documentation # # Documentation/device-mapper/kcopyd.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +47 -0 # dm: Documentation # # Documentation/device-mapper/dm-io.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +75 -0 # dm: Documentation # # Documentation/device-mapper/zero.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/device-mapper/zero.txt # # Documentation/device-mapper/striped.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/device-mapper/striped.txt # # Documentation/device-mapper/linear.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/device-mapper/linear.txt # # Documentation/device-mapper/kcopyd.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/device-mapper/kcopyd.txt # # Documentation/device-mapper/dm-io.txt # 2004/06/17 23:53:44-07:00 kevcorry@us.ibm.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/device-mapper/dm-io.txt # # ChangeSet # 2004/06/18 08:04:10-07:00 christophe@saout.de # [PATCH] Device-mapper: dm-zero flushing fix # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-zero.c # 2004/06/17 23:53:43-07:00 christophe@saout.de +2 -1 # Device-mapper: dm-zero flushing fix # # ChangeSet # 2004/06/18 08:03:59-07:00 kevcorry@us.ibm.com # [PATCH] dm: dm-zero version # # Add missing dm-zero version number. # # From: Alasdair Kergon # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-zero.c # 2004/06/18 00:32:17-07:00 kevcorry@us.ibm.com +1 -0 # dm: dm-zero version # # ChangeSet # 2004/06/18 08:03:48-07:00 agk@redhat.com # [PATCH] Device-mapper: dm-zero # # Add dm-zero target # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-zero.c # 2004/06/18 00:32:17-07:00 agk@redhat.com +96 -0 # Device-mapper: dm-zero # # drivers/md/dm-zero.c # 2004/06/18 00:32:17-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-zero.c # # drivers/md/Makefile # 2004/06/17 23:53:43-07:00 agk@redhat.com +1 -0 # Device-mapper: dm-zero # # drivers/md/Kconfig # 2004/06/17 23:53:43-07:00 agk@redhat.com +7 -0 # Device-mapper: dm-zero # # ChangeSet # 2004/06/18 08:03:37-07:00 agk@redhat.com # [PATCH] Device-mapper: mirroring # # Add mirror target. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-raid1.c # 2004/06/18 00:32:16-07:00 agk@redhat.com +1283 -0 # Device-mapper: mirroring # # drivers/md/dm-log.h # 2004/06/17 23:53:43-07:00 agk@redhat.com +124 -0 # Device-mapper: mirroring # # drivers/md/dm-log.c # 2004/06/17 23:53:43-07:00 agk@redhat.com +629 -0 # Device-mapper: mirroring # # drivers/md/dm-raid1.c # 2004/06/18 00:32:16-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-raid1.c # # drivers/md/dm-log.h # 2004/06/17 23:53:43-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-log.h # # drivers/md/dm-log.c # 2004/06/17 23:53:43-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-log.c # # drivers/md/Makefile # 2004/06/18 00:32:17-07:00 agk@redhat.com +2 -0 # Device-mapper: mirroring # # drivers/md/Kconfig # 2004/06/18 00:32:17-07:00 agk@redhat.com +7 -0 # Device-mapper: mirroring # # ChangeSet # 2004/06/18 08:03:25-07:00 kevcorry@us.ibm.com # [PATCH] dm: Fix error cleanup in dm_create_persistent() # # dm-exception-store.c: Fix error cleanup in dm_create_persistent(). # This was originally found by chrisw during code review. # # From: Dave Olien # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-exception-store.c # 2004/06/17 23:53:43-07:00 kevcorry@us.ibm.com +2 -2 # dm: Fix error cleanup in dm_create_persistent() # # ChangeSet # 2004/06/18 08:03:15-07:00 agk@redhat.com # [PATCH] Device-mapper: snapshots # # Add snapshot target # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-snap.h # 2004/06/17 23:53:43-07:00 agk@redhat.com +161 -0 # Device-mapper: snapshots # # drivers/md/dm-snap.c # 2004/06/18 00:32:16-07:00 agk@redhat.com +1213 -0 # Device-mapper: snapshots # # drivers/md/dm-snap.h # 2004/06/17 23:53:43-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-snap.h # # drivers/md/dm-snap.c # 2004/06/18 00:32:16-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-snap.c # # drivers/md/dm-exception-store.c # 2004/06/18 00:32:17-07:00 agk@redhat.com +648 -0 # Device-mapper: snapshots # # drivers/md/Makefile # 2004/06/18 00:32:17-07:00 agk@redhat.com +2 -0 # Device-mapper: snapshots # # drivers/md/Kconfig # 2004/06/18 00:32:17-07:00 agk@redhat.com +6 -0 # Device-mapper: snapshots # # drivers/md/dm-exception-store.c # 2004/06/18 00:32:17-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-exception-store.c # # ChangeSet # 2004/06/18 08:03:03-07:00 kevcorry@us.ibm.com # [PATCH] kcopyd commentary # # We're also working on some general documentation which will go in # Documentation/device-mapper and will include more detailed information # about the core driver and the other sub-modules. We'll try to submit those # patches in the near future. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/kcopyd.h # 2004/06/18 00:32:16-07:00 kevcorry@us.ibm.com +4 -0 # kcopyd commentary # # drivers/md/kcopyd.c # 2004/06/18 00:32:16-07:00 kevcorry@us.ibm.com +4 -0 # kcopyd commentary # # ChangeSet # 2004/06/18 08:02:55-07:00 kevcorry@us.ibm.com # [PATCH] dm: kcopyd: No need to lock pages # # No need to lock kcopyd pages. # # From: Alasdair Kergon # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/kcopyd.c # 2004/06/18 00:32:18-07:00 kevcorry@us.ibm.com +0 -2 # dm: kcopyd: No need to lock pages # # ChangeSet # 2004/06/18 08:02:44-07:00 kevcorry@us.ibm.com # [PATCH] dm: kcopyd: remove superfluous INIT_LIST_HEADs # # Remove superfluous kcopyd INIT_LIST_HEAD. # # From: Alasdair Kergon # Signed-off-by: Kevin Corry # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/kcopyd.c # 2004/06/18 00:32:18-07:00 kevcorry@us.ibm.com +0 -4 # dm: kcopyd: remove superfluous INIT_LIST_HEADs # # ChangeSet # 2004/06/18 08:02:33-07:00 agk@redhat.com # [PATCH] Device-mapper: kcopyd # # Add kcopyd - a daemon for copying regions of block devices around in an # efficient manner. Multiple destinations can be specified for a copy. # Designed to perform well both with many small chunks or few large chunks. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/kcopyd.h # 2004/06/18 00:32:18-07:00 agk@redhat.com +41 -0 # Device-mapper: kcopyd # # drivers/md/kcopyd.c # 2004/06/18 00:32:18-07:00 agk@redhat.com +667 -0 # Device-mapper: kcopyd # # drivers/md/kcopyd.h # 2004/06/18 00:32:18-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/kcopyd.h # # drivers/md/kcopyd.c # 2004/06/18 00:32:18-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/kcopyd.c # # drivers/md/dm.h # 2004/06/18 00:32:16-07:00 agk@redhat.com +3 -0 # Device-mapper: kcopyd # # drivers/md/dm.c # 2004/06/18 00:32:16-07:00 agk@redhat.com +1 -0 # Device-mapper: kcopyd # # drivers/md/Makefile # 2004/06/18 00:32:17-07:00 agk@redhat.com +1 -1 # Device-mapper: kcopyd # # ChangeSet # 2004/06/18 08:02:21-07:00 agk@redhat.com # [PATCH] dm-io: device-mapper i/o library for kcopyd # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-io.h # 2004/06/17 23:53:42-07:00 agk@redhat.com +77 -0 # dm-io: device-mapper i/o library for kcopyd # # mm/mempool.c # 2004/06/17 23:53:42-07:00 agk@redhat.com +0 -6 # dm-io: device-mapper i/o library for kcopyd # # drivers/md/dm-io.h # 2004/06/17 23:53:42-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-io.h # # drivers/md/dm-io.c # 2004/06/18 00:32:16-07:00 agk@redhat.com +637 -0 # dm-io: device-mapper i/o library for kcopyd # # drivers/md/Makefile # 2004/06/18 00:32:18-07:00 agk@redhat.com +1 -1 # dm-io: device-mapper i/o library for kcopyd # # drivers/md/dm-io.c # 2004/06/18 00:32:16-07:00 agk@redhat.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/md/dm-io.c # # ChangeSet # 2004/06/18 08:02:10-07:00 bogdan.costescu@iwr.uni-heidelberg.de # [PATCH] 3c59x: support for ATI Radeon 9100 IGP # # The following patch adds support for the 3Com networking core found in the # ATI Radeon 9100 IGP southbridge used on boards like Asus P4R800-VM. # # The main point of this patch is using HAS_MII instead of HAS_NWAY for the # definition of the board. All the previous trials since the end of last # year used HAS_NWAY which disables the Tx part of the transceiver; using # HAS_NWAY was the way all 3Com Cyclone and Tornado chips worked, as they had # the transceiver integrated. The ATI solution has an external transceiver # and I had to physically see the different chip on the board (the board was # provided by ATI) to finally understand that it needs the HAS_MII # definition... I'm still waiting for some docs from ATI to clarify if this # is the correct way of handling this chip and if there are any differences # w.r.t EEPROM handling, but as it appears to work and was also confirmed by # other testers, I don't want to keep owners of such boards away from their # networks :-) # # The textual identification was a bit hard to decide; it's called # "3c920B-EMB-WNM" in the Windows .INF file that Asus provides for their # boards. As this name was already used for PCI ID 9210, I added the # paranthesis which specifies where this chip is found. # # The Scyld driver defines FEATURE_TORNADO to include HAS_NWAY. This board # would then probably need to not be defined with FEATURE_TORNADO, but the # same as in this patch. # # I would like to publicly thank Tyson Vickers for both ideas and patience # during the last few weeks. He managed to get the driver working by # randomly setting driver parameters :-) But then he contacted me and worked # with me towards the solution. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/3c59x.c # 2004/06/17 23:53:42-07:00 bogdan.costescu@iwr.uni-heidelberg.de +8 -4 # 3c59x: support for ATI Radeon 9100 IGP # # ChangeSet # 2004/06/18 08:01:58-07:00 thomas@winischhofer.net # [PATCH] sisfb update 1.7.10 # # attached is an update for the sisfb driver to version 1.7.10. # # This update includes # # - fixes for pure 64bit and 32/64bit mixed systems (add ioctl conversion; # fix variable sizes, etc; REQUIRED for current X.org/XFree86 on 64bit # systems, even if pure 64bit), # # - fixes for 301C video bridge, (scales TV output correctly now) # # - fixes for 1600x1200 and 1400x1050 LCD panels, # # - many fixes for 661/741/760 (amongst others, proper LFB support for the # 760 and corrections for SiS' new BIOS data layout; would lead to display # corruption with old driver) # # - add support for many modes for LCD which were unsupported previously, # # - add support for HiVision and YPbPr HDTV # # - "vga=" statement now honoured properly (sisfb will set the same mode as # the kernel did by default) # # - use LCD native resolution mode if no mode is given # # - a major clean up of main driver code, # # - radical removal of duplicate (or nearly duplicate) code, # # - switched to 2.6 module_param macros, # # - enhanced communication with the X driver, # # - added eventual POSTing of SiS300/305 card for non-x86 archs, # # - added ability to relocate the image on the TV screen using a userland # tool, # # - added Documentation/fb/sisfb.txt (why the heck was this missing?!) # # - small fix for SiS DRM driver (match 32/64bit fixes mentioned above) # (cast the data passed to sis_free as u32) # # - make driver re-entrant by avoiding static structures and variables. # # As usual, heavily tested. The mode switching code is even lab-tested by # SiS (although 100% written by me). Please apply asap (especially since # 64bit systems were not properly supported previously; as mentioned, current # X.org/XFree86 needs this update for proper communication with the # framebuffer driver on 64bit systems. X crashes on such systems with the # old driver). # # Signed-off-by: Thomas Winischhofer # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/video/sisfb.h # 2004/06/17 23:53:42-07:00 thomas@winischhofer.net +80 -171 # sisfb update 1.7.10 # # drivers/video/sis/vstruct.h # 2004/06/17 23:53:42-07:00 thomas@winischhofer.net +58 -100 # sisfb update 1.7.10 # # drivers/video/sis/vgatypes.h # 2004/06/17 23:53:42-07:00 thomas@winischhofer.net +62 -103 # sisfb update 1.7.10 # # drivers/video/sis/sis_main.h # 2004/06/17 23:53:42-07:00 thomas@winischhofer.net +365 -704 # sisfb update 1.7.10 # # drivers/video/sis/sis_main.c # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +3762 -3016 # sisfb update 1.7.10 # # drivers/video/sis/sis_accel.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +140 -264 # sisfb update 1.7.10 # # drivers/video/sis/sis_accel.c # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +188 -187 # sisfb update 1.7.10 # # drivers/video/sis/sis.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +497 -2 # sisfb update 1.7.10 # # drivers/video/sis/osdef.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +45 -65 # sisfb update 1.7.10 # # drivers/video/sis/oem310.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +32 -196 # sisfb update 1.7.10 # # drivers/video/sis/oem300.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +3 -5 # sisfb update 1.7.10 # # drivers/video/sis/initdef.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +85 -37 # sisfb update 1.7.10 # # drivers/video/sis/init301.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +132 -60 # sisfb update 1.7.10 # # drivers/video/sis/init.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +198 -607 # sisfb update 1.7.10 # # drivers/video/sis/init.c # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +961 -1060 # sisfb update 1.7.10 # # Documentation/fb/sisfb.txt # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +158 -0 # sisfb update 1.7.10 # # drivers/video/sis/init301.c # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +3425 -4113 # sisfb update 1.7.10 # # drivers/video/sis/310vtbl.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +507 -1122 # sisfb update 1.7.10 # # drivers/video/sis/300vtbl.h # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +346 -458 # sisfb update 1.7.10 # # drivers/char/drm/sis_mm.c # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +2 -2 # sisfb update 1.7.10 # # Documentation/ioctl-number.txt # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +2 -0 # sisfb update 1.7.10 # # Documentation/fb/sisfb.txt # 2004/06/17 23:53:41-07:00 thomas@winischhofer.net +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/fb/sisfb.txt # # ChangeSet # 2004/06/18 08:01:45-07:00 paul@serice.net # [PATCH] iso9660: NFS fix # # Make all inode numbers unique for images less than 128GB in size. Required # for knfsd. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/iso_fs.h # 2004/06/17 23:53:41-07:00 paul@serice.net +6 -12 # iso9660: NFS fix # # fs/isofs/inode.c # 2004/06/18 00:32:11-07:00 paul@serice.net +4 -2 # iso9660: NFS fix # # fs/isofs/dir.c # 2004/06/18 00:32:11-07:00 paul@serice.net +12 -3 # iso9660: NFS fix # # ChangeSet # 2004/06/18 08:01:34-07:00 paul@serice.net # [PATCH] iso9660: fix handling of inodes beyond 4GB # # This is my fourth attempt to patch the isofs code. It is similar to the last # posting except this one implements the NFS get_parent() method which has # always been missing. # # The original problem I set out to addresses is that the current iso9660 file # system cannot reach inodes located beyond the 4GB barrier. This is caused by # using the inode number as the byte offset of the inode data. Being 32-bits # wide, the inode number is unable to reach inode data that does not reside on # the first 4GB of the file system. # # This causes real problems with "growisofs" # # http://fy.chalmers.se/~appro/linux/DVD+RW/#isofs4gb # # and my pet project "shunt" # # http://www.serice.net/shunt/ # # This patch switches the isofs code from iget() to iget5_locked() which allows # extra data to be passed into isofs_read_inode() so that inode data anywhere on # the disk can be reached. # # The inode number scheme was also changed. Continuing to use the byte offset # would have resulted in non-unique inodes in many common situations, but # because the inode number no longer plays any role in reading the meta-data off # the disk, I was free to set the inode number to some unique characteristic of # the file. I have chosen to use the block offset which is also 32-bits wide. # # Lastly, the pre-patch code uses the default export_operations to handle # accessing the file system through NFS. The problem with this is that the # default NFS operations assume that iget() works which is no longer the case # because of the necessity of switching to iget5_locked(). So, I had to # implement the NFS operations too. As a bonus, I went ahead and implemented # the NFS get_parent() method which has always been missing. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/isofs/export.c # 2004/06/17 23:53:41-07:00 paul@serice.net +228 -0 # iso9660: fix handling of inodes beyond 4GB # # include/linux/iso_fs_i.h # 2004/06/17 23:53:41-07:00 paul@serice.net +4 -1 # iso9660: fix handling of inodes beyond 4GB # # include/linux/iso_fs.h # 2004/06/18 00:32:20-07:00 paul@serice.net +66 -0 # iso9660: fix handling of inodes beyond 4GB # # fs/isofs/rock.c # 2004/06/17 23:53:41-07:00 paul@serice.net +7 -8 # iso9660: fix handling of inodes beyond 4GB # # fs/isofs/namei.c # 2004/06/17 23:53:41-07:00 paul@serice.net +21 -9 # iso9660: fix handling of inodes beyond 4GB # # fs/isofs/inode.c # 2004/06/18 00:32:20-07:00 paul@serice.net +104 -53 # iso9660: fix handling of inodes beyond 4GB # # fs/isofs/export.c # 2004/06/17 23:53:41-07:00 paul@serice.net +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/fs/isofs/export.c # # fs/isofs/dir.c # 2004/06/18 00:32:20-07:00 paul@serice.net +3 -3 # iso9660: fix handling of inodes beyond 4GB # # fs/isofs/Makefile # 2004/06/17 23:53:41-07:00 paul@serice.net +1 -1 # iso9660: fix handling of inodes beyond 4GB # # ChangeSet # 2004/06/18 08:01:23-07:00 tim@physik3.uni-rostock.de # [PATCH] BSD accounting format rework # # BSD accounting format rework: # # Use all explicit and implicit padding in struct acct to # # - correctly report 32 bit uid/gid, # - correctly report jobs (e.g., daemons) running longer than 497 days, # - increase the precision of ac_etime from 2^-13 to 2^-20 # (i.e., from ~6 hours to ~1 min. after a year) # - store the current AHZ value. # - allow cross-platform processing of the accounting file # (limited for m68k which has a different size struct acct). # - introduce versioning for smooth transition to incompatible formats in # the future. Currently the following version numbers are defined: # 0: old format (until 2.6.7) with 16 bit uid/gid # 1: extended variant (binary compatible to v0 on M68K) # 2: extended variant (binary compatible to v0 on everything except M68K) # 3: a new binary incompatible format (64 bytes) # 4: new binary incompatible format (128 bytes). # layout of its first 64 bytes is the same as for v3. # 5: marks second half of new binary incompatible format (128 bytes) # (layout is not yet defined) # # All this is accomplished without breaking binary compatibility. 32 bit # uid/gid support is compatible with the patch previously floating around and # used e.g. by Red Hat. # # This patch also introduces a config option for a new, binary incompatible # "version 3" format that # # - is uniform across and properly aligned on all platforms # - stores pid and ppid # - uses AHZ==100 on all platforms (allows to report longer times) # # Much of the compatibility glue goes away when v1/v2 support is removed from # the kernel. Such a patch is at # # http://www.physik3.uni-rostock.de/tim/kernel/2.7/acct-cleanup-04.patch # # and might be applied in the 2.7 timeframe. # # The new v3 format is source compatible with current GNU acct tools (6.3.5). # However, current GNU acct tools can be compiled for only one format. As there # is no way to pass the kernel configuration to userspace, with my patch it will # still only support the old v2 format. Only if v1/v2 support is removed from # the kernel, recompiling GNU acct tools will yield v3 support. # # A preliminary take at the corresponding work on cross-platform userspace tools # (GNU acct package) is at # # http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/ # # This version of the package is able to read any of the v0/v2/v3 formats, # regardless of byte-order (untested), even within the same file. # Cross-platform compatibility with m68k (v1 format) is not yet implemented, but # native use on m68k should work (untested). pid and ppid are currently only # shown by the dump-acct utility. # # Thanks to Arthur Corliss, Albert Cahalan and Ragnar Kjørstad for their # comments, and to Albert Cahalan for the u64->IEEE float conversion code. # # Signed-off-by: Tim Schmielau # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/acct.c # 2004/06/17 23:53:41-07:00 tim@physik3.uni-rostock.de +97 -8 # BSD accounting format rework # # init/Kconfig # 2004/06/17 23:53:41-07:00 tim@physik3.uni-rostock.de +12 -0 # BSD accounting format rework # # include/linux/acct.h # 2004/06/17 23:53:41-07:00 tim@physik3.uni-rostock.de +120 -25 # BSD accounting format rework # # ChangeSet # 2004/06/18 08:01:12-07:00 alan@redhat.com # [PATCH] make the 3c59x/3c90x driver somewhat more reliable # # The existing driver violates basic PCI rules in several places making it # unusable for basic things like DHCP in Fedora Core. This patch removes all # the situations I can find where it writes to the device while in D3 state # and breaks stuff. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/3c59x.c # 2004/06/18 00:32:18-07:00 alan@redhat.com +34 -9 # make the 3c59x/3c90x driver somewhat more reliable # # ChangeSet # 2004/06/18 08:01:01-07:00 bwindle@fint.org # [PATCH] fix 3c59x.c to allow 3c905c 100bT-FD # # Fix the 3c905C 10/100 transceiver initialisation woes. # # (This was reverted from 2.6.7-rcX, but the bug reporter said the failure # turned out to be unrepeatable). # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/3c59x.c # 2004/06/18 00:32:20-07:00 bwindle@fint.org +1 -1 # fix 3c59x.c to allow 3c905c 100bT-FD # # ChangeSet # 2004/06/18 08:00:52-07:00 joris@eljakim.nl # [PATCH] Validate PM-Timer rate at boot time # # Add a check to the PM-Timer initialization code. It validates the PM-Timer # rate against PIT channel 2 and rejects the PM-Timer if its rate is not # withing 5% of the expected number. # # Rationale: # # The PMTMR timers of certain (older) mainboards are running at invalid # rates, often much faster than the rate expected by the PM-Timer code. This # causes the system clock to run much too fast. See also # http://bugme.osdl.org/show_bug.cgi?id=2375 # # Possible workarounds are disabling the PM-Timer in the kernel config or # disabling the PM-Timer at boot time through the "clock=tsc" parameter. # However, we believe it is more user friendly to automatically validate the # PM-Timer rate at boot time before using it as the system time source. # # Tested by me (with broken timer) and John Stultz (with good timer) and # believed to be ok. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/kernel/timers/timer_pm.c # 2004/06/17 23:53:40-07:00 joris@eljakim.nl +38 -0 # Validate PM-Timer rate at boot time # # ChangeSet # 2004/06/18 08:00:41-07:00 willy@debian.org # [PATCH] ahc1542 !CONFIG_MCA build fix # # The old 1542 scsi driver is both ISA and MCA. The MCA portions are disabled # when !CONFIG_MCA through the typical wrapper scheme (a la pci.h and # !CONFIG_PCI). However... the driver unconditionally includes linux/mca.h # which in turn unconditionally includes asm/mca.h. # # This breaks drivers on platforms with ISA but not MCA, like alpha. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/mca.h # 2004/06/17 23:53:40-07:00 willy@debian.org +2 -0 # ahc1542 !CONFIG_MCA build fix # # ChangeSet # 2004/06/18 08:00:30-07:00 mingo@elte.hu # [PATCH] x86: remove io_apic_sync # # The patch below gets rid of io_apic_sync(). # # io_apic_sync() was introduced in 2.1.104 and it was originally done for # masking and unmasking as well. Later the unmasking use got removed but the # masking use lingered around. I dont think it was ever justified to do it # and clearly since the lack of io_apic_sync() didnt break some of the other # writes we do to the IO-APIC registers, it must be unnecessary in the # masking case too. # # Signed-off-by: Ingo Molnar # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-i386/io_apic.h # 2004/06/17 23:49:30-07:00 mingo@elte.hu +0 -9 # x86: remove io_apic_sync # # arch/i386/kernel/io_apic.c # 2004/06/18 00:32:15-07:00 mingo@elte.hu +0 -3 # x86: remove io_apic_sync # # ChangeSet # 2004/06/18 08:00:20-07:00 mingo@elte.hu # [PATCH] x86: remove APIC_LOCKUP_DEBUG # # the patch below gets rid of APIC_LOCKUP_DEBUG. It has been in the kernel # for more than 3 years and the message was only reported once during that # period of time - and even in that case it was a side-effect of a really bad # crash. The lockup workaround works, the debugging code can be moved out. # # Signed-off-by: Ingo Molnar # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/kernel/io_apic.c # 2004/06/18 00:32:21-07:00 mingo@elte.hu +0 -21 # x86: remove APIC_LOCKUP_DEBUG # # ChangeSet # 2004/06/18 08:00:09-07:00 pavel@ucw.cz # [PATCH] io_apic.c code consolidation # # This cleans up io_apic.c a bit -- I do not really like 4 copies of same # code. # # Ingo said: # # yeah, agreed - i checked & test it, it's ok. I made a small # modification (see the patch below) to uninline the __modify_IO_APIC_irq() # function - shaving 0.5K off the kernel's size. # # Signed-off-by: Ingo Molnar # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/kernel/io_apic.c # 2004/06/18 00:32:21-07:00 pavel@ucw.cz +16 -51 # io_apic.c code consolidation # # ChangeSet # 2004/06/18 07:59:58-07:00 nickpiggin@yahoo.com.au # [PATCH] Fix read() vs truncate race # # do_generic_mapping_read() # { # isize1 = i_size_read(); # ... # readpage # copy_to_user up to isize1; # } # # readpage() # { # isize2 = i_size_read(); # ... # read blocks # ... # zero-fill all blocks past isize2 # } # # If a second thread runs truncate and shrinks i_size, so isize1 and isize2 are # different, the read can return up to a page of zero-fill that shouldn't really # exist. # # The trick is to read isize1 after doing the readpage. I realised this is the # right way to do it without having to change the readpage API. # # The patch should not cost any cycles when reading from pagecache. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/filemap.c # 2004/06/18 00:32:09-07:00 nickpiggin@yahoo.com.au +50 -26 # Fix read() vs truncate race # # ChangeSet # 2004/06/18 07:59:47-07:00 akpm@osdl.org # [PATCH] invalidate_inodes2(): mark pages not uptodate # # Andrea Arcangeli points out that invalidate_inode_pages2() is # supposed to mark mapped-into-pagetable pages as not uptodate so that next time # someone faults the page in we will go get a new version from backing store. # # The callers are the direct-io code and the NFS "something changed on the # server" code. In both these cases we do need to go and re-read the page. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/truncate.c # 2004/06/17 23:49:30-07:00 akpm@osdl.org +8 -2 # invalidate_inodes2(): mark pages not uptodate # # ChangeSet # 2004/06/18 07:59:36-07:00 herbert@gondor.apana.org.au # [PATCH] Check return status of register calls in i82365 # # i82365 calls driver_register and platform_device_register without checking # their return values. This patch fixes that. # # It also runs platform_device_register() prior to isa_probe() so we don't have # to undo ise_probe()'s effects if platform_device_register() ends up failing. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/pcmcia/i82365.c # 2004/06/17 23:49:30-07:00 herbert@gondor.apana.org.au +10 -4 # Check return status of register calls in i82365 # # ChangeSet # 2004/06/18 07:59:25-07:00 tol@stacken.kth.se # [PATCH] getgroups16() fix # # sys_getgroups16 (or rather groups16_to_user()) returns large gids # truncated. Needs to be fixed, one way or another. Don't know why the # other similar casts are still there. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/uid16.c # 2004/06/17 23:49:29-07:00 tol@stacken.kth.se +6 -6 # getgroups16() fix # # include/linux/sched.h # 2004/06/18 00:32:12-07:00 tol@stacken.kth.se +9 -1 # getgroups16() fix # # ChangeSet # 2004/06/18 07:59:14-07:00 rene.herman@keyaccess.nl # [PATCH] same small resource tweaks, x86_64 version # # The same small tweaks for x86_64. Just to keep the two in sync. One # additional wrinkle: vram_resource was exported to e820.c, which didn't # actually use it. Undo that. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/setup.c # 2004/06/17 23:49:29-07:00 rene.herman@keyaccess.nl +11 -9 # same small resource tweaks, x86_64 version # # arch/x86_64/kernel/e820.c # 2004/06/17 23:49:29-07:00 rene.herman@keyaccess.nl +1 -1 # same small resource tweaks, x86_64 version # # ChangeSet # 2004/06/18 07:59:03-07:00 rene.herman@keyaccess.nl # [PATCH] small tweaks to standard resource stuff # # Various small tweaks. Compiled and booted. # # 1. add IORESOURCE_BUSY | IORESOURCE_MEM also for the kernel code and # data resources. I don't believe this actually matters one bit, but # they're hooked into a BUSY/MEM parent ("System RAM") and marking # them busy seems to make sense. # # 2. delete the .start = 1M default for the kernel code resource. This # isn't actually a change; it's set to virt_to_phys(_text) in # setup_arch() overriding any default anyways. # # 3. s/vram_resource/video_ram_resource/. Lines up much nicer with # video_rom_resource... # # 4. s/checksum/romchecksum/. setup.c is a fairly large file, and # "checksum" pollutes the namespace. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/kernel/setup.c # 2004/06/17 23:49:29-07:00 rene.herman@keyaccess.nl +11 -9 # small tweaks to standard resource stuff # # ChangeSet # 2004/06/18 07:58:52-07:00 hpa@zytor.com # [PATCH] Use first-fit for pty allocation # # (With Andrew Morton). # # The current dynamic pty allocation scheme has a few problems: # # - pty numbers grow to be very large, causing wtmp file bloat. # # - Seems to break libc5 and some old applications # # So change it to do first-fit. An IDR tree is used to provide a # logarithmic-time search. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/char/tty_io.c # 2004/06/17 23:49:29-07:00 hpa@zytor.com +64 -19 # Use first-fit for pty allocation # # ChangeSet # 2004/06/18 07:58:40-07:00 tytso@mit.edu # [PATCH] Ext3: Retry allocation after transaction commit (v2) # # Here is a reworked version of my patch to ext3 to retry certain filesystem # operations after an ENOSPC error. The ext3_should_retry_alloc() function will # not wait on the currently running transaction if there is a currently active # handle; hence this should avoid deadlocks in the Lustre use case. The patch # is versus BK-recent. # # I've also included a simple, reliable test case which demonstrates the problem # this patch is intended to fix. (Note that BK-recent is not sufficient to # address this test case, and waiting on the commiting transaction in # ext3_new_block is also not sufficient. Been there, tried that, didn't work. # We need to do the full-bore retry from the top level. The # ext3_should_retry_alloc() will only wait on the committing transaction if # there is an active handle; hence Lustre will probably also need to use # ext3_should_retry_alloc() if it wants to reliably avoid this particular # problem.) # # #!/bin/sh # # # # # TEST_DIR=/tmp # IMAGE=$TEST_DIR/retry.img # MNTPT=$TEST_DIR/retry.mnt # TEST_SRC=/usr/projects/e2fsprogs/e2fsprogs/build # MKE2FS_OPTS="" # IMAGE_SIZE=8192 # # umount $MNTPT # dd if=/dev/zero of=$IMAGE bs=4k count=$IMAGE_SIZE # mke2fs -j -F $MKE2FS_OPTS $IMAGE # # function test_log () # { # echo $* # logger -p local4.notice $* # } # # mkdir -p $MNTPT # mount -o loop -t ext3 $IMAGE $MNTPT # test_log Retry test: BEGIN # for i in `seq 1 3` # do # test_log "Retry test: Loop $i" # echo 2 > /proc/sys/fs/jbd-debug # while ! mkdir -p $MNTPT/foo/bar # do # test_log "Retry test: mkdir failed" # sleep 1 # done # echo 0 > /proc/sys/fs/jbd-debug # cp -r $TEST_SRC $MNTPT/foo/bar 2> /dev/null # rm -rf $MNTPT/* # done # umount $MNTPT # test_log "Retry test: END" # # # akpm@osdl.org # # Rework the code to make it a formal JBD API entry point. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/jbd.h # 2004/06/17 23:47:53-07:00 tytso@mit.edu +1 -0 # Ext3: Retry allocation after transaction commit (v2) # # include/linux/ext3_fs.h # 2004/06/17 23:47:53-07:00 tytso@mit.edu +1 -0 # Ext3: Retry allocation after transaction commit (v2) # # fs/jbd/journal.c # 2004/06/17 23:47:53-07:00 tytso@mit.edu +34 -0 # Ext3: Retry allocation after transaction commit (v2) # # fs/ext3/xattr.c # 2004/06/17 23:47:53-07:00 tytso@mit.edu +5 -1 # Ext3: Retry allocation after transaction commit (v2) # # fs/ext3/namei.c # 2004/06/18 00:32:11-07:00 tytso@mit.edu +20 -5 # Ext3: Retry allocation after transaction commit (v2) # # fs/ext3/inode.c # 2004/06/17 23:47:53-07:00 tytso@mit.edu +5 -14 # Ext3: Retry allocation after transaction commit (v2) # # fs/ext3/balloc.c # 2004/06/17 23:49:23-07:00 tytso@mit.edu +32 -6 # Ext3: Retry allocation after transaction commit (v2) # # fs/ext3/acl.c # 2004/06/17 23:47:53-07:00 tytso@mit.edu +9 -1 # Ext3: Retry allocation after transaction commit (v2) # # ChangeSet # 2004/06/18 07:58:28-07:00 rene.herman@keyaccess.nl # [PATCH] pc9800: merge std_resources.c back into setup.c # # std_resources.{c,h} was only split off due to pc9800 wanting to override it. # With it gone, it might as well be merged back in. Doesn't change any code. # It was compiled and booted. # # This time this also actually doesn't break compilation of any of the # subarches. That's to say, any further. I guess it might have been my .config # (my regular PC config, with just the subarch switched through menuconfig) or # O=, but only ELAN actually compiled. Voyager and VISWS bombed out at the # final link and NUMAQ much sooner (with "physnode_map undeclared" during # compilation of numaq.c). # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/kernel/setup.c # 2004/06/18 00:32:22-07:00 rene.herman@keyaccess.nl +200 -5 # pc9800: merge std_resources.c back into setup.c # # arch/i386/kernel/Makefile # 2004/06/17 23:44:27-07:00 rene.herman@keyaccess.nl +0 -1 # pc9800: merge std_resources.c back into setup.c # # arch/i386/Kconfig # 2004/06/17 23:44:27-07:00 rene.herman@keyaccess.nl +0 -6 # pc9800: merge std_resources.c back into setup.c # # BitKeeper/deleted/.del-std_resources.h~45da2e05d849a20f # 2004/06/18 07:58:23-07:00 rene.herman@keyaccess.nl +0 -0 # Delete: include/asm-i386/std_resources.h # # BitKeeper/deleted/.del-std_resources.c~3be5b97880eb064e # 2004/06/18 07:58:22-07:00 rene.herman@keyaccess.nl +0 -0 # Delete: arch/i386/kernel/std_resources.c # # ChangeSet # 2004/06/18 07:58:17-07:00 bunk@fs.tum.de # [PATCH] more PC9800 removal # # Removes more PC9800 code. # # Requires: # # bk rm drivers/char/upd4990a.c # bk rm drivers/net/ne2k_cbus.c # bk rm drivers/net/ne2k_cbus.h # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # sound/drivers/opl3/opl3_lib.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -20 # more PC9800 removal # # sound/drivers/mpu401/mpu401.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -11 # more PC9800 removal # # sound/core/seq/instr/Makefile # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -1 # more PC9800 removal # # sound/core/seq/Makefile # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -1 # more PC9800 removal # # include/linux/serio.h # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -1 # more PC9800 removal # # include/linux/serial_core.h # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -8 # more PC9800 removal # # include/linux/ide.h # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +1 -1 # more PC9800 removal # # include/asm-i386/timex.h # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -4 # more PC9800 removal # # include/asm-i386/serial.h # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -7 # more PC9800 removal # # include/asm-i386/processor.h # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -6 # more PC9800 removal # # include/asm-i386/ide.h # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -34 # more PC9800 removal # # drivers/serial/8250_pnp.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -3 # more PC9800 removal # # drivers/pnp/isapnp/core.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -5 # more PC9800 removal # # drivers/net/at1700.c # 2004/06/17 23:44:24-07:00 bunk@fs.tum.de +0 -88 # more PC9800 removal # # drivers/net/Space.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +2 -2 # more PC9800 removal # # drivers/net/3c509.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +9 -36 # more PC9800 removal # # drivers/ide/ide-proc.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -1 # more PC9800 removal # # drivers/char/keyboard.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +2 -3 # more PC9800 removal # # arch/i386/kernel/i8259.c # 2004/06/17 23:43:58-07:00 bunk@fs.tum.de +0 -5 # more PC9800 removal # # ChangeSet # 2004/06/18 07:58:05-07:00 rddunlap@osdl.org # [PATCH] Remove PC9800 support # # PC9800 sub-arch is incomplete, hackish (at least in IDE), maintainers don't # reply to emails and haven't touched it in awhile. Can't even config it to # try to build it without other patches to the kernel tree. # # bk-rm-script: # # #! /bin/sh # bk rm -r ./arch/i386/mach-pc9800 # bk rm -r ./arch/i386/boot98 # bk rm ./drivers/char/lp_old98.c # bk rm ./drivers/serial/serial98.c # bk rm ./drivers/scsi/scsi_pc98.c # bk rm ./drivers/scsi/pc980155.c # bk rm ./drivers/scsi/pc980155.h # bk rm ./drivers/block/floppy98.c # bk rm ./drivers/input/keyboard/98kbd.c # bk rm ./drivers/input/serio/98kbd-io.c # bk rm ./drivers/input/misc/98spkr.c # bk rm ./drivers/input/mouse/98busmouse.c # bk rm ./drivers/ide/legacy/pc9800.c # bk rm ./drivers/ide/legacy/hd98.c # bk rm -r ./include/asm-i386/mach-pc9800 # bk rm ./include/asm-i386/pc9800_sca.h # bk rm ./include/asm-i386/pc9800.h # bk rm ./fs/partitions/nec98.c # bk rm ./fs/partitions/nec98.h # bk rm ./sound/isa/cs423x/pc98.c # bk rm ./sound/isa/cs423x/pc9801_118_magic.h # bk rm ./sound/isa/cs423x/sound_pc9800.h # # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # sound/isa/cs423x/Makefile # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -2 # Remove PC9800 support # # sound/isa/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -10 # Remove PC9800 support # # fs/partitions/check.c # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -1 # Remove PC9800 support # # fs/partitions/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -7 # Remove PC9800 support # # drivers/serial/Makefile # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -1 # Remove PC9800 support # # drivers/serial/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -13 # Remove PC9800 support # # drivers/scsi/Makefile # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -2 # Remove PC9800 support # # drivers/scsi/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -12 # Remove PC9800 support # # drivers/net/Makefile # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -1 # Remove PC9800 support # # drivers/net/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +1 -51 # Remove PC9800 support # # drivers/input/serio/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -10 # Remove PC9800 support # # drivers/input/mouse/Makefile # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -1 # Remove PC9800 support # # drivers/input/mouse/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -11 # Remove PC9800 support # # drivers/input/misc/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -4 # Remove PC9800 support # # drivers/input/keyboard/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -12 # Remove PC9800 support # # drivers/ide/Makefile # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -1 # Remove PC9800 support # # drivers/ide/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +1 -19 # Remove PC9800 support # # drivers/char/Makefile # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +0 -1 # Remove PC9800 support # # drivers/char/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +1 -21 # Remove PC9800 support # # drivers/block/Kconfig # 2004/06/17 23:43:53-07:00 rddunlap@osdl.org +1 -8 # Remove PC9800 support # # ChangeSet # 2004/06/18 07:57:53-07:00 Robert.Picco@hp.com # [PATCH] HPET driver # # The driver supports the High Precision Event Timer. The driver has adopted # a similar API to the Real Time Clock driver. It can support any number of # HPET devices and the maximum number of timers per HPET device. For further # information look at the documentation in the patch. # # Thanks to Venki at Intel for testing the driver on X86 hardware with HPET. # # HPET documentation is available at http://www.intel.com/design/chipsets/datashts/252516.htm # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/hpet.h # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +133 -0 # HPET driver # # drivers/char/hpet.c # 2004/06/17 23:43:14-07:00 Robert.Picco@hp.com +1076 -0 # HPET driver # # include/linux/miscdevice.h # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +1 -0 # HPET driver # # include/linux/hpet.h # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/linux/hpet.h # # include/asm-i386/hpet.h # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +3 -0 # HPET driver # # drivers/char/rtc.c # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +5 -0 # HPET driver # # drivers/char/hpet.c # 2004/06/17 23:43:14-07:00 Robert.Picco@hp.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/char/hpet.c # # drivers/char/Makefile # 2004/06/18 00:32:23-07:00 Robert.Picco@hp.com +1 -0 # HPET driver # # drivers/char/Kconfig # 2004/06/18 00:32:23-07:00 Robert.Picco@hp.com +27 -0 # HPET driver # # arch/i386/kernel/time_hpet.c # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +46 -0 # HPET driver # # arch/i386/Kconfig # 2004/06/18 00:32:22-07:00 Robert.Picco@hp.com +2 -1 # HPET driver # # Documentation/hpet.txt # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +298 -0 # HPET driver # # Documentation/filesystems/proc.txt # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +1 -1 # HPET driver # # Documentation/hpet.txt # 2004/06/17 23:41:40-07:00 Robert.Picco@hp.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/hpet.txt # # ChangeSet # 2004/06/18 07:57:41-07:00 chrisw@osdl.org # [PATCH] RLIM: adjust default mqueue sizes # # Lower default sizes for POSIX mqueue allocation now that rlimits are in place. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # ipc/mqueue.c # 2004/06/17 23:41:40-07:00 chrisw@osdl.org +3 -3 # RLIM: adjust default mqueue sizes # # ChangeSet # 2004/06/18 07:57:29-07:00 chrisw@osdl.org # [PATCH] RLIM: enforce rlimits for POSIX mqueue allocation # # Add a user_struct to the mq_inode_info structure. Charge the maximum number # of bytes that could be allocated to a mqueue to the user who creates the # mqueue. This is checked against the per user rlimit. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # ipc/mqueue.c # 2004/06/18 00:32:23-07:00 chrisw@osdl.org +39 -5 # RLIM: enforce rlimits for POSIX mqueue allocation # # ChangeSet # 2004/06/18 07:57:18-07:00 chrisw@osdl.org # [PATCH] RLIM: add mq_attr_ok() helper # # Add helper function mq_attr_ok() to do mq_attr sanity checking, and do some # extra overlow checking. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # ipc/mqueue.c # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +23 -10 # RLIM: add mq_attr_ok() helper # # ChangeSet # 2004/06/18 07:57:07-07:00 chrisw@osdl.org # [PATCH] RLIM: add mq_bytes to user_struct # # Add mq_bytes field to user_struct, and make sure it's properly initialized. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/user.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -0 # RLIM: add mq_bytes to user_struct # # include/linux/sched.h # 2004/06/18 00:32:22-07:00 chrisw@osdl.org +2 -0 # RLIM: add mq_bytes to user_struct # # ChangeSet # 2004/06/18 07:56:56-07:00 chrisw@osdl.org # [PATCH] RLIM: add rlimit entry for POSIX mqueue allocation # # Add an rlimit entry to control the maximum number of bytes a user can allocate # to a POSIX mqueue. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/mqueue.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +2 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-x86_64/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-v850/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-sparc64/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-sparc/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-sh/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-s390/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-ppc64/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-ppc/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-parisc/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-mips/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-m68k/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-ia64/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-i386/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-h8300/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-cris/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-arm26/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-arm/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # include/asm-alpha/resource.h # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/x86_64/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/v850/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/um/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/sparc64/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/sparc/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/sh/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/s390/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/ppc64/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/ppc/kernel/process.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/parisc/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/mips/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/m68knommu/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/m68k/kernel/process.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/ia64/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/i386/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/h8300/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/cris/kernel/process.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/arm26/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/arm/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # arch/alpha/kernel/init_task.c # 2004/06/17 23:41:39-07:00 chrisw@osdl.org +1 -0 # RLIM: add rlimit entry for POSIX mqueue allocation # # ChangeSet # 2004/06/18 07:56:43-07:00 chrisw@osdl.org # [PATCH] RLIM: add simple get_uid() helper # # Add simple helper function to grab a reference to a user_struct. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/sched.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +5 -0 # RLIM: add simple get_uid() helper # # ChangeSet # 2004/06/18 07:56:32-07:00 chrisw@osdl.org # [PATCH] RLIM: add sigpending field to user_struct # # Add sigpending field to user_struct, and make sure it's properly initialized. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/user.c # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add sigpending field to user_struct # # include/linux/sched.h # 2004/06/18 00:32:25-07:00 chrisw@osdl.org +1 -0 # RLIM: add sigpending field to user_struct # # ChangeSet # 2004/06/18 07:56:20-07:00 chrisw@osdl.org # [PATCH] RLIM: add rlimit entry for controlling queued signals # # The following patches introduce per user rlimits for both queued signals and # POSIX message queues. The changes touch all the arches resource.h files as # well as init_task.c to get the rlimit defaults setup. # # Both require caching the user_struct to avoid problems with setuid(). # # The signal changes makes some small changes to send_signal() to pass along the # task being signalled to get proper accounting for signals initiated in # interrupt. Thanks to Marcelo for getting this one going. # # # This patch: # # Add an rlimit entry to control the maximum number of pending signals a user # may have. This is essentially just the resource.h changes. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/signal.h # 2004/06/18 00:32:25-07:00 chrisw@osdl.org +3 -0 # RLIM: add rlimit entry for controlling queued signals # # include/asm-x86_64/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +4 -2 # RLIM: add rlimit entry for controlling queued signals # # include/asm-v850/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +4 -2 # RLIM: add rlimit entry for controlling queued signals # # include/asm-sparc64/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +6 -4 # RLIM: add rlimit entry for controlling queued signals # # include/asm-sparc/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +6 -4 # RLIM: add rlimit entry for controlling queued signals # # include/asm-sh/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-s390/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +4 -2 # RLIM: add rlimit entry for controlling queued signals # # include/asm-ppc64/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-ppc/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-parisc/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-mips/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-m68k/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +4 -2 # RLIM: add rlimit entry for controlling queued signals # # include/asm-ia64/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-i386/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +5 -2 # RLIM: add rlimit entry for controlling queued signals # # include/asm-h8300/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +4 -2 # RLIM: add rlimit entry for controlling queued signals # # include/asm-cris/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +5 -3 # RLIM: add rlimit entry for controlling queued signals # # include/asm-arm26/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-arm/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +3 -1 # RLIM: add rlimit entry for controlling queued signals # # include/asm-alpha/resource.h # 2004/06/18 00:32:24-07:00 chrisw@osdl.org +5 -3 # RLIM: add rlimit entry for controlling queued signals # # ChangeSet # 2004/06/18 07:56:09-07:00 akpm@osdl.org # [PATCH] i2c fixups for idr API change # # Fix up the i2c code which uses the IDR library. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/i2c/i2c-core.c # 2004/06/17 23:41:38-07:00 akpm@osdl.org +8 -2 # i2c fixups for idr API change # # ChangeSet # 2004/06/18 07:55:58-07:00 minyard@acm.org # [PATCH] IDR fixups # # There were definately some problems in there. I've made some changes and # tested with a lot of bounds. I don't have a machine with enough memory to # fill it up (it would take ~16GB on a 64-bit machine), but I use the "above" # code to simulate a lot of situations. # # The problems were: # # * IDR_FULL was not the right value # * idr_get_new_above() was not defined in the headers or documented. # * idr_alloc() bug-ed if there was a race and not enough memory was # allocated. It should have returned NULL. # * id will overflow when you go past the end. # * There was a "(id >= (1 << (layers*IDR_BITS)))" comparison, but at # the top layer it would overflow the id and be zero. # * The allocation should return ENOSPC for an "above" value with # nothing above it, but it returned EAGAIN. # # I have not tested on 64-bits (as I don't have a 64-bit machine). # # I've included the files, a diff from the previous version, and my test # programs. # # For the test programs, idr_test will just attempt to allocate # elements, check them, free them, and check them again. # # idr_test2 will allocate element with between # them. # # idr_test3 just tests some bounds and tries all values with just a few in # the idr. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # lib/idr.c # 2004/06/17 23:41:38-07:00 minyard@acm.org +31 -14 # IDR fixups # # include/linux/idr.h # 2004/06/17 23:41:38-07:00 minyard@acm.org +9 -6 # IDR fixups # # ChangeSet # 2004/06/18 07:55:47-07:00 akpm@osdl.org # [PATCH] idr: remove counter bits from id's # # idr_get_new() currently returns an incrementing counter in the top 8 bits of # the counter. Which means that most users have to mask it off again, and we # only have a 24-bit range. # # So remove that counter. Also: # # - Remove the BITS_PER_INT define due to namespace collision risk. # # - Make MAX_ID_SHIFT 31, so counters have a 0 to 2G-1 range. # # - Why is MAX_ID_SHIFT using sizeof(int) and not sizeof(long)? If it's for # consistency across 32- and 64-bit machines, why not just make it "31"? # # - Does this still hold true with the counter removed? # # /* We can only use half the bits in the top level because there are # only four possible bits in the top level (5 bits * 4 levels = 25 # bits, but you only use 24 bits in the id). */ # # If not, what needs to change? # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # lib/idr.c # 2004/06/18 00:32:26-07:00 akpm@osdl.org +3 -16 # idr: remove counter bits from id's # # include/linux/idr.h # 2004/06/18 00:32:26-07:00 akpm@osdl.org +5 -13 # idr: remove counter bits from id's # # ChangeSet # 2004/06/18 07:55:36-07:00 minyard@acm.org # [PATCH] Fixes for idr code # # * On a 32-bit architecture, the idr code will cease to work if you add # more than 2^20 entries. You will not be able to find many of the # entries. The problem is that the IDR code uses 5-bit chunks of the # number and the lower portion used by IDR is 24 bits, so you have one bit # that leaks over into the comparisons that should not be there. The # solution is to mask off that bit before doing IDR processing. This # actually causes the POSIX timer code to crash if you create that many # timers. I have included an idr_test.tar.gz file that demonstrates this # with and without the fix, in case you need more evidence :). # # * When the IDR fills up, it returns -1. However, there was no way to # check for this condition. This patch adds the ability to check for the # idr being full and fixes all the users. It also fixes a problem in # fs/super.c where the idr code wasn't checking for -1. # # * There was a race condition creating POSIX timers. The timer was added # to a task struct for another process then the data for the timer was # filled out. The other task could use/destroy time timer as soon as it is # in the task's queue and the lock is released. This moves settup up the # timer data to before the timer is enqueued or (for some data) into the # lock. # # * Change things so that the caller doesn't need to run idr_full() to find # out the reason for an idr_get_new() failure. # # Just return -ENOSPC if the tree was full, or -EAGAIN if the caller needs # to re-run idr_pre_get() and try again. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # net/sctp/sm_make_chunk.c # 2004/06/17 23:41:37-07:00 minyard@acm.org +15 -10 # Fixes for idr code # # lib/idr.c # 2004/06/18 00:32:26-07:00 minyard@acm.org +37 -8 # Fixes for idr code # # kernel/posix-timers.c # 2004/06/17 23:41:37-07:00 minyard@acm.org +52 -34 # Fixes for idr code # # include/linux/idr.h # 2004/06/18 00:32:26-07:00 minyard@acm.org +7 -1 # Fixes for idr code # # fs/super.c # 2004/06/17 23:41:37-07:00 minyard@acm.org +10 -5 # Fixes for idr code # # fs/proc/generic.c # 2004/06/17 23:41:37-07:00 minyard@acm.org +6 -4 # Fixes for idr code # # ChangeSet # 2004/06/18 07:55:25-07:00 mason@suse.com # [PATCH] reiserfs data logging support # # Add data=journal support for reiserfs # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/reiserfs_fs_i.h # 2004/06/17 23:41:37-07:00 mason@suse.com +1 -0 # reiserfs data logging support # # include/linux/reiserfs_fs.h # 2004/06/17 23:41:37-07:00 mason@suse.com +8 -0 # reiserfs data logging support # # fs/reiserfs/tail_conversion.c # 2004/06/17 23:41:37-07:00 mason@suse.com +0 -41 # reiserfs data logging support # # fs/reiserfs/stree.c # 2004/06/17 23:41:37-07:00 mason@suse.com +40 -3 # reiserfs data logging support # # fs/reiserfs/journal.c # 2004/06/17 23:41:37-07:00 mason@suse.com +13 -4 # reiserfs data logging support # # fs/reiserfs/inode.c # 2004/06/17 23:41:37-07:00 mason@suse.com +49 -10 # reiserfs data logging support # # fs/reiserfs/file.c # 2004/06/17 23:41:37-07:00 mason@suse.com +18 -2 # reiserfs data logging support # # ChangeSet # 2004/06/18 07:55:13-07:00 mason@suse.com # [PATCH] reiserfs: btree readahead # # Walking the btree can trigger a number of single block synchronous reads. # This patch does btree readahead during operations that are likely to be long # and sequential. So far, that only includes directory reads and truncates, but # it can make both much faster. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/reiserfs_fs.h # 2004/06/18 00:32:26-07:00 mason@suse.com +5 -1 # reiserfs: btree readahead # # fs/reiserfs/stree.c # 2004/06/18 00:32:26-07:00 mason@suse.com +68 -25 # reiserfs: btree readahead # # fs/reiserfs/dir.c # 2004/06/17 23:41:37-07:00 mason@suse.com +1 -0 # reiserfs: btree readahead # # ChangeSet # 2004/06/18 07:55:03-07:00 mason@suse.com # [PATCH] reiserfs: remove debugging warning from block allocator # # Remove debugging warning from the reiserfs block allocator code # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/reiserfs/bitmap.c # 2004/06/17 23:41:37-07:00 mason@suse.com +0 -1 # reiserfs: remove debugging warning from block allocator # # ChangeSet # 2004/06/18 07:54:52-07:00 mason@suse.com # [PATCH] reiserfs: block allocator should not inherit "packing locality 1" # # reiserfsck --rebuild-tree expects the only key with a packing locality of 1 to # be for the root directory (key [1 2]). The new block allocator inherited that # packing locality down to subdirectories, which triggers failures in reiserfsck # --rebuild-tree # # reiserfsck in readonly check mode doesn't complain about this, thanks to Jeff # Mahoney for finding it. # # The fix is to never inherit packing locality #1 # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/reiserfs/bitmap.c # 2004/06/18 00:32:26-07:00 mason@suse.com +6 -1 # reiserfs: block allocator should not inherit "packing locality 1" # # ChangeSet # 2004/06/18 07:54:43-07:00 mason@suse.com # [PATCH] reiserfs: block allocator optimizations # # From: # From: # # The current reiserfs allocator pretty much allocates things sequentially # from the start of the disk, it works very nicely for desktop loads but # once you've got more then one proc doing io data files can fragment badly. # # One obvious solution is something like ext2's bitmap groups, which puts # file data into different areas of the disk based on which subdirectory # they are in. The problem with bitmap groups is that if you've got a # group of subdirectories their contents will be spread out all over the # disk, leading to lots of seeks during a sequential read. # # This allocator patch uses the packing locality to determine which bitmap # group to allocate from, but when you create a file it looks in the bitmaps # to see how 'full' that packing locality already is. If it hasn't been # heavily used yet, the packing locality is inherited from the parent # directory putting files in new subdirs close to the parent subdir, # otherwise it is the inode number of the parent directory putting new # files far away from the parent subdir. # # The end result is fewer bitmap groups for the same working set. For # example, one test data set created by 20 procs running in parallel has # 6822 subdirs. And with vanilla reiserfs that would mean 6822 # packing localities. This patch turns that into 26 packing localities. # # This makes sequential reads of big directory trees more efficient, but # it also makes the btree more efficient in general. Things end up sorted # better because groups of subdirs end up with similar keys in the btree, # instead of being spread out all over. # # The bitmap grouping code tries to use the start of each bitmap group # for metadata, and offsets the data slightly. The data and metadata # are still close together, but not completely intermixed like they are # in the default allocator. The end result is that leaf nodes tend to be # close to each other, making metadata readahead more effective. # # The old block allocator had the ability to enforce a minimum # allocation size, but did not use it. It now tries to do a pass looking # for larger allocation chunks before falling back to the old behaviour # of taking any blocks it can find. # # The patch changes the defaults to: # # mount -o alloc=skip_busy:dirid_groups:packing_groups # # You can get back the old behaviour with mount -o alloc=skip_busy # # mount -o alloc=dirid_groups will turn on the bitmap groups # mount -o alloc=packing_groups turns on the packing locality reduction code # mount -o alloc=skip_busy:dirid_groups turns on both dirid_groups and # skip_busy # # Finally the patch adds a mount -o alloc=oid_groups, which puts files into # bitmap groups based on a hash of their objectid. This would be used for # databases or other situations where you have a limited number of very # large files. # # This command will tell you how many packing localities are actually in # use: # # debugreiserfs -d /dev/xxx | grep '^|.*SD' | sed 's/^.....//' | awk '{print $1}' | sort -u | wc -l # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/reiserfs_fs.h # 2004/06/18 00:32:26-07:00 mason@suse.com +10 -1 # reiserfs: block allocator optimizations # # fs/reiserfs/super.c # 2004/06/17 23:41:36-07:00 mason@suse.com +7 -6 # reiserfs: block allocator optimizations # # fs/reiserfs/inode.c # 2004/06/18 00:32:26-07:00 mason@suse.com +1 -2 # reiserfs: block allocator optimizations # # fs/reiserfs/file.c # 2004/06/18 00:32:26-07:00 mason@suse.com +11 -3 # reiserfs: block allocator optimizations # # fs/reiserfs/bitmap.c # 2004/06/18 00:32:27-07:00 mason@suse.com +234 -55 # reiserfs: block allocator optimizations # # ChangeSet # 2004/06/18 07:54:32-07:00 akpm@osdl.org # [PATCH] ppc64: uninline __pte_free_tlb() # # The pgalloc.h changes broke ppc64: # # In file included from include/asm-generic/tlb.h:18, # from include/asm/tlb.h:24, # from arch/ppc64/mm/hash_utils.c:48: # include/asm/pgalloc.h: In function `__pte_free_tlb': # include/asm/pgalloc.h:110: dereferencing pointer to incomplete type # include/asm/pgalloc.h:111: dereferencing pointer to incomplete type # # Uninlining __pte_free_tlb() fixes that. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/pgalloc.h # 2004/06/17 23:41:36-07:00 akpm@osdl.org +1 -27 # ppc64: uninline __pte_free_tlb() # # arch/ppc64/mm/tlb.c # 2004/06/17 23:41:36-07:00 akpm@osdl.org +27 -0 # ppc64: uninline __pte_free_tlb() # # ChangeSet # 2004/06/18 07:54:20-07:00 rmk@arm.linux.org.uk # [PATCH] Clean up asm/pgalloc.h include 3 # # This patch cleans up needless includes of asm/pgalloc.h from the arch/i386/ # subtree. Compile tested on x86_pc SMP. # # [I also tried VISWS + SMP without PM doesn't build in smpboot.c, # though I don't believe its caused by this patch. With PM, fails # to link complaining maxcpus is undefined. Therefore, I presume # VISWS + SMP is an invalid configuration.] # # This patch is part of a larger patch aiming towards getting the include of # asm/pgtable.h out of linux/mm.h, so that asm/pgtable.h can sanely get at # things like mm_struct and friends. # # I suggest testing in -mm for a while to ensure there aren't any hidden arch # issues. # # The outstanding list of files for other architectures can be found # at http://www.arm.linux.org.uk/misc/pgalloc.txt # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/mm/ioremap.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/mm/init.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/mm/hugetlbpage.c # 2004/06/18 00:32:07-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/mm/fault.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/mach-voyager/voyager_thread.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/mach-voyager/voyager_smp.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/mach-voyager/voyager_basic.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/mach-visws/traps.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/vm86.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/traps.c # 2004/06/18 00:32:07-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/smpboot.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/smp.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/mpparse.c # 2004/06/18 00:32:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/irq.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/i386_ksyms.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/efi.c # 2004/06/17 23:41:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/apic.c # 2004/06/18 00:32:15-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include 3 # # arch/i386/kernel/acpi/boot.c # 2004/06/17 23:41:33-07:00 rmk@arm.linux.org.uk +2 -1 # Clean up asm/pgalloc.h include 3 # # ChangeSet # 2004/06/18 07:54:08-07:00 rmk@arm.linux.org.uk # [PATCH] Clean up asm/pgalloc.h include # # This patch cleans up needless includes of asm/pgalloc.h from the drivers/ # subtree. drivers/char/mem.c has been compile tested; the others have not, # since they are for non-x86 and non-ARM architectures. # # This patch is part of a larger patch aiming towards getting the include of # asm/pgtable.h out of linux/mm.h, so that asm/pgtable.h can sanely get at # things like mm_struct and friends. # # I suggest testing in -mm for a while to ensure there aren't any hidden arch # issues. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # sound/oss/dmasound/dmasound_atari.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/video/console/sticore.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/parisc/ccio-rm-dma.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/parisc/ccio-dma.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/net/sun3lance.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/net/macsonic.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/net/lasi_82596.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/net/82596.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # drivers/char/mem.c # 2004/06/17 23:41:10-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # ChangeSet # 2004/06/18 07:53:57-07:00 rmk@arm.linux.org.uk # [PATCH] Clean up asm/pgalloc.h include # # This patch cleans up needless includes of asm/pgalloc.h from the fs/ # kernel/ and mm/ subtrees. Compile tested on multiple ARM platforms, and # x86, this patch appears safe. # # This patch is part of a larger patch aiming towards getting the include of # asm/pgtable.h out of linux/mm.h, so that asm/pgtable.h can sanely get at # things like mm_struct and friends. # # I suggest testing in -mm for a while to ensure there aren't any hidden arch # issues. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/vmscan.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/vmalloc.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/nommu.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/msync.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/mremap.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/mprotect.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/mmap.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/mincore.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # mm/highmem.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # kernel/module.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # include/asm-generic/tlb.h # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +1 -0 # Clean up asm/pgalloc.h include # # include/asm-arm26/tlb.h # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +1 -0 # Clean up asm/pgalloc.h include # # fs/proc/proc_misc.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # fs/exec.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # fs/binfmt_flat.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # fs/binfmt_elf.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # fs/binfmt_aout.c # 2004/06/17 23:41:09-07:00 rmk@arm.linux.org.uk +0 -1 # Clean up asm/pgalloc.h include # # ChangeSet # 2004/06/18 07:53:45-07:00 yoav.zach@intel.com # [PATCH] binfmt_misc: improve calculation of interpreter's credentials # # This patch allows for misc binaries to run with credentials and security # token that are calculated according to the binaries, and not according to the # interpreter, which is the legacy behavior of binfmt_misc. # # The way it is done is by calling prepare_binprm, which is where these # attributes are calculated, before switching the 'file' field in the bprm from # the binary to the interpreter. # # This feature should be used with care, since the interpreter will have root # permissions when running a setuid binary owned by root. # # Please note - # # - Only root can register an interpreter with binfmt_misc. The feature is # documented and the administrator is advised to handle it with care # # - The new feature is enabled only with a special flag in the registration # string. When this flag is not specified the current behavior of # binfmt_misc is kept # # - This is the only 'right' way for an interpreter to know the correct # AT_SECURE value for the interpreted binary # # # From: Chris Wright # # This patchset looks OK, except for one problem. It installs the fd (which # could've been unreadable) without unsharing the ->files. So someone can use # this to read unreadable yet executable files. Here's a patch which fixes # that up. I added one bit that's commented out because I'm not positive if a # final steal_locks() is needed. # # I did a fair amount of rearranging to simplify the error conditions # relative to the fd_install(), and unshare_files(). # # From: Chris Wright # # I found that the intel patchset (and mine as well) leaked i_writecount on # the original executed file. In addition, I verified that the steal_locks() # bit is indeed needed. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/binfmt_misc.c # 2004/06/17 23:41:09-07:00 yoav.zach@intel.com +71 -51 # binfmt_misc: improve calculation of interpreter's credentials # # Documentation/binfmt_misc.txt # 2004/06/17 23:41:09-07:00 yoav.zach@intel.com +7 -0 # binfmt_misc: improve calculation of interpreter's credentials # # ChangeSet # 2004/06/18 07:53:34-07:00 yoav.zach@intel.com # [PATCH] Handle non-readable binfmt_misc executables # # # # I work in a group that works on enabling the IA-32 Execution Layer # (http://www.intel.com/pressroom/archive/releases/20040113comp.htm) on Linux. # In a few words - this is a dynamic translator for IA-32 binaries on IPF # platform. Following David Mosberger's advice - we use the binfmt_misc # mechanism for the invocation of the translator whenever the user tries to # exec an IA-32 binary. # # The EL is meant to help in the migration path from IA-32 to IPF. From our # beta customers we learnt that at first stage - they tend to keep their # environment mostly intact, using the legacy IA-32 binaries. # # Such an environment has, naturally, setuid and non-readable binaries. It # will be useless to ask the administrator to change the settings of such an # environment - some of them are very complex, and the administrators are # reluctant to make any changes in a system that already proved itself to be # robust and secure. So, our target with these patches is not to enhance the # support for scripts but rather to allow a translator to be integrated into a # working environment that is not (and should not be) aware to the fact it's # being emulated. # # As I said before - it is practically hopeless to expect an administrator of # such a system to change it so that it will suit the current behavior of # binfmt_misc. But, even if we could do that, # # I'm not sure it would be a good idea - these changes are likely to be less # secure than the suggested patches - # # - In order to execute non-readable binaries the binary will have to be made # readable, which is obviously less secure than allowing only a trusted # translator to read it # # - There will be no way for the translator to calculate the accurate # AT_SECURE value for the translated process. This might end up with the # translated process running in a non-secured mode when it actually needs to # be secured. # # # # # I prepared a patch that solves a couple of problems that interpreters have # when invoked via binfmt_misc. currently - # # 1) such interpreters cannot open non-readable binaries # # 2) the processes will have their credentials and security attributes # calculated according to interpreter permissions and not those of the # original binary # # the proposed patch solves these problems by - # # 1) opening the binary on behalf of the interpreter and passing its fd # instead of the path as argv[1] to the interpreter # # 2) calling prepare_binprm with the file struct of the binary and not the # one of the interpreter # # The new functionality is enabled by adding a special flag to the registration # string. If this flag is not added then old behavior is not changed. # # A preliminary version of this patch was sent to the list on 9/1/2003 with the # title "[PATCH]: non-readable binaries - binfmt_misc 2.6.0-test4". This new # version fixes the concerns that were raised by the patch, except of calling # unshare_files() before allocating a new fd. this is because this feature did # not enter 2.6 yet. # # # Arun Sharma says: # # We were going through an internal review of this patch: # # http://marc.theaimsgroup.com/?l=linux-kernel&m=107424598901720&w=2 # # which is in your tree already. I'm not sure if this line of code got # sufficient review. # # + /* call prepare_binprm before switching to interpreter's file # + * so that all security calculation will be done according to # + * binary and not interpreter */ # + retval = prepare_binprm(bprm); # # The case that concerns me is: unprivileged interpreter and a privileged # binary. One can use binfmt_misc to execute untrusted code (interpreter) with # elevated privileges. One could argue that all binfmt_misc interpreters are # trusted, because only root can register them. But that's a change from the # traditional behavior of binfmt_misc (and binfmt_script). # # # (Update): # # Arun pointed out that calculating the process credentials according to the # binary that needs to be translated is a bit risky, since it requires the # administrator to pay extra attention not to register an interpreter which is # not intended to run with root credentials. # # After discussing this issue with him, I would like to propose a modified # patch: The old patch did 2 things - 1) open the binary for reading and 2) # calculate the credentials according to the binary. # # I removed the riskier part of changing the credentials calculation, so the # revised patch only opens the binary for reading. It also includes few words # of warning in the description of the 'open-binary' feature in # binfmt_misc.txt, and makes the function entry_status print the flags in use. # # As for the 'credentials' part of the patch, I will prepare a separate patch # for it and send it again to the LKML, describe the problem and ask for people # comments. # # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/binfmts.h # 2004/06/17 23:41:09-07:00 yoav.zach@intel.com +4 -0 # Handle non-readable binfmt_misc executables # # fs/exec.c # 2004/06/18 00:32:28-07:00 yoav.zach@intel.com +3 -1 # Handle non-readable binfmt_misc executables # # fs/binfmt_misc.c # 2004/06/18 00:32:28-07:00 yoav.zach@intel.com +120 -21 # Handle non-readable binfmt_misc executables # # Documentation/binfmt_misc.txt # 2004/06/18 00:32:28-07:00 yoav.zach@intel.com +19 -4 # Handle non-readable binfmt_misc executables # # ChangeSet # 2004/06/18 07:53:23-07:00 mporter@kernel.crashing.org # [PATCH] Add PPC4xx MAINTAINERS entry, merge CREDITS from 2.4 # # Add myself as the PPC4xx maintainer. Merge CREDITS entry from 2.4 # # Signed-off-by: Matt Porter # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # MAINTAINERS # 2004/06/17 23:41:09-07:00 mporter@kernel.crashing.org +7 -0 # Add PPC4xx MAINTAINERS entry, merge CREDITS from 2.4 # # CREDITS # 2004/06/18 00:32:10-07:00 mporter@kernel.crashing.org +8 -0 # Add PPC4xx MAINTAINERS entry, merge CREDITS from 2.4 # # ChangeSet # 2004/06/18 07:53:12-07:00 olh@suse.de # [PATCH] ppc64: avoid multiline /proc/cmdline content on iSeries # # /proc/cmdline is filled via an OS400 call iSeries_init(). It scans the # returned data from the end, instead of the beginning. This leads to # multiple lines in /proc/cmdline # # Just scan from the beginning and stop at the first newline. This patch # changes also the /proc/iSeries/mf/*/cmdline interface to do the same as the # initial setup. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/mf_proc.c # 2004/06/17 23:41:08-07:00 olh@suse.de +15 -22 # ppc64: avoid multiline /proc/cmdline content on iSeries # # arch/ppc64/kernel/iSeries_setup.c # 2004/06/17 23:41:08-07:00 olh@suse.de +6 -7 # ppc64: avoid multiline /proc/cmdline content on iSeries # # ChangeSet # 2004/06/18 07:53:00-07:00 mikpe@csd.uu.se # [PATCH] ppc32 irq.c cpumask fix # # 2.6.7-rc3-mm1 changed cpumask_t from ulong to a struct, causing # compile-time errors in arch/ppc/kernel/irq.c. # # Proposed fix below. Tested on a G3. # # Signed-off-by: Mikael Pettersson # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/kernel/irq.c # 2004/06/17 23:41:08-07:00 mikpe@csd.uu.se +3 -1 # ppc32 irq.c cpumask fix # # ChangeSet # 2004/06/18 07:52:49-07:00 kumar.gala@freescale.com # [PATCH] ppc32: support for e500 and 85xx # # Here is both a GNU style and BK patch for adding support for the e500 core and # 85xx platform to 2.6. This is pretty much a direct port from 2.4 with a bit # of cleanup around the edges. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc/mpc85xx.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +128 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/immap_85xx.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +126 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/fsl_ocp.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +54 -0 # ppc32: support for e500 and 85xx # # arch/ppc/syslib/ppc85xx_setup.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +67 -0 # ppc32: support for e500 and 85xx # # arch/ppc/syslib/ppc85xx_setup.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +341 -0 # ppc32: support for e500 and 85xx # # arch/ppc/syslib/ppc85xx_common.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +29 -0 # ppc32: support for e500 and 85xx # # arch/ppc/syslib/ppc85xx_common.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +46 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/mpc85xx_ads_common.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +50 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/mpc85xx_ads_common.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +237 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/mpc8540_ads.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +30 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/mpc8540_ads.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +238 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/mpc8540.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +97 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/Makefile # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +7 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/Kconfig # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +44 -0 # ppc32: support for e500 and 85xx # # arch/ppc/mm/fsl_booke_mmu.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +236 -0 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/head_e500.S # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +1329 -0 # ppc32: support for e500 and 85xx # # include/linux/prctl.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +6 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/tlbflush.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +22 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/system.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +2 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/serial.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +2 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/reg_booke.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +119 -11 # ppc32: support for e500 and 85xx # # include/asm-ppc/reg.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +12 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/ptrace.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +5 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/processor.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +16 -9 # ppc32: support for e500 and 85xx # # include/asm-ppc/ppcboot.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +2 -2 # ppc32: support for e500 and 85xx # # include/asm-ppc/ppc_asm.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +56 -10 # ppc32: support for e500 and 85xx # # include/asm-ppc/pgtable.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +37 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/ocp_ids.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +2 -1 # ppc32: support for e500 and 85xx # # include/asm-ppc/ocp.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +4 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/mpc85xx.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/asm-ppc/mpc85xx.h # # include/asm-ppc/mmu_context.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +5 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/mmu.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +68 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/io.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +2 -0 # ppc32: support for e500 and 85xx # # include/asm-ppc/immap_85xx.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/asm-ppc/immap_85xx.h # # include/asm-ppc/fsl_ocp.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/asm-ppc/fsl_ocp.h # # include/asm-ppc/elf.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +1 -0 # ppc32: support for e500 and 85xx # # arch/ppc/syslib/ppc85xx_setup.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/syslib/ppc85xx_setup.h # # arch/ppc/syslib/ppc85xx_setup.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/syslib/ppc85xx_setup.c # # arch/ppc/syslib/ppc85xx_common.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/syslib/ppc85xx_common.h # # arch/ppc/syslib/ppc85xx_common.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/syslib/ppc85xx_common.c # # arch/ppc/syslib/open_pic.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +1 -1 # ppc32: support for e500 and 85xx # # arch/ppc/syslib/Makefile # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +7 -0 # ppc32: support for e500 and 85xx # # arch/ppc/platforms/85xx/mpc85xx_ads_common.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/platforms/85xx/mpc85xx_ads_common.h # # arch/ppc/platforms/85xx/mpc85xx_ads_common.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/platforms/85xx/mpc85xx_ads_common.c # # arch/ppc/platforms/85xx/mpc8540_ads.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/platforms/85xx/mpc8540_ads.h # # arch/ppc/platforms/85xx/mpc8540_ads.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/platforms/85xx/mpc8540_ads.c # # arch/ppc/platforms/85xx/mpc8540.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/platforms/85xx/mpc8540.c # # arch/ppc/platforms/85xx/Makefile # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/platforms/85xx/Makefile # # arch/ppc/platforms/85xx/Kconfig # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/platforms/85xx/Kconfig # # arch/ppc/mm/pgtable.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +32 -0 # ppc32: support for e500 and 85xx # # arch/ppc/mm/mmu_decl.h # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +9 -0 # ppc32: support for e500 and 85xx # # arch/ppc/mm/init.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +6 -0 # ppc32: support for e500 and 85xx # # arch/ppc/mm/fsl_booke_mmu.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/mm/fsl_booke_mmu.c # # arch/ppc/mm/fault.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +7 -7 # ppc32: support for e500 and 85xx # # arch/ppc/mm/Makefile # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +1 -0 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/traps.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +89 -2 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/signal.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +42 -3 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/ptrace.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +84 -3 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/process.c # 2004/06/18 00:32:24-07:00 kumar.gala@freescale.com +95 -6 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/ppc_ksyms.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +5 -1 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/misc.S # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +37 -3 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/head_e500.S # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/kernel/head_e500.S # # arch/ppc/kernel/entry.S # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +24 -12 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/cputable.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +12 -1 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/asm-offsets.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +7 -1 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/align.c # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +5 -5 # ppc32: support for e500 and 85xx # # arch/ppc/kernel/Makefile # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +4 -0 # ppc32: support for e500 and 85xx # # arch/ppc/Makefile # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +8 -2 # ppc32: support for e500 and 85xx # # arch/ppc/Kconfig # 2004/06/17 23:41:08-07:00 kumar.gala@freescale.com +33 -4 # ppc32: support for e500 and 85xx # # ChangeSet # 2004/06/18 07:52:38-07:00 hugh@veritas.com # [PATCH] mm: pretest pte_young and pte_dirty # # Test for pte_young before going to the costlier atomic test_and_clear, as # asm-generic does. Test for pte_dirty before going to the costlier atomic # test_and_clear, as asm-generic does (I said before that I would not do so for # pte_dirty, but was missing the point: there is nothing atomic about deciding # to do nothing). But I've not touched the rather different ppc and ppc64. # # Signed-off-by: Hugh Dickins # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/pgtable.h # 2004/06/17 23:41:07-07:00 hugh@veritas.com +15 -2 # mm: pretest pte_young and pte_dirty # # include/asm-parisc/pgtable.h # 2004/06/17 23:41:07-07:00 hugh@veritas.com +4 -0 # mm: pretest pte_young and pte_dirty # # include/asm-ia64/pgtable.h # 2004/06/17 23:41:07-07:00 hugh@veritas.com +4 -0 # mm: pretest pte_young and pte_dirty # # include/asm-i386/pgtable.h # 2004/06/17 23:41:07-07:00 hugh@veritas.com +14 -2 # mm: pretest pte_young and pte_dirty # # ChangeSet # 2004/06/18 07:52:27-07:00 hugh@veritas.com # [PATCH] mm: flush TLB when clearing young # # Traditionally we've not flushed TLB after clearing the young/referenced bit, # it has seemed just a waste of time. Russell King points out that on some # architectures, with the move from 2.4 mm sweeping to 2.6 rmap, this may be a # serious omission: very frequently referenced pages never re-marked young, and # the worst choices made for unmapping. # # So, replace ptep_test_and_clear_young by ptep_clear_flush_young throughout # rmap.c. Originally I'd imagined making some kind of TLB gather optimization, # but don't see what now: whether worth it rather depends on how common # cross-cpu flushes are, and whether global or not. # # ppc and ppc64 have already found this issue, and worked around it by arranging # TLB flush from their ptep_test_and_clear_young: with the aid of pgtable rmap # pointers. I'm hoping ptep_clear_flush_young will allow ppc and ppc64 to # remove that special code, but won't change them myself. # # It's worth noting that it is Andrea's anon_vma rmap which makes the vma # available for ptep_clear_flush_young in page_referenced_one: anonmm and # pte_chains would both need an additional find_vma for that. # # Signed-off-by: Hugh Dickins # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/rmap.c # 2004/06/17 23:41:07-07:00 hugh@veritas.com +3 -3 # mm: flush TLB when clearing young # # ChangeSet # 2004/06/18 13:33:48+01:00 rmk@flint.arm.linux.org.uk # [ARM] Add support code for ARM hardware vector floating point # # This cset adds the code to handle the hardware vector floating point # unit found on some ARM926 and later CPUs. The hardware provides # an implementation for the common cases, and bounces exceptions for # other cases, which have to be handled in software, and signalling # SIGFPE as appropriate. # # include/asm-arm/vfpmacros.h # 2004/06/18 13:31:34+01:00 rmk@flint.arm.linux.org.uk +25 -0 # # include/asm-arm/vfpmacros.h # 2004/06/18 13:31:33+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/vfpmacros.h # # include/asm-arm/vfp.h # 2004/06/18 13:31:26+01:00 rmk@flint.arm.linux.org.uk +78 -0 # # include/asm-arm/vfp.h # 2004/06/18 13:31:26+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/vfp.h # # arch/arm/vfp/vfpsingle.c # 2004/06/18 13:31:18+01:00 rmk@flint.arm.linux.org.uk +1224 -0 # # arch/arm/vfp/vfpsingle.c # 2004/06/18 13:31:18+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/vfpsingle.c # # arch/arm/vfp/vfpmodule.c # 2004/06/18 13:31:11+01:00 rmk@flint.arm.linux.org.uk +288 -0 # # arch/arm/vfp/vfpmodule.c # 2004/06/18 13:31:11+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/vfpmodule.c # # arch/arm/vfp/vfpinstr.h # 2004/06/18 13:31:03+01:00 rmk@flint.arm.linux.org.uk +88 -0 # # arch/arm/vfp/vfpinstr.h # 2004/06/18 13:31:03+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/vfpinstr.h # # arch/arm/vfp/vfphw.S # 2004/06/18 13:30:55+01:00 rmk@flint.arm.linux.org.uk +210 -0 # # arch/arm/vfp/vfphw.S # 2004/06/18 13:30:55+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/vfphw.S # # arch/arm/vfp/vfpdouble.c # 2004/06/18 13:30:41+01:00 rmk@flint.arm.linux.org.uk +1186 -0 # # arch/arm/vfp/vfpdouble.c # 2004/06/18 13:30:41+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/vfpdouble.c # # arch/arm/vfp/vfp.h # 2004/06/18 13:30:32+01:00 rmk@flint.arm.linux.org.uk +333 -0 # # arch/arm/vfp/vfp.h # 2004/06/18 13:30:32+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/vfp.h # # arch/arm/vfp/entry.S # 2004/06/18 13:30:14+01:00 rmk@flint.arm.linux.org.uk +45 -0 # # arch/arm/vfp/entry.S # 2004/06/18 13:30:14+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/entry.S # # arch/arm/vfp/Makefile # 2004/06/18 13:29:58+01:00 rmk@flint.arm.linux.org.uk +12 -0 # # arch/arm/vfp/Makefile # 2004/06/18 13:29:58+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/vfp/Makefile # # Documentation/arm/VFP/release-notes.txt # 2004/06/18 13:29:51+01:00 rmk@flint.arm.linux.org.uk +55 -0 # # include/asm-arm/thread_info.h # 2004/06/18 13:29:51+01:00 rmk@flint.arm.linux.org.uk +5 -2 # Add VFP state to thread information structure. # # include/asm-arm/fpstate.h # 2004/06/18 13:29:51+01:00 rmk@flint.arm.linux.org.uk +32 -0 # Add VFP hardware structures. # # Documentation/arm/VFP/release-notes.txt # 2004/06/18 13:29:51+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/Documentation/arm/VFP/release-notes.txt # # arch/arm/kernel/process.c # 2004/06/18 13:29:50+01:00 rmk@flint.arm.linux.org.uk +6 -0 # Add VFP calls for releasing VFP state held by a thread and # initialising VFP State. # # arch/arm/kernel/entry-armv.S # 2004/06/18 13:29:50+01:00 rmk@flint.arm.linux.org.uk +13 -0 # Add VFP calls and additional context switch support. # # arch/arm/Makefile # 2004/06/18 13:29:50+01:00 rmk@flint.arm.linux.org.uk +1 -0 # Add VFP directory to build # # arch/arm/Kconfig # 2004/06/18 13:29:49+01:00 rmk@flint.arm.linux.org.uk +11 -0 # Add VFP configuration option. # # ChangeSet # 2004/06/18 15:21:08+09:00 yoshfuji@linux-ipv6.org # [XFRM] fix dependency issues for CONFIG_IPV6=m. # # net/xfrm/xfrm_state.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +10 -0 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/xfrm/xfrm_export.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +1 -1 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/xfrm/Makefile # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +1 -1 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/ipv6/ipcomp6.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +5 -1 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/ipv6/esp6.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +8 -5 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/ipv6/ah6.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +5 -1 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/ipv4/ipcomp.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +7 -3 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/ipv4/esp4.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +9 -4 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # net/ipv4/ah4.c # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +4 -1 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # include/net/xfrm.h # 2004/06/18 15:20:58+09:00 yoshfuji@linux-ipv6.org +1 -1 # [XFRM] split up xfrm_check_output() into two functions to solve dependency issues. # # BitKeeper/deleted/.del-xfrm_output.c~af23cc5516e28602 # 2004/06/18 15:10:51+09:00 yoshfuji@linux-ipv6.org +0 -0 # Delete: net/xfrm/xfrm_output.c # # ChangeSet # 2004/06/18 01:56:40-04:00 len.brown@intel.com # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.7 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.7 # # drivers/acpi/pci_link.c # 2004/06/18 01:54:24-04:00 len.brown@intel.com +0 -0 # Auto merged # # arch/x86_64/kernel/mpparse.c # 2004/06/18 01:54:24-04:00 len.brown@intel.com +0 -0 # Auto merged # # arch/i386/kernel/mpparse.c # 2004/06/18 01:54:23-04:00 len.brown@intel.com +0 -0 # Auto merged # # ChangeSet # 2004/06/18 01:40:30-04:00 len.brown@intel.com # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.6 # into intel.com:/home/lenb/src/linux-acpi-test-2.6.7 # # arch/x86_64/kernel/mpparse.c # 2004/06/18 01:40:27-04:00 len.brown@intel.com +0 -0 # Auto merged # # ChangeSet # 2004/06/18 14:25:15+09:00 yoshfuji@linux-ipv6.org # [IPV6] XFRM: support (uncompressed) tunnel mode ipcomp6 using xfrm6_tunnel infrastructure. # # net/ipv6/xfrm6_tunnel.c # 2004/06/18 14:25:06+09:00 yoshfuji@linux-ipv6.org +623 -0 # # net/ipv6/xfrm6_tunnel.c # 2004/06/18 14:25:06+09:00 yoshfuji@linux-ipv6.org +0 -0 # BitKeeper file /home2/yoshfuji/BitKeeper/linux-2.6-export-2.6.8/linux-2.6-xfrm6tunnel/net/ipv6/xfrm6_tunnel.c # # net/ipv6/xfrm6_policy.c # 2004/06/18 14:25:06+09:00 yoshfuji@linux-ipv6.org +2 -0 # [IPV6] XFRM: add missing xfrm6_tunnel.c. # # net/ipv6/ipcomp6.c # 2004/06/18 14:25:06+09:00 yoshfuji@linux-ipv6.org +69 -0 # [IPV6] XFRM: support (uncompressed) tunnel mode ipcomp6 using xfrm6_tunnel infrastructure. # # net/ipv6/ip6_tunnel.c # 2004/06/18 14:25:06+09:00 yoshfuji@linux-ipv6.org +9 -9 # [IPV6] XFRM: use xfrm6_tunnel infrastructure to register/unregister protocol handers. # # net/ipv6/Makefile # 2004/06/18 14:25:06+09:00 yoshfuji@linux-ipv6.org +2 -1 # [IPV6] XFRM: add missing xfrm6_tunnel.c. # # include/net/xfrm.h # 2004/06/18 14:25:06+09:00 yoshfuji@linux-ipv6.org +14 -4 # [IPV6] XFRM: add missing xfrm6_tunnel.c. # # ChangeSet # 2004/06/18 13:56:36+09:00 yoshfuji@linux-ipv6.org # [IPV6] XFRM: add missing xfrm6_policy_check(). # # net/ipv6/ip6_tunnel.c # 2004/06/18 13:56:27+09:00 yoshfuji@linux-ipv6.org +5 -0 # [IPV6] XFRM: add missing xfrm6_policy_check(). # # ChangeSet # 2004/06/18 13:54:05+09:00 yoshfuji@linux-ipv6.org # [IPV6] make several functions static in ip6_tunnel that should be. # # net/ipv6/ip6_tunnel.c # 2004/06/18 13:53:56+09:00 yoshfuji@linux-ipv6.org +10 -6 # [IPV6] make several functions static in ip6_tunnel that should be. # # ChangeSet # 2004/06/18 00:18:19-04:00 len.brown@intel.com # [ACPI] handle SCI override to nth IOAPIC # http://bugzilla.kernel.org/show_bug.cgi?id=2835 # # arch/x86_64/kernel/mpparse.c # 2004/06/17 20:18:02-04:00 len.brown@intel.com +1 -0 # handle SCI override to nth IOAPIC # # arch/i386/kernel/mpparse.c # 2004/06/17 20:18:02-04:00 len.brown@intel.com +1 -0 # handle SCI override to nth IOAPIC # # ChangeSet # 2004/06/17 21:16:48-07:00 rth@twiddle.net # [PATCH] alpha: fix discontigmem+initrd build # # From: Ivan Kokshaysky # # Compilation fails due to incorrect usage of NODE_DATA(). # # Reported by hpa. # # arch/alpha/mm/numa.c # 2004/06/14 08:25:24-07:00 rth@twiddle.net +2 -2 # alpha: fix discontigmem+initrd build # # ChangeSet # 2004/06/17 21:04:44-07:00 paulus@samba.org # [PATCH] ppc64: Optimize exception/syscall entry/exit # # This rewrites the PPC64 exception entry/exit routines to make them # smaller and faster. # # In particular we no longer save all of the registers for the common # exceptions - system calls, hardware interrupts and decrementer (timer) # interrupts - only the volatile registers. The other registers are saved # and restored (if used) by the C functions we call. This involved # changing the registers we use in early exception processing from r20-r23 # to r9-r12, which ended up changing quite a lot of code in head.S. # Overall this gives us about a 20% reduction in null syscall time. # # Some system calls need all the registers (e.g. fork/clone/vfork and # [rt_]sigsuspend). For these the syscall dispatch code calls a stub that # saves the nonvolatile registers before calling the real handler. # # This also implements the force_successful_syscall_return() thing for # ppc64. # # Signed-off-by: Paul Mackerras # Signed-off-by: Linus Torvalds # # include/asm-ppc64/thread_info.h # 2004/06/16 22:46:06-07:00 paulus@samba.org +2 -2 # ppc64: Optimize exception/syscall entry/exit # # include/asm-ppc64/ptrace.h # 2004/06/16 22:46:06-07:00 paulus@samba.org +12 -0 # ppc64: Optimize exception/syscall entry/exit # # include/asm-ppc64/processor.h # 2004/06/16 22:46:06-07:00 paulus@samba.org +1 -2 # ppc64: Optimize exception/syscall entry/exit # # include/asm-ppc64/ppc_asm.h # 2004/06/16 22:46:06-07:00 paulus@samba.org +3 -5 # ppc64: Optimize exception/syscall entry/exit # # include/asm-ppc64/paca.h # 2004/06/16 22:46:06-07:00 paulus@samba.org +9 -11 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/xmon/xmon.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +0 -3 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/mm/fault.c # 2004/06/16 23:23:50-07:00 paulus@samba.org +33 -24 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/traps.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +15 -1 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/syscalls.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +14 -0 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/signal32.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +1 -1 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/signal.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +2 -2 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/process.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +5 -1 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/pacaData.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +0 -2 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/misc.S # 2004/06/16 22:46:06-07:00 paulus@samba.org +13 -12 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/head.S # 2004/06/16 22:46:06-07:00 paulus@samba.org +707 -760 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/entry.S # 2004/06/16 22:48:02-07:00 paulus@samba.org +277 -193 # ppc64: Optimize exception/syscall entry/exit # # arch/ppc64/kernel/asm-offsets.c # 2004/06/16 22:46:06-07:00 paulus@samba.org +10 -2 # ppc64: Optimize exception/syscall entry/exit # # ChangeSet # 2004/06/17 21:04:32-07:00 paulus@samba.org # [PATCH] ppc64: Implement CONFIG_PREEMPT # # This implements CONFIG_PREEMPT for ppc64. Aside from the entry.S # changes to check the _TIF_NEED_RESCHED bit when returning from an # exception, there are various changes to make the ppc64-specific code # preempt-safe, mostly adding preempt_enable/disable or get_cpu/put_cpu # calls where needed. I have been using this on my desktop G5 for the # last week without problems. # # Signed-off-by: Paul Mackerras # Signed-off-by: Linus Torvalds # # include/asm-ppc64/thread_info.h # 2004/06/09 23:21:41-07:00 paulus@samba.org +5 -2 # ppc64: Implement CONFIG_PREEMPT # # include/asm-ppc64/system.h # 2004/06/09 23:21:41-07:00 paulus@samba.org +2 -0 # ppc64: Implement CONFIG_PREEMPT # # include/asm-ppc64/hardirq.h # 2004/06/09 23:21:41-07:00 paulus@samba.org +2 -0 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/mm/tlb.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +5 -1 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/mm/init.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +4 -1 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/mm/hugetlbpage.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +4 -1 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/mm/hash_utils.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +7 -3 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/traps.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +2 -4 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/sys_ppc32.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +2 -6 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/signal32.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +5 -7 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/signal.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +3 -5 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/rtas.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +4 -2 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/ptrace32.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +6 -12 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/ptrace.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +4 -8 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/process.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +64 -23 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/entry.S # 2004/06/09 23:21:41-07:00 paulus@samba.org +50 -9 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/asm-offsets.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +1 -0 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/kernel/align.c # 2004/06/09 23:21:41-07:00 paulus@samba.org +9 -4 # ppc64: Implement CONFIG_PREEMPT # # arch/ppc64/Kconfig # 2004/06/09 23:21:41-07:00 paulus@samba.org +0 -1 # ppc64: Implement CONFIG_PREEMPT # # ChangeSet # 2004/06/17 22:54:26-05:00 stevef@smfhome1.smfdom # Fix typo in name of CIFS Kconfig option and add rename stats # # fs/cifs/cifssmb.c # 2004/06/17 22:54:19-05:00 stevef@smfhome1.smfdom +12 -1 # add rename stats # # fs/cifs/cifsglob.h # 2004/06/17 22:54:19-05:00 stevef@smfhome1.smfdom +2 -0 # add rename stats # # fs/cifs/cifs_debug.c # 2004/06/17 22:54:19-05:00 stevef@smfhome1.smfdom +7 -1 # Add rename stats # # fs/Kconfig # 2004/06/17 22:54:19-05:00 stevef@smfhome1.smfdom +1 -1 # Fix typo in name of CIFS Kconfig option # # ChangeSet # 2004/06/17 23:21:03-04:00 len.brown@intel.com # [ACPI] avoid spurious interrupts on VIA # http://bugzilla.kernel.org/show_bug.cgi?id=2243 # # drivers/acpi/pci_link.c # 2004/06/11 10:38:46-04:00 len.brown@intel.com +3 -19 # disable all PCI Interrupt Links to be enabled by _SRS # # ChangeSet # 2004/06/17 20:05:11-07:00 dsaxena@plexity.net # Merge plexity.net:/home/dsaxena/src/linux-2.6-arm-timer # into plexity.net:/home/dsaxena/src/linux-2.6-for-rmk # # arch/arm/mach-integrator/integrator_cp.c # 2004/06/17 20:05:06-07:00 dsaxena@plexity.net +0 -0 # Auto merged # # arch/arm/kernel/debug.S # 2004/06/17 20:05:06-07:00 dsaxena@plexity.net +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/06/17 20:05:06-07:00 dsaxena@plexity.net +0 -0 # Auto merged # # ChangeSet # 2004/06/17 23:00:08-04:00 len.brown@intel.com # [ACPI] fix passive cooling mode indicator (Luming Yu) # http://bugzilla.kernel.org/show_bug.cgi?id=1770 # # drivers/acpi/thermal.c # 2004/01/02 00:06:13-05:00 len.brown@intel.com +7 -0 # fix passive cooling mode indicator (Luming Yu) # # ChangeSet # 2004/06/17 16:25:47-07:00 tony.luck@intel.com # [PATCH] ia64: switching between CPEI & CPEP # # A couple of months ago Hidetoshi Seto from Fujitsu proposed # a patch to provide similar switching between interrupt mode # and polling mode for corrected platform events (CPE) as we # have for processor events (CMC) [with the obvious difference # that not all platforms support an interrupt for CPE]. # # I dusted it off and made a couple of very minor cleanups (which # Seto-san checked out last night on his test setup and confirmed # still passes). # # Signed-off-by: Tony Luck # Signed-off-by: David Mosberger # # arch/ia64/kernel/mca.c # 2004/06/16 13:24:00-07:00 tony.luck@intel.com +71 -16 # ia64: switching between CPEI & CPEP # # ChangeSet # 2004/06/17 16:22:26-07:00 pfg@sgi.com # [PATCH] ia64: fix SN2 interrupt rerouting # # Signed-off-by: Patrick Gefre # Signed-off-by: David Mosberger # # arch/ia64/sn/kernel/irq.c # 2004/06/17 08:42:20-07:00 pfg@sgi.com +17 -0 # ia64: fix SN2 interrupt rerouting # # arch/ia64/sn/io/sn2/ml_iograph.c # 2004/06/17 08:42:20-07:00 pfg@sgi.com +8 -8 # ia64: fix SN2 interrupt rerouting # # ChangeSet # 2004/06/17 15:47:19-07:00 davidm@tiger.hpl.hp.com # ia64: Fix build-problem when CONFIG_IA32 is not enabled. # # Without this fix, you'll get unresolved references to # sys_rt_sigaction(). # # include/asm-ia64/unistd.h # 2004/06/17 15:47:11-07:00 davidm@tiger.hpl.hp.com +2 -1 # (__ARCH_WANT_SYS_RT_SIGACTION): Move outside of # #ifdef CONFIG_IA32_SUPPORT bracket---we need # sys_rt_sigaction() whether we have ia32 emulation or not. # # ChangeSet # 2004/06/17 15:45:25-07:00 davidm@tiger.hpl.hp.com # ia64: Squish some more hazards & warnings for UP compile. # # include/asm-ia64/system.h # 2004/06/17 15:45:17-07:00 davidm@tiger.hpl.hp.com +1 -1 # (local_irq_enable): Precede ia64_ssm() with ia64_stop() to avoid # WAW hazard when local_irq_disable() is followed in the # same instruction-group by local_irq_enable(). # # include/asm-ia64/gcc_intrin.h # 2004/06/17 15:45:17-07:00 davidm@tiger.hpl.hp.com +11 -5 # (ia64_ptcga): Follow with ia64_dv_serialize_data() to shut up some # compiler/assembler-warnings which showed when compiling for UP. # (ia64_ptcl): Likewise. # (ia64_intrin_local_irq_restore): Put a stop-bit before the cmp.ne to # work around an apparent GCC v3.4 bug/limitation (it doesn't # seem to heed the clobber of p6/p7 and merrily generates code # that writes to p6/p7 right before the cmp.ne. # # ChangeSet # 2004/06/17 15:41:52-07:00 dsaxena@plexity.net # [ARM] Remove ADIFCC machine type # # The code is completely out of date, I am no longer maintaining it, # and nobdy has volunteered to do so; therefore, I am killing it. # # Signed-off-by: Deepak Saxena # # arch/arm/mm/Kconfig # 2004/06/17 15:41:42-07:00 dsaxena@plexity.net +1 -1 # Remove ADIFCC machine type # # arch/arm/kernel/entry-armv.S # 2004/06/17 15:41:42-07:00 dsaxena@plexity.net +1 -1 # Remove ADIFCC machine type # # arch/arm/kernel/debug.S # 2004/06/17 15:41:42-07:00 dsaxena@plexity.net +0 -26 # Remove ADIFCC machine type # # arch/arm/boot/compressed/head-xscale.S # 2004/06/17 15:41:42-07:00 dsaxena@plexity.net +0 -3 # Remove ADIFCC machine type # # arch/arm/boot/Makefile # 2004/06/17 15:41:42-07:00 dsaxena@plexity.net +0 -2 # Remove ADIFCC machine type # # arch/arm/Makefile # 2004/06/17 15:41:42-07:00 dsaxena@plexity.net +0 -1 # Remove ADIFCC machine type # # arch/arm/Kconfig # 2004/06/17 15:41:42-07:00 dsaxena@plexity.net +0 -3 # Remove ADIFCC machine type # # ChangeSet # 2004/06/17 15:41:25-07:00 davidm@tiger.hpl.hp.com # ia64: Squish compiler-warning in perfmon.c when compiling for UP. # # arch/ia64/kernel/perfmon.c # 2004/06/17 15:41:17-07:00 davidm@tiger.hpl.hp.com +26 -25 # (pfm_force_cleanup): Move nside "#ifdef CONFIG_SMP" bracket to # avoid compiler-warning. # # BitKeeper/deleted/.del-adi_evb_defconfig~5ab95444ffcea5c9 # 2004/06/17 15:27:16-07:00 dsaxena@plexity.net +0 -0 # Delete: arch/arm/configs/adi_evb_defconfig # # BitKeeper/deleted/.del-vmalloc.h~15c97e3acb543bb0 # 2004/06/17 15:25:00-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/vmalloc.h # # BitKeeper/deleted/.del-uncompress.h~62baa5a4fcf5eb3b # 2004/06/17 15:25:00-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/uncompress.h # # BitKeeper/deleted/.del-timex.h~a141f6df7754bb0a # 2004/06/17 15:25:00-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/timex.h # # BitKeeper/deleted/.del-system.h~198f47232b9136f1 # 2004/06/17 15:25:00-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/system.h # # BitKeeper/deleted/.del-serial.h~bc766ee26826eae8 # 2004/06/17 15:24:59-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/serial.h # # BitKeeper/deleted/.del-param.h~80c7330f7482c3c7 # 2004/06/17 15:24:59-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/param.h # # BitKeeper/deleted/.del-memory.h~2d1748648a3d612 # 2004/06/17 15:24:59-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/memory.h # # BitKeeper/deleted/.del-irqs.h~f0180913d4bf323c # 2004/06/17 15:24:59-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/irqs.h # # BitKeeper/deleted/.del-io.h~e0d8c315f73a9e29 # 2004/06/17 15:24:59-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/io.h # # BitKeeper/deleted/.del-hardware.h~b995a53087c6aa07 # 2004/06/17 15:24:59-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/hardware.h # # BitKeeper/deleted/.del-dma.h~1aab232a2312a68e # 2004/06/17 15:24:58-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/dma.h # # BitKeeper/deleted/.del-adi_evb.h~cd33495e40db9649 # 2004/06/17 15:24:56-07:00 dsaxena@plexity.net +0 -0 # Delete: include/asm-arm/arch-adifcc/adi_evb.h # # ChangeSet # 2004/06/17 15:23:14-07:00 stern@rowland.harvard.edu # [PATCH] USB: Fix endian bug in g_file_storage # # This patch fixes a couple of places in g_file_storage where I forgot to # use proper byte-swapping. # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/file_storage.c # 2004/06/17 09:15:53-07:00 stern@rowland.harvard.edu +2 -2 # USB: Fix endian bug in g_file_storage # # ChangeSet # 2004/06/17 15:22:55-07:00 stern@rowland.harvard.edu # [PATCH] USB Storage: unusual_devs.h update # # On Thu, 17 Jun 2004, Daniel Nouri wrote: # > I get this message when inserting my USB MMC card reader: # > # > usb 3-1: new full speed USB device using address 4 # > usb.agent[5388]: usb-storage: already loaded # > usb-storage: This device (04e6,0006,0205 S 01 P 01) has an unneeded Protocol entry in unusual_devs.h # > Please send a copy of this message to # # Thanks for letting us know. This patch will eliminate that log message. # # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # BitKeeper/deleted/.del-mm.c~5479359d6124d62c # 2004/06/17 15:22:54-07:00 dsaxena@plexity.net +0 -0 # Delete: arch/arm/mach-adifcc/mm.c # # BitKeeper/deleted/.del-irq.c~df46d54c803ac527 # 2004/06/17 15:22:54-07:00 dsaxena@plexity.net +0 -0 # Delete: arch/arm/mach-adifcc/irq.c # # BitKeeper/deleted/.del-arch.c~e5363b35d51cf728 # 2004/06/17 15:22:54-07:00 dsaxena@plexity.net +0 -0 # Delete: arch/arm/mach-adifcc/arch.c # # BitKeeper/deleted/.del-Makefile~bb9d2878ad23132d # 2004/06/17 15:22:53-07:00 dsaxena@plexity.net +0 -0 # Delete: arch/arm/mach-adifcc/Makefile # # drivers/usb/storage/unusual_devs.h # 2004/06/17 09:06:45-07:00 stern@rowland.harvard.edu +1 -1 # USB Storage: unusual_devs.h update # # ChangeSet # 2004/06/17 15:22:34-07:00 mdharm-usb@one-eyed-alien.net # [PATCH] USB Storage: Lexar Jumpshot CF reader # # This patch is required to fix up the jumpshot driver, and to supress # the 'unneeded entry' message for another device which uses the same # VID/PID/rev for multiple different versions of the device. # # Alan Stern cooked this patch up, originally. # # Signed-off-by: Matthew Dharm # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/unusual_devs.h # 2004/06/17 08:57:07-07:00 mdharm-usb@one-eyed-alien.net +2 -2 # USB Storage: Lexar Jumpshot CF reader # # drivers/usb/storage/jumpshot.c # 2004/06/17 08:51:10-07:00 mdharm-usb@one-eyed-alien.net +1 -1 # USB Storage: Lexar Jumpshot CF reader # # ChangeSet # 2004/06/17 15:22:14-07:00 david-b@pacbell.net # [PATCH] USB: add support for Buffalo LUA-U2-KTX # # Add support for Buffalo's LUA-U2-KTX, which is a AX8817X based usb # ethernet adapter. I just added the USB id and it worked like a dream. # # From: Neil Bortnak # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/net/usbnet.c # 2004/06/14 05:52:53-07:00 david-b@pacbell.net +6 -0 # USB: add support for Buffalo LUA-U2-KTX # # ChangeSet # 2004/06/17 15:21:44-07:00 david-b@pacbell.net # [PATCH] proper bios handoff in ehci-hcd # # Stuart Hayes here at Dell has identified this or/and mix-up in the # ehci-hcd driver. Because of this, ehci-hcd is not properly released by # BIOSes supporting full 2.0 and port behavior can then become erratic. # # (Code predates general availability of such BIOS firmware. This version # of the patch also fixes minor linewrap issues.) # # From: Gary Lerhaupt # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/host/ehci-hcd.c # 2004/06/16 01:29:01-07:00 david-b@pacbell.net +4 -3 # proper bios handoff in ehci-hcd # # ChangeSet # 2004/06/17 15:21:14-07:00 sean@mess.org # [PATCH] USB: PhidgetServo driver fixes # # Here is a patch for the phidgetservo driver -- it was using memory after # kfree(), and using driver_info is much nicer. :) # # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/misc/phidgetservo.c # 2004/06/16 08:28:42-07:00 sean@mess.org +63 -54 # USB: PhidgetServo driver fixes # # ChangeSet # 2004/06/17 15:20:50-07:00 stern@rowland.harvard.edu # [PATCH] USB: Only process ports with change events pending # # This patch adds a bit-array to the hub driver's private data structure, # used for storing the contents of the hub's interrupt status message. That # message indicates which ports have events pending (and whether the hub # itself has events pending). By only polling the status of the ports # listed in the bit-array we can save a fair amount of overhead in hub # communication. # # (The #error test added to hub.h is a little awkward, but it's purely # precautionary -- it won't matter until someone decides to support hubs # with more than 31 ports!) # # Also included in the patch, since this seemed the perfect opportunity for # it, is Byron's suggestion for handling hub events in the order in which # they were received. # # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.h # 2004/06/15 09:10:57-07:00 stern@rowland.harvard.edu +4 -0 # USB: Only process ports with change events pending # # drivers/usb/core/hub.c # 2004/06/15 09:11:37-07:00 stern@rowland.harvard.edu +14 -2 # USB: Only process ports with change events pending # # ChangeSet # 2004/06/17 14:21:35-07:00 dsaxena@plexity.net # [ARM] Consolidate various ARM timer fns. into single timer_tick() call. # # Signed-off-by: Deepak Saxena # # include/asm-arm/mach/time.h # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +2 -6 # Consolidate various ARM timer functions into a single timer_tick() call. # # arch/arm/mach-versatile/core.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/mach-shark/core.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/mach-sa1100/time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -5 # Call timer_tick() # # arch/arm/mach-s3c2410/time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -6 # Call timer_tick() # # arch/arm/mach-rpc/riscpc.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/mach-pxa/time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -5 # Call timer_tick() # # arch/arm/mach-omap/time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/mach-lh7a40x/time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -4 # Call timer_tick() # # arch/arm/mach-ixp4xx/common.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -1 # Call timer_tick() # # arch/arm/mach-iop3xx/iop321-time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -1 # Call timer_tick() # # arch/arm/mach-integrator/time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/mach-footbridge/time.c # 2004/06/17 14:21:26-07:00 dsaxena@plexity.net +2 -11 # Call timer_tick() # # arch/arm/mach-epxa10db/time.c # 2004/06/17 14:21:25-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/mach-ebsa110/core.c # 2004/06/17 14:21:25-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/mach-clps7500/core.c # 2004/06/17 14:21:25-07:00 dsaxena@plexity.net +2 -3 # Call timer_tick() # # arch/arm/mach-clps711x/time.c # 2004/06/17 14:21:25-07:00 dsaxena@plexity.net +1 -3 # Call timer_tick() # # arch/arm/kernel/time.c # 2004/06/17 14:21:25-07:00 dsaxena@plexity.net +16 -8 # Consolidate various ARM timer functions into a single timer_tick() call. # # ChangeSet # 2004/06/17 13:40:02-07:00 jmorris@redhat.com # [IPV6]: Fix OOPS in fragmentation. # # Incorrect SKB pointer is passed to output() callback # in ip6_fragment(). # # Work done by James Morris and Yoshifuji Hideaki. # # Signed-off-by: James Morris # Signed-off-by: Yoshifuji Hideaki # Signed-off-by: David S. Miller # # net/ipv6/ip6_output.c # 2004/06/17 13:39:47-07:00 jmorris@redhat.com +4 -6 # [IPV6]: Fix OOPS in fragmentation. # # Incorrect SKB pointer is passed to output() callback # in ip6_fragment(). # # Work done by James Morris and Yoshifuji Hideaki. # # Signed-off-by: James Morris # Signed-off-by: Yoshifuji Hideaki # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/17 16:31:52-04:00 len.brown@intel.com # [ACPI] PCI bus numbering workaround for ServerWorks # from David Shaohua Li # http://bugzilla.kernel.org/show_bug.cgi?id=1662 # # drivers/acpi/pci_root.c # 2004/06/17 12:31:13-04:00 len.brown@intel.com +48 -1 # if _BBN is bogus, evaluate _CRS on PCI bus # to get the bus number (David Shaohua Li) # # ChangeSet # 2004/06/17 12:11:42-07:00 davem@nuts.davemloft.net # [NET]: In unregister_netdevice(), do synchronize_net() before final dev_put(). # # This way we make sure that all destination cache updates # to remove references to this device are seen by entire # system before final destruction of the device. # # ChangeSet # 2004/06/17 12:09:59-07:00 davem@nuts.davemloft.net # Cset exclude: kuznet@ms2.inr.ac.ru|ChangeSet|20040616204246|05149 # # net/core/dst.c # 2004/06/17 12:09:54-07:00 davem@nuts.davemloft.net +0 -0 # Exclude # # ChangeSet # 2004/06/17 11:52:18-07:00 shemminger@osdl.org # [SPARSE]: Fix another net warning. # # Get rid of warning from assignment in conditional. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/core/net-sysfs.c # 2004/06/17 11:52:04-07:00 shemminger@osdl.org +1 -1 # [SPARSE]: Fix another net warning. # # Get rid of warning from assignment in conditional. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/17 11:40:00-07:00 shemminger@osdl.org # [SPARSE]: Get rid of warning in bridge ethtool ioctl. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_if.c # 2004/06/17 11:39:35-07:00 shemminger@osdl.org +1 -1 # [SPARSE]: Get rid of warning in bridge ethtool ioctl. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/17 11:16:48-07:00 shemminger@osdl.org # [SPARSE]: Annotate csum_and_copy_to_user(). # # include/asm-sparc64/checksum.h # 2004/06/17 11:16:34-07:00 shemminger@osdl.org +2 -1 # [SPARSE]: Annotate csum_and_copy_to_user(). # # include/asm-sparc/checksum.h # 2004/06/17 11:16:34-07:00 shemminger@osdl.org +1 -1 # [SPARSE]: Annotate csum_and_copy_to_user(). # # include/asm-sh/checksum.h # 2004/06/17 11:16:34-07:00 shemminger@osdl.org +4 -2 # [SPARSE]: Annotate csum_and_copy_to_user(). # # include/asm-parisc/checksum.h # 2004/06/17 11:16:34-07:00 shemminger@osdl.org +4 -2 # [SPARSE]: Annotate csum_and_copy_to_user(). # # include/asm-mips/checksum.h # 2004/06/17 11:16:34-07:00 shemminger@osdl.org +2 -1 # [SPARSE]: Annotate csum_and_copy_to_user(). # # include/asm-i386/checksum.h # 2004/06/17 11:16:34-07:00 shemminger@osdl.org +4 -2 # [SPARSE]: Annotate csum_and_copy_to_user(). # # ChangeSet # 2004/06/17 11:15:13-07:00 akpm@osdl.org # [BRIDGE]: Fix bridge sysfs improprely initialized kobject. # # The bridge sysfs interface introduced around 2.6.7-rc1 created a bad # entry in /sys because it didn't initialise the name member of the kobject. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/bridge/br_sysfs_br.c # 2004/06/17 11:14:46-07:00 akpm@osdl.org +1 -3 # [BRIDGE]: Fix bridge sysfs improprely initialized kobject. # # The bridge sysfs interface introduced around 2.6.7-rc1 created a bad # entry in /sys because it didn't initialise the name member of the kobject. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/17 10:56:25-07:00 shemminger@osdl.org # [SPARSE]: Add annotations to sock_filter.h # # Since sock_fprog is argument in ioctl, the filter pointer needs # to be annotated. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # include/linux/filter.h # 2004/06/17 10:56:10-07:00 shemminger@osdl.org +3 -1 # [SPARSE]: Add annotations to sock_filter.h # # Since sock_fprog is argument in ioctl, the filter pointer needs # to be annotated. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/17 10:51:14-07:00 shemminger@osdl.org # [SPARSE]: Get rid of warning in irtty_ioctl(). # # Don't really need verify_area because result of copy_to_user is checked. # Add annotation to get rid of sparse warnings. # # Signed-off-by: Stephen Hemminger # Signed-off-by: Jean Tourrilhes # Signed-off-by: David S. Miller # # drivers/net/irda/irtty-sir.c # 2004/06/17 10:50:59-07:00 shemminger@osdl.org +1 -9 # [SPARSE]: Get rid of warning in irtty_ioctl(). # # Don't really need verify_area because result of copy_to_user is checked. # Add annotation to get rid of sparse warnings. # # Signed-off-by: Stephen Hemminger # Signed-off-by: Jean Tourrilhes # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/17 11:09:05-05:00 stevef@stevef95.austin.ibm.com # fix typo in cifs kernel config option title # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/Kconfig # 2004/06/17 11:08:47-05:00 stevef@stevef95.austin.ibm.com +1 -1 # fix typo in cifs kernel config option title # # ChangeSet # 2004/06/17 02:15:36-04:00 len.brown@intel.com # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.7-mpparse # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.7 # # arch/x86_64/kernel/mpparse.c # 2004/06/17 02:15:31-04:00 len.brown@intel.com +0 -0 # Auto merged # # ChangeSet # 2004/06/17 01:42:44-04:00 len.brown@intel.com # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.7 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.7 # # arch/x86_64/kernel/mpparse.c # 2004/06/17 01:42:37-04:00 len.brown@intel.com +0 -0 # Auto merged # # arch/ia64/pci/pci.c # 2004/06/17 01:42:37-04:00 len.brown@intel.com +0 -0 # Auto merged # # arch/ia64/kernel/iosapic.c # 2004/06/17 01:42:36-04:00 len.brown@intel.com +0 -0 # Auto merged # # ChangeSet # 2004/06/17 01:30:00-04:00 len.brown@intel.com # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.6 # into intel.com:/home/lenb/src/linux-acpi-test-2.6.7 # # arch/i386/kernel/dmi_scan.c # 2004/06/17 01:29:57-04:00 len.brown@intel.com +0 -0 # Auto merged # # ChangeSet # 2004/06/17 01:26:33-04:00 len.brown@intel.com # [ACPI] Fix a lockup which Sid Boyce # discovered with IOAPIC disabled. # # The problem was that drivers/serial/8250_acpi.c found COM1 in the ACPI # namespace and called acpi_register_gsi() to set up its IRQ. ACPI tells us # that the COM1 IRQ is edge triggered, active high, but acpi_register_gsi() # was ignoring the edge_level argument, so it blindly set the COM1 IRQ to be # level-triggered. # # Signed-off-by: Bjorn Helgaas # Signed-off-by: Andrew Morton # Signed-off-by: Andrew Morton # With the 2.6.7-rc3-mm1 acpi changes to arch/x86_64/kernel/mpparse.c, # mp_find_ioapic is called from a non-__init function. The fatal code # path is reached when loading device drivers for PCI devices. # # ChangeSet # 2004/06/17 01:19:49-04:00 len.brown@intel.com # [ACPI] mp_find_ioapic() oops from mp_register_gsi() on device resume # Signed-off-by: Andrew Morton # # arch/i386/kernel/mpparse.c # 2004/05/31 06:03:27-04:00 len.brown@intel.com +1 -1 # It is called from mp_register_gsi(), which is called on the device resume # path. Kernel oopses. # # Program received signal SIGEMT, Emulation trap. # mp_find_ioapic (gsi=1) at arch/i386/kernel/mpparse.c:862 # 862 { # (gdb) bt # #0 mp_find_ioapic (gsi=1) at arch/i386/kernel/mpparse.c:862 # #1 0xc0111de1 in mp_register_gsi (gsi=17, edge_level=1, active_high_low=1) # at arch/i386/kernel/mpparse.c:1042 # #2 0xc010e164 in acpi_register_gsi (gsi=17, edge_level=9, active_high_low=9) # at arch/i386/kernel/acpi/boot.c:460 # #3 0xc01ef27e in acpi_pci_irq_enable (dev=0xc16da800) at drivers/acpi/pci_irq.c:382 # # ChangeSet # 2004/06/17 01:15:58-04:00 len.brown@intel.com # [ACPI] *** Warning: "acpi_register_gsi" [drivers/serial/8250_acpi.ko] undefined! # # Signed-off-by: Andrew Morton # # arch/i386/kernel/acpi/boot.c # 2004/06/17 01:15:53-04:00 len.brown@intel.com +2 -0 # *** Warning: "acpi_register_gsi" [drivers/serial/8250_acpi.ko] undefined! # # Signed-off-by: Andrew Morton # # ChangeSet # 2004/06/17 00:24:34-04:00 jgarzik@pobox.com # [libata/IDE nvidia] shuffle pci ids # # * Mark conflicting PCI ids with CONFIG_BLK_DEV_IDE_SATA # * Move not-yet-released PCI ids to libata sata_nv driver # # drivers/scsi/sata_nv.c # 2004/06/17 00:24:28-04:00 jgarzik@pobox.com +11 -3 # [libata/IDE nvidia] shuffle pci ids # # * Mark conflicting PCI ids with CONFIG_BLK_DEV_IDE_SATA # * Move not-yet-released PCI ids to libata sata_nv driver # # drivers/ide/pci/amd74xx.c # 2004/06/17 00:24:28-04:00 jgarzik@pobox.com +6 -14 # [libata/IDE nvidia] shuffle pci ids # # * Mark conflicting PCI ids with CONFIG_BLK_DEV_IDE_SATA # * Move not-yet-released PCI ids to libata sata_nv driver # # ChangeSet # 2004/06/16 23:10:50-05:00 stevef@smfhome1.smfdom # Fix /proc/fs/cifs/Stats to handle larger return data, and correct Kconfig reference to /proc/fs/cifs/Stats # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/cifsfs.h # 2004/06/16 23:10:44-05:00 stevef@smfhome1.smfdom +1 -1 # update cifs version to 1.19 # # fs/cifs/cifs_debug.c # 2004/06/16 23:10:44-05:00 stevef@smfhome1.smfdom +42 -17 # fix /proc/fs/cifs/Stats to handle larger return data # # fs/cifs/CHANGES # 2004/06/16 23:10:44-05:00 stevef@smfhome1.smfdom +9 -1 # Update cifs change log for 1.19 # # fs/Kconfig # 2004/06/16 23:10:44-05:00 stevef@smfhome1.smfdom +11 -2 # Correct name of /proc/fs/cifs/Stats file. Add cifs posix extensions configure option. # # ChangeSet # 2004/06/16 21:05:55-07:00 davidm@tiger.hpl.hp.com # Merge tiger.hpl.hp.com:/data1/bk/vanilla/linux-2.5 # into tiger.hpl.hp.com:/data1/bk/lia64/to-linus-2.5 # # arch/ia64/kernel/gate.S # 2004/06/16 21:05:50-07:00 davidm@tiger.hpl.hp.com +0 -4 # Auto merged # # arch/ia64/kernel/fsys.S # 2004/06/16 21:05:50-07:00 davidm@tiger.hpl.hp.com +0 -2 # Auto merged # # ChangeSet # 2004/06/16 20:53:53-07:00 davidm@tiger.hpl.hp.com # ia64: Nuke two warnings in mca.c that showed in the simulator configuration. # # arch/ia64/kernel/mca.c # 2004/06/16 20:53:46-07:00 davidm@tiger.hpl.hp.com +8 -0 # (ia64_mca_cpe_int_handler): Define only if CONFIG_ACPI is defined. # (ia64_mca_cpe_int_caller): Likewise. # # ChangeSet # 2004/06/16 20:51:30-07:00 davidm@tiger.hpl.hp.com # ia64: Fix ia32 partial-page-list code to compile cleanly in more configs. # # # include/asm-ia64/ia32.h # 2004/06/16 20:51:21-07:00 davidm@tiger.hpl.hp.com +9 -3 # (IA32_PAGE_SHIFT): Move to here from ia32priv.h. # (ia32_copy_partial_page_list): Declare unconditionally. If # PAGE_SHIFT == IA32_PAGE_SHIFT< define it as a no-op. # (ia32_drop_partial_page_list): Likewise. # # arch/ia64/kernel/process.c # 2004/06/16 20:51:21-07:00 davidm@tiger.hpl.hp.com +2 -6 # (flush_thread): Remove #ifdef CONFIG_IA32_SUPPORT bracket (no longer needed). # Pass task-pointer to ia32_drop_partial_page_list() instead of # partial-page list (the thread.ppl member may not exist in all # configurations). # (exit_thread): Likewise. # # arch/ia64/ia32/sys_ia32.c # 2004/06/16 20:51:21-07:00 davidm@tiger.hpl.hp.com +8 -5 # (ia32_drop_partial_page_list): Take task-pointer instead of partial_page_list- # pointer. # (sys32_munmap): Declare pstart and pend only when really needed. # (sys32_mremap): Likewise. # # arch/ia64/ia32/ia32priv.h # 2004/06/16 20:51:21-07:00 davidm@tiger.hpl.hp.com +7 -4 # (_ASM_IA64_IA32_PRIV_H): Rename from _ASM_IA64_IA32_H to avoid name-clash. # (IA32_PAGE_SHIFT): Move to include/asm-ia64/ia32.h. # (ia32_init_pp_list): Define as 0 for case swhere PAGE_SHIFT==IA32_PAGE_SHIFT. # # ChangeSet # 2004/06/16 23:44:40-04:00 jgarzik@pobox.com # [libata] put nvidia in Kconfig, in alphabetical order # # drivers/scsi/Kconfig # 2004/06/16 23:44:34-04:00 jgarzik@pobox.com +8 -8 # [libata] put nvidia in Kconfig, in alphabetical order # # ChangeSet # 2004/06/16 23:42:01-04:00 achew@nvidia.com # [libata] Add NVIDIA SATA driver # # drivers/scsi/sata_nv.c # 2004/06/16 23:41:55-04:00 achew@nvidia.com +1 -1 # [libata] Add NVIDIA SATA driver # # drivers/scsi/Makefile # 2004/06/16 23:41:55-04:00 achew@nvidia.com +1 -0 # [libata] Add NVIDIA SATA driver # # drivers/scsi/Kconfig # 2004/06/16 23:41:55-04:00 achew@nvidia.com +8 -0 # [libata] Add NVIDIA SATA driver # # drivers/scsi/sata_nv.c # 2004/06/16 23:40:44-04:00 jgarzik@pobox.com +345 -0 # # drivers/scsi/sata_nv.c # 2004/06/16 23:40:44-04:00 jgarzik@pobox.com +0 -0 # BitKeeper file /spare/repo/libata-2.6/drivers/scsi/sata_nv.c # # ChangeSet # 2004/06/16 23:29:08-04:00 jgarzik@pobox.com # [IDE] Introduce SATA enable/disable config option # # This config option is introduced to help reduce user confusion, # and eliminate conflicts between the IDE driver (which is often # built into user kernels) and the new libata SATA driver. # # drivers/ide/pci/siimage.c # 2004/06/16 23:29:02-04:00 jgarzik@pobox.com +3 -0 # [IDE] Introduce SATA enable/disable config option # # This config option is introduced to help reduce user confusion, # and eliminate conflicts between the IDE driver (which is often # built into user kernels) and the new libata SATA driver. # # drivers/ide/pci/piix.c # 2004/06/16 23:29:02-04:00 jgarzik@pobox.com +2 -2 # [IDE] Introduce SATA enable/disable config option # # This config option is introduced to help reduce user confusion, # and eliminate conflicts between the IDE driver (which is often # built into user kernels) and the new libata SATA driver. # # drivers/ide/pci/generic.c # 2004/06/16 23:29:02-04:00 jgarzik@pobox.com +2 -0 # [IDE] Introduce SATA enable/disable config option # # This config option is introduced to help reduce user confusion, # and eliminate conflicts between the IDE driver (which is often # built into user kernels) and the new libata SATA driver. # # drivers/ide/Kconfig # 2004/06/16 23:29:02-04:00 jgarzik@pobox.com +20 -0 # [IDE] Introduce SATA enable/disable config option # # This config option is introduced to help reduce user confusion, # and eliminate conflicts between the IDE driver (which is often # built into user kernels) and the new libata SATA driver. # # arch/ia64/kernel/head.S # 2004/06/16 18:09:33-07:00 davidm@tiger.hpl.hp.com +5 -1 # (_start): Initialize "current" pointer for init-task to be in # region 5, not 7. # # arch/ia64/kernel/entry.S # 2004/06/16 18:09:33-07:00 davidm@tiger.hpl.hp.com +4 -2 # (ia64_switch_to): Don't try to map "current"-pointers which are # inside region 5. # # arch/ia64/ia32/ia32_support.c # 2004/06/16 18:09:33-07:00 davidm@tiger.hpl.hp.com +10 -6 # ia64: Move "current" pointer for init-task from region 7 to region 5. # # This patch initializes "current" for the init-task such that it will # be an address in region 5 rather than region 7. Also, it updates the # context-switch code such that it won't attempt to install a pinned TLB # entry when the current task points inside region 5 (as will happen now # with the init-task). # # This fixes a problem which was triggered by SELinux. The problem was # due to the fact that the init_task is initialized statically (in # init_tasks.c) and hence resides in region 5, but the "current" pointer # was using the region 7-alias of that data-structure, which causes # inconsistencies and failers with the list-maniplulation code. # # Signed-off-by: Kazuto MIYOSHI # Signed-off-by: Takayoshi Kochi # Signed-off-by: Kaigai Kohei # Signed-off-by: David Mosberger # # ChangeSet # 2004/06/16 19:57:30-04:00 jgarzik@pobox.com # Merge pobox.com:/spare/repo/netdev-2.6/via-rhine # into pobox.com:/spare/repo/net-drivers-2.6 # # drivers/net/via-rhine.c # 2004/06/16 19:57:26-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/06/16 19:56:25-04:00 jgarzik@pobox.com # Merge pobox.com:/spare/repo/netdev-2.6/via-gbit # into pobox.com:/spare/repo/net-drivers-2.6 # # drivers/net/Kconfig # 2004/06/16 19:56:21-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/06/16 19:54:04-04:00 jgarzik@pobox.com # Merge pobox.com:/spare/repo/netdev-2.6/misc-herbert # into pobox.com:/spare/repo/net-drivers-2.6 # # drivers/net/yellowfin.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/sungem.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/starfire.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ns83820.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/natsemi.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ibmlana.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/forcedeth.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/ewrk3.c # 2004/06/16 19:54:01-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/at1700.c # 2004/06/16 19:54:00-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/acenic.c # 2004/06/16 19:54:00-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/3c527.c # 2004/06/16 19:54:00-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/06/16 19:51:21-04:00 jgarzik@pobox.com # Merge pobox.com:/spare/repo/netdev-2.6/ip-copysum # into pobox.com:/spare/repo/net-drivers-2.6 # # drivers/net/yellowfin.c # 2004/06/16 19:51:17-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/tulip/winbond-840.c # 2004/06/16 19:51:17-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/natsemi.c # 2004/06/16 19:51:17-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # drivers/net/epic100.c # 2004/06/16 19:51:17-04:00 jgarzik@pobox.com +0 -0 # Auto merged # # ChangeSet # 2004/06/16 16:51:07-07:00 jbarnes@engr.sgi.com # [PATCH] ia64: update sn2_defconfig # # Small patch to update the sn2_defconfig file. I just did a 'make oldconfig' # with the current sn2_defconfig and removed 8250 support. # Signed-off-by: David Mosberger # # arch/ia64/configs/sn2_defconfig # 2004/06/16 09:03:12-07:00 jbarnes@engr.sgi.com +51 -55 # ia64: update sn2_defconfig # # ChangeSet # 2004/06/16 16:04:19-07:00 kaos@sgi.com # [PATCH] ia64: Support SN platform specific error features # # The SN prom supports fine grained error handling features, the OS needs # to tell the prom if the OS expects to use these platform specific # features. # # Signed-off-by: Keith Owens # Signed-off-by: David Mosberger # # include/asm-ia64/sn/sn_sal.h # 2004/06/16 06:14:42-07:00 kaos@sgi.com +34 -0 # ia64: Support SN platform specific error features # # arch/ia64/sn/kernel/setup.c # 2004/06/16 06:14:42-07:00 kaos@sgi.com +22 -1 # ia64: Support SN platform specific error features # # ChangeSet # 2004/06/16 18:25:29-04:00 alan@redhat.com # [PATCH] add new via-velocity gigabit ethernet driver # # Contributed by VIA, cleaned up by Alan. # # drivers/net/via-velocity.h # 2004/06/02 15:49:48-04:00 alan@redhat.com +1885 -0 # PATCH: via-velocity with new ethtool used # # drivers/net/via-velocity.h # 2004/06/02 15:49:48-04:00 alan@redhat.com +0 -0 # BitKeeper file /spare/repo/netdev-2.6/via-gbit/drivers/net/via-velocity.h # # drivers/net/via-velocity.c # 2004/06/16 17:29:42-04:00 alan@redhat.com +3277 -0 # PATCH: via-velocity with new ethtool used # # drivers/net/Makefile # 2004/06/16 16:22:14-04:00 alan@redhat.com +1 -0 # PATCH: via-velocity with new ethtool used # # drivers/net/Kconfig # 2004/06/16 16:22:14-04:00 alan@redhat.com +11 -0 # PATCH: via-velocity with new ethtool used # # drivers/net/via-velocity.c # 2004/06/16 17:29:42-04:00 alan@redhat.com +0 -0 # BitKeeper file /spare/repo/netdev-2.6/via-gbit/drivers/net/via-velocity.c # # ChangeSet # 2004/06/16 15:52:13-05:00 stevef@stevef95.austin.ibm.com # fix throttle to limit number of requests to 50 on wire to server at one time. # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/transport.c # 2004/06/16 15:52:04-05:00 stevef@stevef95.austin.ibm.com +20 -13 # fix throttle to limit number of requests to 50 on wire to server at one time. # # ChangeSet # 2004/06/16 13:48:12-07:00 davem@nuts.davemloft.net # [TCP]: No vegas by default just yet. # # net/ipv4/tcp_input.c # 2004/06/16 13:47:53-07:00 davem@nuts.davemloft.net +1 -1 # [TCP]: No vegas by default just yet. # # ChangeSet # 2004/06/16 11:18:42-07:00 dada1@cosmosbay.com # [NET]: Tidy somaxconn sysctl doc. # # Documentation/networking/ip-sysctl.txt # 2004/06/16 11:18:23-07:00 dada1@cosmosbay.com +3 -2 # [NET]: Tidy somaxconn sysctl doc. # # ChangeSet # 2004/06/16 10:57:05-07:00 dlstevens@us.ibm.com # [IPV4]: Fix interface selection in multicast sockops. # # net/ipv4/ip_sockglue.c # 2004/06/16 10:56:46-07:00 dlstevens@us.ibm.com +1 -0 # [IPV4]: Fix interface selection in multicast sockops. # # ChangeSet # 2004/06/16 10:27:13-07:00 herbert@gondor.apana.org.au # [NET]: Clear dev refs in dst->child. # # This is a resend of an earlier patch to dst_dev_event. I've changed # it slightly by moving the input/output assignment into dst_ifdown. # # To recap, this patch drops lingering IPsec references to a device that # is being unregistered. The child processing in the GC is too late # since it never runs until the reference on the dst hits zero which # could take a long time for things like TCP connections. # # The reason I've left the input/output assignment outside the loop is # because they aren't really necessary for the IPsec dst's, and if # it were in the loop then we'll have to do the same child processing # in ___dst_free as well. # # I've tested this with an ESP/IPCOMP tunnel and I can confirm that it # does fix the problem. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/core/dst.c # 2004/06/16 10:26:56-07:00 herbert@gondor.apana.org.au +37 -25 # [NET]: Clear dev refs in dst->child. # # This is a resend of an earlier patch to dst_dev_event. I've changed # it slightly by moving the input/output assignment into dst_ifdown. # # To recap, this patch drops lingering IPsec references to a device that # is being unregistered. The child processing in the GC is too late # since it never runs until the reference on the dst hits zero which # could take a long time for things like TCP connections. # # The reason I've left the input/output assignment outside the loop is # because they aren't really necessary for the IPsec dst's, and if # it were in the loop then we'll have to do the same child processing # in ___dst_free as well. # # I've tested this with an ESP/IPCOMP tunnel and I can confirm that it # does fix the problem. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/16 10:23:42-07:00 davem@nuts.davemloft.net # Merge nuts.davemloft.net:/disk1/BK/net-2.6.8 # into nuts.davemloft.net:/disk1/BK/net-2.6 # # net/ipv4/tcp.c # 2004/06/16 10:23:34-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/06/16 11:36:45-05:00 jejb@mulgrave.(none) # scsi_debug: num_parts, ptype and (re-)scans # # From: Douglas Gilbert # # Changes in version 1.73: # - 'num_parts' parameter to specify 0 to 4 partitions # - 'ptype' to specify (or change via sysfs) SCSI # peripheral device type # - support ability to increase the number of targets # and/or luns then re-scan a scsi_debug host # - remove redundant trailing spaces # # The new facilties are described at: # http://www.torque.net/sg/sdebug26.html # A tarball of driver (version 1.73) is also there. # # Signed-off-by: James Bottomley # (conflict resolution) # # drivers/scsi/scsi_debug.h # 2004/06/16 11:36:19-05:00 jejb@mulgrave.(none) +1 -4 # scsi_debug: num_parts, ptype and (re-)scans # # drivers/scsi/scsi_debug.c # 2004/06/16 11:36:19-05:00 jejb@mulgrave.(none) +253 -124 # scsi_debug: num_parts, ptype and (re-)scans # # ChangeSet # 2004/06/16 09:32:58-05:00 jejb@mulgrave.(none) # SCSI: fix uninitialised variable warning # # Spotted By: Andrew Morton # # drivers/scsi/scsi_transport_spi.c: In function `spi_dv_retrain': # drivers/scsi/scsi_transport_spi.c:393: warning: `period' might be used uninitialized in this function # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_transport_spi.c # 2004/06/16 09:32:42-05:00 jejb@mulgrave.(none) +1 -1 # SCSI: fix uninitialised variable warning # # ChangeSet # 2004/06/15 21:46:23-07:00 jmorris@redhat.com # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/ss/services.c # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +12 -0 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/ss/policydb.c # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +9 -1 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/security.h # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +5 -4 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/flask.h # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +9 -0 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/class_to_string.h # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +9 -0 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/av_permissions.h # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +223 -0 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/av_perm_to_string.h # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +12 -0 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/av_inherit.h # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +9 -0 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/hooks.c # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +80 -22 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/Makefile # 2004/06/15 21:46:08-07:00 jmorris@redhat.com +1 -1 # [SELINUX]: Fine-grained Netlink support - SELinux changes # # This patch contains SELinux changes which add support for extended Netlink # socket classes and the associated permissions nlmsg_read and nlmsg_write. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 21:45:30-07:00 jmorris@redhat.com # [SELINUX]: Fine-grained Netlink support - add sk to netlink_send hook # # Modifies the LSM netlink_send() hook so that it takes a struct sock # parameter. SELinux will use this parameter to lookup the class of socket, # which was assigned during socket security initialization. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/hooks.c # 2004/06/15 21:45:15-07:00 jmorris@redhat.com +1 -1 # [SELINUX]: Fine-grained Netlink support - add sk to netlink_send hook # # Modifies the LSM netlink_send() hook so that it takes a struct sock # parameter. SELinux will use this parameter to lookup the class of socket, # which was assigned during socket security initialization. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/dummy.c # 2004/06/15 21:45:15-07:00 jmorris@redhat.com +1 -1 # [SELINUX]: Fine-grained Netlink support - add sk to netlink_send hook # # Modifies the LSM netlink_send() hook so that it takes a struct sock # parameter. SELinux will use this parameter to lookup the class of socket, # which was assigned during socket security initialization. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/netlink/af_netlink.c # 2004/06/15 21:45:15-07:00 jmorris@redhat.com +1 -1 # [SELINUX]: Fine-grained Netlink support - add sk to netlink_send hook # # Modifies the LSM netlink_send() hook so that it takes a struct sock # parameter. SELinux will use this parameter to lookup the class of socket, # which was assigned during socket security initialization. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # include/linux/security.h # 2004/06/15 21:45:15-07:00 jmorris@redhat.com +11 -8 # [SELINUX]: Fine-grained Netlink support - add sk to netlink_send hook # # Modifies the LSM netlink_send() hook so that it takes a struct sock # parameter. SELinux will use this parameter to lookup the class of socket, # which was assigned during socket security initialization. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 21:44:40-07:00 jmorris@redhat.com # [SELINUX]: Fine-grained Netlink support - move security_netlink_send() hook. # # This patch moves the security_netlink_send() LSM hook after the user copy, # so that LSM modules can safely examine skb payload content. For SELinux, # we need to look at the Netlink message type. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/netlink/af_netlink.c # 2004/06/15 21:44:26-07:00 jmorris@redhat.com +4 -4 # [SELINUX]: Fine-grained Netlink support - move security_netlink_send() hook. # # This patch moves the security_netlink_send() LSM hook after the user copy, # so that LSM modules can safely examine skb payload content. For SELinux, # we need to look at the Netlink message type. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 21:42:03-07:00 jmorris@redhat.com # [SELINUX]: Fine-grained Netlink support - SELinux headers # # This patch regenerates the SELinux module headers to reflect new class # and access vectors definitions. The size of the diff is misleading; # much of it is simply a change in the ordering of the automatically # generated definitions. The corresponding generation script has been # changed to ensure a stable order in the future. # # Author: Stephen Smalley # Signed-off-by: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/flask.h # 2004/06/15 21:41:48-07:00 jmorris@redhat.com +12 -0 # [SELINUX]: Fine-grained Netlink support - SELinux headers # # This patch regenerates the SELinux module headers to reflect new class # and access vectors definitions. The size of the diff is misleading; # much of it is simply a change in the ordering of the automatically # generated definitions. The corresponding generation script has been # changed to ensure a stable order in the future. # # Author: Stephen Smalley # Signed-off-by: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/class_to_string.h # 2004/06/15 21:41:48-07:00 jmorris@redhat.com +12 -0 # [SELINUX]: Fine-grained Netlink support - SELinux headers # # This patch regenerates the SELinux module headers to reflect new class # and access vectors definitions. The size of the diff is misleading; # much of it is simply a change in the ordering of the automatically # generated definitions. The corresponding generation script has been # changed to ensure a stable order in the future. # # Author: Stephen Smalley # Signed-off-by: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/av_permissions.h # 2004/06/15 21:41:48-07:00 jmorris@redhat.com +350 -250 # [SELINUX]: Fine-grained Netlink support - SELinux headers # # This patch regenerates the SELinux module headers to reflect new class # and access vectors definitions. The size of the diff is misleading; # much of it is simply a change in the ordering of the automatically # generated definitions. The corresponding generation script has been # changed to ensure a stable order in the future. # # Author: Stephen Smalley # Signed-off-by: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/include/av_perm_to_string.h # 2004/06/15 21:41:48-07:00 jmorris@redhat.com +89 -3 # [SELINUX]: Fine-grained Netlink support - SELinux headers # # This patch regenerates the SELinux module headers to reflect new class # and access vectors definitions. The size of the diff is misleading; # much of it is simply a change in the ordering of the automatically # generated definitions. The corresponding generation script has been # changed to ensure a stable order in the future. # # Author: Stephen Smalley # Signed-off-by: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 21:39:10-07:00 anton@samba.org # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # include/linux/skbuff.h # 2004/06/15 21:38:55-07:00 anton@samba.org +24 -0 # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # include/asm-ppc64/system.h # 2004/06/15 21:38:55-07:00 anton@samba.org +9 -0 # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # drivers/net/s2io.h # 2004/06/15 21:38:55-07:00 anton@samba.org +0 -1 # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # drivers/net/s2io.c # 2004/06/15 21:38:55-07:00 anton@samba.org +2 -2 # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # drivers/net/ixgb/ixgb_main.c # 2004/06/15 21:38:55-07:00 anton@samba.org +2 -3 # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # drivers/net/e1000/e1000_main.c # 2004/06/15 21:38:55-07:00 anton@samba.org +2 -3 # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # drivers/net/e1000/e1000_ethtool.c # 2004/06/15 21:38:55-07:00 anton@samba.org +3 -2 # [NET]: Allow IP header alignment to be overriden. # # Author: Anton Blanchard # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 21:37:06-07:00 shemminger@osdl.org # [ATM]: Include compiler.h in atm.h # # include/linux/atm.h # 2004/06/15 21:36:52-07:00 shemminger@osdl.org +1 -0 # [ATM]: Include compiler.h in atm.h # # ChangeSet # 2004/06/15 21:35:21-07:00 davem@nuts.davemloft.net # [TCP]: Tweak some default sysctl values. # # tcp_default_win_scale: 7 # tcp_vegas_cong_avoid: 1 # tcp_moderate_rcvbuf: 1 # tcp_bic: 1 # # net/ipv4/tcp_input.c # 2004/06/15 21:18:53-07:00 davem@nuts.davemloft.net +3 -3 # [TCP]: Tweak some default sysctl values. # # tcp_default_win_scale: 7 # tcp_vegas_cong_avoid: 1 # tcp_moderate_rcvbuf: 1 # tcp_bic: 1 # # net/ipv4/tcp.c # 2004/06/15 21:18:53-07:00 davem@nuts.davemloft.net +1 -1 # [TCP]: Tweak some default sysctl values. # # tcp_default_win_scale: 7 # tcp_vegas_cong_avoid: 1 # tcp_moderate_rcvbuf: 1 # tcp_bic: 1 # # ChangeSet # 2004/06/15 21:09:47-07:00 yoshfuji@linux-ipv6.org # [IPV6]: UDPv6 checksum. # # We always need to check UDPv6 checksum because it is mandatory. # # Author: Yoshifuji Hideaki # Signed-off-by: David S. Miller # # net/ipv6/udp.c # 2004/06/15 21:09:31-07:00 yoshfuji@linux-ipv6.org +1 -1 # [IPV6]: UDPv6 checksum. # # We always need to check UDPv6 checksum because it is mandatory. # # Author: Yoshifuji Hideaki # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 21:07:24-07:00 jmorris@redhat.com # [SELINUX]: Fix sock_orphan race. # # The patch below fixes a race between sock_orphan() and # selinux_socket_sock_rcv_skb() which can lead to a null pointer deref oops # under heavy load. The sk_callback_lock is used in the patch to # synchronize access to the incoming socket's inode security state. # # This patch has been under test in the Fedora kernel for over a month # without incident. # # Author: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # security/selinux/hooks.c # 2004/06/15 21:07:09-07:00 jmorris@redhat.com +21 -16 # [SELINUX]: Fix sock_orphan race. # # The patch below fixes a race between sock_orphan() and # selinux_socket_sock_rcv_skb() which can lead to a null pointer deref oops # under heavy load. The sk_callback_lock is used in the patch to # synchronize access to the incoming socket's inode security state. # # This patch has been under test in the Fedora kernel for over a month # without incident. # # Author: Stephen Smalley # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 20:37:41-07:00 hadi@znyx.com # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/sch_prio.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +58 -14 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/sch_ingress.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +64 -8 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/police.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +329 -1 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/cls_u32.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +179 -8 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/cls_tcindex.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +2 -2 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/cls_rsvp.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +3 -3 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/cls_route.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +3 -3 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/cls_fw.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +174 -3 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/cls_api.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +18 -5 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/Makefile # 2004/06/15 20:37:18-07:00 hadi@znyx.com +3 -1 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/Kconfig # 2004/06/15 20:37:18-07:00 hadi@znyx.com +33 -2 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/ethernet/eth.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +3 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/core/skbuff.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +23 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/core/rtnetlink.c # 2004/06/15 20:37:18-07:00 hadi@znyx.com +4 -2 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/net/pkt_sched.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +76 -4 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/net/pkt_cls.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +30 -2 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/linux/skbuff.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +9 -1 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/linux/rtnetlink.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +17 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/linux/pkt_sched.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +1 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/linux/pkt_cls.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +163 -8 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/linux/netdevice.h # 2004/06/15 20:37:18-07:00 hadi@znyx.com +2 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/act_api.c # 2004/06/15 20:37:06-07:00 hadi@znyx.com +978 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/act_api.c # 2004/06/15 20:37:06-07:00 hadi@znyx.com +0 -0 # BitKeeper file /disk1/BK/tc-2.6/net/sched/act_api.c # # include/net/pkt_act.h # 2004/06/15 20:37:05-07:00 hadi@znyx.com +286 -0 # [NET]: Add tc extensions infrastructure. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/net/pkt_act.h # 2004/06/15 20:37:05-07:00 hadi@znyx.com +0 -0 # BitKeeper file /disk1/BK/tc-2.6/include/net/pkt_act.h # # ChangeSet # 2004/06/16 00:33:13-03:00 acme@toy.kerneljanitors.org # [ECONET] kill some trivial warnings # # Signed-off-by: Arnaldo Carvalho de Melo # # net/econet/af_econet.c # 2004/06/16 00:33:01-03:00 acme@toy.kerneljanitors.org +6 -8 # [ECONET] kill some trivial warnings # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/15 20:24:51-07:00 davem@nuts.davemloft.net # Merge bk://kernel.bkbits.net/acme/net-2.6 # into nuts.davemloft.net:/disk1/BK/net-2.6 # # net/ipv6/tcp_ipv6.c # 2004/06/15 20:24:38-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/06/15 20:20:25-07:00 ahu@ds9a.nl # [NET]: Update some sysctl documentation. # # I ran the following (crappy) script: # ... # In /proc/sys/ and found a host of undocumented sysctls. This patch documents # a number of them, and at least mentions the rest as 'TODO'. Please verify my # code-inspired documentation before applying! # # Signed-off-by: Bert Hubert # Signed-off-by: David S. Miller # # Documentation/networking/ip-sysctl.txt # 2004/06/15 20:19:32-07:00 ahu@ds9a.nl +57 -0 # [NET]: Update some sysctl documentation. # # I ran the following (crappy) script: # ... # In /proc/sys/ and found a host of undocumented sysctls. This patch documents # a number of them, and at least mentions the rest as 'TODO'. Please verify my # code-inspired documentation before applying! # # Signed-off-by: Bert Hubert # Signed-off-by: David S. Miller # # Documentation/filesystems/proc.txt # 2004/06/15 20:19:32-07:00 ahu@ds9a.nl +2 -1 # [NET]: Update some sysctl documentation. # # I ran the following (crappy) script: # ... # In /proc/sys/ and found a host of undocumented sysctls. This patch documents # a number of them, and at least mentions the rest as 'TODO'. Please verify my # code-inspired documentation before applying! # # Signed-off-by: Bert Hubert # Signed-off-by: David S. Miller # # ChangeSet # 2004/06/15 19:32:48-07:00 dsaxena@omelas.(none) # [ARM] Add include/asm-arm/mach/time.h for shared timer definitions # # Signed-off-by: Deepak Saxena # # include/asm-arm/mach/time.h # 2004/06/15 19:31:40-07:00 dsaxena@omelas.(none) +24 -0 # # include/asm-arm/mach/time.h # 2004/06/15 19:31:40-07:00 dsaxena@omelas.(none) +0 -0 # BitKeeper file /home/dsaxena/src/linux-2.6-arm-timer/include/asm-arm/mach/time.h # # ChangeSet # 2004/06/15 19:00:23-07:00 dsaxena@omelas.(none) # [ARM] Delete include/asm-arm/arch-versatile/time.h # # Signed-off-by: Deepak Saxena # # BitKeeper/deleted/.del-time.h~c344b24f8045f7dc # 2004/06/15 18:59:09-07:00 dsaxena@omelas.(none) +0 -0 # Delete: include/asm-arm/arch-versatile/time.h # # ChangeSet # 2004/06/15 18:45:01-07:00 dsaxena@omelas.(none) # [ARM] Delete include/asm-arm/arch-ixp4xx/time.h # # Signed-off-by: Deepak Saxena # # BitKeeper/deleted/.del-time.h~cc23e4568356fd42 # 2004/06/15 18:44:35-07:00 dsaxena@omelas.(none) +0 -0 # Delete: include/asm-arm/arch-ixp4xx/time.h # # ChangeSet # 2004/06/15 18:42:18-07:00 dsaxena@omelas.(none) # [ARM] Delete include/asm-arm/arch-iop3xx/time.h # # Signed-off-by: Deepak Saxena # # BitKeeper/deleted/.del-time.h~66507b95d41b2fa3 # 2004/06/15 18:41:53-07:00 dsaxena@omelas.(none) +0 -0 # Delete: include/asm-arm/arch-iop3xx/time.h # # ChangeSet # 2004/06/15 18:38:14-07:00 dsaxena@omelas.(none) # [ARM] Delete include/asm-arm/arch-nexuspci/time.h # # Signed-off-by: Deepak Saxena # # BitKeeper/deleted/.del-time.h~730e38fa47912a2c # 2004/06/15 18:37:53-07:00 dsaxena@omelas.(none) +0 -0 # Delete: include/asm-arm/arch-nexuspci/time.h # # ChangeSet # 2004/06/15 18:16:01-07:00 dsaxena@omelas.(none) # [ARM] Remove bogus gettimeoffset ptr from machine_desc struct. # # This was accidently added during the timer code cleanup. # # Signed-off-by: Deepak Saxena # # include/asm-arm/mach/arch.h # 2004/06/15 18:14:13-07:00 dsaxena@omelas.(none) +0 -1 # Remove bogus gettimeoffset() from machine_desc struct # # ChangeSet # 2004/06/15 17:57:04-07:00 dsaxena@omelas.(none) # Merge # # arch/arm/mach-omap/board-generic.c # 2004/06/15 17:57:02-07:00 dsaxena@omelas.(none) +0 -0 # SCCS merged # # arch/arm/mach-omap/time.c # 2004/06/15 17:50:10-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/mach-omap/time.c # 2004/06/15 17:50:10-07:00 dsaxena@omelas.(none) +0 -0 # Merge rename: include/asm-arm/arch-omap/time.h -> arch/arm/mach-omap/time.c # # arch/arm/mach-omap/board-perseus2.c # 2004/06/15 17:50:10-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/mach-omap/board-osk.c # 2004/06/15 17:50:10-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/mach-omap/board-innovator.c # 2004/06/15 17:50:10-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/06/15 17:50:10-07:00 dsaxena@omelas.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/15 17:48:14-07:00 dsaxena@omelas.(none) # [ARM] Timer cleanup # # Signed-off-by: Deepak Saxena # # include/asm-arm/mach/arch.h # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +5 -0 # ARM timer cleanup # # include/asm-arm/arch-ixp4xx/platform.h # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # include/asm-arm/arch-integrator/platform.h # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +4 -0 # ARM timer cleanup # # arch/arm/mach-versatile/core.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +147 -0 # ARM timer cleanup # # arch/arm/mach-tbox/core.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +27 -0 # ARM timer cleanup # # arch/arm/mach-shark/core.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +40 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/yopy.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/xp860.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/trizeps.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +8 -3 # ARM timer cleanup # # arch/arm/mach-sa1100/system3.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/stork.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/simpad.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/sherman.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/shannon.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/pleb.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/pfs168.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/pangolin.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/omnimeter.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/nanoengine.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/lart.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/jornada720.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/itsy.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/huw_webpanel.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/hackkit.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/h3600.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +3 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/graphicsmaster.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/graphicsclient.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/generic.h # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/freebird.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/flexanet.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/empeg.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/cerf.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/brutus.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/badge4.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/assabet.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-sa1100/adsbitsy.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-s3c2410/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +18 -10 # ARM timer cleanup # # arch/arm/mach-s3c2410/s3c2410.h # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-s3c2410/mach-vr1000.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +6 -0 # ARM timer cleanup # # arch/arm/mach-s3c2410/mach-smdk2410.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +6 -0 # ARM timer cleanup # # arch/arm/mach-s3c2410/mach-h1940.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +6 -0 # ARM timer cleanup # # arch/arm/mach-s3c2410/mach-bast.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +6 -0 # ARM timer cleanup # # arch/arm/mach-s3c2410/Makefile # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -1 # ARM timer cleanup # # arch/arm/mach-rpc/riscpc.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +31 -0 # ARM timer cleanup # # arch/arm/mach-pxa/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +27 -4 # ARM timer cleanup # # arch/arm/mach-pxa/mainstone.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-pxa/lubbock.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-pxa/idp.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-pxa/generic.h # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-pxa/Makefile # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -1 # ARM timer cleanup # # arch/arm/mach-omap/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +15 -13 # ARM timer cleanup # # arch/arm/mach-omap/common.h # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-omap/board-perseus2.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-omap/board-osk.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-omap/board-innovator.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-omap/board-generic.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +7 -0 # ARM timer cleanup # # arch/arm/mach-omap/Makefile # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -1 # ARM timer cleanup # # arch/arm/mach-lh7a40x/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +22 -5 # ARM timer cleanup # # arch/arm/mach-lh7a40x/arch-lpd7a40x.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-lh7a40x/arch-kev7a400.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-lh7a40x/Makefile # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -1 # ARM timer cleanup # # arch/arm/mach-ixp4xx/prpmc1100-setup.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-ixp4xx/ixdp425-setup.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +3 -0 # ARM timer cleanup # # arch/arm/mach-ixp4xx/coyote-setup.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/mach-ixp4xx/common.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +7 -8 # ARM timer cleanup # # arch/arm/mach-iop3xx/iop321-time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +7 -6 # ARM timer cleanup # # arch/arm/mach-iop3xx/arch.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-integrator/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +146 -0 # ARM timer cleanup # # arch/arm/mach-integrator/integrator_cp.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +6 -0 # ARM timer cleanup # # arch/arm/mach-integrator/integrator_ap.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +6 -0 # ARM timer cleanup # # arch/arm/mach-ftvpci/core.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +47 -0 # ARM timer cleanup # # arch/arm/mach-footbridge/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +26 -8 # ARM timer cleanup # # arch/arm/mach-footbridge/arch.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +6 -0 # ARM timer cleanup # # arch/arm/mach-footbridge/Makefile # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +1 -1 # ARM timer cleanup # # arch/arm/mach-epxa10db/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +45 -1 # ARM timer cleanup # # arch/arm/mach-epxa10db/arch.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +3 -0 # ARM timer cleanup # # arch/arm/mach-ebsa110/core.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +102 -0 # ARM timer cleanup # # arch/arm/mach-clps7500/core.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +40 -1 # ARM timer cleanup # # arch/arm/mach-clps711x/time.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +28 -4 # ARM timer cleanup # # arch/arm/mach-clps711x/p720t.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-clps711x/fortunet.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-clps711x/edb7211-arch.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-clps711x/clep7312.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-clps711x/ceiva.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/mach-clps711x/cdb89712.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/common/time-acorn.c # 2004/06/15 17:42:35-07:00 dsaxena@omelas.(none) +3 -2 # ARM timer cleanup # # arch/arm/mach-clps711x/autcpu12.c # 2004/06/15 17:42:34-07:00 dsaxena@omelas.(none) +2 -0 # ARM timer cleanup # # arch/arm/kernel/time.c # 2004/06/15 17:42:34-07:00 dsaxena@omelas.(none) +12 -15 # ARM timer cleanup # # arch/arm/kernel/setup.c # 2004/06/15 17:42:34-07:00 dsaxena@omelas.(none) +3 -0 # ARM timer cleanup # # arch/arm/kernel/Makefile # 2004/06/15 17:42:34-07:00 dsaxena@omelas.(none) +1 -2 # ARM timer cleanup # # arch/arm/common/Makefile # 2004/06/15 17:42:34-07:00 dsaxena@omelas.(none) +1 -0 # ARM timer cleanup # # arch/arm/Kconfig # 2004/06/15 17:42:34-07:00 dsaxena@omelas.(none) +5 -0 # ARM timer cleanup # # BitKeeper/deleted/.del-time.h~e839fe4bcd9e4cf9 # 2004/06/15 16:48:56-07:00 dsaxena@omelas.(none) +0 -0 # Delete: include/asm-arm/arch-tbox/time.h # # ChangeSet # 2004/06/15 16:29:30-07:00 eranian@hpl.hp.com # [PATCH] ia64: fix info in /proc/pal/*/bus_info # # This patch fixes to minor bugs: # - corrected descriptions for bit 52 and 53 of the /proc/pal/CPU*/bus_info # entry; they were swapped # - corrected a typo for bit 55 of the /proc/pal/CPU*/bus_info entry # # Signed-off-by: Stephane Eranian # Signed-off-by: David Mosberger # # arch/ia64/kernel/palinfo.c # 2004/06/15 10:28:07-07:00 eranian@hpl.hp.com +2 -2 # ia64: fix info in /proc/pal/*/bus_info # # BitKeeper/deleted/.del-time.c~e41898daed8bea09 # 2004/06/15 16:08:17-07:00 dsaxena@omelas.(none) +0 -0 # Delete: arch/arm/mach-shark/time.c # # arch/arm/mach-shark/time.c # 2004/06/15 15:58:38-07:00 dsaxena@omelas.(none) +0 -0 # Rename: arch/arm/mach-shark/time.ch -> arch/arm/mach-shark/time.c # # arch/arm/mach-shark/time.ch # 2004/06/15 15:46:57-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-shark/time.h -> arch/arm/mach-shark/time.ch # # arch/arm/mach-sa1100/time.c # 2004/06/15 15:02:29-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-sa1100/time.h -> arch/arm/mach-sa1100/time.c # # arch/arm/mach-s3c2410/time.c # 2004/06/15 13:52:07-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-s3c2410/time.h -> arch/arm/mach-s3c2410/time.c # # BitKeeper/deleted/.del-time.c~16d0f1fb7b29ea89 # 2004/06/15 13:09:43-07:00 dsaxena@omelas.(none) +0 -23 # Delete: arch/arm/mach-rpc/time.c # # arch/arm/mach-rpc/time.c # 2004/06/15 13:02:38-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-rpc/time.h -> arch/arm/mach-rpc/time.c # # arch/arm/mach-pxa/time.c # 2004/06/15 12:36:09-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-pxa/time.h -> arch/arm/mach-pxa/time.c # # arch/arm/mach-omap/time.c # 2004/06/15 12:06:48-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-omap/time.h -> arch/arm/mach-omap/time.c # # arch/arm/mach-lh7a40x/time.c # 2004/06/15 11:01:21-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-lh7a40x/time.h -> arch/arm/mach-lh7a40x/time.c # # ChangeSet # 2004/06/15 12:48:08-05:00 jejb@mulgrave.(none) # Fix endless loop in SCSI SPI transport class # # If the driver doesn't update the peroid, we go # around forever. The fix is to keep our old period # unless the driver returns a greater one. # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_transport_spi.c # 2004/06/15 12:47:53-05:00 jejb@mulgrave.(none) +3 -1 # Fix endless loop in SCSI SPI transport class # # ChangeSet # 2004/06/15 12:32:52-05:00 jejb@mulgrave.(none) # Merge # # drivers/scsi/qlogicpti.c # 2004/06/15 12:32:34-05:00 jejb@mulgrave.(none) +0 -1 # SCCS merged # # drivers/scsi/esp.c # 2004/06/15 12:32:09-05:00 jejb@mulgrave.(none) +0 -1 # SCCS merged # # include/linux/pci_ids.h # 2004/06/15 12:28:06-05:00 jejb@mulgrave.(none) +0 -0 # Auto merged # # drivers/scsi/st.c # 2004/06/15 12:28:06-05:00 jejb@mulgrave.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_debug.c # 2004/06/15 12:28:06-05:00 jejb@mulgrave.(none) +0 -0 # Auto merged # # drivers/scsi/osst.c # 2004/06/15 12:28:05-05:00 jejb@mulgrave.(none) +0 -0 # Auto merged # # drivers/scsi/cpqfcTScontrol.c # 2004/06/15 12:28:05-05:00 jejb@mulgrave.(none) +0 -0 # Auto merged # # drivers/scsi/Kconfig # 2004/06/15 12:28:05-05:00 jejb@mulgrave.(none) +0 -0 # Auto merged # # MAINTAINERS # 2004/06/15 12:28:05-05:00 jejb@mulgrave.(none) +0 -0 # Auto merged # # ChangeSet # 2004/06/15 12:09:19-05:00 rddunlap@osdl.org # [PATCH] Comment out an unused function in drivers/scsi/wd7000.c # # Eliminate unused function wd7000_abort() in wd7000 driver. # # CC [M] drivers/scsi/wd7000.o # drivers/scsi/wd7000.c:1612: warning: `wd7000_abort' defined but not used # # As the author states in his comment, this is "unfinished business" ;-) # # # From: Mika Kukkonen # Signed-off-by: Randy Dunlap # Signed-off-by: James Bottomley # # drivers/scsi/wd7000.c # 2004/06/15 10:49:13-05:00 rddunlap@osdl.org +2 -1 # Comment out an unused function in drivers/scsi/wd7000.c # # ChangeSet # 2004/06/15 12:07:20-05:00 bunk@fs.tum.de # [PATCH] modular scsi/mca_53c9x doesn't work # # On Mon, Jun 14, 2004 at 08:22:15PM +0100, Christoph Hellwig wrote: # > On Mon, Jun 14, 2004 at 08:52:56PM +0200, Adrian Bunk wrote: # > > The issue described in the mail forwarded below is still present in # > > 2.6.7-rc3-mm2 (but not specific to -mm). # > > # > > I'd suggest the following workaround: # > # > Please add the exports instead. It'll affect all the other 53C9X-based # > drivers aswell. # # This sounds like a better solution. # # Signed-off-by: James Bottomley # # drivers/scsi/NCR53C9x.c # 2004/06/14 17:47:23-05:00 bunk@fs.tum.de +11 -0 # modular scsi/mca_53c9x doesn't work # # ChangeSet # 2004/06/15 12:06:00-05:00 akpm@osdl.org # [PATCH] drivers/scsi/megaraid.c: user/kernel pointer bugs # # From: "Robert T. Johnson" # # Since arg is a user pointer, so are uioc_mimd and uiocp, and hence umc is a # user pointer. Thus reading umc->xferaddr requires dereferencing a user # pointer, which isn't safe. # # Signed-off-by: Andrew Morton # Signed-off-by: James Bottomley # # drivers/scsi/megaraid.c # 2004/06/10 08:19:19-05:00 akpm@osdl.org +4 -2 # drivers/scsi/megaraid.c: user/kernel pointer bugs # # ChangeSet # 2004/06/15 12:04:04-05:00 g.liakhovetski@gmx.de # [PATCH] tmscsim: 64-bit cleanup # # > Although, I think, there's still a glitch there (modified if's order). # > I'll send a new version, if the approach is approved in principle. # # Ok, attached is version 3:-) It also fixes a definite (although, perhaps, # harmless) bug in scsiiom.c. And removes a redundant assignment in # tmscsim.c. # # Signed-off-by: Guennadi Liakhovetski # Signed-off-by: James Bottomley # # drivers/scsi/tmscsim.c # 2004/06/14 17:28:50-05:00 g.liakhovetski@gmx.de +40 -34 # tmscsim: 64-bit cleanup # # ChangeSet # 2004/06/15 12:01:55-05:00 hch@lst.de # [PATCH] avoid obsolete scsi APIs in eata_pio # # Signed-off-by: James Bottomley # # drivers/scsi/eata_pio.c # 2004/06/07 05:22:42-05:00 hch@lst.de +66 -65 # avoid obsolete scsi APIs in eata_pio # # drivers/scsi/eata_generic.h # 2004/06/07 05:19:05-05:00 hch@lst.de +1 -1 # avoid obsolete scsi APIs in eata_pio # # ChangeSet # 2004/06/15 11:59:06-05:00 hch@lst.de # [PATCH] clean up SCSI_TIMEOUT usage # # - qlogicfc.c abuses SCSI_TIEMOUT although it's not part of the scsi # core, give it it's own ISP_TIMEOUT define # - avoid redefining timeouts #ifdef DEBUG, that's a cause for heisenbugs # just waiting to happen # - now SCSI_TIMEOUT is private to scsi_scan.c, move it there # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_scan.c # 2004/06/06 06:20:50-05:00 hch@lst.de +5 -0 # clean up SCSI_TIMEOUT usage # # drivers/scsi/scsi_error.c # 2004/06/06 06:19:15-05:00 hch@lst.de +4 -9 # clean up SCSI_TIMEOUT usage # # drivers/scsi/scsi.h # 2004/06/06 06:17:31-05:00 hch@lst.de +0 -6 # clean up SCSI_TIMEOUT usage # # drivers/scsi/qlogicfc.c # 2004/06/06 06:17:21-05:00 hch@lst.de +2 -1 # clean up SCSI_TIMEOUT usage # # ChangeSet # 2004/06/15 16:33:27+01:00 rmk@flint.arm.linux.org.uk # [ARM] pxafb doesn't need to include asm/mach-types.h # # drivers/video/pxafb.c # 2004/06/15 16:31:17+01:00 rmk@flint.arm.linux.org.uk +0 -1 # pxafb doesn't need to include asm/mach-types.h # # ChangeSet # 2004/06/15 15:50:19+01:00 elf@com.rmk.(none) # [ARM PATCH] 1928/1: lh7a40x #7 Changes to memory model to support contiguous SDRAM # # Patch from Marc Singer # # [if's replaced by ifdef's.] # # While the BLOB boot loader doesn't support it, there are two others, # UBOOT and Logic's LOLO, that will initialize the SDRAM controller such # that the memory appears as a contiguous region. This layout to be # required for WinCE and, thus, is the default for these loaders. The # memory organization had been optimized for discontiguous blocks. Now, # it supports a default mode that is compatible with all of the # bootloaders as well as options to optimize for either contiguous or # discontiguous models. # # Withing, there is also a slight change to the way that the DEBUG_LL # macros select the UART address. Now it uses immediate constants # exclusively. # # # include/asm-arm/arch-lh7a40x/memory.h # 2004/06/12 22:57:20+01:00 elf@com.rmk.(none) +21 -48 # [PATCH] 1928/1: lh7a40x #7 Changes to memory model to support contiguous SDRAM # # arch/arm/mach-lh7a40x/Kconfig # 2004/06/12 22:57:20+01:00 elf@com.rmk.(none) +31 -0 # [PATCH] 1928/1: lh7a40x #7 Changes to memory model to support contiguous SDRAM # # arch/arm/kernel/debug.S # 2004/06/12 22:57:20+01:00 elf@com.rmk.(none) +2 -1 # [PATCH] 1928/1: lh7a40x #7 Changes to memory model to support contiguous SDRAM # # arch/arm/Kconfig # 2004/06/12 22:57:20+01:00 elf@com.rmk.(none) +2 -2 # [PATCH] 1928/1: lh7a40x #7 Changes to memory model to support contiguous SDRAM # # Documentation/arm/Sharp-LH/SDRAM # 2004/06/12 22:57:20+01:00 elf@com.rmk.(none) +51 -0 # [PATCH] 1928/1: lh7a40x #7 Changes to memory model to support contiguous SDRAM # # Documentation/arm/Sharp-LH/SDRAM # 2004/06/12 22:57:20+01:00 elf@com.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/Documentation/arm/Sharp-LH/SDRAM # # ChangeSet # 2004/06/15 15:46:21+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 1926/3: PXAFB cleanups and fixes # # Patch from Ian Campbell # # Sorry, 1926/2 was missing a brace. Fixed here. # # Previous commentry: # I have corrected the grayscale conversion to correctly use the upper # byte rather than the lower one. As requested I have also left the # actual grayscale conversion where it was this time and just dealt with # the palette differences in pxafb_setpalettereg. # # fb_alloc_cmap is only called when bits_per_pixel is < 16, otherwise # any existing cmap is freed. # # I also fixed up all the spaces and brackets issues (not just the one # you raised previously) this introduces some noise in the patch, if # you'd like the two patches separately please ask. # # drivers/video/pxafb.c # 2004/06/15 13:42:45+01:00 icampbell@com.rmk.(none) +50 -43 # [PATCH] 1926/3: PXAFB cleanups and fixes # # ChangeSet # 2004/06/15 14:52:36+01:00 rmk@flint.arm.linux.org.uk # [ARM] Add clock API # # Since peripheral clocks are be derived in SoC or even platform # specific ways, we need a way to keep this information out of the # drivers. AMBA Primecells are defined in terms of functional units # where clocks are derived from external sources, and it is up to the # SoC designer to determine where to derive those clocks from. # # Therefore, we provide a very basic API which allows platforms to # provide this information in a generic manner to their peripherals. # This framework also allows peripherals to shut down unused clock # sources when they're not in use. # # include/asm-arm/hardware/clock.h # 2004/06/15 14:49:41+01:00 rmk@flint.arm.linux.org.uk +121 -0 # # include/asm-arm/hardware/clock.h # 2004/06/15 14:49:41+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/hardware/clock.h # # arch/arm/mach-versatile/clock.h # 2004/06/15 14:49:33+01:00 rmk@flint.arm.linux.org.uk +25 -0 # # arch/arm/mach-versatile/clock.h # 2004/06/15 14:49:33+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/mach-versatile/clock.h # # arch/arm/mach-versatile/clock.c # 2004/06/15 14:49:25+01:00 rmk@flint.arm.linux.org.uk +146 -0 # # arch/arm/mach-versatile/clock.c # 2004/06/15 14:49:25+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/mach-versatile/clock.c # # arch/arm/mach-integrator/clock.h # 2004/06/15 14:49:18+01:00 rmk@flint.arm.linux.org.uk +25 -0 # # arch/arm/mach-integrator/clock.h # 2004/06/15 14:49:18+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/mach-integrator/clock.h # # arch/arm/mach-integrator/clock.c # 2004/06/15 14:49:09+01:00 rmk@flint.arm.linux.org.uk +138 -0 # # include/asm-arm/arch-integrator/impd1.h # 2004/06/15 14:49:09+01:00 rmk@flint.arm.linux.org.uk +0 -1 # IM-PD/1 VCO is now controlled via the clock subsystem. # # arch/arm/mach-integrator/clock.c # 2004/06/15 14:49:09+01:00 rmk@flint.arm.linux.org.uk +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/mach-integrator/clock.c # # drivers/serial/amba-pl011.c # 2004/06/15 14:49:08+01:00 rmk@flint.arm.linux.org.uk +58 -23 # Make PL011 UART use clock layer to obtain clock source information. # # drivers/input/serio/ambakmi.c # 2004/06/15 14:49:08+01:00 rmk@flint.arm.linux.org.uk +33 -5 # Make keyboard/mouse interface use clock layer to obtain KMI clock # source information. # # arch/arm/mach-versatile/Makefile # 2004/06/15 14:49:08+01:00 rmk@flint.arm.linux.org.uk +1 -1 # Add clock.o object. # # arch/arm/mach-integrator/integrator_cp.c # 2004/06/15 14:49:08+01:00 rmk@flint.arm.linux.org.uk +62 -0 # Add Integrator/CP specific clocks. # # arch/arm/mach-integrator/impd1.c # 2004/06/15 14:49:08+01:00 rmk@flint.arm.linux.org.uk +28 -13 # Add clock structures for IM-PD/1 on-board clocks. # # arch/arm/mach-integrator/Makefile # 2004/06/15 14:49:08+01:00 rmk@flint.arm.linux.org.uk +1 -1 # Add clock.o to build objects. # # ChangeSet # 2004/06/15 00:29:37-04:00 jgarzik@pobox.com # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # include/linux/libata.h # 2004/06/15 00:29:32-04:00 jgarzik@pobox.com +2 -2 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/sata_vsc.c # 2004/06/15 00:29:32-04:00 jgarzik@pobox.com +1 -1 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/sata_via.c # 2004/06/15 00:29:32-04:00 jgarzik@pobox.com +1 -1 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/sata_sx4.c # 2004/06/15 00:29:32-04:00 jgarzik@pobox.com +6 -3 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/sata_svw.c # 2004/06/15 00:29:32-04:00 jgarzik@pobox.com +1 -1 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/sata_sis.c # 2004/06/15 00:29:32-04:00 jgarzik@pobox.com +1 -1 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/sata_sil.c # 2004/06/15 00:29:32-04:00 jgarzik@pobox.com +1 -1 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/sata_promise.c # 2004/06/15 00:29:31-04:00 jgarzik@pobox.com +4 -4 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/libata-core.c # 2004/06/15 00:29:31-04:00 jgarzik@pobox.com +29 -21 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # drivers/scsi/ata_piix.c # 2004/06/15 00:29:31-04:00 jgarzik@pobox.com +2 -2 # [libata] ->qc_prep hook # # Rename ->fill_sg hook to ->qc_prep, and call it unconditionally # (as opposed to ->fill_sg, which was called only when the # flag ATA_QCFLAG_SG was set). # # ChangeSet # 2004/06/14 23:54:02-04:00 jgarzik@pobox.com # [libata] PCI IDE command-end/irq-acknowledge cleanup # # Restruct default irq handler (used for many PCI IDE-like SATA # controllers) to obtain device status and acknowledge interrupts # a bit differently. # # In an attempt to better attack the "ich5 screaming interrupt" problem, # acknowledge and clear the device's INTRQ by reading the Status register # _before_ ack'ing the controller's irq status. This is a deviation # from how the Linux IDE driver acknowledges interrupts, but it may # be the best method, since the ICH5 appears to continue to assert # the interrupt bit in the BMDMA until the device INTRQ line is cleared. # # Of course, SATA has no INTRQ line per se, so ICH5 essentially has # new interrupt behavior not seen before in the PCI IDE world, while # pretending that it's compatible with PCI IDE. Sigh. # # This change affects all SATA controllers (for which there are libata # drivers) except for sata_promise and sata_sx4. # # drivers/scsi/libata-core.c # 2004/06/14 23:53:57-04:00 jgarzik@pobox.com +57 -83 # [libata] PCI IDE command-end/irq-acknowledge cleanup # # Restruct default irq handler (used for many PCI IDE-like SATA # controllers) to obtain device status and acknowledge interrupts # a bit differently. # # In an attempt to better attack the "ich5 screaming interrupt" problem, # acknowledge and clear the device's INTRQ by reading the Status register # _before_ ack'ing the controller's irq status. This is a deviation # from how the Linux IDE driver acknowledges interrupts, but it may # be the best method, since the ICH5 appears to continue to assert # the interrupt bit in the BMDMA until the device INTRQ line is cleared. # # Of course, SATA has no INTRQ line per se, so ICH5 essentially has # new interrupt behavior not seen before in the PCI IDE world, while # pretending that it's compatible with PCI IDE. Sigh. # # This change affects all SATA controllers (for which there are libata # drivers) except for sata_promise and sata_sx4. # # ChangeSet # 2004/06/14 22:40:59-04:00 jgarzik@pobox.com # [libata] PCI IDE DMA code shuffling # # PCI IDE DMA standard (or "bmdma") helper routines ata_bmdma_stop, # ata_bmdma_ack_irq, and ata_bmdma_status are added to linux/libata.h, # and used in libata-core. # # There is a minor behavior change, such that, the Alt Status register # is read before acknowledging the bmdma interrupt. This should be ok, # and furthermore there will be more significant behavior changes # in this area coming soon. # # include/linux/libata.h # 2004/06/14 22:40:53-04:00 jgarzik@pobox.com +40 -0 # [libata] PCI IDE DMA code shuffling # # PCI IDE DMA standard (or "bmdma") helper routines ata_bmdma_stop, # ata_bmdma_ack_irq, and ata_bmdma_status are added to linux/libata.h, # and used in libata-core. # # There is a minor behavior change, such that, the Alt Status register # is read before acknowledging the bmdma interrupt. This should be ok, # and furthermore there will be more significant behavior changes # in this area coming soon. # # drivers/scsi/libata-core.c # 2004/06/14 22:40:53-04:00 jgarzik@pobox.com +4 -41 # [libata] PCI IDE DMA code shuffling # # PCI IDE DMA standard (or "bmdma") helper routines ata_bmdma_stop, # ata_bmdma_ack_irq, and ata_bmdma_status are added to linux/libata.h, # and used in libata-core. # # There is a minor behavior change, such that, the Alt Status register # is read before acknowledging the bmdma interrupt. This should be ok, # and furthermore there will be more significant behavior changes # in this area coming soon. # # drivers/net/acenic.c # 2004/06/14 18:49:59-04:00 johnpol@2ka.mipt.ru +2 -2 # Typo in ethtool code in acenic driver # # ChangeSet # 2004/06/14 18:34:29-04:00 akpm@osdl.org # [PATCH] prism94 build fix # # init_wds is being instantiated in both isl_ioctl.c and islpci_eth.c, causing # linkage errors. # # drivers/net/wireless/prism54/islpci_mgt.o(.rodata+0x198): In function `islpci_mgmt_rx_fill': # /usr/src/25/drivers/net/wireless/prism54/islpci_mgt.c:154: multiple definition of `init_wds' # drivers/net/wireless/prism54/islpci_eth.o(.rodata+0x1c8):/usr/src/25/include/linux/skbuff.h:815: first defined here # # Signed-off-by: Andrew Morton # # drivers/net/wireless/prism54/islpci_mgt.h # 2004/06/13 22:29:45-04:00 akpm@osdl.org +1 -1 # prism94 build fix # # ChangeSet # 2004/06/14 18:33:35-04:00 a.othieno@bluewin.ch # [PATCH] Kill stale references to Documentation/networking/8139too.txt # # Documentation/networking/8139too.txt was removed with this ChangeSet: # # ChangeSet@1.1371.153.2 2004-01-10 15:34:47-05:00 jgarzik@redhat.com # [netdrvr] remove Documentation/networking/8139too.txt # # All sections of the document are woefully outdated. # # # However, `grep' still reveals these references to it: # # drivers/net/8139too.c:90: See 8139too.txt for more details. # drivers/net/Kconfig:1539: as well as the # Documentation/networking/00-INDEX:7:8139too.txt # # Signed-off-by: Arthur Othieno # # drivers/net/Kconfig # 2004/06/14 14:50:09-04:00 a.othieno@bluewin.ch +1 -3 # Kill stale references to Documentation/networking/8139too.txt # # drivers/net/8139too.c # 2004/06/14 14:50:09-04:00 a.othieno@bluewin.ch +0 -2 # Kill stale references to Documentation/networking/8139too.txt # # Documentation/networking/00-INDEX # 2004/06/14 14:50:09-04:00 a.othieno@bluewin.ch +0 -2 # Kill stale references to Documentation/networking/8139too.txt # # ChangeSet # 2004/06/14 18:32:42-04:00 johnpol@2ka.mipt.ru # [PATCH] Typo in ethtool code in acenic driver # # In 10mbps detection code. # # ChangeSet # 2004/06/14 14:38:31-07:00 stern@rowland.harvard.edu # [PATCH] USB: Remove private khubd semaphore # # This patch removes the private semaphore used by the hub driver, and uses # the regular "serialize" semaphore instead. This will satisfy the general # locking requirements for adding and removing devices attached to the hub. # The only tricky aspect is that now the hub event handler must take a # reference to the hub device while waiting to acquire the semaphore, in # case the hub is disconnected during the wait. # # The patch also replaces a few occurrences of spin_lock_irqsave() in # regions where interrupts are known to be enabled with spin_lock_irq(). # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.h # 2004/06/14 03:33:06-07:00 stern@rowland.harvard.edu +0 -1 # USB: Remove private khubd semaphore # # drivers/usb/core/hub.c # 2004/06/14 03:59:02-07:00 stern@rowland.harvard.edu +24 -21 # USB: Remove private khubd semaphore # # ChangeSet # 2004/06/14 16:27:27-04:00 jgarzik@pobox.com # [libata] don't probe from workqueue # # Since we want the probe phase to call other workqueues, this is # required to eliminate future deadlocks. # # Other methods would include starting a single-shot thread just for # probing, but overall, using a separate thread for probing is pointless # since we are already in process context when we probe. # # So, we simply call ata_bus_probe directly. # # include/linux/libata.h # 2004/06/14 16:27:21-04:00 jgarzik@pobox.com +0 -15 # [libata] don't probe from workqueue # # Since we want the probe phase to call other workqueues, this is # required to eliminate future deadlocks. # # Other methods would include starting a single-shot thread just for # probing, but overall, using a separate thread for probing is pointless # since we are already in process context when we probe. # # So, we simply call ata_bus_probe directly. # # drivers/scsi/libata-core.c # 2004/06/14 16:27:21-04:00 jgarzik@pobox.com +18 -118 # [libata] don't probe from workqueue # # Since we want the probe phase to call other workqueues, this is # required to eliminate future deadlocks. # # Other methods would include starting a single-shot thread just for # probing, but overall, using a separate thread for probing is pointless # since we are already in process context when we probe. # # So, we simply call ata_bus_probe directly. # # BitKeeper/deleted/.del-time.h~d87f27565ed1c644 # 2004/06/14 11:55:15-07:00 dsaxena@omelas.(none) +0 -0 # Delete: include/asm-arm/arch-epxa10db/time.h # # ChangeSet # 2004/06/14 10:50:59-07:00 mhoffman@lightlink.com # [PATCH] I2C: add alternate VCORE calculations for w83627thf and w83637hf # # Pick a VRM (for VID interpretation) based on the VRM & OVT config, # if available. Props to Jean Delvare for the # idea & code fragment. # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/w83627hf.c # 2004/06/08 19:06:02-07:00 mhoffman@lightlink.com +6 -3 # I2C: add alternate VCORE calculations for w83627thf and w83637hf # # ChangeSet # 2004/06/14 10:35:58-07:00 stern@rowland.harvard.edu # [PATCH] USB: Fix bug in TT initialization introduced by earlier # # This patch repairs a bug introduced by an earlier patch: The TT # initialization code was moved to _after_ the TT's first use. The patch # simply puts the code back the way it used to be. # # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/13 07:11:31-07:00 stern@rowland.harvard.edu +13 -10 # USB: Fix bug in TT initialization introduced by earlier # # ChangeSet # 2004/06/14 10:35:15-07:00 mdharm-usb@one-eyed-alien.net # [PATCH] USB Storage: Fix race when removing the SCSI host # # This patch fixes a race is disconnecting a usb-storage device that occurs # with the SCSI layer. It's primarily reproducable via adding delays into # various disconnect and reset processing paths, but has also been # encountered in the field. # # This patch started life as as281b, and was modified by me only to patch # properly against current kernels. # # The main features of the patch are: # # Store the host pointer at the start of the control thread # rather than trying to get it from srb->device; after the host # is removed the SCSI device structure may no longer exist. # # Keep dev_semaphore locked during the entire time the control # thread or reset handlers are using the us_data structure. # # Reorder the items in dissociate_dev() and release_resources() # so that things are released in the opposite order from the way # they were acquired originally. Don't bother to increment and # decrement the usb_device's reference count; it's unnecessary. # # In disconnect(), first set the DISCONNECTING flag so that no # more I/O will take place and no more requests will be accepted. # Next, cut short the current command and wait for it to finish. # Then call scsi_remove_host(). The SCSI core guarantees that # when scsi_remove_host() returns, the host will not be in error # recovery and all outstanding commands will have been cancelled. # # Remove some old useless left-over code that was #if'ed out. # # Use a wait_queue for the 6-second delay during device resets # so that we can be woken up in the middle if a disconnect occurs. # # The key point here is that after scsi_remove_host(), everything is idle as # far as the SCSI midlayer is concerned. But if there was a command in # progress at the time, the midlayer will abort it without telling us or # waiting for it to complete. Hence we have to wait for the control thread # to be idle before we can try to kill it. This should happen quickly, # since all I/O attempted by the thread will fail immediately. # # Signed-off-by: Matthew Dharm # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/usb.h # 2004/06/13 13:09:07-07:00 mdharm-usb@one-eyed-alien.net +3 -2 # USB Storage: Fix race when removing the SCSI host # # drivers/usb/storage/usb.c # 2004/06/13 13:09:07-07:00 mdharm-usb@one-eyed-alien.net +85 -126 # USB Storage: Fix race when removing the SCSI host # # drivers/usb/storage/transport.c # 2004/06/13 13:09:07-07:00 mdharm-usb@one-eyed-alien.net +5 -4 # USB Storage: Fix race when removing the SCSI host # # ChangeSet # 2004/06/14 10:33:05-07:00 mdharm-usb@one-eyed-alien.net # [PATCH] USB Storage: INQUIRY fixup, mode-sense options, Genesys devices # # This patch does a few things (all in the same section of code). It started # life as patches as226b, as280, and as275. Later it was merged into as226e # and I added significantly to it. # # # First, this patch introduces a new config option to allow people to enable # write-protect detection for their USB devices. With some luck, we've # finally got it right and can eventually remove this option in favor of # enabling this behavior all the time. # # Next, we change how we force some flags on -- it turns out that there are # some 'generic' entries in the SCSI devinfo which was overriding us when we # didn't want it. # # Finally, we add a safety check to the workaround for GeneSys Logic devices # -- if the max_sectors parameter has already been turned down, we won't turn # it up. # # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/scsiglue.c # 2004/06/13 08:24:10-07:00 mdharm-usb@one-eyed-alien.net +46 -6 # USB Storage: INQUIRY fixup, mode-sense options, Genesys devices # # drivers/usb/storage/Kconfig # 2004/06/13 08:24:10-07:00 mdharm-usb@one-eyed-alien.net +22 -0 # USB Storage: INQUIRY fixup, mode-sense options, Genesys devices # # arch/arm/mach-footbridge/time.c # 2004/06/14 10:27:44-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-ebsa285/time.h -> arch/arm/mach-footbridge/time.c # # arch/arm/mach-ebsa110/time.c # 2004/06/14 10:03:25-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-ebsa110/time.h -> arch/arm/mach-ebsa110/time.c # # ChangeSet # 2004/06/14 09:45:55-07:00 greg@kroah.com # I2C: sparse cleanups again, based on comments from lkml # # This is more like the original code. # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/it87.c # 2004/06/14 02:45:18-07:00 greg@kroah.com +1 -4 # I2C: sparse cleanups again, based on comments from lkml # # This is more like the original code. # # Signed-off-by: Greg Kroah-Hartman # # BitKeeper/deleted/.del-time.c~8f84839a52a43e18 # 2004/06/13 20:40:08-07:00 dsaxena@omelas.(none) +0 -31 # Delete: arch/arm/mach-clps7500/time.c # # arch/arm/common/time-acorn.c # 2004/06/13 20:24:17-07:00 dsaxena@omelas.(none) +0 -0 # Rename: arch/arm/kernel/time-acorn.c -> arch/arm/common/time-acorn.c # # ChangeSet # 2004/06/12 22:23:05-03:00 acme@toy.kerneljanitors.org # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/stream.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +41 -0 # # net/sunrpc/xprt.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +2 -2 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/sunrpc/svcsock.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv6/tcp_ipv6.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_output.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +4 -4 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_minisocks.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp_ipv4.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/ipv4/tcp.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +3 -22 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # net/core/stream.c # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +0 -0 # BitKeeper file /home/acme/bk/net-2.6/net/core/stream.c # # net/core/Makefile # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +1 -1 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/tcp.h # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +0 -22 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # include/net/sock.h # 2004/06/12 22:22:55-03:00 acme@toy.kerneljanitors.org +20 -0 # [NET] first bits of net/core/stream.c # # Move tcp sk_wmem_queued related functions to net/core/stream.c, will be # used by other SOCK_STREAM protocols, starting with LLC. # # Also move the tcp_charge_skb to sock.h, for the same reasons. # # Signed-off-by: Arnaldo Carvalho de Melo # # ChangeSet # 2004/06/11 17:22:53-07:00 linux@kodeaffe.de # [PATCH] sysfs: fs/sysfs/inode.c: modify parents ctime and mtime on creation # # When a node is added to sysfs (e.g. a device plugged in via USB), the # filesystem fails to make this change visible in the parent directory's # ctime/mtime. This is in contrast to removing a device, because in that # case, sysfs makes use of the function simple_unlink from fs/libfs.c which # takes care of that. Instead of using simple_link from fs/libfs.c on # creation, sysfs implements its own mechanism. This patch hooks into the # function sysfs_create and sets the ctime and the mtime of the parent to # CURRENT_TIME. # # Signed-off-by: Sebastian Henschel # Signed-off-by: Greg Kroah-Hartman # # fs/sysfs/inode.c # 2004/06/10 14:47:54-07:00 linux@kodeaffe.de +6 -1 # sysfs: fs/sysfs/inode.c: modify parents ctime and mtime on creation # # ChangeSet # 2004/06/11 17:22:14-07:00 hannal@us.ibm.com # [PATCH] Driver Model: Add class support to msr.c # # This patch enables class support in arch/i386/kernel/msr.c. Very simliar # to cpuid (with the fixes Zwane/Greg made, thanks). # # [root@w-hlinder2 root]# tree /sys/class/msr # /sys/class/msr # | -- msr0 # | `-- dev # `-- msr1 # `-- dev # # 2 directories, 2 files # # Thanks to Randy Dunlap for pointing out the unnecessary tabs. Fixed. # # Signed-off-by Hanna Linder # Signed-off-by: Greg Kroah-Hartman # # arch/i386/kernel/msr.c # 2004/06/09 16:33:29-07:00 hannal@us.ibm.com +69 -2 # Driver Model: Add class support to msr.c # # arch/ia64/kernel/unwind.c # 2004/06/11 17:13:56-07:00 kaos@sgi.com +20 -15 # ia64: Remove warnings when unwind debug is turned on # # ChangeSet # 2004/06/11 17:06:39-07:00 david-b@pacbell.net # [PATCH] USB: usb on big endian, ehci needs a byteswap # # Adds a missing byteswap that would affect interrupt transfers # with EHCI on big-endian platforms, like Rick's MIPS-4km uClinux. # Needed for external hubs, and then likely for mice, keyboards, # and so on. # # From: Rick Sewill # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/host/ehci-sched.c # 2004/06/11 06:09:39-07:00 david-b@pacbell.net +1 -1 # USB: usb on big endian, ehci needs a byteswap # # ChangeSet # 2004/06/11 17:06:09-07:00 david-b@pacbell.net # [PATCH] USB: retry string fetches on ZLPs not just STALLs # # This matches the behavior for other descriptor fetches. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/message.c # 2004/06/11 04:49:33-07:00 david-b@pacbell.net +2 -2 # USB: retry string fetches on ZLPs not just STALLs # # ChangeSet # 2004/06/11 17:05:38-07:00 david-b@pacbell.net # [PATCH] USB: usbnet shouldn't oops on cdc error path # # If the string descriptor fetch works, no problem. Else # make the disconnect() logic -- newly called because of # "recent" changes to interface claiming logic -- use its # fast cleanup path, since we're still not fully set up yet. # # Should resolve OSDL bugid 2714; please merge. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/net/usbnet.c # 2004/06/10 23:55:54-07:00 david-b@pacbell.net +1 -0 # USB: usbnet shouldn't oops on cdc error path # # ChangeSet # 2004/06/11 17:05:08-07:00 david-b@pacbell.net # [PATCH] USB: usbtest just uses module_param() # # This prevents some warnings during modprobe. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/misc/usbtest.c # 2004/06/11 00:06:34-07:00 david-b@pacbell.net +8 -8 # USB: usbtest just uses module_param() # # ChangeSet # 2004/06/11 16:52:33-07:00 thoffman@arnor.net # [PATCH] USB: ATI Remote driver update # # Here are some contributed improvements for the ATI remote driver. # # I submitted the driver and it was accepted several months ago. # Since then a few people have sent me patches and suggestions. # # This patch adds two things: # # (1) support for the "Lola" X10 remote, sent to me by # Seth Cohn # # (2) key autorepeat support, sent to me by # Vincent Vanackere # # The key autorepeat support has been tested by me, but the Lola support # has not, as I don't have the hardware. # # Thanks to Seth and Vincent, with my apologies for taking so long to # forward their improvements along. # # # Signed-off-by: Torrey Hoffman # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/input/ati_remote.c # 2004/06/08 17:12:09-07:00 thoffman@arnor.net +42 -12 # USB: ATI Remote driver update # # drivers/usb/input/Kconfig # 2004/06/09 15:24:29-07:00 thoffman@arnor.net +8 -6 # USB: ATI Remote driver update # # ChangeSet # 2004/06/11 16:51:56-07:00 stern@rowland.harvard.edu # [PATCH] USB: Mark devices as NOTATTACHED as soon as possible # # This patch implements something we've been lacking for a long time: a way # to mark devices as USB_STATE_NOTATTACHED as soon as we know that they're # gone. The usb_device->state member is no longer protected by the # ->serialize semaphore; instead there's a new private spinlock. Usbcore # routines should no longer set ->state directly; instead they should use # the new utility routine usb_set_device_state(). There are protections # against changing states while devices are being added or removed. # # Change assignments to udev->state into calls of # usb_set_device_state(). # # Add new private device_state_lock to the hub driver, along # with usb_set_device_state() and recursively_mark_NOTATTACHED(). # # Acquire the new spinlock while adding or removing children[] # pointers. # # When disabling a port that has a child device, mark the child # as NOTATTACHED. # # You mentioned once having tried to do something like this and running into # trouble. Take a good look and let me know if you see any difficulties # here. # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/usb.h # 2004/06/09 06:52:00-07:00 stern@rowland.harvard.edu +3 -0 # USB: Mark devices as NOTATTACHED as soon as possible # # drivers/usb/core/message.c # 2004/06/09 06:50:10-07:00 stern@rowland.harvard.edu +4 -4 # USB: Mark devices as NOTATTACHED as soon as possible # # drivers/usb/core/hub.c # 2004/06/09 07:16:54-07:00 stern@rowland.harvard.edu +85 -12 # USB: Mark devices as NOTATTACHED as soon as possible # # drivers/usb/core/hcd.c # 2004/06/09 06:46:56-07:00 stern@rowland.harvard.edu +2 -2 # USB: Mark devices as NOTATTACHED as soon as possible # # ChangeSet # 2004/06/11 16:24:02-07:00 davidm@tiger.hpl.hp.com # ia64: Update defconfig # # arch/ia64/defconfig # 2004/06/11 16:23:55-07:00 davidm@tiger.hpl.hp.com +17 -6 # Update # # arch/arm/mach-clps7500/time.c # 2004/06/11 14:14:12-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-cl7500/time.h -> arch/arm/mach-clps7500/time.c # # BitKeeper/deleted/.del-time.c~531bda1d3ed195a5 # 2004/06/11 14:12:46-07:00 dsaxena@omelas.(none) +0 -0 # Delete: arch/arm/mach-adifcc/time.c # # arch/arm/mach-adifcc/time.c # 2004/06/11 14:10:55-07:00 dsaxena@omelas.(none) +0 -0 # Rename: include/asm-arm/arch-adifcc/time.h -> arch/arm/mach-adifcc/time.c # # ChangeSet # 2004/06/11 11:32:29-07:00 kaos@sgi.com # [PATCH] ia64: Remove warnings when unwind debug is turned on # # Turning on UNW_DEBUG generates warnings for incorrect number of # parameters for formats and several cases of "suggest explicit braces to # avoid ambiguous `else'", because UNW_DPRINT contains an if statement. # # Signed-off-by: Keith Owens # Signed-off-by: David Mosberger # # ChangeSet # 2004/06/10 20:00:01-04:00 margitsw@t-online.de # [PATCH] prism54: White space and indentation # # 2004-05-29 Margit Schubert-While # # * White space and indentation patch # # ChangeSet # 2004/06/10 19:59:53-04:00 margitsw@t-online.de # [PATCH] prism54: Fix typo # # 2004-05-29 Margit Schubert-While # # * isl_ioctl.c : Fix typo # # ChangeSet # 2004/06/10 19:59:45-04:00 margitsw@t-online.de # [PATCH] prism54: Fix channel stats, bump version to 1.2 # # 2004-05-20 Aurelien Alleaume # # * islpci_eth.c : use dev_kfree_skb_irq instead of dev_kfree_skb where needed. # # * isl_ioctl.c : report channel instead of frequency in scan. # # * islpci_hotplug.c : bump version to 1.2 # # ChangeSet # 2004/06/10 19:59:36-04:00 margitsw@t-online.de # [PATCH] prism54: Reduce module verbosity # # 2004-05-01 Margit Schubert-While # # * Reduce module verbosity # # ChangeSet # 2004/06/10 19:59:28-04:00 margitsw@t-online.de # [PATCH] prism54: Align skb patch # # * islpci_eth.c, islpci_dev.c : Align skb->data unconditonally after # allocation. This would appear to improve RX rate # # ChangeSet # 2004/06/10 19:59:20-04:00 margitsw@t-online.de # [PATCH] prism54: Add likely/unlikely, KO wds completely # # * islpci_mgt.h : Change init_wds definition # # * islpci_eth.c : Do some likely/unlikely # # ChangeSet # 2004/06/10 19:59:11-04:00 margitsw@t-online.de # [PATCH] prism54: Don't allow mib reads while unconfigured # # 004-04-17 Aurelien Alleaume # # * oid_mgt.c, isl_ioctl.c : Cleanup. Prevented real oid reading # before the card is configured with mib values (might be # related to # bug #53). # # ChangeSet # 2004/06/10 19:59:03-04:00 margitsw@t-online.de # [PATCH] prism54: Fix bug 77, strengthened oid txn # # 2004-04-09 Aurelien Alleaume # # * oid_mgt.c, isl_ioctl.c : Cleanups. Bug #77. Minor stuffs. # # * islpci_mgt.c (islpci_mgt_transaction) : enforce serialization # in oid transaction. lindent.sh. # # * islpci_mgt.c (islpci_mgt_transaction) : Strengthened oid transaction. # # ChangeSet # 2004/06/10 19:58:55-04:00 margitsw@t-online.de # [PATCH] prism54: Fix bugs 39/73 # # 2004-04-07 Margit Schubert-While # # * Bugs 39 and 73 # # ChangeSet # 2004/06/10 19:58:46-04:00 margitsw@t-online.de # [PATCH] prism54: Fix bugs 74/75 # # 2004-03-22 Aurelien Alleaume # # * oid_mgt.c, isl_ioctl.c : Minor bugfixes : #74 and #75. # # ChangeSet # 2004/06/10 19:38:59-04:00 bunk@fs.tum.de # [PATCH] add NAPI help texts # # NAPI seems to be so self-explaining that no help texts are needed. ;-) # # I combined the two help texts that were at NAPI options, and added them # to all NAPI options. # # ChangeSet # 2004/06/10 19:37:53-04:00 rmk@arm.linux.org.uk # [PATCH] add ARM smc91x driver # # ChangeSet # 2004/06/10 19:58:38-04:00 margitsw@t-online.de # [PATCH] prism54: Fix endian patch # # * Split out patch islpci_eth.c : # * Fix endian problem (bug 74/75 related) # # ChangeSet # 2004/06/10 20:52:50-04:00 jgarzik@pobox.com # [netdrvr acenic] remove unneeded ifdefs # # ChangeSet # 2004/06/10 20:19:03-04:00 shemminger@osdl.org # [PATCH] fix oops from acenic ethtool # # Fix the following OOPS that happens when doing ifup on FC-2 # with 2.6.7 in acenic and a security hole due to missing capable(NET_ADMIN), # by replacing private ethtool handling with ethtool_ops. # # (Yes, Jes because of DEV_ETHTOOL_OPS define it will still work # on ancient kernels.) # # ChangeSet # 2004/06/10 19:58:30-04:00 margitsw@t-online.de # [PATCH] prism54: Kernel compatibility # # 2004-03-20 Margit Schubert-While # # * isl_38xx.[ch], isl_ioctl.c, islpci_dev.[ch], islpci_eth.c # islpci_hotplug.c, islpci_mgt.[ch], oid_mgt.c, prismcompat.h: # Adopt new prism54 kernel compatibility. # Remove remaining kernel version ifdefs. # # ChangeSet # 2004/06/10 19:37:01-04:00 akpm@osdl.org # [PATCH] fealnx-mac-address-and-other-issues.patch # # (resend - I need to get this out of my tree my one means or another..) # # # From: "SuD (Alex)" # # I recently was given a surecom 10/100 ethernet card and found that i could # not change Mac address for it as other driver/devices allow. I tried to # implement the missing feature and noticed that the device is quite peculiar # (or either my system is broken), when trying to fill mac address registers # (no matter whether io_ops is set): - If I write a byte (writeb) to an even # i/o address it seems like actually a word was written (the next byte is set # to 0). - If I write a byte to an odd i/o address my pc gets bad freezed. # # That made think of writing 16bit words (writew) for the memory address, as # opposed to what most driver examples do. It works for me (I hope i set the # lines at the right place in device_open function after the device is # reset). I hope the code is clean enough and does not mess with byte # ordering. This is the patch (this time against 2.6.5): # # (akpm: Is this right on big-endian?) # # drivers/net/acenic.c # 2004/06/10 20:52:44-04:00 jgarzik@pobox.com +0 -6 # [netdrvr acenic] remove unneeded ifdefs # # drivers/net/acenic.h # 2004/06/04 17:31:46-04:00 shemminger@osdl.org +0 -1 # fix oops from acenic ethtool # # drivers/net/acenic.c # 2004/06/04 17:31:46-04:00 shemminger@osdl.org +127 -121 # fix oops from acenic ethtool # # drivers/net/wireless/prism54/oid_mgt.h # 2004/05/28 08:06:38-04:00 margitsw@t-online.de +1 -1 # prism54: White space and indentation (resend) # # drivers/net/wireless/prism54/oid_mgt.c # 2004/05/28 09:12:49-04:00 margitsw@t-online.de +7 -7 # prism54: White space and indentation (resend) # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/05/28 09:12:49-04:00 margitsw@t-online.de +42 -42 # prism54: White space and indentation (resend) # # drivers/net/wireless/prism54/islpci_eth.c # 2004/05/28 09:49:41-04:00 margitsw@t-online.de +8 -8 # prism54: White space and indentation (resend) # # drivers/net/wireless/prism54/islpci_dev.h # 2004/05/28 08:25:30-04:00 margitsw@t-online.de +1 -1 # prism54: White space and indentation (resend) # # drivers/net/wireless/prism54/isl_ioctl.c # 2004/05/28 09:49:41-04:00 margitsw@t-online.de +28 -34 # prism54: White space and indentation (resend) # # drivers/net/wireless/prism54/isl_ioctl.c # 2004/05/28 09:33:42-04:00 margitsw@t-online.de +1 -1 # prism54: Fix typo # # drivers/net/wireless/prism54/islpci_hotplug.c # 2004/05/28 09:49:41-04:00 margitsw@t-online.de +1 -1 # prism54: Fix channel stats, bump version to 1.2 (resend) # # drivers/net/wireless/prism54/islpci_eth.c # 2004/05/28 09:49:41-04:00 margitsw@t-online.de +3 -3 # prism54: Fix channel stats, bump version to 1.2 (resend) # # drivers/net/wireless/prism54/isl_ioctl.c # 2004/05/28 09:49:41-04:00 margitsw@t-online.de +2 -2 # prism54: Fix channel stats, bump version to 1.2 (resend) # # drivers/net/wireless/prism54/islpci_dev.c # 2004/06/05 08:11:34-04:00 margitsw@t-online.de +3 -1 # prism54: Reduce module verbosity (resend) # # drivers/net/wireless/prism54/islpci_eth.c # 2004/06/05 08:09:41-04:00 margitsw@t-online.de +1 -0 # prism54: Align skb patch (resend) # # drivers/net/wireless/prism54/islpci_dev.c # 2004/06/05 08:09:41-04:00 margitsw@t-online.de +1 -0 # prism54: Align skb patch (resend) # # drivers/net/wireless/prism54/islpci_mgt.h # 2004/05/28 09:33:42-04:00 margitsw@t-online.de +1 -1 # prism54: Add likely/unlikely, KO wds completely (resend) # # drivers/net/wireless/prism54/islpci_eth.c # 2004/05/28 09:33:42-04:00 margitsw@t-online.de +9 -8 # prism54: Add likely/unlikely, KO wds completely (resend) # # drivers/net/wireless/prism54/oid_mgt.c # 2004/06/05 08:03:15-04:00 margitsw@t-online.de +40 -21 # prism54: Don't allow mib reads while unconfigured (resend) # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/06/05 08:03:15-04:00 margitsw@t-online.de +5 -3 # prism54: Don't allow mib reads while unconfigured (resend) # # drivers/net/wireless/prism54/islpci_dev.c # 2004/06/05 08:03:15-04:00 margitsw@t-online.de +3 -1 # prism54: Don't allow mib reads while unconfigured (resend) # # drivers/net/wireless/prism54/isl_ioctl.h # 2004/06/05 08:03:15-04:00 margitsw@t-online.de +0 -1 # prism54: Don't allow mib reads while unconfigured (resend) # # drivers/net/wireless/prism54/isl_ioctl.c # 2004/06/05 08:03:15-04:00 margitsw@t-online.de +5 -31 # prism54: Don't allow mib reads while unconfigured (resend) # # drivers/net/wireless/prism54/oid_mgt.c # 2004/05/28 09:08:01-04:00 margitsw@t-online.de +2 -6 # prism54: Fix bug 77, strengthened oid txn (resend) # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/05/28 09:08:01-04:00 margitsw@t-online.de +35 -26 # prism54: Fix bug 77, strengthened oid txn (resend) # # drivers/net/wireless/prism54/isl_ioctl.c # 2004/05/28 09:08:01-04:00 margitsw@t-online.de +13 -76 # prism54: Fix bug 77, strengthened oid txn (resend) # # drivers/net/wireless/prism54/islpci_dev.c # 2004/06/05 07:57:11-04:00 margitsw@t-online.de +2 -2 # prism54: Fix bugs 39/73 (resend) # # drivers/net/wireless/prism54/oid_mgt.c # 2004/05/28 08:43:01-04:00 margitsw@t-online.de +2 -2 # prism54: Fix bugs 74/75 (resend) # # drivers/net/wireless/prism54/isl_ioctl.c # 2004/05/28 08:43:01-04:00 margitsw@t-online.de +1 -0 # prism54: Fix bugs 74/75 (resend) # # drivers/net/wireless/prism54/islpci_eth.c # 2004/05/28 08:25:30-04:00 margitsw@t-online.de +16 -16 # prism54: Fix endian patch (resend) # # drivers/net/wireless/prism54/prismcompat.h # 2004/06/05 07:45:32-04:00 margitsw@t-online.de +46 -0 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/prismcompat.h # 2004/06/05 07:45:32-04:00 margitsw@t-online.de +0 -0 # BitKeeper file /spare/repo/netdev-2.6/prism54/drivers/net/wireless/prism54/prismcompat.h # # drivers/net/wireless/prism54/oid_mgt.c # 2004/06/05 07:44:14-04:00 margitsw@t-online.de +1 -0 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/islpci_mgt.h # 2004/06/05 07:44:14-04:00 margitsw@t-online.de +0 -9 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/islpci_mgt.c # 2004/06/05 07:44:14-04:00 margitsw@t-online.de +1 -15 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/islpci_hotplug.c # 2004/06/05 07:44:14-04:00 margitsw@t-online.de +1 -0 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/islpci_eth.c # 2004/06/05 07:44:14-04:00 margitsw@t-online.de +1 -0 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/islpci_dev.h # 2004/06/05 07:44:14-04:00 margitsw@t-online.de +0 -20 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/islpci_dev.c # 2004/06/05 07:45:32-04:00 margitsw@t-online.de +121 -27 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/isl_ioctl.c # 2004/06/05 07:44:14-04:00 margitsw@t-online.de +1 -1 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/isl_38xx.h # 2004/06/05 07:45:32-04:00 margitsw@t-online.de +0 -10 # prism54: Kernel compatibility (resend) # # drivers/net/wireless/prism54/isl_38xx.c # 2004/06/05 07:45:32-04:00 margitsw@t-online.de +2 -132 # prism54: Kernel compatibility (resend) # # drivers/net/tulip/Kconfig # 2004/06/04 11:16:07-04:00 bunk@fs.tum.de +11 -4 # add NAPI help texts # # drivers/net/Kconfig # 2004/06/04 11:18:14-04:00 bunk@fs.tum.de +70 -0 # add NAPI help texts # # drivers/net/arm/smc91x.h # 2004/05/29 08:04:43-04:00 rmk@arm.linux.org.uk +829 -0 # Re: smc91x driver # # drivers/net/arm/smc91x.c # 2004/05/29 07:57:20-04:00 rmk@arm.linux.org.uk +2171 -0 # Re: smc91x driver # # drivers/net/arm/smc91x.h # 2004/05/29 08:04:43-04:00 rmk@arm.linux.org.uk +0 -0 # BitKeeper file /spare/repo/netdev-2.6/misc/drivers/net/arm/smc91x.h # # drivers/net/arm/smc91x.c # 2004/05/29 07:57:20-04:00 rmk@arm.linux.org.uk +0 -0 # BitKeeper file /spare/repo/netdev-2.6/misc/drivers/net/arm/smc91x.c # # drivers/net/arm/Makefile # 2003/07/06 11:12:19-04:00 rmk@arm.linux.org.uk +1 -0 # Re: smc91x driver # # drivers/net/arm/Kconfig # 2003/09/28 11:03:12-04:00 rmk@arm.linux.org.uk +17 -0 # Re: smc91x driver # # drivers/net/fealnx.c # 2004/04/23 01:29:23-04:00 akpm@osdl.org +5 -0 # fealnx-mac-address-and-other-issues.patch # # ChangeSet # 2004/06/10 16:34:14-07:00 kenneth.w.chen@intel.com # [PATCH] ia64: fix race in fsys_bubble_down to avoid fp-register corruption # # The fast system-call fall-back-path has a race: it reads PSR, modifies # some bits, then writes back the new PSR. Unfortunately, the contents # of PSR may change between reading and writing it. For example, an # interrupt could occur which could trigger a context-switch. The # context-switch might in turn flush the floating-point-high (FPH) # partition to memory, clear PSR.MFH, and set PSR.DFH. To prevent this # race, the patch below turns off PSR.I before reading PSR. # # This fixes a floating-point corruption problem that was observed on a # system with a libc which has the fast system-call support enabled. # # The performance impact is minimal (on the order of a handful of cycles). # # Signed-off-by: Kevin Tian # Signed-off-by: Ken Chen # Signed-off-by: Asit Mallick # Signed-off-by: David Mosberger # # arch/ia64/kernel/gate.S # 2004/06/09 05:36:21-07:00 kenneth.w.chen@intel.com +4 -2 # ia64: fix race in fsys_bubble_down # # arch/ia64/kernel/fsys.S # 2004/06/09 05:11:54-07:00 kenneth.w.chen@intel.com +2 -1 # ia64: fix race in fsys_bubble_down # # ChangeSet # 2004/06/10 13:25:26-07:00 Robert.Picco@hp.com # [PATCH] ia64: mark non-existent NUMA-nodes as offline # # I found a problem with HP NUMA configuration in 2.6.7-rc3-mm1. The # node_online_map is incorrect because of actions taken by # reassign_cpu_only_nodes in arch/ia64/mm/discontig.c. The mm1 patch # which changes the mempolicy for the init_task uses this invalid # node_online_map and eventually uses a non-existent node's zonelist # when calling __alloc_pages. # # The patch below takes care of this issue. It puts the non-existent # nodes offline. # # Signed-off-by: David Mosberger # # arch/ia64/mm/discontig.c # 2004/06/09 15:44:02-07:00 Robert.Picco@hp.com +3 -0 # ia64: mark non-existent NUMA-nodes as offline # # ChangeSet # 2004/06/10 12:52:02-07:00 greg@kroah.com # I2C: sparse cleanups for drivers/i2c/* # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/i2c-dev.c # 2004/06/10 05:51:18-07:00 greg@kroah.com +3 -4 # I2C: sparse cleanups for drivers/i2c/* # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/it87.c # 2004/06/10 05:51:18-07:00 greg@kroah.com +4 -1 # I2C: sparse cleanups for drivers/i2c/* # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/10 12:09:46-07:00 greg@kroah.com # USB: fix up dumb int_user_arg variable name as pointed out by Al Viro. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/misc/auerswald.c # 2004/06/10 05:08:46-07:00 greg@kroah.com +7 -7 # USB: fix up dumb int_user_arg variable name as pointed out by Al Viro. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/input/hiddev.c # 2004/06/10 05:08:46-07:00 greg@kroah.com +4 -5 # USB: fix up dumb int_user_arg variable name as pointed out by Al Viro. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/class/audio.c # 2004/06/10 05:08:46-07:00 greg@kroah.com +32 -32 # USB: fix up dumb int_user_arg variable name as pointed out by Al Viro. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/10 11:40:08-07:00 greg@kroah.com # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/whiteheat.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +3 -2 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/kobil_sct.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +5 -4 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/kl5kusb105.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +7 -8 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/io_ti.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +3 -3 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/io_edgeport.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +7 -8 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/ftdi_sio.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +6 -6 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/net/rtl8150.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +15 -15 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/misc/legousbtower.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +4 -4 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/misc/auerswald.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +8 -6 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/w9968cf.h # 2004/06/10 04:39:09-07:00 greg@kroah.com +1 -1 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/w9968cf.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +24 -23 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/vicam.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +14 -18 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/usbvideo.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +2 -2 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/stv680.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +1 -1 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/se401.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +1 -1 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/pwc-if.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +2 -2 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/ov511.h # 2004/06/10 04:39:09-07:00 greg@kroah.com +1 -1 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/ov511.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +1 -1 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/dabusb.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +5 -5 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/input/hiddev.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +26 -24 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/input/hid-core.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +3 -1 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/image/mdc800.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +3 -3 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/class/audio.c # 2004/06/10 04:39:09-07:00 greg@kroah.com +36 -30 # USB: sparse cleanups for the whole driver/usb/* tree. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/10 09:48:09-07:00 rtjohnso@eecs.berkeley.edu # [PATCH] PATCH: 2.6.7-rc3 drivers/usb/core/devio.c: user/kernel pointer bugs # # Since ctrl is copied in from userspace, ctrl.data cannot safely be # dereferenced. Let me know if you have any questions or if I've made # a mistake. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/devio.c # 2004/06/09 05:49:50-07:00 rtjohnso@eecs.berkeley.edu +2 -2 # PATCH: 2.6.7-rc3 drivers/usb/core/devio.c: user/kernel pointer bugs # # ChangeSet # 2004/06/10 09:36:26-07:00 greg@kroah.com # Driver Core: more whitespace fixups # # This catches the files I had to do by hand as Dmitry's patch differed from my tree. # # Signed-off-by: Dmitry Torokhov # Signed-off-by: Greg Kroah-Hartman # # drivers/base/bus.c # 2004/06/10 02:35:56-07:00 greg@kroah.com +64 -65 # Driver Core: more whitespace fixups # # This catches the files I had to do by hand as Dmitry's patch differed from my tree. # # Signed-off-by: Dmitry Torokhov # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/10 09:34:27-07:00 dtor_core@ameritech.net # [PATCH] Driver Core: Whitespace fixes # # Whitespace and formatting changes (a,b,c -> a, b, c) in drivers/base # # Signed-off-by: Dmitry Torokhov # Signed-off-by: Greg Kroah-Hartman # # drivers/base/sys.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +51 -51 # Driver Core: Whitespace fixes # # drivers/base/power/sysfs.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +9 -9 # Driver Core: Whitespace fixes # # drivers/base/power/suspend.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +21 -21 # Driver Core: Whitespace fixes # # drivers/base/power/shutdown.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +9 -9 # Driver Core: Whitespace fixes # # drivers/base/power/runtime.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +4 -4 # Driver Core: Whitespace fixes # # drivers/base/power/resume.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +6 -6 # Driver Core: Whitespace fixes # # drivers/base/power/power.h # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +4 -4 # Driver Core: Whitespace fixes # # drivers/base/power/main.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +7 -7 # Driver Core: Whitespace fixes # # drivers/base/platform.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +9 -9 # Driver Core: Whitespace fixes # # drivers/base/node.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +7 -7 # Driver Core: Whitespace fixes # # drivers/base/interface.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +9 -9 # Driver Core: Whitespace fixes # # drivers/base/init.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +2 -2 # Driver Core: Whitespace fixes # # drivers/base/firmware_class.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +5 -5 # Driver Core: Whitespace fixes # # drivers/base/firmware.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +3 -3 # Driver Core: Whitespace fixes # # drivers/base/driver.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +8 -8 # Driver Core: Whitespace fixes # # drivers/base/core.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +23 -23 # Driver Core: Whitespace fixes # # drivers/base/class_simple.c # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +6 -6 # Driver Core: Whitespace fixes # # drivers/base/base.h # 2004/06/09 23:34:24-07:00 dtor_core@ameritech.net +3 -2 # Driver Core: Whitespace fixes # # ChangeSet # 2004/06/10 09:25:58-07:00 dtor_core@ameritech.net # [PATCH] Driver Core: Suppress platform device suffixes # # Do not add numeric suffix to platform device name if device id is set to # -1. This can be used when there can be only one instance of a device # (like i8042). # # Signed-off-by: Dmitry Torokhov # Signed-off-by: Greg Kroah-Hartman # # drivers/base/platform.c # 2004/06/09 23:33:27-07:00 dtor_core@ameritech.net +4 -1 # Driver Core: Suppress platform device suffixes # # ChangeSet # 2004/06/09 11:14:30-07:00 greg@kroah.com # USB: crap, I misapplied a patch with the wrong level # # This gets rid of usb/host and puts the file in the proper drivers/usb/host # directory. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/host/ohci-lh7a404.c # 2004/06/09 04:12:00-07:00 greg@kroah.com +0 -0 # USB: crap, I misapplied a patch with the wrong level # # This gets rid of usb/host and puts the file in the proper drivers/usb/host # directory. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/09 11:10:52-07:00 stern@rowland.harvard.edu # [PATCH] USB: Update root-hub code for the ohci-lh7a404 driver # # On Wed, 9 Jun 2004, David Brownell wrote: # # > Needs an update for ohci-lh7a404.c too ... # # I didn't even know this driver existed! Where did usb/host/* come from? # # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # usb/host/ohci-lh7a404.c # 2004/06/09 06:09:47-07:00 stern@rowland.harvard.edu +1 -3 # USB: Update root-hub code for the ohci-lh7a404 driver # # ChangeSet # 2004/06/09 11:10:09-07:00 stern@rowland.harvard.edu # [PATCH] USB: Minor tidying up of hub driver # # After my last few changesets there were a few small items that needed to # be tidied up. # # Update kerneldoc to reflect the actual operation of # usb_disconnect() and usb_new_device(). The new locking # requirements are listed too, though they aren't all # implemented yet. # # Fulfill the new locking requirement in hcd_panic(). # # Remove unneeded local variables to conserve stack space in # usb_disconnect(), which calls itself recursively. # # In hub_port_connect_change(), store the parent's children[] # pointer as late as possible and don't lock the new device until # then (that's when it becomes globally accessible). This will # minimize the time that the not-fully-configured device structure # is visible to other parts of the kernel. # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/09 05:20:00-07:00 stern@rowland.harvard.edu +25 -23 # USB: Minor tidying up of hub driver # # drivers/usb/core/hcd.c # 2004/06/09 05:03:06-07:00 stern@rowland.harvard.edu +2 -0 # USB: Minor tidying up of hub driver # # ChangeSet # 2004/06/09 11:09:31-07:00 stern@rowland.harvard.edu # [PATCH] USB: Fix bus-list root-hub race # # There are a few places where the code enumerates through all the USB # devices on all the buses, starting with each bus's root hub and working # down. However a bus does not always have a root hub, and the code does # not check that the root_hub pointer is non-NULL. This patch fixes the # problem, using the usb_bus_list_lock semaphore to synchronize access when # root hubs are added or removed. # # In addition it seemed like a good idea to minimize the time that a # non-fully-configured root hub is accessible through the bus's pointer. So # this patch delays setting the pointer and holds usb_bus_list_lock while # configuring a root hub. # # It turned out that a bunch of things needed to be changed for all this to # work: # # Check for NULL root_hub pointer in usb_device_read() and # usb_find_device(). # # Pass the root-hub device as a separate argument to # hcd_register_root(). # # Make usb_register_root_hub() acquire the usb_bus_list_lock and # set the bus->root_hub pointer. # # For consistency's sake, move the place where the children[] # pointer to a non-root-hub device gets stored as close as possible # to where usb_new_device() is called. # # Make usb_disconnect() acquire the usb_bus_list_lock when removing # a root hub. # # Change usb_hcd_pci_remove() and the non-PCI host drivers so that # they call usb_disconnect() with a pointer to the bus's root_hub # pointer, not a pointer to a temporary variable. # # Change all the host controller drivers not to store the root_hub # pointer in the bus structure but instead to pass it as a new # argument to hcd_register_root(). # # I made some attempt to update the hc_sl811 driver along with the rest, but # it's pretty clear that driver won't work in the current framework. Among # other things, it never reads the root hub's device descriptor. To what # extent is the driver really supported? # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/host/uhci-hcd.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +2 -3 # USB: Fix bus-list root-hub race # # drivers/usb/host/ohci-sa1111.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +1 -3 # USB: Fix bus-list root-hub race # # drivers/usb/host/ohci-omap.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +1 -3 # USB: Fix bus-list root-hub race # # drivers/usb/host/ohci-hcd.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +2 -3 # USB: Fix bus-list root-hub race # # drivers/usb/host/hc_sl811_rh.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +8 -2 # USB: Fix bus-list root-hub race # # drivers/usb/host/ehci-hcd.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +2 -3 # USB: Fix bus-list root-hub race # # drivers/usb/gadget/dummy_hcd.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +2 -3 # USB: Fix bus-list root-hub race # # drivers/usb/core/usb.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +2 -0 # USB: Fix bus-list root-hub race # # drivers/usb/core/hub.c # 2004/06/09 04:45:43-07:00 stern@rowland.harvard.edu +16 -7 # USB: Fix bus-list root-hub race # # drivers/usb/core/hcd.h # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +3 -3 # USB: Fix bus-list root-hub race # # drivers/usb/core/hcd.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +10 -3 # USB: Fix bus-list root-hub race # # drivers/usb/core/hcd-pci.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +1 -3 # USB: Fix bus-list root-hub race # # drivers/usb/core/devices.c # 2004/06/09 04:40:49-07:00 stern@rowland.harvard.edu +2 -0 # USB: Fix bus-list root-hub race # # ChangeSet # 2004/06/09 11:08:58-07:00 oliver@neukum.org # [PATCH] USB: add printer reset ioctl # # - add soft reset ioctl # # Signed-off-by: Oliver Neukum # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/class/usblp.c # 2004/06/09 10:05:10-07:00 oliver@neukum.org +10 -0 # USB: add printer reset ioctl # # ChangeSet # 2004/06/09 10:34:09-07:00 akpm@osdl.org # [PATCH] I2C: w83627hf.c build fix # # with gcc-2.95: # # drivers/i2c/chips/w83627hf.c:482: parse error before `static' # drivers/i2c/chips/w83627hf.c:502: parse error before `static' # drivers/i2c/chips/w83627hf.c: In function `show_regs_fan_1': # drivers/i2c/chips/w83627hf.c:541: warning: implicit declaration of function `show_fan' # drivers/i2c/chips/w83627hf.c: In function `w83627hf_detect': # drivers/i2c/chips/w83627hf.c:1074: `dev_attr_in0_min' undeclared (first use in this function) # drivers/i2c/chips/w83627hf.c:1074: (Each undeclared identifier is reported only once # drivers/i2c/chips/w83627hf.c:1074: for each function it appears in.) # drivers/i2c/chips/w83627hf.c: At top level: # drivers/i2c/chips/w83627hf.c:428: warning: `show_regs_in_min0' defined but not used # drivers/i2c/chips/w83627hf.c:441: warning: `store_regs_in_min0' defined but not used # # Signed-off-by: Andrew Morton # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/w83627hf.c # 2004/06/08 23:10:38-07:00 akpm@osdl.org +3 -3 # I2C: w83627hf.c build fix # # ChangeSet # 2004/06/09 10:19:23-07:00 greg@kroah.com # merge i2c-2.6 into driver-2.6 trees due to problems people reported. # # drivers/i2c/chips/w83627hf.c # 2004/06/09 10:19:12-07:00 greg@kroah.com +0 -1 # merge i2c-2.6 into driver-2.6 trees due to problems people reported. # # drivers/scsi/scsi_debug.c # 2004/06/09 10:11:48-07:00 greg@kroah.com +0 -0 # Auto merged # # drivers/i2c/chips/it87.c # 2004/06/09 10:11:48-07:00 greg@kroah.com +0 -0 # Auto merged # # MAINTAINERS # 2004/06/09 10:11:47-07:00 greg@kroah.com +0 -0 # Auto merged # # ChangeSet # 2004/06/08 22:45:12-07:00 greg@kroah.com # cpuid: fix hotplug cpu remove bug for class device. # # Signed-off-by: Greg Kroah-Hartman # # arch/i386/kernel/cpuid.c # 2004/06/08 22:44:49-07:00 greg@kroah.com +12 -14 # cpuid: fix hotplug cpu remove bug for class device. # # Signed-off-by: Greg Kroah-Hartman # # drivers/base/platform.c # 2004/06/08 16:46:21-07:00 rmk@arm.linux.org.uk +86 -0 # Add platform_get_resource() # # ChangeSet # 2004/06/08 16:28:02-07:00 rmk@arm.linux.org.uk # [PATCH] Add platform_get_resource() # # This patch adds management of platform device resources to the # device model, allowing drivers to lookup resources, IRQs and DMA # numbers in the platform device resource array. We also add a # couple of functions which allow platform devices and their resources # to be registered. # # Signed-off-by: Russell King # Signed-off-by: Greg Kroah-Hartman # # include/linux/device.h # 2004/05/28 12:29:34-07:00 rmk@arm.linux.org.uk +5 -0 # Add platform_get_resource() # # ChangeSet # 2004/06/08 16:26:12-07:00 hannal@us.ibm.com # [PATCH] Add cpu hotplug support to cpuid.c # # Here is the patch that uses a cpu hotplug callback, to allow dynamic support # of cpu id for classes in sysfs. # # This patch applies on top of the one I sent out earlier that Greg included. # I do not have access to hardware that supports cpu hotswapping (virtually or not) # so have not been able to test that aspect of the patch. However, the original # functionality of listing static cpu's still works. # # Please consider for testing or inclusion. # # Signed-off-by: Hanna Linder # Signed-off-by: Greg Kroah-Hartman # # arch/i386/kernel/cpuid.c # 2004/06/08 14:31:22-07:00 hannal@us.ibm.com +48 -11 # Add cpu hotplug support to cpuid.c # # ChangeSet # 2004/06/08 16:10:24-07:00 stern@rowland.harvard.edu # [PATCH] USB: Initialize endpoint autoconfig in g_file_storage # # This one-line patch corrects a simple problem in the g_file_storage # driver. It neglected to initialize the endpoint-autoconfiguration library # before using it. Please apply. # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/file_storage.c # 2004/06/08 04:03:07-07:00 stern@rowland.harvard.edu +1 -0 # USB: Initialize endpoint autoconfig in g_file_storage # # ChangeSet # 2004/06/08 16:09:55-07:00 david-b@pacbell.net # [PATCH] lh7a404 USB host against 2.6.7-rc2 # # Support for the Sharp LH7A404 OHCI, another non-PCI implementation. # This uses a platform_device and a workaround for a register read # problem. # # Signed-off-by: Marc Singer # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # usb/host/ohci-lh7a404.c # 2004/06/07 16:24:04-07:00 david-b@pacbell.net +387 -0 # lh7a404 USB host against 2.6.7-rc2 # # drivers/usb/Kconfig # 2004/06/07 09:24:04-07:00 david-b@pacbell.net +1 -1 # lh7a404 USB host against 2.6.7-rc2 # # usb/host/ohci-lh7a404.c # 2004/06/07 16:24:04-07:00 david-b@pacbell.net +0 -0 # BitKeeper file /home/greg/linux/BK/usb-2.6/usb/host/ohci-lh7a404.c # # drivers/usb/host/ohci.h # 2004/06/07 09:24:04-07:00 david-b@pacbell.net +19 -0 # lh7a404 USB host against 2.6.7-rc2 # # drivers/usb/host/ohci-q.c # 2004/06/07 09:24:04-07:00 david-b@pacbell.net +3 -3 # lh7a404 USB host against 2.6.7-rc2 # # drivers/usb/host/ohci-hub.c # 2004/06/07 09:33:47-07:00 david-b@pacbell.net +21 -21 # lh7a404 USB host against 2.6.7-rc2 # # drivers/usb/host/ohci-hcd.c # 2004/06/07 09:24:04-07:00 david-b@pacbell.net +26 -16 # lh7a404 USB host against 2.6.7-rc2 # # drivers/usb/host/ohci-dbg.c # 2004/06/07 09:24:04-07:00 david-b@pacbell.net +15 -15 # lh7a404 USB host against 2.6.7-rc2 # # ChangeSet # 2004/06/08 16:09:24-07:00 david-b@pacbell.net # [PATCH] USB: rndis (3/4) Big Endian support for gadget RNDIS # # Add byteswapping. Original version partially worked on PPC with Net2280, # this version applies to the latest RNDIS code but hasn't been retested on # big-endian. Ping should be working in at least one one direction. # # Also added a handful of other things from my BK: track suspend/resume # (to eventually implement wake-on-lan), give a better rndis error # message, and add missing declarations for PM-related OIDs (usage is # #ifdeffed out by previous patch). # # From: Jon Neal # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/rndis.c # 2004/06/07 11:30:16-07:00 david-b@pacbell.net +199 -163 # USB: rndis (3/4) Big Endian support for gadget RNDIS # # drivers/usb/gadget/ndis.h # 2004/06/07 11:30:16-07:00 david-b@pacbell.net +30 -0 # USB: rndis (3/4) Big Endian support for gadget RNDIS # # drivers/usb/gadget/ether.c # 2004/06/07 11:32:18-07:00 david-b@pacbell.net +28 -2 # USB: rndis (3/4) Big Endian support for gadget RNDIS # # ChangeSet # 2004/06/08 16:08:52-07:00 david-b@pacbell.net # [PATCH] USB: usb suspend/resume work better on net2280 # # This makes net2280 behave more correctly with respect to # usb suspend and resume processing. # # So for example gadget zero autoresume testing works. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/net2280.c # 2004/06/07 07:31:53-07:00 david-b@pacbell.net +17 -8 # USB: usb suspend/resume work better on net2280 # # ChangeSet # 2004/06/08 16:08:19-07:00 david-b@pacbell.net # [PATCH] USB: usb root hubs can set power budgets # # This adds hub_set_power_budget(), mostly so that HCDs for low # powered ports (cell phone, PDA, etc) can more easily report their # true power budgets. It's not always 500mA per root hub port; this # makes dummy_hcd report the minimum, 8mA. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/dummy_hcd.c # 2004/06/07 07:31:53-07:00 david-b@pacbell.net +3 -0 # USB: usb root hubs can set power budgets # # drivers/usb/core/hub.h # 2004/06/07 07:31:53-07:00 david-b@pacbell.net +11 -0 # USB: usb root hubs can set power budgets # # ChangeSet # 2004/06/08 14:36:23-07:00 jmunsin@iki.fi # [PATCH] I2C: drivers/i2c/chips/it87.c cleanup patch # # Attached is a cleanup patch for the it87 sensor driver, against # 2.6.7-rc2. Jean Delvare has reviewed it. # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/it87.c # 2004/06/08 13:33:09-07:00 jmunsin@iki.fi +22 -26 # I2C: drivers/i2c/chips/it87.c cleanup patch # # ChangeSet # 2004/06/08 14:31:15-07:00 mhoffman@lightlink.com # [PATCH] I2C: add alternate VCORE calculations for w83627thf and w83637hf # # This patch adds support for the alternate in0/VCORE calculation which is # available for 2 of 4 chips this driver supports. It also fixes a minor # bug in the standard voltage input calculation. # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/w83627hf.c # 2004/06/05 19:02:59-07:00 mhoffman@lightlink.com +91 -3 # I2C: add alternate VCORE calculations for w83627thf and w83637hf # # ChangeSet # 2004/06/08 14:12:40-07:00 greg@kroah.com # Merge kroah.com:/home/greg/linux/BK/bleed-2.6 # into kroah.com:/home/greg/linux/BK/usb-2.6 # # include/linux/usb.h # 2004/06/08 14:12:36-07:00 greg@kroah.com +0 -1 # Auto merged # # drivers/usb/serial/cyberjack.c # 2004/06/08 14:12:36-07:00 greg@kroah.com +0 -6 # Auto merged # # drivers/usb/media/pwc-if.c # 2004/06/08 14:12:36-07:00 greg@kroah.com +0 -1 # Auto merged # # drivers/usb/media/Kconfig # 2004/06/08 14:12:35-07:00 greg@kroah.com +0 -1 # Auto merged # # drivers/usb/core/devio.c # 2004/06/08 14:12:35-07:00 greg@kroah.com +0 -1 # Auto merged # # ChangeSet # 2004/06/07 21:38:30-07:00 kaos@sgi.com # [PATCH] ia64: Rename SN "modules" variable to "sn_modules". # # SN code has a "modules" variable that conflicts with a variable of the # same name in kernel/module.c. This conflict breaks lcrash for ia64. # Rename "modules" to "sn_modules". # # Signed-off-by: Keith Owens # Signed-off-by: David Mosberger # # include/asm-ia64/sn/module.h # 2004/06/07 08:45:42-07:00 kaos@sgi.com +1 -1 # ia64: Rename modules to sn_modules # # arch/ia64/sn/io/sn2/module.c # 2004/06/07 08:45:32-07:00 kaos@sgi.com +7 -7 # ia64: Rename modules to sn_modules # # arch/ia64/sn/io/sn2/klgraph.c # 2004/06/07 08:49:25-07:00 kaos@sgi.com +2 -2 # ia64: Rename modules to sn_modules # # arch/ia64/sn/io/machvec/pci_bus_cvlink.c # 2004/06/07 08:45:20-07:00 kaos@sgi.com +2 -2 # ia64: Rename modules to sn_modules # # ChangeSet # 2004/06/07 17:01:22-07:00 david-b@pacbell.net # [PATCH] USB: rndis (4/4) start documenting spec variances # # This partially reverts one of the changes in an earlier patch, # starting to document where Microsoft's spec is lying. Needed # to interop with Windows ME. # # # The Windows ME implementation of RNDIS relies on a message that # Microsoft's specification says isn't used. Restore this (removed # in earlier cleanup), and start collecting comments specifically # on where MSFT violates its own specifications. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/rndis.c # 2004/06/07 07:04:50-07:00 david-b@pacbell.net +17 -0 # USB: rndis (4/4) start documenting spec variances # # ChangeSet # 2004/06/07 16:58:23-07:00 david-b@pacbell.net # [PATCH] USB: rndis (2/4) fix memory leaks # # Tao Huang wrote: # > I'm writing udc driver for S3C2410. I found RNDIS almost not call my # > driver's free_request and free_buffer. So after run my driver about 3 # > hours the system will out of memory. # > # > This patch will fix the memory leak. # > # > There will still have memory leak when driver unload, but I don't known # > where is the proper place to fix it. # > 1) rndis.c should free resp_queue when it unload # > 2) ether.c should free tx_reqs and rx_reqs when it unload (as # > eth_reset_config) # # Thanks ... this is a nice patch to have. # # # From: Tao Huang # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/ether.c # 2004/06/06 06:34:51-07:00 david-b@pacbell.net +13 -5 # USB: rndis (2/4) fix memory leaks # # ChangeSet # 2004/06/07 16:57:06-07:00 david-b@pacbell.net # [PATCH] USB: rndis (1/4) update OID support # # NDIS devices have a generic attribute get/set API where the attributes # are identified by 32 bit "OIDs". This fixes some problems with the OIDs # supported by the original RNDIS patch: # # - It included OIDs not found in the RNDIS spec. These have been # removed. As a rule, these weren't exported in the "OIDs I support" # list, and only a couple wouldn't fail those accesses, so this mostly # changes what debug printk appears. # # - OIDs used for optional 802.3 statistics were partially supported. # They're all in the OID list now, but the support is #ifdeffed out. # (Those statistics were mostly just made up, anyway!) # # - "Required" OIDs for suspend, resume, and wakeup support weren't # listed. Their messages are now defined, but support is #ifdeffed # out. Seems the docs aren't entirely accurate, and Windows can # behave reasonably without them. (This area needs help from someone # who knows MS-Windows power management.) # # There are also a few minor cleanups, more reasonable default volume level # for debug messages (never at KERN_INFO, keepalives only if VERBOSE), and # dumping of all bytes of some undocumented messages Windows XP has been # seen emitting shortly before the host suspended itself. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/rndis.h # 2004/06/06 06:06:42-07:00 david-b@pacbell.net +37 -4 # USB: rndis (1/4) update OID support # # drivers/usb/gadget/rndis.c # 2004/06/06 06:06:42-07:00 david-b@pacbell.net +162 -166 # USB: rndis (1/4) update OID support # # ChangeSet # 2004/06/07 16:55:44-07:00 stern@rowland.harvard.edu # [PATCH] USB: unusual_devs.h update # # Given the problems that Dan Scholnik has reported, we should combine the # unusual_devs.h entries for the Casio QV cameras into one. The new # NEED_OVERRIDE flag will prevent complaints about unnecessary overrides, # and Dan says the same subclass and protocol values should work for all the # cameras. If they don't we'll hear about it soon enough! # # # On Tue, 1 Jun 2004, Dan Scholnik wrote: # > On Tue, 2004-06-01 at 14:14, Alan Stern wrote: # > > On Tue, 1 Jun 2004, Dan Scholnik wrote: # > > # > > > Up until the 2.6 kernels, there was one entry for all the QV cameras # > > > with both US_SC_8070 and US_PR_CB that I think seemed to work fine for # > > > everyone. As far as I know the only problem was all the folks emailing # > > > the log entry stating that the Casio entry wasn't needed. So, you could # > > > revert back to that, or revert back to the 2.6.3ish version (pre-as190) # > > > that had the overrides just for product IDs 1001-9009. I'm not really # > > > an expert on Casio's cameras, I'm afraid, just the one model I own which # > > > is 4-5 years old now. # > > > # > > > I'll be happy to prepare a patch any way you choose to go. # > > # > > How does this work for you? # > > # > > Alan Stern # > # > Works fine for me; that's I think exactly how it was from the beginning # > until 2.6 and the later 2.4 kernels when all the changes were made. # > Just cross your fingers that it doesn't somehow break newer Casios, as # > it would seem every camera they ever made falls under that entry. # # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/unusual_devs.h # 2004/06/01 05:46:58-07:00 stern@rowland.harvard.edu +3 -9 # USB: unusual_devs.h update # # ChangeSet # 2004/06/07 16:55:17-07:00 stern@rowland.harvard.edu # [PATCH] USB: Fix resource leakage in the hub driver # # The hub driver is very careless about returning resources when an error # occurs while installing a new device. This patch attempts to put some # order back into the situation. Details: # # Since usb_new_device() allocates neither the device structure # nor the device address, it shouldn't release either one. # # Because usb_new_device() no longer releases the device structure, # usb_register_root_hub() doesn't need to take an extra reference # to it. # # Since the device address selection and TT setup code is used # only for new devices, not ones being reset, move that code from # hub_port_init() to hub_port_connect_change(). By the same token, # hub_port_init() doesn't have to release the device address or # the device structure. # # Just to make things look better, move the failure code in # hub_port_init() to the end of the routine. And when disabling # endpoint 0, disable both the IN and OUT parts of the endpoint. # # In hub_port_connect_change(), make all the failure paths # execute the same code so that resources are always released. # These resources comprise: the pointer from the parent to the # new child device, the HCD state for ep0, the device's address, # and the device structure itself -- in short, everything that's # set up before calling usb_new_device(). # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/07 10:08:06-07:00 stern@rowland.harvard.edu +45 -50 # USB: Fix resource leakage in the hub driver # # drivers/usb/core/hcd.c # 2004/06/07 09:55:49-07:00 stern@rowland.harvard.edu +1 -3 # USB: Fix resource leakage in the hub driver # # ChangeSet # 2004/06/07 16:54:49-07:00 stern@rowland.harvard.edu # [PATCH] USB: Check port reset return code # # This patch adds checking for the SET-FEATURE request that actually does a # port reset. Without the check, the hub driver just assumes that the port # reset command actually was transferred okay. # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/07 08:20:11-07:00 stern@rowland.harvard.edu +6 -2 # USB: Check port reset return code # # ChangeSet # 2004/06/07 16:34:04-07:00 baldrick@free.fr # [PATCH] USB devio.c: deadlock fix # # proc_resetdevice is called with dev->serialize held. # usb_reset_device takes dev->serialize and then calls # __usb_reset_device. To avoid deadlock, proc_resetdevice # should call __usb_reset_device directly. # # Signed-off-by: Duncan Sands # Signed-off-by: Greg Kroah-Hartman # # include/linux/usb.h # 2004/06/07 01:39:20-07:00 baldrick@free.fr +1 -0 # USB devio.c: deadlock fix # # drivers/usb/core/devio.c # 2004/06/07 01:39:20-07:00 baldrick@free.fr +1 -1 # USB devio.c: deadlock fix # # ChangeSet # 2004/06/07 14:39:16-07:00 arun.sharma@intel.com # [PATCH] ia64: fix ia32 virtual memory leaks due to partial-page mappings # # Certain IA-32 applications which do mmap/munmaps which are not # PAGE_SIZE aligned could see temporary (recovered at process exit time) # memory leaks, because the kernel didn't have enough data to decide if # the complete page could be unmapped. This patch adds a new data # structure called the "partial page list" which helps the kernel keep # track of precisely which 4k pages are in use by the IA-32 application. # # Armed with this data, the kernel can make better decisions at munmap # and mprotect time. No significant performance degradation was observed # in the workloads we tested and in some cases, the performance actually # improved! This is possibly due to the reduced length of the vma list. # # Signed-off-by: Arun Sharma # Signed-off-by: Gordon Jin # Signed-off-by: David Mosberger # # include/asm-ia64/processor.h # 2004/06/04 18:14:13-07:00 arun.sharma@intel.com +4 -1 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # include/asm-ia64/ia32.h # 2004/06/04 18:15:32-07:00 arun.sharma@intel.com +2 -0 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # arch/ia64/kernel/process.c # 2004/06/04 04:59:05-07:00 arun.sharma@intel.com +12 -0 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # arch/ia64/ia32/sys_ia32.c # 2004/06/04 06:31:39-07:00 arun.sharma@intel.com +524 -5 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # arch/ia64/ia32/ia32priv.h # 2004/06/04 03:42:27-07:00 arun.sharma@intel.com +25 -0 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # arch/ia64/ia32/ia32_support.c # 2004/06/04 02:57:01-07:00 arun.sharma@intel.com +8 -0 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # arch/ia64/ia32/ia32_entry.S # 2004/06/04 02:57:01-07:00 arun.sharma@intel.com +1 -1 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # arch/ia64/ia32/binfmt_elf32.c # 2004/06/04 02:57:01-07:00 arun.sharma@intel.com +4 -0 # ia64: fix virtual memory leaks in ia32 emulator due to partial-page mappings # # ChangeSet # 2004/06/07 13:00:07-07:00 stern@rowland.harvard.edu # [PATCH] USB: Fix logic in usb_get_descriptor() # # This patch fixes a simple logic error in usb_get_descriptor(). It also # takes the opportunity to make the subroutine a little easier to read. # Please apply. # # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/message.c # 2004/06/06 09:43:22-07:00 stern@rowland.harvard.edu +7 -7 # USB: Fix logic in usb_get_descriptor() # # ChangeSet # 2004/06/07 12:59:41-07:00 kaie@kuix.de # [PATCH] USB: enable pwc usb camera driver # # The attached patch enables the pwc driver included with kernel 2.6.7-rc2 # # It also removes the warnings during compilation. # However, note that I blindly duplicated the release approach used by # other usb camera drivers, replacing the current no-op. # # The driver works for me with a Logitech QuickCam Notebook Pro and # GnomeMeeting. # # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/media/pwc-if.c # 2004/06/07 02:42:50-07:00 kaie@kuix.de +1 -8 # USB: enable pwc usb camera driver # # drivers/usb/media/Kconfig # 2004/06/07 02:27:03-07:00 kaie@kuix.de +1 -1 # USB: enable pwc usb camera driver # # ChangeSet # 2004/06/07 12:59:12-07:00 mdharm-usb@one-eyed-alien.net # [PATCH] USB Storage: GetMaxLUN tightening # # This patch started life from Alan Stern as as274, and has been heavily # modified. It narrows the case where a clear_halt() is issued after a # failed GetMaxLUN command to only a STALL case. # # Since the only legimate responses to a GetMaxLUN are STALL or data, # anything else is now considered a fatal error and we give up on the device. # # # Signed-off-by: Matthew Dharm # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/usb.c # 2004/06/06 15:22:29-07:00 mdharm-usb@one-eyed-alien.net +8 -2 # USB Storage: GetMaxLUN tightening # # drivers/usb/storage/transport.c # 2004/06/06 15:22:29-07:00 mdharm-usb@one-eyed-alien.net +13 -10 # USB Storage: GetMaxLUN tightening # # ChangeSet # 2004/06/07 12:58:42-07:00 Siegfried.Hildebrand@FernUni-Hagen.de # [PATCH] Re: Problems with cyberjack usb-serial-module since kernel 2.6.2 # # > Send me a patch to back those changes out to fix your device and I'll # > apply it. If the author is around to realize this, that should wake # > them up :) # # Ok, here you are! :) # Attached is a patch for linux-2.6.7-rc2. (though the patch hasn't changed # since -rc1) # # Again a short description: # (the patch removes most of the changes done in linux-2.6.2) # 1. Removed the local buffer of cyberjack_write, because something goes wrong # upon a write-request bigger than the buffer. Without this, a write-request # stalls with error -3. # 2. Removed some usb_clear_halt() lines. Without this, the device doesn't even # open and returns -7. # # It works for my cyberjack pinpad USB card reader on # - nforce2 chipset # - VIA KM266 chipset # - AMD Irongate chipset # # # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/cyberjack.c # 2004/06/06 09:25:11-07:00 Siegfried.Hildebrand@FernUni-Hagen.de +6 -15 # Re: Problems with cyberjack usb-serial-module since kernel 2.6.2 # # ChangeSet # 2004/06/07 11:44:48-07:00 alex.williamson@hp.com # [PATCH] ia64: delete McKinley A-stepping code # # The patch below removes the config option and one bit of code for # McKinley A0/A1 CPU workarounds. These CPUs were never used in # production, and IIRC this workaround really only affected X11. # # Signed-off-by: David Mosberger # # include/asm-ia64/pgtable.h # 2004/06/07 03:07:59-07:00 alex.williamson@hp.com +1 -5 # ia64: delete McKinley A-stepping code # # arch/ia64/Kconfig # 2004/06/07 03:03:19-07:00 alex.williamson@hp.com +0 -14 # ia64: delete McKinley A-stepping code # # ChangeSet # 2004/06/07 11:27:28-07:00 greg@kroah.com # USB: make usb devices remove their sysfs files when disconnected. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/usb.h # 2004/06/07 04:26:43-07:00 greg@kroah.com +2 -0 # USB: make usb devices remove their sysfs files when disconnected. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/sysfs.c # 2004/06/07 04:26:43-07:00 greg@kroah.com +59 -30 # USB: make usb devices remove their sysfs files when disconnected. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/message.c # 2004/06/07 04:26:43-07:00 greg@kroah.com +1 -0 # USB: make usb devices remove their sysfs files when disconnected. # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/07 04:26:43-07:00 greg@kroah.com +1 -0 # USB: make usb devices remove their sysfs files when disconnected. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/07 10:30:35-07:00 greg@kroah.com # Merge kroah.com:/home/greg/linux/BK/bleed-2.6 # into kroah.com:/home/greg/linux/BK/usb-2.6 # # drivers/usb/gadget/ether.c # 2004/06/07 10:30:30-07:00 greg@kroah.com +0 -0 # Auto merged # # ChangeSet # 2004/06/04 16:48:04-07:00 greg@kroah.com # Driver core: finally add a MAINTAINERS entry for it. # # Signed-off-by: Greg Kroah-Hartman # # MAINTAINERS # 2004/06/04 09:47:20-07:00 greg@kroah.com +6 -0 # Driver core: finally add a MAINTAINERS entry for it. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/04 15:54:01-07:00 corbet@lwn.net # [PATCH] Module section offsets in /sys/module # # So here I am trying to write about how one can apply gdb to a running # kernel, and I'd like to tell people how to debug loadable modules. Only # with the 2.6 module loader, there's no way to find out where the various # sections in the module image ended up, so you can't do much. This patch # attempts to fix that by adding a "sections" subdirectory to every module's # entry in /sys/module; each attribute in that directory associates a # beginning address with the section name. Those attributes can be used by a # a simple script to generate an add-symbol-file command for gdb, something # like: # # #!/bin/bash # # # # gdbline module image # # # # Outputs an add-symbol-file line suitable for pasting into gdb to examine # # a loaded module. # # # cd /sys/module/$1/sections # echo -n add-symbol-file $2 `/bin/cat .text` # # for section in .[a-z]* *; do # if [ $section != ".text" ]; then # echo " \\" # echo -n " -s" $section `/bin/cat $section` # fi # done # echo # # Currently, this feature is absent if CONFIG_KALLSYMS is not set. I do # wonder if CONFIG_DEBUG_INFO might not be a better choice, now that I think # about it. Section names are unmunged, so "ls -a" is needed to see most of # them. # # Signed-off-by: Greg Kroah-Hartman # # kernel/module.c # 2004/06/03 14:37:17-07:00 corbet@lwn.net +100 -0 # Module section offsets in /sys/module # # include/linux/module.h # 2004/06/03 14:01:29-07:00 corbet@lwn.net +19 -0 # Module section offsets in /sys/module # # ChangeSet # 2004/06/04 17:17:42-05:00 stern@rowland.harvard.edu # [PATCH] Make the scsi error handler bus settle delay a per template option # # On 1 Jun 2004, James Bottomley wrote: # > On Tue, 2004-06-01 at 15:29, Alan Stern wrote: # > > In addition, the settle-time delays would have to be removed from the # > > error handler -- which means adding it to all the low-level drivers. Is # > > that doable? # > # > Well, for 2.6, I think that a simple flag indicating that the driver # > will implement it's own timeout should suffice rather than altering # > every LLD... # # Signed-off-by: Alan Stern # Signed-off-by: James Bottomley # # include/scsi/scsi_host.h # 2004/06/04 11:51:31-05:00 stern@rowland.harvard.edu +5 -0 # Make the scsi error handler bus settle delay a per template option # # drivers/usb/storage/scsiglue.c # 2004/06/04 11:52:56-05:00 stern@rowland.harvard.edu +3 -0 # Make the scsi error handler bus settle delay a per template option # # drivers/scsi/scsi_error.c # 2004/06/04 11:54:06-05:00 stern@rowland.harvard.edu +4 -2 # Make the scsi error handler bus settle delay a per template option # # ChangeSet # 2004/06/04 15:15:08-07:00 stern@rowland.harvard.edu # [PATCH] USB: Genuine changes to hub_port_debounce() # # This patch includes the algorithmic changes I would like to see in # hub_port_debounce(). They are: # # Increase the total timeout period from 400 ms to 1500 ms. # # Check the port's connect-changed status during the polling # loop. # # Return as soon as the connection has been stable for the # required time, even if it has been stably _dis_-connected. # (The current code waits for the full timeout period if there # isn't a connection.) # # In previous emails I have responded to all the concerns raised by others # about these changes, and I can't imagine how they could cause any trouble. # # Increasing the total timeout won't affect people with properly # functioning hardware. Their connections will quickly stabilize # and the routine will return just as before. People with flaky # hardware that takes a long time to settle down will now be able # to use their devices. # # Checking the connect-changed status during the polling loop will # make the test more conservative. The code will be able to # detect transient disconnections that it would have missed # before, and it won't return until the connection really _is_ # stable. Furthermore, this makes the test compliant with the # USB specification, which requires the stability timer to be # restarted whenever a connection change occurs. # # Returning early for disconnections is a simple optimization. # It's more important now that the total timeout length is 1.5 # seconds rather than 0.4 seconds. # # I urge you to apply this patch and for people to try it out. If there do # turn out to be problems... the patch is very small, well-contained, and # easy to revert. # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/04 07:28:00-07:00 stern@rowland.harvard.edu +4 -4 # USB: Genuine changes to hub_port_debounce() # # ChangeSet # 2004/06/04 15:14:42-07:00 stern@rowland.harvard.edu # [PATCH] USB: Superficial improvements to hub_port_debounce() # # Since my previous suggestions for changes to hub_port_debounce() # encountered so much resistance, this patch makes some fairly superficial # improvements to the code while leaving the logic of the algorithm almost # completely intact. The only behavioral change is that it actually # requests the port status at the start, rather than assuming the status is # not CONNECTED. Changes include: # # Vastly improved comments that are now unambiguous and accurately # descriptive of the code. # # Local variables changed to more sensible names. The stability # period is now reported in milliseconds rather than a meaningless # poll count. # # The sleep interval is moved from the start of the loop to the # end, so that the first time through we read the port status # immediately. # # If the connection has not stabilized after the total timeout # expires, -ETIMEDOUT is returned rather than whatever the # current connect status happens to be. # # If the connection does stabilize then the port status is returned # so that hub_port_connect_change() will have an up-to-date value # for the status rather than relying on the pre-debounce value. # # The changes I wanted to make but other people were worried about are # included as comments. A later (small) patch will uncomment them for # testing. # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/04 07:15:37-07:00 stern@rowland.harvard.edu +34 -30 # USB: Superficial improvements to hub_port_debounce() # # ChangeSet # 2004/06/04 15:14:11-07:00 stern@rowland.harvard.edu # [PATCH] USB: Debounce all connect change events # # This patch makes the hub driver debounce all connection changes. Right # now the driver only does so if the status happens to be CONNECTED at one # particular instant. However, the whole point of debouncing is that the # connection is subject to transient interruptions until it has stabilized; # hence deciding whether to debounce based on a single initial test defeats # the entire purpose. # # There are some additional smaller changes that go along with the major # one: # # Comments added to hub_port_connect_change() detailing the # conditions under which it will be called. # # Don't clear the port's connect-changed feature if it wasn't # set. # # Skip debouncing if there wasn't a physical connection change # but only a logical port-enable change (or a firmware-download- # induced device morph -- not yet implemented). # # Clear all the hub status change indicators in hub_events() # before handling a connect change. This will reduce syslog # clutter from status change bits that remain set while khubd # is busy taking care of a new device. # # The patch includes no changes to the debounce routine itself. Please # apply. # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.c # 2004/06/04 07:10:33-07:00 stern@rowland.harvard.edu +41 -22 # USB: Debounce all connect change events # # ChangeSet # 2004/06/04 15:13:47-07:00 stern@rowland.harvard.edu # [PATCH] USB: Code cleanup for the UHCI driver # # This patch makes some simple cleanups in the UHCI driver: # # It introduces msecs_to_jiffies() conversions and uses msleep(). # # It wakes up threads waiting for an endpoint to be disabled # in the oddball case where interrupts aren't working. (This # should have been in a previous patch but I missed it.) # # It disables PCI interrupt generation whenever the controller # is reset and enables it when the controller is started. This # may possibly solve some people's problems with suspend/resume. # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/host/uhci-hcd.c # 2004/06/04 08:14:49-07:00 stern@rowland.harvard.edu +28 -17 # USB: Code cleanup for the UHCI driver # # ChangeSet # 2004/06/04 15:13:16-07:00 jnardelli@infosciences.com # [PATCH] USB: fix Memory leak in visor.c and ftdi_sio.c # # Signed-off-by: Joe Nardelli # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/visor.c # 2004/06/04 07:13:10-07:00 jnardelli@infosciences.com +1 -0 # USB: fix Memory leak in visor.c and ftdi_sio.c # # drivers/usb/serial/ftdi_sio.c # 2004/06/04 06:53:27-07:00 jnardelli@infosciences.com +1 -0 # USB: fix Memory leak in visor.c and ftdi_sio.c # # ChangeSet # 2004/06/04 15:12:44-07:00 spitalnik@penguin.cz # [PATCH] USB: pegasus driver and ATEN device support # # I have created a patch to add support for ATEN device in pegasus usb driver. # I've sent the patch to the maintainer stated in pegasus.h but after several # weeks I didn't recieve a response, so I'm sending it to you now. The patch # should apply cleanly on 2.6.6, but it doesn't apply cleanly on todays -bk as # there was some patch adding some other device. One thing I'm not 100% sure # are the flags specified to PEGASUS_DEV, what means HAS_HOME_PNA? # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/net/pegasus.h # 2004/04/15 14:37:12-07:00 spitalnik@penguin.cz +3 -0 # USB: pegasus driver and ATEN device support # # ChangeSet # 2004/06/04 14:53:48-07:00 Frank.A.Uepping@t-online.de # [PATCH] Driver Core: fix struct device::release issue # # Signed-off-by: Greg Kroah-Hartman # # # On Saturday 27 March 2004 02:14, Greg KH wrote: # > On Sat, Mar 06, 2004 at 12:47:24PM +0100, Frank A. Uepping wrote: # > > Hi, # > > if device_add fails (e.g. bus_add_device returns an error) then the release # > > method will be called for the device. Is this a bug or a feature? # > # > Are you sure this will happen? device_initialize() gets a reference # > that is still present after device_add() fails, right? So release() # > will not get called. # At the label PMError, kobject_unregister is called, which decrements the # recount by 2, which will result in calling release at label Done (put_device). # # kobject_unregister should be superseded by kobject_del. # Here is a patch: # # drivers/base/core.c # 2004/03/27 07:04:27-08:00 Frank.A.Uepping@t-online.de +1 -1 # Driver Core: fix struct device::release issue # # ChangeSet # 2004/06/04 14:46:39-07:00 khali@linux-fr.org # [PATCH] I2C: update I2C IDs # # > > Greg, should I send a patch to you with these? # > # > Sure, if it's needed. # # Just noticed that I never sent the promised patch. Here it is. I also # added a few other IDs, since we have them in our (2.4) i2c CVS # repository. Having them in 2.6 as well will at least prevent collisions. # # Signed-off-by: Greg Kroah-Hartman # # include/linux/i2c-id.h # 2004/05/31 14:26:48-07:00 khali@linux-fr.org +12 -0 # I2C: update I2C IDs # # ChangeSet # 2004/06/04 14:45:53-07:00 vojtech@suse.cz # [PATCH] I2C i2c-piix: Don't treat ServerWorks servers as Laptops # # I'm sending you this little obvious patch which should enable i2c-piix # to work on IBM servers with ServerWorks chipsets. It still will treat # any IBM/Intel machine as a laptop and refuse to work, but it's better # than before. # # # i2c: Treat only IBM machines with Intel chipsets as IBM laptops. # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/busses/i2c-piix4.c # 2004/03/19 08:01:34-08:00 vojtech@suse.cz +1 -1 # I2C i2c-piix: Don't treat ServerWorks servers as Laptops # # ChangeSet # 2004/06/04 13:24:29-07:00 greg@kroah.com # PCI: convert to using dev_attrs for all PCI devices. # # Signed-off-by: Greg Kroah-Hartman # # drivers/pci/pci.h # 2004/06/04 06:23:04-07:00 greg@kroah.com +1 -0 # PCI: convert to using dev_attrs for all PCI devices. # # Signed-off-by: Greg Kroah-Hartman # # drivers/pci/pci-sysfs.c # 2004/06/04 06:23:04-07:00 greg@kroah.com +15 -18 # PCI: convert to using dev_attrs for all PCI devices. # # Signed-off-by: Greg Kroah-Hartman # # drivers/pci/pci-driver.c # 2004/06/04 06:23:04-07:00 greg@kroah.com +1 -0 # PCI: convert to using dev_attrs for all PCI devices. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/04 11:09:29-07:00 greg@kroah.com # Driver Model: And even more cleanup of silly scsi use of the *ATTR macros... # # Signed-off-by: Greg Kroah-Hartman # # drivers/scsi/scsi_transport_spi.c # 2004/06/04 04:08:48-07:00 greg@kroah.com +2 -2 # Driver Model: And even more cleanup of silly scsi use of the *ATTR macros... # # Signed-off-by: Greg Kroah-Hartman # # drivers/scsi/scsi_sysfs.c # 2004/06/04 04:08:48-07:00 greg@kroah.com +5 -5 # Driver Model: And even more cleanup of silly scsi use of the *ATTR macros... # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/04 11:55:11-05:00 jejb@mulgrave.(none) # sg update to 20040516 # # From: Douglas Gilbert # # Here are some further refinements to this patch with help # from Pat Mansfield: # - replace vmalloc() with kmalloc(,GFP_KERNEL) # - bump max sg devices from 8192 to 32768 # # Tested to 16k devices (and 8k devices on a box with 512MB # ram), Patch is against lk 2.6.6 (or 2.6.6-bk1). # # Signed-off-by: James Bottomley # # drivers/scsi/sg.c # 2004/06/04 11:54:42-05:00 jejb@mulgrave.(none) +22 -15 # sg update to 20040516 # # ChangeSet # 2004/06/04 09:13:16-05:00 hch@lst.de # [PATCH] kill dead compat code in advansys # # I actually wanted to fix up the check_region usage there but got lost # in the mess. Let's start by kicking out the 2.2 compat and using scsi # layer constants instead of their own redefinitions first. # # Signed-off-by: James Bottomley # # drivers/scsi/advansys.c # 2004/06/04 06:19:50-05:00 hch@lst.de +119 -508 # kill dead compat code in advansys # # ChangeSet # 2004/06/04 09:09:27-05:00 hch@lst.de # [PATCH] update 53c700 to avoid obsolete headers # # Signed-off-by: James Bottomley # # drivers/scsi/sim710.c # 2004/06/04 05:53:02-05:00 hch@lst.de +2 -3 # update 53c700 to avoid obsolete headers # # drivers/scsi/lasi700.c # 2004/06/04 05:53:02-05:00 hch@lst.de +1 -2 # update 53c700 to avoid obsolete headers # # drivers/scsi/NCR_D700.c # 2004/06/04 06:45:28-05:00 hch@lst.de +1 -3 # update 53c700 to avoid obsolete headers # # drivers/scsi/53c700.h # 2004/06/04 06:43:36-05:00 hch@lst.de +13 -10 # update 53c700 to avoid obsolete headers # # drivers/scsi/53c700.c # 2004/06/04 06:43:46-05:00 hch@lst.de +65 -64 # update 53c700 to avoid obsolete headers # # ChangeSet # 2004/06/04 08:59:37-05:00 hch@lst.de # [PATCH] missing forward declarations in scsi_eh.h # # Signed-off-by: James Bottomley # # include/scsi/scsi_eh.h # 2004/06/04 06:45:01-05:00 hch@lst.de +4 -0 # missing forward declarations in scsi_eh.h # # ChangeSet # 2004/06/03 21:54:17-05:00 akpm@osdl.org # [PATCH] 3ware 9000 schedule_timeout fix # # From: "Adam Radford" # # This small patch fixes the broken schedule_timeout() usage in the 3w-9xxx # driver, and replaces the calls with msleep(). # # Signed-off-by: Andrew Morton # Signed-off-by: James Bottomley # # drivers/scsi/3w-9xxx.c # 2004/06/03 19:43:06-05:00 akpm@osdl.org +4 -3 # 3ware 9000 schedule_timeout fix # # ChangeSet # 2004/06/03 21:51:02-05:00 akpm@osdl.org # [PATCH] 3ware 9000 driver update # # From: "Adam Radford" # # This patch updates the 3w-9xxx driver in 2.6.7-rc2-mm1 to v2.26.02.000 to # cleanup several things pointed out by Chris Hellwig / Jeff Garzik. # # Changes in this release: # - Use descriptive defines for phase numbers. # - Remove un-needed casts for TW_Command_Full # - Rework eh_reset(), eh_abort() spinlocks. # - Remove all mdelays, replace w/ schedule_timeout(). # - Remove MODULE_PARAM cmds_per_lun, add sysfs device attribute 'queue_depth'. # - Remove twa_slave_configure(). # - Remove twa_info(). # - Remove all bitfields from structures, add bitmask macros. # - Remove twa_setup_irq() wrapper, call directly. # - Remove un-needed prototypes. # - Propogate return value of pci_enable_device(), pci_set_dma_mask(), ioremap(). # - Use pci_request/free_regions(). # - Add missing call to pci_disable_device() on probe failure. # - Unregister character ioctl interface in twa_remove(). # - Make some excessively lengthy lines < 80 columns. # - Use pci_module_init() instead of pci_register_driver(). # - Remove bogus TW_IN_INTR check, fix twa_interrupt() spinlock. # - Rev driver branch to .02 to denote kernel version. # # Signed-off-by: Andrew Morton # Signed-off-by: James Bottomley # # drivers/scsi/3w-9xxx.h # 2004/06/03 21:44:23-05:00 akpm@osdl.org +31 -53 # 3ware 9000 driver update # # drivers/scsi/3w-9xxx.c # 2004/06/03 21:44:23-05:00 akpm@osdl.org +167 -159 # 3ware 9000 driver update # # ChangeSet # 2004/06/03 20:12:20-05:00 arjanv@redhat.com # [PATCH] SCSI: replace deprecated hosts.h file # # Signed-off-by: James Bottomley # # drivers/scsi/zalon.c # 2004/05/12 10:46:24-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/wd7000.c # 2004/05/12 10:46:24-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/wd33c93.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/ultrastor.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/u14-34f.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/tmscsim.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/t128.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sym53c416.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sun3x_esp.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sun3_scsi_vme.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sun3_scsi.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/st.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sr_vendor.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sr_ioctl.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sr.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sim710.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sgiwd93.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sg.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/seagate.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/sd.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/scsicam.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/scsi_pc98.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/scsi_module.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/scsi_ioctl.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/scsi_error.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/scsi_devinfo.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/scsi_debug.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/qlogicpti.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/qlogicisp.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/qlogicfc.c # 2004/05/12 10:46:23-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/qlogicfas408.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/qlogicfas.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/qla2xxx/qla_os.h # 2004/05/12 10:46:27-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/qla1280.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/psi240i.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/ppa.h # 2004/05/12 10:46:24-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pluto.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pcmcia/qlogic_stub.c # 2004/05/12 10:46:25-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pcmcia/fdomain_stub.c # 2004/05/12 10:46:25-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pcmcia/aha152x_stub.c # 2004/05/12 10:46:25-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pci2220i.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pci2000.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pc980155.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/pas16.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/osst.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/oktagon_esp.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/nsp32.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/ncr53c8xx.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/mvme16x.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/mvme147.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/megaraid.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/mca_53c9x.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/mac_scsi.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/mac_esp.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/lasi700.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/jazz_esp.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/ips.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/ini9100u.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/in2000.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/imm.h # 2004/05/12 10:46:24-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/ide-scsi.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/ibmmca.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/i60uscsi.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/gvp11.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/g_NCR5380.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/fdomain.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/fd_mcs.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/fcal.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/fastlane.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/esp.c # 2004/05/12 10:46:21-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/eata_pio.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/eata.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/dtc.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/dmx3191d.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/dec_esp.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/dc395x.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/cyberstormII.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/cyberstorm.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/cpqfcTSworker.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/cpqfcTSinit.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +2 -2 # SCSI: replace deprecated hosts.h file # # drivers/scsi/cpqfcTScontrol.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/constants.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/bvme6000.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/blz2060.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/blz1230.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/atp870u.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/atari_scsi.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/amiga7xx.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/aic7xxx_old.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/aic7xxx/aiclib.c # 2004/05/12 10:46:25-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/aic7xxx/aic7xxx_osm.h # 2004/05/12 10:46:27-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/aic7xxx/aic79xx_osm.h # 2004/05/12 10:46:27-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/aha1740.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/aha1542.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/advansys.c # 2004/05/12 10:46:19-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/a3000.c # 2004/05/12 10:46:19-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/a2091.c # 2004/05/12 10:46:19-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/NCR_Q720.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/NCR_D700.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/NCR53c406a.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/NCR53C9x.c # 2004/05/12 10:46:22-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/BusLogic.c # 2004/05/12 10:46:20-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/53c7xx.c # 2004/05/12 10:46:19-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/53c700.c # 2004/05/12 10:46:19-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # drivers/scsi/3w-xxxx.c # 2004/05/12 10:46:19-05:00 arjanv@redhat.com +1 -1 # SCSI: replace deprecated hosts.h file # # ChangeSet # 2004/06/03 20:07:56-05:00 akpm@osdl.org # [PATCH] scsi_transport_spi.c build fix # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_transport_spi.c # 2004/06/03 11:23:05-05:00 akpm@osdl.org +1 -1 # scsi_transport_spi.c build fix # # ChangeSet # 2004/06/03 20:06:32-05:00 akpm@osdl.org # [PATCH] Lost 2.4 change for BusLogic info # # From: Alan Cox # # I think it might be a good thing if this was fixed to match 2.4 # # Signed-off-by: Andrew Morton # Signed-off-by: James Bottomley # # drivers/scsi/Kconfig # 2004/06/03 01:56:10-05:00 akpm@osdl.org +1 -3 # Lost 2.4 change for BusLogic info # # ChangeSet # 2004/06/03 20:05:10-05:00 hch@lst.de # [PATCH] scsi_dev_flags must be __initdata, not __init # # __init is only for functions # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_devinfo.c # 2004/05/31 16:05:51-05:00 hch@lst.de +1 -1 # scsi_dev_flags must be __initdata, not __init # # ChangeSet # 2004/06/03 20:03:33-05:00 rddunlap@osdl.org # [PATCH] fix check_region usage in eata_pio # # Based on "eata_generic.h", this SCSI controller has 9 bytes of IO # space, not 8, so update request_region(), release_region(), and # n_io_port to use 9 instead of 8. # # diffstat:= # drivers/scsi/eata_pio.c | 16 ++++++++-------- # 1 files changed, 8 insertions(+), 8 deletions(-) # # Signed-off-by: James Bottomley # # drivers/scsi/eata_pio.c # 2004/06/01 17:29:30-05:00 rddunlap@osdl.org +8 -8 # fix check_region usage in eata_pio # # ChangeSet # 2004/06/03 20:01:03-05:00 James.Bottomley@steeleye.com # [PATCH] Advansys: Add basic highmem/DMA support # # On Wed, 2004-05-19 at 05:38, Herbert Xu wrote: # > This is a resend of my patch that adds basic support for highmem # > on i386 to the advansys driver. It has been tested in # > http://bugs.debian.org/245238. # > # > The maintainer email address listed in the MAINTAINERS file bounced # > so someone else will need to look at this. # # I converted your patch to use the DMA-API. This will be necessary to # use the EISA advansys boards---Of course, EISA won't work properly until # the entire driver is converted to the driverfs probing API, sigh, but # I'll get around to that eventually. # # OK, and I couldn't resist getting rid of the stupid in_isr locking on # the done function. # # Converted from original patch by Herbert Xu # Signed-off-by: James Bottomley # # drivers/scsi/advansys.c # 2004/05/31 12:14:32-05:00 James.Bottomley@steeleye.com +95 -50 # Add basic highmem/DMA support # # ChangeSet # 2004/06/03 19:59:37-05:00 hch@lst.de # [PATCH] remove obsolete API usage from dpt_i2o # # Signed-off-by: James Bottomley # # drivers/scsi/dpti.h # 2004/05/31 08:34:32-05:00 hch@lst.de +12 -12 # remove obsolete API usage from dpt_i2o # # drivers/scsi/dpt_i2o.c # 2004/05/31 08:35:50-05:00 hch@lst.de +28 -25 # remove obsolete API usage from dpt_i2o # # ChangeSet # 2004/06/03 19:58:15-05:00 hch@lst.de # [PATCH] fix sym53c416 check_region usage # # again, the init code could use some bigger rework, but let's stick to # the minimal fix until we have some testers. # # Signed-off-by: James Bottomley # # drivers/scsi/sym53c416.c # 2004/05/31 07:18:12-05:00 hch@lst.de +41 -42 # fix sym53c416 check_region usage # # ChangeSet # 2004/06/03 19:56:47-05:00 hch@lst.de # [PATCH] fix check_region usage in eata_pio # # I'd love to rework the init sequence a bit more, but without beeing able # to actually test the driver I'd rather stick to the bulletproof fix. # # Signed-off-by: James Bottomley # # drivers/scsi/eata_pio.c # 2004/05/31 06:30:48-05:00 hch@lst.de +58 -44 # fix check_region usage in eata_pio # # ChangeSet # 2004/06/03 19:55:15-05:00 hch@lst.de # [PATCH] handle NO_SENSE in sd # # Original patch from # http://marc.theaimsgroup.com/?l=linux-scsi&m=107428662718579&w=2 # reworked to according to James' suggestion to handle NO_SENSE the same # as RECOVERED_ERROR. # # Signed-off-by: James Bottomley # # drivers/scsi/sd.c # 2004/05/31 05:53:01-05:00 hch@lst.de +4 -4 # handle NO_SENSE in sd # # ChangeSet # 2004/06/03 19:53:41-05:00 hch@lst.de # [PATCH] remove sleep_on_timeout usage in megaraid # # megaraid does sleep_on_timeout on a stack waitq - use msleep instead. # # Signed-off-by: James Bottomley # # drivers/scsi/megaraid.c # 2004/05/30 08:04:14-05:00 hch@lst.de +3 -6 # remove sleep_on_timeout usage in megaraid # # ChangeSet # 2004/06/03 19:52:05-05:00 g.liakhovetski@gmx.de # [PATCH] tmscsim: Store pDCB in device->hostdata # # On Sun, 23 May 2004, Christoph Hellwig wrote: # > The other thing is that most calls to dc390_findDCB could probably be # > replaced with stroing the pDCB in scsi_device->hostdata on slave_alloc, # > but that could aswell be done in an incremental patch. # # Done in the attached patch. Tested as usual and a bit harder. # # Signed-off-by: James Bottomley # # drivers/scsi/tmscsim.c # 2004/05/28 18:17:17-05:00 g.liakhovetski@gmx.de +8 -10 # tmscsim: Store pDCB in device->hostdata # # ChangeSet # 2004/06/03 19:50:16-05:00 hch@lst.de # [PATCH] fix dpt_i2o compilation for alpha and sparc # # This patch has been floating around for ages, got reminded of it again # when looking at the debian kernel package. # # Signed-off-by: James Bottomley # # drivers/scsi/dpt_i2o.c # 2004/05/10 07:21:38-05:00 hch@lst.de +2 -2 # fix dpt_i2o compilation for alpha and sparc # # ChangeSet # 2004/06/03 20:43:58-04:00 len.brown@intel.com # [ACPI] acpi=force overrides blacklist pci=noacpi or acpi=noirq (Andi Kleen) # # arch/i386/kernel/dmi_scan.c # 2004/06/03 20:43:48-04:00 len.brown@intel.com +12 -6 # acpi=force overrides blacklist pci=noacpi or acpi=noirq (Andi Kleen) # # ChangeSet # 2004/06/03 19:41:12-05:00 aradford@amcc.com # [PATCH] 2/2 3ware 9000 SATA-RAID driver v2.26.00.009 # # Signed-off-by: James Bottomley # # include/linux/pci_ids.h # 2004/05/21 17:33:51-05:00 aradford@amcc.com +2 -0 # 3ware 9000 SATA-RAID driver v2.26.00.009 # # drivers/scsi/Makefile # 2004/05/21 17:24:55-05:00 aradford@amcc.com +1 -0 # 3ware 9000 SATA-RAID driver v2.26.00.009 # # drivers/scsi/Kconfig # 2004/05/21 18:29:59-05:00 aradford@amcc.com +12 -1 # 3ware 9000 SATA-RAID driver v2.26.00.009 # # drivers/scsi/3w-9xxx.h # 2004/05/26 15:17:26-05:00 aradford@amcc.com +726 -0 # 3ware 9000 SATA-RAID driver v2.26.00.009 # # MAINTAINERS # 2004/05/21 17:56:25-05:00 aradford@amcc.com +14 -0 # 3ware 9000 SATA-RAID driver v2.26.00.009 # # drivers/scsi/3w-9xxx.h # 2004/05/26 15:17:26-05:00 aradford@amcc.com +0 -0 # BitKeeper file /home/jejb/BK/scsi-misc-2.6/drivers/scsi/3w-9xxx.h # # ChangeSet # 2004/06/03 19:39:01-05:00 aradford@amcc.com # [PATCH] 1/2 3ware 9000 SATA-RAID driver v2.26.00.009 # # Here is an updated version v2.26.00.009 of the 3ware 9000 SATA-RAID driver. # # Changes in this release: # - Convert driver to pci_driver format. # - Remove proc interface, add sysfs attributes. # - Return SCSI_MLQUEUE_HOST_BUSY when card status is busy. # # Future versions may include: # - PAE fix # - 80 column wrap fixes # - Remove more prototypes by re-ordering functions. # - sysfs queue depth adjustment instead of module_param # # Signed-off-by: James Bottomley # # drivers/scsi/3w-9xxx.c # 2004/05/26 15:17:24-05:00 aradford@amcc.com +2144 -0 # 3ware 9000 SATA-RAID driver v2.26.00.009 # # drivers/scsi/3w-9xxx.c # 2004/05/26 15:17:24-05:00 aradford@amcc.com +0 -0 # BitKeeper file /home/jejb/BK/scsi-misc-2.6/drivers/scsi/3w-9xxx.c # # ChangeSet # 2004/06/03 17:37:14-07:00 mochel@digitalimplant.org # [Driver Model] Add default device attributes to struct bus_type. # # - Add struct bus_type::dev_attrs, which is an array of device # attributes that are added to each device as they are registered. # # - Also make sure that we don't hang when removing bus attributes # if adding one failed.. # # include/linux/device.h # 2004/06/03 17:37:08-07:00 mochel@digitalimplant.org +1 -0 # [Driver Model] Add default device attributes to struct bus_type. # # drivers/base/bus.c # 2004/06/03 17:37:08-07:00 mochel@digitalimplant.org +35 -1 # [Driver Model] Add default device attributes to struct bus_type. # # ChangeSet # 2004/06/03 17:14:32-07:00 greg@kroah.com # USB: remove "devfs" message from kernel log for usb-serial driver # # No one uses devfs on 2.6 :) # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/bus.c # 2004/06/03 17:14:00-07:00 greg@kroah.com +2 -2 # USB: remove "devfs" message from kernel log for usb-serial driver # # No one uses devfs on 2.6 :) # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/03 17:05:41-07:00 mochel@digitalimplant.org # [Driver Model] Add default attributes for struct bus_type. # # - Similar to default attributes for struct class, this is an array # of attributes, terminated with an attribute with a NULL name, that # are added when the bus is registered, and removed when the bus is # unregistered. # # include/linux/device.h # 2004/06/03 17:05:35-07:00 mochel@digitalimplant.org +2 -0 # [Driver Model] Add default attributes for struct bus_type. # # drivers/base/bus.c # 2004/06/03 17:05:35-07:00 mochel@digitalimplant.org +37 -0 # [Driver Model] Add default attributes for struct bus_type. # # ChangeSet # 2004/06/03 16:50:29-07:00 scott@concord.org # [PATCH] USB: kyocera 7135 patch # # Here is a patch based on 2.6.7-rc2 that makes the Kyocera 7135 work. # The Kyocera appears to have the same setup as the Trio. Its endpoints # are laid out like this: # # > >>>type address # > >>>usb bulk out: 0x01 # > >>>usb interrupt in: 0x82 # > >>>usb bulk out: 0x03 # > >>>usb bulk in: 0x84 # The last two are the ones used for the syncing communication. # # So the patch adds the ids for the kyocera and makes the treo_attach # function handle the kyocera too. I also changed the comment; it appears # there was an error in the original comment about the treo: # # Joe Nardelli wrote: # > Actually, the comment isn't quite right for Treos either (oops). It # > should read: # > # > ... # > 1st bulk in endpoint to communicate with the 2nd bulk out endpoint # > ... # # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/serial/visor.h # 2004/06/02 07:09:27-07:00 scott@concord.org +3 -0 # USB: kyocera 7135 patch # # drivers/usb/serial/visor.c # 2004/06/02 10:03:04-07:00 scott@concord.org +11 -7 # USB: kyocera 7135 patch # # ChangeSet # 2004/06/03 16:49:51-07:00 stern@rowland.harvard.edu # [PATCH] USB: 2.6-BK usb (printing) broken # # On Sat, 29 May 2004, Jens Axboe wrote: # # > > > Both 2.6.7-rc1 and BK current spit out a bunch of: # > > > # > > > drivers/usb/class/usblp.c: usblp1: nonzero read/write bulk status received: -2 # > > > drivers/usb/class/usblp.c: usblp1: error -2 reading from printer # > > > drivers/usb/class/usblp.c: usblp1: error -115 reading from printer # > > > drivers/usb/class/usblp.c: usblp1: error -115 reading from printer # > > > ... # > > > # > > > (about ~80 of that last line) but work for me. # # > Sorry wasn't quite clear - the above messages are with 2.6.7-rc1 and # > current bk with your patch backed out. Current bk with the patch reports # > only the timeouts I originally listed. # # Okay, I feel better. # # It looks like those errors you see are caused by a bug in the usblp # driver. The patch below ought to help. # # drivers/usb/class/usblp.c # 2004/05/29 07:25:51-07:00 stern@rowland.harvard.edu +1 -0 # USB: 2.6-BK usb (printing) broken # # ChangeSet # 2004/06/03 12:38:31-07:00 hannal@us.ibm.com # [PATCH] Add class support to cpuid.c # # This patch adds class support to arch/i386/kernel/cpuid.c. This enables udev # support. I have tested on a 2-way SMP system and on a 2-way built as UP. # Here are the results for the SMP: # # [hlinder@w-hlinder2 hlinder]$ tree /sys/class/cpuid # /sys/class/cpuid # |-- cpu0 # | `-- dev # `-- cpu1 # `-- dev # # 2 directories, 2 files # [hlinder@w-hlinder2 hlinder]$ more /sys/class/cpuid/cpu0/dev # 203:0 # [hlinder@w-hlinder2 hlinder]$ more /sys/class/cpuid/cpu1/dev # 203:1 # [hlinder@w-hlinder2 hlinder]$ # # And for the UP: # # [root@w-hlinder2 root]# tree /sys/class/cpuid # /sys/class/cpuid # `-- cpu0 # `-- dev # # 1 directory, 1 file # # # Signed-off-by: Greg Kroah-Hartman # # arch/i386/kernel/cpuid.c # 2004/06/02 14:22:27-07:00 hannal@us.ibm.com +36 -2 # Add class support to cpuid.c # # ChangeSet # 2004/06/03 12:06:36-07:00 greg@kroah.com # Cset exclude: vojtech@suse.cz|ChangeSet|20040602201956|45549 # # Oops, this broke device removal pretty badly :( # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/transport.c # 2004/06/03 12:06:28-07:00 greg@kroah.com +0 -0 # Exclude # # drivers/usb/storage/isd200.c # 2004/06/03 12:06:28-07:00 greg@kroah.com +0 -0 # Exclude # # ChangeSet # 2004/06/03 11:42:20-07:00 greg@kroah.com # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/w83l785ts.c # 2004/06/03 11:41:43-07:00 greg@kroah.com +2 -2 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/w83781d.c # 2004/06/03 11:41:44-07:00 greg@kroah.com +15 -15 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/w83627hf.c # 2004/06/03 11:41:43-07:00 greg@kroah.com +49 -49 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/via686a.c # 2004/06/03 11:41:44-07:00 greg@kroah.com +9 -9 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/lm85.c # 2004/06/03 11:41:43-07:00 greg@kroah.com +13 -13 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/lm78.c # 2004/06/03 11:41:43-07:00 greg@kroah.com +11 -11 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/it87.c # 2004/06/03 11:41:44-07:00 greg@kroah.com +11 -11 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # drivers/i2c/chips/asb100.c # 2004/06/03 11:41:43-07:00 greg@kroah.com +33 -33 # Driver Model: Cleanup the i2c driver silly use of the *ATTR macros which just broke # # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/03 11:40:44-07:00 greg@kroah.com # Driver Model: More cleanup of silly scsi use of the *ATTR macros... # # Signed-off-by: Greg Kroah-Hartman # # drivers/scsi/scsi_debug.c # 2004/06/03 11:40:14-07:00 greg@kroah.com +8 -8 # Driver Model: More cleanup of silly scsi use of the *ATTR macros... # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/03 10:41:29-07:00 mochel@digitalimplant.org # [Driver Model] Add default attributes for classes class devices. # # - add struct class::class_attrs, which is designed to point to an # array of class_attributes that are added when the class is registered # and removed when the class is unregistered. # This allows for more consolidated and cleaner definition of and # management of attributes. # # - Add struct class::class_dev_attrs to do something similarly for # class devices. Each class device that is registered with the class # gets that set of attributes added for them, and subsequently removed # when the device is unregistered. # # Each array depends on a terminating attribute with a NULL name. Hint: # use the new __ATTR_NULL macro to terminate it. # # include/linux/device.h # 2004/06/03 10:41:22-07:00 mochel@digitalimplant.org +3 -0 # [Driver Model] Add default attributes for classes class devices. # # ChangeSet # 2004/06/03 10:27:16-07:00 mochel@digitalimplant.org # [sysfs] Add attr_name() macro # # - Returns the name of an embedded attribute in a higher-level # attribute. # # ChangeSet # 2004/06/03 09:48:45-07:00 greg@kroah.com # Add basic sysfs support for raw devices # # This is needed by people who use udev and want raw devices. # SuSE is shipping with this patch. # # Signed-off-by: Greg Kroah-Hartman # # drivers/char/raw.c # 2004/06/03 09:48:22-07:00 greg@kroah.com +24 -1 # Add basic sysfs support for raw devices # # This is needed by people who use udev and want raw devices. # SuSE is shipping with this patch. # # Signed-off-by: Greg Kroah-Hartman # # ChangeSet # 2004/06/03 08:44:34-07:00 mochel@digitalimplant.org # [Driver Model] Fix up silly scsi usage of DEVICE_ATTR() macros. # # - Hey, just because the macro incorrectly included a ';' doesn't mean # one shouldn't add one on their own.. (Or at least be consistent.) # # Signed-off-by: Greg Kroah-Hartman # # drivers/scsi/scsi_sysfs.c # 2004/06/03 08:44:27-07:00 mochel@digitalimplant.org +2 -2 # [Driver Model] Fix up silly scsi usage of DEVICE_ATTR() macros. # # ChangeSet # 2004/06/03 00:45:08-04:00 len.brown@intel.com # [ACPI] fix !CONFIG_PCI build (Bjorn Helgaas) # # include/linux/acpi.h # 2004/06/02 11:02:20-04:00 len.brown@intel.com +2 -2 # fix !CONFIG_PCI build (Bjorn Helgaas) # # arch/i386/kernel/acpi/boot.c # 2004/06/02 11:02:20-04:00 len.brown@intel.com +5 -4 # fix !CONFIG_PCI build (Bjorn Helgaas) # # ChangeSet # 2004/06/02 21:08:30-04:00 p.lavarre@ieee.org # [PATCH] ata_check_bmdma # # Move hand-coded BMDMA status check into separate function. # # drivers/scsi/libata-core.c # 2004/05/27 19:56:57-04:00 p.lavarre@ieee.org +18 -10 # ata_check_bmdma # # ChangeSet # 2004/06/02 17:10:52-07:00 mochel@digitalimplant.org # [Driver Model] Consolidate attribute definition macros # # - Create __ATTR(), __ATTR_RO(), and __ATTR_NULL macros to help define # attributes in a neat, short-hand form. # # - Apply these macros to the attribute definition in include/linux/device.h # # - Note: These can be used to more cleanly define attributes in your own # code. e.g: # # static struct device_attribute attrs[] = { # __ATTR_RO(foo), # __ATTR_RO(bar), # __ATTR(baz,0666,baz_show,baz_store), # __ATTR_NULL, # }; # # ...etc. # # Signed-off-by: Greg Kroah-Hartman # # include/linux/device.h # 2004/06/02 17:01:55-07:00 mochel@digitalimplant.org +6 -25 # [Driver Model] Consolidate object attribute definition. # # ChangeSet # 2004/06/02 14:07:26-07:00 stern@rowland.harvard.edu # [PATCH] USB: Move usb_new_device() et al. into hub.c # # This patch moves usb_new_device(), usb_disconnect(), usb_choose_address(), # and usb_release_address() from usb.c to hub.c. As a side benefit, # choose_address() and release_address() can now become static. The other # two can't, because they have to be exported for use by HCD's when # registering/unregistering root hubs. # # Some other features of the patch: # # The usb_snddefctrl() and usb_rcvdefctrl() macros have been # removed, since only one of them was used and only in one spot. # # The comment about configuration choice needing to interact with # hub power budgeting has been moved in accordance with David's # wish. usb_new_device() checks to make sure a configuration # could be chosen and logs a warning if no choice was made. # # Following Linus's preference, the #ifdef preprocessor stuff has # been removed from around the calls the show_string routine. It # is now defined as a non-inline routine when debugging is enabled # and as an inline no-op otherwise (the compiler will optimize # away the useless tests). # # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/usb.c # 2004/06/01 09:54:17-07:00 stern@rowland.harvard.edu +0 -229 # USB: Move usb_new_device() et al. into hub.c # # drivers/usb/core/hub.c # 2004/06/01 09:54:17-07:00 stern@rowland.harvard.edu +231 -3 # USB: Move usb_new_device() et al. into hub.c # # drivers/usb/core/hcd.h # 2004/06/01 09:54:17-07:00 stern@rowland.harvard.edu +0 -7 # USB: Move usb_new_device() et al. into hub.c # # ChangeSet # 2004/06/02 14:06:55-07:00 stern@rowland.harvard.edu # [PATCH] USB: Minor cleanups for hub driver # # Greg: # # This patch takes care of some small miscellaneous items in hub.c: # # Move the definition of CONFIG to the right place; # # Print the proper value for submission status in the error log; # # Remove an unused list of all hubs; # # Remove some unneeded braces; # # Kill an accidentally-resurrected comment. # # Signed-off-by: Alan Stern # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/hub.h # 2004/06/01 09:31:11-07:00 stern@rowland.harvard.edu +0 -1 # USB: Minor cleanups for hub driver # # drivers/usb/core/hub.c # 2004/06/01 09:39:04-07:00 stern@rowland.harvard.edu +9 -25 # USB: Minor cleanups for hub driver # # ChangeSet # 2004/06/02 13:55:44-07:00 oliver@neukum.org # [PATCH] USB: fix race between disconnect and write of acm driver # # acm uses a workqueue to defer part of a write operation. # In case of disconnect this work must be waited for. # - fix race between write and disconnect # # Signed-off-by: Oliver Neukum # Signed-off-by: Vojtech Pavlik # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/class/cdc-acm.c # 2004/05/31 08:13:14-07:00 oliver@neukum.org +2 -0 # USB: fix race between disconnect and write of acm driver # # ChangeSet # 2004/06/02 13:49:28-07:00 oliver@neukum.org # [PATCH] USB: fix racy access to urb->status in cdc acm driver # # Hi, # # fix access to urb->status by introduction of an explicit flag # for finished data transfer. # - fix racy access to urb->status # # Signed-off-by: Oliver Neukum # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/class/cdc-acm.h # 2004/05/31 08:02:12-07:00 oliver@neukum.org +1 -0 # USB: fix racy access to urb->status in cdc acm driver # # drivers/usb/class/cdc-acm.c # 2004/05/31 08:02:12-07:00 oliver@neukum.org +10 -6 # USB: fix racy access to urb->status in cdc acm driver # # ChangeSet # 2004/06/02 13:36:24-07:00 oliver@neukum.org # [PATCH] USB: error handling of open of acm driver # # this adds error handling to the open method of the cdc acm driver. # The change set is relative to my last patch rewriting probe. # - add error handling to open method # # # Signed-off-by: Oliver Neukum # Signed-off-by: Vojtech Pavlik # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/class/cdc-acm.c # 2004/05/31 06:54:36-07:00 oliver@neukum.org +23 -8 # USB: error handling of open of acm driver # # ChangeSet # 2004/06/02 13:31:54-07:00 oliver@neukum.org # [PATCH] USB: proper evaluation of the union descriptor for CDC ACM # # this changes acm_probe() to using the proper union descriptor. # It contains the workaround David suggested. Please apply. # # - fix probing to use cdc union descriptor # # Signed-off-by: Oliver Neukum # Signed-off-by: Vojtech Pavlik # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/class/cdc-acm.c # 2004/05/30 03:56:45-07:00 oliver@neukum.org +100 -174 # USB: proper evaluation of the union descriptor for CDC ACM # # drivers/usb/class/cdc-acm.h # 2004/05/30 03:56:45-07:00 oliver@neukum.org +114 -0 # USB: proper evaluation of the union descriptor for CDC ACM # # drivers/usb/class/cdc-acm.h # 2004/05/30 03:56:45-07:00 oliver@neukum.org +0 -0 # BitKeeper file /home/greg/linux/BK/usb-2.6/drivers/usb/class/cdc-acm.h # # ChangeSet # 2004/06/02 13:25:59-07:00 david-b@pacbell.net # [PATCH] USB: usb retry cleanups # # This patch stops changing the reported fault mode in cases where retries of # GET_DESCRIPTOR fail because the device just doesn't have such a descriptor. # Plus, it stops printing messages when retrying. # # It also reduces the number of retries; the first retry seems to resolve most # of these firmware problems. # # Signed-Off-By: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/core/message.c # 2004/06/01 08:10:37-07:00 david-b@pacbell.net +1 -4 # USB: usb retry cleanups # # ChangeSet # 2004/06/02 13:25:08-07:00 david-b@pacbell.net # [PATCH] USB: pxa/rndis device descriptor # # This fixes a problem that all pxa2xx_udc g_ether devices # would run into. They'd give the wrong descriptors, like: # # > --------msg1- usbview ---------- # > Device Descriptor: bcdUSB: 0x0200 # > bDeviceClass: 0xFF # > bDeviceSubClass: 0x00 # > bDeviceProtocol: 0x00 # > bMaxPacketSize0: 0x10 (16) # # Windows doesn't like RNDIS-supporting devices to point # out that they're really vendor-specific. So this patch # makes sure they don't. # # Signed-off-by: David Brownell # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/ether.c # 2004/05/29 04:01:44-07:00 david-b@pacbell.net +10 -11 # USB: pxa/rndis device descriptor # # ChangeSet # 2004/06/02 13:19:23-07:00 numlock@freesurf.ch # [PATCH] Add support for ISD-300 controller # # This patch adds support in unusual_devs.h for the ISD-300 USB controller # used in CD-ROM enclosures. # # With it, since 2.6.0 it allowed me to move gigabytes of data and worked # without a hitch. # # # Signed-off-by: Andrew Morton # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/unusual_devs.h # 2004/05/25 20:32:24-07:00 numlock@freesurf.ch +6 -0 # Add support for ISD-300 controller # # ChangeSet # 2004/06/02 13:18:53-07:00 stern@rowland.harvard.edu # [PATCH] USB: Fix disconnect bug in dummy_hcd # # Greg: # # This patch fixes a bug in disconnect handling for the dummy_hcd driver. # After a disconnect the driver would still accept URBs for endpoint 0, # leading to an oops. It also improves the ad-hoc technique used by the # driver to track its gadget's struct usb_device and fixes the way # port-power changes are handled. Please apply. # # Alan Stern # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/gadget/dummy_hcd.c # 2004/05/17 10:12:20-07:00 stern@rowland.harvard.edu +11 -4 # USB: Fix disconnect bug in dummy_hcd # # ChangeSet # 2004/06/02 13:18:15-07:00 stern@rowland.harvard.edu # [PATCH] USB: unusual_devs.h update # # On Mon, 3 May 2004, zcat wrote: # # > I am trying to get my camera going as a webcam (concord EyeQ Duo in PC # > mode, not HDD mode) with the 2.6.4 kernel using the se401 driver # > (compiled in).. It logged the following message, which doesn't mean much # > to me so I have no idea if it's useful information or not; # > # > May 3 21:08:11 mrsnorris kernel: usb 1-1: new full speed USB device # > using address 2 # > May 3 21:08:16 mrsnorris kernel: usb 1-1: control timeout on ep0out # > May 3 21:08:16 mrsnorris kernel: usb-storage: This device # > (0595,4343,0100 S 00 P 00) has an unneeded Protocol entry in unusual_devs.h # > May 3 21:08:16 mrsnorris kernel: Please send a copy of this message # > to # # This fixes the "unneeded Protocol entry" message. We never solved the # control timeout problem. # # Alan Stern # # # Signed-off-by: Greg Kroah-Hartman # # drivers/usb/storage/unusual_devs.h # 2004/05/03 04:15:35-07:00 stern@rowland.harvard.edu +1 -1 # USB: unusual_devs.h update # # ChangeSet # 2004/06/02 15:37:59-04:00 rl@hellgate.ch # [PATCH] Add rhine_power_init(): get power regs into sane state # # Add rhine_power_init(): get power regs into sane state. # Move the respective code out of rhine_init_one. Add code for # two additional patterns (Rhine III). # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +35 -20 # Add rhine_power_init(): get power regs into sane state # # ChangeSet # 2004/06/02 15:37:51-04:00 rl@hellgate.ch # [PATCH] Rewrite special-casing # # Use PCI revision to determine special cases. One bit field replaces a # bunch of data structures holding special case information. # # Replace chip_id, drv_flags in rhine_private with quirks # # Remove enum rhine_chips, struct rhine_chip_info (and array), # enum chip_capability_flags # # Add enum rhine_revs, enum rhine_quirks (some values in preparation for # subsequent changes) # # wait_for_reset() and enable_mmio() now use quirks instead of chip_id # # Remove model names from ident strings for now. # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +76 -58 # Rewrite special-casing # # ChangeSet # 2004/06/02 15:37:42-04:00 rl@hellgate.ch # [PATCH] Return codes for rhine_init_one # # Use return codes in rhine_init_one instead of -ENODEV for all errors. # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +15 -7 # Return codes for rhine_init_one # # ChangeSet # 2004/06/02 15:37:34-04:00 rl@hellgate.ch # [PATCH] Nuke all pci_flags # # All this code together can be replaced with a single #ifdef USE_MMIO. # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +11 -20 # Nuke all pci_flags # # ChangeSet # 2004/06/02 15:37:26-04:00 rl@hellgate.ch # [PATCH] Nuke default_port, references to if_port, medialock # # As is, code doesn't do anything useful. # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +0 -10 # Nuke default_port, references to if_port, medialock # # ChangeSet # 2004/06/02 15:37:18-04:00 rl@hellgate.ch # [PATCH] Nuke HasESIPhy and related code # # This has been dead code forever. # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +2 -3 # Nuke HasESIPhy and related code # # ChangeSet # 2004/06/02 15:37:09-04:00 rl@hellgate.ch # [PATCH] Nuke CanHaveMII and related code # # All Rhines can have a MII. # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +26 -40 # Nuke CanHaveMII and related code # # ChangeSet # 2004/06/02 15:37:01-04:00 rl@hellgate.ch # [PATCH] Nuke HAS_IP_COPYSUM # # HAS_IP_COPYSUM has been utterly meaningless for a long time. # # Signed-off-by: Roger Luethi # # drivers/net/via-rhine.c # 2004/06/01 20:00:00-04:00 rl@hellgate.ch +0 -5 # Nuke HAS_IP_COPYSUM # # ChangeSet # 2004/06/01 12:39:07-05:00 jejb@raven.il.steeleye.com # Merge # # drivers/scsi/sr_ioctl.c # 2004/06/01 12:38:49-05:00 jejb@raven.il.steeleye.com +0 -0 # SCCS merged # # drivers/scsi/sg.c # 2004/06/01 12:36:37-05:00 jejb@raven.il.steeleye.com +0 -0 # Auto merged # # drivers/scsi/scsi_devinfo.c # 2004/06/01 12:36:37-05:00 jejb@raven.il.steeleye.com +0 -0 # Auto merged # # drivers/scsi/constants.c # 2004/06/01 12:36:36-05:00 jejb@raven.il.steeleye.com +0 -0 # Auto merged # # ChangeSet # 2004/05/29 10:47:12-05:00 akpm@osdl.org # [PATCH] remove calls of obsolete scsi APIs in i2o_scsi # # From: Markus Lidel # # Here is a patch from Christoph Hellwig, which removes calls of the obsolete # scsi API in i2o_scsi. # # Signed-off-by: Andrew Morton # Signed-off-by: James Bottomley # # drivers/message/i2o/i2o_scsi.c # 2004/05/28 11:21:05-05:00 akpm@osdl.org +34 -57 # remove calls of obsolete scsi APIs in i2o_scsi # # ChangeSet # 2004/05/29 10:44:40-05:00 Markus.Lidel@shadowconnect.com # [PATCH] get I2O working with Adaptec's zero channel # # this patch now gets the mentioned controllers working with the I2O # subsystem. It tested on two different system with ASR-2005S and # ASR-2010S and reported as working. # # It's also tested on i686 and x86_64 with already working I2O controllers # without a problem. # # Signed-off-by: James Bottomley # # include/linux/i2o.h # 2004/05/24 18:53:22-05:00 Markus.Lidel@shadowconnect.com +9 -5 # get I2O working with Adaptec's zero channel # # drivers/message/i2o/i2o_scsi.c # 2004/05/24 18:56:46-05:00 Markus.Lidel@shadowconnect.com +3 -3 # get I2O working with Adaptec's zero channel # # drivers/message/i2o/i2o_core.c # 2004/05/24 19:07:35-05:00 Markus.Lidel@shadowconnect.com +104 -55 # get I2O working with Adaptec's zero channel # # drivers/message/i2o/i2o_config.c # 2004/05/24 16:57:44-05:00 Markus.Lidel@shadowconnect.com +1 -1 # get I2O working with Adaptec's zero channel # # drivers/message/i2o/i2o_block.c # 2004/05/24 18:56:06-05:00 Markus.Lidel@shadowconnect.com +4 -4 # get I2O working with Adaptec's zero channel # # ChangeSet # 2004/05/29 10:40:12-05:00 brking@us.ibm.com # [PATCH] ipr operational timeout oops # # This patch fixes an oops that can occur if an adapter times # out coming operational. # # Signed-off-by: James Bottomley # # drivers/scsi/ipr.h # 2004/05/26 22:30:13-05:00 brking@us.ibm.com +2 -2 # ipr operational timeout oops # # drivers/scsi/ipr.c # 2004/05/26 17:22:36-05:00 brking@us.ibm.com +1 -0 # ipr operational timeout oops # # ChangeSet # 2004/05/29 10:37:41-05:00 g.liakhovetski@gmx.de # [PATCH] tmscsim: convert to slave_... # # On Wed, 26 May 2004, Christoph Hellwig wrote: # > Looks like a way to go. I'm not sure what scan_device is supposed to # > do as I already wrote, but from looking at when it's set/cleared I'm # > pretty sure it tries to indicate whethere we're currently scanning for # > devices. And useing slave_alloc/slave_configure is a much safer way to # > find that out then guessing from the commands sent. # # Attached is a patch, that moves scan_device to # slave_alloc/_configure/_destroy, as you suggested (to be precise, as I # understood your suggestion:-)) # # Signed-off-by: James Bottomley # # drivers/scsi/tmscsim.h # 2004/05/27 17:52:39-05:00 g.liakhovetski@gmx.de +0 -2 # tmscsim: convert to slave_... # # drivers/scsi/tmscsim.c # 2004/05/27 17:57:12-05:00 g.liakhovetski@gmx.de +19 -14 # tmscsim: convert to slave_... # # drivers/scsi/scsiiom.c # 2004/05/27 17:32:23-05:00 g.liakhovetski@gmx.de +21 -41 # tmscsim: convert to slave_... # # drivers/scsi/dc390.h # 2004/05/27 17:57:23-05:00 g.liakhovetski@gmx.de +1 -13 # tmscsim: convert to slave_... # # ChangeSet # 2004/05/29 10:33:13-05:00 akpm@osdl.org # [PATCH] unchecked kmalloc in sr_audio_ioctl() # # From: "Luiz Fernando N. Capitulino" # # # Signed-off-by: Andrew Morton # Signed-off-by: James Bottomley # # drivers/scsi/sr_ioctl.c # 2004/05/26 11:03:15-05:00 akpm@osdl.org +3 -0 # unchecked kmalloc in sr_audio_ioctl() # # ChangeSet # 2004/05/29 10:31:04-05:00 g.liakhovetski@gmx.de # [PATCH] tmscsim: remove DeviceCnt # # On Wed, 26 May 2004, Christoph Hellwig wrote: # > On Sun, May 23, 2004 at 11:19:58PM +0200, Guennadi Liakhovetski wrote: # > > # > > Whereas, DCBCnt is incremented on slave_alloc, decremented on # > > slave_destroy and used in a couple more places. So, is it safe to assume # > > that DeviceCnt is redundant and remove it in a next patch?... Then it # > > might be already safe to move scan_devices as you suggest? # > # > Looks like a way to go. I'm not sure what scan_device is supposed to # > do as I already wrote, but from looking at when it's set/cleared I'm # > pretty sure it tries to indicate whethere we're currently scanning for # > devices. And useing slave_alloc/slave_configure is a much safer way to # > find that out then guessing from the commands sent. # # So, here's the first one - remove DeviceCnt. # # Signed-off-by: James Bottomley # # drivers/scsi/tmscsim.h # 2004/05/26 15:23:14-05:00 g.liakhovetski@gmx.de +2 -9 # tmscsim: remove DeviceCnt # # drivers/scsi/tmscsim.c # 2004/05/26 15:24:01-05:00 g.liakhovetski@gmx.de +1 -2 # tmscsim: remove DeviceCnt # # drivers/scsi/scsiiom.c # 2004/05/26 15:23:32-05:00 g.liakhovetski@gmx.de +0 -2 # tmscsim: remove DeviceCnt # # ChangeSet # 2004/05/29 10:28:07-05:00 g.liakhovetski@gmx.de # [PATCH] tmscsim: Update version after "new API" # # The "API-update" patch, just approved by Christoph deserves a new version. # # Signed-off-by: James Bottomley # # drivers/scsi/tmscsim.c # 2004/05/26 15:16:10-05:00 g.liakhovetski@gmx.de +2 -0 # tmscsim: Update version after "new API" # # drivers/scsi/dc390.h # 2004/05/26 15:16:08-05:00 g.liakhovetski@gmx.de +1 -1 # tmscsim: Update version after "new API" # # ChangeSet # 2004/05/29 10:24:44-05:00 davej@redhat.com # [PATCH] SCSI: Correct BELKIN card reader whitelist entry. # # Should be FORCELUN not SPARSELUN ? # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_devinfo.c # 2004/05/26 08:13:42-05:00 davej@redhat.com +1 -1 # SCSI: Correct BELKIN card reader whitelist entry. # # ChangeSet # 2004/05/29 10:22:47-05:00 davej@redhat.com # [PATCH] SCSI: more whitelist updates for usb card readers # # ATech 9-in-1 card reader. # Cbox 3 5 1/2 bay with 6in1 card reader # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_devinfo.c # 2004/05/26 07:44:43-05:00 davej@redhat.com +3 -0 # SCSI: more whitelist updates for usb card readers # # ChangeSet # 2004/05/29 10:20:15-05:00 akpm@osdl.org # [PATCH] Stop megaraid trashing other i960 based devices # # From: Alan Cox # # In 2.4 the megaraid driver was careful to avoid stepping on wrong devices. # Specifically the megaraid3 series devices used an intel pci ID (8086:1960) # which is the generic i960 identifier not their own. # # The code to do this in 2.4 worked for almost all cases, but even that code has # mysteriously vanished in 2.6 meaning the megaraid driver trashes stuff like # promise i2o cards and compaq management cards. # # The following patch puts back the 2.4 stuff + one additional check so that the # driver isn't quite as rude as it was before. # # Signed-off-by: James Bottomley # # drivers/scsi/megaraid.c # 2004/05/22 20:59:10-05:00 akpm@osdl.org +20 -0 # Stop megaraid trashing other i960 based devices # # ChangeSet # 2004/05/29 10:17:42-05:00 lcapitulino@prefeitura.sp.gov.br # [PATCH] qla1280.c warning fix. # # drivers/scsi/qla1280.c:3124: warning: `qla1280_64bit_start_scsi' defined but not used # # Signed-off-by: James Bottomley # # drivers/scsi/qla1280.c # 2004/04/13 12:56:24-05:00 lcapitulino@prefeitura.sp.gov.br +2 -2 # qla1280.c warning fix. # # ChangeSet # 2004/05/29 10:13:11-05:00 michaelc@cs.wisc.edu # [PATCH] SCSI: remove extra queue unplug calls # # blk_insert_request will do the right thing and either unplug the queue or # call the request_fn, so users of scsi_do_req do not need to call # generic_unplug_device themselves. The attached patch just removes that # call from scsi_lib.c and the sg driver after they do a scsi_do_req. # # Signed-off-by: James Bottomley # # drivers/scsi/sg.c # 2004/05/24 20:59:40-05:00 michaelc@cs.wisc.edu +0 -1 # SCSI: remove extra queue unplug calls # # drivers/scsi/scsi_lib.c # 2004/05/24 20:59:39-05:00 michaelc@cs.wisc.edu +0 -1 # SCSI: remove extra queue unplug calls # # ChangeSet # 2004/05/29 10:11:11-05:00 jejb@mulgrave.(none) # MPT Fusion driver 3.01.07 update # # From: "Moore, Eric Dean" # # Clean up backword compatibility with 2.4 kernel and older. Patch # provided by Christoph Hellwig # # Signed-off-by: James Bottomley # # drivers/message/fusion/mptscsih.h # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +0 -71 # MPT Fusion driver 3.01.07 update # # drivers/message/fusion/mptscsih.c # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +36 -37 # MPT Fusion driver 3.01.07 update # # drivers/message/fusion/mptlan.c # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +3 -16 # MPT Fusion driver 3.01.07 update # # drivers/message/fusion/mptctl.c # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +2 -66 # MPT Fusion driver 3.01.07 update # # drivers/message/fusion/mptbase.h # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +7 -3 # MPT Fusion driver 3.01.07 update # # drivers/message/fusion/mptbase.c # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +10 -8 # MPT Fusion driver 3.01.07 update # # drivers/message/fusion/linux_compat.h # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +0 -189 # MPT Fusion driver 3.01.07 update # # drivers/message/fusion/isense.c # 2004/05/29 10:10:51-05:00 jejb@mulgrave.(none) +0 -8 # MPT Fusion driver 3.01.07 update # # ChangeSet # 2004/05/29 10:06:35-05:00 davej@redhat.com # [PATCH] USB / SCSI multi-card reader whitelist updates. # # For more info see Red Hat bugzilla entries #85851 and #124048 # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_devinfo.c # 2004/05/04 11:44:37-05:00 davej@redhat.com +2 -0 # USB / SCSI multi-card reader whitelist updates. # # ChangeSet # 2004/05/29 10:04:10-05:00 brking@us.ibm.com # [PATCH] ipr driver version 2.0.8 # # Bump driver version # # Signed-off-by: James Bottomley # # drivers/scsi/ipr.h # 2004/05/23 21:48:22-05:00 brking@us.ibm.com +2 -2 # ipr driver version 2.0.8 # # ChangeSet # 2004/05/29 10:01:45-05:00 brking@us.ibm.com # [PATCH] ipr duplicate ioa reset fix # # This patch closes a window where if a device had a cancel all # outstanding as a result of a check condition and the adapter # was reset for some reason, a request sense would still be issued, # which would end up timing out and issuing an additional adapter # reset. It could also result in a leak of command blocks, depending # on when it timed out. # # Signed-off-by: James Bottomley # # drivers/scsi/ipr.c # 2004/05/23 21:43:47-05:00 brking@us.ibm.com +6 -0 # ipr duplicate ioa reset fix # # ChangeSet # 2004/05/29 09:59:59-05:00 brking@us.ibm.com # [PATCH] ipr scsi busy io hang # # Signed-off-by: James Bottomley # # drivers/scsi/ipr.c # 2004/05/23 21:40:15-05:00 brking@us.ibm.com +5 -1 # ipr scsi busy io hang # # ChangeSet # 2004/05/29 09:59:10-05:00 jejb@mulgrave.(none) # Convert tmcscsim to new probing interfaces # # From: Guennadi Liakhovetski # # Update the driver to use the new pci, scsi and # module interfaces. # # Modified with feedback from hch # # Signed-off-by: James Bottomley # # drivers/scsi/tmscsim.c # 2004/05/29 09:58:54-05:00 jejb@mulgrave.(none) +151 -98 # Convert tmcscsim to new probing interfaces # # drivers/scsi/scsiiom.c # 2004/05/29 09:58:54-05:00 jejb@mulgrave.(none) +12 -26 # Convert tmcscsim to new probing interfaces # # drivers/scsi/dc390.h # 2004/05/29 09:58:54-05:00 jejb@mulgrave.(none) +0 -1 # Convert tmcscsim to new probing interfaces # # ChangeSet # 2004/05/29 09:55:10-05:00 jejb@mulgrave.(none) # SCSI: slave_detach -> slave_destory comment fix # # From: Guennadi Liakhovetski # # Signed-off-by: James Bottomley # # include/scsi/scsi_host.h # 2004/05/29 09:54:55-05:00 jejb@mulgrave.(none) +2 -2 # SCSI: slave_detach -> slave_destory comment fix # # ChangeSet # 2004/05/29 09:48:47-05:00 hch@lst.de # [PATCH] move scsi debugging helpers and give them sane names # # - give the constants.c prettyprinting helpers proper scsi_ prefixed # names (and keep compat versions for 2.6.x) # - move them to include/scsi/scsi_dbg.h so now really only legacy stuff # is left in drivers/scsi/scsi.h # # Signed-off-by: James Bottomley # # drivers/scsi/scsi_syms.c # 2004/05/19 12:46:14-05:00 hch@lst.de +6 -6 # move scsi debugging helpers and give them sane names # # drivers/scsi/scsi.h # 2004/05/19 12:46:14-05:00 hch@lst.de +42 -15 # move scsi debugging helpers and give them sane names # # drivers/scsi/constants.c # 2004/05/19 12:46:14-05:00 hch@lst.de +11 -11 # move scsi debugging helpers and give them sane names # # include/scsi/scsi_dbg.h # 2004/05/13 03:45:25-05:00 hch@lst.de +18 -0 # move scsi debugging helpers and give them sane names # # include/scsi/scsi_dbg.h # 2004/05/13 03:45:25-05:00 hch@lst.de +0 -0 # BitKeeper file /home/jejb/BK/scsi-misc-2.6/include/scsi/scsi_dbg.h # # ChangeSet # 2004/05/27 15:21:03-04:00 herbert@gondor.apana.org.au # [NETDRV #2] Use driver-specific name for resources # # Here is the next part which uses a driver-specific name instead of # dev->name for resource allocations prior to netdev registration. # It also changes printks that are in direct response to errors in # resource allocations. # # drivers/net/zorro8390.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/yellowfin.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/wd.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/sunhme.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/sungem.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/sun3_82586.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/stnic.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/starfire.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/smc9194.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +5 -3 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/smc-ultra32.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/smc-ultra.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/smc-mca.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/r8169.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/oaknet.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ns83820.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ni52.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ne3210.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +6 -4 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ne2k_cbus.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ne2.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ne.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ne-h8300.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/natsemi.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/lp486e.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/lne390.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +5 -3 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/jazzsonic.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ibmlana.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/hp.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +5 -3 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/hp-plus.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/forcedeth.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +2 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/fmv18x.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ewrk3.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +2 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/eth16i.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -4 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/eepro.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/e2100.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/defxx.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/cs89x0.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/at1700.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +5 -3 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/apne.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/acenic.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/ac3200.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +4 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/82596.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +3 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/3c527.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +2 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/3c523.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/3c507.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +2 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/3c503.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +2 -2 # 2/x: [NETDRV] Use driver-specific name for resources # # drivers/net/3c501.c # 2004/05/22 13:40:55-04:00 herbert@gondor.apana.org.au +1 -1 # 2/x: [NETDRV] Use driver-specific name for resources # # ChangeSet # 2004/05/27 15:20:53-04:00 herbert@gondor.apana.org.au # [NETDRV #1] Ifdef builtin-only probe in ISA/MCA drivers # # Here is the bit which conditionalises the # builtin-only probe functions. # # drivers/net/wd.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/smc-ultra.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/ne2k_cbus.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/ne2.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/ne.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/ne-h8300.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/lne390.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/lance.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/isa-skeleton.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/hp100.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/hp.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/hp-plus.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/ewrk3.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/eth16i.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/es3210.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/eexpress.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/eepro.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/e2100.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/cs89x0.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +1 -1 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/ac3200.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/3c523.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/3c505.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -1 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # drivers/net/3c503.c # 2004/05/20 17:16:23-04:00 herbert@gondor.apana.org.au +2 -0 # 1/x: [NETDRV] Ifdef builtin-only probe in ISA/MCA drivers # # ChangeSet # 2004/05/27 13:38:57-04:00 rl@hellgate.ch # [PATCH] Nuke HAS_IP_COPYSUM for net drivers # # Entirely untested, but Obviously Correct(TM). HAS_IP_COPYSUM has been # utterly meaningless for a long time. # # drivers/net/yellowfin.c # 2004/05/25 14:46:47-04:00 rl@hellgate.ch +0 -5 # Nuke HAS_IP_COPYSUM for net drivers # # drivers/net/tulip/winbond-840.c # 2004/05/25 14:46:26-04:00 rl@hellgate.ch +0 -6 # Nuke HAS_IP_COPYSUM for net drivers # # drivers/net/natsemi.c # 2004/05/25 14:51:58-04:00 rl@hellgate.ch +0 -5 # Nuke HAS_IP_COPYSUM for net drivers # # drivers/net/epic100.c # 2004/05/25 14:45:55-04:00 rl@hellgate.ch +0 -5 # Nuke HAS_IP_COPYSUM for net drivers # # ChangeSet # 2004/05/25 01:32:47-04:00 len.brown@intel.com # [ACPI] PCI IRQ update (Bjorn Helgaas) # http://bugme.osdl.org/show_bug.cgi?id=2574 # # mp_parse_prt() and iosapic_parse_prt() used to allocate all # IRQs, whether devices needed them or not. Some devices # failed because the this method enabled unused PCI Interrupt # Link Devices, which disrupted active link devices. # # Now the PRT knowledge is pulled out of the arch # code and the IRQ allocation and IO-APIC programming # is done by pci_enable_device(). # This is also a step toward allowing the addition # of new root bridges and PRTs at run-time. # # The architecture supplies # # unsigned int # acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) # # which is called by acpi_pci_irq_enable(). ACPI supplies # all the information from the PRT, and the arch sets up # the routing and returns the IRQ it allocated. # # include/linux/acpi.h # 2004/05/25 01:32:34-04:00 len.brown@intel.com +1 -1 # PCI IRQ update (Bjorn Helgaas) # # include/asm-x86_64/mpspec.h # 2004/05/25 01:32:34-04:00 len.brown@intel.com +1 -1 # PCI IRQ update (Bjorn Helgaas) # # include/asm-ia64/iosapic.h # 2004/05/25 01:32:34-04:00 len.brown@intel.com +0 -1 # PCI IRQ update (Bjorn Helgaas) # # include/asm-i386/mpspec.h # 2004/05/25 01:32:34-04:00 len.brown@intel.com +1 -1 # PCI IRQ update (Bjorn Helgaas) # # include/acpi/acpi_drivers.h # 2004/05/25 01:32:34-04:00 len.brown@intel.com +1 -1 # PCI IRQ update (Bjorn Helgaas) # # drivers/serial/8250_hcdp.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +4 -8 # PCI IRQ update (Bjorn Helgaas) # # drivers/serial/8250_acpi.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +6 -16 # PCI IRQ update (Bjorn Helgaas) # # drivers/acpi/tables.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +3 -3 # PCI IRQ update (Bjorn Helgaas) # # drivers/acpi/pci_link.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +2 -2 # PCI IRQ update (Bjorn Helgaas) # # drivers/acpi/pci_irq.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +36 -83 # PCI IRQ update (Bjorn Helgaas) # # arch/x86_64/kernel/mpparse.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +39 -76 # PCI IRQ update (Bjorn Helgaas) # # arch/ia64/pci/pci.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +12 -4 # PCI IRQ update (Bjorn Helgaas) # # arch/ia64/kernel/iosapic.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +80 -129 # PCI IRQ update (Bjorn Helgaas) # # arch/ia64/kernel/acpi.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +8 -15 # PCI IRQ update (Bjorn Helgaas) # # arch/i386/pci/acpi.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +23 -8 # PCI IRQ update (Bjorn Helgaas) # # arch/i386/kernel/mpparse.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +38 -78 # PCI IRQ update (Bjorn Helgaas) # # arch/i386/kernel/acpi/boot.c # 2004/05/25 01:32:34-04:00 len.brown@intel.com +28 -0 # PCI IRQ update (Bjorn Helgaas) # # ChangeSet # 2004/05/22 23:32:21-04:00 len.brown@intel.com # Kconfig typo fix from Jochen Voss # # drivers/acpi/Kconfig # 2004/04/05 06:54:30-04:00 len.brown@intel.com +1 -1 # Kconfig typo fix from Jochen Voss # diff -Nru a/CREDITS b/CREDITS --- a/CREDITS 2004-06-23 19:04:27 -07:00 +++ b/CREDITS 2004-06-23 19:04:27 -07:00 @@ -2267,8 +2267,8 @@ N: Eberhard Moenkeberg E: emoenke@gwdg.de D: CDROM driver "sbpcd" (Matsushita/Panasonic/Soundblaster) -S: Reinholdstrasse 14 -S: D-37083 Goettingen +S: Ruhstrathoehe 2 b. +S: D-37085 Goettingen S: Germany N: Thomas Molina @@ -2571,6 +2571,14 @@ D: sonypi, meye drivers, mct_u232 usb serial hacks S: Paris, France +N: Matt Porter +E: mporter@kernel.crashing.org +D: Motorola PowerPC PReP support +D: cPCI PowerPC support +D: Embedded PowerPC 4xx/6xx/7xx/74xx support +S: Chandler, Arizona 85249 +S: USA + N: Frederic Potter E: fpotter@cirpack.com D: Some PCI kernel support @@ -3109,12 +3117,13 @@ S: USA N: Marcelo W. Tosatti -E: marcelo@conectiva.com.br -W: http://bazar.conectiva.com.br/~marcelo/ -D: Miscellaneous kernel hacker (mostly VM/MM work) -S: Conectiva S.A. -S: R. Tocantins, 89 - Cristo Rei -S: 80050-430 - Curitiba - Paraná +E: marcelo.tosatti@cyclades.com +D: Miscellaneous kernel hacker +D: v2.4 kernel maintainer +D: Current pc300/cyclades maintainer +S: Cyclades Corporation +S: Av Cristovao Colombo, 462. Floresta. +S: Porto Alegre S: Brazil N: Stefan Traby diff -Nru a/Documentation/arm/Sharp-LH/SDRAM b/Documentation/arm/Sharp-LH/SDRAM --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/arm/Sharp-LH/SDRAM 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,51 @@ +README on the SDRAM Controller for the LH7a40X +============================================== + +The standard configuration for the SDRAM controller generates a sparse +memory array. The precise layout is determined by the SDRAM chips. A +default kernel configuration assembles the discontiguous memory +regions into separate memory nodes via the NUMA (Non-Uniform Memory +Architecture) facilities. In this default configuration, the kernel +is forgiving about the precise layout. As long as it is given an +accurate picture of available memory by the bootloader the kernel will +execute correctly. + +The SDRC supports a mode where some of the chip select lines are +swapped in order to make SDRAM look like a synchronous ROM. Setting +this bit means that the RAM will present as a contiguous array. Some +programmers prefer this to the discontiguous layout. Be aware that +may be a penalty for this feature where some some configurations of +memory are significantly reduced; i.e. 64MiB of RAM appears as only 32 +MiB. + +There are a couple of configuration options to override the default +behavior. When the SROMLL bit is set and memory appears as a +contiguous array, there is no reason to support NUMA. +CONFIG_LH7A40X_CONTIGMEM disables NUMA support. When physical memory +is discontiguous, the memory tables are organized such that there are +two banks per nodes with a small gap between them. This layout wastes +some kernel memory for page tables representing non-existent memory. +CONFIG_LH7A40X_ONE_BANK_PER_NODE optimizes the node tables such that +there are no gaps. These options control the low level organization +of the memory management tables in ways that may prevent the kernel +from booting or may cause the kernel to allocated excessively large +page tables. Be warned. Only change these options if you know what +you are doing. The default behavior is a reasonable compromise that +will suit all users. + +-- + +A typical 32MiB system with the default configuration options will +find physical memory managed as follows. + + node 0: 0xc0000000 4MiB + 0xc1000000 4MiB + node 1: 0xc4000000 4MiB + 0xc5000000 4MiB + node 2: 0xc8000000 4MiB + 0xc9000000 4MiB + node 3: 0xcc000000 4MiB + 0xcd000000 4MiB + +Setting CONFIG_LH7A40X_ONE_BANK_PER_NODE will put each bank into a +separate node. diff -Nru a/Documentation/arm/VFP/release-notes.txt b/Documentation/arm/VFP/release-notes.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/arm/VFP/release-notes.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,55 @@ +Release notes for Linux Kernel VFP support code +----------------------------------------------- + +Date: 20 May 2004 +Author: Russell King + +This is the first release of the Linux Kernel VFP support code. It +provides support for the exceptions bounced from VFP hardware found +on ARM926EJ-S. + +This release has been validated against the SoftFloat-2b library by +John R. Hauser using the TestFloat-2a test suite. Details of this +library and test suite can be found at: + + http://www.cs.berkeley.edu/~jhauser/arithmetic/SoftFloat.html + +The operations which have been tested with this package are: + + - fdiv + - fsub + - fadd + - fmul + - fcmp + - fcmpe + - fcvtd + - fcvts + - fsito + - ftosi + - fsqrt + +All the above pass softfloat tests with the following exceptions: + +- fadd/fsub shows some differences in the handling of +0 / -0 results + when input operands differ in signs. +- the handling of underflow exceptions is slightly different. If a + result underflows before rounding, but becomes a normalised number + after rounding, we do not signal an underflow exception. + +Other operations which have been tested by basic assembly-only tests +are: + + - fcpy + - fabs + - fneg + - ftoui + - ftosiz + - ftouiz + +The combination operations have not been tested: + + - fmac + - fnmac + - fmsc + - fnmsc + - fnmul diff -Nru a/Documentation/as-iosched.txt b/Documentation/as-iosched.txt --- a/Documentation/as-iosched.txt 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,165 +0,0 @@ -Anticipatory IO scheduler -------------------------- -Nick Piggin 13 Sep 2003 - -Attention! Database servers, especially those using "TCQ" disks should -investigate performance with the 'deadline' IO scheduler. Any system with high -disk performance requirements should do so, in fact. - -If you see unusual performance characteristics of your disk systems, or you -see big performance regressions versus the deadline scheduler, please email -me. Database users don't bother unless you're willing to test a lot of patches -from me ;) its a known issue. - -Also, users with hardware RAID controllers, doing striping, may find -highly variable performance results with using the as-iosched. The -as-iosched anticipatory implementation is based on the notion that a disk -device has only one physical seeking head. A striped RAID controller -actually has a head for each physical device in the logical RAID device. - -However, setting the antic_expire (see tunable parameters below) produces -very similar behavior to the deadline IO scheduler. - - -Selecting IO schedulers ------------------------ -To choose IO schedulers at boot time, use the argument 'elevator=deadline'. -'noop' and 'as' (the default) are also available. IO schedulers are assigned -globally at boot time only presently. - - -Anticipatory IO scheduler Policies ----------------------------------- -The as-iosched implementation implements several layers of policies -to determine when an IO request is dispatched to the disk controller. -Here are the policies outlined, in order of application. - -1. one-way Elevator algorithm. - -The elevator algorithm is similar to that used in deadline scheduler, with -the addition that it allows limited backward movement of the elevator -(i.e. seeks backwards). A seek backwards can occur when choosing between -two IO requests where one is behind the elevator's current position, and -the other is in front of the elevator's position. If the seek distance to -the request in back of the elevator is less than half the seek distance to -the request in front of the elevator, then the request in back can be chosen. -Backward seeks are also limited to a maximum of MAXBACK (1024*1024) sectors. -This favors forward movement of the elevator, while allowing opportunistic -"short" backward seeks. - -2. FIFO expiration times for reads and for writes. - -This is again very similar to the deadline IO scheduler. The expiration -times for requests on these lists is tunable using the parameters read_expire -and write_expire discussed below. When a read or a write expires in this way, -the IO scheduler will interrupt its current elevator sweep or read anticipation -to service the expired request. - -3. Read and write request batching - -A batch is a collection of read requests or a collection of write -requests. The as scheduler alternates dispatching read and write batches -to the driver. In the case a read batch, the scheduler submits read -requests to the driver as long as there are read requests to submit, and -the read batch time limit has not been exceeded (read_batch_expire). -The read batch time limit begins counting down only when there are -competing write requests pending. - -In the case of a write batch, the scheduler submits write requests to -the driver as long as there are write requests available, and the -write batch time limit has not been exceeded (write_batch_expire). -However, the length of write batches will be gradually shortened -when read batches frequently exceed their time limit. - -When changing between batch types, the scheduler waits for all requests -from the previous batch to complete before scheduling requests for the -next batch. - -The read and write fifo expiration times described in policy 2 above -are checked only when in scheduling IO of a batch for the corresponding -(read/write) type. So for example, the read FIFO timeout values are -tested only during read batches. Likewise, the write FIFO timeout -values are tested only during write batches. For this reason, -it is generally not recommended for the read batch time -to be longer than the write expiration time, nor for the write batch -time to exceed the read expiration time (see tunable parameters below). - -When the IO scheduler changes from a read to a write batch, -it begins the elevator from the request that is on the head of the -write expiration FIFO. Likewise, when changing from a write batch to -a read batch, scheduler begins the elevator from the first entry -on the read expiration FIFO. - -4. Read anticipation. - -Read anticipation occurs only when scheduling a read batch. -This implementation of read anticipation allows only one read request -to be dispatched to the disk controller at a time. In -contrast, many write requests may be dispatched to the disk controller -at a time during a write batch. It is this characteristic that can make -the anticipatory scheduler perform anomalously with controllers supporting -TCQ, or with hardware striped RAID devices. Setting the antic_expire -queue paramter (see below) to zero disables this behavior, and the anticipatory -scheduler behaves essentially like the deadline scheduler. - -When read anticipation is enabled (antic_expire is not zero), reads -are dispatched to the disk controller one at a time. -At the end of each read request, the IO scheduler examines its next -candidate read request from its sorted read list. If that next request -is from the same process as the request that just completed, -or if the next request in the queue is "very close" to the -just completed request, it is dispatched immediately. Otherwise, -statistics (average think time, average seek distance) on the process -that submitted the just completed request are examined. If it seems -likely that that process will submit another request soon, and that -request is likely to be near the just completed request, then the IO -scheduler will stop dispatching more read requests for up time (antic_expire) -milliseconds, hoping that process will submit a new request near the one -that just completed. If such a request is made, then it is dispatched -immediately. If the antic_expire wait time expires, then the IO scheduler -will dispatch the next read request from the sorted read queue. - -To decide whether an anticipatory wait is worthwhile, the scheduler -maintains statistics for each process that can be used to compute -mean "think time" (the time between read requests), and mean seek -distance for that process. One observation is that these statistics -are associated with each process, but those statistics are not associated -with a specific IO device. So for example, if a process is doing IO -on several file systems on separate devices, the statistics will be -a combination of IO behavior from all those devices. - - -Tuning the anticipatory IO scheduler ------------------------------------- -When using 'as', the anticipatory IO scheduler there are 5 parameters under -/sys/block/*/iosched/. All are units of milliseconds. - -The parameters are: -* read_expire - Controls how long until a read request becomes "expired". It also controls the - interval between which expired requests are served, so set to 50, a request - might take anywhere < 100ms to be serviced _if_ it is the next on the - expired list. Obviously request expiration strategies won't make the disk - go faster. The result basically equates to the timeslice a single reader - gets in the presence of other IO. 100*((seek time / read_expire) + 1) is - very roughly the % streaming read efficiency your disk should get with - multiple readers. - -* read_batch_expire - Controls how much time a batch of reads is given before pending writes are - served. A higher value is more efficient. This might be set below read_expire - if writes are to be given higher priority than reads, but reads are to be - as efficient as possible when there are no writes. Generally though, it - should be some multiple of read_expire. - -* write_expire, and -* write_batch_expire are equivalent to the above, for writes. - -* antic_expire - Controls the maximum amount of time we can anticipate a good read (one - with a short seek distance from the most recently completed request) before - giving up. Many other factors may cause anticipation to be stopped early, - or some processes will not be "anticipated" at all. Should be a bit higher - for big seek time devices though not a linear correspondence - most - processes have only a few ms thinktime. - diff -Nru a/Documentation/binfmt_misc.txt b/Documentation/binfmt_misc.txt --- a/Documentation/binfmt_misc.txt 2004-06-23 19:04:29 -07:00 +++ b/Documentation/binfmt_misc.txt 2004-06-23 19:04:29 -07:00 @@ -15,7 +15,7 @@ mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc To actually register a new binary type, you have to set up a string looking like -:name:type:offset:magic:mask:interpreter: (where you can choose the ':' upon +:name:type:offset:magic:mask:interpreter:flags (where you can choose the ':' upon your needs) and echo it to /proc/sys/fs/binfmt_misc/register. Here is what the fields mean: - 'name' is an identifier string. A new /proc file will be created with this @@ -34,6 +34,28 @@ The mask is anded with the byte sequence of the file. - 'interpreter' is the program that should be invoked with the binary as first argument (specify the full path) + - 'flags' is an optional field that controls several aspects of the invocation + of the interpreter. It is a string of capital letters, each controls a certain + aspect. The following flags are supported - + 'P' - preserve-argv[0]. Legacy behavior of binfmt_misc is to overwrite the + original argv[0] with the full path to the binary. When this flag is + included, binfmt_misc will add an argument to the argument vector for + this purpose, thus preserving the original argv[0]. + 'O' - open-binary. Legacy behavior of binfmt_misc is to pass the full path + of the binary to the interpreter as an argument. When this flag is + included, binfmt_misc will open the file for reading and pass its + descriptor as an argument, instead of the full path, thus allowing + the interpreter to execute non-readable binaries. This feature should + be used with care - the interpreter has to be trusted not to emit + the contents of the non-readable binary. + 'C' - credentials. Currently, the behavior of binfmt_misc is to calculate + the credentials and security token of the new process according to + the interpreter. When this flag is included, these attributes are + calculated according to the binary. It also implies the 'O' flag. + This feature should be used with care as the interpreter + will run with root permissions when a setuid binary owned by root + is run with binfmt_misc. + There are some restrictions: - the whole register string may not exceed 255 characters @@ -83,9 +105,9 @@ write a wrapper script for it. See Documentation/java.txt for an example. -Your interpreter should NOT look in the PATH for the filename; the -kernel passes it the full filename to use. Using the PATH can cause -unexpected behaviour and be a security hazard. +Your interpreter should NOT look in the PATH for the filename; the kernel +passes it the full filename (or the file descriptor) to use. Using $PATH can +cause unexpected behaviour and can be a security hazard. There is a web page about binfmt_misc at diff -Nru a/Documentation/block/as-iosched.txt b/Documentation/block/as-iosched.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/block/as-iosched.txt 2004-06-23 19:04:26 -07:00 @@ -0,0 +1,165 @@ +Anticipatory IO scheduler +------------------------- +Nick Piggin 13 Sep 2003 + +Attention! Database servers, especially those using "TCQ" disks should +investigate performance with the 'deadline' IO scheduler. Any system with high +disk performance requirements should do so, in fact. + +If you see unusual performance characteristics of your disk systems, or you +see big performance regressions versus the deadline scheduler, please email +me. Database users don't bother unless you're willing to test a lot of patches +from me ;) its a known issue. + +Also, users with hardware RAID controllers, doing striping, may find +highly variable performance results with using the as-iosched. The +as-iosched anticipatory implementation is based on the notion that a disk +device has only one physical seeking head. A striped RAID controller +actually has a head for each physical device in the logical RAID device. + +However, setting the antic_expire (see tunable parameters below) produces +very similar behavior to the deadline IO scheduler. + + +Selecting IO schedulers +----------------------- +To choose IO schedulers at boot time, use the argument 'elevator=deadline'. +'noop' and 'as' (the default) are also available. IO schedulers are assigned +globally at boot time only presently. + + +Anticipatory IO scheduler Policies +---------------------------------- +The as-iosched implementation implements several layers of policies +to determine when an IO request is dispatched to the disk controller. +Here are the policies outlined, in order of application. + +1. one-way Elevator algorithm. + +The elevator algorithm is similar to that used in deadline scheduler, with +the addition that it allows limited backward movement of the elevator +(i.e. seeks backwards). A seek backwards can occur when choosing between +two IO requests where one is behind the elevator's current position, and +the other is in front of the elevator's position. If the seek distance to +the request in back of the elevator is less than half the seek distance to +the request in front of the elevator, then the request in back can be chosen. +Backward seeks are also limited to a maximum of MAXBACK (1024*1024) sectors. +This favors forward movement of the elevator, while allowing opportunistic +"short" backward seeks. + +2. FIFO expiration times for reads and for writes. + +This is again very similar to the deadline IO scheduler. The expiration +times for requests on these lists is tunable using the parameters read_expire +and write_expire discussed below. When a read or a write expires in this way, +the IO scheduler will interrupt its current elevator sweep or read anticipation +to service the expired request. + +3. Read and write request batching + +A batch is a collection of read requests or a collection of write +requests. The as scheduler alternates dispatching read and write batches +to the driver. In the case a read batch, the scheduler submits read +requests to the driver as long as there are read requests to submit, and +the read batch time limit has not been exceeded (read_batch_expire). +The read batch time limit begins counting down only when there are +competing write requests pending. + +In the case of a write batch, the scheduler submits write requests to +the driver as long as there are write requests available, and the +write batch time limit has not been exceeded (write_batch_expire). +However, the length of write batches will be gradually shortened +when read batches frequently exceed their time limit. + +When changing between batch types, the scheduler waits for all requests +from the previous batch to complete before scheduling requests for the +next batch. + +The read and write fifo expiration times described in policy 2 above +are checked only when in scheduling IO of a batch for the corresponding +(read/write) type. So for example, the read FIFO timeout values are +tested only during read batches. Likewise, the write FIFO timeout +values are tested only during write batches. For this reason, +it is generally not recommended for the read batch time +to be longer than the write expiration time, nor for the write batch +time to exceed the read expiration time (see tunable parameters below). + +When the IO scheduler changes from a read to a write batch, +it begins the elevator from the request that is on the head of the +write expiration FIFO. Likewise, when changing from a write batch to +a read batch, scheduler begins the elevator from the first entry +on the read expiration FIFO. + +4. Read anticipation. + +Read anticipation occurs only when scheduling a read batch. +This implementation of read anticipation allows only one read request +to be dispatched to the disk controller at a time. In +contrast, many write requests may be dispatched to the disk controller +at a time during a write batch. It is this characteristic that can make +the anticipatory scheduler perform anomalously with controllers supporting +TCQ, or with hardware striped RAID devices. Setting the antic_expire +queue paramter (see below) to zero disables this behavior, and the anticipatory +scheduler behaves essentially like the deadline scheduler. + +When read anticipation is enabled (antic_expire is not zero), reads +are dispatched to the disk controller one at a time. +At the end of each read request, the IO scheduler examines its next +candidate read request from its sorted read list. If that next request +is from the same process as the request that just completed, +or if the next request in the queue is "very close" to the +just completed request, it is dispatched immediately. Otherwise, +statistics (average think time, average seek distance) on the process +that submitted the just completed request are examined. If it seems +likely that that process will submit another request soon, and that +request is likely to be near the just completed request, then the IO +scheduler will stop dispatching more read requests for up time (antic_expire) +milliseconds, hoping that process will submit a new request near the one +that just completed. If such a request is made, then it is dispatched +immediately. If the antic_expire wait time expires, then the IO scheduler +will dispatch the next read request from the sorted read queue. + +To decide whether an anticipatory wait is worthwhile, the scheduler +maintains statistics for each process that can be used to compute +mean "think time" (the time between read requests), and mean seek +distance for that process. One observation is that these statistics +are associated with each process, but those statistics are not associated +with a specific IO device. So for example, if a process is doing IO +on several file systems on separate devices, the statistics will be +a combination of IO behavior from all those devices. + + +Tuning the anticipatory IO scheduler +------------------------------------ +When using 'as', the anticipatory IO scheduler there are 5 parameters under +/sys/block/*/iosched/. All are units of milliseconds. + +The parameters are: +* read_expire + Controls how long until a read request becomes "expired". It also controls the + interval between which expired requests are served, so set to 50, a request + might take anywhere < 100ms to be serviced _if_ it is the next on the + expired list. Obviously request expiration strategies won't make the disk + go faster. The result basically equates to the timeslice a single reader + gets in the presence of other IO. 100*((seek time / read_expire) + 1) is + very roughly the % streaming read efficiency your disk should get with + multiple readers. + +* read_batch_expire + Controls how much time a batch of reads is given before pending writes are + served. A higher value is more efficient. This might be set below read_expire + if writes are to be given higher priority than reads, but reads are to be + as efficient as possible when there are no writes. Generally though, it + should be some multiple of read_expire. + +* write_expire, and +* write_batch_expire are equivalent to the above, for writes. + +* antic_expire + Controls the maximum amount of time we can anticipate a good read (one + with a short seek distance from the most recently completed request) before + giving up. Many other factors may cause anticipation to be stopped early, + or some processes will not be "anticipated" at all. Should be a bit higher + for big seek time devices though not a linear correspondence - most + processes have only a few ms thinktime. + diff -Nru a/Documentation/block/deadline-iosched.txt b/Documentation/block/deadline-iosched.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/block/deadline-iosched.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,78 @@ +Deadline IO scheduler tunables +============================== + +This little file attempts to document how the deadline io scheduler works. +In particular, it will clarify the meaning of the exposed tunables that may be +of interest to power users. + +Each io queue has a set of io scheduler tunables associated with it. These +tunables control how the io scheduler works. You can find these entries +in: + +/sys/block//iosched + +assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted, +you can do so by typing: + +# mount none /sys -t sysfs + + +******************************************************************************** + + +read_expire (in ms) +----------- + +The goal of the deadline io scheduler is to attempt to guarentee a start +service time for a request. As we focus mainly on read latencies, this is +tunable. When a read request first enters the io scheduler, it is assigned +a deadline that is the current time + the read_expire value in units of +miliseconds. + + +write_expire (in ms) +----------- + +Similar to read_expire mentioned above, but for writes. + + +fifo_batch +---------- + +When a read request expires its deadline, we must move some requests from +the sorted io scheduler list to the block device dispatch queue. fifo_batch +controls how many requests we move, based on the cost of each request. A +request is either qualified as a seek or a stream. The io scheduler knows +the last request that was serviced by the drive (or will be serviced right +before this one). See seek_cost and stream_unit. + + +write_starved (number of dispatches) +------------- + +When we have to move requests from the io scheduler queue to the block +device dispatch queue, we always give a preference to reads. However, we +don't want to starve writes indefinitely either. So writes_starved controls +how many times we give preference to reads over writes. When that has been +done writes_starved number of times, we dispatch some writes based on the +same criteria as reads. + + +front_merges (bool) +------------ + +Sometimes it happens that a request enters the io scheduler that is contigious +with a request that is already on the queue. Either it fits in the back of that +request, or it fits at the front. That is called either a back merge candidate +or a front merge candidate. Due to the way files are typically laid out, +back merges are much more common than front merges. For some work loads, you +may even know that it is a waste of time to spend any time attempting to +front merge requests. Setting front_merges to 0 disables this functionality. +Front merges may still occur due to the cached last_merge hint, but since +that comes at basically 0 cost we leave that on. We simply disable the +rbtree front sector lookup when the io scheduler merge function is called. + + +Nov 11 2002, Jens Axboe + + diff -Nru a/Documentation/device-mapper/dm-io.txt b/Documentation/device-mapper/dm-io.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/device-mapper/dm-io.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,75 @@ +dm-io +===== + +Dm-io provides synchronous and asynchronous I/O services. There are three +types of I/O services available, and each type has a sync and an async +version. + +The user must set up an io_region structure to describe the desired location +of the I/O. Each io_region indicates a block-device along with the starting +sector and size of the region. + + struct io_region { + struct block_device *bdev; + sector_t sector; + sector_t count; + }; + +Dm-io can read from one io_region or write to one or more io_regions. Writes +to multiple regions are specified by an array of io_region structures. + +The first I/O service type takes a list of memory pages as the data buffer for +the I/O, along with an offset into the first page. + + struct page_list { + struct page_list *next; + struct page *page; + }; + + int dm_io_sync(unsigned int num_regions, struct io_region *where, int rw, + struct page_list *pl, unsigned int offset, + unsigned long *error_bits); + int dm_io_async(unsigned int num_regions, struct io_region *where, int rw, + struct page_list *pl, unsigned int offset, + io_notify_fn fn, void *context); + +The second I/O service type takes an array of bio vectors as the data buffer +for the I/O. This service can be handy if the caller has a pre-assembled bio, +but wants to direct different portions of the bio to different devices. + + int dm_io_sync_bvec(unsigned int num_regions, struct io_region *where, + int rw, struct bio_vec *bvec, + unsigned long *error_bits); + int dm_io_async_bvec(unsigned int num_regions, struct io_region *where, + int rw, struct bio_vec *bvec, + io_notify_fn fn, void *context); + +The third I/O service type takes a pointer to a vmalloc'd memory buffer as the +data buffer for the I/O. This service can be handy if the caller needs to do +I/O to a large region but doesn't want to allocate a large number of individual +memory pages. + + int dm_io_sync_vm(unsigned int num_regions, struct io_region *where, int rw, + void *data, unsigned long *error_bits); + int dm_io_async_vm(unsigned int num_regions, struct io_region *where, int rw, + void *data, io_notify_fn fn, void *context); + +Callers of the asynchronous I/O services must include the name of a completion +callback routine and a pointer to some context data for the I/O. + + typedef void (*io_notify_fn)(unsigned long error, void *context); + +The "error" parameter in this callback, as well as the "*error" parameter in +all of the synchronous versions, is a bitset (instead of a simple error value). +In the case of an write-I/O to multiple regions, this bitset allows dm-io to +indicate success or failure on each individual region. + +Before using any of the dm-io services, the user should call dm_io_get() +and specify the number of pages they expect to perform I/O on concurrently. +Dm-io will attempt to resize its mempool to make sure enough pages are +always available in order to avoid unnecessary waiting while performing I/O. + +When the user is finished using the dm-io services, they should call +dm_io_put() and specify the same number of pages that were given on the +dm_io_get() call. + diff -Nru a/Documentation/device-mapper/kcopyd.txt b/Documentation/device-mapper/kcopyd.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/device-mapper/kcopyd.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,47 @@ +kcopyd +====== + +Kcopyd provides the ability to copy a range of sectors from one block-device +to one or more other block-devices, with an asynchronous completion +notification. It is used by dm-snapshot and dm-mirror. + +Users of kcopyd must first create a client and indicate how many memory pages +to set aside for their copy jobs. This is done with a call to +kcopyd_client_create(). + + int kcopyd_client_create(unsigned int num_pages, + struct kcopyd_client **result); + +To start a copy job, the user must set up io_region structures to describe +the source and destinations of the copy. Each io_region indicates a +block-device along with the starting sector and size of the region. The source +of the copy is given as one io_region structure, and the destinations of the +copy are given as an array of io_region structures. + + struct io_region { + struct block_device *bdev; + sector_t sector; + sector_t count; + }; + +To start the copy, the user calls kcopyd_copy(), passing in the client +pointer, pointers to the source and destination io_regions, the name of a +completion callback routine, and a pointer to some context data for the copy. + + int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from, + unsigned int num_dests, struct io_region *dests, + unsigned int flags, kcopyd_notify_fn fn, void *context); + + typedef void (*kcopyd_notify_fn)(int read_err, unsigned int write_err, + void *context); + +When the copy completes, kcopyd will call the user's completion routine, +passing back the user's context pointer. It will also indicate if a read or +write error occurred during the copy. + +When a user is done with all their copy jobs, they should call +kcopyd_client_destroy() to delete the kcopyd client, which will release the +associated memory pages. + + void kcopyd_client_destroy(struct kcopyd_client *kc); + diff -Nru a/Documentation/device-mapper/linear.txt b/Documentation/device-mapper/linear.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/device-mapper/linear.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,61 @@ +dm-linear +========= + +Device-Mapper's "linear" target maps a linear range of the Device-Mapper +device onto a linear range of another device. This is the basic building +block of logical volume managers. + +Parameters: + : Full pathname to the underlying block-device, or a + "major:minor" device-number. + : Starting sector within the device. + + +Example scripts +=============== +[[ +#!/bin/sh +# Create an identity mapping for a device +echo "0 `blockdev --getsize $1` linear $1 0" | dmsetup create identity +]] + + +[[ +#!/bin/sh +# Join 2 devices together +size1=`blockdev --getsize $1` +size2=`blockdev --getsize $2` +echo "0 $size1 linear $1 0 +$size1 $size2 linear $2 0" | dmsetup create joined +]] + + +[[ +#!/usr/bin/perl -w +# Split a device into 4M chunks and then join them together in reverse order. + +my $name = "reverse"; +my $extent_size = 4 * 1024 * 2; +my $dev = $ARGV[0]; +my $table = ""; +my $count = 0; + +if (!defined($dev)) { + die("Please specify a device.\n"); +} + +my $dev_size = `blockdev --getsize $dev`; +my $extents = int($dev_size / $extent_size) - + (($dev_size % $extent_size) ? 1 : 0); + +while ($extents > 0) { + my $this_start = $count * $extent_size; + $extents--; + $count++; + my $this_offset = $extents * $extent_size; + + $table .= "$this_start $extent_size linear $dev $this_offset\n"; +} + +`echo \"$table\" | dmsetup create $name`; +]] diff -Nru a/Documentation/device-mapper/striped.txt b/Documentation/device-mapper/striped.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/device-mapper/striped.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,58 @@ +dm-stripe +========= + +Device-Mapper's "striped" target is used to create a striped (i.e. RAID-0) +device across one or more underlying devices. Data is written in "chunks", +with consecutive chunks rotating among the underlying devices. This can +potentially provide improved I/O throughput by utilizing several physical +devices in parallel. + +Parameters: [ ]+ + : Number of underlying devices. + : Size of each chunk of data. Must be a power-of-2 and at + least as large as the system's PAGE_SIZE. + : Full pathname to the underlying block-device, or a + "major:minor" device-number. + : Starting sector within the device. + +One or more underlying devices can be specified. The striped device size must +be a multiple of the chunk size and a multiple of the number of underlying +devices. + + +Example scripts +=============== + +[[ +#!/usr/bin/perl -w +# Create a striped device across any number of underlying devices. The device +# will be called "stripe_dev" and have a chunk-size of 128k. + +my $chunk_size = 128 * 2; +my $dev_name = "stripe_dev"; +my $num_devs = @ARGV; +my @devs = @ARGV; +my ($min_dev_size, $stripe_dev_size, $i); + +if (!$num_devs) { + die("Specify at least one device\n"); +} + +$min_dev_size = `blockdev --getsize $devs[0]`; +for ($i = 1; $i < $num_devs; $i++) { + my $this_size = `blockdev --getsize $devs[$i]`; + $min_dev_size = ($min_dev_size < $this_size) ? + $min_dev_size : $this_size; +} + +$stripe_dev_size = $min_dev_size * $num_devs; +$stripe_dev_size -= $stripe_dev_size % ($chunk_size * $num_devs); + +$table = "0 $stripe_dev_size striped $num_devs $chunk_size"; +for ($i = 0; $i < $num_devs; $i++) { + $table .= " $devs[$i] 0"; +} + +`echo $table | dmsetup create $dev_name`; +]] + diff -Nru a/Documentation/device-mapper/zero.txt b/Documentation/device-mapper/zero.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/device-mapper/zero.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,37 @@ +dm-zero +======= + +Device-Mapper's "zero" target provides a block-device that always returns +zero'd data on reads and silently drops writes. This is similar behavior to +/dev/zero, but as a block-device instead of a character-device. + +Dm-zero has no target-specific parameters. + +One very interesting use of dm-zero is for creating "sparse" devices in +conjunction with dm-snapshot. A sparse device reports a device-size larger +than the amount of actual storage space available for that device. A user can +write data anywhere within the sparse device and read it back like a normal +device. Reads to previously unwritten areas will return a zero'd buffer. When +enough data has been written to fill up the actual storage space, the sparse +device is deactivated. This can be very useful for testing device and +filesystem limitations. + +To create a sparse device, start by creating a dm-zero device that's the +desired size of the sparse device. For this example, we'll assume a 10TB +sparse device. + +TEN_TERABYTES=`expr 10 \* 1024 \* 1024 \* 1024 \* 2` # 10 TB in sectors +echo "0 $TEN_TERABYTES zero" | dmsetup create zero1 + +Then create a snapshot of the zero device, using any available block-device as +the COW device. The size of the COW device will determine the amount of real +space available to the sparse device. For this example, we'll assume /dev/sdb1 +is an available 10GB partition. + +echo "0 $TEN_TERABYTES snapshot /dev/mapper/zero1 /dev/sdb1 p 128" | \ + dmsetup create sparse1 + +This will create a 10TB sparse device called /dev/mapper/sparse1 that has +10GB of actual storage space available. If more than 10GB of data is written +to this device, it will start returning I/O errors. + diff -Nru a/Documentation/devices.txt b/Documentation/devices.txt --- a/Documentation/devices.txt 2004-06-23 19:04:26 -07:00 +++ b/Documentation/devices.txt 2004-06-23 19:04:26 -07:00 @@ -2377,16 +2377,16 @@ 1 = /dev/gpib1 Second GPIB bus ... -160 block Carmel 8-port SATA Disks on First Controller - 0 = /dev/carmel/0 SATA disk 0 whole disk - 1 = /dev/carmel/0p1 SATA disk 0 partition 1 +160 block Promise SX8 8-port SATA Disks on First Controller + 0 = /dev/sx8/0 SATA disk 0 whole disk + 1 = /dev/sx8/0p1 SATA disk 0 partition 1 ... - 31 = /dev/carmel/0p31 SATA disk 0 partition 31 + 31 = /dev/sx8/0p31 SATA disk 0 partition 31 - 32 = /dev/carmel/1 SATA disk 1 whole disk - 64 = /dev/carmel/2 SATA disk 2 whole disk + 32 = /dev/sx8/1 SATA disk 1 whole disk + 64 = /dev/sx8/2 SATA disk 2 whole disk ... - 224 = /dev/carmel/7 SATA disk 7 whole disk + 224 = /dev/sx8/7 SATA disk 7 whole disk Partitions are handled in the same way as for IDE disks (see major number 3) except that the limit on @@ -2400,16 +2400,16 @@ 17 = /dev/irlpt1 Second IrLPT device ... -161 block Carmel 8-port SATA Disks on Second Controller - 0 = /dev/carmel/8 SATA disk 8 whole disk - 1 = /dev/carmel/8p1 SATA disk 8 partition 1 +161 block Promise SX8 8-port SATA Disks on Second Controller + 0 = /dev/sx8/8 SATA disk 8 whole disk + 1 = /dev/sx8/8p1 SATA disk 8 partition 1 ... - 31 = /dev/carmel/8p31 SATA disk 8 partition 31 + 31 = /dev/sx8/8p31 SATA disk 8 partition 31 - 32 = /dev/carmel/9 SATA disk 9 whole disk - 64 = /dev/carmel/10 SATA disk 10 whole disk + 32 = /dev/sx8/9 SATA disk 9 whole disk + 64 = /dev/sx8/10 SATA disk 10 whole disk ... - 224 = /dev/carmel/15 SATA disk 15 whole disk + 224 = /dev/sx8/15 SATA disk 15 whole disk Partitions are handled in the same way as for IDE disks (see major number 3) except that the limit on diff -Nru a/Documentation/fb/sisfb.txt b/Documentation/fb/sisfb.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/fb/sisfb.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,158 @@ + +What is sisfb? +============== + +sisfb is a framebuffer device driver for SiS (Silicon Integrated Systems) +graphics chips. Supported are: + +- SiS 300 series: SiS 300/305, 540, 630(S), 730(S) +- SiS 315 series: SiS 315/H/PRO, 55x, (M)65x, 740, (M)661(F/M)X, (M)741(GX) +- SiS 330 series: SiS 330 ("Xabre"), (M)760 + + +Why do I need a framebuffer driver? +=================================== + +sisfb is eg. useful if you want a high-resolution text console. Besides that, +sisfb is required to run DirectFB (which comes with an additional, dedicated +driver for the 315 series). + +On the 300 series, sisfb on kernels older than 2.6.3 furthermore plays an +important role in connection with DRM/DRI: Sisfb manages the memory heap +used by DRM/DRI for 3D texture and other data. This memory management is +required for using DRI/DRM. + +Kernels >= around 2.6.3 do not need sisfb any longer for DRI/DRM memory +management. The SiS DRM driver has been updated and features a memory manager +of its own (which will be used if sisfb is not compiled). So unless you want +a graphical console, you don't need sisfb on kernels >=2.6.3. + +Sidenote: Since this seems to be a commonly made mistake: sisfb and vesafb +cannot be active at the same time! Do only select one of them in your kernel +configuration. + + +How are parameters passed to sisfb? +=================================== + +Well, it depends: If compiled statically into the kernel, use lilo's append +statement to add the parameters to the kernel command line. Please see lilo's +(or GRUB's) documentation for more information. If sisfb is a kernel module, +parameters are given with the modprobe (or insmod) command. + +Example for sisfb as part of the static kernel: Add the following line to your +lilo.conf: + + append="video=sisfb:mode:1024x768x16,mem:12288,rate:75" + +Example for sisfb as a module: Start sisfb by typing + + modprobe sisfb mode=1024x768x16 rate=75 mem=12288 + +A common mistake is that folks use a wrong parameter format when using the +driver compiled into the kernel. Please note: If compiled into the kernel, +the parameter format is video=sisfb:mode:none or video=sisfb:mode:1024x768x16 +(or whatever mode you want to use, alternatively using any other format +described above or the vesa keyword instead of mode). If compiled as a module, +the parameter format reads mode=none or mode=1024x768x16 (or whatever mode you +want to use). Using a "=" for a ":" (and vice versa) is a huge difference! +Additionally: If you give more than one argument to the in-kernel sisfb, the +arguments are separated with ",". For example: + + video=sisfb:mode:1024x768x16,rate:75,mem:12288 + + +How do I use it? +================ + +Preface statement: This file only covers very little of the driver's +capabilities and features. Please refer to the author's and maintainer's +website at http://www.winischhofer.net/linuxsisvga.shtml for more +information. Additionally, "modinfo sisfb" gives an overview over all +supported options including some explanation. + +The desired display mode can be specified using the keyword "mode" with +a parameter in one of the follwing formats: + - XxYxDepth or + - XxY-Depth or + - XxY-Depth@Rate or + - XxY + - or simply use the VESA mode number in hexadecimal or decimal. + +For example: 1024x768x16, 1024x768-16@75, 1280x1024-16. If no depth is +specified, it defaults to 8. If no rate is given, it defaults to 60Hz. Depth 32 +means 24bit color depth (but 32 bit framebuffer depth, which is not relevant +to the user). + +Additionally, sisfb understands the keyword "vesa" followed by a VESA mode +number in decimal or hexadecimal. For example: vesa=791 or vesa=0x117. Please +use either "mode" or "vesa" but not both. + +Linux 2.4 only: If no mode is given, sisfb defaults to "no mode" (mode=none) if +compiled as a module; if sisfb is statically compiled into the kernel, it +defaults to 800x600x8 unless CRT2 type is LCD, in which case the LCD's native +resolution is used. If you want to switch to a different mode, use the fbset +shell command. + +Linux 2.6 only: If no mode is given, sisfb defaults to 800x600x8 unless CRT2 +type is LCD, in which case it defaults to the LCD's native resolution. If +you want to switch to another mode, use the stty shell command. + +You should compile in both vgacon (to boot if you remove you SiS card from +your system) and sisfb (for graphics mode). Under Linux 2.6, also "Framebuffer +console support" (fbcon) is needed for a graphical console. + +You should *not* compile-in vesafb. And please do not use the "vga=" keyword +in lilo's or grub's configuration file; mode selection is done using the +"mode" or "vesa" keywords as a parameter. See above and below. + + +X11 +=== + +If using XFree86 or X.org, it is recommended that you don't use the "fbdev" +driver but the dedicated "sis" X driver. The "sis" X driver and sisfb are +developed by the same person (Thomas Winischhofer) and cooperate well with +each other. + + +SVGALib +======= + +SVGALib, if directly accessing the hardware, never restores the screen +correctly, especially on laptops or if the output devices are LCD or TV. +Therefore, use the chipset "FBDEV" in SVGALib configuration. This will make +SVGALib use the framebuffer device for mode switches and restoration. + + +Configuration +============= + +(Some) accepted options: + +off - Disable sisfb. This option is only understood if sisfb is + in-kernel, not a module. +mem:X - size of memory for the console, rest will be used for DRI/DRM. X + is in kilobytes. On 300 series, the default is 4096, 8192 or + 16384 (each in kilobyte) depending on how much video ram the card + has. On 315/330 series, the default is the maximum available ram + (since DRI/DRM is not supported for these chipsets). +noaccel - do not use 2D acceleration engine. (Default: use acceleration) +noypan - disable y-panning and scroll by redrawing the entire screen. + This is much slower than y-panning. (Default: use y-panning) +vesa:X - selects startup videomode. X is number from 0 to 0x1FF and + represents the VESA mode number (can be given in decimal or + hexadecimal form, the latter prefixed with "0x"). +mode:X - selects startup videomode. Please see above for the format of + "X". + +Boolean options such as "noaccel" or "noypan" are to be given without a +parameter if sisfb is in-kernel (for example "video=sisfb:noypan). If +sisfb is a module, these are to be set to 1 (for example "modprobe sisfb +noypan=1"). + +-- +Thomas Winischhofer +May 27, 2004 + + diff -Nru a/Documentation/filesystems/hpfs.txt b/Documentation/filesystems/hpfs.txt --- a/Documentation/filesystems/hpfs.txt 2004-06-23 19:04:26 -07:00 +++ b/Documentation/filesystems/hpfs.txt 2004-06-23 19:04:26 -07:00 @@ -1,5 +1,5 @@ -Read/Write HPFS 2.05 -1998-2001, Mikulas Patocka +Read/Write HPFS 2.09 +1998-2004, Mikulas Patocka email: mikulas@artax.karlin.mff.cuni.cz homepage: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi @@ -283,6 +283,14 @@ 2.05 Fixed crash when got mount parameters without = Fixed crash when allocation of anode failed due to full disk Fixed some crashes when block io or inode allocation failed +2.06 Fixed some crash on corrupted disk structures + Better allocation strategy + Reschedule points added so that it doesn't lock CPU long time + It should work in read-only mode on Warp Server +2.07 More fixes for Warp Server. Now it really works +2.08 Creating new files is not so slow on large disks + An attempt to sync deleted file does not generate filesystem error +2.09 Fixed error on extremly fragmented files vim: set textwidth=80: diff -Nru a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt --- a/Documentation/filesystems/proc.txt 2004-06-23 19:04:26 -07:00 +++ b/Documentation/filesystems/proc.txt 2004-06-23 19:04:26 -07:00 @@ -201,7 +201,7 @@ devices Available devices (block and character) dma Used DMS channels filesystems Supported filesystems - driver Various drivers grouped here, currently rtc (2.4) + driver Various drivers grouped here, currently rtc (2.4) and hpet (2.6) execdomains Execdomains, related to security (2.4) fb Frame Buffer devices (2.4) fs File system parameters, currently nfs/exports (2.4) @@ -1640,7 +1640,8 @@ Writing to this file results in a flush of the routing cache. -gc_elastic, gc_interval, gc_min_interval, gc_tresh, gc_timeout +gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout, +gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3 -------------------------------------------------------------- Values to control the frequency and behavior of the garbage collection diff -Nru a/Documentation/hpet.txt b/Documentation/hpet.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/hpet.txt 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,298 @@ + High Precision Event Timer Driver for Linux + +The High Precision Event Timer (HPET) hardware is the future replacement for the 8254 and Real +Time Clock (RTC) periodic timer functionality. Each HPET can have up two 32 timers. It is possible +to configure the first two timers as legacy replacements for 8254 and RTC periodic. A specification +done by INTEL and Microsoft can be found at http://www.intel.com/labs/platcomp/hpet/hpetspec.htm. + +The driver supports detection of HPET driver allocation and initialization of the HPET before the +driver module_init routine is called. This enables platform code which uses timer 0 or 1 as the +main timer to intercept HPET initialization. An example of this initialization can be found in +arch/i386/kernel/time_hpet.c. + +The driver provides two APIs which are very similar to the API found in the rtc.c driver. +There is a user space API and a kernel space API. An example user space program is provided +below. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +extern void hpet_open_close(int, const char **); +extern void hpet_info(int, const char **); +extern void hpet_poll(int, const char **); +extern void hpet_fasync(int, const char **); +extern void hpet_read(int, const char **); + +#include +#include +#include + +struct hpet_command { + char *command; + void (*func)(int argc, const char ** argv); +} hpet_command[] = { + { + "open-close", + hpet_open_close + }, + { + "info", + hpet_info + }, + { + "poll", + hpet_poll + }, + { + "fasync", + hpet_fasync + }, +}; + +int +main(int argc, const char ** argv) +{ + int i; + + argc--; + argv++; + + if (!argc) { + fprintf(stderr, "-hpet: requires command\n"); + return -1; + } + + + for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++) + if (!strcmp(argv[0], hpet_command[i].command)) { + argc--; + argv++; + fprintf(stderr, "-hpet: executing %s\n", + hpet_command[i].command); + hpet_command[i].func(argc, argv); + return 0; + } + + fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]); + + return -1; +} + +void +hpet_open_close(int argc, const char **argv) +{ + int fd; + + if (argc != 1) { + fprintf(stderr, "hpet_open_close: device-name\n"); + return; + } + + fd = open(argv[0], O_RDWR); + if (fd < 0) + fprintf(stderr, "hpet_open_close: open failed\n"); + else + close(fd); + + return; +} + +void +hpet_info(int argc, const char **argv) +{ +} + +void +hpet_poll(int argc, const char **argv) +{ + unsigned long freq; + int iterations, i, fd; + struct pollfd pfd; + struct hpet_info info; + struct timeval stv, etv; + struct timezone tz; + long usec; + + if (argc != 3) { + fprintf(stderr, "hpet_poll: device-name freq iterations\n"); + return; + } + + freq = atoi(argv[1]); + iterations = atoi(argv[2]); + + fd = open(argv[0], O_RDWR); + + if (fd < 0) { + fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]); + return; + } + + if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { + fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n"); + goto out; + } + + if (ioctl(fd, HPET_INFO, &info) < 0) { + fprintf(stderr, "hpet_poll: failed to get info\n"); + goto out; + } + + fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags); + + if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { + fprintf(stderr, "hpet_poll: HPET_EPI failed\n"); + goto out; + } + + if (ioctl(fd, HPET_IE_ON, 0) < 0) { + fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n"); + goto out; + } + + pfd.fd = fd; + pfd.events = POLLIN; + + for (i = 0; i < iterations; i++) { + pfd.revents = 0; + gettimeofday(&stv, &tz); + if (poll(&pfd, 1, -1) < 0) + fprintf(stderr, "hpet_poll: poll failed\n"); + else { + long data; + + gettimeofday(&etv, &tz); + usec = stv.tv_sec * 1000000 + stv.tv_usec; + usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec; + + fprintf(stderr, + "hpet_poll: expired time = 0x%lx\n", usec); + + fprintf(stderr, "hpet_poll: revents = 0x%x\n", + pfd.revents); + + if (read(fd, &data, sizeof(data)) != sizeof(data)) { + fprintf(stderr, "hpet_poll: read failed\n"); + } + else + fprintf(stderr, "hpet_poll: data 0x%lx\n", + data); + } + } + +out: + close(fd); + return; +} + +static int hpet_sigio_count; + +static void +hpet_sigio(int val) +{ + fprintf(stderr, "hpet_sigio: called\n"); + hpet_sigio_count++; +} + +void +hpet_fasync(int argc, const char **argv) +{ + unsigned long freq; + int iterations, i, fd, value; + sig_t oldsig; + struct hpet_info info; + + hpet_sigio_count = 0; + fd = -1; + + if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) { + fprintf(stderr, "hpet_fasync: failed to set signal handler\n"); + return; + } + + if (argc != 3) { + fprintf(stderr, "hpet_fasync: device-name freq iterations\n"); + goto out; + } + + fd = open(argv[0], O_RDWR); + + if (fd < 0) { + fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]); + return; + } + + + if ((fcntl(fd, F_SETOWN, getpid()) == 1) || + ((value = fcntl(fd, F_GETFL)) == 1) || + (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) { + fprintf(stderr, "hpet_fasync: fcntl failed\n"); + goto out; + } + + freq = atoi(argv[1]); + iterations = atoi(argv[2]); + + if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { + fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n"); + goto out; + } + + if (ioctl(fd, HPET_INFO, &info) < 0) { + fprintf(stderr, "hpet_fasync: failed to get info\n"); + goto out; + } + + fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags); + + if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { + fprintf(stderr, "hpet_fasync: HPET_EPI failed\n"); + goto out; + } + + if (ioctl(fd, HPET_IE_ON, 0) < 0) { + fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n"); + goto out; + } + + for (i = 0; i < iterations; i++) { + (void) pause(); + fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count); + } + +out: + signal(SIGIO, oldsig); + + if (fd >= 0) + close(fd); + + return; +} + +The kernel API has three interfaces exported from the driver: + + hpet_register(struct hpet_task *tp, int periodic) + hpet_unregister(struct hpet_task *tp) + hpet_control(struct hpet_task *tp, unsigned int cmd, unsigned long arg) + +The kernel module using this interface fills in the ht_func and ht_data members of the +hpet_task structure before calling hpet_register. hpet_control simply vectors to the hpet_ioctl +routine and has the same commands and respective arguments as the user API. hpet_unregister +is used to terminate usage of the HPET timer reserved by hpet_register. + + diff -Nru a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt --- a/Documentation/ioctl-number.txt 2004-06-23 19:04:28 -07:00 +++ b/Documentation/ioctl-number.txt 2004-06-23 19:04:28 -07:00 @@ -189,3 +189,5 @@ 0xDD 00-3F ZFCP device driver see drivers/s390/scsi/ +0xF3 00-3F video/sisfb.h sisfb (in development) + diff -Nru a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX --- a/Documentation/networking/00-INDEX 2004-06-23 19:04:28 -07:00 +++ b/Documentation/networking/00-INDEX 2004-06-23 19:04:28 -07:00 @@ -4,8 +4,6 @@ - information on the 3Com EtherLink Plus (3c505) driver. 6pack.txt - info on the 6pack protocol, an alternative to KISS for AX.25 -8139too.txt - - info on the 8139too driver for RTL-8139 based network cards. Configurable - info on some of the configurable network parameters DLINK.txt diff -Nru a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt --- a/Documentation/networking/ip-sysctl.txt 2004-06-23 19:04:26 -07:00 +++ b/Documentation/networking/ip-sysctl.txt 2004-06-23 19:04:26 -07:00 @@ -17,6 +17,16 @@ Disable Path MTU Discovery. default FALSE +min_pmtu - INTEGER + default 562 - minimum discovered Path MTU + +mtu_expires - INTEGER + Time, in seconds, that cached PMTU information is kept. + +min_adv_mss - INTEGER + The advertised MSS depends on the first hop route MTU, but will + never be lower than this setting. + IP Fragmentation: ipfrag_high_thresh - INTEGER @@ -345,6 +355,20 @@ conections. Default: 7 + +tcp_frto - BOOLEAN + Enables F-RTO, an enhanced recovery algorithm for TCP retransmission + timeouts. It is particularly beneficial in wireless environments + where packet loss is typically due to random radio interference + rather than intermediate router congestion. + +somaxconn - INTEGER + Limit of socket listen() backlog, known in userspace as SOMAXCONN. + Defaults to 128. See also tcp_max_syn_backlog for additional tuning + for TCP sockets. + +IP Variables: + ip_local_port_range - 2 INTEGERS Defines the local port range that is used by TCP and UDP to choose the local port. The first number is the first, the @@ -586,6 +610,19 @@ The max value from conf/{all,interface}/arp_ignore is used when ARP request is received on the {interface} +app_solicit - INTEGER + The maximum number of probes to send to the user space ARP daemon + via netlink before dropping back to multicast probes (see + mcast_solicit). Defaults to 0. + +disable_policy - BOOLEAN + Disable IPSEC policy (SPD) for this interface + +disable_xfrm - BOOLEAN + Disable IPSEC encryption on this interface, whatever the policy + + + tag - INTEGER Allows you to write a number, which can be used as required. Default value is 0. @@ -678,9 +715,11 @@ disabled if local forwarding is enabled. autoconf - BOOLEAN - Configure link-local addresses using L2 hardware addresses. + Autoconfigure addresses using Prefix Information in Router + Advertisements. - Default: TRUE + Functional default: enabled if accept_ra is enabled. + disabled if accept_ra is disabled. dad_transmits - INTEGER The amount of Duplicate Address Detection probes to send. @@ -803,5 +842,26 @@ 0 : disable this. Default: 1 + +UNDOCUMENTED: + +dev_weight FIXME +discovery_slots FIXME +discovery_timeout FIXME +fast_poll_increase FIXME +ip6_queue_maxlen FIXME +lap_keepalive_time FIXME +lo_cong FIXME +max_baud_rate FIXME +max_dgram_qlen FIXME +max_noreply_time FIXME +max_tx_data_size FIXME +max_tx_window FIXME +min_tx_turn_time FIXME +mod_cong FIXME +no_cong FIXME +no_cong_thresh FIXME +slot_timeout FIXME +warn_noreply_time FIXME $Id: ip-sysctl.txt,v 1.20 2001/12/13 09:00:18 davem Exp $ diff -Nru a/MAINTAINERS b/MAINTAINERS --- a/MAINTAINERS 2004-06-23 19:04:27 -07:00 +++ b/MAINTAINERS 2004-06-23 19:04:27 -07:00 @@ -90,6 +90,20 @@ L: linux-net@vger.kernel.org S: Maintained +3W-XXXX ATA-RAID CONTROLLER DRIVER +P: Adam Radford +M: linuxraid@amcc.com +L: linux-scsi@vger.kernel.org +W: http://www.amcc.com +S: Supported + +3W-9XXX SATA-RAID CONTROLLER DRIVER +P: Adam Radford +M: linuxraid@amcc.com +L: linux-scsi@vger.kernel.org +W: http://www.amcc.com +S: Supported + 53C700 AND 53C700-66 SCSI DRIVER P: James E.J. Bottomley M: James.Bottomley@HansenPartnership.com @@ -689,6 +703,12 @@ L: blinux-list@redhat.com S: Maintained +DRIVER CORE, KOBJECTS, AND SYSFS +P: Greg Kroah-Hartman +M: greg@kroah.com +L: linux-kernel@vger.kernel.org +S: Supported + DRM DRIVERS L: dri-devel@lists.sourceforge.net S: Supported @@ -1249,6 +1269,13 @@ M: benh@kernel.crashing.org W: http://www.linuxppc.org/ L: linuxppc-dev@lists.linuxppc.org +S: Maintained + +LINUX FOR POWERPC EMBEDDED PPC4XX +P: Matt Porter +M: mporter@kernel.crashing.org +W: http://www.penguinppc.org/ +L: linuxppc-embedded@lists.linuxppc.org S: Maintained LLC (802.2) diff -Nru a/Makefile b/Makefile --- a/Makefile 2004-06-23 19:04:27 -07:00 +++ b/Makefile 2004-06-23 19:04:27 -07:00 @@ -290,8 +290,6 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk -RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ - else echo rpm; fi) GENKSYMS = scripts/genksyms/genksyms DEPMOD = /sbin/depmod KALLSYMS = scripts/kallsyms @@ -409,13 +407,6 @@ scripts_basic: include/linux/autoconf.h - -# That's our default target when none is given on the command line -# Note that 'modules' will be added as a prerequisite as well, -# in the CONFIG_MODULES part below - -all: vmlinux - # Objects we will link into vmlinux / subdirs we need to visit init-y := init/ drivers-y := drivers/ sound/ @@ -449,6 +440,19 @@ include $(srctree)/arch/$(ARCH)/Makefile +# Default kernel image to build when no specific target is given. +# KBUILD_IMAGE may be overruled on the commandline or +# set in the environment +# Also any assingments in arch/$(ARCH)/Makefiel take precedence over +# this default value +export KBUILD_IMAGE ?= vmlinux + +# The all: target is the default when no target is given on the +# command line. +# This allow a user to issue only 'make' to build a kernel including modules +# Defaults vmlinux but it is usually overriden in the arch makefile +all: vmlinux + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE CFLAGS += -Os else @@ -795,7 +799,7 @@ # Directories & files removed with 'make clean' CLEAN_DIRS += $(MODVERDIR) -CLEAN_FILES += vmlinux System.map kernel.spec \ +CLEAN_FILES += vmlinux System.map \ .tmp_kallsyms* .tmp_version .tmp_vmlinux* # Directories & files removed with 'make mrproper' @@ -848,37 +852,19 @@ -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f -# RPM target -# --------------------------------------------------------------------------- - -.PHONY: rpm -# Remove hyphens since they have special meaning in RPM filenames -KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE)) +# Packaging of the kernel to various formats +# --------------------------------------------------------------------------- +# rpm target kept for backward compatibility +package-dir := $(srctree)/scripts/package -# If you do a make spec before packing the tarball you can rpm -ta it +.PHONY: %-pkg rpm -spec: - $(CONFIG_SHELL) $(srctree)/scripts/mkspec > $(objtree)/kernel.spec - -# a) Build a tar ball -# b) generate an rpm from it -# c) and pack the result -# - Use /. to avoid tar packing just the symlink - -rpm: clean spec - set -e; \ - cd .. ; \ - ln -sf $(srctree) $(KERNELPATH) ; \ - tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \ - rm $(KERNELPATH) - - set -e; \ - $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version;\ - mv -f $(objtree)/.tmp_version $(objtree)/.version; +%pkg: FORCE + $(Q)$(MAKE) -f $(package-dir)/Makefile $@ +rpm: FORCE + $(Q)$(MAKE) -f $(package-dir)/Makefile $@ - $(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz - rm ../$(KERNELPATH).tar.gz # Brief documentation of the typical targets used # --------------------------------------------------------------------------- @@ -905,6 +891,8 @@ @echo ' tags/TAGS - Generate tags file for editors' @echo ' cscope - Generate cscope index' @echo ' checkstack - Generate a list of stack hogs' + @echo 'Kernel packaging:' + @$(MAKE) -f $(package-dir)/Makefile help @echo '' @echo 'Documentation targets:' @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp diff -Nru a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c --- a/arch/alpha/kernel/init_task.c 2004-06-23 19:04:26 -07:00 +++ b/arch/alpha/kernel/init_task.c 2004-06-23 19:04:26 -07:00 @@ -4,6 +4,7 @@ #include #include #include +#include #include diff -Nru a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c --- a/arch/alpha/mm/numa.c 2004-06-23 19:04:25 -07:00 +++ b/arch/alpha/mm/numa.c 2004-06-23 19:04:25 -07:00 @@ -279,8 +279,8 @@ initrd_end, phys_to_virt(PFN_PHYS(max_low_pfn))); } else { - nid = NODE_DATA(kvaddr_to_nid(initrd_start)); - reserve_bootmem_node(nid, + nid = kvaddr_to_nid(initrd_start); + reserve_bootmem_node(NODE_DATA(nid), virt_to_phys((void *)initrd_start), INITRD_SIZE); } diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/Kconfig 2004-06-23 19:04:27 -07:00 @@ -72,9 +72,6 @@ prompt "ARM system type" default ARCH_RPC -config ARCH_ADIFCC - bool "ADIFCC-based" - config ARCH_CLPS7500 bool "Cirrus-CL-PS7500FE" @@ -191,6 +188,11 @@ depends on ARCH_RPC default y +config TIMER_ACORN + bool + depends on ARCH_ACORN || ARCH_CLPS7500 + default y + ##################################################################### # Footbridge support config FOOTBRIDGE @@ -246,10 +248,10 @@ # Select various configuration options depending on the machine type config DISCONTIGMEM bool - depends on ARCH_EDB7211 || ARCH_SA1100 || ARCH_LH7A40X + depends on ARCH_EDB7211 || ARCH_SA1100 || (ARCH_LH7A40X && !LH7A40X_SROMLL) default y help - Say Y to upport efficient handling of discontiguous physical memory, + Say Y to support efficient handling of discontiguous physical memory, for architectures which are either NUMA (Non-Uniform Memory Access) or have huge holes in the physical address space for other reasons. See for more. @@ -257,7 +259,7 @@ # Now handle the bus types config PCI bool "PCI support" if ARCH_INTEGRATOR_AP - default y if ARCH_FTVPCI || ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX + default y if ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX help Find out whether you have a PCI motherboard. PCI is the name of a bus system, i.e. the way the CPU talks to the other stuff inside @@ -270,11 +272,6 @@ doesn't. # Select the host bridge type -config PCI_HOST_PLX90X0 - bool - depends on PCI && ARCH_FTVPCI - default y - config PCI_HOST_VIA82C505 bool depends on PCI && ARCH_SHARK @@ -421,6 +418,17 @@ If you do not feel you need a faster FP emulation you should better choose NWFPE. +config VFP + bool "VFP-format floating point maths" + help + Say Y to include VFP support code in the kernel. This is needed + if your hardware includes a VFP unit. + + Please see for + release notes and additional status information. + + Say N if your target does not have VFP hardware. + source "fs/Kconfig.binfmt" source "drivers/base/Kconfig" @@ -539,7 +547,7 @@ config LEDS bool "Timer and CPU usage LEDs" - depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB + depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB help If you say Y here, the LEDs on your machine will be used to provide useful information about your current system status. @@ -553,7 +561,7 @@ config LEDS_TIMER bool "Timer LED" if LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || MACH_MAINSTONE || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB) - depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB + depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB default y if ARCH_EBSA110 help If you say Y here, one of the system LEDs (the green one on the @@ -609,7 +617,7 @@ source "net/Kconfig" -if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_FTVPCI || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE +if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE source "drivers/ide/Kconfig" endif diff -Nru a/arch/arm/Makefile b/arch/arm/Makefile --- a/arch/arm/Makefile 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/Makefile 2004-06-23 19:04:26 -07:00 @@ -74,9 +74,6 @@ textaddr-$(CONFIG_ARCH_CO285) := 0x60008000 machine-$(CONFIG_ARCH_CO285) := footbridge incdir-$(CONFIG_ARCH_CO285) := ebsa285 - machine-$(CONFIG_ARCH_FTVPCI) := ftvpci - incdir-$(CONFIG_ARCH_FTVPCI) := nexuspci - machine-$(CONFIG_ARCH_TBOX) := tbox machine-$(CONFIG_ARCH_SHARK) := shark machine-$(CONFIG_ARCH_SA1100) := sa1100 ifeq ($(CONFIG_ARCH_SA1100),y) @@ -91,7 +88,6 @@ machine-$(CONFIG_ARCH_CLPS711X) := clps711x textaddr-$(CONFIG_ARCH_FORTUNET) := 0xc0008000 machine-$(CONFIG_ARCH_IOP3XX) := iop3xx - machine-$(CONFIG_ARCH_ADIFCC) := adifcc machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx machine-$(CONFIG_ARCH_OMAP) := omap machine-$(CONFIG_ARCH_S3C2410) := s3c2410 @@ -119,6 +115,7 @@ endif core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) +core-$(CONFIG_VFP) += arch/arm/vfp/ drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ drivers-$(CONFIG_ARCH_CLPS7500) += drivers/acorn/char/ diff -Nru a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile --- a/arch/arm/boot/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/boot/Makefile 2004-06-23 19:04:25 -07:00 @@ -49,8 +49,6 @@ zreladdr-$(CONFIG_ARCH_PXA) := 0xa0008000 zreladdr-$(CONFIG_ARCH_IOP3XX) := 0xa0008000 params_phys-$(CONFIG_ARCH_IOP3XX) := 0xa0000100 - zreladdr-$(CONFIG_ARCH_ADIFCC) := 0xc0008000 -params_phys-$(CONFIG_ARCH_ADIFCC) := 0xc0000100 zreladdr-$(CONFIG_ARCH_IXP4XX) := 0x00008000 params-phys-$(CONFIG_ARCH_IXP4XX) := 0x00000100 zreladdr-$(CONFIG_ARCH_OMAP) := 0x10008000 diff -Nru a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S --- a/arch/arm/boot/compressed/head-xscale.S 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/boot/compressed/head-xscale.S 2004-06-23 19:04:26 -07:00 @@ -66,7 +66,4 @@ mov r7, #MACH_TYPE_IQ80310 #endif -#ifdef CONFIG_ARCH_ADI_EVB - mov r7, #MACH_TYPE_ADI_EVB -#endif diff -Nru a/arch/arm/common/Makefile b/arch/arm/common/Makefile --- a/arch/arm/common/Makefile 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/common/Makefile 2004-06-23 19:04:26 -07:00 @@ -6,6 +6,6 @@ obj-$(CONFIG_ARM_AMBA) += amba.o obj-$(CONFIG_ICST525) += icst525.o obj-$(CONFIG_SA1111) += sa1111.o -obj-$(CONFIG_PCI_HOST_PLX90X0) += plx90x0.o obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o obj-$(CONFIG_DMABOUNCE) += dmabounce.o +obj-$(CONFIG_TIMER_ACORN) += time-acorn.o diff -Nru a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c --- a/arch/arm/common/dmabounce.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/common/dmabounce.c 2004-06-23 19:04:25 -07:00 @@ -234,7 +234,7 @@ } } - dma_addr = virt_to_bus(ptr); + dma_addr = virt_to_dma(dev, ptr); if (device_info && dma_needs_bounce(dev, dma_addr, size)) { struct safe_buffer *buf; @@ -248,7 +248,7 @@ dev_dbg(dev, "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, buf->ptr, (void *) virt_to_bus(buf->ptr), + __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), buf->safe, (void *) buf->safe_dma_addr); if ((dir == DMA_TO_DEVICE) || @@ -290,7 +290,7 @@ dev_dbg(dev, "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, buf->ptr, (void *) virt_to_bus(buf->ptr), + __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), buf->safe, (void *) buf->safe_dma_addr); @@ -342,7 +342,7 @@ dev_dbg(dev, "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, buf->ptr, (void *) virt_to_bus(buf->ptr), + __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), buf->safe, (void *) buf->safe_dma_addr); DO_STATS ( device_info->bounce_count++ ); @@ -367,7 +367,7 @@ } consistent_sync(buf->safe, size, dir); } else { - consistent_sync(bus_to_virt(dma_addr), size, dir); + consistent_sync(dma_to_virt(dev, dma_addr), size, dir); } } diff -Nru a/arch/arm/common/plx90x0.c b/arch/arm/common/plx90x0.c --- a/arch/arm/common/plx90x0.c 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,178 +0,0 @@ -/* - * Driver for PLX Technology PCI9000-series host bridge. - * - * Copyright (C) 1997, 1998, 1999, 2000 FutureTV Labs Ltd - */ - -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include - -#include -#include -#include -#include -#include - -/* - * Since the following functions are all very similar, the common parts - * are pulled out into these macros. - */ - -#define PLX_CLEAR_CONFIG \ - __raw_writel(0, PLX_BASE + 0xac); \ - local_irq_restore(flags); } - -#define PLX_SET_CONFIG \ - { unsigned long flags; \ - local_irq_save(flags); \ - __raw_writel((1<<31 | (bus->number << 16) \ - | (devfn << 8) | (where & ~3) \ - | ((bus->number == 0)?0:1)), PLX_BASE + 0xac); \ - -#define PLX_CONFIG_WRITE(size) \ - PLX_SET_CONFIG \ - __raw_write##size(value, PCIO_BASE + (where & 3)); \ - if (__raw_readw(PLX_BASE + 0x6) & 0x2000) \ - __raw_writew(0x2000, PLX_BASE + 0x6); \ - PLX_CLEAR_CONFIG \ - return PCIBIOS_SUCCESSFUL; - -#define PLX_CONFIG_READ(size) \ - PLX_SET_CONFIG \ - *value = __raw_read##size(PCIO_BASE + (where & 3)); \ - if (__raw_readw(PLX_BASE + 0x6) & 0x2000) { \ - __raw_writew(0x2000, PLX_BASE + 0x6); \ - *value = 0xffffffffUL; \ - } \ - PLX_CLEAR_CONFIG \ - return PCIBIOS_SUCCESSFUL; - -/* Configuration space access routines */ - -static int -plx90x0_read_config (struct pci_bus *bus, unsigned int devfn, int where, - int where, int size, u32 *value) -{ - switch (size) { - case 1: - PLX_CONFIG_READ(b) - break; - case 2: - PLX_CONFIG_READ(w) - break; - case 4: - PLX_CONFIG_READ(l) - break; - } - return PCIBIOS_SUCCESSFUL; -} - -static int -plx90x0_write_config (struct pci_bus *bus, unsigned int devfn, int where, - int where, int size, u32 value) -{ - switch (size) { - case 1: - PLX_CONFIG_WRITE(b) - break; - case 2: - PLX_CONFIG_WRITE(w) - break; - case 4: - PLX_CONFIG_WRITE(l) - break; - } - return PCIBIOS_SUCCESSFUL; -} - -static struct pci_ops plx90x0_ops = -{ - .read = plx90x0_read_config, - .write = plx90x0_write_config, -}; - -static void -plx_syserr_handler(int irq, void *handle, struct pt_regs *regs) -{ - printk("PLX90x0: machine check %04x (pc=%08lx)\n", - readw(PLX_BASE + 6), regs->ARM_pc); - __raw_writew(0xf000, PLX_BASE + 6); -} - -/* - * Initialise the PCI system. - */ - -void __init -plx90x0_init(struct arm_sysdata *sysdata) -{ - static const unsigned long int base = PLX_BASE; - char *what; - unsigned long bar = (unsigned long)virt_to_bus((void *)PAGE_OFFSET); - - /* Have a sniff around and see which PLX device is present. */ - unsigned long id = __raw_readl(base + 0xf0); - -#if 0 - /* This check was a good idea, but can fail. The PLX9060 puts no - default value in these registers unless NB# is asserted (which it - isn't on these cards). */ - if ((id & 0xffff) != PCI_VENDOR_ID_PLX) - return; /* Nothing found */ -#endif - - /* Found one - now work out what it is. */ - switch (id >> 16) { - case 0: /* PCI_DEVICE_ID_PLX_9060 */ - what = "PCI9060"; - break; - case PCI_DEVICE_ID_PLX_9060ES: - what = "PCI9060ES"; - break; - case PCI_DEVICE_ID_PLX_9060SD: - what = "PCI9060SD"; /* uhuhh.. */ - break; - case PCI_DEVICE_ID_PLX_9080: - what = "PCI9080"; - break; - default: - printk("PCI: Unknown PLX device %04lx found -- ignored.\n", - id >> 16); - return; - } - - printk("PCI: PLX Technology %s host bridge found.\n", what); - - /* Now set it up for both master and slave accesses. */ - __raw_writel(0xffff0147, base + 0x4); - __raw_writeb(32, base + 0xd); - __raw_writel(0x8 | bar, base + 0x18); - __raw_writel(0xf8000008, base + 0x80); - __raw_writel(0x40000001, base + 0x84); - __raw_writel(0, base + 0x88); - __raw_writel(0, base + 0x8c); - __raw_writel(0x11, base + 0x94); - __raw_writel(0xC3 + (4 << 28) - + (8 << 11) + (1 << 10) - + (1 << 24), base + 0x98); - __raw_writel(0xC0000000, base + 0x9c); - __raw_writel(PLX_MEM_START, base + 0xa0); - __raw_writel(PLX_IO_START, base + 0xa4); - __raw_writel(0x3, base + 0xa8); - __raw_writel(0, base + 0xac); - __raw_writel(0x10001, base + 0xe8); - __raw_writel(0x8000767e, base + 0xec); - - request_irq(IRQ_SYSERR, plx_syserr_handler, 0, - "system error", NULL); - - pci_scan_bus(0, &plx90x0_ops, sysdata); -} diff -Nru a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c --- a/arch/arm/common/sa1111.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/common/sa1111.c 2004-06-23 19:04:28 -07:00 @@ -610,7 +610,7 @@ * %-EBUSY physical address already marked in-use. * %0 successful. */ -static int __init +static int __sa1111_probe(struct device *me, struct resource *mem, int irq) { struct sa1111 *sachip; diff -Nru a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/common/time-acorn.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,67 @@ +/* + * linux/arch/arm/common/time-acorn.c + * + * Copyright (c) 1996-2000 Russell King. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Changelog: + * 24-Sep-1996 RMK Created + * 10-Oct-1996 RMK Brought up to date with arch-sa110eval + * 04-Dec-1997 RMK Updated for new arch/arm/time.c + * 13=Jun-2004 DS Moved to arch/arm/common b/c shared w/CLPS7500 + */ +#include +#include + +#include +#include +#include + +#include + +static unsigned long ioctime_gettimeoffset(void) +{ + unsigned int count1, count2, status; + long offset; + + ioc_writeb (0, IOC_T0LATCH); + barrier (); + count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); + barrier (); + status = ioc_readb(IOC_IRQREQA); + barrier (); + ioc_writeb (0, IOC_T0LATCH); + barrier (); + count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); + + offset = count2; + if (count2 < count1) { + /* + * We have not had an interrupt between reading count1 + * and count2. + */ + if (status & (1 << 5)) + offset -= LATCH; + } else if (count2 > count1) { + /* + * We have just had another interrupt between reading + * count1 and count2. + */ + offset -= LATCH; + } + + offset = (LATCH - offset) * (tick_nsec / 1000); + return (offset + LATCH/2) / LATCH; +} + +void __init ioctime_init(void) +{ + ioc_writeb(LATCH & 255, IOC_T0LTCHL); + ioc_writeb(LATCH >> 8, IOC_T0LTCHH); + ioc_writeb(0, IOC_T0GO); + + gettimeoffset = ioctime_gettimeoffset; +} diff -Nru a/arch/arm/configs/adi_evb_defconfig b/arch/arm/configs/adi_evb_defconfig --- a/arch/arm/configs/adi_evb_defconfig 2004-06-23 19:04:27 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,678 +0,0 @@ -# -# Automatically generated by make menuconfig: don't edit -# -CONFIG_ARM=y -# CONFIG_EISA is not set -# CONFIG_SBUS is not set -# CONFIG_MCA is not set -CONFIG_UID16=y -CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set -# CONFIG_GENERIC_BUST_SPINLOCK is not set -# CONFIG_GENERIC_ISA_DMA is not set - -# -# Code maturity level options -# -CONFIG_EXPERIMENTAL=y -# CONFIG_OBSOLETE is not set - -# -# Loadable module support -# -CONFIG_MODULES=y -# CONFIG_MODVERSIONS is not set -# CONFIG_KMOD is not set - -# -# System Type -# -CONFIG_ARCH_ADIFCC=y -# CONFIG_ARCH_ARCA5K is not set -# CONFIG_ARCH_CLPS7500 is not set -# CONFIG_ARCH_CLPS711X is not set -# CONFIG_ARCH_CO285 is not set -# CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_CAMELOT is not set -# CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_IOP310 is not set -# CONFIG_ARCH_L7200 is not set -# CONFIG_ARCH_RPC is not set -# CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_SHARK is not set - -# -# Archimedes/A5000 Implementations -# -# CONFIG_ARCH_ARC is not set -# CONFIG_ARCH_A5K is not set - -# -# Footbridge Implementations -# -# CONFIG_ARCH_CATS is not set -# CONFIG_ARCH_PERSONAL_SERVER is not set -# CONFIG_ARCH_EBSA285_ADDIN is not set -# CONFIG_ARCH_EBSA285_HOST is not set -# CONFIG_ARCH_NETWINDER is not set - -# -# SA11x0 Implementations -# -# CONFIG_SA1100_ASSABET is not set -# CONFIG_ASSABET_NEPONSET is not set -# CONFIG_SA1100_ADSBITSY is not set -# CONFIG_SA1100_BRUTUS is not set -# CONFIG_SA1100_CERF is not set -# CONFIG_SA1100_H3600 is not set -# CONFIG_SA1100_EXTENEX1 is not set -# CONFIG_SA1100_FLEXANET is not set -# CONFIG_SA1100_FREEBIRD is not set -# CONFIG_SA1100_GRAPHICSCLIENT is not set -# CONFIG_SA1100_GRAPHICSMASTER is not set -# CONFIG_SA1100_JORNADA720 is not set -# CONFIG_SA1100_HUW_WEBPANEL is not set -# CONFIG_SA1100_ITSY is not set -# CONFIG_SA1100_LART is not set -# CONFIG_SA1100_NANOENGINE is not set -# CONFIG_SA1100_OMNIMETER is not set -# CONFIG_SA1100_PANGOLIN is not set -# CONFIG_SA1100_PLEB is not set -# CONFIG_SA1100_SHERMAN is not set -# CONFIG_SA1100_SIMPAD is not set -# CONFIG_SA1100_PFS168 is not set -# CONFIG_SA1100_VICTOR is not set -# CONFIG_SA1100_XP860 is not set -# CONFIG_SA1100_YOPY is not set -# CONFIG_SA1100_USB is not set -# CONFIG_SA1100_USB_NETLINK is not set -# CONFIG_SA1100_USB_CHAR is not set - -# -# CLPS711X/EP721X Implementations -# -# CONFIG_ARCH_CDB89712 is not set -# CONFIG_ARCH_CLEP7312 is not set -# CONFIG_ARCH_EDB7211 is not set -# CONFIG_ARCH_P720T is not set -# CONFIG_ARCH_EP7211 is not set -# CONFIG_ARCH_EP7212 is not set -CONFIG_ARCH_ADI_EVB=y -CONFIG_XSCALE_PMU_TIMER=y -# CONFIG_ARCH_ACORN is not set -# CONFIG_FOOTBRIDGE is not set -# CONFIG_FOOTBRIDGE_HOST is not set -# CONFIG_FOOTBRIDGE_ADDIN is not set -CONFIG_CPU_32=y -# CONFIG_CPU_26 is not set -# CONFIG_CPU_32v3 is not set -# CONFIG_CPU_32v4 is not set -# CONFIG_CPU_ARM610 is not set -# CONFIG_CPU_ARM710 is not set -# CONFIG_CPU_ARM720T is not set -# CONFIG_CPU_ARM920T is not set -# CONFIG_CPU_ARM926T is not set -# CONFIG_CPU_ARM1020 is not set -# CONFIG_CPU_SA110 is not set -# CONFIG_CPU_SA1100 is not set -CONFIG_CPU_32v4=y -CONFIG_CPU_XSCALE=y -CONFIG_ARM_THUMB=y -# CONFIG_XSCALE_TOOLS is not set -CONFIG_XSCALE_WRITE_ALLOC=y -CONFIG_XSCALE_PMU=y -CONFIG_ARM_THUMB=y -# CONFIG_DISCONTIGMEM is not set - -# -# General setup -# -# CONFIG_PCI is not set -# CONFIG_ISA is not set -# CONFIG_ISA_DMA is not set -# CONFIG_HOTPLUG is not set -# CONFIG_PCMCIA is not set -CONFIG_NET=y -CONFIG_SYSVIPC=y -# CONFIG_BSD_PROCESS_ACCT is not set -CONFIG_SYSCTL=y -CONFIG_FPE_NWFPE=y -# CONFIG_FPE_FASTFPE is not set -CONFIG_KCORE_ELF=y -# CONFIG_KCORE_AOUT is not set -CONFIG_BINFMT_AOUT=y -CONFIG_BINFMT_ELF=y -# CONFIG_BINFMT_MISC is not set -# CONFIG_PM is not set -# CONFIG_ARTHUR is not set -CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/mtdblock1 mem=32M initrd=0xc0800000,3M" -CONFIG_ALIGNMENT_TRAP=y - -# -# Parallel port support -# -# CONFIG_PARPORT is not set - -# -# Memory Technology Devices (MTD) -# -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -CONFIG_MTD_PARTITIONS=y -# CONFIG_MTD_REDBOOT_PARTS is not set -# CONFIG_MTD_BOOTLDR_PARTS is not set -# CONFIG_MTD_AFS_PARTS is not set -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_CFI_INTELEXT=y -# CONFIG_MTD_CFI_AMDSTD is not set -# CONFIG_MTD_RAM is not set -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set -# CONFIG_MTD_OBSOLETE_CHIPS is not set -# CONFIG_MTD_AMDSTD is not set -# CONFIG_MTD_SHARP is not set -# CONFIG_MTD_JEDEC is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_NORA is not set -# CONFIG_MTD_ARM_INTEGRATOR is not set -# CONFIG_MTD_CDB89712 is not set -# CONFIG_MTD_SA1100 is not set -# CONFIG_MTD_DC21285 is not set -# CONFIG_MTD_IQ80310 is not set -CONFIG_MTD_ADI_EVB=y -# CONFIG_MTD_PCI is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLKMTD is not set -# CONFIG_MTD_DOC1000 is not set -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOCPROBE is not set - -# -# NAND Flash Device Drivers -# -# CONFIG_MTD_NAND is not set - -# -# Plug and Play configuration -# -# CONFIG_PNP is not set -# CONFIG_ISAPNP is not set -# CONFIG_PNPBIOS is not set - -# -# Block devices -# -# CONFIG_BLK_DEV_FD is not set -# CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_CISS_SCSI_TAPE is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_LOOP is not set -# CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_SIZE=8192 -CONFIG_BLK_DEV_INITRD=y - -# -# Multi-device support (RAID and LVM) -# -# CONFIG_MD is not set -# CONFIG_BLK_DEV_MD is not set -# CONFIG_MD_LINEAR is not set -# CONFIG_MD_RAID0 is not set -# CONFIG_MD_RAID1 is not set -# CONFIG_MD_RAID5 is not set -# CONFIG_MD_MULTIPATH is not set -# CONFIG_BLK_DEV_LVM is not set - -# -# Networking options -# -# CONFIG_PACKET is not set -CONFIG_NETLINK=y -CONFIG_RTNETLINK=y -# CONFIG_NETLINK_DEV is not set -# CONFIG_NETFILTER is not set -# CONFIG_FILTER is not set -CONFIG_UNIX=y -CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_PNP=y -# CONFIG_IP_PNP_DHCP is not set -CONFIG_IP_PNP_BOOTP=y -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE is not set -# CONFIG_ARPD is not set -# CONFIG_INET_ECN is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_IPV6 is not set -# CONFIG_KHTTPD is not set -# CONFIG_ATM is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_LLC is not set -# CONFIG_NET_DIVERT is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_NET_FASTROUTE is not set -# CONFIG_NET_HW_FLOWCONTROL is not set - -# -# QoS and/or fair queueing -# -# CONFIG_NET_SCHED is not set - -# -# Network device support -# -CONFIG_NETDEVICES=y - -# -# ARCnet devices -# -# CONFIG_ARCNET is not set -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_EQUALIZER is not set -# CONFIG_TUN is not set -# CONFIG_ETHERTAP is not set - -# -# Ethernet (10 or 100Mbit) -# -CONFIG_NET_ETHERNET=y -# CONFIG_ARM_AM79C961A is not set -# CONFIG_SUNLANCE is not set -# CONFIG_SUNBMAC is not set -# CONFIG_SUNQE is not set -# CONFIG_SUNLANCE is not set -# CONFIG_SUNGEM is not set -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_LANCE is not set -# CONFIG_NET_VENDOR_SMC is not set -# CONFIG_NET_VENDOR_RACAL is not set -# CONFIG_NET_ISA is not set -# CONFIG_NET_PCI is not set -# CONFIG_NET_POCKET is not set - -# -# Ethernet (1000 Mbit) -# -# CONFIG_ACENIC is not set -# CONFIG_DL2K is not set -# CONFIG_MYRI_SBUS is not set -# CONFIG_NS83820 is not set -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_SK98LIN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PLIP is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -# -# Wireless LAN (non-hamradio) -# -# CONFIG_NET_RADIO is not set - -# -# Token Ring devices -# -# CONFIG_TR is not set -# CONFIG_NET_FC is not set -# CONFIG_RCPCI is not set -# CONFIG_SHAPER is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set - -# -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA is not set - -# -# ATA/IDE/MFM/RLL support -# -# CONFIG_IDE is not set -# CONFIG_BLK_DEV_HD is not set - -# -# SCSI support -# -# CONFIG_SCSI is not set - -# -# I2O device support -# -# CONFIG_I2O is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set - -# -# ISDN subsystem -# -# CONFIG_ISDN is not set - -# -# Input core support -# -# CONFIG_INPUT is not set -# CONFIG_INPUT_KEYBDEV is not set -# CONFIG_INPUT_MOUSEDEV is not set -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_EVDEV is not set - -# -# Character devices -# -# CONFIG_VT is not set -CONFIG_SERIAL=y -CONFIG_SERIAL_CONSOLE=y -# CONFIG_SERIAL_EXTENDED is not set -# CONFIG_SERIAL_NONSTANDARD is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_AMBA is not set -# CONFIG_SERIAL_AMBA_CONSOLE is not set -# CONFIG_SERIAL_CLPS711X is not set -# CONFIG_SERIAL_CLPS711X_CONSOLE is not set -# CONFIG_SERIAL_21285 is not set -# CONFIG_SERIAL_21285_OLD is not set -# CONFIG_SERIAL_21285_CONSOLE is not set -# CONFIG_SERIAL_UART00 is not set -# CONFIG_SERIAL_UART00_CONSOLE is not set -# CONFIG_SERIAL_SA1100 is not set -# CONFIG_SERIAL_SA1100_CONSOLE is not set -# CONFIG_SERIAL_8250 is not set -# CONFIG_SERIAL_8250_CONSOLE is not set -# CONFIG_SERIAL_8250_EXTENDED is not set -# CONFIG_SERIAL_8250_MANY_PORTS is not set -# CONFIG_SERIAL_8250_SHARE_IRQ is not set -# CONFIG_SERIAL_8250_DETECT_IRQ is not set -# CONFIG_SERIAL_8250_MULTIPORT is not set -# CONFIG_SERIAL_8250_HUB6 is not set -CONFIG_UNIX98_PTYS=y -CONFIG_UNIX98_PTY_COUNT=256 - -# -# I2C support -# -# CONFIG_I2C is not set - -# -# L3 serial bus support -# -# CONFIG_L3 is not set -# CONFIG_L3_ALGOBIT is not set -# CONFIG_L3_BIT_SA1100_GPIO is not set -# CONFIG_L3_SA1111 is not set -# CONFIG_BIT_SA1100_GPIO is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -CONFIG_MOUSE=y -CONFIG_PSMOUSE=y -# CONFIG_82C710_MOUSE is not set -# CONFIG_PC110_PAD is not set - -# -# Joysticks -# -# CONFIG_INPUT_GAMEPORT is not set -# CONFIG_QIC02_TAPE is not set - -# -# Watchdog Cards -# -# CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set -# CONFIG_NVRAM is not set -# CONFIG_RTC is not set -# CONFIG_DTLK is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set - -# -# Ftape, the floppy tape device driver -# -# CONFIG_FTAPE is not set -# CONFIG_AGP is not set -# CONFIG_DRM is not set - -# -# Multimedia devices -# -# CONFIG_VIDEO_DEV is not set - -# -# File systems -# -# CONFIG_QUOTA is not set -# CONFIG_AUTOFS_FS is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_REISERFS_CHECK is not set -# CONFIG_ADFS_FS is not set -# CONFIG_ADFS_FS_RW is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_CMS_FS is not set -# CONFIG_EXT3_FS is not set -# CONFIG_JBD is not set -# CONFIG_JBD_DEBUG is not set -# CONFIG_FAT_FS is not set -# CONFIG_MSDOS_FS is not set -# CONFIG_UMSDOS_FS is not set -# CONFIG_VFAT_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_JFFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -# CONFIG_CRAMFS is not set -# CONFIG_TMPFS is not set -CONFIG_RAMFS=y -# CONFIG_ISO9660_FS is not set -# CONFIG_JOLIET is not set -# CONFIG_ZISOFS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_FREEVXFS_FS is not set -# CONFIG_NTFS_FS is not set -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_RW is not set -# CONFIG_HPFS_FS is not set -CONFIG_PROC_FS=y -# CONFIG_DEVFS_FS is not set -# CONFIG_DEVFS_MOUNT is not set -# CONFIG_DEVFS_DEBUG is not set -CONFIG_DEVPTS_FS=y -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX4FS_RW is not set -# CONFIG_ROMFS_FS is not set -CONFIG_EXT2_FS=y -# CONFIG_SYSV_FS is not set -# CONFIG_UDF_FS is not set -# CONFIG_UDF_RW is not set -# CONFIG_UFS_FS is not set -# CONFIG_UFS_FS_WRITE is not set - -# -# Network File Systems -# -# CONFIG_CODA_FS is not set -# CONFIG_INTERMEZZO_FS is not set -# CONFIG_NFS_FS is not set -# CONFIG_NFS_V3 is not set -# CONFIG_ROOT_NFS is not set -# CONFIG_NFSD is not set -# CONFIG_NFSD_V3 is not set -# CONFIG_SUNRPC is not set -# CONFIG_LOCKD is not set -# CONFIG_SMB_FS is not set -# CONFIG_NCP_FS is not set -# CONFIG_NCPFS_PACKET_SIGNING is not set -# CONFIG_NCPFS_IOCTL_LOCKING is not set -# CONFIG_NCPFS_STRONG is not set -# CONFIG_NCPFS_NFS_NS is not set -# CONFIG_NCPFS_OS2_NS is not set -# CONFIG_NCPFS_SMALLDOS is not set -# CONFIG_NCPFS_NLS is not set -# CONFIG_NCPFS_EXTRAS is not set -# CONFIG_ZISOFS_FS is not set -# CONFIG_ZLIB_FS_INFLATE is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -# CONFIG_MSDOS_PARTITION is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_SMB_NLS is not set -# CONFIG_NLS is not set - -# -# Multimedia Capabilities Port drivers -# -# CONFIG_MCP is not set -# CONFIG_MCP_SA1100 is not set -# CONFIG_MCP_UCB1200 is not set -# CONFIG_MCP_UCB1200_AUDIO is not set -# CONFIG_MCP_UCB1200_TS is not set - -# -# USB support -# -# CONFIG_USB is not set -# CONFIG_USB_UHCI is not set -# CONFIG_USB_UHCI_ALT is not set -# CONFIG_USB_OHCI is not set -# CONFIG_USB_OHCI_SA1111 is not set -# CONFIG_USB_AUDIO is not set -# CONFIG_USB_BLUETOOTH is not set -# CONFIG_USB_STORAGE is not set -# 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_JUMPSHOT is not set -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_DC2XX is not set -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_SCANNER is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USB_HPUSBSCSI is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_CATC is not set -# CONFIG_USB_CDCETHER is not set -# CONFIG_USB_USBNET is not set -# CONFIG_USB_USS720 is not set - -# -# USB Serial Converter support -# -# CONFIG_USB_SERIAL is not set -# CONFIG_USB_SERIAL_GENERIC is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# 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_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_PL2303 is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_XIRCOM is not set -# CONFIG_USB_SERIAL_OMNINET is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_ID75 is not set - -# -# Bluetooth support -# -# CONFIG_BT is not set - -# -# Kernel hacking -# -CONFIG_FRAME_POINTER=y -CONFIG_DEBUG_ERRORS=y -CONFIG_DEBUG_USER=y -# CONFIG_DEBUG_INFO is not set -CONFIG_DEBUG_SLAB=y -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_NO_PGT_CACHE is not set -CONFIG_DEBUG_LL=y -# CONFIG_DEBUG_DC21285_PORT is not set -# CONFIG_DEBUG_CLPS711X_UART2 is not set diff -Nru a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile --- a/arch/arm/kernel/Makefile 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/kernel/Makefile 2004-06-23 19:04:28 -07:00 @@ -11,8 +11,7 @@ time.o traps.o obj-$(CONFIG_APM) += apm.o -obj-$(CONFIG_ARCH_ACORN) += ecard.o time-acorn.o -obj-$(CONFIG_ARCH_CLPS7500) += time-acorn.o +obj-$(CONFIG_ARCH_ACORN) += ecard.o obj-$(CONFIG_FOOTBRIDGE) += isa.o obj-$(CONFIG_FIQ) += fiq.o obj-$(CONFIG_MODULES) += armksyms.o module.o diff -Nru a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S --- a/arch/arm/kernel/debug.S 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/kernel/debug.S 2004-06-23 19:04:26 -07:00 @@ -439,32 +439,6 @@ #endif .endm -#elif defined(CONFIG_ARCH_ADI_EVB) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - mov \rx, #0x00400000 @ physical base address - orrne \rx, \rx, #0xff000000 @ virtual base - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x5] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1002b - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x6] - tst \rd, #0x10 - beq 1001b - .endm - #elif defined(CONFIG_ARCH_IXP4XX) .macro addruart,rx @@ -591,7 +565,8 @@ .macro addruart,rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 @ MMU enabled? - ldr \rx, =0x80000700 @ physical base address + mov \rx, #0x00000700 @ offset from base + orreq \rx, \rx, #0x80000000 @ physical base orrne \rx, \rx, #0xf8000000 @ virtual base .endm diff -Nru a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S --- a/arch/arm/kernel/entry-armv.S 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/kernel/entry-armv.S 2004-06-23 19:04:26 -07:00 @@ -19,6 +19,7 @@ #include #include #include +#include #include "entry-header.S" @@ -561,7 +562,7 @@ .macro irq_prio_table .endm -#elif defined(CONFIG_ARCH_IOP310) || defined(CONFIG_ARCH_ADIFCC) +#elif defined(CONFIG_ARCH_IOP310) .macro disable_fiq .endm @@ -1198,8 +1199,13 @@ mov pc, lr @ CP#7 mov pc, lr @ CP#8 mov pc, lr @ CP#9 +#ifdef CONFIG_VFP + b do_vfp @ CP#10 (VFP) + b do_vfp @ CP#11 (VFP) +#else mov pc, lr @ CP#10 (VFP) mov pc, lr @ CP#11 (VFP) +#endif mov pc, lr @ CP#12 mov pc, lr @ CP#13 mov pc, lr @ CP#14 (Debug) @@ -1260,6 +1266,13 @@ ldr r3, [r2, #TI_CPU_DOMAIN]! stmia ip, {r4 - sl, fp, sp, lr} @ Store most regs on stack mcr p15, 0, r3, c3, c0, 0 @ Set domain register +#ifdef CONFIG_VFP + @ Always disable VFP so we can lazily save/restore the old + @ state. This occurs in the context of the previous thread. + VFPFMRX r4, FPEXC + bic r4, r4, #FPEXC_ENABLE + VFPFMXR FPEXC, r4 +#endif ldmib r2, {r4 - sl, fp, sp, pc} @ Load all regs saved previously __INIT diff -Nru a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c --- a/arch/arm/kernel/init_task.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/kernel/init_task.c 2004-06-23 19:04:28 -07:00 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c --- a/arch/arm/kernel/process.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/kernel/process.c 2004-06-23 19:04:28 -07:00 @@ -314,10 +314,16 @@ memset(thread->used_cp, 0, sizeof(thread->used_cp)); memset(&tsk->thread.debug, 0, sizeof(struct debug_info)); fp_init(&thread->fpstate); +#if defined(CONFIG_VFP) + vfp_flush_thread(&thread->vfpstate); +#endif } void release_thread(struct task_struct *dead_task) { +#if defined(CONFIG_VFP) + vfp_release_thread(&dead_task->thread_info->vfpstate); +#endif } asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); diff -Nru a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c --- a/arch/arm/kernel/setup.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/kernel/setup.c 2004-06-23 19:04:27 -07:00 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -34,6 +35,7 @@ #include #include +#include #ifndef MEM_SIZE #define MEM_SIZE (16*1024*1024) @@ -727,6 +729,7 @@ * Set up various architecture-specific pointers */ init_arch_irq = mdesc->init_irq; + init_arch_time = mdesc->init_time; init_machine = mdesc->init_machine; #ifdef CONFIG_VT diff -Nru a/arch/arm/kernel/time-acorn.c b/arch/arm/kernel/time-acorn.c --- a/arch/arm/kernel/time-acorn.c 2004-06-23 19:04:29 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,66 +0,0 @@ -/* - * linux/arch/arm/kernel/time-acorn.c - * - * Copyright (c) 1996-2000 Russell King. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Changelog: - * 24-Sep-1996 RMK Created - * 10-Oct-1996 RMK Brought up to date with arch-sa110eval - * 04-Dec-1997 RMK Updated for new arch/arm/time.c - */ -#include -#include - -#include -#include -#include - -extern unsigned long (*gettimeoffset)(void); - -static unsigned long ioctime_gettimeoffset(void) -{ - unsigned int count1, count2, status; - long offset; - - ioc_writeb (0, IOC_T0LATCH); - barrier (); - count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); - barrier (); - status = ioc_readb(IOC_IRQREQA); - barrier (); - ioc_writeb (0, IOC_T0LATCH); - barrier (); - count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); - - offset = count2; - if (count2 < count1) { - /* - * We have not had an interrupt between reading count1 - * and count2. - */ - if (status & (1 << 5)) - offset -= LATCH; - } else if (count2 > count1) { - /* - * We have just had another interrupt between reading - * count1 and count2. - */ - offset -= LATCH; - } - - offset = (LATCH - offset) * (tick_nsec / 1000); - return (offset + LATCH/2) / LATCH; -} - -void __init ioctime_init(void) -{ - ioc_writeb(LATCH & 255, IOC_T0LTCHL); - ioc_writeb(LATCH >> 8, IOC_T0LTCHH); - ioc_writeb(0, IOC_T0GO); - - gettimeoffset = ioctime_gettimeoffset; -} diff -Nru a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c --- a/arch/arm/kernel/time.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/kernel/time.c 2004-06-23 19:04:27 -07:00 @@ -27,12 +27,15 @@ #include #include #include +#include #include #include #include #include +#include + u64 jiffies_64 = INITIAL_JIFFIES; EXPORT_SYMBOL(jiffies_64); @@ -49,15 +52,11 @@ /* change this if you have some constant time drift */ #define USECS_PER_JIFFY (1000000/HZ) -static int dummy_set_rtc(void) -{ - return 0; -} /* * hook for setting the RTC's idea of the current time. */ -int (*set_rtc)(void) = dummy_set_rtc; +int (*set_rtc)(void); static unsigned long dummy_gettimeoffset(void) { @@ -238,7 +237,7 @@ #endif #ifdef CONFIG_LEDS_TIMER -static void do_leds(void) +static inline void do_leds(void) { static unsigned int count = 50; @@ -248,7 +247,7 @@ } } #else -#define do_leds() +#define do_leds() #endif void do_gettimeofday(struct timeval *tv) @@ -316,12 +315,18 @@ EXPORT_SYMBOL(do_settimeofday); -static struct irqaction timer_irq = { - .name = "timer", - .flags = SA_INTERRUPT, -}; +void timer_tick(struct pt_regs *regs) +{ + do_profile(regs); + do_leds(); + do_set_rtc(); + do_timer(regs); +} + +void (*init_arch_time)(void); + +void __init time_init(void) +{ + init_arch_time(); +} -/* - * Include architecture specific code - */ -#include diff -Nru a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c --- a/arch/arm/kernel/traps.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/kernel/traps.c 2004-06-23 19:04:26 -07:00 @@ -426,7 +426,7 @@ /* * Flush a region from virtual address 'r0' to virtual address 'r1' - * _inclusive_. There is no alignment requirement on either address; + * _exclusive_. There is no alignment requirement on either address; * user space does not need to know the hardware cache layout. * * r2 contains flags. It should ALWAYS be passed as ZERO until it diff -Nru a/arch/arm/mach-adifcc/Makefile b/arch/arm/mach-adifcc/Makefile --- a/arch/arm/mach-adifcc/Makefile 2004-06-23 19:04:25 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,11 +0,0 @@ -# -# Makefile for the linux kernel. -# - -# Object file lists. - -obj-y := arch.o irq.o mm.o -obj-m := -obj-n := -obj- := - diff -Nru a/arch/arm/mach-adifcc/arch.c b/arch/arm/mach-adifcc/arch.c --- a/arch/arm/mach-adifcc/arch.c 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,32 +0,0 @@ -/* - * linux/arch/arm/mach-adifcc/arch.c - * - * Copyright (C) 2001 MontaVista Software, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -extern void adifcc_map_io(void); -extern void adifcc_init_irq(void); - -#ifdef CONFIG_ARCH_ADI_EVB -MACHINE_START(ADI_EVB, "ADI 80200FCC Evaluation Board") - MAINTAINER("MontaVista Software Inc.") - BOOT_MEM(0xc0000000, 0x00400000, 0xff400000) - MAPIO(adifcc_map_io) - INITIRQ(adifcc_init_irq) -MACHINE_END -#endif - diff -Nru a/arch/arm/mach-adifcc/irq.c b/arch/arm/mach-adifcc/irq.c --- a/arch/arm/mach-adifcc/irq.c 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,61 +0,0 @@ -/* - * linux/arch/arm/mach-xscale/irq.c - * - * Author: Deepak Saxena - * Copyright: (C) 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Based on IOP80310 code. Currently there's nothing more than the - * 80200 on chip interrupts. That'll change once the hardware adds - * support for PCI though. - */ -#include -#include - -#include -#include -#include - -static void xs80200_irq_mask (unsigned int irq) -{ - long INTCTL; - asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (INTCTL)); - switch (irq) { - case IRQ_XS80200_BCU: INTCTL &= ~(1<<3); break; - case IRQ_XS80200_PMU: INTCTL &= ~(1<<2); break; - case IRQ_XS80200_EXTIRQ: INTCTL &= ~(1<<1); break; - case IRQ_XS80200_EXTFIQ: INTCTL &= ~(1<<0); break; - } - asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (INTCTL)); -} - -static void xs80200_irq_unmask (unsigned int irq) -{ - long INTCTL; - asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (INTCTL)); - switch (irq) { - case IRQ_XS80200_BCU: INTCTL |= (1<<3); break; - case IRQ_XS80200_PMU: INTCTL |= (1<<2); break; - case IRQ_XS80200_EXTIRQ: INTCTL |= (1<<1); break; - case IRQ_XS80200_EXTFIQ: INTCTL |= (1<<0); break; - } - asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (INTCTL)); -} - -void __init adifcc_init_irq(void) -{ - int i; - - for (i = 0; i < NR_XS80200_IRQS; i++) { - irq_desc[i].valid = 1; - irq_desc[i].probe_ok = 0; - irq_desc[i].mask_ack = xs80200_irq_mask; - irq_desc[i].mask = xs80200_irq_mask; - irq_desc[i].unmask = xs80200_irq_unmask; - } -} - - diff -Nru a/arch/arm/mach-adifcc/mm.c b/arch/arm/mach-adifcc/mm.c --- a/arch/arm/mach-adifcc/mm.c 2004-06-23 19:04:27 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,23 +0,0 @@ -/* - * linux/arch/arm/mach-xscale/mm.c - */ -#include -#include -#include - -#include -#include -#include - -#include - - -static struct map_desc adifcc_io_desc[] __initdata = { - /* on-board devices */ - { 0xff400000, 0x00400000, 0x00300000, MT_DEVICE } -}; - -void __init adifcc_map_io(void) -{ - iotable_init(adifcc_io_desc, ARRAY_SIZE(adifcc_io_desc)); -} diff -Nru a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c --- a/arch/arm/mach-clps711x/autcpu12.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-clps711x/autcpu12.c 2004-06-23 19:04:26 -07:00 @@ -37,6 +37,7 @@ extern void clps711x_map_io(void); extern void clps711x_init_irq(void); +extern void clps711x_init_time(void); /* * The on-chip registers are given a size of 1MB so that a section can @@ -65,5 +66,6 @@ BOOT_PARAMS(0xc0020000) MAPIO(autcpu12_map_io) INITIRQ(clps711x_init_irq) + INITTIME(clp711x_init_time) MACHINE_END diff -Nru a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c --- a/arch/arm/mach-clps711x/cdb89712.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-clps711x/cdb89712.c 2004-06-23 19:04:25 -07:00 @@ -34,6 +34,7 @@ extern void clps711x_init_irq(void); extern void clps711x_map_io(void); +extern void clps711x-init_time(void); /* * Map the CS89712 Ethernet port. That should be moved to the @@ -55,6 +56,7 @@ BOOT_PARAMS(0xc0000100) MAPIO(cdb89712_map_io) INITIRQ(clps711x_init_irq) + INITTIME(clps711x_init_time) MACHINE_END static int cdb89712_hw_init(void) diff -Nru a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c --- a/arch/arm/mach-clps711x/ceiva.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-clps711x/ceiva.c 2004-06-23 19:04:25 -07:00 @@ -35,6 +35,7 @@ #include extern void clps711x_init_irq(void); +extern void clps711x_init_time(void); static struct map_desc ceiva_io_desc[] __initdata = { /* virtual, physical, length, type */ @@ -58,4 +59,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(ceiva_map_io) INITIRQ(clps711x_init_irq) + INITTIME(clps711x_init_time) MACHINE_END diff -Nru a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c --- a/arch/arm/mach-clps711x/clep7312.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-clps711x/clep7312.c 2004-06-23 19:04:27 -07:00 @@ -25,6 +25,7 @@ extern void clps711x_init_irq(void); extern void clps711x_map_io(void); +extern void clps711x_init_time(void); static void __init fixup_clep7312(struct machine_desc *desc, struct tag *tags, @@ -44,5 +45,6 @@ FIXUP(fixup_clep7312) MAPIO(clps711x_map_io) INITIRQ(clps711x_init_irq) + INITTIME(clps711x_init_time) MACHINE_END diff -Nru a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c --- a/arch/arm/mach-clps711x/edb7211-arch.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-clps711x/edb7211-arch.c 2004-06-23 19:04:28 -07:00 @@ -27,6 +27,7 @@ extern void clps711x_init_irq(void); extern void edb7211_map_io(void); +extern void clps711x_init_time(void); static void __init fixup_edb7211(struct machine_desc *desc, struct tag *tags, @@ -56,4 +57,5 @@ FIXUP(fixup_edb7211) MAPIO(edb7211_map_io) INITIRQ(clps711x_init_irq) + INITTIME(clps711x_init_time) MACHINE_END diff -Nru a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c --- a/arch/arm/mach-clps711x/fortunet.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-clps711x/fortunet.c 2004-06-23 19:04:27 -07:00 @@ -33,6 +33,7 @@ extern void clps711x_map_io(void); extern void clps711x_init_irq(void); +extern void clps711x_init_time(void); struct meminfo memmap = { .nr_banks = 1, @@ -82,4 +83,5 @@ FIXUP(fortunet_fixup) MAPIO(clps711x_map_io) INITIRQ(clps711x_init_irq) + INITTIME(clps711x_init_time) MACHINE_END diff -Nru a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c --- a/arch/arm/mach-clps711x/p720t.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-clps711x/p720t.c 2004-06-23 19:04:27 -07:00 @@ -36,6 +36,7 @@ extern void clps711x_init_irq(void); extern void clps711x_map_io(void); +extern void clps711x_init_time(void); /* * Map the P720T system PLD. It occupies two address spaces: @@ -86,6 +87,7 @@ FIXUP(fixup_p720t) MAPIO(p720t_map_io) INITIRQ(clps711x_init_irq) + INITTIME(clps711x_init_time) MACHINE_END static int p720t_hw_init(void) diff -Nru a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c --- a/arch/arm/mach-clps711x/time.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-clps711x/time.c 2004-06-23 19:04:25 -07:00 @@ -18,12 +18,17 @@ */ #include #include +#include +#include #include +#include +#include #include #include -extern unsigned long (*gettimeoffset)(void); +#include + /* * gettimeoffset() returns time since last timer tick, in usecs. @@ -38,18 +43,35 @@ return (hwticks * (tick_nsec / 1000)) / LATCH; } -void __init clps711x_setup_timer(void) +/* + * IRQ handler for the timer + */ +static irqreturn_t +p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + timer_tick(regs); + return IRQ_HANDLED; +} + +static struct irqaction clps711x_timer_irq = { + .name = "CLPS711x Timer Tick", + .flags = SA_INTERRUPT, + .handler = p720t_timer_interrupt +}; + +void __init clps711x_init_time(void) { struct timespec tv; unsigned int syscon; - gettimeoffset = clps711x_gettimeoffset; - syscon = clps_readl(SYSCON1); syscon |= SYSCON1_TC2S | SYSCON1_TC2M; clps_writel(syscon, SYSCON1); clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */ + + setup_irq(IRQ_TC2OI, &clps711x_timer_irq); + gettimeoffset = clps711x_gettimeoffset; tv.tv_nsec = 0; tv.tv_sec = clps_readl(RTCDR); diff -Nru a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c --- a/arch/arm/mach-clps7500/core.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-clps7500/core.c 2004-06-23 19:04:27 -07:00 @@ -10,12 +10,13 @@ #include #include #include -#include +#include #include #include #include #include +#include #include #include @@ -265,10 +266,47 @@ iotable_init(cl7500_io_desc, ARRAY_SIZE(cl7500_io_desc)); } +extern void ioctime_init(void); + +static irqreturn_t +clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + timer_tick(regs); + + /* Why not using do_leds interface?? */ + { + /* Twinkle the lights. */ + static int count, state = 0xff00; + if (count-- == 0) { + state ^= 0x100; + count = 25; + *((volatile unsigned int *)LED_ADDRESS) = state; + } + } + return IRQ_HANDLED; +} + +static struct irqaction clps7500_timer_irq = { + .name = "CLPS7500 Timer Tick", + .flags = SA_INTERRUPT, + .handler = clps7500_timer_interrupt +}; + +/* + * Set up timer interrupt. + */ +void __init clps7500_init_time(void) +{ + ioctime_init(); + + setup_irq(IRQ_TIMER, &clps7500_timer_irq); +} + MACHINE_START(CLPS7500, "CL-PS7500") MAINTAINER("Philip Blundell") BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) MAPIO(clps7500_map_io) INITIRQ(clps7500_init_irq) + INITTIME(clps7500_init_time) MACHINE_END diff -Nru a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c --- a/arch/arm/mach-ebsa110/core.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-ebsa110/core.c 2004-06-23 19:04:26 -07:00 @@ -26,6 +26,8 @@ #include #include +#include + #define IRQ_MASK 0xfe000000 /* read */ #define IRQ_MSET 0xfe000000 /* write */ #define IRQ_STAT 0xff000000 /* read */ @@ -89,6 +91,103 @@ iotable_init(ebsa110_io_desc, ARRAY_SIZE(ebsa110_io_desc)); } + +#define PIT_CTRL (PIT_BASE + 0x0d) +#define PIT_T2 (PIT_BASE + 0x09) +#define PIT_T1 (PIT_BASE + 0x05) +#define PIT_T0 (PIT_BASE + 0x01) + +/* + * This is the rate at which your MCLK signal toggles (in Hz) + * This was measured on a 10 digit frequency counter sampling + * over 1 second. + */ +#define MCLK 47894000 + +/* + * This is the rate at which the PIT timers get clocked + */ +#define CLKBY7 (MCLK / 7) + +/* + * This is the counter value. We tick at 200Hz on this platform. + */ +#define COUNT ((CLKBY7 + (HZ / 2)) / HZ) + +/* + * Get the time offset from the system PIT. Note that if we have missed an + * interrupt, then the PIT counter will roll over (ie, be negative). + * This actually works out to be convenient. + */ +static unsigned long ebsa110_gettimeoffset(void) +{ + unsigned long offset, count; + + __raw_writeb(0x40, PIT_CTRL); + count = __raw_readb(PIT_T1); + count |= __raw_readb(PIT_T1) << 8; + + /* + * If count > COUNT, make the number negative. + */ + if (count > COUNT) + count |= 0xffff0000; + + offset = COUNT; + offset -= count; + + /* + * `offset' is in units of timer counts. Convert + * offset to units of microseconds. + */ + offset = offset * (1000000 / HZ) / COUNT; + + return offset; +} + +static irqreturn_t +ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + u32 count; + + /* latch and read timer 1 */ + __raw_writeb(0x40, PIT_CTRL); + count = __raw_readb(PIT_T1); + count |= __raw_readb(PIT_T1) << 8; + + count += COUNT; + + __raw_writeb(count & 0xff, PIT_T1); + __raw_writeb(count >> 8, PIT_T1); + + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction ebsa110_timer_irq = { + .name = "EBSA110 Timer Tick", + .flags = SA_INTERRUPT, + .handler = ebsa110_timer_interrupt +}; + +/* + * Set up timer interrupt. + */ +void __init ebsa110_time_init(void) +{ + /* + * Timer 1, mode 2, LSB/MSB + */ + __raw_writeb(0x70, PIT_CTRL); + __raw_writeb(COUNT & 0xff, PIT_T1); + __raw_writeb(COUNT >> 8, PIT_T1); + + gettimeoffset = ebsa110_gettimeoffset; + + setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq); +} + MACHINE_START(EBSA110, "EBSA110") MAINTAINER("Russell King") BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000) @@ -98,4 +197,5 @@ SOFT_REBOOT MAPIO(ebsa110_map_io) INITIRQ(ebsa110_init_irq) + INITTIME(ebsa110_init_time) MACHINE_END diff -Nru a/arch/arm/mach-ebsa110/time.c b/arch/arm/mach-ebsa110/time.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-ebsa110/time.c 2004-06-23 19:04:26 -07:00 @@ -0,0 +1,118 @@ +/* + * linux/include/asm-arm/arch-ebsa110/time.h + * + * Copyright (C) 1996,1997,1998 Russell King. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * No real time clock on the evalulation board! + * + * Changelog: + * 10-Oct-1996 RMK Created + * 04-Dec-1997 RMK Updated for new arch/arm/kernel/time.c + * 07-Aug-1998 RMK Updated for arch/arm/kernel/leds.c + * 28-Dec-1998 APH Made leds code optional + */ + +#include +#include + +extern unsigned long (*gettimeoffset)(void); + +#define PIT_CTRL (PIT_BASE + 0x0d) +#define PIT_T2 (PIT_BASE + 0x09) +#define PIT_T1 (PIT_BASE + 0x05) +#define PIT_T0 (PIT_BASE + 0x01) + +/* + * This is the rate at which your MCLK signal toggles (in Hz) + * This was measured on a 10 digit frequency counter sampling + * over 1 second. + */ +#define MCLK 47894000 + +/* + * This is the rate at which the PIT timers get clocked + */ +#define CLKBY7 (MCLK / 7) + +/* + * This is the counter value. We tick at 200Hz on this platform. + */ +#define COUNT ((CLKBY7 + (HZ / 2)) / HZ) + +/* + * Get the time offset from the system PIT. Note that if we have missed an + * interrupt, then the PIT counter will roll over (ie, be negative). + * This actually works out to be convenient. + */ +static unsigned long ebsa110_gettimeoffset(void) +{ + unsigned long offset, count; + + __raw_writeb(0x40, PIT_CTRL); + count = __raw_readb(PIT_T1); + count |= __raw_readb(PIT_T1) << 8; + + /* + * If count > COUNT, make the number negative. + */ + if (count > COUNT) + count |= 0xffff0000; + + offset = COUNT; + offset -= count; + + /* + * `offset' is in units of timer counts. Convert + * offset to units of microseconds. + */ + offset = offset * (1000000 / HZ) / COUNT; + + return offset; +} + +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + u32 count; + + /* latch and read timer 1 */ + __raw_writeb(0x40, PIT_CTRL); + count = __raw_readb(PIT_T1); + count |= __raw_readb(PIT_T1) << 8; + + count += COUNT; + + __raw_writeb(count & 0xff, PIT_T1); + __raw_writeb(count >> 8, PIT_T1); + + do_leds(); + do_timer(regs); + do_profile(regs); + + return IRQ_HANDLED; +} + +/* + * Set up timer interrupt. + */ +void __init time_init(void) +{ + /* + * Timer 1, mode 2, LSB/MSB + */ + __raw_writeb(0x70, PIT_CTRL); + __raw_writeb(COUNT & 0xff, PIT_T1); + __raw_writeb(COUNT >> 8, PIT_T1); + + gettimeoffset = ebsa110_gettimeoffset; + + timer_irq.handler = timer_interrupt; + + setup_irq(IRQ_EBSA110_TIMER0, &timer_irq); +} + + diff -Nru a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c --- a/arch/arm/mach-epxa10db/arch.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-epxa10db/arch.c 2004-06-23 19:04:27 -07:00 @@ -29,10 +29,13 @@ extern void epxa10db_map_io(void); extern void epxa10db_init_irq(void); +extern void epxa10db_init_time(void); MACHINE_START(CAMELOT, "Altera Epxa10db") MAINTAINER("Altera Corporation") BOOT_MEM(0x00000000, 0x7fffc000, 0xffffc000) MAPIO(epxa10db_map_io) INITIRQ(epxa10db_init_irq) + INITTIME(epxa10db_init_time) MACHINE_END + diff -Nru a/arch/arm/mach-epxa10db/time.c b/arch/arm/mach-epxa10db/time.c --- a/arch/arm/mach-epxa10db/time.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-epxa10db/time.c 2004-06-23 19:04:25 -07:00 @@ -10,11 +10,17 @@ */ #include #include +#include +#include #include +#include +#include +#include -extern int (*set_rtc)(void); +#define TIMER00_TYPE (volatile unsigned int*) +#include static int epxa10db_set_rtc(void) { @@ -29,3 +35,39 @@ } __initcall(epxa10db_rtc_init); + + +/* + * IRQ handler for the timer + */ +static irqreturn_t +epxa10db_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + + // ...clear the interrupt + *TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))|=TIMER0_CR_CI_MSK; + + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction epxa10db_timer_irq = { + .name = "Excalibur Timer Tick", + .flags = SA_INTERRUPT, + .handler = epxa10db_timer_interrupt +}; + +/* + * Set up timer interrupt, and return the current time in seconds. + */ +void __init epxa10db_init_time(void) +{ + /* Start the timer */ + *TIMER0_LIMIT(IO_ADDRESS(EXC_TIMER00_BASE))=(unsigned int)(EXC_AHB2_CLK_FREQUENCY/200); + *TIMER0_PRESCALE(IO_ADDRESS(EXC_TIMER00_BASE))=1; + *TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))=TIMER0_CR_IE_MSK | TIMER0_CR_S_MSK; + + setup_irq(IRQ_TIMER0, &epxa10db_timer_irq); +} + diff -Nru a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile --- a/arch/arm/mach-footbridge/Makefile 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-footbridge/Makefile 2004-06-23 19:04:27 -07:00 @@ -4,7 +4,7 @@ # Object file lists. -obj-y := arch.o dc21285.o dma.o irq.o isa-irq.o mm.o +obj-y := arch.o dc21285.o dma.o irq.o isa-irq.o mm.o time.o obj-m := obj-n := obj- := diff -Nru a/arch/arm/mach-footbridge/arch.c b/arch/arm/mach-footbridge/arch.c --- a/arch/arm/mach-footbridge/arch.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-footbridge/arch.c 2004-06-23 19:04:26 -07:00 @@ -22,6 +22,7 @@ extern void footbridge_map_io(void); extern void footbridge_init_irq(void); +extern void footbridge_init_time(void); unsigned int mem_fclk_21285 = 50000000; @@ -43,6 +44,7 @@ VIDEO(0x000a0000, 0x000bffff) MAPIO(footbridge_map_io) INITIRQ(footbridge_init_irq) + INITTIME(footbridge_init_time) MACHINE_END #endif @@ -78,6 +80,7 @@ FIXUP(fixup_netwinder) MAPIO(footbridge_map_io) INITIRQ(footbridge_init_irq) + INITTIME(footbridge_init_time) MACHINE_END #endif @@ -103,6 +106,7 @@ FIXUP(fixup_cats) MAPIO(footbridge_map_io) INITIRQ(footbridge_init_irq) + INITTIME(footbridge_init_time) MACHINE_END #endif @@ -129,6 +133,7 @@ FIXUP(fixup_coebsa285) MAPIO(footbridge_map_io) INITIRQ(footbridge_init_irq) + INITTIME(footbridge_init_time) MACHINE_END #endif @@ -139,5 +144,6 @@ BOOT_PARAMS(0x00000100) MAPIO(footbridge_map_io) INITIRQ(footbridge_init_irq) + INITTIME(footbridge_init_time) MACHINE_END #endif diff -Nru a/arch/arm/mach-footbridge/time.c b/arch/arm/mach-footbridge/time.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-footbridge/time.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,296 @@ +/* + * linux/include/asm-arm/arch-ebsa285/time.h + * + * Copyright (C) 1998 Russell King. + * Copyright (C) 1998 Phil Blundell + * + * CATS has a real-time clock, though the evaluation board doesn't. + * + * Changelog: + * 21-Mar-1998 RMK Created + * 27-Aug-1998 PJB CATS support + * 28-Dec-1998 APH Made leds optional + * 20-Jan-1999 RMK Started merge of EBSA285, CATS and NetWinder + * 16-Mar-1999 RMK More support for EBSA285-like machines with RTCs in + */ + +#define RTC_PORT(x) (rtc_base+(x)) +#define RTC_ALWAYS_BCD 0 + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +static int rtc_base; + +#define mSEC_10_from_14 ((14318180 + 100) / 200) + +static unsigned long isa_gettimeoffset(void) +{ + int count; + + static int count_p = (mSEC_10_from_14/6); /* for the first call after boot */ + static unsigned long jiffies_p = 0; + + /* + * cache volatile jiffies temporarily; we have IRQs turned off. + */ + unsigned long jiffies_t; + + /* timer count may underflow right here */ + outb_p(0x00, 0x43); /* latch the count ASAP */ + + count = inb_p(0x40); /* read the latched count */ + + /* + * We do this guaranteed double memory access instead of a _p + * postfix in the previous port access. Wheee, hackady hack + */ + jiffies_t = jiffies; + + count |= inb_p(0x40) << 8; + + /* Detect timer underflows. If we haven't had a timer tick since + the last time we were called, and time is apparently going + backwards, the counter must have wrapped during this routine. */ + if ((jiffies_t == jiffies_p) && (count > count_p)) + count -= (mSEC_10_from_14/6); + else + jiffies_p = jiffies_t; + + count_p = count; + + count = (((mSEC_10_from_14/6)-1) - count) * (tick_nsec / 1000); + count = (count + (mSEC_10_from_14/6)/2) / (mSEC_10_from_14/6); + + return count; +} + +static irqreturn_t +isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + timer_tick(regs); + + return IRQ_HANDLED; +} + +static unsigned long __init get_isa_cmos_time(void) +{ + unsigned int year, mon, day, hour, min, sec; + int i; + + // check to see if the RTC makes sense..... + if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0) + return mktime(1970, 1, 1, 0, 0, 0); + + /* The Linux interpretation of the CMOS clock register contents: + * When the Update-In-Progress (UIP) flag goes from 1 to 0, the + * RTC registers show the second which has precisely just started. + * Let's hope other operating systems interpret the RTC the same way. + */ + /* read RTC exactly on falling edge of update flag */ + for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */ + if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) + break; + + for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */ + if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)) + break; + + do { /* Isn't this overkill ? UIP above should guarantee consistency */ + sec = CMOS_READ(RTC_SECONDS); + min = CMOS_READ(RTC_MINUTES); + hour = CMOS_READ(RTC_HOURS); + day = CMOS_READ(RTC_DAY_OF_MONTH); + mon = CMOS_READ(RTC_MONTH); + year = CMOS_READ(RTC_YEAR); + } while (sec != CMOS_READ(RTC_SECONDS)); + + if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BCD_TO_BIN(sec); + BCD_TO_BIN(min); + BCD_TO_BIN(hour); + BCD_TO_BIN(day); + BCD_TO_BIN(mon); + BCD_TO_BIN(year); + } + if ((year += 1900) < 1970) + year += 100; + return mktime(year, mon, day, hour, min, sec); +} + +static int +set_isa_cmos_time(void) +{ + int retval = 0; + int real_seconds, real_minutes, cmos_minutes; + unsigned char save_control, save_freq_select; + unsigned long nowtime = xtime.tv_sec; + + save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */ + CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); + + save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */ + CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); + + cmos_minutes = CMOS_READ(RTC_MINUTES); + if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) + BCD_TO_BIN(cmos_minutes); + + /* + * since we're only adjusting minutes and seconds, + * don't interfere with hour overflow. This avoids + * messing with unknown time zones but requires your + * RTC not to be off by more than 15 minutes + */ + real_seconds = nowtime % 60; + real_minutes = nowtime / 60; + if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) + real_minutes += 30; /* correct for half hour time zone */ + real_minutes %= 60; + + if (abs(real_minutes - cmos_minutes) < 30) { + if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { + BIN_TO_BCD(real_seconds); + BIN_TO_BCD(real_minutes); + } + CMOS_WRITE(real_seconds,RTC_SECONDS); + CMOS_WRITE(real_minutes,RTC_MINUTES); + } else + retval = -1; + + /* The following flags have to be released exactly in this order, + * otherwise the DS12887 (popular MC146818A clone with integrated + * battery and quartz) will not reset the oscillator and will not + * update precisely 500 ms later. You won't find this mentioned in + * the Dallas Semiconductor data sheets, but who believes data + * sheets anyway ... -- Markus Kuhn + */ + CMOS_WRITE(save_control, RTC_CONTROL); + CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); + + return retval; +} + + +static unsigned long timer1_latch; + +static unsigned long timer1_gettimeoffset (void) +{ + unsigned long value = timer1_latch - *CSR_TIMER1_VALUE; + + return ((tick_nsec / 1000) * value) / timer1_latch; +} + +static irqreturn_t +timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + *CSR_TIMER1_CLR = 0; + + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction footbridge_timer_irq = { + .flags = SA_INTERRUPT +}; + +/* + * Set up timer interrupt. + */ +void __init footbridge_init_time(void) +{ + if (machine_is_co285() || + machine_is_personal_server()) + /* + * Add-in 21285s shouldn't access the RTC + */ + rtc_base = 0; + else + rtc_base = 0x70; + + if (rtc_base) { + int reg_d, reg_b; + + /* + * Probe for the RTC. + */ + reg_d = CMOS_READ(RTC_REG_D); + + /* + * make sure the divider is set + */ + CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_REG_A); + + /* + * Set control reg B + * (24 hour mode, update enabled) + */ + reg_b = CMOS_READ(RTC_REG_B) & 0x7f; + reg_b |= 2; + CMOS_WRITE(reg_b, RTC_REG_B); + + if ((CMOS_READ(RTC_REG_A) & 0x7f) == RTC_REF_CLCK_32KHZ && + CMOS_READ(RTC_REG_B) == reg_b) { + struct timespec tv; + + /* + * We have a RTC. Check the battery + */ + if ((reg_d & 0x80) == 0) + printk(KERN_WARNING "RTC: *** warning: CMOS battery bad\n"); + + tv.tv_nsec = 0; + tv.tv_sec = get_isa_cmos_time(); + do_settimeofday(&tv); + set_rtc = set_isa_cmos_time; + } else + rtc_base = 0; + } + + if (machine_is_ebsa285() || + machine_is_co285() || + machine_is_personal_server()) { + gettimeoffset = timer1_gettimeoffset; + + timer1_latch = (mem_fclk_21285 + 8 * HZ) / (16 * HZ); + + *CSR_TIMER1_CLR = 0; + *CSR_TIMER1_LOAD = timer1_latch; + *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16; + + footbridge_timer_irq.name = "Timer1 Timer Tick"; + footbrdige_timer_irq.handler = timer1_interrupt; + + setup_irq(IRQ_TIMER1, &footbridge_timer_irq); + + } else { + /* enable PIT timer */ + /* set for periodic (4) and LSB/MSB write (0x30) */ + outb(0x34, 0x43); + outb((mSEC_10_from_14/6) & 0xFF, 0x40); + outb((mSEC_10_from_14/6) >> 8, 0x40); + + gettimeoffset = isa_gettimeoffset; + + footbridge_timer_irq.name = "ISA Timer Tick"; + footbrdige_timer_irq.handler = isa_timer_interrupt; + + setup_irq(IRQ_ISA, &footbridge_timer_irq); + } +} diff -Nru a/arch/arm/mach-ftvpci/Makefile b/arch/arm/mach-ftvpci/Makefile --- a/arch/arm/mach-ftvpci/Makefile 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,13 +0,0 @@ -# -# Makefile for the linux kernel. -# - -# Object file lists. - -obj-y := core.o -obj-m := -obj-n := -obj- := - -obj-$(CONFIG_PCI) += pci.o -obj-$(CONFIG_LEDS) += leds.o diff -Nru a/arch/arm/mach-ftvpci/core.c b/arch/arm/mach-ftvpci/core.c --- a/arch/arm/mach-ftvpci/core.c 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,96 +0,0 @@ -/* - * linux/arch/arm/mach-ftvpci/core.c - * - * Architecture specific fixups. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -extern unsigned long soft_irq_mask; - -static const unsigned char irq_cmd[] = -{ - INTCONT_IRQ_DUART, - INTCONT_IRQ_PLX, - INTCONT_IRQ_D, - INTCONT_IRQ_C, - INTCONT_IRQ_B, - INTCONT_IRQ_A, - INTCONT_IRQ_SYSERR -}; - -static void ftvpci_mask_irq(unsigned int irq) -{ - __raw_writel(irq_cmd[irq], INTCONT_BASE); - soft_irq_mask &= ~(1<= FIRST_IRQ && i <= LAST_IRQ) { - irq_desc[i].valid = 1; - irq_desc[i].probe_ok = 1; - irq_desc[i].mask_ack = ftvpci_mask_irq; - irq_desc[i].mask = ftvpci_mask_irq; - irq_desc[i].unmask = ftvpci_unmask_irq; - ftvpci_mask_irq(i); - } else { - irq_desc[i].valid = 0; - irq_desc[i].probe_ok = 0; - } - } -} - -static struct map_desc ftvpci_io_desc[] __initdata = { - { INTCONT_BASE, INTCONT_START, 0x00001000, MT_DEVICE }, - { PLX_BASE, PLX_START, 0x00001000, MT_DEVICE }, - { PCIO_BASE, PLX_IO_START, 0x00100000, MT_DEVICE }, - { DUART_BASE, DUART_START, 0x00001000, MT_DEVICE }, - { STATUS_BASE, STATUS_START, 0x00001000, MT_DEVICE } -}; - -static void __init ftvpci_map_io(void) -{ - iotable_init(ftvpci_io_desc, ARRAY_SIZE(ftvpci_io_desc)); -} - -MACHINE_START(NEXUSPCI, "FTV/PCI") - MAINTAINER("Philip Blundell") - BOOT_MEM(0x40000000, 0x10000000, 0xe0000000) - MAPIO(ftvpci_map_io) - INITIRQ(ftvpci_init_irq) -MACHINE_END diff -Nru a/arch/arm/mach-ftvpci/leds.c b/arch/arm/mach-ftvpci/leds.c --- a/arch/arm/mach-ftvpci/leds.c 2004-06-23 19:04:25 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,36 +0,0 @@ -/* - * linux/arch/arm/kernel/leds-ftvpci.c - * - * Copyright (C) 1999 FutureTV Labs Ltd - */ - -#include -#include - -#include -#include -#include -#include - -static void ftvpci_leds_event(led_event_t ledevt) -{ - static int led_state = 0; - - switch(ledevt) { - case led_timer: - led_state ^= 1; - raw_writeb(0x1a | led_state, INTCONT_BASE); - break; - - default: - break; - } -} - -static int __init ftvpci_leds_init(void) -{ - leds_event = ftvpci_leds_event; - return 0; -} - -arch_initcall(ftvpci_leds_init); diff -Nru a/arch/arm/mach-ftvpci/pci.c b/arch/arm/mach-ftvpci/pci.c --- a/arch/arm/mach-ftvpci/pci.c 2004-06-23 19:04:29 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,60 +0,0 @@ -/* - * linux/arch/arm/kernel/ftv-pci.c - * - * PCI bios-type initialisation for PCI machines - * - * Bits taken from various places. - */ -#include -#include -#include - -#include -#include -#include - -/* - * Owing to a PCB cockup, issue A backplanes are wired thus: - * - * Slot 1 2 3 4 5 Bridge S1 S2 S3 S4 - * IRQ D C B A A C B A D - * A D C B B D C B A - * B A D C C A D C B - * C B A D D B A D C - * - * ID A31 A30 A29 A28 A27 A26 DEV4 DEV5 DEV6 DEV7 - * - * Actually, this isn't too bad, because with the processor card - * in slot 5 on the primary bus, the IRQs rotate on both sides - * as you'd expect. - */ - -static int irqmap_ftv[] __initdata = { IRQ_PCI_D, IRQ_PCI_C, IRQ_PCI_B, IRQ_PCI_A }; - -static int __init ftv_map_irq(struct pci_dev *dev, u8 slot, u8 pin) -{ - if (slot > 0x10) - slot--; - return irqmap_ftv[(slot - pin) & 3]; -} - -static u8 __init ftv_swizzle(struct pci_dev *dev, u8 *pin) -{ - return PCI_SLOT(dev->devfn); -} - -/* ftv host-specific stuff */ -static struct hw_pci ftv_pci __initdata = { - .init = plx90x0_init, - .swizzle = ftv_swizzle, - .map_irq = ftv_map_irq, -}; - -static int __init ftv_pci_init(void) -{ - if (machine_is_ftvpci()) - pci_common_init(&ftv_pci); - return 0; -} - -subsys_initcall(ftv_pci_init); diff -Nru a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile --- a/arch/arm/mach-integrator/Makefile 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-integrator/Makefile 2004-06-23 19:04:28 -07:00 @@ -4,7 +4,7 @@ # Object file lists. -obj-y := core.o lm.o time.o +obj-y := clock.o core.o lm.o time.o obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o diff -Nru a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-integrator/clock.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,138 @@ +/* + * linux/arch/arm/mach-integrator/clock.c + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "clock.h" + +static LIST_HEAD(clocks); +static DECLARE_MUTEX(clocks_sem); + +struct clk *clk_get(struct device *dev, const char *id) +{ + struct clk *p, *clk = ERR_PTR(-ENOENT); + + down(&clocks_sem); + list_for_each_entry(p, &clocks, node) { + if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { + clk = p; + break; + } + } + up(&clocks_sem); + + return clk; +} +EXPORT_SYMBOL(clk_get); + +void clk_put(struct clk *clk) +{ + module_put(clk->owner); +} +EXPORT_SYMBOL(clk_put); + +int clk_enable(struct clk *clk) +{ + return 0; +} +EXPORT_SYMBOL(clk_enable); + +void clk_disable(struct clk *clk) +{ +} +EXPORT_SYMBOL(clk_disable); + +int clk_use(struct clk *clk) +{ + return 0; +} +EXPORT_SYMBOL(clk_use); + +void clk_unuse(struct clk *clk) +{ +} +EXPORT_SYMBOL(clk_unuse); + +unsigned long clk_get_rate(struct clk *clk) +{ + return clk->rate; +} +EXPORT_SYMBOL(clk_get_rate); + +long clk_round_rate(struct clk *clk, unsigned long rate) +{ + return rate; +} +EXPORT_SYMBOL(clk_round_rate); + +int clk_set_rate(struct clk *clk, unsigned long rate) +{ + int ret = -EIO; + if (clk->setvco) { + struct icst525_vco vco; + + vco = icst525_khz_to_vco(clk->params, rate); + clk->rate = icst525_khz(clk->params, vco); + + printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", + clk->name, vco.s, vco.r, vco.v); + + clk->setvco(clk, vco); + ret = 0; + } + return 0; +} +EXPORT_SYMBOL(clk_set_rate); + +/* + * These are fixed clocks. + */ +static struct clk kmi_clk = { + .name = "KMIREFCLK", + .rate = 24000000, +}; + +static struct clk uart_clk = { + .name = "UARTCLK", + .rate = 14745600, +}; + +int clk_register(struct clk *clk) +{ + down(&clocks_sem); + list_add(&clk->node, &clocks); + up(&clocks_sem); + return 0; +} +EXPORT_SYMBOL(clk_register); + +void clk_unregister(struct clk *clk) +{ + down(&clocks_sem); + list_del(&clk->node); + up(&clocks_sem); +} +EXPORT_SYMBOL(clk_unregister); + +static int __init clk_init(void) +{ + clk_register(&kmi_clk); + clk_register(&uart_clk); + return 0; +} +arch_initcall(clk_init); diff -Nru a/arch/arm/mach-integrator/clock.h b/arch/arm/mach-integrator/clock.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-integrator/clock.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,25 @@ +/* + * linux/arch/arm/mach-integrator/clock.h + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +struct module; +struct icst525_params; + +struct clk { + struct list_head node; + unsigned long rate; + struct module *owner; + const char *name; + const struct icst525_params *params; + void *data; + void (*setvco)(struct clk *, struct icst525_vco vco); +}; + +int clk_register(struct clk *clk); +void clk_unregister(struct clk *clk); diff -Nru a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c --- a/arch/arm/mach-integrator/impd1.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-integrator/impd1.c 2004-06-23 19:04:26 -07:00 @@ -25,13 +25,16 @@ #include #include +#include "clock.h" + static int module_id; module_param_named(lmid, module_id, int, 0444); MODULE_PARM_DESC(lmid, "logic module stack position"); struct impd1_module { - void *base; + void *base; + struct clk vcos[2]; }; static const struct icst525_params impd1_vco_params = { @@ -43,25 +46,20 @@ .rd_max = 120, }; -void impd1_set_vco(struct device *dev, int vconr, unsigned long period) +static void impd1_setvco(struct clk *clk, struct icst525_vco vco) { - struct impd1_module *impd1 = dev_get_drvdata(dev); - struct icst525_vco vco; + struct impd1_module *impd1 = clk->data; + int vconr = clk - impd1->vcos; u32 val; - vco = icst525_ps_to_vco(&impd1_vco_params, period); - - pr_debug("Guessed VCO reg params: S=%d R=%d V=%d\n", - vco.s, vco.r, vco.v); - val = vco.v | (vco.r << 9) | (vco.s << 16); writel(0xa05f, impd1->base + IMPD1_LOCK); switch (vconr) { - case 1: + case 0: writel(val, impd1->base + IMPD1_OSC1); break; - case 2: + case 1: writel(val, impd1->base + IMPD1_OSC2); break; } @@ -77,8 +75,6 @@ #endif } -EXPORT_SYMBOL(impd1_set_vco); - void impd1_tweak_control(struct device *dev, u32 mask, u32 val) { struct impd1_module *impd1 = dev_get_drvdata(dev); @@ -140,6 +136,11 @@ } }; +static const char *impd1_vconames[2] = { + "CLCDCLK", + "AUXVCO2", +}; + static int impd1_probe(struct lm_device *dev) { struct impd1_module *impd1; @@ -168,6 +169,16 @@ printk("IM-PD1 found at 0x%08lx\n", dev->resource.start); + for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { + impd1->vcos[i].owner = THIS_MODULE, + impd1->vcos[i].name = impd1_vconames[i], + impd1->vcos[i].params = &impd1_vco_params, + impd1->vcos[i].data = impd1, + impd1->vcos[i].setvco = impd1_setvco; + + clk_register(&impd1->vcos[i]); + } + for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) { struct impd1_device *idev = impd1_devs + i; struct amba_device *d; @@ -216,12 +227,16 @@ { struct impd1_module *impd1 = lm_get_drvdata(dev); struct list_head *l, *n; + int i; list_for_each_safe(l, n, &dev->dev.children) { struct device *d = list_to_dev(l); device_unregister(d); } + + for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) + clk_unregister(&impd1->vcos[i]); lm_set_drvdata(dev, NULL); diff -Nru a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c --- a/arch/arm/mach-integrator/integrator_ap.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-integrator/integrator_ap.c 2004-06-23 19:04:28 -07:00 @@ -281,11 +281,17 @@ } } +static void ap_time_init(void) +{ + integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, 0); +} + MACHINE_START(INTEGRATOR, "ARM-Integrator") MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) BOOT_PARAMS(0x00000100) MAPIO(ap_map_io) INITIRQ(ap_init_irq) + INITTIME(ap_time_init) INIT_MACHINE(ap_init) MACHINE_END diff -Nru a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c --- a/arch/arm/mach-integrator/integrator_cp.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-integrator/integrator_cp.c 2004-06-23 19:04:28 -07:00 @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -32,12 +33,16 @@ #include #include +#include "clock.h" + #define INTCP_PA_MMC_BASE 0x1c000000 #define INTCP_PA_AACI_BASE 0x1d000000 #define INTCP_PA_FLASH_BASE 0x24000000 #define INTCP_FLASH_SIZE SZ_32M +#define INTCP_PA_CLCD_BASE 0xc0000000 + #define INTCP_VA_CIC_BASE 0xf1000040 #define INTCP_VA_PIC_BASE 0xf1400000 #define INTCP_VA_SIC_BASE 0xfca00000 @@ -210,6 +215,44 @@ } /* + * Clock handling + */ +#define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) +#define CM_AUXOSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+0x1c) + +static const struct icst525_params cp_auxvco_params = { + .ref = 24000, + .vco_max = 320000, + .vd_min = 8, + .vd_max = 263, + .rd_min = 3, + .rd_max = 65, +}; + +static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco) +{ + u32 val; + + val = readl(CM_AUXOSC) & ~0x7ffff; + val |= vco.v | (vco.r << 9) | (vco.s << 16); + + writel(0xa05f, CM_LOCK); + writel(val, CM_AUXOSC); + writel(0, CM_LOCK); +} + +static struct clk cp_clcd_clk = { + .name = "CLCDCLK", + .params = &cp_auxvco_params, + .setvco = cp_auxvco_set, +}; + +static struct clk cp_mmci_clk = { + .name = "MCLK", + .rate = 14745600, +}; + +/* * Flash handling. */ static int intcp_flash_init(void) @@ -308,7 +351,7 @@ } static struct mmc_platform_data mmc_data = { - .mclk = 33000000, + .mclk = 14745600, .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .status = mmc_status, }; @@ -340,15 +383,34 @@ .periphid = 0, }; +static struct amba_device clcd_device = { + .dev = { + .bus_id = "mb:c0", + .coherent_dma_mask = ~0, + }, + .res = { + .start = INTCP_PA_CLCD_BASE, + .end = INTCP_PA_CLCD_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .dma_mask = ~0, + .irq = { IRQ_CP_CLCDCINT, NO_IRQ }, + .periphid = 0, +}; + static struct amba_device *amba_devs[] __initdata = { &mmc_device, &aaci_device, + &clcd_device, }; static void __init intcp_init(void) { int i; + clk_register(&cp_clcd_clk); + clk_register(&cp_mmci_clk); + platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { @@ -357,11 +419,17 @@ } } +static void __init intcp_init_time(void) +{ + integrator_time_init(1000000 / HZ, TIMER_CTRL_IE); +} + MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) BOOT_PARAMS(0x00000100) MAPIO(intcp_map_io) INITIRQ(intcp_init_irq) + INITTIME(intcp_init_time) INIT_MACHINE(intcp_init) MACHINE_END diff -Nru a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c --- a/arch/arm/mach-integrator/time.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-integrator/time.c 2004-06-23 19:04:26 -07:00 @@ -10,9 +10,16 @@ #include #include #include +#include +#include #include #include +#include +#include +#include + +#include #define RTC_DR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 0) #define RTC_MR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 4) @@ -44,3 +51,140 @@ } __initcall(integrator_rtc_init); + + +/* + * Where is the timer (VA)? + */ +#define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000) +#define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100) +#define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200) +#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) + +/* + * How long is the timer interval? + */ +#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) +#if TIMER_INTERVAL >= 0x100000 +#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) +#elif TIMER_INTERVAL >= 0x10000 +#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) +#else +#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) +#endif + +#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */ + +/* + * What does it look like? + */ +typedef struct TimerStruct { + unsigned long TimerLoad; + unsigned long TimerValue; + unsigned long TimerControl; + unsigned long TimerClear; +} TimerStruct_t; + +extern unsigned long (*gettimeoffset)(void); + +static unsigned long timer_reload; + +/* + * Returns number of ms since last clock interrupt. Note that interrupts + * will have been disabled by do_gettimeoffset() + */ +static unsigned long integrator_gettimeoffset(void) +{ + volatile TimerStruct_t *timer1 = (TimerStruct_t *)TIMER1_VA_BASE; + unsigned long ticks1, ticks2, status; + + /* + * Get the current number of ticks. Note that there is a race + * condition between us reading the timer and checking for + * an interrupt. We get around this by ensuring that the + * counter has not reloaded between our two reads. + */ + ticks2 = timer1->TimerValue & 0xffff; + do { + ticks1 = ticks2; + status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS); + ticks2 = timer1->TimerValue & 0xffff; + } while (ticks2 > ticks1); + + /* + * Number of ticks since last interrupt. + */ + ticks1 = timer_reload - ticks2; + + /* + * Interrupt pending? If so, we've reloaded once already. + */ + if (status & (1 << IRQ_TIMERINT1)) + ticks1 += timer_reload; + + /* + * Convert the ticks to usecs + */ + return TICKS2USECS(ticks1); +} + +/* + * IRQ handler for the timer + */ +static irqreturn_t +integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE; + + // ...clear the interrupt + timer1->TimerClear = 1; + + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction integrator_timer_irq = { + .name = "Integrator Timer Tick", + .flags = SA_INTERRUPT, + .handler = integrator_timer_interrupt +}; + +/* + * Set up timer interrupt, and return the current time in seconds. + */ +void __init integrator_time_init(unsigned long reload, unsigned int ctrl) +{ + volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE; + volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE; + volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE; + unsigned int timer_ctrl = 0x80 | 0x40; /* periodic */ + + timer_reload = reload; + timer_ctrl |= ctrl; + + if (timer_reload > 0x100000) { + timer_reload >>= 8; + timer_ctrl |= 0x08; /* /256 */ + } else if (timer_reload > 0x010000) { + timer_reload >>= 4; + timer_ctrl |= 0x04; /* /16 */ + } + + /* + * Initialise to a known state (all timers off) + */ + timer0->TimerControl = 0; + timer1->TimerControl = 0; + timer2->TimerControl = 0; + + timer1->TimerLoad = timer_reload; + timer1->TimerValue = timer_reload; + timer1->TimerControl = timer_ctrl; + + /* + * Make irqs happen for the system timer + */ + setup_irq(IRQ_TIMERINT1, &integrator_timer_irq); + gettimeoffset = integrator_gettimeoffset; +} diff -Nru a/arch/arm/mach-iop3xx/arch.c b/arch/arm/mach-iop3xx/arch.c --- a/arch/arm/mach-iop3xx/arch.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-iop3xx/arch.c 2004-06-23 19:04:27 -07:00 @@ -29,6 +29,7 @@ #ifdef CONFIG_ARCH_IQ80321 extern void iq80321_map_io(void); extern void iop321_init_irq(void); +extern void iop321_init_time(void); #endif #ifdef CONFIG_ARCH_IQ80310 @@ -67,6 +68,7 @@ FIXUP(fixup_iop321) MAPIO(iq80321_map_io) INITIRQ(iop321_init_irq) + INITTIME(iop321_init_time) MACHINE_END #else diff -Nru a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c --- a/arch/arm/mach-iop3xx/iop321-time.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-iop3xx/iop321-time.c 2004-06-23 19:04:28 -07:00 @@ -23,7 +23,9 @@ #include #include #include + #include +#include static unsigned long iop321_gettimeoffset(void) { @@ -61,27 +63,26 @@ asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr)); - do_timer(regs); + timer_tick(regs); return IRQ_HANDLED; } -extern unsigned long (*gettimeoffset)(void); - -static struct irqaction timer_irq = { - .name = "timer", +static struct irqaction iop321_timer_irq = { + .name = "IOP321 Timer Tick", .handler = iop321_timer_interrupt, + .flags = SA_INTERRUPT }; extern int setup_arm_irq(int, struct irqaction*); -void __init time_init(void) +void __init iop321_init_time(void) { u32 timer_ctl; u32 latch = LATCH; gettimeoffset = iop321_gettimeoffset; - setup_irq(IRQ_IOP321_TIMER0, &timer_irq); + setup_irq(IRQ_IOP321_TIMER0, &iop321_timer_irq); timer_ctl = IOP321_TMR_EN | IOP321_TMR_PRIVILEGED | IOP321_TMR_RELOAD | IOP321_TMR_RATIO_1_1; diff -Nru a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c --- a/arch/arm/mach-ixp4xx/common.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-ixp4xx/common.c 2004-06-23 19:04:27 -07:00 @@ -36,6 +36,7 @@ #include #include +#include /************************************************************************* @@ -227,24 +228,22 @@ * Catch up with the real idea of time */ do { - do_timer(regs); + timer_tick(regs); last_jiffy_time += LATCH; } while((*IXP4XX_OSTS - last_jiffy_time) > LATCH); return IRQ_HANDLED; } -extern unsigned long (*gettimeoffset)(void); - -static struct irqaction timer_irq = { - .name = "IXP4xx Timer Tick", - .flags = SA_INTERRUPT +static struct irqaction ixp4xx_timer_irq = { + .name = "IXP4xx Timer Tick", + .flags = SA_INTERRUPT, + .handler = ixp4xx_timer_interrupt }; -void __init time_init(void) +void __init ixp4xx_init_time(void) { gettimeoffset = ixp4xx_gettimeoffset; - timer_irq.handler = ixp4xx_timer_interrupt; /* Clear Pending Interrupt by writing '1' to it */ *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; @@ -257,7 +256,7 @@ last_jiffy_time = 0; /* Connect the interrupt handler and enable the interrupt */ - setup_irq(IRQ_IXP4XX_TIMER1, &timer_irq); + setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq); } diff -Nru a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c --- a/arch/arm/mach-ixp4xx/coyote-setup.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-ixp4xx/coyote-setup.c 2004-06-23 19:04:26 -07:00 @@ -84,6 +84,7 @@ IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(coyote_map_io) INITIRQ(ixp4xx_init_irq) + INITTIME(ixp4xx_init_time) BOOT_PARAMS(0x0100) INIT_MACHINE(coyote_init) MACHINE_END diff -Nru a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c 2004-06-23 19:04:27 -07:00 @@ -113,6 +113,7 @@ IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(ixdp425_map_io) INITIRQ(ixp4xx_init_irq) + INITTIME(ixp4xx_init_time) BOOT_PARAMS(0x0100) INIT_MACHINE(ixdp425_init) MACHINE_END @@ -123,6 +124,7 @@ IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(ixdp425_map_io) INITIRQ(ixp4xx_init_irq) + INITTIME(ixp4xx_init_time) BOOT_PARAMS(0x0100) INIT_MACHINE(ixdp425_init) MACHINE_END @@ -140,6 +142,7 @@ IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(ixdp425_map_io) INITIRQ(ixp4xx_init_irq) + INITTIME(ixp4xx_init_time) BOOT_PARAMS(0x0100) INIT_MACHINE(ixdp425_init) MACHINE_END diff -Nru a/arch/arm/mach-ixp4xx/prpmc1100-setup.c b/arch/arm/mach-ixp4xx/prpmc1100-setup.c --- a/arch/arm/mach-ixp4xx/prpmc1100-setup.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-ixp4xx/prpmc1100-setup.c 2004-06-23 19:04:25 -07:00 @@ -84,6 +84,7 @@ IXP4XX_PERIPHERAL_BASE_VIRT) MAPIO(prpmc1100_map_io) INITIRQ(ixp4xx_init_irq) + INITTIME(ixp4xx_init_time) BOOT_PARAMS(0x0100) INIT_MACHINE(prpmc1100_init) MACHINE_END diff -Nru a/arch/arm/mach-lh7a40x/Kconfig b/arch/arm/mach-lh7a40x/Kconfig --- a/arch/arm/mach-lh7a40x/Kconfig 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-lh7a40x/Kconfig 2004-06-23 19:04:27 -07:00 @@ -34,6 +34,37 @@ config ARCH_LH7A404 bool +config LH7A40X_CONTIGMEM + bool "Disable NUMA Support" + depends on ARCH_LH7A40X + help + Say Y here if your bootloader sets the SROMLL bit(s) in + the SDRAM controller, organizing memory as a contiguous + array. This option will disable CONFIG_DISCONTIGMEM and + force the kernel to manage all memory in one node. + + Setting this option incorrectly may prevent the kernel from + booting. It is OK to leave it N. + + For more information, consult + . + +config LH7A40X_ONE_BANK_PER_NODE + bool "Optimize NUMA Node Tables for Size" + depends on ARCH_LH7A40X && !LH7A40X_CONTIGMEM + help + Say Y here to produce compact memory node tables. By + default pairs of adjacent physical RAM banks are managed + together in a single node, incurring some wasted overhead + in the node tables, however also maintaining compatibility + with systems where physical memory is truly contiguous. + + Setting this option incorrectly may prevent the kernel from + booting. It is OK to leave it N. + + For more information, consult + . + endmenu endif diff -Nru a/arch/arm/mach-lh7a40x/Makefile b/arch/arm/mach-lh7a40x/Makefile --- a/arch/arm/mach-lh7a40x/Makefile 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-lh7a40x/Makefile 2004-06-23 19:04:27 -07:00 @@ -4,7 +4,7 @@ # Object file lists. -obj-y := fiq.o +obj-y := fiq.o time.o # generic.o obj-$(CONFIG_MACH_KEV7A400) += arch-kev7a400.o irq-lh7a400.o obj-$(CONFIG_MACH_LPD7A400) += arch-lpd7a40x.o ide-lpd7a40x.o irq-lh7a400.o diff -Nru a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c --- a/arch/arm/mach-lh7a40x/arch-kev7a400.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c 2004-06-23 19:04:25 -07:00 @@ -25,6 +25,7 @@ /* This function calls the board specific IRQ initialization function. */ extern void lh7a400_init_irq (void); +extern void lh7a40x_init_time (void); static struct map_desc kev7a400_io_desc[] __initdata = { { IO_VIRT, IO_PHYS, IO_SIZE, MT_DEVICE }, @@ -108,4 +109,5 @@ BOOT_PARAMS (0xc0000100) MAPIO (kev7a400_map_io) INITIRQ (lh7a400_init_irq) + INITTIME (lh7a40x_init_time) MACHINE_END diff -Nru a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c --- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c 2004-06-23 19:04:25 -07:00 @@ -280,6 +280,7 @@ #ifdef CONFIG_MACH_LPD7A404 extern void lh7a404_init_irq (void); +extern void lh7a40x_init_time (void); MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10") MAINTAINER ("Marc Singer") @@ -287,6 +288,7 @@ BOOT_PARAMS (0xc0000100) MAPIO (lpd7a400_map_io) INITIRQ (lh7a404_init_irq) + INITTIME (lh7a40x_init_time) INIT_MACHINE (lpd7a40x_init) MACHINE_END diff -Nru a/arch/arm/mach-lh7a40x/time.c b/arch/arm/mach-lh7a40x/time.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-lh7a40x/time.c 2004-06-23 19:04:27 -07:00 @@ -0,0 +1,67 @@ +/* + * arch/arm/mach-lh7a40x/time.c + * + * Copyright (C) 2004 Logic Product Development + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#if HZ < 100 +# define TIMER_CONTROL TIMER_CONTROL1 +# define TIMER_LOAD TIMER_LOAD1 +# define TIMER_CONSTANT (508469/HZ) +# define TIMER_MODE (TIMER_C_ENABLE | TIMER_C_PERIODIC | TIMER_C_508KHZ) +# define TIMER_EOI TIMER_EOI1 +# define TIMER_IRQ IRQ_T1UI +#else +# define TIMER_CONTROL TIMER_CONTROL3 +# define TIMER_LOAD TIMER_LOAD3 +# define TIMER_CONSTANT (3686400/HZ) +# define TIMER_MODE (TIMER_C_ENABLE | TIMER_C_PERIODIC) +# define TIMER_EOI TIMER_EOI3 +# define TIMER_IRQ IRQ_T3UI +#endif + +static irqreturn_t +lh7a40x_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + TIMER_EOI = 0; + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction lh7a40x_timer_irq = { + .name = "LHA740x Timer Tick", + .flags = SA_INTERRUPT, + .handler = lh7a40x_timer_interrupt +}; + +void __init lh7a40x_init_time(void) +{ + /* Stop/disable all timers */ + TIMER_CONTROL1 = 0; + TIMER_CONTROL2 = 0; + TIMER_CONTROL3 = 0; + + setup_irq (TIMER_IRQ, &lh7a40x_timer_irq); + + TIMER_LOAD = TIMER_CONSTANT; + TIMER_CONTROL = TIMER_MODE; +} + diff -Nru a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile --- a/arch/arm/mach-omap/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-omap/Makefile 2004-06-23 19:04:25 -07:00 @@ -3,7 +3,7 @@ # # Common support -obj-y := common.o irq.o dma.o clocks.o mux.o bus.o gpio.o +obj-y := common.o irq.o dma.o clocks.o mux.o bus.o gpio.o time.o obj-m := obj-n := obj- := diff -Nru a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/board-generic.c --- a/arch/arm/mach-omap/board-generic.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-omap/board-generic.c 2004-06-23 19:04:27 -07:00 @@ -65,6 +65,11 @@ omap_map_io(); } +static void __init omap_generic_init_time(void) +{ + omap_init_time(); +} + MACHINE_START(OMAP_GENERIC, "Generic OMAP-1510/1610/1710") MAINTAINER("Tony Lindgren ") BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) @@ -72,4 +77,6 @@ MAPIO(omap_generic_map_io) INITIRQ(omap_generic_init_irq) INIT_MACHINE(omap_generic_init) + INITTIME(omap_generic_init_time) MACHINE_END + diff -Nru a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/board-innovator.c --- a/arch/arm/mach-omap/board-innovator.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-omap/board-innovator.c 2004-06-23 19:04:25 -07:00 @@ -156,5 +156,6 @@ BOOT_PARAMS(0x10000100) MAPIO(innovator_map_io) INITIRQ(innovator_init_irq) + INITTIME(omap_init_time) INIT_MACHINE(innovator_init) MACHINE_END diff -Nru a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/board-osk.c --- a/arch/arm/mach-omap/board-osk.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-omap/board-osk.c 2004-06-23 19:04:28 -07:00 @@ -94,5 +94,6 @@ BOOT_PARAMS(0x10000100) MAPIO(osk_map_io) INITIRQ(osk_init_irq) + INITTIME(omap_init_time) INIT_MACHINE(osk_init) MACHINE_END diff -Nru a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/board-perseus2.c --- a/arch/arm/mach-omap/board-perseus2.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-omap/board-perseus2.c 2004-06-23 19:04:28 -07:00 @@ -111,5 +111,6 @@ BOOT_PARAMS(0x10000100) MAPIO(omap_perseus2_map_io) INITIRQ(omap_perseus2_init_irq) + INITTIME(omap_init_time) INIT_MACHINE(omap_perseus2_init) MACHINE_END diff -Nru a/arch/arm/mach-omap/common.h b/arch/arm/mach-omap/common.h --- a/arch/arm/mach-omap/common.h 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-omap/common.h 2004-06-23 19:04:27 -07:00 @@ -28,6 +28,7 @@ #define __ARCH_ARM_MACH_OMAP_COMMON_H extern void omap_map_io(void); +extern void omap_init_time(void); #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ diff -Nru a/arch/arm/mach-omap/time.c b/arch/arm/mach-omap/time.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-omap/time.c 2004-06-23 19:04:27 -07:00 @@ -0,0 +1,212 @@ +/* + * arch/arm/mach-omap/time.c + * + * OMAP Timer Tick + * + * Copyright (C) 2000 RidgeRun, Inc. + * Author: Greg Lonnon + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef __instrument +#define __instrument +#define __noinstrument __attribute__ ((no_instrument_function)) +#endif + +typedef struct { + u32 cntl; /* CNTL_TIMER, R/W */ + u32 load_tim; /* LOAD_TIM, W */ + u32 read_tim; /* READ_TIM, R */ +} mputimer_regs_t; + +#define mputimer_base(n) \ + ((volatile mputimer_regs_t*)IO_ADDRESS(OMAP_MPUTIMER_BASE + \ + (n)*OMAP_MPUTIMER_OFFSET)) + +static inline unsigned long timer32k_read(int reg) { + unsigned long val; + val = omap_readw(reg + OMAP_32kHz_TIMER_BASE); + return val; +} +static inline void timer32k_write(int reg,int val) { + omap_writew(val, reg + OMAP_32kHz_TIMER_BASE); +} + +/* + * How long is the timer interval? 100 HZ, right... + * IRQ rate = (TVR + 1) / 32768 seconds + * TVR = 32768 * IRQ_RATE -1 + * IRQ_RATE = 1/100 + * TVR = 326 + */ +#define TIMER32k_PERIOD 326 +//#define TIMER32k_PERIOD 0x7ff + +static inline void start_timer32k(void) { + timer32k_write(TIMER32k_CR, + TIMER32k_TSS | TIMER32k_TRB | + TIMER32k_INT | TIMER32k_ARL); +} + +#ifdef CONFIG_MACH_OMAP_PERSEUS2 +/* + * After programming PTV with 0 and setting the MPUTIM_CLOCK_ENABLE + * (external clock enable) bit, the timer count rate is 6.5 MHz (13 + * MHZ input/2). !! The divider by 2 is undocumented !! + */ +#define MPUTICKS_PER_SEC (13000000/2) +#else +/* + * After programming PTV with 0, the timer count rate is 6 MHz. + * WARNING! this must be an even number, or machinecycles_to_usecs + * below will break. + */ +#define MPUTICKS_PER_SEC (12000000/2) +#endif + +static int mputimer_started[3] = {0,0,0}; + +static inline void __noinstrument start_mputimer(int n, + unsigned long load_val) +{ + volatile mputimer_regs_t* timer = mputimer_base(n); + + mputimer_started[n] = 0; + timer->cntl = MPUTIM_CLOCK_ENABLE; + udelay(1); + + timer->load_tim = load_val; + udelay(1); + timer->cntl = (MPUTIM_CLOCK_ENABLE | MPUTIM_AR | MPUTIM_ST); + mputimer_started[n] = 1; +} + +static inline unsigned long __noinstrument +read_mputimer(int n) +{ + volatile mputimer_regs_t* timer = mputimer_base(n); + return (mputimer_started[n] ? timer->read_tim : 0); +} + +void __noinstrument start_mputimer1(unsigned long load_val) +{ + start_mputimer(0, load_val); +} +void __noinstrument start_mputimer2(unsigned long load_val) +{ + start_mputimer(1, load_val); +} +void __noinstrument start_mputimer3(unsigned long load_val) +{ + start_mputimer(2, load_val); +} + +unsigned long __noinstrument read_mputimer1(void) +{ + return read_mputimer(0); +} +unsigned long __noinstrument read_mputimer2(void) +{ + return read_mputimer(1); +} +unsigned long __noinstrument read_mputimer3(void) +{ + return read_mputimer(2); +} + +unsigned long __noinstrument do_getmachinecycles(void) +{ + return 0 - read_mputimer(0); +} + +unsigned long __noinstrument machinecycles_to_usecs(unsigned long mputicks) +{ + /* Round up to nearest usec */ + return ((mputicks * 1000) / (MPUTICKS_PER_SEC / 2 / 1000) + 1) >> 1; +} + +/* + * This marks the time of the last system timer interrupt + * that was *processed by the ISR* (timer 2). + */ +static unsigned long systimer_mark; + +static unsigned long omap_gettimeoffset(void) +{ + /* Return elapsed usecs since last system timer ISR */ + return machinecycles_to_usecs(do_getmachinecycles() - systimer_mark); +} + +static irqreturn_t +omap_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + unsigned long now, ilatency; + + /* + * Mark the time at which the timer interrupt ocurred using + * timer1. We need to remove interrupt latency, which we can + * retrieve from the current system timer2 counter. Both the + * offset timer1 and the system timer2 are counting at 6MHz, + * so we're ok. + */ + now = 0 - read_mputimer1(); + ilatency = MPUTICKS_PER_SEC / 100 - read_mputimer2(); + systimer_mark = now - ilatency; + + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction omap_timer_irq = { + .name = "OMAP Timer Tick", + .flags = SA_INTERRUPT, + .handler = omap_timer_interrupt +}; + +void __init omap_init_time(void) +{ + /* Since we don't call request_irq, we must init the structure */ + gettimeoffset = omap_gettimeoffset; + +#ifdef OMAP1510_USE_32KHZ_TIMER + timer32k_write(TIMER32k_CR, 0x0); + timer32k_write(TIMER32k_TVR,TIMER32k_PERIOD); + setup_irq(INT_OS_32kHz_TIMER, &omap_timer_irq); + start_timer32k(); +#else + setup_irq(INT_TIMER2, &omap_timer_irq); + start_mputimer2(MPUTICKS_PER_SEC / 100 - 1); +#endif +} + diff -Nru a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile --- a/arch/arm/mach-pxa/Makefile 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-pxa/Makefile 2004-06-23 19:04:27 -07:00 @@ -3,7 +3,7 @@ # # Common support (must be linked before board specific support) -obj-y += generic.o irq.o dma.o +obj-y += generic.o irq.o dma.o time.o obj-$(CONFIG_PXA25x) += pxa25x.o obj-$(CONFIG_PXA27x) += pxa27x.o diff -Nru a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c --- a/arch/arm/mach-pxa/generic.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-pxa/generic.c 2004-06-23 19:04:26 -07:00 @@ -59,6 +59,24 @@ EXPORT_SYMBOL(pxa_gpio_mode); /* + * Routine to safely enable or disable a clock in the CKEN + */ +void pxa_set_cken(int clock, int enable) +{ + unsigned long flags; + local_irq_save(flags); + + if (enable) + CKEN |= clock; + else + CKEN &= ~clock; + + local_irq_restore(flags); +} + +EXPORT_SYMBOL(pxa_set_cken); + +/* * Intel PXA2xx internal register mapping. * * Note 1: not all PXA2xx variants implement all those addresses. @@ -180,10 +198,26 @@ .resource = pxafb_resources, }; +static struct platform_device ffuart_device = { + .name = "pxa2xx-uart", + .id = 0, +}; +static struct platform_device btuart_device = { + .name = "pxa2xx-uart", + .id = 1, +}; +static struct platform_device stuart_device = { + .name = "pxa2xx-uart", + .id = 2, +}; + static struct platform_device *devices[] __initdata = { &pxamci_device, &udc_device, &pxafb_device, + &ffuart_device, + &btuart_device, + &stuart_device, }; static int __init pxa_init(void) diff -Nru a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h --- a/arch/arm/mach-pxa/generic.h 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-pxa/generic.h 2004-06-23 19:04:28 -07:00 @@ -11,6 +11,7 @@ extern void __init pxa_map_io(void); extern void __init pxa_init_irq(void); +extern void __init pxa_init_time(void); #define SET_BANK(__nr,__start,__size) \ mi->bank[__nr].start = (__start), \ diff -Nru a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c --- a/arch/arm/mach-pxa/idp.c 2004-06-23 19:04:24 -07:00 +++ b/arch/arm/mach-pxa/idp.c 2004-06-23 19:04:24 -07:00 @@ -118,5 +118,6 @@ BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) MAPIO(idp_map_io) INITIRQ(idp_init_irq) + INITTIME(pxa_init_time) INIT_MACHINE(idp_init) MACHINE_END diff -Nru a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c --- a/arch/arm/mach-pxa/lubbock.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-pxa/lubbock.c 2004-06-23 19:04:26 -07:00 @@ -220,5 +220,6 @@ BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) MAPIO(lubbock_map_io) INITIRQ(lubbock_init_irq) + INITTIME(pxa_init_time) INIT_MACHINE(lubbock_init) MACHINE_END diff -Nru a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c --- a/arch/arm/mach-pxa/mainstone.c 2004-06-23 19:04:29 -07:00 +++ b/arch/arm/mach-pxa/mainstone.c 2004-06-23 19:04:29 -07:00 @@ -137,5 +137,6 @@ BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) MAPIO(mainstone_map_io) INITIRQ(mainstone_init_irq) + INITTIME(pxa_init_time) INIT_MACHINE(mainstone_init) MACHINE_END diff -Nru a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-pxa/time.c 2004-06-23 19:04:26 -07:00 @@ -0,0 +1,124 @@ +/* + * arch/arm/mach-pxa/time.c + * + * Author: Nicolas Pitre + * Created: Jun 15, 2001 + * Copyright: MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +static inline unsigned long pxa_get_rtc_time(void) +{ + return RCNR; +} + +static int pxa_set_rtc(void) +{ + unsigned long current_time = xtime.tv_sec; + + if (RTSR & RTSR_ALE) { + /* make sure not to forward the clock over an alarm */ + unsigned long alarm = RTAR; + if (current_time >= alarm && alarm >= RCNR) + return -ERESTARTSYS; + } + RCNR = current_time; + return 0; +} + +/* IRQs are disabled before entering here from do_gettimeofday() */ +static unsigned long pxa_gettimeoffset (void) +{ + long ticks_to_match, elapsed, usec; + + /* Get ticks before next timer match */ + ticks_to_match = OSMR0 - OSCR; + + /* We need elapsed ticks since last match */ + elapsed = LATCH - ticks_to_match; + + /* don't get fooled by the workaround in pxa_timer_interrupt() */ + if (elapsed <= 0) + return 0; + + /* Now convert them to usec */ + usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH; + + return usec; +} + +static irqreturn_t +pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + int next_match; + + /* Loop until we get ahead of the free running timer. + * This ensures an exact clock tick count and time accuracy. + * IRQs are disabled inside the loop to ensure coherence between + * lost_ticks (updated in do_timer()) and the match reg value, so we + * can use do_gettimeofday() from interrupt handlers. + * + * HACK ALERT: it seems that the PXA timer regs aren't updated right + * away in all cases when a write occurs. We therefore compare with + * 8 instead of 0 in the while() condition below to avoid missing a + * match if OSCR has already reached the next OSMR value. + * Experience has shown that up to 6 ticks are needed to work around + * this problem, but let's use 8 to be conservative. Note that this + * affect things only when the timer IRQ has been delayed by nearly + * exactly one tick period which should be a pretty rare event. + */ + do { + timer_tick(regs); + OSSR = OSSR_M0; /* Clear match on timer 0 */ + next_match = (OSMR0 += LATCH); + } while( (signed long)(next_match - OSCR) <= 8 ); + + return IRQ_HANDLED; +} + +static struct irqaction pxa_timer_irq = { + .name = "PXA Timer Tick", + .flags = SA_INTERRUPT, + .handler = pxa_timer_interrupt +}; + +void __init pxa_init_time(void) +{ + struct timespec tv; + + gettimeoffset = pxa_gettimeoffset; + set_rtc = pxa_set_rtc; + + tv.tv_nsec = 0; + tv.tv_sec = pxa_get_rtc_time(); + do_settimeofday(&tv); + + OSMR0 = 0; /* set initial match at 0 */ + OSSR = 0xf; /* clear status on all timers */ + setup_irq(IRQ_OST0, &pxa_timer_irq); + OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ + OSCR = 0; /* initialize free-running timer, force first match */ +} + diff -Nru a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c --- a/arch/arm/mach-rpc/riscpc.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-rpc/riscpc.c 2004-06-23 19:04:27 -07:00 @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include #include @@ -25,6 +27,7 @@ #include #include +#include extern void rpc_init_irq(void); @@ -82,6 +85,31 @@ elf_hwcap &= ~HWCAP_HALF; } +static irqreturn_t +rpc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction rpc_timer_irq = { + .name = "RiscPC Timer Tick", + .flags = SA_INTERRUPT, + .handler = rpc_timer_interrupt +}; + +/* + * Set up timer interrupt. + */ +void __init rpc_init_time(void) +{ + extern void ioctime_init(void); + ioctime_init(); + + setup_irq(IRQ_TIMER, &rpc_timer_irq); +} + MACHINE_START(RISCPC, "Acorn-RiscPC") MAINTAINER("Russell King") BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) @@ -90,4 +118,5 @@ DISABLE_PARPORT(1) MAPIO(rpc_map_io) INITIRQ(rpc_init_irq) + INITTIME(rpc_init_time) MACHINE_END diff -Nru a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile --- a/arch/arm/mach-s3c2410/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-s3c2410/Makefile 2004-06-23 19:04:25 -07:00 @@ -4,7 +4,7 @@ # Object file lists. -obj-y := s3c2410.o irq.o +obj-y := s3c2410.o irq.o time.o obj-m := obj-n := obj- := diff -Nru a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c --- a/arch/arm/mach-s3c2410/mach-bast.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-s3c2410/mach-bast.c 2004-06-23 19:04:27 -07:00 @@ -185,10 +185,16 @@ } +void __init bast_init_time(void) +{ + s3c2410_init_time(); +} + MACHINE_START(BAST, "Simtec-BAST") MAINTAINER("Ben Dooks ") BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART) BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(bast_map_io) INITIRQ(bast_init_irq) + INITTIME(bast_init_time) MACHINE_END diff -Nru a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c --- a/arch/arm/mach-s3c2410/mach-h1940.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-s3c2410/mach-h1940.c 2004-06-23 19:04:28 -07:00 @@ -91,10 +91,16 @@ } +void __init ipaq_init_time(void) +{ + s3c2410_init_time(); +} + MACHINE_START(H1940, "IPAQ-H1940") MAINTAINER("Ben Dooks ") BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART) BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(ipaq_map_io) INITIRQ(ipaq_init_irq) + INITTIME(ipaq_init_time) MACHINE_END diff -Nru a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c --- a/arch/arm/mach-s3c2410/mach-smdk2410.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-s3c2410/mach-smdk2410.c 2004-06-23 19:04:27 -07:00 @@ -99,6 +99,11 @@ s3c2410_init_irq(); } +void __init smdk2410_init_time(void) +{ + s3c2401_init_time(); +} + MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch * to SMDK2410 */ MAINTAINER("Jonas Dietsche") @@ -106,4 +111,5 @@ BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(smdk2410_map_io) INITIRQ(smdk2410_init_irq) + INITTIME(smdk2410_init_time) MACHINE_END diff -Nru a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c --- a/arch/arm/mach-s3c2410/mach-vr1000.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-s3c2410/mach-vr1000.c 2004-06-23 19:04:28 -07:00 @@ -155,10 +155,16 @@ } +void __init vr1000_init_time(void) +{ + s3c2401_init_time(); +} + MACHINE_START(VR1000, "Simtec-VR1000") MAINTAINER("Ben Dooks ") BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART) BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) MAPIO(vr1000_map_io) INITIRQ(vr1000_init_irq) + INITTIME(vr1000_init_time) MACHINE_END diff -Nru a/arch/arm/mach-s3c2410/s3c2410.h b/arch/arm/mach-s3c2410/s3c2410.h --- a/arch/arm/mach-s3c2410/s3c2410.h 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-s3c2410/s3c2410.h 2004-06-23 19:04:26 -07:00 @@ -4,3 +4,5 @@ extern void s3c2410_init_irq(void); +extern s3c2410_init_time(void); + diff -Nru a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-s3c2410/time.c 2004-06-23 19:04:26 -07:00 @@ -0,0 +1,176 @@ +/* linux/include/asm-arm/arch-s3c2410/time.h + * + * Copyright (C) 2003 Simtec Electronics + * Ben Dooks, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static unsigned long timer_startval; +static unsigned long timer_ticks_usec; + +#ifdef CONFIG_S3C2410_RTC +extern void s3c2410_rtc_check(); +#endif + +/* with an 12MHz clock, we get 12 ticks per-usec + */ + + +/*** + * Returns microsecond since last clock interrupt. Note that interrupts + * will have been disabled by do_gettimeoffset() + * IRQs are disabled before entering here from do_gettimeofday() + */ +static unsigned long s3c2410_gettimeoffset (void) +{ + unsigned long tdone; + unsigned long usec; + + /* work out how many ticks have gone since last timer interrupt */ + + tdone = timer_startval - __raw_readl(S3C2410_TCNTO(4)); + + /* currently, tcnt is in 12MHz units, but this may change + * for non-bast machines... + */ + + usec = tdone / timer_ticks_usec; + + return usec; +} + + +/* + * IRQ handler for the timer + */ +static irqreturn_t +s3c2410_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction s3c2410_timer_irq = { + .name = "S32410 Timer Tick", + .flags = SA_INTERRUPT, + .handler = s3c2410_timer_interrupt +}; + +/* + * Set up timer interrupt, and return the current time in seconds. + * + * Currently we only use timer4, as it is the only timer which has no + * other function that can be exploited externally + */ +void __init s3c2410_init_time (void) +{ + unsigned long tcon; + unsigned long tcnt; + unsigned long tcfg1; + unsigned long tcfg0; + + gettimeoffset = s3c2410_gettimeoffset; + + tcnt = 0xffff; /* default value for tcnt */ + + /* read the current timer configuration bits */ + + tcon = __raw_readl(S3C2410_TCON); + tcfg1 = __raw_readl(S3C2410_TCFG1); + tcfg0 = __raw_readl(S3C2410_TCFG0); + + /* configure the system for whichever machine is in use */ + + if (machine_is_bast() || machine_is_vr1000()) { + timer_ticks_usec = 12; /* timer is at 12MHz */ + tcnt = (timer_ticks_usec * (1000*1000)) / HZ; + } + + /* for the h1940, we use the pclk from the core to generate + * the timer values. since 67.5MHz is not a value we can directly + * generate the timer value from, we need to pre-scale and + * divied before using it. + * + * overall divsior to get 200Hz is 337500 + * we can fit tcnt if we pre-scale by 6, producing a tick rate + * of 11.25MHz, and a tcnt of 56250. + */ + + if (machine_is_h1940() || machine_is_smdk2410() ) { + timer_ticks_usec = s3c2410_pclk / (1000*1000); + timer_ticks_usec /= 6; + + tcfg1 &= ~S3C2410_TCFG1_MUX4_MASK; + tcfg1 |= S3C2410_TCFG1_MUX4_DIV2; + + tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK; + tcfg0 |= ((6 - 1) / 2) << S3C2410_TCFG_PRESCALER1_SHIFT; + + tcnt = (s3c2410_pclk / 6) / HZ; + } + + + printk("setup_timer tcon=%08lx, tcnt %04lx, tcfg %08lx,%08lx\n", + tcon, tcnt, tcfg0, tcfg1); + + /* check to see if timer is within 16bit range... */ + if (tcnt > 0xffff) { + panic("setup_timer: HZ is too small, cannot configure timer!"); + return; + } + + __raw_writel(tcfg1, S3C2410_TCFG1); + __raw_writel(tcfg0, S3C2410_TCFG0); + + timer_startval = tcnt; + __raw_writel(tcnt, S3C2410_TCNTB(4)); + + /* ensure timer is stopped... */ + + tcon &= ~(7<<20); + tcon |= S3C2410_TCON_T4RELOAD; + tcon |= S3C2410_TCON_T4MANUALUPD; + + __raw_writel(tcon, S3C2410_TCON); + __raw_writel(tcnt, S3C2410_TCNTB(4)); + __raw_writel(tcnt, S3C2410_TCMPB(4)); + + setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); + + /* start the timer running */ + tcon |= S3C2410_TCON_T4START; + tcon &= ~S3C2410_TCON_T4MANUALUPD; + __raw_writel(tcon, S3C2410_TCON); +} + + + diff -Nru a/arch/arm/mach-sa1100/adsbitsy.c b/arch/arm/mach-sa1100/adsbitsy.c --- a/arch/arm/mach-sa1100/adsbitsy.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/adsbitsy.c 2004-06-23 19:04:25 -07:00 @@ -147,4 +147,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(adsbitsy_map_io) INITIRQ(adsbitsy_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c --- a/arch/arm/mach-sa1100/assabet.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/assabet.c 2004-06-23 19:04:25 -07:00 @@ -324,5 +324,6 @@ FIXUP(fixup_assabet) MAPIO(assabet_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) INIT_MACHINE(assabet_init) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c --- a/arch/arm/mach-sa1100/badge4.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/badge4.c 2004-06-23 19:04:25 -07:00 @@ -245,4 +245,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(badge4_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/brutus.c b/arch/arm/mach-sa1100/brutus.c --- a/arch/arm/mach-sa1100/brutus.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-sa1100/brutus.c 2004-06-23 19:04:28 -07:00 @@ -37,4 +37,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(brutus_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c --- a/arch/arm/mach-sa1100/cerf.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-sa1100/cerf.c 2004-06-23 19:04:26 -07:00 @@ -92,4 +92,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(cerf_map_io) INITIRQ(cerf_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/empeg.c b/arch/arm/mach-sa1100/empeg.c --- a/arch/arm/mach-sa1100/empeg.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-sa1100/empeg.c 2004-06-23 19:04:27 -07:00 @@ -35,4 +35,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(empeg_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/flexanet.c b/arch/arm/mach-sa1100/flexanet.c --- a/arch/arm/mach-sa1100/flexanet.c 2004-06-23 19:04:29 -07:00 +++ b/arch/arm/mach-sa1100/flexanet.c 2004-06-23 19:04:29 -07:00 @@ -183,5 +183,6 @@ BOOT_PARAMS(0xc0000100) MAPIO(flexanet_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/freebird.c b/arch/arm/mach-sa1100/freebird.c --- a/arch/arm/mach-sa1100/freebird.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/freebird.c 2004-06-23 19:04:25 -07:00 @@ -77,4 +77,5 @@ #endif MAPIO(freebird_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h --- a/arch/arm/mach-sa1100/generic.h 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-sa1100/generic.h 2004-06-23 19:04:27 -07:00 @@ -6,6 +6,7 @@ extern void __init sa1100_map_io(void); extern void __init sa1100_init_irq(void); +extern void __init sa1100_init_time(void); #define SET_BANK(__nr,__start,__size) \ mi->bank[__nr].start = (__start), \ diff -Nru a/arch/arm/mach-sa1100/graphicsclient.c b/arch/arm/mach-sa1100/graphicsclient.c --- a/arch/arm/mach-sa1100/graphicsclient.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-sa1100/graphicsclient.c 2004-06-23 19:04:28 -07:00 @@ -198,4 +198,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(graphicsclient_map_io) INITIRQ(graphicsclient_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/graphicsmaster.c b/arch/arm/mach-sa1100/graphicsmaster.c --- a/arch/arm/mach-sa1100/graphicsmaster.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-sa1100/graphicsmaster.c 2004-06-23 19:04:26 -07:00 @@ -287,4 +287,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(graphicsmaster_map_io) INITIRQ(graphicsmaster_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c --- a/arch/arm/mach-sa1100/h3600.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-sa1100/h3600.c 2004-06-23 19:04:26 -07:00 @@ -286,6 +286,7 @@ BOOT_PARAMS(0xc0000100) MAPIO(h3100_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END #endif /* CONFIG_SA1100_H3100 */ @@ -400,6 +401,7 @@ BOOT_PARAMS(0xc0000100) MAPIO(h3600_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END #endif /* CONFIG_SA1100_H3600 */ @@ -783,6 +785,7 @@ BOOT_PARAMS(0xc0000100) MAPIO(h3800_map_io) INITIRQ(h3800_init_irq) + INITTIME(sa1100_init_time) MACHINE_END #endif /* CONFIG_SA1100_H3800 */ diff -Nru a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c --- a/arch/arm/mach-sa1100/hackkit.c 2004-06-23 19:04:29 -07:00 +++ b/arch/arm/mach-sa1100/hackkit.c 2004-06-23 19:04:29 -07:00 @@ -174,4 +174,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(hackkit_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/huw_webpanel.c b/arch/arm/mach-sa1100/huw_webpanel.c --- a/arch/arm/mach-sa1100/huw_webpanel.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-sa1100/huw_webpanel.c 2004-06-23 19:04:28 -07:00 @@ -81,4 +81,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(huw_webpanel_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/itsy.c b/arch/arm/mach-sa1100/itsy.c --- a/arch/arm/mach-sa1100/itsy.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-sa1100/itsy.c 2004-06-23 19:04:28 -07:00 @@ -37,4 +37,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(itsy_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c --- a/arch/arm/mach-sa1100/jornada720.c 2004-06-23 19:04:29 -07:00 +++ b/arch/arm/mach-sa1100/jornada720.c 2004-06-23 19:04:29 -07:00 @@ -101,4 +101,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(jornada720_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c --- a/arch/arm/mach-sa1100/lart.c 2004-06-23 19:04:29 -07:00 +++ b/arch/arm/mach-sa1100/lart.c 2004-06-23 19:04:29 -07:00 @@ -43,4 +43,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(lart_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c --- a/arch/arm/mach-sa1100/nanoengine.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/nanoengine.c 2004-06-23 19:04:25 -07:00 @@ -49,4 +49,5 @@ FIXUP(fixup_nanoengine) MAPIO(nanoengine_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/omnimeter.c b/arch/arm/mach-sa1100/omnimeter.c --- a/arch/arm/mach-sa1100/omnimeter.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/omnimeter.c 2004-06-23 19:04:25 -07:00 @@ -59,4 +59,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(omnimeter_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/pangolin.c b/arch/arm/mach-sa1100/pangolin.c --- a/arch/arm/mach-sa1100/pangolin.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-sa1100/pangolin.c 2004-06-23 19:04:28 -07:00 @@ -40,4 +40,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(pangolin_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/pfs168.c b/arch/arm/mach-sa1100/pfs168.c --- a/arch/arm/mach-sa1100/pfs168.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/pfs168.c 2004-06-23 19:04:25 -07:00 @@ -112,4 +112,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(pfs168_map_io) INITIRQ(pfs168_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c --- a/arch/arm/mach-sa1100/pleb.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-sa1100/pleb.c 2004-06-23 19:04:26 -07:00 @@ -31,4 +31,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(pleb_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c --- a/arch/arm/mach-sa1100/shannon.c 2004-06-23 19:04:29 -07:00 +++ b/arch/arm/mach-sa1100/shannon.c 2004-06-23 19:04:29 -07:00 @@ -41,4 +41,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(shannon_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/sherman.c b/arch/arm/mach-sa1100/sherman.c --- a/arch/arm/mach-sa1100/sherman.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-sa1100/sherman.c 2004-06-23 19:04:27 -07:00 @@ -27,4 +27,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(sherman_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c --- a/arch/arm/mach-sa1100/simpad.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/simpad.c 2004-06-23 19:04:25 -07:00 @@ -231,4 +231,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(simpad_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/stork.c b/arch/arm/mach-sa1100/stork.c --- a/arch/arm/mach-sa1100/stork.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-sa1100/stork.c 2004-06-23 19:04:27 -07:00 @@ -331,6 +331,7 @@ BOOT_PARAMS(0xc0000100) MAPIO(stork_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/system3.c b/arch/arm/mach-sa1100/system3.c --- a/arch/arm/mach-sa1100/system3.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-sa1100/system3.c 2004-06-23 19:04:28 -07:00 @@ -470,4 +470,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(system3_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-sa1100/time.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,112 @@ +/* + * linux/include/asm-arm/arch-sa1100/time.h + * + * Copyright (C) 1998 Deborah Wallach. + * Twiddles (C) 1999 Hugo Fiennes + * + * 2000/03/29 (C) Nicolas Pitre + * Rewritten: big cleanup, much simpler, better HZ accuracy. + * + */ + + +#define RTC_DEF_DIVIDER (32768 - 1) +#define RTC_DEF_TRIM 0 + +static unsigned long __init sa1100_get_rtc_time(void) +{ + /* + * According to the manual we should be able to let RTTR be zero + * and then a default diviser for a 32.768KHz clock is used. + * Apparently this doesn't work, at least for my SA1110 rev 5. + * If the clock divider is uninitialized then reset it to the + * default value to get the 1Hz clock. + */ + if (RTTR == 0) { + RTTR = RTC_DEF_DIVIDER + (RTC_DEF_TRIM << 16); + printk(KERN_WARNING "Warning: uninitialized Real Time Clock\n"); + /* The current RTC value probably doesn't make sense either */ + RCNR = 0; + return 0; + } + return RCNR; +} + +static int sa1100_set_rtc(void) +{ + unsigned long current_time = xtime.tv_sec; + + if (RTSR & RTSR_ALE) { + /* make sure not to forward the clock over an alarm */ + unsigned long alarm = RTAR; + if (current_time >= alarm && alarm >= RCNR) + return -ERESTARTSYS; + } + RCNR = current_time; + return 0; +} + +/* IRQs are disabled before entering here from do_gettimeofday() */ +static unsigned long sa1100_gettimeoffset (void) +{ + unsigned long ticks_to_match, elapsed, usec; + + /* Get ticks before next timer match */ + ticks_to_match = OSMR0 - OSCR; + + /* We need elapsed ticks since last match */ + elapsed = LATCH - ticks_to_match; + + /* Now convert them to usec */ + usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH; + + return usec; +} + +/* + * We will be entered with IRQs enabled. + * + * Loop until we get ahead of the free running timer. + * This ensures an exact clock tick count and time accuracy. + * IRQs are disabled inside the loop to ensure coherence between + * lost_ticks (updated in do_timer()) and the match reg value, so we + * can use do_gettimeofday() from interrupt handlers. + */ +static irqreturn_t +sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + unsigned int next_match; + + do { + timer_tick(regs); + OSSR = OSSR_M0; /* Clear match on timer 0 */ + next_match = (OSMR0 += LATCH); + } while ((signed long)(next_match - OSCR) <= 0); + + return IRQ_HANDLED; +} + +static struct irqaction sa1100_timer_irq = { + .name = "SA11xx Timer Tick", + .flags = SA_INTERRUPT, + .handler = sa1100_timer_interrupt +}; + +void __init sa1100_init_time(void) +{ + struct timespec tv; + + gettimeoffset = sa1100_gettimeoffset; + set_rtc = sa1100_set_rtc; + + tv.tv_nsec = 0; + tv.tv_sec = sa1100_get_rtc_time(); + do_settimeofday(&tv); + + OSMR0 = 0; /* set initial match at 0 */ + OSSR = 0xf; /* clear status on all timers */ + setup_irq(IRQ_OST0, &sa1100_timer_irq); + OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ + OSCR = 0; /* initialize free-running timer, force first match */ +} + diff -Nru a/arch/arm/mach-sa1100/trizeps.c b/arch/arm/mach-sa1100/trizeps.c --- a/arch/arm/mach-sa1100/trizeps.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mach-sa1100/trizeps.c 2004-06-23 19:04:28 -07:00 @@ -228,4 +228,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(trizeps_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/xp860.c b/arch/arm/mach-sa1100/xp860.c --- a/arch/arm/mach-sa1100/xp860.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-sa1100/xp860.c 2004-06-23 19:04:27 -07:00 @@ -89,4 +89,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(xp860_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-sa1100/yopy.c b/arch/arm/mach-sa1100/yopy.c --- a/arch/arm/mach-sa1100/yopy.c 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-sa1100/yopy.c 2004-06-23 19:04:25 -07:00 @@ -91,4 +91,5 @@ BOOT_PARAMS(0xc0000100) MAPIO(yopy_map_io) INITIRQ(sa1100_init_irq) + INITTIME(sa1100_init_time) MACHINE_END diff -Nru a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c --- a/arch/arm/mach-shark/core.c 2004-06-23 19:04:27 -07:00 +++ b/arch/arm/mach-shark/core.c 2004-06-23 19:04:27 -07:00 @@ -5,13 +5,18 @@ */ #include #include +#include +#include #include #include #include +#include +#include #include #include +#include extern void shark_init_irq(void); @@ -24,10 +29,43 @@ iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc)); } +#define IRQ_TIMER 0 +#define HZ_TIME ((1193180 + HZ/2) / HZ) + +static irqreturn_t +shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction shark_timer_irq = { + .name = "Shark Timer Tick", + .flags = SA_INTERRUPT, + .handler = shark_timer_interrupt +}; + +/* + * Set up timer interrupt, and return the current time in seconds. + */ +void __init shark_init_time(void) +{ + unsigned long flags; + + outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */ + outb(HZ_TIME & 0xff, 0x40); /* LSB of count */ + outb(HZ_TIME >> 8, 0x40); + + setup_irq(IRQ_TIMER, &shark_timer_irq); +} + + MACHINE_START(SHARK, "Shark") MAINTAINER("Alexander Schulz") BOOT_MEM(0x08000000, 0x40000000, 0xe0000000) BOOT_PARAMS(0x08003000) MAPIO(shark_map_io) INITIRQ(shark_init_irq) + INITTIME(shark_init_time) MACHINE_END diff -Nru a/arch/arm/mach-tbox/Makefile b/arch/arm/mach-tbox/Makefile --- a/arch/arm/mach-tbox/Makefile 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,11 +0,0 @@ -# -# Makefile for the linux kernel. -# - -# Object file lists. - -obj-y := core.o -obj-m := -obj-n := -obj- := - diff -Nru a/arch/arm/mach-tbox/core.c b/arch/arm/mach-tbox/core.c --- a/arch/arm/mach-tbox/core.c 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,73 +0,0 @@ -/* - * linux/arch/arm/mm/mm-tbox.c - * - * Copyright (C) 1998, 1999, 2000 Phil Blundell - * Copyright (C) 1998-1999 Russell King - * - * Extra MM routines for the Tbox architecture - */ -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -extern unsigned long soft_irq_mask; - -static void tbox_mask_irq(unsigned int irq) -{ - __raw_writel(0, INTCONT + (irq << 2)); - soft_irq_mask &= ~(1<= 12 && i <= 13)) { - irq_desc[i].valid = 1; - irq_desc[i].probe_ok = 0; - irq_desc[i].mask_ack = tbox_mask_irq; - irq_desc[i].mask = tbox_mask_irq; - irq_desc[i].unmask = tbox_unmask_irq; - tbox_mask_irq(i); - } else { - irq_desc[i].valid = 0; - irq_desc[i].probe_ok = 0; - } - } -} - -static struct map_desc tbox_io_desc[] __initdata = { - /* See hardware.h for details */ - { IO_BASE, IO_START, 0x00100000, MT_DEVICE } -}; - -static void __init tbox_map_io(void) -{ - iotable_init(tbox_io_desc, ARRAY_SIZE(tbox_io_desc)); -} - -MACHINE_START(TBOX, "unknown-TBOX") - MAINTAINER("Philip Blundell") - BOOT_MEM(0x80000000, 0x00400000, 0xe0000000) - MAPIO(tbox_map_io) - INITIRQ(tbox_init_irq) -MACHINE_END - diff -Nru a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile --- a/arch/arm/mach-versatile/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/arm/mach-versatile/Makefile 2004-06-23 19:04:25 -07:00 @@ -2,4 +2,4 @@ # Makefile for the linux kernel. # -obj-y := core.o +obj-y := core.o clock.o diff -Nru a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-versatile/clock.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,146 @@ +/* + * linux/arch/arm/mach-versatile/clock.c + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "clock.h" + +static LIST_HEAD(clocks); +static DECLARE_MUTEX(clocks_sem); + +struct clk *clk_get(struct device *dev, const char *id) +{ + struct clk *p, *clk = ERR_PTR(-ENOENT); + + down(&clocks_sem); + list_for_each_entry(p, &clocks, node) { + if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { + clk = p; + break; + } + } + up(&clocks_sem); + + return clk; +} +EXPORT_SYMBOL(clk_get); + +void clk_put(struct clk *clk) +{ + module_put(clk->owner); +} +EXPORT_SYMBOL(clk_put); + +int clk_enable(struct clk *clk) +{ + return 0; +} +EXPORT_SYMBOL(clk_enable); + +void clk_disable(struct clk *clk) +{ +} +EXPORT_SYMBOL(clk_disable); + +int clk_use(struct clk *clk) +{ + return 0; +} +EXPORT_SYMBOL(clk_use); + +void clk_unuse(struct clk *clk) +{ +} +EXPORT_SYMBOL(clk_unuse); + +unsigned long clk_get_rate(struct clk *clk) +{ + return clk->rate; +} +EXPORT_SYMBOL(clk_get_rate); + +long clk_round_rate(struct clk *clk, unsigned long rate) +{ + return rate; +} +EXPORT_SYMBOL(clk_round_rate); + +int clk_set_rate(struct clk *clk, unsigned long rate) +{ + int ret = -EIO; +#if 0 // Not yet + if (clk->setvco) { + struct icst525_vco vco; + + vco = icst525_khz_to_vco(clk->params, rate); + clk->rate = icst525_khz(clk->params, vco); + + printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", + clk->name, vco.s, vco.r, vco.v); + + clk->setvco(clk, vco); + ret = 0; + } +#endif + return 0; +} +EXPORT_SYMBOL(clk_set_rate); + +/* + * These are fixed clocks. + */ +static struct clk kmi_clk = { + .name = "KMIREFCLK", + .rate = 24000000, +}; + +static struct clk uart_clk = { + .name = "UARTCLK", + .rate = 24000000, +}; + +static struct clk mmci_clk = { + .name = "MCLK", + .rate = 33000000, +}; + +int clk_register(struct clk *clk) +{ + down(&clocks_sem); + list_add(&clk->node, &clocks); + up(&clocks_sem); + return 0; +} +EXPORT_SYMBOL(clk_register); + +void clk_unregister(struct clk *clk) +{ + down(&clocks_sem); + list_del(&clk->node); + up(&clocks_sem); +} +EXPORT_SYMBOL(clk_unregister); + +static int __init clk_init(void) +{ + clk_register(&kmi_clk); + clk_register(&uart_clk); + clk_register(&mmci_clk); + return 0; +} +arch_initcall(clk_init); diff -Nru a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-versatile/clock.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,25 @@ +/* + * linux/arch/arm/mach-versatile/clock.h + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +struct module; +struct icst525_params; + +struct clk { + struct list_head node; + unsigned long rate; + struct module *owner; + const char *name; + const struct icst525_params *params; + void *data; + void (*setvco)(struct clk *, struct icst525_vco vco); +}; + +int clk_register(struct clk *clk); +void clk_unregister(struct clk *clk); diff -Nru a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c --- a/arch/arm/mach-versatile/core.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mach-versatile/core.c 2004-06-23 19:04:26 -07:00 @@ -22,7 +22,9 @@ #include #include #include +#include +#include #include #include #include @@ -33,6 +35,7 @@ #include #include #include +#include #include #ifdef CONFIG_MMC #include @@ -511,11 +514,153 @@ leds_event = versatile_leds_event; } +/* + * Where is the timer (VA)? + */ +#define TIMER0_VA_BASE IO_ADDRESS(VERSATILE_TIMER0_1_BASE) +#define TIMER1_VA_BASE (IO_ADDRESS(VERSATILE_TIMER0_1_BASE) + 0x20) +#define TIMER2_VA_BASE IO_ADDRESS(VERSATILE_TIMER2_3_BASE) +#define TIMER3_VA_BASE (IO_ADDRESS(VERSATILE_TIMER2_3_BASE) + 0x20) +#define VA_IC_BASE IO_ADDRESS(VERSATILE_VIC_BASE) + +/* + * How long is the timer interval? + */ +#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10) +#if TIMER_INTERVAL >= 0x100000 +#define TIMER_RELOAD (TIMER_INTERVAL >> 8) /* Divide by 256 */ +#define TIMER_CTRL 0x88 /* Enable, Clock / 256 */ +#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC) +#elif TIMER_INTERVAL >= 0x10000 +#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */ +#define TIMER_CTRL 0x84 /* Enable, Clock / 16 */ +#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC) +#else +#define TIMER_RELOAD (TIMER_INTERVAL) +#define TIMER_CTRL 0x80 /* Enable */ +#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) +#endif + +#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */ + +/* + * What does it look like? + */ +typedef struct TimerStruct { + unsigned long TimerLoad; + unsigned long TimerValue; + unsigned long TimerControl; + unsigned long TimerClear; +} TimerStruct_t; + +extern unsigned long (*gettimeoffset)(void); + +/* + * Returns number of ms since last clock interrupt. Note that interrupts + * will have been disabled by do_gettimeoffset() + */ +static unsigned long versatile_gettimeoffset(void) +{ + volatile TimerStruct_t *timer0 = (TimerStruct_t *)TIMER0_VA_BASE; + unsigned long ticks1, ticks2, status; + + /* + * Get the current number of ticks. Note that there is a race + * condition between us reading the timer and checking for + * an interrupt. We get around this by ensuring that the + * counter has not reloaded between our two reads. + */ + ticks2 = timer0->TimerValue & 0xffff; + do { + ticks1 = ticks2; + status = __raw_readl(VA_IC_BASE + VIC_IRQ_RAW_STATUS); + ticks2 = timer0->TimerValue & 0xffff; + } while (ticks2 > ticks1); + + /* + * Number of ticks since last interrupt. + */ + ticks1 = TIMER_RELOAD - ticks2; + + /* + * Interrupt pending? If so, we've reloaded once already. + * + * FIXME: Need to check this is effectively timer 0 that expires + */ + if (status & IRQMASK_TIMERINT0_1) + ticks1 += TIMER_RELOAD; + + /* + * Convert the ticks to usecs + */ + return TICKS2USECS(ticks1); +} + +/* + * IRQ handler for the timer + */ +static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE; + + // ...clear the interrupt + timer0->TimerClear = 1; + + timer_tick(regs); + + return IRQ_HANDLED; +} + +static struct irqaction versatile_timer_irq = { + .name = "Versatile Timer Tick", + .flags = SA_INTERRUPT, + .handler = versatile_timer_interrupt +}; + +/* + * Set up timer interrupt, and return the current time in seconds. + */ +void __init versatile_init_time(void) +{ + volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE; + volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE; + volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE; + volatile TimerStruct_t *timer3 = (volatile TimerStruct_t *)TIMER3_VA_BASE; + + /* + * set clock frequency: + * VERSATILE_REFCLK is 32KHz + * VERSATILE_TIMCLK is 1MHz + */ + *(volatile unsigned int *)IO_ADDRESS(VERSATILE_SCTL_BASE) |= + ((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) | + (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel)); + + /* + * Initialise to a known state (all timers off) + */ + timer0->TimerControl = 0; + timer1->TimerControl = 0; + timer2->TimerControl = 0; + timer3->TimerControl = 0; + + timer0->TimerLoad = TIMER_RELOAD; + timer0->TimerValue = TIMER_RELOAD; + timer0->TimerControl = TIMER_CTRL | 0x40 | TIMER_CTRL_IE; /* periodic + IE */ + + /* + * Make irqs happen for the system timer + */ + setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq); + gettimeoffset = versatile_gettimeoffset; +} + MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000) BOOT_PARAMS(0x00000100) MAPIO(versatile_map_io) INITIRQ(versatile_init_irq) + INITTIME(versatile_init_time) INIT_MACHINE(versatile_init) MACHINE_END diff -Nru a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig --- a/arch/arm/mm/Kconfig 2004-06-23 19:04:26 -07:00 +++ b/arch/arm/mm/Kconfig 2004-06-23 19:04:26 -07:00 @@ -220,7 +220,7 @@ # XScale config CPU_XSCALE bool - depends on ARCH_IOP3XX || ARCH_ADIFCC || ARCH_PXA || ARCH_IXP4XX + depends on ARCH_IOP3XX || ARCH_PXA || ARCH_IXP4XX default y select CPU_32v5 select CPU_ABRT_EV5T diff -Nru a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c --- a/arch/arm/mm/consistent.c 2004-06-23 19:04:28 -07:00 +++ b/arch/arm/mm/consistent.c 2004-06-23 19:04:28 -07:00 @@ -194,7 +194,7 @@ /* * Set the "dma handle" */ - *handle = page_to_bus(page); + *handle = page_to_dma(dev, page); do { BUG_ON(!pte_none(*pte)); diff -Nru a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/Makefile 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,12 @@ +# +# linux/arch/arm/vfp/Makefile +# +# Copyright (C) 2001 ARM Limited +# + +# EXTRA_CFLAGS := -DDEBUG +# EXTRA_AFLAGS := -DDEBUG + +obj-y += vfp.o + +vfp-$(CONFIG_VFP) += entry.o vfpmodule.o vfphw.o vfpsingle.o vfpdouble.o diff -Nru a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/entry.S 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,45 @@ +/* + * linux/arch/arm/vfp/entry.S + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Basic entry code, called from the kernel's undefined instruction trap. + * r0 = faulted instruction + * r5 = faulted PC+4 + * r9 = successful return + * r10 = thread_info structure + * lr = failure return + */ +#include +#include +#include +#include + + .globl do_vfp +do_vfp: + ldr r4, .LCvfp + add r10, r10, #TI_VFPSTATE @ r10 = workspace + ldr pc, [r4] @ call VFP entry point + +.LCvfp: + .word vfp_vector + +@ This code is called if the VFP does not exist. It needs to flag the +@ failure to the VFP initialisation code. + + __INIT + .globl vfp_testing_entry +vfp_testing_entry: + ldr r0, VFP_arch_address + str r5, [r0] @ known non-zero value + mov pc, r9 @ we have handled the fault + +VFP_arch_address: + .word VFP_arch + + __FINIT diff -Nru a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/vfp.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,333 @@ +/* + * linux/arch/arm/vfp/vfp.h + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +static inline u32 vfp_shiftright32jamming(u32 val, unsigned int shift) +{ + if (shift) { + if (shift < 32) + val = val >> shift | ((val << (32 - shift)) != 0); + else + val = val != 0; + } + return val; +} + +static inline u64 vfp_shiftright64jamming(u64 val, unsigned int shift) +{ + if (shift) { + if (shift < 64) + val = val >> shift | ((val << (64 - shift)) != 0); + else + val = val != 0; + } + return val; +} + +static inline u32 vfp_hi64to32jamming(u64 val) +{ + u32 v; + + asm( + "cmp %Q1, #1 @ vfp_hi64to32jamming\n\t" + "movcc %0, %R1\n\t" + "orrcs %0, %R1, #1" + : "=r" (v) : "r" (val) : "cc"); + + return v; +} + +static inline void add128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml) +{ + asm( "adds %Q0, %Q2, %Q4\n\t" + "adcs %R0, %R2, %R4\n\t" + "adcs %Q1, %Q3, %Q5\n\t" + "adc %R1, %R3, %R5" + : "=r" (nl), "=r" (nh) + : "0" (nl), "1" (nh), "r" (ml), "r" (mh) + : "cc"); + *resh = nh; + *resl = nl; +} + +static inline void sub128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml) +{ + asm( "subs %Q0, %Q2, %Q4\n\t" + "sbcs %R0, %R2, %R4\n\t" + "sbcs %Q1, %Q3, %Q5\n\t" + "sbc %R1, %R3, %R5\n\t" + : "=r" (nl), "=r" (nh) + : "0" (nl), "1" (nh), "r" (ml), "r" (mh) + : "cc"); + *resh = nh; + *resl = nl; +} + +static inline void mul64to128(u64 *resh, u64 *resl, u64 n, u64 m) +{ + u32 nh, nl, mh, ml; + u64 rh, rma, rmb, rl; + + nl = n; + ml = m; + rl = (u64)nl * ml; + + nh = n >> 32; + rma = (u64)nh * ml; + + mh = m >> 32; + rmb = (u64)nl * mh; + rma += rmb; + + rh = (u64)nh * mh; + rh += ((u64)(rma < rmb) << 32) + (rma >> 32); + + rma <<= 32; + rl += rma; + rh += (rl < rma); + + *resl = rl; + *resh = rh; +} + +static inline void shift64left(u64 *resh, u64 *resl, u64 n) +{ + *resh = n >> 63; + *resl = n << 1; +} + +static inline u64 vfp_hi64multiply64(u64 n, u64 m) +{ + u64 rh, rl; + mul64to128(&rh, &rl, n, m); + return rh | (rl != 0); +} + +static inline u64 vfp_estimate_div128to64(u64 nh, u64 nl, u64 m) +{ + u64 mh, ml, remh, reml, termh, terml, z; + + if (nh >= m) + return ~0ULL; + mh = m >> 32; + z = (mh << 32 <= nh) ? 0xffffffff00000000ULL : (nh / mh) << 32; + mul64to128(&termh, &terml, m, z); + sub128(&remh, &reml, nh, nl, termh, terml); + ml = m << 32; + while ((s64)remh < 0) { + z -= 0x100000000ULL; + add128(&remh, &reml, remh, reml, mh, ml); + } + remh = (remh << 32) | (reml >> 32); + z |= (mh << 32 <= remh) ? 0xffffffff : remh / mh; + return z; +} + +/* + * Operations on unpacked elements + */ +#define vfp_sign_negate(sign) (sign ^ 0x8000) + +/* + * Single-precision + */ +struct vfp_single { + s16 exponent; + u16 sign; + u32 significand; +}; + +extern s32 vfp_get_float(unsigned int reg); +extern void vfp_put_float(unsigned int reg, s32 val); + +/* + * VFP_SINGLE_MANTISSA_BITS - number of bits in the mantissa + * VFP_SINGLE_EXPONENT_BITS - number of bits in the exponent + * VFP_SINGLE_LOW_BITS - number of low bits in the unpacked significand + * which are not propagated to the float upon packing. + */ +#define VFP_SINGLE_MANTISSA_BITS (23) +#define VFP_SINGLE_EXPONENT_BITS (8) +#define VFP_SINGLE_LOW_BITS (32 - VFP_SINGLE_MANTISSA_BITS - 2) +#define VFP_SINGLE_LOW_BITS_MASK ((1 << VFP_SINGLE_LOW_BITS) - 1) + +/* + * The bit in an unpacked float which indicates that it is a quiet NaN + */ +#define VFP_SINGLE_SIGNIFICAND_QNAN (1 << (VFP_SINGLE_MANTISSA_BITS - 1 + VFP_SINGLE_LOW_BITS)) + +/* + * Operations on packed single-precision numbers + */ +#define vfp_single_packed_sign(v) ((v) & 0x80000000) +#define vfp_single_packed_negate(v) ((v) ^ 0x80000000) +#define vfp_single_packed_abs(v) ((v) & ~0x80000000) +#define vfp_single_packed_exponent(v) (((v) >> VFP_SINGLE_MANTISSA_BITS) & ((1 << VFP_SINGLE_EXPONENT_BITS) - 1)) +#define vfp_single_packed_mantissa(v) ((v) & ((1 << VFP_SINGLE_MANTISSA_BITS) - 1)) + +/* + * Unpack a single-precision float. Note that this returns the magnitude + * of the single-precision float mantissa with the 1. if necessary, + * aligned to bit 30. + */ +static inline void vfp_single_unpack(struct vfp_single *s, s32 val) +{ + u32 significand; + + s->sign = vfp_single_packed_sign(val) >> 16, + s->exponent = vfp_single_packed_exponent(val); + + significand = (u32) val; + significand = (significand << (32 - VFP_SINGLE_MANTISSA_BITS)) >> 2; + if (s->exponent && s->exponent != 255) + significand |= 0x40000000; + s->significand = significand; +} + +/* + * Re-pack a single-precision float. This assumes that the float is + * already normalised such that the MSB is bit 30, _not_ bit 31. + */ +static inline s32 vfp_single_pack(struct vfp_single *s) +{ + u32 val; + val = (s->sign << 16) + + (s->exponent << VFP_SINGLE_MANTISSA_BITS) + + (s->significand >> VFP_SINGLE_LOW_BITS); + return (s32)val; +} + +#define VFP_NUMBER (1<<0) +#define VFP_ZERO (1<<1) +#define VFP_DENORMAL (1<<2) +#define VFP_INFINITY (1<<3) +#define VFP_NAN (1<<4) +#define VFP_NAN_SIGNAL (1<<5) + +#define VFP_QNAN (VFP_NAN) +#define VFP_SNAN (VFP_NAN|VFP_NAN_SIGNAL) + +static inline int vfp_single_type(struct vfp_single *s) +{ + int type = VFP_NUMBER; + if (s->exponent == 255) { + if (s->significand == 0) + type = VFP_INFINITY; + else if (s->significand & VFP_SINGLE_SIGNIFICAND_QNAN) + type = VFP_QNAN; + else + type = VFP_SNAN; + } else if (s->exponent == 0) { + if (s->significand == 0) + type |= VFP_ZERO; + else + type |= VFP_DENORMAL; + } + return type; +} + +#ifndef DEBUG +#define vfp_single_normaliseround(sd,vsd,fpscr,except,func) __vfp_single_normaliseround(sd,vsd,fpscr,except) +u32 __vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions); +#else +u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions, const char *func); +#endif + +/* + * Double-precision + */ +struct vfp_double { + s16 exponent; + u16 sign; + u64 significand; +}; + +extern u64 vfp_get_double(unsigned int reg); +extern void vfp_put_double(unsigned int reg, u64 val); + +#define VFP_DOUBLE_MANTISSA_BITS (52) +#define VFP_DOUBLE_EXPONENT_BITS (11) +#define VFP_DOUBLE_LOW_BITS (64 - VFP_DOUBLE_MANTISSA_BITS - 2) +#define VFP_DOUBLE_LOW_BITS_MASK ((1 << VFP_DOUBLE_LOW_BITS) - 1) + +/* + * The bit in an unpacked double which indicates that it is a quiet NaN + */ +#define VFP_DOUBLE_SIGNIFICAND_QNAN (1ULL << (VFP_DOUBLE_MANTISSA_BITS - 1 + VFP_DOUBLE_LOW_BITS)) + +/* + * Operations on packed single-precision numbers + */ +#define vfp_double_packed_sign(v) ((v) & (1ULL << 63)) +#define vfp_double_packed_negate(v) ((v) ^ (1ULL << 63)) +#define vfp_double_packed_abs(v) ((v) & ~(1ULL << 63)) +#define vfp_double_packed_exponent(v) (((v) >> VFP_DOUBLE_MANTISSA_BITS) & ((1 << VFP_DOUBLE_EXPONENT_BITS) - 1)) +#define vfp_double_packed_mantissa(v) ((v) & ((1ULL << VFP_DOUBLE_MANTISSA_BITS) - 1)) + +/* + * Unpack a double-precision float. Note that this returns the magnitude + * of the double-precision float mantissa with the 1. if necessary, + * aligned to bit 62. + */ +static inline void vfp_double_unpack(struct vfp_double *s, s64 val) +{ + u64 significand; + + s->sign = vfp_double_packed_sign(val) >> 48; + s->exponent = vfp_double_packed_exponent(val); + + significand = (u64) val; + significand = (significand << (64 - VFP_DOUBLE_MANTISSA_BITS)) >> 2; + if (s->exponent && s->exponent != 2047) + significand |= (1ULL << 62); + s->significand = significand; +} + +/* + * Re-pack a double-precision float. This assumes that the float is + * already normalised such that the MSB is bit 30, _not_ bit 31. + */ +static inline s64 vfp_double_pack(struct vfp_double *s) +{ + u64 val; + val = ((u64)s->sign << 48) + + ((u64)s->exponent << VFP_DOUBLE_MANTISSA_BITS) + + (s->significand >> VFP_DOUBLE_LOW_BITS); + return (s64)val; +} + +static inline int vfp_double_type(struct vfp_double *s) +{ + int type = VFP_NUMBER; + if (s->exponent == 2047) { + if (s->significand == 0) + type = VFP_INFINITY; + else if (s->significand & VFP_DOUBLE_SIGNIFICAND_QNAN) + type = VFP_QNAN; + else + type = VFP_SNAN; + } else if (s->exponent == 0) { + if (s->significand == 0) + type |= VFP_ZERO; + else + type |= VFP_DENORMAL; + } + return type; +} + +u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exceptions, const char *func); + +/* + * System registers + */ +extern u32 vfp_get_sys(unsigned int reg); +extern void vfp_put_sys(unsigned int reg, u32 val); + +u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand); diff -Nru a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/vfpdouble.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,1186 @@ +/* + * linux/arch/arm/vfp/vfpdouble.c + * + * This code is derived in part from John R. Housers softfloat library, which + * carries the following notice: + * + * =========================================================================== + * This C source file is part of the SoftFloat IEC/IEEE Floating-point + * Arithmetic Package, Release 2. + * + * Written by John R. Hauser. This work was made possible in part by the + * International Computer Science Institute, located at Suite 600, 1947 Center + * Street, Berkeley, California 94704. Funding was partially provided by the + * National Science Foundation under grant MIP-9311980. The original version + * of this code was written as part of a project to build a fixed-point vector + * processor in collaboration with the University of California at Berkeley, + * overseen by Profs. Nelson Morgan and John Wawrzynek. More information + * is available through the web page `http://HTTP.CS.Berkeley.EDU/~jhauser/ + * arithmetic/softfloat.html'. + * + * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort + * has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT + * TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO + * PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY + * AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. + * + * Derivative works are acceptable, even for commercial purposes, so long as + * (1) they include prominent notice that the work is derivative, and (2) they + * include prominent notice akin to these three paragraphs for those parts of + * this code that are retained. + * =========================================================================== + */ +#include +#include +#include +#include + +#include "vfpinstr.h" +#include "vfp.h" + +static struct vfp_double vfp_double_default_qnan = { + .exponent = 2047, + .sign = 0, + .significand = VFP_DOUBLE_SIGNIFICAND_QNAN, +}; + +static void vfp_double_dump(const char *str, struct vfp_double *d) +{ + pr_debug("VFP: %s: sign=%d exponent=%d significand=%016llx\n", + str, d->sign != 0, d->exponent, d->significand); +} + +static void vfp_double_normalise_denormal(struct vfp_double *vd) +{ + int bits = 31 - fls(vd->significand >> 32); + if (bits == 31) + bits = 62 - fls(vd->significand); + + vfp_double_dump("normalise_denormal: in", vd); + + if (bits) { + vd->exponent -= bits - 1; + vd->significand <<= bits; + } + + vfp_double_dump("normalise_denormal: out", vd); +} + +u32 vfp_double_normaliseround(int dd, struct vfp_double *vd, u32 fpscr, u32 exceptions, const char *func) +{ + u64 significand, incr; + int exponent, shift, underflow; + u32 rmode; + + vfp_double_dump("pack: in", vd); + + /* + * Infinities and NaNs are a special case. + */ + if (vd->exponent == 2047 && (vd->significand == 0 || exceptions)) + goto pack; + + /* + * Special-case zero. + */ + if (vd->significand == 0) { + vd->exponent = 0; + goto pack; + } + + exponent = vd->exponent; + significand = vd->significand; + + shift = 32 - fls(significand >> 32); + if (shift == 32) + shift = 64 - fls(significand); + if (shift) { + exponent -= shift; + significand <<= shift; + } + +#ifdef DEBUG + vd->exponent = exponent; + vd->significand = significand; + vfp_double_dump("pack: normalised", vd); +#endif + + /* + * Tiny number? + */ + underflow = exponent < 0; + if (underflow) { + significand = vfp_shiftright64jamming(significand, -exponent); + exponent = 0; +#ifdef DEBUG + vd->exponent = exponent; + vd->significand = significand; + vfp_double_dump("pack: tiny number", vd); +#endif + if (!(significand & ((1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1))) + underflow = 0; + } + + /* + * Select rounding increment. + */ + incr = 0; + rmode = fpscr & FPSCR_RMODE_MASK; + + if (rmode == FPSCR_ROUND_NEAREST) { + incr = 1ULL << VFP_DOUBLE_LOW_BITS; + if ((significand & (1ULL << (VFP_DOUBLE_LOW_BITS + 1))) == 0) + incr -= 1; + } else if (rmode == FPSCR_ROUND_TOZERO) { + incr = 0; + } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vd->sign != 0)) + incr = (1ULL << (VFP_DOUBLE_LOW_BITS + 1)) - 1; + + pr_debug("VFP: rounding increment = 0x%08llx\n", incr); + + /* + * Is our rounding going to overflow? + */ + if ((significand + incr) < significand) { + exponent += 1; + significand = (significand >> 1) | (significand & 1); + incr >>= 1; +#ifdef DEBUG + vd->exponent = exponent; + vd->significand = significand; + vfp_double_dump("pack: overflow", vd); +#endif + } + + /* + * If any of the low bits (which will be shifted out of the + * number) are non-zero, the result is inexact. + */ + if (significand & ((1 << (VFP_DOUBLE_LOW_BITS + 1)) - 1)) + exceptions |= FPSCR_IXC; + + /* + * Do our rounding. + */ + significand += incr; + + /* + * Infinity? + */ + if (exponent >= 2046) { + exceptions |= FPSCR_OFC | FPSCR_IXC; + if (incr == 0) { + vd->exponent = 2045; + vd->significand = 0x7fffffffffffffffULL; + } else { + vd->exponent = 2047; /* infinity */ + vd->significand = 0; + } + } else { + if (significand >> (VFP_DOUBLE_LOW_BITS + 1) == 0) + exponent = 0; + if (exponent || significand > 0x8000000000000000ULL) + underflow = 0; + if (underflow) + exceptions |= FPSCR_UFC; + vd->exponent = exponent; + vd->significand = significand >> 1; + } + + pack: + vfp_double_dump("pack: final", vd); + { + s64 d = vfp_double_pack(vd); + pr_debug("VFP: %s: d(d%d)=%016llx exceptions=%08x\n", func, + dd, d, exceptions); + vfp_put_double(dd, d); + } + return exceptions; +} + +/* + * Propagate the NaN, setting exceptions if it is signalling. + * 'n' is always a NaN. 'm' may be a number, NaN or infinity. + */ +static u32 +vfp_propagate_nan(struct vfp_double *vdd, struct vfp_double *vdn, + struct vfp_double *vdm, u32 fpscr) +{ + struct vfp_double *nan; + int tn, tm = 0; + + tn = vfp_double_type(vdn); + + if (vdm) + tm = vfp_double_type(vdm); + + if (fpscr & FPSCR_DEFAULT_NAN) + /* + * Default NaN mode - always returns a quiet NaN + */ + nan = &vfp_double_default_qnan; + else { + /* + * Contemporary mode - select the first signalling + * NAN, or if neither are signalling, the first + * quiet NAN. + */ + if (tn == VFP_SNAN || (tm != VFP_SNAN && tn == VFP_QNAN)) + nan = vdn; + else + nan = vdm; + /* + * Make the NaN quiet. + */ + nan->significand |= VFP_DOUBLE_SIGNIFICAND_QNAN; + } + + *vdd = *nan; + + /* + * If one was a signalling NAN, raise invalid operation. + */ + return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : 0x100; +} + +/* + * Extended operations + */ +static u32 vfp_double_fabs(int dd, int unused, int dm, u32 fpscr) +{ + vfp_put_double(dd, vfp_double_packed_abs(vfp_get_double(dm))); + return 0; +} + +static u32 vfp_double_fcpy(int dd, int unused, int dm, u32 fpscr) +{ + vfp_put_double(dd, vfp_get_double(dm)); + return 0; +} + +static u32 vfp_double_fneg(int dd, int unused, int dm, u32 fpscr) +{ + vfp_put_double(dd, vfp_double_packed_negate(vfp_get_double(dm))); + return 0; +} + +static u32 vfp_double_fsqrt(int dd, int unused, int dm, u32 fpscr) +{ + struct vfp_double vdm, vdd; + int ret, tm; + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + tm = vfp_double_type(&vdm); + if (tm & (VFP_NAN|VFP_INFINITY)) { + struct vfp_double *vdp = &vdd; + + if (tm & VFP_NAN) + ret = vfp_propagate_nan(vdp, &vdm, NULL, fpscr); + else if (vdm.sign == 0) { + sqrt_copy: + vdp = &vdm; + ret = 0; + } else { + sqrt_invalid: + vdp = &vfp_double_default_qnan; + ret = FPSCR_IOC; + } + vfp_put_double(dd, vfp_double_pack(vdp)); + return ret; + } + + /* + * sqrt(+/- 0) == +/- 0 + */ + if (tm & VFP_ZERO) + goto sqrt_copy; + + /* + * Normalise a denormalised number + */ + if (tm & VFP_DENORMAL) + vfp_double_normalise_denormal(&vdm); + + /* + * sqrt(<0) = invalid + */ + if (vdm.sign) + goto sqrt_invalid; + + vfp_double_dump("sqrt", &vdm); + + /* + * Estimate the square root. + */ + vdd.sign = 0; + vdd.exponent = ((vdm.exponent - 1023) >> 1) + 1023; + vdd.significand = (u64)vfp_estimate_sqrt_significand(vdm.exponent, vdm.significand >> 32) << 31; + + vfp_double_dump("sqrt estimate1", &vdd); + + vdm.significand >>= 1 + (vdm.exponent & 1); + vdd.significand += 2 + vfp_estimate_div128to64(vdm.significand, 0, vdd.significand); + + vfp_double_dump("sqrt estimate2", &vdd); + + /* + * And now adjust. + */ + if ((vdd.significand & VFP_DOUBLE_LOW_BITS_MASK) <= 5) { + if (vdd.significand < 2) { + vdd.significand = ~0ULL; + } else { + u64 termh, terml, remh, reml; + vdm.significand <<= 2; + mul64to128(&termh, &terml, vdd.significand, vdd.significand); + sub128(&remh, &reml, vdm.significand, 0, termh, terml); + while ((s64)remh < 0) { + vdd.significand -= 1; + shift64left(&termh, &terml, vdd.significand); + terml |= 1; + add128(&remh, &reml, remh, reml, termh, terml); + } + vdd.significand |= (remh | reml) != 0; + } + } + vdd.significand = vfp_shiftright64jamming(vdd.significand, 1); + + return vfp_double_normaliseround(dd, &vdd, fpscr, 0, "fsqrt"); +} + +/* + * Equal := ZC + * Less than := N + * Greater than := C + * Unordered := CV + */ +static u32 vfp_compare(int dd, int signal_on_qnan, int dm, u32 fpscr) +{ + s64 d, m; + u32 ret = 0; + + m = vfp_get_double(dm); + if (vfp_double_packed_exponent(m) == 2047 && vfp_double_packed_mantissa(m)) { + ret |= FPSCR_C | FPSCR_V; + if (signal_on_qnan || !(vfp_double_packed_mantissa(m) & (1ULL << (VFP_DOUBLE_MANTISSA_BITS - 1)))) + /* + * Signalling NaN, or signalling on quiet NaN + */ + ret |= FPSCR_IOC; + } + + d = vfp_get_double(dd); + if (vfp_double_packed_exponent(d) == 2047 && vfp_double_packed_mantissa(d)) { + ret |= FPSCR_C | FPSCR_V; + if (signal_on_qnan || !(vfp_double_packed_mantissa(d) & (1ULL << (VFP_DOUBLE_MANTISSA_BITS - 1)))) + /* + * Signalling NaN, or signalling on quiet NaN + */ + ret |= FPSCR_IOC; + } + + if (ret == 0) { + if (d == m || vfp_double_packed_abs(d | m) == 0) { + /* + * equal + */ + ret |= FPSCR_Z | FPSCR_C; + } else if (vfp_double_packed_sign(d ^ m)) { + /* + * different signs + */ + if (vfp_double_packed_sign(d)) + /* + * d is negative, so d < m + */ + ret |= FPSCR_N; + else + /* + * d is positive, so d > m + */ + ret |= FPSCR_C; + } else if ((vfp_double_packed_sign(d) != 0) ^ (d < m)) { + /* + * d < m + */ + ret |= FPSCR_N; + } else if ((vfp_double_packed_sign(d) != 0) ^ (d > m)) { + /* + * d > m + */ + ret |= FPSCR_C; + } + } + + return ret; +} + +static u32 vfp_double_fcmp(int dd, int unused, int dm, u32 fpscr) +{ + return vfp_compare(dd, 0, dm, fpscr); +} + +static u32 vfp_double_fcmpe(int dd, int unused, int dm, u32 fpscr) +{ + return vfp_compare(dd, 1, dm, fpscr); +} + +static u32 vfp_double_fcmpz(int dd, int unused, int dm, u32 fpscr) +{ + return vfp_compare(dd, 0, -1, fpscr); +} + +static u32 vfp_double_fcmpez(int dd, int unused, int dm, u32 fpscr) +{ + return vfp_compare(dd, 1, -1, fpscr); +} + +static u32 vfp_double_fcvts(int sd, int unused, int dm, u32 fpscr) +{ + struct vfp_double vdm; + struct vfp_single vsd; + int tm; + u32 exceptions = 0; + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + + tm = vfp_double_type(&vdm); + + /* + * If we have a signalling NaN, signal invalid operation. + */ + if (tm == VFP_SNAN) + exceptions = FPSCR_IOC; + + if (tm & VFP_DENORMAL) + vfp_double_normalise_denormal(&vdm); + + vsd.sign = vdm.sign; + vsd.significand = vfp_hi64to32jamming(vdm.significand); + + /* + * If we have an infinity or a NaN, the exponent must be 255 + */ + if (tm & (VFP_INFINITY|VFP_NAN)) { + vsd.exponent = 255; + if (tm & VFP_NAN) + vsd.significand |= VFP_SINGLE_SIGNIFICAND_QNAN; + goto pack_nan; + } else if (tm & VFP_ZERO) + vsd.exponent = 0; + else + vsd.exponent = vdm.exponent - (1023 - 127); + + return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fcvts"); + + pack_nan: + vfp_put_float(sd, vfp_single_pack(&vsd)); + return exceptions; +} + +static u32 vfp_double_fuito(int dd, int unused, int dm, u32 fpscr) +{ + struct vfp_double vdm; + u32 m = vfp_get_float(dm); + + vdm.sign = 0; + vdm.exponent = 1023 + 63 - 1; + vdm.significand = (u64)m; + + return vfp_double_normaliseround(dd, &vdm, fpscr, 0, "fuito"); +} + +static u32 vfp_double_fsito(int dd, int unused, int dm, u32 fpscr) +{ + struct vfp_double vdm; + u32 m = vfp_get_float(dm); + + vdm.sign = (m & 0x80000000) >> 16; + vdm.exponent = 1023 + 63 - 1; + vdm.significand = vdm.sign ? -m : m; + + return vfp_double_normaliseround(dd, &vdm, fpscr, 0, "fsito"); +} + +static u32 vfp_double_ftoui(int sd, int unused, int dm, u32 fpscr) +{ + struct vfp_double vdm; + u32 d, exceptions = 0; + int rmode = fpscr & FPSCR_RMODE_MASK; + int tm; + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + + /* + * Do we have a denormalised number? + */ + tm = vfp_double_type(&vdm); + if (tm & VFP_DENORMAL) + exceptions |= FPSCR_IDC; + + if (tm & VFP_NAN) + vdm.sign = 0; + + if (vdm.exponent >= 1023 + 32) { + d = vdm.sign ? 0 : 0xffffffff; + exceptions = FPSCR_IOC; + } else if (vdm.exponent >= 1023 - 1) { + int shift = 1023 + 63 - vdm.exponent; + u64 rem, incr = 0; + + /* + * 2^0 <= m < 2^32-2^8 + */ + d = (vdm.significand << 1) >> shift; + rem = vdm.significand << (65 - shift); + + if (rmode == FPSCR_ROUND_NEAREST) { + incr = 0x8000000000000000ULL; + if ((d & 1) == 0) + incr -= 1; + } else if (rmode == FPSCR_ROUND_TOZERO) { + incr = 0; + } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vdm.sign != 0)) { + incr = ~0ULL; + } + + if ((rem + incr) < rem) { + if (d < 0xffffffff) + d += 1; + else + exceptions |= FPSCR_IOC; + } + + if (d && vdm.sign) { + d = 0; + exceptions |= FPSCR_IOC; + } else if (rem) + exceptions |= FPSCR_IXC; + } else { + d = 0; + if (vdm.exponent | vdm.significand) { + exceptions |= FPSCR_IXC; + if (rmode == FPSCR_ROUND_PLUSINF && vdm.sign == 0) + d = 1; + else if (rmode == FPSCR_ROUND_MINUSINF && vdm.sign) { + d = 0; + exceptions |= FPSCR_IOC; + } + } + } + + pr_debug("VFP: ftoui: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions); + + vfp_put_float(sd, d); + + return exceptions; +} + +static u32 vfp_double_ftouiz(int sd, int unused, int dm, u32 fpscr) +{ + return vfp_double_ftoui(sd, unused, dm, FPSCR_ROUND_TOZERO); +} + +static u32 vfp_double_ftosi(int sd, int unused, int dm, u32 fpscr) +{ + struct vfp_double vdm; + u32 d, exceptions = 0; + int rmode = fpscr & FPSCR_RMODE_MASK; + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + vfp_double_dump("VDM", &vdm); + + /* + * Do we have denormalised number? + */ + if (vfp_double_type(&vdm) & VFP_DENORMAL) + exceptions |= FPSCR_IDC; + + if (vdm.exponent >= 1023 + 32) { + d = 0x7fffffff; + if (vdm.sign) + d = ~d; + exceptions |= FPSCR_IOC; + } else if (vdm.exponent >= 1023 - 1) { + int shift = 1023 + 63 - vdm.exponent; /* 58 */ + u64 rem, incr = 0; + + d = (vdm.significand << 1) >> shift; + rem = vdm.significand << (65 - shift); + + if (rmode == FPSCR_ROUND_NEAREST) { + incr = 0x8000000000000000ULL; + if ((d & 1) == 0) + incr -= 1; + } else if (rmode == FPSCR_ROUND_TOZERO) { + incr = 0; + } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vdm.sign != 0)) { + incr = ~0ULL; + } + + if ((rem + incr) < rem && d < 0xffffffff) + d += 1; + if (d > 0x7fffffff + (vdm.sign != 0)) { + d = 0x7fffffff + (vdm.sign != 0); + exceptions |= FPSCR_IOC; + } else if (rem) + exceptions |= FPSCR_IXC; + + if (vdm.sign) + d = -d; + } else { + d = 0; + if (vdm.exponent | vdm.significand) { + exceptions |= FPSCR_IXC; + if (rmode == FPSCR_ROUND_PLUSINF && vdm.sign == 0) + d = 1; + else if (rmode == FPSCR_ROUND_MINUSINF && vdm.sign) + d = -1; + } + } + + pr_debug("VFP: ftosi: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions); + + vfp_put_float(sd, (s32)d); + + return exceptions; +} + +static u32 vfp_double_ftosiz(int dd, int unused, int dm, u32 fpscr) +{ + return vfp_double_ftosi(dd, unused, dm, FPSCR_ROUND_TOZERO); +} + + +static u32 (* const fop_extfns[32])(int dd, int unused, int dm, u32 fpscr) = { + [FEXT_TO_IDX(FEXT_FCPY)] = vfp_double_fcpy, + [FEXT_TO_IDX(FEXT_FABS)] = vfp_double_fabs, + [FEXT_TO_IDX(FEXT_FNEG)] = vfp_double_fneg, + [FEXT_TO_IDX(FEXT_FSQRT)] = vfp_double_fsqrt, + [FEXT_TO_IDX(FEXT_FCMP)] = vfp_double_fcmp, + [FEXT_TO_IDX(FEXT_FCMPE)] = vfp_double_fcmpe, + [FEXT_TO_IDX(FEXT_FCMPZ)] = vfp_double_fcmpz, + [FEXT_TO_IDX(FEXT_FCMPEZ)] = vfp_double_fcmpez, + [FEXT_TO_IDX(FEXT_FCVT)] = vfp_double_fcvts, + [FEXT_TO_IDX(FEXT_FUITO)] = vfp_double_fuito, + [FEXT_TO_IDX(FEXT_FSITO)] = vfp_double_fsito, + [FEXT_TO_IDX(FEXT_FTOUI)] = vfp_double_ftoui, + [FEXT_TO_IDX(FEXT_FTOUIZ)] = vfp_double_ftouiz, + [FEXT_TO_IDX(FEXT_FTOSI)] = vfp_double_ftosi, + [FEXT_TO_IDX(FEXT_FTOSIZ)] = vfp_double_ftosiz, +}; + + + + +static u32 +vfp_double_fadd_nonnumber(struct vfp_double *vdd, struct vfp_double *vdn, + struct vfp_double *vdm, u32 fpscr) +{ + struct vfp_double *vdp; + u32 exceptions = 0; + int tn, tm; + + tn = vfp_double_type(vdn); + tm = vfp_double_type(vdm); + + if (tn & tm & VFP_INFINITY) { + /* + * Two infinities. Are they different signs? + */ + if (vdn->sign ^ vdm->sign) { + /* + * different signs -> invalid + */ + exceptions = FPSCR_IOC; + vdp = &vfp_double_default_qnan; + } else { + /* + * same signs -> valid + */ + vdp = vdn; + } + } else if (tn & VFP_INFINITY && tm & VFP_NUMBER) { + /* + * One infinity and one number -> infinity + */ + vdp = vdn; + } else { + /* + * 'n' is a NaN of some type + */ + return vfp_propagate_nan(vdd, vdn, vdm, fpscr); + } + *vdd = *vdp; + return exceptions; +} + +static u32 +vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn, + struct vfp_double *vdm, u32 fpscr) +{ + u32 exp_diff; + u64 m_sig; + + if (vdn->significand & (1ULL << 63) || + vdm->significand & (1ULL << 63)) { + pr_info("VFP: bad FP values in %s\n", __func__); + vfp_double_dump("VDN", vdn); + vfp_double_dump("VDM", vdm); + } + + /* + * Ensure that 'n' is the largest magnitude number. Note that + * if 'n' and 'm' have equal exponents, we do not swap them. + * This ensures that NaN propagation works correctly. + */ + if (vdn->exponent < vdm->exponent) { + struct vfp_double *t = vdn; + vdn = vdm; + vdm = t; + } + + /* + * Is 'n' an infinity or a NaN? Note that 'm' may be a number, + * infinity or a NaN here. + */ + if (vdn->exponent == 2047) + return vfp_double_fadd_nonnumber(vdd, vdn, vdm, fpscr); + + /* + * We have two proper numbers, where 'vdn' is the larger magnitude. + * + * Copy 'n' to 'd' before doing the arithmetic. + */ + *vdd = *vdn; + + /* + * Align 'm' with the result. + */ + exp_diff = vdn->exponent - vdm->exponent; + m_sig = vfp_shiftright64jamming(vdm->significand, exp_diff); + + /* + * If the signs are different, we are really subtracting. + */ + if (vdn->sign ^ vdm->sign) { + m_sig = vdn->significand - m_sig; + if ((s64)m_sig < 0) { + vdd->sign = vfp_sign_negate(vdd->sign); + m_sig = -m_sig; + } + } else { + m_sig += vdn->significand; + } + vdd->significand = m_sig; + + return 0; +} + +static u32 +vfp_double_multiply(struct vfp_double *vdd, struct vfp_double *vdn, + struct vfp_double *vdm, u32 fpscr) +{ + vfp_double_dump("VDN", vdn); + vfp_double_dump("VDM", vdm); + + /* + * Ensure that 'n' is the largest magnitude number. Note that + * if 'n' and 'm' have equal exponents, we do not swap them. + * This ensures that NaN propagation works correctly. + */ + if (vdn->exponent < vdm->exponent) { + struct vfp_double *t = vdn; + vdn = vdm; + vdm = t; + pr_debug("VFP: swapping M <-> N\n"); + } + + vdd->sign = vdn->sign ^ vdm->sign; + + /* + * If 'n' is an infinity or NaN, handle it. 'm' may be anything. + */ + if (vdn->exponent == 2047) { + if (vdn->significand || (vdm->exponent == 2047 && vdm->significand)) + return vfp_propagate_nan(vdd, vdn, vdm, fpscr); + if ((vdm->exponent | vdm->significand) == 0) { + *vdd = vfp_double_default_qnan; + return FPSCR_IOC; + } + vdd->exponent = vdn->exponent; + vdd->significand = 0; + return 0; + } + + /* + * If 'm' is zero, the result is always zero. In this case, + * 'n' may be zero or a number, but it doesn't matter which. + */ + if ((vdm->exponent | vdm->significand) == 0) { + vdd->exponent = 0; + vdd->significand = 0; + return 0; + } + + /* + * We add 2 to the destination exponent for the same reason + * as the addition case - though this time we have +1 from + * each input operand. + */ + vdd->exponent = vdn->exponent + vdm->exponent - 1023 + 2; + vdd->significand = vfp_hi64multiply64(vdn->significand, vdm->significand); + + vfp_double_dump("VDD", vdd); + return 0; +} + +#define NEG_MULTIPLY (1 << 0) +#define NEG_SUBTRACT (1 << 1) + +static u32 +vfp_double_multiply_accumulate(int dd, int dn, int dm, u32 fpscr, u32 negate, char *func) +{ + struct vfp_double vdd, vdp, vdn, vdm; + u32 exceptions; + + vfp_double_unpack(&vdn, vfp_get_double(dn)); + if (vdn.exponent == 0 && vdn.significand) + vfp_double_normalise_denormal(&vdn); + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + if (vdm.exponent == 0 && vdm.significand) + vfp_double_normalise_denormal(&vdm); + + exceptions = vfp_double_multiply(&vdp, &vdn, &vdm, fpscr); + if (negate & NEG_MULTIPLY) + vdp.sign = vfp_sign_negate(vdp.sign); + + vfp_double_unpack(&vdn, vfp_get_double(dd)); + if (negate & NEG_SUBTRACT) + vdn.sign = vfp_sign_negate(vdn.sign); + + exceptions |= vfp_double_add(&vdd, &vdn, &vdp, fpscr); + + return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, func); +} + +/* + * Standard operations + */ + +/* + * sd = sd + (sn * sm) + */ +static u32 vfp_double_fmac(int dd, int dn, int dm, u32 fpscr) +{ + return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, 0, "fmac"); +} + +/* + * sd = sd - (sn * sm) + */ +static u32 vfp_double_fnmac(int dd, int dn, int dm, u32 fpscr) +{ + return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, NEG_MULTIPLY, "fnmac"); +} + +/* + * sd = -sd + (sn * sm) + */ +static u32 vfp_double_fmsc(int dd, int dn, int dm, u32 fpscr) +{ + return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, NEG_SUBTRACT, "fmsc"); +} + +/* + * sd = -sd - (sn * sm) + */ +static u32 vfp_double_fnmsc(int dd, int dn, int dm, u32 fpscr) +{ + return vfp_double_multiply_accumulate(dd, dn, dm, fpscr, NEG_SUBTRACT | NEG_MULTIPLY, "fnmsc"); +} + +/* + * sd = sn * sm + */ +static u32 vfp_double_fmul(int dd, int dn, int dm, u32 fpscr) +{ + struct vfp_double vdd, vdn, vdm; + u32 exceptions; + + vfp_double_unpack(&vdn, vfp_get_double(dn)); + if (vdn.exponent == 0 && vdn.significand) + vfp_double_normalise_denormal(&vdn); + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + if (vdm.exponent == 0 && vdm.significand) + vfp_double_normalise_denormal(&vdm); + + exceptions = vfp_double_multiply(&vdd, &vdn, &vdm, fpscr); + return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fmul"); +} + +/* + * sd = -(sn * sm) + */ +static u32 vfp_double_fnmul(int dd, int dn, int dm, u32 fpscr) +{ + struct vfp_double vdd, vdn, vdm; + u32 exceptions; + + vfp_double_unpack(&vdn, vfp_get_double(dn)); + if (vdn.exponent == 0 && vdn.significand) + vfp_double_normalise_denormal(&vdn); + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + if (vdm.exponent == 0 && vdm.significand) + vfp_double_normalise_denormal(&vdm); + + exceptions = vfp_double_multiply(&vdd, &vdn, &vdm, fpscr); + vdd.sign = vfp_sign_negate(vdd.sign); + + return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fnmul"); +} + +/* + * sd = sn + sm + */ +static u32 vfp_double_fadd(int dd, int dn, int dm, u32 fpscr) +{ + struct vfp_double vdd, vdn, vdm; + u32 exceptions; + + vfp_double_unpack(&vdn, vfp_get_double(dn)); + if (vdn.exponent == 0 && vdn.significand) + vfp_double_normalise_denormal(&vdn); + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + if (vdm.exponent == 0 && vdm.significand) + vfp_double_normalise_denormal(&vdm); + + exceptions = vfp_double_add(&vdd, &vdn, &vdm, fpscr); + + return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fadd"); +} + +/* + * sd = sn - sm + */ +static u32 vfp_double_fsub(int dd, int dn, int dm, u32 fpscr) +{ + struct vfp_double vdd, vdn, vdm; + u32 exceptions; + + vfp_double_unpack(&vdn, vfp_get_double(dn)); + if (vdn.exponent == 0 && vdn.significand) + vfp_double_normalise_denormal(&vdn); + + vfp_double_unpack(&vdm, vfp_get_double(dm)); + if (vdm.exponent == 0 && vdm.significand) + vfp_double_normalise_denormal(&vdm); + + /* + * Subtraction is like addition, but with a negated operand. + */ + vdm.sign = vfp_sign_negate(vdm.sign); + + exceptions = vfp_double_add(&vdd, &vdn, &vdm, fpscr); + + return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fsub"); +} + +/* + * sd = sn / sm + */ +static u32 vfp_double_fdiv(int dd, int dn, int dm, u32 fpscr) +{ + struct vfp_double vdd, vdn, vdm; + u32 exceptions = 0; + int tm, tn; + + vfp_double_unpack(&vdn, vfp_get_double(dn)); + vfp_double_unpack(&vdm, vfp_get_double(dm)); + + vdd.sign = vdn.sign ^ vdm.sign; + + tn = vfp_double_type(&vdn); + tm = vfp_double_type(&vdm); + + /* + * Is n a NAN? + */ + if (tn & VFP_NAN) + goto vdn_nan; + + /* + * Is m a NAN? + */ + if (tm & VFP_NAN) + goto vdm_nan; + + /* + * If n and m are infinity, the result is invalid + * If n and m are zero, the result is invalid + */ + if (tm & tn & (VFP_INFINITY|VFP_ZERO)) + goto invalid; + + /* + * If n is infinity, the result is infinity + */ + if (tn & VFP_INFINITY) + goto infinity; + + /* + * If m is zero, raise div0 exceptions + */ + if (tm & VFP_ZERO) + goto divzero; + + /* + * If m is infinity, or n is zero, the result is zero + */ + if (tm & VFP_INFINITY || tn & VFP_ZERO) + goto zero; + + if (tn & VFP_DENORMAL) + vfp_double_normalise_denormal(&vdn); + if (tm & VFP_DENORMAL) + vfp_double_normalise_denormal(&vdm); + + /* + * Ok, we have two numbers, we can perform division. + */ + vdd.exponent = vdn.exponent - vdm.exponent + 1023 - 1; + vdm.significand <<= 1; + if (vdm.significand <= (2 * vdn.significand)) { + vdn.significand >>= 1; + vdd.exponent++; + } + vdd.significand = vfp_estimate_div128to64(vdn.significand, 0, vdm.significand); + if ((vdd.significand & 0x1ff) <= 2) { + u64 termh, terml, remh, reml; + mul64to128(&termh, &terml, vdm.significand, vdd.significand); + sub128(&remh, &reml, vdn.significand, 0, termh, terml); + while ((s64)remh < 0) { + vdd.significand -= 1; + add128(&remh, &reml, remh, reml, 0, vdm.significand); + } + vdd.significand |= (reml != 0); + } + return vfp_double_normaliseround(dd, &vdd, fpscr, 0, "fdiv"); + + vdn_nan: + exceptions = vfp_propagate_nan(&vdd, &vdn, &vdm, fpscr); + pack: + vfp_put_double(dd, vfp_double_pack(&vdd)); + return exceptions; + + vdm_nan: + exceptions = vfp_propagate_nan(&vdd, &vdm, &vdn, fpscr); + goto pack; + + zero: + vdd.exponent = 0; + vdd.significand = 0; + goto pack; + + divzero: + exceptions = FPSCR_DZC; + infinity: + vdd.exponent = 2047; + vdd.significand = 0; + goto pack; + + invalid: + vfp_put_double(dd, vfp_double_pack(&vfp_double_default_qnan)); + return FPSCR_IOC; +} + +static u32 (* const fop_fns[16])(int dd, int dn, int dm, u32 fpscr) = { + [FOP_TO_IDX(FOP_FMAC)] = vfp_double_fmac, + [FOP_TO_IDX(FOP_FNMAC)] = vfp_double_fnmac, + [FOP_TO_IDX(FOP_FMSC)] = vfp_double_fmsc, + [FOP_TO_IDX(FOP_FNMSC)] = vfp_double_fnmsc, + [FOP_TO_IDX(FOP_FMUL)] = vfp_double_fmul, + [FOP_TO_IDX(FOP_FNMUL)] = vfp_double_fnmul, + [FOP_TO_IDX(FOP_FADD)] = vfp_double_fadd, + [FOP_TO_IDX(FOP_FSUB)] = vfp_double_fsub, + [FOP_TO_IDX(FOP_FDIV)] = vfp_double_fdiv, +}; + +#define FREG_BANK(x) ((x) & 0x0c) +#define FREG_IDX(x) ((x) & 3) + +u32 vfp_double_cpdo(u32 inst, u32 fpscr) +{ + u32 op = inst & FOP_MASK; + u32 exceptions = 0; + unsigned int dd = vfp_get_sd(inst); + unsigned int dn = vfp_get_sn(inst); + unsigned int dm = vfp_get_sm(inst); + unsigned int vecitr, veclen, vecstride; + u32 (*fop)(int, int, s32, u32); + + veclen = fpscr & FPSCR_LENGTH_MASK; + vecstride = (1 + ((fpscr & FPSCR_STRIDE_MASK) == FPSCR_STRIDE_MASK)) * 2; + + /* + * If destination bank is zero, vector length is always '1'. + * ARM DDI0100F C5.1.3, C5.3.2. + */ + if (FREG_BANK(dd) == 0) + veclen = 0; + + pr_debug("VFP: vecstride=%u veclen=%u\n", vecstride, + (veclen >> FPSCR_LENGTH_BIT) + 1); + + fop = (op == FOP_EXT) ? fop_extfns[dn] : fop_fns[FOP_TO_IDX(op)]; + if (!fop) + goto invalid; + + for (vecitr = 0; vecitr <= veclen; vecitr += 1 << FPSCR_LENGTH_BIT) { + u32 except; + + if (op == FOP_EXT) + pr_debug("VFP: itr%d (d%u.%u) = op[%u] (d%u.%u)\n", + vecitr >> FPSCR_LENGTH_BIT, + dd >> 1, dd & 1, dn, + dm >> 1, dm & 1); + else + pr_debug("VFP: itr%d (d%u.%u) = (d%u.%u) op[%u] (d%u.%u)\n", + vecitr >> FPSCR_LENGTH_BIT, + dd >> 1, dd & 1, + dn >> 1, dn & 1, + FOP_TO_IDX(op), + dm >> 1, dm & 1); + + except = fop(dd, dn, dm, fpscr); + pr_debug("VFP: itr%d: exceptions=%08x\n", + vecitr >> FPSCR_LENGTH_BIT, except); + + exceptions |= except; + + /* + * This ensures that comparisons only operate on scalars; + * comparisons always return with one FPSCR status bit set. + */ + if (except & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V)) + break; + + /* + * CHECK: It appears to be undefined whether we stop when + * we encounter an exception. We continue. + */ + + dd = FREG_BANK(dd) + ((FREG_IDX(dd) + vecstride) & 6); + dn = FREG_BANK(dn) + ((FREG_IDX(dn) + vecstride) & 6); + if (FREG_BANK(dm) != 0) + dm = FREG_BANK(dm) + ((FREG_IDX(dm) + vecstride) & 6); + } + return exceptions; + + invalid: + return ~0; +} diff -Nru a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/vfphw.S 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,210 @@ +/* + * linux/arch/arm/vfp/vfphw.S + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This code is called from the kernel's undefined instruction trap. + * r9 holds the return address for successful handling. + * lr holds the return address for unrecognised instructions. + * r10 points at the start of the private FP workspace in the thread structure + * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h) + */ +#include +#include +#include "../kernel/entry-header.S" + + .macro DBGSTR, str +#ifdef DEBUG + stmfd sp!, {r0-r3, ip, lr} + add r0, pc, #4 + bl printk + b 1f + .asciz "<7>VFP: \str\n" + .balign 4 +1: ldmfd sp!, {r0-r3, ip, lr} +#endif + .endm + + .macro DBGSTR1, str, arg +#ifdef DEBUG + stmfd sp!, {r0-r3, ip, lr} + mov r1, \arg + add r0, pc, #4 + bl printk + b 1f + .asciz "<7>VFP: \str\n" + .balign 4 +1: ldmfd sp!, {r0-r3, ip, lr} +#endif + .endm + + .macro DBGSTR3, str, arg1, arg2, arg3 +#ifdef DEBUG + stmfd sp!, {r0-r3, ip, lr} + mov r3, \arg3 + mov r2, \arg2 + mov r1, \arg1 + add r0, pc, #4 + bl printk + b 1f + .asciz "<7>VFP: \str\n" + .balign 4 +1: ldmfd sp!, {r0-r3, ip, lr} +#endif + .endm + + +@ VFP hardware support entry point. +@ +@ r0 = faulted instruction +@ r5 = faulted PC+4 +@ r9 = successful return +@ r10 = vfp_state union +@ lr = failure return + + .globl vfp_support_entry +vfp_support_entry: + DBGSTR3 "instr %08x pc %08x state %p", r0, r5, r10 + + VFPFMRX r1, FPEXC @ Is the VFP enabled? + DBGSTR1 "fpexc %08x", r1 + tst r1, #FPEXC_ENABLE + bne look_for_VFP_exceptions @ VFP is already enabled + + DBGSTR1 "enable %x", r10 + ldr r3, last_VFP_context_address + orr r1, r1, #FPEXC_ENABLE @ user FPEXC has the enable bit set + ldr r4, [r3] @ last_VFP_context pointer + bic r2, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled + cmp r4, r10 + beq check_for_exception @ we are returning to the same + @ process, so the registers are + @ still there. In this case, we do + @ not want to drop a pending exception. + + VFPFMXR FPEXC, r2 @ enable VFP, disable any pending + @ exceptions, so we can get at the + @ rest of it + + @ Save out the current registers to the old thread state + + DBGSTR1 "save old state %p", r4 + cmp r4, #0 + beq no_old_VFP_process + VFPFMRX r2, FPSCR @ current status + VFPFMRX r6, FPINST @ FPINST (always there, rev0 onwards) + tst r1, #FPEXC_FPV2 @ is there an FPINST2 to read? + VFPFMRX r8, FPINST2, NE @ FPINST2 if needed - avoids reading + @ nonexistant reg on rev0 + VFPFSTMIA r4 @ save the working registers + add r4, r4, #8*16+4 + stmia r4, {r1, r2, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 + @ and point r4 at the word at the + @ start of the register dump + +no_old_VFP_process: + DBGSTR1 "load state %p", r10 + str r10, [r3] @ update the last_VFP_context pointer + @ Load the saved state back into the VFP + add r4, r10, #8*16+4 + ldmia r4, {r1, r2, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 + VFPFLDMIA r10 @ reload the working registers while + @ FPEXC is in a safe state + tst r1, #FPEXC_FPV2 @ is there an FPINST2 to write? + VFPFMXR FPINST2, r8, NE @ FPINST2 if needed - avoids writing + @ nonexistant reg on rev0 + VFPFMXR FPINST, r6 + VFPFMXR FPSCR, r2 @ restore status + +check_for_exception: + tst r1, #FPEXC_EXCEPTION + bne process_exception @ might as well handle the pending + @ exception before retrying branch + @ out before setting an FPEXC that + @ stops us reading stuff + VFPFMXR FPEXC, r1 @ restore FPEXC last + sub r5, r5, #4 + str r5, [sp, #S_PC] @ retry the instruction + mov pc, r9 @ we think we have handled things + + +look_for_VFP_exceptions: + tst r1, #FPEXC_EXCEPTION + bne process_exception + VFPFMRX r2, FPSCR + tst r2, #FPSCR_IXE @ IXE doesn't set FPEXC_EXCEPTION ! + bne process_exception + + @ Fall into hand on to next handler - appropriate coproc instr + @ not recognised by VFP + + DBGSTR "not VFP" + mov pc, lr + +process_exception: + DBGSTR "bounce" + sub r5, r5, #4 + str r5, [sp, #S_PC] @ retry the instruction on exit from + @ the imprecise exception handling in + @ the support code + mov r2, sp @ nothing stacked - regdump is at TOS + mov lr, r9 @ setup for a return to the user code. + + @ Now call the C code to package up the bounce to the support code + @ r0 holds the trigger instruction + @ r1 holds the FPEXC value + @ r2 pointer to register dump + b VFP9_bounce @ we have handled this - the support + @ code will raise an exception if + @ required. If not, the user code will + @ retry the faulted instruction + +last_VFP_context_address: + .word last_VFP_context + + .globl vfp_get_float +vfp_get_float: + add pc, pc, r0, lsl #3 + mov r0, r0 + .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + mrc p10, 0, r0, c\dr, c0, 0 @ fmrs r0, s0 + mov pc, lr + mrc p10, 0, r0, c\dr, c0, 4 @ fmrs r0, s1 + mov pc, lr + .endr + + .globl vfp_put_float +vfp_put_float: + add pc, pc, r0, lsl #3 + mov r0, r0 + .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + mcr p10, 0, r1, c\dr, c0, 0 @ fmsr r0, s0 + mov pc, lr + mcr p10, 0, r1, c\dr, c0, 4 @ fmsr r0, s1 + mov pc, lr + .endr + + .globl vfp_get_double +vfp_get_double: + mov r0, r0, lsr #1 + add pc, pc, r0, lsl #3 + mov r0, r0 + .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + mrrc p10, 1, r0, r1, c\dr @ fmrrd r0, r1, d\dr + mov pc, lr + .endr + + .globl vfp_put_double +vfp_put_double: + mov r0, r0, lsr #1 + add pc, pc, r0, lsl #3 + mov r0, r0 + .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 + mcrr p10, 1, r1, r2, c\dr @ fmrrd r1, r2, d\dr + mov pc, lr + .endr diff -Nru a/arch/arm/vfp/vfpinstr.h b/arch/arm/vfp/vfpinstr.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/vfpinstr.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,88 @@ +/* + * linux/arch/arm/vfp/vfpinstr.h + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * VFP instruction masks. + */ +#define INST_CPRTDO(inst) (((inst) & 0x0f000000) == 0x0e000000) +#define INST_CPRT(inst) ((inst) & (1 << 4)) +#define INST_CPRT_L(inst) ((inst) & (1 << 20)) +#define INST_CPRT_Rd(inst) (((inst) & (15 << 12)) >> 12) +#define INST_CPRT_OP(inst) (((inst) >> 21) & 7) +#define INST_CPNUM(inst) ((inst) & 0xf00) +#define CPNUM(cp) ((cp) << 8) + +#define FOP_MASK (0x00b00040) +#define FOP_FMAC (0x00000000) +#define FOP_FNMAC (0x00000040) +#define FOP_FMSC (0x00100000) +#define FOP_FNMSC (0x00100040) +#define FOP_FMUL (0x00200000) +#define FOP_FNMUL (0x00200040) +#define FOP_FADD (0x00300000) +#define FOP_FSUB (0x00300040) +#define FOP_FDIV (0x00800000) +#define FOP_EXT (0x00b00040) + +#define FOP_TO_IDX(inst) ((inst & 0x00b00000) >> 20 | (inst & (1 << 6)) >> 4) + +#define FEXT_MASK (0x000f0080) +#define FEXT_FCPY (0x00000000) +#define FEXT_FABS (0x00000080) +#define FEXT_FNEG (0x00010000) +#define FEXT_FSQRT (0x00010080) +#define FEXT_FCMP (0x00040000) +#define FEXT_FCMPE (0x00040080) +#define FEXT_FCMPZ (0x00050000) +#define FEXT_FCMPEZ (0x00050080) +#define FEXT_FCVT (0x00070080) +#define FEXT_FUITO (0x00080000) +#define FEXT_FSITO (0x00080080) +#define FEXT_FTOUI (0x000c0000) +#define FEXT_FTOUIZ (0x000c0080) +#define FEXT_FTOSI (0x000d0000) +#define FEXT_FTOSIZ (0x000d0080) + +#define FEXT_TO_IDX(inst) ((inst & 0x000f0000) >> 15 | (inst & (1 << 7)) >> 7) + +#define vfp_get_sd(inst) ((inst & 0x0000f000) >> 11 | (inst & (1 << 22)) >> 22) +#define vfp_get_dd(inst) ((inst & 0x0000f000) >> 12) +#define vfp_get_sm(inst) ((inst & 0x0000000f) << 1 | (inst & (1 << 5)) >> 5) +#define vfp_get_dm(inst) ((inst & 0x0000000f)) +#define vfp_get_sn(inst) ((inst & 0x000f0000) >> 15 | (inst & (1 << 7)) >> 7) +#define vfp_get_dn(inst) ((inst & 0x000f0000) >> 16) + +#define vfp_single(inst) (((inst) & 0x0000f00) == 0xa00) + +#define FPSCR_N (1 << 31) +#define FPSCR_Z (1 << 30) +#define FPSCR_C (1 << 29) +#define FPSCR_V (1 << 28) + +/* + * Since we aren't building with -mfpu=vfp, we need to code + * these instructions using their MRC/MCR equivalents. + */ +#define vfpreg(_vfp_) #_vfp_ + +#define fmrx(_vfp_) ({ \ + u32 __v; \ + asm("mrc%? p10, 7, %0, " vfpreg(_vfp_) ", cr0, 0 @ fmrx %0, " #_vfp_ \ + : "=r" (__v)); \ + __v; \ + }) + +#define fmxr(_vfp_,_var_) \ + asm("mcr%? p10, 7, %0, " vfpreg(_vfp_) ", cr0, 0 @ fmxr " #_vfp_ ", %0" \ + : : "r" (_var_)) + +u32 vfp_single_cpdo(u32 inst, u32 fpscr); +u32 vfp_single_cprt(u32 inst, u32 fpscr, struct pt_regs *regs); + +u32 vfp_double_cpdo(u32 inst, u32 fpscr); diff -Nru a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/vfpmodule.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,288 @@ +/* + * linux/arch/arm/vfp/vfpmodule.c + * + * Copyright (C) 2004 ARM Limited. + * Written by Deep Blue Solutions Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "vfpinstr.h" +#include "vfp.h" + +/* + * Our undef handlers (in entry.S) + */ +void vfp_testing_entry(void); +void vfp_support_entry(void); + +void (*vfp_vector)(void) = vfp_testing_entry; +union vfp_state *last_VFP_context; + +/* + * Dual-use variable. + * Used in startup: set to non-zero if VFP checks fail + * After startup, holds VFP architecture + */ +unsigned int VFP_arch; + +/* + * Per-thread VFP initialisation. + */ +void vfp_flush_thread(union vfp_state *vfp) +{ + memset(vfp, 0, sizeof(union vfp_state)); + + vfp->hard.fpexc = FPEXC_ENABLE; + vfp->hard.fpscr = FPSCR_ROUND_NEAREST; + + /* + * Disable VFP to ensure we initialise it first. + */ + fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE); + + /* + * Ensure we don't try to overwrite our newly initialised + * state information on the first fault. + */ + if (last_VFP_context == vfp) + last_VFP_context = NULL; +} + +/* + * Per-thread VFP cleanup. + */ +void vfp_release_thread(union vfp_state *vfp) +{ + if (last_VFP_context == vfp) + last_VFP_context = NULL; +} + +/* + * Raise a SIGFPE for the current process. + * sicode describes the signal being raised. + */ +void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs) +{ + siginfo_t info; + + memset(&info, 0, sizeof(info)); + + info.si_signo = SIGFPE; + info.si_code = sicode; + info.si_addr = (void *)(instruction_pointer(regs) - 4); + + /* + * This is the same as NWFPE, because it's not clear what + * this is used for + */ + current->thread.error_code = 0; + current->thread.trap_no = 6; + + force_sig_info(SIGFPE, &info, current); +} + +static void vfp_panic(char *reason) +{ + int i; + + printk(KERN_ERR "VFP: Error: %s\n", reason); + printk(KERN_ERR "VFP: EXC 0x%08x SCR 0x%08x INST 0x%08x\n", + fmrx(FPEXC), fmrx(FPSCR), fmrx(FPINST)); + for (i = 0; i < 32; i += 2) + printk(KERN_ERR "VFP: s%2u: 0x%08x s%2u: 0x%08x\n", + i, vfp_get_float(i), i+1, vfp_get_float(i+1)); +} + +/* + * Process bitmask of exception conditions. + */ +static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_regs *regs) +{ + int si_code = 0; + + pr_debug("VFP: raising exceptions %08x\n", exceptions); + + if (exceptions == (u32)-1) { + vfp_panic("unhandled bounce"); + vfp_raise_sigfpe(0, regs); + return; + } + + /* + * If any of the status flags are set, update the FPSCR. + * Comparison instructions always return at least one of + * these flags set. + */ + if (exceptions & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V)) + fpscr &= ~(FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V); + + fpscr |= exceptions; + + fmxr(FPSCR, fpscr); + +#define RAISE(stat,en,sig) \ + if (exceptions & stat && fpscr & en) \ + si_code = sig; + + /* + * These are arranged in priority order, least to highest. + */ + RAISE(FPSCR_IXC, FPSCR_IXE, FPE_FLTRES); + RAISE(FPSCR_UFC, FPSCR_UFE, FPE_FLTUND); + RAISE(FPSCR_OFC, FPSCR_OFE, FPE_FLTOVF); + RAISE(FPSCR_IOC, FPSCR_IOE, FPE_FLTINV); + + if (si_code) + vfp_raise_sigfpe(si_code, regs); +} + +/* + * Emulate a VFP instruction. + */ +static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs) +{ + u32 exceptions = (u32)-1; + + pr_debug("VFP: emulate: INST=0x%08x SCR=0x%08x\n", inst, fpscr); + + if (INST_CPRTDO(inst)) { + if (!INST_CPRT(inst)) { + /* + * CPDO + */ + if (vfp_single(inst)) { + exceptions = vfp_single_cpdo(inst, fpscr); + } else { + exceptions = vfp_double_cpdo(inst, fpscr); + } + } else { + /* + * A CPRT instruction can not appear in FPINST2, nor + * can it cause an exception. Therefore, we do not + * have to emulate it. + */ + } + } else { + /* + * A CPDT instruction can not appear in FPINST2, nor can + * it cause an exception. Therefore, we do not have to + * emulate it. + */ + } + return exceptions; +} + +/* + * Package up a bounce condition. + */ +void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) +{ + u32 fpscr, orig_fpscr, exceptions, inst; + + pr_debug("VFP: bounce: trigger %08x fpexc %08x\n", trigger, fpexc); + + /* + * Enable access to the VFP so we can handle the bounce. + */ + fmxr(FPEXC, fpexc & ~(FPEXC_EXCEPTION|FPEXC_INV|FPEXC_UFC|FPEXC_IOC)); + + orig_fpscr = fpscr = fmrx(FPSCR); + + /* + * If we are running with inexact exceptions enabled, we need to + * emulate the trigger instruction. Note that as we're emulating + * the trigger instruction, we need to increment PC. + */ + if (fpscr & FPSCR_IXE) { + regs->ARM_pc += 4; + goto emulate; + } + + barrier(); + + /* + * Modify fpscr to indicate the number of iterations remaining + */ + if (fpexc & FPEXC_EXCEPTION) { + u32 len; + + len = fpexc + (1 << FPEXC_LENGTH_BIT); + + fpscr &= ~FPSCR_LENGTH_MASK; + fpscr |= (len & FPEXC_LENGTH_MASK) << (FPSCR_LENGTH_BIT - FPEXC_LENGTH_BIT); + } + + /* + * Handle the first FP instruction. We used to take note of the + * FPEXC bounce reason, but this appears to be unreliable. + * Emulate the bounced instruction instead. + */ + inst = fmrx(FPINST); + exceptions = vfp_emulate_instruction(inst, fpscr, regs); + if (exceptions) + vfp_raise_exceptions(exceptions, inst, orig_fpscr, regs); + + /* + * If there isn't a second FP instruction, exit now. + */ + if (!(fpexc & FPEXC_FPV2)) + return; + + /* + * The barrier() here prevents fpinst2 being read + * before the condition above. + */ + barrier(); + trigger = fmrx(FPINST2); + fpscr = fmrx(FPSCR); + + emulate: + exceptions = vfp_emulate_instruction(trigger, fpscr, regs); + if (exceptions) + vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs); +} + +/* + * VFP support code initialisation. + */ +static int __init vfp_init(void) +{ + unsigned int vfpsid; + + /* + * First check that there is a VFP that we can use. + * The handler is already setup to just log calls, so + * we just need to read the VFPSID register. + */ + vfpsid = fmrx(FPSID); + + printk(KERN_INFO "VFP support v0.3: "); + if (VFP_arch) { + printk("not present\n"); + } else if (vfpsid & FPSID_NODOUBLE) { + printk("no double precision support\n"); + } else { + VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ + printk("implementor %02x architecture %d part %02x variant %x rev %x\n", + (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, + (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT, + (vfpsid & FPSID_PART_MASK) >> FPSID_PART_BIT, + (vfpsid & FPSID_VARIANT_MASK) >> FPSID_VARIANT_BIT, + (vfpsid & FPSID_REV_MASK) >> FPSID_REV_BIT); + vfp_vector = vfp_support_entry; + } + return 0; +} + +late_initcall(vfp_init); diff -Nru a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/vfp/vfpsingle.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,1224 @@ +/* + * linux/arch/arm/vfp/vfpsingle.c + * + * This code is derived in part from John R. Housers softfloat library, which + * carries the following notice: + * + * =========================================================================== + * This C source file is part of the SoftFloat IEC/IEEE Floating-point + * Arithmetic Package, Release 2. + * + * Written by John R. Hauser. This work was made possible in part by the + * International Computer Science Institute, located at Suite 600, 1947 Center + * Street, Berkeley, California 94704. Funding was partially provided by the + * National Science Foundation under grant MIP-9311980. The original version + * of this code was written as part of a project to build a fixed-point vector + * processor in collaboration with the University of California at Berkeley, + * overseen by Profs. Nelson Morgan and John Wawrzynek. More information + * is available through the web page `http://HTTP.CS.Berkeley.EDU/~jhauser/ + * arithmetic/softfloat.html'. + * + * THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort + * has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT + * TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO + * PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY + * AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. + * + * Derivative works are acceptable, even for commercial purposes, so long as + * (1) they include prominent notice that the work is derivative, and (2) they + * include prominent notice akin to these three paragraphs for those parts of + * this code that are retained. + * =========================================================================== + */ +#include +#include +#include +#include + +#include "vfpinstr.h" +#include "vfp.h" + +static struct vfp_single vfp_single_default_qnan = { + .exponent = 255, + .sign = 0, + .significand = VFP_SINGLE_SIGNIFICAND_QNAN, +}; + +static void vfp_single_dump(const char *str, struct vfp_single *s) +{ + pr_debug("VFP: %s: sign=%d exponent=%d significand=%08x\n", + str, s->sign != 0, s->exponent, s->significand); +} + +static void vfp_single_normalise_denormal(struct vfp_single *vs) +{ + int bits = 31 - fls(vs->significand); + + vfp_single_dump("normalise_denormal: in", vs); + + if (bits) { + vs->exponent -= bits - 1; + vs->significand <<= bits; + } + + vfp_single_dump("normalise_denormal: out", vs); +} + +#ifndef DEBUG +#define vfp_single_normaliseround(sd,vsd,fpscr,except,func) __vfp_single_normaliseround(sd,vsd,fpscr,except) +u32 __vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions) +#else +u32 vfp_single_normaliseround(int sd, struct vfp_single *vs, u32 fpscr, u32 exceptions, const char *func) +#endif +{ + u32 significand, incr, rmode; + int exponent, shift, underflow; + + vfp_single_dump("pack: in", vs); + + /* + * Infinities and NaNs are a special case. + */ + if (vs->exponent == 255 && (vs->significand == 0 || exceptions)) + goto pack; + + /* + * Special-case zero. + */ + if (vs->significand == 0) { + vs->exponent = 0; + goto pack; + } + + exponent = vs->exponent; + significand = vs->significand; + + /* + * Normalise first. Note that we shift the significand up to + * bit 31, so we have VFP_SINGLE_LOW_BITS + 1 below the least + * significant bit. + */ + shift = 32 - fls(significand); + if (shift < 32 && shift) { + exponent -= shift; + significand <<= shift; + } + +#ifdef DEBUG + vs->exponent = exponent; + vs->significand = significand; + vfp_single_dump("pack: normalised", vs); +#endif + + /* + * Tiny number? + */ + underflow = exponent < 0; + if (underflow) { + significand = vfp_shiftright32jamming(significand, -exponent); + exponent = 0; +#ifdef DEBUG + vs->exponent = exponent; + vs->significand = significand; + vfp_single_dump("pack: tiny number", vs); +#endif + if (!(significand & ((1 << (VFP_SINGLE_LOW_BITS + 1)) - 1))) + underflow = 0; + } + + /* + * Select rounding increment. + */ + incr = 0; + rmode = fpscr & FPSCR_RMODE_MASK; + + if (rmode == FPSCR_ROUND_NEAREST) { + incr = 1 << VFP_SINGLE_LOW_BITS; + if ((significand & (1 << (VFP_SINGLE_LOW_BITS + 1))) == 0) + incr -= 1; + } else if (rmode == FPSCR_ROUND_TOZERO) { + incr = 0; + } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vs->sign != 0)) + incr = (1 << (VFP_SINGLE_LOW_BITS + 1)) - 1; + + pr_debug("VFP: rounding increment = 0x%08x\n", incr); + + /* + * Is our rounding going to overflow? + */ + if ((significand + incr) < significand) { + exponent += 1; + significand = (significand >> 1) | (significand & 1); + incr >>= 1; +#ifdef DEBUG + vs->exponent = exponent; + vs->significand = significand; + vfp_single_dump("pack: overflow", vs); +#endif + } + + /* + * If any of the low bits (which will be shifted out of the + * number) are non-zero, the result is inexact. + */ + if (significand & ((1 << (VFP_SINGLE_LOW_BITS + 1)) - 1)) + exceptions |= FPSCR_IXC; + + /* + * Do our rounding. + */ + significand += incr; + + /* + * Infinity? + */ + if (exponent >= 254) { + exceptions |= FPSCR_OFC | FPSCR_IXC; + if (incr == 0) { + vs->exponent = 253; + vs->significand = 0x7fffffff; + } else { + vs->exponent = 255; /* infinity */ + vs->significand = 0; + } + } else { + if (significand >> (VFP_SINGLE_LOW_BITS + 1) == 0) + exponent = 0; + if (exponent || significand > 0x80000000) + underflow = 0; + if (underflow) + exceptions |= FPSCR_UFC; + vs->exponent = exponent; + vs->significand = significand >> 1; + } + + pack: + vfp_single_dump("pack: final", vs); + { + s32 d = vfp_single_pack(vs); + pr_debug("VFP: %s: d(s%d)=%08x exceptions=%08x\n", func, + sd, d, exceptions); + vfp_put_float(sd, d); + } + + return exceptions; +} + +/* + * Propagate the NaN, setting exceptions if it is signalling. + * 'n' is always a NaN. 'm' may be a number, NaN or infinity. + */ +static u32 +vfp_propagate_nan(struct vfp_single *vsd, struct vfp_single *vsn, + struct vfp_single *vsm, u32 fpscr) +{ + struct vfp_single *nan; + int tn, tm = 0; + + tn = vfp_single_type(vsn); + + if (vsm) + tm = vfp_single_type(vsm); + + if (fpscr & FPSCR_DEFAULT_NAN) + /* + * Default NaN mode - always returns a quiet NaN + */ + nan = &vfp_single_default_qnan; + else { + /* + * Contemporary mode - select the first signalling + * NAN, or if neither are signalling, the first + * quiet NAN. + */ + if (tn == VFP_SNAN || (tm != VFP_SNAN && tn == VFP_QNAN)) + nan = vsn; + else + nan = vsm; + /* + * Make the NaN quiet. + */ + nan->significand |= VFP_SINGLE_SIGNIFICAND_QNAN; + } + + *vsd = *nan; + + /* + * If one was a signalling NAN, raise invalid operation. + */ + return tn == VFP_SNAN || tm == VFP_SNAN ? FPSCR_IOC : 0x100; +} + + +/* + * Extended operations + */ +static u32 vfp_single_fabs(int sd, int unused, s32 m, u32 fpscr) +{ + vfp_put_float(sd, vfp_single_packed_abs(m)); + return 0; +} + +static u32 vfp_single_fcpy(int sd, int unused, s32 m, u32 fpscr) +{ + vfp_put_float(sd, m); + return 0; +} + +static u32 vfp_single_fneg(int sd, int unused, s32 m, u32 fpscr) +{ + vfp_put_float(sd, vfp_single_packed_negate(m)); + return 0; +} + +static const u16 sqrt_oddadjust[] = { + 0x0004, 0x0022, 0x005d, 0x00b1, 0x011d, 0x019f, 0x0236, 0x02e0, + 0x039c, 0x0468, 0x0545, 0x0631, 0x072b, 0x0832, 0x0946, 0x0a67 +}; + +static const u16 sqrt_evenadjust[] = { + 0x0a2d, 0x08af, 0x075a, 0x0629, 0x051a, 0x0429, 0x0356, 0x029e, + 0x0200, 0x0179, 0x0109, 0x00af, 0x0068, 0x0034, 0x0012, 0x0002 +}; + +u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand) +{ + int index; + u32 z, a; + + if ((significand & 0xc0000000) != 0x40000000) { + printk(KERN_WARNING "VFP: estimate_sqrt: invalid significand\n"); + } + + a = significand << 1; + index = (a >> 27) & 15; + if (exponent & 1) { + z = 0x4000 + (a >> 17) - sqrt_oddadjust[index]; + z = ((a / z) << 14) + (z << 15); + a >>= 1; + } else { + z = 0x8000 + (a >> 17) - sqrt_evenadjust[index]; + z = a / z + z; + z = (z >= 0x20000) ? 0xffff8000 : (z << 15); + if (z <= a) + return (s32)a >> 1; + } + return (u32)(((u64)a << 31) / z) + (z >> 1); +} + +static u32 vfp_single_fsqrt(int sd, int unused, s32 m, u32 fpscr) +{ + struct vfp_single vsm, vsd; + int ret, tm; + + vfp_single_unpack(&vsm, m); + tm = vfp_single_type(&vsm); + if (tm & (VFP_NAN|VFP_INFINITY)) { + struct vfp_single *vsp = &vsd; + + if (tm & VFP_NAN) + ret = vfp_propagate_nan(vsp, &vsm, NULL, fpscr); + else if (vsm.sign == 0) { + sqrt_copy: + vsp = &vsm; + ret = 0; + } else { + sqrt_invalid: + vsp = &vfp_single_default_qnan; + ret = FPSCR_IOC; + } + vfp_put_float(sd, vfp_single_pack(vsp)); + return ret; + } + + /* + * sqrt(+/- 0) == +/- 0 + */ + if (tm & VFP_ZERO) + goto sqrt_copy; + + /* + * Normalise a denormalised number + */ + if (tm & VFP_DENORMAL) + vfp_single_normalise_denormal(&vsm); + + /* + * sqrt(<0) = invalid + */ + if (vsm.sign) + goto sqrt_invalid; + + vfp_single_dump("sqrt", &vsm); + + /* + * Estimate the square root. + */ + vsd.sign = 0; + vsd.exponent = ((vsm.exponent - 127) >> 1) + 127; + vsd.significand = vfp_estimate_sqrt_significand(vsm.exponent, vsm.significand) + 2; + + vfp_single_dump("sqrt estimate", &vsd); + + /* + * And now adjust. + */ + if ((vsd.significand & VFP_SINGLE_LOW_BITS_MASK) <= 5) { + if (vsd.significand < 2) { + vsd.significand = 0xffffffff; + } else { + u64 term; + s64 rem; + vsm.significand <<= !(vsm.exponent & 1); + term = (u64)vsd.significand * vsd.significand; + rem = ((u64)vsm.significand << 32) - term; + + pr_debug("VFP: term=%016llx rem=%016llx\n", term, rem); + + while (rem < 0) { + vsd.significand -= 1; + rem += ((u64)vsd.significand << 1) | 1; + } + vsd.significand |= rem != 0; + } + } + vsd.significand = vfp_shiftright32jamming(vsd.significand, 1); + + return vfp_single_normaliseround(sd, &vsd, fpscr, 0, "fsqrt"); +} + +/* + * Equal := ZC + * Less than := N + * Greater than := C + * Unordered := CV + */ +static u32 vfp_compare(int sd, int signal_on_qnan, s32 m, u32 fpscr) +{ + s32 d; + u32 ret = 0; + + d = vfp_get_float(sd); + if (vfp_single_packed_exponent(m) == 255 && vfp_single_packed_mantissa(m)) { + ret |= FPSCR_C | FPSCR_V; + if (signal_on_qnan || !(vfp_single_packed_mantissa(m) & (1 << (VFP_SINGLE_MANTISSA_BITS - 1)))) + /* + * Signalling NaN, or signalling on quiet NaN + */ + ret |= FPSCR_IOC; + } + + if (vfp_single_packed_exponent(d) == 255 && vfp_single_packed_mantissa(d)) { + ret |= FPSCR_C | FPSCR_V; + if (signal_on_qnan || !(vfp_single_packed_mantissa(d) & (1 << (VFP_SINGLE_MANTISSA_BITS - 1)))) + /* + * Signalling NaN, or signalling on quiet NaN + */ + ret |= FPSCR_IOC; + } + + if (ret == 0) { + if (d == m || vfp_single_packed_abs(d | m) == 0) { + /* + * equal + */ + ret |= FPSCR_Z | FPSCR_C; + } else if (vfp_single_packed_sign(d ^ m)) { + /* + * different signs + */ + if (vfp_single_packed_sign(d)) + /* + * d is negative, so d < m + */ + ret |= FPSCR_N; + else + /* + * d is positive, so d > m + */ + ret |= FPSCR_C; + } else if ((vfp_single_packed_sign(d) != 0) ^ (d < m)) { + /* + * d < m + */ + ret |= FPSCR_N; + } else if ((vfp_single_packed_sign(d) != 0) ^ (d > m)) { + /* + * d > m + */ + ret |= FPSCR_C; + } + } + return ret; +} + +static u32 vfp_single_fcmp(int sd, int unused, s32 m, u32 fpscr) +{ + return vfp_compare(sd, 0, m, fpscr); +} + +static u32 vfp_single_fcmpe(int sd, int unused, s32 m, u32 fpscr) +{ + return vfp_compare(sd, 1, m, fpscr); +} + +static u32 vfp_single_fcmpz(int sd, int unused, s32 m, u32 fpscr) +{ + return vfp_compare(sd, 0, 0, fpscr); +} + +static u32 vfp_single_fcmpez(int sd, int unused, s32 m, u32 fpscr) +{ + return vfp_compare(sd, 1, 0, fpscr); +} + +static u32 vfp_single_fcvtd(int dd, int unused, s32 m, u32 fpscr) +{ + struct vfp_single vsm; + struct vfp_double vdd; + int tm; + u32 exceptions = 0; + + vfp_single_unpack(&vsm, m); + + tm = vfp_single_type(&vsm); + + /* + * If we have a signalling NaN, signal invalid operation. + */ + if (tm == VFP_SNAN) + exceptions = FPSCR_IOC; + + if (tm & VFP_DENORMAL) + vfp_single_normalise_denormal(&vsm); + + vdd.sign = vsm.sign; + vdd.significand = (u64)vsm.significand << 32; + + /* + * If we have an infinity or NaN, the exponent must be 2047. + */ + if (tm & (VFP_INFINITY|VFP_NAN)) { + vdd.exponent = 2047; + if (tm & VFP_NAN) + vdd.significand |= VFP_DOUBLE_SIGNIFICAND_QNAN; + goto pack_nan; + } else if (tm & VFP_ZERO) + vdd.exponent = 0; + else + vdd.exponent = vsm.exponent + (1023 - 127); + + /* + * Technically, if bit 0 of dd is set, this is an invalid + * instruction. However, we ignore this for efficiency. + */ + return vfp_double_normaliseround(dd, &vdd, fpscr, exceptions, "fcvtd"); + + pack_nan: + vfp_put_double(dd, vfp_double_pack(&vdd)); + return exceptions; +} + +static u32 vfp_single_fuito(int sd, int unused, s32 m, u32 fpscr) +{ + struct vfp_single vs; + + vs.sign = 0; + vs.exponent = 127 + 31 - 1; + vs.significand = (u32)m; + + return vfp_single_normaliseround(sd, &vs, fpscr, 0, "fuito"); +} + +static u32 vfp_single_fsito(int sd, int unused, s32 m, u32 fpscr) +{ + struct vfp_single vs; + + vs.sign = (m & 0x80000000) >> 16; + vs.exponent = 127 + 31 - 1; + vs.significand = vs.sign ? -m : m; + + return vfp_single_normaliseround(sd, &vs, fpscr, 0, "fsito"); +} + +static u32 vfp_single_ftoui(int sd, int unused, s32 m, u32 fpscr) +{ + struct vfp_single vsm; + u32 d, exceptions = 0; + int rmode = fpscr & FPSCR_RMODE_MASK; + int tm; + + vfp_single_unpack(&vsm, m); + vfp_single_dump("VSM", &vsm); + + /* + * Do we have a denormalised number? + */ + tm = vfp_single_type(&vsm); + if (tm & VFP_DENORMAL) + exceptions |= FPSCR_IDC; + + if (tm & VFP_NAN) + vsm.sign = 0; + + if (vsm.exponent >= 127 + 32) { + d = vsm.sign ? 0 : 0xffffffff; + exceptions = FPSCR_IOC; + } else if (vsm.exponent >= 127 - 1) { + int shift = 127 + 31 - vsm.exponent; + u32 rem, incr = 0; + + /* + * 2^0 <= m < 2^32-2^8 + */ + d = (vsm.significand << 1) >> shift; + rem = vsm.significand << (33 - shift); + + if (rmode == FPSCR_ROUND_NEAREST) { + incr = 0x80000000; + if ((d & 1) == 0) + incr -= 1; + } else if (rmode == FPSCR_ROUND_TOZERO) { + incr = 0; + } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vsm.sign != 0)) { + incr = ~0; + } + + if ((rem + incr) < rem) { + if (d < 0xffffffff) + d += 1; + else + exceptions |= FPSCR_IOC; + } + + if (d && vsm.sign) { + d = 0; + exceptions |= FPSCR_IOC; + } else if (rem) + exceptions |= FPSCR_IXC; + } else { + d = 0; + if (vsm.exponent | vsm.significand) { + exceptions |= FPSCR_IXC; + if (rmode == FPSCR_ROUND_PLUSINF && vsm.sign == 0) + d = 1; + else if (rmode == FPSCR_ROUND_MINUSINF && vsm.sign) { + d = 0; + exceptions |= FPSCR_IOC; + } + } + } + + pr_debug("VFP: ftoui: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions); + + vfp_put_float(sd, d); + + return exceptions; +} + +static u32 vfp_single_ftouiz(int sd, int unused, s32 m, u32 fpscr) +{ + return vfp_single_ftoui(sd, unused, m, FPSCR_ROUND_TOZERO); +} + +static u32 vfp_single_ftosi(int sd, int unused, s32 m, u32 fpscr) +{ + struct vfp_single vsm; + u32 d, exceptions = 0; + int rmode = fpscr & FPSCR_RMODE_MASK; + + vfp_single_unpack(&vsm, m); + vfp_single_dump("VSM", &vsm); + + /* + * Do we have a denormalised number? + */ + if (vfp_single_type(&vsm) & VFP_DENORMAL) + exceptions |= FPSCR_IDC; + + if (vsm.exponent >= 127 + 32) { + /* + * m >= 2^31-2^7: invalid + */ + d = 0x7fffffff; + if (vsm.sign) + d = ~d; + exceptions |= FPSCR_IOC; + } else if (vsm.exponent >= 127 - 1) { + int shift = 127 + 31 - vsm.exponent; + u32 rem, incr = 0; + + /* 2^0 <= m <= 2^31-2^7 */ + d = (vsm.significand << 1) >> shift; + rem = vsm.significand << (33 - shift); + + if (rmode == FPSCR_ROUND_NEAREST) { + incr = 0x80000000; + if ((d & 1) == 0) + incr -= 1; + } else if (rmode == FPSCR_ROUND_TOZERO) { + incr = 0; + } else if ((rmode == FPSCR_ROUND_PLUSINF) ^ (vsm.sign != 0)) { + incr = ~0; + } + + if ((rem + incr) < rem && d < 0xffffffff) + d += 1; + if (d > 0x7fffffff + (vsm.sign != 0)) { + d = 0x7fffffff + (vsm.sign != 0); + exceptions |= FPSCR_IOC; + } else if (rem) + exceptions |= FPSCR_IXC; + + if (vsm.sign) + d = -d; + } else { + d = 0; + if (vsm.exponent | vsm.significand) { + exceptions |= FPSCR_IXC; + if (rmode == FPSCR_ROUND_PLUSINF && vsm.sign == 0) + d = 1; + else if (rmode == FPSCR_ROUND_MINUSINF && vsm.sign) + d = -1; + } + } + + pr_debug("VFP: ftosi: d(s%d)=%08x exceptions=%08x\n", sd, d, exceptions); + + vfp_put_float(sd, (s32)d); + + return exceptions; +} + +static u32 vfp_single_ftosiz(int sd, int unused, s32 m, u32 fpscr) +{ + return vfp_single_ftosi(sd, unused, m, FPSCR_ROUND_TOZERO); +} + +static u32 (* const fop_extfns[32])(int sd, int unused, s32 m, u32 fpscr) = { + [FEXT_TO_IDX(FEXT_FCPY)] = vfp_single_fcpy, + [FEXT_TO_IDX(FEXT_FABS)] = vfp_single_fabs, + [FEXT_TO_IDX(FEXT_FNEG)] = vfp_single_fneg, + [FEXT_TO_IDX(FEXT_FSQRT)] = vfp_single_fsqrt, + [FEXT_TO_IDX(FEXT_FCMP)] = vfp_single_fcmp, + [FEXT_TO_IDX(FEXT_FCMPE)] = vfp_single_fcmpe, + [FEXT_TO_IDX(FEXT_FCMPZ)] = vfp_single_fcmpz, + [FEXT_TO_IDX(FEXT_FCMPEZ)] = vfp_single_fcmpez, + [FEXT_TO_IDX(FEXT_FCVT)] = vfp_single_fcvtd, + [FEXT_TO_IDX(FEXT_FUITO)] = vfp_single_fuito, + [FEXT_TO_IDX(FEXT_FSITO)] = vfp_single_fsito, + [FEXT_TO_IDX(FEXT_FTOUI)] = vfp_single_ftoui, + [FEXT_TO_IDX(FEXT_FTOUIZ)] = vfp_single_ftouiz, + [FEXT_TO_IDX(FEXT_FTOSI)] = vfp_single_ftosi, + [FEXT_TO_IDX(FEXT_FTOSIZ)] = vfp_single_ftosiz, +}; + + + + + +static u32 +vfp_single_fadd_nonnumber(struct vfp_single *vsd, struct vfp_single *vsn, + struct vfp_single *vsm, u32 fpscr) +{ + struct vfp_single *vsp; + u32 exceptions = 0; + int tn, tm; + + tn = vfp_single_type(vsn); + tm = vfp_single_type(vsm); + + if (tn & tm & VFP_INFINITY) { + /* + * Two infinities. Are they different signs? + */ + if (vsn->sign ^ vsm->sign) { + /* + * different signs -> invalid + */ + exceptions = FPSCR_IOC; + vsp = &vfp_single_default_qnan; + } else { + /* + * same signs -> valid + */ + vsp = vsn; + } + } else if (tn & VFP_INFINITY && tm & VFP_NUMBER) { + /* + * One infinity and one number -> infinity + */ + vsp = vsn; + } else { + /* + * 'n' is a NaN of some type + */ + return vfp_propagate_nan(vsd, vsn, vsm, fpscr); + } + *vsd = *vsp; + return exceptions; +} + +static u32 +vfp_single_add(struct vfp_single *vsd, struct vfp_single *vsn, + struct vfp_single *vsm, u32 fpscr) +{ + u32 exp_diff, m_sig; + + if (vsn->significand & 0x80000000 || + vsm->significand & 0x80000000) { + pr_info("VFP: bad FP values in %s\n", __func__); + vfp_single_dump("VSN", vsn); + vfp_single_dump("VSM", vsm); + } + + /* + * Ensure that 'n' is the largest magnitude number. Note that + * if 'n' and 'm' have equal exponents, we do not swap them. + * This ensures that NaN propagation works correctly. + */ + if (vsn->exponent < vsm->exponent) { + struct vfp_single *t = vsn; + vsn = vsm; + vsm = t; + } + + /* + * Is 'n' an infinity or a NaN? Note that 'm' may be a number, + * infinity or a NaN here. + */ + if (vsn->exponent == 255) + return vfp_single_fadd_nonnumber(vsd, vsn, vsm, fpscr); + + /* + * We have two proper numbers, where 'vsn' is the larger magnitude. + * + * Copy 'n' to 'd' before doing the arithmetic. + */ + *vsd = *vsn; + + /* + * Align both numbers. + */ + exp_diff = vsn->exponent - vsm->exponent; + m_sig = vfp_shiftright32jamming(vsm->significand, exp_diff); + + /* + * If the signs are different, we are really subtracting. + */ + if (vsn->sign ^ vsm->sign) { + m_sig = vsn->significand - m_sig; + if ((s32)m_sig < 0) { + vsd->sign = vfp_sign_negate(vsd->sign); + m_sig = -m_sig; + } else if (m_sig == 0) { + vsd->sign = (fpscr & FPSCR_RMODE_MASK) == + FPSCR_ROUND_MINUSINF ? 0x8000 : 0; + } + } else { + m_sig = vsn->significand + m_sig; + } + vsd->significand = m_sig; + + return 0; +} + +static u32 +vfp_single_multiply(struct vfp_single *vsd, struct vfp_single *vsn, struct vfp_single *vsm, u32 fpscr) +{ + vfp_single_dump("VSN", vsn); + vfp_single_dump("VSM", vsm); + + /* + * Ensure that 'n' is the largest magnitude number. Note that + * if 'n' and 'm' have equal exponents, we do not swap them. + * This ensures that NaN propagation works correctly. + */ + if (vsn->exponent < vsm->exponent) { + struct vfp_single *t = vsn; + vsn = vsm; + vsm = t; + pr_debug("VFP: swapping M <-> N\n"); + } + + vsd->sign = vsn->sign ^ vsm->sign; + + /* + * If 'n' is an infinity or NaN, handle it. 'm' may be anything. + */ + if (vsn->exponent == 255) { + if (vsn->significand || (vsm->exponent == 255 && vsm->significand)) + return vfp_propagate_nan(vsd, vsn, vsm, fpscr); + if ((vsm->exponent | vsm->significand) == 0) { + *vsd = vfp_single_default_qnan; + return FPSCR_IOC; + } + vsd->exponent = vsn->exponent; + vsd->significand = 0; + return 0; + } + + /* + * If 'm' is zero, the result is always zero. In this case, + * 'n' may be zero or a number, but it doesn't matter which. + */ + if ((vsm->exponent | vsm->significand) == 0) { + vsd->exponent = 0; + vsd->significand = 0; + return 0; + } + + /* + * We add 2 to the destination exponent for the same reason as + * the addition case - though this time we have +1 from each + * input operand. + */ + vsd->exponent = vsn->exponent + vsm->exponent - 127 + 2; + vsd->significand = vfp_hi64to32jamming((u64)vsn->significand * vsm->significand); + + vfp_single_dump("VSD", vsd); + return 0; +} + +#define NEG_MULTIPLY (1 << 0) +#define NEG_SUBTRACT (1 << 1) + +static u32 +vfp_single_multiply_accumulate(int sd, int sn, s32 m, u32 fpscr, u32 negate, char *func) +{ + struct vfp_single vsd, vsp, vsn, vsm; + u32 exceptions; + s32 v; + + v = vfp_get_float(sn); + pr_debug("VFP: s%u = %08x\n", sn, v); + vfp_single_unpack(&vsn, v); + if (vsn.exponent == 0 && vsn.significand) + vfp_single_normalise_denormal(&vsn); + + vfp_single_unpack(&vsm, m); + if (vsm.exponent == 0 && vsm.significand) + vfp_single_normalise_denormal(&vsm); + + exceptions = vfp_single_multiply(&vsp, &vsn, &vsm, fpscr); + if (negate & NEG_MULTIPLY) + vsp.sign = vfp_sign_negate(vsp.sign); + + v = vfp_get_float(sd); + pr_debug("VFP: s%u = %08x\n", sd, v); + vfp_single_unpack(&vsn, v); + if (negate & NEG_SUBTRACT) + vsn.sign = vfp_sign_negate(vsn.sign); + + exceptions |= vfp_single_add(&vsd, &vsn, &vsp, fpscr); + + return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, func); +} + +/* + * Standard operations + */ + +/* + * sd = sd + (sn * sm) + */ +static u32 vfp_single_fmac(int sd, int sn, s32 m, u32 fpscr) +{ + return vfp_single_multiply_accumulate(sd, sn, m, fpscr, 0, "fmac"); +} + +/* + * sd = sd - (sn * sm) + */ +static u32 vfp_single_fnmac(int sd, int sn, s32 m, u32 fpscr) +{ + return vfp_single_multiply_accumulate(sd, sn, m, fpscr, NEG_MULTIPLY, "fnmac"); +} + +/* + * sd = -sd + (sn * sm) + */ +static u32 vfp_single_fmsc(int sd, int sn, s32 m, u32 fpscr) +{ + return vfp_single_multiply_accumulate(sd, sn, m, fpscr, NEG_SUBTRACT, "fmsc"); +} + +/* + * sd = -sd - (sn * sm) + */ +static u32 vfp_single_fnmsc(int sd, int sn, s32 m, u32 fpscr) +{ + return vfp_single_multiply_accumulate(sd, sn, m, fpscr, NEG_SUBTRACT | NEG_MULTIPLY, "fnmsc"); +} + +/* + * sd = sn * sm + */ +static u32 vfp_single_fmul(int sd, int sn, s32 m, u32 fpscr) +{ + struct vfp_single vsd, vsn, vsm; + u32 exceptions; + s32 n = vfp_get_float(sn); + + pr_debug("VFP: s%u = %08x\n", sn, n); + + vfp_single_unpack(&vsn, n); + if (vsn.exponent == 0 && vsn.significand) + vfp_single_normalise_denormal(&vsn); + + vfp_single_unpack(&vsm, m); + if (vsm.exponent == 0 && vsm.significand) + vfp_single_normalise_denormal(&vsm); + + exceptions = vfp_single_multiply(&vsd, &vsn, &vsm, fpscr); + return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fmul"); +} + +/* + * sd = -(sn * sm) + */ +static u32 vfp_single_fnmul(int sd, int sn, s32 m, u32 fpscr) +{ + struct vfp_single vsd, vsn, vsm; + u32 exceptions; + s32 n = vfp_get_float(sn); + + pr_debug("VFP: s%u = %08x\n", sn, n); + + vfp_single_unpack(&vsn, n); + if (vsn.exponent == 0 && vsn.significand) + vfp_single_normalise_denormal(&vsn); + + vfp_single_unpack(&vsm, m); + if (vsm.exponent == 0 && vsm.significand) + vfp_single_normalise_denormal(&vsm); + + exceptions = vfp_single_multiply(&vsd, &vsn, &vsm, fpscr); + vsd.sign = vfp_sign_negate(vsd.sign); + return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fnmul"); +} + +/* + * sd = sn + sm + */ +static u32 vfp_single_fadd(int sd, int sn, s32 m, u32 fpscr) +{ + struct vfp_single vsd, vsn, vsm; + u32 exceptions; + s32 n = vfp_get_float(sn); + + pr_debug("VFP: s%u = %08x\n", sn, n); + + /* + * Unpack and normalise denormals. + */ + vfp_single_unpack(&vsn, n); + if (vsn.exponent == 0 && vsn.significand) + vfp_single_normalise_denormal(&vsn); + + vfp_single_unpack(&vsm, m); + if (vsm.exponent == 0 && vsm.significand) + vfp_single_normalise_denormal(&vsm); + + exceptions = vfp_single_add(&vsd, &vsn, &vsm, fpscr); + + return vfp_single_normaliseround(sd, &vsd, fpscr, exceptions, "fadd"); +} + +/* + * sd = sn - sm + */ +static u32 vfp_single_fsub(int sd, int sn, s32 m, u32 fpscr) +{ + /* + * Subtraction is addition with one sign inverted. + */ + return vfp_single_fadd(sd, sn, vfp_single_packed_negate(m), fpscr); +} + +/* + * sd = sn / sm + */ +static u32 vfp_single_fdiv(int sd, int sn, s32 m, u32 fpscr) +{ + struct vfp_single vsd, vsn, vsm; + u32 exceptions = 0; + s32 n = vfp_get_float(sn); + int tm, tn; + + pr_debug("VFP: s%u = %08x\n", sn, n); + + vfp_single_unpack(&vsn, n); + vfp_single_unpack(&vsm, m); + + vsd.sign = vsn.sign ^ vsm.sign; + + tn = vfp_single_type(&vsn); + tm = vfp_single_type(&vsm); + + /* + * Is n a NAN? + */ + if (tn & VFP_NAN) + goto vsn_nan; + + /* + * Is m a NAN? + */ + if (tm & VFP_NAN) + goto vsm_nan; + + /* + * If n and m are infinity, the result is invalid + * If n and m are zero, the result is invalid + */ + if (tm & tn & (VFP_INFINITY|VFP_ZERO)) + goto invalid; + + /* + * If n is infinity, the result is infinity + */ + if (tn & VFP_INFINITY) + goto infinity; + + /* + * If m is zero, raise div0 exception + */ + if (tm & VFP_ZERO) + goto divzero; + + /* + * If m is infinity, or n is zero, the result is zero + */ + if (tm & VFP_INFINITY || tn & VFP_ZERO) + goto zero; + + if (tn & VFP_DENORMAL) + vfp_single_normalise_denormal(&vsn); + if (tm & VFP_DENORMAL) + vfp_single_normalise_denormal(&vsm); + + /* + * Ok, we have two numbers, we can perform division. + */ + vsd.exponent = vsn.exponent - vsm.exponent + 127 - 1; + vsm.significand <<= 1; + if (vsm.significand <= (2 * vsn.significand)) { + vsn.significand >>= 1; + vsd.exponent++; + } + vsd.significand = ((u64)vsn.significand << 32) / vsm.significand; + if ((vsd.significand & 0x3f) == 0) + vsd.significand |= ((u64)vsm.significand * vsd.significand != (u64)vsn.significand << 32); + + return vfp_single_normaliseround(sd, &vsd, fpscr, 0, "fdiv"); + + vsn_nan: + exceptions = vfp_propagate_nan(&vsd, &vsn, &vsm, fpscr); + pack: + vfp_put_float(sd, vfp_single_pack(&vsd)); + return exceptions; + + vsm_nan: + exceptions = vfp_propagate_nan(&vsd, &vsm, &vsn, fpscr); + goto pack; + + zero: + vsd.exponent = 0; + vsd.significand = 0; + goto pack; + + divzero: + exceptions = FPSCR_DZC; + infinity: + vsd.exponent = 255; + vsd.significand = 0; + goto pack; + + invalid: + vfp_put_float(sd, vfp_single_pack(&vfp_single_default_qnan)); + return FPSCR_IOC; +} + +static u32 (* const fop_fns[16])(int sd, int sn, s32 m, u32 fpscr) = { + [FOP_TO_IDX(FOP_FMAC)] = vfp_single_fmac, + [FOP_TO_IDX(FOP_FNMAC)] = vfp_single_fnmac, + [FOP_TO_IDX(FOP_FMSC)] = vfp_single_fmsc, + [FOP_TO_IDX(FOP_FNMSC)] = vfp_single_fnmsc, + [FOP_TO_IDX(FOP_FMUL)] = vfp_single_fmul, + [FOP_TO_IDX(FOP_FNMUL)] = vfp_single_fnmul, + [FOP_TO_IDX(FOP_FADD)] = vfp_single_fadd, + [FOP_TO_IDX(FOP_FSUB)] = vfp_single_fsub, + [FOP_TO_IDX(FOP_FDIV)] = vfp_single_fdiv, +}; + +#define FREG_BANK(x) ((x) & 0x18) +#define FREG_IDX(x) ((x) & 7) + +u32 vfp_single_cpdo(u32 inst, u32 fpscr) +{ + u32 op = inst & FOP_MASK; + u32 exceptions = 0; + unsigned int sd = vfp_get_sd(inst); + unsigned int sn = vfp_get_sn(inst); + unsigned int sm = vfp_get_sm(inst); + unsigned int vecitr, veclen, vecstride; + u32 (*fop)(int, int, s32, u32); + + veclen = fpscr & FPSCR_LENGTH_MASK; + vecstride = 1 + ((fpscr & FPSCR_STRIDE_MASK) == FPSCR_STRIDE_MASK); + + /* + * If destination bank is zero, vector length is always '1'. + * ARM DDI0100F C5.1.3, C5.3.2. + */ + if (FREG_BANK(sd) == 0) + veclen = 0; + + pr_debug("VFP: vecstride=%u veclen=%u\n", vecstride, + (veclen >> FPSCR_LENGTH_BIT) + 1); + + fop = (op == FOP_EXT) ? fop_extfns[sn] : fop_fns[FOP_TO_IDX(op)]; + if (!fop) + goto invalid; + + for (vecitr = 0; vecitr <= veclen; vecitr += 1 << FPSCR_LENGTH_BIT) { + s32 m = vfp_get_float(sm); + u32 except; + + if (op == FOP_EXT) + pr_debug("VFP: itr%d (s%u) = op[%u] (s%u=%08x)\n", + vecitr >> FPSCR_LENGTH_BIT, sd, sn, sm, m); + else + pr_debug("VFP: itr%d (s%u) = (s%u) op[%u] (s%u=%08x)\n", + vecitr >> FPSCR_LENGTH_BIT, sd, sn, + FOP_TO_IDX(op), sm, m); + + except = fop(sd, sn, m, fpscr); + pr_debug("VFP: itr%d: exceptions=%08x\n", + vecitr >> FPSCR_LENGTH_BIT, except); + + exceptions |= except; + + /* + * This ensures that comparisons only operate on scalars; + * comparisons always return with one FPSCR status bit set. + */ + if (except & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V)) + break; + + /* + * CHECK: It appears to be undefined whether we stop when + * we encounter an exception. We continue. + */ + + sd = FREG_BANK(sd) + ((FREG_IDX(sd) + vecstride) & 7); + sn = FREG_BANK(sn) + ((FREG_IDX(sn) + vecstride) & 7); + if (FREG_BANK(sm) != 0) + sm = FREG_BANK(sm) + ((FREG_IDX(sm) + vecstride) & 7); + } + return exceptions; + + invalid: + return (u32)-1; +} diff -Nru a/arch/arm26/kernel/init_task.c b/arch/arm26/kernel/init_task.c --- a/arch/arm26/kernel/init_task.c 2004-06-23 19:04:26 -07:00 +++ b/arch/arm26/kernel/init_task.c 2004-06-23 19:04:26 -07:00 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c --- a/arch/cris/kernel/process.c 2004-06-23 19:04:27 -07:00 +++ b/arch/cris/kernel/process.c 2004-06-23 19:04:27 -07:00 @@ -112,6 +112,7 @@ #include #include #include +#include //#define DEBUG diff -Nru a/arch/h8300/Kconfig b/arch/h8300/Kconfig --- a/arch/h8300/Kconfig 2004-06-23 19:04:28 -07:00 +++ b/arch/h8300/Kconfig 2004-06-23 19:04:28 -07:00 @@ -223,7 +223,7 @@ config CONFIG_SH_STANDARD_BIOS bool "Use gdb protocol serial console" - depends on (!H8300H_SIM && H8S_SIM) + depends on (!H8300H_SIM && !H8S_SIM) help serial console output using GDB protocol. Require eCos/RedBoot diff -Nru a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c --- a/arch/h8300/kernel/init_task.c 2004-06-23 19:04:26 -07:00 +++ b/arch/h8300/kernel/init_task.c 2004-06-23 19:04:26 -07:00 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c --- a/arch/h8300/kernel/ptrace.c 2004-06-23 19:04:26 -07:00 +++ b/arch/h8300/kernel/ptrace.c 2004-06-23 19:04:26 -07:00 @@ -116,18 +116,36 @@ case PTRACE_PEEKUSR: { unsigned long tmp; - if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) + if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { ret = -EIO; + break ; + } - tmp = 0; /* Default return condition */ + ret = 0; /* Default return condition */ addr = addr >> 2; /* temporary hack. */ + if (addr < H8300_REGS_NO) tmp = h8300_get_reg(child, addr); else { - ret = -EIO; - break ; + switch(addr) { + case 49: + tmp = child->mm->start_code; + break ; + case 50: + tmp = child->mm->start_data; + break ; + case 51: + tmp = child->mm->end_code; + break ; + case 52: + tmp = child->mm->end_data; + break ; + default: + ret = -EIO; + } } - ret = put_user(tmp,(unsigned long *) data); + if (!ret) + ret = put_user(tmp,(unsigned long *) data); break ; } diff -Nru a/arch/h8300/platform/h8s/entry.S b/arch/h8300/platform/h8s/entry.S --- a/arch/h8300/platform/h8s/entry.S 2004-06-23 19:04:28 -07:00 +++ b/arch/h8300/platform/h8s/entry.S 2004-06-23 19:04:28 -07:00 @@ -83,6 +83,7 @@ mov.l @(LER0-LER1:16,sp),er1 /* restore ER0 */ mov.l er1,@er0 mov.w @(LEXR-LER1:16,sp),r1 /* restore EXR */ + mov.b r1l,r1h mov.w r1,@(8:16,er0) mov.w @(LCCR-LER1:16,sp),r1 /* restore the RET addr */ mov.b r1l,r1h @@ -213,7 +214,6 @@ mov.l er0,@(LER0:16,sp) /* save the return value */ jsr @SYMBOL_NAME(syscall_trace) bra SYMBOL_NAME(ret_from_exception):8 - SYMBOL_NAME_LABEL(ret_from_fork) mov.l er2,er0 diff -Nru a/arch/h8300/platform/h8s/ptrace_h8s.c b/arch/h8300/platform/h8s/ptrace_h8s.c --- a/arch/h8300/platform/h8s/ptrace_h8s.c 2004-06-23 19:04:26 -07:00 +++ b/arch/h8300/platform/h8s/ptrace_h8s.c 2004-06-23 19:04:26 -07:00 @@ -23,7 +23,7 @@ static const int h8300_register_offset[] = { PT_REG(er1), PT_REG(er2), PT_REG(er3), PT_REG(er4), PT_REG(er5), PT_REG(er6), PT_REG(er0), PT_REG(orig_er0), - PT_REG(ccr), PT_REG(pc), PT_REG(exr) + PT_REG(ccr), PT_REG(pc), 0, PT_REG(exr) }; /* read register */ diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig --- a/arch/i386/Kconfig 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/Kconfig 2004-06-23 19:04:25 -07:00 @@ -436,7 +436,8 @@ Choose N to continue using the legacy 8254 timer. config HPET_EMULATE_RTC - def_bool HPET_TIMER && RTC=y + bool "Provide RTC interrupt" + depends on HPET_TIMER && RTC=y config SMP bool "Symmetric multi-processing support" @@ -1333,12 +1334,6 @@ config X86_TRAMPOLINE bool depends on X86_SMP || (X86_VOYAGER && SMP) - default y - -# std_resources is overridden for pc9800, but that's not -# a currently selectable arch choice -config X86_STD_RESOURCES - bool default y config PC diff -Nru a/arch/i386/Makefile b/arch/i386/Makefile --- a/arch/i386/Makefile 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/Makefile 2004-06-23 19:04:26 -07:00 @@ -121,22 +121,23 @@ all: bzImage -BOOTIMAGE=arch/i386/boot/bzImage -zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage +# KBUILD_IMAGE specify target image being built + KBUILD_IMAGE := $(boot)/bzImage +zImage zlilo zdisk: KBUILD_IMAGE := arch/i386/boot/zImage zImage bzImage: vmlinux - $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) + $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) compressed: zImage zlilo bzlilo: vmlinux - $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zlilo zdisk bzdisk: vmlinux - $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk install fdimage fdimage144 fdimage288: vmlinux - $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ prepare: include/asm-$(ARCH)/asm_offsets.h CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h diff -Nru a/arch/i386/boot98/Makefile b/arch/i386/boot98/Makefile --- a/arch/i386/boot98/Makefile 2004-06-23 19:04:27 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,102 +0,0 @@ -# -# arch/i386/boot/Makefile -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1994 by Linus Torvalds -# - -# ROOT_DEV specifies the default root-device when making the image. -# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case -# the default of FLOPPY is used by 'build'. - -ROOT_DEV := CURRENT - -# If you want to preset the SVGA mode, uncomment the next line and -# set SVGA_MODE to whatever number you want. -# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. -# The number is the same as you would ordinarily press at bootup. - -SVGA_MODE := -DSVGA_MODE=NORMAL_VGA - -# If you want the RAM disk device, define this to be the size in blocks. - -#RAMDISK := -DRAMDISK=512 - -targets := vmlinux.bin bootsect bootsect.o setup setup.o \ - zImage bzImage -subdir- := compressed - -host-progs := tools/build - -# --------------------------------------------------------------------------- - -$(obj)/zImage: IMAGE_OFFSET := 0x1000 -$(obj)/zImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -$(obj)/bzImage: IMAGE_OFFSET := 0x100000 -$(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ -$(obj)/bzImage: BUILDFLAGS := -b - -quiet_cmd_image = BUILD $@ -cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \ - $(obj)/vmlinux.bin $(ROOT_DEV) > $@ - -$(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \ - $(obj)/vmlinux.bin $(obj)/tools/build FORCE - $(call if_changed,image) - @echo 'Kernel: $@ is ready' - -$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE - $(call if_changed,objcopy) - -LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary -LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext - -$(obj)/setup $(obj)/bootsect: %: %.o FORCE - $(call if_changed,ld) - -$(obj)/compressed/vmlinux: FORCE - $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ - -# Set this if you want to pass append arguments to the zdisk/fdimage kernel -FDARGS = - -$(obj)/mtools.conf: $(src)/mtools.conf.in - sed -e 's|@OBJ@|$(obj)|g' < $< > $@ - -# This requires write access to /dev/fd0 -zdisk: $(BOOTIMAGE) $(obj)/mtools.conf - MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync - syslinux /dev/fd0 ; sync - echo 'default linux $(FDARGS)' | \ - MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg - MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync - -# These require being root or having syslinux 2.02 or higher installed -fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf - dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 - MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync - syslinux $(obj)/fdimage ; sync - echo 'default linux $(FDARGS)' | \ - MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg - MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync - -fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf - dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 - MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync - syslinux $(obj)/fdimage ; sync - echo 'default linux $(FDARGS)' | \ - MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg - MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync - -zlilo: $(BOOTIMAGE) - if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi - if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi - cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz - cp System.map $(INSTALL_PATH)/ - if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi - -install: $(BOOTIMAGE) - sh $(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" diff -Nru a/arch/i386/boot98/bootsect.S b/arch/i386/boot98/bootsect.S --- a/arch/i386/boot98/bootsect.S 2004-06-23 19:04:25 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,397 +0,0 @@ -/* - * bootsect.S - boot sector for NEC PC-9800 series - * - * Linux/98 project at Kyoto University Microcomputer Club (KMC) - * FUJITA Norimasa, TAKAI Kousuke 1997-1998 - * rewritten by TAKAI Kousuke (as86 -> gas), Nov 1999 - * - * Based on: - * bootsect.S Copyright (C) 1991, 1992 Linus Torvalds - * modified by Drew Eckhardt - * modified by Bruce Evans (bde) - * - * bootsect.S is loaded at 0x1FC00 or 0x1FE00 by the bios-startup routines, - * and moves itself out of the way to address 0x90000, and jumps there. - * - * It then loads 'setup' directly after itself (0x90200), and the system - * at 0x10000, using BIOS interrupts. - * - * NOTE! currently system is at most (8*65536-4096) bytes long. This should - * be no problem, even in the future. I want to keep it simple. This 508 kB - * kernel size should be enough, especially as this doesn't contain the - * buffer cache as in minix (and especially now that the kernel is - * compressed :-) - * - * The loader has been made as simple as possible, and continuous - * read errors will result in a unbreakable loop. Reboot by hand. It - * loads pretty fast by getting whole tracks at a time whenever possible. - */ - -#include /* for CONFIG_ROOT_RDONLY */ -#include - -SETUPSECTS = 4 /* default nr of setup-sectors */ -BOOTSEG = 0x1FC0 /* original address of boot-sector */ -INITSEG = DEF_INITSEG /* we move boot here - out of the way */ -SETUPSEG = DEF_SETUPSEG /* setup starts here */ -SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */ -SYSSIZE = DEF_SYSSIZE /* system size: # of 16-byte clicks */ - /* to be loaded */ -ROOT_DEV = 0 /* ROOT_DEV is now written by "build" */ -SWAP_DEV = 0 /* SWAP_DEV is now written by "build" */ - -#ifndef SVGA_MODE -#define SVGA_MODE ASK_VGA -#endif - -#ifndef RAMDISK -#define RAMDISK 0 -#endif - -#ifndef ROOT_RDONLY -#define ROOT_RDONLY 1 -#endif - -/* normal/hireso text VRAM segments */ -#define NORMAL_TEXT 0xa000 -#define HIRESO_TEXT 0xe000 - -/* bios work area addresses */ -#define EXPMMSZ 0x0401 -#define BIOS_FLAG 0x0501 -#define DISK_BOOT 0x0584 - -.code16 -.text - -.global _start -_start: - -#if 0 /* hook for debugger, harmless unless BIOS is fussy (old HP) */ - int $0x3 -#endif - jmp real_start - .ascii "Linux 98" - .word 0 -real_start: - xorw %di, %di /* %di = 0 */ - movw %di, %ss /* %ss = 0 */ - movw $0x03F0, %sp - pushw %cx /* for hint */ - - movw $0x0A00, %ax /* normal mode defaults (80x25) */ - - testb $0x08, %ss:BIOS_FLAG /* check hi-reso bit */ - jnz set_crt_mode -/* - * Hi-Reso (high-resolution) machine. - * - * Some hi-reso machines have no RAMs on bank 8/A (0x080000 - 0x0BFFFF). - * On such machines we get two RAM banks from top of protect menory and - * map them on bank 8/A. - * These work-around must be done before moving myself on INITSEG (0x090000-). - */ - movw $(HIRESO_TEXT >> 8), %cs:(vram + 1) /* text VRAM segment */ - - /* set memory window */ - movb $0x08, %al - outb %al, $0x91 /* map native RAM (if any) */ - movb $0x0A, %al - outb %al, $0x93 - - /* check bank ram A */ - pushw $0xA500 - popw %ds - movw (%di), %cx /* %si == 0 from entry */ - notw %cx - movw %cx, (%di) - - movw $0x43F, %dx /* cache flush for 486 and up. */ - movb $0xA0, %al - outb %al, %dx - - cmpw %cx, (%di) - je hireso_done - - /* - * Write test failed; we have no native RAM on 080000h - 0BFFFFh. - * Take 256KB of RAM from top of protected memory. - */ - movb %ss:EXPMMSZ, %al - subb $2, %al /* reduce 2 x 128KB */ - movb %al, %ss:EXPMMSZ - addb %al, %al - addb $0x10, %al - outb %al, $0x91 - addb $2, %al - outb %al, $0x93 - -hireso_done: - movb $0x10, %al /* CRT mode 80x31, %ah still 0Ah */ - -set_crt_mode: - int $0x18 /* set CRT mode */ - - movb $0x0C, %ah /* turn on text displaying */ - int $0x18 - - xorw %dx, %dx /* position cursor to home */ - movb $0x13, %ah - int $0x18 - - movb $0x11, %ah /* turn cursor displaying on */ - int $0x18 - - /* move 1 kilobytes from [BOOTSEG:0000h] to [INITSEG:0000h] */ - cld - xorw %si, %si - pushw $INITSEG - popw %es - movw $512, %cx /* %di == 0 from entry */ - rep - cs - movsw - - ljmp $INITSEG, $go - -go: - pushw %cs - popw %ds /* %ds = %cs */ - - popw %dx /* %dh = saved %ch passed from BIOS */ - movb %ss:DISK_BOOT, %al - andb $0xf0, %al /* %al = Device Address */ - movb $18, %ch /* 18 secs/track, 512 b/sec (1440 KB) */ - cmpb $0x30, %al - je try512 - cmpb $0x90, %al /* 1 MB I/F, 1 MB floppy */ - je try1.2M - cmpb $0xf0, %al /* 640 KB I/F, 1 MB floppy */ - je try1.2M - movb $9, %ch /* 9 secs/track, 512 b/sec ( 720 KB) */ - cmpb $0x10, %al /* 1 MB I/F, 640 KB floppy */ - je try512 - cmpb $0x70, %al /* 640 KB I/F, 640 KB floppy */ - jne error /* unknown device? */ - - /* XXX: Does it make sense to support 8 secs/track, 512 b/sec - (640 KB) floppy? */ - -try512: movb $2, %cl /* 512 b/sec */ -lasttry:call tryload -/* - * Display error message and halt - */ -error: movw $error_msg, %si - call print -wait_reboot: - movb $0x0, %ah - int $0x18 /* wait keyboard input */ -1: movb $0, %al - outb %al, $0xF0 /* reset CPU */ - jmp 1b /* just in case... */ - -try1.2M:cmpb $2, %dh - je try2HC - movw $0x0803, %cx /* 8 secs/track, 1024 b/sec (1232 KB) */ - call tryload - movb $15, %ch /* 15 secs/track, 512 b/sec (1200 KB) */ - jmp try512 -try2HC: movw $0x0F02, %cx /* 15 secs/track, 512 b/sec (1200 KB) */ - call tryload - movw $0x0803, %cx /* 8 secs/track, 1024 b/sec (1232 KB) */ - jmp lasttry - -/* - * Try to load SETUP and SYSTEM provided geometry information in %cx. - * This routine *will not* return on successful load... - */ -tryload: - movw %cx, sectlen - movb %ss:DISK_BOOT, %al - movb $0x7, %ah /* recalibrate the drive */ - int $0x1b - jc error /* recalibration should succeed */ - - /* - * Load SETUP into memory. It is assumed that SETUP fits into - * first cylinder (2 tracks, 9KB on 2DD, 15-18KB on 2HD). - */ - movb $0, %bl - movb setup_sects, %bh - incb %bh - shlw %bx /* %bx = (setup_sects + 1) * 512 */ - movw $128, %bp - shlw %cl, %bp /* %bp = */ - subw %bp, %bx /* length to load */ - movw $0x0002, %dx /* head 0, sector 2 */ - movb %cl, %ch /* `N' for sector address */ - movb $0, %cl /* cylinder 0 */ - pushw %cs - popw %es /* %es = %cs (= INITSEG) */ - movb $0xd6, %ah /* read, multi-track, MFM */ - int $0x1b /* load it! */ - jc read_error - - movw $loading_msg, %si - call print - - movw $SYSSEG, %ax - movw %ax, %es /* %es = SYSSEG */ - -/* - * This routine loads the system at address 0x10000, making sure - * no 64kB boundaries are crossed. We try to load it as fast as - * possible, loading whole tracks whenever we can. - * - * in: es - starting address segment (normally 0x1000) - */ - movb %ch, %cl - addb $7, %cl /* %cl = log2 */ - shrw %cl, %bx /* %bx = # of phys. sectors in SETUP */ - addb %bl, %dl /* %dl = start sector # of SYSTEM */ - decb %dl /* %dl is 0-based in below loop */ - -rp_read_newseg: - xorw %bp, %bp /* = starting address within segment */ -#ifdef __BIG_KERNEL__ - bootsect_kludge = 0x220 /* 0x200 (size of bootsector) + 0x20 (offset */ - lcall *bootsect_kludge /* of bootsect_kludge in setup.S */ -#else - movw %es, %ax - subw $SYSSEG, %ax -#endif - cmpw syssize, %ax - ja boot /* done! */ - -rp_read: - movb sectors, %al - addb %al, %al - movb %al, %ch /* # of sectors on both surface */ - subb %dl, %al /* # of sectors left on this track */ - movb $0, %ah - shlw %cl, %ax /* # of bytes left on this track */ - movw %ax, %bx /* transfer length */ - addw %bp, %ax /* cross 64K boundary? */ - jnc 1f /* ok. */ - jz 1f /* also ok. */ - /* - * Oops, we are crossing 64K boundary... - * Adjust transfer length to make transfer fit in the boundary. - * - * Note: sector size is assumed to be a measure of 65536. - */ - xorw %bx, %bx - subw %bp, %bx -1: pushw %dx - movw $dot_msg, %si /* give progress message */ - call print - xchgw %ax, %dx - movb $0, %ah - divb sectors - xchgb %al, %ah - xchgw %ax, %dx /* %dh = head # / %dl = sector # */ - incb %dl /* fix %dl to 1-based */ - pushw %cx - movw cylinder, %cx - movb $0xd6, %ah /* read, multi-track, seek, MFM */ - movb %ss:DISK_BOOT, %al - int $0x1b - popw %cx - popw %dx - jc read_error - movw %bx, %ax /* # of bytes just read */ - shrw %cl, %ax /* %ax = # of sectors just read */ - addb %al, %dl /* advance sector # */ - cmpb %ch, %dl /* %ch = # of sectors/cylinder */ - jb 2f - incb cylinder /* next cylinder */ - xorb %dl, %dl /* sector 0 */ -2: addw %bx, %bp /* advance offset pointer */ - jnc rp_read - /* offset pointer wrapped; advance segment pointer. */ - movw %es, %ax - addw $0x1000, %ax - movw %ax, %es - jmp rp_read_newseg - -read_error: - ret - -boot: movw %cs, %ax /* = INITSEG */ - /* movw %ax, %ds */ - movw %ax, %ss - movw $0x4000, %sp /* 0x4000 is arbitrary value >= - * length of bootsect + length of - * setup + room for stack; - * PC-9800 never have BIOS workareas - * on high memory. - */ -/* - * After that we check which root-device to use. If the device is - * not defined, /dev/fd0 (2, 0) will be used. - */ - cmpw $0, root_dev - jne 3f - movb $2, root_dev+1 -3: - -/* - * After that (everything loaded), we jump to the setup-routine - * loaded directly after the bootblock: - */ - ljmp $SETUPSEG, $0 - -/* - * Subroutine for print string on console. - * %cs:%si - pointer to message - */ -print: - pushaw - pushw %ds - pushw %es - pushw %cs - popw %ds - lesw curpos, %di /* %es:%di = current text VRAM addr. */ -1: xorw %ax, %ax - lodsb - testb %al, %al - jz 2f /* end of string */ - stosw /* character code */ - movb $0xE1, %es:0x2000-2(%di) /* character attribute */ - jmp 1b -2: movw %di, %dx - movb $0x13, %ah - int $0x18 /* move cursor to current point */ - popw %es - popw %ds - popaw - ret - -loading_msg: - .string "Loading" -dot_msg: - .string "." -error_msg: - .string "Read Error!" - - .org 490 - -curpos: .word 160 /* current cursor position */ -vram: .word NORMAL_TEXT /* text VRAM segment */ - -cylinder: .byte 0 /* current cylinder (lower byte) */ -sectlen: .byte 0 /* (log2 of ) - 7 */ -sectors: .byte 0x0F /* default is 2HD (15 sector/track) */ - -# XXX: This is a fairly snug fit. - -.org 497 -setup_sects: .byte SETUPSECTS -root_flags: .word ROOT_RDONLY -syssize: .word SYSSIZE -swap_dev: .word SWAP_DEV -ram_size: .word RAMDISK -vid_mode: .word SVGA_MODE -root_dev: .word ROOT_DEV -boot_flag: .word 0xAA55 diff -Nru a/arch/i386/boot98/install.sh b/arch/i386/boot98/install.sh --- a/arch/i386/boot98/install.sh 2004-06-23 19:04:27 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,40 +0,0 @@ -#!/bin/sh -# -# arch/i386/boot/install.sh -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1995 by Linus Torvalds -# -# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin -# -# "make install" script for i386 architecture -# -# Arguments: -# $1 - kernel version -# $2 - kernel image file -# $3 - kernel map file -# $4 - default install path (blank if root directory) -# - -# User may have a custom install script - -if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi -if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi - -# Default install - same as make zlilo - -if [ -f $4/vmlinuz ]; then - mv $4/vmlinuz $4/vmlinuz.old -fi - -if [ -f $4/System.map ]; then - mv $4/System.map $4/System.old -fi - -cat $2 > $4/vmlinuz -cp $3 $4/System.map - -if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi diff -Nru a/arch/i386/boot98/mtools.conf.in b/arch/i386/boot98/mtools.conf.in --- a/arch/i386/boot98/mtools.conf.in 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,17 +0,0 @@ -# -# mtools configuration file for "make (b)zdisk" -# - -# Actual floppy drive -drive a: - file="/dev/fd0" - -# 1.44 MB floppy disk image -drive v: - file="@OBJ@/fdimage" cylinders=80 heads=2 sectors=18 filter - -# 2.88 MB floppy disk image (mostly for virtual uses) -drive w: - file="@OBJ@/fdimage" cylinders=80 heads=2 sectors=36 filter - - diff -Nru a/arch/i386/boot98/setup.S b/arch/i386/boot98/setup.S --- a/arch/i386/boot98/setup.S 2004-06-23 19:04:25 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,876 +0,0 @@ -/* - * setup.S Copyright (C) 1991, 1992 Linus Torvalds - * - * setup.s is responsible for getting the system data from the BIOS, - * and putting them into the appropriate places in system memory. - * both setup.s and system has been loaded by the bootblock. - * - * This code asks the bios for memory/disk/other parameters, and - * puts them in a "safe" place: 0x90000-0x901FF, ie where the - * boot-block used to be. It is then up to the protected mode - * system to read them from there before the area is overwritten - * for buffer-blocks. - * - * Move PS/2 aux init code to psaux.c - * (troyer@saifr00.cfsat.Honeywell.COM) 03Oct92 - * - * some changes and additional features by Christoph Niemann, - * March 1993/June 1994 (Christoph.Niemann@linux.org) - * - * add APM BIOS checking by Stephen Rothwell, May 1994 - * (sfr@canb.auug.org.au) - * - * High load stuff, initrd support and position independency - * by Hans Lermen & Werner Almesberger, February 1996 - * , - * - * Video handling moved to video.S by Martin Mares, March 1996 - * - * - * Extended memory detection scheme retwiddled by orc@pell.chi.il.us (david - * parsons) to avoid loadlin confusion, July 1997 - * - * Transcribed from Intel (as86) -> AT&T (gas) by Chris Noe, May 1999. - * - * - * Fix to work around buggy BIOSes which dont use carry bit correctly - * and/or report extended memory in CX/DX for e801h memory size detection - * call. As a result the kernel got wrong figures. The int15/e801h docs - * from Ralf Brown interrupt list seem to indicate AX/BX should be used - * anyway. So to avoid breaking many machines (presumably there was a reason - * to orginally use CX/DX instead of AX/BX), we do a kludge to see - * if CX/DX have been changed in the e801 call and if so use AX/BX . - * Michael Miller, April 2001 - * - * New A20 code ported from SYSLINUX by H. Peter Anvin. AMD Elan bugfixes - * by Robert Schwebel, December 2001 - * - * Heavily modified for NEC PC-9800 series by Kyoto University Microcomputer - * Club (KMC) Linux/98 project , 1997-1999 - */ - -#include -#include -#include -#include -#include -#include -#include - -/* Signature words to ensure LILO loaded us right */ -#define SIG1 0xAA55 -#define SIG2 0x5A5A - -#define HIRESO_TEXT 0xe000 -#define NORMAL_TEXT 0xa000 - -#define BIOS_FLAG2 0x0400 -#define BIOS_FLAG5 0x0458 -#define RDISK_EQUIP 0x0488 -#define BIOS_FLAG 0x0501 -#define KB_SHFT_STS 0x053a -#define DISK_EQUIP 0x055c - -INITSEG = DEF_INITSEG # 0x9000, we move boot here, out of the way -SYSSEG = DEF_SYSSEG # 0x1000, system loaded at 0x10000 (65536). -SETUPSEG = DEF_SETUPSEG # 0x9020, this is the current segment - # ... and the former contents of CS - -DELTA_INITSEG = SETUPSEG - INITSEG # 0x0020 - -.code16 -.globl begtext, begdata, begbss, endtext, enddata, endbss - -.text -begtext: -.data -begdata: -.bss -begbss: -.text - -start: - jmp trampoline - -# This is the setup header, and it must start at %cs:2 (old 0x9020:2) - - .ascii "HdrS" # header signature - .word 0x0203 # header version number (>= 0x0105) - # or else old loadlin-1.5 will fail) -realmode_swtch: .word 0, 0 # default_switch, SETUPSEG -start_sys_seg: .word SYSSEG - .word kernel_version # pointing to kernel version string - # above section of header is compatible - # with loadlin-1.5 (header v1.5). Don't - # change it. - -type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin, - # Bootlin, SYSLX, bootsect...) - # See Documentation/i386/boot.txt for - # assigned ids - -# flags, unused bits must be zero (RFU) bit within loadflags -loadflags: -LOADED_HIGH = 1 # If set, the kernel is loaded high -CAN_USE_HEAP = 0x80 # If set, the loader also has set - # heap_end_ptr to tell how much - # space behind setup.S can be used for - # heap purposes. - # Only the loader knows what is free -#ifndef __BIG_KERNEL__ - .byte 0 -#else - .byte LOADED_HIGH -#endif - -setup_move_size: .word 0x8000 # size to move, when setup is not - # loaded at 0x90000. We will move setup - # to 0x90000 then just before jumping - # into the kernel. However, only the - # loader knows how much data behind - # us also needs to be loaded. - -code32_start: # here loaders can put a different - # start address for 32-bit code. -#ifndef __BIG_KERNEL__ - .long 0x1000 # 0x1000 = default for zImage -#else - .long 0x100000 # 0x100000 = default for big kernel -#endif - -ramdisk_image: .long 0 # address of loaded ramdisk image - # Here the loader puts the 32-bit - # address where it loaded the image. - # This only will be read by the kernel. - -ramdisk_size: .long 0 # its size in bytes - -bootsect_kludge: - .long 0 # obsolete - -heap_end_ptr: .word modelist+1024 # (Header version 0x0201 or later) - # space from here (exclusive) down to - # end of setup code can be used by setup - # for local heap purposes. - -pad1: .word 0 -cmd_line_ptr: .long 0 # (Header version 0x0202 or later) - # If nonzero, a 32-bit pointer - # to the kernel command line. - # The command line should be - # located between the start of - # setup and the end of low - # memory (0xa0000), or it may - # get overwritten before it - # gets read. If this field is - # used, there is no longer - # anything magical about the - # 0x90000 segment; the setup - # can be located anywhere in - # low memory 0x10000 or higher. - -ramdisk_max: .long MAXMEM-1 # (Header version 0x0203 or later) - # The highest safe address for - # the contents of an initrd - -trampoline: call start_of_setup - .space 1024 -# End of setup header ##################################################### - -start_of_setup: -# Set %ds = %cs, we know that SETUPSEG = %cs at this point - movw %cs, %ax # aka SETUPSEG - movw %ax, %ds -# Check signature at end of setup - cmpw $SIG1, setup_sig1 - jne bad_sig - - cmpw $SIG2, setup_sig2 - jne bad_sig - - jmp good_sig1 - -# Routine to print asciiz string at ds:si -prtstr: - lodsb - andb %al, %al - jz fin - - call prtchr - jmp prtstr - -fin: ret - -no_sig_mess: .string "No setup signature found ..." - -good_sig1: - jmp good_sig - -# We now have to find the rest of the setup code/data -bad_sig: - movw %cs, %ax # SETUPSEG - subw $DELTA_INITSEG, %ax # INITSEG - movw %ax, %ds - xorb %bh, %bh - movb (497), %bl # get setup sect from bootsect - subw $4, %bx # LILO loads 4 sectors of setup - shlw $8, %bx # convert to words (1sect=2^8 words) - movw %bx, %cx - shrw $3, %bx # convert to segment - addw $SYSSEG, %bx - movw %bx, %cs:start_sys_seg -# Move rest of setup code/data to here - movw $2048, %di # four sectors loaded by LILO - subw %si, %si - pushw %cs - popw %es - movw $SYSSEG, %ax - movw %ax, %ds - rep - movsw - movw %cs, %ax # aka SETUPSEG - movw %ax, %ds - cmpw $SIG1, setup_sig1 - jne no_sig - - cmpw $SIG2, setup_sig2 - jne no_sig - - jmp good_sig - -no_sig: - lea no_sig_mess, %si - call prtstr - -no_sig_loop: - hlt - jmp no_sig_loop - -good_sig: - movw %cs, %ax # aka SETUPSEG - subw $DELTA_INITSEG, %ax # aka INITSEG - movw %ax, %ds -# Check if an old loader tries to load a big-kernel - testb $LOADED_HIGH, %cs:loadflags # Do we have a big kernel? - jz loader_ok # No, no danger for old loaders. - - cmpb $0, %cs:type_of_loader # Do we have a loader that - # can deal with us? - jnz loader_ok # Yes, continue. - - pushw %cs # No, we have an old loader, - popw %ds # die. - lea loader_panic_mess, %si - call prtstr - - jmp no_sig_loop - -loader_panic_mess: .string "Wrong loader, giving up..." - -loader_ok: -# Get memory size (extended mem, kB) - -# On PC-9800, memory size detection is done completely in 32-bit -# kernel initialize code (kernel/setup.c). - pushw %es - xorl %eax, %eax - movw %ax, %es - movb %al, (E820NR) # PC-9800 has no E820 - movb %es:(0x401), %al - shll $7, %eax - addw $1024, %ax - movw %ax, (2) - movl %eax, (0x1e0) - movw %es:(0x594), %ax - shll $10, %eax - addl %eax, (0x1e0) - popw %es - -# Check for video adapter and its parameters and allow the -# user to browse video modes. - call video # NOTE: we need %ds pointing - # to bootsector - -# Get text video mode - movb $0x0B, %ah - int $0x18 # CRT mode sense - movw $(20 << 8) + 40, %cx - testb $0x10, %al - jnz 3f - movb $20, %ch - testb $0x01, %al - jnz 1f - movb $25, %ch - jmp 1f -3: # If bit 4 was 1, it means either 1) 31 lines for hi-reso mode, - # or 2) 30 lines for PC-9821. - movb $31, %ch # hireso mode value - pushw $0 - popw %es - testb $0x08, %es:BIOS_FLAG - jnz 1f - movb $30, %ch -1: # Now we got # of rows in %ch - movb %ch, (14) - - testb $0x02, %al - jnz 2f - movb $80, %cl -2: # Now we got # of columns in %cl - movb %cl, (7) - - # Next, get horizontal frequency if supported - movw $0x3100, %ax - int $0x18 # Call CRT bios - movb %al, (6) # If 31h is unsupported, %al remains 0 - -# Get hd0-3 data... - pushw %ds # aka INITSEG - popw %es - xorw %ax, %ax - movw %ax, %ds - cld - movw $0x0080, %di - movb DISK_EQUIP+1, %ah - movb $0x80, %al - -get_hd_info: - shrb %ah - pushw %ax - jnc 1f - movb $0x84, %ah - int $0x1b - jnc 2f # Success -1: xorw %cx, %cx # `0 cylinders' means no drive -2: # Attention! Work area (drive_info) is arranged for PC-9800. - movw %cx, %ax # # of cylinders - stosw - movw %dx, %ax # # of sectors / # of heads - stosw - movw %bx, %ax # sector size in bytes - stosw - popw %ax - incb %al - cmpb $0x84, %al - jb get_hd_info - -# Get fd data... - movw DISK_EQUIP, %ax - andw $0xf00f, %ax - orb %al, %ah - movb RDISK_EQUIP, %al - notb %al - andb %al, %ah # ignore all `RAM drive' - - movb $0x30, %al - -get_fd_info: - shrb %ah - pushw %ax - jnc 1f - movb $0xc4, %ah - int $0x1b - movb %ah, %al - andb $4, %al # 1.44MB support flag - shrb %al - addb $2, %al # %al = 2 (1.2MB) or 4 (1.44MB) - jmp 2f -1: movb $0, %al # no drive -2: stosb - popw %ax - incb %al - testb $0x04, %al - jz get_fd_info - - addb $(0xb0 - 0x34), %al - jnc get_fd_info # check FDs on 640KB I/F - - pushw %es - popw %ds # %ds got bootsector again -#if 0 - mov $0, (0x1ff) # default is no pointing device -#endif - -#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) -# Then check for an APM BIOS... - # %ds points to the bootsector - movw $0, 0x40 # version = 0 means no APM BIOS - movw $0x09a00, %ax # APM BIOS installation check - xorw %bx, %bx - int $0x1f - jc done_apm_bios # Nope, no APM BIOS - - cmpw $0x0504d, %bx # Check for "PM" signature - jne done_apm_bios # No signature, no APM BIOS - - testb $0x02, %cl # Is 32 bit supported? - je done_apm_bios # No 32-bit, no (good) APM BIOS - - movw $0x09a04, %ax # Disconnect first just in case - xorw %bx, %bx - int $0x1f # ignore return code - movw $0x09a03, %ax # 32 bit connect - xorl %ebx, %ebx - int $0x1f - jc no_32_apm_bios # Ack, error. - - movw %ax, (66) # BIOS code segment - movl %ebx, (68) # BIOS entry point offset - movw %cx, (72) # BIOS 16 bit code segment - movw %dx, (74) # BIOS data segment - movl %esi, (78) # BIOS code segment length - movw %di, (82) # BIOS data segment length -# Redo the installation check as the 32 bit connect -# modifies the flags returned on some BIOSs - movw $0x09a00, %ax # APM BIOS installation check - xorw %bx, %bx - int $0x1f - jc apm_disconnect # error -> shouldn't happen - - cmpw $0x0504d, %bx # check for "PM" signature - jne apm_disconnect # no sig -> shouldn't happen - - movw %ax, (64) # record the APM BIOS version - movw %cx, (76) # and flags - jmp done_apm_bios - -apm_disconnect: # Tidy up - movw $0x09a04, %ax # Disconnect - xorw %bx, %bx - int $0x1f # ignore return code - - jmp done_apm_bios - -no_32_apm_bios: - andw $0xfffd, (76) # remove 32 bit support bit -done_apm_bios: -#endif - -# Pass cursor position to kernel... - movw %cs:cursor_address, %ax - shrw %ax # cursor_address is 2 bytes unit - movb $80, %cl - divb %cl - xchgb %al, %ah # (0) = %al = X, (1) = %ah = Y - movw %ax, (0) - -#if 0 - movw $msg_cpos, %si - call prtstr_cs - call prthex - call prtstr_cs - movw %ds, %ax - call prthex - call prtstr_cs - movb $0x11, %ah - int $0x18 - movb $0, %ah - int $0x18 - .section .rodata, "a" -msg_cpos: .string "Cursor position: 0x" - .string ", %ds:0x" - .string "\r\n" - .previous -#endif - -# Now we want to move to protected mode ... - cmpw $0, %cs:realmode_swtch - jz rmodeswtch_normal - - lcall *%cs:realmode_swtch - - jmp rmodeswtch_end - -rmodeswtch_normal: - pushw %cs - call default_switch - -rmodeswtch_end: -# we get the code32 start address and modify the below 'jmpi' -# (loader may have changed it) - movl %cs:code32_start, %eax - movl %eax, %cs:code32 - -# Now we move the system to its rightful place ... but we check if we have a -# big-kernel. In that case we *must* not move it ... - testb $LOADED_HIGH, %cs:loadflags - jz do_move0 # .. then we have a normal low - # loaded zImage - # .. or else we have a high - # loaded bzImage - jmp end_move # ... and we skip moving - -do_move0: - movw $0x100, %ax # start of destination segment - movw %cs, %bp # aka SETUPSEG - subw $DELTA_INITSEG, %bp # aka INITSEG - movw %cs:start_sys_seg, %bx # start of source segment - cld -do_move: - movw %ax, %es # destination segment - incb %ah # instead of add ax,#0x100 - movw %bx, %ds # source segment - addw $0x100, %bx - subw %di, %di - subw %si, %si - movw $0x800, %cx - rep - movsw - cmpw %bp, %bx # assume start_sys_seg > 0x200, - # so we will perhaps read one - # page more than needed, but - # never overwrite INITSEG - # because destination is a - # minimum one page below source - jb do_move - -end_move: -# then we load the segment descriptors - movw %cs, %ax # aka SETUPSEG - movw %ax, %ds - -# Check whether we need to be downward compatible with version <=201 - cmpl $0, cmd_line_ptr - jne end_move_self # loader uses version >=202 features - cmpb $0x20, type_of_loader - je end_move_self # bootsect loader, we know of it - -# Boot loader does not support boot protocol version 2.02. -# If we have our code not at 0x90000, we need to move it there now. -# We also then need to move the params behind it (commandline) -# Because we would overwrite the code on the current IP, we move -# it in two steps, jumping high after the first one. - movw %cs, %ax - cmpw $SETUPSEG, %ax - je end_move_self - - cli # make sure we really have - # interrupts disabled ! - # because after this the stack - # should not be used - subw $DELTA_INITSEG, %ax # aka INITSEG - movw %ss, %dx - cmpw %ax, %dx - jb move_self_1 - - addw $INITSEG, %dx - subw %ax, %dx # this will go into %ss after - # the move -move_self_1: - movw %ax, %ds - movw $INITSEG, %ax # real INITSEG - movw %ax, %es - movw %cs:setup_move_size, %cx - std # we have to move up, so we use - # direction down because the - # areas may overlap - movw %cx, %di - decw %di - movw %di, %si - subw $move_self_here+0x200, %cx - rep - movsb - ljmp $SETUPSEG, $move_self_here - -move_self_here: - movw $move_self_here+0x200, %cx - rep - movsb - movw $SETUPSEG, %ax - movw %ax, %ds - movw %dx, %ss - -end_move_self: # now we are at the right place - lidt idt_48 # load idt with 0,0 - xorl %eax, %eax # Compute gdt_base - movw %ds, %ax # (Convert %ds:gdt to a linear ptr) - shll $4, %eax - addl $gdt, %eax - movl %eax, (gdt_48+2) - lgdt gdt_48 # load gdt with whatever is - # appropriate - -# that was painless, now we enable A20 - - outb %al, $0xf2 # A20 on - movb $0x02, %al - outb %al, $0xf6 # also A20 on; making ITF's - # way our model - - # PC-9800 seems to enable A20 at the moment of `outb'; - # so we don't wait unlike IBM PCs (see ../setup.S). - -# enable DMA to access memory over 0x100000 (1MB). - - movw $0x439, %dx - inb %dx, %al - andb $(~4), %al - outb %al, %dx - -# Set DMA to increment its bank address automatically at 16MB boundary. -# Initial setting is 64KB boundary mode so that we can't run DMA crossing -# physical address 0xXXXXFFFF. - - movb $0x0c, %al - outb %al, $0x29 # ch. 0 - movb $0x0d, %al - outb %al, $0x29 # ch. 1 - movb $0x0e, %al - outb %al, $0x29 # ch. 2 - movb $0x0f, %al - outb %al, $0x29 # ch. 3 - movb $0x50, %al - outb %al, $0x11 # reinitialize DMAC - -# make sure any possible coprocessor is properly reset.. - movb $0, %al - outb %al, $0xf8 - outb %al, $0x5f # delay - -# well, that went ok, I hope. Now we mask all interrupts - the rest -# is done in init_IRQ(). - movb $0xFF, %al # mask all interrupts for now - outb %al, $0x0A - outb %al, $0x5f # delay - - movb $0x7F, %al # mask all irq's but irq7 which - outb %al, $0x02 # is cascaded - -# Well, that certainly wasn't fun :-(. Hopefully it works, and we don't -# need no steenking BIOS anyway (except for the initial loading :-). -# The BIOS-routine wants lots of unnecessary data, and it's less -# "interesting" anyway. This is how REAL programmers do it. -# -# Well, now's the time to actually move into protected mode. To make -# things as simple as possible, we do no register set-up or anything, -# we let the gnu-compiled 32-bit programs do that. We just jump to -# absolute address 0x1000 (or the loader supplied one), -# in 32-bit protected mode. -# -# Note that the short jump isn't strictly needed, although there are -# reasons why it might be a good idea. It won't hurt in any case. - movw $1, %ax # protected mode (PE) bit - lmsw %ax # This is it! - jmp flush_instr - -flush_instr: - xorw %bx, %bx # Flag to indicate a boot - xorl %esi, %esi # Pointer to real-mode code - movw %cs, %si - subw $DELTA_INITSEG, %si - shll $4, %esi # Convert to 32-bit pointer -# NOTE: For high loaded big kernels we need a -# jmpi 0x100000,__BOOT_CS -# -# but we yet haven't reloaded the CS register, so the default size -# of the target offset still is 16 bit. -# However, using an operand prefix (0x66), the CPU will properly -# take our 48 bit far pointer. (INTeL 80386 Programmer's Reference -# Manual, Mixing 16-bit and 32-bit code, page 16-6) - - .byte 0x66, 0xea # prefix + jmpi-opcode -code32: .long 0x1000 # will be set to 0x100000 - # for big kernels - .word __BOOT_CS - -# Here's a bunch of information about your current kernel.. -kernel_version: .ascii UTS_RELEASE - .ascii " (" - .ascii LINUX_COMPILE_BY - .ascii "@" - .ascii LINUX_COMPILE_HOST - .ascii ") " - .ascii UTS_VERSION - .byte 0 - -# This is the default real mode switch routine. -# to be called just before protected mode transition -default_switch: - cli # no interrupts allowed ! - outb %al, $0x50 # disable NMI for bootup - # sequence - lret - - -# This routine prints one character (in %al) on console. -# PC-9800 doesn't have BIOS-function to do it like IBM PC's INT 10h - 0Eh, -# so we hardcode `prtchr' subroutine here. -prtchr: - pushaw - pushw %es - cmpb $0, %cs:prtchr_initialized - jnz prtchr_ok - xorw %cx, %cx - movw %cx, %es - testb $0x8, %es:BIOS_FLAG - jz 1f - movb $(HIRESO_TEXT >> 8), %cs:cursor_address+3 - movw $(80 * 31 * 2), %cs:max_cursor_offset -1: pushw %ax - call get_cursor_position - movw %ax, %cs:cursor_address - popw %ax - movb $1, %cs:prtchr_initialized -prtchr_ok: - lesw %cs:cursor_address, %di - movw $160, %bx - movb $0, %ah - cmpb $13, %al - je do_cr - cmpb $10, %al - je do_lf - - # normal (printable) character - stosw - movb $0xe1, %es:0x2000-2(%di) - jmp 1f - -do_cr: movw %di, %ax - divb %bl # %al = Y, %ah = X * 2 - mulb %bl - movw %ax, %dx - jmp 2f - -do_lf: addw %bx, %di -1: movw %cs:max_cursor_offset, %cx - cmpw %cx, %di - movw %di, %dx - jb 2f - # cursor reaches bottom of screen; scroll it - subw %bx, %dx - xorw %di, %di - movw %bx, %si - cld - subw %bx, %cx - shrw %cx - pushw %cx - rep; es; movsw - movb $32, %al # clear bottom line characters - movb $80, %cl - rep; stosw - movw $0x2000, %di - popw %cx - leaw (%bx,%di), %si - rep; es; movsw - movb $0xe1, %al # clear bottom line attributes - movb $80, %cl - rep; stosw -2: movw %dx, %cs:cursor_address - movb $0x13, %ah # move cursor to right position - int $0x18 - popw %es - popaw - ret - -cursor_address: - .word 0 - .word NORMAL_TEXT -max_cursor_offset: - .word 80 * 25 * 2 # for normal 80x25 mode - -# putstr may called without running through start_of_setup (via bootsect_panic) -# so we should initialize ourselves on demand. -prtchr_initialized: - .byte 0 - -# This routine queries GDC (graphic display controller) for current cursor -# position. Cursor position is returned in %ax (CPU offset address). -get_cursor_position: -1: inb $0x60, %al - outb %al, $0x5f # delay - outb %al, $0x5f # delay - testb $0x04, %al # Is FIFO empty? - jz 1b # no -> wait until empty - - movb $0xe0, %al # CSRR command - outb %al, $0x62 # command write - outb %al, $0x5f # delay - outb %al, $0x5f # delay - -2: inb $0x60, %al - outb %al, $0x5f # delay - outb %al, $0x5f # delay - testb $0x01, %al # Is DATA READY? - jz 2b # no -> wait until ready - - inb $0x62, %al # read xAD (L) - outb %al, $0x5f # delay - outb %al, $0x5f # delay - movb %al, %ah - inb $0x62, %al # read xAD (H) - outb %al, $0x5f # delay - outb %al, $0x5f # delay - xchgb %al, %ah # correct byte order - pushw %ax - inb $0x62, %al # read yAD (L) - outb %al, $0x5f # delay - outb %al, $0x5f # delay - inb $0x62, %al # read yAD (M) - outb %al, $0x5f # delay - outb %al, $0x5f # delay - inb $0x62, %al # read yAD (H) - # yAD is not our interest, - # so discard it. - popw %ax - addw %ax, %ax # convert to CPU address - ret - -# Descriptor tables -# -# NOTE: The intel manual says gdt should be sixteen bytes aligned for -# efficiency reasons. However, there are machines which are known not -# to boot with misaligned GDTs, so alter this at your peril! If you alter -# GDT_ENTRY_BOOT_CS (in asm/segment.h) remember to leave at least two -# empty GDT entries (one for NULL and one reserved). -# -# NOTE: On some CPUs, the GDT must be 8 byte aligned. This is -# true for the Voyager Quad CPU card which will not boot without -# This directive. 16 byte aligment is recommended by intel. -# - .align 16 -gdt: - .fill GDT_ENTRY_BOOT_CS,8,0 - - .word 0xFFFF # 4Gb - (0x100000*0x1000 = 4Gb) - .word 0 # base address = 0 - .word 0x9A00 # code read/exec - .word 0x00CF # granularity = 4096, 386 - # (+5th nibble of limit) - - .word 0xFFFF # 4Gb - (0x100000*0x1000 = 4Gb) - .word 0 # base address = 0 - .word 0x9200 # data read/write - .word 0x00CF # granularity = 4096, 386 - # (+5th nibble of limit) -gdt_end: - .align 4 - - .word 0 # alignment byte -idt_48: - .word 0 # idt limit = 0 - .word 0, 0 # idt base = 0L - - .word 0 # alignment byte -gdt_48: - .word gdt_end - gdt - 1 # gdt limit - .word 0, 0 # gdt base (filled in later) - -# Include video setup & detection code - -#include "video.S" - -# Setup signature -- must be last -setup_sig1: .word SIG1 -setup_sig2: .word SIG2 - -# After this point, there is some free space which is used by the video mode -# handling code to store the temporary mode table (not used by the kernel). - -modelist: - -.text -endtext: -.data -enddata: -.bss -endbss: diff -Nru a/arch/i386/boot98/video.S b/arch/i386/boot98/video.S --- a/arch/i386/boot98/video.S 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,262 +0,0 @@ -/* video.S - * - * Video mode setup, etc. for NEC PC-9800 series. - * - * Copyright (C) 1997,98,99 Linux/98 project - * - * Based on the video.S for IBM PC: - * copyright (C) Martin Mares - */ - -/* Positions of various video parameters passed to the kernel */ -/* (see also include/linux/tty.h) */ -#define PARAM_CURSOR_POS 0x00 -#define PARAM_VIDEO_PAGE 0x04 -#define PARAM_VIDEO_MODE 0x06 -#define PARAM_VIDEO_COLS 0x07 -#define PARAM_VIDEO_EGA_BX 0x0a -#define PARAM_VIDEO_LINES 0x0e -#define PARAM_HAVE_VGA 0x0f -#define PARAM_FONT_POINTS 0x10 - -#define PARAM_VIDEO98_COMPAT 0x0a -#define PARAM_VIDEO98_HIRESO 0x0b -#define PARAM_VIDEO98_MACHTYPE 0x0c -#define PARAM_VIDEO98_LINES 0x0e -#define PARAM_VIDEO98_COLS 0x0f - -# PARAM_LFB_* and PARAM_VESAPM_* are unused on PC-9800. - -# This is the main entry point called by setup.S -# %ds *must* be pointing to the bootsector -video: xorw %ax, %ax - movw %ax, %es # %es = 0 - - movb %es:BIOS_FLAG, %al - movb %al, PARAM_VIDEO_MODE - - movb $0, PARAM_VIDEO98_HIRESO # 0 = normal - movw $NORMAL_TEXT, PARAM_VIDEO_PAGE - testb $0x8, %al - movw $(80 * 256 + 25), %ax - jz 1f - # hireso machine. - movb $1, PARAM_VIDEO98_HIRESO # !0 = hi-reso - movb $(HIRESO_TEXT >> 8), PARAM_VIDEO_PAGE + 1 - movw $(80 * 256 + 31), %ax -1: movw %ax, PARAM_VIDEO98_LINES # also sets VIDEO98_COLS - - movb $0xc0, %ch # 400-line graphic mode - movb $0x42, %ah - int $0x18 - - movw $80, PARAM_VIDEO_COLS - - movw $msg_probing, %si - call prtstr_cs - -# Check vendor from font pattern of `A'... - -1: inb $0x60, %al # wait V-sync - testb $0x20, %al - jnz 1b -2: inb $0x60, %al - testb $0x20, %al - jz 2b - - movb $0x00, %al # select font of `A' - outb %al, $0xa1 - movb $0x41, %al - outb %al, $0xa3 - - movw $8, %cx - movw PARAM_VIDEO_PAGE, %ax - cmpw $NORMAL_TEXT, %ax - je 3f - movb $24, %cl # for hi-reso machine -3: addw $0x400, %ax # %ax = CG window segment - pushw %ds - movw %ax, %ds - xorw %dx, %dx # get sum of `A' pattern... - xorw %si, %si -4: lodsw - addw %ax, %dx - loop 4b - popw %ds - - movw %dx, %ax - movw $msg_nec, %si - xorw %bx, %bx # vendor info will go into %bx - testb $8, %es:BIOS_FLAG - jnz check_hireso_vendor - cmpw $0xc7f8, %ax - je 5f - jmp 6f -check_hireso_vendor: - cmpw $0x9639, %ax # XXX: NOT VERIFIED!!! - je 5f -6: incw %bx # compatible machine - movw $msg_compat, %si -5: movb %bl, PARAM_VIDEO98_COMPAT - call prtstr_cs - - movw $msg_fontdata, %si - call prtstr_cs # " (CG sum of A = 0x" - movw %dx, %ax - call prthex - call prtstr_cs # ") PC-98" - - movb $'0', %al - pushw %ds - pushw $0xf8e8 - popw %ds - cmpw $0x2198, (0) - popw %ds - jne 7f - movb $'2', %al -7: call prtchr - call prtstr_cs # "1 " - - movb $0, PARAM_VIDEO98_MACHTYPE -#if 0 /* XXX - This check is bogus? [0000:BIOS_FLAG2]-bit7 does NOT - indicate whether it is a note machine, but merely indicates - whether it has ``RAM drive''. */ -# check note machine - testb $0x80, %es:BIOS_FLAG2 - jnz is_note - pushw %ds - pushw $0xfd80 - popw %ds - movb (4), %al - popw %ds - cmpb $0x20, %al # EPSON note A - je epson_note - cmpb $0x22, %al # EPSON note W - je epson_note - cmpb $0x27, %al # EPSON note AE - je epson_note - cmpb $0x2a, %al # EPSON note WR - jne note_done -epson_note: - movb $1, PARAM_VIDEO98_MACHTYPE - movw $msg_note, %si - call prtstr_cs -note_done: -#endif - -# print h98 ? (only NEC) - cmpb $0, PARAM_VIDEO98_COMPAT - jnz 8f # not NEC -> not H98 - - testb $0x80, %es:BIOS_FLAG5 - jz 8f # have NESA bus -> H98 - movw $msg_h98, %si - call prtstr_cs - orb $2, PARAM_VIDEO98_MACHTYPE -8: testb $0x40, %es:BIOS_FLAG5 - jz 9f - movw $msg_gs, %si - call prtstr_cs # only prints it :-) -9: - movw $msg_normal, %si # "normal" - testb $0x8, %es:BIOS_FLAG - jz 1f - movw $msg_hireso, %si -1: call prtstr_cs - - movw $msg_sysclk, %si - call prtstr_cs - movb $'5', %al - testb $0x80, %es:BIOS_FLAG - jz 2f - movb $'8', %al -2: call prtchr - call prtstr_cs - -#if 0 - testb $0x40, %es:(0x45c) - jz no_30line # no 30-line support - - movb %es:KB_SHFT_STS, %al - testb $0x01, %al # is SHIFT key pressed? - jz no_30line - - testb $0x10, %al # is CTRL key pressed? - jnz line40 - - # switch to 30-line mode - movb $30, PARAM_VIDEO98_LINES - movw $msg_30line, %si - jmp 3f - -line40: - movb $37, PARAM_VIDEO98_LINES - movw $40, PARAM_VIDEO_LINES - movw $msg_40line, %si -3: call prtstr_cs - - movb $0x32, %bh - movw $0x300c, %ax - int $0x18 # switch video mode - movb $0x0c, %ah - int $0x18 # turn on text plane - movw %cs:cursor_address, %dx - movb $0x13, %ah - int $0x18 # move cursor to correct place - mov $0x11, %ah - int $0x18 # turn on text plane - - call prtstr_cs # "Ok.\r\n" -no_30line: -#endif - ret - -prtstr_cs: - pushw %ds - pushw %cs - popw %ds - call prtstr - popw %ds - ret - -# prthex is for debugging purposes, and prints %ax in hexadecimal. -prthex: pushw %cx - movw $4, %cx -1: rolw $4, %ax - pushw %ax - andb $0xf, %al - cmpb $10, %al - sbbb $0x69, %al - das - call prtchr - popw %ax - loop 1b - popw %cx - ret - -msg_probing: .string "Probing machine: " - -msg_nec: .string "NEC" -msg_compat: .string "compatible" - -msg_fontdata: .string " (CG sum of A = 0x" - .string ") PC-98" - .string "1 " - -msg_gs: .string "(GS) " -msg_h98: .string "(H98) " - -msg_normal: .string "normal" -msg_hireso: .string "Hi-reso" - -msg_sysclk: .string " mode, system clock " - .string "MHz\r\n" - -#if 0 -msg_40line: # cpp will concat following lines, so the assembler can deal. - .ascii "\ -Video mode will be adjusted to 37-line (so-called ``40-line'') mode later.\r\n\ -THIS MODE MAY DAMAGE YOUR MONITOR PHYSICALLY. USE AT YOUR OWN RISK.\r\n" -msg_30line: .string "Switching video mode to 30-line (640x480) mode... " - .string "Ok.\r\n" -#endif diff -Nru a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile --- a/arch/i386/kernel/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/Makefile 2004-06-23 19:04:25 -07:00 @@ -31,7 +31,6 @@ obj-$(CONFIG_HPET_TIMER) += time_hpet.o obj-$(CONFIG_EFI) += efi.o efi_stub.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o -obj-$(CONFIG_X86_STD_RESOURCES) += std_resources.o EXTRA_AFLAGS := -traditional diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c --- a/arch/i386/kernel/acpi/boot.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/kernel/acpi/boot.c 2004-06-23 19:04:28 -07:00 @@ -28,7 +28,9 @@ #include #include #include -#include +#include + +#include #include #include #include @@ -436,6 +438,38 @@ *irq = gsi; return 0; } + +unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) +{ + unsigned int irq; + +#ifdef CONFIG_PCI + /* + * Make sure all (legacy) PCI IRQs are set as level-triggered. + */ + if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) { + static u16 irq_mask; + extern void eisa_set_level_irq(unsigned int irq); + + if (edge_level == ACPI_LEVEL_SENSITIVE) { + if ((gsi < 16) && !((1 << gsi) & irq_mask)) { + Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi); + irq_mask |= (1 << gsi); + eisa_set_level_irq(gsi); + } + } + } +#endif + +#ifdef CONFIG_X86_IO_APIC + if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) { + mp_register_gsi(gsi, edge_level, active_high_low); + } +#endif + acpi_gsi_to_irq(gsi, &irq); + return irq; +} +EXPORT_SYMBOL(acpi_register_gsi); static unsigned long __init acpi_scan_rsdp ( diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c --- a/arch/i386/kernel/apic.c 2004-06-23 19:04:29 -07:00 +++ b/arch/i386/kernel/apic.c 2004-06-23 19:04:29 -07:00 @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -79,6 +78,17 @@ if (!APIC_INTEGRATED(ver)) /* 82489DX */ v |= APIC_LVT_LEVEL_TRIGGER; apic_write_around(APIC_LVT0, v); +} + +int get_physical_broadcast(void) +{ + unsigned int lvr, version; + lvr = apic_read(APIC_LVR); + version = GET_APIC_VERSION(lvr); + if (version >= 0x14) + return 0xff; + else + return 0xf; } int get_maxlvt(void) diff -Nru a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c --- a/arch/i386/kernel/cpuid.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/cpuid.c 2004-06-23 19:04:25 -07:00 @@ -36,12 +36,17 @@ #include #include #include +#include +#include +#include #include #include #include #include +static struct class_simple *cpuid_class; + #ifdef CONFIG_SMP struct cpuid_command { @@ -153,20 +158,84 @@ .open = cpuid_open, }; +static int cpuid_class_simple_device_add(int i) +{ + int err = 0; + struct class_device *class_err; + + class_err = class_simple_device_add(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i); + if (IS_ERR(class_err)) + err = PTR_ERR(class_err); + return err; +} + +static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) +{ + unsigned int cpu = (unsigned long)hcpu; + + switch (action) { + case CPU_ONLINE: + cpuid_class_simple_device_add(cpu); + break; + case CPU_DEAD: + class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); + break; + } + return NOTIFY_OK; +} + +static struct notifier_block cpuid_class_cpu_notifier = +{ + .notifier_call = cpuid_class_cpu_callback, +}; + int __init cpuid_init(void) { + int i, err = 0; + i = 0; + if (register_chrdev(CPUID_MAJOR, "cpu/cpuid", &cpuid_fops)) { printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n", CPUID_MAJOR); - return -EBUSY; + err = -EBUSY; + goto out; + } + cpuid_class = class_simple_create(THIS_MODULE, "cpuid"); + if (IS_ERR(cpuid_class)) { + err = PTR_ERR(cpuid_class); + goto out_chrdev; } + for_each_online_cpu(i) { + err = cpuid_class_simple_device_add(i); + if (err != 0) + goto out_class; + } + register_cpu_notifier(&cpuid_class_cpu_notifier); - return 0; + err = 0; + goto out; + +out_class: + i = 0; + for_each_online_cpu(i) { + class_simple_device_remove(MKDEV(CPUID_MAJOR, i)); + } + class_simple_destroy(cpuid_class); +out_chrdev: + unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); +out: + return err; } void __exit cpuid_exit(void) { + int cpu = 0; + + for_each_online_cpu(cpu) + class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); + class_simple_destroy(cpuid_class); unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); + unregister_cpu_notifier(&cpuid_class_cpu_notifier); } module_init(cpuid_init); diff -Nru a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c --- a/arch/i386/kernel/dmi_scan.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/kernel/dmi_scan.c 2004-06-23 19:04:26 -07:00 @@ -10,6 +10,7 @@ #include #include #include +#include #include unsigned long dmi_broken; @@ -139,21 +140,6 @@ return -1; } - -enum -{ - DMI_BIOS_VENDOR, - DMI_BIOS_VERSION, - DMI_BIOS_DATE, - DMI_SYS_VENDOR, - DMI_PRODUCT_NAME, - DMI_PRODUCT_VERSION, - DMI_BOARD_VENDOR, - DMI_BOARD_NAME, - DMI_BOARD_VERSION, - DMI_STRING_MAX -}; - static char *dmi_ident[DMI_STRING_MAX]; /* @@ -176,26 +162,11 @@ } /* - * DMI callbacks for problem boards + * Ugly compatibility crap. */ - -struct dmi_strmatch -{ - u8 slot; - char *substr; -}; - -#define NONE 255 - -struct dmi_blacklist -{ - int (*callback)(struct dmi_blacklist *); - char *ident; - struct dmi_strmatch matches[4]; -}; - -#define NO_MATCH { NONE, NULL} -#define MATCH(a,b) { a, b } +#define dmi_blacklist dmi_system_id +#define NO_MATCH { DMI_NONE, NULL} +#define MATCH DMI_MATCH /* * Reboot options and system auto-detection code provided by @@ -343,23 +314,6 @@ } /* - * Work around broken HP Pavilion Notebooks which assign USB to - * IRQ 9 even though it is actually wired to IRQ 11 - */ -static __init int fix_broken_hp_bios_irq9(struct dmi_blacklist *d) -{ -#ifdef CONFIG_PCI - extern int broken_hp_bios_irq9; - if (broken_hp_bios_irq9 == 0) - { - broken_hp_bios_irq9 = 1; - printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", d->ident); - } -#endif - return 0; -} - -/* * Check for clue free BIOS implementations who use * the following QA technique * @@ -546,15 +500,21 @@ #ifdef CONFIG_ACPI_PCI static __init int disable_acpi_irq(struct dmi_blacklist *d) -{ - printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n", d->ident); - acpi_noirq_set(); +{ + if (!acpi_force) { + printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n", + d->ident); + acpi_noirq_set(); + } return 0; } static __init int disable_acpi_pci(struct dmi_blacklist *d) -{ - printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", d->ident); - acpi_disable_pci(); +{ + if (!acpi_force) { + printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", + d->ident); + acpi_disable_pci(); + } return 0; } #endif @@ -839,14 +799,6 @@ NO_MATCH, NO_MATCH } }, - { fix_broken_hp_bios_irq9, "HP Pavilion N5400 Series Laptop", { - MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), - MATCH(DMI_BIOS_VERSION, "GE.M1.03"), - MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook Model GE"), - MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736") - } }, - - /* * Generic per vendor APM settings */ @@ -1048,9 +1000,6 @@ static __init void dmi_check_blacklist(void) { - struct dmi_blacklist *d; - int i; - #ifdef CONFIG_ACPI_BOOT #define ACPI_BLACKLIST_CUTOFF_YEAR 2001 @@ -1072,25 +1021,7 @@ } } #endif - - d=&dmi_blacklist[0]; - while(d->callback) - { - for(i=0;i<4;i++) - { - int s = d->matches[i].slot; - if(s==NONE) - continue; - if(dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr)) - continue; - /* No match */ - goto fail; - } - if(d->callback(d)) - return; -fail: - d++; - } + dmi_check_system(dmi_blacklist); } @@ -1157,3 +1088,52 @@ } EXPORT_SYMBOL(is_unsafe_smbus); + + +/** + * dmi_check_system - check system DMI data + * @list: array of dmi_system_id structures to match against + * + * Walk the blacklist table running matching functions until someone + * returns non zero or we hit the end. Callback function is called for + * each successfull match. Returns the number of matches. + */ +int dmi_check_system(struct dmi_system_id *list) +{ + int i, count = 0; + struct dmi_system_id *d = list; + + while (d->ident) { + for (i = 0; i < ARRAY_SIZE(d->matches); i++) { + int s = d->matches[i].slot; + if (s == DMI_NONE) + continue; + if (dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr)) + continue; + /* No match */ + goto fail; + } + if (d->callback && d->callback(d)) + break; + count++; +fail: d++; + } + + return count; +} + +EXPORT_SYMBOL(dmi_check_system); + +/** + * dmi_get_system_info - return DMI data value + * @field: data index (see enum dmi_filed) + * + * Returns one DMI data value, can be used to perform + * complex DMI data checks. + */ +char * dmi_get_system_info(int field) +{ + return dmi_ident[field]; +} + +EXPORT_SYMBOL(dmi_get_system_info); diff -Nru a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c --- a/arch/i386/kernel/efi.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/kernel/efi.c 2004-06-23 19:04:28 -07:00 @@ -37,7 +37,6 @@ #include #include #include -#include #include #define EFI_DEBUG 0 diff -Nru a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c --- a/arch/i386/kernel/i386_ksyms.c 2004-06-23 19:04:29 -07:00 +++ b/arch/i386/kernel/i386_ksyms.c 2004-06-23 19:04:29 -07:00 @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff -Nru a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c --- a/arch/i386/kernel/i8259.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/kernel/i8259.c 2004-06-23 19:04:28 -07:00 @@ -317,16 +317,11 @@ * be shot. */ -/* - * =PC9800NOTE= In NEC PC-9800, we use irq8 instead of irq13! - */ static irqreturn_t math_error_irq(int cpl, void *dev_id, struct pt_regs *regs) { extern void math_error(void *); -#ifndef CONFIG_X86_PC9800 outb(0,0xF0); -#endif if (ignore_fpu_irq || !boot_cpu_data.hard_math) return IRQ_NONE; math_error((void *)regs->eip); diff -Nru a/arch/i386/kernel/init_task.c b/arch/i386/kernel/init_task.c --- a/arch/i386/kernel/init_task.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/kernel/init_task.c 2004-06-23 19:04:28 -07:00 @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c --- a/arch/i386/kernel/io_apic.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/kernel/io_apic.c 2004-06-23 19:04:26 -07:00 @@ -41,10 +41,6 @@ #include "io_ports.h" -#undef APIC_LOCKUP_DEBUG - -#define APIC_LOCKUP_DEBUG - static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED; /* @@ -127,83 +123,47 @@ } } -/* mask = 1 */ -static void __mask_IO_APIC_irq (unsigned int irq) +static void __modify_IO_APIC_irq (unsigned int irq, unsigned long enable, unsigned long disable) { - int pin; struct irq_pin_list *entry = irq_2_pin + irq; + unsigned int pin, reg; for (;;) { - unsigned int reg; pin = entry->pin; if (pin == -1) break; reg = io_apic_read(entry->apic, 0x10 + pin*2); - io_apic_modify(entry->apic, 0x10 + pin*2, reg |= 0x00010000); + reg &= ~disable; + reg |= enable; + io_apic_modify(entry->apic, 0x10 + pin*2, reg); if (!entry->next) break; entry = irq_2_pin + entry->next; } - io_apic_sync(entry->apic); +} + +/* mask = 1 */ +static void __mask_IO_APIC_irq (unsigned int irq) +{ + __modify_IO_APIC_irq(irq, 0x00010000, 0); } /* mask = 0 */ static void __unmask_IO_APIC_irq (unsigned int irq) { - int pin; - struct irq_pin_list *entry = irq_2_pin + irq; - - for (;;) { - unsigned int reg; - pin = entry->pin; - if (pin == -1) - break; - reg = io_apic_read(entry->apic, 0x10 + pin*2); - io_apic_modify(entry->apic, 0x10 + pin*2, reg &= 0xfffeffff); - if (!entry->next) - break; - entry = irq_2_pin + entry->next; - } + __modify_IO_APIC_irq(irq, 0, 0x00010000); } /* mask = 1, trigger = 0 */ static void __mask_and_edge_IO_APIC_irq (unsigned int irq) { - int pin; - struct irq_pin_list *entry = irq_2_pin + irq; - - for (;;) { - unsigned int reg; - pin = entry->pin; - if (pin == -1) - break; - reg = io_apic_read(entry->apic, 0x10 + pin*2); - reg = (reg & 0xffff7fff) | 0x00010000; - io_apic_modify(entry->apic, 0x10 + pin*2, reg); - if (!entry->next) - break; - entry = irq_2_pin + entry->next; - } + __modify_IO_APIC_irq(irq, 0x00010000, 0x00008000); } /* mask = 0, trigger = 1 */ static void __unmask_and_level_IO_APIC_irq (unsigned int irq) { - int pin; - struct irq_pin_list *entry = irq_2_pin + irq; - - for (;;) { - unsigned int reg; - pin = entry->pin; - if (pin == -1) - break; - reg = io_apic_read(entry->apic, 0x10 + pin*2); - reg = (reg & 0xfffeffff) | 0x00008000; - io_apic_modify(entry->apic, 0x10 + pin*2, reg); - if (!entry->next) - break; - entry = irq_2_pin + entry->next; - } + __modify_IO_APIC_irq(irq, 0x00008000, 0x00010000); } static void mask_IO_APIC_irq (unsigned int irq) @@ -1366,7 +1326,7 @@ printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); printk(KERN_DEBUG "....... : Delivery Type: %X\n", reg_00.bits.delivery_type); printk(KERN_DEBUG "....... : LTS : %X\n", reg_00.bits.LTS); - if (reg_00.bits.ID >= APIC_BROADCAST_ID) + if (reg_00.bits.ID >= get_physical_broadcast()) UNEXPECTED_IO_APIC(); if (reg_00.bits.__reserved_1 || reg_00.bits.__reserved_2) UNEXPECTED_IO_APIC(); @@ -1682,7 +1642,7 @@ old_id = mp_ioapics[apic].mpc_apicid; - if (mp_ioapics[apic].mpc_apicid >= APIC_BROADCAST_ID) { + if (mp_ioapics[apic].mpc_apicid >= get_physical_broadcast()) { printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", apic, mp_ioapics[apic].mpc_apicid); printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", @@ -1703,10 +1663,10 @@ mp_ioapics[apic].mpc_apicid)) { printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", apic, mp_ioapics[apic].mpc_apicid); - for (i = 0; i < APIC_BROADCAST_ID; i++) + for (i = 0; i < get_physical_broadcast(); i++) if (!physid_isset(i, phys_id_present_map)) break; - if (i >= APIC_BROADCAST_ID) + if (i >= get_physical_broadcast()) panic("Max APIC ID exceeded!\n"); printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", i); @@ -1893,30 +1853,11 @@ ack_APIC_irq(); if (!(v & (1 << (i & 0x1f)))) { -#ifdef APIC_LOCKUP_DEBUG - struct irq_pin_list *entry; -#endif - #ifdef APIC_MISMATCH_DEBUG atomic_inc(&irq_mis_count); #endif spin_lock(&ioapic_lock); __mask_and_edge_IO_APIC_irq(irq); -#ifdef APIC_LOCKUP_DEBUG - for (entry = irq_2_pin + irq;;) { - unsigned int reg; - - if (entry->pin == -1) - break; - reg = io_apic_read(entry->apic, 0x10 + entry->pin * 2); - if (reg & 0x00004000) - printk(KERN_CRIT "Aieee!!! Remote IRR" - " still set after unlock!\n"); - if (!entry->next) - break; - entry = irq_2_pin + entry->next; - } -#endif __unmask_and_level_IO_APIC_irq(irq); spin_unlock(&ioapic_lock); } @@ -2322,8 +2263,6 @@ #ifdef CONFIG_ACPI_BOOT -#define IO_APIC_MAX_ID APIC_BROADCAST_ID - int __init io_apic_get_unique_id (int ioapic, int apic_id) { union IO_APIC_reg_00 reg_00; @@ -2348,7 +2287,7 @@ reg_00.raw = io_apic_read(ioapic, 0); spin_unlock_irqrestore(&ioapic_lock, flags); - if (apic_id >= IO_APIC_MAX_ID) { + if (apic_id >= get_physical_broadcast()) { printk(KERN_WARNING "IOAPIC[%d]: Invalid apic_id %d, trying " "%d\n", ioapic, apic_id, reg_00.bits.ID); apic_id = reg_00.bits.ID; @@ -2360,12 +2299,12 @@ */ if (check_apicid_used(apic_id_map, apic_id)) { - for (i = 0; i < IO_APIC_MAX_ID; i++) { + for (i = 0; i < get_physical_broadcast(); i++) { if (!check_apicid_used(apic_id_map, i)) break; } - if (i == IO_APIC_MAX_ID) + if (i == get_physical_broadcast()) panic("Max apic_id exceeded!\n"); printk(KERN_WARNING "IOAPIC[%d]: apic_id %d already used, " diff -Nru a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c --- a/arch/i386/kernel/irq.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/irq.c 2004-06-23 19:04:25 -07:00 @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c --- a/arch/i386/kernel/mpparse.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/kernel/mpparse.c 2004-06-23 19:04:26 -07:00 @@ -23,12 +23,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include @@ -104,6 +104,21 @@ static int mpc_record; static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __initdata; +#ifdef CONFIG_X86_NUMAQ +static int MP_valid_apicid(int apicid, int version) +{ + return hweight_long(apicid & 0xf) == 1 && (apicid >> 4) != 0xf; +} +#else +static int MP_valid_apicid(int apicid, int version) +{ + if (version >= 0x14) + return apicid < 0xff; + else + return apicid < 0xf; +} +#endif + void __init MP_processor_info (struct mpc_config_processor *m) { int ver, apicid; @@ -180,14 +195,14 @@ return; } num_processors++; + ver = m->mpc_apicver; - if (MAX_APICS - m->mpc_apicid <= 0) { + if (!MP_valid_apicid(apicid, ver)) { printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n", m->mpc_apicid, MAX_APICS); --num_processors; return; } - ver = m->mpc_apicver; tmp = apicid_to_cpu_present(apicid); physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp); @@ -844,7 +859,7 @@ MP_processor_info(&processor); } -#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) +#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT)) #define MP_ISA_BUS 0 #define MP_MAX_IOAPIC_PIN 127 @@ -857,7 +872,7 @@ } mp_ioapic_routing[MAX_IO_APICS]; -static int __init mp_find_ioapic ( +static int mp_find_ioapic ( int gsi) { int i = 0; @@ -1000,14 +1015,23 @@ for (i = 0; i < 16; i++) { int idx; - for (idx = 0; idx < mp_irq_entries; idx++) - if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS && - (mp_irqs[idx].mpc_srcbusirq == i || - mp_irqs[idx].mpc_dstirq == i)) - break; + for (idx = 0; idx < mp_irq_entries; idx++) { + struct mpc_config_intsrc *irq = mp_irqs + idx; - if (idx != mp_irq_entries) - continue; /* IRQ already used */ + /* Do we already have a mapping for this ISA IRQ? */ + if (irq->mpc_srcbus == MP_ISA_BUS && irq->mpc_srcbusirq == i) + break; + + /* Do we already have a mapping for this IOAPIC pin */ + if ((irq->mpc_dstapic == intsrc.mpc_dstapic) && + (irq->mpc_dstirq == i)) + break; + } + + if (idx != mp_irq_entries) { + printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i); + continue; /* IRQ already used */ + } intsrc.mpc_irqtype = mp_INT; intsrc.mpc_srcbusirq = i; /* Identity mapped */ @@ -1025,96 +1049,56 @@ } } -extern FADT_DESCRIPTOR acpi_fadt; - -#ifdef CONFIG_ACPI_PCI - int (*platform_rename_gsi)(int ioapic, int gsi); -void __init mp_parse_prt (void) +void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) { - struct list_head *node = NULL; - struct acpi_prt_entry *entry = NULL; int ioapic = -1; int ioapic_pin = 0; - int gsi = 0; int idx, bit = 0; - int edge_level = 0; - int active_high_low = 0; - /* - * Parsing through the PCI Interrupt Routing Table (PRT) and program - * routing for all entries. - */ - list_for_each(node, &acpi_prt.entries) { - entry = list_entry(node, struct acpi_prt_entry, node); +#ifdef CONFIG_ACPI_BUS + /* Don't set up the ACPI SCI because it's already set up */ + if (acpi_fadt.sci_int == gsi) + return; +#endif - /* Need to get gsi for dynamic entry */ - if (entry->link.handle) { - gsi = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low); - if (!gsi) - continue; - } - else { - /* Hardwired GSI. Assume PCI standard settings */ - gsi = entry->link.index; - edge_level = 1; - active_high_low = 1; - } + ioapic = mp_find_ioapic(gsi); + if (ioapic < 0) { + printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi); + return; + } - /* Don't set up the ACPI SCI because it's already set up */ - if (acpi_fadt.sci_int == gsi) { - /* we still need to set entry's irq */ - acpi_gsi_to_irq(gsi, &entry->irq); - continue; - } - - ioapic = mp_find_ioapic(gsi); - if (ioapic < 0) - continue; - ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base; - - if (platform_rename_gsi) - gsi = platform_rename_gsi(ioapic, gsi); - - /* - * Avoid pin reprogramming. PRTs typically include entries - * with redundant pin->gsi mappings (but unique PCI devices); - * we only only program the IOAPIC on the first. - */ - bit = ioapic_pin % 32; - idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); - if (idx > 3) { - printk(KERN_ERR "Invalid reference to IOAPIC pin " - "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, - ioapic_pin); - continue; - } - if ((1<irq); - continue; - } + ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base; - mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<irq); - } - printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d %s %s\n", - entry->id.segment, entry->id.bus, - entry->id.device, ('A' + entry->pin), - mp_ioapic_routing[ioapic].apic_id, ioapic_pin, - entry->irq, edge_level ? "level" : "edge", - active_high_low ? "low" : "high"); + /* + * Avoid pin reprogramming. PRTs typically include entries + * with redundant pin->gsi mappings (but unique PCI devices); + * we only program the IOAPIC on the first. + */ + bit = ioapic_pin % 32; + idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); + if (idx > 3) { + printk(KERN_ERR "Invalid reference to IOAPIC pin " + "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, + ioapic_pin); + return; + } + if ((1< #include #include +#include +#include +#include #include #include #include #include +static struct class_simple *msr_class; + /* Note: "err" is handled in a funny way below. Otherwise one version of gcc or another breaks. */ @@ -255,20 +260,82 @@ .open = msr_open, }; +static int msr_class_simple_device_add(int i) +{ + int err = 0; + struct class_device *class_err; + + class_err = class_simple_device_add(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i); + if (IS_ERR(class_err)) + err = PTR_ERR(class_err); + return err; +} + +static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) +{ + unsigned int cpu = (unsigned long)hcpu; + + switch (action) { + case CPU_ONLINE: + msr_class_simple_device_add(cpu); + break; + case CPU_DEAD: + class_simple_device_remove(MKDEV(MSR_MAJOR, cpu)); + break; + } + return NOTIFY_OK; +} + +static struct notifier_block msr_class_cpu_notifier = +{ + .notifier_call = msr_class_cpu_callback, +}; + int __init msr_init(void) { + int i, err = 0; + i = 0; + if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) { printk(KERN_ERR "msr: unable to get major %d for msr\n", MSR_MAJOR); - return -EBUSY; + err = -EBUSY; + goto out; + } + msr_class = class_simple_create(THIS_MODULE, "msr"); + if (IS_ERR(msr_class)) { + err = PTR_ERR(msr_class); + goto out_chrdev; } + for_each_online_cpu(i) { + err = msr_class_simple_device_add(i); + if (err != 0) + goto out_class; + } + register_cpu_notifier(&msr_class_cpu_notifier); - return 0; + err = 0; + goto out; + +out_class: + i = 0; + for_each_online_cpu(i) + class_simple_device_remove(MKDEV(MSR_MAJOR, i)); + class_simple_destroy(msr_class); +out_chrdev: + unregister_chrdev(MSR_MAJOR, "cpu/msr"); +out: + return err; } void __exit msr_exit(void) { + int cpu = 0; + for_each_online_cpu(cpu) + class_simple_device_remove(MKDEV(MSR_MAJOR, cpu)); + class_simple_destroy(msr_class); unregister_chrdev(MSR_MAJOR, "cpu/msr"); + unregister_cpu_notifier(&msr_class_cpu_notifier); } module_init(msr_init); diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c 2004-06-23 19:04:27 -07:00 +++ b/arch/i386/kernel/setup.c 2004-06-23 19:04:27 -07:00 @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include "setup_arch_pre.h" /* This value is set up by the early boot code to point to the value @@ -57,8 +57,6 @@ int disable_pse __initdata = 0; -static inline char * __init machine_specific_memory_setup(void); - /* * Machine setup.. */ @@ -133,8 +131,203 @@ unsigned char __initdata boot_params[PARAM_SIZE]; -static struct resource code_resource = { "Kernel code", 0x100000, 0 }; -static struct resource data_resource = { "Kernel data", 0, 0 }; +static struct resource data_resource = { + .name = "Kernel data", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_MEM +}; + +static struct resource code_resource = { + .name = "Kernel code", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_MEM +}; + +static struct resource system_rom_resource = { + .name = "System ROM", + .start = 0xf0000, + .end = 0xfffff, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}; + +static struct resource extension_rom_resource = { + .name = "Extension ROM", + .start = 0xe0000, + .end = 0xeffff, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}; + +static struct resource adapter_rom_resources[] = { { + .name = "Adapter ROM", + .start = 0xc8000, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}, { + .name = "Adapter ROM", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}, { + .name = "Adapter ROM", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}, { + .name = "Adapter ROM", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}, { + .name = "Adapter ROM", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}, { + .name = "Adapter ROM", + .start = 0, + .end = 0, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +} }; + +#define ADAPTER_ROM_RESOURCES \ + (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0]) + +static struct resource video_rom_resource = { + .name = "Video ROM", + .start = 0xc0000, + .end = 0xc7fff, + .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM +}; + +static struct resource video_ram_resource = { + .name = "Video RAM area", + .start = 0xa0000, + .end = 0xbffff, + .flags = IORESOURCE_BUSY | IORESOURCE_MEM +}; + +static struct resource standard_io_resources[] = { { + .name = "dma1", + .start = 0x0000, + .end = 0x001f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +}, { + .name = "pic1", + .start = 0x0020, + .end = 0x0021, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +}, { + .name = "timer", + .start = 0x0040, + .end = 0x005f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +}, { + .name = "keyboard", + .start = 0x0060, + .end = 0x006f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +}, { + .name = "dma page reg", + .start = 0x0080, + .end = 0x008f, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +}, { + .name = "pic2", + .start = 0x00a0, + .end = 0x00a1, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +}, { + .name = "dma2", + .start = 0x00c0, + .end = 0x00df, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +}, { + .name = "fpu", + .start = 0x00f0, + .end = 0x00ff, + .flags = IORESOURCE_BUSY | IORESOURCE_IO +} }; + +#define STANDARD_IO_RESOURCES \ + (sizeof standard_io_resources / sizeof standard_io_resources[0]) + +#define romsignature(x) (*(unsigned short *)(x) == 0xaa55) + +static int __init romchecksum(unsigned char *rom, unsigned long length) +{ + unsigned char *p, sum = 0; + + for (p = rom; p < rom + length; p++) + sum += *p; + return sum == 0; +} + +static void __init probe_roms(void) +{ + unsigned long start, length, upper; + unsigned char *rom; + int i; + + /* video rom */ + upper = adapter_rom_resources[0].start; + for (start = video_rom_resource.start; start < upper; start += 2048) { + rom = isa_bus_to_virt(start); + if (!romsignature(rom)) + continue; + + video_rom_resource.start = start; + + /* 0 < length <= 0x7f * 512, historically */ + length = rom[2] * 512; + + /* if checksum okay, trust length byte */ + if (length && romchecksum(rom, length)) + video_rom_resource.end = start + length - 1; + + request_resource(&iomem_resource, &video_rom_resource); + break; + } + + start = (video_rom_resource.end + 1 + 2047) & ~2047UL; + if (start < upper) + start = upper; + + /* system rom */ + request_resource(&iomem_resource, &system_rom_resource); + upper = system_rom_resource.start; + + /* check for extension rom (ignore length byte!) */ + rom = isa_bus_to_virt(extension_rom_resource.start); + if (romsignature(rom)) { + length = extension_rom_resource.end - extension_rom_resource.start + 1; + if (romchecksum(rom, length)) { + request_resource(&iomem_resource, &extension_rom_resource); + upper = extension_rom_resource.start; + } + } + + /* check for adapter roms on 2k boundaries */ + for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) { + rom = isa_bus_to_virt(start); + if (!romsignature(rom)) + continue; + + /* 0 < length <= 0x7f * 512, historically */ + length = rom[2] * 512; + + /* but accept any length that fits if checksum okay */ + if (!length || start + length > upper || !romchecksum(rom, length)) + continue; + + adapter_rom_resources[i].start = start; + adapter_rom_resources[i].end = start + length - 1; + request_resource(&iomem_resource, &adapter_rom_resources[i]); + + start = adapter_rom_resources[i++].end & ~2047UL; + } +} static void __init limit_regions(unsigned long long size) { @@ -465,14 +658,6 @@ */ #define LOWMEMSIZE() (0x9f000) -static void __init setup_memory_region(void) -{ - char *who = machine_specific_memory_setup(); - printk(KERN_INFO "BIOS-provided physical RAM map:\n"); - print_memory_map(who); -} /* setup_memory_region */ - - static void __init parse_cmdline_early (char ** cmdline_p) { char c = ' ', *to = command_line, *from = saved_command_line; @@ -948,6 +1133,7 @@ static void __init register_memory(unsigned long max_low_pfn) { unsigned long low_mem_size; + int i; if (efi_enabled) efi_initialize_iomem_resources(&code_resource, &data_resource); @@ -955,10 +1141,11 @@ legacy_init_iomem_resources(&code_resource, &data_resource); /* EFI systems may still have VGA */ - request_graphics_resource(); + request_resource(&iomem_resource, &video_ram_resource); /* request I/O space for devices used on all i[345]86 PCs */ - request_standard_io_resources(); + for (i = 0; i < STANDARD_IO_RESOURCES; i++) + request_resource(&ioport_resource, &standard_io_resources[i]); /* Tell the PCI layer not to allocate too close to the RAM area.. */ low_mem_size = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff; @@ -1073,6 +1260,8 @@ __setup("noreplacement", noreplacement_setup); +static char * __init machine_specific_memory_setup(void); + /* * Determine if we were loaded by an EFI loader. If so, then we have also been * passed the efi memmap, systab, etc., so we should use these data structures @@ -1123,8 +1312,10 @@ ARCH_SETUP if (efi_enabled) efi_init(); - else - setup_memory_region(); + else { + printk(KERN_INFO "BIOS-provided physical RAM map:\n"); + print_memory_map(machine_specific_memory_setup()); + } copy_edd(); diff -Nru a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c --- a/arch/i386/kernel/signal.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/kernel/signal.c 2004-06-23 19:04:26 -07:00 @@ -56,16 +56,15 @@ } asmlinkage int -sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) +sys_rt_sigsuspend(struct pt_regs regs) { - struct pt_regs * regs = (struct pt_regs *) &unewset; sigset_t saveset, newset; /* XXX: Don't preclude handling different sized sigset_t's. */ - if (sigsetsize != sizeof(sigset_t)) + if (regs.ecx != sizeof(sigset_t)) return -EINVAL; - if (copy_from_user(&newset, unewset, sizeof(newset))) + if (copy_from_user(&newset, (sigset_t __user *)regs.ebx, sizeof(newset))) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); @@ -75,11 +74,11 @@ recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); - regs->eax = -EINTR; + regs.eax = -EINTR; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); - if (do_signal(regs, &saveset)) + if (do_signal(®s, &saveset)) return -EINTR; } } @@ -117,10 +116,11 @@ } asmlinkage int -sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) +sys_sigaltstack(struct pt_regs regs) { - struct pt_regs *regs = (struct pt_regs *) &uss; - return do_sigaltstack(uss, uoss, regs->esp); + const stack_t __user *uss = (const stack_t __user *)regs.ebx; + stack_t __user *uoss = (stack_t __user *)regs.ecx; + return do_sigaltstack(uss, uoss, regs.esp); } diff -Nru a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c --- a/arch/i386/kernel/smp.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/smp.c 2004-06-23 19:04:25 -07:00 @@ -21,7 +21,6 @@ #include #include -#include #include #include #include diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c --- a/arch/i386/kernel/smpboot.c 2004-06-23 19:04:27 -07:00 +++ b/arch/i386/kernel/smpboot.c 2004-06-23 19:04:27 -07:00 @@ -47,7 +47,6 @@ #include #include -#include #include #include #include diff -Nru a/arch/i386/kernel/std_resources.c b/arch/i386/kernel/std_resources.c --- a/arch/i386/kernel/std_resources.c 2004-06-23 19:04:27 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,204 +0,0 @@ -/* - * Machine specific resource allocation for generic. - */ - -#include -#include -#include - -#define romsignature(x) (*(unsigned short *)(x) == 0xaa55) - -static struct resource system_rom_resource = { - .name = "System ROM", - .start = 0xf0000, - .end = 0xfffff, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}; - -static struct resource extension_rom_resource = { - .name = "Extension ROM", - .start = 0xe0000, - .end = 0xeffff, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}; - -static struct resource adapter_rom_resources[] = { { - .name = "Adapter ROM", - .start = 0xc8000, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}, { - .name = "Adapter ROM", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}, { - .name = "Adapter ROM", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}, { - .name = "Adapter ROM", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}, { - .name = "Adapter ROM", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}, { - .name = "Adapter ROM", - .start = 0, - .end = 0, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -} }; - -#define ADAPTER_ROM_RESOURCES \ - (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0]) - -static struct resource video_rom_resource = { - .name = "Video ROM", - .start = 0xc0000, - .end = 0xc7fff, - .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM -}; - -static struct resource vram_resource = { - .name = "Video RAM area", - .start = 0xa0000, - .end = 0xbffff, - .flags = IORESOURCE_BUSY | IORESOURCE_MEM -}; - -static struct resource standard_io_resources[] = { { - .name = "dma1", - .start = 0x0000, - .end = 0x001f, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -}, { - .name = "pic1", - .start = 0x0020, - .end = 0x0021, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -}, { - .name = "timer", - .start = 0x0040, - .end = 0x005f, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -}, { - .name = "keyboard", - .start = 0x0060, - .end = 0x006f, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -}, { - .name = "dma page reg", - .start = 0x0080, - .end = 0x008f, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -}, { - .name = "pic2", - .start = 0x00a0, - .end = 0x00a1, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -}, { - .name = "dma2", - .start = 0x00c0, - .end = 0x00df, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -}, { - .name = "fpu", - .start = 0x00f0, - .end = 0x00ff, - .flags = IORESOURCE_BUSY | IORESOURCE_IO -} }; - -#define STANDARD_IO_RESOURCES \ - (sizeof standard_io_resources / sizeof standard_io_resources[0]) - -static int __init checksum(unsigned char *rom, unsigned long length) -{ - unsigned char *p, sum = 0; - - for (p = rom; p < rom + length; p++) - sum += *p; - return sum == 0; -} - -void __init probe_roms(void) -{ - unsigned long start, length, upper; - unsigned char *rom; - int i; - - /* video rom */ - upper = adapter_rom_resources[0].start; - for (start = video_rom_resource.start; start < upper; start += 2048) { - rom = isa_bus_to_virt(start); - if (!romsignature(rom)) - continue; - - video_rom_resource.start = start; - - /* 0 < length <= 0x7f * 512, historically */ - length = rom[2] * 512; - - /* if checksum okay, trust length byte */ - if (length && checksum(rom, length)) - video_rom_resource.end = start + length - 1; - - request_resource(&iomem_resource, &video_rom_resource); - break; - } - - start = (video_rom_resource.end + 1 + 2047) & ~2047UL; - if (start < upper) - start = upper; - - /* system rom */ - request_resource(&iomem_resource, &system_rom_resource); - upper = system_rom_resource.start; - - /* check for extension rom (ignore length byte!) */ - rom = isa_bus_to_virt(extension_rom_resource.start); - if (romsignature(rom)) { - length = extension_rom_resource.end - extension_rom_resource.start + 1; - if (checksum(rom, length)) { - request_resource(&iomem_resource, &extension_rom_resource); - upper = extension_rom_resource.start; - } - } - - /* check for adapter roms on 2k boundaries */ - for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) { - rom = isa_bus_to_virt(start); - if (!romsignature(rom)) - continue; - - /* 0 < length <= 0x7f * 512, historically */ - length = rom[2] * 512; - - /* but accept any length that fits if checksum okay */ - if (!length || start + length > upper || !checksum(rom, length)) - continue; - - adapter_rom_resources[i].start = start; - adapter_rom_resources[i].end = start + length - 1; - request_resource(&iomem_resource, &adapter_rom_resources[i]); - - start = adapter_rom_resources[i++].end & ~2047UL; - } -} - -void __init request_graphics_resource(void) -{ - request_resource(&iomem_resource, &vram_resource); -} - -void __init request_standard_io_resources(void) -{ - int i; - - for (i = 0; i < STANDARD_IO_RESOURCES; i++) - request_resource(&ioport_resource, &standard_io_resources[i]); -} diff -Nru a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c --- a/arch/i386/kernel/time_hpet.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/time_hpet.c 2004-06-23 19:04:25 -07:00 @@ -21,6 +21,7 @@ #include #include +#include unsigned long hpet_period; /* fsecs / HPET clock */ unsigned long hpet_tick; /* hpet clks count per tick */ @@ -135,6 +136,51 @@ hpet_writel(cfg, HPET_CFG); use_hpet = 1; + +#ifdef CONFIG_HPET + { + struct hpet_data hd; + unsigned int ntimer; + + memset(&hd, 0, sizeof (hd)); + + ntimer = hpet_readl(HPET_ID); + ntimer = (ntimer & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT; + ntimer++; + + /* + * Register with driver. + * Timer0 and Timer1 is used by platform. + */ + hd.hd_address = hpet_virt_address; + hd.hd_nirqs = ntimer; + hd.hd_flags = HPET_DATA_PLATFORM; +#ifndef CONFIG_HPET_EMULATE_RTC + hd.hd_state = 0x1; +#else + hd.hd_state = 0x3; +#endif + hd.hd_irq[0] = HPET_LEGACY_8254; + hd.hd_irq[1] = HPET_LEGACY_RTC; + if (ntimer > 2) { + struct hpet *hpet; + struct hpet_timer *timer; + int i; + + hpet = (struct hpet *) hpet_virt_address; + + for (i = 2, timer = &hpet->hpet_timers[2]; i < ntimer; + timer++, i++) + hd.hd_irq[i] = (timer->hpet_config & + Tn_INT_ROUTE_CNF_MASK) >> + Tn_INT_ROUTE_CNF_SHIFT; + + } + + hpet_alloc(&hd); + } +#endif + #ifdef CONFIG_X86_LOCAL_APIC wait_timer_tick = wait_hpet_tick; #endif diff -Nru a/arch/i386/kernel/timers/timer_pm.c b/arch/i386/kernel/timers/timer_pm.c --- a/arch/i386/kernel/timers/timer_pm.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/timers/timer_pm.c 2004-06-23 19:04:25 -07:00 @@ -21,6 +21,14 @@ #include #include +#include +#include "mach_timer.h" + +/* Number of PMTMR ticks expected during calibration run */ +#define PMTMR_TICKS_PER_SEC 3579545 +#define PMTMR_EXPECTED_RATE \ + ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10)) + /* The I/O port the PMTMR resides at. * The location is detected during setup_arch(), @@ -57,6 +65,33 @@ return v2 & ACPI_PM_MASK; } + +/* + * Some boards have the PMTMR running way too fast. We check + * the PMTMR rate against PIT channel 2 to catch these cases. + */ +static int verify_pmtmr_rate(void) +{ + u32 value1, value2; + unsigned long count, delta; + + mach_prepare_counter(); + value1 = read_pmtmr(); + mach_countup(&count); + value2 = read_pmtmr(); + delta = (value2 - value1) & ACPI_PM_MASK; + + /* Check that the PMTMR delta is within 5% of what we expect */ + if (delta < (PMTMR_EXPECTED_RATE * 19) / 20 || + delta > (PMTMR_EXPECTED_RATE * 21) / 20) { + printk(KERN_INFO "PM-Timer running at invalid rate: %lu%% of normal - aborting.\n", 100UL * delta / PMTMR_EXPECTED_RATE); + return -1; + } + + return 0; +} + + static int init_pmtmr(char* override) { u32 value1, value2; @@ -89,6 +124,9 @@ return -ENODEV; pm_good: + if (verify_pmtmr_rate() != 0) + return -ENODEV; + init_cpu_khz(); return 0; } diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/traps.c 2004-06-23 19:04:25 -07:00 @@ -47,7 +47,6 @@ #include #include -#include #include #include @@ -163,7 +162,6 @@ break; printk(" =======================\n"); } - printk("\n"); } void show_stack(struct task_struct *task, unsigned long *esp) diff -Nru a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c --- a/arch/i386/kernel/vm86.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/kernel/vm86.c 2004-06-23 19:04:25 -07:00 @@ -44,7 +44,6 @@ #include #include -#include #include #include #include @@ -178,8 +177,9 @@ static int do_vm86_irq_handling(int subfunction, int irqnumber); static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); -asmlinkage int sys_vm86old(struct vm86_struct __user * v86) +asmlinkage int sys_vm86old(struct pt_regs regs) { + struct vm86_struct __user *v86 = (struct vm86_struct __user *)regs.ebx; struct kernel_vm86_struct info; /* declare this _on top_, * this avoids wasting of stack space. * This remains on the stack until we @@ -198,7 +198,7 @@ if (tmp) goto out; memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); - info.regs32 = (struct pt_regs *) &v86; + info.regs32 = ®s; tsk->thread.vm86_info = v86; do_sys_vm86(&info, tsk); ret = 0; /* we never return here */ @@ -207,7 +207,7 @@ } -asmlinkage int sys_vm86(unsigned long subfunction, struct vm86plus_struct __user * v86) +asmlinkage int sys_vm86(struct pt_regs regs) { struct kernel_vm86_struct info; /* declare this _on top_, * this avoids wasting of stack space. @@ -216,14 +216,15 @@ */ struct task_struct *tsk; int tmp, ret; + struct vm86plus_struct __user *v86; tsk = current; - switch (subfunction) { + switch (regs.ebx) { case VM86_REQUEST_IRQ: case VM86_FREE_IRQ: case VM86_GET_IRQ_BITS: case VM86_GET_AND_RESET_IRQ: - ret = do_vm86_irq_handling(subfunction,(int)v86); + ret = do_vm86_irq_handling(regs.ebx, (int)regs.ecx); goto out; case VM86_PLUS_INSTALL_CHECK: /* NOTE: on old vm86 stuff this will return the error @@ -239,13 +240,14 @@ ret = -EPERM; if (tsk->thread.saved_esp0) goto out; + v86 = (struct vm86plus_struct __user *)regs.ecx; tmp = copy_from_user(&info, v86, VM86_REGS_SIZE1); tmp += copy_from_user(&info.regs.VM86_REGS_PART2, &v86->regs.VM86_REGS_PART2, (long)&info.regs32 - (long)&info.regs.VM86_REGS_PART2); ret = -EFAULT; if (tmp) goto out; - info.regs32 = (struct pt_regs *) &subfunction; + info.regs32 = ®s; info.vm86plus.is_vm86pus = 1; tsk->thread.vm86_info = (struct vm86_struct __user *)v86; do_sys_vm86(&info, tsk); @@ -486,9 +488,10 @@ * in userspace is always better than an Oops anyway.) [KD] */ static void do_int(struct kernel_vm86_regs *regs, int i, - unsigned char * ssp, unsigned short sp) + unsigned char __user * ssp, unsigned short sp) { - unsigned long *intr_ptr, segoffs; + unsigned long __user *intr_ptr; + unsigned long segoffs; if (regs->cs == BIOSSEG) goto cannot_handle; @@ -496,7 +499,7 @@ goto cannot_handle; if (i==0x21 && is_revectored(AH(regs),&KVM86->int21_revectored)) goto cannot_handle; - intr_ptr = (unsigned long *) (i << 2); + intr_ptr = (unsigned long __user *) (i << 2); if (get_user(segoffs, intr_ptr)) goto cannot_handle; if ((segoffs >> 16) == BIOSSEG) @@ -521,7 +524,7 @@ if (VMPI.is_vm86pus) { if ( (trapno==3) || (trapno==1) ) return_to_32bit(regs, VM86_TRAP + (trapno << 8)); - do_int(regs, trapno, (unsigned char *) (regs->ss << 4), SP(regs)); + do_int(regs, trapno, (unsigned char __user *) (regs->ss << 4), SP(regs)); return 0; } if (trapno !=1) @@ -541,7 +544,9 @@ void handle_vm86_fault(struct kernel_vm86_regs * regs, long error_code) { - unsigned char *csp, *ssp, opcode; + unsigned char opcode; + unsigned char __user *csp; + unsigned char __user *ssp; unsigned short ip, sp; int data32, pref_done; @@ -553,8 +558,8 @@ return_to_32bit(regs, VM86_PICRETURN); \ return; } while (0) - csp = (unsigned char *) (regs->cs << 4); - ssp = (unsigned char *) (regs->ss << 4); + csp = (unsigned char __user *) (regs->cs << 4); + ssp = (unsigned char __user *) (regs->ss << 4); sp = SP(regs); ip = IP(regs); diff -Nru a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile --- a/arch/i386/lib/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/lib/Makefile 2004-06-23 19:04:25 -07:00 @@ -3,9 +3,8 @@ # -lib-y = checksum.o delay.o \ - usercopy.o getuser.o \ - memcpy.o strstr.o +lib-y = checksum.o delay.o usercopy.o getuser.o memcpy.o strstr.o \ + bitops.o lib-$(CONFIG_X86_USE_3DNOW) += mmx.o lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o diff -Nru a/arch/i386/lib/bitops.c b/arch/i386/lib/bitops.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/i386/lib/bitops.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,70 @@ +#include +#include + +/** + * find_next_bit - find the first set bit in a memory region + * @addr: The address to base the search on + * @offset: The bitnumber to start searching at + * @size: The maximum size to search + */ +int find_next_bit(const unsigned long *addr, int size, int offset) +{ + const unsigned long *p = addr + (offset >> 5); + int set = 0, bit = offset & 31, res; + + if (bit) { + /* + * Look for nonzero in the first 32 bits: + */ + __asm__("bsfl %1,%0\n\t" + "jne 1f\n\t" + "movl $32, %0\n" + "1:" + : "=r" (set) + : "r" (*p >> bit)); + if (set < (32 - bit)) + return set + offset; + set = 32 - bit; + p++; + } + /* + * No set bit yet, search remaining full words for a bit + */ + res = find_first_bit (p, size - 32 * (p - addr)); + return (offset + set + res); +} +EXPORT_SYMBOL(find_next_bit); + +/** + * find_next_zero_bit - find the first zero bit in a memory region + * @addr: The address to base the search on + * @offset: The bitnumber to start searching at + * @size: The maximum size to search + */ +int find_next_zero_bit(const unsigned long *addr, int size, int offset) +{ + unsigned long * p = ((unsigned long *) addr) + (offset >> 5); + int set = 0, bit = offset & 31, res; + + if (bit) { + /* + * Look for zero in the first 32 bits. + */ + __asm__("bsfl %1,%0\n\t" + "jne 1f\n\t" + "movl $32, %0\n" + "1:" + : "=r" (set) + : "r" (~(*p >> bit))); + if (set < (32 - bit)) + return set + offset; + set = 32 - bit; + p++; + } + /* + * No zero yet, search remaining full bytes for a zero + */ + res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr)); + return (offset + set + res); +} +EXPORT_SYMBOL(find_next_zero_bit); diff -Nru a/arch/i386/lib/delay.c b/arch/i386/lib/delay.c --- a/arch/i386/lib/delay.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/lib/delay.c 2004-06-23 19:04:28 -07:00 @@ -31,15 +31,16 @@ inline void __const_udelay(unsigned long xloops) { int d0; + xloops *= 4; __asm__("mull %0" :"=d" (xloops), "=&a" (d0) - :"1" (xloops),"0" (current_cpu_data.loops_per_jiffy)); - __delay(xloops * HZ); + :"1" (xloops),"0" (current_cpu_data.loops_per_jiffy * (HZ/4))); + __delay(++xloops); } void __udelay(unsigned long usecs) { - __const_udelay(usecs * 0x000010c6); /* 2**32 / 1000000 */ + __const_udelay(usecs * 0x000010c7); /* 2**32 / 1000000 (rounded up) */ } void __ndelay(unsigned long nsecs) diff -Nru a/arch/i386/mach-pc9800/Makefile b/arch/i386/mach-pc9800/Makefile --- a/arch/i386/mach-pc9800/Makefile 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,5 +0,0 @@ -# -# Makefile for the linux kernel. -# - -obj-y := setup.o topology.o std_resources.o diff -Nru a/arch/i386/mach-pc9800/setup.c b/arch/i386/mach-pc9800/setup.c --- a/arch/i386/mach-pc9800/setup.c 2004-06-23 19:04:25 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,117 +0,0 @@ -/* - * Machine specific setup for pc9800 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct sys_desc_table_struct { - unsigned short length; - unsigned char table[0]; -}; - -/** - * pre_intr_init_hook - initialisation prior to setting up interrupt vectors - * - * Description: - * Perform any necessary interrupt initialisation prior to setting up - * the "ordinary" interrupt call gates. For legacy reasons, the ISA - * interrupts should be initialised here if the machine emulates a PC - * in any way. - **/ -void __init pre_intr_init_hook(void) -{ - init_ISA_irqs(); -} - -/* - * IRQ7 is cascade interrupt to second interrupt controller - */ -static struct irqaction irq7 = { no_action, 0, 0, "cascade", NULL, NULL}; - -/** - * intr_init_hook - post gate setup interrupt initialisation - * - * Description: - * Fill in any interrupts that may have been left out by the general - * init_IRQ() routine. interrupts having to do with the machine rather - * than the devices on the I/O bus (like APIC interrupts in intel MP - * systems) are started here. - **/ -void __init intr_init_hook(void) -{ -#ifdef CONFIG_X86_LOCAL_APIC - apic_intr_init(); -#endif - - setup_irq(7, &irq7); -} - -/** - * pre_setup_arch_hook - hook called prior to any setup_arch() execution - * - * Description: - * generally used to activate any machine specific identification - * routines that may be needed before setup_arch() runs. On VISWS - * this is used to get the board revision and type. - **/ -void __init pre_setup_arch_hook(void) -{ - SYS_DESC_TABLE.length = 0; - MCA_bus = 0; - /* In PC-9800, APM BIOS version is written in BCD...?? */ - APM_BIOS_INFO.version = (APM_BIOS_INFO.version & 0xff00) - | ((APM_BIOS_INFO.version & 0x00f0) >> 4); -} - -/** - * trap_init_hook - initialise system specific traps - * - * Description: - * Called as the final act of trap_init(). Used in VISWS to initialise - * the various board specific APIC traps. - **/ -void __init trap_init_hook(void) -{ -} - -static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL}; - -/** - * time_init_hook - do any specific initialisations for the system timer. - * - * Description: - * Must plug the system timer interrupt source at HZ into the IRQ listed - * in irq_vectors.h:TIMER_IRQ - **/ -void __init time_init_hook(void) -{ - setup_irq(0, &irq0); -} - -#ifdef CONFIG_MCA -/** - * mca_nmi_hook - hook into MCA specific NMI chain - * - * Description: - * The MCA (Microchannel Architecture) has an NMI chain for NMI sources - * along the MCA bus. Use this to hook into that chain if you will need - * it. - **/ -void __init mca_nmi_hook(void) -{ - /* If I recall correctly, there's a whole bunch of other things that - * we can do to check for NMI problems, but that's all I know about - * at the moment. - */ - - printk("NMI generated from unknown source!\n"); -} -#endif diff -Nru a/arch/i386/mach-pc9800/std_resources.c b/arch/i386/mach-pc9800/std_resources.c --- a/arch/i386/mach-pc9800/std_resources.c 2004-06-23 19:04:29 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,195 +0,0 @@ -/* - * Machine specific resource allocation for PC-9800. - * Written by Osamu Tomita - */ - -#include -#include -#include - -static char str_pic1[] = "pic1"; -static char str_dma[] = "dma"; -static char str_pic2[] = "pic2"; -static char str_calender_clock[] = "calender clock"; -static char str_system[] = "system"; -static char str_nmi_control[] = "nmi control"; -static char str_kanji_rom[] = "kanji rom"; -static char str_keyboard[] = "keyboard"; -static char str_text_gdc[] = "text gdc"; -static char str_crtc[] = "crtc"; -static char str_timer[] = "timer"; -static char str_graphic_gdc[] = "graphic gdc"; -static char str_dma_ex_bank[] = "dma ex. bank"; -static char str_beep_freq[] = "beep freq."; -static char str_mouse_pio[] = "mouse pio"; -struct resource standard_io_resources[] = { - { str_pic1, 0x00, 0x00, IORESOURCE_BUSY }, - { str_dma, 0x01, 0x01, IORESOURCE_BUSY }, - { str_pic1, 0x02, 0x02, IORESOURCE_BUSY }, - { str_dma, 0x03, 0x03, IORESOURCE_BUSY }, - { str_dma, 0x05, 0x05, IORESOURCE_BUSY }, - { str_dma, 0x07, 0x07, IORESOURCE_BUSY }, - { str_pic2, 0x08, 0x08, IORESOURCE_BUSY }, - { str_dma, 0x09, 0x09, IORESOURCE_BUSY }, - { str_pic2, 0x0a, 0x0a, IORESOURCE_BUSY }, - { str_dma, 0x0b, 0x0b, IORESOURCE_BUSY }, - { str_dma, 0x0d, 0x0d, IORESOURCE_BUSY }, - { str_dma, 0x0f, 0x0f, IORESOURCE_BUSY }, - { str_dma, 0x11, 0x11, IORESOURCE_BUSY }, - { str_dma, 0x13, 0x13, IORESOURCE_BUSY }, - { str_dma, 0x15, 0x15, IORESOURCE_BUSY }, - { str_dma, 0x17, 0x17, IORESOURCE_BUSY }, - { str_dma, 0x19, 0x19, IORESOURCE_BUSY }, - { str_dma, 0x1b, 0x1b, IORESOURCE_BUSY }, - { str_dma, 0x1d, 0x1d, IORESOURCE_BUSY }, - { str_dma, 0x1f, 0x1f, IORESOURCE_BUSY }, - { str_calender_clock, 0x20, 0x20, 0 }, - { str_dma, 0x21, 0x21, IORESOURCE_BUSY }, - { str_calender_clock, 0x22, 0x22, 0 }, - { str_dma, 0x23, 0x23, IORESOURCE_BUSY }, - { str_dma, 0x25, 0x25, IORESOURCE_BUSY }, - { str_dma, 0x27, 0x27, IORESOURCE_BUSY }, - { str_dma, 0x29, 0x29, IORESOURCE_BUSY }, - { str_dma, 0x2b, 0x2b, IORESOURCE_BUSY }, - { str_dma, 0x2d, 0x2d, IORESOURCE_BUSY }, - { str_system, 0x31, 0x31, IORESOURCE_BUSY }, - { str_system, 0x33, 0x33, IORESOURCE_BUSY }, - { str_system, 0x35, 0x35, IORESOURCE_BUSY }, - { str_system, 0x37, 0x37, IORESOURCE_BUSY }, - { str_nmi_control, 0x50, 0x50, IORESOURCE_BUSY }, - { str_nmi_control, 0x52, 0x52, IORESOURCE_BUSY }, - { "time stamp", 0x5c, 0x5f, IORESOURCE_BUSY }, - { str_kanji_rom, 0xa1, 0xa1, IORESOURCE_BUSY }, - { str_kanji_rom, 0xa3, 0xa3, IORESOURCE_BUSY }, - { str_kanji_rom, 0xa5, 0xa5, IORESOURCE_BUSY }, - { str_kanji_rom, 0xa7, 0xa7, IORESOURCE_BUSY }, - { str_kanji_rom, 0xa9, 0xa9, IORESOURCE_BUSY }, - { str_keyboard, 0x41, 0x41, IORESOURCE_BUSY }, - { str_keyboard, 0x43, 0x43, IORESOURCE_BUSY }, - { str_text_gdc, 0x60, 0x60, IORESOURCE_BUSY }, - { str_text_gdc, 0x62, 0x62, IORESOURCE_BUSY }, - { str_text_gdc, 0x64, 0x64, IORESOURCE_BUSY }, - { str_text_gdc, 0x66, 0x66, IORESOURCE_BUSY }, - { str_text_gdc, 0x68, 0x68, IORESOURCE_BUSY }, - { str_text_gdc, 0x6a, 0x6a, IORESOURCE_BUSY }, - { str_text_gdc, 0x6c, 0x6c, IORESOURCE_BUSY }, - { str_text_gdc, 0x6e, 0x6e, IORESOURCE_BUSY }, - { str_crtc, 0x70, 0x70, IORESOURCE_BUSY }, - { str_crtc, 0x72, 0x72, IORESOURCE_BUSY }, - { str_crtc, 0x74, 0x74, IORESOURCE_BUSY }, - { str_crtc, 0x74, 0x74, IORESOURCE_BUSY }, - { str_crtc, 0x76, 0x76, IORESOURCE_BUSY }, - { str_crtc, 0x78, 0x78, IORESOURCE_BUSY }, - { str_crtc, 0x7a, 0x7a, IORESOURCE_BUSY }, - { str_timer, 0x71, 0x71, IORESOURCE_BUSY }, - { str_timer, 0x73, 0x73, IORESOURCE_BUSY }, - { str_timer, 0x75, 0x75, IORESOURCE_BUSY }, - { str_timer, 0x77, 0x77, IORESOURCE_BUSY }, - { str_graphic_gdc, 0xa0, 0xa0, IORESOURCE_BUSY }, - { str_graphic_gdc, 0xa2, 0xa2, IORESOURCE_BUSY }, - { str_graphic_gdc, 0xa4, 0xa4, IORESOURCE_BUSY }, - { str_graphic_gdc, 0xa6, 0xa6, IORESOURCE_BUSY }, - { "cpu", 0xf0, 0xf7, IORESOURCE_BUSY }, - { "fpu", 0xf8, 0xff, IORESOURCE_BUSY }, - { str_dma_ex_bank, 0x0e05, 0x0e05, 0 }, - { str_dma_ex_bank, 0x0e07, 0x0e07, 0 }, - { str_dma_ex_bank, 0x0e09, 0x0e09, 0 }, - { str_dma_ex_bank, 0x0e0b, 0x0e0b, 0 }, - { str_beep_freq, 0x3fd9, 0x3fd9, IORESOURCE_BUSY }, - { str_beep_freq, 0x3fdb, 0x3fdb, IORESOURCE_BUSY }, - { str_beep_freq, 0x3fdd, 0x3fdd, IORESOURCE_BUSY }, - { str_beep_freq, 0x3fdf, 0x3fdf, IORESOURCE_BUSY }, - /* All PC-9800 have (exactly) one mouse interface. */ - { str_mouse_pio, 0x7fd9, 0x7fd9, 0 }, - { str_mouse_pio, 0x7fdb, 0x7fdb, 0 }, - { str_mouse_pio, 0x7fdd, 0x7fdd, 0 }, - { str_mouse_pio, 0x7fdf, 0x7fdf, 0 }, - { "mouse timer", 0xbfdb, 0xbfdb, 0 }, - { "mouse irq", 0x98d7, 0x98d7, 0 }, -}; - -#define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource)) - -static struct resource tvram_resource = { "Text VRAM/CG window", 0xa0000, 0xa4fff, IORESOURCE_BUSY }; -static struct resource gvram_brg_resource = { "Graphic VRAM (B/R/G)", 0xa8000, 0xbffff, IORESOURCE_BUSY }; -static struct resource gvram_e_resource = { "Graphic VRAM (E)", 0xe0000, 0xe7fff, IORESOURCE_BUSY }; - -/* System ROM resources */ -#define MAXROMS 6 -static struct resource rom_resources[MAXROMS] = { - { "System ROM", 0xe8000, 0xfffff, IORESOURCE_BUSY } -}; - -void __init probe_roms(void) -{ - int i; - __u8 *xrom_id; - int roms = 1; - - request_resource(&iomem_resource, rom_resources+0); - - xrom_id = (__u8 *) isa_bus_to_virt(PC9800SCA_XROM_ID + 0x10); - - for (i = 0; i < 16; i++) { - if (xrom_id[i] & 0x80) { - int j; - - for (j = i + 1; j < 16 && (xrom_id[j] & 0x80); j++) - ; - rom_resources[roms].start = 0x0d0000 + i * 0x001000; - rom_resources[roms].end = 0x0d0000 + j * 0x001000 - 1; - rom_resources[roms].name = "Extension ROM"; - rom_resources[roms].flags = IORESOURCE_BUSY; - - request_resource(&iomem_resource, - rom_resources + roms); - if (++roms >= MAXROMS) - return; - } - } -} - -void __init request_graphics_resource(void) -{ - int i; - - if (PC9800_HIGHRESO_P()) { - tvram_resource.start = 0xe0000; - tvram_resource.end = 0xe4fff; - gvram_brg_resource.name = "Graphic VRAM"; - gvram_brg_resource.start = 0xc0000; - gvram_brg_resource.end = 0xdffff; - } - - request_resource(&iomem_resource, &tvram_resource); - request_resource(&iomem_resource, &gvram_brg_resource); - if (!PC9800_HIGHRESO_P()) - request_resource(&iomem_resource, &gvram_e_resource); - - if (PC9800_HIGHRESO_P() || PC9800_9821_P()) { - static char graphics[] = "graphics"; - static struct resource graphics_resources[] = { - { graphics, 0x9a0, 0x9a0, 0 }, - { graphics, 0x9a2, 0x9a2, 0 }, - { graphics, 0x9a4, 0x9a4, 0 }, - { graphics, 0x9a6, 0x9a6, 0 }, - { graphics, 0x9a8, 0x9a8, 0 }, - { graphics, 0x9aa, 0x9aa, 0 }, - { graphics, 0x9ac, 0x9ac, 0 }, - { graphics, 0x9ae, 0x9ae, 0 }, - }; - -#define GRAPHICS_RESOURCES (sizeof(graphics_resources)/sizeof(struct resource)) - - for (i = 0; i < GRAPHICS_RESOURCES; i++) - request_resource(&ioport_resource, graphics_resources + i); - } -} - -void __init request_standard_io_resources(void) -{ - int i; - - for (i = 0; i < STANDARD_IO_RESOURCES; i++) - request_resource(&ioport_resource, standard_io_resources+i); -} diff -Nru a/arch/i386/mach-pc9800/topology.c b/arch/i386/mach-pc9800/topology.c --- a/arch/i386/mach-pc9800/topology.c 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,44 +0,0 @@ -/* - * arch/i386/mach-pc9800/topology.c - Populate driverfs with topology information - * - * Written by: Matthew Dobson, IBM Corporation - * Original Code: Paul Dorwin, IBM Corporation, Patrick Mochel, OSDL - * - * Copyright (C) 2002, IBM Corp. - * - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Modify for PC-9800 by Osamu Tomita - * - */ -#include -#include -#include - -struct i386_cpu cpu_devices[NR_CPUS]; - -static int __init topology_init(void) -{ - int i; - - for (i = 0; i < NR_CPUS; i++) - if (cpu_possible(i)) arch_register_cpu(i); - return 0; -} - -subsys_initcall(topology_init); diff -Nru a/arch/i386/mach-visws/mpparse.c b/arch/i386/mach-visws/mpparse.c --- a/arch/i386/mach-visws/mpparse.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/mach-visws/mpparse.c 2004-06-23 19:04:26 -07:00 @@ -57,12 +57,12 @@ boot_cpu_logical_apicid = logical_apicid; } - if (m->mpc_apicid > MAX_APICS) { + ver = m->mpc_apicver; + if ((ver >= 0x14 && m->mpc_apicid >= 0xff) || m->mpc_apicid >= 0xf) { printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n", m->mpc_apicid, MAX_APICS); return; } - ver = m->mpc_apicver; apic_cpus = apicid_to_cpu_present(m->mpc_apicid); physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus); diff -Nru a/arch/i386/mach-visws/traps.c b/arch/i386/mach-visws/traps.c --- a/arch/i386/mach-visws/traps.c 2004-06-23 19:04:27 -07:00 +++ b/arch/i386/mach-visws/traps.c 2004-06-23 19:04:27 -07:00 @@ -8,7 +8,6 @@ #include #include -#include #include #include #include "cobalt.h" diff -Nru a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c --- a/arch/i386/mach-voyager/voyager_basic.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/mach-voyager/voyager_basic.c 2004-06-23 19:04:26 -07:00 @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff -Nru a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c --- a/arch/i386/mach-voyager/voyager_smp.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/mach-voyager/voyager_smp.c 2004-06-23 19:04:26 -07:00 @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff -Nru a/arch/i386/mach-voyager/voyager_thread.c b/arch/i386/mach-voyager/voyager_thread.c --- a/arch/i386/mach-voyager/voyager_thread.c 2004-06-23 19:04:27 -07:00 +++ b/arch/i386/mach-voyager/voyager_thread.c 2004-06-23 19:04:27 -07:00 @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff -Nru a/arch/i386/math-emu/errors.c b/arch/i386/math-emu/errors.c --- a/arch/i386/math-emu/errors.c 2004-06-23 19:04:27 -07:00 +++ b/arch/i386/math-emu/errors.c 2004-06-23 19:04:27 -07:00 @@ -41,18 +41,18 @@ RE_ENTRANT_CHECK_OFF; /* No need to verify_area(), we have previously fetched these bytes. */ - printk("Unimplemented FPU Opcode at eip=%p : ", (void *) address); + printk("Unimplemented FPU Opcode at eip=%p : ", (void __user *) address); if ( FPU_CS == __USER_CS ) { while ( 1 ) { - FPU_get_user(byte1, (u_char *) address); + FPU_get_user(byte1, (u_char __user *) address); if ( (byte1 & 0xf8) == 0xd8 ) break; printk("[%02x]", byte1); address++; } printk("%02x ", byte1); - FPU_get_user(FPU_modrm, 1 + (u_char *) address); + FPU_get_user(FPU_modrm, 1 + (u_char __user *) address); if (FPU_modrm >= 0300) printk("%02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8, FPU_modrm & 7); @@ -98,7 +98,7 @@ #define MAX_PRINTED_BYTES 20 for ( i = 0; i < MAX_PRINTED_BYTES; i++ ) { - FPU_get_user(byte1, (u_char *) address); + FPU_get_user(byte1, (u_char __user *) address); if ( (byte1 & 0xf8) == 0xd8 ) { printk(" %02x", byte1); @@ -111,7 +111,7 @@ printk(" [more..]\n"); else { - FPU_get_user(FPU_modrm, 1 + (u_char *) address); + FPU_get_user(FPU_modrm, 1 + (u_char __user *) address); if (FPU_modrm >= 0300) printk(" %02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8, FPU_modrm & 7); diff -Nru a/arch/i386/math-emu/fpu_arith.c b/arch/i386/math-emu/fpu_arith.c --- a/arch/i386/math-emu/fpu_arith.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/math-emu/fpu_arith.c 2004-06-23 19:04:28 -07:00 @@ -16,7 +16,7 @@ #include "status_w.h" -void fadd__() +void fadd__(void) { /* fadd st,st(i) */ int i = FPU_rm; @@ -25,7 +25,7 @@ } -void fmul__() +void fmul__(void) { /* fmul st,st(i) */ int i = FPU_rm; @@ -35,7 +35,7 @@ -void fsub__() +void fsub__(void) { /* fsub st,st(i) */ clear_C1(); @@ -43,7 +43,7 @@ } -void fsubr_() +void fsubr_(void) { /* fsubr st,st(i) */ clear_C1(); @@ -51,7 +51,7 @@ } -void fdiv__() +void fdiv__(void) { /* fdiv st,st(i) */ clear_C1(); @@ -59,7 +59,7 @@ } -void fdivr_() +void fdivr_(void) { /* fdivr st,st(i) */ clear_C1(); @@ -68,7 +68,7 @@ -void fadd_i() +void fadd_i(void) { /* fadd st(i),st */ int i = FPU_rm; @@ -77,7 +77,7 @@ } -void fmul_i() +void fmul_i(void) { /* fmul st(i),st */ clear_C1(); @@ -85,7 +85,7 @@ } -void fsubri() +void fsubri(void) { /* fsubr st(i),st */ clear_C1(); @@ -93,7 +93,7 @@ } -void fsub_i() +void fsub_i(void) { /* fsub st(i),st */ clear_C1(); @@ -101,7 +101,7 @@ } -void fdivri() +void fdivri(void) { /* fdivr st(i),st */ clear_C1(); @@ -109,7 +109,7 @@ } -void fdiv_i() +void fdiv_i(void) { /* fdiv st(i),st */ clear_C1(); @@ -118,7 +118,7 @@ -void faddp_() +void faddp_(void) { /* faddp st(i),st */ int i = FPU_rm; @@ -128,7 +128,7 @@ } -void fmulp_() +void fmulp_(void) { /* fmulp st(i),st */ clear_C1(); @@ -138,7 +138,7 @@ -void fsubrp() +void fsubrp(void) { /* fsubrp st(i),st */ clear_C1(); @@ -147,7 +147,7 @@ } -void fsubp_() +void fsubp_(void) { /* fsubp st(i),st */ clear_C1(); @@ -156,7 +156,7 @@ } -void fdivrp() +void fdivrp(void) { /* fdivrp st(i),st */ clear_C1(); @@ -165,7 +165,7 @@ } -void fdivp_() +void fdivp_(void) { /* fdivp st(i),st */ clear_C1(); diff -Nru a/arch/i386/math-emu/fpu_aux.c b/arch/i386/math-emu/fpu_aux.c --- a/arch/i386/math-emu/fpu_aux.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/math-emu/fpu_aux.c 2004-06-23 19:04:25 -07:00 @@ -30,7 +30,7 @@ } /* Needs to be externally visible */ -void finit() +void finit(void) { control_word = 0x037f; partial_status = 0; @@ -58,7 +58,7 @@ fsetpm, FPU_illegal, FPU_illegal, FPU_illegal }; -void finit_() +void finit_(void) { (finit_table[FPU_rm])(); } @@ -75,7 +75,7 @@ FPU_illegal, FPU_illegal, FPU_illegal, FPU_illegal }; -void fstsw_() +void fstsw_(void) { (fstsw_table[FPU_rm])(); } @@ -86,13 +86,13 @@ FPU_illegal, FPU_illegal, FPU_illegal, FPU_illegal }; -void fp_nop() +void fp_nop(void) { (fp_nop_table[FPU_rm])(); } -void fld_i_() +void fld_i_(void) { FPU_REG *st_new_ptr; int i; @@ -124,7 +124,7 @@ } -void fxch_i() +void fxch_i(void) { /* fxch st(i) */ FPU_REG t; @@ -173,14 +173,14 @@ } -void ffree_() +void ffree_(void) { /* ffree st(i) */ FPU_settagi(FPU_rm, TAG_Empty); } -void ffreep() +void ffreep(void) { /* ffree st(i) + pop - unofficial code */ FPU_settagi(FPU_rm, TAG_Empty); @@ -188,14 +188,14 @@ } -void fst_i_() +void fst_i_(void) { /* fst st(i) */ FPU_copy_to_regi(&st(0), FPU_gettag0(), FPU_rm); } -void fstp_i() +void fstp_i(void) { /* fstp st(i) */ FPU_copy_to_regi(&st(0), FPU_gettag0(), FPU_rm); diff -Nru a/arch/i386/math-emu/fpu_entry.c b/arch/i386/math-emu/fpu_entry.c --- a/arch/i386/math-emu/fpu_entry.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/math-emu/fpu_entry.c 2004-06-23 19:04:28 -07:00 @@ -128,7 +128,7 @@ u_char emulating=0; #endif /* RE_ENTRANT_CHECKING */ -static int valid_prefix(u_char *Byte, u_char **fpu_eip, +static int valid_prefix(u_char *Byte, u_char __user **fpu_eip, overrides *override); asmlinkage void math_emulate(long arg) @@ -140,7 +140,7 @@ FPU_REG loaded_data; FPU_REG *st0_ptr; u_char loaded_tag, st0_tag; - void *data_address; + void __user *data_address; struct address data_sel_off; struct address entry_sel_off; unsigned long code_base = 0; @@ -192,7 +192,8 @@ math_abort(FPU_info, SIGILL); } - if ( SEG_D_SIZE(code_descriptor = LDT_DESCRIPTOR(FPU_CS)) ) + code_descriptor = LDT_DESCRIPTOR(FPU_CS); + if ( SEG_D_SIZE(code_descriptor) ) { /* The above test may be wrong, the book is not clear */ /* Segmented 32 bit protected mode */ @@ -214,7 +215,7 @@ if (current->ptrace & PT_PTRACED) FPU_lookahead = 0; - if ( !valid_prefix(&byte1, (u_char **)&FPU_EIP, + if ( !valid_prefix(&byte1, (u_char __user **)&FPU_EIP, &addr_modes.override) ) { RE_ENTRANT_CHECK_OFF; @@ -257,7 +258,7 @@ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(1); - FPU_get_user(FPU_modrm, (u_char *) FPU_EIP); + FPU_get_user(FPU_modrm, (u_char __user *) FPU_EIP); RE_ENTRANT_CHECK_ON; FPU_EIP++; @@ -336,23 +337,23 @@ switch ( (byte1 >> 1) & 3 ) { case 0: - unmasked = FPU_load_single((float *)data_address, + unmasked = FPU_load_single((float __user *)data_address, &loaded_data); loaded_tag = unmasked & 0xff; unmasked &= ~0xff; break; case 1: - loaded_tag = FPU_load_int32((long *)data_address, &loaded_data); + loaded_tag = FPU_load_int32((long __user *)data_address, &loaded_data); break; case 2: - unmasked = FPU_load_double((double *)data_address, + unmasked = FPU_load_double((double __user *)data_address, &loaded_data); loaded_tag = unmasked & 0xff; unmasked &= ~0xff; break; case 3: default: /* Used here to suppress gcc warnings. */ - loaded_tag = FPU_load_int16((short *)data_address, &loaded_data); + loaded_tag = FPU_load_int16((short __user *)data_address, &loaded_data); break; } @@ -563,7 +564,7 @@ if (FPU_lookahead && !need_resched()) { FPU_ORIG_EIP = FPU_EIP - code_base; - if ( valid_prefix(&byte1, (u_char **)&FPU_EIP, + if ( valid_prefix(&byte1, (u_char __user **)&FPU_EIP, &addr_modes.override) ) goto do_another_FPU_instruction; } @@ -579,11 +580,11 @@ all prefix bytes, further changes are needed in the emulator code which accesses user address space. Access to separate segments is important for msdos emulation. */ -static int valid_prefix(u_char *Byte, u_char **fpu_eip, +static int valid_prefix(u_char *Byte, u_char __user **fpu_eip, overrides *override) { u_char byte; - u_char *ip = *fpu_eip; + u_char __user *ip = *fpu_eip; *override = (overrides) { 0, 0, PREFIX_DEFAULT }; /* defaults */ @@ -679,9 +680,9 @@ #define sstatus_word() \ ((S387->swd & ~SW_Top & 0xffff) | ((S387->ftop << SW_Top_Shift) & SW_Top)) -int restore_i387_soft(void *s387, struct _fpstate *buf) +int restore_i387_soft(void *s387, struct _fpstate __user *buf) { - u_char *d = (u_char *)buf; + u_char __user *d = (u_char __user *)buf; int offset, other, i, tags, regnr, tag, newtop; RE_ENTRANT_CHECK_OFF; @@ -725,9 +726,9 @@ } -int save_i387_soft(void *s387, struct _fpstate * buf) +int save_i387_soft(void *s387, struct _fpstate __user * buf) { - u_char *d = (u_char *)buf; + u_char __user *d = (u_char __user *)buf; int offset = (S387->ftop & 7) * 10, other = 80 - offset; RE_ENTRANT_CHECK_OFF; diff -Nru a/arch/i386/math-emu/fpu_etc.c b/arch/i386/math-emu/fpu_etc.c --- a/arch/i386/math-emu/fpu_etc.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/math-emu/fpu_etc.c 2004-06-23 19:04:26 -07:00 @@ -137,7 +137,7 @@ ftst_, fxam, (FUNC_ST0)FPU_illegal, (FUNC_ST0)FPU_illegal }; -void FPU_etc() +void FPU_etc(void) { (fp_etc_table[FPU_rm])(&st(0), FPU_gettag0()); } diff -Nru a/arch/i386/math-emu/fpu_proto.h b/arch/i386/math-emu/fpu_proto.h --- a/arch/i386/math-emu/fpu_proto.h 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/math-emu/fpu_proto.h 2004-06-23 19:04:28 -07:00 @@ -77,13 +77,13 @@ extern void FPU_triga(void); extern void FPU_trigb(void); /* get_address.c */ -extern void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip, +extern void __user *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip, struct address *addr, fpu_addr_modes addr_modes); -extern void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip, +extern void __user *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip, struct address *addr, fpu_addr_modes addr_modes); /* load_store.c */ extern int FPU_load_store(u_char type, fpu_addr_modes addr_modes, - void *data_address); + void __user *data_address); /* poly_2xm1.c */ extern int poly_2xm1(u_char sign, FPU_REG *arg, FPU_REG *result); /* poly_atan.c */ @@ -112,26 +112,26 @@ /* reg_constant.c */ extern void fconst(void); /* reg_ld_str.c */ -extern int FPU_load_extended(long double *s, int stnr); -extern int FPU_load_double(double *dfloat, FPU_REG *loaded_data); -extern int FPU_load_single(float *single, FPU_REG *loaded_data); -extern int FPU_load_int64(long long *_s); -extern int FPU_load_int32(long *_s, FPU_REG *loaded_data); -extern int FPU_load_int16(short *_s, FPU_REG *loaded_data); -extern int FPU_load_bcd(u_char *s); +extern int FPU_load_extended(long double __user *s, int stnr); +extern int FPU_load_double(double __user *dfloat, FPU_REG *loaded_data); +extern int FPU_load_single(float __user *single, FPU_REG *loaded_data); +extern int FPU_load_int64(long long __user *_s); +extern int FPU_load_int32(long __user *_s, FPU_REG *loaded_data); +extern int FPU_load_int16(short __user *_s, FPU_REG *loaded_data); +extern int FPU_load_bcd(u_char __user *s); extern int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, - long double *d); -extern int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat); -extern int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single); -extern int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d); -extern int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d); -extern int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d); -extern int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d); + long double __user *d); +extern int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat); +extern int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float __user *single); +extern int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long __user *d); +extern int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long __user *d); +extern int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short __user *d); +extern int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char __user *d); extern int FPU_round_to_int(FPU_REG *r, u_char tag); -extern u_char *fldenv(fpu_addr_modes addr_modes, u_char *s); -extern void frstor(fpu_addr_modes addr_modes, u_char *data_address); -extern u_char *fstenv(fpu_addr_modes addr_modes, u_char *d); -extern void fsave(fpu_addr_modes addr_modes, u_char *data_address); +extern u_char __user *fldenv(fpu_addr_modes addr_modes, u_char __user *s); +extern void frstor(fpu_addr_modes addr_modes, u_char __user *data_address); +extern u_char __user *fstenv(fpu_addr_modes addr_modes, u_char __user *d); +extern void fsave(fpu_addr_modes addr_modes, u_char __user *data_address); extern int FPU_tagof(FPU_REG *ptr); /* reg_mul.c */ extern int FPU_mul(FPU_REG const *b, u_char tagb, int deststnr, int control_w); diff -Nru a/arch/i386/math-emu/fpu_system.h b/arch/i386/math-emu/fpu_system.h --- a/arch/i386/math-emu/fpu_system.h 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/math-emu/fpu_system.h 2004-06-23 19:04:26 -07:00 @@ -80,7 +80,7 @@ /* A simpler test than verify_area() can probably be done for FPU_code_verify_area() because the only possible error is to step past the upper boundary of a legal code area. */ -#define FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void *)FPU_EIP,z) +#define FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void __user *)FPU_EIP,z) #endif #define FPU_get_user(x,y) get_user((x),(y)) diff -Nru a/arch/i386/math-emu/get_address.c b/arch/i386/math-emu/get_address.c --- a/arch/i386/math-emu/get_address.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/math-emu/get_address.c 2004-06-23 19:04:28 -07:00 @@ -82,7 +82,7 @@ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(1); - FPU_get_user(base, (u_char *) (*fpu_eip)); /* The SIB byte */ + FPU_get_user(base, (u_char __user *) (*fpu_eip)); /* The SIB byte */ RE_ENTRANT_CHECK_ON; (*fpu_eip)++; ss = base >> 6; @@ -112,7 +112,7 @@ long displacement; RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(1); - FPU_get_user(displacement, (signed char *) (*fpu_eip)); + FPU_get_user(displacement, (signed char __user *) (*fpu_eip)); offset += displacement; RE_ENTRANT_CHECK_ON; (*fpu_eip)++; @@ -123,7 +123,7 @@ long displacement; RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(4); - FPU_get_user(displacement, (long *) (*fpu_eip)); + FPU_get_user(displacement, (long __user *) (*fpu_eip)); offset += displacement; RE_ENTRANT_CHECK_ON; (*fpu_eip) += 4; @@ -241,7 +241,7 @@ */ -void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip, +void __user *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip, struct address *addr, fpu_addr_modes addr_modes) { @@ -277,24 +277,24 @@ /* Special case: disp32 */ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(4); - FPU_get_user(address, (unsigned long *) (*fpu_eip)); + FPU_get_user(address, (unsigned long __user *) (*fpu_eip)); (*fpu_eip) += 4; RE_ENTRANT_CHECK_ON; addr->offset = address; - return (void *) address; + return (void __user *) address; } else { address = *cpu_reg_ptr; /* Just return the contents of the cpu register */ addr->offset = address; - return (void *) address; + return (void __user *) address; } case 1: /* 8 bit signed displacement */ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(1); - FPU_get_user(address, (signed char *) (*fpu_eip)); + FPU_get_user(address, (signed char __user *) (*fpu_eip)); RE_ENTRANT_CHECK_ON; (*fpu_eip)++; break; @@ -302,7 +302,7 @@ /* 32 bit displacement */ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(4); - FPU_get_user(address, (long *) (*fpu_eip)); + FPU_get_user(address, (long __user *) (*fpu_eip)); (*fpu_eip) += 4; RE_ENTRANT_CHECK_ON; break; @@ -331,11 +331,11 @@ EXCEPTION(EX_INTERNAL|0x133); } - return (void *)address; + return (void __user *)address; } -void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip, +void __user *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip, struct address *addr, fpu_addr_modes addr_modes) { @@ -363,7 +363,7 @@ /* Special case: disp16 */ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(2); - FPU_get_user(address, (unsigned short *) (*fpu_eip)); + FPU_get_user(address, (unsigned short __user *) (*fpu_eip)); (*fpu_eip) += 2; RE_ENTRANT_CHECK_ON; goto add_segment; @@ -373,7 +373,7 @@ /* 8 bit signed displacement */ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(1); - FPU_get_user(address, (signed char *) (*fpu_eip)); + FPU_get_user(address, (signed char __user *) (*fpu_eip)); RE_ENTRANT_CHECK_ON; (*fpu_eip)++; break; @@ -381,7 +381,7 @@ /* 16 bit displacement */ RE_ENTRANT_CHECK_OFF; FPU_code_verify_area(2); - FPU_get_user(address, (unsigned short *) (*fpu_eip)); + FPU_get_user(address, (unsigned short __user *) (*fpu_eip)); (*fpu_eip) += 2; RE_ENTRANT_CHECK_ON; break; @@ -445,5 +445,5 @@ EXCEPTION(EX_INTERNAL|0x131); } - return (void *)address ; + return (void __user *)address ; } diff -Nru a/arch/i386/math-emu/load_store.c b/arch/i386/math-emu/load_store.c --- a/arch/i386/math-emu/load_store.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/math-emu/load_store.c 2004-06-23 19:04:25 -07:00 @@ -61,7 +61,7 @@ }; int FPU_load_store(u_char type, fpu_addr_modes addr_modes, - void *data_address) + void __user *data_address) { FPU_REG loaded_data; FPU_REG *st0_ptr; @@ -119,7 +119,7 @@ { case 000: /* fld m32real */ clear_C1(); - loaded_tag = FPU_load_single((float *)data_address, &loaded_data); + loaded_tag = FPU_load_single((float __user *)data_address, &loaded_data); if ( (loaded_tag == TAG_Special) && isNaN(&loaded_data) && (real_1op_NaN(&loaded_data) < 0) ) @@ -131,12 +131,12 @@ break; case 001: /* fild m32int */ clear_C1(); - loaded_tag = FPU_load_int32((long *)data_address, &loaded_data); + loaded_tag = FPU_load_int32((long __user *)data_address, &loaded_data); FPU_copy_to_reg0(&loaded_data, loaded_tag); break; case 002: /* fld m64real */ clear_C1(); - loaded_tag = FPU_load_double((double *)data_address, &loaded_data); + loaded_tag = FPU_load_double((double __user *)data_address, &loaded_data); if ( (loaded_tag == TAG_Special) && isNaN(&loaded_data) && (real_1op_NaN(&loaded_data) < 0) ) @@ -148,68 +148,68 @@ break; case 003: /* fild m16int */ clear_C1(); - loaded_tag = FPU_load_int16((short *)data_address, &loaded_data); + loaded_tag = FPU_load_int16((short __user *)data_address, &loaded_data); FPU_copy_to_reg0(&loaded_data, loaded_tag); break; case 010: /* fst m32real */ clear_C1(); - FPU_store_single(st0_ptr, st0_tag, (float *)data_address); + FPU_store_single(st0_ptr, st0_tag, (float __user *)data_address); break; case 011: /* fist m32int */ clear_C1(); - FPU_store_int32(st0_ptr, st0_tag, (long *)data_address); + FPU_store_int32(st0_ptr, st0_tag, (long __user *)data_address); break; case 012: /* fst m64real */ clear_C1(); - FPU_store_double(st0_ptr, st0_tag, (double *)data_address); + FPU_store_double(st0_ptr, st0_tag, (double __user *)data_address); break; case 013: /* fist m16int */ clear_C1(); - FPU_store_int16(st0_ptr, st0_tag, (short *)data_address); + FPU_store_int16(st0_ptr, st0_tag, (short __user *)data_address); break; case 014: /* fstp m32real */ clear_C1(); - if ( FPU_store_single(st0_ptr, st0_tag, (float *)data_address) ) + if ( FPU_store_single(st0_ptr, st0_tag, (float __user *)data_address) ) pop_0(); /* pop only if the number was actually stored (see the 80486 manual p16-28) */ break; case 015: /* fistp m32int */ clear_C1(); - if ( FPU_store_int32(st0_ptr, st0_tag, (long *)data_address) ) + if ( FPU_store_int32(st0_ptr, st0_tag, (long __user *)data_address) ) pop_0(); /* pop only if the number was actually stored (see the 80486 manual p16-28) */ break; case 016: /* fstp m64real */ clear_C1(); - if ( FPU_store_double(st0_ptr, st0_tag, (double *)data_address) ) + if ( FPU_store_double(st0_ptr, st0_tag, (double __user *)data_address) ) pop_0(); /* pop only if the number was actually stored (see the 80486 manual p16-28) */ break; case 017: /* fistp m16int */ clear_C1(); - if ( FPU_store_int16(st0_ptr, st0_tag, (short *)data_address) ) + if ( FPU_store_int16(st0_ptr, st0_tag, (short __user *)data_address) ) pop_0(); /* pop only if the number was actually stored (see the 80486 manual p16-28) */ break; case 020: /* fldenv m14/28byte */ - fldenv(addr_modes, (u_char *)data_address); + fldenv(addr_modes, (u_char __user *)data_address); /* Ensure that the values just loaded are not changed by fix-up operations. */ return 1; case 022: /* frstor m94/108byte */ - frstor(addr_modes, (u_char *)data_address); + frstor(addr_modes, (u_char __user *)data_address); /* Ensure that the values just loaded are not changed by fix-up operations. */ return 1; case 023: /* fbld m80dec */ clear_C1(); - loaded_tag = FPU_load_bcd((u_char *)data_address); + loaded_tag = FPU_load_bcd((u_char __user *)data_address); FPU_settag0(loaded_tag); break; case 024: /* fldcw */ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_READ, data_address, 2); - FPU_get_user(control_word, (unsigned short *) data_address); + FPU_get_user(control_word, (unsigned short __user *) data_address); RE_ENTRANT_CHECK_ON; if ( partial_status & ~control_word & CW_Exceptions ) partial_status |= (SW_Summary | SW_Backward); @@ -221,47 +221,47 @@ return 1; case 025: /* fld m80real */ clear_C1(); - loaded_tag = FPU_load_extended((long double *)data_address, 0); + loaded_tag = FPU_load_extended((long double __user *)data_address, 0); FPU_settag0(loaded_tag); break; case 027: /* fild m64int */ clear_C1(); - loaded_tag = FPU_load_int64((long long *)data_address); + loaded_tag = FPU_load_int64((long long __user *)data_address); FPU_settag0(loaded_tag); break; case 030: /* fstenv m14/28byte */ - fstenv(addr_modes, (u_char *)data_address); + fstenv(addr_modes, (u_char __user *)data_address); return 1; case 032: /* fsave */ - fsave(addr_modes, (u_char *)data_address); + fsave(addr_modes, (u_char __user *)data_address); return 1; case 033: /* fbstp m80dec */ clear_C1(); - if ( FPU_store_bcd(st0_ptr, st0_tag, (u_char *)data_address) ) + if ( FPU_store_bcd(st0_ptr, st0_tag, (u_char __user *)data_address) ) pop_0(); /* pop only if the number was actually stored (see the 80486 manual p16-28) */ break; case 034: /* fstcw m16int */ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE,data_address,2); - FPU_put_user(control_word, (unsigned short *) data_address); + FPU_put_user(control_word, (unsigned short __user *) data_address); RE_ENTRANT_CHECK_ON; return 1; case 035: /* fstp m80real */ clear_C1(); - if ( FPU_store_extended(st0_ptr, st0_tag, (long double *)data_address) ) + if ( FPU_store_extended(st0_ptr, st0_tag, (long double __user *)data_address) ) pop_0(); /* pop only if the number was actually stored (see the 80486 manual p16-28) */ break; case 036: /* fstsw m2byte */ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE,data_address,2); - FPU_put_user(status_word(),(unsigned short *) data_address); + FPU_put_user(status_word(),(unsigned short __user *) data_address); RE_ENTRANT_CHECK_ON; return 1; case 037: /* fistp m64int */ clear_C1(); - if ( FPU_store_int64(st0_ptr, st0_tag, (long long *)data_address) ) + if ( FPU_store_int64(st0_ptr, st0_tag, (long long __user *)data_address) ) pop_0(); /* pop only if the number was actually stored (see the 80486 manual p16-28) */ break; diff -Nru a/arch/i386/math-emu/reg_compare.c b/arch/i386/math-emu/reg_compare.c --- a/arch/i386/math-emu/reg_compare.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/math-emu/reg_compare.c 2004-06-23 19:04:28 -07:00 @@ -324,14 +324,14 @@ /*---------------------------------------------------------------------------*/ -void fcom_st() +void fcom_st(void) { /* fcom st(i) */ compare_st_st(FPU_rm); } -void fcompst() +void fcompst(void) { /* fcomp st(i) */ if ( !compare_st_st(FPU_rm) ) @@ -339,7 +339,7 @@ } -void fcompp() +void fcompp(void) { /* fcompp */ if (FPU_rm != 1) @@ -352,7 +352,7 @@ } -void fucom_() +void fucom_(void) { /* fucom st(i) */ compare_u_st_st(FPU_rm); @@ -360,7 +360,7 @@ } -void fucomp() +void fucomp(void) { /* fucomp st(i) */ if ( !compare_u_st_st(FPU_rm) ) @@ -368,7 +368,7 @@ } -void fucompp() +void fucompp(void) { /* fucompp */ if (FPU_rm == 1) diff -Nru a/arch/i386/math-emu/reg_ld_str.c b/arch/i386/math-emu/reg_ld_str.c --- a/arch/i386/math-emu/reg_ld_str.c 2004-06-23 19:04:27 -07:00 +++ b/arch/i386/math-emu/reg_ld_str.c 2004-06-23 19:04:27 -07:00 @@ -86,7 +86,7 @@ /* Get a long double from user memory */ -int FPU_load_extended(long double *s, int stnr) +int FPU_load_extended(long double __user *s, int stnr) { FPU_REG *sti_ptr = &st(stnr); @@ -100,15 +100,15 @@ /* Get a double from user memory */ -int FPU_load_double(double *dfloat, FPU_REG *loaded_data) +int FPU_load_double(double __user *dfloat, FPU_REG *loaded_data) { int exp, tag, negative; unsigned m64, l64; RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_READ, dfloat, 8); - FPU_get_user(m64, 1 + (unsigned long *) dfloat); - FPU_get_user(l64, (unsigned long *) dfloat); + FPU_get_user(m64, 1 + (unsigned long __user *) dfloat); + FPU_get_user(l64, (unsigned long __user *) dfloat); RE_ENTRANT_CHECK_ON; negative = (m64 & 0x80000000) ? SIGN_Negative : SIGN_Positive; @@ -172,14 +172,14 @@ /* Get a float from user memory */ -int FPU_load_single(float *single, FPU_REG *loaded_data) +int FPU_load_single(float __user *single, FPU_REG *loaded_data) { unsigned m32; int exp, tag, negative; RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_READ, single, 4); - FPU_get_user(m32, (unsigned long *) single); + FPU_get_user(m32, (unsigned long __user *) single); RE_ENTRANT_CHECK_ON; negative = (m32 & 0x80000000) ? SIGN_Negative : SIGN_Positive; @@ -236,7 +236,7 @@ /* Get a long long from user memory */ -int FPU_load_int64(long long *_s) +int FPU_load_int64(long long __user *_s) { long long s; int sign; @@ -268,7 +268,7 @@ /* Get a long from user memory */ -int FPU_load_int32(long *_s, FPU_REG *loaded_data) +int FPU_load_int32(long __user *_s, FPU_REG *loaded_data) { long s; int negative; @@ -297,7 +297,7 @@ /* Get a short from user memory */ -int FPU_load_int16(short *_s, FPU_REG *loaded_data) +int FPU_load_int16(short __user *_s, FPU_REG *loaded_data) { int s, negative; @@ -326,7 +326,7 @@ /* Get a packed bcd array from user memory */ -int FPU_load_bcd(u_char *s) +int FPU_load_bcd(u_char __user *s) { FPU_REG *st0_ptr = &st(0); int pos; @@ -341,7 +341,7 @@ { l *= 10; RE_ENTRANT_CHECK_OFF; - FPU_get_user(bcd, (u_char *) s+pos); + FPU_get_user(bcd, s+pos); RE_ENTRANT_CHECK_ON; l += bcd >> 4; l *= 10; @@ -349,7 +349,7 @@ } RE_ENTRANT_CHECK_OFF; - FPU_get_user(sign, (u_char *) s+9); + FPU_get_user(sign, s+9); sign = sign & 0x80 ? SIGN_Negative : SIGN_Positive; RE_ENTRANT_CHECK_ON; @@ -369,7 +369,7 @@ /*===========================================================================*/ /* Put a long double into user memory */ -int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d) +int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double __user *d) { /* The only exception raised by an attempt to store to an @@ -382,9 +382,9 @@ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE, d, 10); - FPU_put_user(st0_ptr->sigl, (unsigned long *) d); - FPU_put_user(st0_ptr->sigh, (unsigned long *) ((u_char *)d + 4)); - FPU_put_user(exponent16(st0_ptr), (unsigned short *) ((u_char *)d + 8)); + FPU_put_user(st0_ptr->sigl, (unsigned long __user *) d); + FPU_put_user(st0_ptr->sigh, (unsigned long __user *) ((u_char __user *)d + 4)); + FPU_put_user(exponent16(st0_ptr), (unsigned short __user *) ((u_char __user *)d + 8)); RE_ENTRANT_CHECK_ON; return 1; @@ -398,9 +398,9 @@ /* Put out the QNaN indefinite */ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE,d,10); - FPU_put_user(0, (unsigned long *) d); - FPU_put_user(0xc0000000, 1 + (unsigned long *) d); - FPU_put_user(0xffff, 4 + (short *) d); + FPU_put_user(0, (unsigned long __user *) d); + FPU_put_user(0xc0000000, 1 + (unsigned long __user *) d); + FPU_put_user(0xffff, 4 + (short __user *) d); RE_ENTRANT_CHECK_ON; return 1; } @@ -411,7 +411,7 @@ /* Put a double into user memory */ -int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat) +int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat) { unsigned long l[2]; unsigned long increment = 0; /* avoid gcc warnings */ @@ -607,9 +607,9 @@ /* The masked response */ /* Put out the QNaN indefinite */ RE_ENTRANT_CHECK_OFF; - FPU_verify_area(VERIFY_WRITE,(void *)dfloat,8); - FPU_put_user(0, (unsigned long *) dfloat); - FPU_put_user(0xfff80000, 1 + (unsigned long *) dfloat); + FPU_verify_area(VERIFY_WRITE,dfloat,8); + FPU_put_user(0, (unsigned long __user *) dfloat); + FPU_put_user(0xfff80000, 1 + (unsigned long __user *) dfloat); RE_ENTRANT_CHECK_ON; return 1; } @@ -620,9 +620,9 @@ l[1] |= 0x80000000; RE_ENTRANT_CHECK_OFF; - FPU_verify_area(VERIFY_WRITE,(void *)dfloat,8); - FPU_put_user(l[0], (unsigned long *)dfloat); - FPU_put_user(l[1], 1 + (unsigned long *)dfloat); + FPU_verify_area(VERIFY_WRITE,dfloat,8); + FPU_put_user(l[0], (unsigned long __user *)dfloat); + FPU_put_user(l[1], 1 + (unsigned long __user *)dfloat); RE_ENTRANT_CHECK_ON; return 1; @@ -630,7 +630,7 @@ /* Put a float into user memory */ -int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single) +int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float __user *single) { long templ = 0; unsigned long increment = 0; /* avoid gcc warnings */ @@ -826,8 +826,8 @@ /* The masked response */ /* Put out the QNaN indefinite */ RE_ENTRANT_CHECK_OFF; - FPU_verify_area(VERIFY_WRITE,(void *)single,4); - FPU_put_user(0xffc00000, (unsigned long *) single); + FPU_verify_area(VERIFY_WRITE,single,4); + FPU_put_user(0xffc00000, (unsigned long __user *) single); RE_ENTRANT_CHECK_ON; return 1; } @@ -845,8 +845,8 @@ templ |= 0x80000000; RE_ENTRANT_CHECK_OFF; - FPU_verify_area(VERIFY_WRITE,(void *)single,4); - FPU_put_user(templ,(unsigned long *) single); + FPU_verify_area(VERIFY_WRITE,single,4); + FPU_put_user(templ,(unsigned long __user *) single); RE_ENTRANT_CHECK_ON; return 1; @@ -854,7 +854,7 @@ /* Put a long long into user memory */ -int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d) +int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long __user *d) { FPU_REG t; long long tll; @@ -906,7 +906,7 @@ } RE_ENTRANT_CHECK_OFF; - FPU_verify_area(VERIFY_WRITE,(void *)d,8); + FPU_verify_area(VERIFY_WRITE,d,8); copy_to_user(d, &tll, 8); RE_ENTRANT_CHECK_ON; @@ -915,7 +915,7 @@ /* Put a long into user memory */ -int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d) +int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long __user *d) { FPU_REG t; int precision_loss; @@ -964,7 +964,7 @@ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE,d,4); - FPU_put_user(t.sigl, (unsigned long *) d); + FPU_put_user(t.sigl, (unsigned long __user *) d); RE_ENTRANT_CHECK_ON; return 1; @@ -972,7 +972,7 @@ /* Put a short into user memory */ -int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d) +int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short __user *d) { FPU_REG t; int precision_loss; @@ -1021,7 +1021,7 @@ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE,d,2); - FPU_put_user((short)t.sigl,(short *) d); + FPU_put_user((short)t.sigl, d); RE_ENTRANT_CHECK_ON; return 1; @@ -1029,7 +1029,7 @@ /* Put a packed bcd array into user memory */ -int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d) +int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char __user *d) { FPU_REG t; unsigned long long ll; @@ -1071,10 +1071,10 @@ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE,d,10); for ( i = 0; i < 7; i++) - FPU_put_user(0, (u_char *) d+i); /* These bytes "undefined" */ - FPU_put_user(0xc0, (u_char *) d+7); /* This byte "undefined" */ - FPU_put_user(0xff, (u_char *) d+8); - FPU_put_user(0xff, (u_char *) d+9); + FPU_put_user(0, d+i); /* These bytes "undefined" */ + FPU_put_user(0xc0, d+7); /* This byte "undefined" */ + FPU_put_user(0xff, d+8); + FPU_put_user(0xff, d+9); RE_ENTRANT_CHECK_ON; return 1; } @@ -1095,11 +1095,11 @@ b = FPU_div_small(&ll, 10); b |= (FPU_div_small(&ll, 10)) << 4; RE_ENTRANT_CHECK_OFF; - FPU_put_user(b,(u_char *) d+i); + FPU_put_user(b, d+i); RE_ENTRANT_CHECK_ON; } RE_ENTRANT_CHECK_OFF; - FPU_put_user(sign,(u_char *) d+9); + FPU_put_user(sign, d+9); RE_ENTRANT_CHECK_ON; return 1; @@ -1175,7 +1175,7 @@ /*===========================================================================*/ -u_char *fldenv(fpu_addr_modes addr_modes, u_char *s) +u_char __user *fldenv(fpu_addr_modes addr_modes, u_char __user *s) { unsigned short tag_word = 0; u_char tag; @@ -1187,13 +1187,13 @@ { RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_READ, s, 0x0e); - FPU_get_user(control_word, (unsigned short *) s); - FPU_get_user(partial_status, (unsigned short *) (s+2)); - FPU_get_user(tag_word, (unsigned short *) (s+4)); - FPU_get_user(instruction_address.offset, (unsigned short *) (s+6)); - FPU_get_user(instruction_address.selector, (unsigned short *) (s+8)); - FPU_get_user(operand_address.offset, (unsigned short *) (s+0x0a)); - FPU_get_user(operand_address.selector, (unsigned short *) (s+0x0c)); + FPU_get_user(control_word, (unsigned short __user *) s); + FPU_get_user(partial_status, (unsigned short __user *) (s+2)); + FPU_get_user(tag_word, (unsigned short __user *) (s+4)); + FPU_get_user(instruction_address.offset, (unsigned short __user *) (s+6)); + FPU_get_user(instruction_address.selector, (unsigned short __user *) (s+8)); + FPU_get_user(operand_address.offset, (unsigned short __user *) (s+0x0a)); + FPU_get_user(operand_address.selector, (unsigned short __user *) (s+0x0c)); RE_ENTRANT_CHECK_ON; s += 0x0e; if ( addr_modes.default_mode == VM86 ) @@ -1207,14 +1207,14 @@ { RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_READ, s, 0x1c); - FPU_get_user(control_word, (unsigned short *) s); - FPU_get_user(partial_status, (unsigned short *) (s+4)); - FPU_get_user(tag_word, (unsigned short *) (s+8)); - FPU_get_user(instruction_address.offset, (unsigned long *) (s+0x0c)); - FPU_get_user(instruction_address.selector, (unsigned short *) (s+0x10)); - FPU_get_user(instruction_address.opcode, (unsigned short *) (s+0x12)); - FPU_get_user(operand_address.offset, (unsigned long *) (s+0x14)); - FPU_get_user(operand_address.selector, (unsigned long *) (s+0x18)); + FPU_get_user(control_word, (unsigned short __user *) s); + FPU_get_user(partial_status, (unsigned short __user *) (s+4)); + FPU_get_user(tag_word, (unsigned short __user *) (s+8)); + FPU_get_user(instruction_address.offset, (unsigned long __user *) (s+0x0c)); + FPU_get_user(instruction_address.selector, (unsigned short __user *) (s+0x10)); + FPU_get_user(instruction_address.opcode, (unsigned short __user *) (s+0x12)); + FPU_get_user(operand_address.offset, (unsigned long __user *) (s+0x14)); + FPU_get_user(operand_address.selector, (unsigned long __user *) (s+0x18)); RE_ENTRANT_CHECK_ON; s += 0x1c; } @@ -1266,10 +1266,10 @@ } -void frstor(fpu_addr_modes addr_modes, u_char *data_address) +void frstor(fpu_addr_modes addr_modes, u_char __user *data_address) { int i, regnr; - u_char *s = fldenv(addr_modes, data_address); + u_char __user *s = fldenv(addr_modes, data_address); int offset = (top & 7) * 10, other = 80 - offset; /* Copy all registers in stack order. */ @@ -1291,7 +1291,7 @@ } -u_char *fstenv(fpu_addr_modes addr_modes, u_char *d) +u_char __user *fstenv(fpu_addr_modes addr_modes, u_char __user *d) { if ( (addr_modes.default_mode == VM86) || ((addr_modes.default_mode == PM16) @@ -1300,25 +1300,25 @@ RE_ENTRANT_CHECK_OFF; FPU_verify_area(VERIFY_WRITE,d,14); #ifdef PECULIAR_486 - FPU_put_user(control_word & ~0xe080, (unsigned long *) d); + FPU_put_user(control_word & ~0xe080, (unsigned long __user *) d); #else - FPU_put_user(control_word, (unsigned short *) d); + FPU_put_user(control_word, (unsigned short __user *) d); #endif /* PECULIAR_486 */ - FPU_put_user(status_word(), (unsigned short *) (d+2)); - FPU_put_user(fpu_tag_word, (unsigned short *) (d+4)); - FPU_put_user(instruction_address.offset, (unsigned short *) (d+6)); - FPU_put_user(operand_address.offset, (unsigned short *) (d+0x0a)); + FPU_put_user(status_word(), (unsigned short __user *) (d+2)); + FPU_put_user(fpu_tag_word, (unsigned short __user *) (d+4)); + FPU_put_user(instruction_address.offset, (unsigned short __user *) (d+6)); + FPU_put_user(operand_address.offset, (unsigned short __user *) (d+0x0a)); if ( addr_modes.default_mode == VM86 ) { FPU_put_user((instruction_address.offset & 0xf0000) >> 4, - (unsigned short *) (d+8)); + (unsigned short __user *) (d+8)); FPU_put_user((operand_address.offset & 0xf0000) >> 4, - (unsigned short *) (d+0x0c)); + (unsigned short __user *) (d+0x0c)); } else { - FPU_put_user(instruction_address.selector, (unsigned short *) (d+8)); - FPU_put_user(operand_address.selector, (unsigned short *) (d+0x0c)); + FPU_put_user(instruction_address.selector, (unsigned short __user *) (d+8)); + FPU_put_user(operand_address.selector, (unsigned short __user *) (d+0x0c)); } RE_ENTRANT_CHECK_ON; d += 0x0e; @@ -1348,9 +1348,9 @@ } -void fsave(fpu_addr_modes addr_modes, u_char *data_address) +void fsave(fpu_addr_modes addr_modes, u_char __user *data_address) { - u_char *d; + u_char __user *d; int offset = (top & 7) * 10, other = 80 - offset; d = fstenv(addr_modes, data_address); diff -Nru a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c --- a/arch/i386/mm/fault.c 2004-06-23 19:04:25 -07:00 +++ b/arch/i386/mm/fault.c 2004-06-23 19:04:25 -07:00 @@ -24,7 +24,6 @@ #include #include -#include #include #include diff -Nru a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c --- a/arch/i386/mm/hugetlbpage.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/mm/hugetlbpage.c 2004-06-23 19:04:28 -07:00 @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -245,8 +244,15 @@ ret = -ENOMEM; goto out; } - if (!pte_none(*pte)) - continue; + + if (!pte_none(*pte)) { + pmd_t *pmd = (pmd_t *) pte; + + page = pmd_page(*pmd); + pmd_clear(pmd); + dec_page_state(nr_page_table_pages); + page_cache_release(page); + } idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT)); diff -Nru a/arch/i386/mm/init.c b/arch/i386/mm/init.c --- a/arch/i386/mm/init.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/mm/init.c 2004-06-23 19:04:28 -07:00 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff -Nru a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c --- a/arch/i386/mm/ioremap.c 2004-06-23 19:04:26 -07:00 +++ b/arch/i386/mm/ioremap.c 2004-06-23 19:04:26 -07:00 @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff -Nru a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c --- a/arch/i386/pci/acpi.c 2004-06-23 19:04:27 -07:00 +++ b/arch/i386/pci/acpi.c 2004-06-23 19:04:27 -07:00 @@ -1,6 +1,8 @@ #include #include #include +#include +#include #include "pci.h" struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum) @@ -15,18 +17,31 @@ static int __init pci_acpi_init(void) { + struct pci_dev *dev = NULL; + if (pcibios_scanned) return 0; - if (!acpi_noirq) { - if (!acpi_pci_irq_init()) { - printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); - pcibios_scanned++; - pcibios_enable_irq = acpi_pci_irq_enable; - } else - printk(KERN_WARNING "PCI: Invalid ACPI-PCI IRQ routing table\n"); + if (acpi_noirq) + return 0; - } + printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); + acpi_irq_penalty_init(); + pcibios_scanned++; + pcibios_enable_irq = acpi_pci_irq_enable; + + /* + * PCI IRQ routing is set up by pci_enable_device(), but we + * also do it here in case there are still broken drivers that + * don't use pci_enable_device(). + */ + while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) + acpi_pci_irq_enable(dev); + +#ifdef CONFIG_X86_IO_APIC + if (acpi_ioapic) + print_IO_APIC(); +#endif return 0; } diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c --- a/arch/i386/pci/irq.c 2004-06-23 19:04:29 -07:00 +++ b/arch/i386/pci/irq.c 2004-06-23 19:04:29 -07:00 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -22,7 +23,7 @@ #define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24)) #define PIRQ_VERSION 0x0100 -int broken_hp_bios_irq9; +static int broken_hp_bios_irq9; static struct irq_routing_table *pirq_table; @@ -893,6 +894,33 @@ } } +/* + * Work around broken HP Pavilion Notebooks which assign USB to + * IRQ 9 even though it is actually wired to IRQ 11 + */ +static int __init fix_broken_hp_bios_irq9(struct dmi_system_id *d) +{ + if (!broken_hp_bios_irq9) { + broken_hp_bios_irq9 = 1; + printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", d->ident); + } + return 0; +} + +static struct dmi_system_id __initdata pciirq_dmi_table[] = { + { + .callback = fix_broken_hp_bios_irq9, + .ident = "HP Pavilion N5400 Series Laptop", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_BIOS_VERSION, "GE.M1.03"), + DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook Model GE"), + DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"), + }, + }, + { } +}; + static int __init pcibios_irq_init(void) { DBG("PCI: IRQ init\n"); @@ -900,6 +928,8 @@ if (pcibios_enable_irq || raw_pci_ops == NULL) return 0; + dmi_check_system(pciirq_dmi_table); + pirq_table = pirq_find_routing_table(); #ifdef CONFIG_PCI_BIOS @@ -1000,7 +1030,7 @@ /* VIA bridges use interrupt line for apic/pci steering across the V-Link */ else if (interrupt_line_quirk) - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq & 15); return 0; } diff -Nru a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c --- a/arch/i386/pci/visws.c 2004-06-23 19:04:28 -07:00 +++ b/arch/i386/pci/visws.c 2004-06-23 19:04:28 -07:00 @@ -15,8 +15,6 @@ #include "pci.h" -int broken_hp_bios_irq9; - extern struct pci_raw_ops pci_direct_conf1; static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig 2004-06-23 19:04:28 -07:00 +++ b/arch/ia64/Kconfig 2004-06-23 19:04:28 -07:00 @@ -149,20 +149,6 @@ default "6" if ITANIUM # align cache-sensitive data to 64 bytes -config MCKINLEY_ASTEP_SPECIFIC - bool "McKinley A-step specific code" - depends on MCKINLEY - help - Select this option to build a kernel for an IA-64 McKinley prototype - system with any A-stepping CPU. - -config MCKINLEY_A0_SPECIFIC - bool "McKinley A0/A1-step specific code" - depends on MCKINLEY_ASTEP_SPECIFIC - help - Select this option to build a kernel for an IA-64 McKinley prototype - system with an A0 or A1 stepping CPU. - config NUMA bool "NUMA support" depends on !IA64_HP_SIM diff -Nru a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig --- a/arch/ia64/configs/sn2_defconfig 2004-06-23 19:04:25 -07:00 +++ b/arch/ia64/configs/sn2_defconfig 2004-06-23 19:04:25 -07:00 @@ -14,18 +14,22 @@ # CONFIG_SWAP=y CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=20 CONFIG_HOTPLUG=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # @@ -60,7 +64,6 @@ CONFIG_IA64_PAGE_SIZE_16KB=y # CONFIG_IA64_PAGE_SIZE_64KB is not set CONFIG_IA64_L1_CACHE_SHIFT=7 -# CONFIG_MCKINLEY_ASTEP_SPECIFIC is not set CONFIG_NUMA=y CONFIG_VIRTUAL_MEM_MAP=y CONFIG_DISCONTIGMEM=y @@ -70,12 +73,17 @@ CONFIG_FORCE_MAX_ZONEORDER=18 CONFIG_SMP=y CONFIG_NR_CPUS=512 +# CONFIG_HOTPLUG_CPU is not set # CONFIG_PREEMPT is not set CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y + +# +# Firmware Drivers +# CONFIG_EFI_VARS=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set @@ -105,6 +113,7 @@ # CONFIG_PCI=y CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_USE_VECTOR is not set CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y @@ -174,7 +183,6 @@ # CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set -# CONFIG_IDEDISK_STROKE is not set CONFIG_BLK_DEV_IDECD=m CONFIG_BLK_DEV_IDETAPE=m CONFIG_BLK_DEV_IDEFLOPPY=y @@ -218,6 +226,7 @@ # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y @@ -243,7 +252,6 @@ # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set -CONFIG_SCSI_REPORT_LUNS=y CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set @@ -281,7 +289,9 @@ CONFIG_SCSI_SATA_SVW=m CONFIG_SCSI_ATA_PIIX=m CONFIG_SCSI_SATA_PROMISE=m +# CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set +# CONFIG_SCSI_SATA_SIS is not set CONFIG_SCSI_SATA_VIA=m CONFIG_SCSI_SATA_VITESSE=y # CONFIG_SCSI_BUSLOGIC is not set @@ -298,6 +308,7 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set +# CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=y @@ -343,6 +354,7 @@ # # I2O device support # +# CONFIG_I2O is not set # # Networking support @@ -389,8 +401,6 @@ CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_IPV6_TUNNEL=m -# CONFIG_DECNET is not set -CONFIG_BRIDGE=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y @@ -452,6 +462,7 @@ CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set +# CONFIG_IP_NF_RAW is not set # # IPv6: Netfilter Configuration @@ -471,7 +482,9 @@ # # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set +CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m +# CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set @@ -516,12 +529,14 @@ # Network testing # # CONFIG_NET_PKTGEN is not set +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_RX is not set +# CONFIG_NETPOLL_TRAP is not set +CONFIG_NET_POLL_CONTROLLER=y +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y - -# -# ARCnet devices -# -# CONFIG_ARCNET is not set CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_EQUALIZER=m @@ -529,6 +544,11 @@ # CONFIG_ETHERTAP is not set # +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y @@ -582,7 +602,6 @@ CONFIG_HAMACHI=m CONFIG_YELLOWFIN=m CONFIG_R8169=m -CONFIG_SIS190=m CONFIG_SK98LIN=m CONFIG_TIGON3=y @@ -591,6 +610,22 @@ # CONFIG_IXGB=m # CONFIG_IXGB_NAPI is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set CONFIG_PPP=m @@ -602,45 +637,11 @@ # CONFIG_PPP_BSDCOMP is not set # CONFIG_PPPOE is not set # CONFIG_SLIP is not set - -# -# Wireless LAN (non-hamradio) -# -# CONFIG_NET_RADIO is not set - -# -# Token Ring devices -# -# CONFIG_TR is not set CONFIG_NET_FC=y # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=y # -# Wan interfaces -# -# CONFIG_WAN is not set - -# -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support -# -# CONFIG_IRDA is not set - -# -# 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 # # CONFIG_ISDN is not set @@ -703,6 +704,7 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_ROCKETPORT is not set +# CONFIG_CYCLADES is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set @@ -713,18 +715,11 @@ # # Serial drivers # -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_HCDP=y -CONFIG_SERIAL_8250_ACPI=y -CONFIG_SERIAL_8250_NR_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250 is not set # # Non-8250 serial port support # -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 @@ -740,7 +735,6 @@ # # CONFIG_WATCHDOG is not set # CONFIG_HW_RANDOM is not set -# CONFIG_GEN_RTC is not set CONFIG_EFI_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -852,6 +846,7 @@ # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y @@ -897,7 +892,6 @@ # 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 # @@ -968,6 +962,7 @@ # Library routines # CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=m CONFIG_ZLIB_DEFLATE=m @@ -1019,4 +1014,5 @@ # CONFIG_CRYPTO_ARC4 is not set CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set diff -Nru a/arch/ia64/defconfig b/arch/ia64/defconfig --- a/arch/ia64/defconfig 2004-06-23 19:04:25 -07:00 +++ b/arch/ia64/defconfig 2004-06-23 19:04:25 -07:00 @@ -26,6 +26,7 @@ CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y @@ -66,7 +67,6 @@ CONFIG_IA64_PAGE_SIZE_16KB=y # CONFIG_IA64_PAGE_SIZE_64KB is not set CONFIG_IA64_L1_CACHE_SHIFT=7 -# CONFIG_MCKINLEY_ASTEP_SPECIFIC is not set # CONFIG_NUMA is not set CONFIG_VIRTUAL_MEM_MAP=y # CONFIG_IA64_CYCLONE is not set @@ -74,6 +74,7 @@ CONFIG_FORCE_MAX_ZONEORDER=18 CONFIG_SMP=y CONFIG_NR_CPUS=16 +# CONFIG_HOTPLUG_CPU is not set # CONFIG_PREEMPT is not set CONFIG_HAVE_DEC_LOCK=y CONFIG_IA32_SUPPORT=y @@ -178,7 +179,6 @@ # 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=m @@ -220,6 +220,7 @@ # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y @@ -245,7 +246,6 @@ # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y -CONFIG_SCSI_REPORT_LUNS=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y @@ -282,6 +282,7 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set +# CONFIG_SCSI_IPR is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_QLOGIC_ISP is not set @@ -328,6 +329,7 @@ # # I2O device support # +# CONFIG_I2O is not set # # Networking support @@ -573,7 +575,12 @@ # # IPMI # -# CONFIG_IPMI_HANDLER is not set +CONFIG_IPMI_HANDLER=m +CONFIG_IPMI_PANIC_EVENT=y +CONFIG_IPMI_PANIC_STRING=y +CONFIG_IPMI_DEVICE_INTERFACE=m +CONFIG_IPMI_SI=m +CONFIG_IPMI_WATCHDOG=m # # Watchdog Cards @@ -651,6 +658,7 @@ # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set # CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set @@ -662,6 +670,7 @@ # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -688,6 +697,7 @@ # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set CONFIG_FB_RIVA=m # CONFIG_FB_MATROX is not set @@ -852,6 +862,7 @@ # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set +# CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set @@ -901,6 +912,7 @@ # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set +# CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set # @@ -998,7 +1010,6 @@ # 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 # @@ -1083,7 +1094,7 @@ # CONFIG_IA64_GRANULE_64MB is not set CONFIG_DEBUG_KERNEL=y CONFIG_IA64_PRINT_HAZARDS=y -CONFIG_DISABLE_VHPT=y +# CONFIG_DISABLE_VHPT is not set CONFIG_MAGIC_SYSRQ=y # CONFIG_IA64_EARLY_PRINTK_VGA is not set # CONFIG_DEBUG_SLAB is not set diff -Nru a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c --- a/arch/ia64/ia32/binfmt_elf32.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ia64/ia32/binfmt_elf32.c 2004-06-23 19:04:28 -07:00 @@ -197,6 +197,10 @@ } up_write(¤t->mm->mmap_sem); + /* Can't do it in ia64_elf32_init(). Needs to be done before calls to + elf32_map() */ + current->thread.ppl = ia32_init_pp_list(); + return 0; } diff -Nru a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S --- a/arch/ia64/ia32/ia32_entry.S 2004-06-23 19:04:27 -07:00 +++ b/arch/ia64/ia32/ia32_entry.S 2004-06-23 19:04:27 -07:00 @@ -349,7 +349,7 @@ data8 sys_setfsuid /* 16-bit version */ data8 sys_setfsgid /* 16-bit version */ data8 sys_llseek /* 140 */ - data8 sys32_getdents + data8 compat_sys_getdents data8 compat_sys_select data8 sys_flock data8 sys32_msync @@ -371,7 +371,7 @@ data8 sys_sched_get_priority_min /* 160 */ data8 sys32_sched_rr_get_interval data8 compat_sys_nanosleep - data8 sys_mremap + data8 sys32_mremap data8 sys_setresuid /* 16-bit version */ data8 sys32_getresuid16 /* 16-bit version */ /* 165 */ data8 sys_ni_syscall /* vm86 */ @@ -428,7 +428,7 @@ data8 sys_pivot_root data8 sys_mincore data8 sys_madvise - data8 sys_getdents64 /* 220 */ + data8 compat_sys_getdents64 /* 220 */ data8 compat_sys_fcntl64 data8 sys_ni_syscall /* reserved for TUX */ data8 sys_ni_syscall /* reserved for Security */ diff -Nru a/arch/ia64/ia32/ia32_support.c b/arch/ia64/ia32/ia32_support.c --- a/arch/ia64/ia32/ia32_support.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ia64/ia32/ia32_support.c 2004-06-23 19:04:25 -07:00 @@ -218,6 +218,18 @@ ia32_exec_domain.signal_map = default_exec_domain.signal_map; ia32_exec_domain.signal_invmap = default_exec_domain.signal_invmap; register_exec_domain(&ia32_exec_domain); + +#if PAGE_SHIFT > IA32_PAGE_SHIFT + { + extern kmem_cache_t *partial_page_cachep; + + partial_page_cachep = kmem_cache_create("partial_page_cache", + sizeof(struct partial_page), 0, 0, + NULL, NULL); + if (!partial_page_cachep) + panic("Cannot create partial page SLAB cache"); + } +#endif return 0; } diff -Nru a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h --- a/arch/ia64/ia32/ia32priv.h 2004-06-23 19:04:28 -07:00 +++ b/arch/ia64/ia32/ia32priv.h 2004-06-23 19:04:28 -07:00 @@ -1,5 +1,5 @@ -#ifndef _ASM_IA64_IA32_H -#define _ASM_IA64_IA32_H +#ifndef _ASM_IA64_IA32_PRIV_H +#define _ASM_IA64_IA32_PRIV_H #include @@ -9,6 +9,7 @@ #include #include +#include #include @@ -16,12 +17,39 @@ * 32 bit structures for IA32 support. */ -#define IA32_PAGE_SHIFT 12 /* 4KB pages */ #define IA32_PAGE_SIZE (1UL << IA32_PAGE_SHIFT) #define IA32_PAGE_MASK (~(IA32_PAGE_SIZE - 1)) #define IA32_PAGE_ALIGN(addr) (((addr) + IA32_PAGE_SIZE - 1) & IA32_PAGE_MASK) #define IA32_CLOCKS_PER_SEC 100 /* Cast in stone for IA32 Linux */ +/* + * partially mapped pages provide precise accounting of which 4k sub pages + * are mapped and which ones are not, thereby improving IA-32 compatibility. + */ +struct partial_page { + struct partial_page *next; /* linked list, sorted by address */ + struct rb_node pp_rb; + /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*32 + * should suffice.*/ + unsigned int bitmap; + unsigned int base; +}; + +struct partial_page_list { + struct partial_page *pp_head; /* list head, points to the lowest + * addressed partial page */ + struct rb_root ppl_rb; + struct partial_page *pp_hint; /* pp_hint->next is the last + * accessed partial page */ + atomic_t pp_count; /* reference count */ +}; + +#if PAGE_SHIFT > IA32_PAGE_SHIFT +struct partial_page_list* ia32_init_pp_list (void); +#else +# define ia32_init_pp_list() 0 +#endif + /* sigcontext.h */ /* * As documented in the iBCS2 standard.. @@ -528,4 +556,4 @@ #endif /* !CONFIG_IA32_SUPPORT */ -#endif /* _ASM_IA64_IA32_H */ +#endif /* _ASM_IA64_IA32_PRIV_H */ diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c --- a/arch/ia64/ia32/sys_ia32.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ia64/ia32/sys_ia32.c 2004-06-23 19:04:27 -07:00 @@ -8,6 +8,7 @@ * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 2000-2003 Hewlett-Packard Co * David Mosberger-Tang + * Copyright (C) 2004 Gordon Jin * * These routines maintain argument size conversion between 32bit and 64bit * environment. @@ -48,6 +49,7 @@ #include #include #include +#include #include #include @@ -250,6 +252,508 @@ return ret; } +/* SLAB cache for partial_page structures */ +kmem_cache_t *partial_page_cachep; + +/* + * init partial_page_list. + * return 0 means kmalloc fail. + */ +struct partial_page_list* +ia32_init_pp_list(void) +{ + struct partial_page_list *p; + + if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL) + return p; + p->pp_head = 0; + p->ppl_rb = RB_ROOT; + p->pp_hint = 0; + atomic_set(&p->pp_count, 1); + return p; +} + +/* + * Search for the partial page with @start in partial page list @ppl. + * If finds the partial page, return the found partial page. + * Else, return 0 and provide @pprev, @rb_link, @rb_parent to + * be used by later __ia32_insert_pp(). + */ +static struct partial_page * +__ia32_find_pp(struct partial_page_list *ppl, unsigned int start, + struct partial_page **pprev, struct rb_node ***rb_link, + struct rb_node **rb_parent) +{ + struct partial_page *pp; + struct rb_node **__rb_link, *__rb_parent, *rb_prev; + + pp = ppl->pp_hint; + if (pp && pp->base == start) + return pp; + + __rb_link = &ppl->ppl_rb.rb_node; + rb_prev = __rb_parent = NULL; + + while (*__rb_link) { + __rb_parent = *__rb_link; + pp = rb_entry(__rb_parent, struct partial_page, pp_rb); + + if (pp->base == start) { + ppl->pp_hint = pp; + return pp; + } else if (pp->base < start) { + rb_prev = __rb_parent; + __rb_link = &__rb_parent->rb_right; + } else { + __rb_link = &__rb_parent->rb_left; + } + } + + *rb_link = __rb_link; + *rb_parent = __rb_parent; + *pprev = NULL; + if (rb_prev) + *pprev = rb_entry(rb_prev, struct partial_page, pp_rb); + return NULL; +} + +/* + * insert @pp into @ppl. + */ +static void +__ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp, + struct partial_page *prev, struct rb_node **rb_link, + struct rb_node *rb_parent) +{ + /* link list */ + if (prev) { + pp->next = prev->next; + prev->next = pp; + } else { + ppl->pp_head = pp; + if (rb_parent) + pp->next = rb_entry(rb_parent, + struct partial_page, pp_rb); + else + pp->next = NULL; + } + + /* link rb */ + rb_link_node(&pp->pp_rb, rb_parent, rb_link); + rb_insert_color(&pp->pp_rb, &ppl->ppl_rb); + + ppl->pp_hint = pp; +} + +/* + * delete @pp from partial page list @ppl. + */ +static void +__ia32_delete_pp(struct partial_page_list *ppl, struct partial_page *pp, + struct partial_page *prev) +{ + if (prev) { + prev->next = pp->next; + if (ppl->pp_hint == pp) + ppl->pp_hint = prev; + } else { + ppl->pp_head = pp->next; + if (ppl->pp_hint == pp) + ppl->pp_hint = pp->next; + } + rb_erase(&pp->pp_rb, &ppl->ppl_rb); + kmem_cache_free(partial_page_cachep, pp); +} + +static struct partial_page * +__pp_prev(struct partial_page *pp) +{ + struct rb_node *prev = rb_prev(&pp->pp_rb); + if (prev) + return rb_entry(prev, struct partial_page, pp_rb); + else + return NULL; +} + +/* + * Delete partial pages with address between @start and @end. + * @start and @end are page aligned. + */ +static void +__ia32_delete_pp_range(unsigned int start, unsigned int end) +{ + struct partial_page *pp, *prev; + struct rb_node **rb_link, *rb_parent; + + if (start >= end) + return; + + pp = __ia32_find_pp(current->thread.ppl, start, &prev, + &rb_link, &rb_parent); + if (pp) + prev = __pp_prev(pp); + else { + if (prev) + pp = prev->next; + else + pp = current->thread.ppl->pp_head; + } + + while (pp && pp->base < end) { + struct partial_page *tmp = pp->next; + __ia32_delete_pp(current->thread.ppl, pp, prev); + pp = tmp; + } +} + +/* + * Set the range between @start and @end in bitmap. + * @start and @end should be IA32 page aligned and in the same IA64 page. + */ +static int +__ia32_set_pp(unsigned int start, unsigned int end, int flags) +{ + struct partial_page *pp, *prev; + struct rb_node ** rb_link, *rb_parent; + unsigned int pstart, start_bit, end_bit, i; + + pstart = PAGE_START(start); + start_bit = (start % PAGE_SIZE) / IA32_PAGE_SIZE; + end_bit = (end % PAGE_SIZE) / IA32_PAGE_SIZE; + if (end_bit == 0) + end_bit = PAGE_SIZE / IA32_PAGE_SIZE; + pp = __ia32_find_pp(current->thread.ppl, pstart, &prev, + &rb_link, &rb_parent); + if (pp) { + for (i = start_bit; i < end_bit; i++) + set_bit(i, &pp->bitmap); + /* + * Check: if this partial page has been set to a full page, + * then delete it. + */ + if (find_first_zero_bit(&pp->bitmap, sizeof(pp->bitmap)*8) >= + PAGE_SIZE/IA32_PAGE_SIZE) { + __ia32_delete_pp(current->thread.ppl, pp, __pp_prev(pp)); + } + return 0; + } + + /* + * MAP_FIXED may lead to overlapping mmap. + * In this case, the requested mmap area may already mmaped as a full + * page. So check vma before adding a new partial page. + */ + if (flags & MAP_FIXED) { + struct vm_area_struct *vma = find_vma(current->mm, pstart); + if (vma && vma->vm_start <= pstart) + return 0; + } + + /* new a partial_page */ + pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); + if (!pp) + return -ENOMEM; + pp->base = pstart; + pp->bitmap = 0; + for (i=start_bit; ibitmap)); + pp->next = NULL; + __ia32_insert_pp(current->thread.ppl, pp, prev, rb_link, rb_parent); + return 0; +} + +/* + * @start and @end should be IA32 page aligned, but don't need to be in the + * same IA64 page. Split @start and @end to make sure they're in the same IA64 + * page, then call __ia32_set_pp(). + */ +static void +ia32_set_pp(unsigned int start, unsigned int end, int flags) +{ + down_write(¤t->mm->mmap_sem); + if (flags & MAP_FIXED) { + /* + * MAP_FIXED may lead to overlapping mmap. When this happens, + * a series of complete IA64 pages results in deletion of + * old partial pages in that range. + */ + __ia32_delete_pp_range(PAGE_ALIGN(start), PAGE_START(end)); + } + + if (end < PAGE_ALIGN(start)) { + __ia32_set_pp(start, end, flags); + } else { + if (offset_in_page(start)) + __ia32_set_pp(start, PAGE_ALIGN(start), flags); + if (offset_in_page(end)) + __ia32_set_pp(PAGE_START(end), end, flags); + } + up_write(¤t->mm->mmap_sem); +} + +/* + * Unset the range between @start and @end in bitmap. + * @start and @end should be IA32 page aligned and in the same IA64 page. + * After doing that, if the bitmap is 0, then free the page and return 1, + * else return 0; + * If not find the partial page in the list, then + * If the vma exists, then the full page is set to a partial page; + * Else return -ENOMEM. + */ +static int +__ia32_unset_pp(unsigned int start, unsigned int end) +{ + struct partial_page *pp, *prev; + struct rb_node ** rb_link, *rb_parent; + unsigned int pstart, start_bit, end_bit, i; + struct vm_area_struct *vma; + + pstart = PAGE_START(start); + start_bit = (start % PAGE_SIZE) / IA32_PAGE_SIZE; + end_bit = (end % PAGE_SIZE) / IA32_PAGE_SIZE; + if (end_bit == 0) + end_bit = PAGE_SIZE / IA32_PAGE_SIZE; + + pp = __ia32_find_pp(current->thread.ppl, pstart, &prev, + &rb_link, &rb_parent); + if (pp) { + for (i = start_bit; i < end_bit; i++) + clear_bit(i, &pp->bitmap); + if (pp->bitmap == 0) { + __ia32_delete_pp(current->thread.ppl, pp, __pp_prev(pp)); + return 1; + } + return 0; + } + + vma = find_vma(current->mm, pstart); + if (!vma || vma->vm_start > pstart) { + return -ENOMEM; + } + + /* new a partial_page */ + pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); + if (!pp) + return -ENOMEM; + pp->base = pstart; + pp->bitmap = 0; + for (i = 0; i < start_bit; i++) + set_bit(i, &(pp->bitmap)); + for (i = end_bit; i < PAGE_SIZE / IA32_PAGE_SIZE; i++) + set_bit(i, &(pp->bitmap)); + pp->next = NULL; + __ia32_insert_pp(current->thread.ppl, pp, prev, rb_link, rb_parent); + return 0; +} + +/* + * Delete pp between PAGE_ALIGN(start) and PAGE_START(end) by calling + * __ia32_delete_pp_range(). Unset possible partial pages by calling + * __ia32_unset_pp(). + * The returned value see __ia32_unset_pp(). + */ +static int +ia32_unset_pp(unsigned int *startp, unsigned int *endp) +{ + unsigned int start = *startp, end = *endp; + int ret = 0; + + down_write(¤t->mm->mmap_sem); + + __ia32_delete_pp_range(PAGE_ALIGN(start), PAGE_START(end)); + + if (end < PAGE_ALIGN(start)) { + ret = __ia32_unset_pp(start, end); + if (ret == 1) { + *startp = PAGE_START(start); + *endp = PAGE_ALIGN(end); + } + if (ret == 0) { + /* to shortcut sys_munmap() in sys32_munmap() */ + *startp = PAGE_START(start); + *endp = PAGE_START(end); + } + } else { + if (offset_in_page(start)) { + ret = __ia32_unset_pp(start, PAGE_ALIGN(start)); + if (ret == 1) + *startp = PAGE_START(start); + if (ret == 0) + *startp = PAGE_ALIGN(start); + if (ret < 0) + goto out; + } + if (offset_in_page(end)) { + ret = __ia32_unset_pp(PAGE_START(end), end); + if (ret == 1) + *endp = PAGE_ALIGN(end); + if (ret == 0) + *endp = PAGE_START(end); + } + } + + out: + up_write(¤t->mm->mmap_sem); + return ret; +} + +/* + * Compare the range between @start and @end with bitmap in partial page. + * @start and @end should be IA32 page aligned and in the same IA64 page. + */ +static int +__ia32_compare_pp(unsigned int start, unsigned int end) +{ + struct partial_page *pp, *prev; + struct rb_node ** rb_link, *rb_parent; + unsigned int pstart, start_bit, end_bit, size; + unsigned int first_bit, next_zero_bit; /* the first range in bitmap */ + + pstart = PAGE_START(start); + + pp = __ia32_find_pp(current->thread.ppl, pstart, &prev, + &rb_link, &rb_parent); + if (!pp) + return 1; + + start_bit = (start % PAGE_SIZE) / IA32_PAGE_SIZE; + end_bit = (end % PAGE_SIZE) / IA32_PAGE_SIZE; + size = sizeof(pp->bitmap) * 8; + first_bit = find_first_bit(&pp->bitmap, size); + next_zero_bit = find_next_zero_bit(&pp->bitmap, size, first_bit); + if ((start_bit < first_bit) || (end_bit > next_zero_bit)) { + /* exceeds the first range in bitmap */ + return -ENOMEM; + } else if ((start_bit == first_bit) && (end_bit == next_zero_bit)) { + first_bit = find_next_bit(&pp->bitmap, size, next_zero_bit); + if ((next_zero_bit < first_bit) && (first_bit < size)) + return 1; /* has next range */ + else + return 0; /* no next range */ + } else + return 1; +} + +/* + * @start and @end should be IA32 page aligned, but don't need to be in the + * same IA64 page. Split @start and @end to make sure they're in the same IA64 + * page, then call __ia32_compare_pp(). + * + * Take this as example: the range is the 1st and 2nd 4K page. + * Return 0 if they fit bitmap exactly, i.e. bitmap = 00000011; + * Return 1 if the range doesn't cover whole bitmap, e.g. bitmap = 00001111; + * Return -ENOMEM if the range exceeds the bitmap, e.g. bitmap = 00000001 or + * bitmap = 00000101. + */ +static int +ia32_compare_pp(unsigned int *startp, unsigned int *endp) +{ + unsigned int start = *startp, end = *endp; + int retval = 0; + + down_write(¤t->mm->mmap_sem); + + if (end < PAGE_ALIGN(start)) { + retval = __ia32_compare_pp(start, end); + if (retval == 0) { + *startp = PAGE_START(start); + *endp = PAGE_ALIGN(end); + } + } else { + if (offset_in_page(start)) { + retval = __ia32_compare_pp(start, + PAGE_ALIGN(start)); + if (retval == 0) + *startp = PAGE_START(start); + if (retval < 0) + goto out; + } + if (offset_in_page(end)) { + retval = __ia32_compare_pp(PAGE_START(end), end); + if (retval == 0) + *endp = PAGE_ALIGN(end); + } + } + + out: + up_write(¤t->mm->mmap_sem); + return retval; +} + +static void +__ia32_drop_pp_list(struct partial_page_list *ppl) +{ + struct partial_page *pp = ppl->pp_head; + + while (pp) { + struct partial_page *next = pp->next; + kmem_cache_free(partial_page_cachep, pp); + pp = next; + } + + kfree(ppl); +} + +void +ia32_drop_partial_page_list(struct task_struct *task) +{ + struct partial_page_list* ppl = task->thread.ppl; + + if (ppl && atomic_dec_and_test(&ppl->pp_count)) + __ia32_drop_pp_list(ppl); +} + +/* + * Copy current->thread.ppl to ppl (already initialized). + */ +static int +__ia32_copy_pp_list(struct partial_page_list *ppl) +{ + struct partial_page *pp, *tmp, *prev; + struct rb_node **rb_link, *rb_parent; + + ppl->pp_head = NULL; + ppl->pp_hint = NULL; + ppl->ppl_rb = RB_ROOT; + rb_link = &ppl->ppl_rb.rb_node; + rb_parent = NULL; + prev = NULL; + + for (pp = current->thread.ppl->pp_head; pp; pp = pp->next) { + tmp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); + if (!tmp) + return -ENOMEM; + *tmp = *pp; + __ia32_insert_pp(ppl, tmp, prev, rb_link, rb_parent); + prev = tmp; + rb_link = &tmp->pp_rb.rb_right; + rb_parent = &tmp->pp_rb; + } + return 0; +} + +int +ia32_copy_partial_page_list(struct task_struct *p, unsigned long clone_flags) +{ + int retval = 0; + + if (clone_flags & CLONE_VM) { + atomic_inc(¤t->thread.ppl->pp_count); + p->thread.ppl = current->thread.ppl; + } else { + p->thread.ppl = ia32_init_pp_list(); + if (!p->thread.ppl) + return -ENOMEM; + down_write(¤t->mm->mmap_sem); + { + retval = __ia32_copy_pp_list(p->thread.ppl); + } + up_write(¤t->mm->mmap_sem); + } + + return retval; +} + static unsigned long emulate_mmap (struct file *file, unsigned long start, unsigned long len, int prot, int flags, loff_t off) @@ -263,6 +767,7 @@ pend = PAGE_ALIGN(end); if (flags & MAP_FIXED) { + ia32_set_pp((unsigned int)start, (unsigned int)end, flags); if (start > pstart) { if (flags & MAP_SHARED) printk(KERN_INFO @@ -274,7 +779,7 @@ return ret; pstart += PAGE_SIZE; if (pstart >= pend) - return start; /* done */ + goto out; /* done */ } if (end < pend) { if (flags & MAP_SHARED) @@ -287,7 +792,7 @@ return ret; pend -= PAGE_SIZE; if (pstart >= pend) - return start; /* done */ + goto out; /* done */ } } else { /* @@ -341,6 +846,10 @@ if (!(prot & PROT_WRITE) && sys_mprotect(pstart, pend - pstart, prot) < 0) return -EINVAL; } + + if (!(flags & MAP_FIXED)) + ia32_set_pp((unsigned int)start, (unsigned int)end, flags); +out: return start; } @@ -478,11 +987,16 @@ #if PAGE_SHIFT <= IA32_PAGE_SHIFT ret = sys_munmap(start, end - start); #else + if (OFFSET4K(start)) + return -EINVAL; + + end = IA32_PAGE_ALIGN(end); if (start >= end) return -EINVAL; - start = PAGE_ALIGN(start); - end = PAGE_START(end); + ret = ia32_unset_pp(&start, &end); + if (ret < 0) + return ret; if (start >= end) return 0; @@ -521,7 +1035,7 @@ asmlinkage long sys32_mprotect (unsigned int start, unsigned int len, int prot) { - unsigned long end = start + len; + unsigned int end = start + len; #if PAGE_SHIFT > IA32_PAGE_SHIFT long retval = 0; #endif @@ -538,6 +1052,11 @@ if (end < start) return -EINVAL; + retval = ia32_compare_pp(&start, &end); + + if (retval < 0) + return retval; + down(&ia32_mmap_sem); { if (offset_in_page(start)) { @@ -565,6 +1084,59 @@ up(&ia32_mmap_sem); return retval; #endif +} + +asmlinkage long +sys32_mremap (unsigned int addr, unsigned int old_len, unsigned int new_len, + unsigned int flags, unsigned int new_addr) +{ + long ret; + +#if PAGE_SHIFT <= IA32_PAGE_SHIFT + ret = sys_mremap(addr, old_len, new_len, flags, new_addr); +#else + unsigned int old_end, new_end; + + if (OFFSET4K(addr)) + return -EINVAL; + + old_len = IA32_PAGE_ALIGN(old_len); + new_len = IA32_PAGE_ALIGN(new_len); + old_end = addr + old_len; + new_end = addr + new_len; + + if (!new_len) + return -EINVAL; + + if ((flags & MREMAP_FIXED) && (OFFSET4K(new_addr))) + return -EINVAL; + + if (old_len >= new_len) { + ret = sys32_munmap(addr + new_len, old_len - new_len); + if (ret && old_len != new_len) + return ret; + ret = addr; + if (!(flags & MREMAP_FIXED) || (new_addr == addr)) + return ret; + old_len = new_len; + } + + addr = PAGE_START(addr); + old_len = PAGE_ALIGN(old_end) - addr; + new_len = PAGE_ALIGN(new_end) - addr; + + down(&ia32_mmap_sem); + { + ret = sys_mremap(addr, old_len, new_len, flags, new_addr); + } + up(&ia32_mmap_sem); + + if ((ret >= 0) && (old_len < new_len)) { + /* mremap expanded successfully */ + ia32_set_pp(old_end, new_end, flags); + } +#endif + return ret; } asmlinkage long diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c --- a/arch/ia64/kernel/acpi.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ia64/kernel/acpi.c 2004-06-23 19:04:27 -07:00 @@ -521,9 +521,14 @@ #endif /* CONFIG_ACPI_NUMA */ unsigned int -acpi_register_gsi (u32 gsi, int polarity, int trigger) +acpi_register_gsi (u32 gsi, int edge_level, int active_high_low) { - return acpi_register_irq(gsi, polarity, trigger); + if (has_8259 && gsi < 16) + return isa_irq_to_vector(gsi); + + return iosapic_register_intr(gsi, + (active_high_low == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, + (edge_level == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); } EXPORT_SYMBOL(acpi_register_gsi); @@ -548,7 +553,7 @@ if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES) acpi_legacy_devices = 1; - acpi_register_gsi(fadt->sci_int, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE); + acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); return 0; } @@ -661,17 +666,5 @@ } return 0; } - -int -acpi_register_irq (u32 gsi, u32 polarity, u32 trigger) -{ - if (has_8259 && gsi < 16) - return isa_irq_to_vector(gsi); - - return iosapic_register_intr(gsi, - (polarity == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, - (trigger == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); -} -EXPORT_SYMBOL(acpi_register_irq); #endif /* CONFIG_ACPI_BOOT */ diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S --- a/arch/ia64/kernel/entry.S 2004-06-23 19:04:26 -07:00 +++ b/arch/ia64/kernel/entry.S 2004-06-23 19:04:26 -07:00 @@ -179,17 +179,19 @@ .body adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13 + movl r25=init_task mov r27=IA64_KR(CURRENT_STACK) + adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0 dep r20=0,in0,61,3 // physical address of "current" ;; st8 [r22]=sp // save kernel stack pointer of old task shr.u r26=r20,IA64_GRANULE_SHIFT - adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0 + cmp.eq p7,p6=r25,in0 ;; /* * If we've already mapped this task's page, we can skip doing it again. */ - cmp.eq p7,p6=r26,r27 +(p6) cmp.eq p7,p6=r26,r27 (p6) br.cond.dpnt .map ;; .done: diff -Nru a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S --- a/arch/ia64/kernel/head.S 2004-06-23 19:04:27 -07:00 +++ b/arch/ia64/kernel/head.S 2004-06-23 19:04:27 -07:00 @@ -154,6 +154,10 @@ #endif ;; tpa r3=r2 // r3 == phys addr of task struct + ;; + shr.u r16=r3,IA64_GRANULE_SHIFT +(isBP) br.cond.dpnt .load_current // BP stack is on region 5 --- no need to map it + // load mapping for stack (virtaddr in r2, physaddr in r3) rsm psr.ic movl r17=PAGE_KERNEL @@ -165,7 +169,6 @@ dep r2=-1,r3,61,3 // IMVA of task ;; mov r17=rr[r2] - shr.u r16=r3,IA64_GRANULE_SHIFT ;; dep r17=0,r17,8,24 ;; @@ -180,6 +183,7 @@ srlz.d ;; +.load_current: // load the "current" pointer (r13) and ar.k6 with the current task mov IA64_KR(CURRENT)=r2 // virtual address mov IA64_KR(CURRENT_STACK)=r16 diff -Nru a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c --- a/arch/ia64/kernel/init_task.c 2004-06-23 19:04:29 -07:00 +++ b/arch/ia64/kernel/init_task.c 2004-06-23 19:04:29 -07:00 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c --- a/arch/ia64/kernel/iosapic.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ia64/kernel/iosapic.c 2004-06-23 19:04:26 -07:00 @@ -100,7 +100,6 @@ #endif static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED; -extern cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; /* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */ @@ -335,21 +334,6 @@ #endif } -static inline void move_irq(int irq) -{ - /* note - we hold desc->lock */ - cpumask_t tmp; - irq_desc_t *desc = irq_descp(irq); - - if (!cpus_empty(pending_irq_cpumask[irq])) { - cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); - if (unlikely(!cpus_empty(tmp))) { - desc->handler->set_affinity(irq, pending_irq_cpumask[irq]); - } - cpus_clear(pending_irq_cpumask[irq]); - } -} - /* * Handlers for level-triggered interrupts. */ @@ -483,7 +467,7 @@ index = find_iosapic(gsi); if (index < 0) { - printk(KERN_WARNING "%s: No IOSAPIC for GSI 0x%x\n", __FUNCTION__, gsi); + printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi); return; } @@ -512,6 +496,42 @@ } } +static unsigned int +get_target_cpu (void) +{ +#ifdef CONFIG_SMP + static int cpu = -1; + + /* + * If the platform supports redirection via XTP, let it + * distribute interrupts. + */ + if (smp_int_redirect & SMP_IRQ_REDIRECTION) + return hard_smp_processor_id(); + + /* + * Some interrupts (ACPI SCI, for instance) are registered + * before the BSP is marked as online. + */ + if (!cpu_online(smp_processor_id())) + return hard_smp_processor_id(); + + /* + * Otherwise, round-robin interrupt vectors across all the + * processors. (It'd be nice if we could be smarter in the + * case of NUMA.) + */ + do { + if (++cpu >= NR_CPUS) + cpu = 0; + } while (!cpu_online(cpu)); + + return cpu_physical_id(cpu); +#else + return hard_smp_processor_id(); +#endif +} + /* * ACPI can describe IOSAPIC interrupts via static tables and namespace * methods. This provides an interface to register those interrupts and @@ -522,21 +542,35 @@ unsigned long polarity, unsigned long trigger) { int vector; - unsigned int dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff; + unsigned int dest; + unsigned long flags; - vector = gsi_to_vector(gsi); - if (vector < 0) - vector = assign_irq_vector(AUTO_ASSIGN); + /* + * If this GSI has already been registered (i.e., it's a + * shared interrupt, or we lost a race to register it), + * don't touch the RTE. + */ + spin_lock_irqsave(&iosapic_lock, flags); + { + vector = gsi_to_vector(gsi); + if (vector > 0) { + spin_unlock_irqrestore(&iosapic_lock, flags); + return vector; + } - register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, - polarity, trigger); + vector = assign_irq_vector(AUTO_ASSIGN); + dest = get_target_cpu(); + register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, + polarity, trigger); + } + spin_unlock_irqrestore(&iosapic_lock, flags); - printk(KERN_INFO "GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", - gsi, (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), - (trigger == IOSAPIC_EDGE ? "edge" : "level"), dest, vector); + printk(KERN_INFO "GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n", + gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), + (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), + cpu_logical_id(dest), dest, vector); - /* program the IOSAPIC routing table */ - set_rte(vector, dest, 0); + set_rte(vector, dest, 1); return vector; } @@ -549,8 +583,9 @@ int iosapic_vector, u16 eid, u16 id, unsigned long polarity, unsigned long trigger) { + static const char * const name[] = {"unknown", "PMI", "INIT", "CPEI"}; unsigned char delivery; - int vector; + int vector, mask = 0; unsigned int dest = ((id << 8) | eid) & 0xffff; switch (int_type) { @@ -570,21 +605,22 @@ case ACPI_INTERRUPT_CPEI: vector = IA64_CPE_VECTOR; delivery = IOSAPIC_LOWEST_PRIORITY; + mask = 1; break; default: - printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type\n"); + printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type 0x%x\n", int_type); return -1; } - register_intr(gsi, vector, delivery, polarity, - trigger); + register_intr(gsi, vector, delivery, polarity, trigger); - printk(KERN_INFO "PLATFORM int 0x%x: GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", - int_type, gsi, (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), - (trigger == IOSAPIC_EDGE ? "edge" : "level"), dest, vector); + printk(KERN_INFO "PLATFORM int %s (0x%x): GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n", + int_type < ARRAY_SIZE(name) ? name[int_type] : "unknown", + int_type, gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"), + (polarity == IOSAPIC_POL_HIGH ? "high" : "low"), + cpu_logical_id(dest), dest, vector); - /* program the IOSAPIC routing table */ - set_rte(vector, dest, 0); + set_rte(vector, dest, mask); return vector; } @@ -599,18 +635,18 @@ unsigned long trigger) { int vector; - unsigned int dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff; + unsigned int dest = hard_smp_processor_id(); vector = isa_irq_to_vector(isa_irq); register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, polarity, trigger); - DBG("ISA: IRQ %u -> GSI 0x%x (%s,%s) -> CPU 0x%04x vector %d\n", - isa_irq, gsi, polarity == IOSAPIC_POL_HIGH ? "high" : "low", - trigger == IOSAPIC_EDGE ? "edge" : "level", dest, vector); + DBG("ISA: IRQ %u -> GSI %u (%s,%s) -> CPU %d (0x%04x) vector %d\n", + isa_irq, gsi, trigger == IOSAPIC_EDGE ? "edge" : "level", + polarity == IOSAPIC_POL_HIGH ? "high" : "low", + cpu_logical_id(dest), dest, vector); - /* program the IOSAPIC routing table */ - set_rte(vector, dest, 0); + set_rte(vector, dest, 1); } void __init @@ -665,104 +701,3 @@ iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE); } } - -void -iosapic_enable_intr (unsigned int vector) -{ - unsigned int dest; - irq_desc_t *desc; - - /* - * In the case of a shared interrupt, do not re-route the vector, and - * especially do not mask a running interrupt (startup will not get - * called for a shared interrupt). - */ - desc = irq_descp(vector); - if (desc->action) - return; - -#ifdef CONFIG_SMP - /* - * For platforms that do not support interrupt redirect via the XTP interface, we - * can round-robin the PCI device interrupts to the processors - */ - if (!(smp_int_redirect & SMP_IRQ_REDIRECTION)) { - static int cpu_index = -1; - - do - if (++cpu_index >= NR_CPUS) - cpu_index = 0; - while (!cpu_online(cpu_index)); - - dest = cpu_physical_id(cpu_index) & 0xffff; - } else { - /* - * Direct the interrupt vector to the current cpu, platform redirection - * will distribute them. - */ - dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff; - } -#else - /* direct the interrupt vector to the running cpu id */ - dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff; -#endif - set_rte(vector, dest, 1); - - printk(KERN_INFO "IOSAPIC: vector %d -> CPU 0x%04x, enabled\n", - vector, dest); -} - -#ifdef CONFIG_ACPI_PCI - -void __init -iosapic_parse_prt (void) -{ - struct acpi_prt_entry *entry; - struct list_head *node; - unsigned int gsi; - int vector; - char pci_id[16]; - struct hw_interrupt_type *irq_type = &irq_type_iosapic_level; - irq_desc_t *idesc; - - list_for_each(node, &acpi_prt.entries) { - entry = list_entry(node, struct acpi_prt_entry, node); - - /* We're only interested in static (non-link) entries. */ - if (entry->link.handle) - continue; - - gsi = entry->link.index; - - vector = gsi_to_vector(gsi); - if (vector < 0) { - if (find_iosapic(gsi) < 0) - continue; - - /* allocate a vector for this interrupt line */ - if (pcat_compat && (gsi < 16)) - vector = isa_irq_to_vector(gsi); - else - /* new GSI; allocate a vector for it */ - vector = assign_irq_vector(AUTO_ASSIGN); - - register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, IOSAPIC_POL_LOW, - IOSAPIC_LEVEL); - } - entry->irq = vector; - snprintf(pci_id, sizeof(pci_id), "%02x:%02x:%02x[%c]", - entry->id.segment, entry->id.bus, entry->id.device, 'A' + entry->pin); - - /* - * If vector was previously initialized to a different - * handler, re-initialize. - */ - idesc = irq_descp(vector); - if (idesc->handler != irq_type) - register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, IOSAPIC_POL_LOW, - IOSAPIC_LEVEL); - - } -} - -#endif /* CONFIG_ACPI */ diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c --- a/arch/ia64/kernel/irq.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ia64/kernel/irq.c 2004-06-23 19:04:28 -07:00 @@ -1018,6 +1018,22 @@ return full_count; } +void move_irq(int irq) +{ + /* note - we hold desc->lock */ + cpumask_t tmp; + irq_desc_t *desc = irq_descp(irq); + + if (!cpus_empty(pending_irq_cpumask[irq])) { + cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); + if (unlikely(!cpus_empty(tmp))) { + desc->handler->set_affinity(irq, pending_irq_cpumask[irq]); + } + cpus_clear(pending_irq_cpumask[irq]); + } +} + + #endif /* CONFIG_SMP */ #ifdef CONFIG_HOTPLUG_CPU diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c --- a/arch/ia64/kernel/mca.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ia64/kernel/mca.c 2004-06-23 19:04:26 -07:00 @@ -108,6 +108,7 @@ #define MAX_CPE_POLL_INTERVAL (15*60*HZ) /* 15 minutes */ #define MIN_CPE_POLL_INTERVAL (2*60*HZ) /* 2 minutes */ #define CMC_POLL_INTERVAL (1*60*HZ) /* 1 minute */ +#define CPE_HISTORY_LENGTH 5 #define CMC_HISTORY_LENGTH 5 static struct timer_list cpe_poll_timer; @@ -127,6 +128,8 @@ */ static int cpe_poll_enabled = 1; +static int cpe_vector = -1; + extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe); /* @@ -267,20 +270,65 @@ */ #ifndef PLATFORM_MCA_HANDLERS +#ifdef CONFIG_ACPI + static irqreturn_t ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) { - IA64_MCA_DEBUG("%s: received interrupt. CPU:%d vector = %#x\n", - __FUNCTION__, smp_processor_id(), cpe_irq); + static unsigned long cpe_history[CPE_HISTORY_LENGTH]; + static int index; + static spinlock_t cpe_history_lock = SPIN_LOCK_UNLOCKED; + + IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n", + __FUNCTION__, cpe_irq, smp_processor_id()); /* SAL spec states this should run w/ interrupts enabled */ local_irq_enable(); - /* Get the CMC error record and log it */ + /* Get the CPE error record and log it */ ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE); + + spin_lock(&cpe_history_lock); + if (!cpe_poll_enabled && cpe_vector >= 0) { + + int i, count = 1; /* we know 1 happened now */ + unsigned long now = jiffies; + + for (i = 0; i < CPE_HISTORY_LENGTH; i++) { + if (now - cpe_history[i] <= HZ) + count++; + } + + IA64_MCA_DEBUG(KERN_INFO "CPE threshold %d/%d\n", count, CPE_HISTORY_LENGTH); + if (count >= CPE_HISTORY_LENGTH) { + + cpe_poll_enabled = 1; + spin_unlock(&cpe_history_lock); + disable_irq_nosync(local_vector_to_irq(IA64_CPE_VECTOR)); + + /* + * Corrected errors will still be corrected, but + * make sure there's a log somewhere that indicates + * something is generating more than we can handle. + */ + printk(KERN_WARNING "WARNING: Switching to polling CPE handler; error records may be lost\n"); + + mod_timer(&cpe_poll_timer, jiffies + MIN_CPE_POLL_INTERVAL); + + /* lock already released, get out now */ + return IRQ_HANDLED; + } else { + cpe_history[index++] = now; + if (index == CPE_HISTORY_LENGTH) + index = 0; + } + } + spin_unlock(&cpe_history_lock); return IRQ_HANDLED; } +#endif /* CONFIG_ACPI */ + static void show_min_state (pal_min_state_area_t *minstate) { @@ -901,7 +949,7 @@ * handled */ static irqreturn_t -ia64_mca_cmc_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs) +ia64_mca_cmc_int_caller(int cmc_irq, void *arg, struct pt_regs *ptregs) { static int start_count = -1; unsigned int cpuid; @@ -912,7 +960,7 @@ if (start_count == -1) start_count = IA64_LOG_COUNT(SAL_INFO_TYPE_CMC); - ia64_mca_cmc_int_handler(cpe_irq, arg, ptregs); + ia64_mca_cmc_int_handler(cmc_irq, arg, ptregs); for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++); @@ -967,11 +1015,13 @@ * Outputs * handled */ +#ifdef CONFIG_ACPI + static irqreturn_t ia64_mca_cpe_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs) { static int start_count = -1; - static int poll_time = MAX_CPE_POLL_INTERVAL; + static int poll_time = MIN_CPE_POLL_INTERVAL; unsigned int cpuid; cpuid = smp_processor_id(); @@ -989,20 +1039,30 @@ } else { /* * If a log was recorded, increase our polling frequency, - * otherwise, backoff. + * otherwise, backoff or return to interrupt mode. */ if (start_count != IA64_LOG_COUNT(SAL_INFO_TYPE_CPE)) { poll_time = max(MIN_CPE_POLL_INTERVAL, poll_time / 2); - } else { + } else if (cpe_vector < 0) { poll_time = min(MAX_CPE_POLL_INTERVAL, poll_time * 2); + } else { + poll_time = MIN_CPE_POLL_INTERVAL; + + printk(KERN_WARNING "Returning to interrupt driven CPE handler\n"); + enable_irq(local_vector_to_irq(IA64_CPE_VECTOR)); + cpe_poll_enabled = 0; } + + if (cpe_poll_enabled) + mod_timer(&cpe_poll_timer, jiffies + poll_time); start_count = -1; - mod_timer(&cpe_poll_timer, jiffies + poll_time); } return IRQ_HANDLED; } +#endif /* CONFIG_ACPI */ + /* * ia64_mca_cpe_poll * @@ -1240,21 +1300,23 @@ register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction); #ifdef CONFIG_ACPI - /* Setup the CPE interrupt vector */ + /* Setup the CPEI/P vector and handler */ { irq_desc_t *desc; unsigned int irq; - int cpev = acpi_request_vector(ACPI_INTERRUPT_CPEI); - if (cpev >= 0) { + cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI); + + if (cpe_vector >= 0) { for (irq = 0; irq < NR_IRQS; ++irq) - if (irq_to_vector(irq) == cpev) { + if (irq_to_vector(irq) == cpe_vector) { desc = irq_descp(irq); desc->status |= IRQ_PER_CPU; setup_irq(irq, &mca_cpe_irqaction); } - ia64_mca_register_cpev(cpev); + ia64_mca_register_cpev(cpe_vector); } + register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction); } #endif @@ -1294,9 +1356,10 @@ #ifdef CONFIG_ACPI /* If platform doesn't support CPEI, get the timer going. */ - if (acpi_request_vector(ACPI_INTERRUPT_CPEI) < 0 && cpe_poll_enabled) { - register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction); + if (cpe_vector < 0 && cpe_poll_enabled) { ia64_mca_cpe_poll(0UL); + } else { + cpe_poll_enabled = 0; } #endif diff -Nru a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c --- a/arch/ia64/kernel/palinfo.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ia64/kernel/palinfo.c 2004-06-23 19:04:25 -07:00 @@ -515,10 +515,10 @@ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - "Enable Cache Line Repl. Exclusive", "Enable Cache Line Repl. Shared", + "Enable Cache Line Repl. Exclusive", "Disable Transaction Queuing", - "Disable Reponse Error Checking", + "Disable Response Error Checking", "Disable Bus Error Checking", "Disable Bus Requester Internal Error Signalling", "Disable Bus Requester Error Signalling", diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c --- a/arch/ia64/kernel/perfmon.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ia64/kernel/perfmon.c 2004-06-23 19:04:28 -07:00 @@ -311,6 +311,7 @@ unsigned int ctx_cpu; /* cpu to which perfmon is applied (system wide) */ int ctx_fd; /* file descriptor used my this context */ + pfm_ovfl_arg_t ctx_ovfl_arg; /* argument to custom buffer format handler */ pfm_buffer_fmt_t *ctx_buf_fmt; /* buffer format callbacks */ void *ctx_smpl_hdr; /* points to sampling buffer header kernel vaddr */ @@ -4584,31 +4585,6 @@ return 0; } -static void -pfm_force_cleanup(pfm_context_t *ctx, struct pt_regs *regs) -{ - struct task_struct *task = ctx->ctx_task; - - ia64_psr(regs)->up = 0; - ia64_psr(regs)->sp = 1; - - if (GET_PMU_OWNER() == task) { - DPRINT(("cleared ownership for [%d]\n", ctx->ctx_task->pid)); - SET_PMU_OWNER(NULL, NULL); - } - - /* - * disconnect the task from the context and vice-versa - */ - PFM_SET_WORK_PENDING(task, 0); - - task->thread.pfm_context = NULL; - task->thread.flags &= ~IA64_THREAD_PM_VALID; - - DPRINT(("force cleanupf for [%d]\n", task->pid)); -} - - /* * called only from exit_thread(): task == current @@ -5185,7 +5161,7 @@ static void pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs) { - pfm_ovfl_arg_t ovfl_arg; + pfm_ovfl_arg_t *ovfl_arg; unsigned long mask; unsigned long old_val, ovfl_val, new_val; unsigned long ovfl_notify = 0UL, ovfl_pmds = 0UL, smpl_pmds = 0UL, reset_pmds; @@ -5272,7 +5248,8 @@ int j, k, ret = 0; int this_cpu = smp_processor_id(); - pmd_mask = ovfl_pmds >> PMU_FIRST_COUNTER; + pmd_mask = ovfl_pmds >> PMU_FIRST_COUNTER; + ovfl_arg = &ctx->ctx_ovfl_arg; prefetch(ctx->ctx_smpl_hdr); @@ -5282,15 +5259,15 @@ if ((pmd_mask & 0x1) == 0) continue; - ovfl_arg.ovfl_pmd = (unsigned char )i; - ovfl_arg.ovfl_notify = ovfl_notify & mask ? 1 : 0; - ovfl_arg.active_set = 0; - ovfl_arg.ovfl_ctrl.val = 0; /* module must fill in all fields */ - ovfl_arg.smpl_pmds[0] = smpl_pmds = ctx->ctx_pmds[i].smpl_pmds[0]; - - ovfl_arg.pmd_value = ctx->ctx_pmds[i].val; - ovfl_arg.pmd_last_reset = ctx->ctx_pmds[i].lval; - ovfl_arg.pmd_eventid = ctx->ctx_pmds[i].eventid; + ovfl_arg->ovfl_pmd = (unsigned char )i; + ovfl_arg->ovfl_notify = ovfl_notify & mask ? 1 : 0; + ovfl_arg->active_set = 0; + ovfl_arg->ovfl_ctrl.val = 0; /* module must fill in all fields */ + ovfl_arg->smpl_pmds[0] = smpl_pmds = ctx->ctx_pmds[i].smpl_pmds[0]; + + ovfl_arg->pmd_value = ctx->ctx_pmds[i].val; + ovfl_arg->pmd_last_reset = ctx->ctx_pmds[i].lval; + ovfl_arg->pmd_eventid = ctx->ctx_pmds[i].eventid; /* * copy values of pmds of interest. Sampling format may copy them @@ -5299,8 +5276,8 @@ if (smpl_pmds) { for(j=0, k=0; smpl_pmds; j++, smpl_pmds >>=1) { if ((smpl_pmds & 0x1) == 0) continue; - ovfl_arg.smpl_pmds_values[k++] = PMD_IS_COUNTING(j) ? pfm_read_soft_counter(ctx, j) : ia64_get_pmd(j); - DPRINT_ovfl(("smpl_pmd[%d]=pmd%u=0x%lx\n", k-1, j, ovfl_arg.smpl_pmds_values[k-1])); + ovfl_arg->smpl_pmds_values[k++] = PMD_IS_COUNTING(j) ? pfm_read_soft_counter(ctx, j) : ia64_get_pmd(j); + DPRINT_ovfl(("smpl_pmd[%d]=pmd%u=0x%lx\n", k-1, j, ovfl_arg->smpl_pmds_values[k-1])); } } @@ -5311,7 +5288,7 @@ /* * call custom buffer format record (handler) routine */ - ret = (*ctx->ctx_buf_fmt->fmt_handler)(task, ctx->ctx_smpl_hdr, &ovfl_arg, regs, tstamp); + ret = (*ctx->ctx_buf_fmt->fmt_handler)(task, ctx->ctx_smpl_hdr, ovfl_arg, regs, tstamp); end_cycles = ia64_get_itc(); @@ -5319,13 +5296,13 @@ * For those controls, we take the union because they have * an all or nothing behavior. */ - ovfl_ctrl.bits.notify_user |= ovfl_arg.ovfl_ctrl.bits.notify_user; - ovfl_ctrl.bits.block_task |= ovfl_arg.ovfl_ctrl.bits.block_task; - ovfl_ctrl.bits.mask_monitoring |= ovfl_arg.ovfl_ctrl.bits.mask_monitoring; + ovfl_ctrl.bits.notify_user |= ovfl_arg->ovfl_ctrl.bits.notify_user; + ovfl_ctrl.bits.block_task |= ovfl_arg->ovfl_ctrl.bits.block_task; + ovfl_ctrl.bits.mask_monitoring |= ovfl_arg->ovfl_ctrl.bits.mask_monitoring; /* * build the bitmask of pmds to reset now */ - if (ovfl_arg.ovfl_ctrl.bits.reset_ovfl_pmds) reset_pmds |= mask; + if (ovfl_arg->ovfl_ctrl.bits.reset_ovfl_pmds) reset_pmds |= mask; pfm_stats[this_cpu].pfm_smpl_handler_cycles += end_cycles - start_cycles; } @@ -5793,6 +5770,32 @@ } #ifdef CONFIG_SMP + +static void +pfm_force_cleanup(pfm_context_t *ctx, struct pt_regs *regs) +{ + struct task_struct *task = ctx->ctx_task; + + ia64_psr(regs)->up = 0; + ia64_psr(regs)->sp = 1; + + if (GET_PMU_OWNER() == task) { + DPRINT(("cleared ownership for [%d]\n", ctx->ctx_task->pid)); + SET_PMU_OWNER(NULL, NULL); + } + + /* + * disconnect the task from the context and vice-versa + */ + PFM_SET_WORK_PENDING(task, 0); + + task->thread.pfm_context = NULL; + task->thread.flags &= ~IA64_THREAD_PM_VALID; + + DPRINT(("force cleanup for [%d]\n", task->pid)); +} + + /* * in 2.6, interrupts are masked when we come here and the runqueue lock is held */ diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c --- a/arch/ia64/kernel/process.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ia64/kernel/process.c 2004-06-23 19:04:27 -07:00 @@ -439,6 +439,10 @@ ia32_save_state(p); if (clone_flags & CLONE_SETTLS) retval = ia32_clone_tls(p, child_ptregs); + + /* Copy partially mapped page list */ + if (!retval) + retval = ia32_copy_partial_page_list(p, clone_flags); } #endif @@ -672,6 +676,8 @@ /* drop floating-point and debug-register state if it exists: */ current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); ia64_drop_fpu(current); + if (IS_IA32_PROCESS(ia64_task_regs(current))) + ia32_drop_partial_page_list(current); } /* @@ -691,6 +697,8 @@ if (current->thread.flags & IA64_THREAD_DBG_VALID) pfm_release_debug_registers(current); #endif + if (IS_IA32_PROCESS(ia64_task_regs(current))) + ia32_drop_partial_page_list(current); } unsigned long diff -Nru a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c --- a/arch/ia64/kernel/unwind.c 2004-06-23 19:04:29 -07:00 +++ b/arch/ia64/kernel/unwind.c 2004-06-23 19:04:29 -07:00 @@ -385,9 +385,10 @@ } if (write) { - if (read_only(addr)) - UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n"); - else { + if (read_only(addr)) { + UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", + __FUNCTION__); + } else { *addr = *val; if (*nat) *nat_addr |= nat_mask; @@ -432,9 +433,10 @@ return -1; } if (write) - if (read_only(addr)) - UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n"); - else + if (read_only(addr)) { + UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", + __FUNCTION__); + } else *addr = *val; else *val = *addr; @@ -480,9 +482,10 @@ } if (write) - if (read_only(addr)) - UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n"); - else + if (read_only(addr)) { + UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", + __FUNCTION__); + } else *addr = *val; else *val = *addr; @@ -576,9 +579,10 @@ } if (write) { - if (read_only(addr)) - UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n"); - else + if (read_only(addr)) { + UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", + __FUNCTION__); + } else *addr = *val; } else *val = *addr; @@ -596,9 +600,10 @@ addr = &info->sw->pr; if (write) { - if (read_only(addr)) - UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n"); - else + if (read_only(addr)) { + UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n", + __FUNCTION__); + } else *addr = *val; } else *val = *addr; diff -Nru a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c --- a/arch/ia64/mm/discontig.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ia64/mm/discontig.c 2004-06-23 19:04:28 -07:00 @@ -154,6 +154,9 @@ memcpy(numa_slit, numa_slit_fix, sizeof (numa_slit)); + for (i = nnode; i < numnodes; i++) + node_set_offline(i); + numnodes = nnode; return; diff -Nru a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c --- a/arch/ia64/mm/hugetlbpage.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ia64/mm/hugetlbpage.c 2004-06-23 19:04:27 -07:00 @@ -297,7 +297,7 @@ unlock_page(page); } else { hugetlb_put_quota(mapping); - free_huge_page(page); + page_cache_release(page); goto out; } } diff -Nru a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c --- a/arch/ia64/pci/pci.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ia64/pci/pci.c 2004-06-23 19:04:26 -07:00 @@ -134,10 +134,18 @@ static int __init pci_acpi_init (void) { - if (!acpi_pci_irq_init()) - printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); - else - printk(KERN_WARNING "PCI: Invalid ACPI-PCI IRQ routing table\n"); + struct pci_dev *dev = NULL; + + printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); + + /* + * PCI IRQ routing is set up by pci_enable_device(), but we + * also do it here in case there are still broken drivers that + * don't use pci_enable_device(). + */ + while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) + acpi_pci_irq_enable(dev); + return 0; } diff -Nru a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c --- a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c 2004-06-23 19:04:28 -07:00 @@ -741,7 +741,7 @@ /* Is this PCI bus associated with this moduleid? */ moduleid = NODE_MODULEID( nasid_to_cnodeid(pcibr_soft->bs_nasid)); - if (modules[i]->id == moduleid) { + if (sn_modules[i]->id == moduleid) { struct pcibr_list_s *new_element; new_element = kmalloc(sizeof (struct pcibr_soft_s), GFP_KERNEL); @@ -781,7 +781,7 @@ /* * We now have a list of all the pci bridges associated with - * the module_id, modules[i]. Call pci_bus_map_create() for + * the module_id, sn_modules[i]. Call pci_bus_map_create() for * each pci bridge */ softlistp = first_in_list; diff -Nru a/arch/ia64/sn/io/sn2/klgraph.c b/arch/ia64/sn/io/sn2/klgraph.c --- a/arch/ia64/sn/io/sn2/klgraph.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ia64/sn/io/sn2/klgraph.c 2004-06-23 19:04:27 -07:00 @@ -527,7 +527,7 @@ /* Use module as module vertex fastinfo */ memset(buffer, 0, 16); - format_module_id(buffer, modules[cm]->id, MODULE_FORMAT_BRIEF); + format_module_id(buffer, sn_modules[cm]->id, MODULE_FORMAT_BRIEF); sprintf(name, EDGE_LBL_MODULE "/%s", buffer); rc = hwgraph_path_add(hwgraph_root, name, &module_vhdl); @@ -535,7 +535,7 @@ rc = rc; HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, module_vhdl, NULL, "Created module path.\n"); - hwgraph_fastinfo_set(module_vhdl, (arbitrary_info_t) modules[cm]); + hwgraph_fastinfo_set(module_vhdl, (arbitrary_info_t) sn_modules[cm]); /* Add system controller */ sprintf(name, diff -Nru a/arch/ia64/sn/io/sn2/ml_iograph.c b/arch/ia64/sn/io/sn2/ml_iograph.c --- a/arch/ia64/sn/io/sn2/ml_iograph.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ia64/sn/io/sn2/ml_iograph.c 2004-06-23 19:04:25 -07:00 @@ -518,6 +518,14 @@ ASSERT(hubv != GRAPH_VERTEX_NONE); /* + * attach our hub_provider information to hubv, + * so we can use it as a crosstalk provider "master" + * vertex. + */ + xtalk_provider_register(hubv, &hub_provider); + xtalk_provider_startup(hubv); + + /* * If nothing connected to this hub's xtalk port, we're done. */ early_probe_for_widget(hubv, &hwid); @@ -526,14 +534,6 @@ return; /* NOTREACHED */ } - - /* - * attach our hub_provider information to hubv, - * so we can use it as a crosstalk provider "master" - * vertex. - */ - xtalk_provider_register(hubv, &hub_provider); - xtalk_provider_startup(hubv); /* * Create a vertex to represent the crosstalk bus diff -Nru a/arch/ia64/sn/io/sn2/module.c b/arch/ia64/sn/io/sn2/module.c --- a/arch/ia64/sn/io/sn2/module.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ia64/sn/io/sn2/module.c 2004-06-23 19:04:25 -07:00 @@ -33,7 +33,7 @@ #define DPRINTF(x...) #endif -module_t *modules[MODULE_MAX]; +module_t *sn_modules[MODULE_MAX]; int nummodules; #define SN00_SERIAL_FUDGE 0x3b1af409d513c2 @@ -59,9 +59,9 @@ int i; for (i = 0; i < nummodules; i++) - if (modules[i]->id == id) { - DPRINTF("module_lookup: found m=0x%p\n", modules[i]); - return modules[i]; + if (sn_modules[i]->id == id) { + DPRINTF("module_lookup: found m=0x%p\n", sn_modules[i]); + return sn_modules[i]; } return NULL; @@ -104,10 +104,10 @@ /* Insert in sorted order by module number */ - for (i = nummodules; i > 0 && modules[i - 1]->id > moduleid; i--) - modules[i] = modules[i - 1]; + for (i = nummodules; i > 0 && sn_modules[i - 1]->id > moduleid; i--) + sn_modules[i] = sn_modules[i - 1]; - modules[i] = m; + sn_modules[i] = m; nummodules++; } diff -Nru a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c --- a/arch/ia64/sn/kernel/irq.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ia64/sn/kernel/irq.c 2004-06-23 19:04:25 -07:00 @@ -41,6 +41,7 @@ extern void pcibr_force_interrupt(pcibr_intr_t intr); extern int sn_force_interrupt_flag; struct irq_desc * sn_irq_desc(unsigned int irq); +extern cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; struct sn_intr_list_t { struct sn_intr_list_t *next; @@ -71,6 +72,21 @@ { } +static inline void move_irq(int irq) +{ + /* note - we hold desc->lock */ + cpumask_t tmp; + irq_desc_t *desc = irq_descp(irq); + + if (!cpus_empty(pending_irq_cpumask[irq])) { + cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); + if (unlikely(!cpus_empty(tmp))) { + desc->handler->set_affinity(irq, pending_irq_cpumask[irq]); + } + cpus_clear(pending_irq_cpumask[irq]); + } +} + static void sn_ack_irq(unsigned int irq) { @@ -94,6 +110,7 @@ } HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED_ALIAS), mask ); __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); + move_irq(irq); } static void diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c --- a/arch/ia64/sn/kernel/setup.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ia64/sn/kernel/setup.c 2004-06-23 19:04:26 -07:00 @@ -226,7 +226,25 @@ shub_1_1_found = 1; } - +/** + * sn_set_error_handling_features - Tell the SN prom how to handle certain + * error types. + */ +static void __init +sn_set_error_handling_features(void) +{ + u64 ret; + u64 sn_ehf_bits[7]; /* see ia64_sn_set_error_handling_features */ + memset(sn_ehf_bits, 0, sizeof(sn_ehf_bits)); +#define EHF(x) __set_bit(SN_SAL_EHF_ ## x, sn_ehf_bits) + EHF(MCA_SLV_TO_OS_INIT_SLV); + EHF(NO_RZ_TLBC); + // Uncomment once Jesse's code goes in - EHF(NO_RZ_IO_READ); +#undef EHF + ret = ia64_sn_set_error_handling_features(sn_ehf_bits); + if (ret) + printk(KERN_ERR "%s: failed, return code %ld\n", __FUNCTION__, ret); +} /** * sn_setup - SN platform setup routine @@ -317,6 +335,9 @@ printk(KERN_DEBUG "sn_setup: setting master_node_bedrock_address to 0x%lx\n", master_node_bedrock_address); } + + /* Tell the prom how to handle certain error types */ + sn_set_error_handling_features(); /* * we set the default root device to /dev/hda diff -Nru a/arch/m68k/Makefile b/arch/m68k/Makefile --- a/arch/m68k/Makefile 2004-06-23 19:04:28 -07:00 +++ b/arch/m68k/Makefile 2004-06-23 19:04:28 -07:00 @@ -28,6 +28,8 @@ LDFLAGS_vmlinux = -N endif +CHECK := $(CHECK) -D__mc68000__=1 -I$(shell $(CC) -print-file-name=include) + # without -fno-strength-reduce the 53c7xx.c driver fails ;-( CFLAGS += -pipe -fno-strength-reduce -ffixed-a2 diff -Nru a/arch/m68k/ifpsp060/iskeleton.S b/arch/m68k/ifpsp060/iskeleton.S --- a/arch/m68k/ifpsp060/iskeleton.S 2004-06-23 19:04:25 -07:00 +++ b/arch/m68k/ifpsp060/iskeleton.S 2004-06-23 19:04:25 -07:00 @@ -196,14 +196,57 @@ | Expected outputs: | d0 = 0 -> success; non-zero -> failure | -| Linux/68k: As long as ints are disabled, no swapping out should -| occur (hopefully...) +| Linux/m68k: Make sure the page is properly paged in, so we use +| plpaw and handle any exception here. The kernel must not be +| preempted until _060_unlock_page(), so that the page stays mapped. | .global _060_real_lock_page _060_real_lock_page: - clr.l %d0 + move.l %d2,-(%sp) + | load sfc/dfc + moveq #5,%d0 + tst.b %d0 + jne 1f + moveq #1,%d0 +1: movec.l %dfc,%d2 + movec.l %d0,%dfc + movec.l %d0,%sfc + + clr.l %d0 + | prefetch address + .chip 68060 + move.l %a0,%a1 +1: plpaw (%a1) + addq.w #1,%a0 + tst.b %d1 + jeq 2f + addq.w #2,%a0 +2: plpaw (%a0) +3: .chip 68k + + | restore sfc/dfc + movec.l %d2,%dfc + movec.l %d2,%sfc + move.l (%sp)+,%d2 rts +.section __ex_table,"a" + .align 4 + .long 1b,11f + .long 2b,21f +.previous +.section .fixup,"ax" + .even +11: move.l #0x020003c0,%d0 + or.l %d2,%d0 + swap %d0 + jra 3b +21: move.l #0x02000bc0,%d0 + or.l %d2,%d0 + swap %d0 + jra 3b +.previous + | | _060_unlock_page(): | @@ -216,8 +259,7 @@ | d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user | d1 = `xxxxxxff -> longword; `xxxxxx00 -> word | -| Linux/68k: As we do no special locking operation, also no unlocking -| is needed... +| Linux/m68k: perhaps reenable preemption here... .global _060_real_unlock_page _060_real_unlock_page: diff -Nru a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c --- a/arch/m68k/kernel/process.c 2004-06-23 19:04:29 -07:00 +++ b/arch/m68k/kernel/process.c 2004-06-23 19:04:29 -07:00 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c --- a/arch/m68k/kernel/signal.c 2004-06-23 19:04:27 -07:00 +++ b/arch/m68k/kernel/signal.c 2004-06-23 19:04:27 -07:00 @@ -228,8 +228,8 @@ goto out; __asm__ volatile (".chip 68k/68881\n\t" - "fmovemx %0,%/fp0-%/fp1\n\t" - "fmoveml %1,%/fpcr/%/fpsr/%/fpiar\n\t" + "fmovemx %0,%%fp0-%%fp1\n\t" + "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t" ".chip 68k" : /* no outputs */ : "m" (*sc->sc_fpregs), "m" (*sc->sc_fpcntl)); @@ -258,7 +258,7 @@ if (FPU_IS_EMU) { /* restore fpu control register */ if (__copy_from_user(current->thread.fpcntl, - &uc->uc_mcontext.fpregs.f_pcr, 12)) + uc->uc_mcontext.fpregs.f_fpcntl, 12)) goto out; /* restore all other fpu register */ if (__copy_from_user(current->thread.fp, @@ -298,12 +298,12 @@ sizeof(fpregs))) goto out; __asm__ volatile (".chip 68k/68881\n\t" - "fmovemx %0,%/fp0-%/fp7\n\t" - "fmoveml %1,%/fpcr/%/fpsr/%/fpiar\n\t" + "fmovemx %0,%%fp0-%%fp7\n\t" + "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t" ".chip 68k" : /* no outputs */ : "m" (*fpregs.f_fpregs), - "m" (fpregs.f_pcr)); + "m" (*fpregs.f_fpcntl)); } if (context_size && __copy_from_user(fpstate + 4, (long *)&uc->uc_fpstate + 1, @@ -586,12 +586,12 @@ sc->sc_fpstate[0x38] |= 1 << 3; } __asm__ volatile (".chip 68k/68881\n\t" - "fmovemx %/fp0-%/fp1,%0\n\t" - "fmoveml %/fpcr/%/fpsr/%/fpiar,%1\n\t" + "fmovemx %%fp0-%%fp1,%0\n\t" + "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t" ".chip 68k" - : /* no outputs */ - : "m" (*sc->sc_fpregs), - "m" (*sc->sc_fpcntl) + : "=m" (*sc->sc_fpregs), + "=m" (*sc->sc_fpcntl) + : /* no inputs */ : "memory"); } } @@ -604,7 +604,7 @@ if (FPU_IS_EMU) { /* save fpu control register */ - err |= copy_to_user(&uc->uc_mcontext.fpregs.f_pcr, + err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpcntl, current->thread.fpcntl, 12); /* save all other fpu register */ err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpregs, @@ -631,12 +631,12 @@ fpstate[0x38] |= 1 << 3; } __asm__ volatile (".chip 68k/68881\n\t" - "fmovemx %/fp0-%/fp7,%0\n\t" - "fmoveml %/fpcr/%/fpsr/%/fpiar,%1\n\t" + "fmovemx %%fp0-%%fp7,%0\n\t" + "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t" ".chip 68k" - : /* no outputs */ - : "m" (*fpregs.f_fpregs), - "m" (fpregs.f_pcr) + : "=m" (*fpregs.f_fpregs), + "=m" (*fpregs.f_fpcntl) + : /* no inputs */ : "memory"); err |= copy_to_user(&uc->uc_mcontext.fpregs, &fpregs, sizeof(fpregs)); diff -Nru a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c --- a/arch/m68k/kernel/traps.c 2004-06-23 19:04:29 -07:00 +++ b/arch/m68k/kernel/traps.c 2004-06-23 19:04:29 -07:00 @@ -329,7 +329,8 @@ * fault during mem_read/mem_write in ifpsp060/os.S */ send_fault_sig(&fp->ptregs); - } else { + } else if (!(fslw & (MMU060_RE|MMU060_WE)) || + send_fault_sig(&fp->ptregs) > 0) { printk("pc=%#lx, fa=%#lx\n", fp->ptregs.pc, fp->un.fmt4.effaddr); printk( "68060 access error, fslw=%lx\n", fslw ); trap_c( fp ); @@ -517,7 +518,7 @@ if (fp->un.fmt7.wb2a == fp->un.fmt7.faddr) fp->un.fmt7.wb2s &= ~WBV_040; } - } else { + } else if (send_fault_sig(&fp->ptregs) > 0) { printk("68040 access error, ssw=%x\n", ssw); trap_c(fp); } @@ -732,7 +733,7 @@ return; } else if (!(mmusr & MMU_I)) { /* probably a 020 cas fault */ - if (!(ssw & RM)) + if (!(ssw & RM) && send_fault_sig(&fp->ptregs) > 0) printk("unexpected bus error (%#x,%#x)\n", ssw, mmusr); } else if (mmusr & (MMU_B|MMU_L|MMU_S)) { printk("invalid %s access at %#lx from pc %#lx\n", diff -Nru a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c --- a/arch/m68k/mac/iop.c 2004-06-23 19:04:28 -07:00 +++ b/arch/m68k/mac/iop.c 2004-06-23 19:04:28 -07:00 @@ -261,7 +261,7 @@ } else { iop_base[IOP_NUM_ISM] = (struct mac_iop *) ISM_IOP_BASE_QUADRA; } - iop_base[IOP_NUM_SCC]->status_ctrl = 0; + iop_base[IOP_NUM_ISM]->status_ctrl = 0; iop_ism_present = 1; } else { iop_base[IOP_NUM_ISM] = NULL; diff -Nru a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c --- a/arch/m68k/mm/memory.c 2004-06-23 19:04:27 -07:00 +++ b/arch/m68k/mm/memory.c 2004-06-23 19:04:27 -07:00 @@ -54,7 +54,7 @@ /* unreserve the page so it's possible to free that page */ PD_PAGE(dp)->flags &= ~(1 << PG_reserved); - atomic_set(&PD_PAGE(dp)->count, 1); + set_page_count(PD_PAGE(dp), 1); return; } diff -Nru a/arch/m68knommu/kernel/init_task.c b/arch/m68knommu/kernel/init_task.c --- a/arch/m68knommu/kernel/init_task.c 2004-06-23 19:04:26 -07:00 +++ b/arch/m68knommu/kernel/init_task.c 2004-06-23 19:04:26 -07:00 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig --- a/arch/mips/Kconfig 2004-06-23 19:04:27 -07:00 +++ b/arch/mips/Kconfig 2004-06-23 19:04:27 -07:00 @@ -932,11 +932,6 @@ depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000 default n -config COBALT_LCD - bool - depends on MIPS_COBALT - default y - config MIPS_GT96100 bool depends on MIPS_EV96100 diff -Nru a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig --- a/arch/mips/configs/cobalt_defconfig 2004-06-23 19:04:26 -07:00 +++ b/arch/mips/configs/cobalt_defconfig 2004-06-23 19:04:26 -07:00 @@ -80,7 +80,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_IRQ_CPU=y CONFIG_MIPS_GT64111=y -CONFIG_COBALT_LCD=y CONFIG_MIPS_L1_CACHE_SHIFT=5 # CONFIG_FB is not set @@ -432,6 +431,7 @@ # # CONFIG_WATCHDOG is not set CONFIG_RTC=y +CONFIG_COBALT_LCD=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set diff -Nru a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig --- a/arch/mips/configs/ip22_defconfig 2004-06-23 19:04:26 -07:00 +++ b/arch/mips/configs/ip22_defconfig 2004-06-23 19:04:26 -07:00 @@ -583,7 +583,7 @@ CONFIG_INDYDOG=m # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -CONFIG_SGI_DS1286=y +CONFIG_SGI_DS1286=m # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set diff -Nru a/arch/mips/defconfig b/arch/mips/defconfig --- a/arch/mips/defconfig 2004-06-23 19:04:25 -07:00 +++ b/arch/mips/defconfig 2004-06-23 19:04:25 -07:00 @@ -583,7 +583,7 @@ CONFIG_INDYDOG=m # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set -CONFIG_SGI_DS1286=y +CONFIG_SGI_DS1286=m # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set diff -Nru a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c --- a/arch/mips/kernel/init_task.c 2004-06-23 19:04:26 -07:00 +++ b/arch/mips/kernel/init_task.c 2004-06-23 19:04:26 -07:00 @@ -3,6 +3,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c --- a/arch/parisc/kernel/init_task.c 2004-06-23 19:04:27 -07:00 +++ b/arch/parisc/kernel/init_task.c 2004-06-23 19:04:27 -07:00 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig --- a/arch/ppc/Kconfig 2004-06-23 19:04:29 -07:00 +++ b/arch/ppc/Kconfig 2004-06-23 19:04:29 -07:00 @@ -72,8 +72,21 @@ config 8xx bool "8xx" +config E500 + bool "e500" + endchoice +config BOOKE + bool + depends on E500 + default y + +config FSL_BOOKE + bool + depends on E500 + default y + config PTE_64BIT bool depends on 44x @@ -96,6 +109,21 @@ If in doubt, say Y here. +config SPE + bool "SPE Support" + depends on E500 + ---help--- + This option enables kernel support for the Signal Processing + Extensions (SPE) to the PowerPC processor. The kernel currently + supports saving and restoring SPE registers, and turning on the + 'spe enable' bit so user processes can execute SPE instructions. + + This option is only usefully if you have a processor that supports + SPE (e500, otherwise known as 85xx series), but does not have any + affect on a non-spe cpu (it does, however add code to the kernel). + + If in doubt, say Y here. + config TAU bool "Thermal Management Support" depends on 6xx && !8260 @@ -142,7 +170,7 @@ config MATH_EMULATION bool "Math emulation" - depends on 4xx || 8xx + depends on 4xx || 8xx || E500 ---help--- Some PowerPC chips designed for embedded applications do not have a floating-point unit and therefore do not implement the @@ -198,6 +226,7 @@ If in doubt, say Y here. source arch/ppc/platforms/4xx/Kconfig +source arch/ppc/platforms/85xx/Kconfig config PPC64BRIDGE bool @@ -974,8 +1003,8 @@ bool config PCI - bool "PCI support" if 40x || 8260 - default y if !40x && !8260 && !8xx && !APUS + bool "PCI support" if 40x || 8260 || 85xx + default y if !40x && !8260 && !8xx && !APUS && !85xx default PCI_PERMEDIA if !4xx && !8260 && !8xx && APUS default PCI_QSPAN if !4xx && !8260 && 8xx help @@ -1154,6 +1183,7 @@ source "lib/Kconfig" +source "arch/ppc/oprofile/Kconfig" menu "Kernel hacking" @@ -1273,7 +1303,7 @@ config PPC_OCP bool - depends on IBM_OCP + depends on IBM_OCP || FSL_OCP default y endmenu diff -Nru a/arch/ppc/Makefile b/arch/ppc/Makefile --- a/arch/ppc/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc/Makefile 2004-06-23 19:04:25 -07:00 @@ -17,19 +17,24 @@ CPPFLAGS += -Iarch/$(ARCH) AFLAGS += -Iarch/$(ARCH) cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \ - -ffixed-r2 -Wno-uninitialized -mmultiple -mstring + -ffixed-r2 -Wno-uninitialized -mmultiple CPP = $(CC) -E $(CFLAGS) +ifndef CONFIG_E500 +cflags-y += -mstring +endif + cflags-$(CONFIG_4xx) += -Wa,-m405 +cflags-$(CONFIG_E500) += -Wa,-me500 cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge CFLAGS += $(cflags-y) - head-y := arch/ppc/kernel/head.o head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o +head-$(CONFIG_E500) := arch/ppc/kernel/head_e500.o head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o head-$(CONFIG_POWER4) += arch/ppc/kernel/idle_power4.o @@ -37,12 +42,15 @@ core-y += arch/ppc/kernel/ arch/ppc/platforms/ \ arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/ core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/ +core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/ core-$(CONFIG_XMON) += arch/ppc/xmon/ core-$(CONFIG_APUS) += arch/ppc/amiga/ drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/ drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/ drivers-$(CONFIG_8260) += arch/ppc/8260_io/ + +drivers-$(CONFIG_OPROFILE) += arch/ppc/oprofile/ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm diff -Nru a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile --- a/arch/ppc/kernel/Makefile 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/kernel/Makefile 2004-06-23 19:04:28 -07:00 @@ -8,10 +8,14 @@ ifdef CONFIG_4xx EXTRA_AFLAGS := -Wa,-m405 endif +ifdef CONFIG_E500 +EXTRA_AFLAGS := -Wa,-me500 +endif extra-$(CONFIG_PPC_STD_MMU) := head.o extra-$(CONFIG_40x) := head_4xx.o extra-$(CONFIG_44x) := head_44x.o +extra-$(CONFIG_E500) := head_e500.o extra-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_6xx) += idle_6xx.o extra-$(CONFIG_POWER4) += idle_power4.o diff -Nru a/arch/ppc/kernel/align.c b/arch/ppc/kernel/align.c --- a/arch/ppc/kernel/align.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc/kernel/align.c 2004-06-23 19:04:25 -07:00 @@ -21,7 +21,7 @@ unsigned char flags; }; -#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) +#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE) #define OPCD(inst) (((inst) & 0xFC000000) >> 26) #define RS(inst) (((inst) & 0x03E00000) >> 21) #define RA(inst) (((inst) & 0x001F0000) >> 16) @@ -184,7 +184,7 @@ fix_alignment(struct pt_regs *regs) { int instr, nb, flags; -#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) +#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE) int opcode, f1, f2, f3; #endif int i, t; @@ -199,8 +199,8 @@ CHECK_FULL_REGS(regs); -#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) - /* The 4xx-family processors have no DSISR register, +#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE) + /* The 4xx-family & Book-E processors have no DSISR register, * so we emulate it. * The POWER4 has a DSISR register but doesn't set it on * an alignment fault. -- paulus @@ -250,7 +250,7 @@ flags = aligninfo[instr].flags; - /* For the 4xx-family processors, the 'dar' field of the + /* For the 4xx-family & Book-E processors, the 'dar' field of the * pt_regs structure is overloaded and is really from the DEAR. */ diff -Nru a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c --- a/arch/ppc/kernel/asm-offsets.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc/kernel/asm-offsets.c 2004-06-23 19:04:27 -07:00 @@ -44,7 +44,7 @@ DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); -#ifdef CONFIG_4xx +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0)); DEFINE(PT_PTRACED, PT_PTRACED); #endif @@ -54,6 +54,12 @@ DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr)); #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0])); + DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc)); + DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr)); + DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe)); +#endif /* CONFIG_SPE */ /* Interrupt register frame */ DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); diff -Nru a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c --- a/arch/ppc/kernel/cputable.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc/kernel/cputable.c 2004-06-23 19:04:27 -07:00 @@ -34,7 +34,8 @@ extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spec* spec); #define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \ - !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4)) + !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ + !defined(CONFIG_BOOKE)) /* This table only contains "desktop" CPUs, it need to be filled with embedded * ones as well... @@ -561,6 +562,16 @@ 0, /*__setup_cpu_440 */ }, #endif /* CONFIG_44x */ +#ifdef CONFIG_E500 + { /* e500 */ + 0xffff0000, 0x80200000, "e500", + /* xxx - galak: add CPU_FTR_CAN_DOZE */ + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, + PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, + 32, 32, + 0, /*__setup_cpu_e500 */ + }, +#endif #if !CLASSIC_PPC { /* default match */ 0x00000000, 0x00000000, "(generic PPC)", diff -Nru a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S --- a/arch/ppc/kernel/entry.S 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/kernel/entry.S 2004-06-23 19:04:28 -07:00 @@ -36,7 +36,7 @@ #undef SHOW_SYSCALLS_TASK /* - * MSR_KERNEL is > 0x10000 on 4xx since it include MSR_CE. + * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. */ #if MSR_KERNEL >= 0x10000 #define LOAD_MSR_KERNEL(r, x) lis r,(x)@h; ori r,r,(x)@l @@ -45,7 +45,7 @@ #endif #ifdef CONFIG_BOOKE -#define COR r8 +#define COR r8 /* Critical Offset Register (COR) */ #define BOOKE_LOAD_COR lis COR,crit_save@ha #define BOOKE_REST_COR mfspr COR,SPRG2 #define BOOKE_SAVE_COR mtspr SPRG2,COR @@ -241,11 +241,11 @@ andi. r0,r9,(_TIF_SYSCALL_TRACE|_TIF_SIGPENDING|_TIF_NEED_RESCHED) bne- syscall_exit_work syscall_exit_cont: -#ifdef CONFIG_4xx +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) /* If the process has its own DBCR0 value, load it up */ lwz r0,PTRACE(r2) andi. r0,r0,PT_PTRACED - bnel- load_4xx_dbcr0 + bnel- load_dbcr0 #endif stwcx. r0,0,r1 /* to clear the reservation */ lwz r4,_LINK(r1) @@ -510,7 +510,12 @@ stw r12,THREAD+THREAD_VRSAVE(r2) END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) #endif /* CONFIG_ALTIVEC */ - and. r0,r0,r11 /* FP or altivec enabled? */ +#ifdef CONFIG_SPE + oris r0,r0,MSR_SPE@h /* Disable SPE */ + mfspr r12,SPRN_SPEFSCR /* save spefscr register value */ + stw r12,THREAD+THREAD_SPEFSCR(r2) +#endif /* CONFIG_SPE */ + and. r0,r0,r11 /* FP or altivec or SPE enabled? */ beq+ 1f andc r11,r11,r0 MTMSRD(r11) @@ -543,6 +548,10 @@ mtspr SPRN_VRSAVE,r0 /* if G4, restore VRSAVE reg */ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + lwz r0,THREAD+THREAD_SPEFSCR(r2) + mtspr SPRN_SPEFSCR,r0 /* restore SPEFSCR reg */ +#endif /* CONFIG_SPE */ lwz r0,_CCR(r1) mtcrf 0xFF,r0 @@ -589,11 +598,11 @@ bne do_work restore_user: -#ifdef CONFIG_4xx +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) /* Check whether this process has its own DBCR0 value */ lwz r0,PTRACE(r2) andi. r0,r0,PT_PTRACED - bnel- load_4xx_dbcr0 + bnel- load_dbcr0 #endif #ifdef CONFIG_PREEMPT @@ -645,7 +654,7 @@ PPC405_ERR77(0,r1) stwcx. r0,0,r1 /* to clear the reservation */ -#ifndef CONFIG_4xx +#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) lwz r9,_MSR(r1) andi. r10,r9,MSR_RI /* check if this exception occurred */ beql nonrecoverable /* at a bad place (MSR:RI = 0) */ @@ -681,9 +690,9 @@ SYNC RFI -#else /* CONFIG_4xx */ +#else /* !(CONFIG_4xx || CONFIG_BOOKE) */ /* - * This is a bit different on 4xx because 4xx doesn't have + * This is a bit different on 4xx/Book-E because it doesn't have * the RI bit in the MSR. * The TLB miss handler checks if we have interrupted * the exception exit path and restarts it if so @@ -720,6 +729,9 @@ * give the wrong answer). * We have to restore various SPRs that may have been in use at the * time of the critical interrupt. + * + * Note that SPRG6 is used for machine check on CONFIG_BOOKE parts and + * thus not saved in the critical handler */ .globl ret_from_crit_exc ret_from_crit_exc: @@ -866,7 +878,7 @@ * Load the DBCR0 value for a task that is being ptraced, * having first saved away the global DBCR0. */ -load_4xx_dbcr0: +load_dbcr0: mfmsr r0 /* first disable debug exceptions */ rlwinm r0,r0,0,~MSR_DE mtmsr r0 @@ -885,7 +897,7 @@ blr .comm global_dbcr0,8 -#endif /* CONFIG_4xx */ +#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */ do_work: /* r10 contains MSR_KERNEL here */ andi. r0,r9,_TIF_NEED_RESCHED diff -Nru a/arch/ppc/kernel/head_e500.S b/arch/ppc/kernel/head_e500.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/kernel/head_e500.S 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,1329 @@ +/* + * arch/ppc/kernel/head_e500.S + * + * Kernel execution entry point code. + * + * Copyright (c) 1995-1996 Gary Thomas + * Initial PowerPC version. + * Copyright (c) 1996 Cort Dougan + * Rewritten for PReP + * Copyright (c) 1996 Paul Mackerras + * Low-level exception handers, MMU support, and rewrite. + * Copyright (c) 1997 Dan Malek + * PowerPC 8xx modifications. + * Copyright (c) 1998-1999 TiVo, Inc. + * PowerPC 403GCX modifications. + * Copyright (c) 1999 Grant Erickson + * PowerPC 403GCX/405GP modifications. + * Copyright 2000 MontaVista Software Inc. + * PPC405 modifications + * PowerPC 403GCX/405GP modifications. + * Author: MontaVista Software, Inc. + * frank_rowand@mvista.com or source@mvista.com + * debbie_chu@mvista.com + * Copyright 2002-2004 MontaVista Software, Inc. + * PowerPC 44x support, Matt Porter + * Copyright 2004 Freescale Semiconductor, Inc + * PowerPC e500 modifications, Kumar Gala + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Macros + */ + +#define SET_IVOR(vector_number, vector_label) \ + li r26,vector_label@l; \ + mtspr SPRN_IVOR##vector_number,r26; \ + sync + +/* As with the other PowerPC ports, it is expected that when code + * execution begins here, the following registers contain valid, yet + * optional, information: + * + * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.) + * r4 - Starting address of the init RAM disk + * r5 - Ending address of the init RAM disk + * r6 - Start of kernel command line string (e.g. "mem=128") + * r7 - End of kernel command line string + * + */ + .text +_GLOBAL(_stext) +_GLOBAL(_start) + /* + * Reserve a word at a fixed location to store the address + * of abatron_pteptrs + */ + nop +/* + * Save parameters we are passed + */ + mr r31,r3 + mr r30,r4 + mr r29,r5 + mr r28,r6 + mr r27,r7 + li r24,0 /* CPU number */ + +/* We try to not make any assumptions about how the boot loader + * setup or used the TLBs. We invalidate all mappings from the + * boot loader and load a single entry in TLB1[0] to map the + * first 16M of kernel memory. Any boot info passed from the + * bootloader needs to live in this first 16M. + * + * Requirement on bootloader: + * - The page we're executing in needs to reside in TLB1 and + * have IPROT=1. If not an invalidate broadcast could + * evict the entry we're currently executing in. + * + * r3 = Index of TLB1 were executing in + * r4 = Current MSR[IS] + * r5 = Index of TLB1 temp mapping + * + * Later in mapin_ram we will correctly map lowmem, and resize TLB1[0] + * if needed + */ + +/* 1. Find the index of the entry we're executing in */ + bl invstr /* Find our address */ +invstr: mflr r6 /* Make it accessible */ + mfmsr r7 + rlwinm r4,r7,27,31,31 /* extract MSR[IS] */ + mfspr r7, SPRN_PID0 + slwi r7,r7,16 + or r7,r7,r4 + mtspr SPRN_MAS6,r7 + tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */ + mfspr r7,SPRN_MAS1 + andis. r7,r7,MAS1_VALID@h + bne match_TLB + mfspr r7,SPRN_PID1 + slwi r7,r7,16 + or r7,r7,r4 + mtspr SPRN_MAS6,r7 + tlbsx 0,r6 /* search MSR[IS], SPID=PID1 */ + mfspr r7,SPRN_MAS1 + andis. r7,r7,MAS1_VALID@h + bne match_TLB + mfspr r7, SPRN_PID2 + slwi r7,r7,16 + or r7,r7,r4 + mtspr SPRN_MAS6,r7 + tlbsx 0,r6 /* Fall through, we had to match */ +match_TLB: + mfspr r7,SPRN_MAS0 + rlwinm r3,r7,16,28,31 /* Extract MAS0(Entry) */ + + mfspr r7,SPRN_MAS1 /* Insure IPROT set */ + oris r7,r7,MAS1_IPROT@h + mtspr SPRN_MAS1,r7 + tlbwe + +/* 2. Invalidate all entries except the entry we're executing in */ + mfspr r9,SPRN_TLB1CFG + andi. r9,r9,0xfff + li r6,0 /* Set Entry counter to 0 */ +1: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ + rlwimi r7,r6,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */ + mtspr SPRN_MAS0,r7 + tlbre + mfspr r7,SPRN_MAS1 + rlwinm r7,r7,0,2,31 /* Clear MAS1 Valid and IPROT */ + cmpw r3,r6 + beq skpinv /* Dont update the current execution TLB */ + mtspr SPRN_MAS1,r7 + tlbwe + isync +skpinv: addi r6,r6,1 /* Increment */ + cmpw r6,r9 /* Are we done? */ + bne 1b /* If not, repeat */ + + /* Invalidate TLB0 */ + li r6,0x04 + tlbivax 0,r6 +#ifdef CONFIG_SMP + tlbsync +#endif + /* Invalidate TLB1 */ + li r6,0x0c + tlbivax 0,r6 +#ifdef CONFIG_SMP + tlbsync +#endif + msync + +/* 3. Setup a temp mapping and jump to it */ + andi. r5, r3, 0x1 /* Find an entry not used and is non-zero */ + addi r5, r5, 0x1 + lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ + rlwimi r7,r3,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ + mtspr SPRN_MAS0,r7 + tlbre + + /* Just modify the entry ID and EPN for the temp mapping */ + lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ + rlwimi r7,r5,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ + mtspr SPRN_MAS0,r7 + xori r6,r4,1 /* Setup TMP mapping in the other Address space */ + slwi r6,r6,12 + oris r6,r6,(MAS1_VALID|MAS1_IPROT)@h + ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l + mtspr SPRN_MAS1,r6 + mfspr r6,SPRN_MAS2 + li r7,0 /* temp EPN = 0 */ + rlwimi r7,r6,0,20,31 + mtspr SPRN_MAS2,r7 + tlbwe + + xori r6,r4,1 + slwi r6,r6,5 /* setup new context with other address space */ + bl 1f /* Find our address */ +1: mflr r9 + rlwimi r7,r9,0,20,31 + addi r7,r7,24 + mtspr SRR0,r7 + mtspr SRR1,r6 + rfi + +/* 4. Clear out PIDs & Search info */ + li r6,0 + mtspr SPRN_PID0,r6 + mtspr SPRN_PID1,r6 + mtspr SPRN_PID2,r6 + mtspr SPRN_MAS6,r6 + +/* 5. Invalidate mapping we started in */ + lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ + rlwimi r7,r3,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ + mtspr SPRN_MAS0,r7 + tlbre + li r6,0 + mtspr SPRN_MAS1,r6 + tlbwe + /* Invalidate TLB1 */ + li r9,0x0c + tlbivax 0,r9 +#ifdef CONFIG_SMP + tlbsync +#endif + msync + +/* 6. Setup KERNELBASE mapping in TLB1[0] */ + lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */ + mtspr SPRN_MAS0,r6 + lis r6,(MAS1_VALID|MAS1_IPROT)@h + ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_16M))@l + mtspr SPRN_MAS1,r6 + li r7,0 + lis r6,KERNELBASE@h + ori r6,r6,KERNELBASE@l + rlwimi r6,r7,0,20,31 + mtspr SPRN_MAS2,r6 + li r7,(MAS3_SX|MAS3_SW|MAS3_SR) + mtspr SPRN_MAS3,r7 + tlbwe + +/* 7. Jump to KERNELBASE mapping */ + li r7,0 + bl 1f /* Find our address */ +1: mflr r9 + rlwimi r6,r9,0,20,31 + addi r6,r6,24 + mtspr SRR0,r6 + mtspr SRR1,r7 + rfi /* start execution out of TLB1[0] entry */ + +/* 8. Clear out the temp mapping */ + lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ + rlwimi r7,r5,16,12,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ + mtspr SPRN_MAS0,r7 + tlbre + mtspr SPRN_MAS1,r8 + tlbwe + /* Invalidate TLB1 */ + li r9,0x0c + tlbivax 0,r9 +#ifdef CONFIG_SMP + tlbsync +#endif + msync + + /* Establish the interrupt vector offsets */ + SET_IVOR(0, CriticalInput); + SET_IVOR(1, MachineCheck); + SET_IVOR(2, DataStorage); + SET_IVOR(3, InstructionStorage); + SET_IVOR(4, ExternalInput); + SET_IVOR(5, Alignment); + SET_IVOR(6, Program); + SET_IVOR(7, FloatingPointUnavailable); + SET_IVOR(8, SystemCall); + SET_IVOR(9, AuxillaryProcessorUnavailable); + SET_IVOR(10, Decrementer); + SET_IVOR(11, FixedIntervalTimer); + SET_IVOR(12, WatchdogTimer); + SET_IVOR(13, DataTLBError); + SET_IVOR(14, InstructionTLBError); + SET_IVOR(15, Debug); + SET_IVOR(32, SPEUnavailable); + SET_IVOR(33, SPEFloatingPointData); + SET_IVOR(34, SPEFloatingPointRound); + SET_IVOR(35, PerformanceMonitor); + + /* Establish the interrupt vector base */ + lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ + mtspr SPRN_IVPR,r4 + + /* Setup the defaults for TLB entries */ + li r2,MAS4_TSIZED(BOOKE_PAGESZ_4K) + mtspr SPRN_MAS4, r2 + +#if 0 + /* Enable DOZE */ + mfspr r2,SPRN_HID0 + oris r2,r2,HID0_DOZE@h + mtspr SPRN_HID0, r2 +#endif + + /* + * This is where the main kernel code starts. + */ + + /* ptr to current */ + lis r2,init_task@h + ori r2,r2,init_task@l + + /* ptr to current thread */ + addi r4,r2,THREAD /* init task's THREAD */ + mtspr SPRG3,r4 + + /* stack */ + lis r1,init_thread_union@h + ori r1,r1,init_thread_union@l + li r0,0 + stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1) + + bl early_init + + mfspr r3,SPRN_TLB1CFG + andi. r3,r3,0xfff + lis r4,num_tlbcam_entries@ha + stw r3,num_tlbcam_entries@l(r4) +/* + * Decide what sort of machine this is and initialize the MMU. + */ + mr r3,r31 + mr r4,r30 + mr r5,r29 + mr r6,r28 + mr r7,r27 + bl machine_init + bl MMU_init + + /* Setup PTE pointers for the Abatron bdiGDB */ + lis r6, swapper_pg_dir@h + ori r6, r6, swapper_pg_dir@l + lis r5, abatron_pteptrs@h + ori r5, r5, abatron_pteptrs@l + lis r4, KERNELBASE@h + ori r4, r4, KERNELBASE@l + stw r5, 0(r4) /* Save abatron_pteptrs at a fixed location */ + stw r6, 0(r5) + + /* Let's move on */ + lis r4,start_kernel@h + ori r4,r4,start_kernel@l + lis r3,MSR_KERNEL@h + ori r3,r3,MSR_KERNEL@l + mtspr SRR0,r4 + mtspr SRR1,r3 + rfi /* change context and jump to start_kernel */ + +/* + * Interrupt vector entry code + * + * The Book E MMUs are always on so we don't need to handle + * interrupts in real mode as with previous PPC processors. In + * this case we handle interrupts in the kernel virtual address + * space. + * + * Interrupt vectors are dynamically placed relative to the + * interrupt prefix as determined by the address of interrupt_base. + * The interrupt vectors offsets are programmed using the labels + * for each interrupt vector entry. + * + * Interrupt vectors must be aligned on a 16 byte boundary. + * We align on a 32 byte cache line boundary for good measure. + */ + +#define NORMAL_EXCEPTION_PROLOG \ + mtspr SPRN_SPRG0,r10; /* save two registers to work with */\ + mtspr SPRN_SPRG1,r11; \ + mtspr SPRN_SPRG4W,r1; \ + mfcr r10; /* save CR in r10 for now */\ + mfspr r11,SPRN_SRR1; /* check whether user or kernel */\ + andi. r11,r11,MSR_PR; \ + beq 1f; \ + mfspr r1,SPRG3; /* if from user, start at top of */\ + lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\ + addi r1,r1,THREAD_SIZE; \ +1: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\ + tophys(r11,r1); \ + stw r10,_CCR(r11); /* save various registers */\ + stw r12,GPR12(r11); \ + stw r9,GPR9(r11); \ + mfspr r10,SPRG0; \ + stw r10,GPR10(r11); \ + mfspr r12,SPRG1; \ + stw r12,GPR11(r11); \ + mflr r10; \ + stw r10,_LINK(r11); \ + mfspr r10,SPRG4R; \ + mfspr r12,SRR0; \ + stw r10,GPR1(r11); \ + mfspr r9,SRR1; \ + stw r10,0(r11); \ + rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\ + stw r0,GPR0(r11); \ + SAVE_4GPRS(3, r11); \ + SAVE_2GPRS(7, r11) + +/* + * Exception prolog for critical exceptions. This is a little different + * from the normal exception prolog above since a critical exception + * can potentially occur at any point during normal exception processing. + * Thus we cannot use the same SPRG registers as the normal prolog above. + * Instead we use a couple of words of memory at low physical addresses. + * This is OK since we don't support SMP on these processors. For Book E + * processors, we also have a reserved register (SPRG2) that is only used + * in critical exceptions so we can free up a GPR to use as the base for + * indirect access to the critical exception save area. This is necessary + * since the MMU is always on and the save area is offset from KERNELBASE. + */ +#define CRITICAL_EXCEPTION_PROLOG \ + mtspr SPRG2,r8; /* SPRG2 only used in criticals */ \ + lis r8,crit_save@ha; \ + stw r10,crit_r10@l(r8); \ + stw r11,crit_r11@l(r8); \ + mfspr r10,SPRG0; \ + stw r10,crit_sprg0@l(r8); \ + mfspr r10,SPRG1; \ + stw r10,crit_sprg1@l(r8); \ + mfspr r10,SPRG4R; \ + stw r10,crit_sprg4@l(r8); \ + mfspr r10,SPRG5R; \ + stw r10,crit_sprg5@l(r8); \ + mfspr r10,SPRG7R; \ + stw r10,crit_sprg7@l(r8); \ + mfspr r10,SPRN_PID; \ + stw r10,crit_pid@l(r8); \ + mfspr r10,SRR0; \ + stw r10,crit_srr0@l(r8); \ + mfspr r10,SRR1; \ + stw r10,crit_srr1@l(r8); \ + mfspr r8,SPRG2; /* SPRG2 only used in criticals */ \ + mfcr r10; /* save CR in r10 for now */\ + mfspr r11,SPRN_CSRR1; /* check whether user or kernel */\ + andi. r11,r11,MSR_PR; \ + lis r11,critical_stack_top@h; \ + ori r11,r11,critical_stack_top@l; \ + beq 1f; \ + /* COMING FROM USER MODE */ \ + mfspr r11,SPRG3; /* if from user, start at top of */\ + lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\ + addi r11,r11,THREAD_SIZE; \ +1: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\ + stw r10,_CCR(r11); /* save various registers */\ + stw r12,GPR12(r11); \ + stw r9,GPR9(r11); \ + mflr r10; \ + stw r10,_LINK(r11); \ + mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\ + stw r12,_DEAR(r11); /* since they may have had stuff */\ + mfspr r9,SPRN_ESR; /* in them at the point where the */\ + stw r9,_ESR(r11); /* exception was taken */\ + mfspr r12,CSRR0; \ + stw r1,GPR1(r11); \ + mfspr r9,CSRR1; \ + stw r1,0(r11); \ + tovirt(r1,r11); \ + rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\ + stw r0,GPR0(r11); \ + SAVE_4GPRS(3, r11); \ + SAVE_2GPRS(7, r11) + +/* + * Exception prolog for machine check exceptions. This is similar to + * the critical exception prolog, except that machine check exceptions + * have their own save area. For Book E processors, we also have a + * reserved register (SPRG6) that is only used in machine check exceptions + * so we can free up a GPR to use as the base for indirect access to the + * machine check exception save area. This is necessary since the MMU + * is always on and the save area is offset from KERNELBASE. + */ +#define MCHECK_EXCEPTION_PROLOG \ + mtspr SPRG6W,r8; /* SPRG6 used in machine checks */ \ + lis r8,mcheck_save@ha; \ + stw r10,mcheck_r10@l(r8); \ + stw r11,mcheck_r11@l(r8); \ + mfspr r10,SPRG0; \ + stw r10,mcheck_sprg0@l(r8); \ + mfspr r10,SPRG1; \ + stw r10,mcheck_sprg1@l(r8); \ + mfspr r10,SPRG4R; \ + stw r10,mcheck_sprg4@l(r8); \ + mfspr r10,SPRG5R; \ + stw r10,mcheck_sprg5@l(r8); \ + mfspr r10,SPRG7R; \ + stw r10,mcheck_sprg7@l(r8); \ + mfspr r10,SPRN_PID; \ + stw r10,mcheck_pid@l(r8); \ + mfspr r10,SRR0; \ + stw r10,mcheck_srr0@l(r8); \ + mfspr r10,SRR1; \ + stw r10,mcheck_srr1@l(r8); \ + mfspr r10,CSRR0; \ + stw r10,mcheck_csrr0@l(r8); \ + mfspr r10,CSRR1; \ + stw r10,mcheck_csrr1@l(r8); \ + mfspr r8,SPRG6R; /* SPRG6 used in machine checks */ \ + mfcr r10; /* save CR in r10 for now */\ + mfspr r11,SPRN_MCSRR1; /* check whether user or kernel */\ + andi. r11,r11,MSR_PR; \ + lis r11,mcheck_stack_top@h; \ + ori r11,r11,mcheck_stack_top@l; \ + beq 1f; \ + /* COMING FROM USER MODE */ \ + mfspr r11,SPRG3; /* if from user, start at top of */\ + lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\ + addi r11,r11,THREAD_SIZE; \ +1: subi r11,r11,INT_FRAME_SIZE; /* Allocate an exception frame */\ + stw r10,_CCR(r11); /* save various registers */\ + stw r12,GPR12(r11); \ + stw r9,GPR9(r11); \ + mflr r10; \ + stw r10,_LINK(r11); \ + mfspr r12,SPRN_DEAR; /* save DEAR and ESR in the frame */\ + stw r12,_DEAR(r11); /* since they may have had stuff */\ + mfspr r9,SPRN_ESR; /* in them at the point where the */\ + stw r9,_ESR(r11); /* exception was taken */\ + mfspr r12,MCSRR0; \ + stw r1,GPR1(r11); \ + mfspr r9,MCSRR1; \ + stw r1,0(r11); \ + tovirt(r1,r11); \ + rlwinm r9,r9,0,14,12; /* clear MSR_WE (necessary?) */\ + stw r0,GPR0(r11); \ + SAVE_4GPRS(3, r11); \ + SAVE_2GPRS(7, r11) + +/* + * Exception vectors. + */ +#define START_EXCEPTION(label) \ + .align 5; \ +label: + +#define FINISH_EXCEPTION(func) \ + bl transfer_to_handler_full; \ + .long func; \ + .long ret_from_except_full + +#define EXCEPTION(n, label, hdlr, xfer) \ + START_EXCEPTION(label); \ + NORMAL_EXCEPTION_PROLOG; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + xfer(n, hdlr) + +#define CRITICAL_EXCEPTION(n, label, hdlr) \ + START_EXCEPTION(label); \ + CRITICAL_EXCEPTION_PROLOG; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ + NOCOPY, transfer_to_handler_full, \ + ret_from_except_full) + +#define MCHECK_EXCEPTION(n, label, hdlr) \ + START_EXCEPTION(label); \ + MCHECK_EXCEPTION_PROLOG; \ + mfspr r5,SPRN_ESR; \ + stw r5,_ESR(r11); \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ + NOCOPY, mcheck_transfer_to_handler, \ + ret_from_mcheck_exc) + +#define EXC_XFER_TEMPLATE(hdlr, trap, msr, copyee, tfer, ret) \ + li r10,trap; \ + stw r10,TRAP(r11); \ + lis r10,msr@h; \ + ori r10,r10,msr@l; \ + copyee(r10, r9); \ + bl tfer; \ + .long hdlr; \ + .long ret + +#define COPY_EE(d, s) rlwimi d,s,0,16,16 +#define NOCOPY(d, s) + +#define EXC_XFER_STD(n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, NOCOPY, transfer_to_handler_full, \ + ret_from_except_full) + +#define EXC_XFER_LITE(n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, NOCOPY, transfer_to_handler, \ + ret_from_except) + +#define EXC_XFER_EE(n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n, MSR_KERNEL, COPY_EE, transfer_to_handler_full, \ + ret_from_except_full) + +#define EXC_XFER_EE_LITE(n, hdlr) \ + EXC_XFER_TEMPLATE(hdlr, n+1, MSR_KERNEL, COPY_EE, transfer_to_handler, \ + ret_from_except) + +interrupt_base: + /* Critical Input Interrupt */ + CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) + + /* Machine Check Interrupt */ + MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) + + /* Data Storage Interrupt */ + START_EXCEPTION(DataStorage) + mtspr SPRG0, r10 /* Save some working registers */ + mtspr SPRG1, r11 + mtspr SPRG4W, r12 + mtspr SPRG5W, r13 + mfcr r11 + mtspr SPRG7W, r11 + + /* + * Check if it was a store fault, if not then bail + * because a user tried to access a kernel or + * read-protected page. Otherwise, get the + * offending address and handle it. + */ + mfspr r10, SPRN_ESR + andis. r10, r10, ESR_ST@h + beq 2f + + mfspr r10, SPRN_DEAR /* Get faulting address */ + + /* If we are faulting a kernel address, we have to use the + * kernel page tables. + */ + lis r11, TASK_SIZE@h + ori r11, r11, TASK_SIZE@l + cmplw 0, r10, r11 + bge 2f + + /* Get the PGD for the current thread */ +3: + mfspr r11,SPRG3 + lwz r11,PGDIR(r11) +4: + rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ + lwz r11, 0(r11) /* Get L1 entry */ + rlwinm. r12, r11, 0, 0, 19 /* Extract L2 (pte) base address */ + beq 2f /* Bail if no table */ + + rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */ + lwz r11, 0(r12) /* Get Linux PTE */ + + /* Are _PAGE_USER & _PAGE_RW set & _PAGE_HWWRITE not? */ + andi. r13, r11, _PAGE_RW|_PAGE_USER|_PAGE_HWWRITE + cmpwi 0, r13, _PAGE_RW|_PAGE_USER + bne 2f /* Bail if not */ + + /* Update 'changed'. */ + ori r11, r11, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE + stw r11, 0(r12) /* Update Linux page table */ + + /* MAS2 not updated as the entry does exist in the tlb, this + fault taken to detect state transition (eg: COW -> DIRTY) + */ + lis r12, MAS3_RPN@h + ori r12, r12, _PAGE_HWEXEC | MAS3_RPN@l + and r11, r11, r12 + rlwimi r11, r11, 31, 27, 27 /* SX <- _PAGE_HWEXEC */ + ori r11, r11, (MAS3_UW|MAS3_SW|MAS3_UR|MAS3_SR)@l /* set static perms */ + + /* update search PID in MAS6, AS = 0 */ + mfspr r12, SPRN_PID0 + slwi r12, r12, 16 + mtspr SPRN_MAS6, r12 + + /* find the TLB index that caused the fault. It has to be here. */ + tlbsx 0, r10 + + mtspr SPRN_MAS3,r11 + tlbwe + + /* Done...restore registers and get out of here. */ + mfspr r11, SPRG7R + mtcr r11 + mfspr r13, SPRG5R + mfspr r12, SPRG4R + mfspr r11, SPRG1 + mfspr r10, SPRG0 + rfi /* Force context change */ + +2: + /* + * The bailout. Restore registers to pre-exception conditions + * and call the heavyweights to help us out. + */ + mfspr r11, SPRG7R + mtcr r11 + mfspr r13, SPRG5R + mfspr r12, SPRG4R + mfspr r11, SPRG1 + mfspr r10, SPRG0 + b data_access + + /* Instruction Storage Interrupt */ + START_EXCEPTION(InstructionStorage) + NORMAL_EXCEPTION_PROLOG + mfspr r5,SPRN_ESR /* Grab the ESR and save it */ + stw r5,_ESR(r11) + mr r4,r12 /* Pass SRR0 as arg2 */ + li r5,0 /* Pass zero as arg3 */ + EXC_XFER_EE_LITE(0x0400, handle_page_fault) + + /* External Input Interrupt */ + EXCEPTION(0x0500, ExternalInput, do_IRQ, EXC_XFER_LITE) + + /* Alignment Interrupt */ + START_EXCEPTION(Alignment) + NORMAL_EXCEPTION_PROLOG + mfspr r4,SPRN_DEAR /* Grab the DEAR and save it */ + stw r4,_DEAR(r11) + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_EE(0x0600, AlignmentException) + + /* Program Interrupt */ + START_EXCEPTION(Program) + NORMAL_EXCEPTION_PROLOG + mfspr r4,SPRN_ESR /* Grab the ESR and save it */ + stw r4,_ESR(r11) + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_STD(0x0700, ProgramCheckException) + + /* Floating Point Unavailable Interrupt */ + EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) + + /* System Call Interrupt */ + START_EXCEPTION(SystemCall) + NORMAL_EXCEPTION_PROLOG + EXC_XFER_EE_LITE(0x0c00, DoSyscall) + + /* Auxillary Processor Unavailable Interrupt */ + EXCEPTION(0x2900, AuxillaryProcessorUnavailable, UnknownException, EXC_XFER_EE) + + /* Decrementer Interrupt */ + START_EXCEPTION(Decrementer) + NORMAL_EXCEPTION_PROLOG + lis r0,TSR_DIS@h /* Setup the DEC interrupt mask */ + mtspr SPRN_TSR,r0 /* Clear the DEC interrupt */ + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_LITE(0x0900, timer_interrupt) + + /* Fixed Internal Timer Interrupt */ + /* TODO: Add FIT support */ + EXCEPTION(0x3100, FixedIntervalTimer, UnknownException, EXC_XFER_EE) + + /* Watchdog Timer Interrupt */ + /* TODO: Add watchdog support */ + CRITICAL_EXCEPTION(0x3200, WatchdogTimer, UnknownException) + + /* Data TLB Error Interrupt */ + START_EXCEPTION(DataTLBError) + mtspr SPRG0, r10 /* Save some working registers */ + mtspr SPRG1, r11 + mtspr SPRG4W, r12 + mtspr SPRG5W, r13 + mfcr r11 + mtspr SPRG7W, r11 + mfspr r10, SPRN_DEAR /* Get faulting address */ + + /* If we are faulting a kernel address, we have to use the + * kernel page tables. + */ + lis r11, TASK_SIZE@h + ori r11, r11, TASK_SIZE@l + cmplw 5, r10, r11 + blt 5, 3f + lis r11, swapper_pg_dir@h + ori r11, r11, swapper_pg_dir@l + + mfspr r12,SPRN_MAS1 /* Set TID to 0 */ + li r13,MAS1_TID@l + andc r12,r12,r13 + mtspr SPRN_MAS1,r12 + + b 4f + + /* Get the PGD for the current thread */ +3: + mfspr r11,SPRG3 + lwz r11,PGDIR(r11) + +4: + rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ + lwz r11, 0(r11) /* Get L1 entry */ + rlwinm. r12, r11, 0, 0, 19 /* Extract L2 (pte) base address */ + beq 2f /* Bail if no table */ + + rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */ + lwz r11, 0(r12) /* Get Linux PTE */ + andi. r13, r11, _PAGE_PRESENT + beq 2f + + ori r11, r11, _PAGE_ACCESSED + stw r11, 0(r12) + + /* Jump to common tlb load */ + b finish_tlb_load +2: + /* The bailout. Restore registers to pre-exception conditions + * and call the heavyweights to help us out. + */ + mfspr r11, SPRG7R + mtcr r11 + mfspr r13, SPRG5R + mfspr r12, SPRG4R + mfspr r11, SPRG1 + mfspr r10, SPRG0 + b data_access + + /* Instruction TLB Error Interrupt */ + /* + * Nearly the same as above, except we get our + * information from different registers and bailout + * to a different point. + */ + START_EXCEPTION(InstructionTLBError) + mtspr SPRG0, r10 /* Save some working registers */ + mtspr SPRG1, r11 + mtspr SPRG4W, r12 + mtspr SPRG5W, r13 + mfcr r11 + mtspr SPRG7W, r11 + mfspr r10, SRR0 /* Get faulting address */ + + /* If we are faulting a kernel address, we have to use the + * kernel page tables. + */ + lis r11, TASK_SIZE@h + ori r11, r11, TASK_SIZE@l + cmplw 5, r10, r11 + blt 5, 3f + lis r11, swapper_pg_dir@h + ori r11, r11, swapper_pg_dir@l + + mfspr r12,SPRN_MAS1 /* Set TID to 0 */ + li r13,MAS1_TID@l + andc r12,r12,r13 + mtspr SPRN_MAS1,r12 + + b 4f + + /* Get the PGD for the current thread */ +3: + mfspr r11,SPRG3 + lwz r11,PGDIR(r11) + +4: + rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ + lwz r11, 0(r11) /* Get L1 entry */ + rlwinm. r12, r11, 0, 0, 19 /* Extract L2 (pte) base address */ + beq 2f /* Bail if no table */ + + rlwimi r12, r10, 22, 20, 29 /* Compute PTE address */ + lwz r11, 0(r12) /* Get Linux PTE */ + andi. r13, r11, _PAGE_PRESENT + beq 2f + + ori r11, r11, _PAGE_ACCESSED + stw r11, 0(r12) + + /* Jump to common TLB load point */ + b finish_tlb_load + +2: + /* The bailout. Restore registers to pre-exception conditions + * and call the heavyweights to help us out. + */ + mfspr r11, SPRG7R + mtcr r11 + mfspr r13, SPRG5R + mfspr r12, SPRG4R + mfspr r11, SPRG1 + mfspr r10, SPRG0 + b InstructionStorage + +#ifdef CONFIG_SPE + /* SPE Unavailable */ + START_EXCEPTION(SPEUnavailable) + NORMAL_EXCEPTION_PROLOG + bne load_up_spe + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_EE_LITE(0x2010, KernelSPE) +#else + EXCEPTION(0x2020, SPEUnavailable, UnknownException, EXC_XFER_EE) +#endif /* CONFIG_SPE */ + + /* SPE Floating Point Data */ +#ifdef CONFIG_SPE + EXCEPTION(0x2030, SPEFloatingPointData, SPEFloatingPointException, EXC_XFER_EE); +#else + EXCEPTION(0x2040, SPEFloatingPointData, UnknownException, EXC_XFER_EE) +#endif /* CONFIG_SPE */ + + /* SPE Floating Point Round */ + EXCEPTION(0x2050, SPEFloatingPointRound, UnknownException, EXC_XFER_EE) + + /* Performance Monitor */ + EXCEPTION(0x2060, PerformanceMonitor, UnknownException, EXC_XFER_EE) + +/* Check for a single step debug exception while in an exception + * handler before state has been saved. This is to catch the case + * where an instruction that we are trying to single step causes + * an exception (eg ITLB/DTLB miss) and thus the first instruction of + * the exception handler generates a single step debug exception. + * + * If we get a debug trap on the first instruction of an exception handler, + * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is + * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). + * The exception handler was handling a non-critical interrupt, so it will + * save (and later restore) the MSR via SPRN_SRR1, which will still have + * the MSR_DE bit set. + */ + /* Debug Interrupt */ + START_EXCEPTION(Debug) + CRITICAL_EXCEPTION_PROLOG + + /* + * If this is a single step or branch-taken exception in an + * exception entry sequence, it was probably meant to apply to + * the code where the exception occurred (since exception entry + * doesn't turn off DE automatically). We simulate the effect + * of turning off DE on entry to an exception handler by turning + * off DE in the CSRR1 value and clearing the debug status. + */ + mfspr r10,SPRN_DBSR /* check single-step/branch taken */ + andis. r10,r10,(DBSR_IC|DBSR_BT)@h + beq+ 1f + andi. r0,r9,MSR_PR /* check supervisor */ + beq 2f /* branch if we need to fix it up... */ + + /* continue normal handling for a critical exception... */ +1: mfspr r4,SPRN_DBSR + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_TEMPLATE(DebugException, 0x2002, \ + (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \ + NOCOPY, crit_transfer_to_handler, ret_from_crit_exc) + + /* here it looks like we got an inappropriate debug exception. */ +2: rlwinm r9,r9,0,~MSR_DE /* clear DE in the CSRR1 value */ + mtspr SPRN_DBSR,r10 /* clear the IC/BT debug intr status */ + /* restore state and get out */ + lwz r10,_CCR(r11) + lwz r0,GPR0(r11) + lwz r1,GPR1(r11) + mtcrf 0x80,r10 + mtspr CSRR0,r12 + mtspr CSRR1,r9 + lwz r9,GPR9(r11) + + mtspr SPRG2,r8; /* SPRG2 only used in criticals */ + lis r8,crit_save@ha; + lwz r10,crit_r10@l(r8) + lwz r11,crit_r11@l(r8) + mfspr r8,SPRG2 + + rfci + b . + +/* + * Local functions + */ + /* + * Data TLB exceptions will bail out to this point + * if they can't resolve the lightweight TLB fault. + */ +data_access: + NORMAL_EXCEPTION_PROLOG + mfspr r5,SPRN_ESR /* Grab the ESR, save it, pass arg3 */ + stw r5,_ESR(r11) + mfspr r4,SPRN_DEAR /* Grab the DEAR, save it, pass arg2 */ + andis. r10,r5,(ESR_ILK|ESR_DLK)@h + bne 1f + EXC_XFER_EE_LITE(0x0300, handle_page_fault) +1: + addi r3,r1,STACK_FRAME_OVERHEAD + EXC_XFER_EE_LITE(0x0300, CacheLockingException) + +/* + + * Both the instruction and data TLB miss get to this + * point to load the TLB. + * r10 - EA of fault + * r11 - TLB (info from Linux PTE) + * r12, r13 - available to use + * CR5 - results of addr < TASK_SIZE + * MAS0, MAS1 - loaded with proper value when we get here + * MAS2, MAS3 - will need additional info from Linux PTE + * Upon exit, we reload everything and RFI. + */ +finish_tlb_load: + /* + * We set execute, because we don't have the granularity to + * properly set this at the page level (Linux problem). + * Many of these bits are software only. Bits we don't set + * here we (properly should) assume have the appropriate value. + */ + + mfspr r12, SPRN_MAS2 + rlwimi r12, r11, 26, 27, 31 /* extract WIMGE from pte */ + mtspr SPRN_MAS2, r12 + + bge 5, 1f + + /* addr > TASK_SIZE */ + li r10, (MAS3_UX | MAS3_UW | MAS3_UR) + andi. r13, r11, (_PAGE_USER | _PAGE_HWWRITE | _PAGE_HWEXEC) + andi. r12, r11, _PAGE_USER /* Test for _PAGE_USER */ + iseleq r12, 0, r10 + and r10, r12, r13 + srwi r12, r10, 1 + or r12, r12, r10 /* Copy user perms into supervisor */ + b 2f + + /* addr <= TASK_SIZE */ +1: rlwinm r12, r11, 31, 29, 29 /* Extract _PAGE_HWWRITE into SW */ + ori r12, r12, (MAS3_SX | MAS3_SR) + +2: rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */ + mtspr SPRN_MAS3, r11 + tlbwe + + /* Done...restore registers and get out of here. */ + mfspr r11, SPRG7R + mtcr r11 + mfspr r13, SPRG5R + mfspr r12, SPRG4R + mfspr r11, SPRG1 + mfspr r10, SPRG0 + rfi /* Force context change */ + +#ifdef CONFIG_SPE +/* Note that the SPE support is closely modeled after the AltiVec + * support. Changes to one are likely to be applicable to the + * other! */ +load_up_spe: +/* + * Disable SPE for the task which had SPE previously, + * and save its SPE registers in its thread_struct. + * Enables SPE for use in the kernel on return. + * On SMP we know the SPE units are free, since we give it up every + * switch. -- Kumar + */ + mfmsr r5 + oris r5,r5,MSR_SPE@h + mtmsr r5 /* enable use of SPE now */ + isync +/* + * For SMP, we don't do lazy SPE switching because it just gets too + * horrendously complex, especially when a task switches from one CPU + * to another. Instead we call giveup_spe in switch_to. + */ +#ifndef CONFIG_SMP + lis r3,last_task_used_spe@ha + lwz r4,last_task_used_spe@l(r3) + cmpi 0,r4,0 + beq 1f + addi r4,r4,THREAD /* want THREAD of last_task_used_spe */ + SAVE_32EVR(0,r10,r4) + evxor evr10, evr10, evr10 /* clear out evr10 */ + evmwumiaa evr10, evr10, evr10 /* evr10 <- ACC = 0 * 0 + ACC */ + li r5,THREAD_ACC + evstddx evr10, r4, r5 /* save off accumulator */ + lwz r5,PT_REGS(r4) + lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) + lis r10,MSR_SPE@h + andc r4,r4,r10 /* disable SPE for previous task */ + stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) +1: +#endif /* CONFIG_SMP */ + /* enable use of SPE after return */ + oris r9,r9,MSR_SPE@h + mfspr r5,SPRG3 /* current task's THREAD (phys) */ + li r4,1 + li r10,THREAD_ACC + stw r4,THREAD_USED_SPE(r5) + evlddx evr4,r10,r5 + evmra evr4,evr4 + REST_32EVR(0,r10,r5) +#ifndef CONFIG_SMP + subi r4,r5,THREAD + stw r4,last_task_used_spe@l(r3) +#endif /* CONFIG_SMP */ + /* restore registers and return */ +2: REST_4GPRS(3, r11) + lwz r10,_CCR(r11) + REST_GPR(1, r11) + mtcr r10 + lwz r10,_LINK(r11) + mtlr r10 + REST_GPR(10, r11) + mtspr SRR1,r9 + mtspr SRR0,r12 + REST_GPR(9, r11) + REST_GPR(12, r11) + lwz r11,GPR11(r11) + SYNC + rfi + + + +/* + * SPE unavailable trap from kernel - print a message, but let + * the task use SPE in the kernel until it returns to user mode. + */ +KernelSPE: + lwz r3,_MSR(r1) + oris r3,r3,MSR_SPE@h + stw r3,_MSR(r1) /* enable use of SPE after return */ + lis r3,87f@h + ori r3,r3,87f@l + mr r4,r2 /* current */ + lwz r5,_NIP(r1) + bl printk + b ret_from_except +87: .string "SPE used in kernel (task=%p, pc=%x) \n" + .align 4,0 + +#endif /* CONFIG_SPE */ + +/* + * Global functions + */ + +/* + * extern void loadcam_entry(unsigned int index) + * + * Load TLBCAM[index] entry in to the L2 CAM MMU + */ +_GLOBAL(loadcam_entry) + lis r4,TLBCAM@ha + addi r4,r4,TLBCAM@l + mulli r5,r3,20 + add r3,r5,r4 + lwz r4,0(r3) + mtspr SPRN_MAS0,r4 + lwz r4,4(r3) + mtspr SPRN_MAS1,r4 + lwz r4,8(r3) + mtspr SPRN_MAS2,r4 + lwz r4,12(r3) + mtspr SPRN_MAS3,r4 + tlbwe + isync + blr + +/* + * extern void giveup_altivec(struct task_struct *prev) + * + * The e500 core does not have an AltiVec unit. + */ +_GLOBAL(giveup_altivec) + blr + +#ifdef CONFIG_SPE +/* + * extern void giveup_spe(struct task_struct *prev) + * + */ +_GLOBAL(giveup_spe) + mfmsr r5 + oris r5,r5,MSR_SPE@h + SYNC + mtmsr r5 /* enable use of SPE now */ + isync + cmpi 0,r3,0 + beqlr- /* if no previous owner, done */ + addi r3,r3,THREAD /* want THREAD of task */ + lwz r5,PT_REGS(r3) + cmpi 0,r5,0 + SAVE_32EVR(0, r4, r3) + evxor evr6, evr6, evr6 /* clear out evr6 */ + evmwumiaa evr6, evr6, evr6 /* evr6 <- ACC = 0 * 0 + ACC */ + li r4,THREAD_ACC + evstddx evr6, r4, r3 /* save off accumulator */ + beq 1f + lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) + lis r3,MSR_SPE@h + andc r4,r4,r3 /* disable SPE for previous task */ + stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) +1: +#ifndef CONFIG_SMP + li r5,0 + lis r4,last_task_used_spe@ha + stw r5,last_task_used_spe@l(r4) +#endif /* CONFIG_SMP */ + blr +#endif /* CONFIG_SPE */ + +/* + * extern void giveup_fpu(struct task_struct *prev) + * + * The e500 core does not have an FPU. + */ +_GLOBAL(giveup_fpu) + blr + +/* + * extern void abort(void) + * + * At present, this routine just applies a system reset. + */ +_GLOBAL(abort) + li r13,0 + mtspr SPRN_DBCR0,r13 /* disable all debug events */ + mfmsr r13 + ori r13,r13,MSR_DE@l /* Enable Debug Events */ + mtmsr r13 + mfspr r13,SPRN_DBCR0 + lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h + mtspr SPRN_DBCR0,r13 + +_GLOBAL(set_context) + +#ifdef CONFIG_BDI_SWITCH + /* Context switch the PTE pointer for the Abatron BDI2000. + * The PGDIR is the second parameter. + */ + lis r5, abatron_pteptrs@h + ori r5, r5, abatron_pteptrs@l + stw r4, 0x4(r5) +#endif + mtspr SPRN_PID,r3 + isync /* Force context change */ + blr + +/* + * We put a few things here that have to be page-aligned. This stuff + * goes at the beginning of the data segment, which is page-aligned. + */ + .data +_GLOBAL(sdata) +_GLOBAL(empty_zero_page) + .space 4096 +_GLOBAL(swapper_pg_dir) + .space 4096 + + .section .bss +/* Stack for handling critical exceptions from kernel mode */ +critical_stack_bottom: + .space 4096 +critical_stack_top: + .previous + +/* Stack for handling machine check exceptions from kernel mode */ +mcheck_stack_bottom: + .space 4096 +mcheck_stack_top: + .previous + +/* + * This area is used for temporarily saving registers during the + * critical and machine check exception prologs. It must always + * follow the page aligned allocations, so it starts on a page + * boundary, ensuring that all crit_save areas are in a single + * page. + */ + +/* crit_save */ +_GLOBAL(crit_save) + .space 4 +_GLOBAL(crit_r10) + .space 4 +_GLOBAL(crit_r11) + .space 4 +_GLOBAL(crit_sprg0) + .space 4 +_GLOBAL(crit_sprg1) + .space 4 +_GLOBAL(crit_sprg4) + .space 4 +_GLOBAL(crit_sprg5) + .space 4 +_GLOBAL(crit_sprg7) + .space 4 +_GLOBAL(crit_pid) + .space 4 +_GLOBAL(crit_srr0) + .space 4 +_GLOBAL(crit_srr1) + .space 4 + +/* mcheck_save */ +_GLOBAL(mcheck_save) + .space 4 +_GLOBAL(mcheck_r10) + .space 4 +_GLOBAL(mcheck_r11) + .space 4 +_GLOBAL(mcheck_sprg0) + .space 4 +_GLOBAL(mcheck_sprg1) + .space 4 +_GLOBAL(mcheck_sprg4) + .space 4 +_GLOBAL(mcheck_sprg5) + .space 4 +_GLOBAL(mcheck_sprg7) + .space 4 +_GLOBAL(mcheck_pid) + .space 4 +_GLOBAL(mcheck_srr0) + .space 4 +_GLOBAL(mcheck_srr1) + .space 4 +_GLOBAL(mcheck_csrr0) + .space 4 +_GLOBAL(mcheck_csrr1) + .space 4 + +/* + * This space gets a copy of optional info passed to us by the bootstrap + * which is used to pass parameters into the kernel like root=/dev/sda1, etc. + */ +_GLOBAL(cmd_line) + .space 512 + +/* + * Room for two PTE pointers, usually the kernel and current user pointers + * to their respective root page table. + */ +abatron_pteptrs: + .space 8 + + diff -Nru a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c --- a/arch/ppc/kernel/irq.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/kernel/irq.c 2004-06-23 19:04:28 -07:00 @@ -628,7 +628,9 @@ static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer, unsigned long count, void *data) { - cpumask_t *mask = (cpumask_t *)data, full_count = count, err; + int err; + int full_count = count; + cpumask_t *mask = (cpumask_t *)data; cpumask_t new_value; err = cpumask_parse(buffer, count, new_value); diff -Nru a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S --- a/arch/ppc/kernel/misc.S 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/kernel/misc.S 2004-06-23 19:04:28 -07:00 @@ -253,6 +253,24 @@ mtmsr r7 blr +_GLOBAL(low_choose_7447a_dfs) + /* Clear MSR:EE */ + mfmsr r7 + rlwinm r0,r7,0,17,15 + mtmsr r0 + + /* Calc new HID1 value */ + mfspr r4,SPRN_HID1 + insrwi r4,r3,1,9 /* insert parameter into bit 9 */ + sync + mtspr SPRN_HID1,r4 + sync + isync + + /* Return */ + mtmsr r7 + blr + #endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */ /* void local_save_flags_ptr(unsigned long *flags) */ @@ -419,7 +437,24 @@ ble 1b isync -#else /* !(CONFIG_40x || CONFIG_44x) */ +#elif defined(CONFIG_FSL_BOOKE) + /* Invalidate all entries in TLB0 */ + li r3, 0x04 + tlbivax 0,3 + /* Invalidate all entries in TLB1 */ + li r3, 0x0c + tlbivax 0,3 + /* Invalidate all entries in TLB2 */ + li r3, 0x14 + tlbivax 0,3 + /* Invalidate all entries in TLB3 */ + li r3, 0x1c + tlbivax 0,3 + msync +#ifdef CONFIG_SMP + tlbsync +#endif /* CONFIG_SMP */ +#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */ #if defined(CONFIG_SMP) rlwinm r8,r1,0,0,18 lwz r8,TI_CPU(r8) @@ -487,7 +522,20 @@ tlbwe r3, r3, PPC44x_TLB_PAGEID isync 10: -#else /* !(CONFIG_40x || CONFIG_44x) */ +#elif defined(CONFIG_FSL_BOOKE) + rlwinm r4, r3, 0, 0, 19 + ori r5, r4, 0x08 /* TLBSEL = 1 */ + ori r6, r4, 0x10 /* TLBSEL = 2 */ + ori r7, r4, 0x18 /* TLBSEL = 3 */ + tlbivax 0, r4 + tlbivax 0, r5 + tlbivax 0, r6 + tlbivax 0, r7 + msync +#if defined(CONFIG_SMP) + tlbsync +#endif /* CONFIG_SMP */ +#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */ #if defined(CONFIG_SMP) rlwinm r8,r1,0,0,18 lwz r8,TI_CPU(r8) @@ -544,6 +592,10 @@ lis r3, KERNELBASE@h iccci 0,r3 #endif +#elif CONFIG_FSL_BOOKE + mfspr r3,SPRN_L1CSR1 + ori r3,r3,L1CSR1_ICFI|L1CSR1_ICLFR + mtspr SPRN_L1CSR1,r3 #else mfspr r3,PVR rlwinm r3,r3,16,16,31 @@ -1047,7 +1099,7 @@ * and exceptions as if the cpu had performed the load or store. */ -#if defined(CONFIG_4xx) +#if defined(CONFIG_4xx) || defined(CONFIG_E500) _GLOBAL(cvt_fd) lfs 0,0(r3) stfd 0,0(r4) diff -Nru a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c --- a/arch/ppc/kernel/ppc_ksyms.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/kernel/ppc_ksyms.c 2004-06-23 19:04:28 -07:00 @@ -199,6 +199,10 @@ EXPORT_SYMBOL(last_task_used_altivec); EXPORT_SYMBOL(giveup_altivec); #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE +EXPORT_SYMBOL(last_task_used_spe); +EXPORT_SYMBOL(giveup_spe); +#endif /* CONFIG_SPE */ #ifdef CONFIG_SMP EXPORT_SYMBOL(smp_call_function); EXPORT_SYMBOL(smp_hw_index); @@ -324,7 +328,7 @@ EXPORT_SYMBOL(cpm_install_handler); EXPORT_SYMBOL(cpm_free_handler); #endif /* CONFIG_8xx */ -#if defined(CONFIG_8xx) || defined(CONFIG_40x) +#if defined(CONFIG_8xx) || defined(CONFIG_40x) || defined(CONFIG_85xx) EXPORT_SYMBOL(__res); #endif #if defined(CONFIG_8xx) diff -Nru a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c --- a/arch/ppc/kernel/process.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc/kernel/process.c 2004-06-23 19:04:27 -07:00 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -49,6 +50,7 @@ struct task_struct *last_task_used_math = NULL; struct task_struct *last_task_used_altivec = NULL; +struct task_struct *last_task_used_spe = NULL; static struct fs_struct init_fs = INIT_FS; static struct files_struct init_files = INIT_FILES; @@ -177,6 +179,34 @@ EXPORT_SYMBOL(enable_kernel_altivec); #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE +int +dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs) +{ + if (regs->msr & MSR_SPE) + giveup_spe(current); + /* We copy u32 evr[32] + u64 acc + u32 spefscr -> 35 */ + memcpy(evrregs, ¤t->thread.evr[0], sizeof(u32) * 35); + return 1; +} + +void +enable_kernel_spe(void) +{ + WARN_ON(preemptible()); + +#ifdef CONFIG_SMP + if (current->thread.regs && (current->thread.regs->msr & MSR_SPE)) + giveup_spe(current); + else + giveup_spe(NULL); /* just enable SPE for kernel - force */ +#else + giveup_spe(last_task_used_spe); +#endif /* __SMP __ */ +} +EXPORT_SYMBOL(enable_kernel_spe); +#endif /* CONFIG_SPE */ + void enable_kernel_fp(void) { @@ -244,6 +274,17 @@ if ((prev->thread.regs && (prev->thread.regs->msr & MSR_VEC))) giveup_altivec(prev); #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + /* + * If the previous thread used spe in the last quantum + * (thus changing spe regs) then save them. + * + * On SMP we always save/restore spe regs just to avoid the + * complexity of changing processors. + */ + if ((prev->thread.regs && (prev->thread.regs->msr & MSR_SPE))) + giveup_spe(prev); +#endif /* CONFIG_SPE */ #endif /* CONFIG_SMP */ /* Avoid the trap. On smp this this never happens since @@ -251,6 +292,13 @@ */ if (new->thread.regs && last_task_used_altivec == new) new->thread.regs->msr |= MSR_VEC; +#ifdef CONFIG_SPE + /* Avoid the trap. On smp this this never happens since + * we don't set last_task_used_spe + */ + if (new->thread.regs && last_task_used_spe == new) + new->thread.regs->msr |= MSR_SPE; +#endif /* CONFIG_SPE */ new_thread = &new->thread; old_thread = ¤t->thread; last = _switch(old_thread, new_thread); @@ -354,6 +402,10 @@ if (regs->msr & MSR_VEC) giveup_altivec(current); #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + if (regs->msr & MSR_SPE) + giveup_spe(current); +#endif /* CONFIG_SPE */ preempt_enable(); } @@ -438,18 +490,45 @@ current->thread.vrsave = 0; current->thread.used_vr = 0; #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + memset(current->thread.evr, 0, sizeof(current->thread.evr)); + current->thread.acc = 0; + current->thread.spefscr = 0; + current->thread.used_spe = 0; +#endif /* CONFIG_SPE */ } +#define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \ + | PR_FP_EXC_RES | PR_FP_EXC_INV) + int set_fpexc_mode(struct task_struct *tsk, unsigned int val) { struct pt_regs *regs = tsk->thread.regs; - if (val > PR_FP_EXC_PRECISE) + /* This is a bit hairy. If we are an SPE enabled processor + * (have embedded fp) we store the IEEE exception enable flags in + * fpexc_mode. fpexc_mode is also used for setting FP exception + * mode (asyn, precise, disabled) for 'Classic' FP. */ + if (val & PR_FP_EXC_SW_ENABLE) { +#ifdef CONFIG_SPE + tsk->thread.fpexc_mode = val & + (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT); +#else return -EINVAL; - tsk->thread.fpexc_mode = __pack_fe01(val); - if (regs != NULL && (regs->msr & MSR_FP) != 0) - regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1)) - | tsk->thread.fpexc_mode; +#endif + } else { + /* on a CONFIG_SPE this does not hurt us. The bits that + * __pack_fe01 use do not overlap with bits used for + * PR_FP_EXC_SW_ENABLE. Additionally, the MSR[FE0,FE1] bits + * on CONFIG_SPE implementations are reserved so writing to + * them does not change anything */ + if (val > PR_FP_EXC_PRECISE) + return -EINVAL; + tsk->thread.fpexc_mode = __pack_fe01(val); + if (regs != NULL && (regs->msr & MSR_FP) != 0) + regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1)) + | tsk->thread.fpexc_mode; + } return 0; } @@ -457,7 +536,14 @@ { unsigned int val; - val = __unpack_fe01(tsk->thread.fpexc_mode); + if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) +#ifdef CONFIG_SPE + val = tsk->thread.fpexc_mode; +#else + return -EINVAL; +#endif + else + val = __unpack_fe01(tsk->thread.fpexc_mode); return put_user(val, (unsigned int *) adr); } @@ -506,6 +592,10 @@ if (regs->msr & MSR_VEC) giveup_altivec(current); #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + if (regs->msr & MSR_SPE) + giveup_spe(current); +#endif /* CONFIG_SPE */ preempt_enable(); error = do_execve(filename, (char __user *__user *) a1, (char __user *__user *) a2, regs); diff -Nru a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c --- a/arch/ppc/kernel/ptrace.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ppc/kernel/ptrace.c 2004-06-23 19:04:26 -07:00 @@ -35,7 +35,7 @@ /* * Set of msr bits that gdb can change on behalf of a process. */ -#ifdef CONFIG_4xx +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) #define MSR_DEBUGCHANGE 0 #else #define MSR_DEBUGCHANGE (MSR_SE | MSR_BE) @@ -131,13 +131,77 @@ } #endif +#ifdef CONFIG_SPE + +/* + * For get_evrregs/set_evrregs functions 'data' has the following layout: + * + * struct { + * u32 evr[32]; + * u64 acc; + * u32 spefscr; + * } + */ + +/* + * Get contents of SPE register state in task TASK. + */ +static inline int get_evrregs(unsigned long *data, struct task_struct *task) +{ + int i; + + if (!access_ok(VERIFY_WRITE, data, 35 * sizeof(unsigned long))) + return -EFAULT; + + /* copy SPEFSCR */ + if (__put_user(task->thread.spefscr, &data[34])) + return -EFAULT; + + /* copy SPE registers EVR[0] .. EVR[31] */ + for (i = 0; i < 32; i++, data++) + if (__put_user(task->thread.evr[i], data)) + return -EFAULT; + + /* copy ACC */ + if (__put_user64(task->thread.acc, (unsigned long long *)data)) + return -EFAULT; + + return 0; +} + +/* + * Write contents of SPE register state into task TASK. + */ +static inline int set_evrregs(struct task_struct *task, unsigned long *data) +{ + int i; + + if (!access_ok(VERIFY_READ, data, 35 * sizeof(unsigned long))) + return -EFAULT; + + /* copy SPEFSCR */ + if (__get_user(task->thread.spefscr, &data[34])) + return -EFAULT; + + /* copy SPE registers EVR[0] .. EVR[31] */ + for (i = 0; i < 32; i++, data++) + if (__get_user(task->thread.evr[i], data)) + return -EFAULT; + /* copy ACC */ + if (__get_user64(task->thread.acc, (unsigned long long*)data)) + return -EFAULT; + + return 0; +} +#endif /* CONFIG_SPE */ + static inline void set_single_step(struct task_struct *task) { struct pt_regs *regs = task->thread.regs; if (regs != NULL) { -#ifdef CONFIG_4xx +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) task->thread.dbcr0 = DBCR0_IDM | DBCR0_IC; /* MSR.DE should already be set */ #else @@ -152,7 +216,7 @@ struct pt_regs *regs = task->thread.regs; if (regs != NULL) { -#ifdef CONFIG_4xx +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) task->thread.dbcr0 = 0; #else regs->msr &= ~MSR_SE; @@ -358,6 +422,23 @@ giveup_altivec(child); preempt_enable(); ret = set_vrregs(child, (unsigned long *)data); + break; +#endif +#ifdef CONFIG_SPE + case PTRACE_GETEVRREGS: + /* Get the child spe register state. */ + if (child->thread.regs->msr & MSR_SPE) + giveup_spe(child); + ret = get_evrregs((unsigned long *)data, child); + break; + + case PTRACE_SETEVRREGS: + /* Set the child spe register state. */ + /* this is to clear the MSR_SPE bit to force a reload + * of register state from memory */ + if (child->thread.regs->msr & MSR_SPE) + giveup_spe(child); + ret = set_evrregs(child, (unsigned long *)data); break; #endif diff -Nru a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c --- a/arch/ppc/kernel/signal.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/kernel/signal.c 2004-06-23 19:04:28 -07:00 @@ -183,8 +183,8 @@ /* * Save the current user registers on the user stack. - * We only save the altivec registers if the process has used - * altivec instructions at some point. + * We only save the altivec/spe registers if the process has used + * altivec/spe instructions at some point. */ static int save_user_regs(struct pt_regs *regs, struct mcontext *frame, int sigret) @@ -198,6 +198,10 @@ if (current->thread.used_vr && (regs->msr & MSR_VEC)) giveup_altivec(current); #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + if (current->thread.used_spe && (regs->msr & MSR_SPE)) + giveup_spe(current); +#endif /* CONFIG_ALTIVEC */ preempt_enable(); if (__copy_to_user(&frame->mc_gregs, regs, GP_REGS_SIZE) @@ -229,6 +233,24 @@ return 1; #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_SPE + /* save spe registers */ + if (current->thread.used_spe) { + if (__copy_to_user(&frame->mc_vregs, current->thread.evr, + ELF_NEVRREG * sizeof(u32))) + return 1; + /* set MSR_SPE in the saved MSR value to indicate that + frame->mc_vregs contains valid data */ + if (__put_user(regs->msr | MSR_SPE, &frame->mc_gregs[PT_MSR])) + return 1; + } + /* else assert((regs->msr & MSR_SPE) == 0) */ + + /* We always copy to/from spefscr */ + if (__put_user(current->thread.spefscr, (u32 *)&frame->mc_vregs + ELF_NEVRREG)) + return 1; +#endif /* CONFIG_SPE */ + if (sigret) { /* Set up the sigreturn trampoline: li r0,sigret; sc */ if (__put_user(0x38000000UL + sigret, &frame->tramp[0]) @@ -249,7 +271,7 @@ restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig) { unsigned long save_r2; -#ifdef CONFIG_ALTIVEC +#if defined(CONFIG_ALTIVEC) || defined(CONFIG_SPE) unsigned long msr; #endif @@ -289,6 +311,23 @@ if (__get_user(current->thread.vrsave, (u32 *)&sr->mc_vregs[32])) return 1; #endif /* CONFIG_ALTIVEC */ + +#ifdef CONFIG_SPE + /* force the process to reload the spe registers from + current->thread when it next does spe instructions */ + regs->msr &= ~MSR_SPE; + if (!__get_user(msr, &sr->mc_gregs[PT_MSR]) && (msr & MSR_SPE) != 0) { + /* restore spe registers from the stack */ + if (__copy_from_user(current->thread.evr, &sr->mc_vregs, + sizeof(sr->mc_vregs))) + return 1; + } else if (current->thread.used_spe) + memset(¤t->thread.evr, 0, ELF_NEVRREG * sizeof(u32)); + + /* Always get SPEFSCR back */ + if (__get_user(current->thread.spefscr, (u32 *)&sr->mc_vregs + ELF_NEVRREG)) + return 1; +#endif /* CONFIG_SPE */ return 0; } diff -Nru a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c --- a/arch/ppc/kernel/time.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/kernel/time.c 2004-06-23 19:04:28 -07:00 @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -107,17 +108,23 @@ return delta; } -extern unsigned long prof_cpu_mask; -extern unsigned int * prof_buffer; -extern unsigned long prof_len; -extern unsigned long prof_shift; extern char _stext; -static inline void ppc_do_profile (unsigned long nip) +static inline void ppc_do_profile (struct pt_regs *regs) { + unsigned long nip; + extern unsigned long prof_cpu_mask; + + profile_hook(regs); + + if (user_mode(regs)) + return; + if (!prof_buffer) return; + nip = instruction_pointer(regs); + /* * Only measure the CPUs specified by /proc/irq/prof_cpu_mask. * (default is all CPUs.) @@ -156,8 +163,9 @@ while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) < 0) { jiffy_stamp += tb_ticks_per_jiffy; - if (!user_mode(regs)) - ppc_do_profile(instruction_pointer(regs)); + + ppc_do_profile(regs); + if (smp_processor_id()) continue; diff -Nru a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c --- a/arch/ppc/kernel/traps.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc/kernel/traps.c 2004-06-23 19:04:25 -07:00 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -102,8 +103,7 @@ do_exit(err); } -void -_exception(int signr, struct pt_regs *regs, int code, unsigned long addr) +void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) { siginfo_t info; @@ -171,6 +171,11 @@ /* On 4xx, the reason for the machine check or program exception is in the ESR. */ #define get_reason(regs) ((regs)->dsisr) +#ifndef CONFIG_E500 +#define get_mc_reason(regs) ((regs)->dsisr) +#else +#define get_mc_reason(regs) (mfspr(SPRN_MCSR)) +#endif #define REASON_FP 0 #define REASON_ILLEGAL ESR_PIL #define REASON_PRIVILEGED ESR_PPR @@ -184,6 +189,7 @@ /* On non-4xx, the reason for the machine check or program exception is in the MSR. */ #define get_reason(regs) ((regs)->msr) +#define get_mc_reason(regs) ((regs)->msr) #define REASON_FP 0x100000 #define REASON_ILLEGAL 0x80000 #define REASON_PRIVILEGED 0x40000 @@ -193,10 +199,9 @@ #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) #endif -void -MachineCheckException(struct pt_regs *regs) +void MachineCheckException(struct pt_regs *regs) { - unsigned long reason = get_reason(regs); + unsigned long reason = get_mc_reason(regs); if (user_mode(regs)) { regs->msr |= MSR_RI; @@ -256,7 +261,37 @@ /* Clear MCSR */ mtspr(SPRN_MCSR, mcsr); } -#else /* !CONFIG_4xx */ +#elif defined (CONFIG_E500) + printk("Machine check in kernel mode.\n"); + printk("Caused by (from MCSR=%lx): ", reason); + + if (reason & MCSR_MCP) + printk("Machine Check Signal\n"); + if (reason & MCSR_ICPERR) + printk("Instruction Cache Parity Error\n"); + if (reason & MCSR_DCP_PERR) + printk("Data Cache Push Parity Error\n"); + if (reason & MCSR_DCPERR) + printk("Data Cache Parity Error\n"); + if (reason & MCSR_GL_CI) + printk("Guarded Load or Cache-Inhibited stwcx.\n"); + if (reason & MCSR_BUS_IAERR) + printk("Bus - Instruction Address Error\n"); + if (reason & MCSR_BUS_RAERR) + printk("Bus - Read Address Error\n"); + if (reason & MCSR_BUS_WAERR) + printk("Bus - Write Address Error\n"); + if (reason & MCSR_BUS_IBERR) + printk("Bus - Instruction Data Error\n"); + if (reason & MCSR_BUS_RBERR) + printk("Bus - Read Data Bus Error\n"); + if (reason & MCSR_BUS_WBERR) + printk("Bus - Read Data Bus Error\n"); + if (reason & MCSR_BUS_IPERR) + printk("Bus - Instruction Parity Error\n"); + if (reason & MCSR_BUS_RPERR) + printk("Bus - Read Parity Error\n"); +#else /* !CONFIG_4xx && !CONFIG_E500 */ printk("Machine check in kernel mode.\n"); printk("Caused by (from SRR1=%lx): ", reason); switch (reason & 0x601F0000) { @@ -292,8 +327,7 @@ die("machine check", regs, SIGBUS); } -void -SMIException(struct pt_regs *regs) +void SMIException(struct pt_regs *regs) { debugger(regs); #if !(defined(CONFIG_XMON) || defined(CONFIG_KGDB)) @@ -302,24 +336,21 @@ #endif } -void -UnknownException(struct pt_regs *regs) +void UnknownException(struct pt_regs *regs) { printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx %s\n", regs->nip, regs->msr, regs->trap, print_tainted()); _exception(SIGTRAP, regs, 0, 0); } -void -InstructionBreakpoint(struct pt_regs *regs) +void InstructionBreakpoint(struct pt_regs *regs) { if (debugger_iabr_match(regs)) return; _exception(SIGTRAP, regs, TRAP_BRKPT, 0); } -void -RunModeException(struct pt_regs *regs) +void RunModeException(struct pt_regs *regs) { _exception(SIGTRAP, regs, 0, 0); } @@ -337,8 +368,7 @@ #define INST_MFSPR_PVR 0x7c1f42a6 #define INST_MFSPR_PVR_MASK 0xfc1fffff -static int -emulate_instruction(struct pt_regs *regs) +static int emulate_instruction(struct pt_regs *regs) { u32 instword; u32 rd; @@ -401,8 +431,7 @@ return module_find_bug(bugaddr); } -int -check_bug_trap(struct pt_regs *regs) +int check_bug_trap(struct pt_regs *regs) { struct bug_entry *bug; unsigned long addr; @@ -439,8 +468,7 @@ return 0; } -void -ProgramCheckException(struct pt_regs *regs) +void ProgramCheckException(struct pt_regs *regs) { unsigned int reason = get_reason(regs); extern int do_mathemu(struct pt_regs *regs); @@ -513,8 +541,7 @@ _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); } -void -SingleStepException(struct pt_regs *regs) +void SingleStepException(struct pt_regs *regs) { regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ if (debugger_sstep(regs)) @@ -522,8 +549,7 @@ _exception(SIGTRAP, regs, TRAP_TRACE, 0); } -void -AlignmentException(struct pt_regs *regs) +void AlignmentException(struct pt_regs *regs) { int fixed; @@ -543,8 +569,7 @@ _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); } -void -StackOverflow(struct pt_regs *regs) +void StackOverflow(struct pt_regs *regs) { printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n", current, regs->gpr[1]); @@ -561,8 +586,7 @@ die("nonrecoverable exception", regs, SIGKILL); } -void -trace_syscall(struct pt_regs *regs) +void trace_syscall(struct pt_regs *regs) { printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n", current, current->pid, regs->nip, regs->link, regs->gpr[0], @@ -570,8 +594,7 @@ } #ifdef CONFIG_8xx -void -SoftwareEmulation(struct pt_regs *regs) +void SoftwareEmulation(struct pt_regs *regs) { extern int do_mathemu(struct pt_regs *); extern int Soft_emulate_8xx(struct pt_regs *); @@ -623,8 +646,7 @@ #endif /* CONFIG_4xx || CONFIG_BOOKE */ #if !defined(CONFIG_TAU_INT) -void -TAUException(struct pt_regs *regs) +void TAUException(struct pt_regs *regs) { printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx %s\n", regs->nip, regs->msr, regs->trap, print_tainted()); @@ -646,14 +668,13 @@ /* The kernel has executed an altivec instruction without first enabling altivec. Whinge but let it do it. */ if (++kernel_altivec_count < 10) - printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%x)\n", + printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%lx)\n", current, regs->nip); regs->msr |= MSR_VEC; } #ifdef CONFIG_ALTIVEC -void -AltivecAssistException(struct pt_regs *regs) +void AltivecAssistException(struct pt_regs *regs) { int err; @@ -682,6 +703,55 @@ } #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_FSL_BOOKE +void CacheLockingException(struct pt_regs *regs, unsigned long address, + unsigned long error_code) +{ + /* We treat cache locking instructions from the user + * as priv ops, in the future we could try to do + * something smarter + */ + if (error_code & (ESR_DLK|ESR_ILK)) + _exception(SIGILL, regs, ILL_PRVOPC, regs->nip); + return; +} +#endif /* CONFIG_FSL_BOOKE */ + +#ifdef CONFIG_SPE +void SPEFloatingPointException(struct pt_regs *regs) +{ + unsigned long spefscr; + int fpexc_mode; + int code = 0; + + spefscr = current->thread.spefscr; + fpexc_mode = current->thread.fpexc_mode; + + /* Hardware does not neccessarily set sticky + * underflow/overflow/invalid flags */ + if ((spefscr & SPEFSCR_FOVF) && (fpexc_mode & PR_FP_EXC_OVF)) { + code = FPE_FLTOVF; + spefscr |= SPEFSCR_FOVFS; + } + else if ((spefscr & SPEFSCR_FUNF) && (fpexc_mode & PR_FP_EXC_UND)) { + code = FPE_FLTUND; + spefscr |= SPEFSCR_FUNFS; + } + else if ((spefscr & SPEFSCR_FDBZ) && (fpexc_mode & PR_FP_EXC_DIV)) + code = FPE_FLTDIV; + else if ((spefscr & SPEFSCR_FINV) && (fpexc_mode & PR_FP_EXC_INV)) { + code = FPE_FLTINV; + spefscr |= SPEFSCR_FINVS; + } + else if ((spefscr & (SPEFSCR_FG | SPEFSCR_FX)) && (fpexc_mode & PR_FP_EXC_RES)) + code = FPE_FLTRES; + + current->thread.spefscr = spefscr; + + _exception(SIGFPE, regs, code, regs->nip); + return; +} +#endif void __init trap_init(void) { diff -Nru a/arch/ppc/kernel/vecemu.c b/arch/ppc/kernel/vecemu.c --- a/arch/ppc/kernel/vecemu.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc/kernel/vecemu.c 2004-06-23 19:04:25 -07:00 @@ -256,8 +256,7 @@ return (x + half) & ~(0x7fffff >> exp); } -int -emulate_altivec(struct pt_regs *regs) +int emulate_altivec(struct pt_regs *regs) { unsigned int instr, i; unsigned int va, vb, vc, vd; diff -Nru a/arch/ppc/mm/Makefile b/arch/ppc/mm/Makefile --- a/arch/ppc/mm/Makefile 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/mm/Makefile 2004-06-23 19:04:28 -07:00 @@ -12,3 +12,4 @@ obj-$(CONFIG_PPC_STD_MMU) += hashtable.o ppc_mmu.o tlb.o obj-$(CONFIG_40x) += 4xx_mmu.o obj-$(CONFIG_44x) += 44x_mmu.o +obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o diff -Nru a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c --- a/arch/ppc/mm/fault.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ppc/mm/fault.c 2004-06-23 19:04:26 -07:00 @@ -99,7 +99,7 @@ struct mm_struct *mm = current->mm; siginfo_t info; int code = SEGV_MAPERR; -#if defined(CONFIG_4xx) +#if defined(CONFIG_4xx) || defined (CONFIG_BOOKE) int is_write = error_code & ESR_DST; #else int is_write = 0; @@ -114,20 +114,20 @@ error_code &= 0x48200000; else is_write = error_code & 0x02000000; -#endif /* CONFIG_4xx */ +#endif /* CONFIG_4xx || CONFIG_BOOKE */ #if defined(CONFIG_XMON) || defined(CONFIG_KGDB) if (debugger_fault_handler && TRAP(regs) == 0x300) { debugger_fault_handler(regs); return 0; } -#if !defined(CONFIG_4xx) +#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) if (error_code & 0x00400000) { /* DABR match */ if (debugger_dabr_match(regs)) return 0; } -#endif /* !CONFIG_4xx */ +#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/ #endif /* CONFIG_XMON || CONFIG_KGDB */ if (in_atomic() || mm == NULL) @@ -200,8 +200,8 @@ if (is_write) { if (!(vma->vm_flags & VM_WRITE)) goto bad_area; -#if defined(CONFIG_4xx) - /* an exec - 4xx allows for per-page execute permission */ +#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) + /* an exec - 4xx/Book-E allows for per-page execute permission */ } else if (TRAP(regs) == 0x400) { pte_t *ptep; @@ -214,7 +214,7 @@ goto bad_area; #endif - /* Since 4xx supports per-page execute permission, + /* Since 4xx/Book-E supports per-page execute permission, * we lazily flush dcache to icache. */ ptep = NULL; if (get_pteptr(mm, address, &ptep) && pte_present(*ptep)) { diff -Nru a/arch/ppc/mm/fsl_booke_mmu.c b/arch/ppc/mm/fsl_booke_mmu.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/mm/fsl_booke_mmu.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,236 @@ +/* + * Modifications by Kumar Gala (kumar.gala@freescale.com) to support + * E500 Book E processors. + * + * Copyright 2004 Freescale Semiconductor, Inc + * + * This file contains the routines for initializing the MMU + * on the 4xx series of chips. + * -- paulus + * + * Derived from arch/ppc/mm/init.c: + * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) + * + * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au) + * and Cort Dougan (PReP) (cort@cs.nmt.edu) + * Copyright (C) 1996 Paul Mackerras + * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). + * + * Derived from "arch/i386/mm/init.c" + * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern void loadcam_entry(unsigned int index); +unsigned int tlbcam_index; +unsigned int num_tlbcam_entries; +static unsigned long __cam0, __cam1, __cam2; +extern unsigned long total_lowmem; +extern unsigned long __max_low_memory; +#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE + +struct tlbcam { + u32 MAS0; + u32 MAS1; + u32 MAS2; + u32 MAS3; + u32 MAS7; +} TLBCAM[NUM_TLBCAMS]; + +struct tlbcamrange { + unsigned long start; + unsigned long limit; + phys_addr_t phys; +} tlbcam_addrs[NUM_TLBCAMS]; + +extern unsigned int tlbcam_index; + +/* + * Return PA for this VA if it is mapped by a CAM, or 0 + */ +unsigned long v_mapped_by_tlbcam(unsigned long va) +{ + int b; + for (b = 0; b < tlbcam_index; ++b) + if (va >= tlbcam_addrs[b].start && va < tlbcam_addrs[b].limit) + return tlbcam_addrs[b].phys + (va - tlbcam_addrs[b].start); + return 0; +} + +/* + * Return VA for a given PA or 0 if not mapped + */ +unsigned long p_mapped_by_tlbcam(unsigned long pa) +{ + int b; + for (b = 0; b < tlbcam_index; ++b) + if (pa >= tlbcam_addrs[b].phys + && pa < (tlbcam_addrs[b].limit-tlbcam_addrs[b].start) + +tlbcam_addrs[b].phys) + return tlbcam_addrs[b].start+(pa-tlbcam_addrs[b].phys); + return 0; +} + +/* + * Set up one of the I/D BAT (block address translation) register pairs. + * The parameters are not checked; in particular size must be a power + * of 4 between 4k and 256M. + */ +void settlbcam(int index, unsigned long virt, phys_addr_t phys, + unsigned int size, int flags, unsigned int pid) +{ + unsigned int tsize, lz; + + asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); + tsize = (21 - lz) / 2; + +#ifdef CONFIG_SMP + if ((flags & _PAGE_NO_CACHE) == 0) + flags |= _PAGE_COHERENT; +#endif + + TLBCAM[index].MAS0 = MAS0_TLBSEL | (index << 16); + TLBCAM[index].MAS1 = MAS1_VALID | MAS1_IPROT | MAS1_TSIZE(tsize) | ((pid << 16) & MAS1_TID); + TLBCAM[index].MAS2 = virt & PAGE_MASK; + + TLBCAM[index].MAS2 |= (flags & _PAGE_WRITETHRU) ? MAS2_W : 0; + TLBCAM[index].MAS2 |= (flags & _PAGE_NO_CACHE) ? MAS2_I : 0; + TLBCAM[index].MAS2 |= (flags & _PAGE_COHERENT) ? MAS2_M : 0; + TLBCAM[index].MAS2 |= (flags & _PAGE_GUARDED) ? MAS2_G : 0; + TLBCAM[index].MAS2 |= (flags & _PAGE_ENDIAN) ? MAS2_E : 0; + + TLBCAM[index].MAS3 = (phys & PAGE_MASK) | MAS3_SX | MAS3_SR; + TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_SW : 0); + +#ifndef CONFIG_KGDB /* want user access for breakpoints */ + if (flags & _PAGE_USER) { + TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR; + TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0); + } +#else + TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR; + TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0); +#endif + + tlbcam_addrs[index].start = virt; + tlbcam_addrs[index].limit = virt + size - 1; + tlbcam_addrs[index].phys = phys; + + loadcam_entry(index); +} + +void invalidate_tlbcam_entry(int index) +{ + TLBCAM[index].MAS0 = MAS0_TLBSEL | (index << 16); + TLBCAM[index].MAS1 = ~MAS1_VALID; + + loadcam_entry(index); +} + +void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1, + unsigned long cam2) +{ + settlbcam(0, KERNELBASE, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0); + tlbcam_index++; + if (cam1) { + tlbcam_index++; + settlbcam(1, KERNELBASE+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0); + } + if (cam2) { + tlbcam_index++; + settlbcam(2, KERNELBASE+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0); + } +} + +/* + * MMU_init_hw does the chip-specific initialization of the MMU hardware. + */ +void __init MMU_init_hw(void) +{ + flush_instruction_cache(); +} + +unsigned long __init mmu_mapin_ram(void) +{ + cam_mapin_ram(__cam0, __cam1, __cam2); + + return __cam0 + __cam1 + __cam2; +} + + +void __init +adjust_total_lowmem(void) +{ + unsigned long max_low_mem = MAX_LOW_MEM; + unsigned long cam_max = 0x10000000; + unsigned long ram; + + /* adjust CAM size to max_low_mem */ + if (max_low_mem < cam_max) + cam_max = max_low_mem; + + /* adjust lowmem size to max_low_mem */ + if (max_low_mem < total_lowmem) + ram = max_low_mem; + else + ram = total_lowmem; + + /* Calculate CAM values */ + __cam0 = 1UL << 2 * (__ilog2(ram) / 2); + if (__cam0 > cam_max) + __cam0 = cam_max; + ram -= __cam0; + if (ram) { + __cam1 = 1UL << 2 * (__ilog2(ram) / 2); + if (__cam1 > cam_max) + __cam1 = cam_max; + ram -= __cam1; + } + if (ram) { + __cam2 = 1UL << 2 * (__ilog2(ram) / 2); + if (__cam2 > cam_max) + __cam2 = cam_max; + ram -= __cam2; + } + + printk(KERN_INFO "Memory CAM mapping: CAM0=%ldMb, CAM1=%ldMb," + " CAM2=%ldMb residual: %ldMb\n", + __cam0 >> 20, __cam1 >> 20, __cam2 >> 20, + (total_lowmem - __cam0 - __cam1 - __cam2) >> 20); + __max_low_memory = max_low_mem = __cam0 + __cam1 + __cam2; +} diff -Nru a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c --- a/arch/ppc/mm/init.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ppc/mm/init.c 2004-06-23 19:04:26 -07:00 @@ -253,6 +253,12 @@ if (__max_memory && total_memory > __max_memory) total_memory = __max_memory; total_lowmem = total_memory; +#ifdef CONFIG_FSL_BOOKE + /* Freescale Book-E parts expect lowmem to be mapped by fixed TLB + * entries, so we need to adjust lowmem to match the amount we can map + * in the fixed entries */ + adjust_total_lowmem(); +#endif /* CONFIG_FSL_BOOKE */ if (total_lowmem > __max_low_memory) { total_lowmem = __max_low_memory; #ifndef CONFIG_HIGHMEM diff -Nru a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h --- a/arch/ppc/mm/mmu_decl.h 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc/mm/mmu_decl.h 2004-06-23 19:04:27 -07:00 @@ -27,6 +27,9 @@ extern void setbat(int index, unsigned long virt, unsigned long phys, unsigned int size, int flags); extern void reserve_phys_mem(unsigned long start, unsigned long size); +extern void settlbcam(int index, unsigned long virt, phys_addr_t phys, + unsigned int size, int flags, unsigned int pid); +extern void invalidate_tlbcam_entry(int index); extern int __map_without_bats; extern unsigned long ioremap_base; @@ -52,6 +55,12 @@ #define flush_HPTE(X, va, pg) _tlbie(va) extern void MMU_init_hw(void); extern unsigned long mmu_mapin_ram(void); + +#elif defined(CONFIG_FSL_BOOKE) +#define flush_HPTE(X, va, pg) _tlbie(va) +extern void MMU_init_hw(void); +extern unsigned long mmu_mapin_ram(void); +extern void adjust_total_lowmem(void); #else /* anything except 4xx or 8xx */ diff -Nru a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c --- a/arch/ppc/mm/pgtable.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc/mm/pgtable.c 2004-06-23 19:04:25 -07:00 @@ -42,6 +42,10 @@ #define HAVE_BATS 1 #endif +#if defined(CONFIG_FSL_BOOKE) +#define HAVE_TLBCAM 1 +#endif + extern char etext[], _stext[]; #ifdef CONFIG_SMP @@ -59,6 +63,16 @@ #define p_mapped_by_bats(x) (0UL) #endif /* HAVE_BATS */ +#ifdef HAVE_TLBCAM +extern unsigned int tlbcam_index; +extern unsigned int num_tlbcam_entries; +extern unsigned long v_mapped_by_tlbcam(unsigned long va); +extern unsigned long p_mapped_by_tlbcam(unsigned long pa); +#else /* !HAVE_TLBCAM */ +#define v_mapped_by_tlbcam(x) (0UL) +#define p_mapped_by_tlbcam(x) (0UL) +#endif /* HAVE_TLBCAM */ + #ifdef CONFIG_44x /* 44x uses an 8kB pgdir because it has 8-byte Linux PTEs. */ #define PGDIR_ORDER 1 @@ -210,6 +224,9 @@ if ((v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ ) goto out; + if ((v = p_mapped_by_tlbcam(p))) + goto out; + if (mem_init_done) { struct vm_struct *area; area = get_vm_area(size, VM_IOREMAP); @@ -300,6 +317,9 @@ /* is x a power of 2? */ #define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) +/* is x a power of 4? */ +#define is_power_of_4(x) ((x) != 0 && (((x) & (x-1)) == 0) && (ffs(x) & 1)) + /* * Set up a mapping for a block of I/O. * virt, phys, size must all be page-aligned. @@ -324,6 +344,18 @@ return; } #endif /* HAVE_BATS */ + +#ifdef HAVE_TLBCAM + /* + * Use a CAM for this if possible... + */ + if (tlbcam_index < num_tlbcam_entries && is_power_of_4(size) + && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) { + settlbcam(tlbcam_index, virt, phys, size, flags, 0); + ++tlbcam_index; + return; + } +#endif /* HAVE_TLBCAM */ /* No BATs available, put it in the page tables. */ for (i = 0; i < size; i += PAGE_SIZE) diff -Nru a/arch/ppc/oprofile/Kconfig b/arch/ppc/oprofile/Kconfig --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/oprofile/Kconfig 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,23 @@ + +menu "Profiling support" + depends on EXPERIMENTAL + +config PROFILING + bool "Profiling support (EXPERIMENTAL)" + help + Say Y here to enable the extended profiling support mechanisms used + by profilers such as OProfile. + + +config OPROFILE + tristate "OProfile system profiling (EXPERIMENTAL)" + depends on PROFILING + help + OProfile is a profiling system capable of profiling the + whole system, include the kernel, kernel modules, libraries, + and applications. + + If unsure, say N. + +endmenu + diff -Nru a/arch/ppc/oprofile/Makefile b/arch/ppc/oprofile/Makefile --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/oprofile/Makefile 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,9 @@ +obj-$(CONFIG_OPROFILE) += oprofile.o + +DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \ + oprof.o cpu_buffer.o buffer_sync.o \ + event_buffer.o oprofile_files.o \ + oprofilefs.o oprofile_stats.o \ + timer_int.o ) + +oprofile-y := $(DRIVER_OBJS) init.o diff -Nru a/arch/ppc/oprofile/init.c b/arch/ppc/oprofile/init.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/oprofile/init.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,23 @@ +/** + * @file init.c + * + * @remark Copyright 2002 OProfile authors + * @remark Read the file COPYING + * + * @author John Levon + */ + +#include +#include +#include +#include + +int __init oprofile_arch_init(struct oprofile_operations ** ops) +{ + return -ENODEV; +} + + +void oprofile_arch_exit(void) +{ +} diff -Nru a/arch/ppc/platforms/85xx/Kconfig b/arch/ppc/platforms/85xx/Kconfig --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/platforms/85xx/Kconfig 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,44 @@ +config 85xx + bool + depends on E500 + default y + +config PPC_INDIRECT_PCI_BE + bool + depends on 85xx + default y + +menu "Freescale 85xx options" + depends on E500 + +choice + prompt "Machine Type" + depends on 85xx + default MPC8540_ADS + +config MPC8540_ADS + bool "MPC8540ADS" + help + This option enables support for the MPC 8540 ADS evaluation board. + +endchoice + +# It's often necessary to know the specific 85xx processor type. +# Fortunately, it is implied (so far) from the board type, so we +# don't need to ask more redundant questions. +config MPC8540 + bool + depends on MPC8540_ADS + default y + +config FSL_OCP + bool + depends on 85xx + default y + +config PPC_GEN550 + bool + depends on MPC8540 + default y + +endmenu diff -Nru a/arch/ppc/platforms/85xx/Makefile b/arch/ppc/platforms/85xx/Makefile --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/platforms/85xx/Makefile 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,7 @@ +# +# Makefile for the PowerPC 85xx linux kernel. +# + +obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads_common.o mpc8540_ads.o + +obj-$(CONFIG_MPC8540) += mpc8540.o diff -Nru a/arch/ppc/platforms/85xx/mpc8540.c b/arch/ppc/platforms/85xx/mpc8540.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/platforms/85xx/mpc8540.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,97 @@ +/* + * arch/ppc/platforms/85xx/mpc8540.c + * + * MPC8540 I/O descriptions + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include + +/* These should be defined in platform code */ +extern struct ocp_gfar_data mpc85xx_tsec1_def; +extern struct ocp_gfar_data mpc85xx_tsec2_def; +extern struct ocp_gfar_data mpc85xx_fec_def; +extern struct ocp_mpc_i2c_data mpc85xx_i2c1_def; + +/* We use offsets for paddr since we do not know at compile time + * what CCSRBAR is, platform code should fix this up in + * setup_arch + * + * Only the first IRQ is given even if a device has + * multiple lines associated with ita + */ +struct ocp_def core_ocp[] = { + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_IIC, + .index = 0, + .paddr = MPC85xx_IIC1_OFFSET, + .irq = MPC85xx_IRQ_IIC1, + .pm = OCP_CPM_NA, + .additions = &mpc85xx_i2c1_def, + }, + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_16550, + .index = 0, + .paddr = MPC85xx_UART0_OFFSET, + .irq = MPC85xx_IRQ_DUART, + .pm = OCP_CPM_NA, + }, + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_16550, + .index = 1, + .paddr = MPC85xx_UART1_OFFSET, + .irq = MPC85xx_IRQ_DUART, + .pm = OCP_CPM_NA, + }, + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_GFAR, + .index = 0, + .paddr = MPC85xx_ENET1_OFFSET, + .irq = MPC85xx_IRQ_TSEC1_TX, + .pm = OCP_CPM_NA, + .additions = &mpc85xx_tsec1_def, + }, + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_GFAR, + .index = 1, + .paddr = MPC85xx_ENET2_OFFSET, + .irq = MPC85xx_IRQ_TSEC2_TX, + .pm = OCP_CPM_NA, + .additions = &mpc85xx_tsec2_def, + }, + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_GFAR, + .index = 2, + .paddr = MPC85xx_ENET3_OFFSET, + .irq = MPC85xx_IRQ_FEC, + .pm = OCP_CPM_NA, + .additions = &mpc85xx_fec_def, + }, + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_DMA, + .index = 0, + .paddr = MPC85xx_DMA_OFFSET, + .irq = MPC85xx_IRQ_DMA0, + .pm = OCP_CPM_NA, + }, + { .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_PERFMON, + .index = 0, + .paddr = MPC85xx_PERFMON_OFFSET, + .irq = MPC85xx_IRQ_PERFMON, + .pm = OCP_CPM_NA, + }, + { .vendor = OCP_VENDOR_INVALID + } +}; diff -Nru a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,238 @@ +/* + * arch/ppc/platforms/85xx/mpc8540_ads.c + * + * MPC8540ADS board specific routines + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for linux/serial_core.h */ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +struct ocp_gfar_data mpc85xx_tsec1_def = { + .interruptTransmit = MPC85xx_IRQ_TSEC1_TX, + .interruptError = MPC85xx_IRQ_TSEC1_ERROR, + .interruptReceive = MPC85xx_IRQ_TSEC1_RX, + .interruptPHY = MPC85xx_IRQ_EXT5, + .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR + | GFAR_HAS_RMON + | GFAR_HAS_PHY_INTR | GFAR_HAS_COALESCE), + .phyid = 0, + .phyregidx = 0, +}; + +struct ocp_gfar_data mpc85xx_tsec2_def = { + .interruptTransmit = MPC85xx_IRQ_TSEC2_TX, + .interruptError = MPC85xx_IRQ_TSEC2_ERROR, + .interruptReceive = MPC85xx_IRQ_TSEC2_RX, + .interruptPHY = MPC85xx_IRQ_EXT5, + .flags = (GFAR_HAS_GIGABIT | GFAR_HAS_MULTI_INTR + | GFAR_HAS_RMON + | GFAR_HAS_PHY_INTR | GFAR_HAS_COALESCE), + .phyid = 1, + .phyregidx = 0, +}; + +struct ocp_gfar_data mpc85xx_fec_def = { + .interruptTransmit = MPC85xx_IRQ_FEC, + .interruptError = MPC85xx_IRQ_FEC, + .interruptReceive = MPC85xx_IRQ_FEC, + .interruptPHY = MPC85xx_IRQ_EXT5, + .flags = 0, + .phyid = 3, + .phyregidx = 0, +}; + +struct ocp_fs_i2c_data mpc85xx_i2c1_def = { + .flags = FS_I2C_SEPARATE_DFSRR, +}; + +/* ************************************************************************ + * + * Setup the architecture + * + */ +static void __init +mpc8540ads_setup_arch(void) +{ + struct ocp_def *def; + struct ocp_gfar_data *einfo; + bd_t *binfo = (bd_t *) __res; + unsigned int freq; + + /* get the core frequency */ + freq = binfo->bi_intfreq; + + if (ppc_md.progress) + ppc_md.progress("mpc8540ads_setup_arch()", 0); + + /* Set loops_per_jiffy to a half-way reasonable value, + for use until calibrate_delay gets called. */ + loops_per_jiffy = freq / HZ; + +#ifdef CONFIG_PCI + /* setup PCI host bridges */ + mpc85xx_setup_hose(); +#endif + +#ifdef CONFIG_DUMMY_CONSOLE + conswitchp = &dummy_con; +#endif + +#ifdef CONFIG_SERIAL_8250 + mpc85xx_early_serial_map(); +#endif + +#ifdef CONFIG_SERIAL_TEXT_DEBUG + /* Invalidate the entry we stole earlier the serial ports + * should be properly mapped */ + invalidate_tlbcam_entry(NUM_TLBCAMS - 1); +#endif + + def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 0); + if (def) { + einfo = (struct ocp_gfar_data *) def->additions; + memcpy(einfo->mac_addr, binfo->bi_enetaddr, 6); + } + + def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 1); + if (def) { + einfo = (struct ocp_gfar_data *) def->additions; + memcpy(einfo->mac_addr, binfo->bi_enet1addr, 6); + } + + def = ocp_get_one_device(OCP_VENDOR_FREESCALE, OCP_FUNC_GFAR, 2); + if (def) { + einfo = (struct ocp_gfar_data *) def->additions; + memcpy(einfo->mac_addr, binfo->bi_enet2addr, 6); + } + +#ifdef CONFIG_BLK_DEV_INITRD + if (initrd_start) + ROOT_DEV = Root_RAM0; + else +#endif +#ifdef CONFIG_ROOT_NFS + ROOT_DEV = Root_NFS; +#else + ROOT_DEV = Root_HDA1; +#endif + + ocp_for_each_device(mpc85xx_update_paddr_ocp, &(binfo->bi_immr_base)); +} + +/* ************************************************************************ */ +void __init +platform_init(unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7) +{ + /* parse_bootinfo must always be called first */ + parse_bootinfo(find_bootinfo()); + + /* + * If we were passed in a board information, copy it into the + * residual data area. + */ + if (r3) { + memcpy((void *) __res, (void *) (r3 + KERNELBASE), + sizeof (bd_t)); + } +#ifdef CONFIG_SERIAL_TEXT_DEBUG + { + bd_t *binfo = (bd_t *) __res; + + /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ + settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, + binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); + } +#endif + +#if defined(CONFIG_BLK_DEV_INITRD) + /* + * If the init RAM disk has been configured in, and there's a valid + * starting address for it, set it up. + */ + if (r4) { + initrd_start = r4 + KERNELBASE; + initrd_end = r5 + KERNELBASE; + } +#endif /* CONFIG_BLK_DEV_INITRD */ + + /* Copy the kernel command line arguments to a safe place. */ + + if (r6) { + *(char *) (r7 + KERNELBASE) = 0; + strcpy(cmd_line, (char *) (r6 + KERNELBASE)); + } + + /* setup the PowerPC module struct */ + ppc_md.setup_arch = mpc8540ads_setup_arch; + ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo; + + ppc_md.init_IRQ = mpc85xx_ads_init_IRQ; + ppc_md.get_irq = openpic_get_irq; + + ppc_md.restart = mpc85xx_restart; + ppc_md.power_off = mpc85xx_power_off; + ppc_md.halt = mpc85xx_halt; + + ppc_md.find_end_of_memory = mpc85xx_find_end_of_memory; + + ppc_md.time_init = NULL; + ppc_md.set_rtc_time = NULL; + ppc_md.get_rtc_time = NULL; + ppc_md.calibrate_decr = mpc85xx_calibrate_decr; + +#if defined(CONFIG_SERIAL_8250) && defined(CONFIG_SERIAL_TEXT_DEBUG) + ppc_md.progress = gen550_progress; +#endif /* CONFIG_SERIAL_8250 && CONFIG_SERIAL_TEXT_DEBUG */ + + if (ppc_md.progress) + ppc_md.progress("mpc8540ads_init(): exit", 0); + + return; +} diff -Nru a/arch/ppc/platforms/85xx/mpc8540_ads.h b/arch/ppc/platforms/85xx/mpc8540_ads.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,30 @@ +/* + * arch/ppc/platforms/85xx/mpc8540_ads.h + * + * MPC8540ADS board definitions + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#ifndef __MACH_MPC8540ADS_H__ +#define __MACH_MPC8540ADS_H__ + +#include +#include +#include +#include +#include + +#define SERIAL_PORT_DFNS \ + STD_UART_OP(0) \ + STD_UART_OP(1) + +#endif /* __MACH_MPC8540ADS_H__ */ diff -Nru a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,237 @@ +/* + * arch/ppc/platforms/85xx/mpc85xx_ads_common.c + * + * MPC85xx ADS board common routines + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#ifndef CONFIG_PCI +unsigned long isa_io_base = 0; +unsigned long isa_mem_base = 0; +#endif + +extern unsigned long total_memory; /* in mm/init */ + +unsigned char __res[sizeof (bd_t)]; + +/* Internal interrupts are all Level Sensitive, and Positive Polarity */ + +static u_char mpc85xx_ads_openpic_initsenses[] __initdata = { + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 0: L2 Cache */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 1: ECM */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 2: DDR DRAM */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 3: LBIU */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 4: DMA 0 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 5: DMA 1 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 6: DMA 2 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 7: DMA 3 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 8: PCI/PCI-X */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 9: RIO Inbound Port Write Error */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 10: RIO Doorbell Inbound */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 11: RIO Outbound Message */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 12: RIO Inbound Message */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 13: TSEC 0 Transmit */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 14: TSEC 0 Receive */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 15: Unused */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 16: Unused */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 17: Unused */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 18: TSEC 0 Receive/Transmit Error */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 19: TSEC 1 Transmit */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 20: TSEC 1 Receive */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 21: Unused */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 22: Unused */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 23: Unused */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 24: TSEC 1 Receive/Transmit Error */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 25: Fast Ethernet */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 26: DUART */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 27: I2C */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 28: Performance Monitor */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 29: Unused */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 30: CPM */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* Internal 31: Unused */ + 0x0, /* External 0: */ +#if defined(CONFIG_PCI) + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 1: PCI slot 0 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 2: PCI slot 1 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 3: PCI slot 2 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 4: PCI slot 3 */ +#else + 0x0, /* External 1: */ + 0x0, /* External 2: */ + 0x0, /* External 3: */ + 0x0, /* External 4: */ +#endif + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 5: PHY */ + 0x0, /* External 6: */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* External 7: PHY */ + 0x0, /* External 8: */ + 0x0, /* External 9: */ + 0x0, /* External 10: */ + 0x0, /* External 11: */ +}; + +/* ************************************************************************ */ +int +mpc85xx_ads_show_cpuinfo(struct seq_file *m) +{ + uint pvid, svid, phid1; + uint memsize = total_memory; + bd_t *binfo = (bd_t *) __res; + unsigned int freq; + + /* get the core frequency */ + freq = binfo->bi_intfreq; + + pvid = mfspr(PVR); + svid = mfspr(SVR); + + seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n"); + + switch (svid & 0xffff0000) { + case SVR_8540: + seq_printf(m, "Machine\t\t: mpc8540ads\n"); + break; + case SVR_8560: + seq_printf(m, "Machine\t\t: mpc8560ads\n"); + break; + default: + seq_printf(m, "Machine\t\t: unknown\n"); + break; + } + seq_printf(m, "bus freq\t: %u.%.6u MHz\n", freq / 1000000, + freq % 1000000); + seq_printf(m, "PVR\t\t: 0x%x\n", pvid); + seq_printf(m, "SVR\t\t: 0x%x\n", svid); + + /* Display cpu Pll setting */ + phid1 = mfspr(HID1); + seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); + + /* Display the amount of memory */ + seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024)); + + return 0; +} + +void __init +mpc85xx_ads_init_IRQ(void) +{ + bd_t *binfo = (bd_t *) __res; + /* Determine the Physical Address of the OpenPIC regs */ + phys_addr_t OpenPIC_PAddr = + binfo->bi_immr_base + MPC85xx_OPENPIC_OFFSET; + OpenPIC_Addr = ioremap(OpenPIC_PAddr, MPC85xx_OPENPIC_SIZE); + OpenPIC_InitSenses = mpc85xx_ads_openpic_initsenses; + OpenPIC_NumInitSenses = sizeof (mpc85xx_ads_openpic_initsenses); + + /* Skip reserved space and internal sources */ + openpic_set_sources(0, 32, OpenPIC_Addr + 0x10200); + /* Map PIC IRQs 0-11 */ + openpic_set_sources(32, 12, OpenPIC_Addr + 0x10000); + + /* we let openpic interrupts starting from an offset, to + * leave space for cascading interrupts underneath. + */ + openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET); + + return; +} + +#ifdef CONFIG_PCI +/* + * interrupt routing + */ + +int +mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) +{ + static char pci_irq_table[][4] = + /* + * This is little evil, but works around the fact + * that revA boards have IDSEL starting at 18 + * and others boards (older) start at 12 + * + * PCI IDSEL/INTPIN->INTLINE + * A B C D + */ + { + {PIRQA, PIRQB, PIRQC, PIRQD}, /* IDSEL 2 */ + {PIRQD, PIRQA, PIRQB, PIRQC}, + {PIRQC, PIRQD, PIRQA, PIRQB}, + {PIRQB, PIRQC, PIRQD, PIRQA}, /* IDSEL 5 */ + {0, 0, 0, 0}, /* -- */ + {0, 0, 0, 0}, /* -- */ + {0, 0, 0, 0}, /* -- */ + {0, 0, 0, 0}, /* -- */ + {0, 0, 0, 0}, /* -- */ + {0, 0, 0, 0}, /* -- */ + {PIRQA, PIRQB, PIRQC, PIRQD}, /* IDSEL 12 */ + {PIRQD, PIRQA, PIRQB, PIRQC}, + {PIRQC, PIRQD, PIRQA, PIRQB}, + {PIRQB, PIRQC, PIRQD, PIRQA}, /* IDSEL 15 */ + {0, 0, 0, 0}, /* -- */ + {0, 0, 0, 0}, /* -- */ + {PIRQA, PIRQB, PIRQC, PIRQD}, /* IDSEL 18 */ + {PIRQD, PIRQA, PIRQB, PIRQC}, + {PIRQC, PIRQD, PIRQA, PIRQB}, + {PIRQB, PIRQC, PIRQD, PIRQA}, /* IDSEL 21 */ + }; + + const long min_idsel = 2, max_idsel = 21, irqs_per_slot = 4; + return PCI_IRQ_TABLE_LOOKUP; +} + +int +mpc85xx_exclude_device(u_char bus, u_char devfn) +{ + if (bus == 0 && PCI_SLOT(devfn) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; + else + return PCIBIOS_SUCCESSFUL; +} + +#endif /* CONFIG_PCI */ diff -Nru a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,50 @@ +/* + * arch/ppc/platforms/85xx/mpc85xx_ads_common.h + * + * MPC85XX ADS common board definitions + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#ifndef __MACH_MPC85XX_ADS_H__ +#define __MACH_MPC85XX_ADS_H__ + +#include +#include +#include +#include + +#define BOARD_CCSRBAR ((uint)0xe0000000) +#define BCSR_ADDR ((uint)0xf8000000) +#define BCSR_SIZE ((uint)(32 * 1024)) + +extern int mpc85xx_ads_show_cpuinfo(struct seq_file *m); +extern void mpc85xx_ads_init_IRQ(void) __init; +extern void mpc85xx_ads_map_io(void) __init; + +/* PCI interrupt controller */ +#define PIRQA MPC85xx_IRQ_EXT1 +#define PIRQB MPC85xx_IRQ_EXT2 +#define PIRQC MPC85xx_IRQ_EXT3 +#define PIRQD MPC85xx_IRQ_EXT4 + +#define MPC85XX_PCI1_LOWER_IO 0x00000000 +#define MPC85XX_PCI1_UPPER_IO 0x00ffffff + +#define MPC85XX_PCI1_LOWER_MEM 0x80000000 +#define MPC85XX_PCI1_UPPER_MEM 0x9fffffff + +#define MPC85XX_PCI1_IO_BASE 0xe2000000 +#define MPC85XX_PCI1_MEM_OFFSET 0x00000000 + +#define MPC85XX_PCI1_IO_SIZE 0x01000000 + +#endif /* __MACH_MPC85XX_ADS_H__ */ diff -Nru a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c --- a/arch/ppc/platforms/pmac_cpufreq.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc/platforms/pmac_cpufreq.c 2004-06-23 19:04:27 -07:00 @@ -1,7 +1,8 @@ /* * arch/ppc/platforms/pmac_cpufreq.c * - * Copyright (C) 2002 - 2003 Benjamin Herrenschmidt + * Copyright (C) 2002 - 2004 Benjamin Herrenschmidt + * Copyright (C) 2004 John Steele Scott * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -47,6 +48,7 @@ #warning "WARNING, CPUFREQ not recommended on SMP kernels" #endif +extern void low_choose_7447a_dfs(int dfs); extern void low_choose_750fx_pll(int pll); extern void low_sleep_handler(void); extern void openpic_suspend(struct sys_device *sysdev, u32 state); @@ -54,18 +56,27 @@ extern void enable_kernel_altivec(void); extern void enable_kernel_fp(void); +/* + * Currently, PowerMac cpufreq supports only high & low frequencies + * that are set by the firmware + */ static unsigned int low_freq; static unsigned int hi_freq; static unsigned int cur_freq; -/* Clean that up some day ... use a func ptr or at least an enum... */ -static int cpufreq_uses_pmu; -static int cpufreq_uses_gpios; +/* + * Different models uses different mecanisms to switch the frequency + */ +static int (*set_speed_proc)(int low_speed); +/* + * Some definitions used by the various speedprocs + */ static u32 voltage_gpio; static u32 frequency_gpio; static u32 slew_done_gpio; + #define PMAC_CPU_LOW_SPEED 1 #define PMAC_CPU_HIGH_SPEED 0 @@ -123,9 +134,39 @@ return 0; } +/* Switch CPU speed using DFS */ +static int __pmac dfs_set_cpu_speed(int low_speed) +{ + if (low_speed == 0) { + /* ramping up, set voltage first */ + pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ/1000); + } else { + /* ramping down, enable aack delay first */ + pmac_call_feature(PMAC_FTR_AACK_DELAY_ENABLE, NULL, 1, 0); + } + + /* set frequency */ + low_choose_7447a_dfs(low_speed); + + if (low_speed == 1) { + /* ramping down, set voltage last */ + pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ/1000); + } else { + /* ramping up, disable aack delay last */ + pmac_call_feature(PMAC_FTR_AACK_DELAY_ENABLE, NULL, 0, 0); + } + + return 0; +} + + /* Switch CPU speed using slewing GPIOs */ -static int __pmac gpios_set_cpu_speed(unsigned int low_speed) +static int __pmac gpios_set_cpu_speed(int low_speed) { int gpio; @@ -138,7 +179,8 @@ } /* Set frequency */ - pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, frequency_gpio, low_speed ? 0x04 : 0x05); + pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, frequency_gpio, + low_speed ? 0x04 : 0x05); udelay(200); do { set_current_state(TASK_UNINTERRUPTIBLE); @@ -163,7 +205,7 @@ /* Switch CPU speed under PMU control */ -static int __pmac pmu_set_cpu_speed(unsigned int low_speed) +static int __pmac pmu_set_cpu_speed(int low_speed) { struct adb_request req; unsigned long save_l2cr; @@ -269,12 +311,7 @@ return 0; cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); - if (cpufreq_uses_pmu) - rc = pmu_set_cpu_speed(speed_mode); - else if (cpufreq_uses_gpios) - rc = gpios_set_cpu_speed(speed_mode); - else - rc = cpu_750fx_cpu_speed(speed_mode); + set_speed_proc(speed_mode == PMAC_CPU_LOW_SPEED); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); cur_freq = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq; @@ -338,20 +375,137 @@ }; +static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) +{ + struct device_node *volt_gpio_np = of_find_node_by_name(NULL, + "voltage-gpio"); + struct device_node *freq_gpio_np = of_find_node_by_name(NULL, + "frequency-gpio"); + struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL, + "slewing-done"); + u32 *value; + + /* + * Check to see if it's GPIO driven or PMU only + * + * The way we extract the GPIO address is slightly hackish, but it + * works well enough for now. We need to abstract the whole GPIO + * stuff sooner or later anyway + */ + + if (volt_gpio_np) + voltage_gpio = read_gpio(volt_gpio_np); + if (freq_gpio_np) + frequency_gpio = read_gpio(freq_gpio_np); + if (slew_done_gpio_np) + slew_done_gpio = read_gpio(slew_done_gpio_np); + + /* If we use the frequency GPIOs, calculate the min/max speeds based + * on the bus frequencies + */ + if (frequency_gpio && slew_done_gpio) { + int lenp, rc; + u32 *freqs, *ratio; + + freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp); + lenp /= sizeof(u32); + if (freqs == NULL || lenp != 2) { + printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); + return 1; + } + ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL); + if (ratio == NULL) { + printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); + return 1; + } + + /* Get the min/max bus frequencies */ + low_freq = min(freqs[0], freqs[1]); + hi_freq = max(freqs[0], freqs[1]); + + /* Grrrr.. It _seems_ that the device-tree is lying on the low bus + * frequency, it claims it to be around 84Mhz on some models while + * it appears to be approx. 101Mhz on all. Let's hack around here... + * fortunately, we don't need to be too precise + */ + if (low_freq < 98000000) + low_freq = 101000000; + + /* Convert those to CPU core clocks */ + low_freq = (low_freq * (*ratio)) / 2000; + hi_freq = (hi_freq * (*ratio)) / 2000; + + /* Now we get the frequencies, we read the GPIO to see what is out current + * speed + */ + rc = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, frequency_gpio, 0); + cur_freq = (rc & 0x01) ? hi_freq : low_freq; + + set_speed_proc = gpios_set_cpu_speed; + return 1; + } + + /* If we use the PMU, look for the min & max frequencies in the + * device-tree + */ + value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL); + if (!value) + return 1; + low_freq = (*value) / 1000; + /* The PowerBook G4 12" (PowerBook6,1) has an error in the device-tree + * here */ + if (low_freq < 100000) + low_freq *= 10; + + value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL); + if (!value) + return 1; + hi_freq = (*value) / 1000; + set_speed_proc = pmu_set_cpu_speed; + + return 0; +} + +static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode) +{ + struct device_node *volt_gpio_np; + + /* OF only reports the high frequency */ + hi_freq = cur_freq; + low_freq = cur_freq/2; + if (mfspr(HID1) & HID1_DFS) + cur_freq = low_freq; + else + cur_freq = hi_freq; + + volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); + if (!volt_gpio_np){ + printk(KERN_ERR "cpufreq: missing cpu-vcore-select gpio\n"); + return 1; + } + + u32 *reg = (u32 *)get_property(volt_gpio_np, "reg", NULL); + voltage_gpio = *reg; + set_speed_proc = dfs_set_cpu_speed; + + return 0; +} + /* Currently, we support the following machines: * * - Titanium PowerBook 1Ghz (PMU based, 667Mhz & 1Ghz) * - Titanium PowerBook 800 (PMU based, 667Mhz & 800Mhz) + * - Titanium PowerBook 400 (PMU based, 300Mhz & 400Mhz) * - Titanium PowerBook 500 (PMU based, 300Mhz & 500Mhz) * - iBook2 500 (PMU based, 400Mhz & 500Mhz) * - iBook2 700 (CPU based, 400Mhz & 700Mhz, support low voltage) - * - Recent MacRISC3 machines + * - Recent MacRISC3 laptops + * - iBook G4s and PowerBook G4s with 7447A CPUs */ static int __init pmac_cpufreq_setup(void) { struct device_node *cpunode; u32 *value; - int has_freq_ctl = 0; if (strstr(cmd_line, "nocpufreq")) return 0; @@ -367,113 +521,36 @@ goto out; cur_freq = (*value) / 1000; - /* Check for newer machines */ - if (machine_is_compatible("PowerBook3,4") || - machine_is_compatible("PowerBook3,5") || - machine_is_compatible("MacRISC3")) { - struct device_node *volt_gpio_np = of_find_node_by_name(NULL, "voltage-gpio"); - struct device_node *freq_gpio_np = of_find_node_by_name(NULL, "frequency-gpio"); - struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL, "slewing-done"); - - /* - * Check to see if it's GPIO driven or PMU only - * - * The way we extract the GPIO address is slightly hackish, but it - * works well enough for now. We need to abstract the whole GPIO - * stuff sooner or later anyway - */ - - if (volt_gpio_np) - voltage_gpio = read_gpio(volt_gpio_np); - if (freq_gpio_np) - frequency_gpio = read_gpio(freq_gpio_np); - if (slew_done_gpio_np) - slew_done_gpio = read_gpio(slew_done_gpio_np); - - /* If we use the frequency GPIOs, calculate the min/max speeds based - * on the bus frequencies - */ - if (frequency_gpio && slew_done_gpio) { - int lenp, rc; - u32 *freqs, *ratio; - - freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp); - lenp /= sizeof(u32); - if (freqs == NULL || lenp != 2) { - printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); - goto out; - } - ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL); - if (ratio == NULL) { - printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); - goto out; - } - - /* Get the min/max bus frequencies */ - low_freq = min(freqs[0], freqs[1]); - hi_freq = max(freqs[0], freqs[1]); - - /* Grrrr.. It _seems_ that the device-tree is lying on the low bus - * frequency, it claims it to be around 84Mhz on some models while - * it appears to be approx. 101Mhz on all. Let's hack around here... - * fortunately, we don't need to be too precise - */ - if (low_freq < 98000000) - low_freq = 101000000; - - /* Convert those to CPU core clocks */ - low_freq = (low_freq * (*ratio)) / 2000; - hi_freq = (hi_freq * (*ratio)) / 2000; - - /* Now we get the frequencies, we read the GPIO to see what is out current - * speed - */ - rc = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, frequency_gpio, 0); - cur_freq = (rc & 0x01) ? hi_freq : low_freq; - - has_freq_ctl = 1; - cpufreq_uses_gpios = 1; - goto out; - } - - /* If we use the PMU, look for the min & max frequencies in the - * device-tree - */ - value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL); - if (!value) - goto out; - low_freq = (*value) / 1000; - /* The PowerBook G4 12" (PowerBook6,1) has an error in the device-tree - * here */ - if (low_freq < 100000) - low_freq *= 10; - - value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL); - if (!value) - goto out; - hi_freq = (*value) / 1000; - has_freq_ctl = 1; - cpufreq_uses_pmu = 1; - } + /* Check for 7447A based iBook G4 or PowerBook */ + if (machine_is_compatible("PowerBook6,5") || + machine_is_compatible("PowerBook6,4") || + machine_is_compatible("PowerBook5,5") || + machine_is_compatible("PowerBook5,4")) { + pmac_cpufreq_init_7447A(cpunode); + /* Check for other MacRISC3 machines */ + } else if (machine_is_compatible("PowerBook3,4") || + machine_is_compatible("PowerBook3,5") || + machine_is_compatible("MacRISC3")) { + pmac_cpufreq_init_MacRISC3(cpunode); /* Else check for iBook2 500 */ - else if (machine_is_compatible("PowerBook4,1")) { + } else if (machine_is_compatible("PowerBook4,1")) { /* We only know about 500Mhz model */ if (cur_freq < 450000 || cur_freq > 550000) goto out; hi_freq = cur_freq; low_freq = 400000; - has_freq_ctl = 1; - cpufreq_uses_pmu = 1; + set_speed_proc = pmu_set_cpu_speed; } - /* Else check for TiPb 500 */ + /* Else check for TiPb 400 & 500 */ else if (machine_is_compatible("PowerBook3,2")) { - /* We only know about 500Mhz model */ - if (cur_freq < 450000 || cur_freq > 550000) + /* We only know about the 400 MHz and the 500Mhz model + * they both have 300 MHz as low frequency + */ + if (cur_freq < 350000 || cur_freq > 550000) goto out; hi_freq = cur_freq; low_freq = 300000; - has_freq_ctl = 1; - cpufreq_uses_pmu = 1; + set_speed_proc = pmu_set_cpu_speed; } /* Else check for 750FX */ else if (PVR_VER(mfspr(PVR)) == 0x7000) { @@ -483,21 +560,19 @@ value = (u32 *)get_property(cpunode, "reduced-clock-frequency", NULL); if (!value) goto out; - low_freq = (*value) / 1000; - cpufreq_uses_pmu = 0; - has_freq_ctl = 1; + low_freq = (*value) / 1000; + set_speed_proc = cpu_750fx_cpu_speed; } out: - if (!has_freq_ctl) + if (set_speed_proc == NULL) return -ENODEV; pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq; pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq; printk(KERN_INFO "Registering PowerMac CPU frequency driver\n"); - printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz, switch method: %s\n", - low_freq/1000, hi_freq/1000, cur_freq/1000, - cpufreq_uses_pmu ? "PMU" : (cpufreq_uses_gpios ? "GPIOs" : "CPU")); + printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz\n", + low_freq/1000, hi_freq/1000, cur_freq/1000); return cpufreq_register_driver(&pmac_cpufreq_driver); } diff -Nru a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c --- a/arch/ppc/platforms/pmac_feature.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc/platforms/pmac_feature.c 2004-06-23 19:04:28 -07:00 @@ -1282,6 +1282,25 @@ return 0; } +static long __pmac +intrepid_aack_delay_enable(struct device_node* node, long param, long value) +{ + unsigned long flags; + + if (uninorth_rev < 0xd2) + return -ENODEV; + + LOCK(flags); + if (param) + UN_BIS(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE); + else + UN_BIC(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE); + UNLOCK(flags); + + return 0; +} + + #endif /* CONFIG_POWER4 */ static long __pmac @@ -1914,6 +1933,7 @@ { PMAC_FTR_SLEEP_STATE, core99_sleep_state }, { PMAC_FTR_READ_GPIO, core99_read_gpio }, { PMAC_FTR_WRITE_GPIO, core99_write_gpio }, + { PMAC_FTR_AACK_DELAY_ENABLE, intrepid_aack_delay_enable }, { 0, NULL } }; @@ -2116,6 +2136,14 @@ PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, + { "PowerBook5,4", "PowerBook G4 15\"", + PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, + PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + }, + { "PowerBook5,5", "PowerBook G4 17\"", + PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, + PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + }, { "PowerBook6,1", "PowerBook G4 12\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, @@ -2125,6 +2153,10 @@ PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, { "PowerBook6,3", "iBook G4", + PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, + PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, + }, + { "PowerBook6,4", "PowerBook G4 12\"", PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, }, diff -Nru a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile --- a/arch/ppc/syslib/Makefile 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc/syslib/Makefile 2004-06-23 19:04:25 -07:00 @@ -8,6 +8,9 @@ ifdef CONFIG_4xx EXTRA_AFLAGS := -Wa,-m405 endif +ifdef CONFIG_E500 +EXTRA_AFLAGS := -Wa,-me500 +endif CFLAGS_prom_init.o += -fPIC CFLAGS_btext.o += -fPIC @@ -75,3 +78,7 @@ obj-$(CONFIG_MPC10X_BRIDGE) += mpc10x_common.o indirect_pci.o obj-$(CONFIG_40x) += dcr.o obj-$(CONFIG_BOOKE) += dcr.o +obj-$(CONFIG_85xx) += open_pic.o ppc85xx_common.o ppc85xx_setup.o +ifeq ($(CONFIG_85xx),y) +obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o +endif diff -Nru a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c --- a/arch/ppc/syslib/open_pic.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc/syslib/open_pic.c 2004-06-23 19:04:27 -07:00 @@ -28,7 +28,7 @@ #include "open_pic_defs.h" -#ifdef CONFIG_PRPMC800 +#if defined(CONFIG_PRPMC800) || defined(CONFIG_85xx) #define OPENPIC_BIG_ENDIAN #endif diff -Nru a/arch/ppc/syslib/ppc85xx_common.c b/arch/ppc/syslib/ppc85xx_common.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/syslib/ppc85xx_common.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,46 @@ +/* + * arch/ppc/syslib/ppc85xx_common.c + * + * MPC85xx support routines + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include + +#include +#include +#include + +/* ************************************************************************ */ +/* Return the value of CCSRBAR for the current board */ + +phys_addr_t +get_ccsrbar(void) +{ + return BOARD_CCSRBAR; +} + +/* ************************************************************************ */ +/* Update the 85xx OCP tables paddr field */ +void +mpc85xx_update_paddr_ocp(struct ocp_device *dev, void *arg) +{ + phys_addr_t ccsrbar; + if (arg) { + ccsrbar = *(phys_addr_t *)arg; + dev->def->paddr += ccsrbar; + } +} + +EXPORT_SYMBOL(get_ccsrbar); diff -Nru a/arch/ppc/syslib/ppc85xx_common.h b/arch/ppc/syslib/ppc85xx_common.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/syslib/ppc85xx_common.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,29 @@ +/* + * arch/ppc/syslib/ppc85xx_common.h + * + * MPC85xx support routines + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#ifndef __PPC_SYSLIB_PPC85XX_COMMON_H +#define __PPC_SYSLIB_PPC85XX_COMMON_H + +#include +#include +#include + +/* Provide access to ccsrbar for any modules, etc */ +phys_addr_t get_ccsrbar(void); + +/* Update the 85xx OCP tables paddr field */ +void mpc85xx_update_paddr_ocp(struct ocp_device *dev, void *ccsrbar); + +#endif /* __PPC_SYSLIB_PPC85XX_COMMON_H */ diff -Nru a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/syslib/ppc85xx_setup.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,341 @@ +/* + * arch/ppc/syslib/ppc85xx_setup.c + * + * MPC85XX common board code + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include /* for linux/serial_core.h */ +#include + +#include +#include +#include +#include +#include +#include +#include + +/* Return the amount of memory */ +unsigned long __init +mpc85xx_find_end_of_memory(void) +{ + bd_t *binfo; + + binfo = (bd_t *) __res; + + return binfo->bi_memsize; +} + +/* The decrementer counts at the system (internal) clock freq divided by 8 */ +void __init +mpc85xx_calibrate_decr(void) +{ + bd_t *binfo = (bd_t *) __res; + unsigned int freq, divisor; + + /* get the core frequency */ + freq = binfo->bi_busfreq; + + /* The timebase is updated every 8 bus clocks, HID0[SEL_TBCLK] = 0 */ + divisor = 8; + tb_ticks_per_jiffy = freq / divisor / HZ; + tb_to_us = mulhwu_scale_factor(freq / divisor, 1000000); + + /* Set the time base to zero */ + mtspr(SPRN_TBWL, 0); + mtspr(SPRN_TBWU, 0); + + /* Clear any pending timer interrupts */ + mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); + + /* Enable decrementer interrupt */ + mtspr(SPRN_TCR, TCR_DIE); +} + +#ifdef CONFIG_SERIAL_8250 +void __init +mpc85xx_early_serial_map(void) +{ + struct uart_port serial_req; + bd_t *binfo = (bd_t *) __res; + phys_addr_t duart_paddr = binfo->bi_immr_base + MPC85xx_UART0_OFFSET; + + /* Setup serial port access */ + memset(&serial_req, 0, sizeof (serial_req)); + serial_req.uartclk = binfo->bi_busfreq; + serial_req.line = 0; + serial_req.irq = MPC85xx_IRQ_DUART; + serial_req.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; + serial_req.iotype = SERIAL_IO_MEM; + serial_req.membase = ioremap(duart_paddr, MPC85xx_UART0_SIZE); + serial_req.mapbase = duart_paddr; + serial_req.regshift = 0; + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + gen550_init(0, &serial_req); +#endif + + if (early_serial_setup(&serial_req) != 0) + printk("Early serial init of port 0 failed\n"); + + /* Assume early_serial_setup() doesn't modify serial_req */ + duart_paddr = binfo->bi_immr_base + MPC85xx_UART1_OFFSET; + serial_req.line = 1; + serial_req.mapbase = duart_paddr; + serial_req.membase = ioremap(duart_paddr, MPC85xx_UART1_SIZE); + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + gen550_init(1, &serial_req); +#endif + + if (early_serial_setup(&serial_req) != 0) + printk("Early serial init of port 1 failed\n"); +} +#endif + +void +mpc85xx_restart(char *cmd) +{ + local_irq_disable(); + abort(); +} + +void +mpc85xx_power_off(void) +{ + local_irq_disable(); + for(;;); +} + +void +mpc85xx_halt(void) +{ + local_irq_disable(); + for(;;); +} + +#ifdef CONFIG_PCI +static void __init +mpc85xx_setup_pci1(struct pci_controller *hose) +{ + volatile struct ccsr_pci *pci; + volatile struct ccsr_guts *guts; + unsigned short temps; + bd_t *binfo = (bd_t *) __res; + + pci = ioremap(binfo->bi_immr_base + MPC85xx_PCI1_OFFSET, + MPC85xx_PCI1_SIZE); + + guts = ioremap(binfo->bi_immr_base + MPC85xx_GUTS_OFFSET, + MPC85xx_GUTS_SIZE); + + early_read_config_word(hose, 0, 0, PCI_COMMAND, &temps); + temps |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY; + early_write_config_word(hose, 0, 0, PCI_COMMAND, temps); + +#define PORDEVSR_PCI (0x00800000) /* PCI Mode */ + if (guts->pordevsr & PORDEVSR_PCI) { + early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0x80); + } else { + /* PCI-X init */ + temps = PCI_X_CMD_MAX_SPLIT | PCI_X_CMD_MAX_READ + | PCI_X_CMD_ERO | PCI_X_CMD_DPERR_E; + early_write_config_word(hose, 0, 0, PCIX_COMMAND, temps); + } + + /* Disable all windows (except powar0 since its ignored) */ + pci->powar1 = 0; + pci->powar2 = 0; + pci->powar3 = 0; + pci->powar4 = 0; + pci->piwar1 = 0; + pci->piwar2 = 0; + pci->piwar3 = 0; + + /* Setup 512M Phys:PCI 1:1 outbound mem window @ 0x80000000 */ + pci->potar1 = (MPC85XX_PCI1_LOWER_MEM >> 12) & 0x000fffff; + pci->potear1 = 0x00000000; + pci->powbar1 = (MPC85XX_PCI1_LOWER_MEM >> 12) & 0x000fffff; + pci->powar1 = 0x8004401c; /* Enable, Mem R/W, 512M */ + + /* Setup 16M outboud IO windows @ 0xe2000000 */ + pci->potar2 = 0x00000000; + pci->potear2 = 0x00000000; + pci->powbar2 = (MPC85XX_PCI1_IO_BASE >> 12) & 0x000fffff; + pci->powar2 = 0x80088017; /* Enable, IO R/W, 16M */ + + /* Setup 2G inbound Memory Window @ 0 */ + pci->pitar1 = 0x00000000; + pci->piwbar1 = 0x00000000; + pci->piwar1 = 0xa0f5501e; /* Enable, Prefetch, Local + Mem, Snoop R/W, 2G */ +} + + +extern int mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin); +extern int mpc85xx_exclude_device(u_char bus, u_char devfn); + +#if CONFIG_85xx_PCI2 +static void __init +mpc85xx_setup_pci2(struct pci_controller *hose) +{ + volatile struct ccsr_pci *pci; + unsigned short temps; + bd_t *binfo = (bd_t *) __res; + + pci = ioremap(binfo->bi_immr_base + MPC85xx_PCI2_OFFSET, + MPC85xx_PCI2_SIZE); + + early_read_config_word(hose, 0, 0, PCI_COMMAND, &temps); + temps |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY; + early_write_config_word(hose, 0, 0, PCI_COMMAND, temps); + early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0x80); + + /* Disable all windows (except powar0 since its ignored) */ + pci->powar1 = 0; + pci->powar2 = 0; + pci->powar3 = 0; + pci->powar4 = 0; + pci->piwar1 = 0; + pci->piwar2 = 0; + pci->piwar3 = 0; + + /* Setup 512M Phys:PCI 1:1 outbound mem window @ 0xa0000000 */ + pci->potar1 = (MPC85XX_PCI2_LOWER_MEM >> 12) & 0x000fffff; + pci->potear1 = 0x00000000; + pci->powbar1 = (MPC85XX_PCI2_LOWER_MEM >> 12) & 0x000fffff; + pci->powar1 = 0x8004401c; /* Enable, Mem R/W, 512M */ + + /* Setup 16M outboud IO windows @ 0xe3000000 */ + pci->potar2 = 0x00000000; + pci->potear2 = 0x00000000; + pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff; + pci->powar2 = 0x80088017; /* Enable, IO R/W, 16M */ + + /* Setup 2G inbound Memory Window @ 0 */ + pci->pitar1 = 0x00000000; + pci->piwbar1 = 0x00000000; + pci->piwar1 = 0xa0f5501e; /* Enable, Prefetch, Local + Mem, Snoop R/W, 2G */ +} +#endif /* CONFIG_85xx_PCI2 */ + +void __init +mpc85xx_setup_hose(void) +{ + struct pci_controller *hose_a; +#ifdef CONFIG_85xx_PCI2 + struct pci_controller *hose_b; +#endif + bd_t *binfo = (bd_t *) __res; + + hose_a = pcibios_alloc_controller(); + + if (!hose_a) + return; + + ppc_md.pci_swizzle = common_swizzle; + ppc_md.pci_map_irq = mpc85xx_map_irq; + + hose_a->first_busno = 0; + hose_a->bus_offset = 0; + hose_a->last_busno = 0xff; + + setup_indirect_pci(hose_a, binfo->bi_immr_base + PCI1_CFG_ADDR_OFFSET, + binfo->bi_immr_base + PCI1_CFG_DATA_OFFSET); + hose_a->set_cfg_type = 1; + + mpc85xx_setup_pci1(hose_a); + + hose_a->pci_mem_offset = MPC85XX_PCI1_MEM_OFFSET; + hose_a->mem_space.start = MPC85XX_PCI1_LOWER_MEM; + hose_a->mem_space.end = MPC85XX_PCI1_UPPER_MEM; + + hose_a->io_space.start = MPC85XX_PCI1_LOWER_IO; + hose_a->io_space.end = MPC85XX_PCI1_UPPER_IO; + hose_a->io_base_phys = MPC85XX_PCI1_IO_BASE; +#if CONFIG_85xx_PCI2 + isa_io_base = + (unsigned long) ioremap(MPC85XX_PCI1_IO_BASE, + MPC85XX_PCI1_IO_SIZE + + MPC85XX_PCI2_IO_SIZE); +#else + isa_io_base = + (unsigned long) ioremap(MPC85XX_PCI1_IO_BASE, + MPC85XX_PCI1_IO_SIZE); +#endif + hose_a->io_base_virt = (void *) isa_io_base; + + /* setup resources */ + pci_init_resource(&hose_a->mem_resources[0], + MPC85XX_PCI1_LOWER_MEM, + MPC85XX_PCI1_UPPER_MEM, + IORESOURCE_MEM, "PCI1 host bridge"); + + pci_init_resource(&hose_a->io_resource, + MPC85XX_PCI1_LOWER_IO, + MPC85XX_PCI1_UPPER_IO, + IORESOURCE_IO, "PCI1 host bridge"); + + ppc_md.pci_exclude_device = mpc85xx_exclude_device; + + hose_a->last_busno = pciauto_bus_scan(hose_a, hose_a->first_busno); + +#if CONFIG_85xx_PCI2 + hose_b = pcibios_alloc_controller(); + + if (!hose_b) + return; + + hose_b->bus_offset = hose_a->last_busno + 1; + hose_b->first_busno = hose_a->last_busno + 1; + hose_b->last_busno = 0xff; + + setup_indirect_pci(hose_b, binfo->bi_immr_base + PCI2_CFG_ADDR_OFFSET, + binfo->bi_immr_base + PCI2_CFG_DATA_OFFSET); + hose_b->set_cfg_type = 1; + + mpc85xx_setup_pci2(hose_b); + + hose_b->pci_mem_offset = MPC85XX_PCI2_MEM_OFFSET; + hose_b->mem_space.start = MPC85XX_PCI2_LOWER_MEM; + hose_b->mem_space.end = MPC85XX_PCI2_UPPER_MEM; + + hose_b->io_space.start = MPC85XX_PCI2_LOWER_IO; + hose_b->io_space.end = MPC85XX_PCI2_UPPER_IO; + hose_b->io_base_phys = MPC85XX_PCI2_IO_BASE; + hose_b->io_base_virt = (void *) isa_io_base + MPC85XX_PCI1_IO_SIZE; + + /* setup resources */ + pci_init_resource(&hose_b->mem_resources[0], + MPC85XX_PCI2_LOWER_MEM, + MPC85XX_PCI2_UPPER_MEM, + IORESOURCE_MEM, "PCI2 host bridge"); + + pci_init_resource(&hose_b->io_resource, + MPC85XX_PCI2_LOWER_IO, + MPC85XX_PCI2_UPPER_IO, + IORESOURCE_IO, "PCI2 host bridge"); + + hose_b->last_busno = pciauto_bus_scan(hose_b, hose_b->first_busno); +#endif + return; +} +#endif /* CONFIG_PCI */ + + diff -Nru a/arch/ppc/syslib/ppc85xx_setup.h b/arch/ppc/syslib/ppc85xx_setup.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/syslib/ppc85xx_setup.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,67 @@ +/* + * arch/ppc/syslib/ppc85xx_setup.h + * + * MPC85XX common board definitions + * + * Maintainer: Kumar Gala + * + * Copyright 2004 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#ifndef __PPC_SYSLIB_PPC85XX_SETUP_H +#define __PPC_SYSLIB_PPC85XX_SETUP_H + +#include +#include +#include +#include + +extern unsigned long mpc85xx_find_end_of_memory(void) __init; +extern void mpc85xx_calibrate_decr(void) __init; +extern void mpc85xx_early_serial_map(void) __init; +extern void mpc85xx_restart(char *cmd); +extern void mpc85xx_power_off(void); +extern void mpc85xx_halt(void); +extern void mpc85xx_setup_hose(void) __init; + +/* PCI config */ +#define PCI1_CFG_ADDR_OFFSET (0x8000) +#define PCI1_CFG_DATA_OFFSET (0x8004) + +#define PCI2_CFG_ADDR_OFFSET (0x9000) +#define PCI2_CFG_DATA_OFFSET (0x9004) + +/* Additional register for PCI-X configuration */ +#define PCIX_NEXT_CAP 0x60 +#define PCIX_CAP_ID 0x61 +#define PCIX_COMMAND 0x62 +#define PCIX_STATUS 0x64 + +/* Serial Config */ +#define MPC85XX_0_SERIAL (CCSRBAR + 0x4500) +#define MPC85XX_1_SERIAL (CCSRBAR + 0x4600) + +#ifdef CONFIG_SERIAL_MANY_PORTS +#define RS_TABLE_SIZE 64 +#else +#define RS_TABLE_SIZE 2 +#endif + +#define BASE_BAUD 0 + +#define STD_UART_OP(num) \ + { 0, BASE_BAUD, num, MPC85xx_IRQ_DUART, \ + (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ + iomem_base: (u8 *)MPC85XX_##num##_SERIAL, \ + io_type: SERIAL_IO_MEM}, + +/* Offset of CPM register space */ +#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET) + +#endif /* __PPC_SYSLIB_PPC85XX_SETUP_H */ diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig --- a/arch/ppc64/Kconfig 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/Kconfig 2004-06-23 19:04:27 -07:00 @@ -198,7 +198,6 @@ config PREEMPT bool "Preemptible Kernel" - depends on BROKEN help This option reduces the latency of the kernel when reacting to real-time or interactive events by allowing a low priority process to diff -Nru a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile --- a/arch/ppc64/kernel/Makefile 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/kernel/Makefile 2004-06-23 19:04:28 -07:00 @@ -56,4 +56,6 @@ obj-$(CONFIG_PPC_PMAC) += pmac_smp.o smp-tbsync.o endif +obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o + CFLAGS_ioctl32.o += -Ifs/ diff -Nru a/arch/ppc64/kernel/align.c b/arch/ppc64/kernel/align.c --- a/arch/ppc64/kernel/align.c 2004-06-23 19:04:29 -07:00 +++ b/arch/ppc64/kernel/align.c 2004-06-23 19:04:29 -07:00 @@ -22,8 +22,6 @@ #include #include -void disable_kernel_fp(void); /* asm function from head.S */ - struct aligninfo { unsigned char len; unsigned char flags; @@ -280,8 +278,11 @@ } /* Force the fprs into the save area so we can reference them */ - if ((flags & F) && (regs->msr & MSR_FP)) - giveup_fpu(current); + if (flags & F) { + if (!user_mode(regs)) + return 0; + flush_fp_to_thread(current); + } /* If we are loading, get the data from user space */ if (flags & LD) { @@ -310,9 +311,11 @@ if (flags & F) { if (nb == 4) { /* Doing stfs, have to convert to single */ + preempt_disable(); enable_kernel_fp(); cvt_df(¤t->thread.fpr[reg], (float *)&data.v[4], ¤t->thread.fpscr); disable_kernel_fp(); + preempt_enable(); } else data.dd = current->thread.fpr[reg]; @@ -344,9 +347,11 @@ if (flags & F) { if (nb == 4) { /* Doing lfs, have to convert to double */ + preempt_disable(); enable_kernel_fp(); cvt_fd((float *)&data.v[4], ¤t->thread.fpr[reg], ¤t->thread.fpscr); disable_kernel_fp(); + preempt_enable(); } else current->thread.fpr[reg] = data.dd; diff -Nru a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c --- a/arch/ppc64/kernel/asm-offsets.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/kernel/asm-offsets.c 2004-06-23 19:04:27 -07:00 @@ -48,6 +48,8 @@ DEFINE(THREAD_SHIFT, THREAD_SHIFT); DEFINE(THREAD_SIZE, THREAD_SIZE); DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); + DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror)); /* task_struct->thread */ DEFINE(THREAD, offsetof(struct task_struct, thread)); @@ -99,7 +101,10 @@ DEFINE(PACALPPACA, offsetof(struct paca_struct, xLpPaca)); DEFINE(LPPACA, offsetof(struct paca_struct, xLpPaca)); DEFINE(PACAREGSAV, offsetof(struct paca_struct, xRegSav)); - DEFINE(PACAEXC, offsetof(struct paca_struct, exception_stack)); + DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen)); + DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); + DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); + DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi)); DEFINE(PACAGUARD, offsetof(struct paca_struct, guard)); DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0)); DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1)); @@ -136,6 +141,10 @@ DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7])); DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8])); DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9])); + DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10])); + DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11])); + DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12])); + DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13])); DEFINE(GPR20, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[20])); DEFINE(GPR21, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[21])); DEFINE(GPR22, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[22])); @@ -154,7 +163,7 @@ DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr)); DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3)); DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result)); - DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); + DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap)); DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe)); /* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */ diff -Nru a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S --- a/arch/ppc64/kernel/entry.S 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc64/kernel/entry.S 2004-06-23 19:04:25 -07:00 @@ -35,15 +35,9 @@ #define DO_SOFT_DISABLE #endif -#undef SHOW_SYSCALLS -#undef SHOW_SYSCALLS_TASK - -#ifdef SHOW_SYSCALLS_TASK - .data -show_syscalls_task: - .long -1 -#endif - +/* + * System calls. + */ .section ".toc","aw" .SYS_CALL_TABLE: .tc .sys_call_table[TC],.sys_call_table @@ -51,107 +45,175 @@ .SYS_CALL_TABLE32: .tc .sys_call_table32[TC],.sys_call_table32 +/* This value is used to mark exception frames on the stack. */ +exception_marker: + .tc ID_72656773_68657265[TC],0x7265677368657265 + .section ".text" - .align 3 + .align 7 -/* - * Handle a system call. - */ -_GLOBAL(DoSyscall) +#undef SHOW_SYSCALLS + + .globl SystemCall_common +SystemCall_common: + andi. r10,r12,MSR_PR + mr r10,r1 + addi r1,r1,-INT_FRAME_SIZE + beq- 1f + ld r1,PACAKSAVE(r13) +1: std r10,0(r1) + std r11,_NIP(r1) + std r12,_MSR(r1) + std r0,GPR0(r1) + std r10,GPR1(r1) + std r2,GPR2(r1) + std r3,GPR3(r1) + std r4,GPR4(r1) + std r5,GPR5(r1) + std r6,GPR6(r1) + std r7,GPR7(r1) + std r8,GPR8(r1) + li r11,0 + std r11,GPR9(r1) + std r11,GPR10(r1) + std r11,GPR11(r1) + std r11,GPR12(r1) + std r9,GPR13(r1) + crclr so + mfcr r9 + mflr r10 + li r11,0xc01 + std r9,_CCR(r1) + std r10,_LINK(r1) + std r11,_TRAP(r1) + mfxer r9 + mfctr r10 + std r9,_XER(r1) + std r10,_CTR(r1) std r3,ORIG_GPR3(r1) - ld r11,_CCR(r1) /* Clear SO bit in CR */ - lis r10,0x1000 - andc r11,r11,r10 - std r11,_CCR(r1) + ld r2,PACATOC(r13) + addi r9,r1,STACK_FRAME_OVERHEAD + ld r11,exception_marker@toc(r2) + std r11,-16(r9) /* "regshere" marker */ +#ifdef CONFIG_PPC_ISERIES + /* Hack for handling interrupts when soft-enabling on iSeries */ + cmpdi cr1,r0,0x5555 /* syscall 0x5555 */ + andi. r10,r12,MSR_PR /* from kernel */ + crand 4*cr0+eq,4*cr1+eq,4*cr0+eq + beq HardwareInterrupt_entry + lbz r10,PACAPROCENABLED(r13) + std r10,SOFTE(r1) +#endif + mfmsr r11 + ori r11,r11,MSR_EE + mtmsrd r11,1 + #ifdef SHOW_SYSCALLS -#ifdef SHOW_SYSCALLS_TASK - LOADBASE(r31,show_syscalls_task) - ld r31,show_syscalls_task@l(r31) - ld r10,PACACURRENT(r13) - cmp 0,r10,r31 - bne 1f + bl .do_show_syscall + REST_GPR(0,r1) + REST_4GPRS(3,r1) + REST_2GPRS(7,r1) + addi r9,r1,STACK_FRAME_OVERHEAD #endif - LOADADDR(r3,7f) - ld r4,GPR0(r1) - ld r5,GPR3(r1) - ld r6,GPR4(r1) - ld r7,GPR5(r1) - ld r8,GPR6(r1) - ld r9,GPR7(r1) - bl .printk - LOADADDR(r3,77f) - ld r4,GPR8(r1) - ld r5,GPR9(r1) - ld r6, PACACURRENT(r13) - bl .printk - ld r0,GPR0(r1) - ld r3,GPR3(r1) - ld r4,GPR4(r1) - ld r5,GPR5(r1) - ld r6,GPR6(r1) - ld r7,GPR7(r1) - ld r8,GPR8(r1) -1: -#endif /* SHOW_SYSCALLS */ - clrrdi r10,r1,THREAD_SHIFT - ld r10,TI_FLAGS(r10) + clrrdi r11,r1,THREAD_SHIFT + li r12,0 + ld r10,TI_FLAGS(r11) + stb r12,TI_SC_NOERR(r11) andi. r11,r10,_TIF_SYSCALL_T_OR_A - bne- 50f + bne- syscall_dotrace +syscall_dotrace_cont: cmpli 0,r0,NR_syscalls - bge- 66f + bge- syscall_enosys + +system_call: /* label this so stack traces look sane */ /* * Need to vector to 32 Bit or default sys_call_table here, * based on caller's run-mode / personality. */ - andi. r11,r10,_TIF_32BIT + ld r11,.SYS_CALL_TABLE@toc(2) + andi. r10,r10,_TIF_32BIT beq- 15f - ld r10,.SYS_CALL_TABLE32@toc(2) -/* - * We now zero extend all six arguments (r3 - r8), the compatibility - * layer assumes this. - */ + ld r11,.SYS_CALL_TABLE32@toc(2) clrldi r3,r3,32 clrldi r4,r4,32 clrldi r5,r5,32 clrldi r6,r6,32 clrldi r7,r7,32 clrldi r8,r8,32 - b 17f 15: - ld r10,.SYS_CALL_TABLE@toc(2) -17: slwi r0,r0,3 - ldx r10,r10,r0 /* Fetch system call handler [ptr] */ + slwi r0,r0,3 + ldx r10,r11,r0 /* Fetch system call handler [ptr] */ mtlr r10 - addi r9,r1,STACK_FRAME_OVERHEAD blrl /* Call handler */ -_GLOBAL(ret_from_syscall_1) - std r3,RESULT(r1) /* Save result */ + +syscall_exit: #ifdef SHOW_SYSCALLS -#ifdef SHOW_SYSCALLS_TASK - ld r10, PACACURRENT(13) - cmp 0,r10,r31 - bne 91f -#endif - mr r4,r3 - LOADADDR(r3,79f) - bl .printk - ld r3,RESULT(r1) -91: + std r3,GPR3(r1) + bl .do_show_syscall_exit + ld r3,GPR3(r1) #endif + std r3,RESULT(r1) + ld r5,_CCR(r1) li r10,-_LAST_ERRNO - cmpld 0,r3,r10 - blt 30f + cmpld r3,r10 + clrrdi r12,r1,THREAD_SHIFT + bge- syscall_error +syscall_error_cont: + + /* check for syscall tracing or audit */ + ld r9,TI_FLAGS(r12) + andi. r0,r9,_TIF_SYSCALL_T_OR_A + bne- syscall_exit_trace +syscall_exit_trace_cont: + + /* disable interrupts so current_thread_info()->flags can't change, + and so that we don't get interrupted after loading SRR0/1. */ + ld r8,_MSR(r1) + andi. r10,r8,MSR_RI + beq- unrecov_restore + mfmsr r10 + rldicl r10,r10,48,1 + rotldi r10,r10,16 + mtmsrd r10,1 + ld r9,TI_FLAGS(r12) + andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED) + bne- syscall_exit_work + ld r7,_NIP(r1) + stdcx. r0,0,r1 /* to clear the reservation */ + andi. r6,r8,MSR_PR + ld r4,_LINK(r1) + beq 1f /* only restore r13 if */ + ld r13,GPR13(r1) /* returning to usermode */ +1: ld r2,GPR2(r1) + ld r1,GPR1(r1) + li r12,MSR_RI + andc r10,r10,r12 + mtmsrd r10,1 /* clear MSR.RI */ + mtlr r4 + mtcr r5 + mtspr SRR0,r7 + mtspr SRR1,r8 + rfid + +syscall_enosys: + li r3,-ENOSYS + std r3,RESULT(r1) + clrrdi r12,r1,THREAD_SHIFT + ld r5,_CCR(r1) + +syscall_error: + lbz r11,TI_SC_NOERR(r12) + cmpi 0,r11,0 + bne- syscall_error_cont neg r3,r3 -22: ld r10,_CCR(r1) /* Set SO bit in CR */ - oris r10,r10,0x1000 - std r10,_CCR(r1) -30: std r3,GPR3(r1) /* Update return value */ - b .ret_from_except -66: li r3,ENOSYS - b 22b + oris r5,r5,0x1000 /* Set SO bit in CR */ + std r5,_CCR(r1) + b syscall_error_cont /* Traced system call support */ -50: addi r3,r1,STACK_FRAME_OVERHEAD +syscall_dotrace: + bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD bl .do_syscall_trace_enter ld r0,GPR0(r1) /* Restore original registers */ ld r3,GPR3(r1) @@ -160,65 +222,82 @@ ld r6,GPR6(r1) ld r7,GPR7(r1) ld r8,GPR8(r1) - /* XXX check this - Anton */ - ld r9,GPR9(r1) - cmpli 0,r0,NR_syscalls - bge- 66f -/* - * Need to vector to 32 Bit or default sys_call_table here, - * based on caller's run-mode / personality. - */ + addi r9,r1,STACK_FRAME_OVERHEAD clrrdi r10,r1,THREAD_SHIFT ld r10,TI_FLAGS(r10) - andi. r11,r10,_TIF_32BIT - beq- 55f - ld r10,.SYS_CALL_TABLE32@toc(2) + b syscall_dotrace_cont + +syscall_exit_trace: + std r3,GPR3(r1) + bl .save_nvgprs + bl .do_syscall_trace_leave + REST_NVGPRS(r1) + ld r3,GPR3(r1) + ld r5,_CCR(r1) + clrrdi r12,r1,THREAD_SHIFT + b syscall_exit_trace_cont + +/* Stuff to do on exit from a system call. */ +syscall_exit_work: + std r3,GPR3(r1) + std r5,_CCR(r1) + b .ret_from_except_lite + +/* Save non-volatile GPRs, if not already saved. */ +_GLOBAL(save_nvgprs) + ld r11,_TRAP(r1) + andi. r0,r11,1 + beqlr- + SAVE_NVGPRS(r1) + clrrdi r0,r11,1 + std r0,_TRAP(r1) + blr + /* - * We now zero extend all six arguments (r3 - r8), the compatibility - * layer assumes this. + * The sigsuspend and rt_sigsuspend system calls can call do_signal + * and thus put the process into the stopped state where we might + * want to examine its user state with ptrace. Therefore we need + * to save all the nonvolatile registers (r14 - r31) before calling + * the C code. Similarly, fork, vfork and clone need the full + * register state on the stack so that it can be copied to the child. */ - clrldi r3,r3,32 - clrldi r4,r4,32 - clrldi r5,r5,32 - clrldi r6,r6,32 - clrldi r7,r7,32 - clrldi r8,r8,32 - b 57f -55: - ld r10,.SYS_CALL_TABLE@toc(2) -57: - slwi r0,r0,3 - ldx r10,r10,r0 /* Fetch system call handler [ptr] */ - mtlr r10 - addi r9,r1,STACK_FRAME_OVERHEAD - blrl /* Call handler */ -_GLOBAL(ret_from_syscall_2) - std r3,RESULT(r1) /* Save result */ - li r10,-_LAST_ERRNO - cmpld 0,r3,r10 - blt 60f - neg r3,r3 -57: ld r10,_CCR(r1) /* Set SO bit in CR */ - oris r10,r10,0x1000 - std r10,_CCR(r1) -60: std r3,GPR3(r1) /* Update return value */ - bl .do_syscall_trace_leave - b .ret_from_except -66: li r3,ENOSYS - b 57b -#ifdef SHOW_SYSCALLS -7: .string "syscall %d(%x, %x, %x, %x, %x, " -77: .string "%x, %x), current=%p\n" -79: .string " -> %x\n" - .align 2,0 -#endif +_GLOBAL(ppc32_sigsuspend) + bl .save_nvgprs + bl .sys32_sigsuspend + b syscall_exit + +_GLOBAL(ppc64_rt_sigsuspend) + bl .save_nvgprs + bl .sys_rt_sigsuspend + b syscall_exit + +_GLOBAL(ppc32_rt_sigsuspend) + bl .save_nvgprs + bl .sys32_rt_sigsuspend + b syscall_exit + +_GLOBAL(ppc_fork) + bl .save_nvgprs + bl .sys_fork + b syscall_exit + +_GLOBAL(ppc_vfork) + bl .save_nvgprs + bl .sys_vfork + b syscall_exit + +_GLOBAL(ppc_clone) + bl .save_nvgprs + bl .sys_clone + b syscall_exit - _GLOBAL(ppc32_swapcontext) + bl .save_nvgprs bl .sys32_swapcontext b 80f _GLOBAL(ppc64_swapcontext) + bl .save_nvgprs bl .sys_swapcontext b 80f @@ -233,17 +312,20 @@ _GLOBAL(ppc64_rt_sigreturn) bl .sys_rt_sigreturn -80: clrrdi r4,r1,THREAD_SHIFT +80: cmpdi 0,r3,0 + blt syscall_exit + clrrdi r4,r1,THREAD_SHIFT ld r4,TI_FLAGS(r4) andi. r4,r4,_TIF_SYSCALL_T_OR_A - bne- 81f - cmpi 0,r3,0 - bge .ret_from_except - b .ret_from_syscall_1 -81: cmpi 0,r3,0 - blt .ret_from_syscall_2 + beq+ 81f bl .do_syscall_trace_leave - b .ret_from_except +81: b .ret_from_except + +_GLOBAL(ret_from_fork) + bl .schedule_tail + REST_NVGPRS(r1) + li r3,0 + b syscall_exit /* * This routine switches between two different tasks. The process @@ -263,6 +345,7 @@ * The code which creates the new task context is in 'copy_thread' * in arch/ppc64/kernel/process.c */ + .align 7 _GLOBAL(_switch) mflr r0 std r0,16(r1) @@ -315,7 +398,10 @@ 2: END_FTR_SECTION_IFSET(CPU_FTR_SLB) clrrdi r7,r8,THREAD_SHIFT /* base of new stack */ - addi r7,r7,THREAD_SIZE-INT_FRAME_SIZE + /* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE + because we don't need to leave the 288-byte ABI gap at the + top of the kernel stack. */ + addi r7,r7,THREAD_SIZE-SWITCH_FRAME_SIZE mr r1,r8 /* start using new stack pointer */ std r7,PACAKSAVE(r13) @@ -350,60 +436,56 @@ addi r1,r1,SWITCH_FRAME_SIZE blr -_GLOBAL(ret_from_fork) - bl .schedule_tail - clrrdi r4,r1,THREAD_SHIFT - ld r4,TI_FLAGS(r4) - andi. r4,r4,_TIF_SYSCALL_T_OR_A - beq+ .ret_from_except - bl .do_syscall_trace_leave - b .ret_from_except - + .align 7 _GLOBAL(ret_from_except) + ld r11,_TRAP(r1) + andi. r0,r11,1 + bne .ret_from_except_lite + REST_NVGPRS(r1) + +_GLOBAL(ret_from_except_lite) /* * Disable interrupts so that current_thread_info()->flags * can't change between when we test it and when we return * from the interrupt. */ mfmsr r10 /* Get current interrupt state */ - li r4,0 - ori r4,r4,MSR_EE - andc r9,r10,r4 /* clear MSR_EE */ + rldicl r9,r10,48,1 /* clear MSR_EE */ + rotldi r9,r9,16 mtmsrd r9,1 /* Update machine state */ +#ifdef CONFIG_PREEMPT + clrrdi r9,r1,THREAD_SHIFT /* current_thread_info() */ + li r0,_TIF_NEED_RESCHED /* bits to check */ + ld r3,_MSR(r1) + ld r4,TI_FLAGS(r9) + /* Move MSR_PR bit in r3 to _TIF_SIGPENDING position in r0 */ + rlwimi r0,r3,32+TIF_SIGPENDING-MSR_PR_LG,_TIF_SIGPENDING + and. r0,r4,r0 /* check NEED_RESCHED and maybe SIGPENDING */ + bne do_work + +#else /* !CONFIG_PREEMPT */ ld r3,_MSR(r1) /* Returning to user mode? */ andi. r3,r3,MSR_PR beq restore /* if not, just restore regs and return */ /* Check current_thread_info()->flags */ - clrrdi r3,r1,THREAD_SHIFT - ld r3,TI_FLAGS(r3) - andi. r0,r3,_TIF_USER_WORK_MASK + clrrdi r9,r1,THREAD_SHIFT + ld r4,TI_FLAGS(r9) + andi. r0,r4,_TIF_USER_WORK_MASK bne do_work - - addi r0,r1,INT_FRAME_SIZE /* size of frame */ - ld r4,PACACURRENT(r13) - std r0,THREAD+KSP(r4) /* save kernel stack pointer */ - - /* - * r13 is our per cpu area, only restore it if we are returning to - * userspace - */ - REST_GPR(13,r1) +#endif restore: #ifdef CONFIG_PPC_ISERIES ld r5,SOFTE(r1) - mfspr r4,SPRG3 /* get paca address */ cmpdi 0,r5,0 beq 4f /* Check for pending interrupts (iSeries) */ - /* this is CHECKANYINT except that we already have the paca address */ - ld r3,PACALPPACA+LPPACAANYINT(r4) + ld r3,PACALPPACA+LPPACAANYINT(r13) cmpdi r3,0 beq+ 4f /* skip do_IRQ if no interrupts */ - mfspr r13,SPRG3 /* get paca pointer back */ li r3,0 stb r3,PACAPROCENABLED(r13) /* ensure we are soft-disabled */ mtmsrd r10 /* hard-enable again */ @@ -411,13 +493,22 @@ bl .do_IRQ b .ret_from_except /* loop back and handle more */ -4: stb r5,PACAPROCENABLED(r4) +4: stb r5,PACAPROCENABLED(r13) #endif ld r3,_MSR(r1) - andi. r3,r3,MSR_RI + andi. r0,r3,MSR_RI beq- unrecov_restore + andi. r0,r3,MSR_PR + + /* + * r13 is our per cpu area, only restore it if we are returning to + * userspace + */ + beq 1f + REST_GPR(13, r1) +1: ld r3,_CTR(r1) ld r0,_LINK(r1) mtctr r3 @@ -426,8 +517,6 @@ mtspr XER,r3 REST_8GPRS(5, r1) - REST_10GPRS(14, r1) - REST_8GPRS(24, r1) stdcx. r0,0,r1 /* to clear the reservation */ @@ -451,26 +540,62 @@ ld r1,GPR1(r1) rfid + b . -/* Note: this must change if we start using the TIF_NOTIFY_RESUME bit */ +/* Note: this must change if we start using the TIF_NOTIFY_RESUME bit */ do_work: +#ifdef CONFIG_PREEMPT + andi. r0,r3,MSR_PR /* Returning to user mode? */ + bne user_work + /* Check that preempt_count() == 0 and interrupts are enabled */ + lwz r8,TI_PREEMPT(r9) + cmpwi cr1,r8,0 +#ifdef CONFIG_PPC_ISERIES + ld r0,SOFTE(r1) + cmpdi r0,0 +#else + andi. r0,r3,MSR_EE +#endif + crandc eq,cr1*4+eq,eq + bne restore + /* here we are preempting the current task */ +1: lis r0,PREEMPT_ACTIVE@h + stw r0,TI_PREEMPT(r9) +#ifdef CONFIG_PPC_ISERIES + li r0,1 + stb r0,PACAPROCENABLED(r13) +#endif + mtmsrd r10,1 /* reenable interrupts */ + bl .schedule + mfmsr r10 + clrrdi r9,r1,THREAD_SHIFT + rldicl r10,r10,48,1 /* disable interrupts again */ + li r0,0 + rotldi r10,r10,16 + mtmsrd r10,1 + ld r4,TI_FLAGS(r9) + andi. r0,r4,_TIF_NEED_RESCHED + bne 1b + stw r0,TI_PREEMPT(r9) + b restore + +user_work: +#endif /* Enable interrupts */ mtmsrd r10,1 - andi. r0,r3,_TIF_NEED_RESCHED + andi. r0,r4,_TIF_NEED_RESCHED beq 1f bl .schedule - b .ret_from_except + b .ret_from_except_lite -1: andi. r0,r3,_TIF_SIGPENDING - beq .ret_from_except +1: bl .save_nvgprs li r3,0 addi r4,r1,STACK_FRAME_OVERHEAD bl .do_signal b .ret_from_except unrecov_restore: - mfspr r13,SPRG3 addi r3,r1,STACK_FRAME_OVERHEAD bl .unrecoverable_exception b unrecov_restore @@ -488,7 +613,7 @@ mflr r0 std r0,16(r1) stdu r1,-RTAS_FRAME_SIZE(r1) /* Save SP and create stack space. */ - + /* Because RTAS is running in 32b mode, it clobbers the high order half * of all registers that it saves. We therefore save those registers * RTAS might touch to the stack. (r0, r3-r13 are caller saved) diff -Nru a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S --- a/arch/ppc64/kernel/head.S 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/kernel/head.S 2004-06-23 19:04:27 -07:00 @@ -40,15 +40,6 @@ #define DO_SOFT_DISABLE #endif -/* copy saved SOFTE bit or EE bit from saved MSR depending - * if we are doing soft-disable or not - */ -#ifdef DO_SOFT_DISABLE -#define DO_COPY_EE() ld r20,SOFTE(r1) -#else -#define DO_COPY_EE() rldicl r20,r23,49,63 -#endif - /* * hcall interface to pSeries LPAR */ @@ -177,11 +168,18 @@ #endif #endif +/* This value is used to mark exception frames on the stack. */ + .section ".toc","aw" +exception_marker: + .tc ID_72656773_68657265[TC],0x7265677368657265 + .text + /* * The following macros define the code that appears as * the prologue to each of the exception handlers. They * are split into two parts to allow a single kernel binary - * to be used for pSeries, and iSeries. + * to be used for pSeries and iSeries. + * LOL. One day... - paulus */ /* @@ -194,81 +192,55 @@ * This is the start of the interrupt handlers for pSeries * This code runs with relocation off. */ -#define EX_SRR0 0 -#define EX_SRR1 8 -#define EX_R20 16 -#define EX_R21 24 -#define EX_R22 32 -#define EX_R23 40 +#define EX_R9 0 +#define EX_R10 8 +#define EX_R11 16 +#define EX_R12 24 +#define EX_R13 32 +#define EX_SRR0 40 #define EX_DAR 48 #define EX_DSISR 56 #define EX_CCR 60 -#define EX_TRAP 60 -#define EXCEPTION_PROLOG_PSERIES(n,label) \ - mtspr SPRG2,r20; /* use SPRG2 as scratch reg */ \ - mtspr SPRG1,r21; /* save r21 */ \ - mfspr r20,SPRG3; /* get paca virt addr */ \ - ld r21,PACAEXCSP(r20); /* get exception stack ptr */ \ - addi r21,r21,EXC_FRAME_SIZE; /* make exception frame */ \ - std r22,EX_R22(r21); /* Save r22 in exc. frame */ \ - li r22,n; /* Save the ex # in exc. frame*/ \ - stw r22,EX_TRAP(r21); /* */ \ - std r23,EX_R23(r21); /* Save r23 in exc. frame */ \ - mfspr r22,SRR0; /* EA of interrupted instr */ \ - std r22,EX_SRR0(r21); /* Save SRR0 in exc. frame */ \ - mfspr r23,SRR1; /* machine state at interrupt */ \ - std r23,EX_SRR1(r21); /* Save SRR1 in exc. frame */ \ - \ - mfspr r23,DAR; /* Save DAR in exc. frame */ \ - std r23,EX_DAR(r21); \ - mfspr r23,DSISR; /* Save DSISR in exc. frame */ \ - stw r23,EX_DSISR(r21); \ - mfspr r23,SPRG2; /* Save r20 in exc. frame */ \ - std r23,EX_R20(r21); \ - \ - clrrdi r22,r20,60; /* Get 0xc part of the vaddr */ \ - ori r22,r22,(label)@l; /* add in the vaddr offset */ \ - /* assumes *_common < 16b */ \ - mfmsr r23; \ - rotldi r23,r23,4; \ - ori r23,r23,0x32B; /* Set IR, DR, RI, SF, ISF, HV*/ \ - rotldi r23,r23,60; /* for generic handlers */ \ - mtspr SRR0,r22; \ - mtspr SRR1,r23; \ - mfcr r23; /* save CR in r23 */ \ +#define EXCEPTION_PROLOG_PSERIES(area, label) \ + mfspr r13,SPRG3; /* get paca address into r13 */ \ + std r9,area+EX_R9(r13); /* save r9 - r12 */ \ + std r10,area+EX_R10(r13); \ + std r11,area+EX_R11(r13); \ + std r12,area+EX_R12(r13); \ + mfspr r9,SPRG1; \ + std r9,area+EX_R13(r13); \ + mfcr r9; \ + clrrdi r12,r13,32; /* get high part of &label */ \ + mfmsr r10; \ + mfspr r11,SRR0; /* save SRR0 */ \ + ori r12,r12,(label)@l; /* virt addr of handler */ \ + ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \ + mtspr SRR0,r12; \ + mfspr r12,SRR1; /* and SRR1 */ \ + mtspr SRR1,r10; \ rfid /* * This is the start of the interrupt handlers for iSeries * This code runs with relocation on. */ -#define EXCEPTION_PROLOG_ISERIES(n) \ - mtspr SPRG2,r20; /* use SPRG2 as scratch reg */ \ - mtspr SPRG1,r21; /* save r21 */ \ - mfspr r20,SPRG3; /* get paca */ \ - ld r21,PACAEXCSP(r20); /* get exception stack ptr */ \ - addi r21,r21,EXC_FRAME_SIZE; /* make exception frame */ \ - std r22,EX_R22(r21); /* save r22 on exception frame */ \ - li r22,n; /* Save the ex # in exc. frame */ \ - stw r22,EX_TRAP(r21); /* */ \ - std r23,EX_R23(r21); /* Save r23 in exc. frame */ \ - ld r22,LPPACA+LPPACASRR0(r20); /* Get SRR0 from ItLpPaca */ \ - std r22,EX_SRR0(r21); /* save SRR0 in exc. frame */ \ - ld r23,LPPACA+LPPACASRR1(r20); /* Get SRR1 from ItLpPaca */ \ - std r23,EX_SRR1(r21); /* save SRR1 in exc. frame */ \ - \ - mfspr r23,DAR; /* Save DAR in exc. frame */ \ - std r23,EX_DAR(r21); \ - mfspr r23,DSISR; /* Save DSISR in exc. frame */ \ - stw r23,EX_DSISR(r21); \ - mfspr r23,SPRG2; /* Save r20 in exc. frame */ \ - std r23,EX_R20(r21); \ - \ - mfmsr r22; /* set MSR.RI */ \ - ori r22,r22,MSR_RI; \ - mtmsrd r22,1; \ - mfcr r23; /* save CR in r23 */ +#define EXCEPTION_PROLOG_ISERIES_1(area) \ + mfspr r13,SPRG3; /* get paca address into r13 */ \ + std r9,area+EX_R9(r13); /* save r9 - r12 */ \ + std r10,area+EX_R10(r13); \ + std r11,area+EX_R11(r13); \ + std r12,area+EX_R12(r13); \ + mfspr r9,SPRG1; \ + std r9,area+EX_R13(r13); \ + mfcr r9 + +#define EXCEPTION_PROLOG_ISERIES_2 \ + mfmsr r10; \ + ld r11,LPPACA+LPPACASRR0(r13); \ + ld r12,LPPACA+LPPACASRR1(r13); \ + ori r10,r10,MSR_RI; \ + mtmsrd r10,1 /* * The common exception prolog is used for all except a few exceptions @@ -276,107 +248,154 @@ * to take another exception from the point where we first touch the * kernel stack onwards. * - * On entry r20 points to the paca and r21 points to the exception - * frame on entry, r23 contains the saved CR, and relocation is on. - */ -#define EXCEPTION_PROLOG_COMMON \ - mfspr r22,SPRG1; /* Save r21 in exc. frame */ \ - std r22,EX_R21(r21); \ - std r21,PACAEXCSP(r20); /* update exception stack ptr */ \ - ld r22,EX_SRR1(r21); /* Get SRR1 from exc. frame */ \ - andi. r22,r22,MSR_PR; /* Set CR for later branch */ \ - mr r22,r1; /* Save r1 */ \ - subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \ - beq- 1f; \ - ld r1,PACAKSAVE(r20); /* kernel stack to use */ \ -1: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \ - bge cr1,bad_stack; /* abort if it is */ \ - std r22,GPR1(r1); /* save r1 in stackframe */ \ - std r22,0(r1); /* make stack chain pointer */ \ - std r23,_CCR(r1); /* save CR in stackframe */ \ - ld r22,EX_R20(r21); /* move r20 to stackframe */ \ - std r22,GPR20(r1); \ - ld r23,EX_R21(r21); /* move r21 to stackframe */ \ - std r23,GPR21(r1); \ - ld r22,EX_R22(r21); /* move r22 to stackframe */ \ - std r22,GPR22(r1); \ - ld r23,EX_R23(r21); /* move r23 to stackframe */ \ - std r23,GPR23(r1); \ - mflr r22; /* save LR in stackframe */ \ - std r22,_LINK(r1); \ - mfctr r23; /* save CTR in stackframe */ \ - std r23,_CTR(r1); \ - mfspr r22,XER; /* save XER in stackframe */ \ - std r22,_XER(r1); \ - ld r23,EX_DAR(r21); /* move DAR to stackframe */ \ - std r23,_DAR(r1); \ - lwz r22,EX_DSISR(r21); /* move DSISR to stackframe */ \ - std r22,_DSISR(r1); \ - lbz r22,PACAPROCENABLED(r20); \ - std r22,SOFTE(r1); \ - ld r22,EX_SRR0(r21); /* get SRR0 from exc. frame */ \ - ld r23,EX_SRR1(r21); /* get SRR1 from exc. frame */ \ - addi r21,r21,-EXC_FRAME_SIZE;/* pop off exception frame */ \ - std r21,PACAEXCSP(r20); \ - SAVE_GPR(0, r1); /* save r0 in stackframe */ \ - SAVE_8GPRS(2, r1); /* save r2 - r13 in stackframe */ \ - SAVE_4GPRS(10, r1); \ - ld r2,PACATOC(r20); \ - mr r13,r20 - -/* - * Note: code which follows this uses cr0.eq (set if from kernel), - * r1, r22 (SRR0), and r23 (SRR1). - */ + * On entry r13 points to the paca, r9-r13 are saved in the paca, + * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and + * SRR1, and relocation is on. + */ +#define EXCEPTION_PROLOG_COMMON(n, area) \ + andi. r10,r12,MSR_PR; /* See if coming from user */ \ + mr r10,r1; /* Save r1 */ \ + subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \ + beq- 1f; \ + ld r1,PACAKSAVE(r13); /* kernel stack to use */ \ +1: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \ + bge- cr1,bad_stack; /* abort if it is */ \ + std r9,_CCR(r1); /* save CR in stackframe */ \ + std r11,_NIP(r1); /* save SRR0 in stackframe */ \ + std r12,_MSR(r1); /* save SRR1 in stackframe */ \ + std r10,0(r1); /* make stack chain pointer */ \ + std r0,GPR0(r1); /* save r0 in stackframe */ \ + std r10,GPR1(r1); /* save r1 in stackframe */ \ + std r2,GPR2(r1); /* save r2 in stackframe */ \ + SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \ + SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \ + ld r9,area+EX_R9(r13); /* move r9, r10 to stackframe */ \ + ld r10,area+EX_R10(r13); \ + std r9,GPR9(r1); \ + std r10,GPR10(r1); \ + ld r9,area+EX_R11(r13); /* move r11 - r13 to stackframe */ \ + ld r10,area+EX_R12(r13); \ + ld r11,area+EX_R13(r13); \ + std r9,GPR11(r1); \ + std r10,GPR12(r1); \ + std r11,GPR13(r1); \ + ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \ + mflr r9; /* save LR in stackframe */ \ + std r9,_LINK(r1); \ + mfctr r10; /* save CTR in stackframe */ \ + std r10,_CTR(r1); \ + mfspr r11,XER; /* save XER in stackframe */ \ + std r11,_XER(r1); \ + li r9,(n)+1; \ + std r9,_TRAP(r1); /* set trap number */ \ + li r10,0; \ + ld r11,exception_marker@toc(r2); \ + std r10,RESULT(r1); /* clear regs->result */ \ + std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */ /* * Exception vectors. */ -#define STD_EXCEPTION_PSERIES(n, label ) \ - . = n; \ - .globl label##_Pseries; \ -label##_Pseries: \ - EXCEPTION_PROLOG_PSERIES( n, label##_common ) - -#define STD_EXCEPTION_ISERIES( n, label ) \ - .globl label##_Iseries; \ -label##_Iseries: \ - EXCEPTION_PROLOG_ISERIES( n ); \ +#define STD_EXCEPTION_PSERIES(n, label ) \ + . = n; \ + .globl label##_Pseries; \ +label##_Pseries: \ + mtspr SPRG1,r13; /* save r13 */ \ + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) + +#define STD_EXCEPTION_ISERIES(n, label, area) \ + .globl label##_Iseries; \ +label##_Iseries: \ + mtspr SPRG1,r13; /* save r13 */ \ + EXCEPTION_PROLOG_ISERIES_1(area); \ + EXCEPTION_PROLOG_ISERIES_2; \ b label##_common -#define MASKABLE_EXCEPTION_ISERIES( n, label ) \ - .globl label##_Iseries; \ -label##_Iseries: \ - EXCEPTION_PROLOG_ISERIES( n ); \ - lbz r22,PACAPROFENABLED(r20); \ - cmpi 0,r22,0; \ - bne- label##_Iseries_profile; \ -label##_Iseries_prof_ret: \ - lbz r22,PACAPROCENABLED(r20); \ - cmpi 0,r22,0; \ - beq- label##_Iseries_masked; \ - b label##_common; \ -label##_Iseries_profile: \ - std r24,48(r21); \ - std r25,56(r21); \ - mflr r24; \ - bl do_profile; \ - mtlr r24; \ - ld r24,48(r21); \ - ld r25,56(r21); \ +#define MASKABLE_EXCEPTION_ISERIES( n, label ) \ + .globl label##_Iseries; \ +label##_Iseries: \ + mtspr SPRG1,r13; /* save r13 */ \ + EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ + lbz r10,PACAPROFENABLED(r13); \ + cmpwi r10,0; \ + bne- label##_Iseries_profile; \ +label##_Iseries_prof_ret: \ + lbz r10,PACAPROCENABLED(r13); \ + cmpwi 0,r10,0; \ + beq- label##_Iseries_masked; \ + EXCEPTION_PROLOG_ISERIES_2; \ + b label##_common; \ +label##_Iseries_profile: \ + ld r12,LPPACA+LPPACASRR1(r13); \ + andi. r12,r12,MSR_PR; /* Test if in kernel */ \ + bne label##_Iseries_prof_ret; \ + ld r11,LPPACA+LPPACASRR0(r13); \ + ld r12,PACAPROFSTEXT(r13); /* _stext */ \ + subf r11,r12,r11; /* offset into kernel */ \ + lwz r12,PACAPROFSHIFT(r13); \ + srd r11,r11,r12; \ + lwz r12,PACAPROFLEN(r13); /* profile table length - 1 */ \ + cmpd r11,r12; /* off end? */ \ + ble 1f; \ + mr r11,r12; /* force into last entry */ \ +1: sldi r11,r11,2; /* convert to offset */ \ + ld r12,PACAPROFBUFFER(r13);/* profile buffer */ \ + add r12,r12,r11; \ +2: lwarx r11,0,r12; /* atomically increment */ \ + addi r11,r11,1; \ + stwcx. r11,0,r12; \ + bne- 2b; \ b label##_Iseries_prof_ret +#ifdef DO_SOFT_DISABLE +#define DISABLE_INTS \ + lbz r10,PACAPROCENABLED(r13); \ + li r11,0; \ + std r10,SOFTE(r1); \ + mfmsr r10; \ + stb r11,PACAPROCENABLED(r13); \ + ori r10,r10,MSR_EE; \ + mtmsrd r10,1 + +#define ENABLE_INTS \ + lbz r10,PACAPROCENABLED(r13); \ + mfmsr r11; \ + std r10,SOFTE(r1); \ + ori r11,r11,MSR_EE; \ + mtmsrd r11,1 + +#else /* hard enable/disable interrupts */ +#define DISABLE_INTS + +#define ENABLE_INTS \ + ld r12,_MSR(r1); \ + mfmsr r11; \ + rlwimi r11,r12,0,MSR_EE; \ + mtmsrd r11,1 + +#endif + #define STD_EXCEPTION_COMMON( trap, label, hdlr ) \ - .globl label##_common; \ -label##_common: \ - EXCEPTION_PROLOG_COMMON; \ - addi r3,r1,STACK_FRAME_OVERHEAD; \ - li r20,0; \ - li r6,trap; \ - bl .save_remaining_regs; \ - bl hdlr; \ + .align 7; \ + .globl label##_common; \ +label##_common: \ + EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ + DISABLE_INTS; \ + bl .save_nvgprs; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + bl hdlr; \ b .ret_from_except +#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \ + .align 7; \ + .globl label##_common; \ +label##_common: \ + EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ + DISABLE_INTS; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + bl hdlr; \ + b .ret_from_except_lite + /* * Start of pSeries system interrupt routines */ @@ -385,9 +404,45 @@ __start_interrupts: STD_EXCEPTION_PSERIES( 0x100, SystemReset ) - STD_EXCEPTION_PSERIES( 0x200, MachineCheck ) - STD_EXCEPTION_PSERIES( 0x300, DataAccess ) - STD_EXCEPTION_PSERIES( 0x380, DataAccessSLB ) + + . = 0x200 + .globl MachineCheck_Pseries +_MachineCheckPseries: + mtspr SPRG1,r13 /* save r13 */ + EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common) + + . = 0x300 + .globl DataAccess_Pseries +DataAccess_Pseries: + mtspr SPRG1,r13 +BEGIN_FTR_SECTION + mtspr SPRG2,r12 + mfspr r13,DAR + mfspr r12,DSISR + srdi r13,r13,60 + rlwimi r13,r12,16,0x20 + mfcr r12 + cmpwi r13,0x2c + beq .do_stab_bolted_Pseries + mtcrf 0x80,r12 + mfspr r12,SPRG2 +END_FTR_SECTION_IFCLR(CPU_FTR_SLB) + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, DataAccess_common) + + . = 0x380 + .globl DataAccessSLB_Pseries +DataAccessSLB_Pseries: + mtspr SPRG1,r13 + mtspr SPRG2,r12 + mfspr r13,DAR + mfcr r12 + srdi r13,r13,60 + cmpdi r13,0xc + beq .do_slb_bolted_Pseries + mtcrf 0x80,r12 + mfspr r12,SPRG2 + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, DataAccessSLB_common) + STD_EXCEPTION_PSERIES( 0x400, InstructionAccess ) STD_EXCEPTION_PSERIES( 0x480, InstructionAccessSLB ) STD_EXCEPTION_PSERIES( 0x500, HardwareInterrupt ) @@ -397,7 +452,23 @@ STD_EXCEPTION_PSERIES( 0x900, Decrementer ) STD_EXCEPTION_PSERIES( 0xa00, Trap_0a ) STD_EXCEPTION_PSERIES( 0xb00, Trap_0b ) - STD_EXCEPTION_PSERIES( 0xc00, SystemCall ) + + . = 0xc00 + .globl SystemCall_Pseries +SystemCall_Pseries: + mr r9,r13 + mfmsr r10 + mfspr r13,SPRG3 + mfspr r11,SRR0 + clrrdi r12,r13,32 + oris r12,r12,SystemCall_common@h + ori r12,r12,SystemCall_common@l + mtspr SRR0,r12 + ori r10,r10,MSR_IR|MSR_DR|MSR_RI + mfspr r12,SRR1 + mtspr SRR1,r10 + rfid + STD_EXCEPTION_PSERIES( 0xd00, SingleStep ) STD_EXCEPTION_PSERIES( 0xe00, Trap_0e ) @@ -407,25 +478,26 @@ * trickery is thus necessary */ . = 0xf00 - b .PerformanceMonitor_Pseries - . = 0xf20 - b .AltivecUnavailable_Pseries + b PerformanceMonitor_Pseries + + STD_EXCEPTION_PSERIES(0xf20, AltivecUnavailable) STD_EXCEPTION_PSERIES( 0x1300, InstructionBreakpoint ) STD_EXCEPTION_PSERIES( 0x1700, AltivecAssist ) - /* Here are the "moved" performance monitor and - * altivec unavailable exceptions - */ - . = 0x3000 - .globl PerformanceMonitor_Pseries; -.PerformanceMonitor_Pseries: - EXCEPTION_PROLOG_PSERIES(0xf00, PerformanceMonitor_common) + /* moved from 0xf00 */ + STD_EXCEPTION_PSERIES(0x3000, PerformanceMonitor) . = 0x3100 - .globl AltivecUnavailable_Pseries; -.AltivecUnavailable_Pseries: - EXCEPTION_PROLOG_PSERIES(0xf20, AltivecUnavailable_common) +_GLOBAL(do_stab_bolted_Pseries) + mtcrf 0x80,r12 + mfspr r12,SPRG2 + EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) + +_GLOBAL(do_slb_bolted_Pseries) + mtcrf 0x80,r12 + mfspr r12,SPRG2 + EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_slb_bolted) /* Space for the naca. Architected to be located at real address @@ -484,31 +556,82 @@ /*** ISeries-LPAR interrupt handlers ***/ - STD_EXCEPTION_ISERIES( 0x200, MachineCheck ) - STD_EXCEPTION_ISERIES( 0x300, DataAccess ) - STD_EXCEPTION_ISERIES( 0x380, DataAccessSLB ) - STD_EXCEPTION_ISERIES( 0x400, InstructionAccess ) - STD_EXCEPTION_ISERIES( 0x480, InstructionAccessSLB ) - MASKABLE_EXCEPTION_ISERIES( 0x500, HardwareInterrupt ) - STD_EXCEPTION_ISERIES( 0x600, Alignment ) - STD_EXCEPTION_ISERIES( 0x700, ProgramCheck ) - STD_EXCEPTION_ISERIES( 0x800, FPUnavailable ) - MASKABLE_EXCEPTION_ISERIES( 0x900, Decrementer ) - STD_EXCEPTION_ISERIES( 0xa00, Trap_0a ) - STD_EXCEPTION_ISERIES( 0xb00, Trap_0b ) - STD_EXCEPTION_ISERIES( 0xc00, SystemCall ) - STD_EXCEPTION_ISERIES( 0xd00, SingleStep ) - STD_EXCEPTION_ISERIES( 0xe00, Trap_0e ) - STD_EXCEPTION_ISERIES( 0xf00, PerformanceMonitor ) + STD_EXCEPTION_ISERIES(0x200, MachineCheck, PACA_EXMC) + + .globl DataAccess_Iseries +DataAccess_Iseries: + mtspr SPRG1,r13 +BEGIN_FTR_SECTION + mtspr SPRG2,r12 + mfspr r13,DAR + mfspr r12,DSISR + srdi r13,r13,60 + rlwimi r13,r12,16,0x20 + mfcr r12 + cmpwi r13,0x2c + beq .do_stab_bolted_Iseries + mtcrf 0x80,r12 + mfspr r12,SPRG2 +END_FTR_SECTION_IFCLR(CPU_FTR_SLB) + EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN) + EXCEPTION_PROLOG_ISERIES_2 + b DataAccess_common + +.do_stab_bolted_Iseries: + mtcrf 0x80,r12 + mfspr r12,SPRG2 + EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) + EXCEPTION_PROLOG_ISERIES_2 + b .do_stab_bolted + + .globl DataAccessSLB_Iseries +DataAccessSLB_Iseries: + mtspr SPRG1,r13 /* save r13 */ + mtspr SPRG2,r12 + mfspr r13,DAR + mfcr r12 + srdi r13,r13,60 + cmpdi r13,0xc + beq .do_slb_bolted_Iseries + mtcrf 0x80,r12 + mfspr r12,SPRG2 + EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN) + EXCEPTION_PROLOG_ISERIES_2 + b DataAccessSLB_common + +.do_slb_bolted_Iseries: + mtcrf 0x80,r12 + mfspr r12,SPRG2 + EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB) + EXCEPTION_PROLOG_ISERIES_2 + b .do_slb_bolted + + STD_EXCEPTION_ISERIES(0x400, InstructionAccess, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x480, InstructionAccessSLB, PACA_EXGEN) + MASKABLE_EXCEPTION_ISERIES(0x500, HardwareInterrupt) + STD_EXCEPTION_ISERIES(0x600, Alignment, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x700, ProgramCheck, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0x800, FPUnavailable, PACA_EXGEN) + MASKABLE_EXCEPTION_ISERIES(0x900, Decrementer) + STD_EXCEPTION_ISERIES(0xa00, Trap_0a, PACA_EXGEN) + STD_EXCEPTION_ISERIES(0xb00, Trap_0b, PACA_EXGEN) + + .globl SystemCall_Iseries +SystemCall_Iseries: + mr r9,r13 + mfspr r13,SPRG3 + EXCEPTION_PROLOG_ISERIES_2 + b SystemCall_common + + STD_EXCEPTION_ISERIES( 0xd00, SingleStep, PACA_EXGEN) + STD_EXCEPTION_ISERIES( 0xe00, Trap_0e, PACA_EXGEN) + STD_EXCEPTION_ISERIES( 0xf00, PerformanceMonitor, PACA_EXGEN) .globl SystemReset_Iseries SystemReset_Iseries: mfspr r13,SPRG3 /* Get paca address */ - mfmsr r24 - ori r24,r24,MSR_RI - mtmsrd r24 /* RI on */ lhz r24,PACAPACAINDEX(r13) /* Get processor # */ - cmpi 0,r24,0 /* Are we processor 0? */ + cmpwi 0,r24,0 /* Are we processor 0? */ beq .__start_initialization_iSeries /* Start up the first processor */ mfspr r4,CTRLF li r5,RUNLATCH /* Turn off the run light */ @@ -527,7 +650,7 @@ addi r1,r3,THREAD_SIZE subi r1,r1,STACK_FRAME_OVERHEAD - cmpi 0,r23,0 + cmpwi 0,r23,0 beq iseries_secondary_smp_loop /* Loop until told to go */ #ifdef SECONDARY_PROCESSORS bne .__secondary_start /* Loop until told to go */ @@ -552,28 +675,29 @@ b 1b /* If SMP not configured, secondaries * loop forever */ - .globl HardwareInterrupt_Iseries_masked -HardwareInterrupt_Iseries_masked: - b maskable_exception_exit - .globl Decrementer_Iseries_masked Decrementer_Iseries_masked: - li r22,1 - stb r22,PACALPPACA+LPPACADECRINT(r20) - lwz r22,PACADEFAULTDECR(r20) - mtspr DEC,r22 -maskable_exception_exit: - mtcrf 0xff,r23 /* Restore regs and free exception frame */ - ld r22,EX_SRR0(r21) - ld r23,EX_SRR1(r21) - mtspr SRR0,r22 - mtspr SRR1,r23 - ld r22,EX_R22(r21) - ld r23,EX_R23(r21) - mfspr r21,SPRG1 - mfspr r20,SPRG2 + li r11,1 + stb r11,PACALPPACA+LPPACADECRINT(r13) + lwz r12,PACADEFAULTDECR(r13) + mtspr DEC,r12 + /* fall through */ + + .globl HardwareInterrupt_Iseries_masked +HardwareInterrupt_Iseries_masked: + mtcrf 0x80,r9 /* Restore regs */ + ld r11,LPPACA+LPPACASRR0(r13) + ld r12,LPPACA+LPPACASRR1(r13) + mtspr SRR0,r11 + mtspr SRR1,r12 + ld r9,PACA_EXGEN+EX_R9(r13) + ld r10,PACA_EXGEN+EX_R10(r13) + ld r11,PACA_EXGEN+EX_R11(r13) + ld r12,PACA_EXGEN+EX_R12(r13) + ld r13,PACA_EXGEN+EX_R13(r13) rfid #endif + /* * Data area reserved for FWNMI option. */ @@ -587,10 +711,12 @@ . = 0x8000 .globl SystemReset_FWNMI SystemReset_FWNMI: - EXCEPTION_PROLOG_PSERIES(0x100, SystemReset_common) + mtspr SPRG1,r13 /* save r13 */ + EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, SystemReset_common) .globl MachineCheck_FWNMI MachineCheck_FWNMI: - EXCEPTION_PROLOG_PSERIES(0x200, MachineCheck_common) + mtspr SPRG1,r13 /* save r13 */ + EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common) /* * Space for the initial segment table @@ -609,8 +735,22 @@ /*** Common interrupt handlers ***/ STD_EXCEPTION_COMMON( 0x100, SystemReset, .SystemResetException ) - STD_EXCEPTION_COMMON( 0x200, MachineCheck, .MachineCheckException ) - STD_EXCEPTION_COMMON( 0x900, Decrementer, .timer_interrupt ) + + /* + * Machine check is different because we use a different + * save area: PACA_EXMC instead of PACA_EXGEN. + */ + .align 7 + .globl MachineCheck_common +MachineCheck_common: + EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC) + DISABLE_INTS + bl .save_nvgprs + addi r3,r1,STACK_FRAME_OVERHEAD + bl .MachineCheckException + b .ret_from_except + + STD_EXCEPTION_COMMON_LITE(0x900, Decrementer, .timer_interrupt) STD_EXCEPTION_COMMON( 0xa00, Trap_0a, .UnknownException ) STD_EXCEPTION_COMMON( 0xb00, Trap_0b, .UnknownException ) STD_EXCEPTION_COMMON( 0xd00, SingleStep, .SingleStepException ) @@ -624,65 +764,56 @@ #endif /* - * Here the exception frame is filled out and we have detected that - * the kernel stack pointer is bad. R23 contains the saved CR, r20 - * points to the paca, r21 points to the exception frame, and r22 - * contains the (bad) kernel stack pointer. + * Here we have detected that the kernel stack pointer is bad. + * R9 contains the saved CR, r13 points to the paca, + * r10 contains the (bad) kernel stack pointer, + * r11 and r12 contain the saved SRR0 and SRR1. * We switch to using the paca guard page as an emergency stack, - * save the registers on there, and call kernel_bad_stack(), - * which panics. + * save the registers there, and call kernel_bad_stack(), which panics. */ bad_stack: - addi r1,r20,8192-64-INT_FRAME_SIZE - std r22,GPR1(r1) - std r23,_CCR(r1) - ld r22,EX_R20(r21) - std r22,GPR20(r1) - ld r23,EX_R21(r21) - std r23,GPR21(r1) - ld r22,EX_R22(r21) - std r22,GPR22(r1) - ld r23,EX_R23(r21) - std r23,GPR23(r1) - ld r23,EX_DAR(r21) - std r23,_DAR(r1) - lwz r22,EX_DSISR(r21) - std r22,_DSISR(r1) - lwz r23,EX_TRAP(r21) - std r23,TRAP(r1) - ld r22,EX_SRR0(r21) - ld r23,EX_SRR1(r21) - std r22,_NIP(r1) - std r23,_MSR(r1) - addi r21,r21,-EXC_FRAME_SIZE - std r21,PACAEXCSP(r20) - mflr r22 - std r22,_LINK(r1) - mfctr r23 - std r23,_CTR(r1) - mfspr r22,XER - std r22,_XER(r1) + addi r1,r13,8192-64-INT_FRAME_SIZE + std r9,_CCR(r1) + std r10,GPR1(r1) + std r11,_NIP(r1) + std r12,_MSR(r1) + mfspr r11,DAR + mfspr r12,DSISR + std r11,_DAR(r1) + std r12,_DSISR(r1) + mflr r10 + mfctr r11 + mfxer r12 + std r10,_LINK(r1) + std r11,_CTR(r1) + std r12,_XER(r1) SAVE_GPR(0, r1) - SAVE_10GPRS(2, r1) - SAVE_8GPRS(12, r1) - SAVE_8GPRS(24, r1) - addi r21,r1,INT_FRAME_SIZE - std r21,0(r1) - li r22,0 - std r22,0(r21) - ld r2,PACATOC(r20) - mr r13,r20 + SAVE_GPR(2,r1) + SAVE_4GPRS(3,r1) + SAVE_2GPRS(7,r1) + SAVE_10GPRS(12,r1) + SAVE_10GPRS(22,r1) + addi r11,r1,INT_FRAME_SIZE + std r11,0(r1) + li r12,0 + std r12,0(r11) + ld r2,PACATOC(r13) 1: addi r3,r1,STACK_FRAME_OVERHEAD bl .kernel_bad_stack b 1b /* - * Return from an exception which is handled without calling - * save_remaining_regs. The caller is assumed to have done - * EXCEPTION_PROLOG_COMMON. + * Return from an exception with minimal checks. + * The caller is assumed to have done EXCEPTION_PROLOG_COMMON. + * If interrupts have been enabled, or anything has been + * done that might have changed the scheduling status of + * any task or sent any task a signal, you should use + * ret_from_except or ret_from_except_lite instead of this. */ fast_exception_return: - andi. r3,r23,MSR_RI /* check if RI is set */ + ld r12,_MSR(r1) + ld r11,_NIP(r1) + andi. r3,r12,MSR_RI /* check if RI is set */ beq- unrecov_fer ld r3,_CCR(r1) ld r4,_LINK(r1) @@ -691,244 +822,178 @@ mtcr r3 mtlr r4 mtctr r5 - mtspr XER,r6 + mtxer r6 REST_GPR(0, r1) REST_8GPRS(2, r1) - REST_4GPRS(10, r1) - mfmsr r20 - li r21, MSR_RI - andc r20,r20,r21 - mtmsrd r20,1 - - mtspr SRR1,r23 - mtspr SRR0,r22 - REST_4GPRS(20, r1) + mfmsr r10 + clrrdi r10,r10,2 /* clear RI (LE is 0 already) */ + mtmsrd r10,1 + + mtspr SRR1,r12 + mtspr SRR0,r11 + REST_4GPRS(10, r1) ld r1,GPR1(r1) rfid unrecov_fer: - li r6,0x4000 - li r20,0 - bl .save_remaining_regs + bl .save_nvgprs 1: addi r3,r1,STACK_FRAME_OVERHEAD bl .unrecoverable_exception b 1b /* - * Here r20 points to the PACA, r21 to the exception frame, - * r23 contains the saved CR. - * r20 - r23, SRR0 and SRR1 are saved in the exception frame. + * Here r13 points to the paca, r9 contains the saved CR, + * SRR0 and SRR1 are saved in r11 and r12, + * r9 - r13 are saved in paca->exgen. */ + .align 7 .globl DataAccess_common DataAccess_common: -BEGIN_FTR_SECTION - mfspr r22,DAR - srdi r22,r22,60 - cmpi 0,r22,0xc - - /* Segment fault on a bolted segment. Go off and map that segment. */ - beq- .do_stab_bolted -END_FTR_SECTION_IFCLR(CPU_FTR_SLB) -stab_bolted_user_return: - EXCEPTION_PROLOG_COMMON - ld r3,_DSISR(r1) - andis. r0,r3,0xa450 /* weird error? */ - bne 1f /* if not, try to put a PTE */ - andis. r0,r3,0x0020 /* Is it a page table fault? */ - rlwinm r4,r3,32-23,29,29 /* DSISR_STORE -> _PAGE_RW */ - ld r3,_DAR(r1) /* into the hash table */ - -BEGIN_FTR_SECTION - beq+ 2f /* If so handle it */ - li r4,0x300 /* Trap number */ - bl .do_stab_SI - b 1f -END_FTR_SECTION_IFCLR(CPU_FTR_SLB) - -2: li r5,0x300 - bl .do_hash_page_DSI /* Try to handle as hpte fault */ -1: - ld r4,_DAR(r1) - ld r5,_DSISR(r1) - addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - li r6,0x300 - bl .save_remaining_regs - bl .do_page_fault - b .ret_from_except + mfspr r10,DAR + std r10,PACA_EXGEN+EX_DAR(r13) + mfspr r10,DSISR + stw r10,PACA_EXGEN+EX_DSISR(r13) + EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN) + ld r3,PACA_EXGEN+EX_DAR(r13) + lwz r4,PACA_EXGEN+EX_DSISR(r13) + li r5,0x300 + b .do_hash_page /* Try to handle as hpte fault */ + .align 7 .globl DataAccessSLB_common DataAccessSLB_common: - mfspr r22,DAR - srdi r22,r22,60 - cmpi 0,r22,0xc - - /* Segment fault on a bolted segment. Go off and map that segment. */ - beq .do_slb_bolted - - EXCEPTION_PROLOG_COMMON - ld r3,_DAR(r1) - li r4,0x380 /* Exception vector */ + mfspr r10,DAR + std r10,PACA_EXGEN+EX_DAR(r13) + EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN) + ld r3,PACA_EXGEN+EX_DAR(r13) + std r3,_DAR(r1) bl .slb_allocate - or. r3,r3,r3 /* Check return code */ + cmpdi r3,0 /* Check return code */ beq fast_exception_return /* Return if we succeeded */ - addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - ld r4,_DAR(r1) - li r6,0x380 li r5,0 - bl .save_remaining_regs - bl .do_page_fault - b .ret_from_except + std r5,_DSISR(r1) + b .handle_page_fault + .align 7 .globl InstructionAccess_common InstructionAccess_common: - EXCEPTION_PROLOG_COMMON - -BEGIN_FTR_SECTION - andis. r0,r23,0x0020 /* no ste found? */ - beq+ 2f - mr r3,r22 /* SRR0 at interrupt */ - li r4,0x400 /* Trap number */ - bl .do_stab_SI - b 1f -END_FTR_SECTION_IFCLR(CPU_FTR_SLB) - -2: mr r3,r22 + EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN) + ld r3,_NIP(r1) + andis. r4,r12,0x5820 li r5,0x400 - bl .do_hash_page_ISI /* Try to handle as hpte fault */ -1: - mr r4,r22 - rlwinm r5,r23,0,4,4 /* We only care about PR in error_code */ - addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - li r6,0x400 - bl .save_remaining_regs - bl .do_page_fault - b .ret_from_except + b .do_hash_page /* Try to handle as hpte fault */ + .align 7 .globl InstructionAccessSLB_common InstructionAccessSLB_common: - EXCEPTION_PROLOG_COMMON - mr r3,r22 /* SRR0 = NIA */ - li r4,0x480 /* Exception vector */ + EXCEPTION_PROLOG_COMMON(0x480, PACA_EXGEN) + ld r3,_NIP(r1) /* SRR0 = NIA */ bl .slb_allocate or. r3,r3,r3 /* Check return code */ beq+ fast_exception_return /* Return if we succeeded */ - addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - mr r4,r22 /* SRR0 = NIA */ - li r6,0x480 + ld r4,_NIP(r1) li r5,0 - bl .save_remaining_regs - bl .do_page_fault - b .ret_from_except + std r4,_DAR(r1) + std r5,_DSISR(r1) + b .handle_page_fault + .align 7 .globl HardwareInterrupt_common + .globl HardwareInterrupt_entry HardwareInterrupt_common: - EXCEPTION_PROLOG_COMMON + EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) HardwareInterrupt_entry: + DISABLE_INTS addi r3,r1,STACK_FRAME_OVERHEAD - li r20,0 - li r6,0x500 - bl .save_remaining_regs bl .do_IRQ - b .ret_from_except + b .ret_from_except_lite + .align 7 .globl Alignment_common Alignment_common: - EXCEPTION_PROLOG_COMMON + mfspr r10,DAR + std r10,PACA_EXGEN+EX_DAR(r13) + mfspr r10,DSISR + stw r10,PACA_EXGEN+EX_DSISR(r13) + EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN) + ld r3,PACA_EXGEN+EX_DAR(r13) + lwz r4,PACA_EXGEN+EX_DSISR(r13) + std r3,_DAR(r1) + std r4,_DSISR(r1) + bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - li r6,0x600 - bl .save_remaining_regs + ENABLE_INTS bl .AlignmentException b .ret_from_except + .align 7 .globl ProgramCheck_common ProgramCheck_common: - EXCEPTION_PROLOG_COMMON + EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) + bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - li r6,0x700 - bl .save_remaining_regs + ENABLE_INTS bl .ProgramCheckException b .ret_from_except + .align 7 .globl FPUnavailable_common FPUnavailable_common: - EXCEPTION_PROLOG_COMMON + EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) bne .load_up_fpu /* if from user, just load it up */ + bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - li r6,0x800 - bl .save_remaining_regs + ENABLE_INTS bl .KernelFPUnavailableException BUG_OPCODE + .align 7 .globl AltivecUnavailable_common AltivecUnavailable_common: - EXCEPTION_PROLOG_COMMON + EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN) #ifdef CONFIG_ALTIVEC - bne .load_up_altivec /* if from user, just load it up */ + bne .load_up_altivec /* if from user, just load it up */ #endif + bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD - DO_COPY_EE() - li r6,0xf20 - bl .save_remaining_regs -#ifdef CONFIG_ALTIVEC - bl .KernelAltivecUnavailableException -#else - bl .UnknownException -#endif - BUG_OPCODE + ENABLE_INTS + bl .AltivecUnavailableException + b .ret_from_except - .globl SystemCall_common -SystemCall_common: - EXCEPTION_PROLOG_COMMON -#ifdef CONFIG_PPC_ISERIES - cmpi 0,r0,0x5555 /* Special syscall to handle pending */ - bne+ 1f /* interrupts */ - andi. r6,r23,MSR_PR /* Only allowed from kernel */ - beq+ HardwareInterrupt_entry -1: -#endif - DO_COPY_EE() - li r6,0xC00 - bl .save_remaining_regs - bl .DoSyscall - b .ret_from_except +/* + * Hash table stuff + */ + .align 7 +_GLOBAL(do_hash_page) + std r3,_DAR(r1) + std r4,_DSISR(r1) + + andis. r0,r4,0xa450 /* weird error? */ + bne- .handle_page_fault /* if not, try to insert a HPTE */ +BEGIN_FTR_SECTION + andis. r0,r4,0x0020 /* Is it a segment table fault? */ + bne- .do_ste_alloc /* If so handle it */ +END_FTR_SECTION_IFCLR(CPU_FTR_SLB) -_GLOBAL(do_hash_page_ISI) - li r4,0 -_GLOBAL(do_hash_page_DSI) /* * We need to set the _PAGE_USER bit if MSR_PR is set or if we are * accessing a userspace segment (even from the kernel). We assume * kernel addresses always have the high bit set. */ - rotldi r0,r3,15 /* Move high bit into MSR_PR position */ - orc r0,r23,r0 - rlwimi r4,r0,32-13,30,30 /* Insert into _PAGE_USER */ + rlwinm r4,r4,32-23,29,29 /* DSISR_STORE -> _PAGE_RW */ + rotldi r0,r3,15 /* Move high bit into MSR_PR posn */ + orc r0,r12,r0 /* MSR_PR | ~high_bit */ + rlwimi r4,r0,32-13,30,30 /* becomes _PAGE_USER access bit */ ori r4,r4,1 /* add _PAGE_PRESENT */ - mflr r21 /* Save LR in r21 */ - -#ifdef DO_SOFT_DISABLE /* - * We hard enable here (but first soft disable) so that the hash_page - * code can spin on the hash_table_lock with problem on a shared - * processor. + * On iSeries, we soft-disable interrupts here, then + * hard-enable interrupts so that the hash_page code can spin on + * the hash_table_lock without problems on a shared processor. */ - li r0,0 - stb r0,PACAPROCENABLED(r20) /* Soft Disabled */ - - mfmsr r0 - ori r0,r0,MSR_EE - mtmsrd r0,1 /* Hard Enable */ -#endif + DISABLE_INTS /* * r3 contains the faulting address @@ -937,184 +1002,159 @@ * * at return r3 = 0 for success */ - bl .hash_page /* build HPTE if possible */ + cmpdi r3,0 /* see if hash_page succeeded */ #ifdef DO_SOFT_DISABLE /* - * Now go back to hard disabled. + * If we had interrupts soft-enabled at the point where the + * DSI/ISI occurred, and an interrupt came in during hash_page, + * handle it now. + * We jump to ret_from_except_lite rather than fast_exception_return + * because ret_from_except_lite will check for and handle pending + * interrupts if necessary. */ - mfmsr r0 - li r4,0 - ori r4,r4,MSR_EE - andc r0,r0,r4 - mtmsrd r0,1 /* Hard Disable */ - - ld r0,SOFTE(r1) - cmpdi 0,r0,0 /* See if we will soft enable in */ - /* save_remaining_regs */ - beq 5f - CHECKANYINT(r4,r5) - bne- HardwareInterrupt_entry /* Convert this DSI into an External */ - /* to process interrupts which occurred */ - /* during hash_page */ -5: - stb r0,PACAPROCENABLED(r20) /* Restore soft enable/disable status */ + beq .ret_from_except_lite + /* + * hash_page couldn't handle it, set soft interrupt enable back + * to what it was before the trap. Note that .local_irq_restore + * handles any interrupts pending at this point. + */ + ld r3,SOFTE(r1) + bl .local_irq_restore + b 11f +#else + beq+ fast_exception_return /* Return from exception on success */ + /* fall through */ #endif - or. r3,r3,r3 /* Check return code */ - beq fast_exception_return /* Return from exception on success */ - mtlr r21 /* restore LR */ - blr /* Return to DSI or ISI on failure */ +/* Here we have a page fault that hash_page can't handle. */ +_GLOBAL(handle_page_fault) + ENABLE_INTS +11: ld r4,_DAR(r1) + ld r5,_DSISR(r1) + addi r3,r1,STACK_FRAME_OVERHEAD + bl .do_page_fault + cmpdi r3,0 + beq+ .ret_from_except_lite + bl .save_nvgprs + mr r5,r3 + addi r3,r1,STACK_FRAME_OVERHEAD + lwz r4,_DAR(r1) + bl .bad_page_fault + b .ret_from_except + + /* here we have a segment miss */ +_GLOBAL(do_ste_alloc) + bl .ste_allocate /* try to insert stab entry */ + cmpdi r3,0 + beq+ fast_exception_return + b .handle_page_fault /* - * r20 points to the PACA, r21 to the exception frame, - * r23 contains the saved CR. - * r20 - r23, SRR0 and SRR1 are saved in the exception frame. + * r13 points to the PACA, r9 contains the saved CR, + * r11 and r12 contain the saved SRR0 and SRR1. + * r9 - r13 are saved in paca->exslb. * We assume we aren't going to take any exceptions during this procedure. + * We assume (DAR >> 60) == 0xc. */ + .align 7 _GLOBAL(do_stab_bolted) - stw r23,EX_CCR(r21) /* save CR in exc. frame */ + stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ + std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */ - mfspr r22,DSISR - andis. r22,r22,0x0020 - beq- stab_bolted_user_return + /* Hash to the primary group */ + ld r10,PACASTABVIRT(r13) + mfspr r11,DAR + srdi r11,r11,28 + rldimi r10,r11,7,52 /* r10 = first ste of the group */ + /* Calculate VSID */ /* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */ - mfspr r21,DAR - rldicl r20,r21,36,51 - sldi r20,r20,15 - srdi r21,r21,60 - or r20,r20,r21 + rldic r11,r11,15,36 + ori r11,r11,0xc /* VSID_RANDOMIZER */ - li r21,9 - sldi r21,r21,32 - oris r21,r21,58231 - ori r21,r21,39831 + li r9,9 + sldi r9,r9,32 + oris r9,r9,58231 + ori r9,r9,39831 - mulld r20,r20,r21 - clrldi r20,r20,28 /* r20 = vsid */ - - mfsprg r21,3 - ld r21,PACASTABVIRT(r21) - - /* Hash to the primary group */ - mfspr r22,DAR - rldicl r22,r22,36,59 - rldicr r22,r22,7,56 - or r21,r21,r22 /* r21 = first ste of the group */ + mulld r9,r11,r9 + rldic r9,r9,12,16 /* r9 = vsid << 12 */ /* Search the primary group for a free entry */ - li r22,0 -1: - ld r23,0(r21) /* Test valid bit of the current ste */ - rldicl r23,r23,57,63 - cmpwi r23,0 - bne 2f - li r23,0 - rldimi r23,r20,12,0 /* Insert the new vsid value */ - std r23,8(r21) /* Put new entry back into the stab */ - eieio /* Order vsid update */ - li r23,0 - mfspr r20,DAR /* Get the new esid */ - rldicl r20,r20,36,28 /* Permits a full 36b of ESID */ - rldimi r23,r20,28,0 /* Insert the new esid value */ - ori r23,r23,144 /* Turn on valid and kp */ - std r23,0(r21) /* Put new entry back into the stab */ - sync /* Order the update */ - b 3f -2: - addi r22,r22,1 - addi r21,r21,16 - cmpldi r22,7 - ble 1b +1: ld r11,0(r10) /* Test valid bit of the current ste */ + andi. r11,r11,0x80 + beq 2f + addi r10,r10,16 + andi. r11,r10,0x70 + bne 1b /* Stick for only searching the primary group for now. */ /* At least for now, we use a very simple random castout scheme */ /* Use the TB as a random number ; OR in 1 to avoid entry 0 */ - mftb r22 - andi. r22,r22,7 - ori r22,r22,1 - sldi r22,r22,4 + mftb r11 + rldic r11,r11,4,57 /* r11 = (r11 << 4) & 0x70 */ + ori r11,r11,0x10 - /* r21 currently points to and ste one past the group of interest */ + /* r10 currently points to an ste one past the group of interest */ /* make it point to the randomly selected entry */ - subi r21,r21,128 - or r21,r21,r22 /* r21 is the entry to invalidate */ + subi r10,r10,128 + or r10,r10,r11 /* r10 is the entry to invalidate */ isync /* mark the entry invalid */ - ld r23,0(r21) - li r22,-129 - and r23,r23,r22 - std r23,0(r21) + ld r11,0(r10) + rldicl r11,r11,56,1 /* clear the valid bit */ + rotldi r11,r11,8 + std r11,0(r10) sync - li r23,0 - rldimi r23,r20,12,0 - std r23,8(r21) + clrrdi r11,r11,28 /* Get the esid part of the ste */ + slbie r11 + +2: std r9,8(r10) /* Store the vsid part of the ste */ eieio - ld r22,0(r21) /* Get the esid part of the ste */ - li r23,0 - mfspr r20,DAR /* Get the new esid */ - rldicl r20,r20,36,28 /* Permits a full 32b of ESID */ - rldimi r23,r20,28,0 /* Insert the new esid value */ - ori r23,r23,144 /* Turn on valid and kp */ - std r23,0(r21) /* Put new entry back into the stab */ - - rldicl r22,r22,36,28 - rldicr r22,r22,28,35 - slbie r22 + mfspr r11,DAR /* Get the new esid */ + clrrdi r11,r11,28 /* Permits a full 32b of ESID */ + ori r11,r11,0x90 /* Turn on valid and kp */ + std r11,0(r10) /* Put new entry back into the stab */ + sync -3: /* All done -- return from exception. */ - mfsprg r20,3 /* Load the PACA pointer */ - ld r21,PACAEXCSP(r20) /* Get the exception frame pointer */ - addi r21,r21,EXC_FRAME_SIZE - lwz r23,EX_CCR(r21) /* get saved CR */ - - ld r22,EX_SRR1(r21) - andi. r22,r22,MSR_RI - beq- unrecov_stab - - /* note that this is almost identical to maskable_exception_exit */ - mtcr r23 /* restore CR */ - - mfmsr r22 - li r23, MSR_RI - andc r22,r22,r23 - mtmsrd r22,1 - - ld r22,EX_SRR0(r21) /* Get SRR0 from exc. frame */ - ld r23,EX_SRR1(r21) /* Get SRR1 from exc. frame */ - mtspr SRR0,r22 - mtspr SRR1,r23 - ld r22,EX_R22(r21) /* restore r22 and r23 */ - ld r23,EX_R23(r21) - mfspr r20,SPRG2 - mfspr r21,SPRG1 - rfid + lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ + ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */ -unrecov_stab: - EXCEPTION_PROLOG_COMMON - li r6,0x4100 - li r20,0 - bl .save_remaining_regs -1: addi r3,r1,STACK_FRAME_OVERHEAD - bl .unrecoverable_exception - b 1b + andi. r10,r12,MSR_RI + beq- unrecov_slb + + mtcrf 0x80,r9 /* restore CR */ + + mfmsr r10 + clrrdi r10,r10,2 + mtmsrd r10,1 + + mtspr SRR0,r11 + mtspr SRR1,r12 + ld r9,PACA_EXSLB+EX_R9(r13) + ld r10,PACA_EXSLB+EX_R10(r13) + ld r11,PACA_EXSLB+EX_R11(r13) + ld r12,PACA_EXSLB+EX_R12(r13) + ld r13,PACA_EXSLB+EX_R13(r13) + rfid /* - * r20 points to the PACA, r21 to the exception frame, - * r23 contains the saved CR. - * r20 - r23, SRR0 and SRR1 are saved in the exception frame. + * r13 points to the PACA, r9 contains the saved CR, + * r11 and r12 contain the saved SRR0 and SRR1. + * r9 - r13 are saved in paca->exslb. * We assume we aren't going to take any exceptions during this procedure. */ /* XXX note fix masking in get_kernel_vsid to match */ _GLOBAL(do_slb_bolted) - stw r23,EX_CCR(r21) /* save CR in exc. frame */ + stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ + std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */ /* * We take the next entry, round robin. Previously we tried @@ -1122,15 +1162,15 @@ * we dont have any LRU information to help us choose a slot. */ - /* r20 = paca */ -1: ld r22,PACASTABRR(r20) - addi r21,r22,1 - cmpdi r21,SLB_NUM_ENTRIES + /* r13 = paca */ +1: ld r10,PACASTABRR(r13) + addi r9,r10,1 + cmpdi r9,SLB_NUM_ENTRIES blt+ 2f - li r21,2 /* dont touch slot 0 or 1 */ -2: std r21,PACASTABRR(r20) + li r9,2 /* dont touch slot 0 or 1 */ +2: std r9,PACASTABRR(r13) - /* r20 = paca, r22 = entry */ + /* r13 = paca, r10 = entry */ /* * Never cast out the segment for our kernel stack. Since we @@ -1139,8 +1179,8 @@ * which gets invalidated due to a tlbie from another cpu at a * non recoverable point (after setting srr0/1) - Anton */ - slbmfee r21,r22 - srdi r21,r21,27 + slbmfee r9,r10 + srdi r9,r9,27 /* * Use paca->ksave as the value of the kernel stack pointer, * because this is valid at all times. @@ -1150,74 +1190,71 @@ * switch (between updating r1 and updating paca->ksave), * we check against both r1 and paca->ksave. */ - srdi r23,r1,27 - ori r23,r23,1 - cmpd r23,r21 + srdi r11,r1,27 + ori r11,r11,1 + cmpd r11,r9 beq- 1b - ld r23,PACAKSAVE(r20) - srdi r23,r23,27 - ori r23,r23,1 - cmpd r23,r21 + ld r11,PACAKSAVE(r13) + srdi r11,r11,27 + ori r11,r11,1 + cmpd r11,r9 beq- 1b - /* r20 = paca, r22 = entry */ + /* r13 = paca, r10 = entry */ /* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */ - mfspr r21,DAR - rldicl r23,r21,36,51 - sldi r23,r23,15 - srdi r21,r21,60 - or r23,r23,r21 + mfspr r9,DAR + rldicl r11,r9,36,51 + sldi r11,r11,15 + srdi r9,r9,60 + or r11,r11,r9 /* VSID_RANDOMIZER */ - li r21,9 - sldi r21,r21,32 - oris r21,r21,58231 - ori r21,r21,39831 + li r9,9 + sldi r9,r9,32 + oris r9,r9,58231 + ori r9,r9,39831 /* vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK */ - mulld r23,r23,r21 - clrldi r23,r23,28 + mulld r11,r11,r9 + clrldi r11,r11,28 - /* r20 = paca, r22 = entry, r23 = vsid */ + /* r13 = paca, r10 = entry, r11 = vsid */ /* Put together slb word1 */ - sldi r23,r23,12 + sldi r11,r11,12 BEGIN_FTR_SECTION /* set kp and c bits */ - ori r23,r23,0x480 + ori r11,r11,0x480 END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE) BEGIN_FTR_SECTION /* set kp, l and c bits */ - ori r23,r23,0x580 + ori r11,r11,0x580 END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE) - /* r20 = paca, r22 = entry, r23 = slb word1 */ + /* r13 = paca, r10 = entry, r11 = slb word1 */ /* Put together slb word0 */ - mfspr r21,DAR - rldicr r21,r21,0,35 /* get the new esid */ - oris r21,r21,2048 /* set valid bit */ - rldimi r21,r22,0,52 /* insert entry */ + mfspr r9,DAR + clrrdi r9,r9,28 /* get the new esid */ + oris r9,r9,0x800 /* set valid bit */ + rldimi r9,r10,0,52 /* insert entry */ - /* r20 = paca, r21 = slb word0, r23 = slb word1 */ + /* r13 = paca, r9 = slb word0, r11 = slb word1 */ /* * No need for an isync before or after this slbmte. The exception * we enter with and the rfid we exit with are context synchronizing . */ - slbmte r23,r21 + slbmte r11,r9 /* All done -- return from exception. */ - ld r21,PACAEXCSP(r20) /* Get the exception frame pointer */ - addi r21,r21,EXC_FRAME_SIZE - lwz r23,EX_CCR(r21) /* get saved CR */ - /* note that this is almost identical to maskable_exception_exit */ - - ld r22,EX_SRR1(r21) - andi. r22,r22,MSR_RI - beq- unrecov_stab + lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ + ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */ + + andi. r10,r12,MSR_RI /* check for unrecoverable exception */ + beq- unrecov_slb /* * Until everyone updates binutils hardwire the POWER4 optimised @@ -1226,124 +1263,32 @@ #if 0 .machine push .machine "power4" - mtcrf 0x80,r23 + mtcrf 0x80,r9 .machine pop #else - .long 0x7ef80120 + .long 0x7d380120 #endif - mfmsr r22 - li r23, MSR_RI - andc r22,r22,r23 - mtmsrd r22,1 - - ld r22,EX_SRR0(r21) /* Get SRR0 from exc. frame */ - ld r23,EX_SRR1(r21) /* Get SRR1 from exc. frame */ - mtspr SRR0,r22 - mtspr SRR1,r23 - ld r22,EX_R22(r21) /* restore r22 and r23 */ - ld r23,EX_R23(r21) - ld r20,EX_R20(r21) - mfspr r21,SPRG1 + mfmsr r10 + clrrdi r10,r10,2 + mtmsrd r10,1 + + mtspr SRR0,r11 + mtspr SRR1,r12 + ld r9,PACA_EXSLB+EX_R9(r13) + ld r10,PACA_EXSLB+EX_R10(r13) + ld r11,PACA_EXSLB+EX_R11(r13) + ld r12,PACA_EXSLB+EX_R12(r13) + ld r13,PACA_EXSLB+EX_R13(r13) rfid -_GLOBAL(do_stab_SI) - mflr r21 /* Save LR in r21 */ - - /* - * r3 contains the faulting address - * r4 contains the required access permissions - * - * at return r3 = 0 for success - */ - - bl .ste_allocate /* build STE if possible */ - or. r3,r3,r3 /* Check return code */ - beq fast_exception_return /* Return from exception on success */ - mtlr r21 /* restore LR */ - blr /* Return to DSI or ISI on failure */ - -/* - * This code finishes saving the registers to the exception frame. - * Address translation is already on. - */ -_GLOBAL(save_remaining_regs) - /* - * Save the rest of the registers into the pt_regs structure - */ - std r22,_NIP(r1) - std r23,_MSR(r1) - std r6,TRAP(r1) - ld r6,GPR6(r1) - SAVE_2GPRS(14, r1) - SAVE_4GPRS(16, r1) - SAVE_8GPRS(24, r1) - - /* Set the marker value "regshere" just before the reg values */ - SET_REG_TO_CONST(r22, 0x7265677368657265) - std r22,STACK_FRAME_OVERHEAD-16(r1) - - /* - * Clear the RESULT field - */ - li r22,0 - std r22,RESULT(r1) - - /* - * Test if from user state; result will be tested later - */ - andi. r23,r23,MSR_PR /* Set CR for later branch */ - - /* - * Indicate that r1 contains the kernel stack and - * get the Kernel TOC pointer from the paca - */ - ld r2,PACATOC(r13) /* Get Kernel TOC pointer */ - - /* - * If from user state, update THREAD.regs - */ - beq 2f /* Modify THREAD.regs if from user */ - addi r23,r1,STACK_FRAME_OVERHEAD - ld r22, PACACURRENT(r13) - std r23,THREAD+PT_REGS(r22) -2: - SET_REG_TO_CONST(r22, MSR_KERNEL) - -#ifdef DO_SOFT_DISABLE - stb r20,PACAPROCENABLED(r13) /* possibly soft enable */ - ori r22,r22,MSR_EE /* always hard enable */ -#else - rldimi r22,r20,15,48 /* Insert desired EE value */ -#endif - - mtmsrd r22,1 - blr - -/* - * Kernel profiling with soft disable on iSeries - */ -do_profile: - ld r22,8(r21) /* Get SRR1 */ - andi. r22,r22,MSR_PR /* Test if in kernel */ - bnelr /* return if not in kernel */ - ld r22,0(r21) /* Get SRR0 */ - ld r25,PACAPROFSTEXT(r20) /* _stext */ - subf r22,r25,r22 /* offset into kernel */ - lwz r25,PACAPROFSHIFT(r20) - srd r22,r22,r25 - lwz r25,PACAPROFLEN(r20) /* length of profile table (-1) */ - cmp 0,r22,r25 /* off end? */ - ble 1f - mr r22,r25 /* force into last entry */ -1: sldi r22,r22,2 /* convert to offset into buffer */ - ld r25,PACAPROFBUFFER(r20) /* profile buffer */ - add r25,r25,r22 -2: lwarx r22,0,r25 /* atomically increment */ - addi r22,r22,1 - stwcx. r22,0,r25 - bne- 2b - blr +unrecov_slb: + EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB) + DISABLE_INTS + bl .save_nvgprs +1: addi r3,r1,STACK_FRAME_OVERHEAD + bl .unrecoverable_exception + b 1b /* @@ -1375,7 +1320,7 @@ addi r1,r1,0x1000 subi r1,r1,STACK_FRAME_OVERHEAD - cmpi 0,r23,0 + cmpwi 0,r23,0 #ifdef CONFIG_SMP #ifdef SECONDARY_PROCESSORS bne .__secondary_start @@ -1594,9 +1539,9 @@ * */ #ifndef CONFIG_SMP - LOADBASE(r3,last_task_used_math) - ld r4,last_task_used_math@l(r3) - cmpi 0,r4,0 + ld r3,last_task_used_math@got(r2) + ld r4,0(r3) + cmpdi 0,r4,0 beq 1f /* Save FP state to last_task_used_math's THREAD struct */ addi r4,r4,THREAD @@ -1606,8 +1551,8 @@ /* Disable FP for last_task_used_math */ ld r5,PT_REGS(r4) ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) - li r20,MSR_FP|MSR_FE0|MSR_FE1 - andc r4,r4,r20 + li r6,MSR_FP|MSR_FE0|MSR_FE1 + andc r4,r4,r6 std r4,_MSR-STACK_FRAME_OVERHEAD(r5) 1: #endif /* CONFIG_SMP */ @@ -1615,15 +1560,16 @@ ld r4,PACACURRENT(r13) addi r5,r4,THREAD /* Get THREAD */ ld r4,THREAD_FPEXC_MODE(r5) - ori r23,r23,MSR_FP - or r23,r23,r4 + ori r12,r12,MSR_FP + or r12,r12,r4 + std r12,_MSR(r1) lfd fr0,THREAD_FPSCR(r5) mtfsf 0xff,fr0 REST_32FPRS(0, r5) #ifndef CONFIG_SMP /* Update last_task_used_math to 'current' */ subi r4,r5,THREAD /* Back to 'current' */ - std r4,last_task_used_math@l(r3) + std r4,0(r3) #endif /* CONFIG_SMP */ /* restore registers and return */ b fast_exception_return @@ -1651,11 +1597,11 @@ ori r5,r5,MSR_FP mtmsrd r5 /* enable use of fpu now */ isync - cmpi 0,r3,0 + cmpdi 0,r3,0 beqlr- /* if no previous owner, done */ addi r3,r3,THREAD /* want THREAD of task */ ld r5,PT_REGS(r3) - cmpi 0,r5,0 + cmpdi 0,r5,0 SAVE_32FPRS(0, r3) mffs fr0 stfd fr0,THREAD_FPSCR(r3) @@ -1667,8 +1613,8 @@ 1: #ifndef CONFIG_SMP li r5,0 - LOADBASE(r4,last_task_used_math) - std r5,last_task_used_math@l(r4) + ld r4,last_task_used_math@got(r2) + std r5,0(r4) #endif /* CONFIG_SMP */ blr @@ -1699,9 +1645,9 @@ * avoid saving all of the VREGs here... */ #ifndef CONFIG_SMP - LOADBASE(r3,last_task_used_altivec) - ld r4,last_task_used_altivec@l(r3) - cmpi 0,r4,0 + ld r3,last_task_used_altivec@got(r2) + ld r4,0(r3) + cmpdi 0,r4,0 beq 1f /* Save VMX state to last_task_used_altivec's THREAD struct */ addi r4,r4,THREAD @@ -1712,8 +1658,8 @@ /* Disable VMX for last_task_used_altivec */ ld r5,PT_REGS(r4) ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) - lis r20,MSR_VEC@h - andc r4,r4,r20 + lis r6,MSR_VEC@h + andc r4,r4,r6 std r4,_MSR-STACK_FRAME_OVERHEAD(r5) 1: #endif /* CONFIG_SMP */ @@ -1723,7 +1669,7 @@ * all 1's */ mfspr r4,SPRN_VRSAVE - cmpi 0,r4,0 + cmpdi 0,r4,0 bne+ 1f li r4,-1 mtspr SPRN_VRSAVE,r4 @@ -1731,7 +1677,8 @@ /* enable use of VMX after return */ ld r4,PACACURRENT(r13) addi r5,r4,THREAD /* Get THREAD */ - oris r23,r23,MSR_VEC@h + oris r12,r12,MSR_VEC@h + std r12,_MSR(r1) li r4,1 li r10,THREAD_VSCR stw r4,THREAD_USED_VR(r5) @@ -1740,7 +1687,7 @@ #ifndef CONFIG_SMP /* Update last_task_used_math to 'current' */ subi r4,r5,THREAD /* Back to 'current' */ - std r4,last_task_used_altivec@l(r3) + std r4,0(r3) #endif /* CONFIG_SMP */ /* restore registers and return */ b fast_exception_return @@ -1768,11 +1715,11 @@ oris r5,r5,MSR_VEC@h mtmsrd r5 /* enable use of VMX now */ isync - cmpi 0,r3,0 + cmpdi 0,r3,0 beqlr- /* if no previous owner, done */ addi r3,r3,THREAD /* want THREAD of task */ ld r5,PT_REGS(r3) - cmpi 0,r5,0 + cmpdi 0,r5,0 SAVE_32VRS(0,r4,r3) mfvscr vr0 li r4,THREAD_VSCR @@ -1785,8 +1732,8 @@ 1: #ifndef CONFIG_SMP li r5,0 - LOADBASE(r4,last_task_used_altivec) - std r5,last_task_used_altivec@l(r4) + ld r4,last_task_used_altivec@got(r2) + std r5,0(r4) #endif /* CONFIG_SMP */ blr @@ -1885,8 +1832,9 @@ LOADADDR(r3,current_set) sldi r28,r24,3 /* get current_set[cpu#] */ ldx r1,r3,r28 - addi r1,r1,THREAD_SIZE - subi r1,r1,STACK_FRAME_OVERHEAD + addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD + li r0,0 + std r0,0(r1) std r1,PACAKSAVE(r13) ld r3,PACASTABREAL(r13) /* get raddr of segment table */ @@ -1943,7 +1891,7 @@ #endif /* - * This subroutine clobbers r11, r12 and the LR + * This subroutine clobbers r11 and r12 */ _GLOBAL(enable_64b_mode) mfmsr r11 /* grab the current MSR */ @@ -2144,7 +2092,6 @@ std r4,PACACURRENT(r13) std r2,PACATOC(r13) - li r5,0 std r1,PACAKSAVE(r13) /* Restore the parms passed in from the bootloader. */ diff -Nru a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c --- a/arch/ppc64/kernel/iSeries_setup.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/kernel/iSeries_setup.c 2004-06-23 19:04:28 -07:00 @@ -357,15 +357,14 @@ HvCallEvent_dmaToSp(cmd_line, 2 * 64* 1024, 256, HvLpDma_Direction_RemoteToLocal); - p = q = cmd_line + 255; - while (p > cmd_line) { - if ((*p == 0) || (*p == ' ') || (*p == '\n')) - --p; - else + p = cmd_line; + q = cmd_line + 255; + while( p < q ) { + if (!*p || *p == '\n') break; + ++p; } - if (p < q) - *(p + 1) = 0; + *p = 0; if (strstr(cmd_line, "dprofile=")) { for (q = cmd_line; (p = strstr(q, "dprofile=")) != 0; ) { diff -Nru a/arch/ppc64/kernel/init_task.c b/arch/ppc64/kernel/init_task.c --- a/arch/ppc64/kernel/init_task.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ppc64/kernel/init_task.c 2004-06-23 19:04:26 -07:00 @@ -4,6 +4,7 @@ #include #include #include +#include #include static struct fs_struct init_fs = INIT_FS; diff -Nru a/arch/ppc64/kernel/mf_proc.c b/arch/ppc64/kernel/mf_proc.c --- a/arch/ppc64/kernel/mf_proc.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ppc64/kernel/mf_proc.c 2004-06-23 19:04:26 -07:00 @@ -25,33 +25,26 @@ { int len = count; char *p; - + + if (off) { + *eof = 1; + return 0; + } + len = mf_getCmdLine(page, &len, (u64)data); - p = page + len - 1; - while (p > page) { - if ((*p == 0) || (*p == ' ')) - --p; - else + p = page; + while (len < (count - 1)) { + if (!*p || *p == '\n') break; + p++; + len++; } - if (*p != '\n') { - ++p; - *p = '\n'; - } - ++p; + *p = '\n'; + p++; *p = 0; - len = p - page; - - len -= off; - if (len < count) { - *eof = 1; - if (len <= 0) - return 0; - } else - len = count; - *start = page + off; - return len; + + return p - page; } #if 0 diff -Nru a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S --- a/arch/ppc64/kernel/misc.S 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/kernel/misc.S 2004-06-23 19:04:28 -07:00 @@ -85,16 +85,17 @@ cmpw 0,r3,r5 beqlr /* are we enabling interrupts? */ - cmpi 0,r3,0 + cmpdi 0,r3,0 stb r3,PACAPROCENABLED(r13) beqlr /* Check pending interrupts */ /* A decrementer, IPI or PMC interrupt may have occurred * while we were in the hypervisor (which enables) */ - CHECKANYINT(r4,r5) + ld r4,PACALPPACA+LPPACAANYINT(r13) + cmpdi r4,0 beqlr - /* + /* * Handle pending interrupts in interrupt context */ li r0,0x5555 @@ -608,7 +609,7 @@ _GLOBAL(sys_call_table32) .llong .sys_restart_syscall /* 0 */ .llong .sys_exit - .llong .sys_fork + .llong .ppc_fork .llong .sys_read .llong .sys_write .llong .sys32_open /* 5 */ @@ -678,7 +679,7 @@ .llong .sys32_ssetmask .llong .sys_setreuid /* 70 */ .llong .sys_setregid - .llong .sys32_sigsuspend + .llong .ppc32_sigsuspend .llong .compat_sys_sigpending .llong .sys32_sethostname .llong .compat_sys_setrlimit /* 75 */ @@ -726,7 +727,7 @@ .llong .sys32_ipc .llong .sys_fsync .llong .ppc32_sigreturn - .llong .sys_clone /* 120 */ + .llong .ppc_clone /* 120 */ .llong .sys32_setdomainname .llong .ppc64_newuname .llong .sys_ni_syscall /* old modify_ldt syscall */ @@ -784,7 +785,7 @@ .llong .sys32_rt_sigpending /* 175 */ .llong .sys32_rt_sigtimedwait .llong .sys32_rt_sigqueueinfo - .llong .sys32_rt_sigsuspend + .llong .ppc32_rt_sigsuspend .llong .sys32_pread64 .llong .sys32_pwrite64 /* 180 */ .llong .sys_chown @@ -795,7 +796,7 @@ .llong .sys32_sendfile .llong .sys_ni_syscall /* reserved for streams1 */ .llong .sys_ni_syscall /* reserved for streams2 */ - .llong .sys_vfork + .llong .ppc_vfork .llong .compat_sys_getrlimit /* 190 */ .llong .sys32_readahead .llong .sys32_mmap2 @@ -880,7 +881,7 @@ _GLOBAL(sys_call_table) .llong .sys_restart_syscall /* 0 */ .llong .sys_exit - .llong .sys_fork + .llong .ppc_fork .llong .sys_read .llong .sys_write .llong .sys_open /* 5 */ @@ -998,7 +999,7 @@ .llong .sys_ipc .llong .sys_fsync .llong .sys_ni_syscall - .llong .sys_clone /* 120 */ + .llong .ppc_clone /* 120 */ .llong .sys_setdomainname .llong .ppc64_newuname .llong .sys_ni_syscall /* old modify_ldt syscall */ @@ -1056,7 +1057,7 @@ .llong .sys_rt_sigpending /* 175 */ .llong .sys_rt_sigtimedwait .llong .sys_rt_sigqueueinfo - .llong .sys_rt_sigsuspend + .llong .ppc64_rt_sigsuspend .llong .sys_pread64 .llong .sys_pwrite64 /* 180 */ .llong .sys_chown @@ -1067,7 +1068,7 @@ .llong .sys_sendfile64 .llong .sys_ni_syscall /* reserved for streams1 */ .llong .sys_ni_syscall /* reserved for streams2 */ - .llong .sys_vfork + .llong .ppc_vfork .llong .sys_getrlimit /* 190 */ .llong .sys_readahead .llong .sys_ni_syscall /* 32bit only mmap2 */ diff -Nru a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c --- a/arch/ppc64/kernel/pacaData.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/kernel/pacaData.c 2004-06-23 19:04:28 -07:00 @@ -62,8 +62,6 @@ .xDesc = 0xd397d9e2, /* "LpRS" */ \ .xSize = sizeof(struct ItLpRegSave) \ }, \ - .exception_sp = \ - (&paca[number].exception_stack[0]) - EXC_FRAME_SIZE, \ } struct paca_struct paca[] __page_aligned = { diff -Nru a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c --- a/arch/ppc64/kernel/ppc_ksyms.c 2004-06-23 19:04:26 -07:00 +++ b/arch/ppc64/kernel/ppc_ksyms.c 2004-06-23 19:04:26 -07:00 @@ -50,7 +50,6 @@ int abs(int); EXPORT_SYMBOL(do_signal); -EXPORT_SYMBOL(sys_ioctl); EXPORT_SYMBOL(isa_io_base); EXPORT_SYMBOL(pci_io_base); diff -Nru a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c --- a/arch/ppc64/kernel/process.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/kernel/process.c 2004-06-23 19:04:27 -07:00 @@ -65,8 +65,43 @@ .page_table_lock = SPIN_LOCK_UNLOCKED, }; +/* + * Make sure the floating-point register state in the + * the thread_struct is up to date for task tsk. + */ +void flush_fp_to_thread(struct task_struct *tsk) +{ + if (tsk->thread.regs) { + /* + * We need to disable preemption here because if we didn't, + * another process could get scheduled after the regs->msr + * test but before we have finished saving the FP registers + * to the thread_struct. That process could take over the + * FPU, and then when we get scheduled again we would store + * bogus values for the remaining FP registers. + */ + preempt_disable(); + if (tsk->thread.regs->msr & MSR_FP) { +#ifdef CONFIG_SMP + /* + * This should only ever be called for current or + * for a stopped child process. Since we save away + * the FP register state on context switch on SMP, + * there is something wrong if a stopped child appears + * to still have its FP state in the CPU registers. + */ + BUG_ON(tsk != current); +#endif + giveup_fpu(current); + } + preempt_enable(); + } +} + void enable_kernel_fp(void) { + WARN_ON(preemptible()); + #ifdef CONFIG_SMP if (current->thread.regs && (current->thread.regs->msr & MSR_FP)) giveup_fpu(current); @@ -80,12 +115,9 @@ int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs) { - struct pt_regs *regs = tsk->thread.regs; - - if (!regs) + if (!tsk->thread.regs) return 0; - if (tsk == current && (regs->msr & MSR_FP)) - giveup_fpu(current); + flush_fp_to_thread(current); memcpy(fpregs, &tsk->thread.fpr[0], sizeof(*fpregs)); @@ -96,6 +128,8 @@ void enable_kernel_altivec(void) { + WARN_ON(preemptible()); + #ifdef CONFIG_SMP if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) giveup_altivec(current); @@ -107,10 +141,29 @@ } EXPORT_SYMBOL(enable_kernel_altivec); +/* + * Make sure the VMX/Altivec register state in the + * the thread_struct is up to date for task tsk. + */ +void flush_altivec_to_thread(struct task_struct *tsk) +{ +#ifdef CONFIG_ALTIVEC + if (tsk->thread.regs) { + preempt_disable(); + if (tsk->thread.regs->msr & MSR_VEC) { +#ifdef CONFIG_SMP + BUG_ON(tsk != current); +#endif + giveup_altivec(current); + } + preempt_enable(); + } +#endif +} + int dump_task_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs) { - if (regs->msr & MSR_VEC) - giveup_altivec(current); + flush_altivec_to_thread(current); memcpy(vrregs, ¤t->thread.vr[0], sizeof(*vrregs)); return 1; } @@ -166,6 +219,7 @@ void show_regs(struct pt_regs * regs) { int i; + unsigned long trap; printk("NIP: %016lX XER: %016lX LR: %016lX\n", regs->nip, regs->xer, regs->link); @@ -176,7 +230,8 @@ regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0, regs->msr&MSR_IR ? 1 : 0, regs->msr&MSR_DR ? 1 : 0); - if (regs->trap == 0x300 || regs->trap == 0x380 || regs->trap == 0x600) + trap = TRAP(regs); + if (trap == 0x300 || trap == 0x380 || trap == 0x600) printk("DAR: %016lx, DSISR: %016lx\n", regs->dar, regs->dsisr); printk("TASK: %p[%d] '%s' THREAD: %p", current, current->pid, current->comm, current->thread_info); @@ -191,6 +246,8 @@ } printk("%016lX ", regs->gpr[i]); + if (i == 13 && !FULL_REGS(regs)) + break; } printk("\n"); /* @@ -245,16 +302,8 @@ */ void prepare_to_copy(struct task_struct *tsk) { - struct pt_regs *regs = tsk->thread.regs; - - if (regs == NULL) - return; - if (regs->msr & MSR_FP) - giveup_fpu(current); -#ifdef CONFIG_ALTIVEC - if (regs->msr & MSR_VEC) - giveup_altivec(current); -#endif /* CONFIG_ALTIVEC */ + flush_fp_to_thread(current); + flush_altivec_to_thread(current); } /* @@ -439,12 +488,8 @@ error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; - if (regs->msr & MSR_FP) - giveup_fpu(current); -#ifdef CONFIG_ALTIVEC - if (regs->msr & MSR_VEC) - giveup_altivec(current); -#endif /* CONFIG_ALTIVEC */ + flush_fp_to_thread(current); + flush_altivec_to_thread(current); error = do_execve(filename, (char __user * __user *) a1, (char __user * __user *) a2, regs); diff -Nru a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c --- a/arch/ppc64/kernel/ptrace.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/kernel/ptrace.c 2004-06-23 19:04:28 -07:00 @@ -119,8 +119,7 @@ if (index < PT_FPR0) { tmp = get_reg(child, (int)index); } else { - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0]; } ret = put_user(tmp,(unsigned long __user *) data); @@ -152,8 +151,7 @@ if (index < PT_FPR0) { ret = put_reg(child, index, data); } else { - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); ((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data; ret = 0; } @@ -245,8 +243,7 @@ unsigned long *reg = &((unsigned long *)child->thread.fpr)[0]; unsigned long __user *tmp = (unsigned long __user *)addr; - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); for (i = 0; i < 32; i++) { ret = put_user(*reg, tmp); @@ -263,8 +260,7 @@ unsigned long *reg = &((unsigned long *)child->thread.fpr)[0]; unsigned long __user *tmp = (unsigned long __user *)addr; - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); for (i = 0; i < 32; i++) { ret = get_user(*reg, tmp); diff -Nru a/arch/ppc64/kernel/ptrace32.c b/arch/ppc64/kernel/ptrace32.c --- a/arch/ppc64/kernel/ptrace32.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/kernel/ptrace32.c 2004-06-23 19:04:27 -07:00 @@ -136,8 +136,7 @@ if (index < PT_FPR0) { tmp = get_reg(child, index); } else { - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); /* * the user space code considers the floating point * to be an array of unsigned int (32 bits) - the @@ -179,8 +178,7 @@ break; if (numReg >= PT_FPR0) { - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); tmp = ((unsigned long int *)child->thread.fpr)[numReg - PT_FPR0]; } else { /* register within PT_REGS struct */ tmp = get_reg(child, numReg); @@ -244,8 +242,7 @@ if (index < PT_FPR0) { ret = put_reg(child, index, data); } else { - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); /* * the user space code considers the floating point * to be an array of unsigned int (32 bits) - the @@ -283,8 +280,7 @@ || ((numReg > PT_CCR) && (numReg < PT_FPR0))) break; if (numReg >= PT_FPR0) { - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); } if (numReg == PT_MSR) data = (data & MSR_DEBUGCHANGE) @@ -379,8 +375,7 @@ unsigned long *reg = &((unsigned long *)child->thread.fpr)[0]; unsigned int __user *tmp = (unsigned int __user *)addr; - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); for (i = 0; i < 32; i++) { ret = put_user(*reg, tmp); @@ -397,8 +392,7 @@ unsigned long *reg = &((unsigned long *)child->thread.fpr)[0]; unsigned int __user *tmp = (unsigned int __user *)addr; - if (child->thread.regs->msr & MSR_FP) - giveup_fpu(child); + flush_fp_to_thread(child); for (i = 0; i < 32; i++) { ret = get_user(*reg, tmp); diff -Nru a/arch/ppc64/kernel/rtas.c b/arch/ppc64/kernel/rtas.c --- a/arch/ppc64/kernel/rtas.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc64/kernel/rtas.c 2004-06-23 19:04:25 -07:00 @@ -68,10 +68,11 @@ void call_rtas_display_status(char c) { - struct rtas_args *args = &(get_paca()->xRtas); + struct rtas_args *args; unsigned long s; spin_lock_irqsave(&rtas.lock, s); + args = &(get_paca()->xRtas); args->token = 10; args->nargs = 1; @@ -145,7 +146,7 @@ va_list list; int i, logit = 0; unsigned long s; - struct rtas_args *rtas_args = &(get_paca()->xRtas); + struct rtas_args *rtas_args; long ret; PPCDBG(PPCDBG_RTAS, "Entering rtas_call\n"); @@ -158,6 +159,7 @@ /* Gotta do something different here, use global lock for now... */ spin_lock_irqsave(&rtas.lock, s); + rtas_args = &(get_paca()->xRtas); rtas_args->token = token; rtas_args->nargs = nargs; diff -Nru a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c --- a/arch/ppc64/kernel/signal.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc64/kernel/signal.c 2004-06-23 19:04:25 -07:00 @@ -131,8 +131,7 @@ #endif long err = 0; - if (regs->msr & MSR_FP) - giveup_fpu(current); + flush_fp_to_thread(current); /* Make sure signal doesn't get spurrious FP exceptions */ current->thread.fpscr = 0; @@ -141,9 +140,8 @@ err |= __put_user(v_regs, &sc->v_regs); /* save altivec registers */ - if (current->thread.used_vr) { - if (regs->msr & MSR_VEC) - giveup_altivec(current); + if (current->thread.used_vr) { + flush_altivec_to_thread(current); /* Copy 33 vec registers (vr0..31 and vscr) to the stack */ err |= __copy_to_user(v_regs, current->thread.vr, 33 * sizeof(vector128)); /* set MSR_VEC in the MSR value in the frame to indicate that sc->v_reg) @@ -530,13 +528,13 @@ struct k_sigaction *ka = ¤t->sighand->action[signr-1]; /* Whee! Actually deliver the signal. */ - if (regs->trap == 0x0C00) + if (TRAP(regs) == 0x0C00) syscall_restart(regs, ka); handle_signal(signr, ka, &info, oldset, regs); return 1; } - if (regs->trap == 0x0C00) { /* System Call! */ + if (TRAP(regs) == 0x0C00) { /* System Call! */ if ((int)regs->result == -ERESTARTNOHAND || (int)regs->result == -ERESTARTSYS || (int)regs->result == -ERESTARTNOINTR) { diff -Nru a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c --- a/arch/ppc64/kernel/signal32.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/kernel/signal32.c 2004-06-23 19:04:28 -07:00 @@ -130,11 +130,10 @@ { elf_greg_t64 *gregs = (elf_greg_t64 *)regs; int i, err = 0; - - /* Make sure floating point registers are stored in regs */ - if (regs->msr & MSR_FP) - giveup_fpu(current); - + + /* Make sure floating point registers are stored in regs */ + flush_fp_to_thread(current); + /* save general and floating-point registers */ for (i = 0; i <= PT_RESULT; i ++) err |= __put_user((unsigned int)gregs[i], &frame->mc_gregs[i]); @@ -148,8 +147,7 @@ #ifdef CONFIG_ALTIVEC /* save altivec registers */ if (current->thread.used_vr) { - if (regs->msr & MSR_VEC) - giveup_altivec(current); + flush_altivec_to_thread(current); if (__copy_to_user(&frame->mc_vregs, current->thread.vr, ELF_NVRREG32 * sizeof(vector128))) return 1; @@ -934,7 +932,7 @@ ka = (signr == 0)? NULL: ¤t->sighand->action[signr-1]; - if (regs->trap == 0x0C00 /* System Call! */ + if (TRAP(regs) == 0x0C00 /* System Call! */ && regs->ccr & 0x10000000 /* error signalled */ && ((ret = regs->gpr[3]) == ERESTARTSYS || ret == ERESTARTNOHAND || ret == ERESTARTNOINTR diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c --- a/arch/ppc64/kernel/sys_ppc32.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/kernel/sys_ppc32.c 2004-06-23 19:04:27 -07:00 @@ -617,12 +617,8 @@ error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; - if (regs->msr & MSR_FP) - giveup_fpu(current); -#ifdef CONFIG_ALTIVEC - if (regs->msr & MSR_VEC) - giveup_altivec(current); -#endif /* CONFIG_ALTIVEC */ + flush_fp_to_thread(current); + flush_altivec_to_thread(current); error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs); diff -Nru a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c --- a/arch/ppc64/kernel/syscalls.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/kernel/syscalls.c 2004-06-23 19:04:27 -07:00 @@ -237,5 +237,19 @@ return secs; } +void do_show_syscall(unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7, unsigned long r8, + struct pt_regs *regs) +{ + printk("syscall %ld(%lx, %lx, %lx, %lx, %lx, %lx) regs=%p current=%p" + " cpu=%d\n", regs->gpr[0], r3, r4, r5, r6, r7, r8, regs, + current, smp_processor_id()); +} + +void do_show_syscall_exit(unsigned long r3) +{ + printk(" -> %lx, current=%p cpu=%d\n", r3, current, smp_processor_id()); +} + /* Only exists on P-series. */ cond_syscall(ppc_rtas); diff -Nru a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c --- a/arch/ppc64/kernel/sysfs.c 2004-06-23 19:04:25 -07:00 +++ b/arch/ppc64/kernel/sysfs.c 2004-06-23 19:04:25 -07:00 @@ -325,6 +325,16 @@ #ifdef CONFIG_NUMA parent = &node_devices[cpu_to_node(cpu)]; #endif + /* + * For now, we just see if the system supports making + * the RTAS calls for CPU hotplug. But, there may be a + * more comprehensive way to do this for an individual + * CPU. For instance, the boot cpu might never be valid + * for hotplugging. + */ + if (systemcfg->platform != PLATFORM_PSERIES_LPAR) + c->no_control = 1; + register_cpu(c, cpu, parent); register_cpu_pmc(&c->sysdev); diff -Nru a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c --- a/arch/ppc64/kernel/traps.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/kernel/traps.c 2004-06-23 19:04:27 -07:00 @@ -308,8 +308,7 @@ siginfo_t info; unsigned long fpscr; - if (regs->msr & MSR_FP) - giveup_fpu(current); + flush_fp_to_thread(current); fpscr = current->thread.fpscr; @@ -442,8 +441,22 @@ die("Unrecoverable FP Unavailable Exception", regs, SIGABRT); } -void KernelAltivecUnavailableException(struct pt_regs *regs) +void AltivecUnavailableException(struct pt_regs *regs) { +#ifndef CONFIG_ALTIVEC + if (user_mode(regs)) { + /* A user program has executed an altivec instruction, + but this kernel doesn't support altivec. */ + siginfo_t info; + + memset(&info, 0, sizeof(info)); + info.si_signo = SIGILL; + info.si_code = ILL_ILLOPC; + info.si_addr = (void *) regs->nip; + _exception(SIGILL, &info, regs); + return; + } +#endif printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception " "%lx at %lx\n", regs->trap, regs->nip); die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); @@ -531,10 +544,39 @@ void AltivecAssistException(struct pt_regs *regs) { - if (regs->msr & MSR_VEC) - giveup_altivec(current); - /* XXX quick hack for now: set the non-Java bit in the VSCR */ - current->thread.vscr.u[3] |= 0x10000; + int err; + siginfo_t info; + + if (!user_mode(regs)) { + printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode" + " at %lx\n", regs->nip); + die("Kernel VMX/Altivec assist exception", regs, SIGILL); + } + + flush_altivec_to_thread(current); + + err = emulate_altivec(regs); + if (err == 0) { + regs->nip += 4; /* skip emulated instruction */ + emulate_single_step(regs); + return; + } + + if (err == -EFAULT) { + /* got an error reading the instruction */ + info.si_signo = SIGSEGV; + info.si_errno = 0; + info.si_code = SEGV_MAPERR; + info.si_addr = (void *) regs->nip; + force_sig_info(SIGSEGV, &info, current); + } else { + /* didn't recognize the instruction */ + /* XXX quick hack for now: set the non-Java bit in the VSCR */ + if (printk_ratelimit()) + printk(KERN_ERR "Unrecognized altivec instruction " + "in %s at %lx\n", current->comm, regs->nip); + current->thread.vscr.u[3] |= 0x10000; + } } #endif /* CONFIG_ALTIVEC */ diff -Nru a/arch/ppc64/kernel/vecemu.c b/arch/ppc64/kernel/vecemu.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc64/kernel/vecemu.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,346 @@ +/* + * Routines to emulate some Altivec/VMX instructions, specifically + * those that can trap when given denormalized operands in Java mode. + */ +#include +#include +#include +#include +#include +#include + +/* Functions in vector.S */ +extern void vaddfp(vector128 *dst, vector128 *a, vector128 *b); +extern void vsubfp(vector128 *dst, vector128 *a, vector128 *b); +extern void vmaddfp(vector128 *dst, vector128 *a, vector128 *b, vector128 *c); +extern void vnmsubfp(vector128 *dst, vector128 *a, vector128 *b, vector128 *c); +extern void vrefp(vector128 *dst, vector128 *src); +extern void vrsqrtefp(vector128 *dst, vector128 *src); +extern void vexptep(vector128 *dst, vector128 *src); + +static unsigned int exp2s[8] = { + 0x800000, + 0x8b95c2, + 0x9837f0, + 0xa5fed7, + 0xb504f3, + 0xc5672a, + 0xd744fd, + 0xeac0c7 +}; + +/* + * Computes an estimate of 2^x. The `s' argument is the 32-bit + * single-precision floating-point representation of x. + */ +static unsigned int eexp2(unsigned int s) +{ + int exp, pwr; + unsigned int mant, frac; + + /* extract exponent field from input */ + exp = ((s >> 23) & 0xff) - 127; + if (exp > 7) { + /* check for NaN input */ + if (exp == 128 && (s & 0x7fffff) != 0) + return s | 0x400000; /* return QNaN */ + /* 2^-big = 0, 2^+big = +Inf */ + return (s & 0x80000000)? 0: 0x7f800000; /* 0 or +Inf */ + } + if (exp < -23) + return 0x3f800000; /* 1.0 */ + + /* convert to fixed point integer in 9.23 representation */ + pwr = (s & 0x7fffff) | 0x800000; + if (exp > 0) + pwr <<= exp; + else + pwr >>= -exp; + if (s & 0x80000000) + pwr = -pwr; + + /* extract integer part, which becomes exponent part of result */ + exp = (pwr >> 23) + 126; + if (exp >= 254) + return 0x7f800000; + if (exp < -23) + return 0; + + /* table lookup on top 3 bits of fraction to get mantissa */ + mant = exp2s[(pwr >> 20) & 7]; + + /* linear interpolation using remaining 20 bits of fraction */ + asm("mulhwu %0,%1,%2" : "=r" (frac) + : "r" (pwr << 12), "r" (0x172b83ff)); + asm("mulhwu %0,%1,%2" : "=r" (frac) : "r" (frac), "r" (mant)); + mant += frac; + + if (exp >= 0) + return mant + (exp << 23); + + /* denormalized result */ + exp = -exp; + mant += 1 << (exp - 1); + return mant >> exp; +} + +/* + * Computes an estimate of log_2(x). The `s' argument is the 32-bit + * single-precision floating-point representation of x. + */ +static unsigned int elog2(unsigned int s) +{ + int exp, mant, lz, frac; + + exp = s & 0x7f800000; + mant = s & 0x7fffff; + if (exp == 0x7f800000) { /* Inf or NaN */ + if (mant != 0) + s |= 0x400000; /* turn NaN into QNaN */ + return s; + } + if ((exp | mant) == 0) /* +0 or -0 */ + return 0xff800000; /* return -Inf */ + + if (exp == 0) { + /* denormalized */ + asm("cntlzw %0,%1" : "=r" (lz) : "r" (mant)); + mant <<= lz - 8; + exp = (-118 - lz) << 23; + } else { + mant |= 0x800000; + exp -= 127 << 23; + } + + if (mant >= 0xb504f3) { /* 2^0.5 * 2^23 */ + exp |= 0x400000; /* 0.5 * 2^23 */ + asm("mulhwu %0,%1,%2" : "=r" (mant) + : "r" (mant), "r" (0xb504f334)); /* 2^-0.5 * 2^32 */ + } + if (mant >= 0x9837f0) { /* 2^0.25 * 2^23 */ + exp |= 0x200000; /* 0.25 * 2^23 */ + asm("mulhwu %0,%1,%2" : "=r" (mant) + : "r" (mant), "r" (0xd744fccb)); /* 2^-0.25 * 2^32 */ + } + if (mant >= 0x8b95c2) { /* 2^0.125 * 2^23 */ + exp |= 0x100000; /* 0.125 * 2^23 */ + asm("mulhwu %0,%1,%2" : "=r" (mant) + : "r" (mant), "r" (0xeac0c6e8)); /* 2^-0.125 * 2^32 */ + } + if (mant > 0x800000) { /* 1.0 * 2^23 */ + /* calculate (mant - 1) * 1.381097463 */ + /* 1.381097463 == 0.125 / (2^0.125 - 1) */ + asm("mulhwu %0,%1,%2" : "=r" (frac) + : "r" ((mant - 0x800000) << 1), "r" (0xb0c7cd3a)); + exp += frac; + } + s = exp & 0x80000000; + if (exp != 0) { + if (s) + exp = -exp; + asm("cntlzw %0,%1" : "=r" (lz) : "r" (exp)); + lz = 8 - lz; + if (lz > 0) + exp >>= lz; + else if (lz < 0) + exp <<= -lz; + s += ((lz + 126) << 23) + exp; + } + return s; +} + +#define VSCR_SAT 1 + +static int ctsxs(unsigned int x, int scale, unsigned int *vscrp) +{ + int exp, mant; + + exp = (x >> 23) & 0xff; + mant = x & 0x7fffff; + if (exp == 255 && mant != 0) + return 0; /* NaN -> 0 */ + exp = exp - 127 + scale; + if (exp < 0) + return 0; /* round towards zero */ + if (exp >= 31) { + /* saturate, unless the result would be -2^31 */ + if (x + (scale << 23) != 0xcf000000) + *vscrp |= VSCR_SAT; + return (x & 0x80000000)? 0x80000000: 0x7fffffff; + } + mant |= 0x800000; + mant = (mant << 7) >> (30 - exp); + return (x & 0x80000000)? -mant: mant; +} + +static unsigned int ctuxs(unsigned int x, int scale, unsigned int *vscrp) +{ + int exp; + unsigned int mant; + + exp = (x >> 23) & 0xff; + mant = x & 0x7fffff; + if (exp == 255 && mant != 0) + return 0; /* NaN -> 0 */ + exp = exp - 127 + scale; + if (exp < 0) + return 0; /* round towards zero */ + if (x & 0x80000000) { + /* negative => saturate to 0 */ + *vscrp |= VSCR_SAT; + return 0; + } + if (exp >= 32) { + /* saturate */ + *vscrp |= VSCR_SAT; + return 0xffffffff; + } + mant |= 0x800000; + mant = (mant << 8) >> (31 - exp); + return mant; +} + +/* Round to floating integer, towards 0 */ +static unsigned int rfiz(unsigned int x) +{ + int exp; + + exp = ((x >> 23) & 0xff) - 127; + if (exp == 128 && (x & 0x7fffff) != 0) + return x | 0x400000; /* NaN -> make it a QNaN */ + if (exp >= 23) + return x; /* it's an integer already (or Inf) */ + if (exp < 0) + return x & 0x80000000; /* |x| < 1.0 rounds to 0 */ + return x & ~(0x7fffff >> exp); +} + +/* Round to floating integer, towards +/- Inf */ +static unsigned int rfii(unsigned int x) +{ + int exp, mask; + + exp = ((x >> 23) & 0xff) - 127; + if (exp == 128 && (x & 0x7fffff) != 0) + return x | 0x400000; /* NaN -> make it a QNaN */ + if (exp >= 23) + return x; /* it's an integer already (or Inf) */ + if ((x & 0x7fffffff) == 0) + return x; /* +/-0 -> +/-0 */ + if (exp < 0) + /* 0 < |x| < 1.0 rounds to +/- 1.0 */ + return (x & 0x80000000) | 0x3f800000; + mask = 0x7fffff >> exp; + /* mantissa overflows into exponent - that's OK, + it can't overflow into the sign bit */ + return (x + mask) & ~mask; +} + +/* Round to floating integer, to nearest */ +static unsigned int rfin(unsigned int x) +{ + int exp, half; + + exp = ((x >> 23) & 0xff) - 127; + if (exp == 128 && (x & 0x7fffff) != 0) + return x | 0x400000; /* NaN -> make it a QNaN */ + if (exp >= 23) + return x; /* it's an integer already (or Inf) */ + if (exp < -1) + return x & 0x80000000; /* |x| < 0.5 -> +/-0 */ + if (exp == -1) + /* 0.5 <= |x| < 1.0 rounds to +/- 1.0 */ + return (x & 0x80000000) | 0x3f800000; + half = 0x400000 >> exp; + /* add 0.5 to the magnitude and chop off the fraction bits */ + return (x + half) & ~(0x7fffff >> exp); +} + +int +emulate_altivec(struct pt_regs *regs) +{ + unsigned int instr, i; + unsigned int va, vb, vc, vd; + vector128 *vrs; + + if (get_user(instr, (unsigned int *) regs->nip)) + return -EFAULT; + if ((instr >> 26) != 4) + return -EINVAL; /* not an altivec instruction */ + vd = (instr >> 21) & 0x1f; + va = (instr >> 16) & 0x1f; + vb = (instr >> 11) & 0x1f; + vc = (instr >> 6) & 0x1f; + + vrs = current->thread.vr; + switch (instr & 0x3f) { + case 10: + switch (vc) { + case 0: /* vaddfp */ + vaddfp(&vrs[vd], &vrs[va], &vrs[vb]); + break; + case 1: /* vsubfp */ + vsubfp(&vrs[vd], &vrs[va], &vrs[vb]); + break; + case 4: /* vrefp */ + vrefp(&vrs[vd], &vrs[vb]); + break; + case 5: /* vrsqrtefp */ + vrsqrtefp(&vrs[vd], &vrs[vb]); + break; + case 6: /* vexptefp */ + for (i = 0; i < 4; ++i) + vrs[vd].u[i] = eexp2(vrs[vb].u[i]); + break; + case 7: /* vlogefp */ + for (i = 0; i < 4; ++i) + vrs[vd].u[i] = elog2(vrs[vb].u[i]); + break; + case 8: /* vrfin */ + for (i = 0; i < 4; ++i) + vrs[vd].u[i] = rfin(vrs[vb].u[i]); + break; + case 9: /* vrfiz */ + for (i = 0; i < 4; ++i) + vrs[vd].u[i] = rfiz(vrs[vb].u[i]); + break; + case 10: /* vrfip */ + for (i = 0; i < 4; ++i) { + u32 x = vrs[vb].u[i]; + x = (x & 0x80000000)? rfiz(x): rfii(x); + vrs[vd].u[i] = x; + } + break; + case 11: /* vrfim */ + for (i = 0; i < 4; ++i) { + u32 x = vrs[vb].u[i]; + x = (x & 0x80000000)? rfii(x): rfiz(x); + vrs[vd].u[i] = x; + } + break; + case 14: /* vctuxs */ + for (i = 0; i < 4; ++i) + vrs[vd].u[i] = ctuxs(vrs[vb].u[i], va, + ¤t->thread.vscr.u[3]); + break; + case 15: /* vctsxs */ + for (i = 0; i < 4; ++i) + vrs[vd].u[i] = ctsxs(vrs[vb].u[i], va, + ¤t->thread.vscr.u[3]); + break; + default: + return -EINVAL; + } + break; + case 46: /* vmaddfp */ + vmaddfp(&vrs[vd], &vrs[va], &vrs[vb], &vrs[vc]); + break; + case 47: /* vnmsubfp */ + vnmsubfp(&vrs[vd], &vrs[va], &vrs[vb], &vrs[vc]); + break; + default: + return -EINVAL; + } + + return 0; +} diff -Nru a/arch/ppc64/kernel/vector.S b/arch/ppc64/kernel/vector.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc64/kernel/vector.S 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,172 @@ +#include +#include + +/* + * The routines below are in assembler so we can closely control the + * usage of floating-point registers. These routines must be called + * with preempt disabled. + */ + .section ".toc","aw" +fpzero: + .tc FD_0_0[TC],0 +fpone: + .tc FD_3ff00000_0[TC],0x3ff0000000000000 /* 1.0 */ +fphalf: + .tc FD_3fe00000_0[TC],0x3fe0000000000000 /* 0.5 */ + + .text +/* + * Internal routine to enable floating point and set FPSCR to 0. + * Don't call it from C; it doesn't use the normal calling convention. + */ +fpenable: + mfmsr r10 + ori r11,r10,MSR_FP + mtmsr r11 + isync + stfd fr31,-8(r1) + stfd fr0,-16(r1) + stfd fr1,-24(r1) + mffs fr31 + lfd fr1,fpzero@toc(r2) + mtfsf 0xff,fr1 + blr + +fpdisable: + mtlr r12 + mtfsf 0xff,fr31 + lfd fr1,-24(r1) + lfd fr0,-16(r1) + lfd fr31,-8(r1) + mtmsr r10 + isync + blr + +/* + * Vector add, floating point. + */ +_GLOBAL(vaddfp) + mflr r12 + bl fpenable + li r0,4 + mtctr r0 + li r6,0 +1: lfsx fr0,r4,r6 + lfsx fr1,r5,r6 + fadds fr0,fr0,fr1 + stfsx fr0,r3,r6 + addi r6,r6,4 + bdnz 1b + b fpdisable + +/* + * Vector subtract, floating point. + */ +_GLOBAL(vsubfp) + mflr r12 + bl fpenable + li r0,4 + mtctr r0 + li r6,0 +1: lfsx fr0,r4,r6 + lfsx fr1,r5,r6 + fsubs fr0,fr0,fr1 + stfsx fr0,r3,r6 + addi r6,r6,4 + bdnz 1b + b fpdisable + +/* + * Vector multiply and add, floating point. + */ +_GLOBAL(vmaddfp) + mflr r12 + bl fpenable + stfd fr2,-32(r1) + li r0,4 + mtctr r0 + li r7,0 +1: lfsx fr0,r4,r7 + lfsx fr1,r5,r7 + lfsx fr2,r6,r7 + fmadds fr0,fr0,fr1,fr2 + stfsx fr0,r3,r7 + addi r7,r7,4 + bdnz 1b + lfd fr2,-32(r1) + b fpdisable + +/* + * Vector negative multiply and subtract, floating point. + */ +_GLOBAL(vnmsubfp) + mflr r12 + bl fpenable + stfd fr2,-32(r1) + li r0,4 + mtctr r0 + li r7,0 +1: lfsx fr0,r4,r7 + lfsx fr1,r5,r7 + lfsx fr2,r6,r7 + fnmsubs fr0,fr0,fr1,fr2 + stfsx fr0,r3,r7 + addi r7,r7,4 + bdnz 1b + lfd fr2,-32(r1) + b fpdisable + +/* + * Vector reciprocal estimate. We just compute 1.0/x. + * r3 -> destination, r4 -> source. + */ +_GLOBAL(vrefp) + mflr r12 + bl fpenable + li r0,4 + lfd fr1,fpone@toc(r2) + mtctr r0 + li r6,0 +1: lfsx fr0,r4,r6 + fdivs fr0,fr1,fr0 + stfsx fr0,r3,r6 + addi r6,r6,4 + bdnz 1b + b fpdisable + +/* + * Vector reciprocal square-root estimate, floating point. + * We use the frsqrte instruction for the initial estimate followed + * by 2 iterations of Newton-Raphson to get sufficient accuracy. + * r3 -> destination, r4 -> source. + */ +_GLOBAL(vrsqrtefp) + mflr r12 + bl fpenable + stfd fr2,-32(r1) + stfd fr3,-40(r1) + stfd fr4,-48(r1) + stfd fr5,-56(r1) + li r0,4 + lfd fr4,fpone@toc(r2) + lfd fr5,fphalf@toc(r2) + mtctr r0 + li r6,0 +1: lfsx fr0,r4,r6 + frsqrte fr1,fr0 /* r = frsqrte(s) */ + fmuls fr3,fr1,fr0 /* r * s */ + fmuls fr2,fr1,fr5 /* r * 0.5 */ + fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */ + fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */ + fmuls fr3,fr1,fr0 /* r * s */ + fmuls fr2,fr1,fr5 /* r * 0.5 */ + fnmsubs fr3,fr1,fr3,fr4 /* 1 - s * r * r */ + fmadds fr1,fr2,fr3,fr1 /* r = r + 0.5 * r * (1 - s * r * r) */ + stfsx fr1,r3,r6 + addi r6,r6,4 + bdnz 1b + lfd fr5,-56(r1) + lfd fr4,-48(r1) + lfd fr3,-40(r1) + lfd fr2,-32(r1) + b fpdisable diff -Nru a/arch/ppc64/mm/fault.c b/arch/ppc64/mm/fault.c --- a/arch/ppc64/mm/fault.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/mm/fault.c 2004-06-23 19:04:28 -07:00 @@ -80,36 +80,45 @@ * - DSISR for a non-SLB data access fault, * - SRR1 & 0x08000000 for a non-SLB instruction access fault * - 0 any SLB fault. + * The return value is 0 if the fault was handled, or the signal + * number if this is a kernel fault that can't be handled here. */ -void do_page_fault(struct pt_regs *regs, unsigned long address, - unsigned long error_code) +int do_page_fault(struct pt_regs *regs, unsigned long address, + unsigned long error_code) { struct vm_area_struct * vma; struct mm_struct *mm = current->mm; siginfo_t info; unsigned long code = SEGV_MAPERR; unsigned long is_write = error_code & 0x02000000; + unsigned long trap = TRAP(regs); - if (regs->trap == 0x300 || regs->trap == 0x380) { + if (trap == 0x300 || trap == 0x380) { if (debugger_fault_handler(regs)) - return; + return 0; } /* On a kernel SLB miss we can only check for a valid exception entry */ - if (!user_mode(regs) && (regs->trap == 0x380)) { - bad_page_fault(regs, address, SIGSEGV); - return; - } + if (!user_mode(regs) && (trap == 0x380 || address >= TASK_SIZE)) + return SIGSEGV; if (error_code & 0x00400000) { if (debugger_dabr_match(regs)) - return; + return 0; } if (in_atomic() || mm == NULL) { - bad_page_fault(regs, address, SIGSEGV); - return; + if (!user_mode(regs)) + return SIGSEGV; + /* in_atomic() in user mode is really bad, + as is current->mm == NULL. */ + printk(KERN_EMERG "Page fault in user mode with" + "in_atomic() = %d mm = %p\n", in_atomic(), mm); + printk(KERN_EMERG "NIP = %lx MSR = %lx\n", + regs->nip, regs->msr); + die("Weird page fault", regs, SIGSEGV); } + down_read(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) @@ -195,7 +204,7 @@ } up_read(&mm->mmap_sem); - return; + return 0; bad_area: up_read(&mm->mmap_sem); @@ -207,11 +216,10 @@ info.si_code = code; info.si_addr = (void *) address; force_sig_info(SIGSEGV, &info, current); - return; + return 0; } - bad_page_fault(regs, address, SIGSEGV); - return; + return SIGSEGV; /* * We ran out of memory, or some other thing happened to us that made @@ -227,18 +235,19 @@ printk("VM: killing process %s\n", current->comm); if (user_mode(regs)) do_exit(SIGKILL); - bad_page_fault(regs, address, SIGKILL); - return; + return SIGKILL; do_sigbus: up_read(&mm->mmap_sem); - info.si_signo = SIGBUS; - info.si_errno = 0; - info.si_code = BUS_ADRERR; - info.si_addr = (void *)address; - force_sig_info (SIGBUS, &info, current); - if (!user_mode(regs)) - bad_page_fault(regs, address, SIGBUS); + if (user_mode(regs)) { + info.si_signo = SIGBUS; + info.si_errno = 0; + info.si_code = BUS_ADRERR; + info.si_addr = (void *)address; + force_sig_info(SIGBUS, &info, current); + return 0; + } + return SIGBUS; } /* diff -Nru a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c --- a/arch/ppc64/mm/hash_utils.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/mm/hash_utils.c 2004-06-23 19:04:27 -07:00 @@ -251,6 +251,7 @@ struct mm_struct *mm; pte_t *ptep; int ret; + int cpu; int user_region = 0; int local = 0; cpumask_t tmp; @@ -302,7 +303,8 @@ if (pgdir == NULL) return 1; - tmp = cpumask_of_cpu(smp_processor_id()); + cpu = get_cpu(); + tmp = cpumask_of_cpu(cpu); if (user_region && cpus_equal(mm->cpu_vm_mask, tmp)) local = 1; @@ -311,11 +313,13 @@ ret = hash_huge_page(mm, access, ea, vsid, local); else { ptep = find_linux_pte(pgdir, ea); - if (ptep == NULL) + if (ptep == NULL) { + put_cpu(); return 1; + } ret = __hash_page(ea, access, vsid, ptep, trap, local); } - + put_cpu(); return ret; } diff -Nru a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c --- a/arch/ppc64/mm/hugetlbpage.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/mm/hugetlbpage.c 2004-06-23 19:04:27 -07:00 @@ -375,6 +375,7 @@ unsigned long addr; hugepte_t *ptep; struct page *page; + int cpu; int local = 0; cpumask_t tmp; @@ -383,7 +384,8 @@ BUG_ON((end % HPAGE_SIZE) != 0); /* XXX are there races with checking cpu_vm_mask? - Anton */ - tmp = cpumask_of_cpu(smp_processor_id()); + cpu = get_cpu(); + tmp = cpumask_of_cpu(cpu); if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp)) local = 1; @@ -406,6 +408,7 @@ put_page(page); } + put_cpu(); mm->rss -= (end - start) >> PAGE_SHIFT; } diff -Nru a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c --- a/arch/ppc64/mm/init.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/mm/init.c 2004-06-23 19:04:27 -07:00 @@ -764,6 +764,7 @@ void *pgdir; pte_t *ptep; int local = 0; + int cpu; cpumask_t tmp; /* handle i-cache coherency */ @@ -794,12 +795,14 @@ vsid = get_vsid(vma->vm_mm->context.id, ea); - tmp = cpumask_of_cpu(smp_processor_id()); + cpu = get_cpu(); + tmp = cpumask_of_cpu(cpu); if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp)) local = 1; __hash_page(ea, pte_val(pte) & (_PAGE_USER|_PAGE_RW), vsid, ptep, 0x300, local); + put_cpu(); } void * reserve_phb_iospace(unsigned long size) diff -Nru a/arch/ppc64/mm/tlb.c b/arch/ppc64/mm/tlb.c --- a/arch/ppc64/mm/tlb.c 2004-06-23 19:04:27 -07:00 +++ b/arch/ppc64/mm/tlb.c 2004-06-23 19:04:27 -07:00 @@ -41,6 +41,33 @@ DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); unsigned long pte_freelist_forced_free; +void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage) +{ + /* This is safe as we are holding page_table_lock */ + cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id()); + struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur); + + if (atomic_read(&tlb->mm->mm_users) < 2 || + cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) { + pte_free(ptepage); + return; + } + + if (*batchp == NULL) { + *batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC); + if (*batchp == NULL) { + pte_free_now(ptepage); + return; + } + (*batchp)->index = 0; + } + (*batchp)->pages[(*batchp)->index++] = ptepage; + if ((*batchp)->index == PTE_FREELIST_SIZE) { + pte_free_submit(*batchp); + *batchp = NULL; + } +} + /* * Update the MMU hash table to correspond with a change to * a Linux PTE. If wrprot is true, it is permissible to @@ -91,12 +118,15 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch) { int i; - cpumask_t tmp = cpumask_of_cpu(smp_processor_id()); + int cpu; + cpumask_t tmp; int local = 0; BUG_ON(in_interrupt()); + cpu = get_cpu(); i = batch->index; + tmp = cpumask_of_cpu(cpu); if (cpus_equal(batch->mm->cpu_vm_mask, tmp)) local = 1; @@ -106,6 +136,7 @@ else flush_hash_range(batch->context, i, local); batch->index = 0; + put_cpu(); } #ifdef CONFIG_SMP diff -Nru a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c --- a/arch/ppc64/xmon/xmon.c 2004-06-23 19:04:28 -07:00 +++ b/arch/ppc64/xmon/xmon.c 2004-06-23 19:04:28 -07:00 @@ -44,9 +44,6 @@ static int xmon_gate; #endif /* CONFIG_SMP */ -#define TRAP(regs) ((regs)->trap) -#define FULL_REGS(regs) 1 - static unsigned long in_xmon = 0; static unsigned long adrs; diff -Nru a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c --- a/arch/s390/kernel/init_task.c 2004-06-23 19:04:27 -07:00 +++ b/arch/s390/kernel/init_task.c 2004-06-23 19:04:27 -07:00 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c --- a/arch/s390/kernel/s390_ksyms.c 2004-06-23 19:04:27 -07:00 +++ b/arch/s390/kernel/s390_ksyms.c 2004-06-23 19:04:27 -07:00 @@ -76,4 +76,3 @@ EXPORT_SYMBOL_NOVERS(do_call_softirq); EXPORT_SYMBOL(sys_wait4); EXPORT_SYMBOL(cpcmd); -EXPORT_SYMBOL(sys_ioctl); diff -Nru a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c --- a/arch/sh/kernel/init_task.c 2004-06-23 19:04:25 -07:00 +++ b/arch/sh/kernel/init_task.c 2004-06-23 19:04:25 -07:00 @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c --- a/arch/sparc/kernel/init_task.c 2004-06-23 19:04:27 -07:00 +++ b/arch/sparc/kernel/init_task.c 2004-06-23 19:04:27 -07:00 @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S --- a/arch/sparc64/kernel/entry.S 2004-06-23 19:04:24 -07:00 +++ b/arch/sparc64/kernel/entry.S 2004-06-23 19:04:24 -07:00 @@ -1751,42 +1751,44 @@ ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc sra %o0, 0, %o0 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 - cmp %o0, -ENOIOCTLCMD sllx %g2, 32, %g2 + + /* Check if force_successful_syscall_return() + * was invoked. + */ + ldx [%curptr + TI_FLAGS], %l0 + andcc %l0, _TIF_SYSCALL_SUCCESS, %g0 + be,pt %icc, 1f + andn %l0, _TIF_SYSCALL_SUCCESS, %l0 + ba,pt %xcc, 80f + stx %l0, [%curptr + TI_FLAGS] + +1: + cmp %o0, -ENOIOCTLCMD bgeu,pn %xcc, 1f andcc %l0, _TIF_SYSCALL_TRACE, %l6 80: - andn %g3, %g2, %g3 /* System call success, clear Carry condition code. */ + /* System call success, clear Carry condition code. */ + andn %g3, %g2, %g3 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE] bne,pn %icc, linux_syscall_trace2 - add %l1, 0x4, %l2 ! npc = npc+4 + add %l1, 0x4, %l2 ! npc = npc+4 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] ba,pt %xcc, rtrap_clr_l6 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] 1: - /* Really a failure? Check if force_successful_syscall_return() - * was invoked. - */ - ldx [%curptr + TI_FLAGS], %l0 ! Load - andcc %l0, _TIF_SYSCALL_SUCCESS, %g0 - be,pt %icc, 1f - andcc %l0, _TIF_SYSCALL_TRACE, %l6 - andn %l0, _TIF_SYSCALL_SUCCESS, %l0 - ba,pt %xcc, 80b - stx %l0, [%curptr + TI_FLAGS] - /* System call failure, set Carry condition code. * Also, get abs(errno) to return to the process. */ -1: + andcc %l0, _TIF_SYSCALL_TRACE, %l6 sub %g0, %o0, %o0 or %g3, %g2, %g3 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] mov 1, %l6 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE] bne,pn %icc, linux_syscall_trace2 - add %l1, 0x4, %l2 !npc = npc+4 + add %l1, 0x4, %l2 ! npc = npc+4 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] b,pt %xcc, rtrap diff -Nru a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c --- a/arch/sparc64/kernel/init_task.c 2004-06-23 19:04:29 -07:00 +++ b/arch/sparc64/kernel/init_task.c 2004-06-23 19:04:29 -07:00 @@ -2,6 +2,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c --- a/arch/sparc64/kernel/sparc64_ksyms.c 2004-06-23 19:04:28 -07:00 +++ b/arch/sparc64/kernel/sparc64_ksyms.c 2004-06-23 19:04:28 -07:00 @@ -327,7 +327,6 @@ EXPORT_SYMBOL(sys_getgid); EXPORT_SYMBOL(svr4_getcontext); EXPORT_SYMBOL(svr4_setcontext); -EXPORT_SYMBOL(sys_ioctl); EXPORT_SYMBOL(compat_sys_ioctl); EXPORT_SYMBOL(sparc32_open); EXPORT_SYMBOL(sys_close); diff -Nru a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c --- a/arch/um/kernel/init_task.c 2004-06-23 19:04:29 -07:00 +++ b/arch/um/kernel/init_task.c 2004-06-23 19:04:29 -07:00 @@ -9,6 +9,7 @@ #include "linux/sched.h" #include "linux/init_task.h" #include "linux/version.h" +#include "linux/mqueue.h" #include "asm/uaccess.h" #include "asm/pgtable.h" #include "user_util.h" diff -Nru a/arch/v850/kernel/init_task.c b/arch/v850/kernel/init_task.c --- a/arch/v850/kernel/init_task.c 2004-06-23 19:04:25 -07:00 +++ b/arch/v850/kernel/init_task.c 2004-06-23 19:04:25 -07:00 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/x86_64/Makefile b/arch/x86_64/Makefile --- a/arch/x86_64/Makefile 2004-06-23 19:04:28 -07:00 +++ b/arch/x86_64/Makefile 2004-06-23 19:04:28 -07:00 @@ -37,6 +37,8 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := -e stext +CHECK := $(CHECK) -D__x86_64__=1 + cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,) cflags-$(CONFIG_MPSC) += $(call check_gcc,-march=nocona,) CFLAGS += $(cflags-y) diff -Nru a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c --- a/arch/x86_64/kernel/e820.c 2004-06-23 19:04:26 -07:00 +++ b/arch/x86_64/kernel/e820.c 2004-06-23 19:04:26 -07:00 @@ -34,7 +34,7 @@ */ unsigned long end_user_pfn = MAXMEM>>PAGE_SHIFT; -extern struct resource code_resource, data_resource, vram_resource; +extern struct resource code_resource, data_resource; /* Check for some hardcoded bad areas that early boot is not allowed to touch */ static inline int bad_addr(unsigned long *addrp, unsigned long size) diff -Nru a/arch/x86_64/kernel/init_task.c b/arch/x86_64/kernel/init_task.c --- a/arch/x86_64/kernel/init_task.c 2004-06-23 19:04:27 -07:00 +++ b/arch/x86_64/kernel/init_task.c 2004-06-23 19:04:27 -07:00 @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c --- a/arch/x86_64/kernel/mpparse.c 2004-06-23 19:04:26 -07:00 +++ b/arch/x86_64/kernel/mpparse.c 2004-06-23 19:04:26 -07:00 @@ -716,7 +716,7 @@ } mp_ioapic_routing[MAX_IO_APICS]; -static int __init mp_find_ioapic ( +static int mp_find_ioapic ( int gsi) { int i = 0; @@ -859,15 +859,22 @@ for (i = 0; i < 16; i++) { int idx; - for (idx = 0; idx < mp_irq_entries; idx++) - if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS && - (mp_irqs[idx].mpc_srcbusirq == i || - mp_irqs[idx].mpc_dstirq == i)) - break; + for (idx = 0; idx < mp_irq_entries; idx++) { + struct mpc_config_intsrc *irq = mp_irqs + idx; + + /* Do we already have a mapping for this ISA IRQ? */ + if (irq->mpc_srcbus == MP_ISA_BUS && irq->mpc_srcbusirq == i) + break; + + /* Do we already have a mapping for this IOAPIC pin */ + if ((irq->mpc_dstapic == intsrc.mpc_dstapic) && + (irq->mpc_dstirq == i)) + break; + } if (idx != mp_irq_entries) { printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i); - continue; /* IRQ already used */ + continue; /* IRQ already used */ } intsrc.mpc_irqtype = mp_INT; @@ -888,91 +895,54 @@ return; } - -extern FADT_DESCRIPTOR acpi_fadt; - -#ifdef CONFIG_ACPI_PCI - -void __init mp_parse_prt (void) +void mp_register_gsi (u32 gsi, int edge_level, int active_high_low) { - struct list_head *node = NULL; - struct acpi_prt_entry *entry = NULL; int ioapic = -1; int ioapic_pin = 0; - int gsi = 0; int idx, bit = 0; - int edge_level = 0; - int active_high_low = 0; - /* - * Parsing through the PCI Interrupt Routing Table (PRT) and program - * routing for all static (IOAPIC-direct) entries. - */ - list_for_each(node, &acpi_prt.entries) { - entry = list_entry(node, struct acpi_prt_entry, node); + if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) + return; - /* Need to get gsi for dynamic entry */ - if (entry->link.handle) { - gsi = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low); - if (!gsi) - continue; - } else { - /* Hardwired GSI. Assume PCI standard settings */ - gsi = entry->link.index; - edge_level = 1; - active_high_low = 1; - } +#ifdef CONFIG_ACPI_BUS + /* Don't set up the ACPI SCI because it's already set up */ + if (acpi_fadt.sci_int == gsi) + return; +#endif - /* Don't set up the ACPI SCI because it's already set up */ - if (acpi_fadt.sci_int == gsi) { - /* we still need to set up the entry's irq */ - acpi_gsi_to_irq(gsi, &entry->irq); - continue; - } + ioapic = mp_find_ioapic(gsi); + if (ioapic < 0) { + printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi); + return; + } - ioapic = mp_find_ioapic(gsi); - if (ioapic < 0) - continue; - ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start; - - /* - * Avoid pin reprogramming. PRTs typically include entries - * with redundant pin->gsi mappings (but unique PCI devices); - * we only only program the IOAPIC on the first. - */ - bit = ioapic_pin % 32; - idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); - if (idx > 3) { - printk(KERN_ERR "Invalid reference to IOAPIC pin " - "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, - ioapic_pin); - continue; - } - if ((1<irq); - continue; - } + ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start; - mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<irq); - } - 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); + /* + * Avoid pin reprogramming. PRTs typically include entries + * with redundant pin->gsi mappings (but unique PCI devices); + * we only program the IOAPIC on the first. + */ + bit = ioapic_pin % 32; + idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32); + if (idx > 3) { + printk(KERN_ERR "Invalid reference to IOAPIC pin " + "%d-%d\n", mp_ioapic_routing[ioapic].apic_id, + ioapic_pin); + return; + } + if ((1< upper || !checksum(rom, length)) + if (!length || start + length > upper || !romchecksum(rom, length)) continue; adapter_rom_resources[i].start = start; @@ -555,13 +557,13 @@ probe_roms(); e820_reserve_resources(); - request_resource(&iomem_resource, &vram_resource); + request_resource(&iomem_resource, &video_ram_resource); { unsigned i; /* request I/O space for devices used on all i[345]86 PCs */ for (i = 0; i < STANDARD_IO_RESOURCES; i++) - request_resource(&ioport_resource, standard_io_resources+i); + request_resource(&ioport_resource, &standard_io_resources[i]); } /* Will likely break when you have unassigned resources with more diff -Nru a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c --- a/arch/x86_64/kernel/x8664_ksyms.c 2004-06-23 19:04:25 -07:00 +++ b/arch/x86_64/kernel/x8664_ksyms.c 2004-06-23 19:04:25 -07:00 @@ -218,4 +218,3 @@ EXPORT_SYMBOL_GPL(flush_tlb_all); #endif -EXPORT_SYMBOL(sys_ioctl); diff -Nru a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c --- a/arch/x86_64/mm/numa.c 2004-06-23 19:04:28 -07:00 +++ b/arch/x86_64/mm/numa.c 2004-06-23 19:04:28 -07:00 @@ -182,7 +182,7 @@ numnodes = 1; for (i = 0; i < NR_CPUS; i++) cpu_to_node[i] = 0; - node_to_cpumask[0] = 1; + node_to_cpumask[0] = cpumask_of_cpu(0); setup_node_bootmem(0, start_pfn< #include #include -#ifdef CONFIG_X86_IO_APIC -#include -#endif -#ifdef CONFIG_IOSAPIC -# include -#endif #include #include @@ -50,10 +44,6 @@ struct acpi_prt_list acpi_prt; -#ifdef CONFIG_X86 -extern void eisa_set_level_irq(unsigned int irq); -#endif - /* -------------------------------------------------------------------------- PCI IRQ Routing Table (PRT) Support @@ -237,12 +227,18 @@ PCI Interrupt Routing Support -------------------------------------------------------------------------- */ -int -acpi_pci_irq_lookup (struct pci_bus *bus, int device, int pin) +static int +acpi_pci_irq_lookup ( + struct pci_bus *bus, + int device, + int pin, + int *edge_level, + int *active_high_low) { struct acpi_prt_entry *entry = NULL; int segment = pci_domain_nr(bus); int bus_nr = bus->number; + int irq; ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup"); @@ -255,28 +251,30 @@ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n")); return_VALUE(0); } - - if (!entry->irq && entry->link.handle) { - entry->irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, NULL, NULL); - if (!entry->irq) { + + if (entry->link.handle) { + irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, edge_level, active_high_low); + if (!irq) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n")); return_VALUE(0); } - } - else if (!entry->irq) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid static routing entry (IRQ 0)\n")); - return_VALUE(0); + } else { + irq = entry->link.index; + *edge_level = ACPI_LEVEL_SENSITIVE; + *active_high_low = ACPI_ACTIVE_LOW; } - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", entry->irq)); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq)); - return_VALUE(entry->irq); + return_VALUE(irq); } static int acpi_pci_irq_derive ( struct pci_dev *dev, - int pin) + int pin, + int *edge_level, + int *active_high_low) { struct pci_dev *bridge = dev; int irq = 0; @@ -308,8 +306,8 @@ pin = bridge_pin; } - irq = acpi_pci_irq_lookup(bridge->bus, - PCI_SLOT(bridge->devfn), pin); + irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn), + pin, edge_level, active_high_low); } if (!irq) { @@ -330,6 +328,8 @@ { int irq = 0; u8 pin = 0; + int edge_level = ACPI_LEVEL_SENSITIVE; + int active_high_low = ACPI_ACTIVE_LOW; ACPI_FUNCTION_TRACE("acpi_pci_irq_enable"); @@ -352,21 +352,22 @@ * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot. */ - irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin); + irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, &edge_level, &active_high_low); /* * If no PRT entry was found, we'll try to derive an IRQ from the * device's parent bridge. */ if (!irq) - irq = acpi_pci_irq_derive(dev, pin); + irq = acpi_pci_irq_derive(dev, pin, &edge_level, &active_high_low); /* * No IRQ known to the ACPI subsystem - maybe the BIOS / * driver reported one, then use it. Exit in any case. */ if (!irq) { - printk(KERN_WARNING PREFIX "No IRQ known for interrupt pin %c of device %s", ('A' + pin), pci_name(dev)); + printk(KERN_WARNING PREFIX "PCI interrupt %s[%c]: no GSI", + pci_name(dev), ('A' + pin)); /* Interrupt Line values above 0xF are forbidden */ if (dev->irq && (dev->irq <= 0xF)) { printk(" - using IRQ %d\n", dev->irq); @@ -378,62 +379,14 @@ } } - dev->irq = irq; + dev->irq = acpi_register_gsi(irq, edge_level, active_high_low); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s using IRQ %d\n", pci_name(dev), dev->irq)); - - /* - * Make sure all (legacy) PCI IRQs are set as level-triggered. - */ -#ifdef CONFIG_X86 - { - static u16 irq_mask; - if ((dev->irq < 16) && !((1 << dev->irq) & irq_mask)) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Setting IRQ %d as level-triggered\n", dev->irq)); - irq_mask |= (1 << dev->irq); - eisa_set_level_irq(dev->irq); - } - } -#endif -#ifdef CONFIG_IOSAPIC - if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC) - iosapic_enable_intr(dev->irq); -#endif + printk(KERN_INFO PREFIX "PCI interrupt %s[%c] -> GSI %u " + "(%s, %s) -> IRQ %d\n", + pci_name(dev), 'A' + pin, irq, + (edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge", + (active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high", + dev->irq); return_VALUE(dev->irq); -} - - -int __init -acpi_pci_irq_init (void) -{ - struct pci_dev *dev = NULL; - - ACPI_FUNCTION_TRACE("acpi_pci_irq_init"); - - if (!acpi_prt.count) { - printk(KERN_WARNING PREFIX "ACPI tables contain no PCI IRQ " - "routing entries\n"); - return_VALUE(-ENODEV); - } - - /* Make sure all link devices have a valid IRQ. */ - if (acpi_pci_link_check()) { - return_VALUE(-ENODEV); - } - -#ifdef CONFIG_X86_IO_APIC - /* Program IOAPICs using data from PRT entries. */ - if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) - mp_parse_prt(); -#endif -#ifdef CONFIG_IOSAPIC - if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC) - iosapic_parse_prt(); -#endif - - while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) - acpi_pci_irq_enable(dev); - - return_VALUE(0); } diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c --- a/drivers/acpi/pci_link.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/acpi/pci_link.c 2004-06-23 19:04:25 -07:00 @@ -308,31 +308,12 @@ struct acpi_resource end; } resource; struct acpi_buffer buffer = {sizeof(resource)+1, &resource}; - int i = 0; - int valid = 0; ACPI_FUNCTION_TRACE("acpi_pci_link_set"); if (!link || !irq) return_VALUE(-EINVAL); - /* We don't check irqs the first time around */ - if (link->irq.setonboot) { - /* See if we're already at the target IRQ. */ - if (irq == link->irq.active) - return_VALUE(0); - - /* Make sure the target IRQ in the list of possible IRQs. */ - for (i=0; iirq.possible_count; i++) { - if (irq == link->irq.possible[i]) - valid = 1; - } - if (!valid) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Target IRQ %d invalid\n", irq)); - return_VALUE(-EINVAL); - } - } - memset(&resource, 0, sizeof(resource)); switch(link->irq.resource_type) { @@ -487,13 +468,13 @@ }; int -acpi_pci_link_check (void) +acpi_irq_penalty_init(void) { struct list_head *node = NULL; struct acpi_pci_link *link = NULL; int i = 0; - ACPI_FUNCTION_TRACE("acpi_pci_link_check"); + ACPI_FUNCTION_TRACE("acpi_irq_penalty_init"); /* * Update penalties to facilitate IRQ balancing. @@ -703,6 +684,9 @@ acpi_link.count++; end: + /* disable all links -- to be activated on use */ + acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); + if (result) kfree(link); diff -Nru a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c --- a/drivers/acpi/pci_root.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/acpi/pci_root.c 2004-06-23 19:04:26 -07:00 @@ -113,6 +113,40 @@ } } +static acpi_status +get_root_bridge_busnr_callback (struct acpi_resource *resource, void *data) +{ + int *busnr = (int *)data; + struct acpi_resource_address64 address; + + if (resource->id != ACPI_RSTYPE_ADDRESS16 && + resource->id != ACPI_RSTYPE_ADDRESS32 && + resource->id != ACPI_RSTYPE_ADDRESS64) + return AE_OK; + + acpi_resource_to_address64(resource, &address); + if ((address.address_length > 0) && + (address.resource_type == ACPI_BUS_NUMBER_RANGE)) + *busnr = address.min_address_range; + + return AE_OK; +} + +static acpi_status +try_get_root_bridge_busnr(acpi_handle handle, int *busnum) +{ + acpi_status status; + + *busnum = -1; + status = acpi_walk_resources(handle, METHOD_NAME__CRS, get_root_bridge_busnr_callback, busnum); + if (ACPI_FAILURE(status)) + return status; + /* Check if we really get a bus number from _CRS */ + if (*busnum == -1) + return AE_ERROR; + return AE_OK; +} + static int acpi_pci_root_add ( struct acpi_device *device) @@ -190,9 +224,22 @@ /* Some systems have wrong _BBN */ list_for_each_entry(tmp, &acpi_pci_roots, node) { if ((tmp->id.segment == root->id.segment) - && (tmp->id.bus == root->id.bus)) + && (tmp->id.bus == root->id.bus)) { + int bus = 0; + acpi_status status; + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Wrong _BBN value, please reboot and using option 'pci=noacpi'\n")); + + status = try_get_root_bridge_busnr(root->handle, &bus); + if (ACPI_FAILURE(status)) + break; + if (bus != root->id.bus) { + printk(KERN_INFO PREFIX "PCI _CRS %d overrides _BBN 0\n", bus); + root->id.bus = bus; + } + break; + } } /* * Device & Function diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c --- a/drivers/acpi/tables.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/acpi/tables.c 2004-06-23 19:04:26 -07:00 @@ -131,7 +131,7 @@ { struct acpi_table_ioapic *p = (struct acpi_table_ioapic*) header; - printk(KERN_INFO PREFIX "IOAPIC (id[0x%02x] address[0x%08x] global_irq_base[0x%x])\n", + printk(KERN_INFO PREFIX "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", p->id, p->address, p->global_irq_base); } break; @@ -185,8 +185,8 @@ { struct acpi_table_iosapic *p = (struct acpi_table_iosapic*) header; - printk(KERN_INFO PREFIX "IOSAPIC (id[0x%x] global_irq_base[0x%x] address[%p])\n", - p->id, p->global_irq_base, (void *) (unsigned long) p->address); + printk(KERN_INFO PREFIX "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", + p->id, (void *) (unsigned long) p->address, p->global_irq_base); } break; diff -Nru a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c --- a/drivers/acpi/thermal.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/acpi/thermal.c 2004-06-23 19:04:28 -07:00 @@ -289,6 +289,13 @@ status = acpi_get_handle(tz->handle, "_SCP", &handle); if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n")); + status = acpi_get_handle(tz->handle, "_PSV", &handle); + if(!ACPI_FAILURE(status)) { + tz->cooling_mode = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n", + mode?"passive":"active")); + return_VALUE(0); + } return_VALUE(-ENODEV); } diff -Nru a/drivers/base/Kconfig b/drivers/base/Kconfig --- a/drivers/base/Kconfig 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/Kconfig 2004-06-23 19:04:25 -07:00 @@ -1,5 +1,14 @@ menu "Generic Driver Options" +config PREVENT_FIRMWARE_BUILD + bool "Prevent firmware from being built" + default y + help + Say yes to avoid building firmware. Firmware is usually shipped + with the driver, and only when updating the firware a rebuild + should be made. + If unsure say Y here. + config FW_LOADER tristate "Hotplug firmware loading support" depends on HOTPLUG diff -Nru a/drivers/base/base.h b/drivers/base/base.h --- a/drivers/base/base.h 2004-06-23 19:04:26 -07:00 +++ b/drivers/base/base.h 2004-06-23 19:04:26 -07:00 @@ -6,12 +6,13 @@ static inline struct class_device *to_class_dev(struct kobject *obj) { - return container_of(obj,struct class_device,kobj); + return container_of(obj, struct class_device, kobj); } + static inline struct class_device_attribute *to_class_dev_attr(struct attribute *_attr) { - return container_of(_attr,struct class_device_attribute,attr); + return container_of(_attr, struct class_device_attribute, attr); } diff -Nru a/drivers/base/bus.c b/drivers/base/bus.c --- a/drivers/base/bus.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/base/bus.c 2004-06-23 19:04:26 -07:00 @@ -3,7 +3,7 @@ * * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * + * * This file is released under the GPLv2 * */ @@ -17,17 +17,17 @@ #include "base.h" #include "power/power.h" -#define to_dev(node) container_of(node,struct device,bus_list) -#define to_drv(node) container_of(node,struct device_driver,kobj.entry) +#define to_dev(node) container_of(node, struct device, bus_list) +#define to_drv(node) container_of(node, struct device_driver, kobj.entry) -#define to_bus_attr(_attr) container_of(_attr,struct bus_attribute,attr) -#define to_bus(obj) container_of(obj,struct bus_type,subsys.kset.kobj) +#define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) +#define to_bus(obj) container_of(obj, struct bus_type, subsys.kset.kobj) /* * sysfs bindings for drivers */ -#define to_drv_attr(_attr) container_of(_attr,struct driver_attribute,attr) +#define to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr) #define to_driver(obj) container_of(obj, struct device_driver, kobj) @@ -39,12 +39,12 @@ ssize_t ret = 0; if (drv_attr->show) - ret = drv_attr->show(drv,buf); + ret = drv_attr->show(drv, buf); return ret; } static ssize_t -drv_attr_store(struct kobject * kobj, struct attribute * attr, +drv_attr_store(struct kobject * kobj, struct attribute * attr, const char * buf, size_t count) { struct driver_attribute * drv_attr = to_drv_attr(attr); @@ -52,7 +52,7 @@ ssize_t ret = 0; if (drv_attr->store) - ret = drv_attr->store(drv,buf,count); + ret = drv_attr->store(drv, buf, count); return ret; } @@ -87,12 +87,12 @@ ssize_t ret = 0; if (bus_attr->show) - ret = bus_attr->show(bus,buf); + ret = bus_attr->show(bus, buf); return ret; } static ssize_t -bus_attr_store(struct kobject * kobj, struct attribute * attr, +bus_attr_store(struct kobject * kobj, struct attribute * attr, const char * buf, size_t count) { struct bus_attribute * bus_attr = to_bus_attr(attr); @@ -100,7 +100,7 @@ ssize_t ret = 0; if (bus_attr->store) - ret = bus_attr->store(bus,buf,count); + ret = bus_attr->store(bus, buf, count); return ret; } @@ -113,7 +113,7 @@ { int error; if (get_bus(bus)) { - error = sysfs_create_file(&bus->subsys.kset.kobj,&attr->attr); + error = sysfs_create_file(&bus->subsys.kset.kobj, &attr->attr); put_bus(bus); } else error = -EINVAL; @@ -123,7 +123,7 @@ void bus_remove_file(struct bus_type * bus, struct bus_attribute * attr) { if (get_bus(bus)) { - sysfs_remove_file(&bus->subsys.kset.kobj,&attr->attr); + sysfs_remove_file(&bus->subsys.kset.kobj, &attr->attr); put_bus(bus); } } @@ -133,7 +133,7 @@ }; -decl_subsys(bus,&ktype_bus,NULL); +decl_subsys(bus, &ktype_bus, NULL); /** * bus_for_each_dev - device iterator. @@ -151,10 +151,10 @@ * * NOTE: The device that returns a non-zero value is not retained * in any way, nor is its refcount incremented. If the caller needs - * to retain this data, it should do, and increment the reference + * to retain this data, it should do, and increment the reference * count in the supplied callback. */ -int bus_for_each_dev(struct bus_type * bus, struct device * start, +int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, int (*fn)(struct device *, void *)) { struct device *dev; @@ -170,7 +170,7 @@ down_read(&bus->subsys.rwsem); list_for_each_entry_continue(dev, head, bus_list) { get_device(dev); - error = fn(dev,data); + error = fn(dev, data); put_device(dev); if (error) break; @@ -193,7 +193,7 @@ * and return it. If @start is not NULL, we use it as the head * of the list. * - * NOTE: we don't return the driver that returns a non-zero + * NOTE: we don't return the driver that returns a non-zero * value, nor do we leave the reference count incremented for that * driver. If the caller needs to know that info, it must set it * in the callback. It must also be sure to increment the refcount @@ -216,7 +216,7 @@ down_read(&bus->subsys.rwsem); list_for_each_entry_continue(drv, head, kobj.entry) { get_driver(drv); - error = fn(drv,data); + error = fn(drv, data); put_driver(drv); if(error) break; @@ -233,8 +233,8 @@ * Allow manual attachment of a driver to a deivce. * Caller must have already set @dev->driver. * - * Note that this does not modify the bus reference count - * nor take the bus's rwsem. Please verify those are accounted + * Note that this does not modify the bus reference count + * nor take the bus's rwsem. Please verify those are accounted * for before calling this. (It is ok to call with no other effort * from a driver's probe() method.) */ @@ -242,9 +242,9 @@ void device_bind_driver(struct device * dev) { pr_debug("bound device '%s' to driver '%s'\n", - dev->bus_id,dev->driver->name); - list_add_tail(&dev->driver_list,&dev->driver->devices); - sysfs_create_link(&dev->driver->kobj,&dev->kobj, + dev->bus_id, dev->driver->name); + list_add_tail(&dev->driver_list, &dev->driver->devices); + sysfs_create_link(&dev->driver->kobj, &dev->kobj, kobject_name(&dev->kobj)); } @@ -255,18 +255,18 @@ * @drv: driver. * * First, we call the bus's match function, which should compare - * the device IDs the driver supports with the device IDs of the - * device. Note we don't do this ourselves because we don't know + * the device IDs the driver supports with the device IDs of the + * device. Note we don't do this ourselves because we don't know * the format of the ID structures, nor what is to be considered * a match and what is not. - * - * If we find a match, we call @drv->probe(@dev) if it exists, and + * + * If we find a match, we call @drv->probe(@dev) if it exists, and * call attach() above. */ static int bus_match(struct device * dev, struct device_driver * drv) { int error = -ENODEV; - if (dev->bus->match(dev,drv)) { + if (dev->bus->match(dev, drv)) { dev->driver = drv; if (drv->probe) { if ((error = drv->probe(dev))) { @@ -285,7 +285,7 @@ * device_attach - try to attach device to a driver. * @dev: device. * - * Walk the list of drivers that the bus has and call bus_match() + * Walk the list of drivers that the bus has and call bus_match() * for each pair. If a compatible pair is found, break out and return. */ static int device_attach(struct device * dev) @@ -300,15 +300,15 @@ } if (bus->match) { - list_for_each(entry,&bus->drivers.list) { + list_for_each(entry, &bus->drivers.list) { struct device_driver * drv = to_drv(entry); - error = bus_match(dev,drv); - if (!error ) + error = bus_match(dev, drv); + if (!error) /* success, driver matched */ - return 1; - if (error != -ENODEV) + return 1; + if (error != -ENODEV) /* driver matched but the probe failed */ - printk(KERN_WARNING + printk(KERN_WARNING "%s: probe of %s failed with error %d\n", drv->name, dev->bus_id, error); } @@ -327,7 +327,7 @@ * If bus_match() returns 0 and the @dev->driver is set, we've found * a compatible pair. * - * Note that we ignore the -ENODEV error from bus_match(), since it's + * Note that we ignore the -ENODEV error from bus_match(), since it's * perfectly valid for a driver not to bind to any devices. */ void driver_attach(struct device_driver * drv) @@ -339,13 +339,13 @@ if (!bus->match) return; - list_for_each(entry,&bus->devices.list) { - struct device * dev = container_of(entry,struct device,bus_list); + list_for_each(entry, &bus->devices.list) { + struct device * dev = container_of(entry, struct device, bus_list); if (!dev->driver) { - error = bus_match(dev,drv); + error = bus_match(dev, drv); if (error && (error != -ENODEV)) /* driver matched but the probe failed */ - printk(KERN_WARNING + printk(KERN_WARNING "%s: probe of %s failed with error %d\n", drv->name, dev->bus_id, error); } @@ -367,7 +367,7 @@ { struct device_driver * drv = dev->driver; if (drv) { - sysfs_remove_link(&drv->kobj,kobject_name(&dev->kobj)); + sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj)); list_del_init(&dev->driver_list); device_detach_shutdown(dev); if (drv->remove) @@ -385,13 +385,44 @@ static void driver_detach(struct device_driver * drv) { struct list_head * entry, * next; - list_for_each_safe(entry,next,&drv->devices) { - struct device * dev = container_of(entry,struct device,driver_list); + list_for_each_safe(entry, next, &drv->devices) { + struct device * dev = container_of(entry, struct device, driver_list); device_release_driver(dev); } +} + +static int device_add_attrs(struct bus_type * bus, struct device * dev) +{ + int error = 0; + int i; + + if (bus->dev_attrs) { + for (i = 0; attr_name(bus->dev_attrs[i]); i++) { + error = device_create_file(dev,&bus->dev_attrs[i]); + if (error) + goto Err; + } + } + Done: + return error; + Err: + while (--i >= 0) + device_remove_file(dev,&bus->dev_attrs[i]); + goto Done; +} + + +static void device_remove_attrs(struct bus_type * bus, struct device * dev) +{ + int i; + if (bus->dev_attrs) { + for (i = 0; attr_name(bus->dev_attrs[i]); i++) + device_remove_file(dev,&bus->dev_attrs[i]); + } } + /** * bus_add_device - add device to bus * @dev: device being added @@ -407,11 +438,12 @@ if (bus) { down_write(&dev->bus->subsys.rwsem); - pr_debug("bus %s: add device %s\n",bus->name,dev->bus_id); - list_add_tail(&dev->bus_list,&dev->bus->devices.list); + pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id); + list_add_tail(&dev->bus_list, &dev->bus->devices.list); device_attach(dev); up_write(&dev->bus->subsys.rwsem); - sysfs_create_link(&bus->devices.kobj,&dev->kobj,dev->bus_id); + device_add_attrs(bus, dev); + sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id); } return error; } @@ -428,9 +460,10 @@ void bus_remove_device(struct device * dev) { if (dev->bus) { - sysfs_remove_link(&dev->bus->devices.kobj,dev->bus_id); + sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id); + device_remove_attrs(dev->bus, dev); down_write(&dev->bus->subsys.rwsem); - pr_debug("bus %s: remove device %s\n",dev->bus->name,dev->bus_id); + pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id); device_release_driver(dev); list_del_init(&dev->bus_list); up_write(&dev->bus->subsys.rwsem); @@ -450,8 +483,8 @@ int error = 0; if (bus) { - pr_debug("bus %s: add driver %s\n",bus->name,drv->name); - error = kobject_set_name(&drv->kobj,drv->name); + pr_debug("bus %s: add driver %s\n", bus->name, drv->name); + error = kobject_set_name(&drv->kobj, drv->name); if (error) { put_bus(bus); return error; @@ -484,7 +517,7 @@ { if (drv->bus) { down_write(&drv->bus->subsys.rwsem); - pr_debug("bus %s: remove driver %s\n",drv->bus->name,drv->name); + pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name); driver_detach(drv); up_write(&drv->bus->subsys.rwsem); kobject_unregister(&drv->kobj); @@ -526,7 +559,7 @@ struct bus_type * get_bus(struct bus_type * bus) { - return bus ? container_of(subsys_get(&bus->subsys),struct bus_type,subsys) : NULL; + return bus ? container_of(subsys_get(&bus->subsys), struct bus_type, subsys) : NULL; } void put_bus(struct bus_type * bus) @@ -545,29 +578,64 @@ struct bus_type * find_bus(char * name) { - struct kobject * k = kset_find_obj(&bus_subsys.kset,name); + struct kobject * k = kset_find_obj(&bus_subsys.kset, name); return k ? to_bus(k) : NULL; } + +/** + * bus_add_attrs - Add default attributes for this bus. + * @bus: Bus that has just been registered. + */ + +static int bus_add_attrs(struct bus_type * bus) +{ + int error = 0; + int i; + + if (bus->bus_attrs) { + for (i = 0; attr_name(bus->bus_attrs[i]); i++) { + if ((error = bus_create_file(bus,&bus->bus_attrs[i]))) + goto Err; + } + } + Done: + return error; + Err: + while (--i >= 0) + bus_remove_file(bus,&bus->bus_attrs[i]); + goto Done; +} + +static void bus_remove_attrs(struct bus_type * bus) +{ + int i; + + if (bus->bus_attrs) { + for (i = 0; attr_name(bus->bus_attrs[i]); i++) + bus_remove_file(bus,&bus->bus_attrs[i]); + } +} + /** * bus_register - register a bus with the system. * @bus: bus. * * Once we have that, we registered the bus with the kobject * infrastructure, then register the children subsystems it has: - * the devices and drivers that belong to the bus. + * the devices and drivers that belong to the bus. */ int bus_register(struct bus_type * bus) { int retval; - retval = kobject_set_name(&bus->subsys.kset.kobj,bus->name); + retval = kobject_set_name(&bus->subsys.kset.kobj, bus->name); if (retval) goto out; - subsys_set_kset(bus,bus_subsys); + subsys_set_kset(bus, bus_subsys); retval = subsystem_register(&bus->subsys); - if (retval) + if (retval) goto out; kobject_set_name(&bus->devices.kobj, "devices"); @@ -582,8 +650,9 @@ retval = kset_register(&bus->drivers); if (retval) goto bus_drivers_fail; + bus_add_attrs(bus); - pr_debug("bus type '%s' registered\n",bus->name); + pr_debug("bus type '%s' registered\n", bus->name); return 0; bus_drivers_fail: @@ -596,7 +665,7 @@ /** - * bus_unregister - remove a bus from the system + * bus_unregister - remove a bus from the system * @bus: bus. * * Unregister the child subsystems and the bus itself. @@ -604,7 +673,8 @@ */ void bus_unregister(struct bus_type * bus) { - pr_debug("bus %s: unregistering\n",bus->name); + pr_debug("bus %s: unregistering\n", bus->name); + bus_remove_attrs(bus); kset_unregister(&bus->drivers); kset_unregister(&bus->devices); subsystem_unregister(&bus->subsys); diff -Nru a/drivers/base/class.c b/drivers/base/class.c --- a/drivers/base/class.c 2004-06-23 19:04:29 -07:00 +++ b/drivers/base/class.c 2004-06-23 19:04:29 -07:00 @@ -5,7 +5,7 @@ * Copyright (c) 2002-3 Open Source Development Labs * Copyright (c) 2003-2004 Greg Kroah-Hartman * Copyright (c) 2003-2004 IBM Corp. - * + * * This file is released under the GPLv2 * */ @@ -17,8 +17,8 @@ #include #include "base.h" -#define to_class_attr(_attr) container_of(_attr,struct class_attribute,attr) -#define to_class(obj) container_of(obj,struct class,subsys.kset.kobj) +#define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr) +#define to_class(obj) container_of(obj, struct class, subsys.kset.kobj) static ssize_t class_attr_show(struct kobject * kobj, struct attribute * attr, char * buf) @@ -28,12 +28,12 @@ ssize_t ret = 0; if (class_attr->show) - ret = class_attr->show(dc,buf); + ret = class_attr->show(dc, buf); return ret; } static ssize_t -class_attr_store(struct kobject * kobj, struct attribute * attr, +class_attr_store(struct kobject * kobj, struct attribute * attr, const char * buf, size_t count) { struct class_attribute * class_attr = to_class_attr(attr); @@ -41,7 +41,7 @@ ssize_t ret = 0; if (class_attr->store) - ret = class_attr->store(dc,buf,count); + ret = class_attr->store(dc, buf, count); return ret; } @@ -69,14 +69,14 @@ }; /* Hotplug events for classes go to the class_obj subsys */ -static decl_subsys(class,&ktype_class,NULL); +static decl_subsys(class, &ktype_class, NULL); int class_create_file(struct class * cls, const struct class_attribute * attr) { int error; if (cls) { - error = sysfs_create_file(&cls->subsys.kset.kobj,&attr->attr); + error = sysfs_create_file(&cls->subsys.kset.kobj, &attr->attr); } else error = -EINVAL; return error; @@ -85,13 +85,13 @@ void class_remove_file(struct class * cls, const struct class_attribute * attr) { if (cls) - sysfs_remove_file(&cls->subsys.kset.kobj,&attr->attr); + sysfs_remove_file(&cls->subsys.kset.kobj, &attr->attr); } struct class * class_get(struct class * cls) { if (cls) - return container_of(subsys_get(&cls->subsys),struct class,subsys); + return container_of(subsys_get(&cls->subsys), struct class, subsys); return NULL; } @@ -100,33 +100,67 @@ subsys_put(&cls->subsys); } + +static int add_class_attrs(struct class * cls) +{ + int i; + int error = 0; + + if (cls->class_attrs) { + for (i = 0; attr_name(cls->class_attrs[i]); i++) { + error = class_create_file(cls,&cls->class_attrs[i]); + if (error) + goto Err; + } + } + Done: + return error; + Err: + while (--i >= 0) + class_remove_file(cls,&cls->class_attrs[i]); + goto Done; +} + +static void remove_class_attrs(struct class * cls) +{ + int i; + + if (cls->class_attrs) { + for (i = 0; attr_name(cls->class_attrs[i]); i++) + class_remove_file(cls,&cls->class_attrs[i]); + } +} + int class_register(struct class * cls) { int error; - pr_debug("device class '%s': registering\n",cls->name); + pr_debug("device class '%s': registering\n", cls->name); INIT_LIST_HEAD(&cls->children); INIT_LIST_HEAD(&cls->interfaces); - error = kobject_set_name(&cls->subsys.kset.kobj,cls->name); + error = kobject_set_name(&cls->subsys.kset.kobj, cls->name); if (error) return error; - subsys_set_kset(cls,class_subsys); + subsys_set_kset(cls, class_subsys); error = subsystem_register(&cls->subsys); - if (error) - return error; - - return 0; + if (!error) { + error = add_class_attrs(class_get(cls)); + class_put(cls); + } + return error; } void class_unregister(struct class * cls) { - pr_debug("device class '%s': unregistering\n",cls->name); + pr_debug("device class '%s': unregistering\n", cls->name); + remove_class_attrs(cls); subsystem_unregister(&cls->subsys); } + /* Class Device Stuff */ int class_device_create_file(struct class_device * class_dev, @@ -181,12 +215,12 @@ ssize_t ret = 0; if (class_dev_attr->show) - ret = class_dev_attr->show(cd,buf); + ret = class_dev_attr->show(cd, buf); return ret; } static ssize_t -class_device_attr_store(struct kobject * kobj, struct attribute * attr, +class_device_attr_store(struct kobject * kobj, struct attribute * attr, const char * buf, size_t count) { struct class_device_attribute * class_dev_attr = to_class_dev_attr(attr); @@ -194,7 +228,7 @@ ssize_t ret = 0; if (class_dev_attr->store) - ret = class_dev_attr->store(cd,buf,count); + ret = class_dev_attr->store(cd, buf, count); return ret; } @@ -208,7 +242,7 @@ struct class_device *cd = to_class_dev(kobj); struct class * cls = cd->class; - pr_debug("device class '%s': release.\n",cd->class_id); + pr_debug("device class '%s': release.\n", cd->class_id); if (cls->release) cls->release(cd); @@ -272,6 +306,40 @@ static decl_subsys(class_obj, &ktype_class_device, &class_hotplug_ops); + +static int class_device_add_attrs(struct class_device * cd) +{ + int i; + int error = 0; + struct class * cls = cd->class; + + if (cls->class_dev_attrs) { + for (i = 0; attr_name(cls->class_dev_attrs[i]); i++) { + error = class_device_create_file(cd, + &cls->class_dev_attrs[i]); + if (error) + goto Err; + } + } + Done: + return error; + Err: + while (--i >= 0) + class_device_remove_file(cd,&cls->class_dev_attrs[i]); + goto Done; +} + +static void class_device_remove_attrs(struct class_device * cd) +{ + int i; + struct class * cls = cd->class; + + if (cls->class_dev_attrs) { + for (i = 0; attr_name(cls->class_dev_attrs[i]); i++) + class_device_remove_file(cd,&cls->class_dev_attrs[i]); + } +} + void class_device_initialize(struct class_device *class_dev) { kobj_set_kset_s(class_dev, class_obj_subsys); @@ -311,7 +379,7 @@ class_intf->add(class_dev); up_write(&parent->subsys.rwsem); } - + class_device_add_attrs(class_dev); class_device_dev_link(class_dev); class_device_driver_link(class_dev); @@ -344,7 +412,8 @@ class_device_dev_unlink(class_dev); class_device_driver_unlink(class_dev); - + class_device_remove_attrs(class_dev); + kobject_del(&class_dev->kobj); if (parent) diff -Nru a/drivers/base/class_simple.c b/drivers/base/class_simple.c --- a/drivers/base/class_simple.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/base/class_simple.c 2004-06-23 19:04:26 -07:00 @@ -3,7 +3,7 @@ * * Copyright (c) 2003-2004 Greg Kroah-Hartman * Copyright (c) 2003-2004 IBM Corp. - * + * * This file is released under the GPLv2 * */ @@ -111,7 +111,7 @@ /** * class_simple_device_add - adds a class device to sysfs for a character driver - * @cs: pointer to the struct class_simple that this device should be registered to. + * @cs: pointer to the struct class_simple that this device should be registered to. * @dev: the dev_t for the device to be added. * @device: a pointer to a struct device that is assiociated with this class device. * @fmt: string for the class device's name @@ -146,8 +146,8 @@ s_dev->dev = dev; s_dev->class_dev.dev = device; s_dev->class_dev.class = &cs->class; - - va_start(args,fmt); + + va_start(args, fmt); vsnprintf(s_dev->class_dev.class_id, BUS_ID_SIZE, fmt, args); va_end(args); retval = class_device_register(&s_dev->class_dev); @@ -173,10 +173,10 @@ * @cs: pointer to the struct class_simple to hold the pointer * @hotplug: function pointer to the hotplug function * - * Implement and set a hotplug function to add environment variables specific to this + * Implement and set a hotplug function to add environment variables specific to this * class on the hotplug event. */ -int class_simple_set_hotplug(struct class_simple *cs, +int class_simple_set_hotplug(struct class_simple *cs, int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size)) { if ((cs == NULL) || (IS_ERR(cs))) diff -Nru a/drivers/base/core.c b/drivers/base/core.c --- a/drivers/base/core.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/core.c 2004-06-23 19:04:25 -07:00 @@ -3,7 +3,7 @@ * * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * + * * This file is released under the GPLv2 * */ @@ -28,8 +28,8 @@ * sysfs bindings for devices. */ -#define to_dev(obj) container_of(obj,struct device,kobj) -#define to_dev_attr(_attr) container_of(_attr,struct device_attribute,attr) +#define to_dev(obj) container_of(obj, struct device, kobj) +#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr) extern struct attribute * dev_default_attrs[]; @@ -41,12 +41,12 @@ ssize_t ret = 0; if (dev_attr->show) - ret = dev_attr->show(dev,buf); + ret = dev_attr->show(dev, buf); return ret; } static ssize_t -dev_attr_store(struct kobject * kobj, struct attribute * attr, +dev_attr_store(struct kobject * kobj, struct attribute * attr, const char * buf, size_t count) { struct device_attribute * dev_attr = to_dev_attr(attr); @@ -54,7 +54,7 @@ ssize_t ret = 0; if (dev_attr->store) - ret = dev_attr->store(dev,buf,count); + ret = dev_attr->store(dev, buf, count); return ret; } @@ -153,7 +153,7 @@ { int error = 0; if (get_device(dev)) { - error = sysfs_create_file(&dev->kobj,&attr->attr); + error = sysfs_create_file(&dev->kobj, &attr->attr); put_device(dev); } return error; @@ -168,7 +168,7 @@ void device_remove_file(struct device * dev, struct device_attribute * attr) { if (get_device(dev)) { - sysfs_remove_file(&dev->kobj,&attr->attr); + sysfs_remove_file(&dev->kobj, &attr->attr); put_device(dev); } } @@ -179,7 +179,7 @@ * @dev: device. * * This prepares the device for use by other layers, - * including adding it to the device hierarchy. + * including adding it to the device hierarchy. * It is the first half of device_register(), if called by * that, though it can also be called separately, so one * may use @dev's fields (e.g. the refcount). @@ -187,7 +187,7 @@ void device_initialize(struct device *dev) { - kobj_set_kset_s(dev,devices_subsys); + kobj_set_kset_s(dev, devices_subsys); kobject_init(&dev->kobj); INIT_LIST_HEAD(&dev->node); INIT_LIST_HEAD(&dev->children); @@ -200,7 +200,7 @@ * device_add - add device to device hierarchy. * @dev: device. * - * This is part 2 of device_register(), though may be called + * This is part 2 of device_register(), though may be called * separately _iff_ device_initialize() has been called separately. * * This adds it to the kobject hierarchy via kobject_add(), adds it @@ -221,7 +221,7 @@ pr_debug("DEV: registering device: ID = '%s'\n", dev->bus_id); /* first, register with generic layer. */ - kobject_set_name(&dev->kobj,dev->bus_id); + kobject_set_name(&dev->kobj, dev->bus_id); if (parent) dev->kobj.parent = &parent->kobj; @@ -233,7 +233,7 @@ goto BusError; down_write(&devices_subsys.rwsem); if (parent) - list_add_tail(&dev->node,&parent->children); + list_add_tail(&dev->node, &parent->children); up_write(&devices_subsys.rwsem); /* notify platform of device entry */ @@ -245,7 +245,7 @@ BusError: device_pm_remove(dev); PMError: - kobject_unregister(&dev->kobj); + kobject_del(&dev->kobj); Error: if (parent) put_device(parent); @@ -258,9 +258,9 @@ * @dev: pointer to the device structure * * This happens in two clean steps - initialize the device - * and add it to the system. The two steps can be called - * separately, but this is the easiest and most common. - * I.e. you should only call the two helpers separately if + * and add it to the system. The two steps can be called + * separately, but this is the easiest and most common. + * I.e. you should only call the two helpers separately if * have a clearly defined need to use and refcount the device * before it is added to the hierarchy. */ @@ -301,13 +301,13 @@ * device_del - delete device from system. * @dev: device. * - * This is the first part of the device unregistration + * This is the first part of the device unregistration * sequence. This removes the device from the lists we control - * from here, has it removed from the other driver model + * from here, has it removed from the other driver model * subsystems it was added to in device_add(), and removes it * from the kobject hierarchy. * - * NOTE: this should be called manually _iff_ device_add() was + * NOTE: this should be called manually _iff_ device_add() was * also called manually. */ @@ -340,7 +340,7 @@ * we remove it from all the subsystems with device_del(), then * we decrement the reference count via put_device(). If that * is the final reference count, the device will be cleaned up - * via device_release() above. Otherwise, the structure will + * via device_release() above. Otherwise, the structure will * stick around until the final reference to the device is dropped. */ void device_unregister(struct device * dev) @@ -358,7 +358,7 @@ * @fn: function to be called for each device. * * Iterate over @dev's child devices, and call @fn for each, - * passing it @data. + * passing it @data. * * We check the return of @fn each time. If it returns anything * other than 0, we break out and return that value. @@ -370,8 +370,8 @@ int error = 0; down_read(&devices_subsys.rwsem); - list_for_each_entry(child,&dev->children,node) { - if((error = fn(child,data))) + list_for_each_entry(child, &dev->children, node) { + if((error = fn(child, data))) break; } up_read(&devices_subsys.rwsem); diff -Nru a/drivers/base/cpu.c b/drivers/base/cpu.c --- a/drivers/base/cpu.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/base/cpu.c 2004-06-23 19:04:26 -07:00 @@ -58,6 +58,8 @@ /* * register_cpu - Setup a driverfs device for a CPU. + * @cpu - Callers can set the cpu->no_control field to 1, to indicate not to + * generate a control file in sysfs for this CPU. * @num - CPU number to use when creating the device. * * Initialize and register the CPU device. @@ -75,7 +77,7 @@ error = sysfs_create_link(&root->sysdev.kobj, &cpu->sysdev.kobj, kobject_name(&cpu->sysdev.kobj)); - if (!error) + if (!error && !cpu->no_control) register_cpu_control(cpu); return error; } diff -Nru a/drivers/base/driver.c b/drivers/base/driver.c --- a/drivers/base/driver.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/base/driver.c 2004-06-23 19:04:28 -07:00 @@ -3,7 +3,7 @@ * * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * + * * This file is released under the GPLv2 * */ @@ -15,8 +15,8 @@ #include #include "base.h" -#define to_dev(node) container_of(node,struct device,driver_list) -#define to_drv(obj) container_of(obj,struct device_driver,kobj) +#define to_dev(node) container_of(node, struct device, driver_list) +#define to_drv(obj) container_of(obj, struct device_driver, kobj) /** * driver_create_file - create sysfs file for driver. @@ -28,7 +28,7 @@ { int error; if (get_driver(drv)) { - error = sysfs_create_file(&drv->kobj,&attr->attr); + error = sysfs_create_file(&drv->kobj, &attr->attr); put_driver(drv); } else error = -EINVAL; @@ -45,7 +45,7 @@ void driver_remove_file(struct device_driver * drv, struct driver_attribute * attr) { if (get_driver(drv)) { - sysfs_remove_file(&drv->kobj,&attr->attr); + sysfs_remove_file(&drv->kobj, &attr->attr); put_driver(drv); } } @@ -76,7 +76,7 @@ * @drv: driver to register * * We pass off most of the work to the bus_add_driver() call, - * since most of the things we have to do deal with the bus + * since most of the things we have to do deal with the bus * structures. * * The one interesting aspect is that we initialize @drv->unload_sem @@ -99,8 +99,8 @@ * * Though, once that is done, we attempt to take @drv->unload_sem. * This will block until the driver refcount reaches 0, and it is - * released. Only modular drivers will call this function, and we - * have to guarantee that it won't complete, letting the driver + * released. Only modular drivers will call this function, and we + * have to guarantee that it won't complete, letting the driver * unload until all references are gone. */ diff -Nru a/drivers/base/firmware.c b/drivers/base/firmware.c --- a/drivers/base/firmware.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/base/firmware.c 2004-06-23 19:04:27 -07:00 @@ -3,7 +3,7 @@ * * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * + * * This file is released under the GPLv2 * */ @@ -12,11 +12,11 @@ #include #include -static decl_subsys(firmware,NULL,NULL); +static decl_subsys(firmware, NULL, NULL); int firmware_register(struct subsystem * s) { - kset_set_kset_s(s,firmware_subsys); + kset_set_kset_s(s, firmware_subsys); return subsystem_register(s); } diff -Nru a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c --- a/drivers/base/firmware_class.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/firmware_class.c 2004-06-23 19:04:25 -07:00 @@ -68,7 +68,7 @@ * firmware will be provided. * * Note: zero means 'wait for ever' - * + * **/ static ssize_t firmware_timeout_store(struct class *class, const char *buf, size_t count) @@ -121,7 +121,7 @@ /** * firmware_loading_store: - loading control file * Description: - * The relevant values are: + * The relevant values are: * * 1: Start a load, discarding any previous partial load. * 0: Conclude the load and handle the data to the driver code. @@ -376,7 +376,7 @@ return retval; } -/** +/** * request_firmware: - request firmware to hotplug and wait for it * Description: * @firmware will be used to return a firmware image by the name @@ -457,7 +457,7 @@ /** * register_firmware: - provide a firmware image for later usage - * + * * Description: * Make sure that @data will be available by requesting firmware @name. * @@ -541,7 +541,7 @@ ret = kernel_thread(request_firmware_work_func, fw_work, CLONE_FS | CLONE_FILES); - + if (ret < 0) { fw_work->cont(NULL, fw_work->context); return ret; diff -Nru a/drivers/base/init.c b/drivers/base/init.c --- a/drivers/base/init.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/init.c 2004-06-23 19:04:25 -07:00 @@ -2,7 +2,7 @@ * * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * + * * This file is released under the GPLv2 * */ @@ -33,7 +33,7 @@ classes_init(); firmware_init(); - /* These are also core pieces, but must come after the + /* These are also core pieces, but must come after the * core core pieces. */ platform_bus_init(); diff -Nru a/drivers/base/interface.c b/drivers/base/interface.c --- a/drivers/base/interface.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/interface.c 2004-06-23 19:04:25 -07:00 @@ -1,10 +1,10 @@ /* - * drivers/base/interface.c - common driverfs interface that's exported to + * drivers/base/interface.c - common driverfs interface that's exported to * the world for all devices. * * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * + * * This file is released under the GPLv2 * */ @@ -16,33 +16,33 @@ /** * detach_state - control the default power state for the device. - * - * This is the state the device enters when it's driver module is + * + * This is the state the device enters when it's driver module is * unloaded. The value is an unsigned integer, in the range of 0-4. * '0' indicates 'On', so no action will be taken when the driver is * unloaded. This is the default behavior. * '4' indicates 'Off', meaning the driver core will call the driver's * shutdown method to quiesce the device. - * 1-3 indicate a low-power state for the device to enter via the - * driver's suspend method. + * 1-3 indicate a low-power state for the device to enter via the + * driver's suspend method. */ static ssize_t detach_show(struct device * dev, char * buf) { - return sprintf(buf,"%u\n",dev->detach_state); + return sprintf(buf, "%u\n", dev->detach_state); } static ssize_t detach_store(struct device * dev, const char * buf, size_t n) { u32 state; - state = simple_strtoul(buf,NULL,10); + state = simple_strtoul(buf, NULL, 10); if (state > 4) return -EINVAL; dev->detach_state = state; return n; } -static DEVICE_ATTR(detach_state,0644,detach_show,detach_store); +static DEVICE_ATTR(detach_state, 0644, detach_show, detach_store); struct attribute * dev_default_attrs[] = { diff -Nru a/drivers/base/node.c b/drivers/base/node.c --- a/drivers/base/node.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/node.c 2004-06-23 19:04:25 -07:00 @@ -29,7 +29,7 @@ return len; } -static SYSDEV_ATTR(cpumap,S_IRUGO,node_read_cpumap,NULL); +static SYSDEV_ATTR(cpumap, S_IRUGO, node_read_cpumap, NULL); /* Can be overwritten by architecture specific code. */ int __attribute__((weak)) hugetlb_report_node_meminfo(int node, char *buf) @@ -54,17 +54,17 @@ "Node %d LowFree: %8lu kB\n", nid, K(i.totalram), nid, K(i.freeram), - nid, K(i.totalram-i.freeram), + nid, K(i.totalram - i.freeram), nid, K(i.totalhigh), nid, K(i.freehigh), - nid, K(i.totalram-i.totalhigh), - nid, K(i.freeram-i.freehigh)); + nid, K(i.totalram - i.totalhigh), + nid, K(i.freeram - i.freehigh)); n += hugetlb_report_node_meminfo(nid, buf + n); return n; } -#undef K -static SYSDEV_ATTR(meminfo,S_IRUGO,node_read_meminfo,NULL); +#undef K +static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL); static ssize_t node_read_numastat(struct sys_device * dev, char * buf) { @@ -104,7 +104,7 @@ local_node, other_node); } -static SYSDEV_ATTR(numastat,S_IRUGO,node_read_numastat,NULL); +static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); /* * register_node - Setup a driverfs device for a node. diff -Nru a/drivers/base/platform.c b/drivers/base/platform.c --- a/drivers/base/platform.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/platform.c 2004-06-23 19:04:25 -07:00 @@ -3,7 +3,7 @@ * * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * + * * This file is released under the GPLv2 * * Please see Documentation/driver-model/platform.txt for more @@ -19,12 +19,71 @@ }; /** + * platform_get_resource - get a resource for a device + * @dev: platform device + * @type: resource type + * @num: resource index + */ +struct resource * +platform_get_resource(struct platform_device *dev, unsigned int type, + unsigned int num) +{ + int i; + + for (i = 0; i < dev->num_resources; i++) { + struct resource *r = &dev->resource[i]; + + if ((r->flags & (IORESOURCE_IO|IORESOURCE_MEM| + IORESOURCE_IRQ|IORESOURCE_DMA)) + == type) + if (num-- == 0) + return r; + } + return NULL; +} + +/** + * platform_get_irq - get an IRQ for a device + * @dev: platform device + * @num: IRQ number index + */ +int platform_get_irq(struct platform_device *dev, unsigned int num) +{ + struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); + + return r ? r->start : 0; +} + +/** + * platform_add_devices - add a numbers of platform devices + * @devs: array of platform devices to add + * @num: number of platform devices in array + */ +int platform_add_devices(struct platform_device **devs, int num) +{ + int i, ret = 0; + + for (i = 0; i < num; i++) { + ret = platform_device_register(devs[i]); + if (ret) { + while (--i >= 0) + platform_device_unregister(devs[i]); + break; + } + } + + return ret; +} + +/** * platform_device_register - add a platform-level device * @dev: platform device we're adding * */ int platform_device_register(struct platform_device * pdev) { + int i, ret = 0; + if (!pdev) return -EINVAL; @@ -32,18 +91,59 @@ pdev->dev.parent = &platform_bus; pdev->dev.bus = &platform_bus_type; - - snprintf(pdev->dev.bus_id,BUS_ID_SIZE,"%s%u",pdev->name,pdev->id); + + if (pdev->id != -1) + snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s%u", pdev->name, pdev->id); + else + strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE); + + for (i = 0; i < pdev->num_resources; i++) { + struct resource *p, *r = &pdev->resource[i]; + + r->name = pdev->dev.bus_id; + + p = NULL; + if (r->flags & IORESOURCE_MEM) + p = &iomem_resource; + else if (r->flags & IORESOURCE_IO) + p = &ioport_resource; + + if (p && request_resource(p, r)) { + printk(KERN_ERR + "%s: failed to claim resource %d\n", + pdev->dev.bus_id, i); + ret = -EBUSY; + goto failed; + } + } pr_debug("Registering platform device '%s'. Parent at %s\n", - pdev->dev.bus_id,pdev->dev.parent->bus_id); - return device_register(&pdev->dev); + pdev->dev.bus_id, pdev->dev.parent->bus_id); + + ret = device_register(&pdev->dev); + if (ret == 0) + return ret; + + failed: + while (--i >= 0) + if (pdev->resource[i].flags & (IORESOURCE_MEM|IORESOURCE_IO)) + release_resource(&pdev->resource[i]); + return ret; } void platform_device_unregister(struct platform_device * pdev) { - if (pdev) + int i; + + if (pdev) { device_unregister(&pdev->dev); + + for (i = 0; i < pdev->num_resources; i++) { + struct resource *r = &pdev->resource[i]; + if (r->flags & (IORESOURCE_MEM|IORESOURCE_IO)) + release_resource(r); + } + } } @@ -52,13 +152,13 @@ * @dev: device. * @drv: driver. * - * Platform device IDs are assumed to be encoded like this: - * "", where is a short description of the - * type of device, like "pci" or "floppy", and is the + * Platform device IDs are assumed to be encoded like this: + * "", where is a short description of the + * type of device, like "pci" or "floppy", and is the * enumerated instance of the device, like '0' or '42'. - * Driver IDs are simply "". - * So, extract the from the platform_device structure, - * and compare it against the name of the driver. Return whether + * Driver IDs are simply "". + * So, extract the from the platform_device structure, + * and compare it against the name of the driver. Return whether * they match or not. */ @@ -114,3 +214,5 @@ EXPORT_SYMBOL(platform_bus_type); EXPORT_SYMBOL(platform_device_register); EXPORT_SYMBOL(platform_device_unregister); +EXPORT_SYMBOL(platform_get_irq); +EXPORT_SYMBOL(platform_get_resource); diff -Nru a/drivers/base/power/main.c b/drivers/base/power/main.c --- a/drivers/base/power/main.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/base/power/main.c 2004-06-23 19:04:28 -07:00 @@ -12,10 +12,10 @@ * and add it to the list of power-controlled devices. sysfs entries for * controlling device power management will also be added. * - * A different set of lists than the global subsystem list are used to - * keep track of power info because we use different lists to hold - * devices based on what stage of the power management process they - * are in. The power domain dependencies may also differ from the + * A different set of lists than the global subsystem list are used to + * keep track of power info because we use different lists to hold + * devices based on what stage of the power management process they + * are in. The power domain dependencies may also differ from the * ancestral dependencies that the subsystem list maintains. */ @@ -74,10 +74,10 @@ pr_debug("PM: Adding info for %s:%s\n", dev->bus ? dev->bus->name : "No Bus", dev->kobj.name); - atomic_set(&dev->power.pm_users,0); + atomic_set(&dev->power.pm_users, 0); down(&dpm_sem); - list_add_tail(&dev->power.entry,&dpm_active); - device_pm_set_parent(dev,dev->parent); + list_add_tail(&dev->power.entry, &dpm_active); + device_pm_set_parent(dev, dev->parent); if ((error = dpm_sysfs_add(dev))) list_del(&dev->power.entry); up(&dpm_sem); diff -Nru a/drivers/base/power/power.h b/drivers/base/power/power.h --- a/drivers/base/power/power.h 2004-06-23 19:04:25 -07:00 +++ b/drivers/base/power/power.h 2004-06-23 19:04:25 -07:00 @@ -27,7 +27,7 @@ */ extern struct semaphore dpm_sem; -/* +/* * The PM lists. */ extern struct list_head dpm_active; @@ -37,12 +37,12 @@ static inline struct dev_pm_info * to_pm_info(struct list_head * entry) { - return container_of(entry,struct dev_pm_info,entry); + return container_of(entry, struct dev_pm_info, entry); } static inline struct device * to_device(struct list_head * entry) { - return container_of(to_pm_info(entry),struct device,power); + return container_of(to_pm_info(entry), struct device, power); } extern int device_pm_add(struct device *); @@ -56,7 +56,7 @@ extern void dpm_sysfs_remove(struct device *); /* - * resume.c + * resume.c */ extern void dpm_resume(void); diff -Nru a/drivers/base/power/resume.c b/drivers/base/power/resume.c --- a/drivers/base/power/resume.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/base/power/resume.c 2004-06-23 19:04:28 -07:00 @@ -39,7 +39,7 @@ if (!dev->power.prev_state) resume_device(dev); - list_add_tail(entry,&dpm_active); + list_add_tail(entry, &dpm_active); } } @@ -48,7 +48,7 @@ * device_resume - Restore state of each device in system. * * Walk the dpm_off list, remove each entry, resume the device, - * then add it to the dpm_active list. + * then add it to the dpm_active list. */ void device_resume(void) @@ -62,14 +62,14 @@ /** - * device_power_up_irq - Power on some devices. + * device_power_up_irq - Power on some devices. * - * Walk the dpm_off_irq list and power each device up. This + * Walk the dpm_off_irq list and power each device up. This * is used for devices that required they be powered down with * interrupts disabled. As devices are powered on, they are moved to * the dpm_suspended list. * - * Interrupts must be disabled when calling this. + * Interrupts must be disabled when calling this. */ void dpm_power_up(void) @@ -78,7 +78,7 @@ struct list_head * entry = dpm_off_irq.next; list_del_init(entry); resume_device(to_device(entry)); - list_add_tail(entry,&dpm_active); + list_add_tail(entry, &dpm_active); } } diff -Nru a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c --- a/drivers/base/power/runtime.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/base/power/runtime.c 2004-06-23 19:04:28 -07:00 @@ -24,9 +24,9 @@ * dpm_runtime_resume - Power one device back on. * @dev: Device. * - * Bring one device back to the on state by first powering it + * Bring one device back to the on state by first powering it * on, then restoring state. We only operate on devices that aren't - * already on. + * already on. * FIXME: We need to handle devices that are in an unknown state. */ @@ -55,7 +55,7 @@ if (dev->power.power_state) runtime_resume(dev); - if (!(error = suspend_device(dev,state))) + if (!(error = suspend_device(dev, state))) dev->power.power_state = state; Done: up(&dpm_sem); @@ -70,7 +70,7 @@ * * This is an update mechanism for drivers to notify the core * what power state a device is in. Device probing code may not - * always be able to tell, but we need accurate information to + * always be able to tell, but we need accurate information to * work reliably. */ void dpm_set_power_state(struct device * dev, u32 state) diff -Nru a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c --- a/drivers/base/power/shutdown.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/base/power/shutdown.c 2004-06-23 19:04:27 -07:00 @@ -1,9 +1,9 @@ /* * shutdown.c - power management functions for the device tree. - * + * * Copyright (c) 2002-3 Patrick Mochel * 2002-3 Open Source Development Lab - * + * * This file is released under the GPLv2 * */ @@ -14,7 +14,7 @@ #include "power.h" -#define to_dev(node) container_of(node,struct device,kobj.entry) +#define to_dev(node) container_of(node, struct device, kobj.entry) extern struct subsystem devices_subsys; @@ -29,7 +29,7 @@ dev->driver->shutdown(dev); return 0; } - return dpm_runtime_suspend(dev,dev->detach_state); + return dpm_runtime_suspend(dev, dev->detach_state); } @@ -38,8 +38,8 @@ * down last and resume them first. That way, we don't do anything stupid like * shutting down the interrupt controller before any devices.. * - * Note that there are not different stages for power management calls - - * they only get one called once when interrupts are disabled. + * Note that there are not different stages for power management calls - + * they only get one called once when interrupts are disabled. */ extern int sysdev_shutdown(void); @@ -50,10 +50,10 @@ void device_shutdown(void) { struct device * dev; - + down_write(&devices_subsys.rwsem); - list_for_each_entry_reverse(dev,&devices_subsys.kset.list,kobj.entry) { - pr_debug("shutting down %s: ",dev->bus_id); + list_for_each_entry_reverse(dev, &devices_subsys.kset.list, kobj.entry) { + pr_debug("shutting down %s: ", dev->bus_id); if (dev->driver && dev->driver->shutdown) { pr_debug("Ok\n"); dev->driver->shutdown(dev); diff -Nru a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c --- a/drivers/base/power/suspend.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/base/power/suspend.c 2004-06-23 19:04:28 -07:00 @@ -1,5 +1,5 @@ /* - * suspend.c - Functions for putting devices to sleep. + * suspend.c - Functions for putting devices to sleep. * * Copyright (c) 2003 Patrick Mochel * Copyright (c) 2003 Open Source Development Labs @@ -10,18 +10,18 @@ #include #include "power.h" - + extern int sysdev_suspend(u32 state); /* * The entries in the dpm_active list are in a depth first order, simply - * because children are guaranteed to be discovered after parents, and - * are inserted at the back of the list on discovery. - * + * because children are guaranteed to be discovered after parents, and + * are inserted at the back of the list on discovery. + * * All list on the suspend path are done in reverse order, so we operate * on the leaves of the device tree (or forests, depending on how you want - * to look at it ;) first. As nodes are removed from the back of the list, - * they are inserted into the front of their destintation lists. + * to look at it ;) first. As nodes are removed from the back of the list, + * they are inserted into the front of their destintation lists. * * Things are the reverse on the resume path - iterations are done in * forward order, and nodes are inserted at the back of their destination @@ -44,7 +44,7 @@ dev->power.prev_state = dev->power.power_state; if (dev->bus && dev->bus->suspend && !dev->power.power_state) - error = dev->bus->suspend(dev,state); + error = dev->bus->suspend(dev, state); return error; } @@ -52,16 +52,16 @@ /** * device_suspend - Save state and stop all devices in system. - * @state: Power state to put each device in. + * @state: Power state to put each device in. * * Walk the dpm_active list, call ->suspend() for each device, and move - * it to dpm_off. + * it to dpm_off. * Check the return value for each. If it returns 0, then we move the - * the device to the dpm_off list. If it returns -EAGAIN, we move it to - * the dpm_off_irq list. If we get a different error, try and back out. + * the device to the dpm_off list. If it returns -EAGAIN, we move it to + * the dpm_off_irq list. If we get a different error, try and back out. * * If we hit a failure with any of the devices, call device_resume() - * above to bring the suspended devices back to life. + * above to bring the suspended devices back to life. * * Note this function leaves dpm_sem held to * a) block other devices from registering. @@ -78,14 +78,14 @@ while(!list_empty(&dpm_active)) { struct list_head * entry = dpm_active.prev; struct device * dev = to_device(entry); - error = suspend_device(dev,state); + error = suspend_device(dev, state); if (!error) { list_del(&dev->power.entry); - list_add(&dev->power.entry,&dpm_off); + list_add(&dev->power.entry, &dpm_off); } else if (error == -EAGAIN) { list_del(&dev->power.entry); - list_add(&dev->power.entry,&dpm_off_irq); + list_add(&dev->power.entry, &dpm_off_irq); } else { printk(KERN_ERR "Could not suspend device %s: " "error %d\n", kobject_name(&dev->kobj), error); @@ -108,8 +108,8 @@ * @state: Power state to enter. * * Walk the dpm_off_irq list, calling ->power_down() for each device that - * couldn't power down the device with interrupts enabled. When we're - * done, power down system devices. + * couldn't power down the device with interrupts enabled. When we're + * done, power down system devices. */ int device_power_down(u32 state) @@ -117,10 +117,10 @@ int error = 0; struct device * dev; - list_for_each_entry_reverse(dev,&dpm_off_irq,power.entry) { - if ((error = suspend_device(dev,state))) + list_for_each_entry_reverse(dev, &dpm_off_irq, power.entry) { + if ((error = suspend_device(dev, state))) break; - } + } if (error) goto Error; if ((error = sysdev_suspend(state))) diff -Nru a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c --- a/drivers/base/power/sysfs.c 2004-06-23 19:04:29 -07:00 +++ b/drivers/base/power/sysfs.c 2004-06-23 19:04:29 -07:00 @@ -11,10 +11,10 @@ * * show() returns the current power state of the device. '0' indicates * the device is on. Other values (1-3) indicate the device is in a low - * power state. + * power state. * - * store() sets the current power state, which is an integer value - * between 0-3. If the device is on ('0'), and the value written is + * store() sets the current power state, which is an integer value + * between 0-3. If the device is on ('0'), and the value written is * greater than 0, then the device is placed directly into the low-power * state (via its driver's ->suspend() method). * If the device is currently in a low-power state, and the value is 0, @@ -26,7 +26,7 @@ static ssize_t state_show(struct device * dev, char * buf) { - return sprintf(buf,"%u\n",dev->power.power_state); + return sprintf(buf, "%u\n", dev->power.power_state); } static ssize_t state_store(struct device * dev, const char * buf, size_t n) @@ -35,17 +35,17 @@ char * rest; int error = 0; - state = simple_strtoul(buf,&rest,10); + state = simple_strtoul(buf, &rest, 10); if (*rest) return -EINVAL; if (state) - error = dpm_runtime_suspend(dev,state); + error = dpm_runtime_suspend(dev, state); else dpm_runtime_resume(dev); return error ? error : n; } -static DEVICE_ATTR(state,0644,state_show,state_store); +static DEVICE_ATTR(state, 0644, state_show, state_store); static struct attribute * power_attrs[] = { @@ -59,10 +59,10 @@ int dpm_sysfs_add(struct device * dev) { - return sysfs_create_group(&dev->kobj,&pm_attr_group); + return sysfs_create_group(&dev->kobj, &pm_attr_group); } void dpm_sysfs_remove(struct device * dev) { - sysfs_remove_group(&dev->kobj,&pm_attr_group); + sysfs_remove_group(&dev->kobj, &pm_attr_group); } diff -Nru a/drivers/base/sys.c b/drivers/base/sys.c --- a/drivers/base/sys.c 2004-06-23 19:04:24 -07:00 +++ b/drivers/base/sys.c 2004-06-23 19:04:24 -07:00 @@ -5,8 +5,8 @@ * 2002-3 Open Source Development Lab * * This file is released under the GPLv2 - * - * This exports a 'system' bus type. + * + * This exports a 'system' bus type. * By default, a 'sys' bus gets added to the root of the system. There will * always be core system devices. Devices can use sysdev_register() to * add themselves as children of the system bus. @@ -24,31 +24,31 @@ extern struct subsystem devices_subsys; -#define to_sysdev(k) container_of(k,struct sys_device,kobj) -#define to_sysdev_attr(a) container_of(a,struct sysdev_attribute,attr) +#define to_sysdev(k) container_of(k, struct sys_device, kobj) +#define to_sysdev_attr(a) container_of(a, struct sysdev_attribute, attr) -static ssize_t +static ssize_t sysdev_show(struct kobject * kobj, struct attribute * attr, char * buffer) { struct sys_device * sysdev = to_sysdev(kobj); struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr); if (sysdev_attr->show) - return sysdev_attr->show(sysdev,buffer); + return sysdev_attr->show(sysdev, buffer); return 0; } static ssize_t -sysdev_store(struct kobject * kobj, struct attribute * attr, +sysdev_store(struct kobject * kobj, struct attribute * attr, const char * buffer, size_t count) { struct sys_device * sysdev = to_sysdev(kobj); struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr); if (sysdev_attr->store) - return sysdev_attr->store(sysdev,buffer,count); + return sysdev_attr->store(sysdev, buffer, count); return 0; } @@ -64,22 +64,22 @@ int sysdev_create_file(struct sys_device * s, struct sysdev_attribute * a) { - return sysfs_create_file(&s->kobj,&a->attr); + return sysfs_create_file(&s->kobj, &a->attr); } void sysdev_remove_file(struct sys_device * s, struct sysdev_attribute * a) { - sysfs_remove_file(&s->kobj,&a->attr); + sysfs_remove_file(&s->kobj, &a->attr); } EXPORT_SYMBOL(sysdev_create_file); EXPORT_SYMBOL(sysdev_remove_file); -/* - * declare system_subsys +/* + * declare system_subsys */ -decl_subsys(system,&ktype_sysdev,NULL); +decl_subsys(system, &ktype_sysdev, NULL); int sysdev_class_register(struct sysdev_class * cls) { @@ -87,7 +87,7 @@ kobject_name(&cls->kset.kobj)); INIT_LIST_HEAD(&cls->drivers); cls->kset.subsys = &system_subsys; - kset_set_kset_s(cls,system_subsys); + kset_set_kset_s(cls, system_subsys); return kset_register(&cls->kset); } @@ -109,19 +109,19 @@ * @cls: Device class driver belongs to. * @drv: Driver. * - * If @cls is valid, then @drv is inserted into @cls->drivers to be + * If @cls is valid, then @drv is inserted into @cls->drivers to be * called on each operation on devices of that class. The refcount - * of @cls is incremented. - * Otherwise, @drv is inserted into global_drivers, and called for + * of @cls is incremented. + * Otherwise, @drv is inserted into global_drivers, and called for * each device. */ -int sysdev_driver_register(struct sysdev_class * cls, +int sysdev_driver_register(struct sysdev_class * cls, struct sysdev_driver * drv) { down_write(&system_subsys.rwsem); if (cls && kset_get(&cls->kset)) { - list_add_tail(&drv->entry,&cls->drivers); + list_add_tail(&drv->entry, &cls->drivers); /* If devices of this class already exist, tell the driver */ if (drv->add) { @@ -130,7 +130,7 @@ drv->add(dev); } } else - list_add_tail(&drv->entry,&global_drivers); + list_add_tail(&drv->entry, &global_drivers); up_write(&system_subsys.rwsem); return 0; } @@ -180,12 +180,12 @@ /* But make sure we point to the right type for sysfs translation */ sysdev->kobj.ktype = &ktype_sysdev; - error = kobject_set_name(&sysdev->kobj,"%s%d", - kobject_name(&cls->kset.kobj),sysdev->id); + error = kobject_set_name(&sysdev->kobj, "%s%d", + kobject_name(&cls->kset.kobj), sysdev->id); if (error) return error; - pr_debug("Registering sys device '%s'\n",kobject_name(&sysdev->kobj)); + pr_debug("Registering sys device '%s'\n", kobject_name(&sysdev->kobj)); /* Register the object */ error = kobject_register(&sysdev->kobj); @@ -194,18 +194,18 @@ struct sysdev_driver * drv; down_write(&system_subsys.rwsem); - /* Generic notification is implicit, because it's that - * code that should have called us. + /* Generic notification is implicit, because it's that + * code that should have called us. */ /* Notify global drivers */ - list_for_each_entry(drv,&global_drivers,entry) { + list_for_each_entry(drv, &global_drivers, entry) { if (drv->add) drv->add(sysdev); } /* Notify class auxillary drivers */ - list_for_each_entry(drv,&cls->drivers,entry) { + list_for_each_entry(drv, &cls->drivers, entry) { if (drv->add) drv->add(sysdev); } @@ -219,12 +219,12 @@ struct sysdev_driver * drv; down_write(&system_subsys.rwsem); - list_for_each_entry(drv,&global_drivers,entry) { + list_for_each_entry(drv, &global_drivers, entry) { if (drv->remove) drv->remove(sysdev); } - list_for_each_entry(drv,&sysdev->cls->drivers,entry) { + list_for_each_entry(drv, &sysdev->cls->drivers, entry) { if (drv->remove) drv->remove(sysdev); } @@ -241,12 +241,12 @@ * Loop over each class of system devices, and the devices in each * of those classes. For each device, we call the shutdown method for * each driver registered for the device - the globals, the auxillaries, - * and the class driver. + * and the class driver. * * Note: The list is iterated in reverse order, so that we shut down * child devices before we shut down thier parents. The list ordering * is guaranteed by virtue of the fact that child devices are registered - * after their parents. + * after their parents. */ void sysdev_shutdown(void) @@ -256,25 +256,25 @@ pr_debug("Shutting Down System Devices\n"); down_write(&system_subsys.rwsem); - list_for_each_entry_reverse(cls,&system_subsys.kset.list, + list_for_each_entry_reverse(cls, &system_subsys.kset.list, kset.kobj.entry) { struct sys_device * sysdev; pr_debug("Shutting down type '%s':\n", kobject_name(&cls->kset.kobj)); - list_for_each_entry(sysdev,&cls->kset.list,kobj.entry) { + list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) { struct sysdev_driver * drv; - pr_debug(" %s\n",kobject_name(&sysdev->kobj)); + pr_debug(" %s\n", kobject_name(&sysdev->kobj)); /* Call global drivers first. */ - list_for_each_entry(drv,&global_drivers,entry) { + list_for_each_entry(drv, &global_drivers, entry) { if (drv->shutdown) drv->shutdown(sysdev); } /* Call auxillary drivers next. */ - list_for_each_entry(drv,&cls->drivers,entry) { + list_for_each_entry(drv, &cls->drivers, entry) { if (drv->shutdown) drv->shutdown(sysdev); } @@ -295,7 +295,7 @@ * We perform an almost identical operation as sys_device_shutdown() * above, though calling ->suspend() instead. Interrupts are disabled * when this called. Devices are responsible for both saving state and - * quiescing or powering down the device. + * quiescing or powering down the device. * * This is only called by the device PM core, so we let them handle * all synchronization. @@ -307,32 +307,32 @@ pr_debug("Suspending System Devices\n"); - list_for_each_entry_reverse(cls,&system_subsys.kset.list, + list_for_each_entry_reverse(cls, &system_subsys.kset.list, kset.kobj.entry) { struct sys_device * sysdev; pr_debug("Suspending type '%s':\n", kobject_name(&cls->kset.kobj)); - list_for_each_entry(sysdev,&cls->kset.list,kobj.entry) { + list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) { struct sysdev_driver * drv; - pr_debug(" %s\n",kobject_name(&sysdev->kobj)); + pr_debug(" %s\n", kobject_name(&sysdev->kobj)); /* Call global drivers first. */ - list_for_each_entry(drv,&global_drivers,entry) { + list_for_each_entry(drv, &global_drivers, entry) { if (drv->suspend) - drv->suspend(sysdev,state); + drv->suspend(sysdev, state); } /* Call auxillary drivers next. */ - list_for_each_entry(drv,&cls->drivers,entry) { + list_for_each_entry(drv, &cls->drivers, entry) { if (drv->suspend) - drv->suspend(sysdev,state); + drv->suspend(sysdev, state); } /* Now call the generic one */ if (cls->suspend) - cls->suspend(sysdev,state); + cls->suspend(sysdev, state); } } return 0; @@ -345,7 +345,7 @@ * Similar to sys_device_suspend(), but we iterate the list forwards * to guarantee that parent devices are resumed before their children. * - * Note: Interrupts are disabled when called. + * Note: Interrupts are disabled when called. */ int sysdev_resume(void) @@ -354,28 +354,28 @@ pr_debug("Resuming System Devices\n"); - list_for_each_entry(cls,&system_subsys.kset.list,kset.kobj.entry) { + list_for_each_entry(cls, &system_subsys.kset.list, kset.kobj.entry) { struct sys_device * sysdev; pr_debug("Resuming type '%s':\n", kobject_name(&cls->kset.kobj)); - list_for_each_entry(sysdev,&cls->kset.list,kobj.entry) { + list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) { struct sysdev_driver * drv; - pr_debug(" %s\n",kobject_name(&sysdev->kobj)); + pr_debug(" %s\n", kobject_name(&sysdev->kobj)); /* First, call the class-specific one */ if (cls->resume) cls->resume(sysdev); /* Call auxillary drivers next. */ - list_for_each_entry(drv,&cls->drivers,entry) { + list_for_each_entry(drv, &cls->drivers, entry) { if (drv->resume) drv->resume(sysdev); } /* Call global drivers. */ - list_for_each_entry(drv,&global_drivers,entry) { + list_for_each_entry(drv, &global_drivers, entry) { if (drv->resume) drv->resume(sysdev); } diff -Nru a/drivers/block/Kconfig b/drivers/block/Kconfig --- a/drivers/block/Kconfig 2004-06-23 19:04:26 -07:00 +++ b/drivers/block/Kconfig 2004-06-23 19:04:26 -07:00 @@ -6,7 +6,7 @@ config BLK_DEV_FD tristate "Normal floppy disk support" - depends on (!X86_PC9800 && !ARCH_S390 && !M68K && !IA64) || Q40 || (SUN3X && BROKEN) + depends on (!ARCH_S390 && !M68K && !IA64) || Q40 || (SUN3X && BROKEN) ---help--- If you want to use the floppy disk drive(s) of your PC under Linux, say Y. Information about this driver, especially important for IBM @@ -26,13 +26,6 @@ tristate "Atari floppy support" depends on ATARI -config BLK_DEV_FD98 - tristate "NEC PC-9800 floppy disk support" - depends on X86_PC9800 - ---help--- - If you want to use the floppy disk drive(s) of NEC PC-9801/PC-9821, - say Y. - config BLK_DEV_SWIM_IOP bool "Macintosh IIfx/Quadra 900/Quadra 950 floppy support (EXPERIMENTAL)" depends on MAC && EXPERIMENTAL && BROKEN @@ -292,14 +285,14 @@ If unsure, say N. -config BLK_DEV_CARMEL - tristate "Promise SATA SX8 (carmel) support" +config BLK_DEV_SX8 + tristate "Promise SATA SX8 support" depends on PCI ---help--- Saying Y or M here will enable support for the - Promise SATA SX8 ("carmel") controllers. + Promise SATA SX8 controllers. - Use devices /dev/carmel/$N and /dev/carmel/$Np$M. + Use devices /dev/sx8/$N and /dev/sx8/$Np$M. config BLK_DEV_RAM tristate "RAM disk support" diff -Nru a/drivers/block/Makefile b/drivers/block/Makefile --- a/drivers/block/Makefile 2004-06-23 19:04:28 -07:00 +++ b/drivers/block/Makefile 2004-06-23 19:04:28 -07:00 @@ -41,5 +41,5 @@ obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o obj-$(CONFIG_VIODASD) += viodasd.o -obj-$(CONFIG_BLK_DEV_CARMEL) += carmel.o +obj-$(CONFIG_BLK_DEV_SX8) += sx8.o diff -Nru a/drivers/block/carmel.c b/drivers/block/carmel.c --- a/drivers/block/carmel.c 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,1763 +0,0 @@ -/* - * carmel.c: Driver for Promise SATA SX8 looks-like-I2O hardware - * - * Copyright 2004 Red Hat, Inc. - * - * Author/maintainer: Jeff Garzik - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MODULE_AUTHOR("Jeff Garzik"); -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("Promise SATA SX8 (carmel) block driver"); - -#if 0 -#define CARM_DEBUG -#define CARM_VERBOSE_DEBUG -#else -#undef CARM_DEBUG -#undef CARM_VERBOSE_DEBUG -#endif -#undef CARM_NDEBUG - -#define DRV_NAME "carmel" -#define DRV_VERSION "0.8" -#define PFX DRV_NAME ": " - -#define NEXT_RESP(idx) ((idx + 1) % RMSG_Q_LEN) - -/* 0xf is just arbitrary, non-zero noise; this is sorta like poisoning */ -#define TAG_ENCODE(tag) (((tag) << 16) | 0xf) -#define TAG_DECODE(tag) (((tag) >> 16) & 0x1f) -#define TAG_VALID(tag) ((((tag) & 0xf) == 0xf) && (TAG_DECODE(tag) < 32)) - -/* note: prints function name for you */ -#ifdef CARM_DEBUG -#define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) -#ifdef CARM_VERBOSE_DEBUG -#define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) -#else -#define VPRINTK(fmt, args...) -#endif /* CARM_VERBOSE_DEBUG */ -#else -#define DPRINTK(fmt, args...) -#define VPRINTK(fmt, args...) -#endif /* CARM_DEBUG */ - -#ifdef CARM_NDEBUG -#define assert(expr) -#else -#define assert(expr) \ - if(unlikely(!(expr))) { \ - printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ - #expr,__FILE__,__FUNCTION__,__LINE__); \ - } -#endif - -/* defines only for the constants which don't work well as enums */ -struct carm_host; - -enum { - /* adapter-wide limits */ - CARM_MAX_PORTS = 8, - CARM_SHM_SIZE = (4096 << 7), - CARM_MINORS_PER_MAJOR = 256 / CARM_MAX_PORTS, - CARM_MAX_WAIT_Q = CARM_MAX_PORTS + 1, - - /* command message queue limits */ - CARM_MAX_REQ = 64, /* max command msgs per host */ - CARM_MAX_Q = 1, /* one command at a time */ - CARM_MSG_LOW_WATER = (CARM_MAX_REQ / 4), /* refill mark */ - - /* S/G limits, host-wide and per-request */ - CARM_MAX_REQ_SG = 32, /* max s/g entries per request */ - CARM_SG_BOUNDARY = 0xffffUL, /* s/g segment boundary */ - CARM_MAX_HOST_SG = 600, /* max s/g entries per host */ - CARM_SG_LOW_WATER = (CARM_MAX_HOST_SG / 4), /* re-fill mark */ - - /* hardware registers */ - CARM_IHQP = 0x1c, - CARM_INT_STAT = 0x10, /* interrupt status */ - CARM_INT_MASK = 0x14, /* interrupt mask */ - CARM_HMUC = 0x18, /* host message unit control */ - RBUF_ADDR_LO = 0x20, /* response msg DMA buf low 32 bits */ - RBUF_ADDR_HI = 0x24, /* response msg DMA buf high 32 bits */ - RBUF_BYTE_SZ = 0x28, - CARM_RESP_IDX = 0x2c, - CARM_CMS0 = 0x30, /* command message size reg 0 */ - CARM_LMUC = 0x48, - CARM_HMPHA = 0x6c, - CARM_INITC = 0xb5, - - /* bits in CARM_INT_{STAT,MASK} */ - INT_RESERVED = 0xfffffff0, - INT_WATCHDOG = (1 << 3), /* watchdog timer */ - INT_Q_OVERFLOW = (1 << 2), /* cmd msg q overflow */ - INT_Q_AVAILABLE = (1 << 1), /* cmd msg q has free space */ - INT_RESPONSE = (1 << 0), /* response msg available */ - INT_ACK_MASK = INT_WATCHDOG | INT_Q_OVERFLOW, - INT_DEF_MASK = INT_RESERVED | INT_Q_OVERFLOW | - INT_RESPONSE, - - /* command messages, and related register bits */ - CARM_HAVE_RESP = 0x01, - CARM_MSG_READ = 1, - CARM_MSG_WRITE = 2, - CARM_MSG_VERIFY = 3, - CARM_MSG_GET_CAPACITY = 4, - CARM_MSG_FLUSH = 5, - CARM_MSG_IOCTL = 6, - CARM_MSG_ARRAY = 8, - CARM_MSG_MISC = 9, - CARM_CME = (1 << 2), - CARM_RME = (1 << 1), - CARM_WZBC = (1 << 0), - CARM_RMI = (1 << 0), - CARM_Q_FULL = (1 << 3), - CARM_MSG_SIZE = 288, - CARM_Q_LEN = 48, - - /* CARM_MSG_IOCTL messages */ - CARM_IOC_SCAN_CHAN = 5, /* scan channels for devices */ - CARM_IOC_GET_TCQ = 13, /* get tcq/ncq depth */ - CARM_IOC_SET_TCQ = 14, /* set tcq/ncq depth */ - - IOC_SCAN_CHAN_NODEV = 0x1f, - IOC_SCAN_CHAN_OFFSET = 0x40, - - /* CARM_MSG_ARRAY messages */ - CARM_ARRAY_INFO = 0, - - ARRAY_NO_EXIST = (1 << 31), - - /* response messages */ - RMSG_SZ = 8, /* sizeof(struct carm_response) */ - RMSG_Q_LEN = 48, /* resp. msg list length */ - RMSG_OK = 1, /* bit indicating msg was successful */ - /* length of entire resp. msg buffer */ - RBUF_LEN = RMSG_SZ * RMSG_Q_LEN, - - PDC_SHM_SIZE = (4096 << 7), /* length of entire h/w buffer */ - - /* CARM_MSG_MISC messages */ - MISC_GET_FW_VER = 2, - MISC_ALLOC_MEM = 3, - MISC_SET_TIME = 5, - - /* MISC_GET_FW_VER feature bits */ - FW_VER_4PORT = (1 << 2), /* 1=4 ports, 0=8 ports */ - FW_VER_NON_RAID = (1 << 1), /* 1=non-RAID firmware, 0=RAID */ - FW_VER_ZCR = (1 << 0), /* zero channel RAID (whatever that is) */ - - /* carm_host flags */ - FL_NON_RAID = FW_VER_NON_RAID, - FL_4PORT = FW_VER_4PORT, - FL_FW_VER_MASK = (FW_VER_NON_RAID | FW_VER_4PORT), - FL_DAC = (1 << 16), - FL_DYN_MAJOR = (1 << 17), -}; - -enum scatter_gather_types { - SGT_32BIT = 0, - SGT_64BIT = 1, -}; - -enum host_states { - HST_INVALID, /* invalid state; never used */ - HST_ALLOC_BUF, /* setting up master SHM area */ - HST_ERROR, /* we never leave here */ - HST_PORT_SCAN, /* start dev scan */ - HST_DEV_SCAN_START, /* start per-device probe */ - HST_DEV_SCAN, /* continue per-device probe */ - HST_DEV_ACTIVATE, /* activate devices we found */ - HST_PROBE_FINISHED, /* probe is complete */ - HST_PROBE_START, /* initiate probe */ - HST_SYNC_TIME, /* tell firmware what time it is */ - HST_GET_FW_VER, /* get firmware version, adapter port cnt */ -}; - -#ifdef CARM_DEBUG -static const char *state_name[] = { - "HST_INVALID", - "HST_ALLOC_BUF", - "HST_ERROR", - "HST_PORT_SCAN", - "HST_DEV_SCAN_START", - "HST_DEV_SCAN", - "HST_DEV_ACTIVATE", - "HST_PROBE_FINISHED", - "HST_PROBE_START", - "HST_SYNC_TIME", - "HST_GET_FW_VER", -}; -#endif - -struct carm_port { - unsigned int port_no; - unsigned int n_queued; - struct gendisk *disk; - struct carm_host *host; - - /* attached device characteristics */ - u64 capacity; - char name[41]; - u16 dev_geom_head; - u16 dev_geom_sect; - u16 dev_geom_cyl; -}; - -struct carm_request { - unsigned int tag; - int n_elem; - unsigned int msg_type; - unsigned int msg_subtype; - unsigned int msg_bucket; - struct request *rq; - struct carm_port *port; - struct scatterlist sg[CARM_MAX_REQ_SG]; -}; - -struct carm_host { - unsigned long flags; - void *mmio; - void *shm; - dma_addr_t shm_dma; - - int major; - int id; - char name[32]; - - spinlock_t lock; - struct pci_dev *pdev; - unsigned int state; - u32 fw_ver; - - request_queue_t *oob_q; - unsigned int n_oob; - - unsigned int hw_sg_used; - - unsigned int resp_idx; - - unsigned int wait_q_prod; - unsigned int wait_q_cons; - request_queue_t *wait_q[CARM_MAX_WAIT_Q]; - - unsigned int n_msgs; - u64 msg_alloc; - struct carm_request req[CARM_MAX_REQ]; - void *msg_base; - dma_addr_t msg_dma; - - int cur_scan_dev; - unsigned long dev_active; - unsigned long dev_present; - struct carm_port port[CARM_MAX_PORTS]; - - struct work_struct fsm_task; - - struct semaphore probe_sem; -}; - -struct carm_response { - u32 ret_handle; - u32 status; -} __attribute__((packed)); - -struct carm_msg_sg { - u32 start; - u32 len; -} __attribute__((packed)); - -struct carm_msg_rw { - u8 type; - u8 id; - u8 sg_count; - u8 sg_type; - u32 handle; - u32 lba; - u16 lba_count; - u16 lba_high; - struct carm_msg_sg sg[32]; -} __attribute__((packed)); - -struct carm_msg_allocbuf { - u8 type; - u8 subtype; - u8 n_sg; - u8 sg_type; - u32 handle; - u32 addr; - u32 len; - u32 evt_pool; - u32 n_evt; - u32 rbuf_pool; - u32 n_rbuf; - u32 msg_pool; - u32 n_msg; - struct carm_msg_sg sg[8]; -} __attribute__((packed)); - -struct carm_msg_ioctl { - u8 type; - u8 subtype; - u8 array_id; - u8 reserved1; - u32 handle; - u32 data_addr; - u32 reserved2; -} __attribute__((packed)); - -struct carm_msg_sync_time { - u8 type; - u8 subtype; - u16 reserved1; - u32 handle; - u32 reserved2; - u32 timestamp; -} __attribute__((packed)); - -struct carm_msg_get_fw_ver { - u8 type; - u8 subtype; - u16 reserved1; - u32 handle; - u32 data_addr; - u32 reserved2; -} __attribute__((packed)); - -struct carm_fw_ver { - u32 version; - u8 features; - u8 reserved1; - u16 reserved2; -} __attribute__((packed)); - -struct carm_array_info { - u32 size; - - u16 size_hi; - u16 stripe_size; - - u32 mode; - - u16 stripe_blk_sz; - u16 reserved1; - - u16 cyl; - u16 head; - - u16 sect; - u8 array_id; - u8 reserved2; - - char name[40]; - - u32 array_status; - - /* device list continues beyond this point? */ -} __attribute__((packed)); - -static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); -static void carm_remove_one (struct pci_dev *pdev); -static int carm_bdev_ioctl(struct inode *ino, struct file *fil, - unsigned int cmd, unsigned long arg); - -static struct pci_device_id carm_pci_tbl[] = { - { PCI_VENDOR_ID_PROMISE, 0x8000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, - { PCI_VENDOR_ID_PROMISE, 0x8002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, - { } /* terminate list */ -}; -MODULE_DEVICE_TABLE(pci, carm_pci_tbl); - -static struct pci_driver carm_driver = { - .name = DRV_NAME, - .id_table = carm_pci_tbl, - .probe = carm_init_one, - .remove = carm_remove_one, -}; - -static struct block_device_operations carm_bd_ops = { - .owner = THIS_MODULE, - .ioctl = carm_bdev_ioctl, -}; - -static unsigned int carm_host_id; -static unsigned long carm_major_alloc; - - - -static int carm_bdev_ioctl(struct inode *ino, struct file *fil, - unsigned int cmd, unsigned long arg) -{ - void __user *usermem = (void __user *) arg; - struct carm_port *port = ino->i_bdev->bd_disk->private_data; - struct hd_geometry geom; - - switch (cmd) { - case HDIO_GETGEO: - if (!usermem) - return -EINVAL; - - geom.heads = (u8) port->dev_geom_head; - geom.sectors = (u8) port->dev_geom_sect; - geom.cylinders = port->dev_geom_cyl; - geom.start = get_start_sect(ino->i_bdev); - - if (copy_to_user(usermem, &geom, sizeof(geom))) - return -EFAULT; - return 0; - - default: - break; - } - - return -EOPNOTSUPP; -} - -static const u32 msg_sizes[] = { 32, 64, 128, CARM_MSG_SIZE }; - -static inline int carm_lookup_bucket(u32 msg_size) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(msg_sizes); i++) - if (msg_size <= msg_sizes[i]) - return i; - - return -ENOENT; -} - -static void carm_init_buckets(void *mmio) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(msg_sizes); i++) - writel(msg_sizes[i], mmio + CARM_CMS0 + (4 * i)); -} - -static inline void *carm_ref_msg(struct carm_host *host, - unsigned int msg_idx) -{ - return host->msg_base + (msg_idx * CARM_MSG_SIZE); -} - -static inline dma_addr_t carm_ref_msg_dma(struct carm_host *host, - unsigned int msg_idx) -{ - return host->msg_dma + (msg_idx * CARM_MSG_SIZE); -} - -static int carm_send_msg(struct carm_host *host, - struct carm_request *crq) -{ - void *mmio = host->mmio; - u32 msg = (u32) carm_ref_msg_dma(host, crq->tag); - u32 cm_bucket = crq->msg_bucket; - u32 tmp; - int rc = 0; - - VPRINTK("ENTER\n"); - - tmp = readl(mmio + CARM_HMUC); - if (tmp & CARM_Q_FULL) { -#if 0 - tmp = readl(mmio + CARM_INT_MASK); - tmp |= INT_Q_AVAILABLE; - writel(tmp, mmio + CARM_INT_MASK); - readl(mmio + CARM_INT_MASK); /* flush */ -#endif - DPRINTK("host msg queue full\n"); - rc = -EBUSY; - } else { - writel(msg | (cm_bucket << 1), mmio + CARM_IHQP); - readl(mmio + CARM_IHQP); /* flush */ - } - - return rc; -} - -static struct carm_request *carm_get_request(struct carm_host *host) -{ - unsigned int i; - - /* obey global hardware limit on S/G entries */ - if (host->hw_sg_used >= (CARM_MAX_HOST_SG - CARM_MAX_REQ_SG)) - return NULL; - - for (i = 0; i < CARM_MAX_Q; i++) - if ((host->msg_alloc & (1ULL << i)) == 0) { - struct carm_request *crq = &host->req[i]; - crq->port = NULL; - crq->n_elem = 0; - - host->msg_alloc |= (1ULL << i); - host->n_msgs++; - - assert(host->n_msgs <= CARM_MAX_REQ); - return crq; - } - - DPRINTK("no request available, returning NULL\n"); - return NULL; -} - -static int carm_put_request(struct carm_host *host, struct carm_request *crq) -{ - assert(crq->tag < CARM_MAX_Q); - - if (unlikely((host->msg_alloc & (1ULL << crq->tag)) == 0)) - return -EINVAL; /* tried to clear a tag that was not active */ - - assert(host->hw_sg_used >= crq->n_elem); - - host->msg_alloc &= ~(1ULL << crq->tag); - host->hw_sg_used -= crq->n_elem; - host->n_msgs--; - - return 0; -} - -static struct carm_request *carm_get_special(struct carm_host *host) -{ - unsigned long flags; - struct carm_request *crq = NULL; - struct request *rq; - int tries = 5000; - - while (tries-- > 0) { - spin_lock_irqsave(&host->lock, flags); - crq = carm_get_request(host); - spin_unlock_irqrestore(&host->lock, flags); - - if (crq) - break; - msleep(10); - } - - if (!crq) - return NULL; - - rq = blk_get_request(host->oob_q, WRITE /* bogus */, GFP_KERNEL); - if (!rq) { - spin_lock_irqsave(&host->lock, flags); - carm_put_request(host, crq); - spin_unlock_irqrestore(&host->lock, flags); - return NULL; - } - - crq->rq = rq; - return crq; -} - -static int carm_array_info (struct carm_host *host, unsigned int array_idx) -{ - struct carm_msg_ioctl *ioc; - unsigned int idx; - u32 msg_data; - dma_addr_t msg_dma; - struct carm_request *crq; - int rc; - - crq = carm_get_special(host); - if (!crq) { - rc = -ENOMEM; - goto err_out; - } - - idx = crq->tag; - - ioc = carm_ref_msg(host, idx); - msg_dma = carm_ref_msg_dma(host, idx); - msg_data = (u32) (msg_dma + sizeof(struct carm_array_info)); - - crq->msg_type = CARM_MSG_ARRAY; - crq->msg_subtype = CARM_ARRAY_INFO; - rc = carm_lookup_bucket(sizeof(struct carm_msg_ioctl) + - sizeof(struct carm_array_info)); - BUG_ON(rc < 0); - crq->msg_bucket = (u32) rc; - - memset(ioc, 0, sizeof(*ioc)); - ioc->type = CARM_MSG_ARRAY; - ioc->subtype = CARM_ARRAY_INFO; - ioc->array_id = (u8) array_idx; - ioc->handle = cpu_to_le32(TAG_ENCODE(idx)); - ioc->data_addr = cpu_to_le32(msg_data); - - spin_lock_irq(&host->lock); - assert(host->state == HST_DEV_SCAN_START || - host->state == HST_DEV_SCAN); - spin_unlock_irq(&host->lock); - - DPRINTK("blk_insert_request, tag == %u\n", idx); - blk_insert_request(host->oob_q, crq->rq, 1, crq, 0); - - return 0; - -err_out: - spin_lock_irq(&host->lock); - host->state = HST_ERROR; - spin_unlock_irq(&host->lock); - return rc; -} - -typedef unsigned int (*carm_sspc_t)(struct carm_host *, unsigned int, void *); - -static int carm_send_special (struct carm_host *host, carm_sspc_t func) -{ - struct carm_request *crq; - struct carm_msg_ioctl *ioc; - void *mem; - unsigned int idx, msg_size; - int rc; - - crq = carm_get_special(host); - if (!crq) - return -ENOMEM; - - idx = crq->tag; - - mem = carm_ref_msg(host, idx); - - msg_size = func(host, idx, mem); - - ioc = mem; - crq->msg_type = ioc->type; - crq->msg_subtype = ioc->subtype; - rc = carm_lookup_bucket(msg_size); - BUG_ON(rc < 0); - crq->msg_bucket = (u32) rc; - - DPRINTK("blk_insert_request, tag == %u\n", idx); - blk_insert_request(host->oob_q, crq->rq, 1, crq, 0); - - return 0; -} - -static unsigned int carm_fill_sync_time(struct carm_host *host, - unsigned int idx, void *mem) -{ - struct timeval tv; - struct carm_msg_sync_time *st = mem; - - do_gettimeofday(&tv); - - memset(st, 0, sizeof(*st)); - st->type = CARM_MSG_MISC; - st->subtype = MISC_SET_TIME; - st->handle = cpu_to_le32(TAG_ENCODE(idx)); - st->timestamp = cpu_to_le32(tv.tv_sec); - - return sizeof(struct carm_msg_sync_time); -} - -static unsigned int carm_fill_alloc_buf(struct carm_host *host, - unsigned int idx, void *mem) -{ - struct carm_msg_allocbuf *ab = mem; - - memset(ab, 0, sizeof(*ab)); - ab->type = CARM_MSG_MISC; - ab->subtype = MISC_ALLOC_MEM; - ab->handle = cpu_to_le32(TAG_ENCODE(idx)); - ab->n_sg = 1; - ab->sg_type = SGT_32BIT; - ab->addr = cpu_to_le32(host->shm_dma + (PDC_SHM_SIZE >> 1)); - ab->len = cpu_to_le32(PDC_SHM_SIZE >> 1); - ab->evt_pool = cpu_to_le32(host->shm_dma + (16 * 1024)); - ab->n_evt = cpu_to_le32(1024); - ab->rbuf_pool = cpu_to_le32(host->shm_dma); - ab->n_rbuf = cpu_to_le32(RMSG_Q_LEN); - ab->msg_pool = cpu_to_le32(host->shm_dma + RBUF_LEN); - ab->n_msg = cpu_to_le32(CARM_Q_LEN); - ab->sg[0].start = cpu_to_le32(host->shm_dma + (PDC_SHM_SIZE >> 1)); - ab->sg[0].len = cpu_to_le32(65536); - - return sizeof(struct carm_msg_allocbuf); -} - -static unsigned int carm_fill_scan_channels(struct carm_host *host, - unsigned int idx, void *mem) -{ - struct carm_msg_ioctl *ioc = mem; - u32 msg_data = (u32) (carm_ref_msg_dma(host, idx) + - IOC_SCAN_CHAN_OFFSET); - - memset(ioc, 0, sizeof(*ioc)); - ioc->type = CARM_MSG_IOCTL; - ioc->subtype = CARM_IOC_SCAN_CHAN; - ioc->handle = cpu_to_le32(TAG_ENCODE(idx)); - ioc->data_addr = cpu_to_le32(msg_data); - - /* fill output data area with "no device" default values */ - mem += IOC_SCAN_CHAN_OFFSET; - memset(mem, IOC_SCAN_CHAN_NODEV, CARM_MAX_PORTS); - - return IOC_SCAN_CHAN_OFFSET + CARM_MAX_PORTS; -} - -static unsigned int carm_fill_get_fw_ver(struct carm_host *host, - unsigned int idx, void *mem) -{ - struct carm_msg_get_fw_ver *ioc = mem; - u32 msg_data = (u32) (carm_ref_msg_dma(host, idx) + sizeof(*ioc)); - - memset(ioc, 0, sizeof(*ioc)); - ioc->type = CARM_MSG_MISC; - ioc->subtype = MISC_GET_FW_VER; - ioc->handle = cpu_to_le32(TAG_ENCODE(idx)); - ioc->data_addr = cpu_to_le32(msg_data); - - return sizeof(struct carm_msg_get_fw_ver) + - sizeof(struct carm_fw_ver); -} - -static inline void carm_end_request_queued(struct carm_host *host, - struct carm_request *crq, - int uptodate) -{ - struct request *req = crq->rq; - int rc; - - rc = end_that_request_first(req, uptodate, req->hard_nr_sectors); - assert(rc == 0); - - end_that_request_last(req); - - rc = carm_put_request(host, crq); - assert(rc == 0); -} - -static inline void carm_push_q (struct carm_host *host, request_queue_t *q) -{ - unsigned int idx = host->wait_q_prod % CARM_MAX_WAIT_Q; - - blk_stop_queue(q); - VPRINTK("STOPPED QUEUE %p\n", q); - - host->wait_q[idx] = q; - host->wait_q_prod++; - BUG_ON(host->wait_q_prod == host->wait_q_cons); /* overrun */ -} - -static inline request_queue_t *carm_pop_q(struct carm_host *host) -{ - unsigned int idx; - - if (host->wait_q_prod == host->wait_q_cons) - return NULL; - - idx = host->wait_q_cons % CARM_MAX_WAIT_Q; - host->wait_q_cons++; - - return host->wait_q[idx]; -} - -static inline void carm_round_robin(struct carm_host *host) -{ - request_queue_t *q = carm_pop_q(host); - if (q) { - blk_start_queue(q); - VPRINTK("STARTED QUEUE %p\n", q); - } -} - -static inline void carm_end_rq(struct carm_host *host, struct carm_request *crq, - int is_ok) -{ - carm_end_request_queued(host, crq, is_ok); - if (CARM_MAX_Q == 1) - carm_round_robin(host); - else if ((host->n_msgs <= CARM_MSG_LOW_WATER) && - (host->hw_sg_used <= CARM_SG_LOW_WATER)) { - carm_round_robin(host); - } -} - -static void carm_oob_rq_fn(request_queue_t *q) -{ - struct carm_host *host = q->queuedata; - struct carm_request *crq; - struct request *rq; - int rc; - - while (1) { - DPRINTK("get req\n"); - rq = elv_next_request(q); - if (!rq) - break; - - blkdev_dequeue_request(rq); - - crq = rq->special; - assert(crq != NULL); - assert(crq->rq == rq); - - crq->n_elem = 0; - - DPRINTK("send req\n"); - rc = carm_send_msg(host, crq); - if (rc) { - blk_requeue_request(q, rq); - carm_push_q(host, q); - return; /* call us again later, eventually */ - } - } -} - -static void carm_rq_fn(request_queue_t *q) -{ - struct carm_port *port = q->queuedata; - struct carm_host *host = port->host; - struct carm_msg_rw *msg; - struct carm_request *crq; - struct request *rq; - struct scatterlist *sg; - int writing = 0, pci_dir, i, n_elem, rc; - u32 tmp; - unsigned int msg_size; - -queue_one_request: - VPRINTK("get req\n"); - rq = elv_next_request(q); - if (!rq) - return; - - crq = carm_get_request(host); - if (!crq) { - carm_push_q(host, q); - return; /* call us again later, eventually */ - } - crq->rq = rq; - - blkdev_dequeue_request(rq); - - if (rq_data_dir(rq) == WRITE) { - writing = 1; - pci_dir = PCI_DMA_TODEVICE; - } else { - pci_dir = PCI_DMA_FROMDEVICE; - } - - /* get scatterlist from block layer */ - sg = &crq->sg[0]; - n_elem = blk_rq_map_sg(q, rq, sg); - if (n_elem <= 0) { - carm_end_rq(host, crq, 0); - return; /* request with no s/g entries? */ - } - - /* map scatterlist to PCI bus addresses */ - n_elem = pci_map_sg(host->pdev, sg, n_elem, pci_dir); - if (n_elem <= 0) { - carm_end_rq(host, crq, 0); - return; /* request with no s/g entries? */ - } - crq->n_elem = n_elem; - crq->port = port; - host->hw_sg_used += n_elem; - - /* - * build read/write message - */ - - VPRINTK("build msg\n"); - msg = (struct carm_msg_rw *) carm_ref_msg(host, crq->tag); - - if (writing) { - msg->type = CARM_MSG_WRITE; - crq->msg_type = CARM_MSG_WRITE; - } else { - msg->type = CARM_MSG_READ; - crq->msg_type = CARM_MSG_READ; - } - - msg->id = port->port_no; - msg->sg_count = n_elem; - msg->sg_type = SGT_32BIT; - msg->handle = cpu_to_le32(TAG_ENCODE(crq->tag)); - msg->lba = cpu_to_le32(rq->sector & 0xffffffff); - tmp = (rq->sector >> 16) >> 16; - msg->lba_high = cpu_to_le16( (u16) tmp ); - msg->lba_count = cpu_to_le16(rq->nr_sectors); - - msg_size = sizeof(struct carm_msg_rw) - sizeof(msg->sg); - for (i = 0; i < n_elem; i++) { - struct carm_msg_sg *carm_sg = &msg->sg[i]; - carm_sg->start = cpu_to_le32(sg_dma_address(&crq->sg[i])); - carm_sg->len = cpu_to_le32(sg_dma_len(&crq->sg[i])); - msg_size += sizeof(struct carm_msg_sg); - } - - rc = carm_lookup_bucket(msg_size); - BUG_ON(rc < 0); - crq->msg_bucket = (u32) rc; - - /* - * queue read/write message to hardware - */ - - VPRINTK("send msg, tag == %u\n", crq->tag); - rc = carm_send_msg(host, crq); - if (rc) { - carm_put_request(host, crq); - blk_requeue_request(q, rq); - carm_push_q(host, q); - return; /* call us again later, eventually */ - } - - goto queue_one_request; -} - -static void carm_handle_array_info(struct carm_host *host, - struct carm_request *crq, u8 *mem, - int is_ok) -{ - struct carm_port *port; - u8 *msg_data = mem + sizeof(struct carm_array_info); - struct carm_array_info *desc = (struct carm_array_info *) msg_data; - u64 lo, hi; - int cur_port; - size_t slen; - - DPRINTK("ENTER\n"); - - carm_end_rq(host, crq, is_ok); - - if (!is_ok) - goto out; - if (le32_to_cpu(desc->array_status) & ARRAY_NO_EXIST) - goto out; - - cur_port = host->cur_scan_dev; - - /* should never occur */ - if ((cur_port < 0) || (cur_port >= CARM_MAX_PORTS)) { - printk(KERN_ERR PFX "BUG: cur_scan_dev==%d, array_id==%d\n", - cur_port, (int) desc->array_id); - goto out; - } - - port = &host->port[cur_port]; - - lo = (u64) le32_to_cpu(desc->size); - hi = (u64) le32_to_cpu(desc->size_hi); - - port->capacity = lo | (hi << 32); - port->dev_geom_head = le16_to_cpu(desc->head); - port->dev_geom_sect = le16_to_cpu(desc->sect); - port->dev_geom_cyl = le16_to_cpu(desc->cyl); - - host->dev_active |= (1 << cur_port); - - strncpy(port->name, desc->name, sizeof(port->name)); - port->name[sizeof(port->name) - 1] = 0; - slen = strlen(port->name); - while (slen && (port->name[slen - 1] == ' ')) { - port->name[slen - 1] = 0; - slen--; - } - - printk(KERN_INFO DRV_NAME "(%s): port %u device %Lu sectors\n", - pci_name(host->pdev), port->port_no, - (unsigned long long) port->capacity); - printk(KERN_INFO DRV_NAME "(%s): port %u device \"%s\"\n", - pci_name(host->pdev), port->port_no, port->name); - -out: - assert(host->state == HST_DEV_SCAN); - schedule_work(&host->fsm_task); -} - -static void carm_handle_scan_chan(struct carm_host *host, - struct carm_request *crq, u8 *mem, - int is_ok) -{ - u8 *msg_data = mem + IOC_SCAN_CHAN_OFFSET; - unsigned int i, dev_count = 0; - int new_state = HST_DEV_SCAN_START; - - DPRINTK("ENTER\n"); - - carm_end_rq(host, crq, is_ok); - - if (!is_ok) { - new_state = HST_ERROR; - goto out; - } - - /* TODO: scan and support non-disk devices */ - for (i = 0; i < 8; i++) - if (msg_data[i] == 0) { /* direct-access device (disk) */ - host->dev_present |= (1 << i); - dev_count++; - } - - printk(KERN_INFO DRV_NAME "(%s): found %u interesting devices\n", - pci_name(host->pdev), dev_count); - -out: - assert(host->state == HST_PORT_SCAN); - host->state = new_state; - schedule_work(&host->fsm_task); -} - -static void carm_handle_generic(struct carm_host *host, - struct carm_request *crq, int is_ok, - int cur_state, int next_state) -{ - DPRINTK("ENTER\n"); - - carm_end_rq(host, crq, is_ok); - - assert(host->state == cur_state); - if (is_ok) - host->state = next_state; - else - host->state = HST_ERROR; - schedule_work(&host->fsm_task); -} - -static inline void carm_handle_rw(struct carm_host *host, - struct carm_request *crq, int is_ok) -{ - int pci_dir; - - VPRINTK("ENTER\n"); - - if (rq_data_dir(crq->rq) == WRITE) - pci_dir = PCI_DMA_TODEVICE; - else - pci_dir = PCI_DMA_FROMDEVICE; - - pci_unmap_sg(host->pdev, &crq->sg[0], crq->n_elem, pci_dir); - - carm_end_rq(host, crq, is_ok); -} - -static inline void carm_handle_resp(struct carm_host *host, - u32 ret_handle_le, u32 status) -{ - u32 handle = le32_to_cpu(ret_handle_le); - unsigned int msg_idx; - struct carm_request *crq; - int is_ok = (status == RMSG_OK); - u8 *mem; - - VPRINTK("ENTER, handle == 0x%x\n", handle); - - if (unlikely(!TAG_VALID(handle))) { - printk(KERN_ERR DRV_NAME "(%s): BUG: invalid tag 0x%x\n", - pci_name(host->pdev), handle); - return; - } - - msg_idx = TAG_DECODE(handle); - VPRINTK("tag == %u\n", msg_idx); - - crq = &host->req[msg_idx]; - - /* fast path */ - if (likely(crq->msg_type == CARM_MSG_READ || - crq->msg_type == CARM_MSG_WRITE)) { - carm_handle_rw(host, crq, is_ok); - return; - } - - mem = carm_ref_msg(host, msg_idx); - - switch (crq->msg_type) { - case CARM_MSG_IOCTL: { - switch (crq->msg_subtype) { - case CARM_IOC_SCAN_CHAN: - carm_handle_scan_chan(host, crq, mem, is_ok); - break; - default: - /* unknown / invalid response */ - goto err_out; - } - break; - } - - case CARM_MSG_MISC: { - switch (crq->msg_subtype) { - case MISC_ALLOC_MEM: - carm_handle_generic(host, crq, is_ok, - HST_ALLOC_BUF, HST_SYNC_TIME); - break; - case MISC_SET_TIME: - carm_handle_generic(host, crq, is_ok, - HST_SYNC_TIME, HST_GET_FW_VER); - break; - case MISC_GET_FW_VER: { - struct carm_fw_ver *ver = (struct carm_fw_ver *) - mem + sizeof(struct carm_msg_get_fw_ver); - if (is_ok) { - host->fw_ver = le32_to_cpu(ver->version); - host->flags |= (ver->features & FL_FW_VER_MASK); - } - carm_handle_generic(host, crq, is_ok, - HST_GET_FW_VER, HST_PORT_SCAN); - break; - } - default: - /* unknown / invalid response */ - goto err_out; - } - break; - } - - case CARM_MSG_ARRAY: { - switch (crq->msg_subtype) { - case CARM_ARRAY_INFO: - carm_handle_array_info(host, crq, mem, is_ok); - break; - default: - /* unknown / invalid response */ - goto err_out; - } - break; - } - - default: - /* unknown / invalid response */ - goto err_out; - } - - return; - -err_out: - printk(KERN_WARNING DRV_NAME "(%s): BUG: unhandled message type %d/%d\n", - pci_name(host->pdev), crq->msg_type, crq->msg_subtype); - carm_end_rq(host, crq, 0); -} - -static inline void carm_handle_responses(struct carm_host *host) -{ - void *mmio = host->mmio; - struct carm_response *resp = (struct carm_response *) host->shm; - unsigned int work = 0; - unsigned int idx = host->resp_idx % RMSG_Q_LEN; - - while (1) { - u32 status = le32_to_cpu(resp[idx].status); - - if (status == 0xffffffff) { - VPRINTK("ending response on index %u\n", idx); - writel(idx << 3, mmio + CARM_RESP_IDX); - break; - } - - /* response to a message we sent */ - else if ((status & (1 << 31)) == 0) { - VPRINTK("handling msg response on index %u\n", idx); - carm_handle_resp(host, resp[idx].ret_handle, status); - resp[idx].status = 0xffffffff; - } - - /* asynchronous events the hardware throws our way */ - else if ((status & 0xff000000) == (1 << 31)) { - u8 *evt_type_ptr = (u8 *) &resp[idx]; - u8 evt_type = *evt_type_ptr; - printk(KERN_WARNING DRV_NAME "(%s): unhandled event type %d\n", - pci_name(host->pdev), (int) evt_type); - resp[idx].status = 0xffffffff; - } - - idx = NEXT_RESP(idx); - work++; - } - - VPRINTK("EXIT, work==%u\n", work); - host->resp_idx += work; -} - -static irqreturn_t carm_interrupt(int irq, void *__host, struct pt_regs *regs) -{ - struct carm_host *host = __host; - void *mmio; - u32 mask; - int handled = 0; - unsigned long flags; - - if (!host) { - VPRINTK("no host\n"); - return IRQ_NONE; - } - - spin_lock_irqsave(&host->lock, flags); - - mmio = host->mmio; - - /* reading should also clear interrupts */ - mask = readl(mmio + CARM_INT_STAT); - - if (mask == 0 || mask == 0xffffffff) { - VPRINTK("no work, mask == 0x%x\n", mask); - goto out; - } - - if (mask & INT_ACK_MASK) - writel(mask, mmio + CARM_INT_STAT); - - if (unlikely(host->state == HST_INVALID)) { - VPRINTK("not initialized yet, mask = 0x%x\n", mask); - goto out; - } - - if (mask & CARM_HAVE_RESP) { - handled = 1; - carm_handle_responses(host); - } - -out: - spin_unlock_irqrestore(&host->lock, flags); - VPRINTK("EXIT\n"); - return IRQ_RETVAL(handled); -} - -static void carm_fsm_task (void *_data) -{ - struct carm_host *host = _data; - unsigned long flags; - unsigned int state; - int rc, i, next_dev; - int reschedule = 0; - int new_state = HST_INVALID; - - spin_lock_irqsave(&host->lock, flags); - state = host->state; - spin_unlock_irqrestore(&host->lock, flags); - - DPRINTK("ENTER, state == %s\n", state_name[state]); - - switch (state) { - case HST_PROBE_START: - new_state = HST_ALLOC_BUF; - reschedule = 1; - break; - - case HST_ALLOC_BUF: - rc = carm_send_special(host, carm_fill_alloc_buf); - if (rc) { - new_state = HST_ERROR; - reschedule = 1; - } - break; - - case HST_SYNC_TIME: - rc = carm_send_special(host, carm_fill_sync_time); - if (rc) { - new_state = HST_ERROR; - reschedule = 1; - } - break; - - case HST_GET_FW_VER: - rc = carm_send_special(host, carm_fill_get_fw_ver); - if (rc) { - new_state = HST_ERROR; - reschedule = 1; - } - break; - - case HST_PORT_SCAN: - rc = carm_send_special(host, carm_fill_scan_channels); - if (rc) { - new_state = HST_ERROR; - reschedule = 1; - } - break; - - case HST_DEV_SCAN_START: - host->cur_scan_dev = -1; - new_state = HST_DEV_SCAN; - reschedule = 1; - break; - - case HST_DEV_SCAN: - next_dev = -1; - for (i = host->cur_scan_dev + 1; i < CARM_MAX_PORTS; i++) - if (host->dev_present & (1 << i)) { - next_dev = i; - break; - } - - if (next_dev >= 0) { - host->cur_scan_dev = next_dev; - rc = carm_array_info(host, next_dev); - if (rc) { - new_state = HST_ERROR; - reschedule = 1; - } - } else { - new_state = HST_DEV_ACTIVATE; - reschedule = 1; - } - break; - - case HST_DEV_ACTIVATE: { - int activated = 0; - for (i = 0; i < CARM_MAX_PORTS; i++) - if (host->dev_active & (1 << i)) { - struct carm_port *port = &host->port[i]; - struct gendisk *disk = port->disk; - - set_capacity(disk, port->capacity); - add_disk(disk); - activated++; - } - - printk(KERN_INFO DRV_NAME "(%s): %d ports activated\n", - pci_name(host->pdev), activated); - - new_state = HST_PROBE_FINISHED; - reschedule = 1; - break; - } - - case HST_PROBE_FINISHED: - up(&host->probe_sem); - break; - - case HST_ERROR: - /* FIXME: TODO */ - break; - - default: - /* should never occur */ - printk(KERN_ERR PFX "BUG: unknown state %d\n", state); - assert(0); - break; - } - - if (new_state != HST_INVALID) { - spin_lock_irqsave(&host->lock, flags); - host->state = new_state; - spin_unlock_irqrestore(&host->lock, flags); - } - if (reschedule) - schedule_work(&host->fsm_task); -} - -static int carm_init_wait(void *mmio, u32 bits, unsigned int test_bit) -{ - unsigned int i; - - for (i = 0; i < 50000; i++) { - u32 tmp = readl(mmio + CARM_LMUC); - udelay(100); - - if (test_bit) { - if ((tmp & bits) == bits) - return 0; - } else { - if ((tmp & bits) == 0) - return 0; - } - - cond_resched(); - } - - printk(KERN_ERR PFX "carm_init_wait timeout, bits == 0x%x, test_bit == %s\n", - bits, test_bit ? "yes" : "no"); - return -EBUSY; -} - -static void carm_init_responses(struct carm_host *host) -{ - void *mmio = host->mmio; - unsigned int i; - struct carm_response *resp = (struct carm_response *) host->shm; - - for (i = 0; i < RMSG_Q_LEN; i++) - resp[i].status = 0xffffffff; - - writel(0, mmio + CARM_RESP_IDX); -} - -static int carm_init_host(struct carm_host *host) -{ - void *mmio = host->mmio; - u32 tmp; - u8 tmp8; - int rc; - - DPRINTK("ENTER\n"); - - writel(0, mmio + CARM_INT_MASK); - - tmp8 = readb(mmio + CARM_INITC); - if (tmp8 & 0x01) { - tmp8 &= ~0x01; - writeb(tmp8, CARM_INITC); - readb(mmio + CARM_INITC); /* flush */ - - DPRINTK("snooze...\n"); - msleep(5000); - } - - tmp = readl(mmio + CARM_HMUC); - if (tmp & CARM_CME) { - DPRINTK("CME bit present, waiting\n"); - rc = carm_init_wait(mmio, CARM_CME, 1); - if (rc) { - DPRINTK("EXIT, carm_init_wait 1 failed\n"); - return rc; - } - } - if (tmp & CARM_RME) { - DPRINTK("RME bit present, waiting\n"); - rc = carm_init_wait(mmio, CARM_RME, 1); - if (rc) { - DPRINTK("EXIT, carm_init_wait 2 failed\n"); - return rc; - } - } - - tmp &= ~(CARM_RME | CARM_CME); - writel(tmp, mmio + CARM_HMUC); - readl(mmio + CARM_HMUC); /* flush */ - - rc = carm_init_wait(mmio, CARM_RME | CARM_CME, 0); - if (rc) { - DPRINTK("EXIT, carm_init_wait 3 failed\n"); - return rc; - } - - carm_init_buckets(mmio); - - writel(host->shm_dma & 0xffffffff, mmio + RBUF_ADDR_LO); - writel((host->shm_dma >> 16) >> 16, mmio + RBUF_ADDR_HI); - writel(RBUF_LEN, mmio + RBUF_BYTE_SZ); - - tmp = readl(mmio + CARM_HMUC); - tmp |= (CARM_RME | CARM_CME | CARM_WZBC); - writel(tmp, mmio + CARM_HMUC); - readl(mmio + CARM_HMUC); /* flush */ - - rc = carm_init_wait(mmio, CARM_RME | CARM_CME, 1); - if (rc) { - DPRINTK("EXIT, carm_init_wait 4 failed\n"); - return rc; - } - - writel(0, mmio + CARM_HMPHA); - writel(INT_DEF_MASK, mmio + CARM_INT_MASK); - - carm_init_responses(host); - - /* start initialization, probing state machine */ - spin_lock_irq(&host->lock); - assert(host->state == HST_INVALID); - host->state = HST_PROBE_START; - spin_unlock_irq(&host->lock); - schedule_work(&host->fsm_task); - - DPRINTK("EXIT\n"); - return 0; -} - -static int carm_init_disks(struct carm_host *host) -{ - unsigned int i; - int rc = 0; - - for (i = 0; i < CARM_MAX_PORTS; i++) { - struct gendisk *disk; - request_queue_t *q; - struct carm_port *port; - - port = &host->port[i]; - port->host = host; - port->port_no = i; - - disk = alloc_disk(CARM_MINORS_PER_MAJOR); - if (!disk) { - rc = -ENOMEM; - break; - } - - port->disk = disk; - sprintf(disk->disk_name, DRV_NAME "%u_%u", host->id, i); - sprintf(disk->devfs_name, DRV_NAME "/%u_%u", host->id, i); - disk->major = host->major; - disk->first_minor = i * CARM_MINORS_PER_MAJOR; - disk->fops = &carm_bd_ops; - disk->private_data = port; - - q = blk_init_queue(carm_rq_fn, &host->lock); - if (!q) { - rc = -ENOMEM; - break; - } - disk->queue = q; - blk_queue_max_hw_segments(q, CARM_MAX_REQ_SG); - blk_queue_max_phys_segments(q, CARM_MAX_REQ_SG); - blk_queue_segment_boundary(q, CARM_SG_BOUNDARY); - - q->queuedata = port; - } - - return rc; -} - -static void carm_free_disks(struct carm_host *host) -{ - unsigned int i; - - for (i = 0; i < CARM_MAX_PORTS; i++) { - struct gendisk *disk = host->port[i].disk; - if (disk) { - request_queue_t *q = disk->queue; - - if (disk->flags & GENHD_FL_UP) - del_gendisk(disk); - if (q) - blk_cleanup_queue(q); - put_disk(disk); - } - } -} - -static int carm_init_shm(struct carm_host *host) -{ - host->shm = pci_alloc_consistent(host->pdev, CARM_SHM_SIZE, - &host->shm_dma); - if (!host->shm) - return -ENOMEM; - - host->msg_base = host->shm + RBUF_LEN; - host->msg_dma = host->shm_dma + RBUF_LEN; - - memset(host->shm, 0xff, RBUF_LEN); - memset(host->msg_base, 0, PDC_SHM_SIZE - RBUF_LEN); - - return 0; -} - -static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) -{ - static unsigned int printed_version; - struct carm_host *host; - unsigned int pci_dac; - int rc; - request_queue_t *q; - unsigned int i; - - if (!printed_version++) - printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); - - rc = pci_enable_device(pdev); - if (rc) - return rc; - - rc = pci_request_regions(pdev, DRV_NAME); - if (rc) - goto err_out; - -#if IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */ - rc = pci_set_dma_mask(pdev, 0xffffffffffffffffULL); - if (!rc) { - rc = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL); - if (rc) { - printk(KERN_ERR DRV_NAME "(%s): consistent DMA mask failure\n", - pci_name(pdev)); - goto err_out_regions; - } - pci_dac = 1; - } else { -#endif - rc = pci_set_dma_mask(pdev, 0xffffffffULL); - if (rc) { - printk(KERN_ERR DRV_NAME "(%s): DMA mask failure\n", - pci_name(pdev)); - goto err_out_regions; - } - pci_dac = 0; -#if IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */ - } -#endif - - host = kmalloc(sizeof(*host), GFP_KERNEL); - if (!host) { - printk(KERN_ERR DRV_NAME "(%s): memory alloc failure\n", - pci_name(pdev)); - rc = -ENOMEM; - goto err_out_regions; - } - - memset(host, 0, sizeof(*host)); - host->pdev = pdev; - host->flags = pci_dac ? FL_DAC : 0; - spin_lock_init(&host->lock); - INIT_WORK(&host->fsm_task, carm_fsm_task, host); - init_MUTEX_LOCKED(&host->probe_sem); - - for (i = 0; i < ARRAY_SIZE(host->req); i++) - host->req[i].tag = i; - - host->mmio = ioremap(pci_resource_start(pdev, 0), - pci_resource_len(pdev, 0)); - if (!host->mmio) { - printk(KERN_ERR DRV_NAME "(%s): MMIO alloc failure\n", - pci_name(pdev)); - rc = -ENOMEM; - goto err_out_kfree; - } - - rc = carm_init_shm(host); - if (rc) { - printk(KERN_ERR DRV_NAME "(%s): DMA SHM alloc failure\n", - pci_name(pdev)); - goto err_out_iounmap; - } - - q = blk_init_queue(carm_oob_rq_fn, &host->lock); - if (!q) { - printk(KERN_ERR DRV_NAME "(%s): OOB queue alloc failure\n", - pci_name(pdev)); - rc = -ENOMEM; - goto err_out_pci_free; - } - host->oob_q = q; - q->queuedata = host; - - /* - * Figure out which major to use: 160, 161, or dynamic - */ - if (!test_and_set_bit(0, &carm_major_alloc)) - host->major = 160; - else if (!test_and_set_bit(1, &carm_major_alloc)) - host->major = 161; - else - host->flags |= FL_DYN_MAJOR; - - host->id = carm_host_id; - sprintf(host->name, DRV_NAME "%d", carm_host_id); - - rc = register_blkdev(host->major, host->name); - if (rc < 0) - goto err_out_free_majors; - if (host->flags & FL_DYN_MAJOR) - host->major = rc; - - devfs_mk_dir(DRV_NAME); - - rc = carm_init_disks(host); - if (rc) - goto err_out_blkdev_disks; - - pci_set_master(pdev); - - rc = request_irq(pdev->irq, carm_interrupt, SA_SHIRQ, DRV_NAME, host); - if (rc) { - printk(KERN_ERR DRV_NAME "(%s): irq alloc failure\n", - pci_name(pdev)); - goto err_out_blkdev_disks; - } - - rc = carm_init_host(host); - if (rc) - goto err_out_free_irq; - - DPRINTK("waiting for probe_sem\n"); - down(&host->probe_sem); - - printk(KERN_INFO "%s: pci %s, ports %d, io %lx, irq %u, major %d\n", - host->name, pci_name(pdev), (int) CARM_MAX_PORTS, - pci_resource_start(pdev, 0), pdev->irq, host->major); - - carm_host_id++; - pci_set_drvdata(pdev, host); - return 0; - -err_out_free_irq: - free_irq(pdev->irq, host); -err_out_blkdev_disks: - carm_free_disks(host); - unregister_blkdev(host->major, host->name); -err_out_free_majors: - if (host->major == 160) - clear_bit(0, &carm_major_alloc); - else if (host->major == 161) - clear_bit(1, &carm_major_alloc); - blk_cleanup_queue(host->oob_q); -err_out_pci_free: - pci_free_consistent(pdev, CARM_SHM_SIZE, host->shm, host->shm_dma); -err_out_iounmap: - iounmap(host->mmio); -err_out_kfree: - kfree(host); -err_out_regions: - pci_release_regions(pdev); -err_out: - pci_disable_device(pdev); - return rc; -} - -static void carm_remove_one (struct pci_dev *pdev) -{ - struct carm_host *host = pci_get_drvdata(pdev); - - if (!host) { - printk(KERN_ERR PFX "BUG: no host data for PCI(%s)\n", - pci_name(pdev)); - return; - } - - free_irq(pdev->irq, host); - carm_free_disks(host); - devfs_remove(DRV_NAME); - unregister_blkdev(host->major, host->name); - if (host->major == 160) - clear_bit(0, &carm_major_alloc); - else if (host->major == 161) - clear_bit(1, &carm_major_alloc); - blk_cleanup_queue(host->oob_q); - pci_free_consistent(pdev, CARM_SHM_SIZE, host->shm, host->shm_dma); - iounmap(host->mmio); - kfree(host); - pci_release_regions(pdev); - pci_disable_device(pdev); - pci_set_drvdata(pdev, NULL); -} - -static int __init carm_init(void) -{ - return pci_module_init(&carm_driver); -} - -static void __exit carm_exit(void) -{ - pci_unregister_driver(&carm_driver); -} - -module_init(carm_init); -module_exit(carm_exit); - - diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/block/cciss.c 2004-06-23 19:04:28 -07:00 @@ -479,6 +479,148 @@ return 0; } +#ifdef CONFIG_COMPAT +/* for AMD 64 bit kernel compatibility with 32-bit userland ioctls */ +extern long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); +extern int +register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, + unsigned int, unsigned long, struct file *)); +extern int unregister_ioctl32_conversion(unsigned int cmd); + +static int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg, struct file *file); +static int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg, + struct file *file); + +typedef int (*handler_type) (unsigned int, unsigned int, unsigned long, struct file *); + +static struct ioctl32_map { + unsigned int cmd; + handler_type handler; + int registered; +} cciss_ioctl32_map[] = { + { CCISS_GETPCIINFO, (handler_type) sys_ioctl, 0 }, + { CCISS_GETINTINFO, (handler_type) sys_ioctl, 0 }, + { CCISS_SETINTINFO, (handler_type) sys_ioctl, 0 }, + { CCISS_GETNODENAME, (handler_type) sys_ioctl, 0 }, + { CCISS_SETNODENAME, (handler_type) sys_ioctl, 0 }, + { CCISS_GETHEARTBEAT, (handler_type) sys_ioctl, 0 }, + { CCISS_GETBUSTYPES, (handler_type) sys_ioctl, 0 }, + { CCISS_GETFIRMVER, (handler_type) sys_ioctl, 0 }, + { CCISS_GETDRIVVER, (handler_type) sys_ioctl, 0 }, + { CCISS_REVALIDVOLS, (handler_type) sys_ioctl, 0 }, + { CCISS_PASSTHRU32, cciss_ioctl32_passthru, 0 }, + { CCISS_DEREGDISK, (handler_type) sys_ioctl, 0 }, + { CCISS_REGNEWDISK, (handler_type) sys_ioctl, 0 }, + { CCISS_REGNEWD, (handler_type) sys_ioctl, 0 }, + { CCISS_RESCANDISK, (handler_type) sys_ioctl, 0 }, + { CCISS_GETLUNINFO, (handler_type) sys_ioctl, 0 }, + { CCISS_BIG_PASSTHRU32, cciss_ioctl32_big_passthru, 0 }, +}; +#define NCCISS_IOCTL32_ENTRIES (sizeof(cciss_ioctl32_map) / sizeof(cciss_ioctl32_map[0])) +static void register_cciss_ioctl32(void) +{ + int i, rc; + + for (i=0; i < NCCISS_IOCTL32_ENTRIES; i++) { + rc = register_ioctl32_conversion( + cciss_ioctl32_map[i].cmd, + cciss_ioctl32_map[i].handler); + if (rc != 0) { + printk(KERN_WARNING "cciss: failed to register " + "32 bit compatible ioctl 0x%08x\n", + cciss_ioctl32_map[i].cmd); + cciss_ioctl32_map[i].registered = 0; + } else + cciss_ioctl32_map[i].registered = 1; + } +} +static void unregister_cciss_ioctl32(void) +{ + int i, rc; + + for (i=0; i < NCCISS_IOCTL32_ENTRIES; i++) { + if (!cciss_ioctl32_map[i].registered) + continue; + rc = unregister_ioctl32_conversion( + cciss_ioctl32_map[i].cmd); + if (rc == 0) { + cciss_ioctl32_map[i].registered = 0; + continue; + } + printk(KERN_WARNING "cciss: failed to unregister " + "32 bit compatible ioctl 0x%08x\n", + cciss_ioctl32_map[i].cmd); + } +} +int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg, + struct file *file) +{ + IOCTL32_Command_struct *arg32 = + (IOCTL32_Command_struct *) arg; + IOCTL_Command_struct arg64; + mm_segment_t old_fs; + int err; + unsigned long cp; + + err = 0; + err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info)); + err |= copy_from_user(&arg64.Request, &arg32->Request, sizeof(arg64.Request)); + err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info)); + err |= get_user(arg64.buf_size, &arg32->buf_size); + err |= get_user(cp, &arg32->buf); + arg64.buf = (BYTE *)cp; + + if (err) + return -EFAULT; + + old_fs = get_fs(); + set_fs(KERNEL_DS); + err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) &arg64); + set_fs(old_fs); + if (err) + return err; + err |= copy_to_user(&arg32->error_info, &arg64.error_info, sizeof(&arg32->error_info)); + if (err) + return -EFAULT; + return err; +} +int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg, + struct file *file) +{ + BIG_IOCTL32_Command_struct *arg32 = + (BIG_IOCTL32_Command_struct *) arg; + BIG_IOCTL_Command_struct arg64; + mm_segment_t old_fs; + int err; + unsigned long cp; + + err = 0; + err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info)); + err |= copy_from_user(&arg64.Request, &arg32->Request, sizeof(arg64.Request)); + err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info)); + err |= get_user(arg64.buf_size, &arg32->buf_size); + err |= get_user(arg64.malloc_size, &arg32->malloc_size); + err |= get_user(cp, &arg32->buf); + arg64.buf = (BYTE *)cp; + + if (err) + return -EFAULT; + + old_fs = get_fs(); + set_fs(KERNEL_DS); + err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) &arg64); + set_fs(old_fs); + if (err) + return err; + err |= copy_to_user(&arg32->error_info, &arg64.error_info, sizeof(&arg32->error_info)); + if (err) + return -EFAULT; + return err; +} +#else +static inline void register_cciss_ioctl32(void) {} +static inline void unregister_cciss_ioctl32(void) {} +#endif /* * ioctl */ @@ -2728,6 +2870,7 @@ static int __init init_cciss_module(void) { + register_cciss_ioctl32(); return ( cciss_init()); } @@ -2735,6 +2878,7 @@ { int i; + unregister_cciss_ioctl32(); pci_unregister_driver(&cciss_pci_driver); /* double check that all controller entrys have been removed */ for (i=0; i< MAX_CTLR; i++) diff -Nru a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c --- a/drivers/block/cfq-iosched.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/block/cfq-iosched.c 2004-06-23 19:04:27 -07:00 @@ -59,6 +59,14 @@ unsigned int max_queued; mempool_t *crq_pool; + + request_queue_t *queue; + + /* + * tunables + */ + unsigned int cfq_quantum; + unsigned int cfq_queued; }; struct cfq_queue { @@ -89,7 +97,8 @@ static void cfq_put_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq); static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *cfqd, int pid); -static void cfq_dispatch_sort(struct list_head *head, struct cfq_rq *crq); +static void cfq_dispatch_sort(struct cfq_data *cfqd, struct cfq_queue *cfqq, + struct cfq_rq *crq); /* * lots of deadline iosched dupes, can be abstracted later... @@ -206,8 +215,7 @@ return; } - cfq_del_crq_rb(cfqq, __alias); - cfq_dispatch_sort(cfqd->dispatch, __alias); + cfq_dispatch_sort(cfqd, cfqq, __alias); goto retry; } @@ -321,11 +329,16 @@ cfq_remove_request(q, next); } -static void cfq_dispatch_sort(struct list_head *head, struct cfq_rq *crq) +static void +cfq_dispatch_sort(struct cfq_data *cfqd, struct cfq_queue *cfqq, + struct cfq_rq *crq) { - struct list_head *entry = head; + struct list_head *head = cfqd->dispatch, *entry = head; struct request *__rq; + cfq_del_crq_rb(cfqq, crq); + cfq_remove_merge_hints(cfqd->queue, crq); + if (!list_empty(head)) { __rq = list_entry_rq(head->next); @@ -352,9 +365,7 @@ { struct cfq_rq *crq = rb_entry_crq(rb_first(&cfqq->sort_list)); - cfq_del_crq_rb(cfqq, crq); - cfq_remove_merge_hints(q, crq); - cfq_dispatch_sort(cfqd->dispatch, crq); + cfq_dispatch_sort(cfqd, cfqq, crq); } static int cfq_dispatch_requests(request_queue_t *q, struct cfq_data *cfqd) @@ -385,7 +396,7 @@ ret = 1; } - if ((queued < cfq_quantum) && good_queues) + if ((queued < cfqd->cfq_quantum) && good_queues) goto restart; return ret; @@ -556,7 +567,7 @@ cfqq = cfq_find_cfq_hash(cfqd, current->tgid); if (cfqq) { - int limit = (q->nr_requests - cfq_queued) / cfqd->busy_queues; + int limit = (q->nr_requests - cfqd->cfq_queued) / cfqd->busy_queues; if (limit < 3) limit = 3; @@ -574,6 +585,8 @@ { struct cfq_data *cfqd = q->elevator.elevator_data; struct cfq_rq *crq = RQ_DATA(rq); + struct request_list *rl; + int other_rw; if (crq) { BUG_ON(q->last_merge == rq); @@ -582,6 +595,23 @@ mempool_free(crq, cfqd->crq_pool); rq->elevator_private = NULL; } + + /* + * work-around for may_queue "bug": if a read gets issued and refused + * to queue because writes ate all the allowed slots and no other + * reads are pending for this queue, it could get stuck infinitely + * since freed_request() only checks the waitqueue for writes when + * freeing them. or vice versa for a single write vs many reads. + * so check here whether "the other" data direction might be able + * to queue and wake them + */ + rl = &q->rq; + other_rw = rq_data_dir(rq) ^ 1; + if (rl->count[other_rw] <= q->nr_requests) { + smp_mb(); + if (waitqueue_active(&rl->wait[other_rw])) + wake_up(&rl->wait[other_rw]); + } } static int cfq_set_request(request_queue_t *q, struct request *rq, int gfp_mask) @@ -643,6 +673,7 @@ cfqd->dispatch = &q->queue_head; e->elevator_data = cfqd; + cfqd->queue = q; /* * just set it to some high value, we want anyone to be able to queue @@ -651,6 +682,9 @@ cfqd->max_queued = q->nr_requests; q->nr_requests = 8192; + cfqd->cfq_queued = cfq_queued; + cfqd->cfq_quantum = cfq_quantum; + return 0; out_crqpool: kfree(cfqd->cfq_hash); @@ -685,8 +719,110 @@ subsys_initcall(cfq_slab_setup); +/* + * sysfs parts below --> + */ +struct cfq_fs_entry { + struct attribute attr; + ssize_t (*show)(struct cfq_data *, char *); + ssize_t (*store)(struct cfq_data *, const char *, size_t); +}; + +static ssize_t +cfq_var_show(unsigned int var, char *page) +{ + return sprintf(page, "%d\n", var); +} + +static ssize_t +cfq_var_store(unsigned int *var, const char *page, size_t count) +{ + char *p = (char *) page; + + *var = simple_strtoul(p, &p, 10); + return count; +} + +#define SHOW_FUNCTION(__FUNC, __VAR) \ +static ssize_t __FUNC(struct cfq_data *cfqd, char *page) \ +{ \ + return cfq_var_show(__VAR, (page)); \ +} +SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum); +SHOW_FUNCTION(cfq_queued_show, cfqd->cfq_queued); +#undef SHOW_FUNCTION + +#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX) \ +static ssize_t __FUNC(struct cfq_data *cfqd, const char *page, size_t count) \ +{ \ + int ret = cfq_var_store(__PTR, (page), count); \ + if (*(__PTR) < (MIN)) \ + *(__PTR) = (MIN); \ + else if (*(__PTR) > (MAX)) \ + *(__PTR) = (MAX); \ + return ret; \ +} +STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, INT_MAX); +STORE_FUNCTION(cfq_queued_store, &cfqd->cfq_queued, 1, INT_MAX); +#undef STORE_FUNCTION + +static struct cfq_fs_entry cfq_quantum_entry = { + .attr = {.name = "quantum", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_quantum_show, + .store = cfq_quantum_store, +}; +static struct cfq_fs_entry cfq_queued_entry = { + .attr = {.name = "queued", .mode = S_IRUGO | S_IWUSR }, + .show = cfq_queued_show, + .store = cfq_queued_store, +}; + +static struct attribute *default_attrs[] = { + &cfq_quantum_entry.attr, + &cfq_queued_entry.attr, + NULL, +}; + +#define to_cfq(atr) container_of((atr), struct cfq_fs_entry, attr) + +static ssize_t +cfq_attr_show(struct kobject *kobj, struct attribute *attr, char *page) +{ + elevator_t *e = container_of(kobj, elevator_t, kobj); + struct cfq_fs_entry *entry = to_cfq(attr); + + if (!entry->show) + return 0; + + return entry->show(e->elevator_data, page); +} + +static ssize_t +cfq_attr_store(struct kobject *kobj, struct attribute *attr, + const char *page, size_t length) +{ + elevator_t *e = container_of(kobj, elevator_t, kobj); + struct cfq_fs_entry *entry = to_cfq(attr); + + if (!entry->store) + return -EINVAL; + + return entry->store(e->elevator_data, page, length); +} + +static struct sysfs_ops cfq_sysfs_ops = { + .show = cfq_attr_show, + .store = cfq_attr_store, +}; + +struct kobj_type cfq_ktype = { + .sysfs_ops = &cfq_sysfs_ops, + .default_attrs = default_attrs, +}; + elevator_t iosched_cfq = { .elevator_name = "cfq", + .elevator_ktype = &cfq_ktype, .elevator_merge_fn = cfq_merge, .elevator_merged_fn = cfq_merged_request, .elevator_merge_req_fn = cfq_merged_requests, diff -Nru a/drivers/block/elevator.c b/drivers/block/elevator.c --- a/drivers/block/elevator.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/block/elevator.c 2004-06-23 19:04:28 -07:00 @@ -181,6 +181,14 @@ rq->q = q; q->elevator.elevator_add_req_fn(q, rq, where); + + if (blk_queue_plugged(q)) { + int nrq = q->rq.count[READ] + q->rq.count[WRITE] - q->in_flight; + + if (nrq == q->unplug_thresh) + __generic_unplug_device(q); + } + } void elv_add_request(request_queue_t *q, struct request *rq, int where, diff -Nru a/drivers/block/floppy98.c b/drivers/block/floppy98.c --- a/drivers/block/floppy98.c 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,4682 +0,0 @@ -/* - * linux/drivers/block/floppy.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright (C) 1993, 1994 Alain Knaff - * Copyright (C) 1998 Alan Cox - */ -/* - * 02.12.91 - Changed to static variables to indicate need for reset - * and recalibrate. This makes some things easier (output_byte reset - * checking etc), and means less interrupt jumping in case of errors, - * so the code is hopefully easier to understand. - */ - -/* - * This file is certainly a mess. I've tried my best to get it working, - * but I don't like programming floppies, and I have only one anyway. - * Urgel. I should check for more errors, and do more graceful error - * recovery. Seems there are problems with several drives. I've tried to - * correct them. No promises. - */ - -/* - * As with hd.c, all routines within this file can (and will) be called - * by interrupts, so extreme caution is needed. A hardware interrupt - * handler may not sleep, or a kernel panic will happen. Thus I cannot - * call "floppy-on" directly, but have to set a special timer interrupt - * etc. - */ - -/* - * 28.02.92 - made track-buffering routines, based on the routines written - * by entropy@wintermute.wpi.edu (Lawrence Foard). Linus. - */ - -/* - * Automatic floppy-detection and formatting written by Werner Almesberger - * (almesber@nessie.cs.id.ethz.ch), who also corrected some problems with - * the floppy-change signal detection. - */ - -/* - * 1992/7/22 -- Hennus Bergman: Added better error reporting, fixed - * FDC data overrun bug, added some preliminary stuff for vertical - * recording support. - * - * 1992/9/17: Added DMA allocation & DMA functions. -- hhb. - * - * TODO: Errors are still not counted properly. - */ - -/* 1992/9/20 - * Modifications for ``Sector Shifting'' by Rob Hooft (hooft@chem.ruu.nl) - * modeled after the freeware MS-DOS program fdformat/88 V1.8 by - * Christoph H. Hochst\"atter. - * I have fixed the shift values to the ones I always use. Maybe a new - * ioctl() should be created to be able to modify them. - * There is a bug in the driver that makes it impossible to format a - * floppy as the first thing after bootup. - */ - -/* - * 1993/4/29 -- Linus -- cleaned up the timer handling in the kernel, and - * this helped the floppy driver as well. Much cleaner, and still seems to - * work. - */ - -/* 1994/6/24 --bbroad-- added the floppy table entries and made - * minor modifications to allow 2.88 floppies to be run. - */ - -/* 1994/7/13 -- Paul Vojta -- modified the probing code to allow three or more - * disk types. - */ - -/* - * 1994/8/8 -- Alain Knaff -- Switched to fdpatch driver: Support for bigger - * format bug fixes, but unfortunately some new bugs too... - */ - -/* 1994/9/17 -- Koen Holtman -- added logging of physical floppy write - * errors to allow safe writing by specialized programs. - */ - -/* 1995/4/24 -- Dan Fandrich -- added support for Commodore 1581 3.5" disks - * by defining bit 1 of the "stretch" parameter to mean put sectors on the - * opposite side of the disk, leaving the sector IDs alone (i.e. Commodore's - * drives are "upside-down"). - */ - -/* - * 1995/8/26 -- Andreas Busse -- added Mips support. - */ - -/* - * 1995/10/18 -- Ralf Baechle -- Portability cleanup; move machine dependent - * features to asm/floppy.h. - */ - -/* - * 1998/05/07 -- Russell King -- More portability cleanups; moved definition of - * interrupt and dma channel to asm/floppy.h. Cleaned up some formatting & - * use of '0' for NULL. - */ - -/* - * 1998/06/07 -- Alan Cox -- Merged the 2.0.34 fixes for resource allocation - * failures. - */ - -/* - * 1998/09/20 -- David Weinehall -- Added slow-down code for buggy PS/2-drives. - */ - -/* - * 1999/01/19 -- N.Fujita & Linux/98 Project -- Added code for NEC PC-9800 - * series. - */ - -/* - * 1999/08/13 -- Paul Slootman -- floppy stopped working on Alpha after 24 - * days, 6 hours, 32 minutes and 32 seconds (i.e. MAXINT jiffies; ints were - * being used to store jiffies, which are unsigned longs). - */ - -/* - * 2000/08/28 -- Arnaldo Carvalho de Melo - * - get rid of check_region - * - s/suser/capable/ - */ - -/* - * 2001/08/26 -- Paul Gortmaker - fix insmod oops on machines with no - * floppy controller (lingering task on list after module is gone... boom.) - */ - -/* - * 2002/02/07 -- Anton Altaparmakov - Fix io ports reservation to correct range - * (0x3f2-0x3f5, 0x3f7). This fix is a bit of a hack but the proper fix - * requires many non-obvious changes in arch dependent code. - */ - -/* - * 2002/10/12 -- Osamu Tomita - * split code from floppy.c - * support NEC PC-9800 only - */ - -#define FLOPPY_SANITY_CHECK -#undef FLOPPY_SILENT_DCL_CLEAR - -/* -#define PC9800_DEBUG_FLOPPY -#define PC9800_DEBUG_FLOPPY2 -*/ - -#define REALLY_SLOW_IO - -#define DEBUGT 2 -#define DCL_DEBUG /* debug disk change line */ - -/* do print messages for unexpected interrupts */ -static int print_unex=1; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* for the compatibility eject ioctl */ -#include - -/* - * 1998/1/21 -- Richard Gooch -- devfs support - */ - - -#include -#define FLOPPY98_MOTOR_MASK 0x08 - -#include -#define FD98_STATUS (0 + FD_IOPORT ) -#define FD98_DATA (2 + FD_IOPORT ) -#define FD_MODE (4 + FD_IOPORT ) -#define FD_MODE_CHANGE 0xbe -#define FD_EMODE_CHANGE 0x4be - -#include -#include -#include -#include -#include -#include -#include -#include /* CMOS defines */ -#include -#include -#include -#include -#include -#include /* for invalidate_buffers() */ - -/* - * PS/2 floppies have much slower step rates than regular floppies. - * It's been recommended that take about 1/4 of the default speed - * in some more extreme cases. - */ -static int slow_floppy; - -#include -#include -#include -#include -#include - -#ifndef DEFAULT_FLOPPY_IRQ -# define DEFAULT_FLOPPY_IRQ 11 -#endif -#ifndef DEFAULT_FLOPPY_DMA -# define DEFAULT_FLOPPY_DMA 2 -#endif - -static int FLOPPY_IRQ=DEFAULT_FLOPPY_IRQ; -static int FLOPPY_DMA=DEFAULT_FLOPPY_DMA; -static int can_use_virtual_dma=2; -static int auto_detect_mode = 0; -static int retry_auto_detect = 0; -#define FD_AFTER_RESET_DELAY 1000 - -/* ======= - * can use virtual DMA: - * 0 = use of virtual DMA disallowed by config - * 1 = use of virtual DMA prescribed by config - * 2 = no virtual DMA preference configured. By default try hard DMA, - * but fall back on virtual DMA when not enough memory available - */ - -static int use_virtual_dma; -/* ======= - * use virtual DMA - * 0 using hard DMA - * 1 using virtual DMA - * This variable is set to virtual when a DMA mem problem arises, and - * reset back in floppy_grab_irq_and_dma. - * It is not safe to reset it in other circumstances, because the floppy - * driver may have several buffers in use at once, and we do currently not - * record each buffers capabilities - */ - -static spinlock_t floppy_lock = SPIN_LOCK_UNLOCKED; -static struct completion device_release; - -static unsigned short virtual_dma_port=0x3f0; -irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs); -static int set_mode(char mask, char data); -static void register_devfs_entries (int drive) __init; - -#define K_64 0x10000 /* 64KB */ - -/* the following is the mask of allowed drives. By default units 2 and - * 3 of both floppy controllers are disabled, because switching on the - * motor of these drives causes system hangs on some PCI computers. drive - * 0 is the low bit (0x1), and drive 7 is the high bit (0x80). Bits are on if - * a drive is allowed. - * - * NOTE: This must come before we include the arch floppy header because - * some ports reference this variable from there. -DaveM - */ - -static int allowed_drive_mask = 0x0f; - -#include - -static int irqdma_allocated; - -#define LOCAL_END_REQUEST -#define DEVICE_NAME "floppy" - -#include -#include /* for the compatibility eject ioctl */ -#include - -static struct request *current_req; -static struct request_queue *floppy_queue; - -#ifndef fd_get_dma_residue -#define fd_get_dma_residue() get_dma_residue(FLOPPY_DMA) -#endif - -/* Dma Memory related stuff */ - -#ifndef fd_dma_mem_free -#define fd_dma_mem_free(addr, size) free_pages(addr, get_order(size)) -#endif - -#ifndef fd_dma_mem_alloc -#define fd_dma_mem_alloc(size) __get_dma_pages(GFP_KERNEL,get_order(size)) -#endif - -static inline void fallback_on_nodma_alloc(char **addr, size_t l) -{ -#ifdef FLOPPY_CAN_FALLBACK_ON_NODMA - if (*addr) - return; /* we have the memory */ - if (can_use_virtual_dma != 2) - return; /* no fallback allowed */ - printk("DMA memory shortage. Temporarily falling back on virtual DMA\n"); - *addr = (char *) nodma_mem_alloc(l); -#else - return; -#endif -} - -/* End dma memory related stuff */ - -static unsigned long fake_change; -static int initialising=1; - -#define ITYPE(x) (((x)>>2) & 0x1f) -#define TOMINOR(x) ((x & 3) | ((x & 4) << 5)) -#define UNIT(x) ((x) & 0x03) /* drive on fdc */ -#define FDC(x) (((x) & 0x04) >> 2) /* fdc of drive */ -#define REVDRIVE(fdc, unit) ((unit) + ((fdc) << 2)) - /* reverse mapping from unit and fdc to drive */ -#define DP (&drive_params[current_drive]) -#define DRS (&drive_state[current_drive]) -#define DRWE (&write_errors[current_drive]) -#define FDCS (&fdc_state[fdc]) -#define CLEARF(x) (clear_bit(x##_BIT, &DRS->flags)) -#define SETF(x) (set_bit(x##_BIT, &DRS->flags)) -#define TESTF(x) (test_bit(x##_BIT, &DRS->flags)) - -#define UDP (&drive_params[drive]) -#define UDRS (&drive_state[drive]) -#define UDRWE (&write_errors[drive]) -#define UFDCS (&fdc_state[FDC(drive)]) -#define UCLEARF(x) (clear_bit(x##_BIT, &UDRS->flags)) -#define USETF(x) (set_bit(x##_BIT, &UDRS->flags)) -#define UTESTF(x) (test_bit(x##_BIT, &UDRS->flags)) - -#define DPRINT(format, args...) printk(DEVICE_NAME "%d: " format, current_drive , ## args) - -#define PH_HEAD(floppy,head) (((((floppy)->stretch & 2) >>1) ^ head) << 2) -#define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH) - -#define CLEARSTRUCT(x) memset((x), 0, sizeof(*(x))) - -/* read/write */ -#define COMMAND raw_cmd->cmd[0] -#define DR_SELECT raw_cmd->cmd[1] -#define TRACK raw_cmd->cmd[2] -#define HEAD raw_cmd->cmd[3] -#define SECTOR raw_cmd->cmd[4] -#define SIZECODE raw_cmd->cmd[5] -#define SECT_PER_TRACK raw_cmd->cmd[6] -#define GAP raw_cmd->cmd[7] -#define SIZECODE2 raw_cmd->cmd[8] -#define NR_RW 9 - -/* format */ -#define F_SIZECODE raw_cmd->cmd[2] -#define F_SECT_PER_TRACK raw_cmd->cmd[3] -#define F_GAP raw_cmd->cmd[4] -#define F_FILL raw_cmd->cmd[5] -#define NR_F 6 - -/* - * Maximum disk size (in kilobytes). This default is used whenever the - * current disk size is unknown. - * [Now it is rather a minimum] - */ -#define MAX_DISK_SIZE 4 /* 3984*/ - - -/* - * globals used by 'result()' - */ -#define MAX_REPLIES 16 -static unsigned char reply_buffer[MAX_REPLIES]; -static int inr; /* size of reply buffer, when called from interrupt */ -#define ST0 (reply_buffer[0]) -#define ST1 (reply_buffer[1]) -#define ST2 (reply_buffer[2]) -#define ST3 (reply_buffer[0]) /* result of GETSTATUS */ -#define R_TRACK (reply_buffer[3]) -#define R_HEAD (reply_buffer[4]) -#define R_SECTOR (reply_buffer[5]) -#define R_SIZECODE (reply_buffer[6]) - -#define SEL_DLY (2*HZ/100) - -/* - * this struct defines the different floppy drive types. - */ -static struct { - struct floppy_drive_params params; - const char *name; /* name printed while booting */ -} default_drive_params[]= { -/* NOTE: the time values in jiffies should be in msec! - CMOS drive type - | Maximum data rate supported by drive type - | | Head load time, msec - | | | Head unload time, msec (not used) - | | | | Step rate interval, usec - | | | | | Time needed for spinup time (jiffies) - | | | | | | Timeout for spinning down (jiffies) - | | | | | | | Spindown offset (where disk stops) - | | | | | | | | Select delay - | | | | | | | | | RPS - | | | | | | | | | | Max number of tracks - | | | | | | | | | | | Interrupt timeout - | | | | | | | | | | | | Max nonintlv. sectors - | | | | | | | | | | | | | -Max Errors- flags */ -{{0, 500, 16, 16, 8000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 80, 3*HZ, 20, {3,1,2,0,2}, 0, - 0, { 7, 4, 8, 2, 1, 5, 3,10}, 3*HZ/2, 0 }, "unknown" }, - -{{1, 300, 16, 16, 8000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 40, 3*HZ, 17, {3,1,2,0,2}, 0, - 0, { 1, 0, 0, 0, 0, 0, 0, 0}, 3*HZ/2, 1 }, "360K PC" }, /*5 1/4 360 KB PC*/ - -{{2, 500, 16, 16, 6000, 4*HZ/10, 3*HZ, 14, SEL_DLY, 6, 83, 3*HZ, 17, {3,1,2,0,2}, 0, - 0, { 2, 6, 4, 0, 0, 0, 0, 0}, 3*HZ/2, 2 }, "1.2M" }, /*5 1/4 HD AT*/ - -{{3, 250, 16, 16, 3000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0, - 0, { 4, 6, 0, 0, 0, 0, 0, 0}, 3*HZ/2, 4 }, "720k" }, /*3 1/2 DD*/ - -{{4, 500, 16, 16, 4000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0, - 0, { 7,10, 2, 4, 6, 0, 0, 0}, 3*HZ/2, 7 }, "1.44M" }, /*3 1/2 HD*/ - -{{5, 1000, 15, 8, 3000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 40, {3,1,2,0,2}, 0, - 0, { 7, 8, 4,25,28,22,31,21}, 3*HZ/2, 8 }, "2.88M AMI BIOS" }, /*3 1/2 ED*/ - -{{6, 1000, 15, 8, 3000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 40, {3,1,2,0,2}, 0, - 0, { 7, 8, 4,25,28,22,31,21}, 3*HZ/2, 8 }, "2.88M" } /*3 1/2 ED*/ -/* | --autodetected formats--- | | | - * read_track | | Name printed when booting - * | Native format - * Frequency of disk change checks */ -}; - -static struct floppy_drive_params drive_params[N_DRIVE]; -static struct floppy_drive_struct drive_state[N_DRIVE]; -static struct floppy_write_errors write_errors[N_DRIVE]; -static struct timer_list motor_off_timer[N_DRIVE]; -static struct gendisk *disks[N_DRIVE]; -static struct block_device *opened_bdev[N_DRIVE]; -static DECLARE_MUTEX(open_lock); -static struct floppy_raw_cmd *raw_cmd, default_raw_cmd; - -/* - * This struct defines the different floppy types. - * - * Bit 0 of 'stretch' tells if the tracks need to be doubled for some - * types (e.g. 360kB diskette in 1.2MB drive, etc.). Bit 1 of 'stretch' - * tells if the disk is in Commodore 1581 format, which means side 0 sectors - * are located on side 1 of the disk but with a side 0 ID, and vice-versa. - * This is the same as the Sharp MZ-80 5.25" CP/M disk format, except that the - * 1581's logical side 0 is on physical side 1, whereas the Sharp's logical - * side 0 is on physical side 0 (but with the misnamed sector IDs). - * 'stretch' should probably be renamed to something more general, like - * 'options'. Other parameters should be self-explanatory (see also - * setfdprm(8)). - */ -/* - Size - | Sectors per track - | | Head - | | | Tracks - | | | | Stretch - | | | | | Gap 1 size - | | | | | | Data rate, | 0x40 for perp - | | | | | | | Spec1 (stepping rate, head unload - | | | | | | | | /fmt gap (gap2) */ -static struct floppy_struct floppy_type[32] = { - { 0, 0,0, 0,0,0x00,0x00,0x00,0x00,NULL }, /* 0 no testing */ -#if 0 - { 720, 9,2,40,0,0x2A,0x02,0xDF,0x50,"d360" }, /* 1 360KB PC */ -#else - { 2464,16,2,77,0,0x35,0x48,0xDF,0x74,"d360" }, /* 1 1.25MB 98 */ -#endif - { 2400,15,2,80,0,0x1B,0x00,0xDF,0x54,"h1200" }, /* 2 1.2MB AT */ - { 720, 9,1,80,0,0x2A,0x02,0xDF,0x50,"D360" }, /* 3 360KB SS 3.5" */ - { 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,"D720" }, /* 4 720KB 3.5" */ - { 720, 9,2,40,1,0x23,0x01,0xDF,0x50,"h360" }, /* 5 360KB AT */ - { 1440, 9,2,80,0,0x23,0x01,0xDF,0x50,"h720" }, /* 6 720KB AT */ - { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,"H1440" }, /* 7 1.44MB 3.5" */ - { 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,"E2880" }, /* 8 2.88MB 3.5" */ - { 6240,39,2,80,0,0x1B,0x43,0xAF,0x28,"E3120" }, /* 9 3.12MB 3.5" */ - - { 2880,18,2,80,0,0x25,0x00,0xDF,0x02,"h1440" }, /* 10 1.44MB 5.25" */ - { 3360,21,2,80,0,0x1C,0x00,0xCF,0x0C,"H1680" }, /* 11 1.68MB 3.5" */ - { 820,10,2,41,1,0x25,0x01,0xDF,0x2E,"h410" }, /* 12 410KB 5.25" */ - { 1640,10,2,82,0,0x25,0x02,0xDF,0x2E,"H820" }, /* 13 820KB 3.5" */ - { 2952,18,2,82,0,0x25,0x00,0xDF,0x02,"h1476" }, /* 14 1.48MB 5.25" */ - { 3444,21,2,82,0,0x25,0x00,0xDF,0x0C,"H1722" }, /* 15 1.72MB 3.5" */ - { 840,10,2,42,1,0x25,0x01,0xDF,0x2E,"h420" }, /* 16 420KB 5.25" */ - { 1660,10,2,83,0,0x25,0x02,0xDF,0x2E,"H830" }, /* 17 830KB 3.5" */ - { 2988,18,2,83,0,0x25,0x00,0xDF,0x02,"h1494" }, /* 18 1.49MB 5.25" */ - { 3486,21,2,83,0,0x25,0x00,0xDF,0x0C,"H1743" }, /* 19 1.74 MB 3.5" */ - - { 1760,11,2,80,0,0x1C,0x09,0xCF,0x00,"h880" }, /* 20 880KB 5.25" */ - { 2080,13,2,80,0,0x1C,0x01,0xCF,0x00,"D1040" }, /* 21 1.04MB 3.5" */ - { 2240,14,2,80,0,0x1C,0x19,0xCF,0x00,"D1120" }, /* 22 1.12MB 3.5" */ - { 3200,20,2,80,0,0x1C,0x20,0xCF,0x2C,"h1600" }, /* 23 1.6MB 5.25" */ - { 3520,22,2,80,0,0x1C,0x08,0xCF,0x2e,"H1760" }, /* 24 1.76MB 3.5" */ - { 3840,24,2,80,0,0x1C,0x20,0xCF,0x00,"H1920" }, /* 25 1.92MB 3.5" */ - { 6400,40,2,80,0,0x25,0x5B,0xCF,0x00,"E3200" }, /* 26 3.20MB 3.5" */ - { 7040,44,2,80,0,0x25,0x5B,0xCF,0x00,"E3520" }, /* 27 3.52MB 3.5" */ - { 7680,48,2,80,0,0x25,0x63,0xCF,0x00,"E3840" }, /* 28 3.84MB 3.5" */ - - { 3680,23,2,80,0,0x1C,0x10,0xCF,0x00,"H1840" }, /* 29 1.84MB 3.5" */ - { 1600,10,2,80,0,0x25,0x02,0xDF,0x2E,"D800" }, /* 30 800KB 3.5" */ - { 3200,20,2,80,0,0x1C,0x00,0xCF,0x2C,"H1600" }, /* 31 1.6MB 3.5" */ -}; - -#define NUMBER(x) (sizeof(x) / sizeof(*(x))) -#define SECTSIZE (_FD_SECTSIZE(*floppy)) - -/* Auto-detection: Disk type used until the next media change occurs. */ -static struct floppy_struct *current_type[N_DRIVE]; - -/* - * User-provided type information. current_type points to - * the respective entry of this array. - */ -static struct floppy_struct user_params[N_DRIVE]; - -static sector_t floppy_sizes[256]; - -/* - * The driver is trying to determine the correct media format - * while probing is set. rw_interrupt() clears it after a - * successful access. - */ -static int probing; - -/* Synchronization of FDC access. */ -#define FD_COMMAND_NONE -1 -#define FD_COMMAND_ERROR 2 -#define FD_COMMAND_OKAY 3 - -static volatile int command_status = FD_COMMAND_NONE; -static unsigned long fdc_busy; -static DECLARE_WAIT_QUEUE_HEAD(fdc_wait); -static DECLARE_WAIT_QUEUE_HEAD(command_done); - -#define NO_SIGNAL (!interruptible || !signal_pending(current)) -#define CALL(x) if ((x) == -EINTR) return -EINTR -#define ECALL(x) if ((ret = (x))) return ret; -#define _WAIT(x,i) CALL(ret=wait_til_done((x),i)) -#define WAIT(x) _WAIT((x),interruptible) -#define IWAIT(x) _WAIT((x),1) - -/* Errors during formatting are counted here. */ -static int format_errors; - -/* Format request descriptor. */ -static struct format_descr format_req; - -/* - * Rate is 0 for 500kb/s, 1 for 300kbps, 2 for 250kbps - * Spec1 is 0xSH, where S is stepping rate (F=1ms, E=2ms, D=3ms etc), - * H is head unload time (1=16ms, 2=32ms, etc) - */ - -/* - * Track buffer - * Because these are written to by the DMA controller, they must - * not contain a 64k byte boundary crossing, or data will be - * corrupted/lost. - */ -static char *floppy_track_buffer; -static int max_buffer_sectors; - -static int *errors; -typedef void (*done_f)(int); -static struct cont_t { - void (*interrupt)(void); /* this is called after the interrupt of the - * main command */ - void (*redo)(void); /* this is called to retry the operation */ - void (*error)(void); /* this is called to tally an error */ - done_f done; /* this is called to say if the operation has - * succeeded/failed */ -} *cont; - -static void floppy_ready(void); -static void floppy_start(void); -static void process_fd_request(void); -static void recalibrate_floppy(void); -static void floppy_shutdown(unsigned long); - -static int floppy_grab_irq_and_dma(void); -static void floppy_release_irq_and_dma(void); - -/* - * The "reset" variable should be tested whenever an interrupt is scheduled, - * after the commands have been sent. This is to ensure that the driver doesn't - * get wedged when the interrupt doesn't come because of a failed command. - * reset doesn't need to be tested before sending commands, because - * output_byte is automatically disabled when reset is set. - */ -#define CHECK_RESET { if (FDCS->reset){ reset_fdc(); return; } } -static void reset_fdc(void); - -/* - * These are global variables, as that's the easiest way to give - * information to interrupts. They are the data used for the current - * request. - */ -#define NO_TRACK -1 -#define NEED_1_RECAL -2 -#define NEED_2_RECAL -3 - -static int usage_count; - -/* buffer related variables */ -static int buffer_track = -1; -static int buffer_drive = -1; -static int buffer_min = -1; -static int buffer_max = -1; - -/* fdc related variables, should end up in a struct */ -static struct floppy_fdc_state fdc_state[N_FDC]; -static int fdc; /* current fdc */ - -static struct floppy_struct *_floppy = floppy_type; -static unsigned char current_drive; -static long current_count_sectors; -static unsigned char fsector_t; /* sector in track */ -static unsigned char in_sector_offset; /* offset within physical sector, - * expressed in units of 512 bytes */ - -#ifndef fd_eject -static inline int fd_eject(int drive) -{ - return -EINVAL; -} -#endif - -#ifdef DEBUGT -static long unsigned debugtimer; -#endif - -/* - * Debugging - * ========= - */ -static inline void set_debugt(void) -{ -#ifdef DEBUGT - debugtimer = jiffies; -#endif -} - -static inline void debugt(const char *message) -{ -#ifdef DEBUGT - if (DP->flags & DEBUGT) - printk("%s dtime=%lu\n", message, jiffies-debugtimer); -#endif -} - -typedef void (*timeout_fn)(unsigned long); -static struct timer_list fd_timeout = TIMER_INITIALIZER(floppy_shutdown, 0, 0); - -static const char *timeout_message; - -#ifdef FLOPPY_SANITY_CHECK -static void is_alive(const char *message) -{ - /* this routine checks whether the floppy driver is "alive" */ - if (fdc_busy && command_status < 2 && !timer_pending(&fd_timeout)){ - DPRINT("timeout handler died: %s\n",message); - } -} -#endif - -static void (*do_floppy)(void) = NULL; - -#ifdef FLOPPY_SANITY_CHECK - -#define OLOGSIZE 20 - -static void (*lasthandler)(void); -static unsigned long interruptjiffies; -static unsigned long resultjiffies; -static int resultsize; -static unsigned long lastredo; - -static struct output_log { - unsigned char data; - unsigned char status; - unsigned long jiffies; -} output_log[OLOGSIZE]; - -static int output_log_pos; -#endif - -#define current_reqD -1 -#define MAXTIMEOUT -2 - -static void reschedule_timeout(int drive, const char *message, int marg) -{ - unsigned long delay; - - if (drive == current_reqD) - drive = current_drive; - if (drive < 0 || drive > N_DRIVE) { - delay = 20UL*HZ; - drive=0; - } else - delay = UDP->timeout; - mod_timer(&fd_timeout, delay + jiffies); - if (UDP->flags & FD_DEBUG){ - DPRINT("reschedule timeout "); - printk(message, marg); - printk("\n"); - } - timeout_message = message; -} - -static int maximum(int a, int b) -{ - if (a > b) - return a; - else - return b; -} -#define INFBOUND(a,b) (a)=maximum((a),(b)); - -static int minimum(int a, int b) -{ - if (a < b) - return a; - else - return b; -} -#define SUPBOUND(a,b) (a)=minimum((a),(b)); - - -/* - * Bottom half floppy driver. - * ========================== - * - * This part of the file contains the code talking directly to the hardware, - * and also the main service loop (seek-configure-spinup-command) - */ - -/* - * disk change. - * This routine is responsible for maintaining the FD_DISK_CHANGE flag, - * and the last_checked date. - * - * last_checked is the date of the last check which showed 'no disk change' - * FD_DISK_CHANGE is set under two conditions: - * 1. The floppy has been changed after some i/o to that floppy already - * took place. - * 2. No floppy disk is in the drive. This is done in order to ensure that - * requests are quickly flushed in case there is no disk in the drive. It - * follows that FD_DISK_CHANGE can only be cleared if there is a disk in - * the drive. - * - * For 1., maxblock is observed. Maxblock is 0 if no i/o has taken place yet. - * For 2., FD_DISK_NEWCHANGE is watched. FD_DISK_NEWCHANGE is cleared on - * each seek. If a disk is present, the disk change line should also be - * cleared on each seek. Thus, if FD_DISK_NEWCHANGE is clear, but the disk - * change line is set, this means either that no disk is in the drive, or - * that it has been removed since the last seek. - * - * This means that we really have a third possibility too: - * The floppy has been changed after the last seek. - */ - -static int disk_change(int drive) -{ - return UTESTF(FD_DISK_CHANGED); -} - -static int set_mode(char mask, char data) -{ - register unsigned char newdor, olddor; - - olddor = FDCS->dor; - newdor = (olddor & mask) | data; - if (newdor != olddor) { - FDCS->dor = newdor; - fd_outb(newdor, FD_MODE); - } - - if (newdor & FLOPPY98_MOTOR_MASK) - floppy_grab_irq_and_dma(); - - if (olddor & FLOPPY98_MOTOR_MASK) - floppy_release_irq_and_dma(); - - return olddor; -} - -static void twaddle(void) -{ - if (DP->select_delay) - return; - - fd_outb(FDCS->dor & 0xf7, FD_MODE); - fd_outb(FDCS->dor, FD_MODE); - DRS->select_date = jiffies; -} - -/* reset all driver information about the current fdc. This is needed after - * a reset, and after a raw command. */ -static void reset_fdc_info(int mode) -{ - int drive; - - FDCS->spec1 = FDCS->spec2 = -1; - FDCS->need_configure = 1; - FDCS->perp_mode = 1; - FDCS->rawcmd = 0; - for (drive = 0; drive < N_DRIVE; drive++) - if (FDC(drive) == fdc && - (mode || UDRS->track != NEED_1_RECAL)) - UDRS->track = NEED_2_RECAL; -} - -/* selects the fdc and drive, and enables the fdc's input/dma. */ -static void set_fdc(int drive) -{ - fdc = 0; - current_drive = drive; - set_mode(~0, 0x10); - if (FDCS->rawcmd == 2) - reset_fdc_info(1); - - if (fd_inb(FD98_STATUS) != STATUS_READY) - FDCS->reset = 1; -} - -/* locks the driver */ -static int _lock_fdc(int drive, int interruptible, int line) -{ - if (!usage_count){ - printk(KERN_ERR "Trying to lock fdc while usage count=0 at line %d\n", line); - return -1; - } - if(floppy_grab_irq_and_dma()==-1) - return -EBUSY; - - if (test_and_set_bit(0, &fdc_busy)) { - DECLARE_WAITQUEUE(wait, current); - add_wait_queue(&fdc_wait, &wait); - - for (;;) { - set_current_state(TASK_INTERRUPTIBLE); - - if (!test_and_set_bit(0, &fdc_busy)) - break; - - schedule(); - - if (!NO_SIGNAL) { - remove_wait_queue(&fdc_wait, &wait); - return -EINTR; - } - } - - set_current_state(TASK_RUNNING); - remove_wait_queue(&fdc_wait, &wait); - } - command_status = FD_COMMAND_NONE; - - reschedule_timeout(drive, "lock fdc", 0); - set_fdc(drive); - return 0; -} - -#define lock_fdc(drive,interruptible) _lock_fdc(drive,interruptible, __LINE__) - -#define LOCK_FDC(drive,interruptible) \ -if (lock_fdc(drive,interruptible)) return -EINTR; - - -/* unlocks the driver */ -static inline void unlock_fdc(void) -{ - raw_cmd = 0; - if (!fdc_busy) - DPRINT("FDC access conflict!\n"); - - if (do_floppy) - DPRINT("device interrupt still active at FDC release: %p!\n", - do_floppy); - command_status = FD_COMMAND_NONE; - del_timer(&fd_timeout); - cont = NULL; - clear_bit(0, &fdc_busy); - floppy_release_irq_and_dma(); - wake_up(&fdc_wait); -} - -#ifndef CONFIG_PC9800_MOTOR_OFF /* tomita */ - -/* switches the motor off after a given timeout */ -static void motor_off_callback(unsigned long nr) -{ - printk(KERN_DEBUG "fdc%lu: turn off motor\n", nr); -} - -/* schedules motor off */ -static void floppy_off(unsigned int drive) -{ -} - -#else /* CONFIG_PC9800_MOTOR_OFF */ - -/* switches the motor off after a given timeout */ -static void motor_off_callback(unsigned long fdc) -{ - printk(KERN_DEBUG "fdc%u: turn off motor\n", (unsigned int) fdc); - - fd_outb(0, FD_MODE); /* MTON = 0 */ -} - -static struct timer_list motor_off_timer[N_FDC] = { - { data: 0, function: motor_off_callback }, -#if N_FDC > 1 - { data: 1, function: motor_off_callback }, -#endif -#if N_FDC > 2 -# error "N_FDC > 2; please fix initializer for motor_off_timer[]" -#endif -}; - -/* schedules motor off */ -static void floppy_off(unsigned int drive) -{ - unsigned long volatile delta; - register int fdc = FDC(drive); - - if (!(FDCS->dor & (0x10 << UNIT(drive)))) - return; - - del_timer(motor_off_timer + fdc); - -#if 0 - /* make spindle stop in a position which minimizes spinup time - * next time */ - if (UDP->rps){ - delta = jiffies - UDRS->first_read_date + HZ - - UDP->spindown_offset; - delta = ((delta * UDP->rps) % HZ) / UDP->rps; - motor_off_timer[drive].expires = jiffies + UDP->spindown - delta; - } -#else - if (UDP->rps) - motor_off_timer[drive].expires = jiffies + UDP->spindown; -#endif - - add_timer(motor_off_timer + fdc); -} - -#endif /* CONFIG_PC9800_MOTOR_OFF */ - -/* - * cycle through all N_DRIVE floppy drives, for disk change testing. - * stopping at current drive. This is done before any long operation, to - * be sure to have up to date disk change information. - */ -static void scandrives(void) -{ - int i, drive, saved_drive; - - if (DP->select_delay) - return; - - saved_drive = current_drive; - for (i=0; i < N_DRIVE; i++){ - drive = (saved_drive + i + 1) % N_DRIVE; - if (UDRS->fd_ref == 0 || UDP->select_delay != 0) - continue; /* skip closed drives */ - set_fdc(drive); - } - set_fdc(saved_drive); -} - -static void empty(void) -{ -} - -static DECLARE_WORK(floppy_work, NULL, NULL); - -static void schedule_bh(void (*handler) (void)) -{ - PREPARE_WORK(&floppy_work, (void (*)(void *))handler, NULL); - schedule_work(&floppy_work); -} - -static struct timer_list fd_timer = TIMER_INITIALIZER(NULL, 0, 0); - -static void cancel_activity(void) -{ - do_floppy = NULL; - PREPARE_WORK(&floppy_work, (void*)(void*)empty, NULL); - del_timer(&fd_timer); -} - -/* this function makes sure that the disk stays in the drive during the - * transfer */ -static void fd_watchdog(void) -{ -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("calling disk change from watchdog\n"); - } -#endif - - if (disk_change(current_drive)){ - DPRINT("disk removed during i/o\n"); - cancel_activity(); - cont->done(0); - reset_fdc(); - } else { - del_timer(&fd_timer); - fd_timer.function = (timeout_fn) fd_watchdog; - fd_timer.expires = jiffies + HZ / 10; - add_timer(&fd_timer); - } -} - -static void main_command_interrupt(void) -{ - del_timer(&fd_timer); - cont->interrupt(); -} - -/* waits for a delay (spinup or select) to pass */ -static int fd_wait_for_completion(unsigned long delay, timeout_fn function) -{ - if (FDCS->reset){ - reset_fdc(); /* do the reset during sleep to win time - * if we don't need to sleep, it's a good - * occasion anyways */ - return 1; - } - - if ((signed) (jiffies - delay) < 0){ - del_timer(&fd_timer); - fd_timer.function = function; - fd_timer.expires = delay; - add_timer(&fd_timer); - return 1; - } - return 0; -} - -static spinlock_t floppy_hlt_lock = SPIN_LOCK_UNLOCKED; -static int hlt_disabled; -static void floppy_disable_hlt(void) -{ - unsigned long flags; - - spin_lock_irqsave(&floppy_hlt_lock, flags); - if (!hlt_disabled) { - hlt_disabled=1; -#ifdef HAVE_DISABLE_HLT - disable_hlt(); -#endif - } - spin_unlock_irqrestore(&floppy_hlt_lock, flags); -} - -static void floppy_enable_hlt(void) -{ - unsigned long flags; - - spin_lock_irqsave(&floppy_hlt_lock, flags); - if (hlt_disabled){ - hlt_disabled=0; -#ifdef HAVE_DISABLE_HLT - enable_hlt(); -#endif - } - spin_unlock_irqrestore(&floppy_hlt_lock, flags); -} - - -static void setup_DMA(void) -{ - unsigned long f; - -#ifdef FLOPPY_SANITY_CHECK - if (raw_cmd->length == 0){ - int i; - - printk("zero dma transfer size:"); - for (i=0; i < raw_cmd->cmd_count; i++) - printk("%x,", raw_cmd->cmd[i]); - printk("\n"); - cont->done(0); - FDCS->reset = 1; - return; - } - if (((unsigned long) raw_cmd->kernel_data) % 512){ - printk("non aligned address: %p\n", raw_cmd->kernel_data); - cont->done(0); - FDCS->reset=1; - return; - } -#endif - f=claim_dma_lock(); - fd_disable_dma(); -#ifdef fd_dma_setup - if (fd_dma_setup(raw_cmd->kernel_data, raw_cmd->length, - (raw_cmd->flags & FD_RAW_READ)? - DMA_MODE_READ : DMA_MODE_WRITE, - FDCS->address) < 0) { - release_dma_lock(f); - cont->done(0); - FDCS->reset=1; - return; - } - release_dma_lock(f); -#else - fd_clear_dma_ff(); - fd_cacheflush(raw_cmd->kernel_data, raw_cmd->length); - fd_set_dma_mode((raw_cmd->flags & FD_RAW_READ)? - DMA_MODE_READ : DMA_MODE_WRITE); - fd_set_dma_addr(raw_cmd->kernel_data); - fd_set_dma_count(raw_cmd->length); - virtual_dma_port = FDCS->address; - fd_enable_dma(); - release_dma_lock(f); -#endif - floppy_disable_hlt(); -} - -static void show_floppy(void); - -/* waits until the fdc becomes ready */ - -#ifdef PC9800_DEBUG_FLOPPY -#define READY_DELAY 10000000 -#else -#define READY_DELAY 100000 -#endif - -static int wait_til_ready(void) -{ - int counter, status; - if (FDCS->reset) - return -1; - for (counter = 0; counter < READY_DELAY; counter++) { - status = fd_inb(FD98_STATUS); - if (status & STATUS_READY) - return status; - } - if (!initialising) { - DPRINT("Getstatus times out (%x) on fdc %d\n", - status, fdc); - show_floppy(); - } - FDCS->reset = 1; - return -1; -} - -/* sends a command byte to the fdc */ -static int output_byte(char byte) -{ - int status; - - if ((status = wait_til_ready()) < 0) - return -1; - if ((status & (STATUS_READY|STATUS_DIR|STATUS_DMA)) == STATUS_READY){ - fd_outb(byte,FD98_DATA); -#ifdef FLOPPY_SANITY_CHECK - output_log[output_log_pos].data = byte; - output_log[output_log_pos].status = status; - output_log[output_log_pos].jiffies = jiffies; - output_log_pos = (output_log_pos + 1) % OLOGSIZE; -#endif - return 0; - } - FDCS->reset = 1; - if (!initialising) { - DPRINT("Unable to send byte %x to FDC. Fdc=%x Status=%x\n", - byte, fdc, status); - show_floppy(); - } - return -1; -} -#define LAST_OUT(x) if (output_byte(x)<0){ reset_fdc();return;} - -/* gets the response from the fdc */ -static int result(void) -{ - int i, status=0; - - for(i=0; i < MAX_REPLIES; i++) { - if ((status = wait_til_ready()) < 0) - break; - status &= STATUS_DIR|STATUS_READY|STATUS_BUSY|STATUS_DMA; - if ((status & ~STATUS_BUSY) == STATUS_READY){ -#ifdef FLOPPY_SANITY_CHECK - resultjiffies = jiffies; - resultsize = i; -#endif - return i; - } - if (status == (STATUS_DIR|STATUS_READY|STATUS_BUSY)) - reply_buffer[i] = fd_inb(FD98_DATA); - else - break; - } - if (!initialising) { - DPRINT("get result error. Fdc=%d Last status=%x Read bytes=%d\n", - fdc, status, i); - show_floppy(); - } - FDCS->reset = 1; - return -1; -} - -static int fifo_depth = 0xa; -static int no_fifo; - -#define NOMINAL_DTR 500 - -/* Issue a "SPECIFY" command to set the step rate time, head unload time, - * head load time, and DMA disable flag to values needed by floppy. - * - * The value "dtr" is the data transfer rate in Kbps. It is needed - * to account for the data rate-based scaling done by the 82072 and 82077 - * FDC types. This parameter is ignored for other types of FDCs (i.e. - * 8272a). - * - * Note that changing the data transfer rate has a (probably deleterious) - * effect on the parameters subject to scaling for 82072/82077 FDCs, so - * fdc_specify is called again after each data transfer rate - * change. - * - * srt: 1000 to 16000 in microseconds - * hut: 16 to 240 milliseconds - * hlt: 2 to 254 milliseconds - * - * These values are rounded up to the next highest available delay time. - */ -static void fdc_specify(void) -{ - output_byte(FD_SPECIFY); - output_byte(FDCS->spec1 = 0xdf); - output_byte(FDCS->spec2 = 0x24); -} - -static void tell_sector(void) -{ - printk(": track %d, head %d, sector %d, size %d", - R_TRACK, R_HEAD, R_SECTOR, R_SIZECODE); -} /* tell_sector */ - -static int auto_detect_mode_pc9800(void) -{ -#ifdef PC9800_DEBUG_FLOPPY - printk("auto_detect_mode_pc9800: retry_auto_detect=%d\n", - retry_auto_detect); -#endif - if (retry_auto_detect > 4) { - retry_auto_detect = 0; - return 1; - } - - switch ((int)(_floppy - floppy_type)) { - case 2: - _floppy = floppy_type + 4; - break; - - case 4: - case 6: - _floppy = floppy_type + 7; - break; - - case 7: - case 10: - _floppy = floppy_type + 2; - break; - - default: - _floppy = floppy_type + 7; - } - - retry_auto_detect++; - return 0; -} - -static void access_mode_change_pc9800(void); - -/* - * OK, this error interpreting routine is called after a - * DMA read/write has succeeded - * or failed, so we check the results, and copy any buffers. - * hhb: Added better error reporting. - * ak: Made this into a separate routine. - */ -static int interpret_errors(void) -{ - char bad; - - if (inr!=7) { - DPRINT("-- FDC reply error"); - FDCS->reset = 1; - return 1; - } - - /* check IC to find cause of interrupt */ - switch (ST0 & ST0_INTR) { - case 0x40: /* error occurred during command execution */ - if (ST1 & ST1_EOC) - return 0; /* occurs with pseudo-DMA */ - bad = 1; - if (ST1 & ST1_WP) { - DPRINT("Drive is write protected\n"); - CLEARF(FD_DISK_WRITABLE); - cont->done(0); - bad = 2; - } else if (ST1 & ST1_ND) { - SETF(FD_NEED_TWADDLE); - } else if (ST1 & ST1_OR) { - if (DP->flags & FTD_MSG) - DPRINT("Over/Underrun - retrying\n"); - bad = 0; - }else if (*errors >= DP->max_errors.reporting){ - if (ST0 & ST0_ECE) { - printk("Recalibrate failed!"); - } else if (ST2 & ST2_CRC) { - printk("data CRC error"); - tell_sector(); - } else if (ST1 & ST1_CRC) { - printk("CRC error"); - tell_sector(); - } else if ((ST1 & (ST1_MAM|ST1_ND)) || (ST2 & ST2_MAM)) { - if (auto_detect_mode) { - bad = (char)auto_detect_mode_pc9800(); - access_mode_change_pc9800(); - } - - if (bad) { - printk("floppy error: MA: _floppy - floppy_type=%d\n", (int)(_floppy - floppy_type)); - printk("bad=%d\n", (int)bad); - if (!probing) { - printk("sector not found"); - tell_sector(); - } else - printk("probe failed..."); - } - } else if (ST2 & ST2_WC) { /* seek error */ - printk("wrong cylinder"); - } else if (ST2 & ST2_BC) { /* cylinder marked as bad */ - printk("bad cylinder"); - } else { - printk("unknown error. ST[0..2] are: 0x%x 0x%x 0x%x", ST0, ST1, ST2); - tell_sector(); - } - printk("\n"); - - } - if (ST2 & ST2_WC || ST2 & ST2_BC) - /* wrong cylinder => recal */ - DRS->track = NEED_2_RECAL; - return bad; - case 0x80: /* invalid command given */ - DPRINT("Invalid FDC command given!\n"); - cont->done(0); - return 2; - case 0xc0: - SETF(FD_DISK_CHANGED); - SETF(FD_DISK_WRITABLE); - DPRINT("Abnormal termination caused by polling\n"); - cont->error(); - return 2; - default: /* (0) Normal command termination */ - auto_detect_mode = 0; - return 0; - } -} - -/* - * This routine is called when everything should be correctly set up - * for the transfer (i.e. floppy motor is on, the correct floppy is - * selected, and the head is sitting on the right track). - */ -static void setup_rw_floppy(void) -{ - int i,r, flags,dflags; - unsigned long ready_date; - timeout_fn function; - - access_mode_change_pc9800(); - flags = raw_cmd->flags; - if (flags & (FD_RAW_READ | FD_RAW_WRITE)) - flags |= FD_RAW_INTR; - - if ((flags & FD_RAW_SPIN) && !(flags & FD_RAW_NO_MOTOR)){ - ready_date = DRS->spinup_date + DP->spinup; - /* If spinup will take a long time, rerun scandrives - * again just before spinup completion. Beware that - * after scandrives, we must again wait for selection. - */ - if ((signed) (ready_date - jiffies) > DP->select_delay){ - ready_date -= DP->select_delay; - function = (timeout_fn) floppy_start; - } else - function = (timeout_fn) setup_rw_floppy; - - /* wait until the floppy is spinning fast enough */ - if (fd_wait_for_completion(ready_date,function)) - return; - } - dflags = DRS->flags; - - if ((flags & FD_RAW_READ) || (flags & FD_RAW_WRITE)) - setup_DMA(); - - if (flags & FD_RAW_INTR) - do_floppy = main_command_interrupt; - - r=0; - for (i=0; i< raw_cmd->cmd_count; i++) - r|=output_byte(raw_cmd->cmd[i]); - -#ifdef DEBUGT - debugt("rw_command: "); -#endif - if (r){ - cont->error(); - reset_fdc(); - return; - } - - if (!(flags & FD_RAW_INTR)){ - inr = result(); - cont->interrupt(); - } else if (flags & FD_RAW_NEED_DISK) - fd_watchdog(); -} - -static int blind_seek; - -/* - * This is the routine called after every seek (or recalibrate) interrupt - * from the floppy controller. - */ -static void seek_interrupt(void) -{ -#ifdef DEBUGT - debugt("seek interrupt:"); -#endif - if (inr != 2 || (ST0 & 0xF8) != 0x20) { - DRS->track = NEED_2_RECAL; - cont->error(); - cont->redo(); - return; - } - if (DRS->track >= 0 && DRS->track != ST1 && !blind_seek){ -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("clearing NEWCHANGE flag because of effective seek\n"); - DPRINT("jiffies=%lu\n", jiffies); - } -#endif - CLEARF(FD_DISK_NEWCHANGE); /* effective seek */ - CLEARF(FD_DISK_CHANGED); /* effective seek */ - DRS->select_date = jiffies; - } - DRS->track = ST1; - floppy_ready(); -} - -static void check_wp(void) -{ - if (TESTF(FD_VERIFY)) { - /* check write protection */ - output_byte(FD_GETSTATUS); - output_byte(UNIT(current_drive)); - if (result() != 1){ - FDCS->reset = 1; - return; - } - CLEARF(FD_VERIFY); - CLEARF(FD_NEED_TWADDLE); -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("checking whether disk is write protected\n"); - DPRINT("wp=%x\n",ST3 & 0x40); - } -#endif - if (!(ST3 & 0x40)) - SETF(FD_DISK_WRITABLE); - else - CLEARF(FD_DISK_WRITABLE); - } -} - -static void seek_floppy(void) -{ - int track; - - blind_seek=0; - -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("calling disk change from seek\n"); - } -#endif - - if (!TESTF(FD_DISK_NEWCHANGE) && - disk_change(current_drive) && - (raw_cmd->flags & FD_RAW_NEED_DISK)){ - /* the media changed flag should be cleared after the seek. - * If it isn't, this means that there is really no disk in - * the drive. - */ - SETF(FD_DISK_CHANGED); - cont->done(0); - cont->redo(); - return; - } - if (DRS->track <= NEED_1_RECAL){ - recalibrate_floppy(); - return; - } else if (TESTF(FD_DISK_NEWCHANGE) && - (raw_cmd->flags & FD_RAW_NEED_DISK) && - (DRS->track <= NO_TRACK || DRS->track == raw_cmd->track)) { - /* we seek to clear the media-changed condition. Does anybody - * know a more elegant way, which works on all drives? */ - if (raw_cmd->track) - track = raw_cmd->track - 1; - else { - if (DP->flags & FD_SILENT_DCL_CLEAR){ - blind_seek = 1; - raw_cmd->flags |= FD_RAW_NEED_SEEK; - } - track = 1; - } - } else { - check_wp(); - if (raw_cmd->track != DRS->track && - (raw_cmd->flags & FD_RAW_NEED_SEEK)) - track = raw_cmd->track; - else { - setup_rw_floppy(); - return; - } - } - - do_floppy = seek_interrupt; - output_byte(FD_SEEK); - output_byte(UNIT(current_drive)); - LAST_OUT(track); -#ifdef DEBUGT - debugt("seek command:"); -#endif -} - -static void recal_interrupt(void) -{ -#ifdef DEBUGT - debugt("recal interrupt:"); -#endif - if (inr !=2) - FDCS->reset = 1; - else if (ST0 & ST0_ECE) { - switch(DRS->track){ - case NEED_1_RECAL: -#ifdef DEBUGT - debugt("recal interrupt need 1 recal:"); -#endif - /* after a second recalibrate, we still haven't - * reached track 0. Probably no drive. Raise an - * error, as failing immediately might upset - * computers possessed by the Devil :-) */ - cont->error(); - cont->redo(); - return; - case NEED_2_RECAL: -#ifdef DEBUGT - debugt("recal interrupt need 2 recal:"); -#endif - /* If we already did a recalibrate, - * and we are not at track 0, this - * means we have moved. (The only way - * not to move at recalibration is to - * be already at track 0.) Clear the - * new change flag */ -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("clearing NEWCHANGE flag because of second recalibrate\n"); - } -#endif - - CLEARF(FD_DISK_NEWCHANGE); - DRS->select_date = jiffies; - /* fall through */ - default: -#ifdef DEBUGT - debugt("recal interrupt default:"); -#endif - /* Recalibrate moves the head by at - * most 80 steps. If after one - * recalibrate we don't have reached - * track 0, this might mean that we - * started beyond track 80. Try - * again. */ - DRS->track = NEED_1_RECAL; - break; - } - } else - DRS->track = ST1; - floppy_ready(); -} - -static void print_result(char *message, int inr) -{ - int i; - - DPRINT("%s ", message); - if (inr >= 0) - for (i=0; i= N_FDC || FDCS->address == -1){ - /* we don't even know which FDC is the culprit */ - printk("DOR0=%x\n", fdc_state[0].dor); - printk("floppy interrupt on bizarre fdc %d\n",fdc); - printk("handler=%p\n", handler); - is_alive("bizarre fdc"); - return IRQ_NONE; - } - - FDCS->reset = 0; - /* We have to clear the reset flag here, because apparently on boxes - * with level triggered interrupts (PS/2, Sparc, ...), it is needed to - * emit SENSEI's to clear the interrupt line. And FDCS->reset blocks the - * emission of the SENSEI's. - * It is OK to emit floppy commands because we are in an interrupt - * handler here, and thus we have to fear no interference of other - * activity. - */ - - do_print = !handler && print_unex && !initialising; - - inr = result(); - if (inr && do_print) - print_result("unexpected interrupt", inr); - if (inr == 0){ - do { - output_byte(FD_SENSEI); - inr = result(); - if ((ST0 & ST0_INTR) == 0xC0) { - int drive = ST0 & ST0_DS; - - /* Attention Interrupt. */ - if (ST0 & ST0_NR) { -#ifdef PC9800_DEBUG_FLOPPY - if (do_print) - printk(KERN_DEBUG - "floppy debug: floppy ejected (drive %d)\n", - drive); -#endif - USETF(FD_DISK_CHANGED); - USETF(FD_VERIFY); - } else { -#ifdef PC9800_DEBUG_FLOPPY - if (do_print) - printk(KERN_DEBUG - "floppy debug: floppy inserted (drive %d)\n", - drive); -#endif - } - } /* Attention Interrupt */ -#ifdef PC9800_DEBUG_FLOPPY - else { - printk(KERN_DEBUG - "floppy debug : unknown interrupt\n"); - } -#endif - } while ((ST0 & 0x83) != UNIT(current_drive) && inr == 2); - } - if (handler) { - schedule_bh(handler); - } else { -#if 0 - FDCS->reset = 1; -#endif - } - is_alive("normal interrupt end"); - - /* FIXME! Was it really for us? */ - return IRQ_HANDLED; -} - -static void recalibrate_floppy(void) -{ -#ifdef DEBUGT - debugt("recalibrate floppy:"); -#endif - do_floppy = recal_interrupt; - output_byte(FD_RECALIBRATE); - LAST_OUT(UNIT(current_drive)); -} - -/* - * Must do 4 FD_SENSEIs after reset because of ``drive polling''. - */ -static void reset_interrupt(void) -{ -#ifdef PC9800_DEBUG_FLOPPY - printk("floppy debug: reset interrupt\n"); -#endif -#ifdef DEBUGT - debugt("reset interrupt:"); -#endif - result(); /* get the status ready for set_fdc */ - if (FDCS->reset) { - printk("reset set in interrupt, calling %p\n", cont->error); - cont->error(); /* a reset just after a reset. BAD! */ - } - cont->redo(); -} - -/* - * reset is done by pulling bit 2 of DOR low for a while (old FDCs), - * or by setting the self clearing bit 7 of STATUS (newer FDCs) - */ -static void reset_fdc(void) -{ - unsigned long flags; - -#ifdef PC9800_DEBUG_FLOPPY - printk("floppy debug: reset_fdc\n"); -#endif - - do_floppy = reset_interrupt; - FDCS->reset = 0; - reset_fdc_info(0); - - /* Pseudo-DMA may intercept 'reset finished' interrupt. */ - /* Irrelevant for systems with true DMA (i386). */ - - flags=claim_dma_lock(); - fd_disable_dma(); - release_dma_lock(flags); - - fd_outb(FDCS->dor | 0x80, FD_MODE); - udelay(FD_RESET_DELAY); - fd_outb(FDCS->dor, FD_MODE); - udelay(FD_AFTER_RESET_DELAY); -} - -static void show_floppy(void) -{ - int i; - - printk("\n"); - printk("floppy driver state\n"); - printk("-------------------\n"); - printk("now=%lu last interrupt=%lu diff=%lu last called handler=%p\n", - jiffies, interruptjiffies, jiffies-interruptjiffies, lasthandler); - - -#ifdef FLOPPY_SANITY_CHECK - printk("timeout_message=%s\n", timeout_message); - printk("last output bytes:\n"); - for (i=0; i < OLOGSIZE; i++) - printk("%2x %2x %lu\n", - output_log[(i+output_log_pos) % OLOGSIZE].data, - output_log[(i+output_log_pos) % OLOGSIZE].status, - output_log[(i+output_log_pos) % OLOGSIZE].jiffies); - printk("last result at %lu\n", resultjiffies); - printk("last redo_fd_request at %lu\n", lastredo); - for (i=0; ireset = 1; - if (cont){ - cont->done(0); - cont->redo(); /* this will recall reset when needed */ - } else { - printk("no cont in shutdown!\n"); - process_fd_request(); - } - is_alive("floppy shutdown"); -} -/*typedef void (*timeout_fn)(unsigned long);*/ - -static void access_mode_change_pc9800(void) -{ - static int access_mode, mode_change_now, old_mode, new_set = 1; -#ifdef PC9800_DEBUG_FLOPPY2 - printk("enter access_mode_change\n"); -#endif - access_mode = mode_change_now = 0; - if (DP->cmos==4) { - switch ((int)(_floppy - &floppy_type[0])) { - case 1: - case 2: - new_set = 1; - access_mode = 2; - break; - - case 4: - case 6: - new_set = 1; - access_mode = 3; - break; - - case 7: - case 10: - new_set = 1; - access_mode = 1; - break; - - default: - access_mode = 1; - break; - } - - old_mode = fd_inb(FD_MODE_CHANGE) & 3; - - switch (access_mode) { - case 1: - if ((old_mode & 2) == 0) { - fd_outb(old_mode | 2, FD_MODE_CHANGE); - mode_change_now = 1; - } else { - fd_outb(current_drive << 5, FD_EMODE_CHANGE); - if (fd_inb(FD_EMODE_CHANGE) == 0xff) - return; - } - - fd_outb((current_drive << 5) | 0x11, FD_EMODE_CHANGE); - mode_change_now = 1; - break; - - case 2: - if ((old_mode & 2) == 0) { - fd_outb(old_mode | 2, FD_MODE_CHANGE); - mode_change_now = 1; - } else { - fd_outb(current_drive << 5, FD_EMODE_CHANGE); - if ((fd_inb(FD_EMODE_CHANGE) & 1) == 0) - return; - fd_outb((current_drive << 5) | 0x10, FD_EMODE_CHANGE); - mode_change_now = 1; - } - - break; - - case 3: - if ((old_mode & 2) == 0) - return; - fd_outb(current_drive << 5, FD_EMODE_CHANGE); - if (fd_inb(FD_EMODE_CHANGE) & 1) - fd_outb((current_drive << 5) | 0x10, FD_EMODE_CHANGE); - fd_outb(old_mode & 0xfd, FD_MODE_CHANGE); - mode_change_now = 1; - break; - - default: - break; - } - } else { - switch ((int)(_floppy - &floppy_type[0])) { - case 1: - case 2: - new_set = 1; - access_mode = 2; - break; - - case 4: - case 6: - new_set = 1; - access_mode = 3; - break; - - default: - switch (DP->cmos) { - case 2: - access_mode = 2; - break; - - case 3: - access_mode = 3; - break; - - default: - break; - } - - break; - } - - old_mode = fd_inb(FD_MODE_CHANGE) & 3; - - switch (access_mode) { - case 2: - if ((old_mode & 2) == 0) { - fd_outb(old_mode | 2, FD_MODE_CHANGE); - mode_change_now = 1; - } - - break; - - case 3: - if (old_mode & 2) { - fd_outb(old_mode & 0xfd, FD_MODE_CHANGE); - mode_change_now = 1; - } - - break; - - default: - break; - } - } -#ifdef PC9800_DEBUG_FLOPPY2 - printk("floppy debug: DP->cmos=%d\n", DP->cmos); - printk("floppy debug: mode_change_now=%d\n", mode_change_now); - printk("floppy debug: access_mode=%d\n", access_mode); - printk("floppy debug: old_mode=%d\n", old_mode); - printk("floppy debug: _floppy - &floppy_type[0]=%d\n", (int)(_floppy - &floppy_type[0])); -#endif /* PC9800_DEBUG_FLOPPY2 */ - if(mode_change_now) - reset_fdc(); -} - -/* start motor, check media-changed condition and write protection */ -static int start_motor(void (*function)(void) ) -{ - access_mode_change_pc9800(); - set_mode(~0, 0x8); - - /* wait_for_completion also schedules reset if needed. */ - return(fd_wait_for_completion(DRS->select_date+DP->select_delay, - (timeout_fn) function)); -} - -static void floppy_ready(void) -{ - CHECK_RESET; - if (start_motor(floppy_ready)) return; - -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("calling disk change from floppy_ready\n"); - } -#endif - if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && - disk_change(current_drive) && - !DP->select_delay) - twaddle(); /* this clears the dcl on certain drive/controller - * combinations */ - -#ifdef fd_chose_dma_mode - if ((raw_cmd->flags & FD_RAW_READ) || - (raw_cmd->flags & FD_RAW_WRITE)) - { - unsigned long flags = claim_dma_lock(); - fd_chose_dma_mode(raw_cmd->kernel_data, - raw_cmd->length); - release_dma_lock(flags); - } -#endif - -#if 0 - access_mode_change_pc9800(); -#endif - if (raw_cmd->flags & (FD_RAW_NEED_SEEK | FD_RAW_NEED_DISK)){ - fdc_specify(); /* must be done here because of hut, hlt ... */ - seek_floppy(); - } else { - if ((raw_cmd->flags & FD_RAW_READ) || - (raw_cmd->flags & FD_RAW_WRITE)) - fdc_specify(); - setup_rw_floppy(); - } -} - -static void floppy_start(void) -{ - reschedule_timeout(current_reqD, "floppy start", 0); - - scandrives(); -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("setting NEWCHANGE in floppy_start\n"); - } -#endif - SETF(FD_DISK_NEWCHANGE); - floppy_ready(); -} - -/* - * ======================================================================== - * here ends the bottom half. Exported routines are: - * floppy_start, floppy_off, floppy_ready, lock_fdc, unlock_fdc, set_fdc, - * start_motor, reset_fdc, reset_fdc_info, interpret_errors. - * Initialization also uses output_byte, result, set_dor, floppy_interrupt - * and set_dor. - * ======================================================================== - */ -/* - * General purpose continuations. - * ============================== - */ - -static void do_wakeup(void) -{ - reschedule_timeout(MAXTIMEOUT, "do wakeup", 0); - cont = 0; - command_status += 2; - wake_up(&command_done); -} - -static struct cont_t wakeup_cont={ - empty, - do_wakeup, - empty, - (done_f)empty -}; - - -static struct cont_t intr_cont={ - empty, - process_fd_request, - empty, - (done_f) empty -}; - -static int wait_til_done(void (*handler)(void), int interruptible) -{ - int ret; - - schedule_bh((void *)(void *)handler); - - if (command_status < 2 && NO_SIGNAL) { - DECLARE_WAITQUEUE(wait, current); - - add_wait_queue(&command_done, &wait); - for (;;) { - set_current_state(interruptible? - TASK_INTERRUPTIBLE: - TASK_UNINTERRUPTIBLE); - - if (command_status >= 2 || !NO_SIGNAL) - break; - - is_alive("wait_til_done"); - - schedule(); - } - - set_current_state(TASK_RUNNING); - remove_wait_queue(&command_done, &wait); - } - - if (command_status < 2){ - cancel_activity(); - cont = &intr_cont; - reset_fdc(); - return -EINTR; - } - -#ifdef PC9800_DEBUG_FLOPPY - if (command_status != FD_COMMAND_OKAY) - printk("floppy check: wait_til_done out:%d\n", command_status); -#endif - if (FDCS->reset) - command_status = FD_COMMAND_ERROR; - if (command_status == FD_COMMAND_OKAY) - ret=0; - else - ret=-EIO; - command_status = FD_COMMAND_NONE; - return ret; -} - -static void generic_done(int result) -{ - command_status = result; - cont = &wakeup_cont; -} - -static void generic_success(void) -{ - cont->done(1); -} - -static void generic_failure(void) -{ - cont->done(0); -} - -static void success_and_wakeup(void) -{ - generic_success(); - cont->redo(); -} - - -/* - * formatting and rw support. - * ========================== - */ - -static int next_valid_format(void) -{ - int probed_format; - - probed_format = DRS->probed_format; - while(1){ - if (probed_format >= 8 || - !DP->autodetect[probed_format]){ - DRS->probed_format = 0; - return 1; - } - if (floppy_type[DP->autodetect[probed_format]].sect){ - DRS->probed_format = probed_format; - return 0; - } - probed_format++; - } -} - -static void bad_flp_intr(void) -{ - if (probing){ - DRS->probed_format++; - if (!next_valid_format()) - return; - } - (*errors)++; - INFBOUND(DRWE->badness, *errors); - if (*errors > DP->max_errors.abort) - cont->done(0); - if (*errors > DP->max_errors.reset) - FDCS->reset = 1; - else if (*errors > DP->max_errors.recal) - DRS->track = NEED_2_RECAL; -} - -static void set_floppy(int drive) -{ - int type = ITYPE(UDRS->fd_device); - if (type) { - auto_detect_mode = 0; - _floppy = floppy_type + type; - } else if (auto_detect_mode == 0) { - auto_detect_mode = 1; - retry_auto_detect = 0; - _floppy = current_type[drive]; - } -#ifdef PC9800_DEBUG_FLOPPY2 - printk("set_floppy: set floppy type=%d\n", (int)(_floppy - floppy_type)); -#endif -} - -/* - * formatting support. - * =================== - */ -static void format_interrupt(void) -{ - switch (interpret_errors()){ - case 1: - cont->error(); - case 2: - break; - case 0: - cont->done(1); - } - cont->redo(); -} - -#define CODE2SIZE (ssize = ((1 << SIZECODE) + 3) >> 2) -#define FM_MODE(x,y) ((y) & ~(((x)->rate & 0x80) >>1)) -#define CT(x) ((x) | 0xc0) -static void setup_format_params(int track) -{ - struct fparm { - unsigned char track,head,sect,size; - } *here = (struct fparm *)floppy_track_buffer; - int il,n; - int count,head_shift,track_shift; - - raw_cmd = &default_raw_cmd; - raw_cmd->track = track; - - raw_cmd->flags = FD_RAW_WRITE | FD_RAW_INTR | FD_RAW_SPIN | - FD_RAW_NEED_DISK | FD_RAW_NEED_SEEK; - raw_cmd->rate = _floppy->rate & 0x43; - raw_cmd->cmd_count = NR_F; - COMMAND = FM_MODE(_floppy,FD_FORMAT); - DR_SELECT = UNIT(current_drive) + PH_HEAD(_floppy,format_req.head); - F_SIZECODE = FD_SIZECODE(_floppy); - F_SECT_PER_TRACK = _floppy->sect << 2 >> F_SIZECODE; - F_GAP = _floppy->fmt_gap; - F_FILL = FD_FILL_BYTE; - - raw_cmd->kernel_data = floppy_track_buffer; - raw_cmd->length = 4 * F_SECT_PER_TRACK; - - /* allow for about 30ms for data transport per track */ - head_shift = (F_SECT_PER_TRACK + 5) / 6; - - /* a ``cylinder'' is two tracks plus a little stepping time */ - track_shift = 2 * head_shift + 3; - - /* position of logical sector 1 on this track */ - n = (track_shift * format_req.track + head_shift * format_req.head) - % F_SECT_PER_TRACK; - - /* determine interleave */ - il = 1; - if (_floppy->fmt_gap < 0x22) - il++; - - /* initialize field */ - for (count = 0; count < F_SECT_PER_TRACK; ++count) { - here[count].track = format_req.track; - here[count].head = format_req.head; - here[count].sect = 0; - here[count].size = F_SIZECODE; - } - /* place logical sectors */ - for (count = 1; count <= F_SECT_PER_TRACK; ++count) { - here[n].sect = count; - n = (n+il) % F_SECT_PER_TRACK; - if (here[n].sect) { /* sector busy, find next free sector */ - ++n; - if (n>= F_SECT_PER_TRACK) { - n-=F_SECT_PER_TRACK; - while (here[n].sect) ++n; - } - } - } -} - -static void redo_format(void) -{ - buffer_track = -1; - setup_format_params(format_req.track << STRETCH(_floppy)); - floppy_start(); -#ifdef DEBUGT - debugt("queue format request"); -#endif -} - -static struct cont_t format_cont={ - format_interrupt, - redo_format, - bad_flp_intr, - generic_done }; - -static int do_format(int drive, struct format_descr *tmp_format_req) -{ - int ret; - - LOCK_FDC(drive,1); - set_floppy(drive); - if (!_floppy || - _floppy->track > DP->tracks || - tmp_format_req->track >= _floppy->track || - tmp_format_req->head >= _floppy->head || - (_floppy->sect << 2) % (1 << FD_SIZECODE(_floppy)) || - !_floppy->fmt_gap) { - process_fd_request(); - return -EINVAL; - } - format_req = *tmp_format_req; - format_errors = 0; - cont = &format_cont; - errors = &format_errors; - IWAIT(redo_format); - process_fd_request(); - return ret; -} - -/* - * Buffer read/write and support - * ============================= - */ - -static void floppy_end_request(struct request *req, int uptodate) -{ - if (end_that_request_first(req, uptodate, current_count_sectors)) - return; - add_disk_randomness(req->rq_disk); - floppy_off((long)req->rq_disk->private_data); - blkdev_dequeue_request(req); - end_that_request_last(req); - - /* We're done with the request */ - current_req = NULL; -} - - -/* new request_done. Can handle physical sectors which are smaller than a - * logical buffer */ -static void request_done(int uptodate) -{ - struct request_queue *q = floppy_queue; - struct request *req = current_req; - unsigned long flags; - int block; - - probing = 0; - reschedule_timeout(MAXTIMEOUT, "request done %d", uptodate); - - if (!req) { - printk("floppy.c: no request in request_done\n"); - return; - } - - if (uptodate){ - /* maintain values for invalidation on geometry - * change */ - block = current_count_sectors + req->sector; - INFBOUND(DRS->maxblock, block); - if (block > _floppy->sect) - DRS->maxtrack = 1; - - /* unlock chained buffers */ - spin_lock_irqsave(q->queue_lock, flags); - floppy_end_request(req, 1); - spin_unlock_irqrestore(q->queue_lock, flags); - } else { - if (rq_data_dir(req) == WRITE) { - /* record write error information */ - DRWE->write_errors++; - if (DRWE->write_errors == 1) { - DRWE->first_error_sector = req->sector; - DRWE->first_error_generation = DRS->generation; - } - DRWE->last_error_sector = req->sector; - DRWE->last_error_generation = DRS->generation; - } - spin_lock_irqsave(q->queue_lock, flags); - floppy_end_request(req, 0); - spin_unlock_irqrestore(q->queue_lock, flags); - } -} - -/* Interrupt handler evaluating the result of the r/w operation */ -static void rw_interrupt(void) -{ - int nr_sectors, ssize, eoc, heads; - - if (R_HEAD >= 2) { - /* some Toshiba floppy controllers occasionnally seem to - * return bogus interrupts after read/write operations, which - * can be recognized by a bad head number (>= 2) */ - return; - } - - if (!DRS->first_read_date) - DRS->first_read_date = jiffies; - - nr_sectors = 0; - CODE2SIZE; - - if (ST1 & ST1_EOC) - eoc = 1; - else - eoc = 0; - - if (COMMAND & 0x80) - heads = 2; - else - heads = 1; - - nr_sectors = (((R_TRACK-TRACK) * heads + - R_HEAD-HEAD) * SECT_PER_TRACK + - R_SECTOR-SECTOR + eoc) << SIZECODE >> 2; - -#ifdef FLOPPY_SANITY_CHECK - if (nr_sectors / ssize > - (in_sector_offset + current_count_sectors + ssize - 1) / ssize) { - DPRINT("long rw: %x instead of %lx\n", - nr_sectors, current_count_sectors); - printk("rs=%d s=%d\n", R_SECTOR, SECTOR); - printk("rh=%d h=%d\n", R_HEAD, HEAD); - printk("rt=%d t=%d\n", R_TRACK, TRACK); - printk("heads=%d eoc=%d\n", heads, eoc); - printk("spt=%d st=%d ss=%d\n", SECT_PER_TRACK, - fsector_t, ssize); - printk("in_sector_offset=%d\n", in_sector_offset); - } -#endif - - nr_sectors -= in_sector_offset; - INFBOUND(nr_sectors,0); - SUPBOUND(current_count_sectors, nr_sectors); - - switch (interpret_errors()){ - case 2: - cont->redo(); - return; - case 1: - if (!current_count_sectors){ - cont->error(); - cont->redo(); - return; - } - break; - case 0: - if (!current_count_sectors){ - cont->redo(); - return; - } - current_type[current_drive] = _floppy; - floppy_sizes[TOMINOR(current_drive) ]= _floppy->size; - break; - } - - if (probing) { - if (DP->flags & FTD_MSG) - DPRINT("Auto-detected floppy type %s in fd%d\n", - _floppy->name,current_drive); - current_type[current_drive] = _floppy; - floppy_sizes[TOMINOR(current_drive)] = _floppy->size; - probing = 0; - } - - if (CT(COMMAND) != FD_READ || - raw_cmd->kernel_data == current_req->buffer){ - /* transfer directly from buffer */ - cont->done(1); - } else if (CT(COMMAND) == FD_READ){ - buffer_track = raw_cmd->track; - buffer_drive = current_drive; - INFBOUND(buffer_max, nr_sectors + fsector_t); - } - cont->redo(); -} - -/* Compute maximal contiguous buffer size. */ -static int buffer_chain_size(void) -{ - struct bio *bio; - struct bio_vec *bv; - int size, i; - char *base; - - base = bio_data(current_req->bio); - size = 0; - - rq_for_each_bio(bio, current_req) { - bio_for_each_segment(bv, bio, i) { - if (page_address(bv->bv_page) + bv->bv_offset != base + size) - break; - - size += bv->bv_len; - } - } - - return size >> 9; -} - -/* Compute the maximal transfer size */ -static int transfer_size(int ssize, int max_sector, int max_size) -{ - SUPBOUND(max_sector, fsector_t + max_size); - - /* alignment */ - max_sector -= (max_sector % _floppy->sect) % ssize; - - /* transfer size, beginning not aligned */ - current_count_sectors = max_sector - fsector_t ; - - return max_sector; -} - -/* - * Move data from/to the track buffer to/from the buffer cache. - */ -static void copy_buffer(int ssize, int max_sector, int max_sector_2) -{ - int remaining; /* number of transferred 512-byte sectors */ - struct bio_vec *bv; - struct bio *bio; - char *buffer, *dma_buffer; - int size, i; - - max_sector = transfer_size(ssize, - minimum(max_sector, max_sector_2), - current_req->nr_sectors); - - if (current_count_sectors <= 0 && CT(COMMAND) == FD_WRITE && - buffer_max > fsector_t + current_req->nr_sectors) - current_count_sectors = minimum(buffer_max - fsector_t, - current_req->nr_sectors); - - remaining = current_count_sectors << 9; -#ifdef FLOPPY_SANITY_CHECK - if ((remaining >> 9) > current_req->nr_sectors && - CT(COMMAND) == FD_WRITE){ - DPRINT("in copy buffer\n"); - printk("current_count_sectors=%ld\n", current_count_sectors); - printk("remaining=%d\n", remaining >> 9); - printk("current_req->nr_sectors=%ld\n",current_req->nr_sectors); - printk("current_req->current_nr_sectors=%u\n", - current_req->current_nr_sectors); - printk("max_sector=%d\n", max_sector); - printk("ssize=%d\n", ssize); - } -#endif - - buffer_max = maximum(max_sector, buffer_max); - - dma_buffer = floppy_track_buffer + ((fsector_t - buffer_min) << 9); - - size = current_req->current_nr_sectors << 9; - - rq_for_each_bio(bio, current_req) { - bio_for_each_segment(bv, bio, i) { - if (!remaining) - break; - - size = bv->bv_len; - SUPBOUND(size, remaining); - - buffer = page_address(bv->bv_page) + bv->bv_offset; -#ifdef FLOPPY_SANITY_CHECK - if (dma_buffer + size > - floppy_track_buffer + (max_buffer_sectors << 10) || - dma_buffer < floppy_track_buffer){ - DPRINT("buffer overrun in copy buffer %d\n", - (int) ((floppy_track_buffer - dma_buffer) >>9)); - printk("fsector_t=%d buffer_min=%d\n", - fsector_t, buffer_min); - printk("current_count_sectors=%ld\n", - current_count_sectors); - if (CT(COMMAND) == FD_READ) - printk("read\n"); - if (CT(COMMAND) == FD_WRITE) - printk("write\n"); - break; - } - if (((unsigned long)buffer) % 512) - DPRINT("%p buffer not aligned\n", buffer); -#endif - if (CT(COMMAND) == FD_READ) - memcpy(buffer, dma_buffer, size); - else - memcpy(dma_buffer, buffer, size); - - remaining -= size; - dma_buffer += size; - } - } -#ifdef FLOPPY_SANITY_CHECK - if (remaining){ - if (remaining > 0) - max_sector -= remaining >> 9; - DPRINT("weirdness: remaining %d\n", remaining>>9); - } -#endif -} - -#if 0 -static inline int check_dma_crossing(char *start, - unsigned long length, char *message) -{ - if (CROSS_64KB(start, length)) { - printk("DMA xfer crosses 64KB boundary in %s %p-%p\n", - message, start, start+length); - return 1; - } else - return 0; -} -#endif - -/* work around a bug in pseudo DMA - * (on some FDCs) pseudo DMA does not stop when the CPU stops - * sending data. Hence we need a different way to signal the - * transfer length: We use SECT_PER_TRACK. Unfortunately, this - * does not work with MT, hence we can only transfer one head at - * a time - */ -static void virtualdmabug_workaround(void) -{ - int hard_sectors, end_sector; - - if(CT(COMMAND) == FD_WRITE) { - COMMAND &= ~0x80; /* switch off multiple track mode */ - - hard_sectors = raw_cmd->length >> (7 + SIZECODE); - end_sector = SECTOR + hard_sectors - 1; -#ifdef FLOPPY_SANITY_CHECK - if(end_sector > SECT_PER_TRACK) { - printk("too many sectors %d > %d\n", - end_sector, SECT_PER_TRACK); - return; - } -#endif - SECT_PER_TRACK = end_sector; /* make sure SECT_PER_TRACK points - * to end of transfer */ - } -} - -/* - * Formulate a read/write request. - * this routine decides where to load the data (directly to buffer, or to - * tmp floppy area), how much data to load (the size of the buffer, the whole - * track, or a single sector) - * All floppy_track_buffer handling goes in here. If we ever add track buffer - * allocation on the fly, it should be done here. No other part should need - * modification. - */ - -static int make_raw_rw_request(void) -{ - int aligned_sector_t; - int max_sector, max_size, tracksize, ssize; - - if(max_buffer_sectors == 0) { - printk("VFS: Block I/O scheduled on unopened device\n"); - return 0; - } - - set_fdc((long)current_req->rq_disk->private_data); - - raw_cmd = &default_raw_cmd; - raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_DISK | - FD_RAW_NEED_SEEK; - raw_cmd->cmd_count = NR_RW; - if (rq_data_dir(current_req) == READ) { - raw_cmd->flags |= FD_RAW_READ; - COMMAND = FM_MODE(_floppy,FD_READ); - } else if (rq_data_dir(current_req) == WRITE){ - raw_cmd->flags |= FD_RAW_WRITE; - COMMAND = FM_MODE(_floppy,FD_WRITE); - } else { - DPRINT("make_raw_rw_request: unknown command\n"); - return 0; - } - - max_sector = _floppy->sect * _floppy->head; - - TRACK = (int)current_req->sector / max_sector; - fsector_t = (int)current_req->sector % max_sector; - if (_floppy->track && TRACK >= _floppy->track) { - if (current_req->current_nr_sectors & 1) { - current_count_sectors = 1; - return 1; - } else - return 0; - } - HEAD = fsector_t / _floppy->sect; - - if (((_floppy->stretch & FD_SWAPSIDES) || TESTF(FD_NEED_TWADDLE)) && - fsector_t < _floppy->sect) - max_sector = _floppy->sect; - - /* 2M disks have phantom sectors on the first track */ - if ((_floppy->rate & FD_2M) && (!TRACK) && (!HEAD)){ - max_sector = 2 * _floppy->sect / 3; - if (fsector_t >= max_sector){ - current_count_sectors = minimum(_floppy->sect - fsector_t, - current_req->nr_sectors); - return 1; - } - SIZECODE = 2; - } else - SIZECODE = FD_SIZECODE(_floppy); - raw_cmd->rate = _floppy->rate & 0x43; - if ((_floppy->rate & FD_2M) && - (TRACK || HEAD) && - raw_cmd->rate == 2) - raw_cmd->rate = 1; - - if (SIZECODE) - SIZECODE2 = 0xff; - else - SIZECODE2 = 0x80; - raw_cmd->track = TRACK << STRETCH(_floppy); - DR_SELECT = UNIT(current_drive) + PH_HEAD(_floppy,HEAD); - GAP = _floppy->gap; - CODE2SIZE; - SECT_PER_TRACK = _floppy->sect << 2 >> SIZECODE; - SECTOR = ((fsector_t % _floppy->sect) << 2 >> SIZECODE) + 1; - - /* tracksize describes the size which can be filled up with sectors - * of size ssize. - */ - tracksize = _floppy->sect - _floppy->sect % ssize; - if (tracksize < _floppy->sect){ - SECT_PER_TRACK ++; - if (tracksize <= fsector_t % _floppy->sect) - SECTOR--; - - /* if we are beyond tracksize, fill up using smaller sectors */ - while (tracksize <= fsector_t % _floppy->sect){ - while(tracksize + ssize > _floppy->sect){ - SIZECODE--; - ssize >>= 1; - } - SECTOR++; SECT_PER_TRACK ++; - tracksize += ssize; - } - max_sector = HEAD * _floppy->sect + tracksize; - } else if (!TRACK && !HEAD && !(_floppy->rate & FD_2M) && probing) { - max_sector = _floppy->sect; - } else if (!HEAD && CT(COMMAND) == FD_WRITE) { - /* for virtual DMA bug workaround */ - max_sector = _floppy->sect; - } - - in_sector_offset = (fsector_t % _floppy->sect) % ssize; - aligned_sector_t = fsector_t - in_sector_offset; - max_size = current_req->nr_sectors; - if ((raw_cmd->track == buffer_track) && - (current_drive == buffer_drive) && - (fsector_t >= buffer_min) && (fsector_t < buffer_max)) { - /* data already in track buffer */ - if (CT(COMMAND) == FD_READ) { - copy_buffer(1, max_sector, buffer_max); - return 1; - } - } else if (in_sector_offset || current_req->nr_sectors < ssize){ - if (CT(COMMAND) == FD_WRITE){ - if (fsector_t + current_req->nr_sectors > ssize && - fsector_t + current_req->nr_sectors < ssize + ssize) - max_size = ssize + ssize; - else - max_size = ssize; - } - raw_cmd->flags &= ~FD_RAW_WRITE; - raw_cmd->flags |= FD_RAW_READ; - COMMAND = FM_MODE(_floppy,FD_READ); - } else if ((unsigned long)current_req->buffer < MAX_DMA_ADDRESS) { - unsigned long dma_limit; - int direct, indirect; - - indirect= transfer_size(ssize,max_sector,max_buffer_sectors*2) - - fsector_t; - - /* - * Do NOT use minimum() here---MAX_DMA_ADDRESS is 64 bits wide - * on a 64 bit machine! - */ - max_size = buffer_chain_size(); - dma_limit = (MAX_DMA_ADDRESS - ((unsigned long) current_req->buffer)) >> 9; - if ((unsigned long) max_size > dma_limit) { - max_size = dma_limit; - } - /* 64 kb boundaries */ - if (CROSS_64KB(current_req->buffer, max_size << 9)) - max_size = (K_64 - - ((unsigned long)current_req->buffer) % K_64)>>9; - direct = transfer_size(ssize,max_sector,max_size) - fsector_t; - /* - * We try to read tracks, but if we get too many errors, we - * go back to reading just one sector at a time. - * - * This means we should be able to read a sector even if there - * are other bad sectors on this track. - */ - if (!direct || - (indirect * 2 > direct * 3 && - *errors < DP->max_errors.read_track && - /*!TESTF(FD_NEED_TWADDLE) &&*/ - ((!probing || (DP->read_track&(1<probed_format)))))){ - max_size = current_req->nr_sectors; - } else { - raw_cmd->kernel_data = current_req->buffer; - raw_cmd->length = current_count_sectors << 9; - if (raw_cmd->length == 0){ - DPRINT("zero dma transfer attempted from make_raw_request\n"); - DPRINT("indirect=%d direct=%d fsector_t=%d", - indirect, direct, fsector_t); - return 0; - } -/* check_dma_crossing(raw_cmd->kernel_data, - raw_cmd->length, - "end of make_raw_request [1]");*/ - - virtualdmabug_workaround(); - return 2; - } - } - - if (CT(COMMAND) == FD_READ) - max_size = max_sector; /* unbounded */ - - /* claim buffer track if needed */ - if (buffer_track != raw_cmd->track || /* bad track */ - buffer_drive !=current_drive || /* bad drive */ - fsector_t > buffer_max || - fsector_t < buffer_min || - ((CT(COMMAND) == FD_READ || - (!in_sector_offset && current_req->nr_sectors >= ssize))&& - max_sector > 2 * max_buffer_sectors + buffer_min && - max_size + fsector_t > 2 * max_buffer_sectors + buffer_min) - /* not enough space */){ - buffer_track = -1; - buffer_drive = current_drive; - buffer_max = buffer_min = aligned_sector_t; - } - raw_cmd->kernel_data = floppy_track_buffer + - ((aligned_sector_t-buffer_min)<<9); - - if (CT(COMMAND) == FD_WRITE){ - /* copy write buffer to track buffer. - * if we get here, we know that the write - * is either aligned or the data already in the buffer - * (buffer will be overwritten) */ -#ifdef FLOPPY_SANITY_CHECK - if (in_sector_offset && buffer_track == -1) - DPRINT("internal error offset !=0 on write\n"); -#endif - buffer_track = raw_cmd->track; - buffer_drive = current_drive; - copy_buffer(ssize, max_sector, 2*max_buffer_sectors+buffer_min); - } else - transfer_size(ssize, max_sector, - 2*max_buffer_sectors+buffer_min-aligned_sector_t); - - /* round up current_count_sectors to get dma xfer size */ - raw_cmd->length = in_sector_offset+current_count_sectors; - raw_cmd->length = ((raw_cmd->length -1)|(ssize-1))+1; - raw_cmd->length <<= 9; -#ifdef FLOPPY_SANITY_CHECK - /*check_dma_crossing(raw_cmd->kernel_data, raw_cmd->length, - "end of make_raw_request");*/ - if ((raw_cmd->length < current_count_sectors << 9) || - (raw_cmd->kernel_data != current_req->buffer && - CT(COMMAND) == FD_WRITE && - (aligned_sector_t + (raw_cmd->length >> 9) > buffer_max || - aligned_sector_t < buffer_min)) || - raw_cmd->length % (128 << SIZECODE) || - raw_cmd->length <= 0 || current_count_sectors <= 0){ - DPRINT("fractionary current count b=%lx s=%lx\n", - raw_cmd->length, current_count_sectors); - if (raw_cmd->kernel_data != current_req->buffer) - printk("addr=%d, length=%ld\n", - (int) ((raw_cmd->kernel_data - - floppy_track_buffer) >> 9), - current_count_sectors); - printk("st=%d ast=%d mse=%d msi=%d\n", - fsector_t, aligned_sector_t, max_sector, max_size); - printk("ssize=%x SIZECODE=%d\n", ssize, SIZECODE); - printk("command=%x SECTOR=%d HEAD=%d, TRACK=%d\n", - COMMAND, SECTOR, HEAD, TRACK); - printk("buffer drive=%d\n", buffer_drive); - printk("buffer track=%d\n", buffer_track); - printk("buffer_min=%d\n", buffer_min); - printk("buffer_max=%d\n", buffer_max); - return 0; - } - - if (raw_cmd->kernel_data != current_req->buffer){ - if (raw_cmd->kernel_data < floppy_track_buffer || - current_count_sectors < 0 || - raw_cmd->length < 0 || - raw_cmd->kernel_data + raw_cmd->length > - floppy_track_buffer + (max_buffer_sectors << 10)){ - DPRINT("buffer overrun in schedule dma\n"); - printk("fsector_t=%d buffer_min=%d current_count=%ld\n", - fsector_t, buffer_min, - raw_cmd->length >> 9); - printk("current_count_sectors=%ld\n", - current_count_sectors); - if (CT(COMMAND) == FD_READ) - printk("read\n"); - if (CT(COMMAND) == FD_WRITE) - printk("write\n"); - return 0; - } - } else if (raw_cmd->length > current_req->nr_sectors << 9 || - current_count_sectors > current_req->nr_sectors){ - DPRINT("buffer overrun in direct transfer\n"); - return 0; - } else if (raw_cmd->length < current_count_sectors << 9){ - DPRINT("more sectors than bytes\n"); - printk("bytes=%ld\n", raw_cmd->length >> 9); - printk("sectors=%ld\n", current_count_sectors); - } - if (raw_cmd->length == 0){ - DPRINT("zero dma transfer attempted from make_raw_request\n"); - return 0; - } -#endif - - virtualdmabug_workaround(); - return 2; -} - -static void redo_fd_request(void) -{ -#define REPEAT {request_done(0); continue; } - int drive; - int tmp; - - lastredo = jiffies; - if (current_drive < N_DRIVE) - floppy_off(current_drive); - - for (;;) { - if (!current_req) { - struct request *req; - - spin_lock_irq(floppy_queue->queue_lock); - req = elv_next_request(floppy_queue); - spin_unlock_irq(floppy_queue->queue_lock); - if (!req) { - do_floppy = NULL; - unlock_fdc(); - return; - } - current_req = req; - } - drive = (long)current_req->rq_disk->private_data; - set_fdc(drive); - reschedule_timeout(current_reqD, "redo fd request", 0); - - set_floppy(drive); - raw_cmd = & default_raw_cmd; - raw_cmd->flags = 0; - if (start_motor(redo_fd_request)) return; - disk_change(current_drive); - if (test_bit(current_drive, &fake_change) || - TESTF(FD_DISK_CHANGED)){ - DPRINT("disk absent or changed during operation\n"); - REPEAT; - } - if (!_floppy) { /* Autodetection */ - if (!probing){ - DRS->probed_format = 0; - if (next_valid_format()){ - DPRINT("no autodetectable formats\n"); - _floppy = NULL; - REPEAT; - } - } - probing = 1; - _floppy = floppy_type+DP->autodetect[DRS->probed_format]; - } else - probing = 0; - errors = & (current_req->errors); - tmp = make_raw_rw_request(); - if (tmp < 2){ - request_done(tmp); - continue; - } - - if (TESTF(FD_NEED_TWADDLE)) - twaddle(); - schedule_bh( (void *)(void *) floppy_start); -#ifdef DEBUGT - debugt("queue fd request"); -#endif - return; - } -#undef REPEAT -} - -static struct cont_t rw_cont={ - rw_interrupt, - redo_fd_request, - bad_flp_intr, - request_done }; - -static void process_fd_request(void) -{ - cont = &rw_cont; - schedule_bh( (void *)(void *) redo_fd_request); -} - -static void do_fd_request(request_queue_t * q) -{ - if(max_buffer_sectors == 0) { - printk("VFS: do_fd_request called on non-open device\n"); - return; - } - - if (usage_count == 0) { - printk("warning: usage count=0, current_req=%p exiting\n", current_req); - printk("sect=%ld flags=%lx\n", (long)current_req->sector, current_req->flags); - return; - } - if (fdc_busy){ - /* fdc busy, this new request will be treated when the - current one is done */ - is_alive("do fd request, old request running"); - return; - } - lock_fdc(MAXTIMEOUT,0); - process_fd_request(); - is_alive("do fd request"); -} - -static struct cont_t poll_cont={ - success_and_wakeup, - floppy_ready, - generic_failure, - generic_done }; - -static int poll_drive(int interruptible, int flag) -{ - int ret; - /* no auto-sense, just clear dcl */ - raw_cmd = &default_raw_cmd; - raw_cmd->flags= flag; - raw_cmd->track=0; - raw_cmd->cmd_count=0; - cont = &poll_cont; -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("setting NEWCHANGE in poll_drive\n"); - } -#endif - SETF(FD_DISK_NEWCHANGE); - WAIT(floppy_ready); - return ret; -} - -/* - * User triggered reset - * ==================== - */ - -static void reset_intr(void) -{ - printk("weird, reset interrupt called\n"); -} - -static struct cont_t reset_cont={ - reset_intr, - success_and_wakeup, - generic_failure, - generic_done }; - -static int user_reset_fdc(int drive, int arg, int interruptible) -{ - int ret; - - ret=0; - LOCK_FDC(drive,interruptible); - if (arg == FD_RESET_ALWAYS) - FDCS->reset=1; - if (FDCS->reset){ - cont = &reset_cont; - WAIT(reset_fdc); - } - process_fd_request(); - return ret; -} - -/* - * Misc Ioctl's and support - * ======================== - */ -static inline int fd_copyout(void *param, const void *address, unsigned long size) -{ - return copy_to_user(param,address, size) ? -EFAULT : 0; -} - -static inline int fd_copyin(void *param, void *address, unsigned long size) -{ - return copy_from_user(address, param, size) ? -EFAULT : 0; -} - -#define _COPYOUT(x) (copy_to_user((void *)param, &(x), sizeof(x)) ? -EFAULT : 0) -#define _COPYIN(x) (copy_from_user(&(x), (void *)param, sizeof(x)) ? -EFAULT : 0) - -#define COPYOUT(x) ECALL(_COPYOUT(x)) -#define COPYIN(x) ECALL(_COPYIN(x)) - -static inline const char *drive_name(int type, int drive) -{ - struct floppy_struct *floppy; - - if (type) - floppy = floppy_type + type; - else { - if (UDP->native_format) - floppy = floppy_type + UDP->native_format; - else - return "(null)"; - } - if (floppy->name) - return floppy->name; - else - return "(null)"; -} - - -/* raw commands */ -static void raw_cmd_done(int flag) -{ - int i; - - if (!flag) { - raw_cmd->flags |= FD_RAW_FAILURE; - raw_cmd->flags |= FD_RAW_HARDFAILURE; - } else { - raw_cmd->reply_count = inr; - if (raw_cmd->reply_count > MAX_REPLIES) - raw_cmd->reply_count=0; - for (i=0; i< raw_cmd->reply_count; i++) - raw_cmd->reply[i] = reply_buffer[i]; - - if (raw_cmd->flags & (FD_RAW_READ | FD_RAW_WRITE)) - { - unsigned long flags; - flags=claim_dma_lock(); - raw_cmd->length = fd_get_dma_residue(); - release_dma_lock(flags); - } - - if ((raw_cmd->flags & FD_RAW_SOFTFAILURE) && - (!raw_cmd->reply_count || (raw_cmd->reply[0] & 0xc0))) - raw_cmd->flags |= FD_RAW_FAILURE; - - if (disk_change(current_drive)) - raw_cmd->flags |= FD_RAW_DISK_CHANGE; - else - raw_cmd->flags &= ~FD_RAW_DISK_CHANGE; - if (raw_cmd->flags & FD_RAW_NO_MOTOR_AFTER) - motor_off_callback(current_drive); - - if (raw_cmd->next && - (!(raw_cmd->flags & FD_RAW_FAILURE) || - !(raw_cmd->flags & FD_RAW_STOP_IF_FAILURE)) && - ((raw_cmd->flags & FD_RAW_FAILURE) || - !(raw_cmd->flags &FD_RAW_STOP_IF_SUCCESS))) { - raw_cmd = raw_cmd->next; - return; - } - } - generic_done(flag); -} - - -static struct cont_t raw_cmd_cont={ - success_and_wakeup, - floppy_start, - generic_failure, - raw_cmd_done -}; - -static inline int raw_cmd_copyout(int cmd, char *param, - struct floppy_raw_cmd *ptr) -{ - int ret; - - while(ptr) { - COPYOUT(*ptr); - param += sizeof(struct floppy_raw_cmd); - if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length){ - if (ptr->length>=0 && ptr->length<=ptr->buffer_length) - ECALL(fd_copyout(ptr->data, - ptr->kernel_data, - ptr->buffer_length - - ptr->length)); - } - ptr = ptr->next; - } - return 0; -} - - -static void raw_cmd_free(struct floppy_raw_cmd **ptr) -{ - struct floppy_raw_cmd *next,*this; - - this = *ptr; - *ptr = 0; - while(this) { - if (this->buffer_length) { - fd_dma_mem_free((unsigned long)this->kernel_data, - this->buffer_length); - this->buffer_length = 0; - } - next = this->next; - kfree(this); - this = next; - } -} - - -static inline int raw_cmd_copyin(int cmd, char *param, - struct floppy_raw_cmd **rcmd) -{ - struct floppy_raw_cmd *ptr; - int ret; - int i; - - *rcmd = 0; - while(1) { - ptr = (struct floppy_raw_cmd *) - kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); - if (!ptr) - return -ENOMEM; - *rcmd = ptr; - COPYIN(*ptr); - ptr->next = 0; - ptr->buffer_length = 0; - param += sizeof(struct floppy_raw_cmd); - if (ptr->cmd_count > 33) - /* the command may now also take up the space - * initially intended for the reply & the - * reply count. Needed for long 82078 commands - * such as RESTORE, which takes ... 17 command - * bytes. Murphy's law #137: When you reserve - * 16 bytes for a structure, you'll one day - * discover that you really need 17... - */ - return -EINVAL; - - for (i=0; i< 16; i++) - ptr->reply[i] = 0; - ptr->resultcode = 0; - ptr->kernel_data = 0; - - if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) { - if (ptr->length <= 0) - return -EINVAL; - ptr->kernel_data =(char*)fd_dma_mem_alloc(ptr->length); - fallback_on_nodma_alloc(&ptr->kernel_data, - ptr->length); - if (!ptr->kernel_data) - return -ENOMEM; - ptr->buffer_length = ptr->length; - } - if (ptr->flags & FD_RAW_WRITE) - ECALL(fd_copyin(ptr->data, ptr->kernel_data, - ptr->length)); - rcmd = & (ptr->next); - if (!(ptr->flags & FD_RAW_MORE)) - return 0; - ptr->rate &= 0x43; - } -} - - -static int raw_cmd_ioctl(int cmd, void *param) -{ - int drive, ret, ret2; - struct floppy_raw_cmd *my_raw_cmd; - - if (FDCS->rawcmd <= 1) - FDCS->rawcmd = 1; - for (drive= 0; drive < N_DRIVE; drive++){ - if (FDC(drive) != fdc) - continue; - if (drive == current_drive){ - if (UDRS->fd_ref > 1){ - FDCS->rawcmd = 2; - break; - } - } else if (UDRS->fd_ref){ - FDCS->rawcmd = 2; - break; - } - } - - if (FDCS->reset) - return -EIO; - - ret = raw_cmd_copyin(cmd, param, &my_raw_cmd); - if (ret) { - raw_cmd_free(&my_raw_cmd); - return ret; - } - - raw_cmd = my_raw_cmd; - cont = &raw_cmd_cont; - ret=wait_til_done(floppy_start,1); -#ifdef DCL_DEBUG - if (DP->flags & FD_DEBUG){ - DPRINT("calling disk change from raw_cmd ioctl\n"); - } -#endif - - if (ret != -EINTR && FDCS->reset) - ret = -EIO; - - DRS->track = NO_TRACK; - - ret2 = raw_cmd_copyout(cmd, param, my_raw_cmd); - if (!ret) - ret = ret2; - raw_cmd_free(&my_raw_cmd); - return ret; -} - -static int invalidate_drive(struct block_device *bdev) -{ - /* invalidate the buffer track to force a reread */ - set_bit((long)bdev->bd_disk->private_data, &fake_change); - process_fd_request(); - check_disk_change(bdev); - return 0; -} - - -static inline void clear_write_error(int drive) -{ - CLEARSTRUCT(UDRWE); -} - -static inline int set_geometry(unsigned int cmd, struct floppy_struct *g, - int drive, int type, struct block_device *bdev) -{ - int cnt; - - /* sanity checking for parameters.*/ - if (g->sect <= 0 || - g->head <= 0 || - g->track <= 0 || - g->track > UDP->tracks>>STRETCH(g) || - /* check if reserved bits are set */ - (g->stretch&~(FD_STRETCH|FD_SWAPSIDES)) != 0) - return -EINVAL; - if (type){ - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - down(&open_lock); - LOCK_FDC(drive,1); - floppy_type[type] = *g; - floppy_type[type].name="user format"; - for (cnt = type << 2; cnt < (type << 2) + 4; cnt++) - floppy_sizes[cnt]= floppy_sizes[cnt+0x80]= - floppy_type[type].size+1; - process_fd_request(); - for (cnt = 0; cnt < N_DRIVE; cnt++) { - struct block_device *bdev = opened_bdev[cnt]; - if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) - continue; - __invalidate_device(bdev, 0); - } - up(&open_lock); - } else { - LOCK_FDC(drive,1); - if (cmd != FDDEFPRM) - /* notice a disk change immediately, else - * we lose our settings immediately*/ - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - user_params[drive] = *g; - if (buffer_drive == drive) - SUPBOUND(buffer_max, user_params[drive].sect); - current_type[drive] = &user_params[drive]; - floppy_sizes[drive] = user_params[drive].size; - if (cmd == FDDEFPRM) - DRS->keep_data = -1; - else - DRS->keep_data = 1; - /* invalidation. Invalidate only when needed, i.e. - * when there are already sectors in the buffer cache - * whose number will change. This is useful, because - * mtools often changes the geometry of the disk after - * looking at the boot block */ - if (DRS->maxblock > user_params[drive].sect || DRS->maxtrack) - invalidate_drive(bdev); - else - process_fd_request(); - } - return 0; -} - -/* handle obsolete ioctl's */ -static int ioctl_table[]= { - FDCLRPRM, - FDSETPRM, - FDDEFPRM, - FDGETPRM, - FDMSGON, - FDMSGOFF, - FDFMTBEG, - FDFMTTRK, - FDFMTEND, - FDSETEMSGTRESH, - FDFLUSH, - FDSETMAXERRS, - FDGETMAXERRS, - FDGETDRVTYP, - FDSETDRVPRM, - FDGETDRVPRM, - FDGETDRVSTAT, - FDPOLLDRVSTAT, - FDRESET, - FDGETFDCSTAT, - FDWERRORCLR, - FDWERRORGET, - FDRAWCMD, - FDEJECT, - FDTWADDLE -}; - -static inline int normalize_ioctl(int *cmd, int *size) -{ - int i; - - for (i=0; i < ARRAY_SIZE(ioctl_table); i++) { - if ((*cmd & 0xffff) == (ioctl_table[i] & 0xffff)){ - *size = _IOC_SIZE(*cmd); - *cmd = ioctl_table[i]; - if (*size > _IOC_SIZE(*cmd)) { - printk("ioctl not yet supported\n"); - return -EFAULT; - } - return 0; - } - } - return -EINVAL; -} - -static int get_floppy_geometry(int drive, int type, struct floppy_struct **g) -{ - if (type) - *g = &floppy_type[type]; - else { - LOCK_FDC(drive,0); - CALL(poll_drive(0,0)); - process_fd_request(); - *g = current_type[drive]; - } - if (!*g) - return -ENODEV; - return 0; -} - -static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long param) -{ -#define FD_IOCTL_ALLOWED ((filp) && (filp)->private_data) -#define OUT(c,x) case c: outparam = (const char *) (x); break -#define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0 - - int drive = (long)inode->i_bdev->bd_disk->private_data; - int i, type = ITYPE(UDRS->fd_device); - int ret; - int size; - union inparam { - struct floppy_struct g; /* geometry */ - struct format_descr f; - struct floppy_max_errors max_errors; - struct floppy_drive_params dp; - } inparam; /* parameters coming from user space */ - const char *outparam; /* parameters passed back to user space */ - - /* convert compatibility eject ioctls into floppy eject ioctl. - * We do this in order to provide a means to eject floppy disks before - * installing the new fdutils package */ - if (cmd == CDROMEJECT || /* CD-ROM eject */ - cmd == 0x6470 /* SunOS floppy eject */) { - DPRINT("obsolete eject ioctl\n"); - DPRINT("please use floppycontrol --eject\n"); - cmd = FDEJECT; - } - - /* generic block device ioctls */ - switch(cmd) { - /* the following have been inspired by the corresponding - * code for other block devices. */ - struct floppy_struct *g; - case HDIO_GETGEO: - { - struct hd_geometry loc; - ECALL(get_floppy_geometry(drive, type, &g)); - loc.heads = g->head; - loc.sectors = g->sect; - loc.cylinders = g->track; - loc.start = 0; - return _COPYOUT(loc); - } - } - - /* convert the old style command into a new style command */ - if ((cmd & 0xff00) == 0x0200) { - ECALL(normalize_ioctl(&cmd, &size)); - } else - return -EINVAL; - - /* permission checks */ - if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) || - ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))) - return -EPERM; - - /* copyin */ - CLEARSTRUCT(&inparam); - if (_IOC_DIR(cmd) & _IOC_WRITE) - ECALL(fd_copyin((void *)param, &inparam, size)) - - switch (cmd) { - case FDEJECT: - if (UDRS->fd_ref != 1) - /* somebody else has this drive open */ - return -EBUSY; - LOCK_FDC(drive,1); - - /* do the actual eject. Fails on - * non-Sparc architectures */ - ret=fd_eject(UNIT(drive)); - - USETF(FD_DISK_CHANGED); - USETF(FD_VERIFY); - process_fd_request(); - return ret; - case FDCLRPRM: - LOCK_FDC(drive,1); - current_type[drive] = NULL; - floppy_sizes[drive] = MAX_DISK_SIZE << 1; - UDRS->keep_data = 0; - return invalidate_drive(inode->i_bdev); - case FDSETPRM: - case FDDEFPRM: - return set_geometry(cmd, & inparam.g, - drive, type, inode->i_bdev); - case FDGETPRM: - ECALL(get_floppy_geometry(drive, type, - (struct floppy_struct**) - &outparam)); - break; - - case FDMSGON: - UDP->flags |= FTD_MSG; - return 0; - case FDMSGOFF: - UDP->flags &= ~FTD_MSG; - return 0; - - case FDFMTBEG: - LOCK_FDC(drive,1); - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - ret = UDRS->flags; - if (ret & FD_VERIFY) { - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - ret = UDRS->flags; - } - - if (ret & FD_VERIFY) { - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - ret = UDRS->flags; - } - - if (ret & FD_VERIFY) { - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - ret = UDRS->flags; - } - - if (ret & FD_VERIFY) { - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - ret = UDRS->flags; - } - - if(ret & FD_VERIFY){ - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - ret = UDRS->flags; - } - process_fd_request(); - if (ret & FD_VERIFY) - return -ENODEV; - if (!(ret & FD_DISK_WRITABLE)) - return -EROFS; - return 0; - case FDFMTTRK: - if (UDRS->fd_ref != 1) - return -EBUSY; - return do_format(drive, &inparam.f); - case FDFMTEND: - case FDFLUSH: - LOCK_FDC(drive,1); - return invalidate_drive(inode->i_bdev); - - case FDSETEMSGTRESH: - UDP->max_errors.reporting = - (unsigned short) (param & 0x0f); - return 0; - OUT(FDGETMAXERRS, &UDP->max_errors); - IN(FDSETMAXERRS, &UDP->max_errors, max_errors); - - case FDGETDRVTYP: - outparam = drive_name(type,drive); - SUPBOUND(size,strlen(outparam)+1); - break; - - IN(FDSETDRVPRM, UDP, dp); - OUT(FDGETDRVPRM, UDP); - - case FDPOLLDRVSTAT: - LOCK_FDC(drive,1); - CALL(poll_drive(1, FD_RAW_NEED_DISK)); - process_fd_request(); - /* fall through */ - OUT(FDGETDRVSTAT, UDRS); - - case FDRESET: - return user_reset_fdc(drive, (int)param, 1); - - OUT(FDGETFDCSTAT,UFDCS); - - case FDWERRORCLR: - CLEARSTRUCT(UDRWE); - return 0; - OUT(FDWERRORGET,UDRWE); - - case FDRAWCMD: - if (type) - return -EINVAL; - LOCK_FDC(drive,1); - set_floppy(drive); - CALL(i = raw_cmd_ioctl(cmd,(void *) param)); - process_fd_request(); - return i; - - case FDTWADDLE: - LOCK_FDC(drive,1); - twaddle(); - process_fd_request(); - return 0; - - default: - return -EINVAL; - } - - if (_IOC_DIR(cmd) & _IOC_READ) - return fd_copyout((void *)param, outparam, size); - else - return 0; -#undef OUT -#undef IN -} - -static void __init config_types(void) -{ - int first=1; - int drive; - extern struct fd_info { - unsigned char dummy[4 * 6]; - unsigned char fd_types[8]; - } drive_info; - - for (drive = 0; drive < 4; drive++) - UDP->cmos = drive_info.fd_types[drive]; - - /* XXX */ - /* additional physical CMOS drive detection should go here */ - - for (drive=0; drive < N_DRIVE; drive++){ - unsigned int type = UDP->cmos; - struct floppy_drive_params *params; - const char *name = NULL; - static char temparea[32]; - - if (type < NUMBER(default_drive_params)) { - params = &default_drive_params[type].params; - if (type) { - name = default_drive_params[type].name; - allowed_drive_mask |= 1 << drive; - } - else - allowed_drive_mask &= ~(1 << drive); - } else { - params = &default_drive_params[0].params; - sprintf(temparea, "unknown type %d (usb?)", type); - name = temparea; - } - if (name) { - const char * prepend = ","; - if (first) { - prepend = KERN_INFO "Floppy drive(s):"; - first = 0; - } - printk("%s fd%d is %s", prepend, drive, name); - register_devfs_entries (drive); - } - *UDP = *params; - } - if (!first) - printk("\n"); -} - -static int floppy_release(struct inode * inode, struct file * filp) -{ - int drive = (long)inode->i_bdev->bd_disk->private_data; - - down(&open_lock); - if (UDRS->fd_ref < 0) - UDRS->fd_ref=0; - else if (!UDRS->fd_ref--) { - DPRINT("floppy_release with fd_ref == 0"); - UDRS->fd_ref = 0; - } - if (!UDRS->fd_ref) - opened_bdev[drive] = NULL; - floppy_release_irq_and_dma(); - up(&open_lock); - return 0; -} - -/* - * floppy_open check for aliasing (/dev/fd0 can be the same as - * /dev/PS0 etc), and disallows simultaneous access to the same - * drive with different device numbers. - */ -#define RETERR(x) do{floppy_release(inode,filp); return -(x);}while(0) - -static int floppy_open(struct inode * inode, struct file * filp) -{ - int drive = (long)inode->i_bdev->bd_disk->private_data; - int old_dev; - int try; - int res = -EBUSY; - char *tmp; - -#ifdef PC9800_DEBUG_FLOPPY - printk("floppy open: start\n"); -#endif - filp->private_data = (void*) 0; - -#ifdef PC9800_DEBUG_FLOPPY - printk("floppy open: drive=%d, current_drive=%d, UDP->cmos=%d\n" - "floppy open: FDCS={spec1=%d, spec2=%d, dtr=%d, version=%d, dor=%d, address=%lu}\n", - drive, current_drive, UDP->cmos, FDCS->spec1, FDCS->spec2, - FDCS->dtr, FDCS->version, FDCS->dor, FDCS->address); - if (_floppy) { - printk("floppy open: _floppy={size=%d, sect=%d, head=%d, track=%d, spec1=%d}\n", - _floppy->size, _floppy->sect, _floppy->head, - _floppy->track, _floppy->spec1); - } else { - printk("floppy open: _floppy=NULL\n"); - } -#endif /* PC9800_DEBUG_FLOPPY */ - - down(&open_lock); - old_dev = UDRS->fd_device; - if (opened_bdev[drive] && opened_bdev[drive] != inode->i_bdev) - goto out2; - - if (!UDRS->fd_ref && (UDP->flags & FD_BROKEN_DCL)){ - USETF(FD_DISK_CHANGED); - USETF(FD_VERIFY); - } - - if (UDRS->fd_ref == -1 || - (UDRS->fd_ref && (filp->f_flags & O_EXCL))) - goto out2; - - if (floppy_grab_irq_and_dma()) - goto out2; - - if (filp->f_flags & O_EXCL) - UDRS->fd_ref = -1; - else - UDRS->fd_ref++; - - opened_bdev[drive] = inode->i_bdev; - - res = -ENXIO; - - if (!floppy_track_buffer){ - /* if opening an ED drive, reserve a big buffer, - * else reserve a small one */ - if ((UDP->cmos == 6) || (UDP->cmos == 5)) - try = 64; /* Only 48 actually useful */ - else - try = 32; /* Only 24 actually useful */ - - tmp=(char *)fd_dma_mem_alloc(1024 * try); - if (!tmp && !floppy_track_buffer) { - try >>= 1; /* buffer only one side */ - INFBOUND(try, 16); - tmp= (char *)fd_dma_mem_alloc(1024*try); - } - if (!tmp && !floppy_track_buffer) { - fallback_on_nodma_alloc(&tmp, 2048 * try); - } - if (!tmp && !floppy_track_buffer) { - DPRINT("Unable to allocate DMA memory\n"); - goto out; - } - if (floppy_track_buffer) { - if (tmp) - fd_dma_mem_free((unsigned long)tmp,try*1024); - } else { - buffer_min = buffer_max = -1; - floppy_track_buffer = tmp; - max_buffer_sectors = try; - } - } - - UDRS->fd_device = iminor(inode); - set_capacity(disks[drive], floppy_sizes[iminor(inode)]); - if (old_dev != -1 && old_dev != iminor(inode)) { - if (buffer_drive == drive) - buffer_track = -1; - } - -#ifdef PC9800_DEBUG_FLOPPY - printk("floppy open: floppy.c:%d passed\n", __LINE__); -#endif - - - /* Allow ioctls if we have write-permissions even if read-only open. - * Needed so that programs such as fdrawcmd still can work on write - * protected disks */ - if (filp->f_mode & 2 || permission(filp->f_dentry->d_inode,2,NULL) == 0) - filp->private_data = (void*) 8; - - if (UFDCS->rawcmd == 1) - UFDCS->rawcmd = 2; - -#ifdef PC9800_DEBUG_FLOPPY - printk("floppy open: floppy.c:%d passed\n", __LINE__); -#endif - - if (!(filp->f_flags & O_NDELAY)) { - if (filp->f_mode & 3) { - UDRS->last_checked = 0; - check_disk_change(inode->i_bdev); - if (UTESTF(FD_DISK_CHANGED)) - goto out; - } - res = -EROFS; - if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE))) - goto out; -#ifdef PC9800_DEBUG_FLOPPY - printk("floppy open: end normally\n"); -#endif - } - up(&open_lock); - return 0; -out: - if (UDRS->fd_ref < 0) - UDRS->fd_ref=0; - else - UDRS->fd_ref--; - if (!UDRS->fd_ref) - opened_bdev[drive] = NULL; - floppy_release_irq_and_dma(); -out2: - up(&open_lock); - return res; -} - -/* - * Check if the disk has been changed or if a change has been faked. - */ -static int check_floppy_change(struct gendisk *disk) -{ - int drive = (long)disk->private_data; - -#ifdef PC9800_DEBUG_FLOPPY - printk("check_floppy_change: MINOR=%d\n", minor(dev)); -#endif - - if (UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY)) - return 1; - - if (UDP->checkfreq < (int)(jiffies - UDRS->last_checked)) { - if(floppy_grab_irq_and_dma()) { - return 1; - } - - lock_fdc(drive,0); - poll_drive(0,0); - process_fd_request(); - floppy_release_irq_and_dma(); - } - - if (UTESTF(FD_DISK_CHANGED) || - UTESTF(FD_VERIFY) || - test_bit(drive, &fake_change) || - (!ITYPE(UDRS->fd_device) && !current_type[drive])) - return 1; - return 0; -} - -/* - * This implements "read block 0" for floppy_revalidate(). - * Needed for format autodetection, checking whether there is - * a disk in the drive, and whether that disk is writable. - */ - -static int floppy_rb0_complete(struct bio *bio, unsigned int bytes_done, int err) -{ - if (bio->bi_size) - return 1; - - complete((struct completion*)bio->bi_private); - return 0; -} - -static int __floppy_read_block_0(struct block_device *bdev) -{ - struct bio bio; - struct bio_vec bio_vec; - struct completion complete; - struct page *page; - size_t size; - - page = alloc_page(GFP_NOIO); - if (!page) { - process_fd_request(); - return -ENOMEM; - } - - size = bdev->bd_block_size; - if (!size) - size = 1024; - - bio_init(&bio); - bio.bi_io_vec = &bio_vec; - bio_vec.bv_page = page; - bio_vec.bv_len = size; - bio_vec.bv_offset = 0; - bio.bi_vcnt = 1; - bio.bi_idx = 0; - bio.bi_size = size; - bio.bi_bdev = bdev; - bio.bi_sector = 0; - init_completion(&complete); - bio.bi_private = &complete; - bio.bi_end_io = floppy_rb0_complete; - - submit_bio(READ, &bio); - generic_unplug_device(bdev_get_queue(bdev)); - process_fd_request(); - wait_for_completion(&complete); - - __free_page(page); - - return 0; -} - -/* revalidate the floppy disk, i.e. trigger format autodetection by reading - * the bootblock (block 0). "Autodetection" is also needed to check whether - * there is a disk in the drive at all... Thus we also do it for fixed - * geometry formats */ -static int floppy_revalidate(struct gendisk *disk) -{ - int drive=(long)disk->private_data; -#define NO_GEOM (!current_type[drive] && !ITYPE(UDRS->fd_device)) - int cf; - int res = 0; - - if (UTESTF(FD_DISK_CHANGED) || - UTESTF(FD_VERIFY) || - test_bit(drive, &fake_change) || - NO_GEOM){ - if(usage_count == 0) { - printk("VFS: revalidate called on non-open device.\n"); - return -EFAULT; - } - lock_fdc(drive,0); - cf = UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY); - if (!(cf || test_bit(drive, &fake_change) || NO_GEOM)){ - process_fd_request(); /*already done by another thread*/ - return 0; - } - UDRS->maxblock = 0; - UDRS->maxtrack = 0; - if (buffer_drive == drive) - buffer_track = -1; - clear_bit(drive, &fake_change); - UCLEARF(FD_DISK_CHANGED); - if (cf) - UDRS->generation++; - if (NO_GEOM){ - /* auto-sensing */ - res = __floppy_read_block_0(opened_bdev[drive]); - } else { - if (cf) - poll_drive(0, FD_RAW_NEED_DISK); - process_fd_request(); - } - } - set_capacity(disk, floppy_sizes[UDRS->fd_device]); - return res; -} - -static struct block_device_operations floppy_fops = { - .owner = THIS_MODULE, - .open = floppy_open, - .release = floppy_release, - .ioctl = fd_ioctl, - .media_changed = check_floppy_change, - .revalidate_disk= floppy_revalidate, -}; - -static char *table[] = -{"", -#if 0 - "d360", -#else - "h1232", -#endif - "h1200", "u360", "u720", "h360", "h720", - "u1440", "u2880", "CompaQ", "h1440", "u1680", "h410", - "u820", "h1476", "u1722", "h420", "u830", "h1494", "u1743", - "h880", "u1040", "u1120", "h1600", "u1760", "u1920", - "u3200", "u3520", "u3840", "u1840", "u800", "u1600", -NULL -}; - -static int t360[] = { - 1,0 -}; -static int t1200[] = { - 2,5,6,10,12,14,16,18,20,23,0 -}; -static int t3in[] = { - 8, 9,26,27,28, 7,11,15,19,24,25, - 29,31, 3, 4,13,17,21,22,30, 0 -}; - -static int *table_sup[] = { - NULL, t360, t1200, t3in+5+8, t3in+5, t3in, t3in -}; - -static void __init register_devfs_entries (int drive) -{ - int base_minor = (drive < 4) ? drive : (124 + drive); - - if (UDP->cmos < NUMBER(default_drive_params)) { - int i = 0; - do { - int minor = base_minor + (table_sup[UDP->cmos][i] << 2); - - devfs_mk_bdev(MKDEV(FLOPPY_MAJOR, minor), - S_IFBLK|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP, - "floppy/%d%s", - drive, table[table_sup[UDP->cmos][i]]); - } while (table_sup[UDP->cmos][i++]); - } -} - -/* - * Floppy Driver initialization - * ============================= - */ - -static inline char __init get_fdc_version(void) -{ - return FDC_8272A; -} - -/* lilo configuration */ - -static void __init floppy_set_flags(int *ints,int param, int param2) -{ - int i; - - for (i=0; i < ARRAY_SIZE(default_drive_params); i++){ - if (param) - default_drive_params[i].params.flags |= param2; - else - default_drive_params[i].params.flags &= ~param2; - } - DPRINT("%s flag 0x%x\n", param2 ? "Setting" : "Clearing", param); -} - -static void __init daring(int *ints,int param, int param2) -{ - int i; - - for (i=0; i < ARRAY_SIZE(default_drive_params); i++){ - if (param){ - default_drive_params[i].params.select_delay = 0; - default_drive_params[i].params.flags |= FD_SILENT_DCL_CLEAR; - } else { - default_drive_params[i].params.select_delay = 2*HZ/100; - default_drive_params[i].params.flags &= ~FD_SILENT_DCL_CLEAR; - } - } - DPRINT("Assuming %s floppy hardware\n", param ? "standard" : "broken"); -} - -static void __init set_cmos(int *ints, int dummy, int dummy2) -{ - int current_drive=0; - - if (ints[0] != 2){ - DPRINT("wrong number of parameters for CMOS\n"); - return; - } - current_drive = ints[1]; - if (current_drive < 0 || current_drive >= 8){ - DPRINT("bad drive for set_cmos\n"); - return; - } -#if N_FDC > 1 - if (current_drive >= 4 && !FDC2) - FDC2 = 0x370; -#endif - DP->cmos = ints[2]; - DPRINT("setting CMOS code to %d\n", ints[2]); -} - -static struct param_table { - const char *name; - void (*fn)(int *ints, int param, int param2); - int *var; - int def_param; - int param2; -} config_params[]={ - { "allowed_drive_mask", 0, &allowed_drive_mask, 0xff, 0}, /* obsolete */ - { "all_drives", 0, &allowed_drive_mask, 0xff, 0 }, /* obsolete */ - { "irq", 0, &FLOPPY_IRQ, DEFAULT_FLOPPY_IRQ, 0 }, - { "dma", 0, &FLOPPY_DMA, DEFAULT_FLOPPY_DMA, 0 }, - - { "daring", daring, 0, 1, 0}, -#if N_FDC > 1 - { "two_fdc", 0, &FDC2, 0x370, 0 }, - { "one_fdc", 0, &FDC2, 0, 0 }, -#endif - { "broken_dcl", floppy_set_flags, 0, 1, FD_BROKEN_DCL }, - { "messages", floppy_set_flags, 0, 1, FTD_MSG }, - { "silent_dcl_clear", floppy_set_flags, 0, 1, FD_SILENT_DCL_CLEAR }, - { "debug", floppy_set_flags, 0, 1, FD_DEBUG }, - - { "nodma", 0, &can_use_virtual_dma, 1, 0 }, - { "yesdma", 0, &can_use_virtual_dma, 0, 0 }, - - { "fifo_depth", 0, &fifo_depth, 0xa, 0 }, - { "nofifo", 0, &no_fifo, 0x20, 0 }, - { "usefifo", 0, &no_fifo, 0, 0 }, - - { "cmos", set_cmos, 0, 0, 0 }, - { "slow", 0, &slow_floppy, 1, 0 }, - - { "unexpected_interrupts", 0, &print_unex, 1, 0 }, - { "no_unexpected_interrupts", 0, &print_unex, 0, 0 }, - - EXTRA_FLOPPY_PARAMS -}; - -static int __init floppy_setup(char *str) -{ - int i; - int param; - int ints[11]; - - str = get_options(str,ARRAY_SIZE(ints),ints); - if (str) { - for (i=0; i< ARRAY_SIZE(config_params); i++){ - if (strcmp(str,config_params[i].name) == 0){ - if (ints[0]) - param = ints[1]; - else - param = config_params[i].def_param; - if (config_params[i].fn) - config_params[i]. - fn(ints,param, - config_params[i].param2); - if (config_params[i].var) { - DPRINT("%s=%d\n", str, param); - *config_params[i].var = param; - } - return 1; - } - } - } - if (str) { - DPRINT("unknown floppy option [%s]\n", str); - - DPRINT("allowed options are:"); - for (i=0; i< ARRAY_SIZE(config_params); i++) - printk(" %s",config_params[i].name); - printk("\n"); - } else - DPRINT("botched floppy option\n"); - DPRINT("Read linux/Documentation/floppy.txt\n"); - return 0; -} - -static int have_no_fdc= -ENODEV; - -static void floppy_device_release(struct device *dev) -{ - complete(&device_release); -} - -static struct platform_device floppy_device = { - .name = "floppy", - .id = 0, - .dev = { - .release = floppy_device_release, - }, -}; - -static struct kobject *floppy_find(dev_t dev, int *part, void *data) -{ - int drive = (*part&3) | ((*part&0x80) >> 5); - if (drive >= N_DRIVE || - !(allowed_drive_mask & (1 << drive)) || - fdc_state[FDC(drive)].version == FDC_NONE) - return NULL; - if (((*part>>2) & 0x1f) >= NUMBER(floppy_type)) - return NULL; - *part = 0; - return get_disk(disks[drive]); -} - -int __init floppy_init(void) -{ - int i,unit,drive; - int err; - - raw_cmd = NULL; - FDC1 = 0x90; - - for (i=0; imajor = FLOPPY_MAJOR; - disks[i]->first_minor = TOMINOR(i); - disks[i]->fops = &floppy_fops; - sprintf(disks[i]->disk_name, "fd%d", i); - } - - blk_register_region(MKDEV(FLOPPY_MAJOR, 0), 256, THIS_MODULE, - floppy_find, NULL, NULL); - - for (i=0; i<256; i++) - if (ITYPE(i)) - floppy_sizes[i] = floppy_type[ITYPE(i)].size; - else - floppy_sizes[i] = MAX_DISK_SIZE << 1; - - floppy_queue = blk_init_queue(do_fd_request, &floppy_lock); - if (!floppy_queue) - goto out_queue; - - reschedule_timeout(MAXTIMEOUT, "floppy init", MAXTIMEOUT); - config_types(); - - for (i = 0; i < N_FDC; i++) { - fdc = i; - CLEARSTRUCT(FDCS); - FDCS->dtr = -1; - FDCS->dor = 0; - } - - if ((fd_inb(FD_MODE_CHANGE) & 1) == 0) - FDC1 = 0xc8; - - use_virtual_dma = can_use_virtual_dma & 1; - fdc_state[0].address = FDC1; - if (fdc_state[0].address == -1) { - err = -ENODEV; - goto out1; - } -#if N_FDC > 1 - fdc_state[1].address = FDC2; -#endif - - fdc = 0; /* reset fdc in case of unexpected interrupt */ - if (floppy_grab_irq_and_dma()){ - err = -EBUSY; - goto out1; - } - - /* initialise drive state */ - for (drive = 0; drive < N_DRIVE; drive++) { - CLEARSTRUCT(UDRS); - CLEARSTRUCT(UDRWE); - USETF(FD_DISK_NEWCHANGE); - USETF(FD_DISK_CHANGED); - USETF(FD_VERIFY); - UDRS->fd_device = -1; - floppy_track_buffer = NULL; - max_buffer_sectors = 0; - } - - for (i = 0; i < N_FDC; i++) { - fdc = i; - FDCS->driver_version = FD_DRIVER_VERSION; - for (unit=0; unit<4; unit++) - FDCS->track[unit] = 0; - if (FDCS->address == -1) - continue; - FDCS->rawcmd = 2; - user_reset_fdc(-1, FD_RESET_ALWAYS, 0); - - /* Try to determine the floppy controller type */ - FDCS->version = get_fdc_version(); - if (FDCS->version == FDC_NONE){ - /* free ioports reserved by floppy_grab_irq_and_dma() */ - release_region(FDCS->address, 1); - release_region(FDCS->address + 2, 1); - release_region(FDCS->address + 4, 1); - release_region(0xbe, 1); - release_region(0x4be, 1); - FDCS->address = -1; - continue; - } - if (can_use_virtual_dma == 2 && FDCS->version < FDC_82072A) - can_use_virtual_dma = 0; - - have_no_fdc = 0; - /* Not all FDCs seem to be able to handle the version command - * properly, so force a reset for the standard FDC clones, - * to avoid interrupt garbage. - */ - user_reset_fdc(-1,FD_RESET_ALWAYS,0); - } - fdc=0; - del_timer(&fd_timeout); - current_drive = 0; - floppy_release_irq_and_dma(); -#if 0 /* no message */ - initialising=0; -#endif - if (have_no_fdc) { - DPRINT("no floppy controllers found\n"); - flush_scheduled_work(); - if (usage_count) - floppy_release_irq_and_dma(); - err = have_no_fdc; - goto out2; - } - - for (drive = 0; drive < N_DRIVE; drive++) { - init_timer(&motor_off_timer[drive]); - motor_off_timer[drive].data = drive; - motor_off_timer[drive].function = motor_off_callback; - if (!(allowed_drive_mask & (1 << drive))) - continue; - if (fdc_state[FDC(drive)].version == FDC_NONE) - continue; - /* to be cleaned up... */ - disks[drive]->private_data = (void*)(long)drive; - disks[drive]->queue = floppy_queue; - add_disk(disks[drive]); - } - - platform_device_register(&floppy_device); - return 0; - -out1: - del_timer_sync(&fd_timeout); -out2: - blk_cleanup_queue(floppy_queue); -out_queue: - blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); - unregister_blkdev(FLOPPY_MAJOR,"fd"); -out: - for (i=0; iaddress != -1){ - static char floppy[] = "floppy"; - if (!request_region(FDCS->address, 1, floppy)) - goto cleanup0; - - if (!request_region(FDCS->address + 2, 1, floppy)) { - release_region(FDCS->address, 1); - goto cleanup0; - } - - if (!request_region(FDCS->address + 4, 1, floppy)) { - release_region(FDCS->address, 1); - release_region(FDCS->address + 2, 1); - goto cleanup0; - } - - if (fdc == 0) { /* internal FDC */ - if (request_region(0xbe, 1, "floppy mode change")) { - if (request_region(0x4be, 1, "floppy ex. mode change")) - continue; - else - DPRINT("Floppy io-port 0x4be in use\n"); - - release_region(0xbe, 1); - } else - DPRINT("Floppy io-port 0xbe in use\n"); - - release_region(FDCS->address, 1); - release_region(FDCS->address + 2, 1); - release_region(FDCS->address + 4, 1); - } - - goto cleanup1; - } - } - for (fdc=0; fdc< N_FDC; fdc++){ - if (FDCS->address != -1){ - reset_fdc_info(1); - fd_outb(FDCS->dor, FD_MODE); - } - } - fdc = 0; - fd_outb((FDCS->dor & 8), FD_MODE); - - for (fdc = 0; fdc < N_FDC; fdc++) - if (FDCS->address != -1) - fd_outb(FDCS->dor, FD_MODE); - /* - * The driver will try and free resources and relies on us - * to know if they were allocated or not. - */ - fdc = 0; - irqdma_allocated = 1; - return 0; - -cleanup0: - DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address); -cleanup1: - fd_free_irq(); - fd_free_dma(); - while(--fdc >= 0) { - release_region(FDCS->address, 1); - release_region(FDCS->address + 2, 1); - release_region(FDCS->address + 4, 1); - if (fdc == 0) { - release_region(0x00be, 1); - release_region(0x04be, 1); - } - } - spin_lock_irqsave(&floppy_usage_lock, flags); - usage_count--; - spin_unlock_irqrestore(&floppy_usage_lock, flags); - return -1; -} - -static void floppy_release_irq_and_dma(void) -{ - int old_fdc; -#ifdef FLOPPY_SANITY_CHECK - int drive; -#endif - long tmpsize; - unsigned long tmpaddr; - unsigned long flags; - - spin_lock_irqsave(&floppy_usage_lock, flags); - if (--usage_count){ - spin_unlock_irqrestore(&floppy_usage_lock, flags); - return; - } - spin_unlock_irqrestore(&floppy_usage_lock, flags); - if(irqdma_allocated) - { - fd_disable_dma(); - fd_free_dma(); - fd_free_irq(); - irqdma_allocated=0; - } - fd_outb(0, FD_MODE); - floppy_enable_hlt(); - - if (floppy_track_buffer && max_buffer_sectors) { - tmpsize = max_buffer_sectors*1024; - tmpaddr = (unsigned long)floppy_track_buffer; - floppy_track_buffer = NULL; - max_buffer_sectors = 0; - buffer_min = buffer_max = -1; - fd_dma_mem_free(tmpaddr, tmpsize); - } - -#ifdef FLOPPY_SANITY_CHECK - for (drive=0; drive < N_FDC * 4; drive++) - if (timer_pending(motor_off_timer + drive)) - printk("motor off timer %d still active\n", drive); - - if (timer_pending(&fd_timeout)) - printk("floppy timer still active:%s\n", timeout_message); - if (timer_pending(&fd_timer)) - printk("auxiliary floppy timer still active\n"); - if (floppy_work.pending) - printk("work still pending\n"); -#endif - old_fdc = fdc; - for (fdc = 0; fdc < N_FDC; fdc++) - if (FDCS->address != -1) { - release_region(FDCS->address, 1); - release_region(FDCS->address + 2, 1); - release_region(FDCS->address + 4, 1); - if (fdc == 0) { - release_region(0xbe, 1); - release_region(0x4be, 1); - } - } - fdc = old_fdc; -} - - -#ifdef MODULE - -char *floppy; - -static void unregister_devfs_entries (int drive) -{ - int i; - - if (UDP->cmos < NUMBER(default_drive_params)) { - i = 0; - do { - devfs_remove("floppy/%d%s", drive, table[table_sup[UDP->cmos][i]]); - } while (table_sup[UDP->cmos][i++]); - } -} - -static void __init parse_floppy_cfg_string(char *cfg) -{ - char *ptr; - - while(*cfg) { - for(ptr = cfg;*cfg && *cfg != ' ' && *cfg != '\t'; cfg++); - if (*cfg) { - *cfg = '\0'; - cfg++; - } - if (*ptr) - floppy_setup(ptr); - } -} - -int init_module(void) -{ - printk(KERN_INFO "inserting floppy driver for " UTS_RELEASE "\n"); - - if (floppy) - parse_floppy_cfg_string(floppy); - return floppy_init(); -} - -void cleanup_module(void) -{ - int drive; - - init_completion(&device_release); - platform_device_unregister(&floppy_device); - blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); - unregister_blkdev(FLOPPY_MAJOR, "fd"); - - for (drive = 0; drive < N_DRIVE; drive++) { - del_timer_sync(&motor_off_timer[drive]); - - if ((allowed_drive_mask & (1 << drive)) && - fdc_state[FDC(drive)].version != FDC_NONE) { - del_gendisk(disks[drive]); - unregister_devfs_entries(drive); - } - put_disk(disks[drive]); - } - devfs_remove("floppy"); - - del_timer_sync(&fd_timeout); - del_timer_sync(&fd_timer); - blk_cleanup_queue(floppy_queue); - - if (usage_count) - floppy_release_irq_and_dma(); - - /* eject disk, if any */ - fd_eject(0); - - wait_for_completion(&device_release); -} - -MODULE_PARM(floppy,"s"); -MODULE_PARM(FLOPPY_IRQ,"i"); -MODULE_PARM(FLOPPY_DMA,"i"); -MODULE_AUTHOR("Osamu Tomita"); -MODULE_SUPPORTED_DEVICE("fd"); -MODULE_LICENSE("GPL"); - -#else - -__setup ("floppy=", floppy_setup); -module_init(floppy_init) -#endif diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c --- a/drivers/block/ll_rw_blk.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/block/ll_rw_blk.c 2004-06-23 19:04:25 -07:00 @@ -817,14 +817,14 @@ void blk_recount_segments(request_queue_t *q, struct bio *bio) { struct bio_vec *bv, *bvprv = NULL; - int i, nr_phys_segs, nr_hw_segs, seg_size, cluster; + int i, nr_phys_segs, nr_hw_segs, seg_size, hw_seg_size, cluster; int high, highprv = 1; if (unlikely(!bio->bi_io_vec)) return; cluster = q->queue_flags & (1 << QUEUE_FLAG_CLUSTER); - seg_size = nr_phys_segs = nr_hw_segs = 0; + hw_seg_size = seg_size = nr_phys_segs = nr_hw_segs = 0; bio_for_each_segment(bv, bio, i) { /* * the trick here is making sure that a high page is never @@ -841,22 +841,35 @@ goto new_segment; if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bv)) goto new_segment; + if (BIOVEC_VIRT_OVERSIZE(hw_seg_size + bv->bv_len)) + goto new_hw_segment; seg_size += bv->bv_len; + hw_seg_size += bv->bv_len; bvprv = bv; continue; } new_segment: - if (!BIOVEC_VIRT_MERGEABLE(bvprv, bv)) + if (BIOVEC_VIRT_MERGEABLE(bvprv, bv) && + !BIOVEC_VIRT_OVERSIZE(hw_seg_size + bv->bv_len)) { + hw_seg_size += bv->bv_len; + } else { new_hw_segment: + if (hw_seg_size > bio->bi_hw_front_size) + bio->bi_hw_front_size = hw_seg_size; + hw_seg_size = BIOVEC_VIRT_START_SIZE(bv) + bv->bv_len; nr_hw_segs++; + } nr_phys_segs++; bvprv = bv; seg_size = bv->bv_len; highprv = high; } - + if (hw_seg_size > bio->bi_hw_back_size) + bio->bi_hw_back_size = hw_seg_size; + if (nr_hw_segs == 1 && hw_seg_size > bio->bi_hw_front_size) + bio->bi_hw_front_size = hw_seg_size; bio->bi_phys_segments = nr_phys_segs; bio->bi_hw_segments = nr_hw_segs; bio->bi_flags |= (1 << BIO_SEG_VALID); @@ -889,22 +902,17 @@ int blk_hw_contig_segment(request_queue_t *q, struct bio *bio, struct bio *nxt) { - if (!(q->queue_flags & (1 << QUEUE_FLAG_CLUSTER))) - return 0; - - if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt))) + if (unlikely(!bio_flagged(bio, BIO_SEG_VALID))) + blk_recount_segments(q, bio); + if (unlikely(!bio_flagged(nxt, BIO_SEG_VALID))) + blk_recount_segments(q, nxt); + if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)) || + BIOVEC_VIRT_OVERSIZE(bio->bi_hw_front_size + bio->bi_hw_back_size)) return 0; if (bio->bi_size + nxt->bi_size > q->max_segment_size) return 0; - /* - * bio and nxt are contigous in memory, check if the queue allows - * these two to be merged into one - */ - if (BIO_SEG_BOUNDARY(q, bio, nxt)) - return 1; - - return 0; + return 1; } EXPORT_SYMBOL(blk_hw_contig_segment); @@ -974,7 +982,8 @@ if (req->nr_phys_segments + nr_phys_segs > q->max_phys_segments) { req->flags |= REQ_NOMERGE; - q->last_merge = NULL; + if (req == q->last_merge) + q->last_merge = NULL; return 0; } @@ -996,7 +1005,8 @@ if (req->nr_hw_segments + nr_hw_segs > q->max_hw_segments || req->nr_phys_segments + nr_phys_segs > q->max_phys_segments) { req->flags |= REQ_NOMERGE; - q->last_merge = NULL; + if (req == q->last_merge) + q->last_merge = NULL; return 0; } @@ -1012,14 +1022,31 @@ static int ll_back_merge_fn(request_queue_t *q, struct request *req, struct bio *bio) { + int len; + if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) { req->flags |= REQ_NOMERGE; - q->last_merge = NULL; + if (req == q->last_merge) + q->last_merge = NULL; return 0; } - - if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(req->biotail), __BVEC_START(bio))) - return ll_new_mergeable(q, req, bio); + if (unlikely(!bio_flagged(req->biotail, BIO_SEG_VALID))) + blk_recount_segments(q, req->biotail); + if (unlikely(!bio_flagged(bio, BIO_SEG_VALID))) + blk_recount_segments(q, bio); + len = req->biotail->bi_hw_back_size + bio->bi_hw_front_size; + if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(req->biotail), __BVEC_START(bio)) && + !BIOVEC_VIRT_OVERSIZE(len)) { + int mergeable = ll_new_mergeable(q, req, bio); + + if (mergeable) { + if (req->nr_hw_segments == 1) + req->bio->bi_hw_front_size = len; + if (bio->bi_hw_segments == 1) + bio->bi_hw_back_size = len; + } + return mergeable; + } return ll_new_hw_segment(q, req, bio); } @@ -1027,14 +1054,31 @@ static int ll_front_merge_fn(request_queue_t *q, struct request *req, struct bio *bio) { + int len; + if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) { req->flags |= REQ_NOMERGE; - q->last_merge = NULL; + if (req == q->last_merge) + q->last_merge = NULL; return 0; } - - if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(req->bio))) - return ll_new_mergeable(q, req, bio); + len = bio->bi_hw_back_size + req->bio->bi_hw_front_size; + if (unlikely(!bio_flagged(bio, BIO_SEG_VALID))) + blk_recount_segments(q, bio); + if (unlikely(!bio_flagged(req->bio, BIO_SEG_VALID))) + blk_recount_segments(q, req->bio); + if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(req->bio)) && + !BIOVEC_VIRT_OVERSIZE(len)) { + int mergeable = ll_new_mergeable(q, req, bio); + + if (mergeable) { + if (bio->bi_hw_segments == 1) + bio->bi_hw_front_size = len; + if (req->nr_hw_segments == 1) + req->biotail->bi_hw_back_size = len; + } + return mergeable; + } return ll_new_hw_segment(q, req, bio); } @@ -1066,8 +1110,17 @@ return 0; total_hw_segments = req->nr_hw_segments + next->nr_hw_segments; - if (blk_hw_contig_segment(q, req->biotail, next->bio)) + if (blk_hw_contig_segment(q, req->biotail, next->bio)) { + int len = req->biotail->bi_hw_back_size + next->bio->bi_hw_front_size; + /* + * propagate the combined length to the end of the requests + */ + if (req->nr_hw_segments == 1) + req->bio->bi_hw_front_size = len; + if (next->nr_hw_segments == 1) + next->biotail->bi_hw_back_size = len; total_hw_segments--; + } if (total_hw_segments > q->max_hw_segments) return 0; @@ -1123,7 +1176,7 @@ /* * remove the plug and let it rip.. */ -static inline void __generic_unplug_device(request_queue_t *q) +inline void __generic_unplug_device(request_queue_t *q) { if (test_bit(QUEUE_FLAG_STOPPED, &q->queue_flags)) return; @@ -1137,6 +1190,7 @@ if (elv_next_request(q)) q->request_fn(q); } +EXPORT_SYMBOL(__generic_unplug_device); /** * generic_unplug_device - fire a request queue @@ -2280,13 +2334,9 @@ out: if (freereq) __blk_put_request(q, freereq); + if (bio_sync(bio)) + __generic_unplug_device(q); - if (blk_queue_plugged(q)) { - int nrq = q->rq.count[READ] + q->rq.count[WRITE] - q->in_flight; - - if (nrq == q->unplug_thresh || bio_sync(bio)) - __generic_unplug_device(q); - } spin_unlock_irq(q->queue_lock); return 0; @@ -2535,7 +2585,7 @@ void blk_recalc_rq_segments(struct request *rq) { - struct bio *bio; + struct bio *bio, *prevbio = NULL; int nr_phys_segs, nr_hw_segs; if (!rq->bio) @@ -2548,6 +2598,13 @@ nr_phys_segs += bio_phys_segments(rq->q, bio); nr_hw_segs += bio_hw_segments(rq->q, bio); + if (prevbio) { + if (blk_phys_contig_segment(rq->q, prevbio, bio)) + nr_phys_segs--; + if (blk_hw_contig_segment(rq->q, prevbio, bio)) + nr_hw_segs--; + } + prevbio = bio; } rq->nr_phys_segments = nr_phys_segs; @@ -2610,7 +2667,7 @@ } total_bytes = bio_nbytes = 0; - while ((bio = req->bio)) { + while ((bio = req->bio) != NULL) { int nbytes; if (nr_bytes >= bio->bi_size) { diff -Nru a/drivers/block/sx8.c b/drivers/block/sx8.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/block/sx8.c 2004-06-23 19:04:28 -07:00 @@ -0,0 +1,1763 @@ +/* + * sx8.c: Driver for Promise SATA SX8 looks-like-I2O hardware + * + * Copyright 2004 Red Hat, Inc. + * + * Author/maintainer: Jeff Garzik + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MODULE_AUTHOR("Jeff Garzik"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Promise SATA SX8 block driver"); + +#if 0 +#define CARM_DEBUG +#define CARM_VERBOSE_DEBUG +#else +#undef CARM_DEBUG +#undef CARM_VERBOSE_DEBUG +#endif +#undef CARM_NDEBUG + +#define DRV_NAME "sx8" +#define DRV_VERSION "0.8" +#define PFX DRV_NAME ": " + +#define NEXT_RESP(idx) ((idx + 1) % RMSG_Q_LEN) + +/* 0xf is just arbitrary, non-zero noise; this is sorta like poisoning */ +#define TAG_ENCODE(tag) (((tag) << 16) | 0xf) +#define TAG_DECODE(tag) (((tag) >> 16) & 0x1f) +#define TAG_VALID(tag) ((((tag) & 0xf) == 0xf) && (TAG_DECODE(tag) < 32)) + +/* note: prints function name for you */ +#ifdef CARM_DEBUG +#define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) +#ifdef CARM_VERBOSE_DEBUG +#define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) +#else +#define VPRINTK(fmt, args...) +#endif /* CARM_VERBOSE_DEBUG */ +#else +#define DPRINTK(fmt, args...) +#define VPRINTK(fmt, args...) +#endif /* CARM_DEBUG */ + +#ifdef CARM_NDEBUG +#define assert(expr) +#else +#define assert(expr) \ + if(unlikely(!(expr))) { \ + printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ + #expr,__FILE__,__FUNCTION__,__LINE__); \ + } +#endif + +/* defines only for the constants which don't work well as enums */ +struct carm_host; + +enum { + /* adapter-wide limits */ + CARM_MAX_PORTS = 8, + CARM_SHM_SIZE = (4096 << 7), + CARM_MINORS_PER_MAJOR = 256 / CARM_MAX_PORTS, + CARM_MAX_WAIT_Q = CARM_MAX_PORTS + 1, + + /* command message queue limits */ + CARM_MAX_REQ = 64, /* max command msgs per host */ + CARM_MAX_Q = 1, /* one command at a time */ + CARM_MSG_LOW_WATER = (CARM_MAX_REQ / 4), /* refill mark */ + + /* S/G limits, host-wide and per-request */ + CARM_MAX_REQ_SG = 32, /* max s/g entries per request */ + CARM_SG_BOUNDARY = 0xffffUL, /* s/g segment boundary */ + CARM_MAX_HOST_SG = 600, /* max s/g entries per host */ + CARM_SG_LOW_WATER = (CARM_MAX_HOST_SG / 4), /* re-fill mark */ + + /* hardware registers */ + CARM_IHQP = 0x1c, + CARM_INT_STAT = 0x10, /* interrupt status */ + CARM_INT_MASK = 0x14, /* interrupt mask */ + CARM_HMUC = 0x18, /* host message unit control */ + RBUF_ADDR_LO = 0x20, /* response msg DMA buf low 32 bits */ + RBUF_ADDR_HI = 0x24, /* response msg DMA buf high 32 bits */ + RBUF_BYTE_SZ = 0x28, + CARM_RESP_IDX = 0x2c, + CARM_CMS0 = 0x30, /* command message size reg 0 */ + CARM_LMUC = 0x48, + CARM_HMPHA = 0x6c, + CARM_INITC = 0xb5, + + /* bits in CARM_INT_{STAT,MASK} */ + INT_RESERVED = 0xfffffff0, + INT_WATCHDOG = (1 << 3), /* watchdog timer */ + INT_Q_OVERFLOW = (1 << 2), /* cmd msg q overflow */ + INT_Q_AVAILABLE = (1 << 1), /* cmd msg q has free space */ + INT_RESPONSE = (1 << 0), /* response msg available */ + INT_ACK_MASK = INT_WATCHDOG | INT_Q_OVERFLOW, + INT_DEF_MASK = INT_RESERVED | INT_Q_OVERFLOW | + INT_RESPONSE, + + /* command messages, and related register bits */ + CARM_HAVE_RESP = 0x01, + CARM_MSG_READ = 1, + CARM_MSG_WRITE = 2, + CARM_MSG_VERIFY = 3, + CARM_MSG_GET_CAPACITY = 4, + CARM_MSG_FLUSH = 5, + CARM_MSG_IOCTL = 6, + CARM_MSG_ARRAY = 8, + CARM_MSG_MISC = 9, + CARM_CME = (1 << 2), + CARM_RME = (1 << 1), + CARM_WZBC = (1 << 0), + CARM_RMI = (1 << 0), + CARM_Q_FULL = (1 << 3), + CARM_MSG_SIZE = 288, + CARM_Q_LEN = 48, + + /* CARM_MSG_IOCTL messages */ + CARM_IOC_SCAN_CHAN = 5, /* scan channels for devices */ + CARM_IOC_GET_TCQ = 13, /* get tcq/ncq depth */ + CARM_IOC_SET_TCQ = 14, /* set tcq/ncq depth */ + + IOC_SCAN_CHAN_NODEV = 0x1f, + IOC_SCAN_CHAN_OFFSET = 0x40, + + /* CARM_MSG_ARRAY messages */ + CARM_ARRAY_INFO = 0, + + ARRAY_NO_EXIST = (1 << 31), + + /* response messages */ + RMSG_SZ = 8, /* sizeof(struct carm_response) */ + RMSG_Q_LEN = 48, /* resp. msg list length */ + RMSG_OK = 1, /* bit indicating msg was successful */ + /* length of entire resp. msg buffer */ + RBUF_LEN = RMSG_SZ * RMSG_Q_LEN, + + PDC_SHM_SIZE = (4096 << 7), /* length of entire h/w buffer */ + + /* CARM_MSG_MISC messages */ + MISC_GET_FW_VER = 2, + MISC_ALLOC_MEM = 3, + MISC_SET_TIME = 5, + + /* MISC_GET_FW_VER feature bits */ + FW_VER_4PORT = (1 << 2), /* 1=4 ports, 0=8 ports */ + FW_VER_NON_RAID = (1 << 1), /* 1=non-RAID firmware, 0=RAID */ + FW_VER_ZCR = (1 << 0), /* zero channel RAID (whatever that is) */ + + /* carm_host flags */ + FL_NON_RAID = FW_VER_NON_RAID, + FL_4PORT = FW_VER_4PORT, + FL_FW_VER_MASK = (FW_VER_NON_RAID | FW_VER_4PORT), + FL_DAC = (1 << 16), + FL_DYN_MAJOR = (1 << 17), +}; + +enum scatter_gather_types { + SGT_32BIT = 0, + SGT_64BIT = 1, +}; + +enum host_states { + HST_INVALID, /* invalid state; never used */ + HST_ALLOC_BUF, /* setting up master SHM area */ + HST_ERROR, /* we never leave here */ + HST_PORT_SCAN, /* start dev scan */ + HST_DEV_SCAN_START, /* start per-device probe */ + HST_DEV_SCAN, /* continue per-device probe */ + HST_DEV_ACTIVATE, /* activate devices we found */ + HST_PROBE_FINISHED, /* probe is complete */ + HST_PROBE_START, /* initiate probe */ + HST_SYNC_TIME, /* tell firmware what time it is */ + HST_GET_FW_VER, /* get firmware version, adapter port cnt */ +}; + +#ifdef CARM_DEBUG +static const char *state_name[] = { + "HST_INVALID", + "HST_ALLOC_BUF", + "HST_ERROR", + "HST_PORT_SCAN", + "HST_DEV_SCAN_START", + "HST_DEV_SCAN", + "HST_DEV_ACTIVATE", + "HST_PROBE_FINISHED", + "HST_PROBE_START", + "HST_SYNC_TIME", + "HST_GET_FW_VER", +}; +#endif + +struct carm_port { + unsigned int port_no; + unsigned int n_queued; + struct gendisk *disk; + struct carm_host *host; + + /* attached device characteristics */ + u64 capacity; + char name[41]; + u16 dev_geom_head; + u16 dev_geom_sect; + u16 dev_geom_cyl; +}; + +struct carm_request { + unsigned int tag; + int n_elem; + unsigned int msg_type; + unsigned int msg_subtype; + unsigned int msg_bucket; + struct request *rq; + struct carm_port *port; + struct scatterlist sg[CARM_MAX_REQ_SG]; +}; + +struct carm_host { + unsigned long flags; + void *mmio; + void *shm; + dma_addr_t shm_dma; + + int major; + int id; + char name[32]; + + spinlock_t lock; + struct pci_dev *pdev; + unsigned int state; + u32 fw_ver; + + request_queue_t *oob_q; + unsigned int n_oob; + + unsigned int hw_sg_used; + + unsigned int resp_idx; + + unsigned int wait_q_prod; + unsigned int wait_q_cons; + request_queue_t *wait_q[CARM_MAX_WAIT_Q]; + + unsigned int n_msgs; + u64 msg_alloc; + struct carm_request req[CARM_MAX_REQ]; + void *msg_base; + dma_addr_t msg_dma; + + int cur_scan_dev; + unsigned long dev_active; + unsigned long dev_present; + struct carm_port port[CARM_MAX_PORTS]; + + struct work_struct fsm_task; + + struct semaphore probe_sem; +}; + +struct carm_response { + u32 ret_handle; + u32 status; +} __attribute__((packed)); + +struct carm_msg_sg { + u32 start; + u32 len; +} __attribute__((packed)); + +struct carm_msg_rw { + u8 type; + u8 id; + u8 sg_count; + u8 sg_type; + u32 handle; + u32 lba; + u16 lba_count; + u16 lba_high; + struct carm_msg_sg sg[32]; +} __attribute__((packed)); + +struct carm_msg_allocbuf { + u8 type; + u8 subtype; + u8 n_sg; + u8 sg_type; + u32 handle; + u32 addr; + u32 len; + u32 evt_pool; + u32 n_evt; + u32 rbuf_pool; + u32 n_rbuf; + u32 msg_pool; + u32 n_msg; + struct carm_msg_sg sg[8]; +} __attribute__((packed)); + +struct carm_msg_ioctl { + u8 type; + u8 subtype; + u8 array_id; + u8 reserved1; + u32 handle; + u32 data_addr; + u32 reserved2; +} __attribute__((packed)); + +struct carm_msg_sync_time { + u8 type; + u8 subtype; + u16 reserved1; + u32 handle; + u32 reserved2; + u32 timestamp; +} __attribute__((packed)); + +struct carm_msg_get_fw_ver { + u8 type; + u8 subtype; + u16 reserved1; + u32 handle; + u32 data_addr; + u32 reserved2; +} __attribute__((packed)); + +struct carm_fw_ver { + u32 version; + u8 features; + u8 reserved1; + u16 reserved2; +} __attribute__((packed)); + +struct carm_array_info { + u32 size; + + u16 size_hi; + u16 stripe_size; + + u32 mode; + + u16 stripe_blk_sz; + u16 reserved1; + + u16 cyl; + u16 head; + + u16 sect; + u8 array_id; + u8 reserved2; + + char name[40]; + + u32 array_status; + + /* device list continues beyond this point? */ +} __attribute__((packed)); + +static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); +static void carm_remove_one (struct pci_dev *pdev); +static int carm_bdev_ioctl(struct inode *ino, struct file *fil, + unsigned int cmd, unsigned long arg); + +static struct pci_device_id carm_pci_tbl[] = { + { PCI_VENDOR_ID_PROMISE, 0x8000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, + { PCI_VENDOR_ID_PROMISE, 0x8002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, + { } /* terminate list */ +}; +MODULE_DEVICE_TABLE(pci, carm_pci_tbl); + +static struct pci_driver carm_driver = { + .name = DRV_NAME, + .id_table = carm_pci_tbl, + .probe = carm_init_one, + .remove = carm_remove_one, +}; + +static struct block_device_operations carm_bd_ops = { + .owner = THIS_MODULE, + .ioctl = carm_bdev_ioctl, +}; + +static unsigned int carm_host_id; +static unsigned long carm_major_alloc; + + + +static int carm_bdev_ioctl(struct inode *ino, struct file *fil, + unsigned int cmd, unsigned long arg) +{ + void __user *usermem = (void __user *) arg; + struct carm_port *port = ino->i_bdev->bd_disk->private_data; + struct hd_geometry geom; + + switch (cmd) { + case HDIO_GETGEO: + if (!usermem) + return -EINVAL; + + geom.heads = (u8) port->dev_geom_head; + geom.sectors = (u8) port->dev_geom_sect; + geom.cylinders = port->dev_geom_cyl; + geom.start = get_start_sect(ino->i_bdev); + + if (copy_to_user(usermem, &geom, sizeof(geom))) + return -EFAULT; + return 0; + + default: + break; + } + + return -EOPNOTSUPP; +} + +static const u32 msg_sizes[] = { 32, 64, 128, CARM_MSG_SIZE }; + +static inline int carm_lookup_bucket(u32 msg_size) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(msg_sizes); i++) + if (msg_size <= msg_sizes[i]) + return i; + + return -ENOENT; +} + +static void carm_init_buckets(void *mmio) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(msg_sizes); i++) + writel(msg_sizes[i], mmio + CARM_CMS0 + (4 * i)); +} + +static inline void *carm_ref_msg(struct carm_host *host, + unsigned int msg_idx) +{ + return host->msg_base + (msg_idx * CARM_MSG_SIZE); +} + +static inline dma_addr_t carm_ref_msg_dma(struct carm_host *host, + unsigned int msg_idx) +{ + return host->msg_dma + (msg_idx * CARM_MSG_SIZE); +} + +static int carm_send_msg(struct carm_host *host, + struct carm_request *crq) +{ + void *mmio = host->mmio; + u32 msg = (u32) carm_ref_msg_dma(host, crq->tag); + u32 cm_bucket = crq->msg_bucket; + u32 tmp; + int rc = 0; + + VPRINTK("ENTER\n"); + + tmp = readl(mmio + CARM_HMUC); + if (tmp & CARM_Q_FULL) { +#if 0 + tmp = readl(mmio + CARM_INT_MASK); + tmp |= INT_Q_AVAILABLE; + writel(tmp, mmio + CARM_INT_MASK); + readl(mmio + CARM_INT_MASK); /* flush */ +#endif + DPRINTK("host msg queue full\n"); + rc = -EBUSY; + } else { + writel(msg | (cm_bucket << 1), mmio + CARM_IHQP); + readl(mmio + CARM_IHQP); /* flush */ + } + + return rc; +} + +static struct carm_request *carm_get_request(struct carm_host *host) +{ + unsigned int i; + + /* obey global hardware limit on S/G entries */ + if (host->hw_sg_used >= (CARM_MAX_HOST_SG - CARM_MAX_REQ_SG)) + return NULL; + + for (i = 0; i < CARM_MAX_Q; i++) + if ((host->msg_alloc & (1ULL << i)) == 0) { + struct carm_request *crq = &host->req[i]; + crq->port = NULL; + crq->n_elem = 0; + + host->msg_alloc |= (1ULL << i); + host->n_msgs++; + + assert(host->n_msgs <= CARM_MAX_REQ); + return crq; + } + + DPRINTK("no request available, returning NULL\n"); + return NULL; +} + +static int carm_put_request(struct carm_host *host, struct carm_request *crq) +{ + assert(crq->tag < CARM_MAX_Q); + + if (unlikely((host->msg_alloc & (1ULL << crq->tag)) == 0)) + return -EINVAL; /* tried to clear a tag that was not active */ + + assert(host->hw_sg_used >= crq->n_elem); + + host->msg_alloc &= ~(1ULL << crq->tag); + host->hw_sg_used -= crq->n_elem; + host->n_msgs--; + + return 0; +} + +static struct carm_request *carm_get_special(struct carm_host *host) +{ + unsigned long flags; + struct carm_request *crq = NULL; + struct request *rq; + int tries = 5000; + + while (tries-- > 0) { + spin_lock_irqsave(&host->lock, flags); + crq = carm_get_request(host); + spin_unlock_irqrestore(&host->lock, flags); + + if (crq) + break; + msleep(10); + } + + if (!crq) + return NULL; + + rq = blk_get_request(host->oob_q, WRITE /* bogus */, GFP_KERNEL); + if (!rq) { + spin_lock_irqsave(&host->lock, flags); + carm_put_request(host, crq); + spin_unlock_irqrestore(&host->lock, flags); + return NULL; + } + + crq->rq = rq; + return crq; +} + +static int carm_array_info (struct carm_host *host, unsigned int array_idx) +{ + struct carm_msg_ioctl *ioc; + unsigned int idx; + u32 msg_data; + dma_addr_t msg_dma; + struct carm_request *crq; + int rc; + + crq = carm_get_special(host); + if (!crq) { + rc = -ENOMEM; + goto err_out; + } + + idx = crq->tag; + + ioc = carm_ref_msg(host, idx); + msg_dma = carm_ref_msg_dma(host, idx); + msg_data = (u32) (msg_dma + sizeof(struct carm_array_info)); + + crq->msg_type = CARM_MSG_ARRAY; + crq->msg_subtype = CARM_ARRAY_INFO; + rc = carm_lookup_bucket(sizeof(struct carm_msg_ioctl) + + sizeof(struct carm_array_info)); + BUG_ON(rc < 0); + crq->msg_bucket = (u32) rc; + + memset(ioc, 0, sizeof(*ioc)); + ioc->type = CARM_MSG_ARRAY; + ioc->subtype = CARM_ARRAY_INFO; + ioc->array_id = (u8) array_idx; + ioc->handle = cpu_to_le32(TAG_ENCODE(idx)); + ioc->data_addr = cpu_to_le32(msg_data); + + spin_lock_irq(&host->lock); + assert(host->state == HST_DEV_SCAN_START || + host->state == HST_DEV_SCAN); + spin_unlock_irq(&host->lock); + + DPRINTK("blk_insert_request, tag == %u\n", idx); + blk_insert_request(host->oob_q, crq->rq, 1, crq, 0); + + return 0; + +err_out: + spin_lock_irq(&host->lock); + host->state = HST_ERROR; + spin_unlock_irq(&host->lock); + return rc; +} + +typedef unsigned int (*carm_sspc_t)(struct carm_host *, unsigned int, void *); + +static int carm_send_special (struct carm_host *host, carm_sspc_t func) +{ + struct carm_request *crq; + struct carm_msg_ioctl *ioc; + void *mem; + unsigned int idx, msg_size; + int rc; + + crq = carm_get_special(host); + if (!crq) + return -ENOMEM; + + idx = crq->tag; + + mem = carm_ref_msg(host, idx); + + msg_size = func(host, idx, mem); + + ioc = mem; + crq->msg_type = ioc->type; + crq->msg_subtype = ioc->subtype; + rc = carm_lookup_bucket(msg_size); + BUG_ON(rc < 0); + crq->msg_bucket = (u32) rc; + + DPRINTK("blk_insert_request, tag == %u\n", idx); + blk_insert_request(host->oob_q, crq->rq, 1, crq, 0); + + return 0; +} + +static unsigned int carm_fill_sync_time(struct carm_host *host, + unsigned int idx, void *mem) +{ + struct timeval tv; + struct carm_msg_sync_time *st = mem; + + do_gettimeofday(&tv); + + memset(st, 0, sizeof(*st)); + st->type = CARM_MSG_MISC; + st->subtype = MISC_SET_TIME; + st->handle = cpu_to_le32(TAG_ENCODE(idx)); + st->timestamp = cpu_to_le32(tv.tv_sec); + + return sizeof(struct carm_msg_sync_time); +} + +static unsigned int carm_fill_alloc_buf(struct carm_host *host, + unsigned int idx, void *mem) +{ + struct carm_msg_allocbuf *ab = mem; + + memset(ab, 0, sizeof(*ab)); + ab->type = CARM_MSG_MISC; + ab->subtype = MISC_ALLOC_MEM; + ab->handle = cpu_to_le32(TAG_ENCODE(idx)); + ab->n_sg = 1; + ab->sg_type = SGT_32BIT; + ab->addr = cpu_to_le32(host->shm_dma + (PDC_SHM_SIZE >> 1)); + ab->len = cpu_to_le32(PDC_SHM_SIZE >> 1); + ab->evt_pool = cpu_to_le32(host->shm_dma + (16 * 1024)); + ab->n_evt = cpu_to_le32(1024); + ab->rbuf_pool = cpu_to_le32(host->shm_dma); + ab->n_rbuf = cpu_to_le32(RMSG_Q_LEN); + ab->msg_pool = cpu_to_le32(host->shm_dma + RBUF_LEN); + ab->n_msg = cpu_to_le32(CARM_Q_LEN); + ab->sg[0].start = cpu_to_le32(host->shm_dma + (PDC_SHM_SIZE >> 1)); + ab->sg[0].len = cpu_to_le32(65536); + + return sizeof(struct carm_msg_allocbuf); +} + +static unsigned int carm_fill_scan_channels(struct carm_host *host, + unsigned int idx, void *mem) +{ + struct carm_msg_ioctl *ioc = mem; + u32 msg_data = (u32) (carm_ref_msg_dma(host, idx) + + IOC_SCAN_CHAN_OFFSET); + + memset(ioc, 0, sizeof(*ioc)); + ioc->type = CARM_MSG_IOCTL; + ioc->subtype = CARM_IOC_SCAN_CHAN; + ioc->handle = cpu_to_le32(TAG_ENCODE(idx)); + ioc->data_addr = cpu_to_le32(msg_data); + + /* fill output data area with "no device" default values */ + mem += IOC_SCAN_CHAN_OFFSET; + memset(mem, IOC_SCAN_CHAN_NODEV, CARM_MAX_PORTS); + + return IOC_SCAN_CHAN_OFFSET + CARM_MAX_PORTS; +} + +static unsigned int carm_fill_get_fw_ver(struct carm_host *host, + unsigned int idx, void *mem) +{ + struct carm_msg_get_fw_ver *ioc = mem; + u32 msg_data = (u32) (carm_ref_msg_dma(host, idx) + sizeof(*ioc)); + + memset(ioc, 0, sizeof(*ioc)); + ioc->type = CARM_MSG_MISC; + ioc->subtype = MISC_GET_FW_VER; + ioc->handle = cpu_to_le32(TAG_ENCODE(idx)); + ioc->data_addr = cpu_to_le32(msg_data); + + return sizeof(struct carm_msg_get_fw_ver) + + sizeof(struct carm_fw_ver); +} + +static inline void carm_end_request_queued(struct carm_host *host, + struct carm_request *crq, + int uptodate) +{ + struct request *req = crq->rq; + int rc; + + rc = end_that_request_first(req, uptodate, req->hard_nr_sectors); + assert(rc == 0); + + end_that_request_last(req); + + rc = carm_put_request(host, crq); + assert(rc == 0); +} + +static inline void carm_push_q (struct carm_host *host, request_queue_t *q) +{ + unsigned int idx = host->wait_q_prod % CARM_MAX_WAIT_Q; + + blk_stop_queue(q); + VPRINTK("STOPPED QUEUE %p\n", q); + + host->wait_q[idx] = q; + host->wait_q_prod++; + BUG_ON(host->wait_q_prod == host->wait_q_cons); /* overrun */ +} + +static inline request_queue_t *carm_pop_q(struct carm_host *host) +{ + unsigned int idx; + + if (host->wait_q_prod == host->wait_q_cons) + return NULL; + + idx = host->wait_q_cons % CARM_MAX_WAIT_Q; + host->wait_q_cons++; + + return host->wait_q[idx]; +} + +static inline void carm_round_robin(struct carm_host *host) +{ + request_queue_t *q = carm_pop_q(host); + if (q) { + blk_start_queue(q); + VPRINTK("STARTED QUEUE %p\n", q); + } +} + +static inline void carm_end_rq(struct carm_host *host, struct carm_request *crq, + int is_ok) +{ + carm_end_request_queued(host, crq, is_ok); + if (CARM_MAX_Q == 1) + carm_round_robin(host); + else if ((host->n_msgs <= CARM_MSG_LOW_WATER) && + (host->hw_sg_used <= CARM_SG_LOW_WATER)) { + carm_round_robin(host); + } +} + +static void carm_oob_rq_fn(request_queue_t *q) +{ + struct carm_host *host = q->queuedata; + struct carm_request *crq; + struct request *rq; + int rc; + + while (1) { + DPRINTK("get req\n"); + rq = elv_next_request(q); + if (!rq) + break; + + blkdev_dequeue_request(rq); + + crq = rq->special; + assert(crq != NULL); + assert(crq->rq == rq); + + crq->n_elem = 0; + + DPRINTK("send req\n"); + rc = carm_send_msg(host, crq); + if (rc) { + blk_requeue_request(q, rq); + carm_push_q(host, q); + return; /* call us again later, eventually */ + } + } +} + +static void carm_rq_fn(request_queue_t *q) +{ + struct carm_port *port = q->queuedata; + struct carm_host *host = port->host; + struct carm_msg_rw *msg; + struct carm_request *crq; + struct request *rq; + struct scatterlist *sg; + int writing = 0, pci_dir, i, n_elem, rc; + u32 tmp; + unsigned int msg_size; + +queue_one_request: + VPRINTK("get req\n"); + rq = elv_next_request(q); + if (!rq) + return; + + crq = carm_get_request(host); + if (!crq) { + carm_push_q(host, q); + return; /* call us again later, eventually */ + } + crq->rq = rq; + + blkdev_dequeue_request(rq); + + if (rq_data_dir(rq) == WRITE) { + writing = 1; + pci_dir = PCI_DMA_TODEVICE; + } else { + pci_dir = PCI_DMA_FROMDEVICE; + } + + /* get scatterlist from block layer */ + sg = &crq->sg[0]; + n_elem = blk_rq_map_sg(q, rq, sg); + if (n_elem <= 0) { + carm_end_rq(host, crq, 0); + return; /* request with no s/g entries? */ + } + + /* map scatterlist to PCI bus addresses */ + n_elem = pci_map_sg(host->pdev, sg, n_elem, pci_dir); + if (n_elem <= 0) { + carm_end_rq(host, crq, 0); + return; /* request with no s/g entries? */ + } + crq->n_elem = n_elem; + crq->port = port; + host->hw_sg_used += n_elem; + + /* + * build read/write message + */ + + VPRINTK("build msg\n"); + msg = (struct carm_msg_rw *) carm_ref_msg(host, crq->tag); + + if (writing) { + msg->type = CARM_MSG_WRITE; + crq->msg_type = CARM_MSG_WRITE; + } else { + msg->type = CARM_MSG_READ; + crq->msg_type = CARM_MSG_READ; + } + + msg->id = port->port_no; + msg->sg_count = n_elem; + msg->sg_type = SGT_32BIT; + msg->handle = cpu_to_le32(TAG_ENCODE(crq->tag)); + msg->lba = cpu_to_le32(rq->sector & 0xffffffff); + tmp = (rq->sector >> 16) >> 16; + msg->lba_high = cpu_to_le16( (u16) tmp ); + msg->lba_count = cpu_to_le16(rq->nr_sectors); + + msg_size = sizeof(struct carm_msg_rw) - sizeof(msg->sg); + for (i = 0; i < n_elem; i++) { + struct carm_msg_sg *carm_sg = &msg->sg[i]; + carm_sg->start = cpu_to_le32(sg_dma_address(&crq->sg[i])); + carm_sg->len = cpu_to_le32(sg_dma_len(&crq->sg[i])); + msg_size += sizeof(struct carm_msg_sg); + } + + rc = carm_lookup_bucket(msg_size); + BUG_ON(rc < 0); + crq->msg_bucket = (u32) rc; + + /* + * queue read/write message to hardware + */ + + VPRINTK("send msg, tag == %u\n", crq->tag); + rc = carm_send_msg(host, crq); + if (rc) { + carm_put_request(host, crq); + blk_requeue_request(q, rq); + carm_push_q(host, q); + return; /* call us again later, eventually */ + } + + goto queue_one_request; +} + +static void carm_handle_array_info(struct carm_host *host, + struct carm_request *crq, u8 *mem, + int is_ok) +{ + struct carm_port *port; + u8 *msg_data = mem + sizeof(struct carm_array_info); + struct carm_array_info *desc = (struct carm_array_info *) msg_data; + u64 lo, hi; + int cur_port; + size_t slen; + + DPRINTK("ENTER\n"); + + carm_end_rq(host, crq, is_ok); + + if (!is_ok) + goto out; + if (le32_to_cpu(desc->array_status) & ARRAY_NO_EXIST) + goto out; + + cur_port = host->cur_scan_dev; + + /* should never occur */ + if ((cur_port < 0) || (cur_port >= CARM_MAX_PORTS)) { + printk(KERN_ERR PFX "BUG: cur_scan_dev==%d, array_id==%d\n", + cur_port, (int) desc->array_id); + goto out; + } + + port = &host->port[cur_port]; + + lo = (u64) le32_to_cpu(desc->size); + hi = (u64) le32_to_cpu(desc->size_hi); + + port->capacity = lo | (hi << 32); + port->dev_geom_head = le16_to_cpu(desc->head); + port->dev_geom_sect = le16_to_cpu(desc->sect); + port->dev_geom_cyl = le16_to_cpu(desc->cyl); + + host->dev_active |= (1 << cur_port); + + strncpy(port->name, desc->name, sizeof(port->name)); + port->name[sizeof(port->name) - 1] = 0; + slen = strlen(port->name); + while (slen && (port->name[slen - 1] == ' ')) { + port->name[slen - 1] = 0; + slen--; + } + + printk(KERN_INFO DRV_NAME "(%s): port %u device %Lu sectors\n", + pci_name(host->pdev), port->port_no, + (unsigned long long) port->capacity); + printk(KERN_INFO DRV_NAME "(%s): port %u device \"%s\"\n", + pci_name(host->pdev), port->port_no, port->name); + +out: + assert(host->state == HST_DEV_SCAN); + schedule_work(&host->fsm_task); +} + +static void carm_handle_scan_chan(struct carm_host *host, + struct carm_request *crq, u8 *mem, + int is_ok) +{ + u8 *msg_data = mem + IOC_SCAN_CHAN_OFFSET; + unsigned int i, dev_count = 0; + int new_state = HST_DEV_SCAN_START; + + DPRINTK("ENTER\n"); + + carm_end_rq(host, crq, is_ok); + + if (!is_ok) { + new_state = HST_ERROR; + goto out; + } + + /* TODO: scan and support non-disk devices */ + for (i = 0; i < 8; i++) + if (msg_data[i] == 0) { /* direct-access device (disk) */ + host->dev_present |= (1 << i); + dev_count++; + } + + printk(KERN_INFO DRV_NAME "(%s): found %u interesting devices\n", + pci_name(host->pdev), dev_count); + +out: + assert(host->state == HST_PORT_SCAN); + host->state = new_state; + schedule_work(&host->fsm_task); +} + +static void carm_handle_generic(struct carm_host *host, + struct carm_request *crq, int is_ok, + int cur_state, int next_state) +{ + DPRINTK("ENTER\n"); + + carm_end_rq(host, crq, is_ok); + + assert(host->state == cur_state); + if (is_ok) + host->state = next_state; + else + host->state = HST_ERROR; + schedule_work(&host->fsm_task); +} + +static inline void carm_handle_rw(struct carm_host *host, + struct carm_request *crq, int is_ok) +{ + int pci_dir; + + VPRINTK("ENTER\n"); + + if (rq_data_dir(crq->rq) == WRITE) + pci_dir = PCI_DMA_TODEVICE; + else + pci_dir = PCI_DMA_FROMDEVICE; + + pci_unmap_sg(host->pdev, &crq->sg[0], crq->n_elem, pci_dir); + + carm_end_rq(host, crq, is_ok); +} + +static inline void carm_handle_resp(struct carm_host *host, + u32 ret_handle_le, u32 status) +{ + u32 handle = le32_to_cpu(ret_handle_le); + unsigned int msg_idx; + struct carm_request *crq; + int is_ok = (status == RMSG_OK); + u8 *mem; + + VPRINTK("ENTER, handle == 0x%x\n", handle); + + if (unlikely(!TAG_VALID(handle))) { + printk(KERN_ERR DRV_NAME "(%s): BUG: invalid tag 0x%x\n", + pci_name(host->pdev), handle); + return; + } + + msg_idx = TAG_DECODE(handle); + VPRINTK("tag == %u\n", msg_idx); + + crq = &host->req[msg_idx]; + + /* fast path */ + if (likely(crq->msg_type == CARM_MSG_READ || + crq->msg_type == CARM_MSG_WRITE)) { + carm_handle_rw(host, crq, is_ok); + return; + } + + mem = carm_ref_msg(host, msg_idx); + + switch (crq->msg_type) { + case CARM_MSG_IOCTL: { + switch (crq->msg_subtype) { + case CARM_IOC_SCAN_CHAN: + carm_handle_scan_chan(host, crq, mem, is_ok); + break; + default: + /* unknown / invalid response */ + goto err_out; + } + break; + } + + case CARM_MSG_MISC: { + switch (crq->msg_subtype) { + case MISC_ALLOC_MEM: + carm_handle_generic(host, crq, is_ok, + HST_ALLOC_BUF, HST_SYNC_TIME); + break; + case MISC_SET_TIME: + carm_handle_generic(host, crq, is_ok, + HST_SYNC_TIME, HST_GET_FW_VER); + break; + case MISC_GET_FW_VER: { + struct carm_fw_ver *ver = (struct carm_fw_ver *) + mem + sizeof(struct carm_msg_get_fw_ver); + if (is_ok) { + host->fw_ver = le32_to_cpu(ver->version); + host->flags |= (ver->features & FL_FW_VER_MASK); + } + carm_handle_generic(host, crq, is_ok, + HST_GET_FW_VER, HST_PORT_SCAN); + break; + } + default: + /* unknown / invalid response */ + goto err_out; + } + break; + } + + case CARM_MSG_ARRAY: { + switch (crq->msg_subtype) { + case CARM_ARRAY_INFO: + carm_handle_array_info(host, crq, mem, is_ok); + break; + default: + /* unknown / invalid response */ + goto err_out; + } + break; + } + + default: + /* unknown / invalid response */ + goto err_out; + } + + return; + +err_out: + printk(KERN_WARNING DRV_NAME "(%s): BUG: unhandled message type %d/%d\n", + pci_name(host->pdev), crq->msg_type, crq->msg_subtype); + carm_end_rq(host, crq, 0); +} + +static inline void carm_handle_responses(struct carm_host *host) +{ + void *mmio = host->mmio; + struct carm_response *resp = (struct carm_response *) host->shm; + unsigned int work = 0; + unsigned int idx = host->resp_idx % RMSG_Q_LEN; + + while (1) { + u32 status = le32_to_cpu(resp[idx].status); + + if (status == 0xffffffff) { + VPRINTK("ending response on index %u\n", idx); + writel(idx << 3, mmio + CARM_RESP_IDX); + break; + } + + /* response to a message we sent */ + else if ((status & (1 << 31)) == 0) { + VPRINTK("handling msg response on index %u\n", idx); + carm_handle_resp(host, resp[idx].ret_handle, status); + resp[idx].status = 0xffffffff; + } + + /* asynchronous events the hardware throws our way */ + else if ((status & 0xff000000) == (1 << 31)) { + u8 *evt_type_ptr = (u8 *) &resp[idx]; + u8 evt_type = *evt_type_ptr; + printk(KERN_WARNING DRV_NAME "(%s): unhandled event type %d\n", + pci_name(host->pdev), (int) evt_type); + resp[idx].status = 0xffffffff; + } + + idx = NEXT_RESP(idx); + work++; + } + + VPRINTK("EXIT, work==%u\n", work); + host->resp_idx += work; +} + +static irqreturn_t carm_interrupt(int irq, void *__host, struct pt_regs *regs) +{ + struct carm_host *host = __host; + void *mmio; + u32 mask; + int handled = 0; + unsigned long flags; + + if (!host) { + VPRINTK("no host\n"); + return IRQ_NONE; + } + + spin_lock_irqsave(&host->lock, flags); + + mmio = host->mmio; + + /* reading should also clear interrupts */ + mask = readl(mmio + CARM_INT_STAT); + + if (mask == 0 || mask == 0xffffffff) { + VPRINTK("no work, mask == 0x%x\n", mask); + goto out; + } + + if (mask & INT_ACK_MASK) + writel(mask, mmio + CARM_INT_STAT); + + if (unlikely(host->state == HST_INVALID)) { + VPRINTK("not initialized yet, mask = 0x%x\n", mask); + goto out; + } + + if (mask & CARM_HAVE_RESP) { + handled = 1; + carm_handle_responses(host); + } + +out: + spin_unlock_irqrestore(&host->lock, flags); + VPRINTK("EXIT\n"); + return IRQ_RETVAL(handled); +} + +static void carm_fsm_task (void *_data) +{ + struct carm_host *host = _data; + unsigned long flags; + unsigned int state; + int rc, i, next_dev; + int reschedule = 0; + int new_state = HST_INVALID; + + spin_lock_irqsave(&host->lock, flags); + state = host->state; + spin_unlock_irqrestore(&host->lock, flags); + + DPRINTK("ENTER, state == %s\n", state_name[state]); + + switch (state) { + case HST_PROBE_START: + new_state = HST_ALLOC_BUF; + reschedule = 1; + break; + + case HST_ALLOC_BUF: + rc = carm_send_special(host, carm_fill_alloc_buf); + if (rc) { + new_state = HST_ERROR; + reschedule = 1; + } + break; + + case HST_SYNC_TIME: + rc = carm_send_special(host, carm_fill_sync_time); + if (rc) { + new_state = HST_ERROR; + reschedule = 1; + } + break; + + case HST_GET_FW_VER: + rc = carm_send_special(host, carm_fill_get_fw_ver); + if (rc) { + new_state = HST_ERROR; + reschedule = 1; + } + break; + + case HST_PORT_SCAN: + rc = carm_send_special(host, carm_fill_scan_channels); + if (rc) { + new_state = HST_ERROR; + reschedule = 1; + } + break; + + case HST_DEV_SCAN_START: + host->cur_scan_dev = -1; + new_state = HST_DEV_SCAN; + reschedule = 1; + break; + + case HST_DEV_SCAN: + next_dev = -1; + for (i = host->cur_scan_dev + 1; i < CARM_MAX_PORTS; i++) + if (host->dev_present & (1 << i)) { + next_dev = i; + break; + } + + if (next_dev >= 0) { + host->cur_scan_dev = next_dev; + rc = carm_array_info(host, next_dev); + if (rc) { + new_state = HST_ERROR; + reschedule = 1; + } + } else { + new_state = HST_DEV_ACTIVATE; + reschedule = 1; + } + break; + + case HST_DEV_ACTIVATE: { + int activated = 0; + for (i = 0; i < CARM_MAX_PORTS; i++) + if (host->dev_active & (1 << i)) { + struct carm_port *port = &host->port[i]; + struct gendisk *disk = port->disk; + + set_capacity(disk, port->capacity); + add_disk(disk); + activated++; + } + + printk(KERN_INFO DRV_NAME "(%s): %d ports activated\n", + pci_name(host->pdev), activated); + + new_state = HST_PROBE_FINISHED; + reschedule = 1; + break; + } + + case HST_PROBE_FINISHED: + up(&host->probe_sem); + break; + + case HST_ERROR: + /* FIXME: TODO */ + break; + + default: + /* should never occur */ + printk(KERN_ERR PFX "BUG: unknown state %d\n", state); + assert(0); + break; + } + + if (new_state != HST_INVALID) { + spin_lock_irqsave(&host->lock, flags); + host->state = new_state; + spin_unlock_irqrestore(&host->lock, flags); + } + if (reschedule) + schedule_work(&host->fsm_task); +} + +static int carm_init_wait(void *mmio, u32 bits, unsigned int test_bit) +{ + unsigned int i; + + for (i = 0; i < 50000; i++) { + u32 tmp = readl(mmio + CARM_LMUC); + udelay(100); + + if (test_bit) { + if ((tmp & bits) == bits) + return 0; + } else { + if ((tmp & bits) == 0) + return 0; + } + + cond_resched(); + } + + printk(KERN_ERR PFX "carm_init_wait timeout, bits == 0x%x, test_bit == %s\n", + bits, test_bit ? "yes" : "no"); + return -EBUSY; +} + +static void carm_init_responses(struct carm_host *host) +{ + void *mmio = host->mmio; + unsigned int i; + struct carm_response *resp = (struct carm_response *) host->shm; + + for (i = 0; i < RMSG_Q_LEN; i++) + resp[i].status = 0xffffffff; + + writel(0, mmio + CARM_RESP_IDX); +} + +static int carm_init_host(struct carm_host *host) +{ + void *mmio = host->mmio; + u32 tmp; + u8 tmp8; + int rc; + + DPRINTK("ENTER\n"); + + writel(0, mmio + CARM_INT_MASK); + + tmp8 = readb(mmio + CARM_INITC); + if (tmp8 & 0x01) { + tmp8 &= ~0x01; + writeb(tmp8, CARM_INITC); + readb(mmio + CARM_INITC); /* flush */ + + DPRINTK("snooze...\n"); + msleep(5000); + } + + tmp = readl(mmio + CARM_HMUC); + if (tmp & CARM_CME) { + DPRINTK("CME bit present, waiting\n"); + rc = carm_init_wait(mmio, CARM_CME, 1); + if (rc) { + DPRINTK("EXIT, carm_init_wait 1 failed\n"); + return rc; + } + } + if (tmp & CARM_RME) { + DPRINTK("RME bit present, waiting\n"); + rc = carm_init_wait(mmio, CARM_RME, 1); + if (rc) { + DPRINTK("EXIT, carm_init_wait 2 failed\n"); + return rc; + } + } + + tmp &= ~(CARM_RME | CARM_CME); + writel(tmp, mmio + CARM_HMUC); + readl(mmio + CARM_HMUC); /* flush */ + + rc = carm_init_wait(mmio, CARM_RME | CARM_CME, 0); + if (rc) { + DPRINTK("EXIT, carm_init_wait 3 failed\n"); + return rc; + } + + carm_init_buckets(mmio); + + writel(host->shm_dma & 0xffffffff, mmio + RBUF_ADDR_LO); + writel((host->shm_dma >> 16) >> 16, mmio + RBUF_ADDR_HI); + writel(RBUF_LEN, mmio + RBUF_BYTE_SZ); + + tmp = readl(mmio + CARM_HMUC); + tmp |= (CARM_RME | CARM_CME | CARM_WZBC); + writel(tmp, mmio + CARM_HMUC); + readl(mmio + CARM_HMUC); /* flush */ + + rc = carm_init_wait(mmio, CARM_RME | CARM_CME, 1); + if (rc) { + DPRINTK("EXIT, carm_init_wait 4 failed\n"); + return rc; + } + + writel(0, mmio + CARM_HMPHA); + writel(INT_DEF_MASK, mmio + CARM_INT_MASK); + + carm_init_responses(host); + + /* start initialization, probing state machine */ + spin_lock_irq(&host->lock); + assert(host->state == HST_INVALID); + host->state = HST_PROBE_START; + spin_unlock_irq(&host->lock); + schedule_work(&host->fsm_task); + + DPRINTK("EXIT\n"); + return 0; +} + +static int carm_init_disks(struct carm_host *host) +{ + unsigned int i; + int rc = 0; + + for (i = 0; i < CARM_MAX_PORTS; i++) { + struct gendisk *disk; + request_queue_t *q; + struct carm_port *port; + + port = &host->port[i]; + port->host = host; + port->port_no = i; + + disk = alloc_disk(CARM_MINORS_PER_MAJOR); + if (!disk) { + rc = -ENOMEM; + break; + } + + port->disk = disk; + sprintf(disk->disk_name, DRV_NAME "%u_%u", host->id, i); + sprintf(disk->devfs_name, DRV_NAME "/%u_%u", host->id, i); + disk->major = host->major; + disk->first_minor = i * CARM_MINORS_PER_MAJOR; + disk->fops = &carm_bd_ops; + disk->private_data = port; + + q = blk_init_queue(carm_rq_fn, &host->lock); + if (!q) { + rc = -ENOMEM; + break; + } + disk->queue = q; + blk_queue_max_hw_segments(q, CARM_MAX_REQ_SG); + blk_queue_max_phys_segments(q, CARM_MAX_REQ_SG); + blk_queue_segment_boundary(q, CARM_SG_BOUNDARY); + + q->queuedata = port; + } + + return rc; +} + +static void carm_free_disks(struct carm_host *host) +{ + unsigned int i; + + for (i = 0; i < CARM_MAX_PORTS; i++) { + struct gendisk *disk = host->port[i].disk; + if (disk) { + request_queue_t *q = disk->queue; + + if (disk->flags & GENHD_FL_UP) + del_gendisk(disk); + if (q) + blk_cleanup_queue(q); + put_disk(disk); + } + } +} + +static int carm_init_shm(struct carm_host *host) +{ + host->shm = pci_alloc_consistent(host->pdev, CARM_SHM_SIZE, + &host->shm_dma); + if (!host->shm) + return -ENOMEM; + + host->msg_base = host->shm + RBUF_LEN; + host->msg_dma = host->shm_dma + RBUF_LEN; + + memset(host->shm, 0xff, RBUF_LEN); + memset(host->msg_base, 0, PDC_SHM_SIZE - RBUF_LEN); + + return 0; +} + +static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) +{ + static unsigned int printed_version; + struct carm_host *host; + unsigned int pci_dac; + int rc; + request_queue_t *q; + unsigned int i; + + if (!printed_version++) + printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); + + rc = pci_enable_device(pdev); + if (rc) + return rc; + + rc = pci_request_regions(pdev, DRV_NAME); + if (rc) + goto err_out; + +#if IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */ + rc = pci_set_dma_mask(pdev, 0xffffffffffffffffULL); + if (!rc) { + rc = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL); + if (rc) { + printk(KERN_ERR DRV_NAME "(%s): consistent DMA mask failure\n", + pci_name(pdev)); + goto err_out_regions; + } + pci_dac = 1; + } else { +#endif + rc = pci_set_dma_mask(pdev, 0xffffffffULL); + if (rc) { + printk(KERN_ERR DRV_NAME "(%s): DMA mask failure\n", + pci_name(pdev)); + goto err_out_regions; + } + pci_dac = 0; +#if IF_64BIT_DMA_IS_POSSIBLE /* grrrr... */ + } +#endif + + host = kmalloc(sizeof(*host), GFP_KERNEL); + if (!host) { + printk(KERN_ERR DRV_NAME "(%s): memory alloc failure\n", + pci_name(pdev)); + rc = -ENOMEM; + goto err_out_regions; + } + + memset(host, 0, sizeof(*host)); + host->pdev = pdev; + host->flags = pci_dac ? FL_DAC : 0; + spin_lock_init(&host->lock); + INIT_WORK(&host->fsm_task, carm_fsm_task, host); + init_MUTEX_LOCKED(&host->probe_sem); + + for (i = 0; i < ARRAY_SIZE(host->req); i++) + host->req[i].tag = i; + + host->mmio = ioremap(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); + if (!host->mmio) { + printk(KERN_ERR DRV_NAME "(%s): MMIO alloc failure\n", + pci_name(pdev)); + rc = -ENOMEM; + goto err_out_kfree; + } + + rc = carm_init_shm(host); + if (rc) { + printk(KERN_ERR DRV_NAME "(%s): DMA SHM alloc failure\n", + pci_name(pdev)); + goto err_out_iounmap; + } + + q = blk_init_queue(carm_oob_rq_fn, &host->lock); + if (!q) { + printk(KERN_ERR DRV_NAME "(%s): OOB queue alloc failure\n", + pci_name(pdev)); + rc = -ENOMEM; + goto err_out_pci_free; + } + host->oob_q = q; + q->queuedata = host; + + /* + * Figure out which major to use: 160, 161, or dynamic + */ + if (!test_and_set_bit(0, &carm_major_alloc)) + host->major = 160; + else if (!test_and_set_bit(1, &carm_major_alloc)) + host->major = 161; + else + host->flags |= FL_DYN_MAJOR; + + host->id = carm_host_id; + sprintf(host->name, DRV_NAME "%d", carm_host_id); + + rc = register_blkdev(host->major, host->name); + if (rc < 0) + goto err_out_free_majors; + if (host->flags & FL_DYN_MAJOR) + host->major = rc; + + devfs_mk_dir(DRV_NAME); + + rc = carm_init_disks(host); + if (rc) + goto err_out_blkdev_disks; + + pci_set_master(pdev); + + rc = request_irq(pdev->irq, carm_interrupt, SA_SHIRQ, DRV_NAME, host); + if (rc) { + printk(KERN_ERR DRV_NAME "(%s): irq alloc failure\n", + pci_name(pdev)); + goto err_out_blkdev_disks; + } + + rc = carm_init_host(host); + if (rc) + goto err_out_free_irq; + + DPRINTK("waiting for probe_sem\n"); + down(&host->probe_sem); + + printk(KERN_INFO "%s: pci %s, ports %d, io %lx, irq %u, major %d\n", + host->name, pci_name(pdev), (int) CARM_MAX_PORTS, + pci_resource_start(pdev, 0), pdev->irq, host->major); + + carm_host_id++; + pci_set_drvdata(pdev, host); + return 0; + +err_out_free_irq: + free_irq(pdev->irq, host); +err_out_blkdev_disks: + carm_free_disks(host); + unregister_blkdev(host->major, host->name); +err_out_free_majors: + if (host->major == 160) + clear_bit(0, &carm_major_alloc); + else if (host->major == 161) + clear_bit(1, &carm_major_alloc); + blk_cleanup_queue(host->oob_q); +err_out_pci_free: + pci_free_consistent(pdev, CARM_SHM_SIZE, host->shm, host->shm_dma); +err_out_iounmap: + iounmap(host->mmio); +err_out_kfree: + kfree(host); +err_out_regions: + pci_release_regions(pdev); +err_out: + pci_disable_device(pdev); + return rc; +} + +static void carm_remove_one (struct pci_dev *pdev) +{ + struct carm_host *host = pci_get_drvdata(pdev); + + if (!host) { + printk(KERN_ERR PFX "BUG: no host data for PCI(%s)\n", + pci_name(pdev)); + return; + } + + free_irq(pdev->irq, host); + carm_free_disks(host); + devfs_remove(DRV_NAME); + unregister_blkdev(host->major, host->name); + if (host->major == 160) + clear_bit(0, &carm_major_alloc); + else if (host->major == 161) + clear_bit(1, &carm_major_alloc); + blk_cleanup_queue(host->oob_q); + pci_free_consistent(pdev, CARM_SHM_SIZE, host->shm, host->shm_dma); + iounmap(host->mmio); + kfree(host); + pci_release_regions(pdev); + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); +} + +static int __init carm_init(void) +{ + return pci_module_init(&carm_driver); +} + +static void __exit carm_exit(void) +{ + pci_unregister_driver(&carm_driver); +} + +module_init(carm_init); +module_exit(carm_exit); + + diff -Nru a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c --- a/drivers/cdrom/cdrom.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/cdrom/cdrom.c 2004-06-23 19:04:25 -07:00 @@ -508,6 +508,8 @@ unsigned char buffer[16]; int ret; + *write = 0; + init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); cgc.cmd[0] = GPCMD_GET_CONFIGURATION; @@ -521,8 +523,10 @@ mfd = (struct mrw_feature_desc *)&buffer[sizeof(struct feature_header)]; *write = mfd->write; - if ((ret = cdrom_mrw_probe_pc(cdi))) + if ((ret = cdrom_mrw_probe_pc(cdi))) { + *write = 0; return ret; + } return 0; } @@ -822,8 +826,30 @@ */ static int cdrom_open_write(struct cdrom_device_info *cdi) { + int mrw, mrw_write, ram_write; int ret = 1; + mrw = 0; + if (!cdrom_is_mrw(cdi, &mrw_write)) + mrw = 1; + + (void) cdrom_is_random_writable(cdi, &ram_write); + + if (mrw) + cdi->mask &= ~CDC_MRW; + else + cdi->mask |= CDC_MRW; + + if (mrw_write) + cdi->mask &= ~CDC_MRW_W; + else + cdi->mask |= CDC_MRW_W; + + if (ram_write) + cdi->mask &= ~CDC_RAM; + else + cdi->mask |= CDC_RAM; + if (CDROM_CAN(CDC_MRW_W)) ret = cdrom_mrw_open_write(cdi); else if (CDROM_CAN(CDC_DVD_RAM)) @@ -866,6 +892,9 @@ if ((fp->f_flags & O_NONBLOCK) && (cdi->options & CDO_USE_FFLAGS)) { ret = cdi->ops->open(cdi, 1); } else { + ret = open_for_data(cdi); + if (ret) + goto err; if (fp->f_mode & FMODE_WRITE) { ret = -EROFS; if (!CDROM_CAN(CDC_RAM)) @@ -873,7 +902,6 @@ if (cdrom_open_write(cdi)) goto err; } - ret = open_for_data(cdi); } if (ret) diff -Nru a/drivers/cdrom/isp16.c b/drivers/cdrom/isp16.c --- a/drivers/cdrom/isp16.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/cdrom/isp16.c 2004-06-23 19:04:28 -07:00 @@ -16,6 +16,10 @@ * module_init & module_exit. * Torben Mathiasen * + * 19 June 2004 -- check_region() converted to request_region() + * and return statement cleanups. + * Jesper Juhl + * * Detect cdrom interface on ISP16 sound card. * Configure cdrom interface. * @@ -118,17 +122,17 @@ if (!strcmp(isp16_cdrom_type, "noisp16")) { printk("ISP16: no cdrom interface configured.\n"); - return (0); + return 0; } - if (check_region(ISP16_IO_BASE, ISP16_IO_SIZE)) { + if (!request_region(ISP16_IO_BASE, ISP16_IO_SIZE, "isp16")) { printk("ISP16: i/o ports already in use.\n"); - return (-EIO); + goto out; } if ((isp16_type = isp16_detect()) < 0) { printk("ISP16: no cdrom interface found.\n"); - return (-EIO); + goto cleanup_out; } printk(KERN_INFO @@ -148,27 +152,32 @@ else { printk("ISP16: %s not supported by cdrom interface.\n", isp16_cdrom_type); - return (-EIO); + goto cleanup_out; } if (isp16_cdi_config(isp16_cdrom_base, expected_drive, isp16_cdrom_irq, isp16_cdrom_dma) < 0) { printk ("ISP16: cdrom interface has not been properly configured.\n"); - return (-EIO); + goto cleanup_out; } printk(KERN_INFO "ISP16: cdrom interface set up with io base 0x%03X, irq %d, dma %d," " type %s.\n", isp16_cdrom_base, isp16_cdrom_irq, isp16_cdrom_dma, isp16_cdrom_type); - return (0); + return 0; + +cleanup_out: + release_region(ISP16_IO_BASE, ISP16_IO_SIZE); +out: + return -EIO; } static short __init isp16_detect(void) { if (isp16_c929__detect() >= 0) - return (2); + return 2; else return (isp16_c928__detect()); } @@ -206,7 +215,7 @@ ISP16_OUT(ISP16_C928__ENABLE_PORT, enable_cdrom); } else { /* bits are not the same */ ISP16_OUT(ISP16_CTRL_PORT, ctrl); - return (i); /* -> not detected: possibly incorrect conclusion */ + return i; /* -> not detected: possibly incorrect conclusion */ } } else if (enable_cdrom == 0x20) i = 0; @@ -215,7 +224,7 @@ ISP16_OUT(ISP16_CTRL_PORT, ctrl); - return (i); + return i; } static short __init isp16_c929__detect(void) @@ -236,12 +245,12 @@ tmp = ISP16_IN(ISP16_CTRL_PORT); if (tmp != 2) /* isp16 with 82C929 not detected */ - return (-1); + return -1; /* restore ctrl port value */ ISP16_OUT(ISP16_CTRL_PORT, ctrl); - return (2); + return 2; } static short __init @@ -272,7 +281,7 @@ printk ("ISP16: base address 0x%03X not supported by cdrom interface.\n", base); - return (-1); + return -1; } switch (irq) { case 0: @@ -303,7 +312,7 @@ default: printk("ISP16: irq %d not supported by cdrom interface.\n", irq); - return (-1); + return -1; } switch (dma) { case 0: @@ -312,7 +321,7 @@ case 1: printk("ISP16: dma 1 cannot be used by cdrom interface," " due to conflict with the sound card.\n"); - return (-1); + return -1; break; case 3: dma_code = ISP16_DMA_3; @@ -329,7 +338,7 @@ default: printk("ISP16: dma %d not supported by cdrom interface.\n", dma); - return (-1); + return -1; } if (drive_type != ISP16_SONY && drive_type != ISP16_PANASONIC0 && @@ -339,7 +348,7 @@ printk ("ISP16: drive type (code 0x%02X) not supported by cdrom" " interface.\n", drive_type); - return (-1); + return -1; } /* set type of interface */ @@ -354,7 +363,7 @@ i = ISP16_IN(ISP16_IO_SET_PORT) & ISP16_IO_SET_MASK; /* keep some bits */ ISP16_OUT(ISP16_IO_SET_PORT, i | base_code | irq_code | dma_code); - return (0); + return 0; } void __exit isp16_exit(void) diff -Nru a/drivers/char/Kconfig b/drivers/char/Kconfig --- a/drivers/char/Kconfig 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/Kconfig 2004-06-23 19:04:25 -07:00 @@ -586,17 +586,6 @@ console. This driver allows each pSeries partition to have a console which is accessed via the HMC. -config PC9800_OLDLP - tristate "NEC PC-9800 old-style printer port support" - depends on X86_PC9800 && !PARPORT - ---help--- - If you intend to attach a printer to the parallel port of NEC PC-9801 - /PC-9821 with OLD compatibility mode, Say Y. - -config PC9800_OLDLP_CONSOLE - bool "Support for console on line printer" - depends on PC9800_OLDLP - config QIC02_TAPE tristate "QIC-02 tape support" help @@ -740,7 +729,7 @@ config RTC tristate "Enhanced Real Time Clock Support" - depends on !PPC32 && !PARISC && !IA64 && !X86_PC9800 && !M68K + depends on !PPC32 && !PARISC && !IA64 && !M68K ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you @@ -764,6 +753,28 @@ To compile this driver as a module, choose M here: the module will be called rtc. +config SGI_DS1286 + tristate "SGI DS1286 RTC support" + depends on SGI_IP22 + help + If you say Y here and create a character special file /dev/rtc with + major number 10 and minor number 135 using mknod ("man mknod"), you + will get access to the real time clock built into your computer. + Every SGI has such a clock built in. It reports status information + via the file /proc/rtc and its behaviour is set by various ioctls on + /dev/rtc. + +config SGI_IP27_RTC + bool "SGI M48T35 RTC support" + depends on SGI_IP27 + help + If you say Y here and create a character special file /dev/rtc with + major number 10 and minor number 135 using mknod ("man mknod"), you + will get access to the real time clock built into your computer. + Every SGI has such a clock built in. It reports status information + via the file /proc/rtc and its behaviour is set by various ioctls on + /dev/rtc. + config GEN_RTC tristate "Generic /dev/rtc emulation" depends on RTC!=y && !IA64 @@ -793,14 +804,12 @@ bool "EFI Real Time Clock Services" depends on IA64 -config RTC98 - tristate "NEC PC-9800 Real Time Clock Support" - depends on X86_PC9800 - default y - ---help--- - If you say Y here and create a character special file /dev/rtc with - major number 10 and minor number 135 using mknod ("man mknod"), you - will get access to the real time clock (or hardware clock) built +config COBALT_LCD + bool "Support for Cobalt LCD" + depends on MIPS_COBALT + help + This option enables support for the LCD display and buttons found + on Cobalt systems through a misc device. config H8 bool "Tadpole ANA H8 Support (OBSOLETE)" @@ -956,6 +965,33 @@ The raw driver is deprecated and may be removed from 2.7 kernels. Applications should simply open the device (eg /dev/hda1) with the O_DIRECT flag. + +config HPET + bool "HPET - High Precision Event Timer" if (X86 || IA64) + default n + depends on ACPI + help + If you say Y here, you will have a device named "/dev/hpet/XX" for + each timer supported by the HPET. The timers are + non-periodioc and/or periodic. + +config HPET_RTC_IRQ + bool "HPET Control RTC IRQ" if !HPET_EMULATE_RTC + default n + depends on HPET + help + If you say Y here, you will disable RTC_IRQ in drivers/char/rtc.c. It + is assumed the platform called hpet_alloc with the RTC IRQ values for + the HPET timers. + +config HPET_NOMMAP + bool "HPET - Control mmap capability." + default n + depends on HPET + help + If you say Y here, then the mmap interface for the HPET driver returns ENOSYS. + Some hardware implementations might not want all the memory in the page the + HPET control registers reside to be exposed. config MAX_RAW_DEVS int "Maximum number of RAW devices to support (1-8192)" diff -Nru a/drivers/char/Makefile b/drivers/char/Makefile --- a/drivers/char/Makefile 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/Makefile 2004-06-23 19:04:28 -07:00 @@ -47,15 +47,17 @@ obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_TIPAR) += tipar.o -obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o obj-$(CONFIG_DTLK) += dtlk.o obj-$(CONFIG_R3964) += n_r3964.o obj-$(CONFIG_APPLICOM) += applicom.o obj-$(CONFIG_SONYPI) += sonypi.o obj-$(CONFIG_RTC) += rtc.o +obj-$(CONFIG_HPET) += hpet.o obj-$(CONFIG_GEN_RTC) += genrtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o +obj-$(CONFIG_SGI_DS1286) += ds1286.o +obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o ifeq ($(CONFIG_GENERIC_NVRAM),y) obj-$(CONFIG_NVRAM) += generic_nvram.o else @@ -67,6 +69,7 @@ obj-$(CONFIG_HW_RANDOM) += hw_random.o obj-$(CONFIG_QIC02_TAPE) += tpqic02.o obj-$(CONFIG_FTAPE) += ftape/ +obj-$(CONFIG_COBALT_LCD) += lcd.o obj-$(CONFIG_H8) += h8.o obj-$(CONFIG_PPDEV) += ppdev.o obj-$(CONFIG_NWBUTTON) += nwbutton.o diff -Nru a/drivers/char/applicom.c b/drivers/char/applicom.c --- a/drivers/char/applicom.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/applicom.c 2004-06-23 19:04:28 -07:00 @@ -105,8 +105,8 @@ static unsigned int ReadErrorCount; /* number of read error */ static unsigned int DeviceErrorCount; /* number of device error */ -static ssize_t ac_read (struct file *, char *, size_t, loff_t *); -static ssize_t ac_write (struct file *, const char *, size_t, loff_t *); +static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *); +static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *); static int ac_ioctl(struct inode *, struct file *, unsigned int, unsigned long); static irqreturn_t ac_interrupt(int, void *, struct pt_regs *); @@ -343,7 +343,7 @@ __initcall(applicom_init); #endif -static ssize_t ac_write(struct file *file, const char *buf, size_t count, loff_t * ppos) +static ssize_t ac_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos) { unsigned int NumCard; /* Board number 1 -> 8 */ unsigned int IndexCard; /* Index board number 0 -> 7 */ @@ -467,7 +467,7 @@ return 0; } -static int do_ac_read(int IndexCard, char *buf, +static int do_ac_read(int IndexCard, char __user *buf, struct st_ram_io *st_loc, struct mailbox *mailbox) { unsigned long from = (unsigned long)apbs[IndexCard].RamIO + RAM_TO_PC; @@ -521,7 +521,7 @@ return (sizeof(struct st_ram_io) + sizeof(struct mailbox)); } -static ssize_t ac_read (struct file *filp, char *buf, size_t count, loff_t *ptr) +static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_t *ptr) { unsigned long flags; unsigned int i; @@ -689,6 +689,7 @@ int ret = 0; volatile unsigned char byte_reset_it; struct st_ram_io *adgl; + void __user *argp = (void __user *)arg; /* In general, the device is only openable by root anyway, so we're not particularly concerned that bogus ioctls can flood the console. */ @@ -697,7 +698,7 @@ if (!adgl) return -ENOMEM; - if (copy_from_user(adgl, (void *)arg,sizeof(struct st_ram_io))) { + if (copy_from_user(adgl, argp, sizeof(struct st_ram_io))) { kfree(adgl); return -EFAULT; } @@ -721,7 +722,7 @@ pmem = apbs[IndexCard].RamIO; for (i = 0; i < sizeof(struct st_ram_io); i++) ((unsigned char *)adgl)[i]=readb(pmem++); - if (copy_to_user((void *)arg, adgl, sizeof(struct st_ram_io))) + if (copy_to_user(argp, adgl, sizeof(struct st_ram_io))) ret = -EFAULT; break; case 1: @@ -742,7 +743,7 @@ (readb(apbs[IndexCard].RamIO + SERIAL_NUMBER + 1) << 8) + (readb(apbs[IndexCard].RamIO + SERIAL_NUMBER + 2) ); - if (copy_to_user((void *)arg, adgl, sizeof(struct st_ram_io))) + if (copy_to_user(argp, adgl, sizeof(struct st_ram_io))) ret = -EFAULT; break; case 2: @@ -768,7 +769,7 @@ pmem = apbs[IndexCard].RamIO + TIC_OWNER_TO_PC; adgl->tic_owner_to_pc = readb(pmem++); adgl->numcard_owner_to_pc = readb(pmem); - if (copy_to_user((void *)arg, adgl,sizeof(struct st_ram_io))) + if (copy_to_user(argp, adgl,sizeof(struct st_ram_io))) ret = -EFAULT; break; case 5: diff -Nru a/drivers/char/cyclades.c b/drivers/char/cyclades.c --- a/drivers/char/cyclades.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/cyclades.c 2004-06-23 19:04:26 -07:00 @@ -676,8 +676,6 @@ #include #include -#define cy_put_user put_user - static void cy_throttle (struct tty_struct *tty); static void cy_send_xchar (struct tty_struct *tty, char ch); @@ -3536,7 +3534,7 @@ static int get_serial_info(struct cyclades_port * info, - struct serial_struct * retinfo) + struct serial_struct __user * retinfo) { struct serial_struct tmp; struct cyclades_card *cinfo = &cy_card[info->card]; @@ -3559,7 +3557,7 @@ static int set_serial_info(struct cyclades_port * info, - struct serial_struct * new_info) + struct serial_struct __user * new_info) { struct serial_struct new_serial; struct cyclades_port old_info; @@ -3613,7 +3611,7 @@ * transmit holding register is empty. This functionality * allows an RS485 driver to be written in user space. */ -static int get_lsr_info(struct cyclades_port *info, unsigned int *value) +static int get_lsr_info(struct cyclades_port *info, unsigned int __user *value) { int card, chip, channel, index; unsigned char status; @@ -3638,7 +3636,7 @@ /* Not supported yet */ return -EINVAL; } - return cy_put_user(result, (unsigned long *) value); + return put_user(result, (unsigned long __user *) value); } static int @@ -3916,7 +3914,7 @@ } /* cy_break */ static int -get_mon_info(struct cyclades_port * info, struct cyclades_monitor * mon) +get_mon_info(struct cyclades_port * info, struct cyclades_monitor __user * mon) { if(copy_to_user(mon, &info->mon, sizeof(struct cyclades_monitor))) @@ -3961,7 +3959,7 @@ static int -get_threshold(struct cyclades_port * info, unsigned long *value) +get_threshold(struct cyclades_port * info, unsigned long __user *value) { unsigned char *base_addr; int card,channel,chip,index; @@ -3978,7 +3976,7 @@ + (cy_chip_offset[chip]<default_threshold,value); + return put_user(info->default_threshold,value); }/* get_default_threshold */ @@ -4029,7 +4027,7 @@ static int -get_timeout(struct cyclades_port * info, unsigned long *value) +get_timeout(struct cyclades_port * info, unsigned long __user *value) { unsigned char *base_addr; int card,channel,chip,index; @@ -4046,7 +4044,7 @@ + (cy_chip_offset[chip]<default_timeout,value); + return put_user(info->default_timeout,value); }/* get_default_timeout */ /* @@ -4079,9 +4077,10 @@ { struct cyclades_port * info = (struct cyclades_port *)tty->driver_data; struct cyclades_icount cprev, cnow; /* kernel counter temps */ - struct serial_icounter_struct *p_cuser; /* user space */ + struct serial_icounter_struct __user *p_cuser; /* user space */ int ret_val = 0; unsigned long flags; + void __user *argp = (void __user *)arg; if (serial_paranoia_check(info, tty->name, "cy_ioctl")) return -ENODEV; @@ -4093,31 +4092,31 @@ switch (cmd) { case CYGETMON: - ret_val = get_mon_info(info, (struct cyclades_monitor *)arg); + ret_val = get_mon_info(info, argp); break; case CYGETTHRESH: - ret_val = get_threshold(info, (unsigned long *)arg); + ret_val = get_threshold(info, argp); break; case CYSETTHRESH: - ret_val = set_threshold(info, (unsigned long)arg); + ret_val = set_threshold(info, arg); break; case CYGETDEFTHRESH: - ret_val = get_default_threshold(info, (unsigned long *)arg); + ret_val = get_default_threshold(info, argp); break; case CYSETDEFTHRESH: - ret_val = set_default_threshold(info, (unsigned long)arg); + ret_val = set_default_threshold(info, arg); break; case CYGETTIMEOUT: - ret_val = get_timeout(info, (unsigned long *)arg); + ret_val = get_timeout(info, argp); break; case CYSETTIMEOUT: - ret_val = set_timeout(info, (unsigned long)arg); + ret_val = set_timeout(info, arg); break; case CYGETDEFTIMEOUT: - ret_val = get_default_timeout(info, (unsigned long *)arg); + ret_val = get_default_timeout(info, argp); break; case CYSETDEFTIMEOUT: - ret_val = set_default_timeout(info, (unsigned long)arg); + ret_val = set_default_timeout(info, arg); break; case CYSETRFLOW: info->rflow = (int)arg; @@ -4134,7 +4133,7 @@ ret_val = info->rtsdtr_inv; break; case CYGETCARDINFO: - if (copy_to_user((void *)arg, (void *)&cy_card[info->card], + if (copy_to_user(argp, &cy_card[info->card], sizeof (struct cyclades_card))) { ret_val = -EFAULT; break; @@ -4161,13 +4160,13 @@ ret_val = info->closing_wait / (HZ/100); break; case TIOCGSERIAL: - ret_val = get_serial_info(info, (struct serial_struct *) arg); + ret_val = get_serial_info(info, argp); break; case TIOCSSERIAL: - ret_val = set_serial_info(info, (struct serial_struct *) arg); + ret_val = set_serial_info(info, argp); break; case TIOCSERGETLSR: /* Get line status register */ - ret_val = get_lsr_info(info, (unsigned int *) arg); + ret_val = get_lsr_info(info, argp); break; /* * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change @@ -4215,7 +4214,7 @@ CY_LOCK(info, flags); cnow = info->icount; CY_UNLOCK(info, flags); - p_cuser = (struct serial_icounter_struct *) arg; + p_cuser = argp; ret_val = put_user(cnow.cts, &p_cuser->cts); if (ret_val) return ret_val; ret_val = put_user(cnow.dsr, &p_cuser->dsr); diff -Nru a/drivers/char/drm/sis_mm.c b/drivers/char/drm/sis_mm.c --- a/drivers/char/drm/sis_mm.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/drm/sis_mm.c 2004-06-23 19:04:27 -07:00 @@ -113,7 +113,7 @@ DRM_COPY_TO_USER_IOCTL((drm_sis_mem_t *)data, fb, sizeof(fb)); - DRM_DEBUG("alloc fb, size = %d, offset = %ld\n", fb.size, req.offset); + DRM_DEBUG("alloc fb, size = %d, offset = %d\n", fb.size, req.offset); return retval; } @@ -130,7 +130,7 @@ if (!del_alloc_set(fb.context, VIDEO_TYPE, fb.free)) retval = DRM_ERR(EINVAL); - sis_free(fb.free); + sis_free((u32)fb.free); DRM_DEBUG("free fb, offset = %lu\n", fb.free); diff -Nru a/drivers/char/ds1286.c b/drivers/char/ds1286.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/char/ds1286.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,578 @@ +/* + * DS1286 Real Time Clock interface for Linux + * + * Copyright (C) 1998, 1999, 2000 Ralf Baechle + * + * Based on code written by Paul Gortmaker. + * + * This driver allows use of the real time clock (built into nearly all + * computers) from user space. It exports the /dev/rtc interface supporting + * various ioctl() and also the /proc/rtc pseudo-file for status + * information. + * + * The ioctls can be used to set the interrupt behaviour and generation rate + * from the RTC via IRQ 8. Then the /dev/rtc interface can be used to make + * use of these timer interrupts, be they interval or alarm based. + * + * The /dev/rtc interface will block on reads until an interrupt has been + * received. If a RTC interrupt has already happened, it will output an + * unsigned long and then block. The output value contains the interrupt + * status in the low byte and the number of interrupts since the last read + * in the remaining high bytes. The /dev/rtc interface can also be used with + * the select(2) call. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DS1286_VERSION "1.0" + +/* + * We sponge a minor off of the misc major. No need slurping + * up another valuable major dev number for this. If you add + * an ioctl, make sure you don't conflict with SPARC's RTC + * ioctls. + */ + +static DECLARE_WAIT_QUEUE_HEAD(ds1286_wait); + +static ssize_t ds1286_read(struct file *file, char *buf, + size_t count, loff_t *ppos); + +static int ds1286_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + +static unsigned int ds1286_poll(struct file *file, poll_table *wait); + +static void ds1286_get_alm_time (struct rtc_time *alm_tm); +static void ds1286_get_time(struct rtc_time *rtc_tm); +static int ds1286_set_time(struct rtc_time *rtc_tm); + +static inline unsigned char ds1286_is_updating(void); + +static spinlock_t ds1286_lock = SPIN_LOCK_UNLOCKED; + +static int ds1286_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data); + +/* + * Bits in rtc_status. (7 bits of room for future expansion) + */ + +#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */ +#define RTC_TIMER_ON 0x02 /* missed irq timer active */ + +static unsigned char ds1286_status; /* bitmapped status byte. */ + +static unsigned char days_in_mo[] = { + 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 +}; + +/* + * Now all the various file operations that we export. + */ + +static ssize_t ds1286_read(struct file *file, char *buf, + size_t count, loff_t *ppos) +{ + return -EIO; +} + +static int ds1286_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct rtc_time wtime; + + switch (cmd) { + case RTC_AIE_OFF: /* Mask alarm int. enab. bit */ + { + unsigned int flags; + unsigned char val; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + spin_lock_irqsave(&ds1286_lock, flags); + val = rtc_read(RTC_CMD); + val |= RTC_TDM; + rtc_write(val, RTC_CMD); + spin_unlock_irqrestore(&ds1286_lock, flags); + + return 0; + } + case RTC_AIE_ON: /* Allow alarm interrupts. */ + { + unsigned int flags; + unsigned char val; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + spin_lock_irqsave(&ds1286_lock, flags); + val = rtc_read(RTC_CMD); + val &= ~RTC_TDM; + rtc_write(val, RTC_CMD); + spin_unlock_irqrestore(&ds1286_lock, flags); + + return 0; + } + case RTC_WIE_OFF: /* Mask watchdog int. enab. bit */ + { + unsigned int flags; + unsigned char val; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + spin_lock_irqsave(&ds1286_lock, flags); + val = rtc_read(RTC_CMD); + val |= RTC_WAM; + rtc_write(val, RTC_CMD); + spin_unlock_irqrestore(&ds1286_lock, flags); + + return 0; + } + case RTC_WIE_ON: /* Allow watchdog interrupts. */ + { + unsigned int flags; + unsigned char val; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + spin_lock_irqsave(&ds1286_lock, flags); + val = rtc_read(RTC_CMD); + val &= ~RTC_WAM; + rtc_write(val, RTC_CMD); + spin_unlock_irqrestore(&ds1286_lock, flags); + + return 0; + } + case RTC_ALM_READ: /* Read the present alarm time */ + { + /* + * This returns a struct rtc_time. Reading >= 0xc0 + * means "don't care" or "match all". Only the tm_hour, + * tm_min, and tm_sec values are filled in. + */ + + memset(&wtime, 0, sizeof(wtime)); + ds1286_get_alm_time(&wtime); + break; + } + case RTC_ALM_SET: /* Store a time into the alarm */ + { + /* + * This expects a struct rtc_time. Writing 0xff means + * "don't care" or "match all". Only the tm_hour, + * tm_min and tm_sec are used. + */ + unsigned char hrs, min, sec; + struct rtc_time alm_tm; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + if (copy_from_user(&alm_tm, (struct rtc_time*)arg, + sizeof(struct rtc_time))) + return -EFAULT; + + hrs = alm_tm.tm_hour; + min = alm_tm.tm_min; + + if (hrs >= 24) + hrs = 0xff; + + if (min >= 60) + min = 0xff; + + BIN_TO_BCD(sec); + BIN_TO_BCD(min); + BIN_TO_BCD(hrs); + + spin_lock(&ds1286_lock); + rtc_write(hrs, RTC_HOURS_ALARM); + rtc_write(min, RTC_MINUTES_ALARM); + spin_unlock(&ds1286_lock); + + return 0; + } + case RTC_RD_TIME: /* Read the time/date from RTC */ + { + memset(&wtime, 0, sizeof(wtime)); + ds1286_get_time(&wtime); + break; + } + case RTC_SET_TIME: /* Set the RTC */ + { + struct rtc_time rtc_tm; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, + sizeof(struct rtc_time))) + return -EFAULT; + + return ds1286_set_time(&rtc_tm); + } + default: + return -EINVAL; + } + return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; +} + +/* + * We enforce only one user at a time here with the open/close. + * Also clear the previous interrupt data on an open, and clean + * up things on a close. + */ + +static int ds1286_open(struct inode *inode, struct file *file) +{ + spin_lock_irq(&ds1286_lock); + + if (ds1286_status & RTC_IS_OPEN) + goto out_busy; + + ds1286_status |= RTC_IS_OPEN; + + spin_unlock_irq(&ds1286_lock); + return 0; + +out_busy: + spin_lock_irq(&ds1286_lock); + return -EBUSY; +} + +static int ds1286_release(struct inode *inode, struct file *file) +{ + ds1286_status &= ~RTC_IS_OPEN; + + return 0; +} + +static unsigned int ds1286_poll(struct file *file, poll_table *wait) +{ + poll_wait(file, &ds1286_wait, wait); + + return 0; +} + +/* + * The various file operations we support. + */ + +static struct file_operations ds1286_fops = { + .llseek = no_llseek, + .read = ds1286_read, + .poll = ds1286_poll, + .ioctl = ds1286_ioctl, + .open = ds1286_open, + .release = ds1286_release, +}; + +static struct miscdevice ds1286_dev= +{ + .minor = RTC_MINOR, + .name = "rtc", + .fops = &ds1286_fops, +}; + +static int __init ds1286_init(void) +{ + int err; + + printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION); + + err = misc_register(&ds1286_dev); + if (err) + goto out; + + if (!create_proc_read_entry("driver/rtc", 0, 0, ds1286_read_proc, NULL)) { + err = -ENOMEM; + + goto out_deregister; + } + + return 0; + +out_deregister: + misc_deregister(&ds1286_dev); + +out: + return err; +} + +static void __exit ds1286_exit(void) +{ + remove_proc_entry("driver/rtc", NULL); + misc_deregister(&ds1286_dev); +} + +static char *days[] = { + "***", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" +}; + +/* + * Info exported via "/proc/rtc". + */ +static int ds1286_proc_output(char *buf) +{ + char *p, *s; + struct rtc_time tm; + unsigned char hundredth, month, cmd, amode; + + p = buf; + + ds1286_get_time(&tm); + hundredth = rtc_read(RTC_HUNDREDTH_SECOND); + BCD_TO_BIN(hundredth); + + p += sprintf(p, + "rtc_time\t: %02d:%02d:%02d.%02d\n" + "rtc_date\t: %04d-%02d-%02d\n", + tm.tm_hour, tm.tm_min, tm.tm_sec, hundredth, + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); + + /* + * We implicitly assume 24hr mode here. Alarm values >= 0xc0 will + * match any value for that particular field. Values that are + * greater than a valid time, but less than 0xc0 shouldn't appear. + */ + ds1286_get_alm_time(&tm); + p += sprintf(p, "alarm\t\t: %s ", days[tm.tm_wday]); + if (tm.tm_hour <= 24) + p += sprintf(p, "%02d:", tm.tm_hour); + else + p += sprintf(p, "**:"); + + if (tm.tm_min <= 59) + p += sprintf(p, "%02d\n", tm.tm_min); + else + p += sprintf(p, "**\n"); + + month = rtc_read(RTC_MONTH); + p += sprintf(p, + "oscillator\t: %s\n" + "square_wave\t: %s\n", + (month & RTC_EOSC) ? "disabled" : "enabled", + (month & RTC_ESQW) ? "disabled" : "enabled"); + + amode = ((rtc_read(RTC_MINUTES_ALARM) & 0x80) >> 5) | + ((rtc_read(RTC_HOURS_ALARM) & 0x80) >> 6) | + ((rtc_read(RTC_DAY_ALARM) & 0x80) >> 7); + if (amode == 7) s = "each minute"; + else if (amode == 3) s = "minutes match"; + else if (amode == 1) s = "hours and minutes match"; + else if (amode == 0) s = "days, hours and minutes match"; + else s = "invalid"; + p += sprintf(p, "alarm_mode\t: %s\n", s); + + cmd = rtc_read(RTC_CMD); + p += sprintf(p, + "alarm_enable\t: %s\n" + "wdog_alarm\t: %s\n" + "alarm_mask\t: %s\n" + "wdog_alarm_mask\t: %s\n" + "interrupt_mode\t: %s\n" + "INTB_mode\t: %s_active\n" + "interrupt_pins\t: %s\n", + (cmd & RTC_TDF) ? "yes" : "no", + (cmd & RTC_WAF) ? "yes" : "no", + (cmd & RTC_TDM) ? "disabled" : "enabled", + (cmd & RTC_WAM) ? "disabled" : "enabled", + (cmd & RTC_PU_LVL) ? "pulse" : "level", + (cmd & RTC_IBH_LO) ? "low" : "high", + (cmd & RTC_IPSW) ? "unswapped" : "swapped"); + + return p - buf; +} + +static int ds1286_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = ds1286_proc_output (page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) + len = count; + if (len<0) + len = 0; + + return len; +} + +/* + * Returns true if a clock update is in progress + */ +static inline unsigned char ds1286_is_updating(void) +{ + return rtc_read(RTC_CMD) & RTC_TE; +} + + +static void ds1286_get_time(struct rtc_time *rtc_tm) +{ + unsigned char save_control; + unsigned int flags; + unsigned long uip_watchdog = jiffies; + + /* + * read RTC once any update in progress is done. The update + * can take just over 2ms. We wait 10 to 20ms. There is no need to + * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. + * If you need to know *exactly* when a second has started, enable + * periodic update complete interrupts, (via ioctl) and then + * immediately read /dev/rtc which will block until you get the IRQ. + * Once the read clears, read the RTC time (again via ioctl). Easy. + */ + + if (ds1286_is_updating() != 0) + while (jiffies - uip_watchdog < 2*HZ/100) + barrier(); + + /* + * Only the values that we read from the RTC are set. We leave + * tm_wday, tm_yday and tm_isdst untouched. Even though the + * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated + * by the RTC when initially set to a non-zero value. + */ + spin_lock_irqsave(&ds1286_lock, flags); + save_control = rtc_read(RTC_CMD); + rtc_write((save_control|RTC_TE), RTC_CMD); + + rtc_tm->tm_sec = rtc_read(RTC_SECONDS); + rtc_tm->tm_min = rtc_read(RTC_MINUTES); + rtc_tm->tm_hour = rtc_read(RTC_HOURS) & 0x3f; + rtc_tm->tm_mday = rtc_read(RTC_DATE); + rtc_tm->tm_mon = rtc_read(RTC_MONTH) & 0x1f; + rtc_tm->tm_year = rtc_read(RTC_YEAR); + + rtc_write(save_control, RTC_CMD); + spin_unlock_irqrestore(&ds1286_lock, flags); + + BCD_TO_BIN(rtc_tm->tm_sec); + BCD_TO_BIN(rtc_tm->tm_min); + BCD_TO_BIN(rtc_tm->tm_hour); + BCD_TO_BIN(rtc_tm->tm_mday); + BCD_TO_BIN(rtc_tm->tm_mon); + BCD_TO_BIN(rtc_tm->tm_year); + + /* + * Account for differences between how the RTC uses the values + * and how they are defined in a struct rtc_time; + */ + if (rtc_tm->tm_year < 45) + rtc_tm->tm_year += 30; + if ((rtc_tm->tm_year += 40) < 70) + rtc_tm->tm_year += 100; + + rtc_tm->tm_mon--; +} + +static int ds1286_set_time(struct rtc_time *rtc_tm) +{ + unsigned char mon, day, hrs, min, sec, leap_yr; + unsigned char save_control; + unsigned int yrs, flags; + + + yrs = rtc_tm->tm_year + 1900; + mon = rtc_tm->tm_mon + 1; /* tm_mon starts at zero */ + day = rtc_tm->tm_mday; + hrs = rtc_tm->tm_hour; + min = rtc_tm->tm_min; + sec = rtc_tm->tm_sec; + + if (yrs < 1970) + return -EINVAL; + + leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400)); + + if ((mon > 12) || (day == 0)) + return -EINVAL; + + if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr))) + return -EINVAL; + + if ((hrs >= 24) || (min >= 60) || (sec >= 60)) + return -EINVAL; + + if ((yrs -= 1940) > 255) /* They are unsigned */ + return -EINVAL; + + if (yrs >= 100) + yrs -= 100; + + BIN_TO_BCD(sec); + BIN_TO_BCD(min); + BIN_TO_BCD(hrs); + BIN_TO_BCD(day); + BIN_TO_BCD(mon); + BIN_TO_BCD(yrs); + + spin_lock_irqsave(&ds1286_lock, flags); + save_control = rtc_read(RTC_CMD); + rtc_write((save_control|RTC_TE), RTC_CMD); + + rtc_write(yrs, RTC_YEAR); + rtc_write(mon, RTC_MONTH); + rtc_write(day, RTC_DATE); + rtc_write(hrs, RTC_HOURS); + rtc_write(min, RTC_MINUTES); + rtc_write(sec, RTC_SECONDS); + rtc_write(0, RTC_HUNDREDTH_SECOND); + + rtc_write(save_control, RTC_CMD); + spin_unlock_irqrestore(&ds1286_lock, flags); + + return 0; +} + +static void ds1286_get_alm_time(struct rtc_time *alm_tm) +{ + unsigned char cmd; + unsigned int flags; + + /* + * Only the values that we read from the RTC are set. That + * means only tm_wday, tm_hour, tm_min. + */ + spin_lock_irqsave(&ds1286_lock, flags); + alm_tm->tm_min = rtc_read(RTC_MINUTES_ALARM) & 0x7f; + alm_tm->tm_hour = rtc_read(RTC_HOURS_ALARM) & 0x1f; + alm_tm->tm_wday = rtc_read(RTC_DAY_ALARM) & 0x07; + cmd = rtc_read(RTC_CMD); + spin_unlock_irqrestore(&ds1286_lock, flags); + + BCD_TO_BIN(alm_tm->tm_min); + BCD_TO_BIN(alm_tm->tm_hour); + alm_tm->tm_sec = 0; +} + +module_init(ds1286_init); +module_exit(ds1286_exit); + +MODULE_AUTHOR("Ralf Baechle"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS_MISCDEV(RTC_MINOR); diff -Nru a/drivers/char/hpet.c b/drivers/char/hpet.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/char/hpet.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,1076 @@ +/* + * Intel & MS High Precision Event Timer Implementation. + * Contributors: + * Venki Pallipadi + * Bob Picco + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* + * The High Precision Event Timer driver. + * This driver is closely modelled after the rtc.c driver. + * http://www.intel.com/labs/platcomp/hpet/hpetspec.htm + */ +#define HPET_USER_FREQ (64) +#define HPET_DRIFT (500) + +static u32 hpet_ntimer, hpet_nhpet, hpet_max_freq = HPET_USER_FREQ; + +/* A lock for concurrent access by app and isr hpet activity. */ +static spinlock_t hpet_lock = SPIN_LOCK_UNLOCKED; +/* A lock for concurrent intermodule access to hpet and isr hpet activity. */ +static spinlock_t hpet_task_lock = SPIN_LOCK_UNLOCKED; + +struct hpet_dev { + struct hpets *hd_hpets; + struct hpet *hd_hpet; + struct hpet_timer *hd_timer; + unsigned long hd_ireqfreq; + unsigned long hd_irqdata; + wait_queue_head_t hd_waitqueue; + struct fasync_struct *hd_async_queue; + struct hpet_task *hd_task; + unsigned int hd_flags; + unsigned int hd_irq; + unsigned int hd_hdwirq; +}; + +struct hpets { + struct hpets *hp_next; + struct hpet *hp_hpet; + unsigned long hp_period; + unsigned long hp_delta; + unsigned int hp_ntimer; + unsigned int hp_which; + struct hpet_dev hp_dev[1]; +}; + +static struct hpets *hpets; + +#define HPET_OPEN 0x0001 +#define HPET_IE 0x0002 /* interrupt enabled */ +#define HPET_PERIODIC 0x0004 + +#if BITS_PER_LONG == 64 +#define write_counter(V, MC) writeq(V, MC) +#define read_counter(MC) readq(MC) +#else +#define write_counter(V, MC) writel(V, MC) +#define read_counter(MC) readl(MC) +#endif + +#ifndef readq +static unsigned long long __inline readq(void *addr) +{ + return readl(addr) | (((unsigned long long)readl(addr + 4)) << 32LL); +} +#endif + +#ifndef writeq +static void __inline writeq(unsigned long long v, void *addr) +{ + writel(v & 0xffffffff, addr); + writel(v >> 32, addr + 4); +} +#endif + +static irqreturn_t hpet_interrupt(int irq, void *data, struct pt_regs *regs) +{ + struct hpet_dev *devp; + unsigned long isr; + + devp = data; + + spin_lock(&hpet_lock); + devp->hd_irqdata++; + + /* + * For non-periodic timers, increment the accumulator. + * This has the effect of treating non-periodic like periodic. + */ + if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) { + unsigned long m, t; + + t = devp->hd_ireqfreq; + m = read_counter(&devp->hd_hpet->hpet_mc); + write_counter(t + m + devp->hd_hpets->hp_delta, + &devp->hd_timer->hpet_compare); + } + + isr = (1 << (devp - devp->hd_hpets->hp_dev)); + writeq(isr, &devp->hd_hpet->hpet_isr); + spin_unlock(&hpet_lock); + + spin_lock(&hpet_task_lock); + if (devp->hd_task) + devp->hd_task->ht_func(devp->hd_task->ht_data); + spin_unlock(&hpet_task_lock); + + wake_up_interruptible(&devp->hd_waitqueue); + + kill_fasync(&devp->hd_async_queue, SIGIO, POLL_IN); + + return IRQ_HANDLED; +} + +static int hpet_open(struct inode *inode, struct file *file) +{ + struct hpet_dev *devp; + struct hpets *hpetp; + int i; + + spin_lock_irq(&hpet_lock); + + for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) + for (i = 0; i < hpetp->hp_ntimer; i++) + if (hpetp->hp_dev[i].hd_flags & HPET_OPEN + || hpetp->hp_dev[i].hd_task) + continue; + else { + devp = &hpetp->hp_dev[i]; + break; + } + + if (!devp) { + spin_unlock_irq(&hpet_lock); + return -EBUSY; + } + + file->private_data = devp; + devp->hd_irqdata = 0; + devp->hd_flags |= HPET_OPEN; + spin_unlock_irq(&hpet_lock); + + return 0; +} + +static ssize_t +hpet_read(struct file *file, char *buf, size_t count, loff_t * ppos) +{ + DECLARE_WAITQUEUE(wait, current); + unsigned long data; + ssize_t retval; + struct hpet_dev *devp; + + devp = file->private_data; + if (!devp->hd_ireqfreq) + return -EIO; + + if (count < sizeof(unsigned long)) + return -EINVAL; + + add_wait_queue(&devp->hd_waitqueue, &wait); + + do { + __set_current_state(TASK_INTERRUPTIBLE); + + spin_lock_irq(&hpet_lock); + data = devp->hd_irqdata; + devp->hd_irqdata = 0; + spin_unlock_irq(&hpet_lock); + + if (data) + break; + else if (file->f_flags & O_NONBLOCK) { + retval = -EAGAIN; + goto out; + } else if (signal_pending(current)) { + retval = -ERESTARTSYS; + goto out; + } + + schedule(); + + } while (1); + + retval = put_user(data, (unsigned long *)buf); + if (!retval) + retval = sizeof(unsigned long); + out: + current->state = TASK_RUNNING; + remove_wait_queue(&devp->hd_waitqueue, &wait); + + return retval; +} + +static unsigned int hpet_poll(struct file *file, poll_table * wait) +{ + unsigned long v; + struct hpet_dev *devp; + + devp = file->private_data; + + if (!devp->hd_ireqfreq) + return 0; + + poll_wait(file, &devp->hd_waitqueue, wait); + + spin_lock_irq(&hpet_lock); + v = devp->hd_irqdata; + spin_unlock_irq(&hpet_lock); + + if (v != 0) + return POLLIN | POLLRDNORM; + + return 0; +} + +static int hpet_mmap(struct file *file, struct vm_area_struct *vma) +{ +#ifdef CONFIG_HPET_NOMMAP + return -ENOSYS; +#else + struct hpet_dev *devp; + unsigned long addr; + + if (((vma->vm_end - vma->vm_start) != PAGE_SIZE) || vma->vm_pgoff) + return -EINVAL; + + if (vma->vm_flags & VM_WRITE) + return -EPERM; + + devp = file->private_data; + addr = (unsigned long)devp->hd_hpet; + + if (addr & (PAGE_SIZE - 1)) + return -ENOSYS; + + vma->vm_flags |= VM_IO; + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + addr = __pa(addr); + + if (remap_page_range + (vma, vma->vm_start, addr, PAGE_SIZE, vma->vm_page_prot)) { + printk(KERN_ERR "remap_page_range failed in hpet.c\n"); + return -EAGAIN; + } + + return 0; +#endif +} + +static int hpet_fasync(int fd, struct file *file, int on) +{ + struct hpet_dev *devp; + + devp = file->private_data; + + if (fasync_helper(fd, file, on, &devp->hd_async_queue) >= 0) + return 0; + else + return -EIO; +} + +static int hpet_release(struct inode *inode, struct file *file) +{ + struct hpet_dev *devp; + struct hpet_timer *timer; + int irq = 0; + + devp = file->private_data; + timer = devp->hd_timer; + + spin_lock_irq(&hpet_lock); + + writeq((readq(&timer->hpet_config) & ~Tn_INT_ENB_CNF_MASK), + &timer->hpet_config); + + irq = devp->hd_irq; + devp->hd_irq = 0; + + devp->hd_ireqfreq = 0; + + if (devp->hd_flags & HPET_PERIODIC + && readq(&timer->hpet_config) & Tn_TYPE_CNF_MASK) { + unsigned long v; + + v = readq(&timer->hpet_config); + v ^= Tn_TYPE_CNF_MASK; + writeq(v, &timer->hpet_config); + } + + devp->hd_flags &= ~(HPET_OPEN | HPET_IE | HPET_PERIODIC); + spin_unlock_irq(&hpet_lock); + + if (irq) + free_irq(irq, devp); + + if (file->f_flags & FASYNC) + hpet_fasync(-1, file, 0); + + file->private_data = 0; + return 0; +} + +static int hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int); + +static int +hpet_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + struct hpet_dev *devp; + + devp = file->private_data; + return hpet_ioctl_common(devp, cmd, arg, 0); +} + +static int hpet_ioctl_ieon(struct hpet_dev *devp) +{ + struct hpet_timer *timer; + struct hpet *hpet; + struct hpets *hpetp; + int irq; + unsigned long g, v, t, m; + unsigned long flags, isr; + + timer = devp->hd_timer; + hpet = devp->hd_hpet; + hpetp = devp->hd_hpets; + + v = readq(&timer->hpet_config); + spin_lock_irq(&hpet_lock); + + if (devp->hd_flags & HPET_IE) { + spin_unlock_irq(&hpet_lock); + return -EBUSY; + } + + devp->hd_flags |= HPET_IE; + spin_unlock_irq(&hpet_lock); + + t = readq(&timer->hpet_config); + irq = devp->hd_hdwirq; + + if (irq) { + char name[7]; + + sprintf(name, "hpet%d", (int)(devp - hpetp->hp_dev)); + + if (request_irq + (irq, hpet_interrupt, SA_INTERRUPT, name, (void *)devp)) { + printk(KERN_ERR "hpet: IRQ %d is not free\n", irq); + irq = 0; + } + } + + if (irq == 0) { + spin_lock_irq(&hpet_lock); + devp->hd_flags ^= HPET_IE; + spin_unlock_irq(&hpet_lock); + return -EIO; + } + + devp->hd_irq = irq; + t = devp->hd_ireqfreq; + v = readq(&timer->hpet_config); + g = v | Tn_INT_ENB_CNF_MASK; + + if (devp->hd_flags & HPET_PERIODIC) { + write_counter(t, &timer->hpet_compare); + g |= Tn_TYPE_CNF_MASK; + v |= Tn_TYPE_CNF_MASK; + writeq(v, &timer->hpet_config); + v |= Tn_VAL_SET_CNF_MASK; + writeq(v, &timer->hpet_config); + local_irq_save(flags); + m = read_counter(&hpet->hpet_mc); + write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); + } else { + local_irq_save(flags); + m = read_counter(&hpet->hpet_mc); + write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); + } + + isr = (1 << (devp - hpets->hp_dev)); + writeq(isr, &hpet->hpet_isr); + writeq(g, &timer->hpet_config); + local_irq_restore(flags); + + return 0; +} + +static inline unsigned long hpet_time_div(unsigned long dis) +{ + unsigned long long m = 1000000000000000ULL; + + do_div(m, dis); + + return (unsigned long)m; +} + +static int +hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) +{ + struct hpet_timer *timer; + struct hpet *hpet; + struct hpets *hpetp; + int err; + unsigned long v; + + switch (cmd) { + case HPET_IE_OFF: + case HPET_INFO: + case HPET_EPI: + case HPET_DPI: + case HPET_IRQFREQ: + timer = devp->hd_timer; + hpet = devp->hd_hpet; + hpetp = devp->hd_hpets; + break; + case HPET_IE_ON: + return hpet_ioctl_ieon(devp); + default: + return -EINVAL; + } + + err = 0; + + switch (cmd) { + case HPET_IE_OFF: + if ((devp->hd_flags & HPET_IE) == 0) + break; + v = readq(&timer->hpet_config); + v &= ~Tn_INT_ENB_CNF_MASK; + writeq(v, &timer->hpet_config); + if (devp->hd_irq) { + free_irq(devp->hd_irq, devp); + devp->hd_irq = 0; + } + devp->hd_flags ^= HPET_IE; + break; + case HPET_INFO: + { + struct hpet_info info; + + info.hi_ireqfreq = hpet_time_div(hpetp->hp_period * + devp->hd_ireqfreq); + info.hi_flags = + readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK; + info.hi_hpet = devp->hd_hpets->hp_which; + info.hi_timer = devp - devp->hd_hpets->hp_dev; + if (copy_to_user((void *)arg, &info, sizeof(info))) + err = -EFAULT; + break; + } + case HPET_EPI: + v = readq(&timer->hpet_config); + if ((v & Tn_PER_INT_CAP_MASK) == 0) { + err = -ENXIO; + break; + } + devp->hd_flags |= HPET_PERIODIC; + break; + case HPET_DPI: + v = readq(&timer->hpet_config); + if ((v & Tn_PER_INT_CAP_MASK) == 0) { + err = -ENXIO; + break; + } + if (devp->hd_flags & HPET_PERIODIC && + readq(&timer->hpet_config) & Tn_TYPE_CNF_MASK) { + v = readq(&timer->hpet_config); + v ^= Tn_TYPE_CNF_MASK; + writeq(v, &timer->hpet_config); + } + devp->hd_flags &= ~HPET_PERIODIC; + break; + case HPET_IRQFREQ: + if (!kernel && (arg > hpet_max_freq) && + !capable(CAP_SYS_RESOURCE)) { + err = -EACCES; + break; + } + + if (arg & (arg - 1)) { + err = -EINVAL; + break; + } + + devp->hd_ireqfreq = hpet_time_div(hpetp->hp_period * arg); + } + + return err; +} + +static struct file_operations hpet_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = hpet_read, + .poll = hpet_poll, + .ioctl = hpet_ioctl, + .open = hpet_open, + .release = hpet_release, + .fasync = hpet_fasync, + .mmap = hpet_mmap, +}; + +EXPORT_SYMBOL(hpet_alloc); +EXPORT_SYMBOL(hpet_register); +EXPORT_SYMBOL(hpet_unregister); +EXPORT_SYMBOL(hpet_control); + +int hpet_register(struct hpet_task *tp, int periodic) +{ + unsigned int i; + u64 mask; + struct hpet_timer *timer; + struct hpet_dev *devp; + struct hpets *hpetp; + + switch (periodic) { + case 1: + mask = Tn_PER_INT_CAP_MASK; + break; + case 0: + mask = 0; + break; + default: + return -EINVAL; + } + + spin_lock_irq(&hpet_task_lock); + spin_lock(&hpet_lock); + + for (devp = 0, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) + for (timer = hpetp->hp_hpet->hpet_timers, i = 0; + i < hpetp->hp_ntimer; i++, timer++) { + if ((readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK) + != mask) + continue; + + devp = &hpetp->hp_dev[i]; + + if (devp->hd_flags & HPET_OPEN || devp->hd_task) { + devp = 0; + continue; + } + + tp->ht_opaque = devp; + devp->hd_task = tp; + break; + } + + spin_unlock(&hpet_lock); + spin_unlock_irq(&hpet_task_lock); + + if (tp->ht_opaque) + return 0; + else + return -EBUSY; +} + +static inline int hpet_tpcheck(struct hpet_task *tp) +{ + struct hpet_dev *devp; + struct hpets *hpetp; + + devp = tp->ht_opaque; + + if (!devp) + return -ENXIO; + + for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) + if (devp >= hpetp->hp_dev + && devp < (hpetp->hp_dev + hpetp->hp_ntimer) + && devp->hd_hpet == hpetp->hp_hpet) + return 0; + + return -ENXIO; +} + +int hpet_unregister(struct hpet_task *tp) +{ + struct hpet_dev *devp; + struct hpet_timer *timer; + int err; + + if ((err = hpet_tpcheck(tp))) + return err; + + spin_lock_irq(&hpet_task_lock); + spin_lock(&hpet_lock); + + devp = tp->ht_opaque; + if (devp->hd_task != tp) { + spin_unlock(&hpet_lock); + spin_unlock_irq(&hpet_task_lock); + return -ENXIO; + } + + timer = devp->hd_timer; + writeq((readq(&timer->hpet_config) & ~Tn_INT_ENB_CNF_MASK), + &timer->hpet_config); + devp->hd_flags &= ~(HPET_IE | HPET_PERIODIC); + devp->hd_task = 0; + spin_unlock(&hpet_lock); + spin_unlock_irq(&hpet_task_lock); + + return 0; +} + +int hpet_control(struct hpet_task *tp, unsigned int cmd, unsigned long arg) +{ + struct hpet_dev *devp; + int err; + + if ((err = hpet_tpcheck(tp))) + return err; + + spin_lock_irq(&hpet_lock); + devp = tp->ht_opaque; + if (devp->hd_task != tp) { + spin_unlock_irq(&hpet_lock); + return -ENXIO; + } + spin_unlock_irq(&hpet_lock); + return hpet_ioctl_common(devp, cmd, arg, 1); +} + +#ifdef CONFIG_TIME_INTERPOLATION + +static unsigned long hpet_offset, last_wall_hpet; +static long hpet_nsecs_per_cycle, hpet_cycles_per_sec; + +static unsigned long hpet_getoffset(void) +{ + return hpet_offset + (read_counter(&hpets->hp_hpet->hpet_mc) - + last_wall_hpet) * hpet_nsecs_per_cycle; +} + +static void hpet_update(long delta) +{ + unsigned long mc; + unsigned long offset; + + mc = read_counter(&hpets->hp_hpet->hpet_mc); + offset = hpet_offset + (mc - last_wall_hpet) * hpet_nsecs_per_cycle; + + if (delta < 0 || (unsigned long)delta < offset) + hpet_offset = offset - delta; + else + hpet_offset = 0; + last_wall_hpet = mc; +} + +static void hpet_reset(void) +{ + hpet_offset = 0; + last_wall_hpet = read_counter(&hpets->hp_hpet->hpet_mc); +} + +static struct time_interpolator hpet_interpolator = { + .get_offset = hpet_getoffset, + .update = hpet_update, + .reset = hpet_reset +}; + +#endif + +static ctl_table hpet_table[] = { + { + .ctl_name = 1, + .procname = "max-user-freq", + .data = &hpet_max_freq, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + {.ctl_name = 0} +}; + +static ctl_table hpet_root[] = { + { + .ctl_name = 1, + .procname = "hpet", + .maxlen = 0, + .mode = 0555, + .child = hpet_table, + }, + {.ctl_name = 0} +}; + +static ctl_table dev_root[] = { + { + .ctl_name = CTL_DEV, + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = hpet_root, + }, + {.ctl_name = 0} +}; + +static struct ctl_table_header *sysctl_header; + +static void *hpet_start(struct seq_file *s, loff_t * pos) +{ + struct hpets *hpetp; + loff_t n; + + for (n = *pos, hpetp = hpets; hpetp; hpetp = hpetp->hp_next) + if (!n--) + return hpetp; + + return 0; +} + +static void *hpet_next(struct seq_file *s, void *v, loff_t * pos) +{ + struct hpets *hpetp; + + hpetp = v; + ++*pos; + return hpetp->hp_next; +} + +static void hpet_stop(struct seq_file *s, void *v) +{ + return; +} + +static int hpet_show(struct seq_file *s, void *v) +{ + struct hpets *hpetp; + struct hpet *hpet; + u64 cap, vendor, period; + + hpetp = v; + hpet = hpetp->hp_hpet; + + cap = readq(&hpet->hpet_cap); + period = (cap & HPET_COUNTER_CLK_PERIOD_MASK) >> + HPET_COUNTER_CLK_PERIOD_SHIFT; + vendor = (cap & HPET_VENDOR_ID_MASK) >> HPET_VENDOR_ID_SHIFT; + + seq_printf(s, + "HPET%d period = %d 10**-15 vendor = 0x%x number timer = %d\n", + hpetp->hp_which, (u32) period, (u32) vendor, + hpetp->hp_ntimer); + + return 0; +} + +static struct seq_operations hpet_seq_ops = { + .start = hpet_start, + .next = hpet_next, + .stop = hpet_stop, + .show = hpet_show +}; + +static int hpet_proc_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &hpet_seq_ops); +} + +static struct file_operations hpet_proc_fops = { + .open = hpet_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release +}; + +/* + * Adjustment for when arming the timer with + * initial conditions. That is, main counter + * ticks expired before interrupts are enabled. + */ +#define TICK_CALIBRATE (1000UL) + +static unsigned long __init hpet_calibrate(struct hpets *hpetp) +{ + struct hpet_timer *timer; + unsigned long t, m, count, i, flags, start; + struct hpet_dev *devp; + int j; + struct hpet *hpet; + + for (timer = 0, j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; + j++, devp++) + if ((devp->hd_flags & HPET_OPEN) == 0) { + timer = devp->hd_timer; + break; + } + + if (!timer) + return 0; + + hpet = hpets->hp_hpet; + t = read_counter(&timer->hpet_compare); + + i = 0; + count = hpet_time_div(hpetp->hp_period * TICK_CALIBRATE); + + local_irq_save(flags); + + start = read_counter(&hpet->hpet_mc); + + do { + m = read_counter(&hpet->hpet_mc); + write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); + } while (i++, (m - start) < count); + + local_irq_restore(flags); + + return (m - start) / i; +} + +int __init hpet_alloc(struct hpet_data *hdp) +{ + u64 cap, mcfg; + struct hpet_dev *devp; + u32 i, ntimer; + struct hpets *hpetp; + size_t siz; + struct hpet *hpet; + static struct hpets *last __initdata = (struct hpets *)0; + + /* + * hpet_alloc can be called by platform dependent code. + * if platform dependent code has allocated the hpet + * ACPI also reports hpet, then we catch it here. + */ + for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) + if (hpetp->hp_hpet == (struct hpet *)(hdp->hd_address)) + return 0; + + siz = sizeof(struct hpets) + ((hdp->hd_nirqs - 1) * + sizeof(struct hpet_dev)); + + hpetp = kmalloc(siz, GFP_KERNEL); + + if (!hpetp) + return -ENOMEM; + + memset(hpetp, 0, siz); + + hpetp->hp_which = hpet_nhpet++; + hpetp->hp_hpet = (struct hpet *)hdp->hd_address; + + hpetp->hp_ntimer = hdp->hd_nirqs; + + for (i = 0; i < hdp->hd_nirqs; i++) + hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i]; + + hpet = hpetp->hp_hpet; + + cap = readq(&hpet->hpet_cap); + + ntimer = ((cap & HPET_NUM_TIM_CAP_MASK) >> HPET_NUM_TIM_CAP_SHIFT) + 1; + + if (hpetp->hp_ntimer != ntimer) { + printk(KERN_WARNING "hpet: number irqs doesn't agree" + " with number of timers\n"); + kfree(hpetp); + return -ENODEV; + } + + if (last) + last->hp_next = hpetp; + else + hpets = hpetp; + + last = hpetp; + + hpetp->hp_period = (cap & HPET_COUNTER_CLK_PERIOD_MASK) >> + HPET_COUNTER_CLK_PERIOD_SHIFT; + + mcfg = readq(&hpet->hpet_config); + if ((mcfg & HPET_ENABLE_CNF_MASK) == 0) { + write_counter(0L, &hpet->hpet_mc); + mcfg |= HPET_ENABLE_CNF_MASK; + writeq(mcfg, &hpet->hpet_config); + } + + for (i = 0, devp = hpetp->hp_dev; i < hpetp->hp_ntimer; + i++, hpet_ntimer++, devp++) { + unsigned long v; + struct hpet_timer *timer; + + timer = &hpet->hpet_timers[devp - hpetp->hp_dev]; + v = readq(&timer->hpet_config); + + devp->hd_hpets = hpetp; + devp->hd_hpet = hpet; + devp->hd_timer = timer; + + /* + * If the timer was reserved by platform code, + * then make timer unavailable for opens. + */ + if (hdp->hd_state & (1 << i)) { + devp->hd_flags = HPET_OPEN; + continue; + } + + init_waitqueue_head(&devp->hd_waitqueue); + } + + hpetp->hp_delta = hpet_calibrate(hpetp); + + return 0; +} + +static acpi_status __init hpet_resources(struct acpi_resource *res, void *data) +{ + struct hpet_data *hdp; + acpi_status status; + struct acpi_resource_address64 addr; + struct hpets *hpetp; + + hdp = data; + + status = acpi_resource_to_address64(res, &addr); + + if (ACPI_SUCCESS(status)) { + unsigned long size; + + size = addr.max_address_range - addr.min_address_range + 1; + hdp->hd_address = + (unsigned long)ioremap(addr.min_address_range, size); + + for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) + if (hpetp->hp_hpet == (struct hpet *)(hdp->hd_address)) + return -EBUSY; + } else if (res->id == ACPI_RSTYPE_EXT_IRQ) { + struct acpi_resource_ext_irq *irqp; + int i; + + irqp = &res->data.extended_irq; + + if (irqp->number_of_interrupts > 0) { + hdp->hd_nirqs = irqp->number_of_interrupts; + + for (i = 0; i < hdp->hd_nirqs; i++) +#ifdef CONFIG_IA64 + hdp->hd_irq[i] = + acpi_register_gsi(irqp->interrupts[i], + irqp->edge_level, + irqp->active_high_low); +#else + hdp->hd_irq[i] = irqp->interrupts[i]; +#endif + } + } + + return AE_OK; +} + +static int __init hpet_acpi_add(struct acpi_device *device) +{ + acpi_status result; + struct hpet_data data; + + memset(&data, 0, sizeof(data)); + + result = + acpi_walk_resources(device->handle, METHOD_NAME__CRS, + hpet_resources, &data); + + if (ACPI_FAILURE(result)) + return -ENODEV; + + if (!data.hd_address || !data.hd_nirqs) { + printk("%s: no address or irqs in _CRS\n", __FUNCTION__); + return -ENODEV; + } + + return hpet_alloc(&data); +} + +static int __init hpet_acpi_remove(struct acpi_device *device, int type) +{ + return 0; +} + +static struct acpi_driver hpet_acpi_driver __initdata = { + .name = "hpet", + .class = "", + .ids = "PNP0103", + .ops = { + .add = hpet_acpi_add, + .remove = hpet_acpi_remove, + }, +}; + +static struct miscdevice hpet_misc = { HPET_MINOR, "hpet", &hpet_fops }; + +static int __init hpet_init(void) +{ + struct proc_dir_entry *entry; + + (void)acpi_bus_register_driver(&hpet_acpi_driver); + + if (hpets) { + if (misc_register(&hpet_misc)) + return -ENODEV; + + entry = create_proc_entry("driver/hpet", 0, 0); + + if (entry) + entry->proc_fops = &hpet_proc_fops; + + sysctl_header = register_sysctl_table(dev_root, 0); + +#ifdef CONFIG_TIME_INTERPOLATION + { + struct hpet *hpet; + + hpet = hpets->hp_hpet; + hpet_cycles_per_sec = hpet_time_div(hpets->hp_period); + hpet_interpolator.frequency = hpet_cycles_per_sec; + hpet_interpolator.drift = hpet_cycles_per_sec * + HPET_DRIFT / 1000000; + hpet_nsecs_per_cycle = 1000000000 / hpet_cycles_per_sec; + register_time_interpolator(&hpet_interpolator); + } +#endif + return 0; + } else + return -ENODEV; +} + +static void __exit hpet_exit(void) +{ + acpi_bus_unregister_driver(&hpet_acpi_driver); + + if (hpets) { + unregister_sysctl_table(sysctl_header); + remove_proc_entry("driver/hpet", NULL); + } + + return; +} + +module_init(hpet_init); +module_exit(hpet_exit); +MODULE_AUTHOR("Bob Picco "); +MODULE_LICENSE("GPL"); diff -Nru a/drivers/char/ip27-rtc.c b/drivers/char/ip27-rtc.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/char/ip27-rtc.c 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,327 @@ +/* + * Driver for the SGS-Thomson M48T35 Timekeeper RAM chip + * + * Real Time Clock interface for Linux + * + * TODO: Implement periodic interrupts. + * + * Copyright (C) 2000 Silicon Graphics, Inc. + * Written by Ulf Carlsson (ulfc@engr.sgi.com) + * + * Based on code written by Paul Gortmaker. + * + * This driver allows use of the real time clock (built into + * nearly all computers) from user space. It exports the /dev/rtc + * interface supporting various ioctl() and also the /proc/rtc + * pseudo-file for status information. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + */ + +#define RTC_VERSION "1.09b" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int rtc_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + +static int rtc_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data); + +static void get_rtc_time(struct rtc_time *rtc_tm); + +/* + * Bits in rtc_status. (6 bits of room for future expansion) + */ + +#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */ +#define RTC_TIMER_ON 0x02 /* missed irq timer active */ + +static unsigned char rtc_status; /* bitmapped status byte. */ +static unsigned long rtc_freq; /* Current periodic IRQ rate */ +static struct m48t35_rtc *rtc; + +/* + * If this driver ever becomes modularised, it will be really nice + * to make the epoch retain its value across module reload... + */ + +static unsigned long epoch = 1970; /* year corresponding to 0x00 */ + +static const unsigned char days_in_mo[] = +{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + +static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + + struct rtc_time wtime; + + switch (cmd) { + case RTC_RD_TIME: /* Read the time/date from RTC */ + { + get_rtc_time(&wtime); + break; + } + case RTC_SET_TIME: /* Set the RTC */ + { + struct rtc_time rtc_tm; + unsigned char mon, day, hrs, min, sec, leap_yr; + unsigned int yrs; + + if (!capable(CAP_SYS_TIME)) + return -EACCES; + + if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, + sizeof(struct rtc_time))) + return -EFAULT; + + yrs = rtc_tm.tm_year + 1900; + mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ + day = rtc_tm.tm_mday; + hrs = rtc_tm.tm_hour; + min = rtc_tm.tm_min; + sec = rtc_tm.tm_sec; + + if (yrs < 1970) + return -EINVAL; + + leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400)); + + if ((mon > 12) || (day == 0)) + return -EINVAL; + + if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr))) + return -EINVAL; + + if ((hrs >= 24) || (min >= 60) || (sec >= 60)) + return -EINVAL; + + if ((yrs -= epoch) > 255) /* They are unsigned */ + return -EINVAL; + + if (yrs > 169) + return -EINVAL; + + if (yrs >= 100) + yrs -= 100; + + sec = BIN2BCD(sec); + min = BIN2BCD(min); + hrs = BIN2BCD(hrs); + day = BIN2BCD(day); + mon = BIN2BCD(mon); + yrs = BIN2BCD(yrs); + + spin_lock_irq(&rtc_lock); + rtc->control |= M48T35_RTC_SET; + rtc->year = yrs; + rtc->month = mon; + rtc->date = day; + rtc->hour = hrs; + rtc->min = min; + rtc->sec = sec; + rtc->control &= ~M48T35_RTC_SET; + spin_unlock_irq(&rtc_lock); + + return 0; + } + default: + return -EINVAL; + } + return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; +} + +/* + * We enforce only one user at a time here with the open/close. + * Also clear the previous interrupt data on an open, and clean + * up things on a close. + */ + +static int rtc_open(struct inode *inode, struct file *file) +{ + spin_lock_irq(&rtc_lock); + + if (rtc_status & RTC_IS_OPEN) { + spin_unlock_irq(&rtc_lock); + return -EBUSY; + } + + rtc_status |= RTC_IS_OPEN; + spin_unlock_irq(&rtc_lock); + + return 0; +} + +static int rtc_release(struct inode *inode, struct file *file) +{ + /* + * Turn off all interrupts once the device is no longer + * in use, and clear the data. + */ + + spin_lock_irq(&rtc_lock); + rtc_status &= ~RTC_IS_OPEN; + spin_unlock_irq(&rtc_lock); + + return 0; +} + +/* + * The various file operations we support. + */ + +static struct file_operations rtc_fops = { + .owner = THIS_MODULE, + .ioctl = rtc_ioctl, + .open = rtc_open, + .release = rtc_release, +}; + +static struct miscdevice rtc_dev= +{ + RTC_MINOR, + "rtc", + &rtc_fops +}; + +static int __init rtc_init(void) +{ + rtc = (struct m48t35_rtc *) + (KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base + IOC3_BYTEBUS_DEV0); + + printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION); + if (misc_register(&rtc_dev)) { + printk(KERN_ERR "rtc: cannot register misc device.\n"); + return -ENODEV; + } + if (!create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL)) { + printk(KERN_ERR "rtc: cannot create /proc/rtc.\n"); + misc_deregister(&rtc_dev); + return -ENOENT; + } + + rtc_freq = 1024; + + return 0; +} + +static void __exit rtc_exit (void) +{ + /* interrupts and timer disabled at this point by rtc_release */ + + remove_proc_entry ("rtc", NULL); + misc_deregister(&rtc_dev); +} + +module_init(rtc_init); +module_exit(rtc_exit); + +/* + * Info exported via "/proc/rtc". + */ + +static int rtc_get_status(char *buf) +{ + char *p; + struct rtc_time tm; + + /* + * Just emulate the standard /proc/rtc + */ + + p = buf; + + get_rtc_time(&tm); + + /* + * There is no way to tell if the luser has the RTC set for local + * time or for Universal Standard Time (GMT). Probably local though. + */ + p += sprintf(p, + "rtc_time\t: %02d:%02d:%02d\n" + "rtc_date\t: %04d-%02d-%02d\n" + "rtc_epoch\t: %04lu\n" + "24hr\t\t: yes\n", + tm.tm_hour, tm.tm_min, tm.tm_sec, + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch); + + return p - buf; +} + +static int rtc_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = rtc_get_status(page); + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + return len; +} + +static void get_rtc_time(struct rtc_time *rtc_tm) +{ + /* + * Do we need to wait for the last update to finish? + */ + + /* + * Only the values that we read from the RTC are set. We leave + * tm_wday, tm_yday and tm_isdst untouched. Even though the + * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated + * by the RTC when initially set to a non-zero value. + */ + spin_lock_irq(&rtc_lock); + rtc->control |= M48T35_RTC_READ; + rtc_tm->tm_sec = rtc->sec; + rtc_tm->tm_min = rtc->min; + rtc_tm->tm_hour = rtc->hour; + rtc_tm->tm_mday = rtc->date; + rtc_tm->tm_mon = rtc->month; + rtc_tm->tm_year = rtc->year; + rtc->control &= ~M48T35_RTC_READ; + spin_unlock_irq(&rtc_lock); + + rtc_tm->tm_sec = BCD2BIN(rtc_tm->tm_sec); + rtc_tm->tm_min = BCD2BIN(rtc_tm->tm_min); + rtc_tm->tm_hour = BCD2BIN(rtc_tm->tm_hour); + rtc_tm->tm_mday = BCD2BIN(rtc_tm->tm_mday); + rtc_tm->tm_mon = BCD2BIN(rtc_tm->tm_mon); + rtc_tm->tm_year = BCD2BIN(rtc_tm->tm_year); + + /* + * Account for differences between how the RTC uses the values + * and how they are defined in a struct rtc_time; + */ + if ((rtc_tm->tm_year += (epoch - 1900)) <= 69) + rtc_tm->tm_year += 100; + + rtc_tm->tm_mon--; +} diff -Nru a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c --- a/drivers/char/ipmi/ipmi_bt_sm.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/ipmi/ipmi_bt_sm.c 2004-06-23 19:04:28 -07:00 @@ -31,7 +31,7 @@ #include /* for completion codes */ #include "ipmi_si_sm.h" -#define IPMI_BT_VERSION "v31" +#define IPMI_BT_VERSION "v32" static int bt_debug = 0x00; /* Production value 0, see following flags */ diff -Nru a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c --- a/drivers/char/ipmi/ipmi_devintf.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/ipmi/ipmi_devintf.c 2004-06-23 19:04:28 -07:00 @@ -45,7 +45,7 @@ #include #include -#define IPMI_DEVINTF_VERSION "v31" +#define IPMI_DEVINTF_VERSION "v32" struct ipmi_file_private { @@ -199,7 +199,7 @@ goto out; } - if (copy_from_user(&msgdata, + if (copy_from_user(msgdata, req->msg.data, req->msg.data_len)) { @@ -231,6 +231,7 @@ { int rv = -EINVAL; struct ipmi_file_private *priv = file->private_data; + void __user *arg = (void __user *)data; switch (cmd) { @@ -238,7 +239,7 @@ { struct ipmi_req req; - if (copy_from_user(&req, (void *) data, sizeof(req))) { + if (copy_from_user(&req, arg, sizeof(req))) { rv = -EFAULT; break; } @@ -254,7 +255,7 @@ { struct ipmi_req_settime req; - if (copy_from_user(&req, (void *) data, sizeof(req))) { + if (copy_from_user(&req, arg, sizeof(req))) { rv = -EFAULT; break; } @@ -277,7 +278,7 @@ rv = 0; - if (copy_from_user(&rsp, (void *) data, sizeof(rsp))) { + if (copy_from_user(&rsp, arg, sizeof(rsp))) { rv = -EFAULT; break; } @@ -344,7 +345,7 @@ rsp.msg.data_len = 0; } - if (copy_to_user((void *) data, &rsp, sizeof(rsp))) { + if (copy_to_user(arg, &rsp, sizeof(rsp))) { rv = -EFAULT; goto recv_putback_on_err; } @@ -371,7 +372,7 @@ { struct ipmi_cmdspec val; - if (copy_from_user(&val, (void *) data, sizeof(val))) { + if (copy_from_user(&val, arg, sizeof(val))) { rv = -EFAULT; break; } @@ -384,7 +385,7 @@ { struct ipmi_cmdspec val; - if (copy_from_user(&val, (void *) data, sizeof(val))) { + if (copy_from_user(&val, arg, sizeof(val))) { rv = -EFAULT; break; } @@ -397,7 +398,7 @@ { int val; - if (copy_from_user(&val, (void *) data, sizeof(val))) { + if (copy_from_user(&val, arg, sizeof(val))) { rv = -EFAULT; break; } @@ -410,7 +411,7 @@ { unsigned int val; - if (copy_from_user(&val, (void *) data, sizeof(val))) { + if (copy_from_user(&val, arg, sizeof(val))) { rv = -EFAULT; break; } @@ -426,7 +427,7 @@ val = ipmi_get_my_address(priv->user); - if (copy_to_user((void *) data, &val, sizeof(val))) { + if (copy_to_user(arg, &val, sizeof(val))) { rv = -EFAULT; break; } @@ -438,7 +439,7 @@ { unsigned int val; - if (copy_from_user(&val, (void *) data, sizeof(val))) { + if (copy_from_user(&val, arg, sizeof(val))) { rv = -EFAULT; break; } @@ -454,7 +455,7 @@ val = ipmi_get_my_LUN(priv->user); - if (copy_to_user((void *) data, &val, sizeof(val))) { + if (copy_to_user(arg, &val, sizeof(val))) { rv = -EFAULT; break; } @@ -465,7 +466,7 @@ { struct ipmi_timing_parms parms; - if (copy_from_user(&parms, (void *) data, sizeof(parms))) { + if (copy_from_user(&parms, arg, sizeof(parms))) { rv = -EFAULT; break; } @@ -483,7 +484,7 @@ parms.retries = priv->default_retries; parms.retry_time_ms = priv->default_retry_time_ms; - if (copy_to_user((void *) data, &parms, sizeof(parms))) { + if (copy_to_user(arg, &parms, sizeof(parms))) { rv = -EFAULT; break; } diff -Nru a/drivers/char/ipmi/ipmi_kcs_sm.c b/drivers/char/ipmi/ipmi_kcs_sm.c --- a/drivers/char/ipmi/ipmi_kcs_sm.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/ipmi/ipmi_kcs_sm.c 2004-06-23 19:04:25 -07:00 @@ -42,7 +42,7 @@ #include /* for completion codes */ #include "ipmi_si_sm.h" -#define IPMI_KCS_VERSION "v31" +#define IPMI_KCS_VERSION "v32" /* Set this if you want a printout of why the state machine was hosed when it gets hosed. */ diff -Nru a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c --- a/drivers/char/ipmi/ipmi_msghandler.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/ipmi/ipmi_msghandler.c 2004-06-23 19:04:27 -07:00 @@ -46,7 +46,7 @@ #include #include -#define IPMI_MSGHANDLER_VERSION "v31" +#define IPMI_MSGHANDLER_VERSION "v32" struct ipmi_recv_msg *ipmi_alloc_recv_msg(void); static int ipmi_init_msghandler(void); @@ -1648,6 +1648,22 @@ /* It's the one we want */ if (msg->rsp[2] != 0) { /* Got an error from the channel, just go on. */ + + if (msg->rsp[2] == IPMI_INVALID_COMMAND_ERR) { + /* If the MC does not support this + command, that is legal. We just + assume it has one IPMB at channel + zero. */ + intf->channels[0].medium + = IPMI_CHANNEL_MEDIUM_IPMB; + intf->channels[0].protocol + = IPMI_CHANNEL_PROTOCOL_IPMB; + rv = -ENOSYS; + + intf->curr_channel = IPMI_MAX_CHANNELS; + wake_up(&intf->waitq); + goto out; + } goto next_channel; } if (msg->rsp_size < 6) { @@ -1671,10 +1687,20 @@ wake_up(&intf->waitq); printk(KERN_WARNING "ipmi_msghandler: Error sending" - "channel information: 0x%x\n", + "channel information: %d\n", rv); } } + out: + return; +} + +void ipmi_poll_interface(ipmi_user_t user) +{ + ipmi_smi_t intf = user->intf; + + if (intf->handlers->poll) + intf->handlers->poll(intf->send_info); } int ipmi_register_smi(struct ipmi_smi_handlers *handlers, @@ -3154,6 +3180,7 @@ EXPORT_SYMBOL(ipmi_request_settime); EXPORT_SYMBOL(ipmi_request_supply_msgs); EXPORT_SYMBOL(ipmi_request_with_source); +EXPORT_SYMBOL(ipmi_poll_interface); EXPORT_SYMBOL(ipmi_register_smi); EXPORT_SYMBOL(ipmi_unregister_smi); EXPORT_SYMBOL(ipmi_register_for_cmd); diff -Nru a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c --- a/drivers/char/ipmi/ipmi_si_intf.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/ipmi/ipmi_si_intf.c 2004-06-23 19:04:25 -07:00 @@ -76,7 +76,7 @@ #include "ipmi_si_sm.h" #include -#define IPMI_SI_VERSION "v31" +#define IPMI_SI_VERSION "v32" /* Measure times between events in the driver. */ #undef DEBUG_TIMING @@ -712,6 +712,13 @@ spin_unlock_irqrestore(&(smi_info->si_lock), flags); } +static void poll(void *send_info) +{ + struct smi_info *smi_info = send_info; + + smi_event_handler(smi_info, 0); +} + static void request_events(void *send_info) { struct smi_info *smi_info = send_info; @@ -851,7 +858,8 @@ .owner = THIS_MODULE, .sender = sender, .request_events = request_events, - .set_run_to_completion = set_run_to_completion + .set_run_to_completion = set_run_to_completion, + .poll = poll, }; /* There can be 4 IO ports passed in (with or without IRQs), 4 addresses, @@ -1848,6 +1856,21 @@ atomic_set(&new_smi->req_events, 0); new_smi->run_to_completion = 0; + new_smi->interrupt_disabled = 0; + new_smi->timer_stopped = 0; + new_smi->stop_operation = 0; + + /* The ipmi_register_smi() code does some operations to + determine the channel information, so we must be ready to + handle operations before it is called. This means we have + to stop the timer if we get an error after this point. */ + init_timer(&(new_smi->si_timer)); + new_smi->si_timer.data = (long) new_smi; + new_smi->si_timer.function = smi_timeout; + new_smi->last_timeout_jiffies = jiffies; + new_smi->si_timer.expires = jiffies + SI_TIMEOUT_JIFFIES; + add_timer(&(new_smi->si_timer)); + rv = ipmi_register_smi(&handlers, new_smi, new_smi->ipmi_version_major, @@ -1857,7 +1880,7 @@ printk(KERN_ERR "ipmi_si: Unable to register device: error %d\n", rv); - goto out_err; + goto out_err_stop_timer; } rv = ipmi_smi_add_proc_entry(new_smi->intf, "type", @@ -1867,7 +1890,7 @@ printk(KERN_ERR "ipmi_si: Unable to create proc entry: %d\n", rv); - goto out_err; + goto out_err_stop_timer; } rv = ipmi_smi_add_proc_entry(new_smi->intf, "si_stats", @@ -1877,7 +1900,7 @@ printk(KERN_ERR "ipmi_si: Unable to create proc entry: %d\n", rv); - goto out_err; + goto out_err_stop_timer; } start_clear_flags(new_smi); @@ -1886,34 +1909,40 @@ if (new_smi->irq) new_smi->si_state = SI_CLEARING_FLAGS_THEN_SET_IRQ; - new_smi->interrupt_disabled = 0; - new_smi->timer_stopped = 0; - new_smi->stop_operation = 0; - - init_timer(&(new_smi->si_timer)); - new_smi->si_timer.data = (long) new_smi; - new_smi->si_timer.function = smi_timeout; - new_smi->last_timeout_jiffies = jiffies; - new_smi->si_timer.expires = jiffies + SI_TIMEOUT_JIFFIES; - add_timer(&(new_smi->si_timer)); - *smi = new_smi; printk(" IPMI %s interface initialized\n", si_type[intf_num]); return 0; + out_err_stop_timer: + new_smi->stop_operation = 1; + + /* Wait for the timer to stop. This avoids problems with race + conditions removing the timer here. */ + while (!new_smi->timer_stopped) { + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(1); + } + out_err: if (new_smi->intf) ipmi_unregister_smi(new_smi->intf); new_smi->irq_cleanup(new_smi); + + /* Wait until we know that we are out of any interrupt + handlers might have been running before we freed the + interrupt. */ + synchronize_kernel(); + if (new_smi->si_sm) { if (new_smi->handlers) new_smi->handlers->cleanup(new_smi->si_sm); kfree(new_smi->si_sm); } new_smi->io_cleanup(new_smi); + return rv; } diff -Nru a/drivers/char/ipmi/ipmi_smic_sm.c b/drivers/char/ipmi/ipmi_smic_sm.c --- a/drivers/char/ipmi/ipmi_smic_sm.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/ipmi/ipmi_smic_sm.c 2004-06-23 19:04:27 -07:00 @@ -46,7 +46,7 @@ #include /* for completion codes */ #include "ipmi_si_sm.h" -#define IPMI_SMIC_VERSION "v31" +#define IPMI_SMIC_VERSION "v32" /* smic_debug is a bit-field * SMIC_DEBUG_ENABLE - turned on for now diff -Nru a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c --- a/drivers/char/ipmi/ipmi_watchdog.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/ipmi/ipmi_watchdog.c 2004-06-23 19:04:28 -07:00 @@ -51,7 +51,7 @@ #include #endif -#define IPMI_WATCHDOG_VERSION "v31" +#define IPMI_WATCHDOG_VERSION "v32" /* * The IPMI command/response information for the watchdog timer. @@ -515,40 +515,37 @@ static int ipmi_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; int i; int val; switch(cmd) { case WDIOC_GETSUPPORT: - i = copy_to_user((void*)arg, &ident, sizeof(ident)); + i = copy_to_user(argp, &ident, sizeof(ident)); return i ? -EFAULT : 0; case WDIOC_SETTIMEOUT: - i = copy_from_user(&val, (void *) arg, sizeof(int)); + i = copy_from_user(&val, argp, sizeof(int)); if (i) return -EFAULT; timeout = val; return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); case WDIOC_GETTIMEOUT: - i = copy_to_user((void *) arg, - &timeout, - sizeof(timeout)); + i = copy_to_user(argp, &timeout, sizeof(timeout)); if (i) return -EFAULT; return 0; case WDIOC_SET_PRETIMEOUT: - i = copy_from_user(&val, (void *) arg, sizeof(int)); + i = copy_from_user(&val, argp, sizeof(int)); if (i) return -EFAULT; pretimeout = val; return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY); case WDIOC_GET_PRETIMEOUT: - i = copy_to_user((void *) arg, - &pretimeout, - sizeof(pretimeout)); + i = copy_to_user(argp, &pretimeout, sizeof(pretimeout)); if (i) return -EFAULT; return 0; @@ -557,7 +554,7 @@ return ipmi_heartbeat(); case WDIOC_SETOPTIONS: - i = copy_from_user(&val, (void *) arg, sizeof(int)); + i = copy_from_user(&val, argp, sizeof(int)); if (i) return -EFAULT; if (val & WDIOS_DISABLECARD) @@ -576,7 +573,7 @@ case WDIOC_GETSTATUS: val = 0; - i = copy_to_user((void *) arg, &val, sizeof(val)); + i = copy_to_user(argp, &val, sizeof(val)); if (i) return -EFAULT; return 0; @@ -587,7 +584,7 @@ } static ssize_t ipmi_write(struct file *file, - const char *buf, + const char __user *buf, size_t len, loff_t *ppos) { @@ -607,7 +604,7 @@ } static ssize_t ipmi_read(struct file *file, - char *buf, + char __user *buf, size_t count, loff_t *ppos) { @@ -883,14 +880,12 @@ /* On a panic, if we have a panic timeout, make sure that the thing reboots, even if it hangs during that panic. */ - if (watchdog_user && !panic_event_handled && (panic_timeout > 0)) { + if (watchdog_user && !panic_event_handled) { /* Make sure the panic doesn't hang, and make sure we do this only once. */ panic_event_handled = 1; - timeout = panic_timeout + 120; - if (timeout > 255) - timeout = 255; + timeout = 255; pretimeout = 0; ipmi_watchdog_state = WDOG_TIMEOUT_RESET; panic_halt_ipmi_set_timeout(); diff -Nru a/drivers/char/istallion.c b/drivers/char/istallion.c --- a/drivers/char/istallion.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/istallion.c 2004-06-23 19:04:27 -07:00 @@ -851,7 +851,7 @@ i = tty_unregister_driver(stli_serial); if (i) { printk("STALLION: failed to un-register tty driver, " - "errno=%d,%d\n", -i); + "errno=%d\n", -i); restore_flags(flags); return; } diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c --- a/drivers/char/keyboard.c 2004-06-23 19:04:29 -07:00 +++ b/drivers/char/keyboard.c 2004-06-23 19:04:29 -07:00 @@ -52,13 +52,12 @@ /* * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on. - * This seems a good reason to start with NumLock off. On PC9800 and HIL keyboards + * This seems a good reason to start with NumLock off. On HIL keyboards * of PARISC machines however there is no NumLock key and everyone expects the keypad * to be used for numbers. */ -#if defined(CONFIG_X86_PC9800) || \ - defined(CONFIG_PARISC) && (defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD)) +#if defined(CONFIG_PARISC) && (defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD)) #define KBD_DEFLEDS (1 << VC_NUMLOCK) #else #define KBD_DEFLEDS 0 diff -Nru a/drivers/char/lcd.c b/drivers/char/lcd.c --- a/drivers/char/lcd.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/lcd.c 2004-06-23 19:04:26 -07:00 @@ -12,7 +12,7 @@ * */ -#define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */ +#define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */ #include #include @@ -32,8 +32,8 @@ #include "lcd.h" -static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg); +static int lcd_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); static int lcd_present = 1; @@ -57,8 +57,8 @@ } #endif -static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg) +static int lcd_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { struct lcd_display button_display; unsigned long address, a; @@ -69,7 +69,7 @@ udelay(150); BusyCheck(); LCDWriteInst(0x0F); - break; + break; case LCD_Off: udelay(150); @@ -95,7 +95,7 @@ case LCD_Clear: udelay(150); BusyCheck(); - LCDWriteInst(0x01); + LCDWriteInst(0x01); break; case LCD_Cursor_Left: @@ -108,86 +108,95 @@ udelay(150); BusyCheck(); LCDWriteInst(0x14); - break; + break; case LCD_Cursor_Off: udelay(150); - BusyCheck(); - LCDWriteInst(0x0C); - break; - - case LCD_Cursor_On: - udelay(150); - BusyCheck(); - LCDWriteInst(0x0F); - break; - - case LCD_Blink_Off: - udelay(150); - BusyCheck(); - LCDWriteInst(0x0E); - break; - - case LCD_Get_Cursor_Pos:{ - struct lcd_display display; + BusyCheck(); + LCDWriteInst(0x0C); + break; + case LCD_Cursor_On: udelay(150); - BusyCheck(); - display.cursor_address = ( LCDReadInst ); - display.cursor_address = ( display.cursor_address & 0x07F ); - if(copy_to_user((struct lcd_display*)arg, &display, sizeof(struct lcd_display))) - return -EFAULT; + BusyCheck(); + LCDWriteInst(0x0F); + break; + case LCD_Blink_Off: + udelay(150); + BusyCheck(); + LCDWriteInst(0x0E); break; + + case LCD_Get_Cursor_Pos:{ + struct lcd_display display; + + udelay(150); + BusyCheck(); + display.cursor_address = (LCDReadInst); + display.cursor_address = + (display.cursor_address & 0x07F); + if (copy_to_user + ((struct lcd_display *) arg, &display, + sizeof(struct lcd_display))) + return -EFAULT; + + break; } - case LCD_Set_Cursor_Pos: { - struct lcd_display display; + case LCD_Set_Cursor_Pos:{ + struct lcd_display display; - if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display))) - return -EFAULT; + if (copy_from_user + (&display, (struct lcd_display *) arg, + sizeof(struct lcd_display))) + return -EFAULT; - a = (display.cursor_address | kLCD_Addr ); + a = (display.cursor_address | kLCD_Addr); - udelay(150); - BusyCheck(); - LCDWriteInst( a ); + udelay(150); + BusyCheck(); + LCDWriteInst(a); - break; + break; } - - case LCD_Get_Cursor: { - struct lcd_display display; - udelay(150); - BusyCheck(); - display.character = LCDReadData; + case LCD_Get_Cursor:{ + struct lcd_display display; - if(copy_to_user((struct lcd_display*)arg, &display, sizeof(struct lcd_display))) - return -EFAULT; - udelay(150); - BusyCheck(); - LCDWriteInst(0x10); + udelay(150); + BusyCheck(); + display.character = LCDReadData; - break; + if (copy_to_user + ((struct lcd_display *) arg, &display, + sizeof(struct lcd_display))) + return -EFAULT; + udelay(150); + BusyCheck(); + LCDWriteInst(0x10); + + break; } case LCD_Set_Cursor:{ - struct lcd_display display; - - if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display))) - return -EFAULT; - - udelay(150); - BusyCheck(); - LCDWriteData( display.character ); - udelay(150); - BusyCheck(); - LCDWriteInst(0x10); + struct lcd_display display; - break; - } + if (copy_from_user + (&display, (struct lcd_display *) arg, + sizeof(struct lcd_display))) + return -EFAULT; + + udelay(150); + BusyCheck(); + LCDWriteData(display.character); + udelay(150); + BusyCheck(); + LCDWriteInst(0x10); + + break; + } case LCD_Disp_Left: @@ -208,294 +217,330 @@ LCDWriteInst(0x02); break; - case LCD_Write: { - struct lcd_display display; - + case LCD_Write:{ + struct lcd_display display; + + + if (copy_from_user + (&display, (struct lcd_display *) arg, + sizeof(struct lcd_display))) + return -EFAULT; - if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display))) - return -EFAULT; - - udelay(150); - BusyCheck(); - LCDWriteInst(0x80); - udelay(150); - BusyCheck(); - - for (index = 0; index < (display.size1); index++) { udelay(150); - BusyCheck(); - LCDWriteData( display.line1[index]); - BusyCheck(); - } - - udelay(150); - BusyCheck(); - LCDWriteInst(0xC0); - udelay(150); - BusyCheck(); - for (index = 0; index < (display.size2); index++) { - udelay(150); - BusyCheck(); - LCDWriteData( display.line2[index]); - } - - break; - } - - case LCD_Read: { - struct lcd_display display; + BusyCheck(); + LCDWriteInst(0x80); + udelay(150); + BusyCheck(); - BusyCheck(); - for (address = kDD_R00; address <= kDD_R01; address++) { - a = (address | kLCD_Addr ); + for (index = 0; index < (display.size1); index++) { + udelay(150); + BusyCheck(); + LCDWriteData(display.line1[index]); + BusyCheck(); + } udelay(150); BusyCheck(); - LCDWriteInst( a ); + LCDWriteInst(0xC0); udelay(150); BusyCheck(); - display.line1[address] = LCDReadData; + for (index = 0; index < (display.size2); index++) { + udelay(150); + BusyCheck(); + LCDWriteData(display.line2[index]); + } + + break; } - display.line1[ 0x27 ] = '\0'; - - for (address = kDD_R10; address <= kDD_R11; address++) { - a = (address | kLCD_Addr ); - - udelay(150); - BusyCheck(); - LCDWriteInst( a ); - - udelay(150); - BusyCheck(); - display.line2[address - 0x40 ] = LCDReadData; - } - - display.line2[ 0x27 ] = '\0'; - - if(copy_to_user((struct lcd_display*)arg, &display, - sizeof(struct lcd_display))) - return -EFAULT; - break; - } + case LCD_Read:{ + struct lcd_display display; + + BusyCheck(); + for (address = kDD_R00; address <= kDD_R01; + address++) { + a = (address | kLCD_Addr); + + udelay(150); + BusyCheck(); + LCDWriteInst(a); + udelay(150); + BusyCheck(); + display.line1[address] = LCDReadData; + } -// set all GPIO leds to led_display.leds + display.line1[0x27] = '\0'; - case LED_Set: { - struct lcd_display led_display; - + for (address = kDD_R10; address <= kDD_R11; + address++) { + a = (address | kLCD_Addr); + + udelay(150); + BusyCheck(); + LCDWriteInst(a); + + udelay(150); + BusyCheck(); + display.line2[address - 0x40] = + LCDReadData; + } + + display.line2[0x27] = '\0'; - if(copy_from_user(&led_display, (struct lcd_display*)arg, - sizeof(struct lcd_display))) - return -EFAULT; + if (copy_to_user + ((struct lcd_display *) arg, &display, + sizeof(struct lcd_display))) + return -EFAULT; + break; + } - led_state = led_display.leds; - LEDSet(led_state); +// set all GPIO leds to led_display.leds - break; - } + case LED_Set:{ + struct lcd_display led_display; + + + if (copy_from_user + (&led_display, (struct lcd_display *) arg, + sizeof(struct lcd_display))) + return -EFAULT; + + led_state = led_display.leds; + LEDSet(led_state); + + break; + } // set only bit led_display.leds - case LED_Bit_Set: { - int i; - int bit=1; - struct lcd_display led_display; + case LED_Bit_Set:{ + int i; + int bit = 1; + struct lcd_display led_display; - if(copy_from_user(&led_display, (struct lcd_display*)arg, - sizeof(struct lcd_display))) - return -EFAULT; + if (copy_from_user + (&led_display, (struct lcd_display *) arg, + sizeof(struct lcd_display))) + return -EFAULT; - for (i=0;i<(int)led_display.leds;i++) - { - bit = 2*bit; + for (i = 0; i < (int) led_display.leds; i++) { + bit = 2 * bit; } - led_state = led_state | bit; - LEDSet(led_state); - break; - } + led_state = led_state | bit; + LEDSet(led_state); + break; + } // clear only bit led_display.leds - case LED_Bit_Clear: { - int i; - int bit=1; - struct lcd_display led_display; - - - if(copy_from_user(&led_display, (struct lcd_display*)arg, - sizeof(struct lcd_display))) - return -EFAULT; - - for (i=0;i<(int)led_display.leds;i++) - { - bit = 2*bit; - } - - led_state = led_state & ~bit; - LEDSet(led_state); - break; - } - - - case BUTTON_Read: { - button_display.buttons = GPIRead; - if(copy_to_user((struct lcd_display*)arg, &button_display, sizeof(struct lcd_display))) - return -EFAULT; - break; - } + case LED_Bit_Clear:{ + int i; + int bit = 1; + struct lcd_display led_display; - case LINK_Check: { - button_display.buttons = *((volatile unsigned long *) (0xB0100060) ); - if(copy_to_user((struct lcd_display*)arg, &button_display, sizeof(struct lcd_display))) - return -EFAULT; - break; - } - - case LINK_Check_2: { - int iface_num; - - /* panel-utils should pass in the desired interface status is wanted for - * in "buttons" of the structure. We will set this to non-zero if the - * link is in fact up for the requested interface. --DaveM - */ - if(copy_from_user(&button_display, (struct lcd_display *)arg, sizeof(button_display))) - return -EFAULT; - iface_num = button_display.buttons; -#if defined(CONFIG_TULIP) && 0 - if (iface_num >= 0 && - iface_num < MAX_INTERFACES && - linkcheck_callbacks[iface_num] != NULL) { - button_display.buttons = - linkcheck_callbacks[iface_num](linkcheck_cookies[iface_num]); - } else -#endif - button_display.buttons = 0; - - if(__copy_to_user((struct lcd_display*)arg, &button_display, sizeof(struct lcd_display))) - return -EFAULT; - break; - } -// Erase the flash + if (copy_from_user + (&led_display, (struct lcd_display *) arg, + sizeof(struct lcd_display))) + return -EFAULT; - case FLASH_Erase: { + for (i = 0; i < (int) led_display.leds; i++) { + bit = 2 * bit; + } - int ctr=0; + led_state = led_state & ~bit; + LEDSet(led_state); + break; + } - // Chip Erase Sequence - WRITE_FLASH( kFlash_Addr1, kFlash_Data1 ); - WRITE_FLASH( kFlash_Addr2, kFlash_Data2 ); - WRITE_FLASH( kFlash_Addr1, kFlash_Erase3 ); - WRITE_FLASH( kFlash_Addr1, kFlash_Data1 ); - WRITE_FLASH( kFlash_Addr2, kFlash_Data2 ); - WRITE_FLASH( kFlash_Addr1, kFlash_Erase6 ); - printk( "Erasing Flash.\n"); + case BUTTON_Read:{ + button_display.buttons = GPIRead; + if (copy_to_user + ((struct lcd_display *) arg, &button_display, + sizeof(struct lcd_display))) + return -EFAULT; + break; + } - while ( (!dqpoll(0x00000000,0xFF)) && (!timeout(0x00000000)) ) { - ctr++; + case LINK_Check:{ + button_display.buttons = + *((volatile unsigned long *) (0xB0100060)); + if (copy_to_user + ((struct lcd_display *) arg, &button_display, + sizeof(struct lcd_display))) + return -EFAULT; + break; } - printk("\n"); - printk("\n"); - printk("\n"); + case LINK_Check_2:{ + int iface_num; - if (READ_FLASH(0x07FFF0)==0xFF) { printk("Erase Successful\r\n"); } - else if (timeout) { printk("Erase Timed Out\r\n"); } + /* panel-utils should pass in the desired interface status is wanted for + * in "buttons" of the structure. We will set this to non-zero if the + * link is in fact up for the requested interface. --DaveM + */ + if (copy_from_user + (&button_display, (struct lcd_display *) arg, + sizeof(button_display))) + return -EFAULT; + iface_num = button_display.buttons; +#if defined(CONFIG_TULIP) && 0 + if (iface_num >= 0 && + iface_num < MAX_INTERFACES && + linkcheck_callbacks[iface_num] != NULL) { + button_display.buttons = + linkcheck_callbacks[iface_num] + (linkcheck_cookies[iface_num]); + } else +#endif + button_display.buttons = 0; - break; - } + if (__copy_to_user + ((struct lcd_display *) arg, &button_display, + sizeof(struct lcd_display))) + return -EFAULT; + break; + } -// burn the flash +// Erase the flash - case FLASH_Burn: { + case FLASH_Erase:{ - volatile unsigned long burn_addr; - unsigned long flags; - int i; - unsigned char *rom; - - - struct lcd_display display; - - if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display))) - return -EFAULT; - rom = (unsigned char *) kmalloc((128),GFP_ATOMIC); - if ( rom == NULL ) { - printk ("broken\n"); - return 1; - } - - printk("Churning and Burning -"); - save_flags(flags); - for (i=0; iRomImage[0]); + printk("Churning and Burning -"); + save_flags(flags); + for (i = 0; i < FLASH_SIZE; i = i + 128) { + + if (copy_from_user + (rom, display.RomImage + i, 128)) + return -EFAULT; + burn_addr = kFlashBase + i; + cli(); + for (index = 0; index < (128); index++) { + + WRITE_FLASH(kFlash_Addr1, + kFlash_Data1); + WRITE_FLASH(kFlash_Addr2, + kFlash_Data2); + WRITE_FLASH(kFlash_Addr1, + kFlash_Prog); + *((volatile unsigned char *) + burn_addr) = + (volatile unsigned char) rom[index]; + + while ((!dqpoll + (burn_addr, + (volatile unsigned char) + rom[index])) + && (!timeout(burn_addr))) { + } + burn_addr++; + } + restore_flags(flags); + if (* + ((volatile unsigned char *) (burn_addr + - 1)) == + (volatile unsigned char) rom[index - + 1]) { + } else if (timeout) { + printk("Program timed out\r\n"); + } - if(!access_ok(VERIFY_WRITE, user_bytes, FLASH_SIZE)) - return -EFAULT; - printk("Reading Flash"); - for (i=0; iRomImage[0]); + + if (!access_ok + (VERIFY_WRITE, user_bytes, FLASH_SIZE)) + return -EFAULT; + + printk("Reading Flash"); + for (i = 0; i < FLASH_SIZE; i++) { + unsigned char tmp_byte; + read_addr = kFlashBase + i; + tmp_byte = + *((volatile unsigned char *) + read_addr); + if (__put_user(tmp_byte, &user_bytes[i])) + return -EFAULT; + } + break; + } default: return 0; - break; + break; } @@ -517,7 +562,8 @@ { unsigned long buttons = GPIRead; - if ( (buttons == BUTTON_Next) || (buttons == BUTTON_Next_B) || (buttons == BUTTON_Reset_B) ) + if ((buttons == BUTTON_Next) || (buttons == BUTTON_Next_B) + || (buttons == BUTTON_Reset_B)) return buttons; return 0; } @@ -526,22 +572,23 @@ static int lcd_waiters = 0; -static long lcd_read(struct inode *inode, struct file *file, char *buf, unsigned long count) +static long lcd_read(struct inode *inode, struct file *file, char *buf, + unsigned long count) { long buttons_now; - if(lcd_waiters > 0) + if (lcd_waiters > 0) return -EINVAL; lcd_waiters++; - while(((buttons_now = (long)button_pressed()) == 0) && - !(signal_pending(current))) { + while (((buttons_now = (long) button_pressed()) == 0) && + !(signal_pending(current))) { current->state = TASK_INTERRUPTIBLE; schedule_timeout(2 * HZ); } lcd_waiters--; - if(signal_pending(current)) + if (signal_pending(current)) return -ERESTARTSYS; return buttons_now; } @@ -551,21 +598,20 @@ */ static struct file_operations lcd_fops = { - .read = lcd_read, - .ioctl = lcd_ioctl, - .open = lcd_open, + .read = lcd_read, + .ioctl = lcd_ioctl, + .open = lcd_open, }; -static struct miscdevice lcd_dev= -{ - LCD_MINOR, +static struct miscdevice lcd_dev = { + MISC_DYNAMIC_MINOR, "lcd", &lcd_fops }; -int lcd_init(void) +static int lcd_init(void) { -unsigned long data; + unsigned long data; printk("%s\n", LCD_DRIVER); misc_register(&lcd_dev); @@ -575,19 +621,22 @@ udelay(150); data = LCDReadData; - if ( (data & 0x000000FF) == (0x00) ) { + if ((data & 0x000000FF) == (0x00)) { lcd_present = 0; printk("LCD Not Present\n"); - } - else { + } else { lcd_present = 1; - WRITE_GAL( kGal_DevBank2PReg, kGal_DevBank2Cfg ); - WRITE_GAL( kGal_DevBank3PReg, kGal_DevBank3Cfg ); - } + WRITE_GAL(kGal_DevBank2PReg, kGal_DevBank2Cfg); + WRITE_GAL(kGal_DevBank3PReg, kGal_DevBank3Cfg); + } return 0; } +static void __exit lcd_exit(void) +{ + misc_deregister(&lcd_dev); +} // // Function: dqpoll @@ -600,17 +649,15 @@ // // -int dqpoll( volatile unsigned long address, volatile unsigned char data ) { - -volatile unsigned char dq7; - -dq7 = data & 0x80; +static int dqpoll(volatile unsigned long address, volatile unsigned char data) +{ + volatile unsigned char dq7; -return ( (READ_FLASH(address) & 0x80) == dq7 ); + dq7 = data & 0x80; + return ((READ_FLASH(address) & 0x80) == dq7); } - // // Function: timeout // @@ -622,12 +669,13 @@ // // Out: 0 = not timed out, 1 = timed out -int timeout( volatile unsigned long address ) { - - -return ( (READ_FLASH(address) & 0x20) == 0x20 ); - +static int timeout(volatile unsigned long address) +{ + return (READ_FLASH(address) & 0x20) == 0x20; } +module_init(lcd_init); +module_exit(lcd_exit); - +MODULE_AUTHOR("Andrew Bose"); +MODULE_LICENSE("GPL"); diff -Nru a/drivers/char/lcd.h b/drivers/char/lcd.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/char/lcd.h 2004-06-23 19:04:29 -07:00 @@ -0,0 +1,184 @@ +/* + * LED, LCD and Button panel driver for Cobalt + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1996, 1997 by Andrew Bose + * + * Linux kernel version history: + * March 2001: Ported from 2.0.34 by Liam Davies + * + */ + +// function headers + +static int dqpoll(volatile unsigned long, volatile unsigned char ); +static int timeout(volatile unsigned long); + +#define LCD_CHARS_PER_LINE 40 +#define FLASH_SIZE 524288 +#define MAX_IDLE_TIME 120 + +struct lcd_display { + unsigned long buttons; + int size1; + int size2; + unsigned char line1[LCD_CHARS_PER_LINE]; + unsigned char line2[LCD_CHARS_PER_LINE]; + unsigned char cursor_address; + unsigned char character; + unsigned char leds; + unsigned char *RomImage; +}; + + + +#define LCD_DRIVER "Cobalt LCD Driver v2.10" + +#define kLCD_IR 0x0F000000 +#define kLCD_DR 0x0F000010 +#define kGPI 0x0D000000 +#define kLED 0x0C000000 + +#define kDD_R00 0x00 +#define kDD_R01 0x27 +#define kDD_R10 0x40 +#define kDD_R11 0x67 + +#define kLCD_Addr 0x00000080 + +#define LCDTimeoutValue 0xfff + + +// Flash definitions AMD 29F040 +#define kFlashBase 0x0FC00000 + +#define kFlash_Addr1 0x5555 +#define kFlash_Addr2 0x2AAA +#define kFlash_Data1 0xAA +#define kFlash_Data2 0x55 +#define kFlash_Prog 0xA0 +#define kFlash_Erase3 0x80 +#define kFlash_Erase6 0x10 +#define kFlash_Read 0xF0 + +#define kFlash_ID 0x90 +#define kFlash_VenAddr 0x00 +#define kFlash_DevAddr 0x01 +#define kFlash_VenID 0x01 +#define kFlash_DevID 0xA4 // 29F040 +//#define kFlash_DevID 0xAD // 29F016 + + +// Macros + +#define LCDWriteData(x) outl((x << 24), kLCD_DR) +#define LCDWriteInst(x) outl((x << 24), kLCD_IR) + +#define LCDReadData (inl(kLCD_DR) >> 24) +#define LCDReadInst (inl(kLCD_IR) >> 24) + +#define GPIRead (inl(kGPI) >> 24) + +#define LEDSet(x) outb((char)x, kLED) + +#define WRITE_GAL(x,y) outl(y, 0x04000000 | (x)) +#define BusyCheck() while ((LCDReadInst & 0x80) == 0x80) + +#define WRITE_FLASH(x,y) outb((char)y, kFlashBase | (x)) +#define READ_FLASH(x) (inb(kFlashBase | (x))) + + + +/* + * Function command codes for io_ctl. + */ +#define LCD_On 1 +#define LCD_Off 2 +#define LCD_Clear 3 +#define LCD_Reset 4 +#define LCD_Cursor_Left 5 +#define LCD_Cursor_Right 6 +#define LCD_Disp_Left 7 +#define LCD_Disp_Right 8 +#define LCD_Get_Cursor 9 +#define LCD_Set_Cursor 10 +#define LCD_Home 11 +#define LCD_Read 12 +#define LCD_Write 13 +#define LCD_Cursor_Off 14 +#define LCD_Cursor_On 15 +#define LCD_Get_Cursor_Pos 16 +#define LCD_Set_Cursor_Pos 17 +#define LCD_Blink_Off 18 + +#define LED_Set 40 +#define LED_Bit_Set 41 +#define LED_Bit_Clear 42 + + +// Button defs +#define BUTTON_Read 50 + +// Flash command codes +#define FLASH_Erase 60 +#define FLASH_Burn 61 +#define FLASH_Read 62 + + +// Ethernet LINK check hackaroo +#define LINK_Check 90 +#define LINK_Check_2 91 + +// Button patterns _B - single layer lcd boards + +#define BUTTON_NONE 0x3F +#define BUTTON_NONE_B 0xFE + +#define BUTTON_Left 0x3B +#define BUTTON_Left_B 0xFA + +#define BUTTON_Right 0x37 +#define BUTTON_Right_B 0xDE + +#define BUTTON_Up 0x2F +#define BUTTON_Up_B 0xF6 + +#define BUTTON_Down 0x1F +#define BUTTON_Down_B 0xEE + +#define BUTTON_Next 0x3D +#define BUTTON_Next_B 0x7E + +#define BUTTON_Enter 0x3E +#define BUTTON_Enter_B 0xBE + +#define BUTTON_Reset_B 0xFC + + +// debounce constants + +#define BUTTON_SENSE 160000 +#define BUTTON_DEBOUNCE 5000 + + +// Galileo register stuff + +#define kGal_DevBank2Cfg 0x1466DB33 +#define kGal_DevBank2PReg 0x464 +#define kGal_DevBank3Cfg 0x146FDFFB +#define kGal_DevBank3PReg 0x468 + +// Network + +#define kIPADDR 1 +#define kNETMASK 2 +#define kGATEWAY 3 +#define kDNS 4 + +#define kClassA 5 +#define kClassB 6 +#define kClassC 7 + diff -Nru a/drivers/char/lp_old98.c b/drivers/char/lp_old98.c --- a/drivers/char/lp_old98.c 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,537 +0,0 @@ -/* - * linux/drivers/char/lp_old98.c - * - * printer port driver for ancient PC-9800s with no bidirectional port support - * - * Copyright (C) 1998,99 Kousuke Takai , - * Kyoto University Microcomputer Club - * - * This driver is based on and has compatibility with `lp.c', - * generic PC printer port driver. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* - * I/O port numbers - */ -#define LP_PORT_DATA 0x40 -#define LP_PORT_STATUS (LP_PORT_DATA + 2) -#define LP_PORT_STROBE (LP_PORT_DATA + 4) -#define LP_PORT_CONTROL (LP_PORT_DATA + 6) - -#define LP_PORT_H98MODE 0x0448 -#define LP_PORT_EXTMODE 0x0149 - -/* - * bit mask for I/O - */ -#define LP_MASK_nBUSY (1 << 2) -#define LP_MASK_nSTROBE (1 << 7) - -#define LP_CONTROL_ASSERT_STROBE (0x0e) -#define LP_CONTROL_NEGATE_STROBE (0x0f) - -/* - * Acceptable maximum value for non-privileged user for LPCHARS ioctl. - */ -#define LP_CHARS_NOPRIV_MAX 65535 - -#define DC1 '\x11' -#define DC3 '\x13' - -/* PC-9800s have at least and at most one old-style printer port. */ -static struct lp_struct lp = { - .flags = LP_EXIST | LP_ABORTOPEN, - .chars = LP_INIT_CHAR, - .time = LP_INIT_TIME, - .wait = LP_INIT_WAIT, -}; - -static int dc1_check; -static spinlock_t lp_old98_lock = SPIN_LOCK_UNLOCKED; - - -#undef LP_OLD98_DEBUG - -#ifdef CONFIG_PC9800_OLDLP_CONSOLE -static struct console lp_old98_console; /* defined later */ -static short saved_console_flags; -#endif - -static DECLARE_WAIT_QUEUE_HEAD (lp_old98_waitq); - -static void lp_old98_timer_function(unsigned long data) -{ - if (inb(LP_PORT_STATUS) & LP_MASK_nBUSY) - wake_up_interruptible(&lp_old98_waitq); - else { - struct timer_list *t = (struct timer_list *) data; - - t->expires = jiffies + 1; - add_timer(t); - } -} - -static inline int lp_old98_wait_ready(void) -{ - struct timer_list timer; - - init_timer(&timer); - timer.function = lp_old98_timer_function; - timer.expires = jiffies + 1; - timer.data = (unsigned long)&timer; - add_timer(&timer); - interruptible_sleep_on(&lp_old98_waitq); - del_timer(&timer); - return signal_pending(current); -} - -static inline int lp_old98_char(char lpchar) -{ - unsigned long count = 0; -#ifdef LP_STATS - int tmp; -#endif - - while (!(inb(LP_PORT_STATUS) & LP_MASK_nBUSY)) { - count++; - if (count >= lp.chars) - return 0; - } - - outb(lpchar, LP_PORT_DATA); - -#ifdef LP_STATS - /* - * Update lp statsistics here (and between next two outb()'s). - * Time to compute it is part of storobe delay. - */ - if (count > lp.stats.maxwait) { -#ifdef LP_OLD98_DEBUG - printk(KERN_DEBUG "lp_old98: success after %d counts.\n", - count); -#endif - lp.stats.maxwait = count; - } - count *= 256; - tmp = count - lp.stats.meanwait; - if (tmp < 0) - tmp = -tmp; -#endif - ndelay(lp.wait); - - /* negate PSTB# (activate strobe) */ - outb(LP_CONTROL_ASSERT_STROBE, LP_PORT_CONTROL); - -#ifdef LP_STATS - lp.stats.meanwait = (255 * lp.stats.meanwait + count + 128) / 256; - lp.stats.mdev = (127 * lp.stats.mdev + tmp + 64) / 128; - lp.stats.chars ++; -#endif - - ndelay(lp.wait); - - /* assert PSTB# (deactivate strobe) */ - outb(LP_CONTROL_NEGATE_STROBE, LP_PORT_CONTROL); - - return 1; -} - -static ssize_t lp_old98_write(struct file * file, - const char * buf, size_t count, - loff_t *dummy) -{ - unsigned long total_bytes_written = 0; - - if (!access_ok(VERIFY_READ, buf, count)) - return -EFAULT; - -#ifdef LP_STATS - if (jiffies - lp.lastcall > lp.time) - lp.runchars = 0; - lp.lastcall = jiffies; -#endif - - do { - unsigned long bytes_written = 0; - unsigned long copy_size - = (count < LP_BUFFER_SIZE ? count : LP_BUFFER_SIZE); - - if (__copy_from_user(lp.lp_buffer, buf, copy_size)) - return -EFAULT; - - while (bytes_written < copy_size) { - if (lp_old98_char(lp.lp_buffer[bytes_written])) - bytes_written ++; - else { -#ifdef LP_STATS - int rc = lp.runchars + bytes_written; - - if (rc > lp.stats.maxrun) - lp.stats.maxrun = rc; - - lp.stats.sleeps ++; -#endif -#ifdef LP_OLD98_DEBUG - printk(KERN_DEBUG - "lp_old98: sleeping at %d characters" - " for %d jiffies\n", - lp.runchars, lp.time); - lp.runchars = 0; -#endif - if (lp_old98_wait_ready()) - return ((total_bytes_written - + bytes_written) - ? : -EINTR); - } - } - total_bytes_written += bytes_written; - buf += bytes_written; -#ifdef LP_STATS - lp.runchars += bytes_written; -#endif - count -= bytes_written; - } while (count > 0); - - return total_bytes_written; -} - -static int lp_old98_open(struct inode * inode, struct file * file) -{ - if (iminor(inode) != 0) - return -ENXIO; - - if (lp.flags & LP_BUSY) - return -EBUSY; - - if (dc1_check && (lp.flags & LP_ABORTOPEN) - && !(file->f_flags & O_NONBLOCK)) { - /* - * Check whether printer is on-line. - * PC-9800's old style port have only BUSY# as status input, - * so that it is impossible to distinguish that the printer is - * ready and that the printer is off-line or not connected - * (in both case BUSY# is in the same state). So: - * - * (1) output DC1 (0x11) to printer port and do strobe. - * (2) watch BUSY# line for a while. If BUSY# is pulled - * down, the printer will be ready. Otherwise, - * it will be off-line (or not connected, or power-off, - * ...). - * - * The source of this procedure: - * Terumasa KODAKA, Kazufumi SHIMIZU, Yu HAYAMI: - * `PC-9801 Super Technique', Ascii, 1992. - */ - int count; - unsigned long flags; - - /* interrupts while check is fairly bad */ - spin_lock_irqsave(&lp_old98_lock, flags); - - if (!lp_old98_char(DC1)) { - spin_unlock_irqrestore(&lp_old98_lock, flags); - return -EBUSY; - } - count = (unsigned int)dc1_check > 10000 ? 10000 : dc1_check; - while (inb(LP_PORT_STATUS) & LP_MASK_nBUSY) { - if (--count == 0) { - spin_unlock_irqrestore(&lp_old98_lock, flags); - return -ENODEV; - } - } - spin_unlock_irqrestore(&lp_old98_lock, flags); - } - - if ((lp.lp_buffer = kmalloc(LP_BUFFER_SIZE, GFP_KERNEL)) == NULL) - return -ENOMEM; - - lp.flags |= LP_BUSY; - -#ifdef CONFIG_PC9800_OLDLP_CONSOLE - saved_console_flags = lp_old98_console.flags; - lp_old98_console.flags &= ~CON_ENABLED; -#endif - return 0; -} - -static int lp_old98_release(struct inode * inode, struct file * file) -{ - kfree(lp.lp_buffer); - lp.lp_buffer = NULL; - lp.flags &= ~LP_BUSY; -#ifdef CONFIG_PC9800_OLDLP_CONSOLE - lp_old98_console.flags = saved_console_flags; -#endif - return 0; -} - -static int lp_old98_init_device(void) -{ - unsigned char data; - - if ((data = inb(LP_PORT_EXTMODE)) != 0xFF && (data & 0x10)) { - printk(KERN_INFO - "lp_old98: shutting down extended parallel port mode...\n"); - outb(data & ~0x10, LP_PORT_EXTMODE); - } -#ifdef PC98_HW_H98 - if ((pc98_hw_flags & PC98_HW_H98) - && ((data = inb(LP_PORT_H98MODE)) & 0x01)) { - printk(KERN_INFO - "lp_old98: shutting down H98 full centronics mode...\n"); - outb(data & ~0x01, LP_PORT_H98MODE); - } -#endif - return 0; -} - -static int lp_old98_ioctl(struct inode *inode, struct file *file, - unsigned int command, unsigned long arg) -{ - int retval = 0; - - switch (command) { - case LPTIME: - lp.time = arg * HZ/100; - break; - case LPCHAR: - lp.chars = arg; - break; - case LPABORT: - if (arg) - lp.flags |= LP_ABORT; - else - lp.flags &= ~LP_ABORT; - break; - case LPABORTOPEN: - if (arg) - lp.flags |= LP_ABORTOPEN; - else - lp.flags &= ~LP_ABORTOPEN; - break; - case LPCAREFUL: - /* do nothing */ - break; - case LPWAIT: - lp.wait = arg; - break; - case LPGETIRQ: - retval = put_user(0, (int *)arg); - break; - case LPGETSTATUS: - /* - * convert PC-9800's status to IBM PC's one, so that tunelp(8) - * works in the same way on this driver. - */ - retval = put_user((inb(LP_PORT_STATUS) & LP_MASK_nBUSY) - ? (LP_PBUSY | LP_PERRORP) : LP_PERRORP, - (int *)arg); - break; - case LPRESET: - retval = lp_old98_init_device(); - break; -#ifdef LP_STATS - case LPGETSTATS: - if (copy_to_user((struct lp_stats *)arg, &lp.stats, - sizeof(struct lp_stats))) - retval = -EFAULT; - else if (suser()) - memset(&lp.stats, 0, sizeof(struct lp_stats)); - break; -#endif - case LPGETFLAGS: - retval = put_user(lp.flags, (int *)arg); - break; - case LPSETIRQ: - default: - retval = -EINVAL; - } - return retval; -} - -static struct file_operations lp_old98_fops = { - .owner = THIS_MODULE, - .write = lp_old98_write, - .ioctl = lp_old98_ioctl, - .open = lp_old98_open, - .release = lp_old98_release, -}; - -/* - * Support for console on lp_old98 - */ -#ifdef CONFIG_PC9800_OLDLP_CONSOLE - -static inline void io_delay(void) -{ - unsigned char dummy; /* actually not output */ - - asm volatile ("out%B0 %0,%1" : "=a"(dummy) : "N"(0x5f)); -} - -static void lp_old98_console_write(struct console *console, - const char *s, unsigned int count) -{ - int i; - static unsigned int timeout_run = 0; - - while (count) { - /* wait approx 1.2 seconds */ - for (i = 2000000; !(inb(LP_PORT_STATUS) & LP_MASK_nBUSY); - io_delay()) - if (!--i) { - if (++timeout_run >= 10) - /* disable forever... */ - console->flags &= ~CON_ENABLED; - return; - } - - timeout_run = 0; - - if (*s == '\n') { - outb('\r', LP_PORT_DATA); - io_delay(); - io_delay(); - outb(LP_CONTROL_ASSERT_STROBE, LP_PORT_CONTROL); - io_delay(); - io_delay(); - outb(LP_CONTROL_NEGATE_STROBE, LP_PORT_CONTROL); - io_delay(); - io_delay(); - for (i = 1000000; - !(inb(LP_PORT_STATUS) & LP_MASK_nBUSY); - io_delay()) - if (!--i) - return; - } - - outb(*s++, LP_PORT_DATA); - io_delay(); - io_delay(); - outb(LP_CONTROL_ASSERT_STROBE, LP_PORT_CONTROL); - io_delay(); - io_delay(); - outb(LP_CONTROL_NEGATE_STROBE, LP_PORT_CONTROL); - io_delay(); - io_delay(); - - --count; - } -} - -static struct console lp_old98_console = { - .name = "lp_old98", - .write = lp_old98_console_write, - .flags = CON_PRINTBUFFER, - .index = -1, -}; - -#endif /* console on lp_old98 */ - -static int __init lp_old98_init(void) -{ - char *errmsg = "I/O ports already occupied, giving up."; - -#ifdef PC98_HW_H98 - if (pc98_hw_flags & PC98_HW_H98) - if (!request_region(LP_PORT_H98MODE, 1, "lp_old98") - goto err1; -#endif - if (!request_region(LP_PORT_DATA, 1, "lp_old98")) - goto err2; - if (!request_region(LP_PORT_STATUS, 1, "lp_old98")) - goto err3; - if (!request_region(LP_PORT_STROBE, 1, "lp_old98")) - goto err4; - if (!request_region(LP_PORT_EXTMODE, 1, "lp_old98")) - goto err5; - if (!register_chrdev(LP_MAJOR, "lp", &lp_old98_fops)) { -#ifdef CONFIG_PC9800_OLDLP_CONSOLE - register_console(&lp_old98_console); - printk(KERN_INFO "lp_old98: console ready\n"); -#endif - /* - * rest are not needed by this driver, - * but for locking out other printer drivers... - */ - lp_old98_init_device(); - return 0; - } else - errmsg = "unable to register device"; - - release_region(LP_PORT_EXTMODE, 1); -err5: - release_region(LP_PORT_STROBE, 1); -err4: - release_region(LP_PORT_STATUS, 1); -err3: - release_region(LP_PORT_DATA, 1); -err2: -#ifdef PC98_HW_H98 - if (pc98_hw_flags & PC98_HW_H98) - release_region(LP_PORT_H98MODE, 1); - -err1: -#endif - printk(KERN_ERR "lp_old98: %s\n", errmsg); - return -EBUSY; -} - -static void __exit lp_old98_exit(void) -{ -#ifdef CONFIG_PC9800_OLDLP_CONSOLE - unregister_console(&lp_old98_console); -#endif - unregister_chrdev(LP_MAJOR, "lp"); - - release_region(LP_PORT_DATA, 1); - release_region(LP_PORT_STATUS, 1); - release_region(LP_PORT_STROBE, 1); -#ifdef PC98_HW_H98 - if (pc98_hw_flags & PC98_HW_H98) - release_region(LP_PORT_H98MODE, 1); -#endif - release_region(LP_PORT_EXTMODE, 1); -} - -#ifndef MODULE -static int __init lp_old98_setup(char *str) -{ - int ints[4]; - - str = get_options(str, ARRAY_SIZE(ints), ints); - if (ints[0] > 0) - dc1_check = ints[1]; - return 1; -} -__setup("lp_old98_dc1_check=", lp_old98_setup); -#endif - -MODULE_PARM(dc1_check, "i"); -MODULE_AUTHOR("Kousuke Takai "); -MODULE_DESCRIPTION("PC-9800 old printer port driver"); -MODULE_LICENSE("GPL"); - -module_init(lp_old98_init); -module_exit(lp_old98_exit); diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c --- a/drivers/char/mem.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/mem.c 2004-06-23 19:04:27 -07:00 @@ -26,7 +26,6 @@ #include #include -#include #ifdef CONFIG_IA64 # include diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c --- a/drivers/char/misc.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/misc.c 2004-06-23 19:04:28 -07:00 @@ -63,13 +63,8 @@ #define DYNAMIC_MINORS 64 /* like dynamic majors */ static unsigned char misc_minors[DYNAMIC_MINORS / 8]; -#ifdef CONFIG_SGI_NEWPORT_GFX -extern void gfx_register(void); -#endif -extern void streamable_init(void); extern int rtc_DP8570A_init(void); extern int rtc_MK48T08_init(void); -extern int ds1286_init(void); extern int pmu_device_init(void); extern int tosh_init(void); extern int i8k_init(void); @@ -318,20 +313,8 @@ #ifdef CONFIG_BVME6000 rtc_DP8570A_init(); #endif -#ifdef CONFIG_SGI_DS1286 - ds1286_init(); -#endif #ifdef CONFIG_PMAC_PBOOK pmu_device_init(); -#endif -#ifdef CONFIG_SGI_NEWPORT_GFX - gfx_register (); -#endif -#ifdef CONFIG_SGI_IP22 - streamable_init (); -#endif -#ifdef CONFIG_SGI_NEWPORT_GFX - gfx_register (); #endif #ifdef CONFIG_TOSHIBA tosh_init(); diff -Nru a/drivers/char/mwave/3780i.c b/drivers/char/mwave/3780i.c --- a/drivers/char/mwave/3780i.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/mwave/3780i.c 2004-06-23 19:04:28 -07:00 @@ -467,10 +467,10 @@ } -int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr) { - unsigned short *pusBuffer = pvBuffer; + unsigned short __user *pusBuffer = pvBuffer; unsigned short val; @@ -508,10 +508,10 @@ } int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO, - void *pvBuffer, unsigned uCount, + void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr) { - unsigned short *pusBuffer = pvBuffer; + unsigned short __user *pusBuffer = pvBuffer; unsigned short val; @@ -549,10 +549,10 @@ } -int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr) { - unsigned short *pusBuffer = pvBuffer; + unsigned short __user *pusBuffer = pvBuffer; PRINTK_5(TRACE_3780I, @@ -590,10 +590,10 @@ } -int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr) { - unsigned short *pusBuffer = pvBuffer; + unsigned short __user *pusBuffer = pvBuffer; PRINTK_5(TRACE_3780I, "3780i::dsp3780I_ReadIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n", @@ -637,10 +637,10 @@ } -int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr) { - unsigned short *pusBuffer = pvBuffer; + unsigned short __user *pusBuffer = pvBuffer; PRINTK_5(TRACE_3780I, "3780i::dsp3780I_WriteIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n", diff -Nru a/drivers/char/mwave/3780i.h b/drivers/char/mwave/3780i.h --- a/drivers/char/mwave/3780i.h 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/mwave/3780i.h 2004-06-23 19:04:27 -07:00 @@ -323,16 +323,16 @@ int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings); int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings); int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings); -int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr); int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO, - void *pvBuffer, unsigned uCount, + void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr); -int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr); -int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr); -int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer, +int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer, unsigned uCount, unsigned long ulDSPAddr); unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO, unsigned long ulMsaAddr); diff -Nru a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c --- a/drivers/char/mwave/mwavedd.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/mwave/mwavedd.c 2004-06-23 19:04:26 -07:00 @@ -121,6 +121,7 @@ { unsigned int retval = 0; pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd; + void __user *arg = (void __user *)ioarg; PRINTK_5(TRACE_MWAVE, "mwavedd::mwave_ioctl, entry inode %x file %x cmd %x arg %x\n", @@ -164,8 +165,7 @@ " retval %x from tp3780I_QueryAbilities\n", retval); if (retval == 0) { - if( copy_to_user((char *) ioarg, - (char *) &rAbilities, + if( copy_to_user(arg, &rAbilities, sizeof(MW_ABILITIES)) ) return -EFAULT; } @@ -179,13 +179,12 @@ case IOCTL_MW_READ_DATA: case IOCTL_MW_READCLEAR_DATA: { MW_READWRITE rReadData; - unsigned short *pusBuffer = 0; + unsigned short __user *pusBuffer = 0; - if( copy_from_user((char *) &rReadData, - (char *) ioarg, + if( copy_from_user(&rReadData, arg, sizeof(MW_READWRITE)) ) return -EFAULT; - pusBuffer = (unsigned short *) (rReadData.pBuf); + pusBuffer = (unsigned short __user *) (rReadData.pBuf); PRINTK_4(TRACE_MWAVE, "mwavedd::mwave_ioctl IOCTL_MW_READ_DATA," @@ -193,7 +192,7 @@ rReadData.ulDataLength, ioarg, pusBuffer); retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData, iocmd, - (void *) pusBuffer, + pusBuffer, rReadData.ulDataLength, rReadData.usDspAddress); } @@ -201,12 +200,12 @@ case IOCTL_MW_READ_INST: { MW_READWRITE rReadData; - unsigned short *pusBuffer = 0; + unsigned short __user *pusBuffer = 0; - if( copy_from_user((char *) &rReadData, (char *) ioarg, + if( copy_from_user(&rReadData, arg, sizeof(MW_READWRITE)) ) return -EFAULT; - pusBuffer = (unsigned short *) (rReadData.pBuf); + pusBuffer = (unsigned short __user *) (rReadData.pBuf); PRINTK_4(TRACE_MWAVE, "mwavedd::mwave_ioctl IOCTL_MW_READ_INST," @@ -222,13 +221,12 @@ case IOCTL_MW_WRITE_DATA: { MW_READWRITE rWriteData; - unsigned short *pusBuffer = 0; + unsigned short __user *pusBuffer = 0; - if( copy_from_user((char *) &rWriteData, - (char *) ioarg, + if( copy_from_user(&rWriteData, arg, sizeof(MW_READWRITE)) ) return -EFAULT; - pusBuffer = (unsigned short *) (rWriteData.pBuf); + pusBuffer = (unsigned short __user *) (rWriteData.pBuf); PRINTK_4(TRACE_MWAVE, "mwavedd::mwave_ioctl IOCTL_MW_WRITE_DATA," @@ -244,13 +242,12 @@ case IOCTL_MW_WRITE_INST: { MW_READWRITE rWriteData; - unsigned short *pusBuffer = 0; + unsigned short __user *pusBuffer = 0; - if( copy_from_user((char *) &rWriteData, - (char *) ioarg, + if( copy_from_user(&rWriteData, arg, sizeof(MW_READWRITE)) ) return -EFAULT; - pusBuffer = (unsigned short *) (rWriteData.pBuf); + pusBuffer = (unsigned short __user *)(rWriteData.pBuf); PRINTK_4(TRACE_MWAVE, "mwavedd::mwave_ioctl IOCTL_MW_WRITE_INST," @@ -388,7 +385,7 @@ } -static ssize_t mwave_read(struct file *file, char *buf, size_t count, +static ssize_t mwave_read(struct file *file, char __user *buf, size_t count, loff_t * ppos) { PRINTK_5(TRACE_MWAVE, @@ -399,7 +396,7 @@ } -static ssize_t mwave_write(struct file *file, const char *buf, +static ssize_t mwave_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos) { PRINTK_5(TRACE_MWAVE, diff -Nru a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c --- a/drivers/char/mwave/tp3780i.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/mwave/tp3780i.c 2004-06-23 19:04:25 -07:00 @@ -522,7 +522,7 @@ } int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode, - void *pvBuffer, unsigned int uCount, + void __user *pvBuffer, unsigned int uCount, unsigned long ulDSPAddr) { int retval = 0; @@ -558,7 +558,7 @@ int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode, - void *pvBuffer, unsigned int uCount, + void __user *pvBuffer, unsigned int uCount, unsigned long ulDSPAddr) { int retval = 0; diff -Nru a/drivers/char/mwave/tp3780i.h b/drivers/char/mwave/tp3780i.h --- a/drivers/char/mwave/tp3780i.h 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/mwave/tp3780i.h 2004-06-23 19:04:25 -07:00 @@ -93,10 +93,10 @@ int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities); int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData); int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode, - void *pvBuffer, unsigned int uCount, + void __user *pvBuffer, unsigned int uCount, unsigned long ulDSPAddr); int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode, - void *pvBuffer, unsigned int uCount, + void __user *pvBuffer, unsigned int uCount, unsigned long ulDSPAddr); diff -Nru a/drivers/char/raw.c b/drivers/char/raw.c --- a/drivers/char/raw.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/raw.c 2004-06-23 19:04:27 -07:00 @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -26,6 +27,7 @@ int inuse; }; +static struct class_simple *raw_class; static struct raw_device_data raw_devices[MAX_RAW_MINORS]; static DECLARE_MUTEX(raw_mutex); static struct file_operations raw_ctl_fops; /* forward declaration */ @@ -123,6 +125,13 @@ return ioctl_by_bdev(bdev, command, arg); } +static void bind_device(struct raw_config_request rq) +{ + class_simple_device_remove(MKDEV(RAW_MAJOR, rq.raw_minor)); + class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, rq.raw_minor), + NULL, "raw%d", rq.raw_minor); +} + /* * Deal with ioctls against the raw-device control interface, to bind * and unbind other raw devices. @@ -191,12 +200,15 @@ if (rq.block_major == 0 && rq.block_minor == 0) { /* unbind */ rawdev->binding = NULL; + class_simple_device_remove(MKDEV(RAW_MAJOR, rq.raw_minor)); } else { rawdev->binding = bdget(dev); if (rawdev->binding == NULL) err = -ENOMEM; - else + else { __module_get(THIS_MODULE); + bind_device(rq); + } } up(&raw_mutex); } else { @@ -287,6 +299,15 @@ goto error; } + raw_class = class_simple_create(THIS_MODULE, "raw"); + if (IS_ERR(raw_class)) { + printk(KERN_ERR "Error creating raw class.\n"); + cdev_del(&raw_cdev); + unregister_chrdev_region(dev, MAX_RAW_MINORS); + goto error; + } + class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); + devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), S_IFCHR | S_IRUGO | S_IWUGO, "raw/rawctl"); @@ -309,6 +330,8 @@ devfs_remove("raw/raw%d", i); devfs_remove("raw/rawctl"); devfs_remove("raw"); + class_simple_device_remove(MKDEV(RAW_MAJOR, 0)); + class_simple_destroy(raw_class); cdev_del(&raw_cdev); unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); } diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c --- a/drivers/char/rtc.c 2004-06-23 19:04:29 -07:00 +++ b/drivers/char/rtc.c 2004-06-23 19:04:29 -07:00 @@ -97,6 +97,11 @@ static int rtc_irq = PCI_IRQ_NONE; #endif +#ifdef CONFIG_HPET_RTC_IRQ +#undef RTC_IRQ +#define RTC_IRQ 0 +#endif + #ifdef RTC_IRQ static int rtc_has_irq = 1; #endif diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c --- a/drivers/char/synclinkmp.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/synclinkmp.c 2004-06-23 19:04:25 -07:00 @@ -567,17 +567,17 @@ /* ioctl handlers */ -static int get_stats(SLMP_INFO *info, struct mgsl_icount *user_icount); -static int get_params(SLMP_INFO *info, MGSL_PARAMS *params); -static int set_params(SLMP_INFO *info, MGSL_PARAMS *params); -static int get_txidle(SLMP_INFO *info, int*idle_mode); +static int get_stats(SLMP_INFO *info, struct mgsl_icount __user *user_icount); +static int get_params(SLMP_INFO *info, MGSL_PARAMS __user *params); +static int set_params(SLMP_INFO *info, MGSL_PARAMS __user *params); +static int get_txidle(SLMP_INFO *info, int __user *idle_mode); static int set_txidle(SLMP_INFO *info, int idle_mode); static int tx_enable(SLMP_INFO *info, int enable); static int tx_abort(SLMP_INFO *info); static int rx_enable(SLMP_INFO *info, int enable); static int map_status(int signals); static int modem_input_wait(SLMP_INFO *info,int arg); -static int wait_mgsl_event(SLMP_INFO *info, int *mask_ptr); +static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr); static int tiocmget(struct tty_struct *tty, struct file *file); static int tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear); @@ -692,7 +692,7 @@ * This allows remote debugging of dynamically loadable modules. */ static void* synclinkmp_get_text_ptr(void); -static void* synclinkmp_get_text_ptr() {return synclinkmp_get_text_ptr;} +static void* synclinkmp_get_text_ptr(void) {return synclinkmp_get_text_ptr;} static inline int sanity_check(SLMP_INFO *info, char *name, const char *routine) @@ -1333,8 +1333,9 @@ SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; int error; struct mgsl_icount cnow; /* kernel counter temps */ - struct serial_icounter_struct *p_cuser; /* user space */ + struct serial_icounter_struct __user *p_cuser; /* user space */ unsigned long flags; + void __user *argp = (void __user *)arg; if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s ioctl() cmd=%08X\n", __FILE__,__LINE__, @@ -1351,23 +1352,23 @@ switch (cmd) { case MGSL_IOCGPARAMS: - return get_params(info,(MGSL_PARAMS *)arg); + return get_params(info, argp); case MGSL_IOCSPARAMS: - return set_params(info,(MGSL_PARAMS *)arg); + return set_params(info, argp); case MGSL_IOCGTXIDLE: - return get_txidle(info,(int*)arg); + return get_txidle(info, argp); case MGSL_IOCSTXIDLE: - return set_txidle(info,(int)arg); + return set_txidle(info, (int)arg); case MGSL_IOCTXENABLE: - return tx_enable(info,(int)arg); + return tx_enable(info, (int)arg); case MGSL_IOCRXENABLE: - return rx_enable(info,(int)arg); + return rx_enable(info, (int)arg); case MGSL_IOCTXABORT: return tx_abort(info); case MGSL_IOCGSTATS: - return get_stats(info,(struct mgsl_icount*)arg); + return get_stats(info, argp); case MGSL_IOCWAITEVENT: - return wait_mgsl_event(info,(int*)arg); + return wait_mgsl_event(info, argp); case MGSL_IOCLOOPTXDONE: return 0; // TODO: Not supported, need to document /* Wait for modem input (DCD,RI,DSR,CTS) change @@ -1386,7 +1387,7 @@ spin_lock_irqsave(&info->lock,flags); cnow = info->icount; spin_unlock_irqrestore(&info->lock,flags); - p_cuser = (struct serial_icounter_struct *) arg; + p_cuser = argp; PUT_USER(error,cnow.cts, &p_cuser->cts); if (error) return error; PUT_USER(error,cnow.dsr, &p_cuser->dsr); @@ -2762,7 +2763,7 @@ program_hw(info); } -static int get_stats(SLMP_INFO * info, struct mgsl_icount *user_icount) +static int get_stats(SLMP_INFO * info, struct mgsl_icount __user *user_icount) { int err; @@ -2781,7 +2782,7 @@ return 0; } -static int get_params(SLMP_INFO * info, MGSL_PARAMS *user_params) +static int get_params(SLMP_INFO * info, MGSL_PARAMS __user *user_params) { int err; if (debug_level >= DEBUG_LEVEL_INFO) @@ -2799,7 +2800,7 @@ return 0; } -static int set_params(SLMP_INFO * info, MGSL_PARAMS *new_params) +static int set_params(SLMP_INFO * info, MGSL_PARAMS __user *new_params) { unsigned long flags; MGSL_PARAMS tmp_params; @@ -2825,7 +2826,7 @@ return 0; } -static int get_txidle(SLMP_INFO * info, int*idle_mode) +static int get_txidle(SLMP_INFO * info, int __user *idle_mode) { int err; @@ -2938,7 +2939,7 @@ /* wait for specified event to occur */ -static int wait_mgsl_event(SLMP_INFO * info, int * mask_ptr) +static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr) { unsigned long flags; int s; diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c --- a/drivers/char/tty_io.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/tty_io.c 2004-06-23 19:04:27 -07:00 @@ -91,6 +91,7 @@ #include #include #include +#include #include #include @@ -128,6 +129,8 @@ #ifdef CONFIG_UNIX98_PTYS extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */ extern int pty_limit; /* Config limit on Unix98 ptys */ +static DEFINE_IDR(allocated_ptys); +static DECLARE_MUTEX(allocated_ptys_lock); #endif extern void disable_early_printk(void); @@ -1065,6 +1068,7 @@ { struct tty_struct *tty, *o_tty; int pty_master, tty_closing, o_tty_closing, do_sleep; + int devpts_master; int idx; char buf[64]; @@ -1079,6 +1083,7 @@ idx = tty->index; pty_master = (tty->driver->type == TTY_DRIVER_TYPE_PTY && tty->driver->subtype == PTY_TYPE_MASTER); + devpts_master = pty_master && (tty->driver->flags & TTY_DRIVER_DEVPTS_MEM); o_tty = tty->link; #ifdef TTY_PARANOIA_CHECK @@ -1295,11 +1300,21 @@ o_tty->ldisc = ldiscs[N_TTY]; } - /* + /* * The release_mem function takes care of the details of clearing * the slots and preserving the termios structure. */ release_mem(tty, idx); + +#ifdef CONFIG_UNIX98_PTYS + /* Make this pty number available for reallocation */ + if (devpts_master) { + down(&allocated_ptys_lock); + idr_remove(&allocated_ptys, idx); + up(&allocated_ptys_lock); + } +#endif + } /* @@ -1322,8 +1337,12 @@ int index; dev_t device = inode->i_rdev; unsigned short saved_flags = filp->f_flags; + retry_open: noctty = filp->f_flags & O_NOCTTY; + index = -1; + retval = 0; + if (device == MKDEV(TTYAUX_MAJOR,0)) { if (!current->signal->tty) return -ENXIO; @@ -1361,24 +1380,40 @@ #ifdef CONFIG_UNIX98_PTYS if (device == MKDEV(TTYAUX_MAJOR,2)) { + int idr_ret; + /* find a device that is not in use. */ - static int next_ptmx_dev = 0; - retval = -1; + down(&allocated_ptys_lock); + if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) { + up(&allocated_ptys_lock); + return -ENOMEM; + } + idr_ret = idr_get_new(&allocated_ptys, NULL, &index); + if (idr_ret < 0) { + up(&allocated_ptys_lock); + if (idr_ret == -EAGAIN) + return -ENOMEM; + return -EIO; + } + if (index >= pty_limit) { + idr_remove(&allocated_ptys, index); + up(&allocated_ptys_lock); + return -EIO; + } + up(&allocated_ptys_lock); + driver = ptm_driver; - while (driver->refcount < pty_limit) { - index = next_ptmx_dev; - next_ptmx_dev = (next_ptmx_dev+1) % driver->num; - if (!init_dev(driver, index, &tty)) - goto ptmx_found; /* ok! */ + retval = init_dev(driver, index, &tty); + if (retval) { + down(&allocated_ptys_lock); + idr_remove(&allocated_ptys, index); + up(&allocated_ptys_lock); + return retval; } - return -EIO; /* no free ptys */ - ptmx_found: + set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ - if (devpts_pty_new(tty->link)) { - /* BADNESS - need to destroy both ptm and pts! */ - return -ENOMEM; - } - noctty = 1; + if (devpts_pty_new(tty->link)) + retval = -ENOMEM; } else #endif { @@ -1400,10 +1435,12 @@ #ifdef TTY_DEBUG_HANGUP printk(KERN_DEBUG "opening %s...", tty->name); #endif - if (tty->driver->open) - retval = tty->driver->open(tty, filp); - else - retval = -ENODEV; + if (!retval) { + if (tty->driver->open) + retval = tty->driver->open(tty, filp); + else + retval = -ENODEV; + } filp->f_flags = saved_flags; if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && !capable(CAP_SYS_ADMIN)) @@ -1413,6 +1450,14 @@ #ifdef TTY_DEBUG_HANGUP printk(KERN_DEBUG "error %d in opening %s...", retval, tty->name); +#endif + +#ifdef CONFIG_UNIX98_PTYS + if (index != -1) { + down(&allocated_ptys_lock); + idr_remove(&allocated_ptys, index); + up(&allocated_ptys_lock); + } #endif release_dev(filp); diff -Nru a/drivers/char/upd4990a.c b/drivers/char/upd4990a.c --- a/drivers/char/upd4990a.c 2004-06-23 19:04:26 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,432 +0,0 @@ -/* - * NEC PC-9800 Real Time Clock interface for Linux - * - * Copyright (C) 1997-2001 Linux/98 project, - * Kyoto University Microcomputer Club. - * - * Based on: - * drivers/char/rtc.c by Paul Gortmaker - * - * Changes: - * 2001-02-09 Call check_region on rtc_init and do not request I/O 0033h. - * Call del_timer and release_region on rtc_exit. -- tak - * 2001-07-14 Rewrite and split to - * and . - * Introduce a lot of spin_lock/unlock (&rtc_lock). - */ - -#define RTC98_VERSION "1.2" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * We sponge a minor off of the misc major. No need slurping - * up another valuable major dev number for this. If you add - * an ioctl, make sure you don't conflict with SPARC's RTC - * ioctls. - */ - -static struct fasync_struct *rtc_async_queue; - -static DECLARE_WAIT_QUEUE_HEAD(rtc_wait); - -static struct timer_list rtc_uie_timer; -static u8 old_refclk; - -static int rtc_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg); - -static int rtc_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data); - -/* - * Bits in rtc_status. (5 bits of room for future expansion) - */ - -#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */ -#define RTC_TIMER_ON 0x02 /* not used */ -#define RTC_UIE_TIMER_ON 0x04 /* UIE emulation timer is active */ - -/* - * rtc_status is never changed by rtc_interrupt, and ioctl/open/close is - * protected by the big kernel lock. However, ioctl can still disable the timer - * in rtc_status and then with del_timer after the interrupt has read - * rtc_status but before mod_timer is called, which would then reenable the - * timer (but you would need to have an awful timing before you'd trip on it) - */ -static unsigned char rtc_status; /* bitmapped status byte. */ -static unsigned long rtc_irq_data; /* our output to the world */ - -static const unsigned char days_in_mo[] = -{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - -extern spinlock_t rtc_lock; /* defined in arch/i386/kernel/time.c */ - -static void rtc_uie_intr(unsigned long data) -{ - u8 refclk, tmp; - - /* Kernel timer does del_timer internally before calling - each timer entry, so this is unnecessary. - del_timer(&rtc_uie_timer); */ - spin_lock(&rtc_lock); - - /* Detect rising edge of 1Hz reference clock. */ - refclk = UPD4990A_READ_DATA(); - tmp = old_refclk & refclk; - old_refclk = ~refclk; - if (!(tmp & 1)) - rtc_irq_data += 0x100; - - spin_unlock(&rtc_lock); - - if (!(tmp & 1)) { - /* Now do the rest of the actions */ - wake_up_interruptible(&rtc_wait); - kill_fasync(&rtc_async_queue, SIGIO, POLL_IN); - } - - rtc_uie_timer.expires = jiffies + 1; - add_timer(&rtc_uie_timer); -} - -/* - * Now all the various file operations that we export. - */ - -static ssize_t rtc_read(struct file *file, char *buf, - size_t count, loff_t *ppos) -{ - DECLARE_WAITQUEUE(wait, current); - unsigned long data; - ssize_t retval = 0; - - if (count < sizeof(unsigned long)) - return -EINVAL; - - add_wait_queue(&rtc_wait, &wait); - - set_current_state(TASK_INTERRUPTIBLE); - - do { - /* First make it right. Then make it fast. Putting this whole - * block within the parentheses of a while would be too - * confusing. And no, xchg() is not the answer. */ - spin_lock_irq(&rtc_lock); - data = rtc_irq_data; - rtc_irq_data = 0; - spin_unlock_irq(&rtc_lock); - - if (data != 0) - break; - if (file->f_flags & O_NONBLOCK) { - retval = -EAGAIN; - goto out; - } - if (signal_pending(current)) { - retval = -ERESTARTSYS; - goto out; - } - schedule(); - } while (1); - - retval = put_user(data, (unsigned long *)buf); - if (!retval) - retval = sizeof(unsigned long); - out: - set_current_state(TASK_RUNNING); - remove_wait_queue(&rtc_wait, &wait); - - return retval; -} - -static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg) -{ - struct rtc_time wtime; - struct upd4990a_raw_data raw; - - switch (cmd) { - case RTC_UIE_OFF: /* Mask ints from RTC updates. */ - spin_lock_irq(&rtc_lock); - if (rtc_status & RTC_UIE_TIMER_ON) { - rtc_status &= ~RTC_UIE_TIMER_ON; - del_timer(&rtc_uie_timer); - } - spin_unlock_irq(&rtc_lock); - return 0; - - case RTC_UIE_ON: /* Allow ints for RTC updates. */ - spin_lock_irq(&rtc_lock); - rtc_irq_data = 0; - if (!(rtc_status & RTC_UIE_TIMER_ON)) { - rtc_status |= RTC_UIE_TIMER_ON; - rtc_uie_timer.expires = jiffies + 1; - add_timer(&rtc_uie_timer); - } - /* Just in case... */ - upd4990a_serial_command(UPD4990A_REGISTER_HOLD); - old_refclk = ~UPD4990A_READ_DATA(); - spin_unlock_irq(&rtc_lock); - return 0; - - case RTC_RD_TIME: /* Read the time/date from RTC */ - spin_lock_irq(&rtc_lock); - upd4990a_get_time(&raw, 0); - spin_unlock_irq(&rtc_lock); - - wtime.tm_sec = BCD2BIN(raw.sec); - wtime.tm_min = BCD2BIN(raw.min); - wtime.tm_hour = BCD2BIN(raw.hour); - wtime.tm_mday = BCD2BIN(raw.mday); - wtime.tm_mon = raw.mon - 1; /* convert to 0-base */ - wtime.tm_wday = raw.wday; - - /* - * Account for differences between how the RTC uses the values - * and how they are defined in a struct rtc_time; - */ - if ((wtime.tm_year = BCD2BIN(raw.year)) < 95) - wtime.tm_year += 100; - - wtime.tm_isdst = 0; - break; - - case RTC_SET_TIME: /* Set the RTC */ - { - int leap_yr; - - if (!capable(CAP_SYS_TIME)) - return -EACCES; - - if (copy_from_user(&wtime, (struct rtc_time *) arg, - sizeof (struct rtc_time))) - return -EFAULT; - - /* Valid year is 1995 - 2094, inclusive. */ - if (wtime.tm_year < 95 || wtime.tm_year > 194) - return -EINVAL; - - if (wtime.tm_mon > 11 || wtime.tm_mday == 0) - return -EINVAL; - - /* For acceptable year domain (1995 - 2094), - this IS sufficient. */ - leap_yr = !(wtime.tm_year % 4); - - if (wtime.tm_mday > (days_in_mo[wtime.tm_mon] - + (wtime.tm_mon == 2 && leap_yr))) - return -EINVAL; - - if (wtime.tm_hour >= 24 - || wtime.tm_min >= 60 || wtime.tm_sec >= 60) - return -EINVAL; - - if (wtime.tm_wday > 6) - return -EINVAL; - - raw.sec = BIN2BCD(wtime.tm_sec); - raw.min = BIN2BCD(wtime.tm_min); - raw.hour = BIN2BCD(wtime.tm_hour); - raw.mday = BIN2BCD(wtime.tm_mday); - raw.mon = wtime.tm_mon + 1; - raw.wday = wtime.tm_wday; - raw.year = BIN2BCD(wtime.tm_year % 100); - - spin_lock_irq(&rtc_lock); - upd4990a_set_time(&raw, 0); - spin_unlock_irq(&rtc_lock); - - return 0; - } - default: - return -EINVAL; - } - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; -} - -/* - * We enforce only one user at a time here with the open/close. - * Also clear the previous interrupt data on an open, and clean - * up things on a close. - */ - -static int rtc_open(struct inode *inode, struct file *file) -{ - spin_lock_irq(&rtc_lock); - - if(rtc_status & RTC_IS_OPEN) - goto out_busy; - - rtc_status |= RTC_IS_OPEN; - - rtc_irq_data = 0; - spin_unlock_irq(&rtc_lock); - return 0; - - out_busy: - spin_unlock_irq(&rtc_lock); - return -EBUSY; -} - -static int rtc_fasync(int fd, struct file *filp, int on) -{ - return fasync_helper(fd, filp, on, &rtc_async_queue); -} - -static int rtc_release(struct inode *inode, struct file *file) -{ - del_timer(&rtc_uie_timer); - - if (file->f_flags & FASYNC) - rtc_fasync(-1, file, 0); - - rtc_irq_data = 0; - - /* No need for locking -- nobody else can do anything until this rmw is - * committed, and no timer is running. */ - rtc_status &= ~(RTC_IS_OPEN | RTC_UIE_TIMER_ON); - return 0; -} - -static unsigned int rtc_poll(struct file *file, poll_table *wait) -{ - unsigned long l; - - poll_wait(file, &rtc_wait, wait); - - spin_lock_irq(&rtc_lock); - l = rtc_irq_data; - spin_unlock_irq(&rtc_lock); - - if (l != 0) - return POLLIN | POLLRDNORM; - return 0; -} - -/* - * The various file operations we support. - */ - -static struct file_operations rtc_fops = { - .owner = THIS_MODULE, - .read = rtc_read, - .poll = rtc_poll, - .ioctl = rtc_ioctl, - .open = rtc_open, - .release = rtc_release, - .fasync = rtc_fasync, -}; - -static struct miscdevice rtc_dev= -{ - .minor = RTC_MINOR, - .name = "rtc", - .fops = &rtc_fops, -}; - -static int __init rtc_init(void) -{ - int err = 0; - - if (!request_region(UPD4990A_IO, 1, "rtc")) { - printk(KERN_ERR "upd4990a: could not acquire I/O port %#x\n", - UPD4990A_IO); - return -EBUSY; - } - - err = misc_register(&rtc_dev); - if (err) { - printk(KERN_ERR "upd4990a: can't misc_register() on minor=%d\n", - RTC_MINOR); - release_region(UPD4990A_IO, 1); - return err; - } - -#if 0 - printk(KERN_INFO "\xB6\xDA\xDD\xC0\xDE \xC4\xDE\xB9\xB2 Driver\n"); /* Calender Clock Driver */ -#else - printk(KERN_INFO - "Real Time Clock driver for NEC PC-9800 v" RTC98_VERSION "\n"); -#endif - create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL); - - init_timer(&rtc_uie_timer); - rtc_uie_timer.function = rtc_uie_intr; - - return 0; -} - -module_init (rtc_init); - -static void __exit rtc_exit(void) -{ - del_timer(&rtc_uie_timer); - release_region(UPD4990A_IO, 1); - remove_proc_entry("driver/rtc", NULL); - misc_deregister(&rtc_dev); -} - -module_exit (rtc_exit); - -/* - * Info exported via "/proc/driver/rtc". - */ - -static inline int rtc_get_status(char *buf) -{ - char *p; - unsigned int year; - struct upd4990a_raw_data data; - - p = buf; - - upd4990a_get_time(&data, 0); - - /* - * There is no way to tell if the luser has the RTC set for local - * time or for Universal Standard Time (GMT). Probably local though. - */ - if ((year = BCD2BIN(data.year) + 1900) < 1995) - year += 100; - p += sprintf(p, - "rtc_time\t: %02d:%02d:%02d\n" - "rtc_date\t: %04d-%02d-%02d\n", - BCD2BIN(data.hour), BCD2BIN(data.min), - BCD2BIN(data.sec), - year, data.mon, BCD2BIN(data.mday)); - - return p - buf; -} - -static int rtc_read_proc(char *page, char **start, off_t off, - int count, int *eof, void *data) -{ - int len = rtc_get_status(page); - - if (len <= off + count) - *eof = 1; - *start = page + off; - len -= off; - if (len > count) - len = count; - if (len < 0) - len = 0; - return len; -} diff -Nru a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig --- a/drivers/char/watchdog/Kconfig 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/Kconfig 2004-06-23 19:04:27 -07:00 @@ -96,12 +96,13 @@ Say N if you are unsure. config SA1100_WATCHDOG - tristate "SA1100 watchdog" - depends on WATCHDOG && ARCH_SA1100 + tristate "SA1100/PXA2xx watchdog" + depends on WATCHDOG && ( ARCH_SA1100 || ARCH_PXA ) help - Watchdog timer embedded into SA11x0 chips. This will reboot your - system when timeout is reached. - NOTE, that once enabled, this timer cannot be disabled. + Watchdog timer embedded into SA11x0 and PXA2xx chips. This will + reboot your system when timeout is reached. + + NOTE: once enabled, this timer cannot be disabled. To compile this driver as a module, choose M here: the module will be called sa1100_wdt. diff -Nru a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c --- a/drivers/char/watchdog/acquirewdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/acquirewdt.c 2004-06-23 19:04:27 -07:00 @@ -111,7 +111,7 @@ * /dev/watchdog handling. */ -static ssize_t acq_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +static ssize_t acq_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -146,6 +146,8 @@ unsigned long arg) { int options, retval = -EINVAL; + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, @@ -156,22 +158,22 @@ switch(cmd) { case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)) ? -EFAULT : 0; + return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: acq_keepalive(); return 0; case WDIOC_GETTIMEOUT: - return put_user(WATCHDOG_HEARTBEAT, (int *)arg); + return put_user(WATCHDOG_HEARTBEAT, p); case WDIOC_SETOPTIONS: { - if (get_user(options, (int *)arg)) + if (get_user(options, p)) return -EFAULT; if (options & WDIOS_DISABLECARD) diff -Nru a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c --- a/drivers/char/watchdog/advantechwdt.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/watchdog/advantechwdt.c 2004-06-23 19:04:26 -07:00 @@ -100,7 +100,7 @@ } static ssize_t -advwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +advwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -130,6 +130,8 @@ unsigned long arg) { int new_timeout; + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 1, @@ -138,20 +140,20 @@ switch (cmd) { case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) + if (copy_to_user(argp, &ident, sizeof(ident))) return -EFAULT; break; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: advwdt_ping(); break; case WDIOC_SETTIMEOUT: - if (get_user(new_timeout, (int *)arg)) + if (get_user(new_timeout, p)) return -EFAULT; if ((new_timeout < 1) || (new_timeout > 63)) return -EINVAL; @@ -160,13 +162,13 @@ /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); case WDIOC_SETOPTIONS: { int options, retval = -EINVAL; - if (get_user(options, (int *)arg)) + if (get_user(options, p)) return -EFAULT; if (options & WDIOS_DISABLECARD) { diff -Nru a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c --- a/drivers/char/watchdog/alim1535_wdt.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/watchdog/alim1535_wdt.c 2004-06-23 19:04:26 -07:00 @@ -138,7 +138,7 @@ * the next close to turn off the watchdog. */ -static ssize_t ali_write(struct file *file, const char *data, +static ssize_t ali_write(struct file *file, const char __user *data, size_t len, loff_t * ppos) { /* Can't seek (pwrite) on this device */ @@ -184,6 +184,8 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | @@ -194,12 +196,12 @@ switch (cmd) { case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *) arg, &ident, + return copy_to_user(argp, &ident, sizeof (ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *) arg); + return put_user(0, p); case WDIOC_KEEPALIVE: ali_keepalive(); @@ -209,7 +211,7 @@ { int new_options, retval = -EINVAL; - if (get_user (new_options, (int *) arg)) + if (get_user (new_options, p)) return -EFAULT; if (new_options & WDIOS_DISABLECARD) { @@ -229,7 +231,7 @@ { int new_timeout; - if (get_user(new_timeout, (int *) arg)) + if (get_user(new_timeout, p)) return -EFAULT; if (ali_settimer(new_timeout)) @@ -240,7 +242,7 @@ } case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); default: return -ENOIOCTLCMD; diff -Nru a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c --- a/drivers/char/watchdog/alim7101_wdt.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/watchdog/alim7101_wdt.c 2004-06-23 19:04:28 -07:00 @@ -148,7 +148,7 @@ * /dev/watchdog handling */ -static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos) +static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos) { /* We can't seek */ if(ppos != &file->f_pos) @@ -203,6 +203,8 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, @@ -213,10 +215,10 @@ switch(cmd) { case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wdt_keepalive(); return 0; @@ -224,7 +226,7 @@ { int new_options, retval = -EINVAL; - if(get_user(new_options, (int *)arg)) + if(get_user(new_options, p)) return -EFAULT; if(new_options & WDIOS_DISABLECARD) { @@ -243,7 +245,7 @@ { int new_timeout; - if(get_user(new_timeout, (int *)arg)) + if(get_user(new_timeout, p)) return -EFAULT; if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */ @@ -254,7 +256,7 @@ /* Fall through */ } case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); default: return -ENOIOCTLCMD; } diff -Nru a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c --- a/drivers/char/watchdog/cpu5wdt.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/watchdog/cpu5wdt.c 2004-06-23 19:04:26 -07:00 @@ -145,6 +145,7 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; unsigned int value; static struct watchdog_info ident = { @@ -159,15 +160,15 @@ case WDIOC_GETSTATUS: value = inb(port + CPU5WDT_STATUS_REG); value = (value >> 2) & 1; - if ( copy_to_user((int *)arg, (int *)&value, sizeof(int)) ) + if ( copy_to_user(argp, &value, sizeof(int)) ) return -EFAULT; break; case WDIOC_GETSUPPORT: - if ( copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)) ) + if ( copy_to_user(argp, &ident, sizeof(ident)) ) return -EFAULT; break; case WDIOC_SETOPTIONS: - if ( copy_from_user(&value, (int *)arg, sizeof(int)) ) + if ( copy_from_user(&value, argp, sizeof(int)) ) return -EFAULT; switch(value) { case WDIOS_ENABLECARD: @@ -185,7 +186,7 @@ return 0; } -static ssize_t cpu5wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +static ssize_t cpu5wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { if ( !count ) return -EIO; diff -Nru a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c --- a/drivers/char/watchdog/eurotechwdt.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/watchdog/eurotechwdt.c 2004-06-23 19:04:25 -07:00 @@ -196,8 +196,8 @@ * write of data will do, as we we don't define content meaning. */ -static ssize_t eurwdt_write(struct file *file, const char *buf, size_t count, -loff_t *ppos) +static ssize_t eurwdt_write(struct file *file, const char __user *buf, +size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -237,6 +237,8 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 1, @@ -251,19 +253,18 @@ return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, - sizeof(ident)) ? -EFAULT : 0; + return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *) arg); + return put_user(0, p); case WDIOC_KEEPALIVE: eurwdt_ping(); return 0; case WDIOC_SETTIMEOUT: - if (copy_from_user(&time, (int *) arg, sizeof(int))) + if (copy_from_user(&time, p, sizeof(int))) return -EFAULT; /* Sanity check */ @@ -275,10 +276,10 @@ /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(eurwdt_timeout, (int *)arg); + return put_user(eurwdt_timeout, p); case WDIOC_SETOPTIONS: - if (get_user(options, (int *)arg)) + if (get_user(options, p)) return -EFAULT; if (options & WDIOS_DISABLECARD) { eurwdt_disable_timer(); diff -Nru a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c --- a/drivers/char/watchdog/i8xx_tco.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/watchdog/i8xx_tco.c 2004-06-23 19:04:25 -07:00 @@ -212,7 +212,7 @@ return 0; } -static ssize_t i8xx_tco_write (struct file *file, const char *data, +static ssize_t i8xx_tco_write (struct file *file, const char __user *data, size_t len, loff_t * ppos) { /* Can't seek (pwrite) on this device */ @@ -249,6 +249,8 @@ { int new_options, retval = -EINVAL; int new_heartbeat; + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | @@ -259,12 +261,12 @@ switch (cmd) { case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *) arg, &ident, + return copy_to_user(argp, &ident, sizeof (ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user (0, (int *) arg); + return put_user (0, p); case WDIOC_KEEPALIVE: tco_timer_keepalive (); @@ -272,7 +274,7 @@ case WDIOC_SETOPTIONS: { - if (get_user (new_options, (int *) arg)) + if (get_user (new_options, p)) return -EFAULT; if (new_options & WDIOS_DISABLECARD) { @@ -291,7 +293,7 @@ case WDIOC_SETTIMEOUT: { - if (get_user(new_heartbeat, (int *) arg)) + if (get_user(new_heartbeat, p)) return -EFAULT; if (tco_timer_set_heartbeat(new_heartbeat)) @@ -302,7 +304,7 @@ } case WDIOC_GETTIMEOUT: - return put_user(heartbeat, (int *)arg); + return put_user(heartbeat, p); default: return -ENOIOCTLCMD; diff -Nru a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c --- a/drivers/char/watchdog/ib700wdt.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/watchdog/ib700wdt.c 2004-06-23 19:04:28 -07:00 @@ -139,7 +139,7 @@ } static ssize_t -ibwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -170,6 +170,8 @@ unsigned long arg) { int i, new_margin; + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, @@ -179,19 +181,19 @@ switch (cmd) { case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) + if (copy_to_user(argp, &ident, sizeof(ident))) return -EFAULT; break; case WDIOC_GETSTATUS: - return put_user(0, (int *) arg); + return put_user(0, p); case WDIOC_KEEPALIVE: ibwdt_ping(); break; case WDIOC_SETTIMEOUT: - if (get_user(new_margin, (int *)arg)) + if (get_user(new_margin, p)) return -EFAULT; if ((new_margin < 0) || (new_margin > 30)) return -EINVAL; @@ -203,7 +205,7 @@ /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(wd_times[wd_margin], (int *)arg); + return put_user(wd_times[wd_margin], p); break; default: diff -Nru a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c --- a/drivers/char/watchdog/machzwd.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/watchdog/machzwd.c 2004-06-23 19:04:25 -07:00 @@ -302,7 +302,7 @@ } } -static ssize_t zf_write(struct file *file, const char *buf, size_t count, +static ssize_t zf_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ @@ -352,15 +352,16 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; switch(cmd){ case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, - &zf_info, sizeof(zf_info))) + if (copy_to_user(argp, &zf_info, sizeof(zf_info))) return -EFAULT; break; case WDIOC_GETSTATUS: - return put_user(0, (int *) arg); + return put_user(0, p); case WDIOC_KEEPALIVE: zf_ping(0); diff -Nru a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c --- a/drivers/char/watchdog/mixcomwd.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/watchdog/mixcomwd.c 2004-06-23 19:04:26 -07:00 @@ -134,7 +134,7 @@ } -static ssize_t mixcomwd_write(struct file *file, const char *data, size_t len, loff_t *ppos) +static ssize_t mixcomwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { if (ppos != &file->f_pos) { return -ESPIPE; @@ -164,6 +164,8 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; int status; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, @@ -178,13 +180,12 @@ if (!nowayout) { status|=mixcomwd_timer_alive; } - if (copy_to_user((int *)arg, &status, sizeof(int))) { + if (copy_to_user(p, &status, sizeof(int))) { return -EFAULT; } break; case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, &ident, - sizeof(ident))) { + if (copy_to_user(argp, &ident, sizeof(ident))) { return -EFAULT; } break; diff -Nru a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c --- a/drivers/char/watchdog/pcwd_pci.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/watchdog/pcwd_pci.c 2004-06-23 19:04:25 -07:00 @@ -258,7 +258,7 @@ * /dev/watchdog handling */ -static ssize_t pcipcwd_write(struct file *file, const char *data, +static ssize_t pcipcwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { /* Can't seek (pwrite) on this device */ @@ -293,6 +293,8 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_OVERHEAT | WDIOF_CARDRESET | @@ -305,7 +307,7 @@ switch (cmd) { case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *) arg, &ident, + return copy_to_user(argp, &ident, sizeof (ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: @@ -314,11 +316,11 @@ pcipcwd_get_status(&status); - return put_user(status, (int *) arg); + return put_user(status, p); } case WDIOC_GETBOOTSTATUS: - return put_user(pcipcwd_private.boot_status, (int *) arg); + return put_user(pcipcwd_private.boot_status, p); case WDIOC_GETTEMP: { @@ -327,7 +329,7 @@ if (pcipcwd_get_temperature(&temperature)) return -EFAULT; - return put_user(temperature, (int *) arg); + return put_user(temperature, p); } case WDIOC_KEEPALIVE: @@ -338,7 +340,7 @@ { int new_options, retval = -EINVAL; - if (get_user (new_options, (int *) arg)) + if (get_user (new_options, p)) return -EFAULT; if (new_options & WDIOS_DISABLECARD) { @@ -363,7 +365,7 @@ { int new_heartbeat; - if (get_user(new_heartbeat, (int *) arg)) + if (get_user(new_heartbeat, p)) return -EFAULT; if (pcipcwd_set_heartbeat(new_heartbeat)) @@ -374,7 +376,7 @@ } case WDIOC_GETTIMEOUT: - return put_user(heartbeat, (int *)arg); + return put_user(heartbeat, p); default: return -ENOIOCTLCMD; @@ -413,7 +415,7 @@ * /dev/temperature handling */ -static ssize_t pcipcwd_temp_read(struct file *file, char *data, +static ssize_t pcipcwd_temp_read(struct file *file, char __user *data, size_t len, loff_t *ppos) { int temperature; diff -Nru a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c --- a/drivers/char/watchdog/pcwd_usb.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/watchdog/pcwd_usb.c 2004-06-23 19:04:26 -07:00 @@ -326,7 +326,7 @@ * /dev/watchdog handling */ -static ssize_t usb_pcwd_write(struct file *file, const char *data, +static ssize_t usb_pcwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { /* Can't seek (pwrite) on this device */ @@ -361,6 +361,8 @@ static int usb_pcwd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | @@ -371,12 +373,12 @@ switch (cmd) { case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *) arg, &ident, + return copy_to_user(argp, &ident, sizeof (ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *) arg); + return put_user(0, p); case WDIOC_GETTEMP: { @@ -385,7 +387,7 @@ if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature)) return -EFAULT; - return put_user(temperature, (int *) arg); + return put_user(temperature, p); } case WDIOC_KEEPALIVE: @@ -396,7 +398,7 @@ { int new_options, retval = -EINVAL; - if (get_user (new_options, (int *) arg)) + if (get_user (new_options, p)) return -EFAULT; if (new_options & WDIOS_DISABLECARD) { @@ -416,7 +418,7 @@ { int new_heartbeat; - if (get_user(new_heartbeat, (int *) arg)) + if (get_user(new_heartbeat, p)) return -EFAULT; if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat)) @@ -427,7 +429,7 @@ } case WDIOC_GETTIMEOUT: - return put_user(heartbeat, (int *)arg); + return put_user(heartbeat, p); default: return -ENOIOCTLCMD; @@ -466,7 +468,7 @@ * /dev/temperature handling */ -static ssize_t usb_pcwd_temperature_read(struct file *file, char *data, +static ssize_t usb_pcwd_temperature_read(struct file *file, char __user *data, size_t len, loff_t *ppos) { int temperature; @@ -478,7 +480,7 @@ if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature)) return -EFAULT; - if (copy_to_user (data, &temperature, 1)) + if (copy_to_user(data, &temperature, 1)) return -EFAULT; return 1; diff -Nru a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c --- a/drivers/char/watchdog/sa1100_wdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/sa1100_wdt.c 2004-06-23 19:04:27 -07:00 @@ -1,5 +1,5 @@ /* - * Watchdog driver for the SA11x0 + * Watchdog driver for the SA11x0/PXA2xx * * (c) Copyright 2000 Oleg Drokin * Based on SoftDog driver by Alan Cox @@ -174,7 +174,7 @@ static struct miscdevice sa1100dog_miscdev = { .minor = WATCHDOG_MINOR, - .name = "SA1100 watchdog", + .name = "SA1100/PXA2xx watchdog", .fops = &sa1100dog_fops, }; @@ -194,7 +194,7 @@ ret = misc_register(&sa1100dog_miscdev); if (ret == 0) - printk("SA1100 Watchdog Timer: timer margin %d sec\n", + printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", margin); return ret; @@ -209,7 +209,7 @@ module_exit(sa1100dog_exit); MODULE_AUTHOR("Oleg Drokin "); -MODULE_DESCRIPTION("SA1100 Watchdog"); +MODULE_DESCRIPTION("SA1100/PXA2xx Watchdog"); module_param(margin, int, 0); MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); diff -Nru a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c --- a/drivers/char/watchdog/sbc60xxwdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/sbc60xxwdt.c 2004-06-23 19:04:27 -07:00 @@ -166,7 +166,7 @@ * /dev/watchdog handling */ -static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos) +static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos) { /* We can't seek */ if(ppos != &file->f_pos) @@ -230,6 +230,8 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident= { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, @@ -242,10 +244,10 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wdt_keepalive(); return 0; @@ -253,7 +255,7 @@ { int new_options, retval = -EINVAL; - if(get_user(new_options, (int *)arg)) + if(get_user(new_options, p)) return -EFAULT; if(new_options & WDIOS_DISABLECARD) { @@ -272,7 +274,7 @@ { int new_timeout; - if(get_user(new_timeout, (int *)arg)) + if(get_user(new_timeout, p)) return -EFAULT; if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */ @@ -283,7 +285,7 @@ /* Fall through */ } case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); } } diff -Nru a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c --- a/drivers/char/watchdog/sc1200wdt.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/char/watchdog/sc1200wdt.c 2004-06-23 19:04:25 -07:00 @@ -174,6 +174,8 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { int new_timeout; + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 0, @@ -185,22 +187,22 @@ return -ENOIOCTLCMD; /* Keep Pavel Machek amused ;) */ case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident)) + if (copy_to_user(argp, &ident, sizeof ident)) return -EFAULT; return 0; case WDIOC_GETSTATUS: - return put_user(sc1200wdt_status(), (int *)arg); + return put_user(sc1200wdt_status(), p); case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: sc1200wdt_write_data(WDTO, timeout); return 0; case WDIOC_SETTIMEOUT: - if (get_user(new_timeout, (int *)arg)) + if (get_user(new_timeout, p)) return -EFAULT; /* the API states this is given in secs */ @@ -213,13 +215,13 @@ /* fall through and return the new timeout */ case WDIOC_GETTIMEOUT: - return put_user(timeout * 60, (int *)arg); + return put_user(timeout * 60, p); case WDIOC_SETOPTIONS: { int options, retval = -EINVAL; - if (get_user(options, (int *)arg)) + if (get_user(options, p)) return -EFAULT; if (options & WDIOS_DISABLECARD) { @@ -254,7 +256,7 @@ } -static ssize_t sc1200wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos) +static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { if (ppos != &file->f_pos) return -ESPIPE; diff -Nru a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c --- a/drivers/char/watchdog/sc520_wdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/sc520_wdt.c 2004-06-23 19:04:27 -07:00 @@ -225,7 +225,7 @@ * /dev/watchdog handling */ -static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos) +static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos) { /* We can't seek */ if(ppos != &file->f_pos) @@ -285,6 +285,8 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 1, @@ -296,10 +298,10 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wdt_keepalive(); return 0; @@ -307,7 +309,7 @@ { int new_options, retval = -EINVAL; - if(get_user(new_options, (int *)arg)) + if(get_user(new_options, p)) return -EFAULT; if(new_options & WDIOS_DISABLECARD) { @@ -326,7 +328,7 @@ { int new_timeout; - if(get_user(new_timeout, (int *)arg)) + if(get_user(new_timeout, p)) return -EFAULT; if(wdt_set_heartbeat(new_timeout)) @@ -336,7 +338,7 @@ /* Fall through */ } case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); } } diff -Nru a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c --- a/drivers/char/watchdog/scx200_wdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/scx200_wdt.c 2004-06-23 19:04:27 -07:00 @@ -132,7 +132,7 @@ .notifier_call = scx200_wdt_notify_sys, }; -static ssize_t scx200_wdt_write(struct file *file, const char *data, +static ssize_t scx200_wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { if (ppos != &file->f_pos) @@ -163,6 +163,8 @@ static int scx200_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .identity = "NatSemi SCx200 Watchdog", .firmware_version = 1, @@ -174,20 +176,19 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - if(copy_to_user((struct watchdog_info *)arg, &ident, - sizeof(ident))) + if(copy_to_user(argp, &ident, sizeof(ident))) return -EFAULT; return 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - if (put_user(0, (int *)arg)) + if (put_user(0, p)) return -EFAULT; return 0; case WDIOC_KEEPALIVE: scx200_wdt_ping(); return 0; case WDIOC_SETTIMEOUT: - if (get_user(new_margin, (int *)arg)) + if (get_user(new_margin, p)) return -EFAULT; if (new_margin < 1) return -EINVAL; @@ -195,7 +196,7 @@ scx200_wdt_update_margin(); scx200_wdt_ping(); case WDIOC_GETTIMEOUT: - if (put_user(margin, (int *)arg)) + if (put_user(margin, p)) return -EFAULT; return 0; } diff -Nru a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c --- a/drivers/char/watchdog/softdog.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/char/watchdog/softdog.c 2004-06-23 19:04:26 -07:00 @@ -161,7 +161,7 @@ return 0; } -static ssize_t softdog_write(struct file *file, const char *data, size_t len, loff_t *ppos) +static ssize_t softdog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -194,6 +194,8 @@ static int softdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; int new_margin; static struct watchdog_info ident = { .options = WDIOF_SETTIMEOUT | @@ -206,23 +208,23 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, + return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0,(int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: softdog_keepalive(); return 0; case WDIOC_SETTIMEOUT: - if (get_user(new_margin, (int *)arg)) + if (get_user(new_margin, p)) return -EFAULT; if (softdog_set_heartbeat(new_margin)) return -EINVAL; softdog_keepalive(); /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(soft_margin, (int *)arg); + return put_user(soft_margin, p); } } diff -Nru a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c --- a/drivers/char/watchdog/w83627hf_wdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/w83627hf_wdt.c 2004-06-23 19:04:27 -07:00 @@ -142,7 +142,7 @@ } static ssize_t -wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -171,6 +171,8 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; int new_timeout; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, @@ -180,20 +182,20 @@ switch (cmd) { case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))) + if (copy_to_user(argp, &ident, sizeof(ident))) return -EFAULT; break; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wdt_ping(); break; case WDIOC_SETTIMEOUT: - if (get_user(new_timeout, (int *)arg)) + if (get_user(new_timeout, p)) return -EFAULT; if (wdt_set_heartbeat(new_timeout)) return -EINVAL; @@ -201,13 +203,13 @@ /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); case WDIOC_SETOPTIONS: { int options, retval = -EINVAL; - if (get_user(options, (int *)arg)) + if (get_user(options, p)) return -EFAULT; if (options & WDIOS_DISABLECARD) { diff -Nru a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c --- a/drivers/char/watchdog/w83877f_wdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/w83877f_wdt.c 2004-06-23 19:04:27 -07:00 @@ -188,7 +188,7 @@ * /dev/watchdog handling */ -static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos) +static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos) { /* We can't seek */ if(ppos != &file->f_pos) @@ -249,6 +249,8 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident= { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, @@ -261,10 +263,10 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wdt_keepalive(); return 0; @@ -272,7 +274,7 @@ { int new_options, retval = -EINVAL; - if(get_user(new_options, (int *)arg)) + if(get_user(new_options, p)) return -EFAULT; if(new_options & WDIOS_DISABLECARD) { @@ -291,7 +293,7 @@ { int new_timeout; - if(get_user(new_timeout, (int *)arg)) + if(get_user(new_timeout, p)) return -EFAULT; if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */ @@ -302,7 +304,7 @@ /* Fall through */ } case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); } } diff -Nru a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c --- a/drivers/char/watchdog/wafer5823wdt.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/char/watchdog/wafer5823wdt.c 2004-06-23 19:04:28 -07:00 @@ -95,7 +95,7 @@ inb_p(wdt_stop); } -static ssize_t wafwdt_write(struct file *file, const char *buf, size_t count, loff_t * ppos) +static ssize_t wafwdt_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -128,6 +128,8 @@ unsigned long arg) { int new_timeout; + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 1, @@ -136,21 +138,20 @@ switch (cmd) { case WDIOC_GETSUPPORT: - if (copy_to_user - ((struct watchdog_info *) arg, &ident, sizeof (ident))) + if (copy_to_user(argp, &ident, sizeof (ident))) return -EFAULT; break; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wafwdt_ping(); break; case WDIOC_SETTIMEOUT: - if (get_user(new_timeout, (int *)arg)) + if (get_user(new_timeout, p)) return -EFAULT; if ((new_timeout < 1) || (new_timeout > 255)) return -EINVAL; @@ -159,13 +160,13 @@ wafwdt_start(); /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(timeout, (int *)arg); + return put_user(timeout, p); case WDIOC_SETOPTIONS: { int options, retval = -EINVAL; - if (get_user(options, (int *)arg)) + if (get_user(options, p)) return -EFAULT; if (options & WDIOS_DISABLECARD) { diff -Nru a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c --- a/drivers/char/watchdog/wdt.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/wdt.c 2004-06-23 19:04:27 -07:00 @@ -286,7 +286,7 @@ * write of data will do, as we we don't define content meaning. */ -static ssize_t wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -327,6 +327,8 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; + int __user *p = argp; int new_heartbeat; int status; @@ -351,18 +353,18 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; case WDIOC_GETSTATUS: wdt_get_status(&status); - return put_user(status,(int *)arg); + return put_user(status, p); case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wdt_ping(); return 0; case WDIOC_SETTIMEOUT: - if (get_user(new_heartbeat, (int *)arg)) + if (get_user(new_heartbeat, p)) return -EFAULT; if (wdt_set_heartbeat(new_heartbeat)) @@ -371,7 +373,7 @@ wdt_ping(); /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(heartbeat, (int *)arg); + return put_user(heartbeat, p); } } @@ -435,7 +437,7 @@ * farenheit. It was designed by an imperial measurement luddite. */ -static ssize_t wdt_temp_read(struct file *file, char *buf, size_t count, loff_t *ptr) +static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr) { int temperature; diff -Nru a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c --- a/drivers/char/watchdog/wdt_pci.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/char/watchdog/wdt_pci.c 2004-06-23 19:04:27 -07:00 @@ -331,7 +331,7 @@ * write of data will do, as we we don't define content meaning. */ -static ssize_t wdtpci_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { /* Can't seek (pwrite) on this device */ if (ppos != &file->f_pos) @@ -374,6 +374,8 @@ { int new_heartbeat; int status; + void __user *argp = (void __user *)arg; + int __user *p = argp; static struct watchdog_info ident = { .options = WDIOF_SETTIMEOUT| @@ -396,18 +398,18 @@ default: return -ENOIOCTLCMD; case WDIOC_GETSUPPORT: - return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0; + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; case WDIOC_GETSTATUS: wdtpci_get_status(&status); - return put_user(status,(int *)arg); + return put_user(status, p); case WDIOC_GETBOOTSTATUS: - return put_user(0, (int *)arg); + return put_user(0, p); case WDIOC_KEEPALIVE: wdtpci_ping(); return 0; case WDIOC_SETTIMEOUT: - if (get_user(new_heartbeat, (int *)arg)) + if (get_user(new_heartbeat, p)) return -EFAULT; if (wdtpci_set_heartbeat(new_heartbeat)) @@ -416,7 +418,7 @@ wdtpci_ping(); /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(heartbeat, (int *)arg); + return put_user(heartbeat, p); } } @@ -484,7 +486,7 @@ * fahrenheit. It was designed by an imperial measurement luddite. */ -static ssize_t wdtpci_temp_read(struct file *file, char *buf, size_t count, loff_t *ptr) +static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr) { int temperature; diff -Nru a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c --- a/drivers/firmware/efivars.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/firmware/efivars.c 2004-06-23 19:04:28 -07:00 @@ -134,7 +134,7 @@ #define EFI_ATTR(_name, _mode, _show, _store) \ struct subsys_attribute efi_attr_##_name = { \ - .attr {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \ + .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \ .show = _show, \ .store = _store, \ }; diff -Nru a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c --- a/drivers/i2c/busses/i2c-piix4.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/i2c/busses/i2c-piix4.c 2004-06-23 19:04:26 -07:00 @@ -138,7 +138,7 @@ dev_info(&PIIX4_dev->dev, "Found %s device\n", pci_name(PIIX4_dev)); - if(ibm_dmi_probe()) { + if(ibm_dmi_probe() && PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) { dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module " "may corrupt your serial eeprom! Refusing to load " "module!\n"); diff -Nru a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c --- a/drivers/i2c/chips/asb100.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/i2c/chips/asb100.c 2004-06-23 19:04:27 -07:00 @@ -272,7 +272,7 @@ return show_in(dev, buf, 0x##offset); \ } \ static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ - show_in##offset, NULL) \ + show_in##offset, NULL); \ static ssize_t \ show_in##offset##_min (struct device *dev, char *buf) \ { \ @@ -294,17 +294,17 @@ return set_in_max(dev, buf, count, 0x##offset); \ } \ static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ - show_in##offset##_min, set_in##offset##_min) \ + show_in##offset##_min, set_in##offset##_min); \ static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ - show_in##offset##_max, set_in##offset##_max) + show_in##offset##_max, set_in##offset##_max); -sysfs_in(0) -sysfs_in(1) -sysfs_in(2) -sysfs_in(3) -sysfs_in(4) -sysfs_in(5) -sysfs_in(6) +sysfs_in(0); +sysfs_in(1); +sysfs_in(2); +sysfs_in(3); +sysfs_in(4); +sysfs_in(5); +sysfs_in(6); #define device_create_file_in(client, offset) do { \ device_create_file(&client->dev, &dev_attr_in##offset##_input); \ @@ -410,15 +410,15 @@ return set_fan_div(dev, buf, count, offset - 1); \ } \ static DEVICE_ATTR(fan##offset##_input, S_IRUGO, \ - show_fan##offset, NULL) \ + show_fan##offset, NULL); \ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ - show_fan##offset##_min, set_fan##offset##_min) \ + show_fan##offset##_min, set_fan##offset##_min); \ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ - show_fan##offset##_div, set_fan##offset##_div) + show_fan##offset##_div, set_fan##offset##_div); -sysfs_fan(1) -sysfs_fan(2) -sysfs_fan(3) +sysfs_fan(1); +sysfs_fan(2); +sysfs_fan(3); #define device_create_file_fan(client, offset) do { \ device_create_file(&client->dev, &dev_attr_fan##offset##_input); \ @@ -449,9 +449,9 @@ return sprintf_temp_from_reg(data->reg[nr], buf, nr); \ } -show_temp_reg(temp) -show_temp_reg(temp_max) -show_temp_reg(temp_hyst) +show_temp_reg(temp); +show_temp_reg(temp_max); +show_temp_reg(temp_hyst); #define set_temp_reg(REG, reg) \ static ssize_t set_##reg(struct device *dev, const char *buf, \ @@ -473,15 +473,15 @@ return count; \ } -set_temp_reg(MAX, temp_max) -set_temp_reg(HYST, temp_hyst) +set_temp_reg(MAX, temp_max); +set_temp_reg(HYST, temp_hyst); #define sysfs_temp(num) \ static ssize_t show_temp##num(struct device *dev, char *buf) \ { \ return show_temp(dev, buf, num-1); \ } \ -static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL) \ +static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \ static ssize_t show_temp_max##num(struct device *dev, char *buf) \ { \ return show_temp_max(dev, buf, num-1); \ @@ -492,7 +492,7 @@ return set_temp_max(dev, buf, count, num-1); \ } \ static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ - show_temp_max##num, set_temp_max##num) \ + show_temp_max##num, set_temp_max##num); \ static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \ { \ return show_temp_hyst(dev, buf, num-1); \ @@ -503,12 +503,12 @@ return set_temp_hyst(dev, buf, count, num-1); \ } \ static DEVICE_ATTR(temp##num##_max_hyst, S_IRUGO | S_IWUSR, \ - show_temp_hyst##num, set_temp_hyst##num) + show_temp_hyst##num, set_temp_hyst##num); -sysfs_temp(1) -sysfs_temp(2) -sysfs_temp(3) -sysfs_temp(4) +sysfs_temp(1); +sysfs_temp(2); +sysfs_temp(3); +sysfs_temp(4); /* VID */ #define device_create_file_temp(client, num) do { \ @@ -523,7 +523,7 @@ return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm)); } -static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid, NULL) +static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid, NULL); #define device_create_file_vid(client) \ device_create_file(&client->dev, &dev_attr_in0_ref) @@ -544,7 +544,7 @@ } /* Alarms */ -static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm) +static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm); #define device_create_file_vrm(client) \ device_create_file(&client->dev, &dev_attr_vrm); @@ -554,7 +554,7 @@ return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms)); } -static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL) +static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); #define device_create_file_alarms(client) \ device_create_file(&client->dev, &dev_attr_alarms) @@ -594,9 +594,9 @@ return count; } -static DEVICE_ATTR(fan1_pwm, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1) +static DEVICE_ATTR(fan1_pwm, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1); static DEVICE_ATTR(fan1_pwm_enable, S_IRUGO | S_IWUSR, - show_pwm_enable1, set_pwm_enable1) + show_pwm_enable1, set_pwm_enable1); #define device_create_file_pwm1(client) do { \ device_create_file(&new_client->dev, &dev_attr_fan1_pwm); \ device_create_file(&new_client->dev, &dev_attr_fan1_pwm_enable); \ diff -Nru a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c --- a/drivers/i2c/chips/it87.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/i2c/chips/it87.c 2004-06-23 19:04:28 -07:00 @@ -128,15 +128,15 @@ #define IT87_REG_FAN(nr) (0x0d + (nr)) #define IT87_REG_FAN_MIN(nr) (0x10 + (nr)) -#define IT87_REG_FAN_CTRL 0x13 +#define IT87_REG_FAN_MAIN_CTRL 0x13 #define IT87_REG_VIN(nr) (0x20 + (nr)) #define IT87_REG_TEMP(nr) (0x29 + (nr)) #define IT87_REG_VIN_MAX(nr) (0x30 + (nr) * 2) #define IT87_REG_VIN_MIN(nr) (0x31 + (nr) * 2) -#define IT87_REG_TEMP_HIGH(nr) (0x40 + ((nr) * 2)) -#define IT87_REG_TEMP_LOW(nr) (0x41 + ((nr) * 2)) +#define IT87_REG_TEMP_HIGH(nr) (0x40 + (nr) * 2) +#define IT87_REG_TEMP_LOW(nr) (0x41 + (nr) * 2) #define IT87_REG_I2C_ADDR 0x48 @@ -145,8 +145,8 @@ #define IT87_REG_CHIPID 0x58 -#define IN_TO_REG(val) (SENSORS_LIMIT((((val) * 10 + 8)/16),0,255)) -#define IN_FROM_REG(val) (((val) * 16) / 10) +#define IN_TO_REG(val) (SENSORS_LIMIT((((val) + 8)/16),0,255)) +#define IN_FROM_REG(val) ((val) * 16) static inline u8 FAN_TO_REG(long rpm, int div) { @@ -159,9 +159,9 @@ #define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div))) -#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-5)/10):\ - ((val)+5)/10),0,255)) -#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10) +#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-500)/1000):\ + ((val)+500)/1000),-128,127)) +#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*1000) #define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\ 205-(val)*5) @@ -170,7 +170,7 @@ static int DIV_TO_REG(int val) { int answer = 0; - while ((val >>= 1)) + while ((val >>= 1) != 0) answer++; return answer; } @@ -231,19 +231,19 @@ static ssize_t show_in(struct device *dev, char *buf, int nr) { struct it87_data *data = it87_update_device(dev); - return sprintf(buf, "%d\n", IN_FROM_REG(data->in[nr])*10 ); + return sprintf(buf, "%d\n", IN_FROM_REG(data->in[nr])); } static ssize_t show_in_min(struct device *dev, char *buf, int nr) { struct it87_data *data = it87_update_device(dev); - return sprintf(buf, "%d\n", IN_FROM_REG(data->in_min[nr])*10 ); + return sprintf(buf, "%d\n", IN_FROM_REG(data->in_min[nr])); } static ssize_t show_in_max(struct device *dev, char *buf, int nr) { struct it87_data *data = it87_update_device(dev); - return sprintf(buf, "%d\n", IN_FROM_REG(data->in_max[nr])*10 ); + return sprintf(buf, "%d\n", IN_FROM_REG(data->in_max[nr])); } static ssize_t set_in_min(struct device *dev, const char *buf, @@ -251,7 +251,7 @@ { struct i2c_client *client = to_i2c_client(dev); struct it87_data *data = i2c_get_clientdata(client); - unsigned long val = simple_strtoul(buf, NULL, 10)/10; + unsigned long val = simple_strtoul(buf, NULL, 10); data->in_min[nr] = IN_TO_REG(val); it87_write_value(client, IT87_REG_VIN_MIN(nr), data->in_min[nr]); @@ -262,7 +262,7 @@ { struct i2c_client *client = to_i2c_client(dev); struct it87_data *data = i2c_get_clientdata(client); - unsigned long val = simple_strtoul(buf, NULL, 10)/10; + unsigned long val = simple_strtoul(buf, NULL, 10); data->in_max[nr] = IN_TO_REG(val); it87_write_value(client, IT87_REG_VIN_MAX(nr), data->in_max[nr]); @@ -275,7 +275,7 @@ { \ return show_in(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL) +static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL); #define limit_in_offset(offset) \ static ssize_t \ @@ -299,9 +299,9 @@ return set_in_max(dev, buf, count, 0x##offset); \ } \ static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ - show_in##offset##_min, set_in##offset##_min) \ + show_in##offset##_min, set_in##offset##_min); \ static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ - show_in##offset##_max, set_in##offset##_max) + show_in##offset##_max, set_in##offset##_max); show_in_offset(0); limit_in_offset(0); @@ -325,24 +325,24 @@ static ssize_t show_temp(struct device *dev, char *buf, int nr) { struct it87_data *data = it87_update_device(dev); - return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr])*100 ); + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr])); } static ssize_t show_temp_max(struct device *dev, char *buf, int nr) { struct it87_data *data = it87_update_device(dev); - return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[nr])*100); + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[nr])); } static ssize_t show_temp_min(struct device *dev, char *buf, int nr) { struct it87_data *data = it87_update_device(dev); - return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[nr])*100); + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[nr])); } static ssize_t set_temp_max(struct device *dev, const char *buf, size_t count, int nr) { struct i2c_client *client = to_i2c_client(dev); struct it87_data *data = i2c_get_clientdata(client); - int val = simple_strtol(buf, NULL, 10)/100; + int val = simple_strtol(buf, NULL, 10); data->temp_high[nr] = TEMP_TO_REG(val); it87_write_value(client, IT87_REG_TEMP_HIGH(nr), data->temp_high[nr]); return count; @@ -352,7 +352,7 @@ { struct i2c_client *client = to_i2c_client(dev); struct it87_data *data = i2c_get_clientdata(client); - int val = simple_strtol(buf, NULL, 10)/100; + int val = simple_strtol(buf, NULL, 10); data->temp_low[nr] = TEMP_TO_REG(val); it87_write_value(client, IT87_REG_TEMP_LOW(nr), data->temp_low[nr]); return count; @@ -382,11 +382,11 @@ { \ return set_temp_min(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL) \ +static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \ static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ - show_temp_##offset##_max, set_temp_##offset##_max) \ + show_temp_##offset##_max, set_temp_##offset##_max); \ static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ - show_temp_##offset##_min, set_temp_##offset##_min) + show_temp_##offset##_min, set_temp_##offset##_min); show_temp_offset(1); show_temp_offset(2); @@ -430,8 +430,8 @@ { \ return set_sensor(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \ - show_sensor_##offset, set_sensor_##offset) +static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \ + show_sensor_##offset, set_sensor_##offset); show_sensor_offset(1); show_sensor_offset(2); @@ -525,11 +525,11 @@ { \ return set_fan_div(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \ +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ - show_fan_##offset##_min, set_fan_##offset##_min) \ + show_fan_##offset##_min, set_fan_##offset##_min); \ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ - show_fan_##offset##_div, set_fan_##offset##_div) + show_fan_##offset##_div, set_fan_##offset##_div); show_fan_offset(1); show_fan_offset(2); @@ -773,9 +773,7 @@ We don't want to lock the whole ISA bus, so we lock each client separately. We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks, - would slow down the IT87 access and should not be necessary. - There are some ugly typecasts here, but the good new is - they should - nowhere else be necessary! */ + would slow down the IT87 access and should not be necessary. */ static int it87_read_value(struct i2c_client *client, u8 reg) { struct it87_data *data = i2c_get_clientdata(client); @@ -795,9 +793,7 @@ We don't want to lock the whole ISA bus, so we lock each client separately. We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks, - would slow down the IT87 access and should not be necessary. - There are some ugly typecasts here, but the good new is - they should - nowhere else be necessary! */ + would slow down the IT87 access and should not be necessary. */ static int it87_write_value(struct i2c_client *client, u8 reg, u8 value) { struct it87_data *data = i2c_get_clientdata(client); @@ -840,11 +836,11 @@ } /* Check if tachometers are reset manually or by some reason */ - tmp = it87_read_value(client, IT87_REG_FAN_CTRL); + tmp = it87_read_value(client, IT87_REG_FAN_MAIN_CTRL); if ((tmp & 0x70) == 0) { /* Enable all fan tachometers */ tmp = (tmp & 0x8f) | 0x70; - it87_write_value(client, IT87_REG_FAN_CTRL, tmp); + it87_write_value(client, IT87_REG_FAN_MAIN_CTRL, tmp); } /* Start monitoring */ diff -Nru a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c --- a/drivers/i2c/chips/lm78.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/i2c/chips/lm78.c 2004-06-23 19:04:28 -07:00 @@ -281,7 +281,7 @@ return show_in(dev, buf, 0x##offset); \ } \ static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ - show_in##offset, NULL) \ + show_in##offset, NULL); \ static ssize_t \ show_in##offset##_min (struct device *dev, char *buf) \ { \ @@ -303,9 +303,9 @@ return set_in_max(dev, buf, count, 0x##offset); \ } \ static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ - show_in##offset##_min, set_in##offset##_min) \ + show_in##offset##_min, set_in##offset##_min); \ static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ - show_in##offset##_max, set_in##offset##_max) + show_in##offset##_max, set_in##offset##_max); show_in_offset(0); show_in_offset(1); @@ -354,11 +354,11 @@ return count; } -static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL) +static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL); static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, - show_temp_over, set_temp_over) + show_temp_over, set_temp_over); static DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR, - show_temp_hyst, set_temp_hyst) + show_temp_hyst, set_temp_hyst); /* 3 Fans */ static ssize_t show_fan(struct device *dev, char *buf, int nr) @@ -439,9 +439,9 @@ { \ return set_fan_min(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \ +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ - show_fan_##offset##_min, set_fan_##offset##_min) + show_fan_##offset##_min, set_fan_##offset##_min); static ssize_t set_fan_1_div(struct device *dev, const char *buf, size_t count) @@ -461,10 +461,10 @@ /* Fan 3 divisor is locked in H/W */ static DEVICE_ATTR(fan1_div, S_IRUGO | S_IWUSR, - show_fan_1_div, set_fan_1_div) + show_fan_1_div, set_fan_1_div); static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR, - show_fan_2_div, set_fan_2_div) -static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL) + show_fan_2_div, set_fan_2_div); +static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); /* VID */ static ssize_t show_vid(struct device *dev, char *buf) diff -Nru a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c --- a/drivers/i2c/chips/lm85.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/i2c/chips/lm85.c 2004-06-23 19:04:26 -07:00 @@ -451,9 +451,9 @@ { \ return set_fan_min(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \ +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ - show_fan_##offset##_min, set_fan_##offset##_min) + show_fan_##offset##_min, set_fan_##offset##_min); show_fan_offset(1); show_fan_offset(2); @@ -468,7 +468,7 @@ return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); } -static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL) +static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL); static ssize_t show_vrm_reg(struct device *dev, char *buf) { @@ -487,7 +487,7 @@ return count; } -static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg) +static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); static ssize_t show_alarms_reg(struct device *dev, char *buf) { @@ -495,7 +495,7 @@ return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); } -static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL) +static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); /* pwm */ @@ -542,8 +542,8 @@ return show_pwm_enable(dev, buf, 0x##offset - 1); \ } \ static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, \ - show_pwm_##offset, set_pwm_##offset) \ -static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO, show_pwm_enable##offset, NULL) + show_pwm_##offset, set_pwm_##offset); \ +static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO, show_pwm_enable##offset, NULL); show_pwm_reg(1); show_pwm_reg(2); @@ -617,11 +617,11 @@ { \ return set_in_max(dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in_##offset, NULL) \ +static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in_##offset, NULL); \ static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ - show_in_##offset##_min, set_in_##offset##_min) \ + show_in_##offset##_min, set_in_##offset##_min); \ static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ - show_in_##offset##_max, set_in_##offset##_max) + show_in_##offset##_max, set_in_##offset##_max); show_in_reg(0); show_in_reg(1); @@ -697,11 +697,11 @@ { \ return set_temp_max(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL) \ +static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \ static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ - show_temp_##offset##_min, set_temp_##offset##_min) \ + show_temp_##offset##_min, set_temp_##offset##_min); \ static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ - show_temp_##offset##_max, set_temp_##offset##_max) + show_temp_##offset##_max, set_temp_##offset##_max); show_temp_reg(1); show_temp_reg(2); diff -Nru a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c --- a/drivers/i2c/chips/via686a.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/i2c/chips/via686a.c 2004-06-23 19:04:25 -07:00 @@ -405,11 +405,11 @@ { \ return set_in_max(dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL) \ +static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);\ static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ - show_in##offset##_min, set_in##offset##_min) \ + show_in##offset##_min, set_in##offset##_min); \ static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ - show_in##offset##_max, set_in##offset##_max) + show_in##offset##_max, set_in##offset##_max); show_in_offset(0); show_in_offset(1); @@ -473,11 +473,11 @@ { \ return set_temp_hyst(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL) \ +static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL);\ static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ - show_temp_##offset##_over, set_temp_##offset##_over) \ + show_temp_##offset##_over, set_temp_##offset##_over); \ static DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \ - show_temp_##offset##_hyst, set_temp_##offset##_hyst) + show_temp_##offset##_hyst, set_temp_##offset##_hyst); show_temp_offset(1); show_temp_offset(2); @@ -542,11 +542,11 @@ { \ return set_fan_div(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \ +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ - show_fan_##offset##_min, set_fan_##offset##_min) \ + show_fan_##offset##_min, set_fan_##offset##_min); \ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ - show_fan_##offset##_div, set_fan_##offset##_div) + show_fan_##offset##_div, set_fan_##offset##_div); show_fan_offset(1); show_fan_offset(2); diff -Nru a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c --- a/drivers/i2c/chips/w83627hf.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/i2c/chips/w83627hf.c 2004-06-23 19:04:28 -07:00 @@ -199,7 +199,7 @@ #define W83627THF_REG_PWM2 0x03 /* 697HF and 637HF too */ #define W83627THF_REG_PWM3 0x11 /* 637HF too */ -#define W83627THF_REG_VRM_OVT_CFG 0x18 /* 637HF too, unused yet */ +#define W83627THF_REG_VRM_OVT_CFG 0x18 /* 637HF too */ static const u8 regpwm_627hf[] = { W83627HF_REG_PWM1, W83627HF_REG_PWM2 }; static const u8 regpwm[] = { W83627THF_REG_PWM1, W83627THF_REG_PWM2, @@ -222,7 +222,7 @@ these macros are called: arguments may be evaluated more than once. Fixing this is just not worth it. */ #define IN_TO_REG(val) (SENSORS_LIMIT((((val) + 8)/16),0,255)) -#define IN_FROM_REG(val) ((val) * 16 + 5) +#define IN_FROM_REG(val) ((val) * 16) static inline u8 FAN_TO_REG(long rpm, int div) { @@ -312,6 +312,7 @@ Default = 3435. Other Betas unimplemented */ u8 vrm; + u8 vrm_ovt; /* Register value, 627thf & 637hf only */ }; @@ -370,7 +371,7 @@ { \ return show_in(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL) +static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); #define sysfs_in_reg_offset(reg, offset) \ static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ @@ -384,22 +385,104 @@ return store_in_##reg (dev, buf, count, 0x##offset); \ } \ static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, \ - show_regs_in_##reg##offset, store_regs_in_##reg##offset) + show_regs_in_##reg##offset, store_regs_in_##reg##offset); #define sysfs_in_offsets(offset) \ sysfs_in_offset(offset) \ sysfs_in_reg_offset(min, offset) \ sysfs_in_reg_offset(max, offset) -sysfs_in_offsets(0) -sysfs_in_offsets(1) -sysfs_in_offsets(2) -sysfs_in_offsets(3) -sysfs_in_offsets(4) -sysfs_in_offsets(5) -sysfs_in_offsets(6) -sysfs_in_offsets(7) -sysfs_in_offsets(8) +sysfs_in_offsets(1); +sysfs_in_offsets(2); +sysfs_in_offsets(3); +sysfs_in_offsets(4); +sysfs_in_offsets(5); +sysfs_in_offsets(6); +sysfs_in_offsets(7); +sysfs_in_offsets(8); + +/* use a different set of functions for in0 */ +static ssize_t show_in_0(struct w83627hf_data *data, char *buf, u8 reg) +{ + long in0; + + if ((data->vrm_ovt & 0x01) && + (w83627thf == data->type || w83637hf == data->type)) + + /* use VRM9 calculation */ + in0 = (long)((reg * 488 + 70000 + 50) / 100); + else + /* use VRM8 (standard) calculation */ + in0 = (long)IN_FROM_REG(reg); + + return sprintf(buf,"%ld\n", in0); +} + +static ssize_t show_regs_in_0(struct device *dev, char *buf) +{ + struct w83627hf_data *data = w83627hf_update_device(dev); + return show_in_0(data, buf, data->in[0]); +} + +static ssize_t show_regs_in_min0(struct device *dev, char *buf) +{ + struct w83627hf_data *data = w83627hf_update_device(dev); + return show_in_0(data, buf, data->in_min[0]); +} + +static ssize_t show_regs_in_max0(struct device *dev, char *buf) +{ + struct w83627hf_data *data = w83627hf_update_device(dev); + return show_in_0(data, buf, data->in_max[0]); +} + +static ssize_t store_regs_in_min0(struct device *dev, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct w83627hf_data *data = i2c_get_clientdata(client); + u32 val; + + val = simple_strtoul(buf, NULL, 10); + if ((data->vrm_ovt & 0x01) && + (w83627thf == data->type || w83637hf == data->type)) + + /* use VRM9 calculation */ + data->in_min[0] = (u8)(((val * 100) - 70000 + 244) / 488); + else + /* use VRM8 (standard) calculation */ + data->in_min[0] = IN_TO_REG(val); + + w83627hf_write_value(client, W83781D_REG_IN_MIN(0), data->in_min[0]); + return count; +} + +static ssize_t store_regs_in_max0(struct device *dev, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct w83627hf_data *data = i2c_get_clientdata(client); + u32 val; + + val = simple_strtoul(buf, NULL, 10); + if ((data->vrm_ovt & 0x01) && + (w83627thf == data->type || w83637hf == data->type)) + + /* use VRM9 calculation */ + data->in_max[0] = (u8)(((val * 100) - 70000 + 244) / 488); + else + /* use VRM8 (standard) calculation */ + data->in_max[0] = IN_TO_REG(val); + + w83627hf_write_value(client, W83781D_REG_IN_MAX(0), data->in_max[0]); + return count; +} + +static DEVICE_ATTR(in0_input, S_IRUGO, show_regs_in_0, NULL); +static DEVICE_ATTR(in0_min, S_IRUGO | S_IWUSR, + show_regs_in_min0, store_regs_in_min0); +static DEVICE_ATTR(in0_max, S_IRUGO | S_IWUSR, + show_regs_in_max0, store_regs_in_max0); #define device_create_file_in(client, offset) \ do { \ @@ -416,8 +499,8 @@ FAN_FROM_REG(data->reg[nr-1], \ (long)DIV_FROM_REG(data->fan_div[nr-1]))); \ } -show_fan_reg(fan) -show_fan_reg(fan_min) +show_fan_reg(fan); +show_fan_reg(fan_min); static ssize_t store_fan_min(struct device *dev, const char *buf, size_t count, int nr) @@ -440,7 +523,7 @@ { \ return show_fan(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL) +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); #define sysfs_fan_min_offset(offset) \ static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ @@ -453,14 +536,14 @@ return store_fan_min(dev, buf, count, 0x##offset); \ } \ static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ - show_regs_fan_min##offset, store_regs_fan_min##offset) + show_regs_fan_min##offset, store_regs_fan_min##offset); -sysfs_fan_offset(1) -sysfs_fan_min_offset(1) -sysfs_fan_offset(2) -sysfs_fan_min_offset(2) -sysfs_fan_offset(3) -sysfs_fan_min_offset(3) +sysfs_fan_offset(1); +sysfs_fan_min_offset(1); +sysfs_fan_offset(2); +sysfs_fan_min_offset(2); +sysfs_fan_offset(3); +sysfs_fan_min_offset(3); #define device_create_file_fan(client, offset) \ do { \ @@ -479,9 +562,9 @@ return sprintf(buf,"%ld\n", (long)TEMP_FROM_REG(data->reg)); \ } \ } -show_temp_reg(temp) -show_temp_reg(temp_max) -show_temp_reg(temp_max_hyst) +show_temp_reg(temp); +show_temp_reg(temp_max); +show_temp_reg(temp_max_hyst); #define store_temp_reg(REG, reg) \ static ssize_t \ @@ -505,8 +588,8 @@ \ return count; \ } -store_temp_reg(OVER, max) -store_temp_reg(HYST, max_hyst) +store_temp_reg(OVER, max); +store_temp_reg(HYST, max_hyst); #define sysfs_temp_offset(offset) \ static ssize_t \ @@ -514,7 +597,7 @@ { \ return show_temp(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL) +static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); #define sysfs_temp_reg_offset(reg, offset) \ static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ @@ -528,16 +611,16 @@ return store_temp_##reg (dev, buf, count, 0x##offset); \ } \ static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, \ - show_regs_temp_##reg##offset, store_regs_temp_##reg##offset) + show_regs_temp_##reg##offset, store_regs_temp_##reg##offset); #define sysfs_temp_offsets(offset) \ sysfs_temp_offset(offset) \ sysfs_temp_reg_offset(max, offset) \ sysfs_temp_reg_offset(max_hyst, offset) -sysfs_temp_offsets(1) -sysfs_temp_offsets(2) -sysfs_temp_offsets(3) +sysfs_temp_offsets(1); +sysfs_temp_offsets(2); +sysfs_temp_offsets(3); #define device_create_file_temp(client, offset) \ do { \ @@ -552,7 +635,7 @@ struct w83627hf_data *data = w83627hf_update_device(dev); return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); } -static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL) +static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL); #define device_create_file_vid(client) \ device_create_file(&client->dev, &dev_attr_in0_ref) @@ -574,7 +657,7 @@ return count; } -static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg) +static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); #define device_create_file_vrm(client) \ device_create_file(&client->dev, &dev_attr_vrm) @@ -584,7 +667,7 @@ struct w83627hf_data *data = w83627hf_update_device(dev); return sprintf(buf, "%ld\n", (long) data->alarms); } -static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL) +static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); #define device_create_file_alarms(client) \ device_create_file(&client->dev, &dev_attr_alarms) @@ -641,10 +724,10 @@ return store_beep_reg(dev, buf, count, BEEP_##REG); \ } \ static DEVICE_ATTR(beep_##reg, S_IRUGO | S_IWUSR, \ - show_regs_beep_##reg, store_regs_beep_##reg) + show_regs_beep_##reg, store_regs_beep_##reg); -sysfs_beep(ENABLE, enable) -sysfs_beep(MASK, mask) +sysfs_beep(ENABLE, enable); +sysfs_beep(MASK, mask); #define device_create_file_beep(client) \ do { \ @@ -707,11 +790,11 @@ return store_fan_div_reg(dev, buf, count, offset - 1); \ } \ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ - show_regs_fan_div_##offset, store_regs_fan_div_##offset) + show_regs_fan_div_##offset, store_regs_fan_div_##offset); -sysfs_fan_div(1) -sysfs_fan_div(2) -sysfs_fan_div(3) +sysfs_fan_div(1); +sysfs_fan_div(2); +sysfs_fan_div(3); #define device_create_file_fan_div(client, offset) \ do { \ @@ -763,11 +846,11 @@ return store_pwm_reg(dev, buf, count, offset); \ } \ static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, \ - show_regs_pwm_##offset, store_regs_pwm_##offset) + show_regs_pwm_##offset, store_regs_pwm_##offset); -sysfs_pwm(1) -sysfs_pwm(2) -sysfs_pwm(3) +sysfs_pwm(1); +sysfs_pwm(2); +sysfs_pwm(3); #define device_create_file_pwm(client, offset) \ do { \ @@ -836,11 +919,11 @@ return store_sensor_reg(dev, buf, count, offset); \ } \ static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \ - show_regs_sensor_##offset, store_regs_sensor_##offset) + show_regs_sensor_##offset, store_regs_sensor_##offset); -sysfs_sensor(1) -sysfs_sensor(2) -sysfs_sensor(3) +sysfs_sensor(1); +sysfs_sensor(2); +sysfs_sensor(3); #define device_create_file_sensor(client, offset) \ do { \ @@ -1157,7 +1240,7 @@ static void w83627hf_init_client(struct i2c_client *client) { struct w83627hf_data *data = i2c_get_clientdata(client); - int vid = 0, i; + int i; int type = data->type; u8 tmp; @@ -1191,10 +1274,15 @@ data->vid = w83627thf_read_gpio5(client) & 0x1f; } - /* Convert VID to voltage based on default VRM */ - data->vrm = DEFAULT_VRM; - if (type != w83697hf) - vid = vid_from_reg(vid, data->vrm); + /* Read VRM & OVT Config only once */ + if (w83627thf == data->type || w83637hf == data->type) { + data->vrm_ovt = + w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG); + data->vrm = (data->vrm_ovt & 0x01) ? 90 : 82; + } else { + /* Convert VID to voltage based on default VRM */ + data->vrm = DEFAULT_VRM; + } tmp = w83627hf_read_value(client, W83781D_REG_SCFG1); for (i = 1; i <= 3; i++) { diff -Nru a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c --- a/drivers/i2c/chips/w83781d.c 2004-06-23 19:04:24 -07:00 +++ b/drivers/i2c/chips/w83781d.c 2004-06-23 19:04:24 -07:00 @@ -320,7 +320,7 @@ { \ return show_in(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL) +static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL); #define sysfs_in_reg_offset(reg, offset) \ static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \ @@ -331,7 +331,7 @@ { \ return store_in_##reg (dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_in_##reg##offset, store_regs_in_##reg##offset) +static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_in_##reg##offset, store_regs_in_##reg##offset); #define sysfs_in_offsets(offset) \ sysfs_in_offset(offset); \ @@ -386,7 +386,7 @@ { \ return show_fan(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL) +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL); #define sysfs_fan_min_offset(offset) \ static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \ @@ -397,7 +397,7 @@ { \ return store_fan_min(dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, show_regs_fan_min##offset, store_regs_fan_min##offset) +static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, show_regs_fan_min##offset, store_regs_fan_min##offset); sysfs_fan_offset(1); sysfs_fan_min_offset(1); @@ -466,7 +466,7 @@ { \ return show_temp(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL) +static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL); #define sysfs_temp_reg_offset(reg, offset) \ static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \ @@ -477,7 +477,7 @@ { \ return store_temp_##reg (dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_temp_##reg##offset, store_regs_temp_##reg##offset) +static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_temp_##reg##offset, store_regs_temp_##reg##offset); #define sysfs_temp_offsets(offset) \ sysfs_temp_offset(offset); \ @@ -503,7 +503,7 @@ } static -DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL) +DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL); #define device_create_file_vid(client) \ device_create_file(&client->dev, &dev_attr_in0_ref); static ssize_t @@ -527,7 +527,7 @@ } static -DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg) +DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); #define device_create_file_vrm(client) \ device_create_file(&client->dev, &dev_attr_vrm); static ssize_t @@ -538,7 +538,7 @@ } static -DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL) +DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); #define device_create_file_alarms(client) \ device_create_file(&client->dev, &dev_attr_alarms); static ssize_t show_beep_mask (struct device *dev, char *buf) @@ -598,7 +598,7 @@ { \ return store_beep_reg(dev, buf, count, BEEP_##REG); \ } \ -static DEVICE_ATTR(beep_##reg, S_IRUGO | S_IWUSR, show_regs_beep_##reg, store_regs_beep_##reg) +static DEVICE_ATTR(beep_##reg, S_IRUGO | S_IWUSR, show_regs_beep_##reg, store_regs_beep_##reg); sysfs_beep(ENABLE, enable); sysfs_beep(MASK, mask); @@ -665,7 +665,7 @@ { \ return store_fan_div_reg(dev, buf, count, offset - 1); \ } \ -static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, show_regs_fan_div_##offset, store_regs_fan_div_##offset) +static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, show_regs_fan_div_##offset, store_regs_fan_div_##offset); sysfs_fan_div(1); sysfs_fan_div(2); @@ -744,7 +744,7 @@ { \ return store_pwm_reg(dev, buf, count, offset); \ } \ -static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, show_regs_pwm_##offset, store_regs_pwm_##offset) +static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, show_regs_pwm_##offset, store_regs_pwm_##offset); #define sysfs_pwmenable(offset) \ static ssize_t show_regs_pwmenable_##offset (struct device *dev, char *buf) \ @@ -755,7 +755,7 @@ { \ return store_pwmenable_reg(dev, buf, count, offset); \ } \ -static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset) +static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset); sysfs_pwm(1); sysfs_pwm(2); @@ -833,7 +833,7 @@ { \ return store_sensor_reg(dev, buf, count, offset); \ } \ -static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, show_regs_sensor_##offset, store_regs_sensor_##offset) +static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, show_regs_sensor_##offset, store_regs_sensor_##offset); sysfs_sensor(1); sysfs_sensor(2); @@ -891,7 +891,7 @@ { \ return store_rt_reg(dev, buf, count, offset); \ } \ -static DEVICE_ATTR(rt##offset, S_IRUGO | S_IWUSR, show_regs_rt_##offset, store_regs_rt_##offset) +static DEVICE_ATTR(rt##offset, S_IRUGO | S_IWUSR, show_regs_rt_##offset, store_regs_rt_##offset); sysfs_rt(1); sysfs_rt(2); @@ -1491,7 +1491,7 @@ w83781d_init_client(struct i2c_client *client) { struct w83781d_data *data = i2c_get_clientdata(client); - int vid = 0, i, p; + int i, p; int type = data->type; u8 tmp; @@ -1513,14 +1513,7 @@ w83781d_write_value(client, W83781D_REG_BEEP_INTS2, 0); } - if (type != w83697hf) { - vid = w83781d_read_value(client, W83781D_REG_VID_FANDIV) & 0x0f; - vid |= - (w83781d_read_value(client, W83781D_REG_CHIPID) & 0x01) << - 4; - data->vrm = DEFAULT_VRM; - vid = vid_from_reg(vid, data->vrm); - } + data->vrm = 82; if ((type != w83781d) && (type != as99127f)) { tmp = w83781d_read_value(client, W83781D_REG_SCFG1); diff -Nru a/drivers/i2c/chips/w83l785ts.c b/drivers/i2c/chips/w83l785ts.c --- a/drivers/i2c/chips/w83l785ts.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/i2c/chips/w83l785ts.c 2004-06-23 19:04:26 -07:00 @@ -137,8 +137,8 @@ return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over)); } -static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL) -static DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_over, NULL) +static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL); +static DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_over, NULL); /* * Real code diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c --- a/drivers/i2c/i2c-core.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/i2c/i2c-core.c 2004-06-23 19:04:25 -07:00 @@ -126,7 +126,13 @@ goto out_unlock; } - id = idr_get_new(&i2c_adapter_idr, NULL); + res = idr_get_new(&i2c_adapter_idr, NULL, &id); + if (res < 0) { + if (res == -EAGAIN) + res = -ENOMEM; + goto out_unlock; + } + adap->nr = id & MAX_ID_MASK; init_MUTEX(&adap->bus_lock); init_MUTEX(&adap->clist_lock); @@ -162,7 +168,7 @@ dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr); - out_unlock: +out_unlock: up(&core_lists); return res; } diff -Nru a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c --- a/drivers/i2c/i2c-dev.c 2004-06-23 19:04:28 -07:00 +++ b/drivers/i2c/i2c-dev.c 2004-06-23 19:04:28 -07:00 @@ -181,7 +181,7 @@ struct i2c_smbus_ioctl_data data_arg; union i2c_smbus_data temp; struct i2c_msg *rdwr_pa; - u8 **data_ptrs; + u8 __user **data_ptrs; int i,datasize,res; unsigned long funcs; @@ -238,8 +238,7 @@ return -EFAULT; } - data_ptrs = (u8 **) kmalloc(rdwr_arg.nmsgs * sizeof(u8 *), - GFP_KERNEL); + data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL); if (data_ptrs == NULL) { kfree(rdwr_pa); return -ENOMEM; @@ -252,7 +251,7 @@ res = -EINVAL; break; } - data_ptrs[i] = rdwr_pa[i].buf; + data_ptrs[i] = (u8 __user *)rdwr_pa[i].buf; rdwr_pa[i].buf = kmalloc(rdwr_pa[i].len, GFP_KERNEL); if(rdwr_pa[i].buf == NULL) { res = -ENOMEM; diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig --- a/drivers/ide/Kconfig 2004-06-23 19:04:26 -07:00 +++ b/drivers/ide/Kconfig 2004-06-23 19:04:26 -07:00 @@ -95,27 +95,29 @@ comment "Please see Documentation/ide.txt for help/info on IDE drives" -config BLK_DEV_HD_IDE - bool "Use old disk-only driver on primary interface" - depends on ((X86 && X86_PC9800!=y) || SH_MPC1211) +config BLK_DEV_IDE_SATA + bool "Support for SATA (deprecated; conflicts with libata SATA driver)" + default n ---help--- - There are two drivers for MFM/RLL/IDE disks. Most people use just - the new enhanced driver by itself. This option however installs the - old hard disk driver to control the primary IDE/disk interface in - the system, leaving the new enhanced IDE driver to take care of only - the 2nd/3rd/4th IDE interfaces. Doing this will prevent you from - having an IDE/ATAPI CD-ROM or tape drive connected to the primary - IDE interface. Choosing this option may be useful for older systems - which have MFM/RLL/ESDI controller+drives at the primary port - address (0x1f0), along with IDE drives at the secondary/3rd/4th port - addresses. + There are two drivers for Serial ATA controllers. + + The main driver, "libata", exists inside the SCSI subsystem + and supports most modern SATA controllers. - Normally, just say N here; you will then use the new driver for all - 4 interfaces. + The IDE driver (which you are currently configuring) supports + a few first-generation SATA controllers. -config BLK_DEV_HD_IDE98 + In order to eliminate conflicts between the two subsystems, + this config option enables the IDE driver's SATA support. + Normally this is disabled, as it is preferred that libata + supports SATA controllers, and this (IDE) driver supports + PATA controllers. + + If unsure, say N. + +config BLK_DEV_HD_IDE bool "Use old disk-only driver on primary interface" - depends on X86 && X86_PC9800 + depends on (X86 || SH_MPC1211) ---help--- There are two drivers for MFM/RLL/IDE disks. Most people use just the new enhanced driver by itself. This option however installs the diff -Nru a/drivers/ide/Makefile b/drivers/ide/Makefile --- a/drivers/ide/Makefile 2004-06-23 19:04:27 -07:00 +++ b/drivers/ide/Makefile 2004-06-23 19:04:27 -07:00 @@ -29,7 +29,6 @@ ide-core-$(CONFIG_IDE_ARM) += arm/ide_arm.o # built-in only drivers from legacy/ -ide-core-$(CONFIG_BLK_DEV_IDE_PC9800) += legacy/pc9800.o ide-core-$(CONFIG_BLK_DEV_BUDDHA) += legacy/buddha.o ide-core-$(CONFIG_BLK_DEV_FALCON_IDE) += legacy/falconide.o ide-core-$(CONFIG_BLK_DEV_GAYLE) += legacy/gayle.o diff -Nru a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c --- a/drivers/ide/ide-cd.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/ide/ide-cd.c 2004-06-23 19:04:26 -07:00 @@ -2816,7 +2816,6 @@ return 0; } - /* * Close down the device. Invalidate all cached blocks. */ @@ -2890,12 +2889,6 @@ devinfo->mask |= CDC_CLOSE_TRAY; if (!CDROM_CONFIG_FLAGS(drive)->mo_drive) devinfo->mask |= CDC_MO_DRIVE; - if (!CDROM_CONFIG_FLAGS(drive)->mrw) - devinfo->mask |= CDC_MRW; - if (!CDROM_CONFIG_FLAGS(drive)->mrw_w) - devinfo->mask |= CDC_MRW_W; - if (!CDROM_CONFIG_FLAGS(drive)->ram) - devinfo->mask |= CDC_RAM; devinfo->disk = drive->disk; return register_cdrom(devinfo); @@ -2932,7 +2925,7 @@ struct cdrom_info *info = drive->driver_data; struct cdrom_device_info *cdi = &info->devinfo; struct atapi_capabilities_page cap; - int nslots = 1, mrw_write = 0, ram_write = 0; + int nslots = 1; if (drive->media == ide_optical) { CDROM_CONFIG_FLAGS(drive)->mo_drive = 1; @@ -2961,17 +2954,6 @@ if (ide_cdrom_get_capabilities(drive, &cap)) return 0; - if (!cdrom_is_mrw(cdi, &mrw_write)) { - CDROM_CONFIG_FLAGS(drive)->mrw = 1; - if (mrw_write) { - CDROM_CONFIG_FLAGS(drive)->mrw_w = 1; - CDROM_CONFIG_FLAGS(drive)->ram = 1; - } - } - if (!cdrom_is_random_writable(cdi, &ram_write)) - if (ram_write) - CDROM_CONFIG_FLAGS(drive)->ram = 1; - if (cap.lock == 0) CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; if (cap.eject) @@ -3050,9 +3032,6 @@ printk(" CD%s%s", (CDROM_CONFIG_FLAGS(drive)->cd_r)? "-R" : "", (CDROM_CONFIG_FLAGS(drive)->cd_rw)? "/RW" : ""); - - if (CDROM_CONFIG_FLAGS(drive)->mrw || CDROM_CONFIG_FLAGS(drive)->mrw_w) - printk(" CD-MR%s", CDROM_CONFIG_FLAGS(drive)->mrw_w ? "W" : ""); if (CDROM_CONFIG_FLAGS(drive)->is_changer) printk(" changer w/%d slots", nslots); diff -Nru a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h --- a/drivers/ide/ide-cd.h 2004-06-23 19:04:29 -07:00 +++ b/drivers/ide/ide-cd.h 2004-06-23 19:04:29 -07:00 @@ -79,8 +79,6 @@ __u8 dvd : 1; /* Drive is a DVD-ROM */ __u8 dvd_r : 1; /* Drive can write DVD-R */ __u8 dvd_ram : 1; /* Drive can write DVD-RAM */ - __u8 mrw : 1; /* drive can read mrw */ - __u8 mrw_w : 1; /* drive can write mrw */ __u8 ram : 1; /* generic WRITE (dvd-ram/mrw) */ __u8 test_write : 1; /* Drive can fake writes */ __u8 supp_disc_present : 1; /* Changer can report exact contents diff -Nru a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c --- a/drivers/ide/ide-proc.c 2004-06-23 19:04:27 -07:00 +++ b/drivers/ide/ide-proc.c 2004-06-23 19:04:27 -07:00 @@ -321,7 +321,6 @@ case ide_cy82c693: name = "cy82c693"; break; case ide_4drives: name = "4drives"; break; case ide_pmac: name = "mac-io"; break; - case ide_pc9800: name = "pc9800"; break; default: name = "(unknown)"; break; } len = sprintf(page, "%s\n", name); diff -Nru a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c --- a/drivers/ide/ide-tape.c 2004-06-23 19:04:26 -07:00 +++ b/drivers/ide/ide-tape.c 2004-06-23 19:04:26 -07:00 @@ -2674,7 +2674,7 @@ return __idetape_kmalloc_stage(tape, 0, 0); } -static void idetape_copy_stage_from_user (idetape_tape_t *tape, idetape_stage_t *stage, const char *buf, int n) +static void idetape_copy_stage_from_user (idetape_tape_t *tape, idetape_stage_t *stage, const char __user *buf, int n) { struct idetape_bh *bh = tape->bh; int count; @@ -2701,7 +2701,7 @@ tape->bh = bh; } -static void idetape_copy_stage_to_user (idetape_tape_t *tape, char *buf, idetape_stage_t *stage, int n) +static void idetape_copy_stage_to_user (idetape_tape_t *tape, char __user *buf, idetape_stage_t *stage, int n) { struct idetape_bh *bh = tape->bh; int count; @@ -3610,6 +3610,7 @@ { idetape_tape_t *tape = drive->driver_data; idetape_config_t config; + void __user *argp = (void __user *)arg; #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) @@ -3617,7 +3618,7 @@ #endif /* IDETAPE_DEBUG_LOG */ switch (cmd) { case 0x0340: - if (copy_from_user ((char *) &config, (char *) arg, sizeof (idetape_config_t))) + if (copy_from_user(&config, argp, sizeof (idetape_config_t))) return -EFAULT; tape->best_dsc_rw_frequency = config.dsc_rw_frequency; tape->max_stages = config.nr_stages; @@ -3625,7 +3626,7 @@ case 0x0350: config.dsc_rw_frequency = (int) tape->best_dsc_rw_frequency; config.nr_stages = tape->max_stages; - if (copy_to_user((char *) arg, (char *) &config, sizeof (idetape_config_t))) + if (copy_to_user(argp, &config, sizeof (idetape_config_t))) return -EFAULT; break; default: @@ -3747,7 +3748,7 @@ * will no longer hit performance. * This is not applicable to Onstream. */ -static ssize_t idetape_chrdev_read (struct file *file, char *buf, +static ssize_t idetape_chrdev_read (struct file *file, char __user *buf, size_t count, loff_t *ppos) { ide_drive_t *drive = file->private_data; @@ -3810,7 +3811,7 @@ return actually_read; } -static ssize_t idetape_chrdev_write (struct file *file, const char *buf, +static ssize_t idetape_chrdev_write (struct file *file, const char __user *buf, size_t count, loff_t *ppos) { ide_drive_t *drive = file->private_data; @@ -4127,6 +4128,7 @@ struct mtget mtget; struct mtpos mtpos; int block_offset = 0, position = tape->first_frame_position; + void __user *argp = (void __user *)arg; #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 3) @@ -4146,7 +4148,7 @@ } switch (cmd) { case MTIOCTOP: - if (copy_from_user((char *) &mtop, (char *) arg, sizeof (struct mtop))) + if (copy_from_user(&mtop, argp, sizeof (struct mtop))) return -EFAULT; return (idetape_mtioctop(drive,mtop.mt_op,mtop.mt_count)); case MTIOCGET: @@ -4157,12 +4159,12 @@ if (tape->drv_write_prot) { mtget.mt_gstat |= GMT_WR_PROT(0xffffffff); } - if (copy_to_user((char *) arg,(char *) &mtget, sizeof(struct mtget))) + if (copy_to_user(argp, &mtget, sizeof(struct mtget))) return -EFAULT; return 0; case MTIOCPOS: mtpos.mt_blkno = position / tape->user_bs_factor - block_offset; - if (copy_to_user((char *) arg,(char *) &mtpos, sizeof(struct mtpos))) + if (copy_to_user(argp, &mtpos, sizeof(struct mtpos))) return -EFAULT; return 0; default: diff -Nru a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c --- a/drivers/ide/legacy/hd.c 2004-06-23 19:04:25 -07:00 +++ b/drivers/ide/legacy/hd.c 2004-06-23 19:04:25 -07:00 @@ -660,7 +660,7 @@ unsigned int cmd, unsigned long arg) { struct hd_i_struct *disk = inode->i_bdev->bd_disk->private_data; - struct hd_geometry *loc = (struct hd_geometry *) arg; + struct hd_geometry __user *loc = (struct hd_geometry __user *) arg; struct hd_geometry g; if (cmd != HDIO_GETGEO) diff -Nru a/drivers/ide/legacy/hd98.c b/drivers/ide/legacy/hd98.c --- a/drivers/ide/legacy/hd98.c 2004-06-23 19:04:28 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,883 +0,0 @@ -/* - * Copyright (C) 1991, 1992 Linus Torvalds - * - * This is the low-level hd interrupt support. It traverses the - * request-list, using interrupts to jump between functions. As - * all the functions are called within interrupts, we may not - * sleep. Special care is recommended. - * - * modified by Drew Eckhardt to check nr of hd's from the CMOS. - * - * Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug - * in the early extended-partition checks and added DM partitions - * - * IRQ-unmask, drive-id, multiple-mode, support for ">16 heads", - * and general streamlining by Mark Lord. - * - * Removed 99% of above. Use Mark's ide driver for those options. - * This is now a lightweight ST-506 driver. (Paul Gortmaker) - * - * Modified 1995 Russell King for ARM processor. - * - * Bugfix: max_sectors must be <= 255 or the wheels tend to come - * off in a hurry once you queue things up - Paul G. 02/2001 - */ - -/* Uncomment the following if you want verbose error reports. */ -/* #define VERBOSE_ERRORS */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* CMOS defines */ -#include -#include -#include - -#define REALLY_SLOW_IO -#include -#include -#include - -#include "io_ports.h" - -#ifdef __arm__ -#undef HD_IRQ -#endif -#include -#ifdef __arm__ -#define HD_IRQ IRQ_HARDDISK -#endif - -/* Hd controller regster ports */ - -#define HD_DATA 0x640 /* _CTL when writing */ -#define HD_ERROR 0x642 /* see err-bits */ -#define HD_NSECTOR 0x644 /* nr of sectors to read/write */ -#define HD_SECTOR 0x646 /* starting sector */ -#define HD_LCYL 0x648 /* starting cylinder */ -#define HD_HCYL 0x64a /* high byte of starting cyl */ -#define HD_CURRENT 0x64c /* 101dhhhh , d=drive, hhhh=head */ -#define HD_STATUS 0x64e /* see status-bits */ -#define HD_FEATURE HD_ERROR /* same io address, read=error, write=feature */ -#define HD_PRECOMP HD_FEATURE /* obsolete use of this port - predates IDE */ -#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */ - -#define HD_CMD 0x74c /* used for resets */ -#define HD_ALTSTATUS 0x74c /* same as HD_STATUS but doesn't clear irq */ - -/* Bits of HD_STATUS */ -#define ERR_STAT 0x01 -#define INDEX_STAT 0x02 -#define ECC_STAT 0x04 /* Corrected error */ -#define DRQ_STAT 0x08 -#define SEEK_STAT 0x10 -#define SERVICE_STAT SEEK_STAT -#define WRERR_STAT 0x20 -#define READY_STAT 0x40 -#define BUSY_STAT 0x80 - -/* Bits for HD_ERROR */ -#define MARK_ERR 0x01 /* Bad address mark */ -#define TRK0_ERR 0x02 /* couldn't find track 0 */ -#define ABRT_ERR 0x04 /* Command aborted */ -#define MCR_ERR 0x08 /* media change request */ -#define ID_ERR 0x10 /* ID field not found */ -#define MC_ERR 0x20 /* media changed */ -#define ECC_ERR 0x40 /* Uncorrectable ECC error */ -#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */ -#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */ - -static spinlock_t hd_lock = SPIN_LOCK_UNLOCKED; -static struct request_queue *hd_queue; - -#define CURRENT elv_next_request(hd_queue) - -#define TIMEOUT_VALUE (6*HZ) -#define HD_DELAY 0 - -#define MAX_ERRORS 16 /* Max read/write errors/sector */ -#define RESET_FREQ 8 /* Reset controller every 8th retry */ -#define RECAL_FREQ 4 /* Recalibrate every 4th retry */ -#define MAX_HD 2 - -#define STAT_OK (READY_STAT|SEEK_STAT) -#define OK_STATUS(s) (((s)&(STAT_OK|(BUSY_STAT|WRERR_STAT|ERR_STAT)))==STAT_OK) - -static void recal_intr(void); -static void bad_rw_intr(void); - -static int reset; -static int hd_error; - -/* - * This struct defines the HD's and their types. - */ -struct hd_i_struct { - unsigned int head,sect,cyl,wpcom,lzone,ctl; - int unit; - int recalibrate; - int special_op; -}; - -#ifdef HD_TYPE -static struct hd_i_struct hd_info[] = { HD_TYPE }; -static int NR_HD = ((sizeof (hd_info))/(sizeof (struct hd_i_struct))); -#else -static struct hd_i_struct hd_info[MAX_HD]; -static int NR_HD; -#endif - -static struct gendisk *hd_gendisk[MAX_HD]; - -static struct timer_list device_timer; - -#define TIMEOUT_VALUE (6*HZ) - -#define SET_TIMER \ - do { \ - mod_timer(&device_timer, jiffies + TIMEOUT_VALUE); \ - } while (0) - -static void (*do_hd)(void) = NULL; -#define SET_HANDLER(x) \ -if ((do_hd = (x)) != NULL) \ - SET_TIMER; \ -else \ - del_timer(&device_timer); - - -#if (HD_DELAY > 0) -unsigned long last_req; - -unsigned long read_timer(void) -{ - extern spinlock_t i8253_lock; - unsigned long t, flags; - int i; - - spin_lock_irqsave(&i8253_lock, flags); - t = jiffies * 11932; - outb_p(0, PIT_MODE); - i = inb_p(PIT_CH0); - i |= inb(PIT_CH0) << 8; - spin_unlock_irqrestore(&i8253_lock, flags); - return(t - i); -} -#endif - -void __init hd_setup(char *str, int *ints) -{ - int hdind = 0; - - if (ints[0] != 3) - return; - if (hd_info[0].head != 0) - hdind=1; - hd_info[hdind].head = ints[2]; - hd_info[hdind].sect = ints[3]; - hd_info[hdind].cyl = ints[1]; - hd_info[hdind].wpcom = 0; - hd_info[hdind].lzone = ints[1]; - hd_info[hdind].ctl = (ints[2] > 8 ? 8 : 0); - NR_HD = hdind+1; -} - -static void dump_status (const char *msg, unsigned int stat) -{ - char *name = CURRENT ? - CURRENT->rq_dev->bd_disk->disk_name : - "hd?"; -#ifdef VERBOSE_ERRORS - printk("%s: %s: status=0x%02x { ", name, msg, stat & 0xff); - if (stat & BUSY_STAT) printk("Busy "); - if (stat & READY_STAT) printk("DriveReady "); - if (stat & WRERR_STAT) printk("WriteFault "); - if (stat & SEEK_STAT) printk("SeekComplete "); - if (stat & DRQ_STAT) printk("DataRequest "); - if (stat & ECC_STAT) printk("CorrectedError "); - if (stat & INDEX_STAT) printk("Index "); - if (stat & ERR_STAT) printk("Error "); - printk("}\n"); - if ((stat & ERR_STAT) == 0) { - hd_error = 0; - } else { - hd_error = inb(HD_ERROR); - printk("%s: %s: error=0x%02x { ", name, msg, hd_error & 0xff); - if (hd_error & BBD_ERR) printk("BadSector "); - if (hd_error & ECC_ERR) printk("UncorrectableError "); - if (hd_error & ID_ERR) printk("SectorIdNotFound "); - if (hd_error & ABRT_ERR) printk("DriveStatusError "); - if (hd_error & TRK0_ERR) printk("TrackZeroNotFound "); - if (hd_error & MARK_ERR) printk("AddrMarkNotFound "); - printk("}"); - if (hd_error & (BBD_ERR|ECC_ERR|ID_ERR|MARK_ERR)) { - printk(", CHS=%d/%d/%d", (inb(HD_HCYL)<<8) + inb(HD_LCYL), - inb(HD_CURRENT) & 0xf, inb(HD_SECTOR)); - if (CURRENT) - printk(", sector=%ld", CURRENT->sector); - } - printk("\n"); - } -#else - printk("%s: %s: status=0x%02x.\n", name, msg, stat & 0xff); - if ((stat & ERR_STAT) == 0) { - hd_error = 0; - } else { - hd_error = inb(HD_ERROR); - printk("%s: %s: error=0x%02x.\n", name, msg, hd_error & 0xff); - } -#endif -} - -void check_status(void) -{ - int i = inb(HD_STATUS); - - if (!OK_STATUS(i)) { - dump_status("check_status", i); - bad_rw_intr(); - } -} - -static int controller_busy(void) -{ - int retries = 100000; - unsigned char status; - - do { - status = inb(HD_STATUS); - } while ((status & BUSY_STAT) && --retries); - return status; -} - -static int status_ok(void) -{ - unsigned char status = inb(HD_STATUS); - - if (status & BUSY_STAT) - return 1; /* Ancient, but does it make sense??? */ - if (status & WRERR_STAT) - return 0; - if (!(status & READY_STAT)) - return 0; - if (!(status & SEEK_STAT)) - return 0; - return 1; -} - -static int controller_ready(unsigned int drive, unsigned int head) -{ - int retry = 100; - - do { - if (controller_busy() & BUSY_STAT) - return 0; - outb(0xA0 | (drive<<4) | head, HD_CURRENT); - if (status_ok()) - return 1; - } while (--retry); - return 0; -} - -static void hd_out(struct hd_i_struct *disk, - unsigned int nsect, - unsigned int sect, - unsigned int head, - unsigned int cyl, - unsigned int cmd, - void (*intr_addr)(void)) -{ - unsigned short port; - -#if (HD_DELAY > 0) - while (read_timer() - last_req < HD_DELAY) - /* nothing */; -#endif - if (reset) - return; - if (!controller_ready(disk->unit, head)) { - reset = 1; - return; - } - SET_HANDLER(intr_addr); - outb(disk->ctl,HD_CMD); - port=HD_DATA + 2; - outb(disk->wpcom>>2, port); port += 2; - outb(nsect, port); port += 2; - outb(sect, port); port += 2; - outb(cyl, port); port += 2; - outb(cyl>>8, port); port += 2; - outb(0xA0|(disk->unit<<4)|head, port); port += 2; - outb(cmd, port); -} - -static void hd_request (void); - -static int drive_busy(void) -{ - unsigned int i; - unsigned char c; - - for (i = 0; i < 500000 ; i++) { - c = inb(HD_STATUS); - if ((c & (BUSY_STAT | READY_STAT | SEEK_STAT)) == STAT_OK) - return 0; - } - dump_status("reset timed out", c); - return 1; -} - -static void reset_controller(void) -{ - int i; - - outb(4,HD_CMD); - for(i = 0; i < 1000; i++) barrier(); - outb(hd_info[0].ctl & 0x0f,HD_CMD); - for(i = 0; i < 1000; i++) barrier(); - if (drive_busy()) - printk("hd: controller still busy\n"); - else if ((hd_error = inb(HD_ERROR)) != 1) - printk("hd: controller reset failed: %02x\n",hd_error); -} - -static void reset_hd(void) -{ - static int i; - -repeat: - if (reset) { - reset = 0; - i = -1; - reset_controller(); - } else { - check_status(); - if (reset) - goto repeat; - } - if (++i < NR_HD) { - struct hd_i_struct *disk = &hd_info[i]; - disk->special_op = disk->recalibrate = 1; - hd_out(disk, disk->sect, disk->sect, disk->head-1, - disk->cyl, WIN_SPECIFY, &reset_hd); - if (reset) - goto repeat; - } else - hd_request(); -} - -/* - * Ok, don't know what to do with the unexpected interrupts: on some machines - * doing a reset and a retry seems to result in an eternal loop. Right now I - * ignore it, and just set the timeout. - * - * On laptops (and "green" PCs), an unexpected interrupt occurs whenever the - * drive enters "idle", "standby", or "sleep" mode, so if the status looks - * "good", we just ignore the interrupt completely. - */ -void unexpected_hd_interrupt(void) -{ - unsigned int stat = inb(HD_STATUS); - - if (stat & (BUSY_STAT|DRQ_STAT|ECC_STAT|ERR_STAT)) { - dump_status ("unexpected interrupt", stat); - SET_TIMER; - } -} - -/* - * bad_rw_intr() now tries to be a bit smarter and does things - * according to the error returned by the controller. - * -Mika Liljeberg (liljeber@cs.Helsinki.FI) - */ -static void bad_rw_intr(void) -{ - struct request *req = CURRENT; - struct hd_i_struct *disk; - - if (!req) - return; - disk = req->rq_disk->private_data; - if (++req->errors >= MAX_ERRORS || (hd_error & BBD_ERR)) { - end_request(req, 0); - disk->special_op = disk->recalibrate = 1; - } else if (req->errors % RESET_FREQ == 0) - reset = 1; - else if ((hd_error & TRK0_ERR) || req->errors % RECAL_FREQ == 0) - disk->special_op = disk->recalibrate = 1; - /* Otherwise just retry */ -} - -static inline int wait_DRQ(void) -{ - int retries = 100000, stat; - - while (--retries > 0) - if ((stat = inb(HD_STATUS)) & DRQ_STAT) - return 0; - dump_status("wait_DRQ", stat); - return -1; -} - -static void read_intr(void) -{ - int i, retries = 100000; - struct request *req; - - do { - i = (unsigned) inb(HD_STATUS); - if (i & BUSY_STAT) - continue; - if (!OK_STATUS(i)) - break; - if (i & DRQ_STAT) - goto ok_to_read; - } while (--retries > 0); - dump_status("read_intr", i); - bad_rw_intr(); - hd_request(); - return; -ok_to_read: - req = CURRENT; - insw(HD_DATA,req->buffer,256); - req->sector++; - req->buffer += 512; - req->errors = 0; - i = --req->nr_sectors; - --req->current_nr_sectors; -#ifdef DEBUG - printk("%s: read: sector %ld, remaining = %ld, buffer=%p\n", - req->rq_disk->disk_name, req->sector, req->nr_sectors, - req->buffer+512); -#endif - if (req->current_nr_sectors <= 0) - end_request(req, 1); - if (i > 0) { - SET_HANDLER(&read_intr); - return; - } - (void) inb(HD_STATUS); -#if (HD_DELAY > 0) - last_req = read_timer(); -#endif - if (CURRENT) - hd_request(); - return; -} - -static void write_intr(void) -{ - int i; - int retries = 100000; - struct request *req = CURRENT; - - do { - i = (unsigned) inb(HD_STATUS); - if (i & BUSY_STAT) - continue; - if (!OK_STATUS(i)) - break; - if ((req->nr_sectors <= 1) || (i & DRQ_STAT)) - goto ok_to_write; - } while (--retries > 0); - dump_status("write_intr", i); - bad_rw_intr(); - hd_request(); - return; -ok_to_write: - req->sector++; - i = --req->nr_sectors; - --req->current_nr_sectors; - req->buffer += 512; - if (!i || (req->bio && req->current_nr_sectors < 1)) - end_request(req, 1); - if (i > 0) { - SET_HANDLER(&write_intr); - outsw(HD_DATA,req->buffer,256); - local_irq_enable(); - } else { -#if (HD_DELAY > 0) - last_req = read_timer(); -#endif - hd_request(); - } - return; -} - -static void recal_intr(void) -{ - check_status(); -#if (HD_DELAY > 0) - last_req = read_timer(); -#endif - hd_request(); -} - -/* - * This is another of the error-routines I don't know what to do with. The - * best idea seems to just set reset, and start all over again. - */ -static void hd_times_out(unsigned long dummy) -{ - do_hd = NULL; - - if (!CURRENT) - return; - - disable_irq(HD_IRQ); - local_irq_enable(); - reset = 1; - printk("%s: timeout\n", CURRENT->rq_disk->disk_name); - if (++CURRENT->errors >= MAX_ERRORS) { -#ifdef DEBUG - printk("%s: too many errors\n", CURRENT->rq_disk->disk_name); -#endif - end_request(CURRENT, 0); - } - local_irq_disable(); - hd_request(); - enable_irq(HD_IRQ); -} - -int do_special_op(struct hd_i_struct *disk, struct request *req) -{ - if (disk->recalibrate) { - disk->recalibrate = 0; - hd_out(disk, disk->sect,0,0,0,WIN_RESTORE,&recal_intr); - return reset; - } - if (disk->head > 16) { - printk ("%s: cannot handle device with more than 16 heads - giving up\n", req->rq_disk->disk_name); - end_request(req, 0); - } - disk->special_op = 0; - return 1; -} - -/* - * The driver enables interrupts as much as possible. In order to do this, - * (a) the device-interrupt is disabled before entering hd_request(), - * and (b) the timeout-interrupt is disabled before the sti(). - * - * Interrupts are still masked (by default) whenever we are exchanging - * data/cmds with a drive, because some drives seem to have very poor - * tolerance for latency during I/O. The IDE driver has support to unmask - * interrupts for non-broken hardware, so use that driver if required. - */ -static void hd_request(void) -{ - unsigned int block, nsect, sec, track, head, cyl; - struct hd_i_struct *disk; - struct request *req; - - if (do_hd) - return; -repeat: - del_timer(&device_timer); - local_irq_enable(); - - if (!CURRENT) { - do_hd = NULL; - return; - } - req = CURRENT; - - if (reset) { - local_irq_disable(); - reset_hd(); - return; - } - disk = req->rq_disk->private_data; - block = req->sector; - nsect = req->nr_sectors; - if (block >= get_capacity(req->rq_disk) || - ((block+nsect) > get_capacity(req->rq_disk))) { - printk("%s: bad access: block=%d, count=%d\n", - req->rq_disk->disk_name, block, nsect); - end_request(req, 0); - goto repeat; - } - - if (disk->special_op) { - if (do_special_op(disk, req)) - goto repeat; - return; - } - sec = block % disk->sect + 1; - track = block / disk->sect; - head = track % disk->head; - cyl = track / disk->head; -#ifdef DEBUG - printk("%s: %sing: CHS=%d/%d/%d, sectors=%d, buffer=%p\n", - req->rq_disk->disk_name, (req->cmd == READ)?"read":"writ", - cyl, head, sec, nsect, req->buffer); -#endif - if (req->flags & REQ_CMD) { - switch (rq_data_dir(req)) { - case READ: - hd_out(disk,nsect,sec,head,cyl,WIN_READ,&read_intr); - if (reset) - goto repeat; - break; - case WRITE: - hd_out(disk,nsect,sec,head,cyl,WIN_WRITE,&write_intr); - if (reset) - goto repeat; - if (wait_DRQ()) { - bad_rw_intr(); - goto repeat; - } - outsw(HD_DATA,req->buffer,256); - break; - default: - printk("unknown hd-command\n"); - end_request(req, 0); - break; - } - } -} - -static void do_hd_request (request_queue_t * q) -{ - disable_irq(HD_IRQ); - hd_request(); - enable_irq(HD_IRQ); -} - -static int hd_ioctl(struct inode * inode, struct file * file, - unsigned int cmd, unsigned long arg) -{ - struct hd_i_struct *disk = inode->i_bdev->bd_disk->private_data; - struct hd_geometry *loc = (struct hd_geometry *) arg; - struct hd_geometry g; - - if (cmd != HDIO_GETGEO) - return -EINVAL; - if (!loc) - return -EINVAL; - g.heads = disk->head; - g.sectors = disk->sect; - g.cylinders = disk->cyl; - g.start = get_start_sect(inode->i_bdev); - return copy_to_user(loc, &g, sizeof g) ? -EFAULT : 0; -} - -/* - * Releasing a block device means we sync() it, so that it can safely - * be forgotten about... - */ - -static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - void (*handler)(void) = do_hd; - - do_hd = NULL; - del_timer(&device_timer); - if (!handler) - handler = unexpected_hd_interrupt; - handler(); - local_irq_enable(); -} - -static struct block_device_operations hd_fops = { - .ioctl = hd_ioctl, -}; - -/* - * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags - * means we run the IRQ-handler with interrupts disabled: this is bad for - * interrupt latency, but anything else has led to problems on some - * machines. - * - * We enable interrupts in some of the routines after making sure it's - * safe. - */ - -static int __init hd_init(void) -{ - int drive; - if (register_blkdev(HD_MAJOR,"hd")) { - printk("hd: unable to get major %d for hard disk\n",HD_MAJOR); - return -1; - } - hd_queue = blk_init_queue(do_hd_request, &hd_lock); - if (!hd_queue) { - unregister_blkdev(HD_MAJOR,"hd"); - return -1; - } - blk_queue_max_sectors(hd_queue, 255); - init_timer(&device_timer); - device_timer.function = hd_times_out; - blk_queue_hardsect_size(hd_queue, 512); - -#ifdef __i386__ - if (!NR_HD) { - extern struct drive_info drive_info; - unsigned char *BIOS = (unsigned char *) &drive_info; - unsigned long flags; -#ifndef CONFIG_X86_PC9800 - int cmos_disks; -#endif - - for (drive=0 ; drive<2 ; drive++) { - hd_info[drive].cyl = *(unsigned short *) BIOS; - hd_info[drive].head = *(3+BIOS); - hd_info[drive].sect = *(2+BIOS); - hd_info[drive].wpcom = 0; - hd_info[drive].ctl = *(3+BIOS) > 8 ? 8 : 0; - hd_info[drive].lzone = *(unsigned short *) BIOS; - if (hd_info[drive].cyl && NR_HD == drive) - NR_HD++; - BIOS += 6; - } - - } -#endif /* __i386__ */ -#ifdef __arm__ - if (!NR_HD) { - /* We don't know anything about the drive. This means - * that you *MUST* specify the drive parameters to the - * kernel yourself. - */ - printk("hd: no drives specified - use hd=cyl,head,sectors" - " on kernel command line\n"); - } -#endif - if (!NR_HD) - goto out; - - for (drive=0 ; drive < NR_HD ; drive++) { - struct gendisk *disk = alloc_disk(64); - struct hd_i_struct *p = &hd_info[drive]; - if (!disk) - goto Enomem; - disk->major = HD_MAJOR; - disk->first_minor = drive << 6; - disk->fops = &hd_fops; - sprintf(disk->disk_name, "hd%c", 'a'+drive); - disk->private_data = p; - set_capacity(disk, p->head * p->sect * p->cyl); - disk->queue = hd_queue; - p->unit = drive; - hd_gendisk[drive] = disk; - printk ("%s: %luMB, CHS=%d/%d/%d\n", - disk->disk_name, (unsigned long)get_capacity(disk)/2048, - p->cyl, p->head, p->sect); - } - - if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd", NULL)) { - printk("hd: unable to get IRQ%d for the hard disk driver\n", - HD_IRQ); - goto out1; - } - - if (!request_region(HD_DATA, 2, "hd(data)")) { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA); - NR_HD = 0; - free_irq(HD_IRQ, NULL); - return; - } - - if (!request_region(HD_DATA + 2, 1, "hd")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA); - goto out2; - } - - if (!request_region(HD_DATA + 4, 1, "hd")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA); - goto out3; - } - - if (!request_region(HD_DATA + 6, 1, "hd")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA); - goto out4; - } - - if (!request_region(HD_DATA + 8, 1, "hd")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA); - goto out5; - } - - if (!request_region(HD_DATA + 10, 1, "hd")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA); - goto out6; - } - - if (!request_region(HD_DATA + 12, 1, "hd")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_DATA); - goto out7; - } - - if (!request_region(HD_CMD, 1, "hd(cmd)")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_CMD); - goto out8; - } - - if (!request_region(HD_CMD + 2, 1, "hd(cmd)")) - { - printk(KERN_WARNING "hd: port 0x%x busy\n", HD_CMD); - goto out9; - } - - for(drive=0; drive < NR_HD; drive++) - add_disk(hd_gendisk[drive]); - return 0; - -out9: - release_region(HD_CMD, 1); -out8: - release_region(HD_DATA + 12, 1); -out7: - release_region(HD_DATA + 10, 1); -out6: - release_region(HD_DATA + 8, 1); -out5: - release_region(HD_DATA + 6, 1); -out4: - release_region(HD_DATA + 4, 1); -out3: - release_region(HD_DATA + 2, 1); -out2: - release_region(HD_DATA, 2); - free_irq(HD_IRQ, NULL); -out1: - for (drive = 0; drive < NR_HD; drive++) - put_disk(hd_gendisk[drive]); - NR_HD = 0; -out: - del_timer(&device_timer); - unregister_blkdev(HD_MAJOR,"hd"); - blk_cleanup_queue(hd_queue); - return -1; -Enomem: - while (drive--) - put_disk(hd_gendisk[drive]); - goto out; -} - -static int parse_hd_setup (char *line) { - int ints[6]; - - (void) get_options(line, ARRAY_SIZE(ints), ints); - hd_setup(NULL, ints); - - return 1; -} -__setup("hd=", parse_hd_setup); - -module_init(hd_init); diff -Nru a/drivers/ide/legacy/pc9800.c b/drivers/ide/legacy/pc9800.c --- a/drivers/ide/legacy/pc9800.c 2004-06-23 19:04:27 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,84 +0,0 @@ -/* - * ide_pc9800.c - * - * Copyright (C) 1997-2000 Linux/98 project, - * Kyoto University Microcomputer Club. - */ - -#include -#include -#include -#include -#include - -#include -#include - -#define PC9800_IDE_BANKSELECT 0x432 - -#undef PC9800_IDE_DEBUG - -static void pc9800_select(ide_drive_t *drive) -{ -#ifdef PC9800_IDE_DEBUG - byte old; - - /* Too noisy: */ - /* printk(KERN_DEBUG "pc9800_select(%s)\n", drive->name); */ - - outb(0x80, PC9800_IDE_BANKSELECT); - old = inb(PC9800_IDE_BANKSELECT); - if (old != HWIF(drive)->index) - printk(KERN_DEBUG "ide-pc9800: switching bank #%d -> #%d\n", - old, HWIF(drive)->index); -#endif - outb(HWIF(drive)->index, PC9800_IDE_BANKSELECT); -} - -void __init ide_probe_for_pc9800(void) -{ - u8 saved_bank; - - if (!PC9800_9821_P() /* || !PC9821_IDEIF_DOUBLE_P() */) - return; - - if (!request_region(PC9800_IDE_BANKSELECT, 1, "ide0/1 bank")) { - printk(KERN_ERR - "ide: bank select port (%#x) is already occupied!\n", - PC9800_IDE_BANKSELECT); - return; - } - - /*