http://linux.bkbits.net/linux-2.5 davej@redhat.com[torvalds]|ChangeSet|20041007011630|29125 davej # This is a BitKeeper generated diff -Nru style patch. # # drivers/scsi/scsiiom.c # 2004/10/05 13:12:19-07:00 viro@www.linux.org.uk +4 -4 # more NULL noise removal in drivers/scsi # # ChangeSet # 2004/10/06 18:16:30-07:00 davej@redhat.com # [PATCH] PCI Hotplug: Use before NULL check in shpchp_ctrl # # More fun found with the coverity checker. # # Signed-off-by: Dave Jones # Signed-off-by: Greg Kroah-Hartman # Signed-off-by: Linus Torvalds # # drivers/pci/hotplug/shpchp_ctrl.c # 2004/10/06 09:46:22-07:00 davej@redhat.com +3 -1 # PCI Hotplug: Use before NULL check in shpchp_ctrl # # ChangeSet # 2004/10/06 18:16:18-07:00 mingo@elte.hu # [PATCH] NX: fix read_implies_exec() related noexec-fs breakage # # mmap() done from older !pt_gnu_stack binaries on noexec mounted filesystems # could fail due to the extra PROT_EXEC bit. # # Signed-off-by: Ingo Molnar # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/mmap.c # 2004/10/03 16:03:11-07:00 mingo@elte.hu +9 -7 # NX: fix read_implies_exec() related noexec-fs breakage # # ChangeSet # 2004/10/06 22:04:39+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 2133/1: params_phys is not available on PXA and apears to be ARCH_RPM specific anyway # # Patch from Ian Campbell # # Arecent changeset[0] that changed params into an asm function call # broke the PXA build since PXA does not define PARAMS_PHYS therefore # the params_phys variable is never defined and linking arch/arm/boot/compressed/head.S fails. # # The function is defined in include/asm-arm/arch-rpc/uncompress.h # and so I assume it is dependendant on CONFIG_ARCH_RPC. I can't find # any use of it outside this file. # # Signed-off-by: Ian Campbell # # arch/arm/boot/compressed/head.S # 2004/10/06 10:53:35+01:00 icampbell@com.rmk.(none) +2 -0 # [PATCH] 2133/1: params_phys is not available on PXA and apears to be ARCH_RPM specific anyway # # ChangeSet # 2004/10/06 21:53:09+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2130/1: PXA255 Errata #31 fix for sleep.S # # Patch from Ben Dooks # # Fix Intel Errata #31 for PXA CPUs, where the # state of some external lines can be indeterminate # over sleep if PXBus >=133MHz on suspend # # Signed-off-by: Ben Dooks # # arch/arm/mach-pxa/sleep.S # 2004/10/05 22:35:22+01:00 ben-linux@org.rmk.(none) +39 -2 # [PATCH] 2130/1: PXA255 Errata #31 fix for sleep.S # # ChangeSet # 2004/10/06 21:43:19+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2129/1: S3C2410 - fix set_irq_type() for EINT0..EINT3 # # Patch from Ben Dooks # # Fix the set_irq_type() for EINTs 0 through 3 # # Cleaned up the inital clearing of any pending IRQs # # Signed-off-by: Klaus Fetscher # Signed-off-by: Ben Dooks # # # arch/arm/mach-s3c2410/irq.c # 2004/10/05 15:13:58+01:00 ben-linux@org.rmk.(none) +45 -17 # [PATCH] 2129/1: S3C2410 - fix set_irq_type() for EINT0..EINT3 # # ChangeSet # 2004/10/06 21:38:04+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2127/1: S3C2410 - fix compile error in serial driver # # Patch from Ben Dooks # # Fixes compile error in serial driver for S3C2410 # until the new serial driver can be finished # # Signed-off-by: Ben Dooks # # drivers/serial/s3c2410.c # 2004/10/05 15:20:10+01:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2127/1: S3C2410 - fix compile error in serial driver # # ChangeSet # 2004/10/06 09:46:49-07:00 torvalds@ppc970.osdl.org # Fix up signed one-bit bitfields in core sound code # # sound/pci/intel8x0.c # 2004/10/06 09:46:43-07:00 torvalds@ppc970.osdl.org +7 -7 # Fix up signed one-bit bitfields in core sound code # # include/sound/seq_kernel.h # 2004/10/06 09:46:43-07:00 torvalds@ppc970.osdl.org +2 -2 # Fix up signed one-bit bitfields in core sound code # # include/sound/pcm_oss.h # 2004/10/06 09:46:43-07:00 torvalds@ppc970.osdl.org +5 -5 # Fix up signed one-bit bitfields in core sound code # # include/sound/pcm.h # 2004/10/06 09:46:43-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up signed one-bit bitfields in core sound code # # include/sound/asequencer.h # 2004/10/06 09:46:43-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up signed one-bit bitfields in core sound code # # ChangeSet # 2004/10/06 12:03:45-04:00 davej@redhat.com # [AGPGART] Really add Intel i915 AGPGART Support. # # Whoops. Missing entry in the PCI ID tables. # # Spotted and fixed by someone at SuSE. # Fished out of SuSE's kernel tree by Christoph Hellwig # Signed-off-by: Dave Jones # # drivers/char/agp/intel-agp.c # 2004/10/06 12:03:39-04:00 davej@redhat.com +1 -0 # [AGPGART] Really add Intel i915 AGPGART Support. # # Whoops. Missing entry in the PCI ID tables. # # Spotted and fixed by someone at SuSE. # Fished out of SuSE's kernel tree by Christoph Hellwig # Signed-off-by: Dave Jones # # ChangeSet # 2004/10/06 11:56:49-04:00 davej@redhat.com # [AGPGART] Fix sign extension bug in amd64 gart driver. # # From Terrence Ripperda at NVidia. # # Signed-off-by: Dave Jones # # drivers/char/agp/amd64-agp.c # 2004/10/06 11:56:44-04:00 davej@redhat.com +1 -1 # [AGPGART] Fix sign extension bug in amd64 gart driver. # # From Terrence Ripperda at NVidia. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/10/06 08:23:13-07:00 torvalds@ppc970.osdl.org # Remove rest of legacy arch/m32r/drivers directory # # BitKeeper/deleted/.del-m5drv.c~be38ad4a7db9fa7c # 2004/10/06 08:22:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/m32r/drivers/m5drv.c # # BitKeeper/deleted/.del-m32r_pcc.h~8cfce19892e28b3 # 2004/10/06 08:22:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/m32r/drivers/m32r_pcc.h # # BitKeeper/deleted/.del-m32r_pcc.c~ec230bcb726b3f51 # 2004/10/06 08:22:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/m32r/drivers/m32r_pcc.c # # BitKeeper/deleted/.del-m32r_cfc.h~c983987c1a0593fe # 2004/10/06 08:22:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/m32r/drivers/m32r_cfc.h # # BitKeeper/deleted/.del-m32r_cfc.c~cf841cb47fb6f1d2 # 2004/10/06 08:22:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/m32r/drivers/m32r_cfc.c # # BitKeeper/deleted/.del-m32r-pldsio.c~b2f5559990396c69 # 2004/10/06 08:22:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/m32r/drivers/m32r-pldsio.c # # BitKeeper/deleted/.del-ds1302.c~ee60b2fd97a7068 # 2004/10/06 08:22:33-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: arch/m32r/drivers/ds1302.c # # ChangeSet # 2004/10/06 08:16:50-07:00 blaisorblade_spam@yahoo.it # [PATCH] uml: makefile whitespace fix # # Change the spacing for this command to fix alignment on output. # # Signed-off-by: Paolo 'Blaisorblade' Giarrusso # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/um/kernel/Makefile # 2004/10/05 23:05:47-07:00 blaisorblade_spam@yahoo.it +1 -1 # uml: makefile whitespace fix # # ChangeSet # 2004/10/06 08:16:39-07:00 blaisorblade_spam@yahoo.it # [PATCH] uml: makefile fix for .lds scripts. # # Remove uml.lds and dyn.lds from extra-y; this was a relict from the recent # past. # # Signed-off-by: Paolo 'Blaisorblade' Giarrusso # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/um/kernel/Makefile # 2004/10/06 00:28:34-07:00 blaisorblade_spam@yahoo.it +1 -1 # uml: makefile fix for .lds scripts. # # ChangeSet # 2004/10/06 08:16:25-07:00 takata@linux-m32r.org # [PATCH] m32r: remove arch/m32r/drivers # # Remove obsolete m32r-specific driver files, which are no longer used. # # Signed-off-by: Hirokazu Takata # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/m32r/Makefile # 2004/10/05 23:05:46-07:00 takata@linux-m32r.org +0 -1 # m32r: remove arch/m32r/drivers # # arch/m32r/Kconfig # 2004/10/05 23:05:46-07:00 takata@linux-m32r.org +0 -2 # m32r: remove arch/m32r/drivers # # BitKeeper/deleted/.del-Makefile~95a070149a07e4b # 2004/10/06 08:16:18-07:00 takata@linux-m32r.org +0 -0 # Delete: arch/m32r/drivers/Makefile # # BitKeeper/deleted/.del-Kconfig~11ddb7406c4fc3d0 # 2004/10/06 08:16:18-07:00 takata@linux-m32r.org +0 -0 # Delete: arch/m32r/drivers/Kconfig # # ChangeSet # 2004/10/06 08:16:13-07:00 takata.hirokazu@renesas.com # [PATCH] m32r: remove unused arch/m32r/m32700ut/m32r-flash.c # # Signed-off-by: Hirokazu Takata # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # BitKeeper/deleted/.del-m32r-flash.c~8c08d7ed8c9313d5 # 2004/10/06 08:16:06-07:00 takata.hirokazu@renesas.com +0 -0 # Delete: arch/m32r/m32700ut/m32r-flash.c # # ChangeSet # 2004/10/06 08:16:01-07:00 takata@linux-m32r.org # [PATCH] m32r: remove unused arch/m32r/kernel/io_m32102.c # # Signed-off-by: Hirokazu Takata # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # BitKeeper/deleted/.del-io_m32102.c~ae5de52aac844a53 # 2004/10/06 08:15:54-07:00 takata@linux-m32r.org +0 -0 # Delete: arch/m32r/kernel/io_m32102.c # # ChangeSet # 2004/10/06 08:15:49-07:00 hch@lst.de # [PATCH] m32r: remove arch/m32r/drivers/cs_internal.h # # completely unused wrapper # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # BitKeeper/deleted/.del-cs_internal.h~b7e8531c660fbee4 # 2004/10/06 08:15:42-07:00 hch@lst.de +0 -0 # Delete: arch/m32r/drivers/cs_internal.h # # ChangeSet # 2004/10/06 08:15:37-07:00 hch@lst.de # [PATCH] m32r: remove arch/m32r/drivers/m5.[ch] # # this is a 2.4ish block driver that doesn't have the slightest chance to # actually build. It's also not connected to the build at all. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # BitKeeper/deleted/.del-m5.h~aeadfdc7aee742a7 # 2004/10/06 08:15:30-07:00 hch@lst.de +0 -0 # Delete: arch/m32r/drivers/m5.h # # BitKeeper/deleted/.del-m5.c~32b5e7b664c9688 # 2004/10/06 08:15:30-07:00 hch@lst.de +0 -0 # Delete: arch/m32r/drivers/m5.c # # ChangeSet # 2004/10/06 08:15:24-07:00 takata@linux-m32r.org # [PATCH] m32r: update ioremap routine # # Here is a patch to update ioremap*.c for m32r, taken from "Add __iomem # modifier to the return value type of __ioremap() for much stricter # type-checking." # # * arch/m32r/mm/ioremap.c: ditto. # - Add __iomem modifier to the return value type of __ioremap() # for much stricter type-checking. # # * arch/m32r/mm/ioremap-nommu.c: ditto. # # * include/asm-m32r/io.h: # - Modified for much stricter type-checking. # - Change __inline__ to inline. # # Signed-off-by: Hirokazu Takata # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-m32r/io.h # 2004/10/05 23:05:45-07:00 takata@linux-m32r.org +31 -16 # m32r: update ioremap routine # # arch/m32r/mm/ioremap.c # 2004/10/05 23:05:45-07:00 takata@linux-m32r.org +13 -9 # m32r: update ioremap routine # # arch/m32r/mm/ioremap-nommu.c # 2004/10/05 23:05:45-07:00 takata@linux-m32r.org +4 -3 # m32r: update ioremap routine # # ChangeSet # 2004/10/06 08:15:12-07:00 ak@muc.de # [PATCH] x86_64: fix tss off by one # # From: "Siddha, Suresh B" # # Fix off by one in TSS limit. # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/desc.h # 2004/10/05 23:05:45-07:00 ak@muc.de +2 -2 # x86_64: fix tss off by one # # ChangeSet # 2004/10/06 08:14:59-07:00 ak@muc.de # [PATCH] x86_64: add newline before MCE # # (cosmetic) print newline before MCEs # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/mce.c # 2004/10/05 23:05:45-07:00 ak@muc.de +2 -1 # x86_64: add newline before MCE # # ChangeSet # 2004/10/06 08:14:47-07:00 suresh.b.siddha@intel.com # [PATCH] Disable SW irqbalance/irqaffinity for E7520/E7320/E7525 - change TARGET_CPUS on x86_64 # # Set TARGET_CPUS on x86_64 to cpu_online_map. This brings the code inline # with x86 mach-default. Fix MSI_TARGET_CPU code which will break with this # target_cpus change. # # Signed-off-by: Suresh Siddha # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/smp.h # 2004/10/05 23:05:45-07:00 suresh.b.siddha@intel.com +5 -1 # Disable SW irqbalance/irqaffinity for E7520/E7320/E7525 - change TARGET_CPUS on x86_64 # # include/asm-x86_64/hw_irq.h # 2004/10/05 23:05:45-07:00 suresh.b.siddha@intel.com +1 -0 # Disable SW irqbalance/irqaffinity for E7520/E7320/E7525 - change TARGET_CPUS on x86_64 # # arch/x86_64/kernel/smpboot.c # 2004/10/05 23:05:45-07:00 suresh.b.siddha@intel.com +3 -0 # Disable SW irqbalance/irqaffinity for E7520/E7320/E7525 - change TARGET_CPUS on x86_64 # # arch/x86_64/kernel/io_apic.c # 2004/10/05 23:05:45-07:00 suresh.b.siddha@intel.com +29 -4 # Disable SW irqbalance/irqaffinity for E7520/E7320/E7525 - change TARGET_CPUS on x86_64 # # ChangeSet # 2004/10/06 08:14:35-07:00 ak@muc.de # [PATCH] x86_64: make in_gate_vma() safer # # x86-64 in_gate_vma would take a read lock on the VMA when the passed # address was inside the 32bit vsyscall page. # # This would be called by get_user_pages, which already holds the mmap_sem. # # Unfortunately some callers of get_user_pages hold the mmap_sem for writing, # which could in theory cause a deadlock. # # I think it can currently not happen because the only users who hold it for # write before calling gup() are coredump and AIO in the ring setup, and both # should not ever access the vsyscall page. # # But not taking the semaphore is safer and avoid this here. # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/proto.h # 2004/10/05 23:05:45-07:00 ak@muc.de +1 -0 # x86_64: make in_gate_vma() safer # # arch/x86_64/mm/init.c # 2004/10/05 23:05:45-07:00 ak@muc.de +1 -1 # x86_64: make in_gate_vma() safer # # arch/x86_64/ia32/syscall32.c # 2004/10/05 23:05:45-07:00 ak@muc.de +17 -5 # x86_64: make in_gate_vma() safer # # ChangeSet # 2004/10/06 08:14:23-07:00 ak@muc.de # [PATCH] x86_64: don't corrupt interrupt flag on timer resume # # Don't corrupt interrupt flag in time resume # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/time.c # 2004/10/05 23:05:45-07:00 ak@muc.de +3 -2 # x86_64: don't corrupt interrupt flag on timer resume # # ChangeSet # 2004/10/06 08:14:13-07:00 ak@muc.de # [PATCH] x86_64: avoid a deadlock during panic # # Avoid a deadlock during panic. Don't take the smp_call_function lock in # smp_send_stop() # # Also fix the documentation to conform to Linux standards. # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/smp.c # 2004/10/05 23:05:44-07:00 ak@muc.de +35 -20 # x86_64: avoid a deadlock during panic # # ChangeSet # 2004/10/06 08:14:04-07:00 ak@muc.de # [PATCH] x86_64: fix circular dependency with UNORDERED_IO # # Fix a circular dependency # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/Kconfig # 2004/10/05 23:05:44-07:00 ak@muc.de +0 -1 # x86_64: fix circular dependency with UNORDERED_IO # # ChangeSet # 2004/10/06 08:13:54-07:00 ak@muc.de # [PATCH] x86_64: remove CONFIG_FRAME_POINTER # # CONFIG_FRAME_POINTER has never worked on x86-64 because it never passed # -fno-omit-frame-pointer to the compiler, and that is the only way to get a # frame pointer on x86-64. # # It also causes complications with profiling. Drop it. # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/Kconfig.debug # 2004/10/05 23:05:44-07:00 ak@muc.de +0 -9 # x86_64: remove CONFIG_FRAME_POINTER # # ChangeSet # 2004/10/06 08:13:42-07:00 ak@muc.de # [PATCH] x86_64: fix profile_pc # # This fixes profile_pc to work properly on x86-64 and not crash. # # It does now a simple backtrace to the caller of the spin lock without # requiring a frame pointer for this. # # Frame pointer support has been dropped because it never worked. # # There is still a small race window, but the only way to avoid it would be # to rewrite kernel/spinlock.c in assembler again. The race will account a # profile tick the the parent of the spinlock caller. # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/ptrace.h # 2004/10/05 23:05:44-07:00 ak@muc.de +0 -4 # x86_64: fix profile_pc # # arch/x86_64/kernel/time.c # 2004/10/06 00:28:38-07:00 ak@muc.de +15 -4 # x86_64: fix profile_pc # # ChangeSet # 2004/10/06 08:13:30-07:00 ak@muc.de # [PATCH] x86_64: fix oops with multiple MCEs # # Fix oops when multiple MCE entries are logged. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/mce.c # 2004/10/06 00:28:36-07:00 ak@muc.de +1 -1 # x86_64: fix oops with multiple MCEs # # ChangeSet # 2004/10/06 08:13:18-07:00 ak@muc.de # [PATCH] x86_64: fix HPET_HACK_ENABLE_DANGEROUS # # From: # # The following patch fixes compilation of time.c with # HPET_HACK_ENABLE_DANGEROUS turned on. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/time.c # 2004/10/06 00:28:38-07:00 ak@muc.de +2 -2 # x86_64: fix HPET_HACK_ENABLE_DANGEROUS # # ChangeSet # 2004/10/06 08:13:06-07:00 david@gibson.dropbear.id.au # [PATCH] ppc64: remove redundant #ifdef CONFIG_ALTIVEC # # arch/ppc64/kernel/process.c has an #ifdef CONFIG_ALTIVEC within an #ifdef # CONFIG_ALTIVEC. This patch removes the inner one. # # Signed-off-by: David Gibson # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/process.c # 2004/10/05 23:05:23-07:00 david@gibson.dropbear.id.au +0 -2 # ppc64: remove redundant #ifdef CONFIG_ALTIVEC # # ChangeSet # 2004/10/06 08:12:54-07:00 david@gibson.dropbear.id.au # [PATCH] ppc64: squash EEH warnings # # A slightly non-ideal version of the recent patch which fixed EEH being a # no-op went in. The srcsave variable in eeh_memcpy_to_io() is now never # referenced on non-pSeries machines, and so spews hundreds of warnings. The # variable doesn't actually accomplish anything, so this patch gets rid of # it. # # Signed-off-by: David Gibson # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/eeh.h # 2004/10/05 23:05:23-07:00 david@gibson.dropbear.id.au +1 -2 # ppc64: squash EEH warnings # # ChangeSet # 2004/10/06 08:12:42-07:00 mporter@kernel.crashing.org # [PATCH] ppc32: fix several warnings # # Fixes some annoying warnings due to unitialized variables. # # Signed-off-by: Matt Porter # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/syslib/todc_time.c # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +4 -4 # ppc32: fix several warnings # # arch/ppc/syslib/ppc4xx_pic.c # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +1 -1 # ppc32: fix several warnings # # arch/ppc/mm/44x_mmu.c # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +1 -1 # ppc32: fix several warnings # # arch/ppc/kernel/signal.c # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +1 -1 # ppc32: fix several warnings # # ChangeSet # 2004/10/06 08:12:30-07:00 mporter@kernel.crashing.org # [PATCH] ppc32: add U-Boot support to Ocotea/440GX port # # Adds support for booting the same Ocotea kernel from either the default # PIBS f/w or U-Boot. # # Signed-off-by: Matt Porter # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/boot/simple/pibs.c # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +101 -0 # ppc32: add U-Boot support to Ocotea/440GX port # # include/asm-ppc/reg_booke.h # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +5 -1 # ppc32: add U-Boot support to Ocotea/440GX port # # arch/ppc/platforms/4xx/ocotea.h # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +7 -6 # ppc32: add U-Boot support to Ocotea/440GX port # # arch/ppc/platforms/4xx/ocotea.c # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +67 -50 # ppc32: add U-Boot support to Ocotea/440GX port # # arch/ppc/boot/simple/pibs.c # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/boot/simple/pibs.c # # arch/ppc/boot/simple/Makefile # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +1 -0 # ppc32: add U-Boot support to Ocotea/440GX port # # ChangeSet # 2004/10/06 08:12:17-07:00 mporter@kernel.crashing.org # [PATCH] ppc32: sync ppcboot.h with U-Boot # # This puts us back in sync with current U-Boot CVS tree board info # definition. Please apply. # # Signed-off-by: Matt Porter # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc/ppcboot.h # 2004/10/05 23:05:22-07:00 mporter@kernel.crashing.org +18 -18 # ppc32: sync ppcboot.h with U-Boot # # ChangeSet # 2004/10/06 08:12:05-07:00 ebs@ebshome.net # [PATCH] ppc32: export "indirect" DCR helpers # # this trivial patch adds missing exports for "indirect" DCR helpers - # __mtdcr & __mfcdr. # # Signed-off-by: Eugene Surovegin # Signed-off-by: Matt Porter # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/kernel/ppc_ksyms.c # 2004/10/05 23:05:22-07:00 ebs@ebshome.net +4 -0 # ppc32: export "indirect" DCR helpers # # ChangeSet # 2004/10/06 08:11:53-07:00 gjaeger@sysgo.com # [PATCH] ppc32: fix PFC1_EPS and PFC1_EPS_SHIFT for IBM440GX # # While writing some BSP code for a 440GX custom board, I noticed, that the # DCRN_SDR_PFC1_EPS and DCRN_SDR_PFC1_EPS_SHIFT definitions are wrong and # therefore the functions ibm440gx_get_eth_grp() and ibm440gx_set_eth_grp() # won't work correctly. # # Signed-off-by: Matt Porter # Signed-off-by: Gerhard Jaeger # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc/ibm44x.h # 2004/10/05 23:05:22-07:00 gjaeger@sysgo.com +2 -2 # ppc32: fix PFC1_EPS and PFC1_EPS_SHIFT for IBM440GX # # ChangeSet # 2004/10/06 08:11:41-07:00 akpm@osdl.org # [PATCH] remove get_cpu_ptr() # # Ingo points out that it's unusable anyway, because with some configs the # get_cpu() is evaluated and with others it is not. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/slab.c # 2004/10/05 23:05:22-07:00 akpm@osdl.org +1 -2 # remove get_cpu_ptr() # # include/linux/percpu.h # 2004/10/05 23:05:22-07:00 akpm@osdl.org +0 -22 # remove get_cpu_ptr() # # ChangeSet # 2004/10/06 07:56:53-07:00 viro@www.linux.org.uk # [PATCH] amd64 iomem initial annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/asm-x86_64/io.h # 2004/10/06 01:08:02-07:00 viro@www.linux.org.uk +22 -22 # amd64 iomem initial annotations # # arch/x86_64/mm/ioremap.c # 2004/10/06 01:08:37-07:00 viro@www.linux.org.uk +6 -6 # amd64 iomem initial annotations # # ChangeSet # 2004/10/06 07:56:41-07:00 viro@www.linux.org.uk # [PATCH] trivial usb endianness annotations # # trivial endianness annotations in drivers/usb (apply after ohci and isd200 # fixes). # # Note: drivers/usb is nearly endian-clean at that point; there are several # very dubious places in there (in particular, rtl8150, pegasus and usbnet # are almost certainly broken in mii-related code on big-endian hosts); I'm # leaving them alone for now. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/usb_ch9.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +4 -4 # trivial usb endianness annotations # # drivers/usb/storage/transport.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +4 -4 # trivial usb endianness annotations # # drivers/usb/storage/sddr55.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/storage/sddr09.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/storage/protocol.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +1 -1 # trivial usb endianness annotations # # drivers/usb/storage/jumpshot.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/storage/isd200.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +7 -6 # trivial usb endianness annotations # # drivers/usb/storage/freecom.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/storage/datafab.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/serial/io_usbvend.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +8 -8 # trivial usb endianness annotations # # drivers/usb/serial/io_ti.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/serial/io_edgeport.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/serial/io_edgeport.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/net/usbnet.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/net/rtl8150.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/net/pegasus.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +6 -6 # trivial usb endianness annotations # # drivers/usb/net/kaweth.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +4 -4 # trivial usb endianness annotations # # drivers/usb/net/catc.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/misc/legousbtower.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/misc/auerswald.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/media/ov511.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +1 -1 # trivial usb endianness annotations # # drivers/usb/input/wacom.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +7 -7 # trivial usb endianness annotations # # drivers/usb/input/kbtab.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/input/hid-core.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +7 -7 # trivial usb endianness annotations # # drivers/usb/input/aiptek.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +8 -8 # trivial usb endianness annotations # # drivers/usb/host/uhci-hub.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/host/uhci-hcd.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +7 -7 # trivial usb endianness annotations # # drivers/usb/host/uhci-hcd.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/host/ohci.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +12 -12 # trivial usb endianness annotations # # drivers/usb/host/ohci-q.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +13 -12 # trivial usb endianness annotations # # drivers/usb/host/ohci-hub.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/host/ohci-dbg.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +7 -7 # trivial usb endianness annotations # # drivers/usb/host/ehci.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +37 -37 # trivial usb endianness annotations # # drivers/usb/host/ehci-sched.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +9 -10 # trivial usb endianness annotations # # drivers/usb/host/ehci-q.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +3 -3 # trivial usb endianness annotations # # drivers/usb/host/ehci-mem.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +2 -2 # trivial usb endianness annotations # # drivers/usb/host/ehci-hub.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +1 -1 # trivial usb endianness annotations # # drivers/usb/host/ehci-dbg.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +22 -21 # trivial usb endianness annotations # # drivers/usb/core/hub.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +4 -4 # trivial usb endianness annotations # # drivers/usb/class/usblp.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +1 -1 # trivial usb endianness annotations # # drivers/usb/class/cdc-acm.h # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +1 -1 # trivial usb endianness annotations # # drivers/usb/class/cdc-acm.c # 2004/10/06 00:11:24-07:00 viro@www.linux.org.uk +1 -1 # trivial usb endianness annotations # # ChangeSet # 2004/10/06 07:56:27-07:00 viro@www.linux.org.uk # [PATCH] isd200 bugfix for 64bit boxen # # unsigned long is not a good type to use in declaration of structure we feed # to hardware... # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/usb/storage/isd200.c # 2004/10/05 23:55:53-07:00 viro@www.linux.org.uk +4 -6 # isd200 bugfix for 64bit boxen # # ChangeSet # 2004/10/06 07:56:15-07:00 viro@www.linux.org.uk # [PATCH] ohci bugfix for big-endian 64bit boxen # # ->dma can be a 64bit variable on 64bit boxen; its value will fit into 32 bits # just fine (due to dma mask). However, cpu_to_le32p(&...) will break if we # are on a 64bit big-endian; we'll end up up passing it the address of upper # 32 bits and get 0 instead of correct value. Fix is trivial... # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/usb/host/ohci-q.c # 2004/10/05 23:54:32-07:00 viro@www.linux.org.uk +1 -1 # ohci bugfix for big-endian 64bit boxen # # ChangeSet # 2004/10/06 07:56:03-07:00 viro@www.linux.org.uk # [PATCH] hfsplus endianness bugfix # # hfs_bnode_read_u8() always returns 0 on little-endian (cut'n'paste bug - # function is almost exact copy of its u16 counterpart, but be16_to_cpu() # should've been removed here). # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/hfsplus/bnode.c # 2004/10/05 18:16:01-07:00 viro@www.linux.org.uk +1 -1 # hfsplus endianness bugfix # # ChangeSet # 2004/10/06 07:55:51-07:00 viro@www.linux.org.uk # [PATCH] hfsplus endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/hfsplus/wrapper.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +5 -5 # hfsplus endianness annotations # # fs/hfsplus/part_tbl.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +10 -10 # hfsplus endianness annotations # # fs/hfsplus/hfsplus_raw.h # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +89 -89 # hfsplus endianness annotations # # fs/hfsplus/extents.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +2 -2 # hfsplus endianness annotations # # fs/hfsplus/catalog.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +5 -3 # hfsplus endianness annotations # # fs/hfsplus/btree.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +1 -1 # hfsplus endianness annotations # # fs/hfsplus/brec.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +4 -4 # hfsplus endianness annotations # # fs/hfsplus/bnode.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +5 -5 # hfsplus endianness annotations # # fs/hfsplus/bitmap.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +17 -16 # hfsplus endianness annotations # # fs/hfsplus/bfind.c # 2004/10/05 18:14:08-07:00 viro@www.linux.org.uk +2 -1 # hfsplus endianness annotations # # ChangeSet # 2004/10/06 07:55:39-07:00 viro@www.linux.org.uk # [PATCH] hfs endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/hfs/super.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +3 -4 # hfs endianness annotations # # fs/hfs/part_tbl.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +10 -10 # hfs endianness annotations # # fs/hfs/mdb.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +2 -2 # hfs endianness annotations # # fs/hfs/inode.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +5 -5 # hfs endianness annotations # # fs/hfs/hfs_fs.h # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +5 -5 # hfs endianness annotations # # fs/hfs/hfs.h # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +67 -67 # hfs endianness annotations # # fs/hfs/extent.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +3 -3 # hfs endianness annotations # # fs/hfs/catalog.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +1 -1 # hfs endianness annotations # # fs/hfs/btree.h # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +14 -14 # hfs endianness annotations # # fs/hfs/btree.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +1 -1 # hfs endianness annotations # # fs/hfs/brec.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +4 -4 # hfs endianness annotations # # fs/hfs/bnode.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +5 -5 # hfs endianness annotations # # fs/hfs/bitmap.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +18 -17 # hfs endianness annotations # # fs/hfs/bfind.c # 2004/10/05 17:53:15-07:00 viro@www.linux.org.uk +2 -1 # hfs endianness annotations # # ChangeSet # 2004/10/06 07:55:26-07:00 viro@www.linux.org.uk # [PATCH] umem iomem and (partial) endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/umem.h # 2004/10/05 16:34:44-07:00 viro@www.linux.org.uk +7 -7 # umem iomem and (partial) endianness annotations # # drivers/block/umem.c # 2004/10/05 16:34:02-07:00 viro@www.linux.org.uk +5 -5 # umem iomem and (partial) endianness annotations # # ChangeSet # 2004/10/06 07:55:14-07:00 viro@www.linux.org.uk # [PATCH] cpqarray iomem annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/block/cpqarray.h # 2004/10/05 16:33:37-07:00 viro@www.linux.org.uk +1 -1 # cpqarray iomem annotations # # drivers/block/cpqarray.c # 2004/10/05 16:33:34-07:00 viro@www.linux.org.uk +7 -7 # cpqarray iomem annotations # # ChangeSet # 2004/10/06 07:55:02-07:00 viro@www.linux.org.uk # [PATCH] cciss endianness and iomem annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/block/cciss.h # 2004/10/05 16:32:47-07:00 viro@www.linux.org.uk +2 -2 # cciss endianness and iomem annotations # # drivers/block/cciss.c # 2004/10/05 16:32:45-07:00 viro@www.linux.org.uk +9 -9 # cciss endianness and iomem annotations # # ChangeSet # 2004/10/06 07:54:50-07:00 viro@www.linux.org.uk # [PATCH] i2o_config __user annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/message/i2o/i2o_config.c # 2004/10/05 16:29:40-07:00 viro@www.linux.org.uk +7 -7 # i2o_config __user annotations # # ChangeSet # 2004/10/06 07:54:38-07:00 viro@www.linux.org.uk # [PATCH] ufs endianness bugfixes # # missing conversions from on-disk to host-endian in a couple of places... # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/ufs/super.c # 2004/10/05 15:39:52-07:00 viro@www.linux.org.uk +1 -1 # ufs endianness bugfixes # # fs/ufs/balloc.c # 2004/10/05 15:39:52-07:00 viro@www.linux.org.uk +1 -1 # ufs endianness bugfixes # # ChangeSet # 2004/10/06 07:54:26-07:00 viro@www.linux.org.uk # [PATCH] ufs endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/ufs_fs_i.h # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +2 -2 # ufs endianness annotations # # include/linux/ufs_fs.h # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +272 -262 # ufs endianness annotations # # fs/ufs/util.h # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +19 -19 # ufs endianness annotations # # fs/ufs/truncate.c # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +8 -8 # ufs endianness annotations # # fs/ufs/swab.h # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +36 -36 # ufs endianness annotations # # fs/ufs/super.c # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +4 -4 # ufs endianness annotations # # fs/ufs/inode.c # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +8 -8 # ufs endianness annotations # # fs/ufs/balloc.c # 2004/10/05 15:36:32-07:00 viro@www.linux.org.uk +4 -4 # ufs endianness annotations # # ChangeSet # 2004/10/06 07:54:14-07:00 viro@www.linux.org.uk # [PATCH] isofs endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/iso_fs.h # 2004/10/05 16:30:10-07:00 viro@www.linux.org.uk +6 -6 # isofs endianness annotations # # fs/isofs/compress.c # 2004/10/05 14:40:20-07:00 viro@www.linux.org.uk +2 -2 # isofs endianness annotations # # ChangeSet # 2004/10/06 07:54:02-07:00 viro@www.linux.org.uk # [PATCH] ncpfs (7/7): misc fixes and cleanups # # * remaining endiannes cleanups # * don't mess with setting finfo.i.dataStreamSize when creating the root # directory inode; that field is ignored when populating in-core directory # inodes. # * missing cpu_to_le16() in ncp_search_for_fileset() (for big-endian clients # server sees 0xff7f instead of intended 0x7fff). # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/ncpfs/ncplib_kernel.c # 2004/10/05 14:37:57-07:00 viro@www.linux.org.uk +1 -1 # ncpfs (7/7): misc fixes and cleanups # # fs/ncpfs/inode.c # 2004/10/05 14:37:57-07:00 viro@www.linux.org.uk +2 -2 # ncpfs (7/7): misc fixes and cleanups # # fs/ncpfs/dir.c # 2004/10/05 14:37:57-07:00 viro@www.linux.org.uk +2 -1 # ncpfs (7/7): misc fixes and cleanups # # ChangeSet # 2004/10/06 07:53:50-07:00 viro@www.linux.org.uk # [PATCH] ncpfs (6/7): trivial endianness annotations # # 100% straightforward annotations - from gcc POV no code had been changed. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/ncp_fs_i.h # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +4 -4 # ncpfs (6/7): trivial endianness annotations # # include/linux/ncp_fs.h # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +3 -3 # ncpfs (6/7): trivial endianness annotations # # include/linux/ncp.h # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +16 -16 # ncpfs (6/7): trivial endianness annotations # # fs/ncpfs/symlink.c # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +6 -5 # ncpfs (6/7): trivial endianness annotations # # fs/ncpfs/sock.c # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +1 -1 # ncpfs (6/7): trivial endianness annotations # # fs/ncpfs/ncplib_kernel.h # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +9 -9 # ncpfs (6/7): trivial endianness annotations # # fs/ncpfs/ncplib_kernel.c # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +34 -34 # ncpfs (6/7): trivial endianness annotations # # fs/ncpfs/ioctl.c # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +3 -1 # ncpfs (6/7): trivial endianness annotations # # fs/ncpfs/inode.c # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +1 -1 # ncpfs (6/7): trivial endianness annotations # # fs/ncpfs/dir.c # 2004/10/05 14:35:32-07:00 viro@www.linux.org.uk +7 -5 # ncpfs (6/7): trivial endianness annotations # # ChangeSet # 2004/10/06 07:53:38-07:00 viro@www.linux.org.uk # [PATCH] ncpfs (5/7): le16 handling in marshalling # # New helper: ncp_reply_le16() (decode 16bit little-endian). # # ConvertToNWfromDWORD() cleaned up and fixed (it used to have one too many # le16_to_cpu() in arithmetics, on top of ugly tricks with memcpy() et.al.). # ncp_reply_word() has no callers left; removed. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/ncpfs/ncplib_kernel.c # 2004/10/05 14:31:53-07:00 viro@www.linux.org.uk +11 -8 # ncpfs (5/7): le16 handling in marshalling # # ChangeSet # 2004/10/06 07:53:26-07:00 viro@www.linux.org.uk # [PATCH] ncpfs (4/7): be16 handling in marshalling # # New marshalling helpers - ncp_add_be16() and ncp_reply_be16(). # # Encode and decode a big-endian 16bit field resp. # # A bunch of places in ncplib_kernel.c switched to usign these. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/ncpfs/ncplib_kernel.c # 2004/10/05 14:27:51-07:00 viro@www.linux.org.uk +22 -9 # ncpfs (4/7): be16 handling in marshalling # # ChangeSet # 2004/10/06 07:53:14-07:00 viro@www.linux.org.uk # [PATCH] ncpfs (3/7): be32 handling in marshalling # # New helper in marshalling code: ncp_add_be32() # # Takes host-endian argument, converts to big-endian and stores into packet # we are building. # # A bunch of places in ncplib_kernel.c converted to using it. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/ncpfs/ncplib_kernel.c # 2004/10/05 14:20:27-07:00 viro@www.linux.org.uk +14 -7 # ncpfs (3/7): be32 handling in marshalling # # ChangeSet # 2004/10/06 07:53:02-07:00 viro@www.linux.org.uk # [PATCH] ncpfs (2/7): date handling cleanup # # trivial cleanup: endianness conversions pulled into ncp_date_dos2unix() and # ncp_date_unix2dos() from their callers. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/ncp_fs.h # 2004/10/05 14:14:41-07:00 viro@www.linux.org.uk +2 -2 # ncpfs (2/7): date handling cleanup # # fs/ncpfs/inode.c # 2004/10/05 14:14:41-07:00 viro@www.linux.org.uk +7 -15 # ncpfs (2/7): date handling cleanup # # fs/ncpfs/dir.c # 2004/10/05 14:14:41-07:00 viro@www.linux.org.uk +8 -7 # ncpfs (2/7): date handling cleanup # # ChangeSet # 2004/10/06 07:52:50-07:00 viro@www.linux.org.uk # [PATCH] ncpfs (1/7): constants sanitized # # That's the beginning of ncpfs endianness cleanup. # * converted fixed-endian constants to little-endian (i.e. replaced # htons(0xCDAB) with cpu_to_le16(0xABCD), etc.). These guys _are_ little-endian # and make much more sense that way, even aside of annotation issues. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/ncp_no.h # 2004/10/05 14:01:39-07:00 viro@www.linux.org.uk +13 -13 # ncpfs (1/7): constants sanitized # # include/linux/ncp.h # 2004/10/05 14:02:48-07:00 viro@www.linux.org.uk +30 -30 # ncpfs (1/7): constants sanitized # # fs/ncpfs/symlink.c # 2004/10/05 14:03:04-07:00 viro@www.linux.org.uk +2 -2 # ncpfs (1/7): constants sanitized # # fs/ncpfs/ncplib_kernel.c # 2004/10/05 14:08:08-07:00 viro@www.linux.org.uk +13 -13 # ncpfs (1/7): constants sanitized # # ChangeSet # 2004/10/06 07:52:38-07:00 viro@www.linux.org.uk # [PATCH] quota endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/quotaio_v2.h # 2004/10/05 13:22:32-07:00 viro@www.linux.org.uk +22 -22 # quota endianness annotations # # fs/quota_v2.c # 2004/10/05 13:22:08-07:00 viro@www.linux.org.uk +4 -4 # quota endianness annotations # # fs/quota_v1.c # 2004/10/05 13:22:05-07:00 viro@www.linux.org.uk +2 -2 # quota endianness annotations # # ChangeSet # 2004/10/06 07:52:26-07:00 viro@www.linux.org.uk # [PATCH] fs/partitions endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/genhd.h # 2004/10/05 13:20:09-07:00 viro@www.linux.org.uk +62 -45 # fs/partitions endianness annotations # # fs/partitions/sun.c # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +17 -16 # fs/partitions endianness annotations # # fs/partitions/sgi.c # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +17 -15 # fs/partitions endianness annotations # # fs/partitions/osf.c # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +23 -23 # fs/partitions endianness annotations # # fs/partitions/mac.h # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +18 -18 # fs/partitions endianness annotations # # fs/partitions/ldm.h # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +3 -3 # fs/partitions endianness annotations # # fs/partitions/ldm.c # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +1 -1 # fs/partitions endianness annotations # # fs/partitions/efi.h # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +18 -18 # fs/partitions endianness annotations # # fs/partitions/atari.h # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +2 -2 # fs/partitions endianness annotations # # fs/partitions/amiga.c # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +7 -7 # fs/partitions endianness annotations # # fs/partitions/acorn.c # 2004/10/05 13:21:21-07:00 viro@www.linux.org.uk +20 -20 # fs/partitions endianness annotations # # ChangeSet # 2004/10/06 07:52:14-07:00 viro@www.linux.org.uk # [PATCH] udf endianness annotation fix # # udf/balloc.c::find_next_one_bit() had been confused about types... # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/udf/balloc.c # 2004/10/05 13:19:26-07:00 viro@www.linux.org.uk +2 -2 # udf endianness annotation fix # # ChangeSet # 2004/10/06 07:52:02-07:00 viro@www.linux.org.uk # [PATCH] hton* and ntoh* endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/byteorder/little_endian.h # 2004/10/05 13:18:20-07:00 viro@www.linux.org.uk +4 -4 # hton* and ntoh* endianness annotations # # include/linux/byteorder/generic.h # 2004/10/05 13:18:10-07:00 viro@www.linux.org.uk +4 -4 # hton* and ntoh* endianness annotations # # include/linux/byteorder/big_endian.h # 2004/10/05 13:18:15-07:00 viro@www.linux.org.uk +4 -4 # hton* and ntoh* endianness annotations # # ChangeSet # 2004/10/06 07:51:50-07:00 viro@www.linux.org.uk # [PATCH] romfs endianness annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/romfs_fs.h # 2004/10/05 13:17:28-07:00 viro@www.linux.org.uk +9 -9 # romfs endianness annotations # # fs/romfs/inode.c # 2004/10/05 13:17:42-07:00 viro@www.linux.org.uk +16 -15 # romfs endianness annotations # # ChangeSet # 2004/10/06 07:51:38-07:00 viro@www.linux.org.uk # [PATCH] arcnet iomem annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # include/linux/arcdevice.h # 2004/10/05 13:16:18-07:00 viro@www.linux.org.uk +1 -1 # arcnet iomem annotations # # drivers/net/arcnet/com90xx.c # 2004/10/05 13:16:05-07:00 viro@www.linux.org.uk +2 -2 # arcnet iomem annotations # # drivers/net/arcnet/arc-rimi.c # 2004/10/05 13:15:57-07:00 viro@www.linux.org.uk +6 -6 # arcnet iomem annotations # # ChangeSet # 2004/10/06 07:51:26-07:00 viro@www.linux.org.uk # [PATCH] more NULL noise removal in drivers/scsi # # trivial junk that had been hanging arond in my tree for months now... # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/scsi/tmscsim.c # 2004/10/05 13:12:31-07:00 viro@www.linux.org.uk +3 -3 # more NULL noise removal in drivers/scsi # # drivers/scsi/qla2xxx/qla_init.c # 2004/10/05 13:11:22-07:00 viro@www.linux.org.uk +2 -2 # more NULL noise removal in drivers/scsi # # drivers/scsi/pcmcia/nsp_cs.c # 2004/10/05 13:11:16-07:00 viro@www.linux.org.uk +1 -1 # more NULL noise removal in drivers/scsi # # drivers/scsi/mca_53c9x.c # 2004/10/05 13:12:11-07:00 viro@www.linux.org.uk +7 -7 # more NULL noise removal in drivers/scsi # # drivers/scsi/ips.c # 2004/10/05 13:12:03-07:00 viro@www.linux.org.uk +3 -3 # more NULL noise removal in drivers/scsi # # drivers/scsi/dc395x.c # 2004/10/05 13:11:53-07:00 viro@www.linux.org.uk +3 -3 # more NULL noise removal in drivers/scsi # # drivers/scsi/atp870u.c # 2004/10/05 13:11:44-07:00 viro@www.linux.org.uk +3 -3 # more NULL noise removal in drivers/scsi # # drivers/scsi/NCR53C9x.c # 2004/10/05 13:11:35-07:00 viro@www.linux.org.uk +8 -8 # more NULL noise removal in drivers/scsi # # drivers/scsi/3w-xxxx.c # 2004/10/05 13:11:29-07:00 viro@www.linux.org.uk +3 -3 # more NULL noise removal in drivers/scsi # # ChangeSet # 2004/10/06 07:51:14-07:00 viro@www.linux.org.uk # [PATCH] more new struct initializers # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # fs/reiserfs/xattr_user.c # 2004/10/05 13:08:58-07:00 viro@www.linux.org.uk +5 -5 # more new struct initializers # # fs/reiserfs/xattr_trusted.c # 2004/10/05 13:08:55-07:00 viro@www.linux.org.uk +5 -5 # more new struct initializers # # fs/reiserfs/xattr_security.c # 2004/10/05 13:08:37-07:00 viro@www.linux.org.uk +5 -5 # more new struct initializers # # fs/reiserfs/xattr_acl.c # 2004/10/05 13:08:33-07:00 viro@www.linux.org.uk +10 -10 # more new struct initializers # # drivers/net/s2io.c # 2004/10/05 13:00:28-07:00 viro@www.linux.org.uk +4 -4 # more new struct initializers # # drivers/mtd/chips/jedec_probe.c # 2004/10/05 12:59:50-07:00 viro@www.linux.org.uk +20 -20 # more new struct initializers # # drivers/media/dvb/frontends/stv0299.c # 2004/10/05 12:59:26-07:00 viro@www.linux.org.uk +5 -5 # more new struct initializers # # drivers/media/dvb/dvb-core/dvb_ca_en50221.c # 2004/10/05 12:59:15-07:00 viro@www.linux.org.uk +11 -12 # more new struct initializers # # drivers/char/ipmi/ipmi_poweroff.c # 2004/10/05 12:59:03-07:00 viro@www.linux.org.uk +1 -1 # more new struct initializers # # ChangeSet # 2004/10/06 07:51:01-07:00 viro@www.linux.org.uk # [PATCH] sx8 iomem and endianness annotations + endianness bugfix # # fixed bug: le32_to_cpu(desc->size_hi) is broken on big-endian, since # ->size_hi is 16bit. # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/block/sx8.c # 2004/10/05 13:13:47-07:00 viro@www.linux.org.uk +47 -47 # sx8 iomem and endianness annotations + endianness bugfix # # ChangeSet # 2004/10/06 07:50:49-07:00 viro@www.linux.org.uk # [PATCH] DAC960 iomem annotations # # Signed-off-by: Al Viro # Signed-off-by: Linus Torvalds # # drivers/block/DAC960.h # 2004/10/05 12:57:23-07:00 viro@www.linux.org.uk +94 -94 # DAC960 iomem annotations # # drivers/block/DAC960.c # 2004/10/05 12:57:21-07:00 viro@www.linux.org.uk +17 -17 # DAC960 iomem annotations # # ChangeSet # 2004/10/05 22:01:33-07:00 herbert@gondor.apana.org.au # [TCP]: Fix bug that hid sockets in tcp_diag # # This patch squashes a bug in tcp_diag which was created when the # sk_* loops replaced the original for loops. It's a pity that these # sk_*/hlist_*/list_* loops don't take an arbitrary expression as an # argument for continue. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/tcp_diag.c # 2004/10/05 22:01:14-07:00 herbert@gondor.apana.org.au +16 -13 # [TCP]: Fix bug that hid sockets in tcp_diag # # This patch squashes a bug in tcp_diag which was created when the # sk_* loops replaced the original for loops. It's a pity that these # sk_*/hlist_*/list_* loops don't take an arbitrary expression as an # argument for continue. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 22:00:08-07:00 yoshfuji@linux-ipv6.o0rg # [INET]: Fix ECN encapsulation. # # We broke ECN encapsulation in tunnels recently. # Without this patch, even though encapusulated (inner) packet is # 'not-ECN', encapusulating (outer) packet is sent with 'ECT(0)' set. # This is wrong and should be 'not-ECN.' # This patch fixes up. # # From RFC3168: # The full-functionality option for ECN encapsulation is to copy the # ECN codepoint of the inside header to the outside header on # encapsulation if the inside header is not-ECT or ECT, and to set the # ECN codepoint of the outside header to ECT(0) if the ECN codepoint of # the inside header is CE. # # Signed-off-by: Hideaki YOSHIFUJI # Signed-off-by: David S. Miller # # include/net/inet_ecn.h # 2004/10/05 21:59:49-07:00 yoshfuji@linux-ipv6.o0rg +2 -1 # [INET]: Fix ECN encapsulation. # # We broke ECN encapsulation in tunnels recently. # Without this patch, even though encapusulated (inner) packet is # 'not-ECN', encapusulating (outer) packet is sent with 'ECT(0)' set. # This is wrong and should be 'not-ECN.' # This patch fixes up. # # From RFC3168: # The full-functionality option for ECN encapsulation is to copy the # ECN codepoint of the inside header to the outside header on # encapsulation if the inside header is not-ECT or ECT, and to set the # ECN codepoint of the outside header to ECT(0) if the ECN codepoint of # the inside header is CE. # # Signed-off-by: Hideaki YOSHIFUJI # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 21:58:06-07:00 herbert@gondor.apan.org.au # [TCP]: Show all SYN_RECV sockets in /proc/net/tcp # # I was fixing the tcp_diag so that it shows SYN_RECV sockets properly. # I found that /proc/net/tcp didn't do it correctly either. So here is # a small patch to fix /proc/net/tcp. # # The logic in there stinks though so I'd love to see a rewrite. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/tcp_ipv4.c # 2004/10/05 21:57:47-07:00 herbert@gondor.apan.org.au +8 -1 # [TCP]: Show all SYN_RECV sockets in /proc/net/tcp # # I was fixing the tcp_diag so that it shows SYN_RECV sockets properly. # I found that /proc/net/tcp didn't do it correctly either. So here is # a small patch to fix /proc/net/tcp. # # The logic in there stinks though so I'd love to see a rewrite. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 21:28:15-07:00 davem@nuts.davemloft.net # [SPARC64]: Make kprobe implementation more robust. # # Switch over to use the single-step scheme which x86 uses # which is to execute the kprobe instruction in the # kprobe->insn[] area. Also, make sure the kprobe execution # runs fully with interrupts disabled, so we do not deadlock. # # This required adding code to fix things up as a result of # the instruction executing at a PC which is different from # where it would normally execute. For example, if the # instruction is a PC-relative branch, we have to adjust the # final PC value. # # Signed-off-by: David S. Miller # # arch/sparc64/kernel/kprobes.c # 2004/10/05 21:25:55-07:00 davem@nuts.davemloft.net +166 -69 # [SPARC64]: Make kprobe implementation more robust. # # ChangeSet # 2004/10/05 18:51:53-07:00 torvalds@evo.osdl.org # i386: mark do_test_wp_bit() noinline # # As reported by Zachary Amsden , # some gcc versions will inline the function even when # it is declared after the call-site. This particular # function must not be inlined, since the exception # recovery doesn't like __init sections (which the caller # is in). # # arch/i386/mm/init.c # 2004/10/05 18:51:43-07:00 torvalds@evo.osdl.org +2 -2 # i386: mark do_test_wp_bit() noinline # # As reported by Zachary Amsden , # some gcc versions will inline the function even when # it is declared after the call-site. This particular # function must not be inlined, since the exception # recovery doesn't like __init sections (which the caller # is in). # # ChangeSet # 2004/10/05 18:18:28-07:00 torvalds@evo.osdl.org # prism54: iomem annotations. # # sparse still complains about the games the driver # plays with user pointers, though. # # drivers/net/wireless/prism54/islpci_dev.h # 2004/10/05 18:18:15-07:00 torvalds@evo.osdl.org +1 -1 # prism54: iomem annotations. # # sparse still complains about the games the driver # plays with user pointers, though. # # drivers/net/wireless/prism54/islpci_dev.c # 2004/10/05 18:18:15-07:00 torvalds@evo.osdl.org +4 -4 # prism54: iomem annotations. # # sparse still complains about the games the driver # plays with user pointers, though. # # drivers/net/wireless/prism54/isl_38xx.h # 2004/10/05 18:18:15-07:00 torvalds@evo.osdl.org +7 -7 # prism54: iomem annotations. # # sparse still complains about the games the driver # plays with user pointers, though. # # drivers/net/wireless/prism54/isl_38xx.c # 2004/10/05 18:18:15-07:00 torvalds@evo.osdl.org +6 -6 # prism54: iomem annotations. # # sparse still complains about the games the driver # plays with user pointers, though. # # ChangeSet # 2004/10/05 18:01:31-07:00 torvalds@evo.osdl.org # pcmcia: add iomem sparse annotations. # # It was pretty clean already, adding the proper annotations # to the base pointers and a few functions was all it took # to make sparse happy about the PCI accesses. # # include/pcmcia/ss.h # 2004/10/05 18:01:22-07:00 torvalds@evo.osdl.org +2 -2 # pcmcia: add iomem sparse annotations. # # It was pretty clean already, adding the proper annotations # to the base pointers and a few functions was all it took # to make sparse happy about the PCI accesses. # # drivers/pcmcia/yenta_socket.h # 2004/10/05 18:01:22-07:00 torvalds@evo.osdl.org +1 -1 # pcmcia: add iomem sparse annotations. # # It was pretty clean already, adding the proper annotations # to the base pointers and a few functions was all it took # to make sparse happy about the PCI accesses. # # drivers/pcmcia/rsrc_mgr.c # 2004/10/05 18:01:22-07:00 torvalds@evo.osdl.org +1 -1 # pcmcia: add iomem sparse annotations. # # It was pretty clean already, adding the proper annotations # to the base pointers and a few functions was all it took # to make sparse happy about the PCI accesses. # # drivers/pcmcia/cistpl.c # 2004/10/05 18:01:22-07:00 torvalds@evo.osdl.org +5 -3 # pcmcia: add iomem sparse annotations. # # It was pretty clean already, adding the proper annotations # to the base pointers and a few functions was all it took # to make sparse happy about the PCI accesses. # # drivers/pcmcia/cardbus.c # 2004/10/05 18:01:22-07:00 torvalds@evo.osdl.org +1 -1 # pcmcia: add iomem sparse annotations. # # It was pretty clean already, adding the proper annotations # to the base pointers and a few functions was all it took # to make sparse happy about the PCI accesses. # # ChangeSet # 2004/10/05 17:29:04-07:00 torvalds@ppc970.osdl.org # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/x86_64/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/sparc64/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/sparc/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/ppc64/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/ppc/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/m68k/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/m32r/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/i386/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/arm/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # arch/alpha/Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # Makefile # 2004/10/05 17:28:57-07:00 torvalds@ppc970.osdl.org +1 -1 # Fix up CHECKFLAGS definitions # # More recent versions of sparse do not define the Linux-specific # default defines, so we make the main Makefile default to the # regular Linux preprocessor defines (__linux__, linux, __STDC__ # and unix, __unix__). # # Also, sparse has long since fixed the default empty define to # be "1" as in regular C, so remove the unnecessary "=1" from # the architecture-specific sparse CHECKFLAGS. # # ChangeSet # 2004/10/05 16:44:44-07:00 mingo@redhat.com # [PATCH] Fix task_hot() balancing # # This fixes the integer underflow in task_hot() noticed by Kenneth W Chen # and makes use of p->last_ran to separate load-balancing timestamps (used # by task_hot()) from interactivity timestamps. (which two interfered) # # compiled, booted on x86 SMP. # # Confirmed by Kenneth Chen to fix the db # transaction processing workload that showed the balancing problem. # # Signed-off-by: Ingo Molnar # Signed-off-by: Linus Torvalds # # kernel/sched.c # 2004/10/04 17:00:00-07:00 mingo@redhat.com +3 -2 # Fix task_hot() balancing # # include/linux/sched.h # 2004/10/04 17:00:00-07:00 mingo@redhat.com +1 -1 # Fix task_hot() balancing # # ChangeSet # 2004/10/05 16:37:30-07:00 torvalds@ppc970.osdl.org # Remove test for __linux__ in auth_gss.h. # # It's not necessarily even true when cross-compiling the # kernel, and the right thing to do is check for __KERNEL__ # (which we already do, one line up). # # include/linux/sunrpc/auth_gss.h # 2004/10/05 16:37:24-07:00 torvalds@ppc970.osdl.org +0 -2 # Remove test for __linux__ in auth_gss.h. # # It's not necessarily even true when cross-compiling the # kernel, and the right thing to do is check for __KERNEL__ # (which we already do, one line up). # # ChangeSet # 2004/10/05 14:23:17-07:00 manfred@colorfullife.com # [NET]: Fix secure tcp sequence number generation # # Ted's recent random.c update broke the periodic rekeying: # schedule_work() doesn't provide synchronization. Additionally the first # syn values after boot are generated with secret 0 - not good. # # Attached is a big cleanup. Linus asked me to send to to you for merging: # # The tcp sequence number generator needs a random seed that is reset every # few minutes. Since the sequence numbers should be constantly increasing, # for each rekey 2^24 is added to the sequence number. # The actual use of the sequence number generator is lockless, # synchronization is achieved by having two copies of the control structure. # # The attached patch: # - fixes a race in rekey_seq_generator(): schedule_work doesn't # provide synchronization. # - Uses schedule_delayed_work() for the rekey: simplifies synchronization # and speeds up the hot path. # - Adds a late_initcall for the first initialization after boot. # init_call would be too early, I've checked that the late_initcall runs # before net/ipv4/ipconfig.c, i.e. the BOOTP/DHCP autoconfiguration. # # Signed-Off-By: Manfred Spraul # Signed-off-by: David S. Miller # # drivers/char/random.c # 2004/10/05 14:21:53-07:00 manfred@colorfullife.com +35 -33 # [NET]: Fix secure tcp sequence number generation # # ChangeSet # 2004/10/05 22:06:38+01:00 rmk@flint.arm.linux.org.uk # [ARM] Fix missing definition for OVERCOMMIT_ALWAYS # # arch/arm/mm/init.c # 2004/10/05 22:03:42+01:00 rmk@flint.arm.linux.org.uk +1 -0 # Add linux/mman.h include - required for OVERCOMMIT_ALWAYS # # ChangeSet # 2004/10/05 13:44:51-07:00 tgraf@suug.ch # [PKT_SCHED]: Make rate estimator work on all platforms. # # Fixes the existing rate estimator to compile cleanly on all platforms # and avoids carrying on the variance on platforms with HZ%4 != 0. # # Signed-off-by: Thomas Graf # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/sched/estimator.c # 2004/10/05 13:44:33-07:00 tgraf@suug.ch +3 -7 # [PKT_SCHED]: Make rate estimator work on all platforms. # # Fixes the existing rate estimator to compile cleanly on all platforms # and avoids carrying on the variance on platforms with HZ%4 != 0. # # Signed-off-by: Thomas Graf # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 13:38:47-07:00 davem@nuts.davemloft.net # [NET]: Generic network statistics/estimator # # Work done by Thomas Graf and # Jamal Hadi Salim # # The following patchset introduces generic network statistics for # netlink users. It uses nested TLV which prevents further compatibility # problems when introducing new statistics. Backward compatibility to # existing TLV types TCA_STATS and TCA_XSTATS is ensured but can be # easly removed once it is no longer needed. Therefore prior users of # struct tc_stats can be converted to this API and existing userspace # applications will not notice a difference while converted applications # can use the new extendable statistic interface. # # Changes: # - Add generic network statistics API for netlink users. # - Introduces a generic rate estimator based on timers. Patch is based # on Jamals patch and adapted to the new generic network statistics # API. # - Add documentation of generic network statistics and estimator API. # # Signed-off-by: Thomas Graf # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # net/core/Makefile # 2004/10/05 13:36:58-07:00 davem@nuts.davemloft.net +1 -1 # [NET]: Generic network statistics/estimator # # net/core/gen_stats.c # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +132 -0 # [NET]: Generic network statistics/estimator # # net/core/gen_estimator.c # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +204 -0 # [NET]: Generic network statistics/estimator # # include/net/gen_stats.h # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +45 -0 # [NET]: Generic network statistics/estimator # # Documentation/networking/gen_stats.txt # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +117 -0 # [NET]: Generic network statistics/estimator # # net/core/gen_stats.c # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +0 -0 # BitKeeper file /disk1/BK/net-2.6/net/core/gen_stats.c # # net/core/gen_estimator.c # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +0 -0 # BitKeeper file /disk1/BK/net-2.6/net/core/gen_estimator.c # # include/net/gen_stats.h # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +0 -0 # BitKeeper file /disk1/BK/net-2.6/include/net/gen_stats.h # # include/linux/gen_stats.h # 2004/10/05 13:36:51-07:00 davem@nuts.davemloft.net +62 -0 # [NET]: Generic network statistics/estimator # # Documentation/networking/gen_stats.txt # 2004/10/05 13:36:52-07:00 davem@nuts.davemloft.net +0 -0 # BitKeeper file /disk1/BK/net-2.6/Documentation/networking/gen_stats.txt # # include/linux/gen_stats.h # 2004/10/05 13:36:51-07:00 davem@nuts.davemloft.net +0 -0 # BitKeeper file /disk1/BK/net-2.6/include/linux/gen_stats.h # # ChangeSet # 2004/10/05 13:15:45-07:00 tgraf@suug.ch # [PKT_SCHED]: Remove useless line in cbq_dump_class # # Remove useless line in cbq_dump_class probably introduced by # copy&paste from cbq_dump. # # Signed-off-by: Thomas Graf # Signed-off-by: David S. Miller # # net/sched/sch_cbq.c # 2004/10/05 13:15:25-07:00 tgraf@suug.ch +0 -1 # [PKT_SCHED]: Remove useless line in cbq_dump_class # # Remove useless line in cbq_dump_class probably introduced by # copy&paste from cbq_dump. # # Signed-off-by: Thomas Graf # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 12:36:01-07:00 patrick@tykepenguin.com # [DECNET]: Mark myself as maintainer. # # Signed-off-by: Patrick Caulfield # Signed-off-by: David S. Miller # # MAINTAINERS # 2004/10/05 12:35:42-07:00 patrick@tykepenguin.com +3 -3 # [DECNET]: Mark myself as maintainer. # # Signed-off-by: Patrick Caulfield # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 12:34:07-07:00 macro@linux-mips.org # [IPV4]: Permit the official ARP hw type in SIOCSARP for FDDI. # # Signed-off-by; Maciej W. Rozycki # Signed-off-by: David S. Miller # # net/ipv4/arp.c # 2004/10/05 12:33:48-07:00 macro@linux-mips.org +20 -2 # [IPV4]: Permit the official ARP hw type in SIOCSARP for FDDI. # # Signed-off-by; Maciej W. Rozycki # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 12:32:21-07:00 macro@linux-mips.org # [IPV4]: Set ARP hw type correctly for BOOTP over FDDI. # # Signed-off-by; Maciej W. Rozycki # Signed-off-by: David S. Miller # # net/ipv4/ipconfig.c # 2004/10/05 12:32:03-07:00 macro@linux-mips.org +2 -0 # [IPV4]: Set ARP hw type correctly for BOOTP over FDDI. # # Signed-off-by; Maciej W. Rozycki # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 12:29:45-07:00 macro@linux-mips.org # [NET]: Fix fddi_statistics for 64-bit # # There is a problem with "struct fddi_statistics" for 64-bit systems. # The starting members of the struct are expected to correspond to the # respective members of "struct net_device_stats" (drivers for FDDI # devices return "struct fddi_statistics" in the response to the # get_stats() call of "struct net_device"). Unfortunately, due to using # different types (u32 vs ulong) they do not. "struct net_device_stats" # is a public interface and as a result, bogus results are retrieved, # e.g. for /proc/net/dev. # # Here is my proposal to address the problem. I think there is no # point in duplicating the layout of "struct net_device_stats" in # "struct fddi_statistics" as the former can simply be included as a # member avoiding this problem and actually any possible discrepancy in # the future. This also preserves the layout of the structure for # 32-bit systems. # # Signed-off-by: Maciej W. Rozycki # Signed-off-by: David S. Miller # # include/linux/if_fddi.h # 2004/10/05 12:29:27-07:00 macro@linux-mips.org +7 -33 # [NET]: Fix fddi_statistics for 64-bit # # drivers/net/skfp/skfddi.c # 2004/10/05 12:29:26-07:00 macro@linux-mips.org +11 -9 # [NET]: Fix fddi_statistics for 64-bit # # drivers/net/defxx.c # 2004/10/05 12:29:26-07:00 macro@linux-mips.org +12 -10 # [NET]: Fix fddi_statistics for 64-bit # # ChangeSet # 2004/10/05 12:25:23-07:00 jmorris@redhat.com # [CRYPTO]: Add __init and __initdata to aes.c # # This patch from Herbert V. Riedel adds __initdata to the # generic AES code where appropriate. I also added __init to f_mult(). # # Signed-off-by: Herbert V. Riedel # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # crypto/aes.c # 2004/10/05 12:25:04-07:00 jmorris@redhat.com +6 -6 # [CRYPTO]: Add __init and __initdata to aes.c # # This patch from Herbert V. Riedel adds __initdata to the # generic AES code where appropriate. I also added __init to f_mult(). # # Signed-off-by: Herbert V. Riedel # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 11:37:55-07:00 gnb@sgi.com # [NET]: Fix race between neigh-timer_handler and neigh_event_send # # Fix a race between neigh_timer_handler() calling down to arp_solicit() # with an sk_buff peeked from the head of the neigh->arp_queue, and # neigh_event_send() unqueuing and freeing the head of the same queue # because it's reached the maximum length of 3, by taking an extra # sk_buff reference while holding neigh->lock. # # Signed-off-by: Greg Banks # Signed-off-by: David S. Miller # # net/core/neighbour.c # 2004/10/05 11:37:37-07:00 gnb@sgi.com +7 -1 # [NET]: Fix race between neigh-timer_handler and neigh_event_send # # Fix a race between neigh_timer_handler() calling down to arp_solicit() # with an sk_buff peeked from the head of the neigh->arp_queue, and # neigh_event_send() unqueuing and freeing the head of the same queue # because it's reached the maximum length of 3, by taking an extra # sk_buff reference while holding neigh->lock. # # Signed-off-by: Greg Banks # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 11:21:08-07:00 wensong@linux-vs.org # [IPVS]: Fix endian problem on sync message size. # # Here is the patch from Justin Ossevoort to fix # endian problem on IPVS sync message size. # # Signed-off-by: David S. Miller # # net/ipv4/ipvs/ip_vs_sync.c # 2004/10/05 11:20:50-07:00 wensong@linux-vs.org +19 -9 # [IPVS]: Fix endian problem on sync message size. # # Here is the patch from Justin Ossevoort to fix # endian problem on IPVS sync message size. # # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/05 16:16:55+01:00 rmk@flint.arm.linux.org.uk # [ARM] Add save_time_delta()/restore_time_delta() # # These two functions provide the infrastructure to manage time keeping # across a suspend/resume cycle. # # include/asm-arm/mach/time.h # 2004/10/05 16:13:59+01:00 rmk@flint.arm.linux.org.uk +5 -2 # Add save_time_delta()/restore_time_delta() prototypes. # # arch/arm/mach-sa1100/pm.c # 2004/10/05 16:13:58+01:00 rmk@flint.arm.linux.org.uk +8 -4 # Use save_time_delta/restore_time_delta to save/restore system time # over suspend. # # arch/arm/mach-pxa/pm.c # 2004/10/05 16:13:58+01:00 rmk@flint.arm.linux.org.uk +7 -3 # Use save_time_delta/restore_time_delta to save/restore system time # over suspend. # # arch/arm/kernel/time.c # 2004/10/05 16:13:58+01:00 rmk@flint.arm.linux.org.uk +33 -0 # Add save_time_delta()/restore_time_delta() so that the system time # difference can be saved over sleep. # # ChangeSet # 2004/10/05 07:54:19-07:00 hunold@linuxtv.org # [PATCH] Fix error path in Video4Linux dpc7146 driver # # The I2C adapter wasn't de-registered correctly in case the video card # wasn't found. When the I2C subsystem tried to speak with the dangling # I2C adapter later on, usually an oops happened. # # drivers/media/video/dpc7146.c # 2004/10/05 04:40:54-07:00 hunold@linuxtv.org +1 -0 # Fix error path in Video4Linux dpc7146 driver # # ChangeSet # 2004/10/05 11:08:39+01:00 rmk@flint.arm.linux.org.uk # [SERIAL] Fix warning and remove mach-types.h include # # - s3c2410 doesn't use mach-types.h # - remove unused 'ret' variable # # drivers/serial/s3c2410.c # 2004/10/05 11:04:27+01:00 rmk@flint.arm.linux.org.uk +0 -2 # s3c2410 doesn't use mach-types.h # # drivers/serial/amba-pl011.c # 2004/10/05 11:04:12+01:00 rmk@flint.arm.linux.org.uk +0 -1 # Remove unused 'ret' variable. # # ChangeSet # 2004/10/05 19:20:14+10:00 airlied@starflyer.(none) # drm: Stop i830 and i915 both being build at same time # # Roman Zippel submitted this to lk but I missed it, it does # what I tried to do badly before. # # Signed-off-by: Dave Airlie # # drivers/char/drm/Kconfig # 2004/10/05 19:20:06+10:00 airlied@starflyer.(none) +8 -4 # drm: Stop i830 and i915 both being build at same time # # Roman Zippel submitted this to lk but I missed it, it does # what I tried to do badly before. # # Signed-off-by: Dave Airlie # # ChangeSet # 2004/10/05 10:07:18+01:00 blofeldus@com.rmk.(none) # [SERIAL] Pick nearest baud rate divider # # From: Roger Blofeld # # This patch modifies uart_get_divisor to select the nearest baud rate # divider rather than the lowest. It minimizes baud rate errors. # # For example, if uartclk is 33000000 and baud is 115200 the ratio is about # 17.9 The current code selects 17 (5% error) but should select 18 (0.5% # error) # # Signed-off-by: Andrew Morton # Signed-off-by: Russell King # # drivers/serial/serial_core.c # 2004/10/05 10:02:36+01:00 blofeldus@com.rmk.(none) +1 -1 # [PATCH] pick nearest baud rate divider # # ChangeSet # 2004/10/04 23:11:26+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2123/4: S3C2410 - GPIO IRQ IRQ Filtering and pin number patch # # Patch from Ben Dooks # # Fixed GPG pin numbering, and missing changelog # # Added code to setup the interrupt filtering on # compatible Pins # # Signed-off-by: Ben Dooks # # include/asm-arm/arch-s3c2410/regs-gpio.h # 2004/10/04 18:09:32+01:00 ben-linux@org.rmk.(none) +12 -6 # [PATCH] 2123/4: S3C2410 - GPIO IRQ IRQ Filtering and pin number patch # # include/asm-arm/arch-s3c2410/hardware.h # 2004/10/04 17:55:27+01:00 ben-linux@org.rmk.(none) +16 -1 # [PATCH] 2123/4: S3C2410 - GPIO IRQ IRQ Filtering and pin number patch # # arch/arm/mach-s3c2410/gpio.c # 2004/10/04 17:57:19+01:00 ben-linux@org.rmk.(none) +38 -1 # [PATCH] 2123/4: S3C2410 - GPIO IRQ IRQ Filtering and pin number patch # # ChangeSet # 2004/10/04 22:53:09+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2124/1: S3C2410 - include/asm-arm/arch-s3c2410/regs-spi.h # # Patch from Ben Dooks # # Header file defining S3C2410 SPI registers # # Signed-off-by: Klaus Fetscher # Signed-off-by: Ben Dooks # # # include/asm-arm/arch-s3c2410/regs-spi.h # 2004/10/04 20:20:02+01:00 ben-linux@org.rmk.(none) +56 -0 # [PATCH] 2124/1: S3C2410 - include/asm-arm/arch-s3c2410/regs-spi.h # # include/asm-arm/arch-s3c2410/regs-spi.h # 2004/10/04 20:20:02+01:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-s3c2410/regs-spi.h # # ChangeSet # 2004/10/04 22:48:28+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2122/1: S3C2410 - Documentation updates # # Patch from Ben Dooks # # Added documentation for the GPIO calls, updated # the overview with more information on the supported # core devices, and updated the state of the EB2410ITX # # Signed-off-by: Ben Dooks # # Documentation/arm/Samsung-S3C24XX/Overview.txt # 2004/10/03 23:36:12+01:00 ben-linux@org.rmk.(none) +48 -2 # [PATCH] 2122/1: S3C2410 - Documentation updates # # Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt # 2004/10/03 23:34:59+01:00 ben-linux@org.rmk.(none) +15 -0 # [PATCH] 2122/1: S3C2410 - Documentation updates # # Documentation/arm/Samsung-S3C24XX/GPIO.txt # 2004/10/03 23:34:31+01:00 ben-linux@org.rmk.(none) +122 -0 # [PATCH] 2122/1: S3C2410 - Documentation updates # # Documentation/arm/Samsung-S3C24XX/GPIO.txt # 2004/10/03 23:34:31+01:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/Documentation/arm/Samsung-S3C24XX/GPIO.txt # # ChangeSet # 2004/10/04 22:17:44+01:00 rmk@flint.arm.linux.org.uk # [ARM] Fix params_phys with PIC decompressor builds. # # include/asm-arm/arch-rpc/uncompress.h # 2004/10/04 22:15:11+01:00 rmk@flint.arm.linux.org.uk +2 -2 # Don't take the address of params_phys - -fPIC builds turn this into # a GOT entry which causes problems. # # arch/arm/boot/compressed/head.S # 2004/10/04 22:15:10+01:00 rmk@flint.arm.linux.org.uk +6 -0 # Add params() assembly function to obtain the address of the # parameter information passed from the boot loader. # # ChangeSet # 2004/10/04 17:11:35-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: comment fixes # # Comment fixes. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.h # 2004/10/01 15:37:50-04:00 romieu@fr.zoreil.com +3 -3 # via-velocity: comment fixes # # drivers/net/via-velocity.c # 2004/10/01 15:37:50-04:00 romieu@fr.zoreil.com +3 -3 # via-velocity: comment fixes # # ChangeSet # 2004/10/04 17:11:20-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: wrong buffer offset in velocity_init_td_ring() # # Buffer offset calculation was incorrect in velocity_init_td_ring(). # This didn't cause any trouble because we only use the first td ring. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.c # 2004/10/01 15:37:46-04:00 romieu@fr.zoreil.com +4 -2 # via-velocity: wrong buffer offset in velocity_init_td_ring() # # ChangeSet # 2004/10/04 17:11:05-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: removal of incomplete endianness handling # # Removed cpu_to_le32 call on OWNED_BY_NIC. This will produce 0x01000000 on # big endian machines while rdesc0.owner still evaluates to 0x00000000 or # 0x00000001. BTW, unless we reorder bit fields on big endian machines or # use u32's and cpu_to_le32'd bit mask macros, current code won't work on big # endian machines. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.c # 2004/10/01 15:37:43-04:00 romieu@fr.zoreil.com +1 -1 # via-velocity: removal of incomplete endianness handling # # ChangeSet # 2004/10/04 17:10:51-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: early invocation of init_cam_filter() # # In velocity_init_registers(), init_cam_filter() clears mCAMmask which # might have been set by set_multi() (not sure if this can ever occur). # Modified to invoke init_cam_filter() first. Also, clear_isr() is called # twice. Removed the first invocation. # # In velocity_found1(), there was a unneeded assignment from vptr to # dev->priv. Removed. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.c # 2004/10/01 15:37:40-04:00 romieu@fr.zoreil.com +5 -4 # via-velocity: early invocation of init_cam_filter() # # ChangeSet # 2004/10/04 17:10:39-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: received ring wrong index and missing barriers # # There were several receive ring related bugs. # # In velocity_give_many_rx_descs(), index calculation was incorrect. # This and bugs in velocity_rx_srv() described in the following paragraph # caused packet loss, truncation and infinite error interrupt generation. # # In velocity_rx_srv(), velocity_rx_refill() could be called without any # dirty slot. With proper timing, This can result in refilling yet # unreceived packets and pushing dirty pointer ahead of the current pointer. # And vptr->rd_curr which is used by velocity_rx_refill() was updated after # calling velocity_rx_refill() thus screwing receive descriptor ring. # Also, between checking owner and reading the packet, rmb() is missing. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.c # 2004/10/01 15:37:37-04:00 romieu@fr.zoreil.com +10 -7 # via-velocity: received ring wrong index and missing barriers # # ChangeSet # 2004/10/04 17:10:25-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: velocity_give_rx_desc() removal # # In velocity_give_rx_desc(), there should be a wmb() between resetting the # first four bytes of rdesc0 and setting owner. As resetting the first four # bytes isn't necessary, I just removed the function and directly set owner. # Another rationale for removing the function: # The function doesn't handle synchronization. We should do wmb() before # calling the function. So, I think using bare assignment makes the fact # more explicit. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.c # 2004/10/01 15:37:34-04:00 romieu@fr.zoreil.com +2 -8 # via-velocity: velocity_give_rx_desc() removal # # ChangeSet # 2004/10/04 17:10:12-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: removal of unused velocity_info.xmit_lock # # Removed unused velocity_info.xmit_lock. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.h # 2004/10/01 15:37:31-04:00 romieu@fr.zoreil.com +0 -1 # via-velocity: removal of unused velocity_info.xmit_lock # # drivers/net/via-velocity.c # 2004/10/01 15:37:31-04:00 romieu@fr.zoreil.com +0 -3 # via-velocity: removal of unused velocity_info.xmit_lock # # ChangeSet # 2004/10/04 17:09:58-04:00 romieu@fr.zoreil.com # [PATCH] via-velocity: properly manage the count of adapters # # velocity_nics wasn't managed properly. # # Signed-off-by: Tejun Heo # # drivers/net/via-velocity.c # 2004/10/01 15:37:28-04:00 romieu@fr.zoreil.com +5 -2 # via-velocity: properly manage the count of adapters # # ChangeSet # 2004/10/04 14:06:10-07:00 davem@nuts.davemloft.net # [NET]: Kill typo in neighbour.c # # Signed-off-by: David S. Miller # # net/core/neighbour.c # 2004/10/04 14:05:40-07:00 davem@nuts.davemloft.net +1 -1 # [NET]: Kill typo in neighbour.c # # ChangeSet # 2004/10/04 16:48:22-04:00 nhorman@redhat.com # [PATCH] olympic driver: fix kernel oops on lobe fault # # It fixes an oops that results when a lobe fault is detected. The oops # occurs because a lobe fault triggers an interrupt which is handled # in the current version of the driver by effectively shutting down the # card, and freeing its requisite irq. The former is fine, the latter # is not, as its illegal to free an irq from within an interrupt context. # # I've fixed this bug by removing the call to free_irq from the interrupt # handler (specifically the chunk around line 964 fixes that). While I # was in there I noticed that there were several other conditions in # the interrupt handler that contained the same condition, so I made # the same fix there. I re-added. # # I also modified the contents of olympic_freemem (the chunk around line # 898 to correct a misuse of a pointer after it requisite memory has # been free in the case the the adapter is re-initalized after a fault # to prevent that oops. And then I clean up the interrupt handler to # simply use olympic_freemem from the close routine since the ring buffer # doesn't need to be freed until the driver is closed. # # In addition to these changes I added a call to olympic init in # olympic_open and reset the spinlock so the adapter can be reset and # rejoin the ring without needing to rmmod/insmod the module. Lastly I # cleaned up the wait queue code so that the close routine didn't have # to wait 60 seconds to close the adapter if a fatal fault has closed # the adapter. # # Signed-off-by: Neil Horman # # drivers/net/tokenring/olympic.c # 2004/10/04 06:56:06-04:00 nhorman@redhat.com +18 -45 # olympic driver: fix kernel oops on lobe fault # # ChangeSet # 2004/10/04 12:17:43-07:00 torvalds@ppc970.osdl.org # ppc64: fix non-C99 named initializers # # Al suggested a sparse warning. And sure enough, it found # these ones. # # arch/ppc64/kernel/setup.c # 2004/10/04 12:17:37-07:00 torvalds@ppc970.osdl.org +2 -2 # ppc64: fix non-C99 named initializers # # Al suggested a sparse warning. And sure enough, it found # these ones. # # ChangeSet # 2004/10/03 17:03:46-07:00 bastian@waldi.eu.org # [PATCH] s390: sclp compile fix # # The attached patch makes s390 sclp driver buildable again. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/s390/char/sclp_vt220.c # 2004/10/03 16:53:54-07:00 bastian@waldi.eu.org +1 -1 # s390: sclp compile fix # # drivers/s390/char/sclp_tty.c # 2004/10/03 16:53:54-07:00 bastian@waldi.eu.org +1 -1 # s390: sclp compile fix # # ChangeSet # 2004/10/03 15:03:28-07:00 davem@nuts.davemloft.net # Merge bk://212.42.230.204/net-2.6 # into nuts.davemloft.net:/disk1/BK/net-2.6 # # net/ipv6/sit.c # 2004/10/03 15:03:07-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/10/03 15:01:14-07:00 davem@nuts.davemloft.net # [PKT_ACT]: Fixup tcf_result updating wrt. tcf_action_exec() calls. # # - Pass tcf_result into tcf_action_exec() # - Update res->classid and res->class on non-zero # skb->tc_classid, then reset skb->tc_classid # - Update tcf_action_exec() callers in cls_u32.c # and cls_fw.c # # Based upon a patch by Jamal Hadi Salim # # Signed-off-by: David S. Miller # # net/sched/cls_u32.c # 2004/10/03 14:59:28-07:00 davem@nuts.davemloft.net +1 -6 # [PKT_ACT]: Fixup tcf_result updating wrt. tcf_action_exec() calls. # # net/sched/cls_fw.c # 2004/10/03 14:59:28-07:00 davem@nuts.davemloft.net +1 -1 # [PKT_ACT]: Fixup tcf_result updating wrt. tcf_action_exec() calls. # # net/sched/act_api.c # 2004/10/03 14:59:28-07:00 davem@nuts.davemloft.net +8 -2 # [PKT_ACT]: Fixup tcf_result updating wrt. tcf_action_exec() calls. # # include/net/pkt_sched.h # 2004/10/03 14:59:28-07:00 davem@nuts.davemloft.net +1 -1 # [PKT_ACT]: Fixup tcf_result updating wrt. tcf_action_exec() calls. # # ChangeSet # 2004/10/03 22:47:53+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2121/1: S3C2410 - add S3C2410_MISCCR definitions for power down config # # Patch from Ben Dooks # # Add definitions to the MISCCR register for configuration # of the signal states in power down mode. # # Signed-off-by: Ben Dooks # # include/asm-arm/arch-s3c2410/regs-gpio.h # 2004/10/03 17:16:41+01:00 ben-linux@org.rmk.(none) +5 -0 # [PATCH] 2121/1: S3C2410 - add S3C2410_MISCCR definitions for power down config # # ChangeSet # 2004/10/03 22:40:37+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2120/1: S3C2410 - include/asm-arm/arch-s3c2410/regs-iic.h # # Patch from Ben Dooks # # Include file include/asm-arm/arch-s3c2410/regs-iic.h, # for the I2C controller on the S3C2410 Samsung SoC. # # Signed-off-by: Ben Dooks # # ChangeSet # 2004/10/03 14:39:05-07:00 yoshfuji@linux-ipv6.org # [IPV6]: Missing ip_rt_put() in SIT error path. # # Signed-off-by: Hideaki YOSHIFUJI # Signed-off-by: David S. Miller # # net/ipv6/sit.c # 2004/10/03 14:38:47-07:00 yoshfuji@linux-ipv6.org +1 -0 # [IPV6]: Missing ip_rt_put() in SIT error path. # # Signed-off-by: Hideaki YOSHIFUJI # Signed-off-by: David S. Miller # # include/asm-arm/arch-s3c2410/regs-iic.h # 2004/10/03 17:03:15+01:00 ben-linux@org.rmk.(none) +50 -0 # [PATCH] 2120/1: S3C2410 - include/asm-arm/arch-s3c2410/regs-iic.h # # include/asm-arm/arch-s3c2410/regs-iic.h # 2004/10/03 17:03:15+01:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-s3c2410/regs-iic.h # # ChangeSet # 2004/10/03 14:37:39-07:00 herbert@gondor.apana.org.au # [NET]: Remove neigh hash expansion into already locked section. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/core/neighbour.c # 2004/10/03 14:37:21-07:00 herbert@gondor.apana.org.au +3 -6 # [NET]: Remove neigh hash expansion into already locked section. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/03 22:34:46+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2119/1: S3C2410 - include/asm-arm/arch-s3c2410/regs-mem.h # # Patch from Ben Dooks # # Header file include/asm-arm/arch-s3c2410/regs-mem.h containing # definitions for the S3C2410 memory controller # # Signed-off-by: Ben Dooks # # include/asm-arm/arch-s3c2410/regs-mem.h # 2004/10/01 10:34:18+01:00 ben-linux@org.rmk.(none) +190 -0 # [PATCH] 2119/1: S3C2410 - include/asm-arm/arch-s3c2410/regs-mem.h # # include/asm-arm/arch-s3c2410/regs-mem.h # 2004/10/01 10:34:18+01:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-s3c2410/regs-mem.h # # ChangeSet # 2004/10/03 14:32:14-07:00 davem@nuts.davemloft.net # [TCP]: Rename tcp_skb_psize() to tcp_skb_mss(). # # On request from Herbert Xu. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_input.c # 2004/10/03 14:31:39-07:00 davem@nuts.davemloft.net +1 -1 # [TCP]: Rename tcp_skb_psize() to tcp_skb_mss(). # # include/net/tcp.h # 2004/10/03 14:31:39-07:00 davem@nuts.davemloft.net +1 -1 # [TCP]: Rename tcp_skb_psize() to tcp_skb_mss(). # # ChangeSet # 2004/10/03 14:30:28-07:00 davem@nuts.davemloft.net # [SPARC64]: Update defconfig. # # arch/sparc64/defconfig # 2004/10/03 14:30:07-07:00 davem@nuts.davemloft.net +4 -3 # [SPARC64]: Update defconfig. # # ChangeSet # 2004/10/03 14:30:01-07:00 davem@nuts.davemloft.net # [SPARC64]: Fix SI_TIMER conversion as ppc64 has. # # Signed-off-by: David S. Miller # # arch/sparc64/kernel/signal32.c # 2004/10/03 14:29:32-07:00 davem@nuts.davemloft.net +1 -1 # [SPARC64]: Fix SI_TIMER conversion as ppc64 has. # # ChangeSet # 2004/10/03 22:28:36+01:00 dave.jiang@com.rmk.(none) # [ARM PATCH] 2117/1: Fix ATU config on IQ80331 to prevent master aborts, replace 2099/1 # # Patch from Dave Jiang # # Latest IQ80331 redboot changed value of ATU registers and is causing master aborts on the plugged in card. Changing value back to previous sane state for Linux. # # Signed-off-by: Dave Jiang (dave.jiang@gmail.com) # # Patch in replacement of 2099/1 due to formatting problems. # # arch/arm/mach-iop3xx/iop331-pci.c # 2004/10/01 16:38:29+01:00 dave.jiang@com.rmk.(none) +4 -6 # [PATCH] 2117/1: Fix ATU config on IQ80331 to prevent master aborts, replace 2099/1 # # ChangeSet # 2004/10/03 14:26:22-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_diag.c # 2004/10/03 14:26:12-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # net/ipv4/tcp.c # 2004/10/03 14:26:12-07:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2004/10/03 22:20:42+01:00 rmk@flint.arm.linux.org.uk # [ARM] clk_* functions take frequencies in Hz not kHz # # include/asm-arm/hardware/clock.h # 2004/10/03 22:18:09+01:00 rmk@flint.arm.linux.org.uk +4 -4 # clk_* takes frequencies in Hz not kHz # # drivers/video/amba-clcd.c # 2004/10/03 22:18:09+01:00 rmk@flint.arm.linux.org.uk +1 -1 # clk_* takes frequencies in Hz not kHz # # arch/arm/mach-versatile/clock.c # 2004/10/03 22:18:09+01:00 rmk@flint.arm.linux.org.uk +2 -2 # clk_* takes frequencies in Hz not kHz # # arch/arm/mach-integrator/clock.c # 2004/10/03 22:18:09+01:00 rmk@flint.arm.linux.org.uk +6 -3 # clk_* takes frequencies in Hz not kHz # # ChangeSet # 2004/10/03 21:58:34+01:00 rmk@flint.arm.linux.org.uk # [ARM] Add POSIX message queue and waitid syscalls. # # include/asm-arm/unistd.h # 2004/10/03 21:56:25+01:00 rmk@flint.arm.linux.org.uk +7 -0 # Add __NR_mq_* and __NR_waitid # # arch/arm/kernel/calls.S # 2004/10/03 21:56:24+01:00 rmk@flint.arm.linux.org.uk +8 -1 # Add sys_mq_* and sys_waitid # # ChangeSet # 2004/10/03 21:46:48+01:00 rmk@flint.arm.linux.org.uk # [ARM] mach-types update. # # arch/arm/tools/mach-types # 2004/10/03 21:44:02+01:00 rmk@flint.arm.linux.org.uk +32 -3 # Update mach-types. # # ChangeSet # 2004/10/03 21:09:31+01:00 rmk@flint.arm.linux.org.uk # [ARM] Remove "%?" from within macros containing assembly. # # Some compilers seem to get "%?" wrong in macros. # # include/asm-arm/system.h # 2004/10/03 21:07:09+01:00 rmk@flint.arm.linux.org.uk +4 -2 # Some compilers seem to get "%?" wrong. Try to avoid it in macros # containing assembly. # # include/asm-arm/bitops.h # 2004/10/03 21:07:08+01:00 rmk@flint.arm.linux.org.uk +1 -1 # Some compilers seem to get "%?" wrong. Try to avoid it in macros # containing assembly. # # ChangeSet # 2004/10/03 20:46:58+01:00 rmk@flint.arm.linux.org.uk # [ARM] Check access permissions for whole of signal stack frame. # # We really need to check that we have access to the whole of the # signal frame when we allocate it, rather than "most of it" when # we have iWMMXt extensions selected. # # arch/arm/kernel/signal.c # 2004/10/03 20:44:11+01:00 rmk@flint.arm.linux.org.uk +12 -3 # Move access_ok check inside get_sigframe - get_sigframe knows the # real size of the signal stack frame. # # ChangeSet # 2004/10/03 20:36:58+01:00 rmk@flint.arm.linux.org.uk # [ARM] Fix consistent.c for DMA allocations. # # - Use ISA_DMA_THRESHOLD as the mask for GFP_DMA allocations. # - Don't allow DMA allocations which are for a "smaller" mask than # ISA_DMA_THRESHOLD. # - Ensure that "handle" is initialised to our error value when # returning an error. # # arch/arm/mm/consistent.c # 2004/10/03 20:34:13+01:00 rmk@flint.arm.linux.org.uk +23 -7 # Use ISA_DMA_THRESHOLD as the mask for GFP_DMA allocations. # Don't allow DMA allocations which are for a "smaller" mask than # ISA_DMA_THRESHOLD. # Ensure that "handle" is initialised to our error value when # returning an error. # # ChangeSet # 2004/10/03 20:13:48+01:00 rmk@flint.arm.linux.org.uk # [ARM] Add "noirqdebug" option to match x86 option. # # arch/arm/kernel/irq.c # 2004/10/03 20:11:35+01:00 rmk@flint.arm.linux.org.uk +10 -1 # Add "noirqdebug" option to turn off IRQ debugging. # # ChangeSet # 2004/10/03 19:57:03+01:00 rmk@flint.arm.linux.org.uk # [ARM] ecard.c locking and wait_event_interruptible() fix # # Add locking for use of kecardd services. # Use wait_event_interruptible() rather htan interruptible_sleep_on(). # # arch/arm/kernel/ecard.c # 2004/10/03 19:54:29+01:00 rmk@flint.arm.linux.org.uk +7 -12 # Add kecardd locking. # Use wait_event_interruptible() rather than interruptible_sleep_on() # # ChangeSet # 2004/10/03 20:44:53+02:00 kaber@coreworks.de # [VLAN]: Missing rtnl_unlock in register_vlan_device error path # # Signed-off-by: Patrick McHardy # # net/8021q/vlan.c # 2004/10/03 20:44:27+02:00 kaber@coreworks.de +1 -1 # [VLAN]: Missing rtnl_unlock in register_vlan_device error path # # Signed-off-by: Patrick McHardy # # ChangeSet # 2004/10/03 20:43:32+02:00 kaber@coreworks.de # [IPV6]: Fix free_netdev after failed alloc_netdev in sit_init # # Signed-off-by: Patrick McHardy # # net/ipv6/sit.c # 2004/10/03 20:43:09+02:00 kaber@coreworks.de +5 -4 # [IPV6]: Fix free_netdev after failed alloc_netdev in sit_init # # Signed-off-by: Patrick McHardy # # ChangeSet # 2004/10/03 20:42:17+02:00 kaber@coreworks.de # [IPV4]: Fix ipip_fb_tunnel_dev leak in ipip_fini # # Signed-off-by: Patrick McHardy # # net/ipv4/ipip.c # 2004/10/03 20:41:38+02:00 kaber@coreworks.de +1 -1 # [IPV4]: Fix ipip_fb_tunnel_dev leak in ipip_fini # # Signed-off-by: Patrick McHardy # # ChangeSet # 2004/10/03 20:41:00+02:00 kaber@coreworks.de # [IPV4]: Fix free_netdev after failed alloc_netdev in ipip_init # # Signed-off-by: Patrick McHardy # # net/ipv4/ipip.c # 2004/10/03 20:40:18+02:00 kaber@coreworks.de +5 -4 # [IPV4]: Fix free_netdev after failed alloc_netdev in ipip_init # # Signed-off-by: Patrick McHardy # # ChangeSet # 2004/10/03 20:39:25+02:00 kaber@coreworks.de # [IPV4]: Fix free_netdev after failed alloc_netdev in ipgre_init # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_gre.c # 2004/10/03 20:38:45+02:00 kaber@coreworks.de +6 -5 # [IPV4]: Fix free_netdev after failed alloc_netdev in ipgre_init # # Signed-off-by: Patrick McHardy # # ChangeSet # 2004/10/03 20:29:51+02:00 kaber@coreworks.de # [NET_SCHED]: Remove useless variable in tc_ctl_tfilter # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2004/10/03 20:29:23+02:00 kaber@coreworks.de +4 -4 # [NET_SCHED]: Remove useless variable in tc_ctl_tfilter # # Signed-off-by: Patrick McHardy # # ChangeSet # 2004/10/03 20:25:10+02:00 kaber@coreworks.de # [NET_SCHED]: Fix module leak in tc_ctl_tfilter error path # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2004/10/03 20:24:47+02:00 kaber@coreworks.de +6 -2 # [NET_SCHED]: Fix module leak in tc_ctl_tfilter error path # # Signed-off-by: Patrick McHardy # # ChangeSet # 2004/10/03 11:04:37-07:00 roland@topspin.com # [PATCH] ppc64: fix cross-compilation # # After the "ppc64 monster cleanup," I get # # powerpc-750-linux-gnu-strip: vmlinux: File format not recognized # # from my ppc32 strip command when cross-compiling a ppc64 kernel, since # vmlinux is a 64-bit ELF file. This patch fixes my build (and the # resulting kernel boots fine). # # Signed-off-by: Roland Dreier # Signed-off-by: Linus Torvalds # # arch/ppc64/boot/Makefile # 2004/10/03 10:23:50-07:00 roland@topspin.com +1 -2 # ppc64: fix cross-compilation # # ChangeSet # 2004/10/03 09:51:43-07:00 davidel@xmailserver.org # [PATCH] Avoid unnecessary copy for EPOLL_CTL_DEL # # Ulrich Drepper points out that EPOLL_CTL_DEL doesn't need to copy any of # the hash events. # # Also, we should specify in the man pages that a NULL is allowed in # EPOLL_CTL_DEL. Currently it does not say that. # # Also, starting from when epoll uses rbtrees instead of hashes, the # 'size' hint passed to epoll_create(2) is no more used. But since an API # change has clearly to be excluded, I guess it'll stay as is. # # Signed-off-by: Davide Libenzi # Signed-off-by: Linus Torvalds # # fs/eventpoll.c # 2004/10/03 09:02:27-07:00 davidel@xmailserver.org +5 -1 # Avoid unnecessary copy for EPOLL_CTL_DEL # # ChangeSet # 2004/10/03 09:51:31-07:00 jeffpc@optonline.net # [PATCH] Add DEVPATH env variable to hotplug helper call # # Add $DEVPATH to the environmental variables during /sbin/hotplug call. # # Signed-off-by: Josef 'Jeff' Sipek # Signed-off-by: Linus Torvalds # # kernel/cpu.c # 2004/09/24 10:08:57-07:00 jeffpc@optonline.net +4 -3 # Add DEVPATH env variable to hotplug helper call # # ChangeSet # 2004/10/03 09:51:20-07:00 jeffpc@optonline.net # [PATCH] Use proper sysfs mount-point in documentation # # Signed-off-by: Josef "Jeff" Sipek # Signed-off-by: Linus Torvalds # # Documentation/firmware_class/hotplug-script # 2004/09/24 10:08:57-07:00 jeffpc@optonline.net +2 -2 # Use proper sysfs mount-point in documentation # # ChangeSet # 2004/10/03 09:41:05-07:00 schwab@suse.de # [PATCH] Properly recognize PowerMac7,3 # # Make the PowerMac7,3 no longer unknown. # # Signed-off-by: Andreas Schwab # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/pmac_feature.c # 2004/10/03 05:17:03-07:00 schwab@suse.de +4 -0 # Properly recognize PowerMac7,3 # # ChangeSet # 2004/10/03 09:35:52-07:00 alan@lxorguk.ukuu.org.uk # [PATCH] usb: hcd locking fix # # Missing up() on an error path. # # Cc: Greg KH # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/usb/core/hcd.c # 2004/10/02 23:14:39-07:00 alan@lxorguk.ukuu.org.uk +1 -0 # usb: hcd locking fix # # ChangeSet # 2004/10/03 09:19:35-07:00 jonsmirl@gmail.com # [PATCH] document DRM ioctl use # # Document DRM's usage of 'd' as its ioctl identifier. This can't be # changed, it is in every X server. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/ioctl-number.txt # 2004/10/02 21:05:10-07:00 jonsmirl@gmail.com +1 -0 # document DRM ioctl use # # ChangeSet # 2004/10/03 09:19:23-07:00 ecashin@coraid.com # [PATCH] fix block layer ioctl bug # # If the blockdev doesn't implement BLKFLSBUF and returns -ENOTTY we should # still go ahead and perform the VFS-level sync. We need to test for both # ENOTTY and EINVAL because some SCSI drivers incorrectly return EINVAL. # # Signed-off-by: Ed L Cashin # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/block/ioctl.c # 2004/10/02 21:05:10-07:00 ecashin@coraid.com +2 -1 # fix block layer ioctl bug # # ChangeSet # 2004/10/03 09:19:11-07:00 rddunlap@osdl.org # [PATCH] doc: remove lingering PC-9800 param. # # Remove lingering PC-9800 doc. # # Signed-off-by: Randy Dunlap # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/kernel-parameters.txt # 2004/10/02 21:05:10-07:00 rddunlap@osdl.org +0 -3 # doc: remove lingering PC-9800 param. # # ChangeSet # 2004/10/03 09:18:59-07:00 janitor@sternwelten.at # [PATCH] msleep_interruptible(): fix whitespace # # thanks Xu for noticing, some whitespace found it's way there. # clean that up. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/timer.c # 2004/10/02 21:05:10-07:00 janitor@sternwelten.at +6 -6 # msleep_interruptible(): fix whitespace # # ChangeSet # 2004/10/03 09:18:47-07:00 alan@redhat.com # [PATCH] Fix up tty patch problem with pc300 and clean up braces # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/wan/pc300_tty.c # 2004/10/02 21:05:10-07:00 alan@redhat.com +9 -10 # Fix up tty patch problem with pc300 and clean up braces # # ChangeSet # 2004/10/03 09:18:35-07:00 alan@redhat.com # [PATCH] Fix Kconfig for EDD # # EDD fails with ACARD scsi devices present (hang on the 16bit bios call at # boot) # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/firmware/Kconfig # 2004/10/02 21:05:10-07:00 alan@redhat.com +3 -2 # Fix Kconfig for EDD # # ChangeSet # 2004/10/03 09:18:23-07:00 alan@redhat.com # [PATCH] scsi docs fix # # People have had a long time to change and be aware of the correct return. # Some drivers now generate the correct return too. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/scsi/scsi_mid_low_api.txt # 2004/10/02 21:05:10-07:00 alan@redhat.com +0 -4 # scsi docs fix # # ChangeSet # 2004/10/03 09:18:11-07:00 hugh@veritas.com # [PATCH] overcommit documentation fix # # Signed-off-by: Hugh Dickins # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/sysctl/vm.txt # 2004/10/02 21:05:09-07:00 hugh@veritas.com +1 -1 # overcommit documentation fix # # ChangeSet # 2004/10/03 09:17:59-07:00 dsaxena@plexity.net # [PATCH] Updated IXP4xx MTD driver from CVS (v1.6) # # Following patch updates the IXP4xx MTD driver with the latest # version from MTD CVS. # # Signed-Off-By: David Woodhouse # Signed-off-by: Deepak Saxena # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/mtd/maps/ixp4xx.c # 2004/10/02 21:05:09-07:00 dsaxena@plexity.net +20 -4 # Updated IXP4xx MTD driver from CVS (v1.6) # # ChangeSet # 2004/10/03 09:17:47-07:00 takata@linux-m32r.org # [PATCH] m32r: change to use temporary register variables # # I made a patch to upgrade some header files for m32r. # # - Change to use temporary register variables allocated by the compiler, # instead of fiexd register varialbes. # - Change __inline__ to inline. # # Signed-off-by: Hirokazu Takata # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-m32r/spinlock.h # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +105 -94 # m32r: change to use temporary register variables # # include/asm-m32r/semaphore.h # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +33 -85 # m32r: change to use temporary register variables # # include/asm-m32r/bitops.h # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +80 -76 # m32r: change to use temporary register variables # # ChangeSet # 2004/10/03 09:17:35-07:00 takata@linux-m32r.org # [PATCH] m32r: architecture upgrade on 20040928 # # Miscellaneous upgrade for recent m32r kernel changes. # # * arch/m32r/kernel/entry.S: # Add system calls; taken from asm-i386/unistd.h. # - [PATCH][2/6] perfctr-2.7.3 for 2.6.7-rc1-mm1: i386 (05/31/2004) # - [PATCH] Make key management use syscalls not prctls (09/06/2004) # # * arch/m32r/kernel/io_m32102.c: Remove. # This file is no longer used. Please remove this file. # # * arch/m32r/kernel/irq.c: # - Fix the unnecessary entropy call in the irq handler. # # * arch/m32r/kernel/signal.c: # - Merge common signal handling fault handling in generic code; # use force_sigsegv() instead of force_sig(). # # * arch/m32r/kernel/smp.c: # - Just add brackets. # # * include/asm-m32r/hardirq.h: # - factor out common code # # Signed-off-by: Hirokazu Takata # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-m32r/hardirq.h # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +5 -25 # m32r: architecture upgrade on 20040928 # # arch/m32r/kernel/smp.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +2 -1 # m32r: architecture upgrade on 20040928 # # arch/m32r/kernel/signal.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +2 -9 # m32r: architecture upgrade on 20040928 # # arch/m32r/kernel/irq.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +5 -3 # m32r: architecture upgrade on 20040928 # # arch/m32r/kernel/entry.S # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +10 -0 # m32r: architecture upgrade on 20040928 # # ChangeSet # 2004/10/03 09:17:24-07:00 takata@linux-m32r.org # [PATCH] m32r: update comments for Renesas # # Here is a patch to update comments for Renesas. # The M32R processor is a product of Renesas Technology Corporation now. # # * arch/m32r/kernel/setup.c: # - Change from "MITSUBISHI" to "Renesas" # - Remove RCS ID. # * arch/m32r/kernel/setup_m32700ut.c: ditto. # * arch/m32r/kernel/setup_mappi.c: ditto. # # * arch/m32r/kernel/setup_mappi2.c: # - Remove RCS ID. # * arch/m32r/kernel/setup_oaks32r.c: ditto. # * arch/m32r/kernel/setup_opsput.c: ditto. # * arch/m32r/kernel/setup_usrv.c: ditto. # # * include/asm-m32r/m32102.h: # - Add copyright statement of Renesas # - Remove RCS ID. # * include/asm-m32r/m32r.h: ditto. # * include/asm-m32r/m32r_mp_fpga.h: ditto. # # Signed-off-by: Hirokazu Takata # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-m32r/m32r_mp_fpga.h # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +4 -4 # m32r: update comments for Renesas # # include/asm-m32r/m32r.h # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +3 -4 # m32r: update comments for Renesas # # include/asm-m32r/m32102.h # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +4 -3 # m32r: update comments for Renesas # # arch/m32r/kernel/setup_usrv.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +0 -4 # m32r: update comments for Renesas # # arch/m32r/kernel/setup_opsput.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +0 -2 # m32r: update comments for Renesas # # arch/m32r/kernel/setup_oaks32r.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +0 -4 # m32r: update comments for Renesas # # arch/m32r/kernel/setup_mappi2.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +0 -4 # m32r: update comments for Renesas # # arch/m32r/kernel/setup_mappi.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +1 -5 # m32r: update comments for Renesas # # arch/m32r/kernel/setup_m32700ut.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +1 -3 # m32r: update comments for Renesas # # arch/m32r/kernel/setup.c # 2004/10/02 21:05:09-07:00 takata@linux-m32r.org +1 -1 # m32r: update comments for Renesas # # ChangeSet # 2004/10/03 09:17:12-07:00 yuasa@hh.iij4u.or.jp # [PATCH] mips: added interrupt control routines for vrc4173 # # This change had added interrupt control routines for vrc4173. # # Cc: Ralf Baechle # Signed-off-by: Yoichi Yuasa # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-mips/vr41xx/vrc4173.h # 2004/10/02 21:05:09-07:00 yuasa@hh.iij4u.or.jp +106 -0 # mips: added interrupt control routines for vrc4173 # # arch/mips/vr41xx/common/vrc4173.c # 2004/10/02 21:05:09-07:00 yuasa@hh.iij4u.or.jp +90 -0 # mips: added interrupt control routines for vrc4173 # # ChangeSet # 2004/10/03 09:17:00-07:00 yuasa@hh.iij4u.or.jp # [PATCH] mips: added CPU type checking to interrupt control routines # # This change had added CPU type checking to interrupt control routines. # # Cc: Ralf Baechle # Signed-off-by: Yoichi Yuasa # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/mips/vr41xx/common/icu.c # 2004/10/02 21:05:08-07:00 yuasa@hh.iij4u.or.jp +132 -82 # mips: added CPU type checking to interrupt control routines # # ChangeSet # 2004/10/03 09:16:48-07:00 nickpiggin@yahoo.com.au # [PATCH] vm: prevent kswapd pageout priority windup # # Now that we are correctly kicking off kswapd early (before the synch # reclaim watermark), it is really doing asynchronous pageout. This has # exposed a latent problem where allocators running at the same time will # make kswapd think it is getting into trouble, and cause too much swapping # and suboptimal behaviour. # # This patch changes the kswapd scanning algorithm to use the same metrics # for measuring pageout success as the synchronous reclaim path - namely, how # much work is required to free SWAP_CLUSTER_MAX pages. # # This should make things less fragile all round, and has the added benefit # that kswapd will continue running so long as memory is low and it is # managing to free pages, rather than going through the full priority loop, # then giving up. Should result in much better behaviour all round, # especially when there are concurrent allocators. # # akpm: the patch was confirmed to fix up the excessive swapout which Ray Bryant # has been reporting. # # Signed-off-by: Nick Piggin # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/vmscan.c # 2004/10/02 21:05:08-07:00 nickpiggin@yahoo.com.au +19 -2 # vm: prevent kswapd pageout priority windup # # ChangeSet # 2004/10/03 09:16:36-07:00 tpoynor@mvista.com # [PATCH] JFFS2 mount options discarded # # Yoann Vandoorselaere noticed an attempt to mount a JFFS2 filesystem # read-only mounts writeable instead. # # From: David Woodhouse # # and make it fix the memory leak on failure too: # # Signed-off-by: David Woodhouse # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/jffs2/super.c # 2004/10/02 21:05:08-07:00 tpoynor@mvista.com +3 -2 # JFFS2 mount options discarded # # ChangeSet # 2004/10/03 09:16:24-07:00 david@gibson.dropbear.id.au # [PATCH] ppc64: EEH checks mistakenly became no-ops # # Recent changes which removed the use of IO tokens for EEH enabled devices # had a bug, which mean we now never do EEH checks at all. # # This patch corrects the problem. # # Signed-off-by: David Gibson # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/eeh.h # 2004/10/02 21:04:59-07:00 david@gibson.dropbear.id.au +16 -31 # ppc64: EEH checks mistakenly became no-ops # # ChangeSet # 2004/10/03 09:16:12-07:00 david@gibson.dropbear.id.au # [PATCH] ppc64: squash childregs warnings # # Squash a couple of "pointer from integer" warnings recently introduced. # # Signed-off-by: David Gibson # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/sys_ppc32.c # 2004/10/02 21:04:59-07:00 david@gibson.dropbear.id.au +1 -1 # ppc64: squash childregs warnings # # arch/ppc64/kernel/process.c # 2004/10/02 21:04:59-07:00 david@gibson.dropbear.id.au +1 -1 # ppc64: squash childregs warnings # # ChangeSet # 2004/10/03 09:16:00-07:00 clameter@sgi.com # [PATCH] ppc: time interpolator build fix # # Remove two leftover #includes from timex.h which may cause a build failure # for ppc. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/timex.h # 2004/10/02 21:04:58-07:00 clameter@sgi.com +0 -2 # ppc: time interpolator build fix # # ChangeSet # 2004/10/03 09:15:48-07:00 linux@dominikbrodowski.de # [PATCH] cpufreq: ondemand: account iowait as idle time # # From: "Pallipadi, Venkatesh" # # This patch changes the idle time accounting in ondemand governor. # With this patch ondemand governor accounts cpu iowait time as idle time. # # Thanks to Stefan Seyfried for identifying this issue. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/cpufreq/cpufreq_ondemand.c # 2004/10/02 21:04:58-07:00 linux@dominikbrodowski.de +12 -7 # cpufreq: ondemand: account iowait as idle time # # ChangeSet # 2004/10/03 09:15:36-07:00 linux@dominikbrodowski.de # [PATCH] cpufreq: ondemand: prevent various divide underflows # # From: "Pallipadi, Venkatesh" # # Check for lower limit of latency / sampling rate, and fix divide # underflows. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/cpufreq/cpufreq_ondemand.c # 2004/10/02 21:37:15-07:00 linux@dominikbrodowski.de +19 -4 # cpufreq: ondemand: prevent various divide underflows # # ChangeSet # 2004/10/03 09:15:24-07:00 ak@suse.de # [PATCH] x86_64: Lindenhurst MSI build fix # # Fix the Lindenhurst MSI fix on x86-64 to compile again # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/smp.h # 2004/10/02 21:04:58-07:00 ak@suse.de +8 -0 # x86_64: Lindenhurst MSI build fix # # include/asm-x86_64/msi.h # 2004/10/02 21:04:58-07:00 ak@suse.de +2 -1 # x86_64: Lindenhurst MSI build fix # # ChangeSet # 2004/10/03 09:15:12-07:00 seife@suse.de # [PATCH] swsusp: fix highmem # # From: Pavel Machek # # This actually calls highmem_resume(), so swsusp has chance to work on # highmem machines. It also adds comments about code flow, which is quite # interesting at that point. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/power/swsusp.c # 2004/10/02 21:04:58-07:00 seife@suse.de +7 -0 # swsusp: fix highmem # # ChangeSet # 2004/10/03 09:15:00-07:00 akpm@osdl.org # [PATCH] sparc64: time interpolator build fix # # We need io.h for readq(). # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/timer.c # 2004/10/02 21:37:13-07:00 akpm@osdl.org +1 -0 # sparc64: time interpolator build fix # # ChangeSet # 2004/10/03 09:14:48-07:00 nickpiggin@yahoo.com.au # [PATCH] document isolcpus= boot option # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/kernel-parameters.txt # 2004/10/02 21:37:12-07:00 nickpiggin@yahoo.com.au +12 -0 # document isolcpus= boot option # # ChangeSet # 2004/10/03 09:14:36-07:00 mingo@elte.hu # [PATCH] random driver preempt robustness # # A certain codepath in the random driver relied on vt_ioctl() being under # the BKL and implicitly disabling preemption. The code wasn't buggy # upstream but it's slighly unrobust so I think we want the fix upstream too, # independently of the remove-bkl patch. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/char/random.c # 2004/10/02 21:04:58-07:00 mingo@elte.hu +4 -1 # random driver preempt robustness # # ChangeSet # 2004/10/03 09:14:25-07:00 prasanna@in.ibm.com # [PATCH] kprobes exception notifier fix # # This patch modifies the return value of kprobes exceptions notify handler. # The kprobes exception notifier returns NOTIFY_STOP on handling # notification. This patch helps other debuggers to co-exists with the # Kprobes. Other debuggers registered for exceptions notification must # return NOTIFY_STOP on handling the notification. # # Signed-off-by: Prasanna S Panchamukhi # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/kprobes.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +3 -0 # kprobes exception notifier fix # # include/linux/notifier.h # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +4 -0 # kprobes exception notifier fix # # arch/x86_64/kernel/traps.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +10 -6 # kprobes exception notifier fix # # arch/x86_64/kernel/nmi.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +2 -1 # kprobes exception notifier fix # # arch/sparc64/mm/fault.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +2 -2 # kprobes exception notifier fix # # arch/sparc64/kernel/traps.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +14 -14 # kprobes exception notifier fix # # arch/sparc64/kernel/kprobes.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +6 -6 # kprobes exception notifier fix # # arch/i386/mm/fault.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +1 -1 # kprobes exception notifier fix # # arch/i386/kernel/traps.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +6 -6 # kprobes exception notifier fix # # arch/i386/kernel/kprobes.c # 2004/10/02 21:04:57-07:00 prasanna@in.ibm.com +5 -5 # kprobes exception notifier fix # # ChangeSet # 2004/10/03 09:14:13-07:00 colin@colino.net # [PATCH] use kthread_stop in therm_adt746x # # Use kthread_stop() and kthread_should_stop() instead of monitor_running and # wait_completion(). # # Signed-off-by: Colin Leroy # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/macintosh/therm_adt746x.c # 2004/10/02 21:04:57-07:00 colin@colino.net +12 -13 # use kthread_stop in therm_adt746x # # ChangeSet # 2004/10/03 09:14:01-07:00 colin@colino.net # [PATCH] therm_adt746x: don't change loadavg # # Use interruptible sleep rather than uninterruptible. # # Partially convert it to the kthread API so the kernel thread doesn't get # accidentally signalled. # # Signed-off-by: Colin Leroy # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/macintosh/therm_adt746x.c # 2004/10/02 21:37:17-07:00 colin@colino.net +3 -9 # therm_adt746x: don't change loadavg # # ChangeSet # 2004/10/03 15:52:59+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2118/1: S3C2410 - gpio updates and header file fix # # Patch from Ben Dooks # # Fix missing changelog entries in , # and erroneous EINT definitions in . # # Added s3c2410_gpio_getcfg(pin) and s3c2410_gpio_getirq(pin) # to get the current configuration of an pin, and which IRQ # (if any) maps to it. # # Signed-off-by: Ben Dooks # # include/asm-arm/arch-s3c2410/regs-gpio.h # 2004/10/01 17:31:44+01:00 ben-linux@org.rmk.(none) +4 -4 # [PATCH] 2118/1: S3C2410 - gpio updates and header file fix # # include/asm-arm/arch-s3c2410/hardware.h # 2004/10/01 17:40:26+01:00 ben-linux@org.rmk.(none) +15 -0 # [PATCH] 2118/1: S3C2410 - gpio updates and header file fix # # arch/arm/mach-s3c2410/gpio.c # 2004/10/01 17:41:02+01:00 ben-linux@org.rmk.(none) +35 -1 # [PATCH] 2118/1: S3C2410 - gpio updates and header file fix # # ChangeSet # 2004/10/03 15:47:46+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2103/1: BAST - USB power control # # Patch from Ben Dooks # # USB power control and over-current sense # # Signed-off-by: Ben Dooks # # # arch/arm/mach-s3c2410/usb-simtec.h # 2004/09/12 10:46:19+01:00 ben-linux@org.rmk.(none) +19 -0 # [PATCH] 2103/1: BAST - USB power control # # arch/arm/mach-s3c2410/usb-simtec.h # 2004/09/12 10:46:19+01:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/mach-s3c2410/usb-simtec.h # # arch/arm/mach-s3c2410/mach-vr1000.c # 2004/09/12 11:36:19+01:00 ben-linux@org.rmk.(none) +3 -0 # [PATCH] 2103/1: BAST - USB power control # # arch/arm/mach-s3c2410/mach-bast.c # 2004/09/12 11:23:05+01:00 ben-linux@org.rmk.(none) +3 -0 # [PATCH] 2103/1: BAST - USB power control # # arch/arm/mach-s3c2410/Makefile # 2004/09/12 10:47:55+01:00 ben-linux@org.rmk.(none) +2 -2 # [PATCH] 2103/1: BAST - USB power control # # arch/arm/mach-s3c2410/usb-simtec.c # 2004/09/21 22:55:09+01:00 ben-linux@org.rmk.(none) +123 -0 # [PATCH] 2103/1: BAST - USB power control # # arch/arm/mach-s3c2410/usb-simtec.c # 2004/09/21 22:55:09+01:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/arch/arm/mach-s3c2410/usb-simtec.c # # ChangeSet # 2004/10/03 15:42:39+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2101/1: S3C2410 - usb port management # # Patch from Ben Dooks # # Port power control and management for S3C2410 internal # USB controller for different boards to interface their # power control system to. # # Signed-off-by: Ben Dooks # # # include/asm-arm/arch-s3c2410/usb-control.h # 2004/09/21 22:50:10+01:00 ben-linux@org.rmk.(none) +45 -0 # [PATCH] 2101/1: S3C2410 - usb port management # # include/asm-arm/arch-s3c2410/usb-control.h # 2004/09/21 22:50:10+01:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-s3c2410/usb-control.h # # ChangeSet # 2004/10/03 15:34:05+01:00 sascha@de.rmk.(none) # [ARM PATCH] 2095/1: i.MX time keeping # # Patch from Sascha Hauer # # This patch fixes the i.MX timer functions: # - imx_gettimeoffset() now returns proper values # - fix timer interrupt frequency # # Signed-off-by: Sascha Hauer # # arch/arm/mach-imx/time.c # 2004/09/16 15:07:23+01:00 sascha@de.rmk.(none) +3 -3 # [PATCH] 2095/1: i.MX time keeping # # ChangeSet # 2004/10/03 08:04:47+01:00 aia21@cantab.net # NTFS: Fix another stupid bug in fs/ntfs/attrib.c::ntfs_external_attr_find() # where we forgot to unmap the extent mft record when we had finished # enumerating an attribute which caused a bug check to trigger when the # VFS calls ->clear_inode. # # Signed-off-by: Anton Altaparmakov # # fs/ntfs/attrib.c # 2004/10/03 08:03:01+01:00 aia21@cantab.net +3 -1 # Fix another stupid bug in fs/ntfs/attrib.c::ntfs_external_attr_find() # where we forgot to unmap the extent mft record when we had finished # enumerating an attribute which caused a bug check to trigger when the # VFS calls ->clear_inode. # # fs/ntfs/ChangeLog # 2004/10/03 08:02:52+01:00 aia21@cantab.net +4 -0 # Update # # Documentation/filesystems/ntfs.txt # 2004/10/03 08:02:32+01:00 aia21@cantab.net +1 -1 # Update # # ChangeSet # 2004/10/02 18:33:53-07:00 torvalds@ppc970.osdl.org # tty locking fixups: remove unused "flags" variable # # It became obsolete when the termios locking was changed # to use a per-tty semaphore. # # drivers/char/tty_ioctl.c # 2004/10/02 18:33:47-07:00 torvalds@ppc970.osdl.org +0 -1 # tty locking fixups: remove unused "flags" variable # # It became obsolete when the termios locking was changed # to use a per-tty semaphore. # # ChangeSet # 2004/10/02 17:57:48-07:00 benh@kernel.crashing.org # [PATCH] Fix booting on some recent G5s # # Some recent G5s have a problem with PCI/HT probing. They crash (machine # check) during the probe of some slot numbers, it seems to be related to # some functions beeing disabled by the firmware inside the K2 ASIC. # # This patch limits the config space accesses to devices that are present # in the OF device-tree. This fixes the problem and shouldn't "add" any # limitation. If you plug a "random" PCI card with no OF driver, the # firmware will still build a node for it with the default set of # properties created from the config space. # # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/pmac_pci.c # 2004/08/03 17:26:07-07:00 benh@kernel.crashing.org +11 -1 # Fix booting on some recent G5s # # arch/ppc/platforms/pmac_pci.c # 2004/08/16 21:18:09-07:00 benh@kernel.crashing.org +7 -0 # Fix booting on some recent G5s # # ChangeSet # 2004/10/03 01:08:14+01:00 aia21@cantab.net # NTFS: Fix stupid bug in fs/ntfs/attrib.c::ntfs_attr_reinit_search_ctx() where # we did not clear ctx->al_entry but it was still set due to changes in # ntfs_attr_lookup() and ntfs_external_attr_find() in particular. # # Signed-off-by: Anton Altaparmakov # # Documentation/filesystems/ntfs.txt # 2004/10/03 01:06:43+01:00 aia21@cantab.net +2 -0 # Update # # fs/ntfs/Makefile # 2004/10/03 01:04:37+01:00 aia21@cantab.net +1 -1 # Update # # fs/ntfs/ChangeLog # 2004/10/03 01:04:24+01:00 aia21@cantab.net +7 -0 # Update # # fs/ntfs/attrib.c # 2004/10/03 01:01:52+01:00 aia21@cantab.net +5 -0 # Fix stupid bug in ntfs_attr_reinit_search_ctx() where we # didn't clear ctx->al_entry but it was still set due to # changes in ntfs_attr_lookup() and ntfs_external_attr_find() # in particular. # # ChangeSet # 2004/10/02 15:54:05-07:00 torvalds@ppc970.osdl.org # Fix close() vs posix lock race # # A threaded app that posix-locks and closes the same file # in two threads concurrently may result in a posix lock # that was never visible to the closer, and that thus needs # cleanup on the final fput. # # Handle it together with the regular flocks. # # fs/locks.c # 2004/10/02 15:53:59-07:00 torvalds@ppc970.osdl.org +7 -4 # Fix close() vs posix lock race # # A threaded app that posix-locks and closes the same file # in two threads concurrently may result in a posix lock # that was never visible to the closer, and that thus needs # cleanup on the final fput. # # Handle it together with the regular flocks. # # ChangeSet # 2004/10/02 15:46:35-07:00 alan@lxorguk.ukuu.org.uk # [PATCH] Update termios to use per tty semaphore # # This makes the agreed change of termios locking to be semaphore based # sleep locking. This is needed for USB in particular as it has to use # messaging to issue terminal mode changes. # # This code passes Torvalds test grades 0, 1 and 2 (it looks ok, it # compiles and it booted). It does mean that a driver cannot take an # atomic peek at termios data during an interrupt. Nobody seems to be # doing this although some of the driver receive paths for line # disciplines will eventually want to (n_tty currently doesn't do this # locked on the receive path). Since the ldisc is given a chance to copy # any essential bits on the ->set_termios path this seems not to be a # problem. # # include/linux/tty.h # 2004/10/02 15:45:22-07:00 alan@lxorguk.ukuu.org.uk +1 -0 # Update termios to use per tty semaphore # # drivers/char/tty_ioctl.c # 2004/10/02 15:45:19-07:00 alan@lxorguk.ukuu.org.uk +9 -20 # Update termios to use per tty semaphore # # drivers/char/tty_io.c # 2004/10/02 15:45:19-07:00 alan@lxorguk.ukuu.org.uk +5 -8 # Update termios to use per tty semaphore # # Documentation/tty.txt # 2004/10/02 15:45:19-07:00 alan@lxorguk.ukuu.org.uk +4 -4 # Update termios to use per tty semaphore # # ChangeSet # 2004/10/02 12:09:43-07:00 torvalds@ppc970.osdl.org # Partially undo Alan's recent tty locking fixes: the termios # lock must not be held across the driver/ldisc downcalls. # # Some drivers need to set device state (baudrate etc) and may # need to sleep. # # drivers/char/tty_ioctl.c # 2004/10/02 12:09:36-07:00 torvalds@ppc970.osdl.org +7 -1 # Partially undo Alan's recent tty locking fixes: the termios # lock must not be held across the driver/ldisc downcalls. # # Some drivers need to set device state (baudrate etc) and may # need to sleep. # # ChangeSet # 2004/10/02 10:59:55-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] Race with iput and umount # # Jeff Mahoney notes: # # "generic_shutdown_super() will happily call the ->put_super fs method, # destroying data structures still in use by the iput (->delete_inode) # in progress. # # The unlink path will call the ->unlink fs method, release the path # (thus dropping the reference to the vfsmount, and then call iput. # Since the vfsmount reference is dropped back to 1, a umount will # succeed, causing the superblock to be cleaned up." # # Arrgh... Here's the trivial fix: do the final "iput()" a bit earlier in # the unlink path. # # Note: all places that go to exit1: or exit: will have NULL inode, so we # are not leaking anything here and it is OK do that iput() early; indeed, # the goal of that kludge was to postpone the final iput() past the # unlocking the parent for the sake of contention if a wunch of bankers is # doing parallel unlink() on files in the same directory and normally it # would happen on dput() after vfs_unlink()) # # fs/namei.c # 2004/10/01 22:48:21-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -3 # Race with iput and umount # # ChangeSet # 2004/10/01 16:34:56-07:00 chrisw@osdl.org # [PATCH] mlockall() take mmap_sem a bit later # # In sys_mlockall(), flags validation and can_do_mlock() check don't # require holding mmap_sem. Move down_write() down a bit, and adjust # appropriately. # # Signed-off-by: Chris Wright # Signed-off-by: Linus Torvalds # # mm/mlock.c # 2004/09/29 00:22:26-07:00 chrisw@osdl.org +4 -3 # mlockall() take mmap_sem a bit later # # ChangeSet # 2004/10/01 16:34:43-07:00 chrisw@osdl.org # [PATCH] make can_do_mlock useful for mlock/mlockall # # Move the simple can_do_mlock() check before the full rlimits based # restriction checks for mlock() and mlockall(). As it is, the check # adds nothing. This has a side-effect of eliminating an unnecessary call # to can_do_mlock() on the munlockall() path. # # Signed-off-by: Chris Wright # Signed-off-by: Linus Torvalds # # mm/mlock.c # 2004/09/28 15:08:56-07:00 chrisw@osdl.org +8 -7 # make can_do_mlock useful for mlock/mlockall # # ChangeSet # 2004/10/01 16:34:31-07:00 chrisw@osdl.org # [PATCH] mlockall() check rlimit only when MCL_CURRENT is set # # Only check memlock rlimit against mm->total_vm when mlockall() flags # include MCL_CURRENT. # # Signed-off-by: Chris Wright # Signed-off-by: Linus Torvalds # # mm/mlock.c # 2004/09/28 15:03:35-07:00 chrisw@osdl.org +2 -1 # mlockall() check rlimit only when MCL_CURRENT is set # # ChangeSet # 2004/10/01 16:34:18-07:00 chrisw@osdl.org # [PATCH] mlockall(MCL_FUTURE) unlocks currently locked mappings # # Calling mlockall(MCL_FUTURE) will erroneously unlock any currently locked # mappings. Fix this up, and while we're at it, remove the essentially # unused error variable. # # Signed-off-by: Chris Wright # Signed-off-by: Linus Torvalds # # mm/mlock.c # 2004/09/28 15:27:02-07:00 chrisw@osdl.org +4 -3 # mlockall(MCL_FUTURE) unlocks currently locked mappings # # ChangeSet # 2004/10/01 15:27:36-07:00 trini@kernel.crashing.org # Merge bk://bkbits.246tNt.com/linux-2.5-mpc52xx-pending # into kernel.crashing.org:/home/trini/work/kernel/pristine/for-linus-ppc # # MAINTAINERS # 2004/10/01 15:27:31-07:00 trini@kernel.crashing.org +0 -0 # Auto merged # # ChangeSet # 2004/10/01 15:11:57-07:00 laforge@netfilter.org # [NETFILTER]: Fix NAT helper handling of TCP window tracking info. # # Fix NAT helper code to update TCP window tracking information # if it resizes payload (and thus alrers sequence numbers). # # This patchlet was somehow lost during 2.4.x->2.6.x port of TCP # window tracking :( # # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_nat_helper.c # 2004/10/01 15:11:39-07:00 laforge@netfilter.org +7 -2 # [NETFILTER]: Fix NAT helper handling of TCP window tracking info. # # Fix NAT helper code to update TCP window tracking information # if it resizes payload (and thus alrers sequence numbers). # # This patchlet was somehow lost during 2.4.x->2.6.x port of TCP # window tracking :( # # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/01 15:03:41-07:00 Alexander.Stohr@gmx.de # [SPARC64]: Fix solaris emul __set_utsfield offset calculation. # # Signed-off-by: David S. Miller # # arch/sparc64/solaris/misc.c # 2004/10/01 15:03:24-07:00 Alexander.Stohr@gmx.de +3 -3 # [SPARC64]: Fix solaris emul __set_utsfield offset calculation. # # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/01 15:01:32-07:00 yasuyuki.kozakai@toshiba.co.jp # [IPV6]: Fix ntohs() --> htons() typo in reassembly.c # # Signed-off-by: Yasuyuki KOZAKAI # Signed-off-by: David S. Miller # # net/ipv6/reassembly.c # 2004/10/01 15:01:14-07:00 yasuyuki.kozakai@toshiba.co.jp +1 -1 # [IPV6]: Fix ntohs() --> htons() typo in reassembly.c # # Signed-off-by: Yasuyuki KOZAKAI # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/01 14:58:40-07:00 yoshfuji@linux-ipv6.org # [IPV6]: NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries. # # Signed-off-by: Hideaki YOSHIFUJI # Signed-off-by: David S. Miller # # net/core/neighbour.c # 2004/10/01 14:58:21-07:00 yoshfuji@linux-ipv6.org +8 -0 # [IPV6]: NEIGHBOUR: hold refcnt of net_device from proxy neighbor entries. # # Signed-off-by: Hideaki YOSHIFUJI # Signed-off-by: David S. Miller # # ChangeSet # 2004/10/01 14:50:39-07:00 davem@nuts.davemloft.net # [ATM]: Use neigh_table_{init,clear}() in clip.c # # Signed-off-by: David S. Miller # # net/atm/clip.c # 2004/10/01 14:50:07-07:00 davem@nuts.davemloft.net +14 -15 # [ATM]: Use neigh_table_{init,clear}() in clip.c # # ChangeSet # 2004/10/01 20:00:34+02:00 bzolnier@trik.(none) # [ide] Simtec BAST (EB2410ITX) / Thorcom VR1000 driver # # Patch to provide support for the following two boards: # # - Simtec BAST (EB2410ITX) # - Thorcom VR1000 # # Signed-off-by: Ben Dooks # Signed-off-by: Bartlomiej Zolnierkiewicz # # drivers/ide/arm/bast-ide.c # 2004/10/01 20:00:20+02:00 bzolnier@trik.(none) +71 -0 # [ide] Simtec BAST (EB2410ITX) / Thorcom VR1000 driver # # drivers/ide/arm/Makefile # 2004/10/01 20:00:20+02:00 bzolnier@trik.(none) +1 -0 # [ide] Simtec BAST (EB2410ITX) / Thorcom VR1000 driver # # drivers/ide/Kconfig # 2004/10/01 20:00:20+02:00 bzolnier@trik.(none) +7 -0 # [ide] Simtec BAST (EB2410ITX) / Thorcom VR1000 driver # # drivers/ide/arm/bast-ide.c # 2004/10/01 20:00:20+02:00 bzolnier@trik.(none) +0 -0 # BitKeeper file /home/bzolnier/bk/tmp-2.6/drivers/ide/arm/bast-ide.c # # ChangeSet # 2004/10/01 19:58:49+02:00 bzolnier@trik.(none) # [ide] piix: fix wrong DMA mode selected # # From: Carsten Haustein # # A bug in function piix_config_drive_xfer_rate() allows a call of # hwif->ide_dma_on(drive) without prior call of piix_config_drive_for_dma(). # This results in harddisk configured for UDMA (default?) whereas the highest # DMA mode supported by PIIX3 is MWORD2. # # This bug is supposed to be present in any 2.6.x kernel release and any # 2.4.x kernel release since 2.4.21. # # bart: this should also fix the same bug for PIIXa and PIIXb # # Fixes bugzilla bug #3473. # # Signed-off-by: Bartlomiej Zolnierkiewicz # # drivers/ide/pci/piix.c # 2004/10/01 19:58:41+02:00 bzolnier@trik.(none) +19 -24 # [ide] piix: fix wrong DMA mode selected # # ChangeSet # 2004/10/01 19:58:27+02:00 bzolnier@trik.(none) # [ide] aec62xx: remove dead DEBUG_AEC_REGS code # # Signed-off-by: Bartlomiej Zolnierkiewicz # # drivers/ide/pci/aec62xx.h # 2004/10/01 19:58:05+02:00 bzolnier@trik.(none) +0 -7 # [ide] aec62xx: remove dead DEBUG_AEC_REGS code # # drivers/ide/pci/aec62xx.c # 2004/10/01 19:58:05+02:00 bzolnier@trik.(none) +2 -45 # [ide] aec62xx: remove dead DEBUG_AEC_REGS code # # ChangeSet # 2004/10/01 19:57:32+02:00 bzolnier@trik.(none) # [ide] remove stale comment from ide-proc.c # # ide-default driver was added long time ago. # # Signed-off-by: Bartlomiej Zolnierkiewicz # # drivers/ide/ide-proc.c # 2004/10/01 19:57:06+02:00 bzolnier@trik.(none) +6 -19 # [ide] remove stale comment from ide-proc.c # # ChangeSet # 2004/10/01 19:56:49+02:00 bzolnier@trik.(none) # [ide] remove dead debugging code from ide-taskfile.c # # - CONFIG_IDE_TASK_IOCTL_DEBUG cannot be defined # - function declarations are used instead of calls # # Signed-off-by: Bartlomiej Zolnierkiewicz # # drivers/ide/ide-taskfile.c # 2004/10/01 19:56:37+02:00 bzolnier@trik.(none) +0 -33 # [ide] remove dead debugging code from ide-taskfile.c # # ChangeSet # 2004/10/01 19:56:04+02:00 bzolnier@trik.(none) # [ide] remove dead CMD640 debugging from ide-probe.c # # Signed-off-by: Bartlomiej Zolnierkiewicz # # include/linux/ide.h # 2004/10/01 19:55:47+02:00 bzolnier@trik.(none) +0 -7 # [ide] remove dead CMD640 debugging from ide-probe.c # # drivers/ide/pci/cmd640.c # 2004/10/01 19:55:47+02:00 bzolnier@trik.(none) +4 -2 # [ide] remove dead CMD640 debugging from ide-probe.c # # drivers/ide/ide-probe.c # 2004/10/01 19:55:47+02:00 bzolnier@trik.(none) +0 -9 # [ide] remove dead CMD640 debugging from ide-probe.c # # ChangeSet # 2004/10/01 19:54:54+02:00 bzolnier@trik.(none) # [ide] triflex: kill /proc/ide/triflex # # Fixes OOPS on two single channel controllers. # # Signed-off-by: Bartlomiej Zolnierkiewicz # # drivers/ide/pci/triflex.c # 2004/10/01 19:54:41+02:00 bzolnier@trik.(none) +0 -62 # [ide] triflex: kill /proc/ide/triflex # # ChangeSet # 2004/10/01 08:08:23-07:00 david@gibson.dropbear.id.au # [PATCH] ppc64: change bad choice of VSID_MULTIPLIER # # We recently changed the VSID allocation on PPC64 to use a new scheme # based on a multiplicative hash. It turns out our choice of multiplier # (the largest 28-bit prime) wasn't so great: with large contiguous # mappings, we can get very poor hash scattering. In particular earlier # machines (without 16M pages) which had a reasonable about of RAM (>2G # or so) wouldn't boot, because the linear mapping overflowed some hash # buckets. # # This patch changes the multiplier to something which seems to work # better (it is, rather arbitrarily, the median of the primes between # 2^27 and 2^28). Some more theory should almost certainly go into the # choice of this constant, to avoid more pathological cases. But for # now, this choice fixes a serious bug, and seems to do at least as well # at scattering as the old choice on a handful of simple testcases. # # Signed-off-by: David Gibson # Signed-off-by: Linus Torvalds # # include/asm-ppc64/mmu_context.h # 2004/10/01 01:28:02-07:00 david@gibson.dropbear.id.au +4 -5 # ppc64: change bad choice of VSID_MULTIPLIER # # include/asm-ppc64/mmu.h # 2004/10/01 01:28:02-07:00 david@gibson.dropbear.id.au +1 -1 # ppc64: change bad choice of VSID_MULTIPLIER # # arch/ppc64/kernel/head.S # 2004/10/01 01:34:49-07:00 david@gibson.dropbear.id.au +3 -3 # ppc64: change bad choice of VSID_MULTIPLIER # # ChangeSet # 2004/10/01 08:04:06-07:00 geert@linux-m68k.org # [PATCH] fix up tty fall-out # # The two patches below (compile)fix some fall-out from the tty cleanups. # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: Linus Torvalds # # drivers/char/moxa.c # 2004/10/01 03:43:17-07:00 geert@linux-m68k.org +2 -2 # fix up tty fall-out # # drivers/char/generic_serial.c # 2004/10/01 03:47:40-07:00 geert@linux-m68k.org +1 -1 # fix up tty fall-out # # ChangeSet # 2004/10/01 14:52:48+01:00 rmk@flint.arm.linux.org.uk # [PCMCIA] replace schedule_timeout() with msleep() # # From: # # Remove unnecessary cs_to_timeout() macro. Use msleep() instead of # schedule_timeout() to guarantee the task delays for the desired # time. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Maximilian Attems # Signed-off-by: Andrew Morton # Signed-off-by: Russell King # # drivers/pcmcia/sa1100_h3600.c # 2004/10/01 14:49:42+01:00 rmk@flint.arm.linux.org.uk +2 -2 # [PATCH] replace schedule_timeout() with msleep() # # drivers/pcmcia/i82365.c # 2004/10/01 14:49:41+01:00 rmk@flint.arm.linux.org.uk +1 -2 # [PATCH] replace schedule_timeout() with msleep() # # drivers/pcmcia/ds.c # 2004/10/01 14:49:41+01:00 rmk@flint.arm.linux.org.uk +2 -2 # [PATCH] replace schedule_timeout() with msleep() # # drivers/pcmcia/cs.c # 2004/10/01 14:49:41+01:00 rmk@flint.arm.linux.org.uk +8 -18 # [PATCH] replace schedule_timeout() with msleep() # # ChangeSet # 2004/10/01 13:37:13+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2116/1: S3C2410 - s3c2410_gpio_cfgpin() mask bug # # Patch from Ben Dooks # # Fixed bug where wrong bits where being masked in the # configuration registers for the GPIO pins # # Signed-off-by: Ben Dooks # # arch/arm/mach-s3c2410/gpio.c # 2004/09/30 18:40:57+01:00 ben-linux@org.rmk.(none) +7 -9 # [PATCH] 2116/1: S3C2410 - s3c2410_gpio_cfgpin() mask bug # # ChangeSet # 2004/10/01 13:11:37+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2102/1: BAST - incorrect IRQ for USB overcurrent # # Patch from Ben Dooks # # Fix IRQ number for USB over-current on Simtec BAST # # Signed-off-by: Ben Dooks # # # include/asm-arm/arch-s3c2410/bast-irq.h # 2004/09/12 11:06:40+01:00 ben-linux@org.rmk.(none) +2 -1 # [PATCH] 2102/1: BAST - incorrect IRQ for USB overcurrent # # ChangeSet # 2004/10/01 12:46:48+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2107/1: BAST - additional serial port fixes # # Patch from Ben Dooks # # Added code to remove the serial ports registered when # the module is unloaded. # # Cleaned up ifdef'd code, and added copyright header # # Signed-off-by: Ben Dooks # # # drivers/serial/bast_sio.c # 2004/09/23 23:57:19+01:00 ben-linux@org.rmk.(none) +24 -7 # [PATCH] 2107/1: BAST - additional serial port fixes # # ChangeSet # 2004/10/01 12:37:59+01:00 catalin.marinas@com.rmk.(none) # [ARM PATCH] 2106/1: Remove the "write" assumption for Jazelle in the early_abort handler # # Patch from Catalin Marinas # # On ARM926EJ-S, the "always assume write" for Jazelle data aborts # causes Java code exit with segmentation fault every time it tries # to access a read-only page. This patch puts some restrictions on what # can be done in the Jazelle state but it allows it to run. # # Signed-off-by: Catalin Marinas # # arch/arm/mm/abort-ev5tj.S # 2004/09/15 10:41:36+01:00 catalin.marinas@com.rmk.(none) +0 -1 # [PATCH] 2106/1: Remove the "write" assumption for Jazelle in the early_abort handler # # ChangeSet # 2004/09/30 21:28:12-07:00 torvalds@evo.osdl.org # Fix up and type-annotate sis fb driver # # Some dual use type errors still exist, where the # bios mapping is type-confused. # # drivers/video/sis/sis_main.h # 2004/09/30 21:28:02-07:00 torvalds@evo.osdl.org +1 -1 # Fix up and type-annotate sis fb driver # # Some dual use type errors still exist, where the # bios mapping is type-confused. # # drivers/video/sis/sis_main.c # 2004/09/30 21:28:02-07:00 torvalds@evo.osdl.org +22 -21 # Fix up and type-annotate sis fb driver # # Some dual use type errors still exist, where the # bios mapping is type-confused. # # drivers/video/sis/sis.h # 2004/09/30 21:28:02-07:00 torvalds@evo.osdl.org +7 -7 # Fix up and type-annotate sis fb driver # # Some dual use type errors still exist, where the # bios mapping is type-confused. # # ChangeSet # 2004/09/30 20:58:53-07:00 davem@nuts.davemloft.net # [TCP]: Kill tso_{factor,mss}. # # We can just use skb_shinfo(skb)->tso_{segs,size} # directly. This also allows us to kill the # hack zone code in ip_output.c # # The original impetus for thus change was a problem # noted by John Heffner. We do not abide by the MSS # of the connection for TCP segmentation, we were using # the path MTU instead. This broke various local # network setups with TSO enabled and is fixed as a side # effect of these changes. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_output.c # 2004/09/30 20:56:45-07:00 davem@nuts.davemloft.net +30 -28 # [TCP]: Kill tso_{factor,mss}. # # net/ipv4/tcp_input.c # 2004/09/30 20:56:45-07:00 davem@nuts.davemloft.net +7 -7 # [TCP]: Kill tso_{factor,mss}. # # net/ipv4/tcp.c # 2004/09/30 20:56:45-07:00 davem@nuts.davemloft.net +2 -2 # [TCP]: Kill tso_{factor,mss}. # # net/ipv4/ip_output.c # 2004/09/30 20:56:45-07:00 davem@nuts.davemloft.net +1 -14 # [TCP]: Kill tso_{factor,mss}. # # include/net/tcp.h # 2004/09/30 20:56:45-07:00 davem@nuts.davemloft.net +11 -7 # [TCP]: Kill tso_{factor,mss}. # # ChangeSet # 2004/09/30 20:09:28-07:00 davem@nuts.davemloft.net # [TCP]: Add tcp_tso_win_divisor sysctl. # # This allows control over what percentage of # the congestion window can be consumed by a # single TSO frame. # # The setting of this parameter is a choice # between burstiness and building larger TSO # frames. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_output.c # 2004/09/30 20:07:20-07:00 davem@nuts.davemloft.net +19 -7 # [TCP]: Add tcp_tso_win_divisor sysctl. # # net/ipv4/sysctl_net_ipv4.c # 2004/09/30 20:07:20-07:00 davem@nuts.davemloft.net +8 -0 # [TCP]: Add tcp_tso_win_divisor sysctl. # # include/net/tcp.h # 2004/09/30 20:07:20-07:00 davem@nuts.davemloft.net +1 -0 # [TCP]: Add tcp_tso_win_divisor sysctl. # # include/linux/sysctl.h # 2004/09/30 20:07:20-07:00 davem@nuts.davemloft.net +1 -0 # [TCP]: Add tcp_tso_win_divisor sysctl. # # ChangeSet # 2004/09/30 19:58:07-07:00 torvalds@evo.osdl.org # Do trivial __iomem annotations for tridentfb.c # # A few one-liners removed hundreds of lines of warnings. # The driver was clean, just not using the proper types. # # drivers/video/tridentfb.c # 2004/09/30 19:57:57-07:00 torvalds@evo.osdl.org +4 -4 # Do trivial __iomem annotations for tridentfb.c # # A few one-liners removed hundreds of lines of warnings. # The driver was clean, just not using the proper types. # # ChangeSet # 2004/09/30 22:57:11-04:00 alan@redhat.com # [PATCH] 3c59x: add invalid MAC address check # # drivers/net/3c59x.c # 2004/09/29 12:56:53-04:00 alan@redhat.com +7 -0 # 3c59x: add invalid MAC address check # # ChangeSet # 2004/09/30 19:54:59-07:00 torvalds@evo.osdl.org # Fix up MMIO pointer types and add __iomem annotations to radeonfb.c # # It was almost correct, apart from some silly details. # # The x86 ROM probing is still wrong, and doesn't use the proper # PCI MMIO accessor functions. Sparse (correctly) warns about # it. # # drivers/video/radeonfb.c # 2004/09/30 19:54:50-07:00 torvalds@evo.osdl.org +22 -22 # Fix up MMIO pointer types and add __iomem annotations to radeonfb.c # # ChangeSet # 2004/09/30 19:44:19-07:00 torvalds@evo.osdl.org # Remove casts and add __iomem annotations to gdth driver # # drivers/scsi/gdth.h # 2004/09/30 19:44:10-07:00 torvalds@evo.osdl.org +1 -1 # Remove casts and add __iomem annotations to gdth driver # # drivers/scsi/gdth.c # 2004/09/30 19:44:10-07:00 torvalds@evo.osdl.org +59 -58 # Remove casts and add __iomem annotations to gdth driver # # ChangeSet # 2004/09/30 18:35:01-07:00 torvalds@evo.osdl.org # Fix cyclades driver types, and add __iomem annotations. # # Remove absolutely tons of totally unnecessary casts, # once the types are done right in the first place. # # The driver is still ugly as hell and needs some serious # indentation fixing, but this makes it not spew hundreds # of warnings any more. # # include/linux/cyclades.h # 2004/09/30 18:34:52-07:00 torvalds@evo.osdl.org +5 -5 # Fix cyclades driver types, and add __iomem annotations. # # Remove absolutely tons of totally unnecessary casts, # once the types are done right in the first place. # # The driver is still ugly as hell and needs some serious # indentation fixing, but this makes it not spew hundreds # of warnings any more. # # drivers/char/cyclades.c # 2004/09/30 18:34:52-07:00 torvalds@evo.osdl.org +286 -350 # Fix cyclades driver types, and add __iomem annotations. # # Remove absolutely tons of totally unnecessary casts, # once the types are done right in the first place. # # The driver is still ugly as hell and needs some serious # indentation fixing, but this makes it not spew hundreds # of warnings any more. # # ChangeSet # 2004/09/30 17:04:11-07:00 greg@kroah.com # [PATCH] USB: remove FIXME created from tty core changes in empeg driver. # # Signed-off-by: Greg Kroah-Hartman # Signed-off-by: Linus Torvalds # # drivers/usb/serial/empeg.c # 2004/09/30 16:51:44-07:00 greg@kroah.com +0 -6 # USB: remove FIXME created from tty core changes in empeg driver. # # ChangeSet # 2004/09/30 17:03:59-07:00 greg@kroah.com # [PATCH] USB: fix error in bluetty.c driver caused by tty core changes # # Signed-off-by: Greg Kroah-Hartman # Signed-off-by: Linus Torvalds # # drivers/usb/class/bluetty.c # 2004/09/30 16:51:38-07:00 greg@kroah.com +1 -2 # USB: fix error in bluetty.c driver caused by tty core changes # # ChangeSet # 2004/09/30 16:23:12-07:00 torvalds@ppc970.osdl.org # The hpet acpi driver is not __initdata. # # We register it with the ACPI layer, and it's alive long # after init. # # Noted by Bjorn Helgaas. # # drivers/char/hpet.c # 2004/09/30 16:23:05-07:00 torvalds@ppc970.osdl.org +1 -1 # The hpet acpi driver is not __initdata. # # We register it with the ACPI layer, and it's alive long # after init. # # Noted by Bjorn Helgaas. # # ChangeSet # 2004/09/30 15:49:36-07:00 davem@nuts.davemloft.net # [SUNGEM]: Fix build. # # drivers/net/sungem.c # 2004/09/30 15:49:15-07:00 davem@nuts.davemloft.net +3 -3 # [SUNGEM]: Fix build. # # ChangeSet # 2004/09/30 14:18:32-07:00 torvalds@ppc970.osdl.org # Wisdom passed down the ages on clay tablets. # # Only recently digitized for our edification. # # Documentation/ManagementStyle # 2004/09/30 14:18:25-07:00 torvalds@ppc970.osdl.org +276 -0 # Wisdom passed down the ages on clay tablets. # # Documentation/ManagementStyle # 2004/09/30 14:18:25-07:00 torvalds@ppc970.osdl.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/Documentation/ManagementStyle # # ChangeSet # 2004/09/30 12:42:29-07:00 davem@nuts.davemloft.net # [TCP]: Check correct sequence number for URG in tcp_tso_acked(). # # Noticed by Herbert Xu. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_input.c # 2004/09/30 12:41:57-07:00 davem@nuts.davemloft.net +1 -1 # [TCP]: Check correct sequence number for URG in tcp_tso_acked(). # # ChangeSet # 2004/09/30 12:31:23-07:00 davem@nuts.davemloft.net # [SUNGEM]: Do not need two implementations of poll_controller, hehe. # # Signed-off-by: David S. Miller # # drivers/net/sungem.c # 2004/09/30 12:30:49-07:00 davem@nuts.davemloft.net +0 -20 # [SUNGEM]: Do not need two implementations of poll_controller, hehe. # # ChangeSet # 2004/09/30 12:16:36-07:00 shemminger@osdl.org # [PATCH] limit max jiffy of msecs_to_jiffies # # include/linux/time.h # 2004/09/30 11:46:43-07:00 shemminger@osdl.org +2 -0 # limit max jiffy of msecs_to_jiffies # # ChangeSet # 2004/09/30 18:51:37+00:00 tony.luck@intel.com # [IA64] mca.h, mca_drv.c: cleanup extern declarations # # Move extern declarations of ia64_{reg,unreg}_MCA_extension() # to mca.h. Delete declaration of ia64_mca_ucmc_other_recover_fp() # which doesn't exist. # # Patch supplied by Hidetoshi Seto. # # Signed-off-by: Tony Luck # # include/asm-ia64/mca.h # 2004/09/30 18:49:35+00:00 tony.luck@intel.com +2 -1 # cleanup extern definitions # # arch/ia64/kernel/mca_drv.c # 2004/09/30 18:49:35+00:00 tony.luck@intel.com +0 -2 # cleanup extern definitions # # ChangeSet # 2004/09/30 18:51:15+00:00 seto.hidetoshi@jp.fujitsu.com # [IA64] Recovery from user-mode memory error # # This is the latest/Updated OS_MCA handler which try to do recovery # from multibit-ECC/poisoned memory-read error on user-land. # (Thank you very much for comments, Keith and Grant!) # # I'd still appreciate it if anyone having good test environment # could apply my patch and could report how it works. # (especially reports on non-Tiger/non-Intel platform are welcome.) # # Signed-off-by: Hidetoshi Seto # Signed-off-by: Tony Luck # # arch/ia64/kernel/mca_drv_asm.S # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +45 -0 # BitKeeper file /data/home/aegl/BK/work/seto2/arch/ia64/kernel/mca_drv_asm.S # # arch/ia64/kernel/mca_drv.h # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +113 -0 # BitKeeper file /data/home/aegl/BK/work/seto2/arch/ia64/kernel/mca_drv.h # # include/asm-ia64/mca.h # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +6 -0 # MCA 2xECC memory errors # # arch/ia64/kernel/mca_drv_asm.S # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +0 -0 # BitKeeper file /data/home/aegl/BK/work/seto.merge/arch/ia64/kernel/mca_drv_asm.S # # arch/ia64/kernel/mca_drv.h # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +0 -0 # BitKeeper file /data/home/aegl/BK/work/seto.merge/arch/ia64/kernel/mca_drv.h # # arch/ia64/kernel/mca_drv.c # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +641 -0 # BitKeeper file /data/home/aegl/BK/work/seto2/arch/ia64/kernel/mca_drv.c # # arch/ia64/kernel/mca.c # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +35 -6 # MCA 2xECC memory errors # # arch/ia64/kernel/Makefile # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +2 -0 # MCA 2xECC memory errors # # arch/ia64/Kconfig # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +3 -0 # MCA 2xECC memory errors # # arch/ia64/kernel/mca_drv.c # 2004/09/30 18:49:13+00:00 seto.hidetoshi@jp.fujitsu.com +0 -0 # BitKeeper file /data/home/aegl/BK/work/seto.merge/arch/ia64/kernel/mca_drv.c # # ChangeSet # 2004/09/30 11:25:46-07:00 torvalds@ppc970.osdl.org # Fix up natsemi network driver IO accessor types. # # Basic cleanup - replace untyped/wrongly typed "dev->base_addr" with # use of a strongly typed "ioaddr". # # Fixed up resulting mii_delay() search-and-replace error noticed by # Andrey Klochko. # # Verified by Franz Pletz. # # drivers/net/natsemi.c # 2004/09/30 11:25:40-07:00 torvalds@ppc970.osdl.org +147 -120 # Fix up natsemi network driver IO accessor types. # # Basic cleanup - replace untyped/wrongly typed "dev->base_addr" with # use of a strongly typed "ioaddr". # # Fixed up resulting mii_delay() search-and-replace error noticed by # Andrey Klochko. # # Verified by Franz Pletz. # # ChangeSet # 2004/09/30 16:31:06+00:00 eranian@hpl.hp.com # [IA64] minor fix to perfmon # # change the return value of PFM_CREATE_CONTEXT from # EAGAIN to ENOMEM when the sampling buffer size is # larger than the RLIMIT_MEMLOCK limit of the task. # # signed-off-by: Stephane Eranian # Signed-off-by: Tony Luck # # arch/ia64/kernel/perfmon.c # 2004/09/30 16:29:03+00:00 aegl@agluck-lia64.sc.intel.com +1 -1 # fix error return value when exceeding rlimit # # ChangeSet # 2004/09/30 16:27:05+00:00 eranian@hpl.hp.com # [IA64] perfmon2 fix for TASK_TRACED # # fix a problem in pfm_check_task_state() and pfm_task_incompatible() # which was caused by the introduction of the new TASK_TRACED state. # Tool would fail to attach to a process,i.e., PFM_LOAD_CONTEXT would # fail. With the fix perfmon now accepts to operate on tasks which are # in either TASK_STOPPED or TASK_TRACED state. The problem was tracked # down by Alex Williamson from HP who also submitted the patch. # # signed-off-by: Stephane Eranian # Signed-off-by: Tony Luck # # arch/ia64/kernel/perfmon.c # 2004/09/30 16:24:03+00:00 aegl@agluck-lia64.sc.intel.com +2 -2 # allow state TASK_TRACED as well as TASK_STOPPED # # ChangeSet # 2004/09/30 08:41:37-07:00 Andries.Brouwer@cwi.nl # [PATCH] overcommit symbolic constants # # Played a bit with overcommit the past hour. # # Am not entirely satisfied with the no overcommit mode 2 - # programs segfault when the system is close to that boundary. # So, instead of the somewhat larger patch that I planned to send, # just symbolic names for the modes. # # security/selinux/hooks.c # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +2 -2 # overcommit symbolic constants # # security/dummy.c # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +2 -2 # overcommit symbolic constants # # security/commoncap.c # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +2 -2 # overcommit symbolic constants # # mm/nommu.c # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +1 -1 # overcommit symbolic constants # # mm/mmap.c # 2004/09/30 06:35:27-07:00 Andries.Brouwer@cwi.nl +2 -2 # overcommit symbolic constants # # include/linux/mman.h # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +3 -0 # overcommit symbolic constants # # arch/arm26/mm/init.c # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +1 -1 # overcommit symbolic constants # # arch/arm/mm/init.c # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +1 -1 # overcommit symbolic constants # # Documentation/vm/overcommit-accounting # 2004/09/30 06:34:51-07:00 Andries.Brouwer@cwi.nl +4 -4 # overcommit symbolic constants # # ChangeSet # 2004/09/30 08:41:24-07:00 alan@redhat.com # [PATCH] Fix typo in final changes to old i4l tty code # # drivers/isdn/i4l/isdn_tty.c # 2004/09/30 05:56:48-07:00 alan@redhat.com +1 -1 # Fix typo in final changes to old i4l tty code # # ChangeSet # 2004/09/30 08:41:12-07:00 alan@redhat.com # [PATCH] fix typo in capi driver # # I didn't have ISDN builds on in my tree for some reason hence missing these # two from the tidy ups at the end. Marcel Holtmann also came up with the # same fixes although I didnt find that email until I did these. # # Signed-off-by: Alan Cox # # drivers/isdn/capi/capi.c # 2004/09/30 06:00:58-07:00 alan@redhat.com +1 -1 # fix typo in capi driver # # ChangeSet # 2004/09/30 08:23:27-07:00 benh@kernel.crashing.org # [PATCH] ppc64: Fix incorrect initialization of hash table on some pSeries # # The hash table wasn't fully initialized on some pSeries that had # the workaround for no batching. # # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Linus Torvalds # # arch/ppc64/mm/hash_native.c # 2004/09/29 22:34:39-07:00 benh@kernel.crashing.org +2 -2 # ppc64: Fix incorrect initialization of hash table on some pSeries # # ChangeSet # 2004/09/30 08:23:15-07:00 rddunlap@osdl.org # [PATCH] pc300: remove extra paren. # # Remove an extra left-paren. # # Acked-by: Marcelo Tosatti # Signed-off-by: Randy Dunlap # Signed-off-by: Linus Torvalds # # drivers/net/wan/pc300_tty.c # 2004/09/29 21:37:16-07:00 rddunlap@osdl.org +1 -1 # pc300: remove extra paren. # # ChangeSet # 2004/09/30 14:54:06+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 2114/1: fix drivers/char/watchdog/sa1100-wdt.c on SA1100 # # Patch from Ian Campbell # # Patch 2113 broke drivers/char/watchdog/sa1100-wdt.c on SA1100. # # Signed-off-by: Ian Campbell # # drivers/char/watchdog/sa1100_wdt.c # 2004/09/30 14:37:23+01:00 icampbell@com.rmk.(none) +2 -0 # [PATCH] 2114/1: fix drivers/char/watchdog/sa1100-wdt.c on SA1100 # # ChangeSet # 2004/09/30 13:31:59+01:00 icampbell@com.rmk.(none) # [ARM PATCH] 2113/1: include asm/arch/pxa-regs.h where necessary # # Patch from Ian Campbell # # The include of asm/arch/pxa-regs.h has been removed from # asm-arm/arch-pxa/hardware.h and now needs to be included # from the relevant files. # # I have verified the fixes to arch/arm/mach-pxa/sleep.S and # drivers/char/watchdog/sa1100_wdt.c myself. My local tree # has other changes to include/asm-arm/arch-pxa/serial.h # but I beleive that the attached is necessary and correct. # # Signed-off-by: Ian Campbell # # include/asm-arm/arch-pxa/serial.h # 2004/09/30 13:16:11+01:00 icampbell@com.rmk.(none) +1 -0 # [PATCH] 2113/1: include asm/arch/pxa-regs.h where necessary # # drivers/char/watchdog/sa1100_wdt.c # 2004/09/30 13:15:41+01:00 icampbell@com.rmk.(none) +2 -0 # [PATCH] 2113/1: include asm/arch/pxa-regs.h where necessary # # arch/arm/mach-pxa/sleep.S # 2004/09/30 13:15:40+01:00 icampbell@com.rmk.(none) +2 -0 # [PATCH] 2113/1: include asm/arch/pxa-regs.h where necessary # # ChangeSet # 2004/09/29 21:12:18-07:00 davem@nuts.davemloft.net # [TCP]: Smooth out TSO ack clocking. # # - Export tcp_trim_head() and call it directly from # tcp_tso_acked(). This also fixes URG handling. # # - Make tcp_trim_head() adjust the skb->truesize of # the packet and liberate that space from the socket # send buffer. # # - In tcp_current_mss(), limit TSO factor to 1/4 of # snd_cwnd. The idea is from John Heffner. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_output.c # 2004/09/29 21:11:53-07:00 davem@nuts.davemloft.net +15 -35 # [TCP]: Smooth out TSO ack clocking. # # - Export tcp_trim_head() and call it directly from # tcp_tso_acked(). This also fixes URG handling. # # - Make tcp_trim_head() adjust the skb->truesize of # the packet and liberate that space from the socket # send buffer. # # - In tcp_current_mss(), limit TSO factor to 1/4 of # snd_cwnd. The idea is from John Heffner. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_input.c # 2004/09/29 21:11:53-07:00 davem@nuts.davemloft.net +9 -13 # [TCP]: Smooth out TSO ack clocking. # # - Export tcp_trim_head() and call it directly from # tcp_tso_acked(). This also fixes URG handling. # # - Make tcp_trim_head() adjust the skb->truesize of # the packet and liberate that space from the socket # send buffer. # # - In tcp_current_mss(), limit TSO factor to 1/4 of # snd_cwnd. The idea is from John Heffner. # # Signed-off-by: David S. Miller # # include/net/tcp.h # 2004/09/29 21:11:52-07:00 davem@nuts.davemloft.net +1 -0 # [TCP]: Smooth out TSO ack clocking. # # - Export tcp_trim_head() and call it directly from # tcp_tso_acked(). This also fixes URG handling. # # - Make tcp_trim_head() adjust the skb->truesize of # the packet and liberate that space from the socket # send buffer. # # - In tcp_current_mss(), limit TSO factor to 1/4 of # snd_cwnd. The idea is from John Heffner. # # Signed-off-by: David S. Miller # # ChangeSet # 2004/09/30 11:50:15+10:00 nathans@sgi.com # [XFS] Fix sync issues - use correct writepage page re-dirty interface, # and do not clear dirty flag if page only partially written. # # SGI Modid: xfs-linux:xfs-kern:19622a # Signed-off-by: Nathan Scott # # fs/xfs/linux-2.6/xfs_aops.c # 2004/09/30 11:49:48+10:00 nathans@sgi.com +19 -12 # [XFS] Fix sync issues - use correct writepage page re-dirty interface, # and do not clear dirty flag if page only partially written. # # ChangeSet # 2004/09/30 11:46:12+10:00 nathans@sgi.com # [XFS] Fix merge botch affecting xfs_setattr for realtime files. # # SGI Modid: xfs-linux:xfs-kern:19619a # Signed-off-by: Nathan Scott # # fs/xfs/xfs_vnodeops.c # 2004/09/30 11:45:45+10:00 nathans@sgi.com +5 -5 # [XFS] Fix merge botch affecting xfs_setattr for realtime files. # # ChangeSet # 2004/09/30 11:44:48+10:00 nathans@sgi.com # [XFS] Remove crufty old cap/mac code - never used, never compiled, gone. # # SGI Modid: xfs-linux:xfs-kern:19601a # Signed-off-by: Nathan Scott # # fs/xfs/Makefile # 2004/09/30 11:44:18+10:00 nathans@sgi.com +0 -2 # [XFS] Remove crufty old cap/mac code - never used, never compiled, gone. # # BitKeeper/deleted/.del-xfs_cap.c~4c1a85d7eb301218 # 2004/09/30 11:42:21+10:00 nathans@sgi.com +0 -0 # Delete: fs/xfs/xfs_cap.c # # BitKeeper/deleted/.del-xfs_mac.c~d0bf14eac42cdcd0 # 2004/09/30 11:42:17+10:00 nathans@sgi.com +0 -0 # Delete: fs/xfs/xfs_mac.c # # ChangeSet # 2004/09/29 18:27:52+00:00 tony.luck@intel.com # [IA64] SMP systems may not have SRAT, still need to mark node0 online. # # This only causes a problem in the -mm tree now, but Zou Nan hai and # Shaohua Li sent me this fix so that SMP systems compiled with the # generic kernel (which turns on NUMA and CPUSETS in -mm) won't hit # a BUG_ON in kernel/cpuset.c guarantee_online_mems() which is called # from acpi_early_init() # # Signed-off-by: Tony Luck # # arch/ia64/kernel/acpi.c # 2004/09/29 18:21:24+00:00 aegl@agluck-lia64.sc.intel.com +2 -1 # SMP systems may not have SRAT, still need to mark node0 online. # # ChangeSet # 2004/09/29 17:03:07+00:00 jbarnes@sgi.com # [IA64] defconfig for Intel bigsur # # Here's a defconfig that comes up on my box and has a reasonable set of modules # enabled. # # Signed-off-by: Jesse Barnes # Signed-off-by: Tony Luck # # arch/ia64/configs/bigsur_defconfig # 2004/09/29 17:01:43+00:00 aegl@agluck-lia64.sc.intel.com +1132 -0 # defconfig for Intel bigsur # # arch/ia64/configs/bigsur_defconfig # 2004/09/29 17:01:43+00:00 aegl@agluck-lia64.sc.intel.com +0 -0 # BitKeeper file /data/home/aegl/BK/linux-ia64-release-2.6.9/arch/ia64/configs/bigsur_defconfig # # ChangeSet # 2004/09/29 16:58:05+00:00 jbarnes@sgi.com # [IA64-SGI] sn2: serialize access to PROM chips # # If we read and write the PROM chips at the same time, as might happen at boot # when salinfo extracts MCA records and a user is checking the PROM revision # in /proc/sgi_prominfo, an MCA might occur, since the PROM chips can't be # accessed that way. This patch fixes the problem for systems with new PROMs # (>= 3.50) by using the SAL to do PROM reads. # # Signed-off-by: Jesse Barnes # Signed-off-by: Tony Luck # # include/asm-ia64/sn/sn_sal.h # 2004/09/29 16:51:15+00:00 aegl@agluck-lia64.sc.intel.com +33 -3 # avoid read/write PROM at same time # # arch/ia64/sn/kernel/sn2/prominfo_proc.c # 2004/09/29 16:51:15+00:00 aegl@agluck-lia64.sc.intel.com +141 -164 # avoid read/write PROM at same time # # ChangeSet # 2004/09/25 13:28:02+02:00 tnt@246tNt.com # ppc: Allow the Freescale MPC52xx to NAP when idle on LITE5200 platform # # NAP allows some powersave. It's provided mainly as an example on how # to do it. # # However, when a BDI is plugged it causes early crashes so be aware ! # You need to define CONFIG_BDI_SWITCH so powersave is disabled. # # Signed-off-by: Sylvain Munaut # # arch/ppc/platforms/lite5200.c # 2004/09/25 13:27:50+02:00 tnt@246tNt.com +5 -0 # ppc: Allow the Freescale MPC52xx to NAP when idle on LITE5200 platform # # ChangeSet # 2004/09/25 13:26:25+02:00 tnt@246tNt.com # ppc: Disable the CAN_DOZE & CAN_NAP CPU features when a BDI is used # # Theses powersave features causes random debugging failures with # a BDI. # # Signed-off-by: Sylvain Munaut # # arch/ppc/kernel/cputable.c # 2004/09/25 13:26:11+02:00 tnt@246tNt.com +59 -47 # ppc: Disable the CAN_DOZE & CAN_NAP CPU features when a BDI is used # # ChangeSet # 2004/09/25 13:24:20+02:00 tnt@246tNt.com # ppc: Freescale MPC52xx interrupt controller init code update # # Part of the initialization code of the interrupt controller is # board-specific. It's mainly the external interrupt IRQ[0,3] # configuration. This moved in platform file by this ChangeSet. # # Signed-off-by: Sylvain Munaut # # arch/ppc/syslib/mpc52xx_pic.c # 2004/09/25 13:24:09+02:00 tnt@246tNt.com +14 -4 # ppc: Freescale MPC52xx interrupt controller init code update # # arch/ppc/platforms/lite5200.c # 2004/09/25 13:24:09+02:00 tnt@246tNt.com +31 -0 # ppc: Freescale MPC52xx interrupt controller init code update # # ChangeSet # 2004/09/25 12:59:45+02:00 tnt@246tNt.com # ppc: Add Freescale MPC52xx I2C Support using i2c-mpc.c # # Just adds the necessary OCP def entry. Don't use IRQ yet # though because they are buggy with the 5200 for now. # # Signed-off-by: Sylvain Munaut # # arch/ppc/platforms/mpc5200.c # 2004/09/25 12:59:34+02:00 tnt@246tNt.com +24 -0 # ppc: Add Freescale MPC52xx I2C Support using i2c-mpc.c # # ChangeSet # 2004/09/25 12:59:12+02:00 tnt@246tNt.com # ppc: Update Freescale MPC52xx documentation / maintainer # # Signed-off-by: Sylvain Munaut # # MAINTAINERS # 2004/09/25 12:58:58+02:00 tnt@246tNt.com +9 -0 # ppc: Update Freescale MPC52xx documentation / maintainer # # Documentation/powerpc/mpc52xx.txt # 2004/09/25 12:58:58+02:00 tnt@246tNt.com +1 -10 # ppc: Update Freescale MPC52xx documentation / maintainer # # ChangeSet # 2004/09/25 12:58:26+02:00 tnt@246tNt.com # ppc: Fix output of low-level serial debug on Freescale MPC52xx # # Thanks to Roger Blofeld for pointing that out. # # Signed-off-by: Sylvain Munaut # # arch/ppc/syslib/mpc52xx_setup.c # 2004/09/25 12:58:17+02:00 tnt@246tNt.com +14 -8 # ppc: Fix output of low-level serial debug on Freescale MPC52xx # # ChangeSet # 2004/09/25 12:58:05+02:00 tnt@246tNt.com # ppc: Use interactive console for Freescale MPC52xx when using boot/simple # # Signed-off-by: Dale Farnsworth # Signed-off-by: Sylvain Munaut # # arch/ppc/boot/simple/misc.c # 2004/09/25 12:57:54+02:00 tnt@246tNt.com +3 -1 # ppc: Use interactive console for Freescale MPC52xx when using boot/simple # # ChangeSet # 2004/09/25 12:57:17+02:00 tnt@246tNt.com # ppc: Fix spurious iounmap in Freescale MPC52xx syslib # # Signed-off-by: Sylvain Munaut # # arch/ppc/syslib/mpc52xx_setup.c # 2004/09/25 12:57:06+02:00 tnt@246tNt.com +0 -2 # ppc: Fix spurious iounmap in Freescale MPC52xx syslib # # ChangeSet # 2004/09/25 12:56:54+02:00 tnt@246tNt.com # ppc: Fix missing include in Freescale MPC52xx syslib # # pgtable.h is required for _PAGE_IO # # Signed-off-by: Sylvain Munaut # # arch/ppc/syslib/mpc52xx_setup.c # 2004/09/25 12:56:44+02:00 tnt@246tNt.com +1 -0 # ppc: Fix missing include in Freescale MPC52xx syslib # # ChangeSet # 2004/09/25 12:56:32+02:00 tnt@246tNt.com # ppc: Freescale MPC52xx hardware definitions misc updates/fix # # Mainly this includes : # - Remove the 'volatile' keyword in structs defining hardware registers # sets. This keyword is useless and can even be harmful if it makes someone # believes it's sufficient to access a register like a variable. It's not ! # And the registers must be accessed with the appropriate in_be/out_be. So # we remove this keyword as it's wrong and misleading. # - Some fixes to SDMA # - Add SDRAM & GPIO_WKUP unit # - Remove of useless #define # # Signed-off-by: Sylvain Munaut # # include/asm-ppc/mpc52xx_psc.h # 2004/09/25 12:56:21+02:00 tnt@246tNt.com +81 -81 # ppc: Freescale MPC52xx hardware definitions misc updates/fix # # include/asm-ppc/mpc52xx.h # 2004/09/25 12:56:21+02:00 tnt@246tNt.com +202 -170 # ppc: Freescale MPC52xx hardware definitions misc updates/fix # # ChangeSet # 2004/09/25 12:45:59+02:00 tnt@246tNt.com # ppc: Name update/coherency and white space corrections for Freescale MPC52xx # # - Whitespace audit # - IceCube -> LITE5200 (Official name of the platform) # # Signed-off-by: Sylvain Munaut # # arch/ppc/syslib/mpc52xx_setup.c # 2004/09/25 12:45:24+02:00 tnt@246tNt.com +7 -9 # ppc: Name update/coherency and white space corrections for Freescale MPC52xx # # arch/ppc/syslib/mpc52xx_pic.c # 2004/09/25 12:45:24+02:00 tnt@246tNt.com +2 -2 # ppc: Name update/coherency and white space corrections for Freescale MPC52xx # # arch/ppc/platforms/lite5200.c # 2004/09/25 12:45:24+02:00 tnt@246tNt.com +10 -11 # ppc: Name update/coherency and white space corrections for Freescale MPC52xx # # ChangeSet # 2004/09/23 02:26:55-03:00 acme@conectiva.com.br # [TCP] don't use sk_zapped # # This is not needed, we use refcounts now. # # Signed-off-by: Arnaldo Carvalho de Melo # Signed-off-by: David S. Miller # # net/ipv6/af_inet6.c # 2004/09/23 02:26:43-03:00 acme@conectiva.com.br +0 -1 # [TCP] don't use sk_zapped # # This is not needed, we use refcounts now. # # Signed-off-by: Arnaldo Carvalho de Melo # Signed-off-by: David S. Miller # # net/ipv4/tcp_diag.c # 2004/09/23 02:26:43-03:00 acme@conectiva.com.br +0 -2 # [TCP] don't use sk_zapped # # This is not needed, we use refcounts now. # # Signed-off-by: Arnaldo Carvalho de Melo # Signed-off-by: David S. Miller # # net/ipv4/tcp.c # 2004/09/23 02:26:43-03:00 acme@conectiva.com.br +0 -8 # [TCP] don't use sk_zapped # # This is not needed, we use refcounts now. # # Signed-off-by: Arnaldo Carvalho de Melo # Signed-off-by: David S. Miller # # net/ipv4/af_inet.c # 2004/09/23 02:26:42-03:00 acme@conectiva.com.br +0 -1 # [TCP] don't use sk_zapped # # This is not needed, we use refcounts now. # # Signed-off-by: Arnaldo Carvalho de Melo # Signed-off-by: David S. Miller # # ChangeSet # 2004/09/22 09:59:31-07:00 trini@kernel.crashing.org # ppc32: Update the MVME5100 defconfig so it works out of the box. # # David Gardiner noticed that it needed # updates such as VT=n to 'work' out of the box. # # arch/ppc/configs/mvme5100_defconfig # 2004/09/22 09:59:09-07:00 trini@kernel.crashing.org +57 -82 # Update. # - Set various netfilter options to what the help recommends. # - Enable TULIP. # - Disable input, etc. # - Disable CONFIG_VT. # # ChangeSet # 2004/09/20 14:45:02-04:00 bunk@fs.tum.de # [PATCH] TMS380TR must select FW_LOADER # # I got the following compile error with CONFIG_FW_LOADER=n: # # <-- snip --> # # ... # LD .tmp_vmlinux1 # drivers/built-in.o(.text+0x297944): In function `tms380tr_reset_adapter': # : undefined reference to `request_firmware' # drivers/built-in.o(.text+0x297aaf): In function `tms380tr_reset_adapter': # : undefined reference to `release_firmware' # drivers/built-in.o(.text+0x297af9): In function `tms380tr_reset_adapter': # : undefined reference to `release_firmware' # make: *** [.tmp_vmlinux1] Error 1 # # <-- snip --> # # # CONFIG_TMS380TR must select FW_LOADER (and therefore depend on HOTPLUG). # # # Signed-off-by: Adrian Bunk # # drivers/net/tokenring/Kconfig # 2004/08/09 16:04:22-04:00 bunk@fs.tum.de +2 -1 # TMS380TR must select FW_LOADER # # ChangeSet # 2004/09/15 00:54:50+01:00 davej@redhat.com # [AGPGART] Fix up sparse iomem warnings in Serverworks driver. # # Signed-off-by: Dave Jones # # drivers/char/agp/sworks-agp.c # 2004/09/15 00:54:16+01:00 davej@redhat.com +17 -26 # [AGPGART] Fix up sparse iomem warnings in Serverworks driver. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/09/15 00:52:14+01:00 davej@redhat.com # [AGPGART] Fix up sparse iomem warnings in NVidia driver. # # Signed-off-by: Dave Jones # # drivers/char/agp/nvidia-agp.c # 2004/09/15 00:51:20+01:00 davej@redhat.com +11 -14 # [AGPGART] Fix up sparse iomem warnings in NVidia driver. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/09/15 00:48:28+01:00 davej@redhat.com # [AGPGART] Fix sparse iomem warnings in Intel MCH driver. # # Signed-off-by: Dave Jones # # drivers/char/agp/intel-mch-agp.c # 2004/09/15 00:47:50+01:00 davej@redhat.com +3 -3 # [AGPGART] Fix sparse iomem warnings in Intel MCH driver. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/09/15 00:44:58+01:00 davej@redhat.com # [AGPGART] Fix up sparse iomem warning in Intel driver. # # Signed-off-by: Dave Jones # # drivers/char/agp/intel-agp.c # 2004/09/15 00:43:57+01:00 davej@redhat.com +1 -1 # [AGPGART] Fix up sparse iomem warning in Intel driver. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/09/15 00:35:14+01:00 davej@redhat.com # [AGPGART] Fix up sparse iomem warnings in generic agp code. # # Signed-off-by: Dave Jones # # drivers/char/agp/generic.c # 2004/09/15 00:34:01+01:00 davej@redhat.com +6 -10 # [AGPGART] Fix up sparse iomem warnings in generic agp code. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/09/15 00:28:10+01:00 davej@redhat.com # [AGPGART] Fix up sparse iomem warnings in ati driver. # # Signed-off-by: Dave Jones # # drivers/char/agp/ati-agp.c # 2004/09/15 00:26:57+01:00 davej@redhat.com +14 -17 # [AGPGART] Fix up sparse iomem warnings in ati driver. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/09/15 00:22:47+01:00 davej@redhat.com # [AGPGART] Fix up sparse iomem warnings of amd64 driver. # # Signed-off-by: Dave Jones # # drivers/char/agp/amd64-agp.c # 2004/09/15 00:22:03+01:00 davej@redhat.com +2 -2 # [AGPGART] Fix up sparse iomem warnings of amd64 driver. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/09/15 00:05:26+01:00 davej@redhat.com # [AGPGART] Fix up sparse iomem warnings for amd-k7 driver. # # Signed-off-by: Dave Jones # # drivers/char/agp/amd-k7-agp.c # 2004/09/15 00:03:52+01:00 davej@redhat.com +14 -17 # [AGPGART] Fix up sparse iomem warnings for amd-k7 driver. # # Signed-off-by: Dave Jones # # ChangeSet # 2004/08/24 18:04:28+01:00 davej@redhat.com # [AGPGART] via-agp.c resume/suspend support # # From: Arkadiusz Miskiewicz # # With this patch I'm able to suspend to disk (well, works even without # patch) and resume (without it my laptop hangs (even sysrq is not working) # while resuming). # # Signed-off-by: Arkadiusz Miskiewicz # Signed-off-by: Andrew Morton # Signed-off-by: Dave Jones # # drivers/char/agp/via-agp.c # 2004/08/24 18:04:15+01:00 davej@redhat.com +31 -0 # [AGPGART] via-agp.c resume/suspend support # # From: Arkadiusz Miskiewicz # # With this patch I'm able to suspend to disk (well, works even without # patch) and resume (without it my laptop hangs (even sysrq is not working) # while resuming). # # Signed-off-by: Arkadiusz Miskiewicz # Signed-off-by: Andrew Morton # Signed-off-by: Dave Jones # diff -Nru a/Documentation/ManagementStyle b/Documentation/ManagementStyle --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/ManagementStyle 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,276 @@ + + Linux kernel management style + +This is a short document describing the preferred (or made up, depending +on who you ask) management style for the linux kernel. It's meant to +mirror the CodingStyle document to some degree, and mainly written to +avoid answering (*) the same (or similar) questions over and over again. + +Management style is very personal and much harder to quantify than +simple coding style rules, so this document may or may not have anything +to do with reality. It started as a lark, but that doesn't mean that it +might not actually be true. You'll have to decide for yourself. + +Btw, when talking about "kernel manager", it's all about the technical +lead persons, not the people who do traditional management inside +companies. If you sign purchase orders or you have any clue about the +budget of your group, you're almost certainly not a kernel manager. +These suggestions may or may not apply to you. + +First off, I'd suggest buying "Seven Habits of Highly Successful +People", and NOT read it. Burn it, it's a great symbolic gesture. + +(*) This document does so not so much by answering the question, but by +making it painfully obvious to the questioner that we don't have a clue +to what the answer is. + +Anyway, here goes: + + + Chapter 1: Decisions + +Everybody thinks managers make decisions, and that decision-making is +important. The bigger and more painful the decision, the bigger the +manager must be to make it. That's very deep and obvious, but it's not +actually true. + +The name of the game is to _avoid_ having to make a decision. In +particular, if somebody tells you "choose (a) or (b), we really need you +to decide on this", you're in trouble as a manager. The people you +manage had better know the details better than you, so if they come to +you for a technical decision, you're screwed. You're clearly not +competent to make that decision for them. + +(Corollary:if the people you manage don't know the details better than +you, you're also screwed, although for a totally different reason. +Namely that you are in the wrong job, and that _they_ should be managing +your brilliance instead). + +So the name of the game is to _avoid_ decisions, at least the big and +painful ones. Making small and non-consequential decisions is fine, and +makes you look like you know what you're doing, so what a kernel manager +needs to do is to turn the big and painful ones into small things where +nobody really cares. + +It helps to realize that the key difference between a big decision and a +small one is whether you can fix your decision afterwards. Any decision +can be made small by just always making sure that if you were wrong (and +you _will_ be wrong), you can always undo the damage later by +backtracking. Suddenly, you get to be doubly managerial for making +_two_ inconsequential decisions - the wrong one _and_ the right one. + +And people will even see that as true leadership (*cough* bullshit +*cough*). + +Thus the key to avoiding big decisions becomes to just avoiding to do +things that can't be undone. Don't get ushered into a corner from which +you cannot escape. A cornered rat may be dangerous - a cornered manager +is just pitiful. + +It turns out that since nobody would be stupid enough to ever really let +a kernel manager have huge fiscal responsibility _anyway_, it's usually +fairly easy to backtrack. Since you're not going to be able to waste +huge amounts of money that you might not be able to repay, the only +thing you can backtrack on is a technical decision, and there +back-tracking is very easy: just tell everybody that you were an +incompetent nincompoop, say you're sorry, and undo all the worthless +work you had people work on for the last year. Suddenly the decision +you made a year ago wasn't a big decision after all, since it could be +easily undone. + +It turns out that some people have trouble with this approach, for two +reasons: + - admitting you were an idiot is harder than it looks. We all like to + maintain appearances, and coming out in public to say that you were + wrong is sometimes very hard indeed. + - having somebody tell you that what you worked on for the last year + wasn't worthwhile after all can be hard on the poor lowly engineers + too, and while the actual _work_ was easy enough to undo by just + deleting it, you may have irrevocably lost the trust of that + engineer. And remember: "irrevocable" was what we tried to avoid in + the first place, and your decision ended up being a big one after + all. + +Happily, both of these reasons can be mitigated effectively by just +admitting up-front that you don't have a friggin' clue, and telling +people ahead of the fact that your decision is purely preliminary, and +might be the wrong thing. You should always reserve the right to change +your mind, and make people very _aware_ of that. And it's much easier +to admit that you are stupid when you haven't _yet_ done the really +stupid thing. + +Then, when it really does turn out to be stupid, people just roll their +eyes and say "Oops, he did it again". + +This preemptive admission of incompetence might also make the people who +actually do the work also think twice about whether it's worth doing or +not. After all, if _they_ aren't certain whether it's a good idea, you +sure as hell shouldn't encourage them by promising them that what they +work on will be included. Make them at least think twice before they +embark on a big endeavor. + +Remember: they'd better know more about the details than you do, and +they usually already think they have the answer to everything. The best +thing you can do as a manager is not to instill confidence, but rather a +healthy dose of critical thinking on what they do. + +Btw, another way to avoid a decision is to plaintively just whine "can't +we just do both?" and look pitiful. Trust me, it works. If it's not +clear which approach is better, they'll eventually figure it out. The +answer may end up being that both teams get so frustrated by the +situation that they just give up. + +That may sound like a failure, but it's usually a sign that there was +something wrong with both projects, and the reason the people involved +couldn't decide was that they were both wrong. You end up coming up +smelling like roses, and you avoided yet another decision that you could +have screwed up on. + + + Chapter 2: People + +Most people are idiots, and being a manager means you'll have to deal +with it, and perhaps more importantly, that _they_ have to deal with +_you_. + +It turns out that while it's easy to undo technical mistakes, it's not +as easy to undo personality disorders. You just have to live with +theirs - and yours. + +However, in order to prepare yourself as a kernel manager, it's best to +remember not to burn any bridges, bomb any innocent villagers, or +alienate too many kernel developers. It turns out that alienating people +is fairly easy, and un-alienating them is hard. Thus "alienating" +immediately falls under the heading of "not reversible", and becomes a +no-no according to Chapter 1. + +There's just a few simple rules here: + (1) don't call people d*ckheads (at least not in public) + (2) learn how to apologize when you forgot rule (1) + +The problem with #1 is that it's very easy to do, since you can say +"you're a d*ckhead" in millions of different ways (*), sometimes without +even realizing it, and almost always with a white-hot conviction that +you are right. + +And the more convinced you are that you are right (and let's face it, +you can call just about _anybody_ a d*ckhead, and you often _will_ be +right), the harder it ends up being to apologize afterwards. + +To solve this problem, you really only have two options: + - get really good at apologies + - spread the "love" out so evenly that nobody really ends up feeling + like they get unfairly targeted. Make it inventive enough, and they + might even be amused. + +The option of being unfailingly polite really doesn't exist. Nobody will +trust somebody who is so clearly hiding his true character. + +(*) Paul Simon sang "Fifty Ways to Lose Your Lover", because quite +frankly, "A Million Ways to Tell a Developer He Is a D*ckhead" doesn't +scan nearly as well. But I'm sure he thought about it. + + + Chapter 3: People II - the Good Kind + +While it turns out that most people are idiots, the corollary to that is +sadly that you are one too, and that while we can all bask in the secure +knowledge that we're better than the average person (let's face it, +nobody ever believes that they're average or below-average), we should +also admit that we're not the sharpest knife around, and there will be +other people that are less of an idiot that you are. + +Some people react badly to smart people. Others take advantage of them. + +Make sure that you, as a kernel maintainer, are in the second group. +Suck up to them, because they are the people who will make your job +easier. In particular, they'll be able to make your decisions for you, +which is what the game is all about. + +So when you find somebody smarter than you are, just coast along. Your +management responsibilities largely become ones of saying "Sounds like a +good idea - go wild", or "That sounds good, but what about xxx?". The +second version in particular is a great way to either learn something +new about "xxx" or seem _extra_ managerial by pointing out something the +smarter person hadn't thought about. In either case, you win. + +One thing to look out for is to realize that greatness in one area does +not necessarily translate to other areas. So you might prod people in +specific directions, but let's face it, they might be good at what they +do, and suck at everything else. The good news is that people tend to +naturally gravitate back to what they are good at, so it's not like you +are doing something irreversible when you _do_ prod them in some +direction, just don't push too hard. + + + Chapter 4: Placing blame + +Things will go wrong, and people want somebody to blame. Tag, you're it. + +It's not actually that hard to accept the blame, especially if people +kind of realize that it wasn't _all_ your fault. Which brings us to the +best way of taking the blame: do it for another guy. You'll feel good +for taking the fall, he'll feel good about not getting blamed, and the +guy who lost his whole 36GB porn-collection because of your incompetence +will grudgingly admit that you at least didn't try to weasel out of it. + +Then make the developer who really screwed up (if you can find him) know +_in_private_ that he screwed up. Not just so he can avoid it in the +future, but so that he knows he owes you one. And, perhaps even more +importantly, he's also likely the person who can fix it. Because, let's +face it, it sure ain't you. + +Taking the blame is also why you get to be manager in the first place. +It's part of what makes people trust you, and allow you the potential +glory, because you're the one who gets to say "I screwed up". And if +you've followed the previous rules, you'll be pretty good at saying that +by now. + + + Chapter 5: Things to avoid + +There's one thing people hate even more than being called "d*ckhead", +and that is being called a "d*ckhead" in a sanctimonious voice. The +first you can apologize for, the second one you won't really get the +chance. They likely will no longer be listening even if you otherwise +do a good job. + +We all think we're better than anybody else, which means that when +somebody else puts on airs, it _really_ rubs us the wrong way. You may +be morally and intellectually superior to everybody around you, but +don't try to make it too obvious unless you really _intend_ to irritate +somebody (*). + +Similarly, don't be too polite or subtle about things. Politeness easily +ends up going overboard and hiding the problem, and as they say, "On the +internet, nobody can hear you being subtle". Use a big blunt object to +hammer the point in, because you can't really depend on people getting +your point otherwise. + +Some humor can help pad both the bluntness and the moralizing. Going +overboard to the point of being ridiculous can drive a point home +without making it painful to the recipient, who just thinks you're being +silly. It can thus help get through the personal mental block we all +have about criticism. + +(*) Hint: internet newsgroups that are not directly related to your work +are great ways to take out your frustrations at other people. Write +insulting posts with a sneer just to get into a good flame every once in +a while, and you'll feel cleansed. Just don't crap too close to home. + + + Chapter 6: Why me? + +Since your main responsibility seems to be to take the blame for other +peoples mistakes, and make it painfully obvious to everybody else that +you're incompetent, the obvious question becomes one of why do it in the +first place? + +First off, while you may or may not get screaming teenage girls (or +boys, let's not be judgmental or sexist here) knocking on your dressing +room door, you _will_ get an immense feeling of personal accomplishment +for being "in charge". Never mind the fact that you're really leading +by trying to keep up with everybody else and running after them as fast +as you can. Everybody will still think you're the person in charge. + +It's a great job if you can hack it. diff -Nru a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt --- a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt 2004-10-06 19:37:48 -07:00 +++ b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt 2004-10-06 19:37:48 -07:00 @@ -26,4 +26,19 @@ and http://www.simtec.co.uk/products/EB2410ITX/resources.html +MTD +--- + + The NAND and NOR onboard are currently supported in the linux-mtd cvs, + and are awaiting merge in the mainline. see the linux-mtd project at + http://www.linux-mtd.infradead.org/ for more information. + + +IDE +--- + + Both onboard IDE ports are supported, however there is no support for + changing speed of devices, PIO Mode 4 capable drives should be used. + + (c) 2004 Ben Dooks, Simtec Electronics diff -Nru a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,122 @@ + S3C2410 GPIO Control + ==================== + +Introduction +------------ + + The s3c2410 kernel provides an interface to configure and + manipulate the state of the GPIO pins, and find out other + information about them. + + There are a number of conditions attached to the configuration + of the s3c2410 GPIO system, please read the Samsung provided + data-sheet/users manual to find out the complete list. + + +Headers +------- + + See include/asm-arm/arch-s3c2410/regs-gpio.h for the list + of GPIO pins, and the configuration values for them. This + is included by using #include + + The GPIO management functions are defined in the hardware + header include/asm-arm/arch-s3c2410/hardware.h which can be + included by #include + + A useful ammount of documentation can be found in the hardware + header on how the GPIO functions (and others) work. + + Whilst a number of these functions do make some checks on what + is passed to them, for speed of use, they may not always ensure + that the user supplied data to them is correct. + + +PIN Numbers +----------- + + Each pin has an unique number associated with it in regs-gpio.h, + eg S3C2410_GPA0 or S3C2410_GPF1. These defines are used to tell + the GPIO functions which pin is to be used. + + +Configuring a pin +----------------- + + The following function allows the configuration of a given pin to + be changed. + + void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); + + Eg: + + s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0); + s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1); + + which would turn GPA0 into the lowest Address line A0, and set + GPE8 to be connected to the SDIO/MMC controller's SDDAT1 line. + + +Reading the current configuration +--------------------------------- + + The current configuration of a pin can be read by using: + + s3c2410_gpio_getcfg(unsigned int pin); + + The return value will be from the same set of values which can be + passed to s3c2410_gpio_cfgpin(). + + +Configuring a pull-up resistor +------------------------------ + + A large proportion of the GPIO pins on the S3C2410 can have weak + pull-up resistors enabled. This can be configured by the following + function: + + void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); + + Where the to value is zero to set the pull-up off, and 1 to enable + the specified pull-up. Any other values are currently undefined. + + +Getting the state of a PIN +-------------------------- + + The state of a pin can be read by using the function: + + unsigned int s3c2410_gpio_getpin(unsigned int pin); + + This will return either zero or non-zero. Do not count on this + function returning 1 if the pin is set. + + +Setting the state of a PIN +-------------------------- + + The value an pin is outputing can be modified by using the following: + + void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); + + Which sets the given pin to the value. Use 0 to write 0, and 1 to + set the output to 1. + + +Getting the IRQ number associated with a PIN +-------------------------------------------- + + The following function can map the given pin number to an IRQ + number to pass to the IRQ system. + + int s3c2410_gpio_getirq(unsigned int pin); + + Note, not all pins have an IRQ. + + +Authour +------- + + +Ben Dooks, 03 October 2004 +(c) 2004 Ben Dooks, Simtec Electronics diff -Nru a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt --- a/Documentation/arm/Samsung-S3C24XX/Overview.txt 2004-10-06 19:37:48 -07:00 +++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt 2004-10-06 19:37:48 -07:00 @@ -18,6 +18,9 @@ default by `make s3c2410_defconfig`. This configuration has support for all the machines, and the commonly used features on them. + Certain machines may have their own default configurations as well, + please check the machine specific documentation. + Machines -------- @@ -42,10 +45,53 @@ Handheld (IPAQ), available in several varieties -Contributors ------------- +NAND +---- + + The current kernels do not have direct support for the NAND + controller, the latest linux-mtd CVS has support for this. + See http://www.linux-mtd.infradead.org/ + + +Serial +------ + + The s3c2410 serial driver provides support for the internal + serial ports. These devices appear as /dev/ttySAC0 through 3. + + To create device nodes for these, use the following commands + + mknod ttySAC0 c 204 64 + mknod ttySAC1 c 204 65 + mknod ttySAC2 c 204 66 + + +GPIO +---- + + The core contains support for manipulating the GPIO, see the + documentation in GPIO.txt in the same directory as this file. + + +Clock Management +---------------- + + The core provides the interface defined in the header file + include/asm-arm/hardware/clock.h, to allow control over the + various clock units + + +Port Contributors +----------------- Ben Dooks Vincent Sanders Herbert Potzl Arnaud Patard + Roc Wu + + +Document Author +--------------- + +Ben Dooks, (c) 2004 Simtec Electronics diff -Nru a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt --- a/Documentation/filesystems/ntfs.txt 2004-10-06 19:37:47 -07:00 +++ b/Documentation/filesystems/ntfs.txt 2004-10-06 19:37:47 -07:00 @@ -277,6 +277,8 @@ Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog. +2.1.20: + - Fix two stupid bugs introduced in 2.1.18 release. 2.1.19: - Minor bugfix in handling of the default upcase table. - Many internal cleanups and improvements. Many thanks to Linus diff -Nru a/Documentation/firmware_class/hotplug-script b/Documentation/firmware_class/hotplug-script --- a/Documentation/firmware_class/hotplug-script 2004-10-06 19:37:47 -07:00 +++ b/Documentation/firmware_class/hotplug-script 2004-10-06 19:37:47 -07:00 @@ -7,10 +7,10 @@ HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/ echo 1 > /sys/$DEVPATH/loading -cat $HOTPLUG_FW_DIR/$FIRMWARE > /sysfs/$DEVPATH/data +cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data echo 0 > /sys/$DEVPATH/loading # To cancel the load in case of error: # -# echo -1 > /sysfs/$DEVPATH/loading +# echo -1 > /sys/$DEVPATH/loading # diff -Nru a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt --- a/Documentation/ioctl-number.txt 2004-10-06 19:37:47 -07:00 +++ b/Documentation/ioctl-number.txt 2004-10-06 19:37:47 -07:00 @@ -117,6 +117,7 @@ 'c' 00-7F linux/comstats.h conflict! 'c' 00-7F linux/coda.h conflict! +'d' 00-FF linux/char/drm/drm/h conflict! 'd' 00-1F linux/devfs_fs.h conflict! 'd' 00-DF linux/video_decoder.h conflict! 'd' F0-FF linux/digi1.h diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt --- a/Documentation/kernel-parameters.txt 2004-10-06 19:37:48 -07:00 +++ b/Documentation/kernel-parameters.txt 2004-10-06 19:37:48 -07:00 @@ -97,9 +97,6 @@ See header of drivers/scsi/53c7xx.c. See also Documentation/scsi/ncr53c7xx.txt. - 98busmouse.irq= [HW,MOUSE] PC-9801 Bus Mouse Driver - Format: , default is 13 - acpi= [HW,ACPI] Advanced Configuration and Power Interface Format: { force | off | ht | strict } force -- enable ACPI if default was off @@ -532,6 +529,18 @@ isapnp= [ISAPNP] Format: , , , + + isolcpus= [KNL,SMP] Isolate CPUs from the general scheduler. + Format: , ..., + This option can be used to specify one or more CPUs + to isolate from the general SMP balancing and scheduling + algorithms. The only way to move a process onto or off + an "isolated" CPU is via the CPU affinity syscalls. + + This option is the preferred way to isolate CPUs. The + alternative - manually setting the CPU mask of all tasks + in the system can cause problems and suboptimal load + balancer performance. isp16= [HW,CD] Format: ,,, diff -Nru a/Documentation/networking/gen_stats.txt b/Documentation/networking/gen_stats.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/networking/gen_stats.txt 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,117 @@ +Generic networking statistics for netlink users +====================================================================== + +Statistic counters are grouped into structs: + +Struct TLV type Description +---------------------------------------------------------------------- +gnet_stats_basic TCA_STATS_BASIC Basic statistics +gnet_stats_rate_est TCA_STATS_RATE_EST Rate estimator +gnet_stats_queue TCA_STATS_QUEUE Queue statistics +none TCA_STATS_APP Application specific + + +Collecting: +----------- + +Declare the statistic structs you need: +struct mystruct { + struct gnet_stats_basic bstats; + struct gnet_stats_queue qstats; + ... +}; + +Update statistics: +mystruct->tstats.packet++; +mystruct->qstats.backlog += skb->pkt_len; + + +Export to userspace (Dump): +--------------------------- + +my_dumping_routine(struct sk_buff *skb, ...) +{ + struct gnet_dump dump; + + if (gnet_stats_start_copy(skb, TCA_STATS2, &mystruct->lock, &dump) < 0) + goto rtattr_failure; + + if (gnet_stats_copy_basic(&dump, &mystruct->bstats) < 0 || + gnet_stats_copy_queue(&dump, &mystruct->qstats) < 0 || + gnet_stats_copy_app(&dump, &xstats, sizeof(xstats)) < 0) + goto rtattr_failure; + + if (gnet_stats_finish_copy(&dump) < 0) + goto rtattr_failure; + ... +} + +TCA_STATS/TCA_XSTATS backward compatibility: +-------------------------------------------- + +Prior users of struct tc_stats and xstats can maintain backward +compatibility by calling the compat wrappers to keep providing the +existing TLV types. + +my_dumping_routine(struct sk_buff *skb, ...) +{ + if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, + TCA_XSTATS, &mystruct->lock, &dump) < 0) + goto rtattr_failure; + ... +} + +A struct tc_stats will be filled out during gnet_stats_copy_* calls +and appended to the skb. TCA_XSTATS is provided if gnet_stats_copy_app +was called. + + +Locking: +-------- + +Locks are taken before writing and released once all statistics have +been written. Locks are always released in case of an error. You +are responsible for making sure that the lock is initialized. + + +Rate Estimator: +-------------- + +0) Prepare an estimator attribute. Most likely this would be in user + space. The value of this TLV should contain a tc_estimator structure. + As usual, such a TLV nees to be 32 bit aligned and therefore the + length needs to be appropriately set etc. The estimator interval + and ewma log need to be converted to the appropriate values. + tc_estimator.c::tc_setup_estimator() is advisable to be used as the + conversion routine. It does a few clever things. It takes a time + interval in microsecs, a time constant also in microsecs and a struct + tc_estimator to be populated. The returned tc_estimator can be + transported to the kernel. Transfer such a structure in a TLV of type + TCA_RATE to your code in the kernel. + +In the kernel when setting up: +1) make sure you have basic stats and rate stats setup first. +2) make sure you have initialized stats lock that is used to setup such + stats. +3) Now initialize a new estimator: + + int ret = gen_new_estimator(my_basicstats,my_rate_est_stats, + mystats_lock, attr_with_tcestimator_struct); + + if ret == 0 + success + else + failed + +From now on, everytime you dump my_rate_est_stats it will contain +uptodate info. + +Once you are done, call gen_kill_estimator(my_basicstats, +my_rate_est_stats) Make sure that my_basicstats and my_rate_est_stats +are still valid (i.e still exist) at the time of making this call. + + +Authors: +-------- +Thomas Graf +Jamal Hadi Salim diff -Nru a/Documentation/powerpc/mpc52xx.txt b/Documentation/powerpc/mpc52xx.txt --- a/Documentation/powerpc/mpc52xx.txt 2004-10-06 19:37:47 -07:00 +++ b/Documentation/powerpc/mpc52xx.txt 2004-10-06 19:37:47 -07:00 @@ -1,7 +1,7 @@ Linux 2.6.x on MPC52xx family ----------------------------- -For the latest info, go to http://www.246tNt.com/mpc52xx/state.txt +For the latest info, go to http://www.246tNt.com/mpc52xx/ To compile/use : @@ -37,12 +37,3 @@ - Of course, I inspired myself from the 2.4 port. If you think I forgot to mention you/your company in the copyright of some code, I'll correct it ASAP. - - The codes wants the MBAR to be set at 0xf0000000 by the bootloader. It's - mapped 1:1 with the MMU. If for whatever reason, you want to change this, - beware that some code depends on the 0xf0000000 address and other depends - on the 1:1 mapping. - - Most of the code assumes that port multiplexing, frequency selection, ... - has already been done. IMHO this should be done as early as possible, in - the bootloader. If for whatever reason you can't do it there, do it in the - platform setup code (if U-Boot) or in the arch/ppc/boot/simple/... (if - DBug) diff -Nru a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt --- a/Documentation/scsi/scsi_mid_low_api.txt 2004-10-06 19:37:47 -07:00 +++ b/Documentation/scsi/scsi_mid_low_api.txt 2004-10-06 19:37:47 -07:00 @@ -1091,10 +1091,6 @@ * mid level does not recognize it, then the LLD that controls * the device receives the ioctl. According to recent Unix standards * unsupported ioctl() 'cmd' numbers should return -ENOTTY. - * However the mid level returns -EINVAL for unrecognized 'cmd' - * numbers when this function is not supplied by the driver. - * Unfortunately some applications expect -EINVAL and react badly - * when -ENOTTY is returned; stick with -EINVAL. * * Optionally defined in: LLD **/ diff -Nru a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt --- a/Documentation/sysctl/vm.txt 2004-10-06 19:37:47 -07:00 +++ b/Documentation/sysctl/vm.txt 2004-10-06 19:37:47 -07:00 @@ -47,7 +47,7 @@ When this flag is 1, the kernel pretends there is always enough memory until it actually runs out. -When this flag is 2, the kernel uses a "strict overcommit" +When this flag is 2, the kernel uses a "never overcommit" policy that attempts to prevent any overcommit of memory. This feature can be very useful because there are a lot of diff -Nru a/Documentation/tty.txt b/Documentation/tty.txt --- a/Documentation/tty.txt 2004-10-06 19:37:48 -07:00 +++ b/Documentation/tty.txt 2004-10-06 19:37:48 -07:00 @@ -60,8 +60,8 @@ set_termios() - Called on termios structure changes. The caller passes the old termios data and the current data - is in the tty. Called under the termios lock so - may not sleep. Serialized against itself only. + is in the tty. Called under the termios semaphore so + allowed to sleep. Serialized against itself only. read() - Move data from the line discipline to the user. Multiple read calls may occur in parallel and the @@ -158,8 +158,8 @@ ioctl() - Called when an ioctl may be for the driver -set_termios() - Called on termios change, may get parallel calls, - may block for now (may change that) +set_termios() - Called on termios change, serialized against + itself by a semaphore. May sleep. set_ldisc() - Notifier for discipline change. At the point this is done the discipline is not yet usable. Can now diff -Nru a/Documentation/vm/overcommit-accounting b/Documentation/vm/overcommit-accounting --- a/Documentation/vm/overcommit-accounting 2004-10-06 19:37:48 -07:00 +++ b/Documentation/vm/overcommit-accounting 2004-10-06 19:37:48 -07:00 @@ -1,4 +1,4 @@ -The Linux kernel supports three overcommit handling modes +The Linux kernel supports the following overcommit handling modes 0 - Heuristic overcommit handling. Obvious overcommits of address space are refused. Used for a typical system. It @@ -7,10 +7,10 @@ allocate slighly more memory in this mode. This is the default. -1 - No overcommit handling. Appropriate for some scientific +1 - Always overcommit. Appropriate for some scientific applications. -2 - (NEW) strict overcommit. The total address space commit +2 - Don't overcommit. The total address space commit for the system is not permitted to exceed swap + a configurable percentage (default is 50) of physical RAM. Depending on the percentage you use, in most situations @@ -27,7 +27,7 @@ The C language stack growth does an implicit mremap. If you want absolute guarantees and run close to the edge you MUST mmap your stack for the -largest size you think you will need. For typical stack usage is does +largest size you think you will need. For typical stack usage this does not matter much but it's a corner case if you really really care In mode 2 the MAP_NORESERVE flag is ignored. diff -Nru a/MAINTAINERS b/MAINTAINERS --- a/MAINTAINERS 2004-10-06 19:37:47 -07:00 +++ b/MAINTAINERS 2004-10-06 19:37:47 -07:00 @@ -632,9 +632,9 @@ S: Maintained DECnet NETWORK LAYER -P: Steven Whitehouse -M: SteveW@ACM.org -W: http://www.sucs.swan.ac.uk/~rohan/DECnet/index.html +P: Patrick Caulfield +M: patrick@tykepenguin.com +W: http://linux-decnet.sourceforge.net L: linux-decnet-user@lists.sourceforge.net S: Maintained @@ -1299,6 +1299,15 @@ M: benh@kernel.crashing.org W: http://www.penguinppc.org/ L: linuxppc-dev@lists.linuxppc.org +S: Maintained + +LINUX FOR POWERPC EMBEDDED MPC52XX +P: Sylvain Munaut +M: tnt@246tNt.com +W: http://www.246tNt.com/mpc52xx/ +W: http://www.penguinppc.org/ +L: linuxppc-dev@ozlabs.org +L: linuxppc-embedded@ozlabs.org S: Maintained LINUX FOR POWERPC EMBEDDED PPC4XX diff -Nru a/Makefile b/Makefile --- a/Makefile 2004-10-06 19:37:47 -07:00 +++ b/Makefile 2004-10-06 19:37:47 -07:00 @@ -326,7 +326,7 @@ KALLSYMS = scripts/kallsyms PERL = perl CHECK = sparse -CHECKFLAGS := +CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) diff -Nru a/arch/alpha/Makefile b/arch/alpha/Makefile --- a/arch/alpha/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/alpha/Makefile 2004-10-06 19:37:47 -07:00 @@ -11,7 +11,7 @@ NM := $(NM) -B LDFLAGS_vmlinux := -static -N #-relax -CHECKFLAGS += -D__alpha__=1 +CHECKFLAGS += -D__alpha__ cflags-y := -pipe -mno-fp-regs -ffixed-8 # Determine if we can use the BWX instructions with GAS. diff -Nru a/arch/arm/Makefile b/arch/arm/Makefile --- a/arch/arm/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/Makefile 2004-10-06 19:37:47 -07:00 @@ -57,7 +57,7 @@ CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call cc-option,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -CHECKFLAGS += -D__arm__=1 +CHECKFLAGS += -D__arm__ #Default value DATAADDR := . diff -Nru a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S --- a/arch/arm/boot/compressed/head.S 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/boot/compressed/head.S 2004-10-06 19:37:47 -07:00 @@ -349,6 +349,14 @@ LC1: .word reloc_end - reloc_start .size LC0, . - LC0 +#ifdef CONFIG_ARCH_RPC + .globl params +params: ldr r0, =params_phys + mov pc, lr + .ltorg + .align +#endif + /* * Turn on the cache. We need to setup some page tables so that we * can have both the I and D caches on. diff -Nru a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S --- a/arch/arm/kernel/calls.S 2004-10-06 19:37:48 -07:00 +++ b/arch/arm/kernel/calls.S 2004-10-06 19:37:48 -07:00 @@ -1,7 +1,7 @@ /* * linux/arch/arm/kernel/calls.S * - * Copyright (C) 1995-2003 Russell King + * Copyright (C) 1995-2004 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 @@ -288,6 +288,13 @@ .long sys_pciconfig_iobase .long sys_pciconfig_read .long sys_pciconfig_write + .long sys_mq_open +/* 275 */ .long sys_mq_unlink + .long sys_mq_timedsend + .long sys_mq_timedreceive + .long sys_mq_notify + .long sys_mq_getsetattr +/* 280 */ .long sys_waitid __syscall_end: .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 diff -Nru a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c --- a/arch/arm/kernel/ecard.c 2004-10-06 19:37:48 -07:00 +++ b/arch/arm/kernel/ecard.c 2004-10-06 19:37:48 -07:00 @@ -224,7 +224,7 @@ static pid_t ecard_pid; static wait_queue_head_t ecard_wait; static struct ecard_request *ecard_req; - +static DECLARE_MUTEX(ecard_sem); static DECLARE_COMPLETION(ecard_completion); /* @@ -282,8 +282,6 @@ static int ecard_task(void * unused) { - struct task_struct *tsk = current; - daemonize("kecardd"); /* @@ -298,16 +296,11 @@ while (1) { struct ecard_request *req; - do { - req = xchg(&ecard_req, NULL); - - if (req == NULL) { - sigemptyset(&tsk->pending.signal); - interruptible_sleep_on(&ecard_wait); - } - } while (req == NULL); + wait_event_interruptible(ecard_wait, ecard_req != NULL); - ecard_do_request(req); + req = xchg(&ecard_req, NULL); + if (req != NULL) + ecard_do_request(req); complete(&ecard_completion); } } @@ -330,6 +323,7 @@ if (ecard_pid <= 0) ecard_pid = kernel_thread(ecard_task, NULL, CLONE_KERNEL); + down(&ecard_sem); ecard_req = req; wake_up(&ecard_wait); @@ -337,6 +331,7 @@ * Now wait for kecardd to run. */ wait_for_completion(&ecard_completion); + up(&ecard_sem); } /* ======================= Mid-level card control ===================== */ diff -Nru a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c --- a/arch/arm/kernel/irq.c 2004-10-06 19:37:46 -07:00 +++ b/arch/arm/kernel/irq.c 2004-10-06 19:37:46 -07:00 @@ -46,6 +46,7 @@ */ #define MAX_IRQ_CNT 100000 +static int noirqdebug; static volatile unsigned long irq_err_count; static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED; static LIST_HEAD(irq_pending); @@ -235,7 +236,7 @@ static int count = 100; struct irqaction *action; - if (!count) + if (!count || noirqdebug) return; count--; @@ -863,3 +864,11 @@ init_arch_irq(); init_dma(); } + +static int __init noirqdebug_setup(char *str) +{ + noirqdebug = 1; + return 1; +} + +__setup("noirqdebug", noirqdebug_setup); diff -Nru a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c --- a/arch/arm/kernel/signal.c 2004-10-06 19:37:46 -07:00 +++ b/arch/arm/kernel/signal.c 2004-10-06 19:37:46 -07:00 @@ -409,6 +409,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, int framesize) { unsigned long sp = regs->ARM_sp; + void __user *frame; #ifdef CONFIG_IWMMXT if (test_thread_flag(TIF_USING_IWMMXT)) @@ -424,7 +425,15 @@ /* * ATPCS B01 mandates 8-byte alignment */ - return (void __user *)((sp - framesize) & ~7); + frame = (void __user *)((sp - framesize) & ~7); + + /* + * Check that we can actually write to the signal frame. + */ + if (!access_ok(VERIFY_WRITE, frame, framesize)) + frame = NULL; + + return frame; } static int @@ -493,7 +502,7 @@ struct sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame)); int err = 0; - if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) + if (!frame) return 1; err |= setup_sigcontext(&frame->sc, /*&frame->fpstate,*/ regs, set->sig[0]); @@ -522,7 +531,7 @@ stack_t stack; int err = 0; - if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) + if (!frame) return 1; __put_user_error(&frame->info, &frame->pinfo, err); diff -Nru a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c --- a/arch/arm/kernel/time.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/kernel/time.c 2004-10-06 19:37:47 -07:00 @@ -304,6 +304,39 @@ EXPORT_SYMBOL(do_settimeofday); +/** + * save_time_delta - Save the offset between system time and RTC time + * @delta: pointer to timespec to store delta + * @rtc: pointer to timespec for current RTC time + * + * Return a delta between the system time and the RTC time, such + * that system time can be restored later with restore_time_delta() + */ +void save_time_delta(struct timespec *delta, struct timespec *rtc) +{ + set_normalized_timespec(delta, + xtime.tv_sec - rtc->tv_sec, + xtime.tv_nsec - rtc->tv_nsec); +} +EXPORT_SYMBOL(save_time_delta); + +/** + * restore_time_delta - Restore the current system time + * @delta: delta returned by save_time_delta() + * @rtc: pointer to timespec for current RTC time + */ +void restore_time_delta(struct timespec *delta, struct timespec *rtc) +{ + struct timespec ts; + + set_normalized_timespec(&ts, + delta->tv_sec + rtc->tv_sec, + delta->tv_nsec + rtc->tv_nsec); + + do_settimeofday(&ts); +} +EXPORT_SYMBOL(restore_time_delta); + void timer_tick(struct pt_regs *regs) { profile_tick(CPU_PROFILING, regs); diff -Nru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c --- a/arch/arm/mach-imx/time.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-imx/time.c 2004-10-06 19:37:47 -07:00 @@ -25,7 +25,7 @@ #define TIMER_BASE IMX_TIM1_BASE /* - * Returns number of ms since last clock interrupt. Note that interrupts + * Returns number of us since last clock interrupt. Note that interrupts * will have been disabled by do_gettimeoffset() */ static unsigned long @@ -39,7 +39,7 @@ * an interrupt. We get around this by ensuring that the * counter has not reloaded between our two reads. */ - ticks = IMX_TCR(TIMER_BASE); + ticks = IMX_TCN(TIMER_BASE); /* * Interrupt pending? If so, we've reloaded once already. @@ -84,7 +84,7 @@ */ IMX_TCTL(TIMER_BASE) = 0; IMX_TPRER(TIMER_BASE) = 0; - IMX_TCMP(TIMER_BASE) = LATCH; + IMX_TCMP(TIMER_BASE) = LATCH - 1; IMX_TCTL(TIMER_BASE) = TCTL_CLK_32 | TCTL_IRQEN | TCTL_TEN; /* diff -Nru a/arch/arm/mach-integrator/clock.c b/arch/arm/mach-integrator/clock.c --- a/arch/arm/mach-integrator/clock.c 2004-10-06 19:37:48 -07:00 +++ b/arch/arm/mach-integrator/clock.c 2004-10-06 19:37:48 -07:00 @@ -76,7 +76,10 @@ long clk_round_rate(struct clk *clk, unsigned long rate) { - return rate; + struct icst525_vco vco; + + vco = icst525_khz_to_vco(clk->params, rate / 1000); + return icst525_khz(clk->params, vco) * 1000; } EXPORT_SYMBOL(clk_round_rate); @@ -86,8 +89,8 @@ if (clk->setvco) { struct icst525_vco vco; - vco = icst525_khz_to_vco(clk->params, rate); - clk->rate = icst525_khz(clk->params, vco); + vco = icst525_khz_to_vco(clk->params, rate / 1000); + clk->rate = icst525_khz(clk->params, vco) * 1000; printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", clk->name, vco.s, vco.r, vco.v); diff -Nru a/arch/arm/mach-iop3xx/iop331-pci.c b/arch/arm/mach-iop3xx/iop331-pci.c --- a/arch/arm/mach-iop3xx/iop331-pci.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-iop3xx/iop331-pci.c 2004-10-06 19:37:47 -07:00 @@ -208,12 +208,10 @@ DBG("\tATU: IOP331_IABAR2=0x%08x IOP331_IALR2=0x%08x IOP331_IATVR2=%08x\n", *IOP331_IABAR2, *IOP331_IALR2, *IOP331_IATVR2); DBG("\tATU: IOP331_IABAR3=0x%08x IOP331_IALR3=0x%08x IOP331_IATVR3=%08x\n", *IOP331_IABAR3, *IOP331_IALR3, *IOP331_IATVR3); -#if 0 - hook_fault_code(4, iop331_pci_abort, SIGBUS, "external abort on linefetch"); - hook_fault_code(6, iop331_pci_abort, SIGBUS, "external abort on linefetch"); - hook_fault_code(8, iop331_pci_abort, SIGBUS, "external abort on non-linefetch"); - hook_fault_code(10, iop331_pci_abort, SIGBUS, "external abort on non-linefetch"); -#endif + /* redboot changed, reset IABAR0 to something sane */ + /* fixes master aborts in plugged in cards */ + /* will clean up later and work nicely with redboot */ + *IOP331_IABAR0 = 0x00000004; hook_fault_code(16+6, iop331_pci_abort, SIGBUS, "imprecise external abort"); } diff -Nru a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c --- a/arch/arm/mach-pxa/pm.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-pxa/pm.c 2004-10-06 19:37:47 -07:00 @@ -21,6 +21,7 @@ #include #include #include +#include /* @@ -69,14 +70,16 @@ { unsigned long sleep_save[SLEEP_SAVE_SIZE]; unsigned long checksum = 0; - unsigned long delta; + struct timespec delta, rtc; int i; if (state != PM_SUSPEND_MEM) return -EINVAL; /* preserve current time */ - delta = xtime.tv_sec - RCNR; + rtc.tv_sec = RCNR; + rtc.tv_nsec = 0; + save_time_delta(&delta, &rtc); /* save vital registers */ SAVE(OSMR0); @@ -161,7 +164,8 @@ RESTORE(ICMR); /* restore current time */ - xtime.tv_sec = RCNR + delta; + rtc.tv_sec = RCNR; + restore_time_delta(&delta, &rtc); #ifdef DEBUG printk(KERN_DEBUG "*** made it back from resume\n"); diff -Nru a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S --- a/arch/arm/mach-pxa/sleep.S 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-pxa/sleep.S 2004-10-06 19:37:47 -07:00 @@ -16,6 +16,8 @@ #include #include +#include + .text /* @@ -64,6 +66,37 @@ @ prepare pointer to physical address 0 (virtual mapping in generic.c) mov r2, #UNCACHED_PHYS_0 + @ Intel PXA255 Specification Update notes problems + @ about suspending with PXBus operating above 133MHz + @ (see Errata 31, GPIO output signals, ... unpredictable in sleep + @ + @ We keep the change-down close to the actual suspend on SDRAM + @ as possible to eliminate messing about with the refresh clock + @ as the system will restore with the original speed settings + @ + @ Ben Dooks, 13-Sep-2004 + + ldr r6, =CCCR + ldr r8, [r6] @ keep original value for resume + + @ ensure x1 for run and turbo mode with memory clock + bic r7, r8, #CCCR_M_MASK | CCCR_N_MASK + orr r7, r7, #(1<<5) | (2<<7) + + @ check that the memory frequency is within limits + and r14, r7, #CCCR_L_MASK + teq r14, #1 + bicne r7, r7, #CCCR_L_MASK + orrne r7, r7, #1 @@ 99.53MHz + + @ get ready for the change + @ note, since we are making turbo=run, do not remove the turbo + @ as this may cause non-turbo mode on resume + mrc p14, 0, r0, c6, c0, 0 + bic r0, r0, #2 @ clear change bit + mcr p14, 0, r0, c6, c0, 0 + orr r0, r0, #2 @ initiate change bit + @ align execution to a cache line b 1f @@ -74,6 +107,13 @@ @ All needed values are now in registers. @ These last instructions should be in cache + @ initiate the frequency change... + str r7, [r6] + mcr p14, 0, r0, c6, c0, 0 + + @ restore the original cpu speed value for resume + str r8, [r6] + @ put SDRAM into self-refresh str r5, [r4] @@ -83,8 +123,7 @@ @ enter sleep mode mcr p14, 0, r1, c7, c0, 0 -20: nop - b 20b @ loop waiting for sleep +20: b 20b @ loop waiting for sleep /* * cpu_pxa_resume() diff -Nru a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile --- a/arch/arm/mach-s3c2410/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-s3c2410/Makefile 2004-10-06 19:37:47 -07:00 @@ -21,8 +21,8 @@ # machine specific support -obj-$(CONFIG_ARCH_BAST) += mach-bast.o +obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o obj-$(CONFIG_ARCH_H1940) += mach-h1940.o obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o -obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o +obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o usb-simtec.o diff -Nru a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c --- a/arch/arm/mach-s3c2410/gpio.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-s3c2410/gpio.c 2004-10-06 19:37:47 -07:00 @@ -23,6 +23,11 @@ * 13-Sep-2004 BJD Implemented change of MISCCR * 14-Sep-2004 BJD Added getpin call * 14-Sep-2004 BJD Fixed bug in setpin() call + * 30-Sep-2004 BJD Fixed cfgpin() mask bug + * 01-Oct-2004 BJD Added getcfg() to get pin configuration + * 01-Oct-2004 BJD Fixed mask bug in pullup() call + * 01-Oct-2004 BJD Added getirq() to turn pin into irqno + * 04-Oct-2004 BJD Added irq filter controls for GPIO */ @@ -40,23 +45,20 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function) { unsigned long base = S3C2410_GPIO_BASE(pin); - unsigned long shift = 1; - unsigned long mask = 3; + unsigned long mask; unsigned long con; unsigned long flags; if (pin < S3C2410_GPIO_BANKB) { - shift = 0; - mask = 1; + mask = 1 << S3C2410_GPIO_OFFSET(pin); + } else { + mask = 3 << S3C2410_GPIO_OFFSET(pin)*2; } - mask <<= S3C2410_GPIO_OFFSET(pin); - local_irq_save(flags); - con = __raw_readl(base + 0x00); - - con &= mask << shift; + con = __raw_readl(base + 0x00); + con &= ~mask; con |= function; __raw_writel(con, base + 0x00); @@ -64,6 +66,20 @@ local_irq_restore(flags); } +unsigned int s3c2410_gpio_getcfg(unsigned int pin) +{ + unsigned long base = S3C2410_GPIO_BASE(pin); + unsigned long mask; + + if (pin < S3C2410_GPIO_BANKB) { + mask = 1 << S3C2410_GPIO_OFFSET(pin); + } else { + mask = 3 << S3C2410_GPIO_OFFSET(pin)*2; + } + + return __raw_readl(base) & mask; +} + void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) { unsigned long base = S3C2410_GPIO_BASE(pin); @@ -77,7 +93,7 @@ local_irq_save(flags); up = __raw_readl(base + 0x08); - up &= 1 << offs; + up &= ~(1L << offs); up |= to << offs; __raw_writel(up, base + 0x08); @@ -122,4 +138,57 @@ local_irq_restore(flags); return misccr; +} + +int s3c2410_gpio_getirq(unsigned int pin) +{ + if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15_EINT23) + return -1; /* not valid interrupts */ + + if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7) + return -1; /* not valid pin */ + + if (pin < S3C2410_GPF4) + return (pin - S3C2410_GPF0) + IRQ_EINT0; + + if (pin < S3C2410_GPG0) + return (pin - S3C2410_GPF4) + IRQ_EINT4; + + return (pin - S3C2410_GPG0) + IRQ_EINT8; +} + +int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, + unsigned int config) +{ + unsigned long reg = S3C2410_EINFLT0; + unsigned long flags; + unsigned long val; + + if (pin < S3C2410_GPG8 || pin > S3C2410_GPG15) + return -1; + + config &= 0xff; + + pin -= S3C2410_GPG8_EINT16; + reg += pin & ~3; + + local_irq_save(flags); + + /* update filter width and clock source */ + + val = __raw_readl(reg); + val &= ~(0xff << ((pin & 3) * 8)); + val |= config << ((pin & 3) * 8); + __raw_writel(val, reg); + + /* update filter enable */ + + val = __raw_readl(S3C2410_EXTINT2); + val &= ~(1 << ((pin * 4) + 3)); + val |= on << ((pin * 4) + 3); + __raw_writel(val, S3C2410_EXTINT2); + + local_irq_restore(flags); + + return 0; } diff -Nru a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c --- a/arch/arm/mach-s3c2410/irq.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-s3c2410/irq.c 2004-10-06 19:37:47 -07:00 @@ -1,7 +1,7 @@ /* linux/arch/arm/mach-s3c2410/irq.c * * Copyright (c) 2003,2004 Simtec Electronics - * Ben Dooks + * 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 @@ -27,7 +27,13 @@ * * 21-Jul-2004 Arnaud Patard (Rtp) * Addition of ADC/TC demux - */ + * + * 04-Oct-2004 Klaus Fetscher + * Fix for set_irq_type() on low EINT numbers + * + * 05-Oct-2004 Ben Dooks + * Tidy up KF's patch and sort out new release +*/ #include @@ -46,9 +52,6 @@ #include #include -#if 0 -#include -#endif #define irqdbf(x...) #define irqdbf2(x...) @@ -195,13 +198,20 @@ unsigned long gpcon_offset, extint_offset; unsigned long newvalue = 0, value; - if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT7)) + if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3)) { gpcon_reg = S3C2410_GPFCON; extint_reg = S3C2410_EXTINT0; gpcon_offset = (irq - IRQ_EINT0) * 2; extint_offset = (irq - IRQ_EINT0) * 4; } + else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7)) + { + gpcon_reg = S3C2410_GPFCON; + extint_reg = S3C2410_EXTINT0; + gpcon_offset = (irq - (EXTINT_OFF)) * 2; + extint_offset = (irq - (EXTINT_OFF)) * 4; + } else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15)) { gpcon_reg = S3C2410_GPGCON; @@ -269,6 +279,13 @@ .type = s3c_irqext_type }; +static struct irqchip s3c_irq_eint0t4 = { + .ack = s3c_irq_ack, + .mask = s3c_irq_mask, + .unmask = s3c_irq_unmask, + .type = s3c_irqext_type +}; + /* mask values for the parent registers for each of the interrupt types */ #define INTMSK_UART0 (1UL << (IRQ_UART0 - IRQ_EINT0)) @@ -549,6 +566,7 @@ void __init s3c2410_init_irq(void) { unsigned long pend; + unsigned long last; int irqno; int i; @@ -556,48 +574,51 @@ /* first, clear all interrupts pending... */ + last = 0; for (i = 0; i < 4; i++) { pend = __raw_readl(S3C2410_EINTPEND); - if (pend == 0) + + if (pend == 0 || pend == last) break; + __raw_writel(pend, S3C2410_EINTPEND); printk("irq: clearing pending ext status %08x\n", (int)pend); + last = pend; } + last = 0; for (i = 0; i < 4; i++) { pend = __raw_readl(S3C2410_INTPND); - if (pend == 0) + + if (pend == 0 || pend == last) break; + __raw_writel(pend, S3C2410_SRCPND); __raw_writel(pend, S3C2410_INTPND); printk("irq: clearing pending status %08x\n", (int)pend); + last = pend; } + last = 0; for (i = 0; i < 4; i++) { pend = __raw_readl(S3C2410_SUBSRCPND); - if (pend == 0) + if (pend == 0 || pend == last) break; printk("irq: clearing subpending status %08x\n", (int)pend); __raw_writel(pend, S3C2410_SUBSRCPND); + last = pend; } /* register the main interrupts */ irqdbf("s3c2410_init_irq: registering s3c2410 interrupt handlers\n"); - for (irqno = IRQ_EINT0; irqno <= IRQ_ADCPARENT; irqno++) { + for (irqno = IRQ_BATT_FLT; irqno <= IRQ_ADCPARENT; irqno++) { /* set all the s3c2410 internal irqs */ switch (irqno) { - - case IRQ_EINT4t7: - case IRQ_EINT8t23: - /* these are already dealt with, so should never - * appear */ - break; - /* deal with the special IRQs (cascaded) */ case IRQ_UART0: @@ -631,6 +652,13 @@ /* external interrupts */ + + for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) { + irqdbf("registering irq %d (ext int)\n", irqno); + set_irq_chip(irqno, &s3c_irq_eint0t4); + set_irq_handler(irqno, do_edge_IRQ); + set_irq_flags(irqno, IRQF_VALID); + } for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) { irqdbf("registering irq %d (extended s3c irq)\n", irqno); 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-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-s3c2410/mach-bast.c 2004-10-06 19:37:47 -07:00 @@ -10,6 +10,7 @@ * published by the Free Software Foundation. * * Modifications: + * 14-Sep-2004 BJD USB power control * 20-Aug-2004 BJD Added s3c2410_board struct * 18-Aug-2004 BJD Added platform devices from default set * 16-May-2003 BJD Created initial version @@ -44,6 +45,7 @@ #include "s3c2410.h" #include "devs.h" #include "cpu.h" +#include "usb-simtec.h" /* macros for virtual address mods for the io space entries */ #define VA_C5(item) ((item) + BAST_VAM_CS5) @@ -215,6 +217,7 @@ s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); s3c2410_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs)); s3c2410_set_board(&bast_board); + usb_simtec_init(); } void __init bast_init_irq(void) 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-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-s3c2410/mach-vr1000.c 2004-10-06 19:37:47 -07:00 @@ -11,6 +11,7 @@ * published by the Free Software Foundation. * * Modifications: + * 14-Sep-2004 BJD USB Power control * 04-Sep-2004 BJD Added new uart init, and io init * 21-Aug-2004 BJD Added struct s3c2410_board * 06-Aug-2004 BJD Fixed call to time initialisation @@ -42,6 +43,7 @@ #include "s3c2410.h" #include "devs.h" #include "cpu.h" +#include "usb-simtec.h" /* macros for virtual address mods for the io space entries */ #define VA_C5(item) ((item) + BAST_VAM_CS5) @@ -160,6 +162,7 @@ s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc)); s3c2410_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs)); s3c2410_set_board(&vr1000_board); + usb_simtec_init(); } void __init vr1000_init_irq(void) diff -Nru a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-s3c2410/usb-simtec.c 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,123 @@ +/* linux/arch/arm/mach-s3c2410/usb-simtec.c + * + * Copyright (c) 2004 Simtec Electronics + * Ben Dooks + * + * http://www.simtec.co.uk/products/EB2410ITX/ + * + * Simtec BAST and Thorcom VR1000 USB port support functions + * + * 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. + * + * Modifications: + * 14-Sep-2004 BJD Created +*/ + +#define DEBUG + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "devs.h" +#include "usb-simtec.h" + +/* control power and monitor over-current events on various Simtec + * designed boards. +*/ + +static void +usb_simtec_powercontrol(int port, int to) +{ + pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); + + if (port == 1) { + s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1); + pr_debug("GPBDAT now %08x\n", __raw_readl(S3C2410_GPBDAT)); + } +} + +static irqreturn_t +usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs) +{ + struct s3c2410_hcd_info *info = (struct s3c2410_hcd_info *)pw; + + if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { + pr_debug("usb_simtec: over-current irq (oc detected)\n"); + s3c2410_report_oc(info, 3); + } else { + pr_debug("usb_simtec: over-current irq (oc cleared)\n"); + } + + return IRQ_HANDLED; +} + +static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on) +{ + int ret; + + if (on) { + pr_debug("claiming usb overccurent\n"); + ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, SA_INTERRUPT, + "usb-oc", info); + if (ret != 0) { + printk(KERN_ERR "failed to request usb oc irq\n"); + } + + set_irq_type(IRQ_USBOC, IRQT_BOTHEDGE); + } else { + free_irq(IRQ_USBOC, NULL); + } +} + +static struct s3c2410_hcd_info usb_simtec_info = { + .port[0] = { + .flags = S3C_HCDFLG_USED + }, + .port[1] = { + .flags = S3C_HCDFLG_USED + }, + + .power_control = usb_simtec_powercontrol, + .enable_oc = usb_simtec_enableoc, +}; + + +int usb_simtec_init(void) +{ + printk("USB Power Control, (c) 2004 Simtec Electronics\n"); + s3c_device_usb.dev.platform_data = &usb_simtec_info; + + s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP); + s3c2410_gpio_setpin(S3C2410_GPB4, 1); + + pr_debug("GPB: CON=%08x, DAT=%08x\n", + __raw_readl(S3C2410_GPBCON), __raw_readl(S3C2410_GPBDAT)); + + if (0) { + s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST, + S3C2410_MISCCR_USBDEV); + } + + return 0; +} diff -Nru a/arch/arm/mach-s3c2410/usb-simtec.h b/arch/arm/mach-s3c2410/usb-simtec.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/arm/mach-s3c2410/usb-simtec.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,19 @@ +/* linux/arch/arm/mach-s3c2410/usb-simtec.c + * + * Copyright (c) 2004 Simtec Electronics + * Ben Dooks + * + * http://www.simtec.co.uk/products/EB2410ITX/ + * + * Simtec BAST and Thorcom VR1000 USB port support functions + * + * 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. + * + * Modifications: + * 20-Aug-2004 BJD Created +*/ + +extern int usb_simtec_init(void); + diff -Nru a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c --- a/arch/arm/mach-sa1100/pm.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mach-sa1100/pm.c 2004-10-06 19:37:47 -07:00 @@ -30,6 +30,7 @@ #include #include #include +#include extern void sa1100_cpu_suspend(void); extern void sa1100_cpu_resume(void); @@ -58,14 +59,16 @@ static int sa11x0_pm_enter(u32 state) { - unsigned long sleep_save[SLEEP_SAVE_SIZE]; - unsigned long delta, gpio; + unsigned long gpio, sleep_save[SLEEP_SAVE_SIZE]; + struct timespec delta, rtc; if (state != PM_SUSPEND_MEM) return -EINVAL; /* preserve current time */ - delta = xtime.tv_sec - RCNR; + rtc.tv_sec = RCNR; + rtc.tv_nsec = 0; + save_time_delta(&delta, &rtc); gpio = GPLR; /* save vital registers */ @@ -136,7 +139,8 @@ OSCR = OSMR0 - LATCH; /* restore current time */ - xtime.tv_sec = RCNR + delta; + rtc.tv_sec = RCNR; + restore_time_delta(&delta, &rtc); return 0; } diff -Nru a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c --- a/arch/arm/mach-versatile/clock.c 2004-10-06 19:37:46 -07:00 +++ b/arch/arm/mach-versatile/clock.c 2004-10-06 19:37:46 -07:00 @@ -87,8 +87,8 @@ if (clk->setvco) { struct icst525_vco vco; - vco = icst525_khz_to_vco(clk->params, rate); - clk->rate = icst525_khz(clk->params, vco); + vco = icst525_khz_to_vco(clk->params, rate / 1000); + clk->rate = icst525_khz(clk->params, vco) * 1000; printk("Clock %s: setting VCO reg params: S=%d R=%d V=%d\n", clk->name, vco.s, vco.r, vco.v); diff -Nru a/arch/arm/mm/abort-ev5tj.S b/arch/arm/mm/abort-ev5tj.S --- a/arch/arm/mm/abort-ev5tj.S 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mm/abort-ev5tj.S 2004-10-06 19:37:47 -07:00 @@ -23,7 +23,6 @@ mrc p15, 0, r0, c6, c0, 0 @ get FAR bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR tst r3, #PSR_J_BIT @ Java? - orrne r1, r1, #1 << 11 @ always assume write movne pc, lr tst r3, #PSR_T_BIT @ Thumb? ldrneh r3, [r2] @ read aborted thumb instruction diff -Nru a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c --- a/arch/arm/mm/consistent.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/mm/consistent.c 2004-10-06 19:37:47 -07:00 @@ -138,7 +138,7 @@ struct page *page; struct vm_region *c; unsigned long order; - u64 mask = 0x00ffffff, limit; /* ISA default */ + u64 mask = ISA_DMA_THRESHOLD, limit; if (!consistent_pte) { printk(KERN_ERR "%s: not initialised\n", __func__); @@ -148,19 +148,34 @@ if (dev) { mask = dev->coherent_dma_mask; + + /* + * Sanity check the DMA mask - it must be non-zero, and + * must be able to be satisfied by a DMA allocation. + */ if (mask == 0) { dev_warn(dev, "coherent DMA mask is unset\n"); - return NULL; + goto no_page; + } + + if ((~mask) & ISA_DMA_THRESHOLD) { + dev_warn(dev, "coherent DMA mask %#llx is smaller " + "than system GFP_DMA mask %#llx\n", + mask, (unsigned long long)ISA_DMA_THRESHOLD); + goto no_page; } } + /* + * Sanity check the allocation size. + */ size = PAGE_ALIGN(size); limit = (mask + 1) & ~mask; - if ((limit && size >= limit) || size >= (CONSISTENT_END - CONSISTENT_BASE)) { - printk(KERN_WARNING "coherent allocation too big (requested %#x mask %#Lx)\n", - size, mask); - *handle = ~0; - return NULL; + if ((limit && size >= limit) || + size >= (CONSISTENT_END - CONSISTENT_BASE)) { + printk(KERN_WARNING "coherent allocation too big " + "(requested %#x mask %#llx)\n", size, mask); + goto no_page; } order = get_order(size); @@ -221,6 +236,7 @@ if (page) __free_pages(page, order); no_page: + *handle = ~0; return NULL; } diff -Nru a/arch/arm/mm/init.c b/arch/arm/mm/init.c --- a/arch/arm/mm/init.c 2004-10-06 19:37:46 -07:00 +++ b/arch/arm/mm/init.c 2004-10-06 19:37:46 -07:00 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -590,7 +591,7 @@ * anywhere without overcommit, so turn * it on by default. */ - sysctl_overcommit_memory = 1; + sysctl_overcommit_memory = OVERCOMMIT_ALWAYS; } } diff -Nru a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types --- a/arch/arm/tools/mach-types 2004-10-06 19:37:47 -07:00 +++ b/arch/arm/tools/mach-types 2004-10-06 19:37:47 -07:00 @@ -6,7 +6,7 @@ # To add an entry into this database, please see Documentation/arm/README, # or contact rmk@arm.linux.org.uk # -# Last update: Mon Aug 16 19:22:37 2004 +# Last update: Thu Sep 30 15:23:21 2004 # # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number # @@ -519,7 +519,7 @@ omap_h3 MACH_OMAP_H3 OMAP_H3 509 omap_h4 MACH_OMAP_H4 OMAP_H4 510 n10 MACH_N10 N10 511 -montajade MACH_MONTAJADE MONTAJADE 512 +montejade MACH_MONTAJADE MONTAJADE 512 sg560 MACH_SG560 SG560 513 dp1000 MACH_DP1000 DP1000 514 omap_osk MACH_OMAP_OSK OMAP_OSK 515 @@ -582,7 +582,36 @@ computime MACH_COMPUTIME COMPUTIME 572 izarus MACH_IZARUS IZARUS 573 pxa_rts MACH_RTS RTS 574 -netgate5100 MACH_NETGATE5100 NETGATE5100 575 +se5100 MACH_SE5100 SE5100 575 s3c2510 MACH_S3C2510 S3C2510 576 csb437tl MACH_CSB437TL CSB437TL 577 slauson MACH_SLAUSON SLAUSON 578 +pearlriver MACH_PEARLRIVER PEARLRIVER 579 +tdc_p210 MACH_TDC_P210 TDC_P210 580 +sg580 MACH_SG580 SG580 581 +wrsbcarm7 MACH_WRSBCARM7 WRSBCARM7 582 +ipd MACH_IPD IPD 583 +pxa_dnp2110 MACH_PXA_DNP2110 PXA_DNP2110 584 +xaeniax MACH_XAENIAX XAENIAX 585 +somn4250 MACH_SOMN4250 SOMN4250 586 +pleb2 MACH_PLEB2 PLEB2 587 +cwl MACH_CWL CWL 588 +gd MACH_GD GD 589 +chaffee MACH_CHAFFEE CHAFFEE 590 +rms101 MACH_RMS101 RMS101 591 +rx3715 MACH_RX3715 RX3715 592 +swift MACH_SWIFT SWIFT 593 +roverp7 MACH_ROVERP7 ROVERP7 594 +pr818s MACH_PR818S PR818S 595 +trxpro MACH_TRXPRO TRXPRO 596 +nslu2 MACH_NSLU2 NSLU2 597 +e400 MACH_E400 E400 598 +trab MACH_TRAB TRAB 599 +cmc_pu2 MACH_CMC_PU2 CMC_PU2 600 +fulcrum MACH_FULCRUM FULCRUM 601 +netgate42x MACH_NETGATE42X NETGATE42X 602 +str710 MACH_STR710 STR710 603 +ixdpg425 MACH_IXDPG425 IXDPG425 604 +tomtomgo MACH_TOMTOMGO TOMTOMGO 605 +versatile_ab MACH_VERSATILE_AB VERSATILE_AB 606 +edb9307 MACH_EDB9307 EDB9307 607 diff -Nru a/arch/arm26/mm/init.c b/arch/arm26/mm/init.c --- a/arch/arm26/mm/init.c 2004-10-06 19:37:47 -07:00 +++ b/arch/arm26/mm/init.c 2004-10-06 19:37:47 -07:00 @@ -376,7 +376,7 @@ * Turn on overcommit on tiny machines */ if (PAGE_SIZE >= 16384 && num_physpages <= 128) { - sysctl_overcommit_memory = 1; + sysctl_overcommit_memory = OVERCOMMIT_ALWAYS; printk("Turning on overcommit\n"); } } diff -Nru a/arch/i386/Makefile b/arch/i386/Makefile --- a/arch/i386/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/i386/Makefile 2004-10-06 19:37:47 -07:00 @@ -18,7 +18,7 @@ LDFLAGS := -m elf_i386 OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := -CHECKFLAGS += -D__i386__=1 +CHECKFLAGS += -D__i386__ CFLAGS += -pipe -msoft-float diff -Nru a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c --- a/arch/i386/kernel/kprobes.c 2004-10-06 19:37:47 -07:00 +++ b/arch/i386/kernel/kprobes.c 2004-10-06 19:37:47 -07:00 @@ -267,26 +267,26 @@ switch (val) { case DIE_INT3: if (kprobe_handler(args->regs)) - return NOTIFY_OK; + return NOTIFY_STOP; break; case DIE_DEBUG: if (post_kprobe_handler(args->regs)) - return NOTIFY_OK; + return NOTIFY_STOP; break; case DIE_GPF: if (kprobe_running() && kprobe_fault_handler(args->regs, args->trapnr)) - return NOTIFY_OK; + return NOTIFY_STOP; break; case DIE_PAGE_FAULT: if (kprobe_running() && kprobe_fault_handler(args->regs, args->trapnr)) - return NOTIFY_OK; + return NOTIFY_STOP; break; default: break; } - return NOTIFY_BAD; + return NOTIFY_DONE; } int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c 2004-10-06 19:37:47 -07:00 +++ b/arch/i386/kernel/traps.c 2004-10-06 19:37:47 -07:00 @@ -459,7 +459,7 @@ info.si_code = sicode; \ info.si_addr = (void __user *)siaddr; \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ - == NOTIFY_OK) \ + == NOTIFY_STOP) \ return; \ do_trap(trapnr, signr, str, 1, regs, error_code, &info); \ } @@ -528,7 +528,7 @@ gp_in_kernel: if (!fixup_exception(regs)) { if (notify_die(DIE_GPF, "general protection fault", regs, - error_code, 13, SIGSEGV) == NOTIFY_OK); + error_code, 13, SIGSEGV) == NOTIFY_STOP); return; die("general protection fault", regs, error_code); } @@ -602,7 +602,7 @@ if (!(reason & 0xc0)) { if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) - == NOTIFY_BAD) + == NOTIFY_STOP) return; #ifdef CONFIG_X86_LOCAL_APIC /* @@ -617,7 +617,7 @@ unknown_nmi_error(reason, regs); return; } - if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_BAD) + if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP) return; if (reason & 0x80) mem_parity_error(reason, regs); @@ -666,7 +666,7 @@ asmlinkage int do_int3(struct pt_regs *regs, long error_code) { if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) - == NOTIFY_OK) + == NOTIFY_STOP) return 1; /* This is an interrupt gate, because kprobes wants interrupts disabled. Normal trap handlers don't. */ @@ -707,7 +707,7 @@ __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, - SIGTRAP) == NOTIFY_OK) + SIGTRAP) == NOTIFY_STOP) return; /* It's safe to allow irq's after DR6 has been saved */ if (regs->eflags & X86_EFLAGS_IF) diff -Nru a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c --- a/arch/i386/mm/fault.c 2004-10-06 19:37:46 -07:00 +++ b/arch/i386/mm/fault.c 2004-10-06 19:37:46 -07:00 @@ -227,7 +227,7 @@ __asm__("movl %%cr2,%0":"=r" (address)); if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14, - SIGSEGV) == NOTIFY_OK) + SIGSEGV) == NOTIFY_STOP) return; /* It's safe to allow irq's after cr2 has been saved */ if (regs->eflags & (X86_EFLAGS_IF|VM_MASK)) diff -Nru a/arch/i386/mm/init.c b/arch/i386/mm/init.c --- a/arch/i386/mm/init.c 2004-10-06 19:37:47 -07:00 +++ b/arch/i386/mm/init.c 2004-10-06 19:37:47 -07:00 @@ -45,7 +45,7 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); unsigned long highstart_pfn, highend_pfn; -static int do_test_wp_bit(void); +static int noinline do_test_wp_bit(void); /* * Creates a middle page table and puts a pointer to it in the @@ -673,7 +673,7 @@ * This function cannot be __init, since exceptions don't work in that * section. Put this after the callers, so that it cannot be inlined. */ -static int do_test_wp_bit(void) +static int noinline do_test_wp_bit(void) { char tmp_reg; int flag; diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig 2004-10-06 19:37:47 -07:00 +++ b/arch/ia64/Kconfig 2004-10-06 19:37:47 -07:00 @@ -280,6 +280,9 @@ depends on IA32_SUPPORT default y +config IA64_MCA_RECOVERY + tristate "MCA recovery from errors other than TLB." + config PERFMON bool "Performance monitor support" help diff -Nru a/arch/ia64/configs/bigsur_defconfig b/arch/ia64/configs/bigsur_defconfig --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ia64/configs/bigsur_defconfig 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,1132 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.9-rc2 +# Tue Sep 28 13:26:53 2004 +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y + +# +# General setup +# +CONFIG_LOCALVERSION="" +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=16 +CONFIG_HOTPLUG=y +# CONFIG_IKCONFIG is not set +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +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 +CONFIG_SHMEM=y +# CONFIG_TINY_SHMEM is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y +CONFIG_STOP_MACHINE=y + +# +# Processor type and features +# +CONFIG_IA64=y +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_TIME_INTERPOLATION=y +CONFIG_EFI=y +CONFIG_GENERIC_IOMAP=y +# CONFIG_IA64_GENERIC is not set +CONFIG_IA64_DIG=y +# CONFIG_IA64_HP_ZX1 is not set +# CONFIG_IA64_SGI_SN2 is not set +# CONFIG_IA64_HP_SIM is not set +CONFIG_ITANIUM=y +# CONFIG_MCKINLEY is not set +# CONFIG_IA64_PAGE_SIZE_4KB is not set +# CONFIG_IA64_PAGE_SIZE_8KB is not set +CONFIG_IA64_PAGE_SIZE_16KB=y +# CONFIG_IA64_PAGE_SIZE_64KB is not set +CONFIG_IA64_BRL_EMU=y +# CONFIG_ITANIUM_BSTEP_SPECIFIC is not set +CONFIG_IA64_L1_CACHE_SHIFT=6 +# CONFIG_NUMA is not set +# CONFIG_VIRTUAL_MEM_MAP is not set +# CONFIG_IA64_CYCLONE is not set +CONFIG_IOSAPIC=y +CONFIG_FORCE_MAX_ZONEORDER=18 +CONFIG_SMP=y +CONFIG_NR_CPUS=2 +# CONFIG_HOTPLUG_CPU is not set +CONFIG_PREEMPT=y +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_EFI_PCDP=y +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_MISC=m + +# +# Power management and ACPI +# +CONFIG_PM=y +CONFIG_ACPI=y + +# +# ACPI (Advanced Configuration and Power Interface) Support +# +CONFIG_ACPI_BOOT=y +CONFIG_ACPI_INTERPRETER=y +CONFIG_ACPI_BUTTON=m +CONFIG_ACPI_FAN=m +CONFIG_ACPI_PROCESSOR=m +CONFIG_ACPI_THERMAL=m +# CONFIG_ACPI_DEBUG is not set +CONFIG_ACPI_BUS=y +CONFIG_ACPI_POWER=y +CONFIG_ACPI_PCI=y +CONFIG_ACPI_SYSTEM=y + +# +# Bus options (PCI, PCMCIA) +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_MSI is not set +CONFIG_PCI_LEGACY_PROC=y +CONFIG_PCI_NAMES=y + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + +# +# PCMCIA/CardBus support +# +# CONFIG_PCMCIA is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_NBD=m +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_UB is not set +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_SIZE=4096 + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=m +CONFIG_BLK_DEV_IDE=m + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=m +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_BLK_DEV_IDECD=m +# CONFIG_BLK_DEV_IDETAPE is not set +CONFIG_BLK_DEV_IDEFLOPPY=m +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_IDE_TASKFILE_IO is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=m +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_BLK_DEV_OFFBOARD is not set +CONFIG_BLK_DEV_GENERIC=m +# CONFIG_BLK_DEV_OPTI621 is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +CONFIG_IDEDMA_PCI_AUTO=y +# CONFIG_IDEDMA_ONLYDISK is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_SC1200 is not set +CONFIG_BLK_DEV_PIIX=m +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_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 +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +CONFIG_SCSI=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_CHR_DEV_SG is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y + +# +# SCSI Transport Attributes +# +CONFIG_SCSI_SPI_ATTRS=m +# CONFIG_SCSI_FC_ATTRS is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_SYM53C8XX_2 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 +CONFIG_SCSI_QLA2XXX=y +# CONFIG_SCSI_QLA21XX is not set +# CONFIG_SCSI_QLA22XX is not set +# CONFIG_SCSI_QLA2300 is not set +# CONFIG_SCSI_QLA2322 is not set +# CONFIG_SCSI_QLA6312 is not set +# CONFIG_SCSI_QLA6322 is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_DEBUG is not set + +# +# Multi-device support (RAID and LVM) +# +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_MD_LINEAR=m +CONFIG_MD_RAID0=m +CONFIG_MD_RAID1=m +CONFIG_MD_RAID10=m +CONFIG_MD_RAID5=m +CONFIG_MD_RAID6=m +CONFIG_MD_MULTIPATH=m +CONFIG_BLK_DEV_DM=m +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m +CONFIG_DM_MIRROR=m +CONFIG_DM_ZERO=m + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# Networking support +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +CONFIG_NETDEVICES=y +CONFIG_DUMMY=y +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +CONFIG_NET_PCI=y +# CONFIG_PCNET32 is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_B44 is not set +# CONFIG_FORCEDETH is not set +# CONFIG_DGRS is not set +CONFIG_EEPRO100=y +# CONFIG_EEPRO100_PIO is not set +# CONFIG_E100 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_VELOCITY is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set + +# +# Ethernet (10000 Mbit) +# +# CONFIG_IXGB 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 is not set +# CONFIG_SLIP is not set +# CONFIG_NET_FC is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_RAW is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_ACPI is not set +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +# CONFIG_SERIAL_8250_MULTIPORT is not set +# CONFIG_SERIAL_8250_RSA 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 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_HW_RANDOM is not set +CONFIG_EFI_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +CONFIG_AGP=m +CONFIG_AGP_I460=m +CONFIG_DRM=y +# CONFIG_DRM_TDFX is not set +CONFIG_DRM_R128=m +# CONFIG_DRM_RADEON is not set +# CONFIG_DRM_MGA is not set +# CONFIG_DRM_SIS is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_HPET is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +CONFIG_I2C_ALGOBIT=y +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_ISA is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Hardware Sensors Chip support +# +# CONFIG_I2C_SENSOR is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# 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_SMSC47M1 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set + +# +# Other I2C Chip support +# +# 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 +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Misc devices +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +# CONFIG_FB is not set + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +CONFIG_DUMMY_CONSOLE=y + +# +# Sound +# +CONFIG_SOUND=m + +# +# Advanced Linux Sound Architecture +# +CONFIG_SND=m +CONFIG_SND_TIMER=m +CONFIG_SND_PCM=m +CONFIG_SND_HWDEP=m +CONFIG_SND_RAWMIDI=m +CONFIG_SND_SEQUENCER=m +# CONFIG_SND_SEQ_DUMMY is not set +CONFIG_SND_OSSEMUL=y +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_PCM_OSS=m +# CONFIG_SND_SEQUENCER_OSS is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set + +# +# Generic devices +# +CONFIG_SND_OPL3_LIB=m +# CONFIG_SND_DUMMY is not set +# CONFIG_SND_VIRMIDI is not set +# CONFIG_SND_MTPAV is not set +# CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_MPU401 is not set + +# +# PCI devices +# +CONFIG_SND_AC97_CODEC=m +# CONFIG_SND_ALI5451 is not set +# CONFIG_SND_ATIIXP is not set +# CONFIG_SND_ATIIXP_MODEM is not set +# CONFIG_SND_AU8810 is not set +# CONFIG_SND_AU8820 is not set +# CONFIG_SND_AU8830 is not set +# CONFIG_SND_AZT3328 is not set +# CONFIG_SND_BT87X is not set +# CONFIG_SND_CS46XX is not set +CONFIG_SND_CS4281=m +# CONFIG_SND_EMU10K1 is not set +# CONFIG_SND_KORG1212 is not set +# CONFIG_SND_MIXART is not set +# CONFIG_SND_NM256 is not set +# CONFIG_SND_RME32 is not set +# CONFIG_SND_RME96 is not set +# CONFIG_SND_RME9652 is not set +# CONFIG_SND_HDSP is not set +# CONFIG_SND_TRIDENT is not set +# CONFIG_SND_YMFPCI is not set +# CONFIG_SND_ALS4000 is not set +# CONFIG_SND_CMIPCI is not set +# CONFIG_SND_ENS1370 is not set +# CONFIG_SND_ENS1371 is not set +# CONFIG_SND_ES1938 is not set +# CONFIG_SND_ES1968 is not set +# CONFIG_SND_MAESTRO3 is not set +# CONFIG_SND_FM801 is not set +# CONFIG_SND_ICE1712 is not set +# CONFIG_SND_ICE1724 is not set +# CONFIG_SND_INTEL8X0 is not set +# CONFIG_SND_INTEL8X0M is not set +# CONFIG_SND_SONICVIBES is not set +# CONFIG_SND_VIA82XX is not set +# CONFIG_SND_VX222 is not set + +# +# ALSA USB devices +# +# CONFIG_SND_USB_AUDIO is not set +# CONFIG_SND_USB_USX2Y is not set + +# +# Open Sound System +# +# CONFIG_SOUND_PRIME is not set + +# +# USB support +# +CONFIG_USB=m +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_BANDWIDTH is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_SUSPEND is not set +# CONFIG_USB_OTG is not set + +# +# USB Host Controller Drivers +# +# CONFIG_USB_EHCI_HCD is not set +# CONFIG_USB_OHCI_HCD is not set +CONFIG_USB_UHCI_HCD=m + +# +# USB Device Class drivers +# +CONFIG_USB_AUDIO=m +CONFIG_USB_BLUETOOTH_TTY=m +CONFIG_USB_MIDI=m +CONFIG_USB_ACM=m +CONFIG_USB_PRINTER=m +CONFIG_USB_STORAGE=m +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_RW_DETECT is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set + +# +# USB Human Interface Devices (HID) +# +CONFIG_USB_HID=m +CONFIG_USB_HIDINPUT=y +# CONFIG_HID_FF is not set +CONFIG_USB_HIDDEV=y + +# +# USB HID Boot Protocol drivers +# +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_MTOUCH is not set +# CONFIG_USB_EGALAX is not set +# CONFIG_USB_XPAD is not set +# CONFIG_USB_ATI_REMOTE is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# +# CONFIG_USB_DABUSB is not set + +# +# Video4Linux support is needed for USB Multimedia device support +# + +# +# USB Network adaptors +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_TIGL is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_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 + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_XFS_FS=y +# CONFIG_XFS_RT is not set +CONFIG_XFS_QUOTA=y +CONFIG_XFS_SECURITY=y +CONFIG_XFS_POSIX_ACL=y +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_QUOTA is not set +CONFIG_QUOTACTL=y +CONFIG_AUTOFS_FS=m +CONFIG_AUTOFS4_FS=m + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +# CONFIG_MSDOS_FS is not set +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +CONFIG_DEVPTS_FS_XATTR=y +CONFIG_DEVPTS_FS_SECURITY=y +CONFIG_TMPFS=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +CONFIG_NFS_V4=y +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +CONFIG_NFSD_V4=y +CONFIG_NFSD_TCP=y +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=m +CONFIG_SUNRPC=m +CONFIG_SUNRPC_GSS=m +CONFIG_RPCSEC_GSS_KRB5=m +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +CONFIG_CIFS=m +CONFIG_CIFS_STATS=y +CONFIG_CIFS_XATTR=y +CONFIG_CIFS_POSIX=y +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS 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=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +CONFIG_SGI_PARTITION=y +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +CONFIG_EFI_PARTITION=y + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ASCII is not set +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +CONFIG_NLS_UTF8=m + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set + +# +# Profiling support +# +CONFIG_PROFILING=y +CONFIG_OPROFILE=y + +# +# Kernel hacking +# +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_IA64_GRANULE_16MB is not set +CONFIG_IA64_GRANULE_64MB=y +# CONFIG_IA64_PRINT_HAZARDS is not set +# CONFIG_DISABLE_VHPT is not set +# CONFIG_IA64_DEBUG_CMPXCHG is not set +# CONFIG_IA64_DEBUG_IRQ is not set +CONFIG_SYSVIPC_COMPAT=y + +# +# Security options +# +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=y +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_WHIRLPOOL is not set +CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_TEST is not set diff -Nru a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile --- a/arch/ia64/kernel/Makefile 2004-10-06 19:37:48 -07:00 +++ b/arch/ia64/kernel/Makefile 2004-10-06 19:37:48 -07:00 @@ -17,6 +17,8 @@ obj-$(CONFIG_SMP) += smp.o smpboot.o obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o obj-$(CONFIG_IA64_CYCLONE) += cyclone.o +obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o +mca_recovery-y += mca_drv.o mca_drv_asm.o # The gate DSO image is built using a special linker script. targets += gate.so gate-syms.o diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c --- a/arch/ia64/kernel/acpi.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ia64/kernel/acpi.c 2004-10-06 19:37:47 -07:00 @@ -437,8 +437,9 @@ { int i, j, node_from, node_to; - /* If there's no SRAT, fix the phys_id */ + /* If there's no SRAT, fix the phys_id and mark node 0 online */ if (srat_num_cpus == 0) { + node_set_online(0); node_cpuid[0].phys_id = hard_smp_processor_id(); return; } diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c --- a/arch/ia64/kernel/mca.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ia64/kernel/mca.c 2004-10-06 19:37:47 -07:00 @@ -82,11 +82,6 @@ # define IA64_MCA_DEBUG(fmt...) #endif -typedef struct ia64_fptr { - unsigned long fp; - unsigned long gp; -} ia64_fptr_t; - /* Used by mca_asm.S */ ia64_mca_sal_to_os_state_t ia64_sal_to_os_handoff_state; ia64_mca_os_to_sal_state_t ia64_os_to_sal_handoff_state; @@ -831,6 +826,31 @@ } +/* Function pointer for extra MCA recovery */ +int (*ia64_mca_ucmc_extension) + (void*,ia64_mca_sal_to_os_state_t*,ia64_mca_os_to_sal_state_t*) + = NULL; + +int +ia64_reg_MCA_extension(void *fn) +{ + if (ia64_mca_ucmc_extension) + return 1; + + ia64_mca_ucmc_extension = fn; + return 0; +} + +void +ia64_unreg_MCA_extension(void) +{ + if (ia64_mca_ucmc_extension) + ia64_mca_ucmc_extension = NULL; +} + +EXPORT_SYMBOL(ia64_reg_MCA_extension); +EXPORT_SYMBOL(ia64_unreg_MCA_extension); + /* * ia64_mca_ucmc_handler * @@ -852,10 +872,19 @@ { pal_processor_state_info_t *psp = (pal_processor_state_info_t *) &ia64_sal_to_os_handoff_state.proc_state_param; - int recover = psp->tc && !(psp->cc || psp->bc || psp->rc || psp->uc); + int recover; /* Get the MCA error record and log it */ ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA); + + /* TLB error is only exist in this SAL error record */ + recover = (psp->tc && !(psp->cc || psp->bc || psp->rc || psp->uc)) + /* other error recovery */ + || (ia64_mca_ucmc_extension + && ia64_mca_ucmc_extension( + IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_MCA), + &ia64_sal_to_os_handoff_state, + &ia64_os_to_sal_handoff_state)); /* * Wakeup all the processors which are spinning in the rendezvous diff -Nru a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ia64/kernel/mca_drv.c 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,639 @@ +/* + * File: mca_drv.c + * Purpose: Generic MCA handling layer + * + * Copyright (C) 2004 FUJITSU LIMITED + * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) + */ +#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 "mca_drv.h" + +/* max size of SAL error record (default) */ +static int sal_rec_max = 10000; + +/* from mca.c */ +static ia64_mca_sal_to_os_state_t *sal_to_os_handoff_state; +static ia64_mca_os_to_sal_state_t *os_to_sal_handoff_state; + +/* from mca_drv_asm.S */ +extern void *mca_handler_bhhook(void); + +static spinlock_t mca_bh_lock = SPIN_LOCK_UNLOCKED; + +typedef enum { + MCA_IS_LOCAL = 0, + MCA_IS_GLOBAL = 1 +} mca_type_t; + +#define MAX_PAGE_ISOLATE 32 + +static struct page *page_isolate[MAX_PAGE_ISOLATE]; +static int num_page_isolate = 0; + +typedef enum { + ISOLATE_NG = 0, + ISOLATE_OK = 1 +} isolate_status_t; + +/* + * This pool keeps pointers to the section part of SAL error record + */ +static struct { + slidx_list_t *buffer; /* section pointer list pool */ + int cur_idx; /* Current index of section pointer list pool */ + int max_idx; /* Maximum index of section pointer list pool */ +} slidx_pool; + +/** + * mca_page_isolate - isolate a poisoned page in order not to use it later + * @paddr: poisoned memory location + * + * Return value: + * ISOLATE_OK / ISOLATE_NG + */ + +static isolate_status_t +mca_page_isolate(unsigned long paddr) +{ + int i; + struct page *p; + + /* whether physical address is valid or not */ + if ( !ia64_phys_addr_valid(paddr) ) + return ISOLATE_NG; + + /* convert physical address to physical page number */ + p = pfn_to_page(paddr>>PAGE_SHIFT); + + /* check whether a page number have been already registered or not */ + for( i = 0; i < num_page_isolate; i++ ) + if( page_isolate[i] == p ) + return ISOLATE_OK; /* already listed */ + + /* limitation check */ + if( num_page_isolate == MAX_PAGE_ISOLATE ) + return ISOLATE_NG; + + /* kick pages having attribute 'SLAB' or 'Reserved' */ + if( PageSlab(p) || PageReserved(p) ) + return ISOLATE_NG; + + /* add attribute 'Reserved' and register the page */ + SetPageReserved(p); + page_isolate[num_page_isolate++] = p; + + return ISOLATE_OK; +} + +/** + * mca_hanlder_bh - Kill the process which occurred memory read error + * @paddr: poisoned address received from MCA Handler + */ + +void +mca_handler_bh(unsigned long paddr) +{ + printk(KERN_DEBUG "OS_MCA: process [pid: %d](%s) encounters MCA.\n", + current->pid, current->comm); + + spin_lock(&mca_bh_lock); + if (mca_page_isolate(paddr) == ISOLATE_OK) { + printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); + } else { + printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr); + } + spin_unlock(&mca_bh_lock); + + /* This process is about to be killed itself */ + force_sig(SIGKILL, current); + schedule(); +} + +/** + * mca_make_peidx - Make index of processor error section + * @slpi: pointer to record of processor error section + * @peidx: pointer to index of processor error section + */ + +static void +mca_make_peidx(sal_log_processor_info_t *slpi, peidx_table_t *peidx) +{ + /* + * calculate the start address of + * "struct cpuid_info" and "sal_processor_static_info_t". + */ + u64 total_check_num = slpi->valid.num_cache_check + + slpi->valid.num_tlb_check + + slpi->valid.num_bus_check + + slpi->valid.num_reg_file_check + + slpi->valid.num_ms_check; + u64 head_size = sizeof(sal_log_mod_error_info_t) * total_check_num + + sizeof(sal_log_processor_info_t); + u64 mid_size = slpi->valid.cpuid_info * sizeof(struct sal_cpuid_info); + + peidx_head(peidx) = slpi; + peidx_mid(peidx) = (struct sal_cpuid_info *) + (slpi->valid.cpuid_info ? ((char*)slpi + head_size) : NULL); + peidx_bottom(peidx) = (sal_processor_static_info_t *) + (slpi->valid.psi_static_struct ? + ((char*)slpi + head_size + mid_size) : NULL); +} + +/** + * mca_make_slidx - Make index of SAL error record + * @buffer: pointer to SAL error record + * @slidx: pointer to index of SAL error record + * + * Return value: + * 1 if record has platform error / 0 if not + */ +#define LOG_INDEX_ADD_SECT_PTR(sect, ptr) \ + { slidx_list_t *hl = &slidx_pool.buffer[slidx_pool.cur_idx]; \ + hl->hdr = ptr; \ + list_add(&hl->list, &(sect)); \ + slidx_pool.cur_idx = (slidx_pool.cur_idx + 1)%slidx_pool.max_idx; } + +static int +mca_make_slidx(void *buffer, slidx_table_t *slidx) +{ + int platform_err = 0; + int record_len = ((sal_log_record_header_t*)buffer)->len; + u32 ercd_pos; + int sects; + sal_log_section_hdr_t *sp; + + /* + * Initialize index referring current record + */ + INIT_LIST_HEAD(&(slidx->proc_err)); + INIT_LIST_HEAD(&(slidx->mem_dev_err)); + INIT_LIST_HEAD(&(slidx->sel_dev_err)); + INIT_LIST_HEAD(&(slidx->pci_bus_err)); + INIT_LIST_HEAD(&(slidx->smbios_dev_err)); + INIT_LIST_HEAD(&(slidx->pci_comp_err)); + INIT_LIST_HEAD(&(slidx->plat_specific_err)); + INIT_LIST_HEAD(&(slidx->host_ctlr_err)); + INIT_LIST_HEAD(&(slidx->plat_bus_err)); + INIT_LIST_HEAD(&(slidx->unsupported)); + + /* + * Extract a Record Header + */ + slidx->header = buffer; + + /* + * Extract each section records + * (arranged from "int ia64_log_platform_info_print()") + */ + for (ercd_pos = sizeof(sal_log_record_header_t), sects = 0; + ercd_pos < record_len; ercd_pos += sp->len, sects++) { + sp = (sal_log_section_hdr_t *)((char*)buffer + ercd_pos); + if (!efi_guidcmp(sp->guid, SAL_PROC_DEV_ERR_SECT_GUID)) { + LOG_INDEX_ADD_SECT_PTR(slidx->proc_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_MEM_DEV_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->mem_dev_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_SEL_DEV_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->sel_dev_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_PCI_BUS_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->pci_bus_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->smbios_dev_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_PCI_COMP_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->pci_comp_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->plat_specific_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_HOST_CTLR_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->host_ctlr_err, sp); + } else if (!efi_guidcmp(sp->guid, SAL_PLAT_BUS_ERR_SECT_GUID)) { + platform_err = 1; + LOG_INDEX_ADD_SECT_PTR(slidx->plat_bus_err, sp); + } else { + LOG_INDEX_ADD_SECT_PTR(slidx->unsupported, sp); + } + } + slidx->n_sections = sects; + + return platform_err; +} + +/** + * init_record_index_pools - Initialize pool of lists for SAL record index + * + * Return value: + * 0 on Success / -ENOMEM on Failure + */ +static int +init_record_index_pools(void) +{ + int i; + int rec_max_size; /* Maximum size of SAL error records */ + int sect_min_size; /* Minimum size of SAL error sections */ + /* minimum size table of each section */ + static int sal_log_sect_min_sizes[] = { + sizeof(sal_log_processor_info_t) + sizeof(sal_processor_static_info_t), + sizeof(sal_log_mem_dev_err_info_t), + sizeof(sal_log_sel_dev_err_info_t), + sizeof(sal_log_pci_bus_err_info_t), + sizeof(sal_log_smbios_dev_err_info_t), + sizeof(sal_log_pci_comp_err_info_t), + sizeof(sal_log_plat_specific_err_info_t), + sizeof(sal_log_host_ctlr_err_info_t), + sizeof(sal_log_plat_bus_err_info_t), + }; + + /* + * MCA handler cannot allocate new memory on flight, + * so we preallocate enough memory to handle a SAL record. + * + * Initialize a handling set of slidx_pool: + * 1. Pick up the max size of SAL error records + * 2. Pick up the min size of SAL error sections + * 3. Allocate the pool as enough to 2 SAL records + * (now we can estimate the maxinum of section in a record.) + */ + + /* - 1 - */ + rec_max_size = sal_rec_max; + + /* - 2 - */ + sect_min_size = sal_log_sect_min_sizes[0]; + for (i = 1; i < sizeof sal_log_sect_min_sizes/sizeof(size_t); i++) + if (sect_min_size > sal_log_sect_min_sizes[i]) + sect_min_size = sal_log_sect_min_sizes[i]; + + /* - 3 - */ + slidx_pool.max_idx = (rec_max_size/sect_min_size) * 2 + 1; + slidx_pool.buffer = (slidx_list_t *) kmalloc(slidx_pool.max_idx * sizeof(slidx_list_t), GFP_KERNEL); + + return slidx_pool.buffer ? 0 : -ENOMEM; +} + + +/***************************************************************************** + * Recovery functions * + *****************************************************************************/ + +/** + * is_mca_global - Check whether this MCA is global or not + * @peidx: pointer of index of processor error section + * @pbci: pointer to pal_bus_check_info_t + * + * Return value: + * MCA_IS_LOCAL / MCA_IS_GLOBAL + */ + +static mca_type_t +is_mca_global(peidx_table_t *peidx, pal_bus_check_info_t *pbci) +{ + pal_processor_state_info_t *psp = (pal_processor_state_info_t*)peidx_psp(peidx); + + /* + * PAL can request a rendezvous, if the MCA has a global scope. + * If "rz_always" flag is set, SAL requests MCA rendezvous + * in spite of global MCA. + * Therefore it is local MCA when rendezvous has not been requested. + * Failed to rendezvous, the system must be down. + */ + switch (sal_to_os_handoff_state->imsto_rendez_state) { + case -1: /* SAL rendezvous unsuccessful */ + return MCA_IS_GLOBAL; + case 0: /* SAL rendezvous not required */ + return MCA_IS_LOCAL; + case 1: /* SAL rendezvous successful int */ + case 2: /* SAL rendezvous successful int with init */ + default: + break; + } + + /* + * If One or more Cache/TLB/Reg_File/Uarch_Check is here, + * it would be a local MCA. (i.e. processor internal error) + */ + if (psp->tc || psp->cc || psp->rc || psp->uc) + return MCA_IS_LOCAL; + + /* + * Bus_Check structure with Bus_Check.ib (internal bus error) flag set + * would be a global MCA. (e.g. a system bus address parity error) + */ + if (!pbci || pbci->ib) + return MCA_IS_GLOBAL; + + /* + * Bus_Check structure with Bus_Check.eb (external bus error) flag set + * could be either a local MCA or a global MCA. + * + * Referring Bus_Check.bsi: + * 0: Unknown/unclassified + * 1: BERR# + * 2: BINIT# + * 3: Hard Fail + * (FIXME: Are these SGI specific or generic bsi values?) + */ + if (pbci->eb) + switch (pbci->bsi) { + case 0: + /* e.g. a load from poisoned memory */ + return MCA_IS_LOCAL; + case 1: + case 2: + case 3: + return MCA_IS_GLOBAL; + } + + return MCA_IS_GLOBAL; +} + +/** + * recover_from_read_error - Try to recover the errors which type are "read"s. + * @slidx: pointer of index of SAL error record + * @peidx: pointer of index of processor error section + * @pbci: pointer of pal_bus_check_info + * + * Return value: + * 1 on Success / 0 on Failure + */ + +static int +recover_from_read_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_check_info_t *pbci) +{ + sal_log_mod_error_info_t *smei; + pal_min_state_area_t *pmsa; + struct ia64_psr *psr1, *psr2; + ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook; + + /* Is target address valid? */ + if (!pbci->tv) + return 0; + + /* + * cpu read or memory-mapped io read + * + * offending process affected process OS MCA do + * kernel mode kernel mode down system + * kernel mode user mode kill the process + * user mode kernel mode down system (*) + * user mode user mode kill the process + * + * (*) You could terminate offending user-mode process + * if (pbci->pv && pbci->pl != 0) *and* if you sure + * the process not have any locks of kernel. + */ + + psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr); + + /* + * Check the privilege level of interrupted context. + * If it is user-mode, then terminate affected process. + */ + if (psr1->cpl != 0) { + smei = peidx_bus_check(peidx, 0); + if (smei->valid.target_identifier) { + /* + * setup for resume to bottom half of MCA, + * "mca_handler_bhhook" + */ + pmsa = (pal_min_state_area_t *)(sal_to_os_handoff_state->pal_min_state | (6ul<<61)); + /* pass to bhhook as 1st argument (gr8) */ + pmsa->pmsa_gr[8-1] = smei->target_identifier; + /* set interrupted return address (but no use) */ + pmsa->pmsa_br0 = pmsa->pmsa_iip; + /* change resume address to bottom half */ + pmsa->pmsa_iip = mca_hdlr_bh->fp; + pmsa->pmsa_gr[1-1] = mca_hdlr_bh->gp; + /* set cpl with kernel mode */ + psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr; + psr2->cpl = 0; + psr2->ri = 0; + + return 1; + } + + } + + return 0; +} + +/** + * recover_from_platform_error - Recover from platform error. + * @slidx: pointer of index of SAL error record + * @peidx: pointer of index of processor error section + * @pbci: pointer of pal_bus_check_info + * + * Return value: + * 1 on Success / 0 on Failure + */ + +static int +recover_from_platform_error(slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_check_info_t *pbci) +{ + int status = 0; + pal_processor_state_info_t *psp = (pal_processor_state_info_t*)peidx_psp(peidx); + + if (psp->bc && pbci->eb && pbci->bsi == 0) { + switch(pbci->type) { + case 1: /* partial read */ + case 3: /* full line(cpu) read */ + case 9: /* I/O space read */ + status = recover_from_read_error(slidx, peidx, pbci); + break; + case 0: /* unknown */ + case 2: /* partial write */ + case 4: /* full line write */ + case 5: /* implicit or explicit write-back operation */ + case 6: /* snoop probe */ + case 7: /* incoming or outgoing ptc.g */ + case 8: /* write coalescing transactions */ + case 10: /* I/O space write */ + case 11: /* inter-processor interrupt message(IPI) */ + case 12: /* interrupt acknowledge or external task priority cycle */ + default: + break; + } + } + + return status; +} + +/** + * recover_from_processor_error + * @platform: whether there are some platform error section or not + * @slidx: pointer of index of SAL error record + * @peidx: pointer of index of processor error section + * @pbci: pointer of pal_bus_check_info + * + * Return value: + * 1 on Success / 0 on Failure + */ +/* + * Later we try to recover when below all conditions are satisfied. + * 1. Only one processor error section is exist. + * 2. BUS_CHECK is exist and the others are not exist.(Except TLB_CHECK) + * 3. The entry of BUS_CHECK_INFO is 1. + * 4. "External bus error" flag is set and the others are not set. + */ + +static int +recover_from_processor_error(int platform, slidx_table_t *slidx, peidx_table_t *peidx, pal_bus_check_info_t *pbci) +{ + pal_processor_state_info_t *psp = (pal_processor_state_info_t*)peidx_psp(peidx); + + /* + * We cannot recover errors with other than bus_check. + */ + if (psp->cc || psp->rc || psp->uc) + return 0; + + /* + * If there is no bus error, record is weird but we need not to recover. + */ + if (psp->bc == 0 || pbci == NULL) + return 1; + + /* + * Sorry, we cannot handle so many. + */ + if (peidx_bus_check_num(peidx) > 1) + return 0; + /* + * Well, here is only one bus error. + */ + if (pbci->ib || pbci->cc) + return 0; + if (pbci->eb && pbci->bsi > 0) + return 0; + if (psp->ci == 0) + return 0; + + /* + * This is a local MCA and estimated as recoverble external bus error. + * (e.g. a load from poisoned memory) + * This means "there are some platform errors". + */ + if (platform) + return recover_from_platform_error(slidx, peidx, pbci); + /* + * On account of strange SAL error record, we cannot recover. + */ + return 0; +} + +/** + * mca_try_to_recover - Try to recover from MCA + * @rec: pointer to a SAL error record + * + * Return value: + * 1 on Success / 0 on Failure + */ + +static int +mca_try_to_recover(void *rec, + ia64_mca_sal_to_os_state_t *sal_to_os_state, + ia64_mca_os_to_sal_state_t *os_to_sal_state) +{ + int platform_err; + int n_proc_err; + slidx_table_t slidx; + peidx_table_t peidx; + pal_bus_check_info_t pbci; + + /* handoff state from/to mca.c */ + sal_to_os_handoff_state = sal_to_os_state; + os_to_sal_handoff_state = os_to_sal_state; + + /* Make index of SAL error record */ + platform_err = mca_make_slidx(rec, &slidx); + + /* Count processor error sections */ + n_proc_err = slidx_count(&slidx, proc_err); + + /* Now, OS can recover when there is one processor error section */ + if (n_proc_err > 1) + return 0; + else if (n_proc_err == 0) { + /* Weird SAL record ... We need not to recover */ + + return 1; + } + + /* Make index of processor error section */ + mca_make_peidx((sal_log_processor_info_t*)slidx_first_entry(&slidx.proc_err)->hdr, &peidx); + + /* Extract Processor BUS_CHECK[0] */ + *((u64*)&pbci) = peidx_check_info(&peidx, bus_check, 0); + + /* Check whether MCA is global or not */ + if (is_mca_global(&peidx, &pbci)) + return 0; + + /* Try to recover a processor error */ + return recover_from_processor_error(platform_err, &slidx, &peidx, &pbci); +} + +/* + * ============================================================================= + */ + +int __init mca_external_handler_init(void) +{ + if (init_record_index_pools()) + return -ENOMEM; + + /* register external mca handlers */ + if (ia64_reg_MCA_extension(mca_try_to_recover)){ + printk(KERN_ERR "ia64_reg_MCA_extension failed.\n"); + kfree(slidx_pool.buffer); + return -EFAULT; + } + return 0; +} + +void __exit mca_external_handler_exit(void) +{ + /* unregister external mca handlers */ + ia64_unreg_MCA_extension(); + kfree(slidx_pool.buffer); +} + +module_init(mca_external_handler_init); +module_exit(mca_external_handler_exit); + +module_param(sal_rec_max, int, 0644); +MODULE_PARM_DESC(sal_rec_max, "Max size of SAL error record"); + +MODULE_DESCRIPTION("ia64 platform dependent mca handler driver"); +MODULE_LICENSE("GPL"); diff -Nru a/arch/ia64/kernel/mca_drv.h b/arch/ia64/kernel/mca_drv.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ia64/kernel/mca_drv.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,113 @@ +/* + * File: mca_drv.h + * Purpose: Define helpers for Generic MCA handling + * + * Copyright (C) 2004 FUJITSU LIMITED + * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) + */ +/* + * Processor error section: + * + * +-sal_log_processor_info_t *info-------------+ + * | sal_log_section_hdr_t header; | + * | ... | + * | sal_log_mod_error_info_t info[0]; | + * +-+----------------+-------------------------+ + * | CACHE_CHECK | ^ num_cache_check v + * +----------------+ + * | TLB_CHECK | ^ num_tlb_check v + * +----------------+ + * | BUS_CHECK | ^ num_bus_check v + * +----------------+ + * | REG_FILE_CHECK | ^ num_reg_file_check v + * +----------------+ + * | MS_CHECK | ^ num_ms_check v + * +-struct cpuid_info *id----------------------+ + * | regs[5]; | + * | reserved; | + * +-sal_processor_static_info_t *regs----------+ + * | valid; | + * | ... | + * | fr[128]; | + * +--------------------------------------------+ + */ + +/* peidx: index of processor error section */ +typedef struct peidx_table { + sal_log_processor_info_t *info; + struct sal_cpuid_info *id; + sal_processor_static_info_t *regs; +} peidx_table_t; + +#define peidx_head(p) (((p)->info)) +#define peidx_mid(p) (((p)->id)) +#define peidx_bottom(p) (((p)->regs)) + +#define peidx_psp(p) (&(peidx_head(p)->proc_state_parameter)) +#define peidx_field_valid(p) (&(peidx_head(p)->valid)) +#define peidx_minstate_area(p) (&(peidx_bottom(p)->min_state_area)) + +#define peidx_cache_check_num(p) (peidx_head(p)->valid.num_cache_check) +#define peidx_tlb_check_num(p) (peidx_head(p)->valid.num_tlb_check) +#define peidx_bus_check_num(p) (peidx_head(p)->valid.num_bus_check) +#define peidx_reg_file_check_num(p) (peidx_head(p)->valid.num_reg_file_check) +#define peidx_ms_check_num(p) (peidx_head(p)->valid.num_ms_check) + +#define peidx_cache_check_idx(p, n) (n) +#define peidx_tlb_check_idx(p, n) (peidx_cache_check_idx(p, peidx_cache_check_num(p)) + n) +#define peidx_bus_check_idx(p, n) (peidx_tlb_check_idx(p, peidx_tlb_check_num(p)) + n) +#define peidx_reg_file_check_idx(p, n) (peidx_bus_check_idx(p, peidx_bus_check_num(p)) + n) +#define peidx_ms_check_idx(p, n) (peidx_reg_file_check_idx(p, peidx_reg_file_check_num(p)) + n) + +#define peidx_mod_error_info(p, name, n) \ +({ int __idx = peidx_##name##_idx(p, n); \ + sal_log_mod_error_info_t *__ret = NULL; \ + if (peidx_##name##_num(p) > n) /*BUG*/ \ + __ret = &(peidx_head(p)->info[__idx]); \ + __ret; }) + +#define peidx_cache_check(p, n) peidx_mod_error_info(p, cache_check, n) +#define peidx_tlb_check(p, n) peidx_mod_error_info(p, tlb_check, n) +#define peidx_bus_check(p, n) peidx_mod_error_info(p, bus_check, n) +#define peidx_reg_file_check(p, n) peidx_mod_error_info(p, reg_file_check, n) +#define peidx_ms_check(p, n) peidx_mod_error_info(p, ms_check, n) + +#define peidx_check_info(proc, name, n) \ +({ \ + sal_log_mod_error_info_t *__info = peidx_mod_error_info(proc, name, n);\ + u64 __temp = __info && __info->valid.check_info \ + ? __info->check_info : 0; \ + __temp; }) + +/* slidx: index of SAL log error record */ + +typedef struct slidx_list { + struct list_head list; + sal_log_section_hdr_t *hdr; +} slidx_list_t; + +typedef struct slidx_table { + sal_log_record_header_t *header; + int n_sections; /* # of section headers */ + struct list_head proc_err; + struct list_head mem_dev_err; + struct list_head sel_dev_err; + struct list_head pci_bus_err; + struct list_head smbios_dev_err; + struct list_head pci_comp_err; + struct list_head plat_specific_err; + struct list_head host_ctlr_err; + struct list_head plat_bus_err; + struct list_head unsupported; /* list of unsupported sections */ +} slidx_table_t; + +#define slidx_foreach_entry(pos, head) \ + list_for_each_entry(pos, head, list) +#define slidx_first_entry(head) \ + (((head)->next != (head)) ? list_entry((head)->next, typeof(slidx_list_t), list) : NULL) +#define slidx_count(slidx, sec) \ +({ int __count = 0; \ + slidx_list_t *__pos; \ + slidx_foreach_entry(__pos, &((slidx)->sec)) { __count++; }\ + __count; }) + diff -Nru a/arch/ia64/kernel/mca_drv_asm.S b/arch/ia64/kernel/mca_drv_asm.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ia64/kernel/mca_drv_asm.S 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,45 @@ +/* + * File: mca_drv_asm.S + * Purpose: Assembly portion of Generic MCA handling + * + * Copyright (C) 2004 FUJITSU LIMITED + * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) + */ +#include +#include + +#include +#include + +GLOBAL_ENTRY(mca_handler_bhhook) + invala // clear RSE ? + ;; // + cover // + ;; // + clrrrb // + ;; + alloc r16=ar.pfs,0,2,1,0 // make a new frame + ;; + mov r13=IA64_KR(CURRENT) // current task pointer + ;; + adds r12=IA64_TASK_THREAD_KSP_OFFSET,r13 + ;; + ld8 r12=[r12] // stack pointer + ;; + mov loc0=r16 + movl loc1=mca_handler_bh // recovery C function + ;; + mov out0=r8 // poisoned address + mov b6=loc1 + ;; + mov loc1=rp + ;; + br.call.sptk.many rp=b6 // not return ... + ;; + mov ar.pfs=loc0 + mov rp=loc1 + ;; + mov r8=r0 + br.ret.sptk.many rp + ;; +END(mca_handler_bhhook) diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c --- a/arch/ia64/kernel/perfmon.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ia64/kernel/perfmon.c 2004-10-06 19:37:47 -07:00 @@ -2286,7 +2286,7 @@ * if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur) * return -ENOMEM; */ - if (size > task->rlim[RLIMIT_MEMLOCK].rlim_cur) return -EAGAIN; + if (size > task->rlim[RLIMIT_MEMLOCK].rlim_cur) return -ENOMEM; /* * We do the easy to undo allocations first. @@ -2601,7 +2601,7 @@ */ if (task == current) return 0; - if (task->state != TASK_STOPPED) { + if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task->pid, task->state)); return -EBUSY; } @@ -4755,7 +4755,7 @@ * the task must be stopped. */ if (PFM_CMD_STOPPED(cmd)) { - if (task->state != TASK_STOPPED) { + if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { DPRINT(("[%d] task not in stopped state\n", task->pid)); return -EBUSY; } diff -Nru a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c --- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c 2004-10-06 19:37:47 -07:00 @@ -14,50 +14,14 @@ #include #include #include -#include -#include - -/* to lookup nasids */ +#include #include +#include MODULE_DESCRIPTION("PROM version reporting for /proc"); MODULE_AUTHOR("Chad Talbott"); MODULE_LICENSE("GPL"); -#undef DEBUG_PROMINFO - -#define TRACE_PROMINFO - -#if defined(DEBUG_PROMINFO) -# define DPRINTK(x...) printk(KERN_DEBUG x) -#else -# define DPRINTK(x...) -#endif - -#if defined(TRACE_PROMINFO) && defined(DEBUG_PROMINFO) -# if defined(__GNUC__) -# define TRACE() printk(KERN_DEBUG "%s:%d:%s\n", \ - __FILE__, __LINE__, __FUNCTION__) -# else -# define TRACE() printk(KERN_DEBUG "%s:%d\n", __LINE__, __FILE__) -# endif -#else -# define TRACE() -#endif - -/* Architected IA64 firmware space */ -#define FW_BASE 0x00000000FF000000 -#define FW_TOP 0x0000000100000000 - -/* Sub-regions determined by bits in Node Offset */ -#define LB_PROM_SPACE 0x0000000700000000ul /* Local LB PROM */ - -/* Offset of PROM banner pointers in SAL A and SAL B */ -#define SAL_A_BANNER_OFFSET (1 * 16) -#define SAL_B_BANNER_OFFSET (3 * 16) - - -#define FIT_SIGNATURE 0x2020205f5449465ful /* Standard Intel FIT entry types */ #define FIT_ENTRY_FIT_HEADER 0x00 /* FIT header entry */ #define FIT_ENTRY_PAL_B 0x01 /* PAL_B entry */ @@ -90,12 +54,6 @@ #define FIT_TYPE(q) \ ((unsigned) ((q) >> FIT_TYPE_SHIFT) & FIT_TYPE_MASK) -#define FIT_ENTRY(type, maj, min, size) \ - ((((unsigned long)(maj) & FIT_MAJOR_MASK) << FIT_MAJOR_SHIFT) | \ - (((unsigned long)(min) & FIT_MINOR_MASK) << FIT_MINOR_SHIFT) | \ - (((unsigned long)(type) & FIT_TYPE_MASK) << FIT_TYPE_SHIFT) | \ - (size)) - struct fit_type_map_t { unsigned char type; const char *name; @@ -134,6 +92,39 @@ return "Unknown type"; } + +/* ============ BEGIN temp til old PROMs are no longer supported ============= + * + * The OS should not make direct access to the PROM flash memory. Access to + * this region must be serialized with a PROM lock. If SAL on one cpu is + * updating the FLASH error log at the same time another cpu is accessing the + * PROM, data corruption will occur. + * + * To solve the problem, all flash PROM access has been moved to SAL. Because + * not all systems will have instant PROM updates, we need to support a new OS + * running on a system with old PROMs. + * + * This code should be deleted after 1 OS/PROM release has occurred & the OS + * no longer supports downrev PROMs. (PROM support should be in the 3.50 + * PROMs). + */ +#define SUPPORT_OLD_PROMS +#ifdef SUPPORT_OLD_PROMS + + +#define FIT_SIGNATURE 0x2020205f5449465ful + +/* Sub-regions determined by bits in Node Offset */ +#define LB_PROM_SPACE 0x0000000700000000ul /* Local LB PROM */ + +/* Offset of PROM banner pointers in SAL A and SAL B */ +#define SAL_A_BANNER_OFFSET (1 * 16) +#define SAL_B_BANNER_OFFSET (3 * 16) + +/* Architected IA64 firmware space */ +#define FW_BASE 0x00000000FF000000 +#define FW_TOP 0x0000000100000000 + static unsigned long convert_fw_addr(nasid_t nasid, unsigned long addr) { @@ -154,32 +145,95 @@ return (addr >= FW_BASE && addr < FW_TOP); } -/* These two routines read the FIT table directly from the FLASH PROM - * on a specific node. The PROM can only be accessed using aligned 64 - * bit reads, so we do that and then shift and mask the result to get - * at each field. +static unsigned long * +lookup_fit(int nasid) +{ + unsigned long *fitp; + unsigned long fit_paddr; + unsigned long *fit_vaddr; + + fitp = (void *)GLOBAL_MMR_ADDR(nasid, LB_PROM_SPACE - 32); + fit_paddr = readq(fitp); + fit_vaddr = (unsigned long *) convert_fw_addr(nasid, fit_paddr); + return fit_vaddr; +} +#endif /* SUPPORT_OLD_PROMS */ +/* ============ END temp til old PROMs are no longer supported ============= */ + +static int +get_fit_entry(unsigned long nasid, int index, unsigned long *fentry, + char *banner, int banlen) +{ + int ret; + + ret = ia64_sn_get_fit_compt(nasid, index, fentry, banner, banlen); + +#ifdef SUPPORT_OLD_PROMS + /* The following is hack is temporary until PROMs are updated */ + if (ret == SALRET_NOT_IMPLEMENTED) { + unsigned long *fitadr = lookup_fit(nasid); + int nentries; + + if (readq(fitadr) != FIT_SIGNATURE) { + printk(KERN_WARNING "Unrecognized FIT signature"); + return -2; + } + + nentries = (unsigned int) (readq(fitadr + 1) & 0xffffff); + if (index >= nentries) + return -2; + + fentry[0] = readq(fitadr + 2 * index); + fentry[1] = readq(fitadr + 2 * index + 1); + ret = 0; + + if (banner && FIT_TYPE(fentry[1]) == FIT_ENTRY_SAL_A) { + unsigned long i, qw, *bwp, *qwp; + + banner[0] = '\0'; + qw = fentry[0]; /* Address of SAL A */ + if (!valid_fw_addr(qw)) + return 0; + + qw += SAL_A_BANNER_OFFSET; + qw = convert_fw_addr(nasid, qw); + + qw = readq(qw); /* Address of banner */ + if (!valid_fw_addr(qw)) + return 0; + qw = convert_fw_addr(nasid, qw); + qwp = (unsigned long *) qw; + bwp = (unsigned long *) banner; + for (i=0; i PAGE_SIZE); - p = page; - for (fentry = 0; fentry < nentries; fentry++) - /* each FIT entry is two 64 bit words */ - p += dump_fit_entry(p, fit + 2 * fentry); + for (index=0;;index++) { + BUG_ON(index * 60 > PAGE_SIZE); + if (get_fit_entry(nasid, index, fentry, NULL, 0)) + break; + p += dump_fit_entry(p, fentry); + } return p - page; } static int -dump_version(char *page, unsigned long *fit) +dump_version(char *page, unsigned long nasid) { - int nentries; - int fentry; - unsigned long qw = 0; + unsigned long fentry[2]; + char banner[128]; + int index; int len; - nasid_t nasid = NASID_GET(fit); - - TRACE(); - nentries = (unsigned)readq(fit + 1); - BUG_ON(nentries * 60 > PAGE_SIZE); - - for (fentry = 0; fentry < nentries; fentry++) { - qw = readq(fit + 2 * fentry + 1); - if (FIT_TYPE(qw) == FIT_ENTRY_SAL_A) + for (index = 0; ; index++) { + if (get_fit_entry(nasid, index, fentry, banner, + sizeof(banner))) + return 0; + if (FIT_TYPE(fentry[1]) == FIT_ENTRY_SAL_A) break; } - if (fentry >= nentries) - return 0; - len = sprintf(page, "%x.%02x\n", FIT_MAJOR(qw), FIT_MINOR(qw)); + len = sprintf(page, "%x.%02x\n", FIT_MAJOR(fentry[1]), + FIT_MINOR(fentry[1])); page += len; - qw = readq(fit + 2 * fentry); /* Address of SAL A */ - DPRINTK("SAL A at %p\n", (void *)qw); - if (!valid_fw_addr(qw)) - return len; - - qw += SAL_A_BANNER_OFFSET; - qw = convert_fw_addr(nasid, qw); - DPRINTK("Banner ptr at %p\n", (void *)qw); - - qw = readq(qw); /* Address of banner */ - if (!valid_fw_addr(qw)) - return len; - qw = convert_fw_addr(nasid, qw); - DPRINTK("Banner at %p\n", (void *)qw); + if (banner[0]) + len += snprintf(page, PAGE_SIZE-len, "%s\n", banner); - len += snprintf(page, PAGE_SIZE-len, "%s\n", (char *)qw); return len; } @@ -280,8 +303,8 @@ { int len = 0; - /* data holds the pointer to this node's FIT */ - len = dump_version(page, (unsigned long *)data); + /* data holds the NASID of the node */ + len = dump_version(page, (unsigned long)data); len = proc_calc_metrics(page, start, off, count, eof, len); return len; } @@ -292,52 +315,13 @@ { int len = 0; - /* data holds the pointer to this node's FIT */ - len = dump_fit(page, (unsigned long *)data); + /* data holds the NASID of the node */ + len = dump_fit(page, (unsigned long)data); len = proc_calc_metrics(page, start, off, count, eof, len); return len; } -/* this is a fake FIT that's used on the medusa simulator which - * doesn't usually run a complete PROM. - */ -#ifdef CONFIG_IA64_SGI_SN_SIM -static unsigned long fakefit[] = { - /* this is all we need to satisfy the code below */ - FIT_SIGNATURE, - FIT_ENTRY(FIT_ENTRY_FIT_HEADER, 0x02, 0x60, 2), - /* dump something arbitrary for - * /proc/sgi_prominfo/nodeX/version */ - 0xbadbeef00fa3ef17ul, - FIT_ENTRY(FIT_ENTRY_SAL_A, 0, 0x99, 0x100) -}; -#endif - -static unsigned long * -lookup_fit(int nasid) -{ - unsigned long *fitp; - unsigned long fit_paddr; - unsigned long *fit_vaddr; - -#ifdef CONFIG_IA64_SGI_SN_SIM - if (IS_RUNNING_ON_SIMULATOR()) - return fakefit; -#endif - - fitp = (void *)GLOBAL_MMR_ADDR(nasid, LB_PROM_SPACE - 32); - DPRINTK("pointer to fit at %p\n", (void *)fitp); - fit_paddr = readq(fitp); - DPRINTK("fit pointer contains %lx\n", fit_paddr); - - BUG_ON(!valid_fw_addr(fit_paddr)); - fit_vaddr = (void *)convert_fw_addr(nasid, fit_paddr); - - DPRINTK("fit at %p\n", (void *)fit_vaddr); - return fit_vaddr; -} - /* module entry points */ int __init prominfo_init(void); void __exit prominfo_exit(void); @@ -356,17 +340,12 @@ struct proc_dir_entry **entp; struct proc_dir_entry *p; cnodeid_t cnodeid; - nasid_t nasid; + unsigned long nasid; char name[NODE_NAME_LEN]; if (!ia64_platform_is("sn2")) return 0; - TRACE(); - - DPRINTK("running on cpu %d\n", smp_processor_id()); - DPRINTK("numnodes %d\n", numnodes); - proc_entries = kmalloc(numnodes * sizeof(struct proc_dir_entry *), GFP_KERNEL); @@ -380,12 +359,12 @@ nasid = cnodeid_to_nasid(cnodeid); p = create_proc_read_entry( "fit", 0, *entp, read_fit_entry, - lookup_fit(nasid)); + (void *)nasid); if (p) p->owner = THIS_MODULE; p = create_proc_read_entry( "version", 0, *entp, read_version_entry, - lookup_fit(nasid)); + (void *)nasid); if (p) p->owner = THIS_MODULE; } @@ -399,8 +378,6 @@ struct proc_dir_entry **entp; unsigned cnodeid; char name[NODE_NAME_LEN]; - - TRACE(); for (cnodeid = 0, entp = proc_entries; cnodeid < numnodes; diff -Nru a/arch/m32r/Kconfig b/arch/m32r/Kconfig --- a/arch/m32r/Kconfig 2004-10-06 19:37:46 -07:00 +++ b/arch/m32r/Kconfig 2004-10-06 19:37:46 -07:00 @@ -253,8 +253,6 @@ depends on SMP default n -source "arch/m32r/drivers/Kconfig" - # turning this on wastes a bunch of space. # Summit needs it only when NUMA is on config BOOT_IOREMAP diff -Nru a/arch/m32r/Makefile b/arch/m32r/Makefile --- a/arch/m32r/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/Makefile 2004-10-06 19:37:47 -07:00 @@ -25,7 +25,7 @@ CFLAGS += $(cflags-y) AFLAGS += $(aflags-y) -CHECKFLAGS := $(CHECK) -D__m32r__=1 +CHECKFLAGS := $(CHECK) -D__m32r__ head-y := arch/m32r/kernel/head.o arch/m32r/kernel/init_task.o @@ -36,7 +36,6 @@ arch/m32r/mm/ \ arch/m32r/boot/ -drivers-y += arch/m32r/drivers/ drivers-$(CONFIG_OPROFILE) += arch/m32r/oprofile/ boot := arch/m32r/boot diff -Nru a/arch/m32r/drivers/Kconfig b/arch/m32r/drivers/Kconfig --- a/arch/m32r/drivers/Kconfig 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,34 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see Documentation/kbuild/kconfig-language.txt. -# - -menu "M32R drivers" - -config M32RPCC - bool "M32R PCMCIA I/F" - depends on CHIP_M32700 - -config M32R_CFC - bool "CF I/F Controller" - depends on PLAT_USRV || PLAT_M32700UT || PLAT_MAPPI2 || PLAT_OPSPUT - -config M32700UT_CFC - bool - depends on M32R_CFC - default y - -config CFC_NUM - int "CF I/F number" - depends on PLAT_USRV || PLAT_M32700UT - default "1" if PLAT_USRV || PLAT_M32700UT || PLAT_MAPPI2 || PLAT_OPSPUT - -config MTD_M32R - bool "Flash device mapped on M32R" - depends on PLAT_USRV || PLAT_M32700UT || PLAT_MAPPI2 - -config M32700UT_DS1302 - bool "DS1302 Real Time Clock support" - depends on PLAT_M32700UT || PLAT_OPSPUT - -endmenu diff -Nru a/arch/m32r/drivers/Makefile b/arch/m32r/drivers/Makefile --- a/arch/m32r/drivers/Makefile 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,7 +0,0 @@ -# -# Makefile for the Linux/M32R driver -# - -obj-$(CONFIG_M32RPCC) += m32r_pcc.o -obj-$(CONFIG_M32R_CFC) += m32r_cfc.o -obj-$(CONFIG_M32700UT_DS1302) += ds1302.o diff -Nru a/arch/m32r/drivers/cs_internal.h b/arch/m32r/drivers/cs_internal.h --- a/arch/m32r/drivers/cs_internal.h 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,2 +0,0 @@ -#include "../../../drivers/pcmcia/cs_internal.h" - diff -Nru a/arch/m32r/drivers/ds1302.c b/arch/m32r/drivers/ds1302.c --- a/arch/m32r/drivers/ds1302.c 2004-10-06 19:37:46 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,432 +0,0 @@ -/*!*************************************************************************** -*! -*! FILE NAME : ds1302.c -*! -*! DESCRIPTION: Implements an interface for the DS1302 RTC through Etrax I/O -*! -*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init, get_rtc_status -*! -*! $Log: ds1302.c,v $ -*! Revision 1.2 2003/10/29 08:42:58 fujiwara -*! Set PLD_RTCBAUR from bus clock -*! -*! Revision 1.12 2002/04/10 15:35:25 johana -*! Moved probe function closer to init function and marked it __init. -*! -*! Revision 1.11 2001/06/14 12:35:52 jonashg -*! The ATA hack is back. It is unfortunately the only way to set g27 to output. -*! -*! Revision 1.9 2001/06/14 10:00:14 jonashg -*! No need for tempudelay to be inline anymore (had to adjust the usec to -*! loops conversion because of this to make it slow enough to be a udelay). -*! -*! Revision 1.8 2001/06/14 08:06:32 jonashg -*! Made tempudelay delay usecs (well, just a tad more). -*! -*! Revision 1.7 2001/06/13 14:18:11 jonashg -*! Only allow processes with SYS_TIME capability to set time and charge. -*! -*! Revision 1.6 2001/06/12 15:22:07 jonashg -*! * Made init function __init. -*! * Parameter to out_byte() is unsigned char. -*! * The magic number 42 has got a name. -*! * Removed comment about /proc (nothing is exported there). -*! -*! Revision 1.5 2001/06/12 14:35:13 jonashg -*! Gave the module a name and added it to printk's. -*! -*! Revision 1.4 2001/05/31 14:53:40 jonashg -*! Made tempudelay() inline so that the watchdog doesn't reset (see -*! function comment). -*! -*! Revision 1.3 2001/03/26 16:03:06 bjornw -*! Needs linux/config.h -*! -*! Revision 1.2 2001/03/20 19:42:00 bjornw -*! Use the ETRAX prefix on the DS1302 options -*! -*! Revision 1.1 2001/03/20 09:13:50 magnusmn -*! Linux 2.4 port -*! -*! Revision 1.10 2000/07/05 15:38:23 bjornw -*! Dont update kernel time when a RTC_SET_TIME is done -*! -*! Revision 1.9 2000/03/02 15:42:59 macce -*! * Hack to make RTC work on all 2100/2400 -*! -*! Revision 1.8 2000/02/23 16:59:18 torbjore -*! added setup of R_GEN_CONFIG when RTC is connected to the generic port. -*! -*! Revision 1.7 2000/01/17 15:51:43 johana -*! Added RTC_SET_CHARGE ioctl to enable trickle charger. -*! -*! Revision 1.6 1999/10/27 13:19:47 bjornw -*! Added update_xtime_from_cmos which reads back the updated RTC into the kernel. -*! /dev/rtc calls it now. -*! -*! Revision 1.5 1999/10/27 12:39:37 bjornw -*! Disabled superuser check. Anyone can now set the time. -*! -*! Revision 1.4 1999/09/02 13:27:46 pkj -*! Added shadow for R_PORT_PB_CONFIG. -*! Renamed port_g_shadow to port_g_data_shadow. -*! -*! Revision 1.3 1999/09/02 08:28:06 pkj -*! Made it possible to select either port PB or the generic port for the RST -*! signal line to the DS1302 RTC. -*! Also make sure the RST bit is configured as output on Port PB (if used). -*! -*! Revision 1.2 1999/09/01 14:47:20 bjornw -*! Added support for /dev/rtc operations with ioctl RD_TIME and SET_TIME to read -*! and set the date. Register as major 121. -*! -*! Revision 1.1 1999/09/01 09:45:29 bjornw -*! Implemented a DS1302 RTC driver. -*! -*! -*! --------------------------------------------------------------------------- -*! -*! (C) Copyright 1999, 2000, 2001 Axis Communications AB, LUND, SWEDEN -*! -*! $Id: ds1302.c,v 1.2 2003/10/29 08:42:58 fujiwara Exp $ -*! -*!***************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define RTC_MAJOR_NR 121 /* local major, change later */ - -static const char ds1302_name[] = "ds1302"; - -/* Send 8 bits. */ -static void -out_byte_rtc(unsigned int reg_addr, unsigned char x) -{ - //RST H - outw(0x0001,(unsigned long)PLD_RTCRSTODT); - //write data - outw(((x<<8)|(reg_addr&0xff)),(unsigned long)PLD_RTCWRDATA); - //WE - outw(0x0002,(unsigned long)PLD_RTCCR); - //wait - while(inw((unsigned long)PLD_RTCCR)); - - //RST L - outw(0x0000,(unsigned long)PLD_RTCRSTODT); - -} - -static unsigned char -in_byte_rtc(unsigned int reg_addr) -{ - unsigned char retval; - - //RST H - outw(0x0001,(unsigned long)PLD_RTCRSTODT); - //write data - outw((reg_addr&0xff),(unsigned long)PLD_RTCRDDATA); - //RE - outw(0x0001,(unsigned long)PLD_RTCCR); - //wait - while(inw((unsigned long)PLD_RTCCR)); - - //read data - retval=(inw((unsigned long)PLD_RTCRDDATA) & 0xff00)>>8; - - //RST L - outw(0x0000,(unsigned long)PLD_RTCRSTODT); - - return retval; -} - -/* Enable writing. */ - -static void -ds1302_wenable(void) -{ - out_byte_rtc(0x8e,0x00); -} - -/* Disable writing. */ - -static void -ds1302_wdisable(void) -{ - out_byte_rtc(0x8e,0x80); -} - - - -/* Read a byte from the selected register in the DS1302. */ - -unsigned char -ds1302_readreg(int reg) -{ - unsigned char x; - - x=in_byte_rtc((0x81 | (reg << 1))); /* read register */ - - return x; -} - -/* Write a byte to the selected register. */ - -void -ds1302_writereg(int reg, unsigned char val) -{ - ds1302_wenable(); - out_byte_rtc((0x80 | (reg << 1)),val); - ds1302_wdisable(); -} - -void -get_rtc_time(struct rtc_time *rtc_tm) -{ - unsigned long flags; - - local_irq_save(flags); - local_irq_disable(); - - rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); - rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); - rtc_tm->tm_hour = CMOS_READ(RTC_HOURS); - rtc_tm->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH); - rtc_tm->tm_mon = CMOS_READ(RTC_MONTH); - rtc_tm->tm_year = CMOS_READ(RTC_YEAR); - - local_irq_restore(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 <= 69) - rtc_tm->tm_year += 100; - - rtc_tm->tm_mon--; -} - -static unsigned char days_in_mo[] = - {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - -/* ioctl that supports RTC_RD_TIME and RTC_SET_TIME (read and set time/date). */ - -static int -rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg) -{ - unsigned long flags; - - switch(cmd) { - case RTC_RD_TIME: /* read the time/date from RTC */ - { - struct rtc_time rtc_tm; - - memset(&rtc_tm, 0, sizeof (struct rtc_time)); - get_rtc_time(&rtc_tm); - if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time))) - return -EFAULT; - return 0; - } - - 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 -EPERM; - - 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) || (yrs > 2069)) - 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 >= 2000) - yrs -= 2000; /* RTC (0, 1, ... 69) */ - else - yrs -= 1900; /* RTC (70, 71, ... 99) */ - - BIN_TO_BCD(sec); - BIN_TO_BCD(min); - BIN_TO_BCD(hrs); - BIN_TO_BCD(day); - BIN_TO_BCD(mon); - BIN_TO_BCD(yrs); - - local_irq_save(flags); - local_irq_disable(); - CMOS_WRITE(yrs, RTC_YEAR); - CMOS_WRITE(mon, RTC_MONTH); - CMOS_WRITE(day, RTC_DAY_OF_MONTH); - CMOS_WRITE(hrs, RTC_HOURS); - CMOS_WRITE(min, RTC_MINUTES); - CMOS_WRITE(sec, RTC_SECONDS); - local_irq_restore(flags); - - /* Notice that at this point, the RTC is updated but - * the kernel is still running with the old time. - * You need to set that separately with settimeofday - * or adjtimex. - */ - return 0; - } - - case RTC_SET_CHARGE: /* set the RTC TRICKLE CHARGE register */ - { - int tcs_val; - - if (!capable(CAP_SYS_TIME)) - return -EPERM; - - if(copy_from_user(&tcs_val, (int*)arg, sizeof(int))) - return -EFAULT; - - tcs_val = RTC_TCR_PATTERN | (tcs_val & 0x0F); - ds1302_writereg(RTC_TRICKLECHARGER, tcs_val); - return 0; - } - default: - return -EINVAL; - } -} - -int -get_rtc_status(char *buf) -{ - char *p; - struct rtc_time tm; - - 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", - tm.tm_hour, tm.tm_min, tm.tm_sec, - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); - - return p - buf; -} - - -/* The various file operations we support. */ - -static struct file_operations rtc_fops = { - .owner = THIS_MODULE, - .ioctl = rtc_ioctl, -}; - -/* Probe for the chip by writing something to its RAM and try reading it back. */ - -#define MAGIC_PATTERN 0x42 - -static int __init -ds1302_probe(void) -{ - int retval, res, baur; - - baur=(boot_cpu_data.bus_clock/(2*1000*1000)); - - printk("%s: Set PLD_RTCBAUR = %d\n", ds1302_name,baur); - - outw(0x0000,(unsigned long)PLD_RTCCR); - outw(0x0000,(unsigned long)PLD_RTCRSTODT); - outw(baur,(unsigned long)PLD_RTCBAUR); - - /* Try to talk to timekeeper. */ - - ds1302_wenable(); - /* write RAM byte 0 */ - /* write something magic */ - out_byte_rtc(0xc0,MAGIC_PATTERN); - - /* read RAM byte 0 */ - if((res = in_byte_rtc(0xc1)) == MAGIC_PATTERN) { - char buf[100]; - ds1302_wdisable(); - printk("%s: RTC found.\n", ds1302_name); - get_rtc_status(buf); - printk(buf); - retval = 1; - } else { - printk("%s: RTC not found.\n", ds1302_name); - retval = 0; - } - - return retval; -} - - -/* Just probe for the RTC and register the device to handle the ioctl needed. */ - -int __init -ds1302_init(void) -{ - if (!ds1302_probe()) { - return -1; - } - return 0; -} - -static int __init ds1302_register(void) -{ - ds1302_init(); - if (register_chrdev(RTC_MAJOR_NR, ds1302_name, &rtc_fops)) { - printk(KERN_INFO "%s: unable to get major %d for rtc\n", - ds1302_name, RTC_MAJOR_NR); - return -1; - } - return 0; -} - -module_init(ds1302_register); diff -Nru a/arch/m32r/drivers/m32r-pldsio.c b/arch/m32r/drivers/m32r-pldsio.c --- a/arch/m32r/drivers/m32r-pldsio.c 2004-10-06 19:37:46 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,3067 +0,0 @@ -/* $Id$ - * - * M32R onboard PLD serial module support. - * - * Much of the design and some of the code came from serial.c: - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, - * 1998, 1999 Theodore Ts'o - * - * M32R work: - * Copyright 1996, 2001, Mitsubishi Electric Corporation - * Copyright (C) 2000,2001 by Hiro Kondo, Hiro Takata, and Hitoshi Yamamoto. - * - * 2002-12-25: Support M32700UT Platform by Takeo Takahashi - * Derived from dbg_console.c. - */ - -static char *serial_version = "kondo"; -static char *serial_revdate = "2002-09-11"; -static char *serial_name = "M32R Serial driver"; - -#define LOCAL_VERSTRING "" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* serial_state */ -#include /* kmalloc */ - -#include -#include -#include -#include -#include - -extern struct console console_for_debug; - -static int psio_write(struct tty_struct *tty, int from_user, - const unsigned char *buf, int count); -static int psio_write_room(struct tty_struct *tty); -static int psio_chars_in_buffer(struct tty_struct *tty); - -static void dbg_console_write(struct console *, const char *, unsigned); -static kdev_t dbg_console_device(struct console *c); -//static void psio_interrupt_single(int, void *, struct pt_regs *); -void psio_interrupt_single(int, void *, struct pt_regs *); -static void psio_receive_chars(struct async_struct *, int *); - -static void psio_wait_until_sent(struct tty_struct *, int); -static void change_speed(struct async_struct *,struct termios *); -static void autoconfig(struct serial_state *); -static unsigned detect_uart_irq (struct serial_state *); - -static struct tty_driver psio_driver; -static int psio_refcount; - -#define RS_STROBE_TIME (10*HZ) -#define RS_ISR_PASS_LIMIT 256 - -/* number of characters left in xmit buffer before we ask for more */ -#define WAKEUP_CHARS 256 - -static struct async_struct *IRQ_ports[NR_IRQS]; -static int IRQ_timeout[NR_IRQS]; -#ifdef CONFIG_SERIAL_CONSOLE -static struct console cons; -static int lsr_break_flag; -#endif - -#define BAUDRATE 115200 /* Set Baudrate */ - -/* - * Here we define the default xmit fifo size used for each type of - * UART - */ -static struct serial_uart_config uart_config[] = { - { "unknown", 1, 0 }, - { "8250", 1, 0 }, - { "16450", 1, 0 }, - { "16550", 1, 0 }, - { "16550A", 16, UART_CLEAR_FIFO | UART_USE_FIFO }, - { "cirrus", 1, 0 }, /* usurped by cyclades.c */ - { "ST16650", 1, UART_CLEAR_FIFO | UART_STARTECH }, - { "ST16650V2", 32, UART_CLEAR_FIFO | UART_USE_FIFO | - UART_STARTECH }, - { "TI16750", 64, UART_CLEAR_FIFO | UART_USE_FIFO}, - { "Startech", 1, 0}, /* usurped by cyclades.c */ - { "16C950/954", 128, UART_CLEAR_FIFO | UART_USE_FIFO}, - { "ST16654", 64, UART_CLEAR_FIFO | UART_USE_FIFO | - UART_STARTECH }, - { "XR16850", 128, UART_CLEAR_FIFO | UART_USE_FIFO | - UART_STARTECH }, - { "RSA", 2048, UART_CLEAR_FIFO | UART_USE_FIFO }, - { "m32102", 1, 0 }, - { 0, 0} -}; - -static struct serial_state rs_table[RS_TABLE_SIZE] = { -/* UART CLK PORT IRQ FLAGS */ - { 0, BAUDRATE, ((int)PLD_ESIO0CR + NONCACHE_OFFSET), PLD_IRQ_SIO0_RCV, STD_COM_FLAGS }, -}; -#define NR_PORTS (sizeof(rs_table)/sizeof(struct serial_state)) - - -#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) - -static DECLARE_TASK_QUEUE(tq_psio_serial); -static struct tty_struct *psio_table[NR_PORTS]; -static struct termios *psio_termios[NR_PORTS]; -static struct termios *psio_termios_locked[NR_PORTS]; - -#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT) -#define DBG_CNT(s) printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \ - kdevname(tty->device), (info->flags), serial_refcount,info->count,tty->count,s -) -#else -#define DBG_CNT(s) -#endif - - -static struct timer_list serial_timer; - -static unsigned char *tmp_buf; -#ifdef DECLARE_MUTEX -static DECLARE_MUTEX(tmp_buf_sem); -#else -static struct semaphore tmp_buf_sem = MUTEX; -#endif - -static int dbg_console_setup(struct console *console, char *options); - -#undef SIO0CR -#undef SIO0MOD0 -#undef SIO0MOD1 -#undef SIO0STS -#undef SIO0IMASK -#undef SIO0BAUR -#undef SIO0TXB -#undef SIO0RXB -#define SIO0CR PLD_ESIO0CR -#define SIO0MOD0 PLD_ESIO0MOD0 -#define SIO0MOD1 PLD_ESIO0MOD1 -#define SIO0STS PLD_ESIO0STS -#define SIO0IMASK PLD_ESIO0INTCR -#define SIO0BAUR PLD_ESIO0BAUR -#define SIO0TXB PLD_ESIO0TXB -#define SIO0RXB PLD_ESIO0RXB - -#define SIO_IMASK_TEMPIE (1UL<<1) /* b14: enable */ -#define SIO_IMASK_RXCEN (1UL<<2) /* b13: enable */ -#define SIO_IMASK_REIE (0UL) -#define SIO_SIO0STS_TEMP (1UL<<0) /* Transmitter Register Empty */ -#define SIO_SIO0STS_TXCP (1UL<<1) -#define SIO_SIO0STS_RXCP (1UL<<2) -#define SIO_SIO0STS_OERR (0UL) -#define SIO_SIO0STS_PERR (0UL) -#define SIO_SIO0STS_FERR (0UL) -#define SIO_SIO0MOD0_CTSS (1UL<<6) -#define SIO_SIO0MOD0_RTSS (1UL<<7) -#define SIO_NONE (0UL) - -#define UART_TX ((unsigned char *)SIO0TXB - (unsigned char *)SIO0CR) -#define UART_RX ((unsigned char *)SIO0RXB - (unsigned char *)SIO0CR) -#define UART_IER ((unsigned char *)SIO0IMASK - (unsigned char *)SIO0CR) -#define UART_IER_THRI SIO_IMASK_TEMPIE -#define UART_IER_MSI SIO_NONE -#define UART_IER_RLSI SIO_IMASK_RXCEN -#define UART_IER_RDI SIO_IMASK_REIE -#define UART_LSR ((unsigned char *)SIO0STS - (unsigned char *)SIO0CR) -#define UART_LSR_DR SIO_SIO0STS_RXCP -#define UART_LSR_THRE SIO_SIO0STS_TEMP -#define UART_LSR_TEMT SIO_SIO0STS_TXCP -#define UART_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) -#define UART_LSR_BI SIO_NONE -#define UART_LSR_PE SIO_SIO0STS_PERR -#define UART_LSR_FE SIO_SIO0STS_FERR -#define UART_LSR_OE SIO_SIO0STS_OERR -#define UART_IIR ((unsigned char *)SIO0STS - (unsigned char *)SIO0CR) -#define UART_LCR ((unsigned char *)SIO0CR - (unsigned char *)SIO0CR) -#define UART_LCR_SBC SIO_NONE -#define UART_LCR_PARITY SIO_NONE -#define UART_LCR_EPAR SIO_NONE -#define UART_LCR_SPAR SIO_NONE -#define UART_MCR ((unsigned char *)SIO0MOD0 - (unsigned char *)SIO0CR) -#define UART_MCR_RTS SIO_SIO0MOD0_RTSS -#define UART_MCR_DTR SIO_NONE /* SIO_SIO0MOD0_CTSS */ -#define UART_MCR_LOOP SIO_NONE -#define UART_MCR_OUT1 SIO_NONE -#define UART_MCR_OUT2 SIO_NONE -#define UART_MSR ((unsigned char *)SIO0MOD0 - (unsigned char *)SIO0CR) -#define UART_MSR_DCD SIO_NONE -#define UART_MSR_RI SIO_NONE -#define UART_MSR_DSR SIO_NONE -#define UART_MSR_CTS SIO_NONE - -#define UART_BAUR ((unsigned char *)SIO0BAUR - (unsigned char *)SIO0CR) -#define UART_MOD0 ((unsigned char *)SIO0MOD0 - (unsigned char *)SIO0CR) -#define UART_MOD1 ((unsigned char *)SIO0MOD1 - (unsigned char *)SIO0CR) - -static inline unsigned int psio_in(struct async_struct *info,int offset) -{ - return *(volatile unsigned short *)(info->port + offset); -} -static inline void psio_out(struct async_struct *info,int offset,int value) -{ - *(volatile unsigned short *)(info->port + offset) = value; -} - -#define serial_in(info, offset) psio_in(info,(int)offset) -#define serial_out(info, offset, value) psio_out(info,(int)offset, value) -#define serial_inp(info, offset) psio_in(info,(int)offset) -#define serial_outp(info, offset, value) psio_out(info,(int)offset, value) - - -static inline int serial_paranoia_check(struct async_struct *info, - kdev_t device, const char *routine) -{ -#ifdef SERIAL_PARANOIA_CHECK - static const char *badmagic = - "Warning: bad magic number for serial struct (%s) in %s\n"; - static const char *badinfo = - "Warning: null async_struct for (%s) in %s\n"; - - if (!info) { - printk(badinfo, kdevname(device), routine); - return 1; - } - if (info->magic != SERIAL_MAGIC) { - printk(badmagic, kdevname(device), routine); - return 1; - } -#endif - return 0; -} - -/* - * ------------------------------------------------------------ - * psio_stop() and psio_start() - * - * This routines are called before setting or resetting tty->stopped. - * They enable or disable transmitter interrupts, as necessary. - * ------------------------------------------------------------ - */ -static void psio_stop(struct tty_struct *tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; - - if (serial_paranoia_check(info, tty->device, "psio_stop")) - return; - - save_flags(flags); cli(); - if (info->IER & UART_IER_THRI) { - info->IER &= ~UART_IER_THRI; - serial_out(info, UART_IER, info->IER); - } - restore_flags(flags); - -} - -static void psio_start(struct tty_struct *tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; - - if (serial_paranoia_check(info, tty->device, "psio_start")) - return; - - save_flags(flags); cli(); - if (info->xmit.head != info->xmit.tail - && info->xmit.buf - && !(info->IER & UART_IER_THRI)) { - info->IER |= UART_IER_THRI; - serial_out(info, UART_IER, info->IER); - serial_out(info, UART_TX, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1); - info->state->icount.tx++; - } - restore_flags(flags); -} - - -/* - * This routine is used by the interrupt handler to schedule - * processing in the software interrupt portion of the driver. - */ -static inline void psio_sched_event(struct async_struct *info,int event) -{ - info->event |= 1 << event; - queue_task(&info->tqueue, &tq_psio_serial); - mark_bh(SERIAL_BH); -} - -static inline void psio_receive_chars(struct async_struct *info,int *status) -{ - struct tty_struct *tty = info->tty; - unsigned char ch; - struct async_icount *icount; - int max_count = 256; - - icount = &info->state->icount; - do { - if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty->flip.tqueue.routine((void *) tty); - if (tty->flip.count >= TTY_FLIPBUF_SIZE) - return; // if TTY_DONT_FLIP is set - } - ch = serial_inp(info, UART_RX); - *tty->flip.char_buf_ptr = ch; - icount->rx++; - -#ifdef SERIAL_DEBUG_INTR - printk("DR%02x:%02x...", ch, *status); -#endif - *tty->flip.flag_buf_ptr = 0; - if (*status & (UART_LSR_BI | UART_LSR_PE | - UART_LSR_FE | UART_LSR_OE)) { - /* - * For statistics only - */ - if (*status & UART_LSR_BI) { - *status &= ~(UART_LSR_FE | UART_LSR_PE); - icount->brk++; - /* - * We do the SysRQ and SAK checking - * here because otherwise the break - * may get masked by ignore_status_mask - * or read_status_mask. - */ -#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) - if (info->line == cons.index) { - if (!break_pressed) { - break_pressed = jiffies; - goto ignore_char; - } - break_pressed = 0; - } -#endif - if (info->flags & ASYNC_SAK) - do_SAK(tty); - } else if (*status & UART_LSR_PE) - icount->parity++; - else if (*status & UART_LSR_FE) - icount->frame++; - if (*status & UART_LSR_OE) - icount->overrun++; - - /* - * Mask off conditions which should be ignored. - */ - *status &= info->read_status_mask; - -#ifdef CONFIG_SERIAL_CONSOLE - if (info->line == cons.index) { - /* Recover the break flag from console xmit */ - *status |= lsr_break_flag; - lsr_break_flag = 0; - } -#endif - if (*status & (UART_LSR_BI)) { -#ifdef SERIAL_DEBUG_INTR - printk("handling break...."); -#endif - *tty->flip.flag_buf_ptr = TTY_BREAK; - } else if (*status & UART_LSR_PE) - *tty->flip.flag_buf_ptr = TTY_PARITY; - else if (*status & UART_LSR_FE) - *tty->flip.flag_buf_ptr = TTY_FRAME; - } -#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) - if (break_pressed && info->line == cons.index) { - if (ch != 0 && - time_before(jiffies, break_pressed + HZ*5)) { - handle_sysrq(ch, regs, NULL, NULL); - break_pressed = 0; - goto ignore_char; - } - break_pressed = 0; - } -#endif - if ((*status & info->ignore_status_mask) == 0) { - tty->flip.flag_buf_ptr++; - tty->flip.char_buf_ptr++; - tty->flip.count++; - } -#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) - ignore_char: -#endif - *status = serial_inp(info, UART_LSR); - } while ((*status & UART_LSR_DR) && (max_count-- > 0)); -#if (LINUX_VERSION_CODE > 131394) /* 2.1.66 */ - tty_flip_buffer_push(tty); -#else - queue_task_irq_off(&tty->flip.tqueue, &tq_timer); -#endif -} - -static void transmit_chars(struct async_struct *info, int *intr_done) -{ - int count; - - if (info->x_char) { - // for M32102 serial - // serial_outp(info, UART_TX, info->x_char); - info->state->icount.tx++; - info->x_char = 0; - if (intr_done) - *intr_done = 0; - while((serial_in(info,UART_LSR) & UART_LSR_TEMT) == 0); - return; - } - if (info->xmit.head == info->xmit.tail - || info->tty->stopped - || info->tty->hw_stopped) { - info->IER &= ~UART_IER_THRI; - serial_out(info, UART_IER, info->IER); - return; - } - count = info->xmit_fifo_size; - count = SERIAL_XMIT_SIZE-1; - do { - serial_out(info, UART_TX, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1); - info->state->icount.tx++; - - if (info->xmit.head == info->xmit.tail) - break; - - while((serial_in(info,UART_LSR) & UART_LSR_THRE) == 0); - } while (--count > 0); - while((serial_in(info,UART_LSR) & UART_LSR_TEMT) == 0); - - if (CIRC_CNT(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE) < WAKEUP_CHARS) - psio_sched_event(info, RS_EVENT_WRITE_WAKEUP); - -#ifdef SERIAL_DEBUG_INTR - printk("THRE..."); -#endif - if (intr_done) - *intr_done = 0; - - if (info->xmit.head == info->xmit.tail) { - info->IER &= ~UART_IER_THRI; - serial_out(info, UART_IER, info->IER); - } -} - - -/* - -#ifdef CONFIG_SERIAL_SHARE_IRQ -static void rs_interrupt(int irq, void *dev_id, struct pt_regs * regs) -#endif -*/ - -static void sio_reset(struct async_struct *info) -{ - unsigned int dummy; - /* reset sio */ - /* read receive buffer */ - dummy = serial_inp(info, UART_RX); - dummy = serial_inp(info, UART_RX); - dummy = serial_inp(info, UART_LSR); - serial_outp(info, UART_LCR, 0x0300); /* RSCLR:1, TSCLR:1 */ - serial_outp(info, UART_LCR, 0x0003); /* RSEN:1, TXEN:1 */ -} - -static void sio_error(struct async_struct *info,int status) -{ - unsigned int dummy; - /* reset sio */ - printk("sio[%d] error[%04x]\n", info->line,status); - /* read receive buffer */ - dummy = serial_inp(info, UART_RX); - dummy = serial_inp(info, UART_RX); - dummy = serial_inp(info, UART_LSR); - serial_outp(info, UART_LCR, 0x0300); /* RSCLR:1, TSCLR:1 */ - serial_outp(info, UART_LCR, 0x0003); /* RSEN:1, TXEN:1 */ -} - -//static void psio_interrupt_single(int irq, void *dev_id, struct pt_regs * regs) -void psio_interrupt_single(int irq, void *dev_id, struct pt_regs * regs) -{ - int status; - // int pass_counter = 0; - struct async_struct * info; - -#ifdef CONFIG_SERIAL_MULTIPORT - int first_multi = 0; - struct rs_multiport_struct *multi; -#endif - -#ifdef SERIAL_DEBUG_INTR - printk("psio_interrupt_single(%d)...", irq); -#endif - - info = IRQ_ports[irq&(~1)]; - if (!info || !info->tty) - return; - -#ifdef CONFIG_SERIAL_MULTIPORT - multi = &rs_multiport[irq]; - if (multi->port_monitor) - first_multi = inb(multi->port_monitor); -#endif - - { - status = serial_inp(info, UART_LSR); -#ifdef SERIAL_DEBUG_INTR - printk("status = %x...", status); -#endif - if (status & UART_LSR_DR){ - psio_receive_chars(info, &status); - } - if ((serial_in(info,UART_LSR) & UART_EMPTY) != UART_EMPTY) - sio_error(info, status); - if (status & UART_LSR_THRE) - transmit_chars(info, 0); -#ifdef SERIAL_DEBUG_INTR - printk("IIR = %x...", serial_in(info, UART_IIR)); -#endif - } - - info->last_active = jiffies; -#ifdef CONFIG_SERIAL_MULTIPORT - if (multi->port_monitor) - printk("rs port monitor (single) irq %d: 0x%x, 0x%x\n", - info->state->irq, first_multi, - inb(multi->port_monitor)); -#endif -#ifdef SERIAL_DEBUG_INTR - printk("end.\n"); -#endif -} -#ifdef CONFIG_SERIAL_MULTIPORT -static void rs_interrupt_multi(int irq, void *dev_id, struct pt_regs * regs) -{} -#endif - -static void do_psio_serial_bh(void) -{ - run_task_queue(&tq_psio_serial); -} - -static void do_softint(void *private_) -{ - struct async_struct *info = (struct async_struct *) private_; - struct tty_struct *tty; - - tty = info->tty; - if (!tty) - return; - - if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) { - if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && - tty->ldisc.write_wakeup) - (tty->ldisc.write_wakeup)(tty); - wake_up_interruptible(&tty->write_wait); -#ifdef SERIAL_HAVE_POLL_WAIT - wake_up_interruptible(&tty->poll_wait); -#endif - } -} - -static void psio_timer(void) -{ - static unsigned long last_strobe = 0; - struct async_struct *info; - unsigned int i; - unsigned long flags; - - if ((jiffies - last_strobe) >= RS_STROBE_TIME) { - for (i=0; i < NR_IRQS; i++) { - info = IRQ_ports[i]; - if (!info) - continue; - save_flags(flags); cli(); - psio_interrupt_single(i, NULL, NULL); - restore_flags(flags); - } - } - last_strobe = jiffies; - -#if 1 - mod_timer(&serial_timer, jiffies + 10); -#else - mod_timer(&serial_timer, jiffies + RS_STROBE_TIME); -#endif - - if (IRQ_ports[0]) { - save_flags(flags); cli(); -#ifdef CONFIG_SERIAL_SHARE_IRQ - psio_interrupt(0, NULL, NULL); -#else - psio_interrupt_single(0, NULL, NULL); -#endif - restore_flags(flags); - - mod_timer(&serial_timer, jiffies + IRQ_timeout[0]); - } -} - -/* - * --------------------------------------------------------------- - * Low level utility subroutines for the serial driver: routines to - * figure out the appropriate timeout for an interrupt chain, routines - * to initialize and startup a serial port, and routines to shutdown a - * serial port. Useful stuff like that. - * --------------------------------------------------------------- - */ - -/* - * This routine figures out the correct timeout for a particular IRQ. - * It uses the smallest timeout of all of the serial ports in a - * particular interrupt chain. Now only used for IRQ 0.... - */ -static void figure_IRQ_timeout(int irq) -{ - struct async_struct *info; - int timeout = 60*HZ; /* 60 seconds === a long time :-) */ - - info = IRQ_ports[irq]; - if (!info) { - IRQ_timeout[irq] = 60*HZ; - return; - } - while (info) { - if (info->timeout < timeout) - timeout = info->timeout; - info = info->next_port; - } - if (!irq) - timeout = timeout / 2; - IRQ_timeout[irq] = timeout ? timeout : 1; -} - -#ifdef CONFIG_SERIAL_RSA -/* Attempts to turn on the RSA FIFO. Returns zero on failure */ -static int enable_rsa(struct async_struct *info) {} - -/* Attempts to turn off the RSA FIFO. Returns zero on failure */ -static int disable_rsa(struct async_struct *info) { } -#endif /* CONFIG_SERIAL_RSA */ - -static int startup(struct async_struct * info) -{ - unsigned long flags; - int retval=0; - void (*handler)(int, void *, struct pt_regs *); - struct serial_state *state= info->state; - unsigned long page; -#ifdef CONFIG_SERIAL_MANY_PORTS - unsigned short ICP; -#endif - - page = get_zeroed_page(GFP_KERNEL); - if (!page) - return -ENOMEM; - - save_flags(flags); cli(); - - if (info->flags & ASYNC_INITIALIZED) { - free_page(page); - goto errout; - } - if (info->xmit.buf) - free_page(page); - else - info->xmit.buf = (unsigned char *) page; - -#ifdef SERIAL_DEBUG_OPEN - printk("starting up ttyD%d (irq %d)...", info->line, state->irq); -#endif - - /* - * Clear the FIFO buffers and disable them - * (they will be reenabled in change_speed()) - */ - - /* - * Clear the interrupt registers. - */ - sio_reset(info); - - /* - * Allocate the IRQ if necessary - */ - if (state->irq && (!IRQ_ports[state->irq] || - !IRQ_ports[state->irq]->next_port)) { - if (IRQ_ports[state->irq]) { -#ifdef CONFIG_SERIAL_SHARE_IRQ - free_irq(state->irq, &IRQ_ports[state->irq]); - free_irq(state->irq+1, &IRQ_ports[state->irq]); -#ifdef CONFIG_SERIAL_MULTIPORT - if (rs_multiport[state->irq].port1) - handler = rs_interrupt_multi; - else -#endif - handler = psio_interrupt; -#else - retval = -EBUSY; - goto errout; -#endif /* CONFIG_SERIAL_SHARE_IRQ */ - } else - handler = psio_interrupt_single; - - /* 020116 */ - retval = request_irq(state->irq, handler, SA_SHIRQ, - "serial_rx", &IRQ_ports[state->irq]); - retval = request_irq(state->irq+1, handler, SA_SHIRQ, - "serial_tx", &IRQ_ports[state->irq]); - if (retval) { - if (capable(CAP_SYS_ADMIN)) { - if (info->tty) - set_bit(TTY_IO_ERROR, - &info->tty->flags); - retval = 0; - } - goto errout; - } - } - - /* - * Insert serial port into IRQ chain. - */ - info->prev_port = 0; - info->next_port = IRQ_ports[state->irq]; - if (info->next_port) - info->next_port->prev_port = info; - IRQ_ports[state->irq] = info; - figure_IRQ_timeout(state->irq); - - /* - * Now, initialize the UART - */ - /* for m32r @020113 */ - sio_reset(info); - - info->MCR = 0; - if (info->tty->termios->c_cflag & CBAUD) - info->MCR = UART_MCR_DTR | UART_MCR_RTS; -#ifdef CONFIG_SERIAL_MANY_PORTS - if (info->flags & ASYNC_FOURPORT) { - if (state->irq == 0) - info->MCR |= UART_MCR_OUT1; - } else -#endif - { - if (state->irq != 0) - info->MCR |= UART_MCR_OUT2; - } - info->MCR |= ALPHA_KLUDGE_MCR; /* Don't ask */ - serial_outp(info, UART_MCR, info->MCR); - - /* - * Finally, enable interrupts - */ - info->IER = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI; - serial_outp(info, UART_IER, info->IER); /* enable interrupts */ - -#ifdef CONFIG_SERIAL_MANY_PORTS - if (info->flags & ASYNC_FOURPORT) { - /* Enable interrupts on the AST Fourport board */ - ICP = (info->port & 0xFE0) | 0x01F; - outb_p(0x80, ICP); - (void) inb_p(ICP); - } -#endif - - /* - * And clear the interrupt registers again for luck. - */ - (void)serial_inp(info, UART_LSR); - (void)serial_inp(info, UART_RX); - (void)serial_inp(info, UART_IIR); - (void)serial_inp(info, UART_MSR); - - if (info->tty) - clear_bit(TTY_IO_ERROR, &info->tty->flags); - info->xmit.head = info->xmit.tail = 0; - - /* - * Set up serial timers... - */ - mod_timer(&serial_timer, jiffies + 2*HZ/100); - - /* - * Set up the tty->alt_speed kludge - */ -#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */ - if (info->tty) { - if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) - info->tty->alt_speed = 57600; - if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) - info->tty->alt_speed = 115200; - if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) - info->tty->alt_speed = 230400; - if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) - info->tty->alt_speed = 460800; - } -#endif - - /* - * and set the speed of the serial port - */ - change_speed(info, 0); - - info->flags |= ASYNC_INITIALIZED; - restore_flags(flags); - return 0; - -errout: - restore_flags(flags); - return retval; -} - -/* - * This routine will shutdown a serial port; interrupts are disabled, and - * DTR is dropped if the hangup on close termio flag is on. - */ -static void shutdown(struct async_struct * info) -{ - unsigned long flags; - struct serial_state *state; - int retval; - - if (!(info->flags & ASYNC_INITIALIZED)) - return; - - state = info->state; - -#ifdef SERIAL_DEBUG_OPEN - printk("Shutting down serial port %d (irq %d)....", info->line, - state->irq); -#endif - - save_flags(flags); cli(); /* Disable interrupts */ - - /* - * clear delta_msr_wait queue to avoid mem leaks: we may free the irq - * here so the queue might never be waken up - */ - wake_up_interruptible(&info->delta_msr_wait); - - /* - * First unlink the serial port from the IRQ chain... - */ - if (info->next_port) - info->next_port->prev_port = info->prev_port; - if (info->prev_port) - info->prev_port->next_port = info->next_port; - else - IRQ_ports[state->irq] = info->next_port; - figure_IRQ_timeout(state->irq); - - /* - * Free the IRQ, if necessary - */ - if (state->irq && (!IRQ_ports[state->irq] || - !IRQ_ports[state->irq]->next_port)) { - if (IRQ_ports[state->irq]) { - /* 020116 */ - free_irq(state->irq+1, &IRQ_ports[state->irq]); - retval = request_irq(state->irq+1, psio_interrupt_single, - SA_SHIRQ, "serial_xx", - &IRQ_ports[state->irq]); - free_irq(state->irq, &IRQ_ports[state->irq]); - retval = request_irq(state->irq, psio_interrupt_single, - SA_SHIRQ, "serial", - &IRQ_ports[state->irq]); - - if (retval) - printk("serial shutdown: request_irq: error %d" - " Couldn't reacquire IRQ.\n", retval); - } else{ - free_irq(state->irq, &IRQ_ports[state->irq]); - /* 020116 */ - free_irq(state->irq+1, &IRQ_ports[state->irq]); - } - } - if (info->xmit.buf) { - unsigned long pg = (unsigned long) info->xmit.buf; - info->xmit.buf = 0; - free_page(pg); - } - - info->IER = 0; - serial_outp(info, UART_IER, 0x00); /* disable all intrs */ -#ifdef CONFIG_SERIAL_MANY_PORTS - if (info->flags & ASYNC_FOURPORT) { - /* reset interrupts on the AST Fourport board */ - (void) inb((info->port & 0xFE0) | 0x01F); - info->MCR |= UART_MCR_OUT1; - } else -#endif - if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) - info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS); - serial_outp(info, UART_MCR, info->MCR); - -#ifdef CONFIG_SERIAL_RSA - /* - * Reset the RSA board back to 115kbps compat mode. - */ - if ((state->type == PORT_RSA) && - (state->baud_base == SERIAL_RSA_BAUD_BASE && - disable_rsa(info))) - state->baud_base = SERIAL_RSA_BAUD_BASE_LO; -#endif - - - (void)serial_in(info, UART_RX); /* read data port to reset things */ - - if (info->tty) - set_bit(TTY_IO_ERROR, &info->tty->flags); - - sio_reset(info); - - info->flags &= ~ASYNC_INITIALIZED; - restore_flags(flags); -} - -static void change_speed(struct async_struct *info,struct termios *old_termios) -{ - int quot = 0, baud_base, baud; - unsigned cflag, cval = 0; - int bits; - unsigned long flags; - unsigned mod0, mod1; - - if (!info->tty || !info->tty->termios) - return; - cflag = info->tty->termios->c_cflag; - if (!CONFIGURED_SERIAL_PORT(info)) - return; - - /* byte size and parity */ - switch (cflag & CSIZE) { - case CS5: mod1 = 0x05; bits = 7; break; - case CS6: mod1 = 0x06; bits = 8; break; - case CS7: mod1 = 0x07; bits = 9; break; - case CS8: mod1 = 0x08; bits = 10; break; - /* Never happens, but GCC is too dumb to figure it out */ - default: mod1 = 0x05; bits = 7; break; - } - mod1 <<= 8; - mod0 = 0; - if (cflag & CSTOPB) { - mod0 |= 0x03; - bits++; - } - if (cflag & PARENB) { - mod0 |= 0x10; - bits++; - } - if (!(cflag & PARODD)) { - mod0 |= 0x4; - } - mod0 = 0x80; /* Use RTS# output only */ - - serial_outp(info, UART_MOD0, mod0); /* */ - //serial_outp(info, UART_MOD1, mod1); - //mod1 = 0; - info->LCR = mod1; /* Save LCR */ - - /* Determine divisor based on baud rate */ - baud = tty_get_baud_rate(info->tty); - if (!baud) - baud = 9600; /* B0 transition handled in rs_set_termios */ -#ifdef CONFIG_SERIAL_RSA - if ((info->state->type == PORT_RSA) && - (info->state->baud_base != SERIAL_RSA_BAUD_BASE) && - enable_rsa(info)) - info->state->baud_base = SERIAL_RSA_BAUD_BASE; -#endif - baud_base = info->state->baud_base; - - if (baud == 38400 && - ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) - quot = info->state->custom_divisor; - else { - if (baud == 134) - /* Special case since 134 is really 134.5 */ - quot = (2*baud_base / 269); - else if (baud) - quot = baud_base / baud; - } - /* If the quotient is zero refuse the change */ - if (!quot && old_termios) { - info->tty->termios->c_cflag &= ~CBAUD; - info->tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD); - baud = tty_get_baud_rate(info->tty); - if (!baud) - baud = 9600; - if (baud == 38400 && - ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) - quot = info->state->custom_divisor; - else { - if (baud == 134) - /* Special case since 134 is really 134.5 */ - quot = (2*baud_base / 269); - else if (baud) - quot = baud_base / baud ; - } - } - quot = baud_base / (baud*4) ; - /* As a last resort, if the quotient is zero, default to 9600 bps */ - if (!quot) - quot = baud_base / 9600; - /* - * Work around a bug in the Oxford Semiconductor 952 rev B - * chip which causes it to seriously miscalculate baud rates - * when DLL is 0. - */ - if (((quot & 0xFF) == 0) && (info->state->type == PORT_16C950) && - (info->state->revision == 0x5201)) - quot++; - - info->quot = quot; - info->timeout = ((info->xmit_fifo_size*HZ*bits*quot) / baud_base); - info->timeout += HZ/50; /* Add .02 seconds of slop */ - - /* CTS flow control flag and modem status interrupts */ - info->IER &= ~UART_IER_MSI; - if (info->flags & ASYNC_HARDPPS_CD) - info->IER |= UART_IER_MSI; - if (cflag & CRTSCTS) { - info->flags |= ASYNC_CTS_FLOW; - info->IER |= UART_IER_MSI; - } else - info->flags &= ~ASYNC_CTS_FLOW; - if (cflag & CLOCAL) - info->flags &= ~ASYNC_CHECK_CD; - else { - info->flags |= ASYNC_CHECK_CD; - info->IER |= UART_IER_MSI; - } - serial_out(info, UART_IER, info->IER); - - /* - * Set up parity check flag - */ -#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) - - info->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; - if (I_INPCK(info->tty)) - info->read_status_mask |= UART_LSR_FE | UART_LSR_PE; - if (I_BRKINT(info->tty) || I_PARMRK(info->tty)) - info->read_status_mask |= UART_LSR_BI; - - /* - * Characters to ignore - */ - info->ignore_status_mask = 0; - if (I_IGNPAR(info->tty)) - info->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE; - if (I_IGNBRK(info->tty)) { - info->ignore_status_mask |= UART_LSR_BI; - /* - * If we're ignore parity and break indicators, ignore - * overruns too. (For real raw support). - */ - if (I_IGNPAR(info->tty)) - info->ignore_status_mask |= UART_LSR_OE; - } - /* - * !!! ignore all characters if CREAD is not set - */ - if ((cflag & CREAD) == 0) - info->ignore_status_mask |= UART_LSR_DR; - cval = (baud_base / (baud * 4)) - 1; - - save_flags(flags); cli(); - serial_outp(info, UART_BAUR, cval ); /* set baurate reg */ - serial_outp(info, UART_LCR, 0x03); - restore_flags(flags); -} - -static void psio_put_char(struct tty_struct *tty, unsigned char ch) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; - - if (serial_paranoia_check(info, tty->device, "psio_put_char")) - return; - - if (!tty || !info->xmit.buf) - return; - - save_flags(flags); cli(); - if (CIRC_SPACE(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE) == 0) { - restore_flags(flags); - return; - } - - info->xmit.buf[info->xmit.head] = ch; - info->xmit.head = (info->xmit.head + 1) & (SERIAL_XMIT_SIZE-1); - restore_flags(flags); -} - -static void psio_flush_chars(struct tty_struct *tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; - - if (serial_paranoia_check(info, tty->device, "psio_flush_chars")) - return; - - if (info->xmit.head == info->xmit.tail - || tty->stopped - || tty->hw_stopped - || !info->xmit.buf) - return; - - save_flags(flags); cli(); - if (!(info->IER & UART_IER_THRI)) { - info->IER |= UART_IER_THRI; - serial_out(info, UART_IER, info->IER); - serial_out(info, UART_TX, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1); - info->state->icount.tx++; - } - restore_flags(flags); - while((serial_in(info,UART_LSR) & UART_EMPTY) != UART_EMPTY); -} - -static int psio_write(struct tty_struct *tty, int from_user, - const unsigned char *buf, int count) -{ - int c, ret = 0; - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; - - if (serial_paranoia_check(info, tty->device, "psio_write")) - return 0; - - if (!tty || !info->xmit.buf || !tmp_buf) - return 0; - - save_flags(flags); - if (from_user) { - down(&tmp_buf_sem); - while (1) { - int c1; - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE); - if (count < c) - c = count; - if (c <= 0) - break; - - c -= copy_from_user(tmp_buf, buf, c); - if (!c) { - if (!ret) - ret = -EFAULT; - break; - } - cli(); - c1 = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE); - if (c1 < c) - c = c1; - memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c); - info->xmit.head = ((info->xmit.head + c) & - (SERIAL_XMIT_SIZE-1)); - restore_flags(flags); - buf += c; - count -= c; - ret += c; - } - up(&tmp_buf_sem); - } else { - cli(); - while (1) { - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, - SERIAL_XMIT_SIZE); - if (count < c) - c = count; - if (c <= 0) { - break; - } - memcpy(info->xmit.buf + info->xmit.head, buf, c); - info->xmit.head = ((info->xmit.head + c) & - (SERIAL_XMIT_SIZE-1)); - buf += c; - count -= c; - ret += c; - } - restore_flags(flags); - } - save_flags(flags); cli(); - if (info->xmit.head != info->xmit.tail - && !tty->stopped - && !tty->hw_stopped - && !(info->IER & UART_IER_THRI)) { - info->IER |= UART_IER_THRI; - serial_out(info, UART_IER, info->IER); - serial_out(info, UART_TX, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1); - info->state->icount.tx++; - } - restore_flags(flags); - while((serial_in(info,UART_LSR) & UART_EMPTY) != UART_EMPTY); - return ret; -} - -static int psio_write_room(struct tty_struct *tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - - if (serial_paranoia_check(info, tty->device, "psio_write_room")) - return 0; - return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); -} - -static int psio_chars_in_buffer(struct tty_struct *tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - - if (serial_paranoia_check(info, tty->device, "psio_chars_in_buffer")) - return 0; - return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); -} - -static void psio_flush_buffer(struct tty_struct *tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; - - if (serial_paranoia_check(info, tty->device, "psio_flush_buffer")) - return; - save_flags(flags); cli(); - info->xmit.head = info->xmit.tail = 0; - restore_flags(flags); - wake_up_interruptible(&tty->write_wait); -#ifdef SERIAL_HAVE_POLL_WAIT - wake_up_interruptible(&tty->poll_wait); -#endif - if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && - tty->ldisc.write_wakeup) - (tty->ldisc.write_wakeup)(tty); -} - -/* - * This function is used to send a high-priority XON/XOFF character to - * the device - */ -static void psio_send_xchar(struct tty_struct *tty, char ch) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - - if (serial_paranoia_check(info, tty->device, "psio_send_char")) - return; - - info->x_char = ch; - if (ch) { - unsigned long flags; - save_flags(flags); cli(); - if (!(info->IER & UART_IER_THRI)) { - info->IER |= UART_IER_THRI; - serial_out(info, UART_IER, info->IER); - serial_out(info, UART_TX, info->x_char); - } - restore_flags(flags); - } -} - -/* - * ------------------------------------------------------------ - * rs_throttle() - * - * This routine is called by the upper-layer tty layer to signal that - * incoming characters should be throttled. - * ------------------------------------------------------------ - */ -static void psio_throttle(struct tty_struct * tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; -#ifdef SERIAL_DEBUG_THROTTLE - char buf[64]; - - printk("throttle %s: %d....\n", tty_name(tty, buf), - tty->ldisc.chars_in_buffer(tty)); -#endif - - if (serial_paranoia_check(info, tty->device, "psio_throttle")) - return; - - if (I_IXOFF(tty)) - psio_send_xchar(tty, STOP_CHAR(tty)); - - if (tty->termios->c_cflag & CRTSCTS) - info->MCR &= ~UART_MCR_RTS; - - save_flags(flags); cli(); - serial_out(info, UART_MCR, info->MCR); - restore_flags(flags); -} - -static void psio_unthrottle(struct tty_struct * tty) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; -#ifdef SERIAL_DEBUG_THROTTLE - char buf[64]; - - printk("unthrottle %s: %d....\n", tty_name(tty, buf), - tty->ldisc.chars_in_buffer(tty)); -#endif - - if (serial_paranoia_check(info, tty->device, "psio_unthrottle")) - return; - - if (I_IXOFF(tty)) { - if (info->x_char) info->x_char = 0; - } - if (tty->termios->c_cflag & CRTSCTS) - info->MCR |= UART_MCR_RTS; - save_flags(flags); cli(); - serial_out(info, UART_MCR, info->MCR); - restore_flags(flags); -} - -/* - * ------------------------------------------------------------ - * rs_ioctl() and friends - * ------------------------------------------------------------ - */ - -static int get_serial_info(struct async_struct * info, - struct serial_struct * retinfo) -{ - struct serial_struct tmp; - struct serial_state *state = info->state; - - if (!retinfo) - return -EFAULT; - memset(&tmp, 0, sizeof(tmp)); - tmp.type = state->type; - tmp.line = state->line; - tmp.port = state->port; - if (HIGH_BITS_OFFSET) - tmp.port_high = state->port >> HIGH_BITS_OFFSET; - else - tmp.port_high = 0; - tmp.irq = state->irq; - tmp.flags = state->flags; - tmp.xmit_fifo_size = state->xmit_fifo_size; - tmp.baud_base = state->baud_base; - tmp.close_delay = state->close_delay; - tmp.closing_wait = state->closing_wait; - tmp.custom_divisor = state->custom_divisor; - tmp.hub6 = state->hub6; - tmp.io_type = state->io_type; - if (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) - return -EFAULT; - return 0; -} - -static int set_serial_info(struct async_struct * info, - struct serial_struct * new_info) -{ - struct serial_struct new_serial; - struct serial_state old_state, *state; - unsigned int i,change_irq,change_port; - int retval = 0; - unsigned long new_port; - - if (copy_from_user(&new_serial,new_info,sizeof(new_serial))) - return -EFAULT; - state = info->state; - old_state = *state; - - new_port = new_serial.port; - if (HIGH_BITS_OFFSET) - new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET; - - change_irq = new_serial.irq != state->irq; - change_port = (new_port != ((int) state->port)) || - (new_serial.hub6 != state->hub6); - - if (!capable(CAP_SYS_ADMIN)) { - if (change_irq || change_port || - (new_serial.baud_base != state->baud_base) || - (new_serial.type != state->type) || - (new_serial.close_delay != state->close_delay) || - (new_serial.xmit_fifo_size != state->xmit_fifo_size) || - ((new_serial.flags & ~ASYNC_USR_MASK) != - (state->flags & ~ASYNC_USR_MASK))) - return -EPERM; - state->flags = ((state->flags & ~ASYNC_USR_MASK) | - (new_serial.flags & ASYNC_USR_MASK)); - info->flags = ((info->flags & ~ASYNC_USR_MASK) | - (new_serial.flags & ASYNC_USR_MASK)); - state->custom_divisor = new_serial.custom_divisor; - goto check_and_exit; - } - - new_serial.irq = irq_cannonicalize(new_serial.irq); - - if ((new_serial.irq >= NR_IRQS) || (new_serial.irq < 0) || - (new_serial.baud_base < 9600)|| (new_serial.type < PORT_UNKNOWN) || - (new_serial.type > PORT_MAX) || (new_serial.type == PORT_CIRRUS) || - (new_serial.type == PORT_STARTECH)) { - return -EINVAL; - } - - if ((new_serial.type != state->type) || - (new_serial.xmit_fifo_size <= 0)) - new_serial.xmit_fifo_size = - uart_config[new_serial.type].dfl_xmit_fifo_size; - - /* Make sure address is not already in use */ - if (new_serial.type) { - for (i = 0 ; i < NR_PORTS; i++) - if ((state != &rs_table[i]) && - (rs_table[i].port == new_port) && - rs_table[i].type) - return -EADDRINUSE; - } - - if ((change_port || change_irq) && (state->count > 1)) - return -EBUSY; - - /* - * OK, past this point, all the error checking has been done. - * At this point, we start making changes..... - */ - - state->baud_base = new_serial.baud_base; - state->flags = ((state->flags & ~ASYNC_FLAGS) | - (new_serial.flags & ASYNC_FLAGS)); - info->flags = ((state->flags & ~ASYNC_INTERNAL_FLAGS) | - (info->flags & ASYNC_INTERNAL_FLAGS)); - state->custom_divisor = new_serial.custom_divisor; - state->close_delay = new_serial.close_delay * HZ/100; - state->closing_wait = new_serial.closing_wait * HZ/100; -#if (LINUX_VERSION_CODE > 0x20100) - info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; -#endif - info->xmit_fifo_size = state->xmit_fifo_size = - new_serial.xmit_fifo_size; - - if ((state->type != PORT_UNKNOWN) && state->port) { -#ifdef CONFIG_SERIAL_RSA - if (old_state.type == PORT_RSA) - release_region(state->port + UART_RSA_BASE, 16); - else -#endif - release_region(state->port,8); - } - state->type = new_serial.type; - if (change_port || change_irq) { - /* - * We need to shutdown the serial port at the old - * port/irq combination. - */ - shutdown(info); - state->irq = new_serial.irq; - info->port = state->port = new_port; - info->hub6 = state->hub6 = new_serial.hub6; - if (info->hub6) - info->io_type = state->io_type = SERIAL_IO_HUB6; - else if (info->io_type == SERIAL_IO_HUB6) - info->io_type = state->io_type = SERIAL_IO_PORT; - } - if ((state->type != PORT_UNKNOWN) && state->port) { -#ifdef CONFIG_SERIAL_RSA - if (state->type == PORT_RSA) - request_region(state->port + UART_RSA_BASE, - 16, "serial_rsa(set)"); - else -#endif - request_region(state->port,8,"serial(set)"); - } - - -check_and_exit: - if (!state->port || !state->type) - return 0; - if (info->flags & ASYNC_INITIALIZED) { - if (((old_state.flags & ASYNC_SPD_MASK) != - (state->flags & ASYNC_SPD_MASK)) || - (old_state.custom_divisor != state->custom_divisor)) { -#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */ - if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) - info->tty->alt_speed = 57600; - if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) - info->tty->alt_speed = 115200; - if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) - info->tty->alt_speed = 230400; - if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) - info->tty->alt_speed = 460800; -#endif - change_speed(info, 0); - } - } else - retval = startup(info); - return retval; -} - -/* - * get_lsr_info - get line status register info - * - * Purpose: Let user call ioctl() to get info when the UART physically - * is emptied. On bus types like RS485, the transmitter must - * release the bus after transmitting. This must be done when - * the transmit shift register is empty, not be done when the - * transmit holding register is empty. This functionality - * allows an RS485 driver to be written in user space. - */ -static int get_lsr_info(struct async_struct * info, unsigned int *value) -{ - unsigned char status; - unsigned int result; - unsigned long flags; - - save_flags(flags); cli(); - status = serial_in(info, UART_LSR); - restore_flags(flags); - result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0); - - /* - * If we're about to load something into the transmit - * register, we'll pretend the transmitter isn't empty to - * avoid a race condition (depending on when the transmit - * interrupt happens). - */ - if (info->x_char || - ((CIRC_CNT(info->xmit.head, info->xmit.tail, - SERIAL_XMIT_SIZE) > 0) && - !info->tty->stopped && !info->tty->hw_stopped)) - result &= ~TIOCSER_TEMT; - - if (copy_to_user(value, &result, sizeof(int))) - return -EFAULT; - return 0; -} - - -static int get_modem_info(struct async_struct * info, unsigned int *value) -{ - unsigned char control, status; - unsigned int result; - unsigned long flags; - - control = info->MCR; - save_flags(flags); cli(); - status = serial_in(info, UART_MSR); - restore_flags(flags); - result = ((control & UART_MCR_RTS) ? TIOCM_RTS : 0) - | ((control & UART_MCR_DTR) ? TIOCM_DTR : 0) -#ifdef TIOCM_OUT1 - | ((control & UART_MCR_OUT1) ? TIOCM_OUT1 : 0) - | ((control & UART_MCR_OUT2) ? TIOCM_OUT2 : 0) -#endif - | ((status & UART_MSR_DCD) ? TIOCM_CAR : 0) - | ((status & UART_MSR_RI) ? TIOCM_RNG : 0) - | ((status & UART_MSR_DSR) ? TIOCM_DSR : 0) - | ((status & UART_MSR_CTS) ? TIOCM_CTS : 0); - - if (copy_to_user(value, &result, sizeof(int))) - return -EFAULT; - return 0; -} -static int set_modem_info(struct async_struct * info, unsigned int cmd, - unsigned int *value) -{ - unsigned int arg; - unsigned long flags; - - if (copy_from_user(&arg, value, sizeof(int))) - return -EFAULT; - - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - info->MCR |= UART_MCR_RTS; - if (arg & TIOCM_DTR) - info->MCR |= UART_MCR_DTR; -#ifdef TIOCM_OUT1 - if (arg & TIOCM_OUT1) - info->MCR |= UART_MCR_OUT1; - if (arg & TIOCM_OUT2) - info->MCR |= UART_MCR_OUT2; -#endif - if (arg & TIOCM_LOOP) - info->MCR |= UART_MCR_LOOP; - break; - case TIOCMBIC: - if (arg & TIOCM_RTS) - info->MCR &= ~UART_MCR_RTS; - if (arg & TIOCM_DTR) - info->MCR &= ~UART_MCR_DTR; -#ifdef TIOCM_OUT1 - if (arg & TIOCM_OUT1) - info->MCR &= ~UART_MCR_OUT1; - if (arg & TIOCM_OUT2) - info->MCR &= ~UART_MCR_OUT2; -#endif - if (arg & TIOCM_LOOP) - info->MCR &= ~UART_MCR_LOOP; - break; - case TIOCMSET: - info->MCR = ((info->MCR & ~(UART_MCR_RTS | -#ifdef TIOCM_OUT1 - UART_MCR_OUT1 | - UART_MCR_OUT2 | -#endif - UART_MCR_LOOP | - UART_MCR_DTR)) - | ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0) -#ifdef TIOCM_OUT1 - | ((arg & TIOCM_OUT1) ? UART_MCR_OUT1 : 0) - | ((arg & TIOCM_OUT2) ? UART_MCR_OUT2 : 0) -#endif - | ((arg & TIOCM_LOOP) ? UART_MCR_LOOP : 0) - | ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0)); - break; - default: - return -EINVAL; - } - save_flags(flags); cli(); - info->MCR |= ALPHA_KLUDGE_MCR; /* Don't ask */ - serial_out(info, UART_MCR, info->MCR); - restore_flags(flags); - return 0; -} - -static int do_autoconfig(struct async_struct * info) -{ - int irq, retval; - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - - if (info->state->count > 1) - return -EBUSY; - - shutdown(info); - - autoconfig(info->state); - if ((info->state->flags & ASYNC_AUTO_IRQ) && - (info->state->port != 0 || info->state->iomem_base != 0) && - (info->state->type != PORT_UNKNOWN)) { - irq = detect_uart_irq(info->state); - if (irq > 0) - info->state->irq = irq; - } - - retval = startup(info); - if (retval) - return retval; - return 0; -} - -/* - * rs_break() --- routine which turns the break handling on or off - */ -#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ -static void send_break( struct async_struct * info, int duration) -{ - if (!CONFIGURED_SERIAL_PORT(info)) - return; - current->state = TASK_INTERRUPTIBLE; - current->timeout = jiffies + duration; - cli(); - info->LCR |= UART_LCR_SBC; - serial_out(info, UART_LCR, 0x3); - schedule(); - info->LCR &= ~UART_LCR_SBC; - serial_out(info, UART_LCR, 0x3); - sti(); -} -#else -static void psio_break(struct tty_struct *tty, int break_state) -{ - struct async_struct * info = (struct async_struct *)tty->driver_data; - unsigned long flags; - - if (serial_paranoia_check(info, tty->device, "rs_break")) - return; - - if (!CONFIGURED_SERIAL_PORT(info)) - return; - save_flags(flags); cli(); - if (break_state == -1) - info->LCR |= UART_LCR_SBC; - else - info->LCR &= ~UART_LCR_SBC; - restore_flags(flags); -} -#endif - -#ifdef CONFIG_SERIAL_MULTIPORT -static int get_multiport_struct(struct async_struct * info, - struct serial_multiport_struct *retinfo) -{ - struct serial_multiport_struct ret; - struct rs_multiport_struct *multi; - - multi = &rs_multiport[info->state->irq]; - - ret.port_monitor = multi->port_monitor; - - ret.port1 = multi->port1; - ret.mask1 = multi->mask1; - ret.match1 = multi->match1; - - ret.port2 = multi->port2; - ret.mask2 = multi->mask2; - ret.match2 = multi->match2; - - ret.port3 = multi->port3; - ret.mask3 = multi->mask3; - ret.match3 = multi->match3; - - ret.port4 = multi->port4; - ret.mask4 = multi->mask4; - ret.match4 = multi->match4; - - ret.irq = info->state->irq; - - if (copy_to_user(retinfo,&ret,sizeof(*retinfo))) - return -EFAULT; - return 0; -} - -static int set_multiport_struct(struct async_struct * info, - struct serial_multiport_struct *in_multi) -{ - struct serial_multiport_struct new_multi; - struct rs_multiport_struct *multi; - struct serial_state *state; - int was_multi, now_multi; - int retval; - void (*handler)(int, void *, struct pt_regs *); - - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - state = info->state; - - if (copy_from_user(&new_multi, in_multi, - sizeof(struct serial_multiport_struct))) - return -EFAULT; - - if (new_multi.irq != state->irq || state->irq == 0 || - !IRQ_ports[state->irq]) - return -EINVAL; - - multi = &rs_multiport[state->irq]; - was_multi = (multi->port1 != 0); - - multi->port_monitor = new_multi.port_monitor; - - if (multi->port1) - release_region(multi->port1,1); - multi->port1 = new_multi.port1; - multi->mask1 = new_multi.mask1; - multi->match1 = new_multi.match1; - if (multi->port1) - request_region(multi->port1,1,"serial(multiport1)"); - - if (multi->port2) - release_region(multi->port2,1); - multi->port2 = new_multi.port2; - multi->mask2 = new_multi.mask2; - multi->match2 = new_multi.match2; - if (multi->port2) - request_region(multi->port2,1,"serial(multiport2)"); - - if (multi->port3) - release_region(multi->port3,1); - multi->port3 = new_multi.port3; - multi->mask3 = new_multi.mask3; - multi->match3 = new_multi.match3; - if (multi->port3) - request_region(multi->port3,1,"serial(multiport3)"); - - if (multi->port4) - release_region(multi->port4,1); - multi->port4 = new_multi.port4; - multi->mask4 = new_multi.mask4; - multi->match4 = new_multi.match4; - if (multi->port4) - request_region(multi->port4,1,"serial(multiport4)"); - - now_multi = (multi->port1 != 0); - - if (IRQ_ports[state->irq]->next_port && - (was_multi != now_multi)) { - free_irq(state->irq, &IRQ_ports[state->irq]); - if (now_multi) - handler = rs_interrupt_multi; - else - handler = rs_interrupt; - - retval = request_irq(state->irq, handler, SA_SHIRQ, - "serial", &IRQ_ports[state->irq]); - if (retval) { - printk("Couldn't reallocate serial interrupt " - "driver!!\n"); - } - } - return 0; -} -#endif - -static int psio_ioctl(struct tty_struct *tty, struct file * file, - unsigned int cmd, unsigned long arg) -{ - struct async_struct * info = (struct async_struct *)tty->driver_data; - struct async_icount cprev, cnow; /* kernel counter temps */ - struct serial_icounter_struct icount; - unsigned long flags; -#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ - int retval, tmp; -#endif - - if (serial_paranoia_check(info, tty->device, "rs_ioctl")) - return -ENODEV; - - if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && - (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && - (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { - if (tty->flags & (1 << TTY_IO_ERROR)) - return -EIO; - } - - switch (cmd) { -#if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ - case TCSBRK: /* SVID version: non-zero arg --> no break */ - retval = tty_check_change(tty); - if (retval) - return retval; - tty_wait_until_sent(tty, 0); - if (signal_pending(current)) - return -EINTR; - if (!arg) { - send_break(info, HZ/4); /* 1/4 second */ - if (signal_pending(current)) - return -EINTR; - } - return 0; - case TCSBRKP: /* support for POSIX tcsendbreak() */ - retval = tty_check_change(tty); - if (retval) - return retval; - tty_wait_until_sent(tty, 0); - if (signal_pending(current)) - return -EINTR; - send_break(info, arg ? arg*(HZ/10) : HZ/4); - if (signal_pending(current)) - return -EINTR; - return 0; - case TIOCGSOFTCAR: - tmp = C_CLOCAL(tty) ? 1 : 0; - if (copy_to_user((void *)arg, &tmp, sizeof(int))) - return -EFAULT; - return 0; - case TIOCSSOFTCAR: - if (copy_from_user(&tmp, (void *)arg, sizeof(int))) - return -EFAULT; - - tty->termios->c_cflag = - ((tty->termios->c_cflag & ~CLOCAL) | - (tmp ? CLOCAL : 0)); - return 0; -#endif - case TIOCMGET: - return get_modem_info(info, (unsigned int *) arg); - case TIOCMBIS: - case TIOCMBIC: - case TIOCMSET: - return set_modem_info(info, cmd, (unsigned int *) arg); - case TIOCGSERIAL: - return get_serial_info(info, - (struct serial_struct *) arg); - case TIOCSSERIAL: - return set_serial_info(info, - (struct serial_struct *) arg); - case TIOCSERCONFIG: - return do_autoconfig(info); - - case TIOCSERGETLSR: /* Get line status register */ - return get_lsr_info(info, (unsigned int *) arg); - - case TIOCSERGSTRUCT: - if (copy_to_user((struct async_struct *) arg, - info, sizeof(struct async_struct))) - return -EFAULT; - return 0; - -#ifdef CONFIG_SERIAL_MULTIPORT - case TIOCSERGETMULTI: - return get_multiport_struct(info, - (struct serial_multiport_struct *) arg); - case TIOCSERSETMULTI: - return set_multiport_struct(info, - (struct serial_multiport_struct *) arg); -#endif - - /* - * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change - * - mask passed in arg for lines of interest - * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) - * Caller should use TIOCGICOUNT to see which one it was - */ - case TIOCMIWAIT: - save_flags(flags); cli(); - /* note the counters on entry */ - cprev = info->state->icount; - restore_flags(flags); - /* Force modem status interrupts on */ - info->IER |= UART_IER_MSI; - serial_out(info, UART_IER, info->IER); - while (1) { - interruptible_sleep_on(&info->delta_msr_wait); - /* see if a signal did it */ - if (signal_pending(current)) - return -ERESTARTSYS; - save_flags(flags); cli(); - cnow = info->state->icount; /* atomic copy */ - restore_flags(flags); - if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && - cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) - return -EIO; /* no change => error */ - if ( ((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) || - ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) || - ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) || - ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts)) ) { - return 0; - } - cprev = cnow; - } - /* NOTREACHED */ - - /* - * Get counter of input serial line interrupts (DCD,RI,DSR,CTS) - * Return: write counters to the user passed counter struct - * NB: both 1->0 and 0->1 transitions are counted except for - * RI where only 0->1 is counted. - */ - case TIOCGICOUNT: - save_flags(flags); cli(); - cnow = info->state->icount; - restore_flags(flags); - icount.cts = cnow.cts; - icount.dsr = cnow.dsr; - icount.rng = cnow.rng; - icount.dcd = cnow.dcd; - icount.rx = cnow.rx; - icount.tx = cnow.tx; - icount.frame = cnow.frame; - icount.overrun = cnow.overrun; - icount.parity = cnow.parity; - icount.brk = cnow.brk; - icount.buf_overrun = cnow.buf_overrun; - - if (copy_to_user((void *)arg, &icount, sizeof(icount))) - return -EFAULT; - return 0; - case TIOCSERGWILD: - case TIOCSERSWILD: - /* "setserial -W" is called in Debian boot */ - printk ("TIOCSER?WILD ioctl obsolete, ignored.\n"); - return 0; - - default: - return -ENOIOCTLCMD; - } - return 0; -} - -static void psio_set_termios(struct tty_struct *tty, struct termios *old_termios) -{ - struct async_struct *info = (struct async_struct *)tty->driver_data; - unsigned long flags; - unsigned int cflag = tty->termios->c_cflag; - - if ( (cflag == old_termios->c_cflag) - && ( RELEVANT_IFLAG(tty->termios->c_iflag) - == RELEVANT_IFLAG(old_termios->c_iflag))) - return; - - change_speed(info, old_termios); - - /* Handle transition to B0 status */ - if ((old_termios->c_cflag & CBAUD) && - !(cflag & CBAUD)) { - info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS); - save_flags(flags); cli(); - serial_out(info, UART_MCR, info->MCR); - restore_flags(flags); - } - - /* Handle transition away from B0 status */ - if (!(old_termios->c_cflag & CBAUD) && - (cflag & CBAUD)) { - info->MCR |= UART_MCR_DTR; - if (!(tty->termios->c_cflag & CRTSCTS) || - !test_bit(TTY_THROTTLED, &tty->flags)) { - info->MCR |= UART_MCR_RTS; - } - save_flags(flags); cli(); - serial_out(info, UART_MCR, info->MCR); - restore_flags(flags); - } - - /* Handle turning off CRTSCTS */ - if ((old_termios->c_cflag & CRTSCTS) && - !(tty->termios->c_cflag & CRTSCTS)) { - tty->hw_stopped = 0; - psio_start(tty); - } -} - -/* - * ----------------------------------------------------------- - * psio_close() - * - * This routine is called when the debug console port gets closed. - * First, we wait for the last remaining data to be sent. Then, we unlink - * its async structure from the interrupt chain if necessary, and we free - * that IRQ if nothing is left in the chain. - * ----------------------------------------------------------- - */ -static void psio_close(struct tty_struct *tty, struct file *filp) -{ - struct async_struct * info = (struct async_struct *)tty->driver_data; - struct serial_state *state; - unsigned long flags; - - if (!info || serial_paranoia_check(info, tty->device, "rs_close")) - return; - - state = info->state; - - save_flags(flags); cli(); - - if (tty_hung_up_p(filp)) { - DBG_CNT("before DEC-hung"); - MOD_DEC_USE_COUNT; - restore_flags(flags); - return; - } - -#ifdef SERIAL_DEBUG_OPEN - printk("psio_close ttyD%d, count = %d\n", info->line, state->count); -#endif - if ((tty->count == 1) && (state->count != 1)) { - /* - * Uh, oh. tty->count is 1, which means that the tty - * structure will be freed. state->count should always - * be one in these conditions. If it's greater than - * one, we've got real problems, since it means the - * serial port won't be shutdown. - */ - printk("rs_close: bad serial port count; tty->count is 1, " - "state->count is %d\n", state->count); - state->count = 1; - } - if (--state->count < 0) { - printk("psio_close: bad serial port count for ttyD%d: %d\n", - info->line, state->count); - state->count = 0; - } - if (state->count) { - DBG_CNT("before DEC-2"); - MOD_DEC_USE_COUNT; - restore_flags(flags); - return; - } - info->flags |= ASYNC_CLOSING; - restore_flags(flags); - /* - * Save the termios structure, since this port may have - * separate termios for callout and dialin. - */ - if (info->flags & ASYNC_NORMAL_ACTIVE) - info->state->normal_termios = *tty->termios; - if (info->flags & ASYNC_CALLOUT_ACTIVE) - info->state->callout_termios = *tty->termios; - /* - * Now we wait for the transmit buffer to clear; and we notify - * the line discipline to only process XON/XOFF characters. - */ - tty->closing = 1; - if (info->closing_wait != ASYNC_CLOSING_WAIT_NONE) - tty_wait_until_sent(tty, info->closing_wait); - /* - * At this point we stop accepting input. To do this, we - * disable the receive line status interrupts, and tell the - * interrupt driver to stop checking the data ready bit in the - * line status register. - */ - info->IER &= ~UART_IER_RLSI; - info->read_status_mask &= ~UART_LSR_DR; - if (info->flags & ASYNC_INITIALIZED) { - serial_out(info, UART_IER, info->IER); - /* - * Before we drop DTR, make sure the UART transmitter - * has completely drained; this is especially - * important if there is a transmit FIFO! - */ - psio_wait_until_sent(tty, info->timeout); - } - shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); - if (tty->ldisc.flush_buffer) - tty->ldisc.flush_buffer(tty); - tty->closing = 0; - info->event = 0; - info->tty = 0; - if (info->blocked_open) { - if (info->close_delay) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(info->close_delay); - } - wake_up_interruptible(&info->open_wait); - } - info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE| - ASYNC_CLOSING); - wake_up_interruptible(&info->close_wait); - MOD_DEC_USE_COUNT; -} - -/* - * rs_wait_until_sent() --- wait until the transmitter is empty - */ -static void psio_wait_until_sent(struct tty_struct *tty, int timeout) -{ - struct async_struct * info = (struct async_struct *)tty->driver_data; - unsigned long orig_jiffies, char_time; - int lsr; - - if (serial_paranoia_check(info, tty->device, "psio_wait_until_sent")) - return; - - if (info->state->type == PORT_UNKNOWN) - return; - - if (info->xmit_fifo_size == 0) - return; /* Just in case.... */ - - orig_jiffies = jiffies; - /* - * Set the check interval to be 1/5 of the estimated time to - * send a single character, and make it at least 1. The check - * interval should also be less than the timeout. - * - * Note: we have to use pretty tight timings here to satisfy - * the NIST-PCTS. - */ - char_time = (info->timeout - HZ/50) / info->xmit_fifo_size; - char_time = char_time / 5; - if (char_time == 0) - char_time = 1; - if (timeout && timeout < char_time) - char_time = timeout; - /* - * If the transmitter hasn't cleared in twice the approximate - * amount of time to send the entire FIFO, it probably won't - * ever clear. This assumes the UART isn't doing flow - * control, which is currently the case. Hence, if it ever - * takes longer than info->timeout, this is probably due to a - * UART bug of some kind. So, we clamp the timeout parameter at - * 2*info->timeout. - */ - if (!timeout || timeout > 2*info->timeout) - timeout = 2*info->timeout; -#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT - printk("In rs_wait_until_sent(%d) check=%lu...", timeout, char_time); - printk("jiff=%lu...", jiffies); -#endif - while (!((lsr = serial_inp(info, UART_LSR)) & UART_LSR_TEMT)) { -#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT - printk("lsr = %d (jiff=%lu)...", lsr, jiffies); -#endif - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(char_time); - if (signal_pending(current)) - break; - if (timeout && time_after(jiffies, orig_jiffies + timeout)) - break; - } -#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT - printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); -#endif -} - -/* - * psio_hangup() --- called by tty_hangup() when a hangup is signaled. - */ -static void psio_hangup(struct tty_struct *tty) -{ - struct async_struct * info = (struct async_struct *)tty->driver_data; - struct serial_state *state = info->state; - - if (serial_paranoia_check(info, tty->device, "psio_hangup")) - return; - - state = info->state; - - psio_flush_buffer(tty); - if (info->flags & ASYNC_CLOSING) - return; - shutdown(info); - info->event = 0; - state->count = 0; - info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE); - info->tty = 0; - wake_up_interruptible(&info->open_wait); -} - - - -/* -static void rs_wait_until_sent(struct tty_struct *tty, int timeout) -static void rs_hangup(struct tty_struct *tty) -*/ - -/* - * ------------------------------------------------------------ - * psio_open() and friends - * ------------------------------------------------------------ - */ -#define SERIAL_DEBUG_OPEN -static int block_til_ready(struct tty_struct *tty, struct file * filp, - struct async_struct *info) -{ - DECLARE_WAITQUEUE(wait, current); - struct serial_state *state = info->state; - int retval; - int do_clocal = 0, extra_count = 0; - unsigned long flags; - - /* - * If the device is in the middle of being closed, then block - * until it's done, and then try again. - */ - if (tty_hung_up_p(filp) || - (info->flags & ASYNC_CLOSING)) { - if (info->flags & ASYNC_CLOSING) - interruptible_sleep_on(&info->close_wait); -#ifdef SERIAL_DO_RESTART - return ((info->flags & ASYNC_HUP_NOTIFY) ? - -EAGAIN : -ERESTARTSYS); -#else - return -EAGAIN; -#endif - } - - /* - * If this is a callout device, then just make sure the normal - * device isn't being used. - */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { - if (info->flags & ASYNC_NORMAL_ACTIVE) - return -EBUSY; - if ((info->flags & ASYNC_CALLOUT_ACTIVE) && - (info->flags & ASYNC_SESSION_LOCKOUT) && - (info->session != current->session)) - return -EBUSY; - if ((info->flags & ASYNC_CALLOUT_ACTIVE) && - (info->flags & ASYNC_PGRP_LOCKOUT) && - (info->pgrp != current->pgrp)) - return -EBUSY; - info->flags |= ASYNC_CALLOUT_ACTIVE; - return 0; - } - -#if 1 /* ? 020906 */ -filp->f_flags |= O_NONBLOCK; -#endif /* ? 020906 */ - /* - * If non-blocking mode is set, or the port is not enabled, - * then make the check up front and then exit. - */ - if ((filp->f_flags & O_NONBLOCK) || - (tty->flags & (1 << TTY_IO_ERROR))) { - if (info->flags & ASYNC_CALLOUT_ACTIVE) - return -EBUSY; - info->flags |= ASYNC_NORMAL_ACTIVE; - return 0; - } - - if (info->flags & ASYNC_CALLOUT_ACTIVE) { - if (state->normal_termios.c_cflag & CLOCAL) - do_clocal = 1; - } else { - if (tty->termios->c_cflag & CLOCAL) - do_clocal = 1; - } - - /* - * Block waiting for the carrier detect and the line to become - * free (i.e., not in use by the callout). While we are in - * this loop, state->count is dropped by one, so that - * rs_close() knows when to free things. We restore it upon - * exit, either normal or abnormal. - */ - retval = 0; - add_wait_queue(&info->open_wait, &wait); -#ifdef SERIAL_DEBUG_OPEN - printk("block_til_ready before block: ttyD%d, count = %d\n", - state->line, state->count); -#endif - save_flags(flags); cli(); - if (!tty_hung_up_p(filp)) { - extra_count = 1; - state->count--; - } - restore_flags(flags); - info->blocked_open++; - while (1) { - save_flags(flags); cli(); - if (!(info->flags & ASYNC_CALLOUT_ACTIVE) && - (tty->termios->c_cflag & CBAUD)) - serial_out(info, UART_MCR, - serial_inp(info, UART_MCR) | - (UART_MCR_DTR | UART_MCR_RTS)); - restore_flags(flags); - set_current_state(TASK_INTERRUPTIBLE); - if (tty_hung_up_p(filp) || - !(info->flags & ASYNC_INITIALIZED)) { -#ifdef SERIAL_DO_RESTART - if (info->flags & ASYNC_HUP_NOTIFY) - retval = -EAGAIN; - else - retval = -ERESTARTSYS; -#else - retval = -EAGAIN; -#endif - break; - } - if (!(info->flags & ASYNC_CALLOUT_ACTIVE) && - !(info->flags & ASYNC_CLOSING) && - (do_clocal || (serial_in(info, UART_MSR) & - UART_MSR_DCD))) - break; - if (signal_pending(current)) { - retval = -ERESTARTSYS; - break; - } -#ifdef SERIAL_DEBUG_OPEN - printk("block_til_ready blocking: ttyD%d, count = %d\n", - info->line, state->count); -#endif - schedule(); - } - set_current_state(TASK_RUNNING); - remove_wait_queue(&info->open_wait, &wait); - if (extra_count) - state->count++; - info->blocked_open--; -#ifdef SERIAL_DEBUG_OPEN - printk("block_til_ready after blocking: ttyD%d, count = %d\n", - info->line, state->count); -#endif - if (retval) - return retval; - info->flags |= ASYNC_NORMAL_ACTIVE; - return 0; -} -#undef SERIAL_DEBUG_OPEN - - -static int get_async_struct(int line, struct async_struct **ret_info) -{ - struct async_struct *info; - struct serial_state *sstate; - - sstate = rs_table + line; - sstate->count++; - if (sstate->info) { - *ret_info = sstate->info; - return 0; - } - info = kmalloc(sizeof(struct async_struct), GFP_KERNEL); - if (!info) { - sstate->count--; - return -ENOMEM; - } - memset(info, 0, sizeof(struct async_struct)); - init_waitqueue_head(&info->open_wait); - init_waitqueue_head(&info->close_wait); - init_waitqueue_head(&info->delta_msr_wait); - info->magic = SERIAL_MAGIC; - info->port = sstate->port; - info->flags = sstate->flags; - info->io_type = sstate->io_type; - info->iomem_base = sstate->iomem_base; - info->iomem_reg_shift = sstate->iomem_reg_shift; - info->xmit_fifo_size = sstate->xmit_fifo_size=0; - info->line = line; - info->tqueue.routine = do_softint; - info->tqueue.data = info; - info->state = sstate; - - if (sstate->info) { - kfree(info); - - *ret_info = sstate->info; - return 0; - } - *ret_info = sstate->info = info; - return 0; -} - -/* - * ----------------------------------------------------------- - * psio_open() - * - * This routine is called whenever a debug console port is opened. It - * enables interrupts for a serial port, linking in its async structure into - * the IRQ chain. It also performs the serial-specific - * initialization for the tty structure. - * ----------------------------------------------------------- - */ -static int psio_open(struct tty_struct *tty, struct file *filp) -{ - struct async_struct *info; - int retval,line=0; - unsigned long page; - - MOD_INC_USE_COUNT; - line = MINOR(tty->device) - tty->driver.minor_start; - if ((line < 0) || (line >= NR_PORTS)) { - MOD_DEC_USE_COUNT; - return -ENODEV; - } - - retval = get_async_struct(line, &info); - if (retval) { - printk("psio_open ttyD%d fail...",line); - MOD_DEC_USE_COUNT; - return retval; - } - tty->driver_data = info; - info->tty = tty; - if (serial_paranoia_check(info, tty->device, "psio_open")) - return -ENODEV; - -#ifdef SERIAL_DEBUG_OPEN - printk("psio_open %s%d, count = %d\n", tty->driver.name, info->line, - info->state->count); -#endif - info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; - - /* - * This relies on lock_kernel() stuff so wants tidying for 2.5 - */ - if (!tmp_buf) { - page = get_zeroed_page(GFP_KERNEL); - if (!page) - return -ENOMEM; - if (tmp_buf) - free_page(page); - else - tmp_buf = (unsigned char *) page; - } - /* - * If the port is the middle of closing, bail out now - */ - if (tty_hung_up_p(filp) || - (info->flags & ASYNC_CLOSING)) { - if (info->flags & ASYNC_CLOSING) - interruptible_sleep_on(&info->close_wait); -#ifdef SERIAL_DO_RESTART - return ((info->flags & ASYNC_HUP_NOTIFY) ? - -EAGAIN : -ERESTARTSYS); -#else - return -EAGAIN; -#endif - } - - /* - * Start up serial port - */ - retval=startup(info); - if (retval) - return retval; - - retval = block_til_ready(tty, filp, info); - if (retval) { -#ifdef SERIAL_DEBUG_OPEN - printk("psio_open returning after block_til_ready with %d\n", - retval); -#endif - return retval; - } - - if ((info->state->count == 1) && - (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) - *tty->termios = info->state->normal_termios; - else - *tty->termios = info->state->callout_termios; - change_speed(info, 0); - } -#ifdef CONFIG_SERIAL_CONSOLE - if (cons.cflag && cons.index == line) { - tty->termios->c_cflag = cons.cflag; - cons.cflag = 0; - change_speed(info, 0); - } -#endif - info->session = current->session; - info->pgrp = current->pgrp; - - return 0; -} - -/* - * /proc fs routines.... - */ -static inline int line_info(char *buf, struct serial_state *state) -{ - struct async_struct *info = state->info, scr_info; - char stat_buf[30], control, status; - int ret; - unsigned long flags; - - ret = sprintf(buf, "%d: uart:%s port:%lX irq:%d", - state->line, uart_config[state->type].name, - state->port, state->irq); - - if (!state->port || (state->type == PORT_UNKNOWN)) { - ret += sprintf(buf+ret, "\n"); - return ret; - } - - /* - * Figure out the current RS-232 lines - */ - if (!info) { - info = &scr_info; /* This is just for serial_{in,out} */ - - info->magic = SERIAL_MAGIC; - info->port = state->port; - info->flags = state->flags; - info->hub6 = state->hub6; - info->io_type = state->io_type; - info->iomem_base = state->iomem_base; - info->iomem_reg_shift = state->iomem_reg_shift; - info->quot = 0; - info->tty = 0; - } - save_flags(flags); cli(); - status = serial_in(info, UART_MSR); - control = info != &scr_info ? info->MCR : serial_in(info, UART_MCR); - restore_flags(flags); - - stat_buf[0] = 0; - stat_buf[1] = 0; - if (control & UART_MCR_RTS) - strcat(stat_buf, "|RTS"); - if (status & UART_MSR_CTS) - strcat(stat_buf, "|CTS"); - if (control & UART_MCR_DTR) - strcat(stat_buf, "|DTR"); - if (status & UART_MSR_DSR) - strcat(stat_buf, "|DSR"); - if (status & UART_MSR_DCD) - strcat(stat_buf, "|CD"); - if (status & UART_MSR_RI) - strcat(stat_buf, "|RI"); - - if (info->quot) { - ret += sprintf(buf+ret, " baud:%d", - state->baud_base / (16*info->quot)); - } - - ret += sprintf(buf+ret, " tx:%d rx:%d", - state->icount.tx, state->icount.rx); - - if (state->icount.frame) - ret += sprintf(buf+ret, " fe:%d", state->icount.frame); - - if (state->icount.parity) - ret += sprintf(buf+ret, " pe:%d", state->icount.parity); - - if (state->icount.brk) - ret += sprintf(buf+ret, " brk:%d", state->icount.brk); - - if (state->icount.overrun) - ret += sprintf(buf+ret, " oe:%d", state->icount.overrun); - - /* - * Last thing is the RS-232 status lines - */ - ret += sprintf(buf+ret, " %s\n", stat_buf+1); - return ret; -} - - - -int psio_read_proc(char *page, char **start, off_t off, int count, - int *eof, void *data) -{ - int i, len = 0, l; - off_t begin = 0; - - len += sprintf(page, "sioinfo:1.0 driver:%s%s revision:%s\n", - serial_version, LOCAL_VERSTRING, serial_revdate); - for (i = 0; i < NR_PORTS && len < 4000; i++) { - l = line_info(page + len, &rs_table[i]); - len += l; - if (len+begin > off+count) - goto done; - if (len+begin < off) { - begin += len; - len = 0; - } - } - *eof = 1; -done: - if (off >= len+begin) - return 0; - *start = page + (off-begin); - return ((count < begin+len-off) ? count : begin+len-off); -} - -static char serial_options[] __initdata = - " no serial options enabled\n"; - - -static inline void show_serial_version(void) -{ - printk(KERN_INFO "%s version %s%s (%s) with%s", serial_name, - serial_version, LOCAL_VERSTRING, serial_revdate, - serial_options); -} -static unsigned detect_uart_irq (struct serial_state * state) -{ - if(! state->irq) - printk(KERN_INFO "detect_uart_irq: Ohh irq = 0\n"); - - return state->irq; -} - -static void autoconfig(struct serial_state * state) -{ - struct async_struct *info, scr_info; - //unsigned long flags; - - state->type = PORT_UNKNOWN; - -#ifdef SERIAL_DEBUG_AUTOCONF - printk("Testing ttyD%d (0x%04lx, 0x%04x)...\n", state->line, - state->port, (unsigned) state->iomem_base); -#endif - - if (!CONFIGURED_SERIAL_PORT(state)) - return; - - info = &scr_info; /* This is just for serial_{in,out} */ - - info->magic = SERIAL_MAGIC; - info->state = state; - info->port = state->port; - info->flags = state->flags; - sio_reset(info); -} - -/* - * The debug console driver boot-time initialization code! - */ -/* 20020830 */ -int __init psio_init(void) -{ - int i; - struct serial_state * state; - - init_bh(SERIAL_BH, do_psio_serial_bh); - init_timer(&serial_timer); - serial_timer.function = (void *)psio_timer; -#if 1 - mod_timer(&serial_timer, jiffies + 10); -#else /* 1 */ - mod_timer(&serial_timer, jiffies + RS_STROBE_TIME); -#endif /* 1 */ - - for (i = 0; i < NR_IRQS; i++) { - IRQ_ports[i] = 0; - IRQ_timeout[i] = 0; - } - - /* - * Initialize the tty_driver structure - */ - memset(&psio_driver, 0, sizeof(struct tty_driver)); - psio_driver.magic = TTY_DRIVER_MAGIC; -#if (LINUX_VERSION_CODE > 0x20100) - psio_driver.driver_name = "serial_m32102"; -#endif -#if 1 - psio_driver.name = "ttyD"; -#else -#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS)) - psio_driver.name = "ttyd/%d"; -#else - psio_driver.name = "ttyD"; -#endif -#endif /* 1 */ - - psio_driver.major = TTY_MAJOR; - psio_driver.minor_start = 80; - psio_driver.name_base = 0; - psio_driver.num = NR_PORTS; - psio_driver.type = TTY_DRIVER_TYPE_SERIAL; - - psio_driver.subtype = SERIAL_TYPE_NORMAL; - psio_driver.init_termios = tty_std_termios; - psio_driver.init_termios.c_cflag = - B9600 | CS8 | CREAD | HUPCL | CLOCAL; - psio_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; - psio_driver.refcount = &psio_refcount; - psio_driver.table = psio_table; - psio_driver.termios = psio_termios; - psio_driver.termios_locked = psio_termios_locked; - - psio_driver.open = psio_open; - psio_driver.close = psio_close; - psio_driver.write = psio_write; - psio_driver.put_char = psio_put_char; - psio_driver.flush_chars = psio_flush_chars; - psio_driver.write_room = psio_write_room; - psio_driver.chars_in_buffer = psio_chars_in_buffer; - psio_driver.flush_buffer = psio_flush_buffer; - psio_driver.ioctl = psio_ioctl; - psio_driver.throttle = psio_throttle; - psio_driver.unthrottle = psio_unthrottle; - psio_driver.set_termios = psio_set_termios; - psio_driver.stop = psio_stop; - psio_driver.start = psio_start; - psio_driver.hangup = psio_hangup; - -#if (LINUX_VERSION_CODE >= 131394) /* Linux 2.1.66 */ - psio_driver.break_ctl = psio_break; -#endif -#if (LINUX_VERSION_CODE >= 131343) - psio_driver.send_xchar = psio_send_xchar; - psio_driver.wait_until_sent = psio_wait_until_sent; - psio_driver.read_proc = psio_read_proc; -#endif - - if (tty_register_driver(&psio_driver)) - panic("Couldn't register debug console driver\n"); - - for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { - state->magic = SSTATE_MAGIC; - state->line = i; - state->type = 14; - state->custom_divisor = 0; - state->close_delay = 5*HZ/10; - state->closing_wait = 30*HZ; - state->callout_termios = psio_driver.init_termios; - state->normal_termios = psio_driver.init_termios; - state->icount.cts = state->icount.dsr = - state->icount.rng = state->icount.dcd = 0; - state->icount.rx = state->icount.tx = 0; - state->icount.frame = state->icount.parity = 0; - state->icount.overrun = state->icount.brk = 0; - state->irq = irq_cannonicalize(state->irq); - -#if 0 - if (check_region(state->port,8)) - continue; - if (state->flags & ASYNC_BOOT_AUTOCONF) - autoconfig(psio_table); -#endif - state->baud_base = boot_cpu_data.bus_clock; - printk(KERN_INFO "ttyD%d initialized.\n",i); - tty_register_devfs(&psio_driver, 0, - psio_driver.minor_start + state->line); - } - - return 0; -} - -/* 20020830 */ -static void __exit psio_fini(void) -{ - unsigned long flags; - // int e1, e2; - int e1; - // int i; - // struct async_struct *info; - - /* printk("Unloading %s: version %s\n", serial_name, serial_version); */ - del_timer_sync(&serial_timer); - save_flags(flags); cli(); - remove_bh(SERIAL_BH); - if ((e1 = tty_unregister_driver(&psio_driver))) - printk("psio_serial: failed to unregister serial driver (%d)\n",e1); - restore_flags(flags); - - if (tmp_buf) { - unsigned long pg = (unsigned long) tmp_buf; - tmp_buf = NULL; - free_page(pg); - } -} - -module_init(psio_init); -module_exit(psio_fini); -MODULE_DESCRIPTION("M32R/M32102 (dumb) serial driver"); -MODULE_AUTHOR("Hiroyuki Kondo , Takeo Takahashi "); -MODULE_LICENSE("GPL"); - - -/* - * ----------------------------------------------------------- - * Debug console driver - * ----------------------------------------------------------- - */ - -#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) - -static struct async_struct async_dbgcons; - -/* - * Wait for transmitter & holding register to empty - */ -static inline void wait_for_xmitr(struct async_struct *info) -{ - unsigned int status, tmout = 1000000; - - do { - status = serial_in(info, UART_LSR); - - if (status & UART_LSR_BI) - lsr_break_flag = UART_LSR_BI; - - if (--tmout == 0) - break; - } while((status & BOTH_EMPTY) != BOTH_EMPTY); - - /* Wait for flow control if necessary */ - if (info->flags & ASYNC_CONS_FLOW) { - tmout = 1000000; - while (--tmout && - ((serial_in(info, UART_MSR) & UART_MSR_CTS) == 0)); - } -} -static void dbg_console_write(struct console *co, const char *s, - unsigned count) -{ - static struct async_struct *info = &async_dbgcons; - int ier; - unsigned i; - - /* - * First save the IER then disable the interrupts - */ - ier = serial_in(info, UART_IER); - serial_out(info, UART_IER, 0x00); - - /* - * Now, do each character - */ - for (i = 0; i < count; i++, s++) { - wait_for_xmitr(info); - - /* - * Send the character out. - * If a LF, also do CR... - */ - serial_out(info, UART_TX, *s); - if (*s == 10) { - wait_for_xmitr(info); - serial_out(info, UART_TX, 13); - } - } - - /* - * Finally, Wait for transmitter & holding register to empty - * and restore the IER - */ - wait_for_xmitr(info); - serial_out(info, UART_IER, ier); -} - -#if (LINUX_VERSION_CODE <= 132114) /* Linux 2.4.18 */ -/* - * Receive character from the serial port - */ -static int dbg_console_wait_key(struct console *console) -{ - static struct async_struct *info; - int ier, c; - - info = &async_dbgcons; - - /* - * First save the IER then disable the interrupts so - * that the real driver for the port does not get the - * character. - */ - ier = serial_in(info, UART_IER); - serial_out(info, UART_IER, 0x00); - - while ((serial_in(info, UART_LSR) & UART_LSR_DR) == 0); - c = serial_in(info, UART_RX); - - /* - * Restore the interrupts - */ - serial_out(info, UART_IER, ier); - - return c; -} -#endif - -static kdev_t dbg_console_device(struct console *c) -{ - return MKDEV(TTY_MAJOR, 80 + c->index); -} - - -static int __init dbg_console_setup(struct console *co, char *options) -{ - static struct async_struct *info; - struct serial_state *state; - int baud = BAUDRATE; - int baud_base= boot_cpu_data.bus_clock; - int bits = 8; - int parity = 'n'; - int doflow = 0; - unsigned int cflag = CREAD | HUPCL | CLOCAL | CRTSCTS; - int cval; - char *s; - - if (options) { - baud = simple_strtoul(options, NULL, 10); - s = options; - while(*s >= '0' && *s <= '9') - s++; - if (*s) parity = *s++; - if (*s) bits = *s++ - '0'; - if (*s) doflow = (*s++ == 'r'); - } - - co->flags |= CON_ENABLED; - - /* - * Now construct a cflag setting. - */ - switch(baud) { - case 1200: - cflag |= B1200; - break; - case 2400: - cflag |= B2400; - break; - case 4800: - cflag |= B4800; - break; - case 19200: - cflag |= B19200; - break; - case 38400: - cflag |= B38400; - break; - case 57600: - cflag |= B57600; - break; - case 115200: - cflag |= B115200; - break; - case 9600: - default: - cflag |= B9600; - baud = 9600; - break; - } - switch(bits) { - case 7: - cflag |= CS7; - break; - default: - case 8: - cflag |= CS8; - break; - } - switch(parity) { - case 'o': case 'O': - cflag |= PARODD; - break; - case 'e': case 'E': - cflag |= PARENB; - break; - } - co->cflag = cflag; - - state = rs_table + co->index; - if (doflow) - state->flags |= ASYNC_CONS_FLOW; - info = &async_dbgcons; - info->magic = SERIAL_MAGIC; - info->state = state; - info->port = state->port; - info->flags = state->flags; - info->io_type = state->io_type; - info->iomem_base = state->iomem_base; - info->iomem_reg_shift = state->iomem_reg_shift; - - cval = (baud_base / (baud * 4)) - 1; - - serial_outp(info, UART_LCR, 0x0300); /* init status */ - //serial_outp(info, UART_MOD1, 0x0800); /* 8bit */ - serial_outp(info, UART_MOD0, 0x80); /* cts/rts 1stop nonpari */ - //serial_outp(info, UART_MOD0, 0x180); /* rts 1stop nonpari */ - //serial_outp(info, UART_MOD0, 0xc0); /* cts/rts 1stop nonpari */ - - serial_outp(info, UART_BAUR, cval); /* set baurate reg */ - //serial_outp(info, UART_RBAUR, adj); /* set adj baurate reg */ - serial_outp(info, UART_IER, 0x00); /* intr mask */ - serial_outp(info, UART_LCR, 0x03); - - return 0; -} - -static struct console cons = { - name: "ttyD", - write: dbg_console_write, - device: dbg_console_device, -#if (LINUX_VERSION_CODE <= 132114) /* Linux 2.4.18 */ - wait_key: dbg_console_wait_key, -#endif - setup: dbg_console_setup, - flags: CON_PRINTBUFFER, - index: -1, -}; - - -/* - * Register console. - */ -void __init psio_console_init(void) -{ - register_console(&cons); -} - - diff -Nru a/arch/m32r/drivers/m32r_cfc.c b/arch/m32r/drivers/m32r_cfc.c --- a/arch/m32r/drivers/m32r_cfc.c 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,910 +0,0 @@ -/* - * linux/arch/m32r/drivers/m32r_cfc.c - * - * Device driver for the CFC functionality of M32R. - * - * Copyright (c) 2001, 2002, 2003, 2004 - * Hiroyuki Kondo, Naoto Sugai, Hayato Fujiwara - */ - -#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 - -#undef MAX_IO_WIN /* FIXME */ -#define MAX_IO_WIN 1 -#undef MAX_WIN /* FIXME */ -#define MAX_WIN 1 - -#include "m32r_cfc.h" - -#if !defined(COFIG_PLAT_USRV) -#define PCMCIA_DEBUG 3 -#endif /* COFIG_PLAT_USRV */ - -#ifdef PCMCIA_DEBUG -int m32r_cfc_debug = PCMCIA_DEBUG; -module_param(m32r_cfc_debug, int, 0444); -#define DEBUG(n, args...) if (m32r_cfc_debug>(n)) printk(args) -#else -#define DEBUG(n, args...) do { } while (0) -#endif - -/* Poll status interval -- 0 means default to interrupt */ -static int poll_interval = 0; - -typedef enum pcc_space { as_none = 0, as_comm, as_attr, as_io } pcc_as_t; - -typedef struct pcc_socket { - u_short type, flags; - struct pcmcia_socket socket; - unsigned int number; - ioaddr_t ioaddr; - u_long mapaddr; - u_long base; /* PCC register base */ - u_char cs_irq1, cs_irq2, intr; - pccard_io_map io_map[MAX_IO_WIN]; - pccard_mem_map mem_map[MAX_WIN]; - u_char io_win; - u_char mem_win; - pcc_as_t current_space; - u_char last_iodbex; -#ifdef CHAOS_PCC_DEBUG - u_char last_iosize; -#endif -#ifdef CONFIG_PROC_FS - struct proc_dir_entry *proc; -#endif -} pcc_socket_t; - -static int pcc_sockets = 0; -static pcc_socket_t socket[M32R_MAX_PCC] = { - { 0, }, /* ... */ -}; - -#define ISA_LOCK(n, f) do { } while (0) -#define ISA_UNLOCK(n, f) do { } while (0) - -/*====================================================================*/ - -static unsigned int pcc_get(u_short, unsigned int); -static void pcc_set(u_short, unsigned int , unsigned int ); - -static spinlock_t pcc_lock = SPIN_LOCK_UNLOCKED; - -#if !defined(CONFIG_PLAT_USRV) -static __inline__ u_long pcc_port2addr(unsigned long port, int size) { - u_long addr = 0; - u_long odd; - - if (size == 1) { /* byte access */ - odd = (port&1) << 11; - port -= port & 1; - addr = CFC_IO_MAPBASE_BYTE - CFC_IOPORT_BASE + odd + port; - } else if (size == 2) - addr = CFC_IO_MAPBASE_WORD - CFC_IOPORT_BASE + port; - - return addr; -} -#else /* CONFIG_PLAT_USRV */ -static __inline__ u_long pcc_port2addr(unsigned long port, int size) { - u_long odd; - u_long addr = ((port - CFC_IOPORT_BASE) & 0xf000) << 8; - - if (size == 1) { /* byte access */ - odd = port & 1; - port -= odd; - odd <<= 11; - addr = (addr | CFC_IO_MAPBASE_BYTE) + odd + (port & 0xfff); - } else if (size == 2) /* word access */ - addr = (addr | CFC_IO_MAPBASE_WORD) + (port & 0xfff); - - return addr; -} -#endif /* CONFIG_PLAT_USRV */ - -void pcc_ioread_byte(int sock, unsigned long port, void *buf, size_t size, - size_t nmemb, int flag) -{ - u_long addr; - unsigned char *bp = (unsigned char *)buf; - unsigned long flags; - - DEBUG(3, "m32r_cfc: pcc_ioread_byte: sock=%d, port=%#lx, buf=%p, " - "size=%u, nmemb=%d, flag=%d\n", - sock, port, buf, size, nmemb, flag); - - addr = pcc_port2addr(port, 1); - if (!addr) { - printk("m32r_cfc:ioread_byte null port :%#lx\n",port); - return; - } - DEBUG(3, "m32r_cfc: pcc_ioread_byte: addr=%#lx\n", addr); - - spin_lock_irqsave(&pcc_lock, flags); - /* read Byte */ - while (nmemb--) - *bp++ = readb(addr); - spin_unlock_irqrestore(&pcc_lock, flags); -} - -void pcc_ioread_word(int sock, unsigned long port, void *buf, size_t size, - size_t nmemb, int flag) -{ - u_long addr; - unsigned short *bp = (unsigned short *)buf; - unsigned long flags; - - DEBUG(3, "m32r_cfc: pcc_ioread_word: sock=%d, port=%#lx, " - "buf=%p, size=%u, nmemb=%d, flag=%d\n", - sock, port, buf, size, nmemb, flag); - - if (size != 2) - printk("m32r_cfc: ioread_word :illigal size %u : %#lx\n", size, - port); - if (size == 9) - printk("m32r_cfc: ioread_word :insw \n"); - - addr = pcc_port2addr(port, 2); - if (!addr) { - printk("m32r_cfc:ioread_word null port :%#lx\n",port); - return; - } - DEBUG(3, "m32r_cfc: pcc_ioread_word: addr=%#lx\n", addr); - - spin_lock_irqsave(&pcc_lock, flags); - /* read Word */ - while (nmemb--) - *bp++ = readw(addr); - spin_unlock_irqrestore(&pcc_lock, flags); -} - -void pcc_iowrite_byte(int sock, unsigned long port, void *buf, size_t size, - size_t nmemb, int flag) -{ - u_long addr; - unsigned char *bp = (unsigned char *)buf; - unsigned long flags; - - DEBUG(3, "m32r_cfc: pcc_iowrite_byte: sock=%d, port=%#lx, " - "buf=%p, size=%u, nmemb=%d, flag=%d\n", - sock, port, buf, size, nmemb, flag); - - /* write Byte */ - addr = pcc_port2addr(port, 1); - if (!addr) { - printk("m32r_cfc:iowrite_byte null port:%#lx\n",port); - return; - } - DEBUG(3, "m32r_cfc: pcc_iowrite_byte: addr=%#lx\n", addr); - - spin_lock_irqsave(&pcc_lock, flags); - while (nmemb--) - writeb(*bp++, addr); - spin_unlock_irqrestore(&pcc_lock, flags); -} - -void pcc_iowrite_word(int sock, unsigned long port, void *buf, size_t size, - size_t nmemb, int flag) -{ - u_long addr; - unsigned short *bp = (unsigned short *)buf; - unsigned long flags; - - DEBUG(3, "m32r_cfc: pcc_iowrite_word: sock=%d, port=%#lx, " - "buf=%p, size=%u, nmemb=%d, flag=%d\n", - sock, port, buf, size, nmemb, flag); - - if(size != 2) - printk("m32r_cfc: iowrite_word :illigal size %u : %#lx\n", - size, port); - if(size == 9) - printk("m32r_cfc: iowrite_word :outsw \n"); - - addr = pcc_port2addr(port, 2); - if (!addr) { - printk("m32r_cfc:iowrite_word null addr :%#lx\n",port); - return; - } -#if 1 - if (addr & 1) { - printk("m32r_cfc:iowrite_word port addr (%#lx):%#lx\n", port, - addr); - return; - } -#endif - DEBUG(3, "m32r_cfc: pcc_iowrite_word: addr=%#lx\n", addr); - - spin_lock_irqsave(&pcc_lock, flags); - while (nmemb--) - writew(*bp++, addr); - spin_unlock_irqrestore(&pcc_lock, flags); -} - -/*====================================================================*/ - -#define IS_ALIVE 0x8000 - -typedef struct pcc_t { - char *name; - u_short flags; -} pcc_t; - -static pcc_t pcc[] = { -#if !defined(CONFIG_PLAT_USRV) - { "m32r_cfc", 0 }, { "", 0 }, -#else /* CONFIG_PLAT_USRV */ - { "m32r_cfc", 0 }, { "m32r_cfc", 0 }, { "m32r_cfc", 0 }, - { "m32r_cfc", 0 }, { "m32r_cfc", 0 }, { "", 0 }, -#endif /* CONFIG_PLAT_USRV */ -}; - -static irqreturn_t pcc_interrupt(int, void *, struct pt_regs *regs); - -/*====================================================================*/ - -static struct timer_list poll_timer; - -static unsigned int pcc_get(u_short sock, unsigned int reg) -{ - unsigned int val = inw(reg); - DEBUG(3, "m32r_cfc: pcc_get: reg(0x%08x)=0x%04x\n", reg, val); - return val; -} - - -static void pcc_set(u_short sock, unsigned int reg, unsigned int data) -{ - outw(data, reg); - DEBUG(3, "m32r_cfc: pcc_set: reg(0x%08x)=0x%04x\n", reg, data); -} - -/*====================================================================== - - See if a card is present, powered up, in IO mode, and already - bound to a (non PC Card) Linux driver. We leave these alone. - - We make an exception for cards that seem to be serial devices. - -======================================================================*/ - -static int __init is_alive(u_short sock) -{ - unsigned int stat; - - DEBUG(3, "m32r_cfc: is_alive:\n"); - - printk("CF: "); - stat = pcc_get(sock, (unsigned int)PLD_CFSTS); - if (!stat) - printk("No "); - printk("Card is detected at socket %d : stat = 0x%08x\n", sock, stat); - DEBUG(3, "m32r_cfc: is_alive: sock stat is 0x%04x\n", stat); - - return 0; -} - -static void add_pcc_socket(ulong base, int irq, ulong mapaddr, ioaddr_t ioaddr) -{ - pcc_socket_t *t = &socket[pcc_sockets]; - - DEBUG(3, "m32r_cfc: add_pcc_socket: base=%#lx, irq=%d, " - "mapaddr=%#lx, ioaddr=%08x\n", - base, irq, mapaddr, ioaddr); - - /* add sockets */ - t->ioaddr = ioaddr; - t->mapaddr = mapaddr; -#if !defined(CONFIG_PLAT_USRV) - t->base = 0; - t->flags = 0; - t->cs_irq1 = irq; // insert irq - t->cs_irq2 = irq + 1; // eject irq -#else /* CONFIG_PLAT_USRV */ - t->base = base; - t->flags = 0; - t->cs_irq1 = 0; // insert irq - t->cs_irq2 = 0; // eject irq -#endif /* CONFIG_PLAT_USRV */ - - if (is_alive(pcc_sockets)) - t->flags |= IS_ALIVE; - - /* add pcc */ -#if !defined(CONFIG_PLAT_USRV) - request_region((unsigned int)PLD_CFRSTCR, 0x20, "m32r_cfc"); -#else /* CONFIG_PLAT_USRV */ - { - unsigned int reg_base; - - reg_base = (unsigned int)PLD_CFRSTCR; - reg_base |= pcc_sockets << 8; - request_region(reg_base, 0x20, "m32r_cfc"); - } -#endif /* CONFIG_PLAT_USRV */ - printk(KERN_INFO " %s ", pcc[pcc_sockets].name); - printk("pcc at 0x%08lx\n", t->base); - - /* Update socket interrupt information, capabilities */ - t->socket.features |= (SS_CAP_PCCARD | SS_CAP_STATIC_MAP); - t->socket.map_size = M32R_PCC_MAPSIZE; - t->socket.io_offset = ioaddr; /* use for io access offset */ - t->socket.irq_mask = 0; -#if !defined(CONFIG_PLAT_USRV) - t->socket.pci_irq = PLD_IRQ_CFIREQ ; /* card interrupt */ -#else /* CONFIG_PLAT_USRV */ - t->socket.pci_irq = PLD_IRQ_CF0 + pcc_sockets; -#endif /* CONFIG_PLAT_USRV */ - -#ifndef CONFIG_PLAT_USRV - /* insert interrupt */ - request_irq(irq, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt); - /* eject interrupt */ - request_irq(irq+1, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt); - - DEBUG(3, "m32r_cfc: enable CFMSK, RDYSEL\n"); - pcc_set(pcc_sockets, (unsigned int)PLD_CFIMASK, 0x01); -#endif /* CONFIG_PLAT_USRV */ -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) - pcc_set(pcc_sockets, (unsigned int)PLD_CFCR1, 0x0200); -#endif - pcc_sockets++; - - return; -} - - -/*====================================================================*/ - -static irqreturn_t pcc_interrupt(int irq, void *dev, struct pt_regs *regs) -{ - int i; - u_int events = 0; - int handled = 0; - - DEBUG(3, "m32r_cfc: pcc_interrupt: irq=%d, dev=%p, regs=%p\n", - irq, dev, regs); - for (i = 0; i < pcc_sockets; i++) { - if (socket[i].cs_irq1 != irq && socket[i].cs_irq2 != irq) - continue; - - handled = 1; - DEBUG(3, "m32r_cfc: pcc_interrupt: socket %d irq 0x%02x ", - i, irq); - events |= SS_DETECT; /* insert or eject */ - if (events) - pcmcia_parse_events(&socket[i].socket, events); - } - DEBUG(3, "m32r_cfc: pcc_interrupt: done\n"); - - return IRQ_RETVAL(handled); -} /* pcc_interrupt */ - -static void pcc_interrupt_wrapper(u_long data) -{ - DEBUG(3, "m32r_cfc: pcc_interrupt_wrapper:\n"); - pcc_interrupt(0, NULL, NULL); - init_timer(&poll_timer); - poll_timer.expires = jiffies + poll_interval; - add_timer(&poll_timer); -} - -/*====================================================================*/ - -static int _pcc_get_status(u_short sock, u_int *value) -{ - u_int status; - - DEBUG(3, "m32r_cfc: _pcc_get_status:\n"); - status = pcc_get(sock, (unsigned int)PLD_CFSTS); - *value = (status) ? SS_DETECT : 0; - DEBUG(3, "m32r_cfc: _pcc_get_status: status=0x%08x\n", status); - -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) - if ( status ) { - /* enable CF power */ - status = inw((unsigned int)PLD_CPCR); - if (!(status & PLD_CPCR_CF)) { - DEBUG(3, "m32r_cfc: _pcc_get_status: " - "power on (CPCR=0x%08x)\n", status); - status |= PLD_CPCR_CF; - outw(status, (unsigned int)PLD_CPCR); - udelay(100); - } - *value |= SS_POWERON; - - pcc_set(sock, (unsigned int)PLD_CFBUFCR,0);/* enable buffer */ - udelay(100); - - *value |= SS_READY; /* always ready */ - *value |= SS_3VCARD; - } else { - /* disable CF power */ - status = inw((unsigned int)PLD_CPCR); - status &= ~PLD_CPCR_CF; - outw(status, (unsigned int)PLD_CPCR); - udelay(100); - DEBUG(3, "m32r_cfc: _pcc_get_status: " - "power off (CPCR=0x%08x)\n", status); - } -#elif defined(CONFIG_PLAT_MAPPI2) - if ( status ) { - status = pcc_get(sock, (unsigned int)PLD_CPCR); - if (status == 0) { /* power off */ - pcc_set(sock, (unsigned int)PLD_CPCR, 1); - pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); /* force buffer off for ZA-36 */ - udelay(50); - } - status = pcc_get(sock, (unsigned int)PLD_CFBUFCR); - if (status != 0) { /* buffer off */ - pcc_set(sock, (unsigned int)PLD_CFBUFCR,0); - udelay(50); - pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0101); - udelay(25); /* for IDE reset */ - pcc_set(sock, (unsigned int)PLD_CFRSTCR, 0x0100); - mdelay(2); /* for IDE reset */ - } else { - *value |= SS_POWERON; - *value |= SS_READY; - } - } -#else -#error no platform configuration -#endif - DEBUG(3, "m32r_cfc: _pcc_get_status: GetStatus(%d) = %#4.4x\n", - sock, *value); - return 0; -} /* _get_status */ - -/*====================================================================*/ - -static int _pcc_get_socket(u_short sock, socket_state_t *state) -{ -// pcc_socket_t *t = &socket[sock]; - -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) - state->flags = 0; - state->csc_mask = SS_DETECT; /* ??? */ - state->csc_mask |= SS_READY; /* ??? */ - state->io_irq = 0; - state->Vcc = 33; /* 3.3V fixed */ - state->Vpp = 33; -#endif - DEBUG(3, "m32r_cfc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, " - "io_irq %d, csc_mask %#2.2x\n", sock, state->flags, - state->Vcc, state->Vpp, state->io_irq, state->csc_mask); - return 0; -} /* _get_socket */ - -/*====================================================================*/ - -static int _pcc_set_socket(u_short sock, socket_state_t *state) -{ -#if defined(CONFIG_PLAT_MAPPI2) - u_long reg = 0; -#endif - DEBUG(3, "m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " - "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, - state->Vcc, state->Vpp, state->io_irq, state->csc_mask); - -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) - if (state->Vcc) { - if ((state->Vcc != 50) && (state->Vcc != 33)) - return -EINVAL; - /* accept 5V and 3.3V */ - } -#elif defined(CONFIG_PLAT_MAPPI2) - if (state->Vcc) { - /* - * 5V only - */ - if (state->Vcc == 50) { - reg |= PCCSIGCR_VEN; - } else { - return -EINVAL; - } - } -#endif - - if (state->flags & SS_RESET) { - DEBUG(3, ":RESET\n"); - pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x101); - }else{ - pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x100); - } - if (state->flags & SS_OUTPUT_ENA){ - DEBUG(3, ":OUTPUT_ENA\n"); - /* bit clear */ - pcc_set(sock,(unsigned int)PLD_CFBUFCR,0); - } else { - pcc_set(sock,(unsigned int)PLD_CFBUFCR,1); - } - -#ifdef PCMCIA_DEBUG - if(state->flags & SS_IOCARD){ - DEBUG(3, ":IOCARD"); - } - if (state->flags & SS_PWR_AUTO) { - DEBUG(3, ":PWR_AUTO"); - } - if (state->csc_mask & SS_DETECT) - DEBUG(3, ":csc-SS_DETECT"); - if (state->flags & SS_IOCARD) { - if (state->csc_mask & SS_STSCHG) - DEBUG(3, ":STSCHG"); - } else { - if (state->csc_mask & SS_BATDEAD) - DEBUG(3, ":BATDEAD"); - if (state->csc_mask & SS_BATWARN) - DEBUG(3, ":BATWARN"); - if (state->csc_mask & SS_READY) - DEBUG(3, ":READY"); - } - DEBUG(3, "\n"); -#endif - return 0; -} /* _set_socket */ - -/*====================================================================*/ - -static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io) -{ - u_char map; - - DEBUG(3, "m32r_cfc: SetIOMap(%d, %d, %#2.2x, %d ns, " - "%#4.4x-%#4.4x)\n", sock, io->map, io->flags, - io->speed, io->start, io->stop); - map = io->map; - - return 0; -} /* _set_io_map */ - -/*====================================================================*/ - -static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem) -{ - - u_char map = mem->map; - u_long mode; - u_long addr; - pcc_socket_t *t = &socket[sock]; - - DEBUG(3, "m32r_cfc: SetMemMap(%d, %d, %#2.2x, %d ns, " - "%#5.5lx-%#5.5lx, %#5.5x)\n", sock, map, mem->flags, - mem->speed, mem->res->start, mem->res->end, mem->card_start); - - /* - * sanity check - */ - if ((map > MAX_WIN) || (mem->card_start > 0x3ffffff) || - (mem->res->start > mem->res->end)) { - return -EINVAL; - } - - /* - * de-activate - */ - if ((mem->flags & MAP_ACTIVE) == 0) { - t->current_space = as_none; - return 0; - } - - /* - * Disable first - */ -// pcc_set(sock, PCCR, 0); - - /* - * Set mode - */ - if (mem->flags & MAP_ATTRIB) { - mode = PCMOD_AS_ATTRIB | PCMOD_CBSZ; - t->current_space = as_attr; - } else { - mode = 0; /* common memory */ - t->current_space = as_comm; - } -// pcc_set(sock, PCMOD, mode); - - /* - * Set address - */ - addr = t->mapaddr + (mem->card_start & M32R_PCC_MAPMASK); -// pcc_set(sock, PCADR, addr); - - mem->res->start = addr + mem->card_start; - mem->res->end = mem->res->start + (M32R_PCC_MAPSIZE - 1); - - /* - * Set timing - */ -// pcc_set(sock, PCATCR, pcc_access_timing); - - /* - * Enable again - */ -// pcc_set(sock, PCCR, 1); - - return 0; - -} /* _set_mem_map */ - -#if 0 /* driver model ordering issue */ -/*====================================================================== - - Routines for accessing socket information and register dumps via - /proc/bus/pccard/... - -======================================================================*/ - -static ssize_t show_info(struct class_device *class_dev, char *buf) -{ - pcc_socket_t *s = container_of(class_dev, struct pcc_socket, - socket.dev); - - return sprintf(buf, "type: %s\nbase addr: 0x%08lx\n", - pcc[s->type].name, s->base); -} - -static ssize_t show_exca(struct class_device *class_dev, char *buf) -{ - /* FIXME */ - - return 0; -} - -static CLASS_DEVICE_ATTR(info, S_IRUGO, show_info, NULL); -static CLASS_DEVICE_ATTR(exca, S_IRUGO, show_exca, NULL); -#endif - -/*====================================================================*/ - -/* this is horribly ugly... proper locking needs to be done here at - * some time... */ -#define LOCKED(x) do { \ - int retval; \ - unsigned long flags; \ - spin_lock_irqsave(&pcc_lock, flags); \ - retval = x; \ - spin_unlock_irqrestore(&pcc_lock, flags); \ - return retval; \ -} while (0) - - -static int pcc_get_status(struct pcmcia_socket *s, u_int *value) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) { - DEBUG(3, "m32r_cfc: pcc_get_status: sock(%d) -EINVAL\n", sock); - *value = 0; - return -EINVAL; - } - DEBUG(3, "m32r_cfc: pcc_get_status: sock(%d)\n", sock); - LOCKED(_pcc_get_status(sock, value)); -} - -static int pcc_get_socket(struct pcmcia_socket *s, socket_state_t *state) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) { - DEBUG(3, "m32r_cfc: pcc_get_socket: sock(%d) -EINVAL\n", sock); - return -EINVAL; - } - DEBUG(3, "m32r_cfc: pcc_get_socket: sock(%d)\n", sock); - LOCKED(_pcc_get_socket(sock, state)); -} - -static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) { - DEBUG(3, "m32r_cfc: pcc_set_socket: sock(%d) -EINVAL\n", sock); - return -EINVAL; - } - DEBUG(3, "m32r_cfc: pcc_set_socket: sock(%d)\n", sock); - LOCKED(_pcc_set_socket(sock, state)); -} - -static int pcc_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) { - DEBUG(3, "m32r_cfc: pcc_set_io_map: sock(%d) -EINVAL\n", sock); - return -EINVAL; - } - DEBUG(3, "m32r_cfc: pcc_set_io_map: sock(%d)\n", sock); - LOCKED(_pcc_set_io_map(sock, io)); -} - -static int pcc_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) { - DEBUG(3, "m32r_cfc: pcc_set_mem_map: sock(%d) -EINVAL\n", sock); - return -EINVAL; - } - DEBUG(3, "m32r_cfc: pcc_set_mem_map: sock(%d)\n", sock); - LOCKED(_pcc_set_mem_map(sock, mem)); -} - -static int pcc_init(struct pcmcia_socket *s) -{ - DEBUG(3, "m32r_cfc: pcc_init()\n"); - return 0; -} - -static int pcc_suspend(struct pcmcia_socket *sock) -{ - DEBUG(3, "m32r_cfc: pcc_suspend()\n"); - return pcc_set_socket(sock, &dead_socket); -} - -static struct pccard_operations pcc_operations = { - .init = pcc_init, - .suspend = pcc_suspend, - .get_status = pcc_get_status, - .get_socket = pcc_get_socket, - .set_socket = pcc_set_socket, - .set_io_map = pcc_set_io_map, - .set_mem_map = pcc_set_mem_map, -}; - -/*====================================================================*/ - -static int m32rpcc_suspend(struct device *dev, u32 state, u32 level) -{ - int ret = 0; - if (level == SUSPEND_SAVE_STATE) - ret = pcmcia_socket_dev_suspend(dev, state); - return ret; -} - -static int m32rpcc_resume(struct device *dev, u32 level) -{ - int ret = 0; - if (level == RESUME_RESTORE_STATE) - ret = pcmcia_socket_dev_resume(dev); - return ret; -} - - -static struct device_driver pcc_driver = { - .name = "cfc", - .bus = &platform_bus_type, - .suspend = m32rpcc_suspend, - .resume = m32rpcc_resume, -}; - -static struct platform_device pcc_device = { - .name = "cfc", - .id = 0, -}; - -/*====================================================================*/ - -#define UT_CFC -static int __init init_m32r_pcc(void) -{ - int i, ret; - - ret = driver_register(&pcc_driver); - if (ret) - return ret; - - ret = platform_device_register(&pcc_device); - if (ret){ - driver_unregister(&pcc_driver); - return ret; - } - -#if defined(CONFIG_PLAT_MAPPI2) - pcc_set(0, (unsigned int)PLD_CFCR0, 0x0f0f); - pcc_set(0, (unsigned int)PLD_CFCR1, 0x0200); -#endif - - pcc_sockets = 0; - -#if !defined(CONFIG_PLAT_USRV) - add_pcc_socket(M32R_PCC0_BASE, PLD_IRQ_CFC_INSERT, CFC_ATTR_MAPBASE, - CFC_IOPORT_BASE); -#else /* CONFIG_PLAT_USRV */ - { - ulong base, mapaddr; - ioaddr_t ioaddr; - - for (i = 0 ; i < M32R_MAX_PCC ; i++) { - base = (ulong)PLD_CFRSTCR; - base = base | (i << 8); - ioaddr = (i + 1) << 12; - mapaddr = CFC_ATTR_MAPBASE | (i << 20); - add_pcc_socket(base, 0, mapaddr, ioaddr); - } - } -#endif /* CONFIG_PLAT_USRV */ - - if (pcc_sockets == 0) { - printk("socket is not found.\n"); - platform_device_unregister(&pcc_device); - driver_unregister(&pcc_driver); - return -ENODEV; - } - - /* Set up interrupt handler(s) */ - - for (i = 0 ; i < pcc_sockets ; i++) { - socket[i].socket.dev.dev = &pcc_device.dev; - socket[i].socket.ops = &pcc_operations; - socket[i].socket.owner = THIS_MODULE; - socket[i].number = i; - ret = pcmcia_register_socket(&socket[i].socket); - if (ret && i--) { - for (; i>= 0; i--) - pcmcia_unregister_socket(&socket[i].socket); - break; - } -#if 0 /* driver model ordering issue */ - class_device_create_file(&socket[i].socket.dev, - &class_device_attr_info); - class_device_create_file(&socket[i].socket.dev, - &class_device_attr_exca); -#endif - } - - /* Finally, schedule a polling interrupt */ - if (poll_interval != 0) { - poll_timer.function = pcc_interrupt_wrapper; - poll_timer.data = 0; - init_timer(&poll_timer); - poll_timer.expires = jiffies + poll_interval; - add_timer(&poll_timer); - } - - return 0; -} /* init_m32r_pcc */ - -static void __exit exit_m32r_pcc(void) -{ - int i; - - for (i = 0; i < pcc_sockets; i++) - pcmcia_unregister_socket(&socket[i].socket); - - platform_device_unregister(&pcc_device); - if (poll_interval != 0) - del_timer_sync(&poll_timer); - - driver_unregister(&pcc_driver); -} /* exit_m32r_pcc */ - -module_init(init_m32r_pcc); -module_exit(exit_m32r_pcc); -MODULE_LICENSE("Dual MPL/GPL"); -/*====================================================================*/ diff -Nru a/arch/m32r/drivers/m32r_cfc.h b/arch/m32r/drivers/m32r_cfc.h --- a/arch/m32r/drivers/m32r_cfc.h 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,85 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2001 by Hiroyuki Kondo - */ - -#if !defined(CONFIG_PLAT_USRV) -#define M32R_MAX_PCC 2 -#else /* CONFIG_PLAT_USRV */ -#define M32R_MAX_PCC CONFIG_CFC_NUM -#endif /* CONFIG_PLAT_USRV */ - -/* - * M32R PC Card Controler - */ -#define M32R_PCC0_BASE 0x00ef7000 -#define M32R_PCC1_BASE 0x00ef7020 - -/* - * Register offsets - */ -#define PCCR 0x00 -#define PCADR 0x04 -#define PCMOD 0x08 -#define PCIRC 0x0c -#define PCCSIGCR 0x10 -#define PCATCR 0x14 - -/* - * PCCR - */ -#define PCCR_PCEN (1UL<<(31-31)) - -/* - * PCIRC - */ -#define PCIRC_BWERR (1UL<<(31-7)) -#define PCIRC_CDIN1 (1UL<<(31-14)) -#define PCIRC_CDIN2 (1UL<<(31-15)) -#define PCIRC_BEIEN (1UL<<(31-23)) -#define PCIRC_CIIEN (1UL<<(31-30)) -#define PCIRC_COIEN (1UL<<(31-31)) - -/* - * PCCSIGCR - */ -#define PCCSIGCR_SEN (1UL<<(31-3)) -#define PCCSIGCR_VEN (1UL<<(31-7)) -#define PCCSIGCR_CRST (1UL<<(31-15)) -#define PCCSIGCR_COCR (1UL<<(31-31)) - -/* - * - */ -#define PCMOD_AS_ATTRIB (1UL<<(31-19)) -#define PCMOD_AS_IO (1UL<<(31-18)) - -#define PCMOD_CBSZ (1UL<<(31-23)) /* set for 8bit */ - -#define PCMOD_DBEX (1UL<<(31-31)) /* set for excahnge */ - -/* - * M32R PCC Map addr - */ - -#define M32R_PCC0_MAPBASE 0x14000000 -#define M32R_PCC1_MAPBASE 0x16000000 - -#define M32R_PCC_MAPMAX 0x02000000 - -#define M32R_PCC_MAPSIZE 0x00001000 /* XXX */ -#define M32R_PCC_MAPMASK (~(M32R_PCC_MAPMAX-1)) - -#define CFC_IOPORT_BASE 0x1000 - -#if !defined(CONFIG_PLAT_USRV) -#define CFC_ATTR_MAPBASE 0x0c014000 -#define CFC_IO_MAPBASE_BYTE 0xac012000 -#define CFC_IO_MAPBASE_WORD 0xac002000 -#else /* CONFIG_PLAT_USRV */ -#define CFC_ATTR_MAPBASE 0x04014000 -#define CFC_IO_MAPBASE_BYTE 0xa4012000 -#define CFC_IO_MAPBASE_WORD 0xa4002000 -#endif /* CONFIG_PLAT_USRV */ - diff -Nru a/arch/m32r/drivers/m32r_pcc.c b/arch/m32r/drivers/m32r_pcc.c --- a/arch/m32r/drivers/m32r_pcc.c 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,821 +0,0 @@ -/* - * linux/arch/m32r/drivers/m32r_pcc.c - * - * Device driver for the PCMCIA functionality of M32R. - * - * Copyright (c) 2001, 2002, 2003, 2004 - * Hiroyuki Kondo, Naoto Sugai, Hayato Fujiwara - */ - -#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 - -/* XXX: should be moved into asm/irq.h */ -#define PCC0_IRQ 24 -#define PCC1_IRQ 25 - -#define CHAOS_PCC_DEBUG -#ifdef CHAOS_PCC_DEBUG - static volatile u_short dummy_readbuf; -#endif - -#define PCC_DEBUG_DBEX - -#define PCMCIA_DEBUG 0 - -#include "m32r_pcc.h" - -#ifdef PCMCIA_DEBUG -int pc_debug = PCMCIA_DEBUG; -module_param(pc_debug, int, 0444); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(args) -#else -#define DEBUG(n, args...) do { } while (0) -#endif - -/* Poll status interval -- 0 means default to interrupt */ -static int poll_interval = 0; - -typedef enum pcc_space { as_none = 0, as_comm, as_attr, as_io } pcc_as_t; - -typedef struct pcc_socket { - u_short type, flags; - struct pcmcia_socket socket; - unsigned int number; - ioaddr_t ioaddr; - u_long mapaddr; - u_long base; /* PCC register base */ - u_char cs_irq, intr; - pccard_io_map io_map[MAX_IO_WIN]; - pccard_mem_map mem_map[MAX_WIN]; - u_char io_win; - u_char mem_win; - pcc_as_t current_space; - u_char last_iodbex; -#ifdef CHAOS_PCC_DEBUG - u_char last_iosize; -#endif -#ifdef CONFIG_PROC_FS - struct proc_dir_entry *proc; -#endif -} pcc_socket_t; - -static int pcc_sockets = 0; -static pcc_socket_t socket[M32R_MAX_PCC] = { - { 0, }, /* ... */ -}; - -#define ISA_LOCK(n, f) do { } while (0) -#define ISA_UNLOCK(n, f) do { } while (0) - -/*====================================================================*/ - -static unsigned int pcc_get(u_short, unsigned int); -static void pcc_set(u_short, unsigned int , unsigned int ); - -static spinlock_t pcc_lock = SPIN_LOCK_UNLOCKED; - -void pcc_iorw(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int wr, int flag) -{ - u_long addr; - u_long flags; - int need_ex; -#ifdef PCC_DEBUG_DBEX - int _dbex; -#endif - pcc_socket_t *t = &socket[sock]; -#ifdef CHAOS_PCC_DEBUG - int map_changed = 0; -#endif - - /* Need lock ? */ - spin_lock_irqsave(&pcc_lock, flags); - - /* - * Check if need dbex - */ - need_ex = (size > 1 && flag == 0) ? PCMOD_DBEX : 0; -#ifdef PCC_DEBUG_DBEX - _dbex = need_ex; - need_ex = 0; -#endif - - /* - * calculate access address - */ - addr = t->mapaddr + port - t->ioaddr + KSEG1; /* XXX */ - - /* - * Check current mapping - */ - if (t->current_space != as_io || t->last_iodbex != need_ex) { - - u_long cbsz; - - /* - * Disable first - */ - pcc_set(sock, PCCR, 0); - - /* - * Set mode and io address - */ - cbsz = (t->flags & MAP_16BIT) ? 0 : PCMOD_CBSZ; - pcc_set(sock, PCMOD, PCMOD_AS_IO | cbsz | need_ex); - pcc_set(sock, PCADR, addr & 0x1ff00000); - - /* - * Enable and read it - */ - pcc_set(sock, PCCR, 1); - -#ifdef CHAOS_PCC_DEBUG -#if 0 - map_changed = (t->current_space == as_attr && size == 2); /* XXX */ -#else - map_changed = 1; -#endif -#endif - t->current_space = as_io; - } - - /* - * access to IO space - */ - if (size == 1) { - /* Byte */ - unsigned char *bp = (unsigned char *)buf; - -#ifdef CHAOS_DEBUG - if (map_changed) { - dummy_readbuf = readb(addr); - } -#endif - if (wr) { - /* write Byte */ - while (nmemb--) { - writeb(*bp++, addr); - } - } else { - /* read Byte */ - while (nmemb--) { - *bp++ = readb(addr); - } - } - } else { - /* Word */ - unsigned short *bp = (unsigned short *)buf; - -#ifdef CHAOS_PCC_DEBUG - if (map_changed) { - dummy_readbuf = readw(addr); - } -#endif - if (wr) { - /* write Word */ - while (nmemb--) { -#ifdef PCC_DEBUG_DBEX - if (_dbex) { - unsigned char *cp = (unsigned char *)bp; - unsigned short tmp; - tmp = cp[1] << 8 | cp[0]; - writew(tmp, addr); - bp++; - } else -#endif - writew(*bp++, addr); - } - } else { - /* read Word */ - while (nmemb--) { -#ifdef PCC_DEBUG_DBEX - if (_dbex) { - unsigned char *cp = (unsigned char *)bp; - unsigned short tmp; - tmp = readw(addr); - cp[0] = tmp & 0xff; - cp[1] = (tmp >> 8) & 0xff; - bp++; - } else -#endif - *bp++ = readw(addr); - } - } - } - -#if 1 - /* addr is no longer used */ - if ((addr = pcc_get(sock, PCIRC)) & PCIRC_BWERR) { - printk("m32r_pcc: BWERR detected : port 0x%04lx : iosize %dbit\n", - port, size * 8); - pcc_set(sock, PCIRC, addr); - } -#endif - /* - * save state - */ - t->last_iosize = size; - t->last_iodbex = need_ex; - - /* Need lock ? */ - - spin_unlock_irqrestore(&pcc_lock,flags); - - return; -} - -void pcc_ioread(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int flag) { - pcc_iorw(sock, port, buf, size, nmemb, 0, flag); -} - -void pcc_iowrite(int sock, unsigned long port, void *buf, size_t size, size_t nmemb, int flag) { - pcc_iorw(sock, port, buf, size, nmemb, 1, flag); -} - -/*====================================================================*/ - -#define IS_ALIVE 0x8000 - -typedef struct pcc_t { - char *name; - u_short flags; -} pcc_t; - -static pcc_t pcc[] = { - { "xnux2", 0 }, { "xnux2", 0 }, -}; - -static irqreturn_t pcc_interrupt(int, void *, struct pt_regs *); - -/*====================================================================*/ - -static struct timer_list poll_timer; - -static unsigned int pcc_get(u_short sock, unsigned int reg) -{ - return inl(socket[sock].base + reg); -} - - -static void pcc_set(u_short sock, unsigned int reg, unsigned int data) -{ - outl(data, socket[sock].base + reg); -} - -/*====================================================================== - - See if a card is present, powered up, in IO mode, and already - bound to a (non PC Card) Linux driver. We leave these alone. - - We make an exception for cards that seem to be serial devices. - -======================================================================*/ - -static int __init is_alive(u_short sock) -{ - unsigned int stat; - unsigned int f; - - stat = pcc_get(sock, PCIRC); - f = (stat & (PCIRC_CDIN1 | PCIRC_CDIN2)) >> 16; - if(!f){ - printk("m32r_pcc: No Card is detected at socket %d : stat = 0x%08x\n",stat,sock); - return 0; - } - if(f!=3) - printk("m32r_pcc: Insertion fail (%.8x) at socket %d\n",stat,sock); - else - printk("m32r_pcc: Card is Inserted at socket %d(%.8x)\n",sock,stat); - return 0; -} - -static void add_pcc_socket(ulong base, int irq, ulong mapaddr, ioaddr_t ioaddr) -{ - pcc_socket_t *t = &socket[pcc_sockets]; - - /* add sockets */ - t->ioaddr = ioaddr; - t->mapaddr = mapaddr; - t->base = base; -#ifdef CHAOS_PCC_DEBUG - t->flags = MAP_16BIT; -#else - t->flags = 0; -#endif - if (is_alive(pcc_sockets)) - t->flags |= IS_ALIVE; - - /* add pcc */ - if (t->base > 0) { - request_region(t->base, 0x20, "m32r-pcc"); - } - - printk(KERN_INFO " %s ", pcc[pcc_sockets].name); - printk("pcc at 0x%08lx\n", t->base); - - /* Update socket interrupt information, capabilities */ - t->socket.features |= (SS_CAP_PCCARD | SS_CAP_STATIC_MAP); - t->socket.map_size = M32R_PCC_MAPSIZE; - t->socket.io_offset = ioaddr; /* use for io access offset */ - t->socket.irq_mask = 0; - t->socket.pci_irq = 2 + pcc_sockets; /* XXX */ - - request_irq(irq, pcc_interrupt, 0, "m32r-pcc", pcc_interrupt); - - pcc_sockets++; - - return; -} - - -/*====================================================================*/ - -static irqreturn_t pcc_interrupt(int irq, void *dev, struct pt_regs *regs) -{ - int i, j, irc; - u_int events, active; - int handled = 0; - - DEBUG(4, "m32r: pcc_interrupt(%d)\n", irq); - - for (j = 0; j < 20; j++) { - active = 0; - for (i = 0; i < pcc_sockets; i++) { - if ((socket[i].cs_irq != irq) && - (socket[i].socket.pci_irq != irq)) - continue; - handled = 1; - irc = pcc_get(i, PCIRC); - irc >>=16; - DEBUG(2, "m32r-pcc:interrput: socket %d pcirc 0x%02x ", i, irc); - if (!irc) - continue; - - events = (irc) ? SS_DETECT : 0; - events |= (pcc_get(i,PCCR) & PCCR_PCEN) ? SS_READY : 0; - DEBUG(2, " event 0x%02x\n", events); - - if (events) - pcmcia_parse_events(&socket[i].socket, events); - - active |= events; - active = 0; - } - if (!active) break; - } - if (j == 20) - printk(KERN_NOTICE "m32r-pcc: infinite loop in interrupt handler\n"); - - DEBUG(4, "m32r-pcc: interrupt done\n"); - - return IRQ_RETVAL(handled); -} /* pcc_interrupt */ - -static void pcc_interrupt_wrapper(u_long data) -{ - pcc_interrupt(0, NULL, NULL); - init_timer(&poll_timer); - poll_timer.expires = jiffies + poll_interval; - add_timer(&poll_timer); -} - -/*====================================================================*/ - -static int _pcc_get_status(u_short sock, u_int *value) -{ - u_int status; - - status = pcc_get(sock,PCIRC); - *value = ((status & PCIRC_CDIN1) && (status & PCIRC_CDIN2)) - ? SS_DETECT : 0; - - status = pcc_get(sock,PCCR); - -#if 0 - *value |= (status & PCCR_PCEN) ? SS_READY : 0; -#else - *value |= SS_READY; /* XXX: always */ -#endif - - status = pcc_get(sock,PCCSIGCR); - *value |= (status & PCCSIGCR_VEN) ? SS_POWERON : 0; - - DEBUG(3, "m32r-pcc: GetStatus(%d) = %#4.4x\n", sock, *value); - return 0; -} /* _get_status */ - -/*====================================================================*/ - -static int _pcc_get_socket(u_short sock, socket_state_t *state) -{ - DEBUG(3, "m32r-pcc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, " - "io_irq %d, csc_mask %#2.2x\n", sock, state->flags, - state->Vcc, state->Vpp, state->io_irq, state->csc_mask); - return 0; -} /* _get_socket */ - -/*====================================================================*/ - -static int _pcc_set_socket(u_short sock, socket_state_t *state) -{ - u_long reg = 0; - - DEBUG(3, "m32r-pcc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " - "io_irq %d, csc_mask %#2.2x)", sock, state->flags, - state->Vcc, state->Vpp, state->io_irq, state->csc_mask); - - if (state->Vcc) { - /* - * 5V only - */ - if (state->Vcc == 50) { - reg |= PCCSIGCR_VEN; - } else { - return -EINVAL; - } - } - - if (state->flags & SS_RESET) { - DEBUG(3, ":RESET\n"); - reg |= PCCSIGCR_CRST; - } - if (state->flags & SS_OUTPUT_ENA){ - DEBUG(3, ":OUTPUT_ENA\n"); - /* bit clear */ - } else { - reg |= PCCSIGCR_SEN; - } - - pcc_set(sock,PCCSIGCR,reg); - -#ifdef PCMCIA_DEBUG - if(state->flags & SS_IOCARD){ - DEBUG(3, ":IOCARD"); - } - if (state->flags & SS_PWR_AUTO) { - DEBUG(3, ":PWR_AUTO"); - } - if (state->csc_mask & SS_DETECT) - DEBUG(3, ":csc-SS_DETECT"); - if (state->flags & SS_IOCARD) { - if (state->csc_mask & SS_STSCHG) - DEBUG(3, ":STSCHG"); - } else { - if (state->csc_mask & SS_BATDEAD) - DEBUG(3, ":BATDEAD"); - if (state->csc_mask & SS_BATWARN) - DEBUG(3, ":BATWARN"); - if (state->csc_mask & SS_READY) - DEBUG(3, ":READY"); - } - DEBUG(3, "\n"); -#endif - return 0; -} /* _set_socket */ - -/*====================================================================*/ - -static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io) -{ - u_char map; - - DEBUG(3, "m32r-pcc: SetIOMap(%d, %d, %#2.2x, %d ns, " - "%#4.4x-%#4.4x)\n", sock, io->map, io->flags, - io->speed, io->start, io->stop); - map = io->map; - - return 0; -} /* _set_io_map */ - -/*====================================================================*/ - -static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem) -{ - - u_char map = mem->map; - u_long mode; - u_long addr; - pcc_socket_t *t = &socket[sock]; -#ifdef CHAOS_PCC_DEBUG -#if 0 - pcc_as_t last = t->current_space; -#endif -#endif - - DEBUG(3, "m32r-pcc: SetMemMap(%d, %d, %#2.2x, %d ns, " - "%#5.5lx-%#5.5lx, %#5.5x)\n", sock, map, mem->flags, - mem->speed, mem->res->start, mem->res->end, mem->card_start); - - /* - * sanity check - */ - if ((map > MAX_WIN) || (mem->card_start > 0x3ffffff) || - (mem->res->start > mem->res->end)) { - return -EINVAL; - } - - /* - * de-activate - */ - if ((mem->flags & MAP_ACTIVE) == 0) { - t->current_space = as_none; - return 0; - } - - /* - * Disable first - */ - pcc_set(sock, PCCR, 0); - - /* - * Set mode - */ - if (mem->flags & MAP_ATTRIB) { - mode = PCMOD_AS_ATTRIB | PCMOD_CBSZ; - t->current_space = as_attr; - } else { - mode = 0; /* common memory */ - t->current_space = as_comm; - } - pcc_set(sock, PCMOD, mode); - - /* - * Set address - */ - addr = t->mapaddr + (mem->card_start & M32R_PCC_MAPMASK); - pcc_set(sock, PCADR, addr); - - mem->res->start = addr + mem->card_start; - mem->res->end = mem->res->start + (M32R_PCC_MAPSIZE - 1); - - /* - * Enable again - */ - pcc_set(sock, PCCR, 1); - -#ifdef CHAOS_PCC_DEBUG -#if 0 - if (last != as_attr) { -#else - if (1) { -#endif - - dummy_readbuf = *(u_char *)(addr + KSEG1); - } -#endif - - return 0; - -} /* _set_mem_map */ - -#if 0 /* driver model ordering issue */ -/*====================================================================== - - Routines for accessing socket information and register dumps via - /proc/bus/pccard/... - -======================================================================*/ - -static ssize_t show_info(struct class_device *class_dev, char *buf) -{ - pcc_socket_t *s = container_of(class_dev, struct pcc_socket, - socket.dev); - - return sprintf(buf, "type: %s\nbase addr: 0x%08lx\n", - pcc[s->type].name, s->base); -} - -static ssize_t show_exca(struct class_device *class_dev, char *buf) -{ - /* FIXME */ - - return 0; -} - -static CLASS_DEVICE_ATTR(info, S_IRUGO, show_info, NULL); -static CLASS_DEVICE_ATTR(exca, S_IRUGO, show_exca, NULL); -#endif - -/*====================================================================*/ - -/* this is horribly ugly... proper locking needs to be done here at - * some time... */ -#define LOCKED(x) do { \ - int retval; \ - unsigned long flags; \ - spin_lock_irqsave(&pcc_lock, flags); \ - retval = x; \ - spin_unlock_irqrestore(&pcc_lock, flags); \ - return retval; \ -} while (0) - - -static int pcc_get_status(struct pcmcia_socket *s, u_int *value) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) { - *value = 0; - return -EINVAL; - } - LOCKED(_pcc_get_status(sock, value)); -} - -static int pcc_get_socket(struct pcmcia_socket *s, socket_state_t *state) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) - return -EINVAL; - LOCKED(_pcc_get_socket(sock, state)); -} - -static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) - return -EINVAL; - - LOCKED(_pcc_set_socket(sock, state)); -} - -static int pcc_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) - return -EINVAL; - LOCKED(_pcc_set_io_map(sock, io)); -} - -static int pcc_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) -{ - unsigned int sock = container_of(s, struct pcc_socket, socket)->number; - - if (socket[sock].flags & IS_ALIVE) - return -EINVAL; - LOCKED(_pcc_set_mem_map(sock, mem)); -} - -static int pcc_init(struct pcmcia_socket *s) -{ - DEBUG(4, "m32r-pcc: init call\n"); - return 0; -} - -static int pcc_suspend(struct pcmcia_socket *sock) -{ - return pcc_set_socket(sock, &dead_socket); -} - -static struct pccard_operations pcc_operations = { - .init = pcc_init, - .suspend = pcc_suspend, - .get_status = pcc_get_status, - .get_socket = pcc_get_socket, - .set_socket = pcc_set_socket, - .set_io_map = pcc_set_io_map, - .set_mem_map = pcc_set_mem_map, -}; - -/*====================================================================*/ - -static int m32r_pcc_suspend(struct device *dev, u32 state, u32 level) -{ - int ret = 0; - if (level == SUSPEND_SAVE_STATE) - ret = pcmcia_socket_dev_suspend(dev, state); - return ret; -} - -static int m32r_pcc_resume(struct device *dev, u32 level) -{ - int ret = 0; - if (level == RESUME_RESTORE_STATE) - ret = pcmcia_socket_dev_resume(dev); - return ret; -} - - -static struct device_driver pcc_driver = { - .name = "pcc", - .bus = &platform_bus_type, - .suspend = m32r_pcc_suspend, - .resume = m32r_pcc_resume, -}; - -static struct platform_device pcc_device = { - .name = "pcc", - .id = 0, -}; - -/*====================================================================*/ - -static int __init init_m32r_pcc(void) -{ - int i, ret; - - ret = driver_register(&pcc_driver); - if (ret) - return ret; - - ret = platform_device_register(&pcc_device); - if (ret){ - driver_unregister(&pcc_driver); - return ret; - } - - printk(KERN_INFO "m32r PCC probe:\n"); - - pcc_sockets = 0; - - add_pcc_socket(M32R_PCC0_BASE, PCC0_IRQ, M32R_PCC0_MAPBASE, 0x1000); - -#ifdef CONFIG_M32RPCC_SLOT2 - add_pcc_socket(M32R_PCC1_BASE, PCC1_IRQ, M32R_PCC1_MAPBASE, 0x2000); -#endif - - if (pcc_sockets == 0) { - printk("socket is not found.\n"); - platform_device_unregister(&pcc_device); - driver_unregister(&pcc_driver); - return -ENODEV; - } - - /* Set up interrupt handler(s) */ - - for (i = 0 ; i < pcc_sockets ; i++) { - socket[i].socket.dev.dev = &pcc_device.dev; - socket[i].socket.ops = &pcc_operations; - socket[i].socket.owner = THIS_MODULE; - socket[i].number = i; - ret = pcmcia_register_socket(&socket[i].socket); - if (ret && i--) { - for (; i>= 0; i--) - pcmcia_unregister_socket(&socket[i].socket); - break; - } -#if 0 /* driver model ordering issue */ - class_device_create_file(&socket[i].socket.dev, - &class_device_attr_info); - class_device_create_file(&socket[i].socket.dev, - &class_device_attr_exca); -#endif - } - - /* Finally, schedule a polling interrupt */ - if (poll_interval != 0) { - poll_timer.function = pcc_interrupt_wrapper; - poll_timer.data = 0; - init_timer(&poll_timer); - poll_timer.expires = jiffies + poll_interval; - add_timer(&poll_timer); - } - - return 0; -} /* init_m32r_pcc */ - -static void __exit exit_m32r_pcc(void) -{ - int i; - - for (i = 0; i < pcc_sockets; i++) - pcmcia_unregister_socket(&socket[i].socket); - - platform_device_unregister(&pcc_device); - if (poll_interval != 0) - del_timer_sync(&poll_timer); - - driver_unregister(&pcc_driver); -} /* exit_m32r_pcc */ - -module_init(init_m32r_pcc); -module_exit(exit_m32r_pcc); -MODULE_LICENSE("Dual MPL/GPL"); -/*====================================================================*/ diff -Nru a/arch/m32r/drivers/m32r_pcc.h b/arch/m32r/drivers/m32r_pcc.h --- a/arch/m32r/drivers/m32r_pcc.h 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,70 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2001 by Hiroyuki Kondo - */ - - - -#define M32R_MAX_PCC 2 - -/* - * M32R PC Card Controler - */ -#define M32R_PCC0_BASE 0x00ef7000 -#define M32R_PCC1_BASE 0x00ef7020 - -/* - * Register offsets - */ -#define PCCR 0x00 -#define PCADR 0x04 -#define PCMOD 0x08 -#define PCIRC 0x0c -#define PCCSIGCR 0x10 -#define PCATCR 0x14 - -/* - * PCCR - */ -#define PCCR_PCEN (1UL<<(31-31)) - -/* - * PCIRC - */ -#define PCIRC_BWERR (1UL<<(31-7)) -#define PCIRC_CDIN1 (1UL<<(31-14)) -#define PCIRC_CDIN2 (1UL<<(31-15)) -#define PCIRC_BEIEN (1UL<<(31-23)) -#define PCIRC_CIIEN (1UL<<(31-30)) -#define PCIRC_COIEN (1UL<<(31-31)) - -/* - * PCCSIGCR - */ -#define PCCSIGCR_SEN (1UL<<(31-3)) -#define PCCSIGCR_VEN (1UL<<(31-7)) -#define PCCSIGCR_CRST (1UL<<(31-15)) -#define PCCSIGCR_COCR (1UL<<(31-31)) - -/* - * - */ -#define PCMOD_AS_ATTRIB (1UL<<(31-19)) -#define PCMOD_AS_IO (1UL<<(31-18)) - -#define PCMOD_CBSZ (1UL<<(31-23)) /* set for 8bit */ - -#define PCMOD_DBEX (1UL<<(31-31)) /* set for excahnge */ - -/* - * M32R PCC Map addr - */ -#define M32R_PCC0_MAPBASE 0x14000000 -#define M32R_PCC1_MAPBASE 0x16000000 - -#define M32R_PCC_MAPMAX 0x02000000 - -#define M32R_PCC_MAPSIZE 0x00001000 /* XXX */ -#define M32R_PCC_MAPMASK (~(M32R_PCC_MAPMAX-1)) - diff -Nru a/arch/m32r/drivers/m5.c b/arch/m32r/drivers/m5.c --- a/arch/m32r/drivers/m5.c 2004-10-06 19:37:46 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,913 +0,0 @@ -/* - * Flash Memory Driver for M32700UT-CPU - * - * [support chips] - * - M5M29GT320VP - * - * Copyright (C) 2003 Takeo Takahashi - * - * 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. - * - * 2003-02-01: Takeo Takahashi, support M5M29GT320VP page program. - * - */ - -#ifndef __KERNEL__ -# define __KERNEL__ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "m5.h" - -static const char version[] = "M5 Flash Driver"; -static const char date[] = __DATE__; -static const char time[] = __TIME__; - -/* - * Special function - */ -#define M5_SUPPORT_PROBE 1 -#define M5_MAX_ERROR 5 - -/* - * flash memory start address: - */ -//#define M5_BASE_ADDR (0x00000000 + NONCACHE_OFFSET) -#define M5_BASE_ADDR (0x00000000 + PAGE_OFFSET) -#define M5_IDENT_ADDR (M5_BASE_ADDR + 0) - -/* - * This driver does not have a real partition block, but - * it can support simulation of partition in single chip. - */ -#define M5_PARTITIONS (3) -static int m5_len[M5_PARTITIONS] = { - 192 * 1024, /* 192kB: 0x00000000 - 0x0002ffff */ - 1088 * 1024, /* 1088kB: 0x00030000 - 0x0013ffff */ - 2816 * 1024 /* 2816kB: 0x00140000 - 0x003fffff */ -}; - -static int major = 240; -static int debug = 2; -static int led=0; -static int m5_addr[M5_PARTITIONS]; -static int m5_blk_size[M5_PARTITIONS]; -static int m5_blksize_size[M5_PARTITIONS]; -static int m5_hardsect_size[M5_PARTITIONS]; -static int m5_read_ahead = 1; -MODULE_PARM(major, "i"); -//MODULE_PARM_DESC(major, "major number"); -MODULE_PARM(debug, "i"); -//MODULE_PARM_DESC(debug, "debug flag"); -MODULE_PARM(led, "i"); -//MODULE_PARM_DESC(led, "LED2 support"); - -static devfs_handle_t devfs_handle = NULL; -#ifdef CONFIG_PROC_FS -static struct proc_dir_entry *proc_m5; -#endif - -#define MAJOR_NR major -#define DEVICE_NAME "m5" -#define DEVICE_NR(device) MINOR(device) -#define DEVICE_NO_RANDOM -#define DEVICE_OFF(device) -#define DEVICE_ON(device) -#define DEVICE_REQUEST m5_request -#include - -#define WAIT_TIME 10 /* 10 usec */ -#define WAIT_COUNT (50000/WAIT_TIME) /* 50ms = 10us*5000times */ - -#define SUCCESS 0 -#define FAILED (-1) - -/* - * definitions for cache - */ -static struct cache { - int blk; /* block number, -1:invalid */ - int status; /* cache status */ -#define B_CLEAN 0 -#define B_DIRTY 1 - m5_t *addr; /* block base address */ - m5_t cache[M5_BLOCK_SIZE64]; -} m5_cache; -#define M5_BLK_NOCACHED() (m5_cache.blk == -1) -#define M5_BLK_CACHED(blk) (m5_cache.blk == (blk)) -#define M5_STATE_DIRTY() (m5_cache.status == B_DIRTY) -#define M5_STATE_CLEAN() (m5_cache.status == B_CLEAN) -#define M5_MARK_DIRTY() (m5_cache.status = B_DIRTY) -#define M5_MARK_CLEAN() (m5_cache.status = B_CLEAN) -#define M5_MARK_NOCACHED() (m5_cache.blk = -1) -#define M5_MARK_CACHED(blk, addr) (m5_cache.blk = (blk), \ - m5_cache.addr = (addr)) -#define M5_CACHED_BLK m5_cache.blk -#define M5_CACHED_ADDR m5_cache.addr -#define M5_CACHED_BASE m5_cache.cache - -/* - * Prototype declarations - */ -static int m5_erase_blk(m5_t *reg); -static void m5_led_toggle(void); -static void m5_led_on(void); -static void m5_led_off(void); -static m5_t m5_in(m5_t *addr); -static void m5_out(m5_t val, m5_t *addr); -static int m5_probe(m5_t *addr); -static int m5_get_blk_num(m5_t *addr); -static int m5_get_blk_offset(int blk, m5_t *addr); -static int m5_get_blk_size(int blk); -static int m5_read_blk_cache(m5_t *addr); -static int m5_write_blk_cache(void); -static int m5_full_status_check(m5_t status, m5_t *reg); -static void m5_clear_status(m5_t *reg); -#if 0 -static int m5_status_check(m5_t *reg); -#endif -static int m5_wait_for_ready(m5_t *reg); -static int m5_write_page(m5_t *addr, const m5_t *buf); -static int m5_write(const m5_t *buf, int offset, int len); -static int m5_read_page(m5_t *buf, m5_t *addr); -static int m5_read(m5_t *buf, int offset, int len); -static int m5_erase_blk(m5_t *addr); -static void m5_request(request_queue_t *req); -static int m5_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, unsigned long arg); -static int m5_open(struct inode *inode, struct file *fp); -static int m5_release(struct inode *inode, struct file *fp); -static int proc_m5_read(char *buf, char **start, off_t offset, int len, int *eof, void *unused); -static int __init m5_init(void); -static int __init m5_init_module(void); -static void __exit m5_cleanup_module(void); - -/* - * special function - */ -static inline void m5_led_toggle(void) -{ - unsigned short status; - if (!led) return; - status = inw((unsigned long)PLD_IOLEDCR); - if (status & PLD_IOLED_2_ON) - status &= ~PLD_IOLED_2_ON; - else - status |= PLD_IOLED_2_ON; - outw(status, (unsigned long)PLD_IOLEDCR); -} - -static inline void m5_led_on(void) -{ - unsigned short status; - if (!led) return; - status = inw((unsigned long)PLD_IOLEDCR); - status |= PLD_IOLED_2_ON; - outw(status, (unsigned long)PLD_IOLEDCR); -} - -static inline void m5_led_off(void) -{ - unsigned short status; - if (!led) return; - status = inw((unsigned long)PLD_IOLEDCR); - status &= ~PLD_IOLED_2_ON; - outw(status, (unsigned long)PLD_IOLEDCR); -} - -/* - * I/O function - */ -static inline m5_t m5_in(m5_t *addr) -{ - return *addr; -} - -static inline void m5_out(m5_t val, m5_t *addr) -{ - *addr = val; -} - -#if M5_SUPPORT_PROBE -/* - * int m5_probe() - * m5_t *addr: probed address - * int SUCCESS: supported device - * int FAILED: unsupported device - */ -static int m5_probe(m5_t *addr) -{ -#if 1 - /* - * FIXME: cannot read maker & device codes. - */ - m5_t val; - m5_out(M5_CMD_DEVICE_IDENT, addr); - val = m5_in((m5_t *)M5_IDENT_ADDR); - val &= 0xff; - if (val == M5_MAKER) - printk("m5: detected M5M29GT320VP\n"); - else - printk("m5: unknown maker(0x%02x)\n", val); - m5_out(M5_CMD_READ_ARRAY, addr); /* array mode */ - /* always success */ - return SUCCESS; -#else - - int result; - m5_t val; - unsigned char maker, device; - - result = SUCCESS; - m5_out(M5_CMD_DEVICE_IDENT, addr); - val = m5_in((m5_t *)M5_IDENT_ADDR); - maker = (val >> 16); - device = (val & 0xff); - if (maker != M5_MAKER) { - printk("m5: unknown maker(0x%02x)\n", maker); - // result = FAILED; - // ignore error - } - if (device != M5_M5M29GT320VP) { - printk("m5: unknown device(0x%02x)\n", device); - // result = FAILED; - // ignore error - } - if (result != FAILED) - printk("m5: detected M5M29GT320VP\n"); - m5_out(M5_CMD_READ_ARRAY, addr); - return result; -#endif -} -#endif /* M5_SUPPORT_PROBE */ - -/* - * int m5_get_blk_num() - * m5_t *addr: - * blk: OK, return block number - * -1: NG - */ -static int m5_get_blk_num(m5_t *addr) -{ - int blk; - - blk = (((int)addr & 0x0fff0000) >> 16); - if (blk > 0x3f) { - printk("m5: out of block address (0x%08x)\n", (int)addr); - return -1; - } - if (blk == 0x3f) - blk += (int)(((int)addr & 0x0000e000) >> 13); - if (blk > MAX_BLOCK_NUM) { - printk("m5: out of block address (addr=0x%08x, blk=%d)\n", - (int)addr, blk); - return -1; - } - return blk; -} - -/* - * m5_t *m5_get_blk_base() - * return block base address - */ -static inline m5_t *m5_get_blk_base(int blk, m5_t *addr) -{ - if (blk < 0x3f) return (m5_t *)((int)addr & 0xffff0000); - return (m5_t *)((int)addr & 0xffffe000); -} - -/* - * int m5_get_blk_offset() - * return offset of specified address in blk - */ -static inline int m5_get_blk_offset(int blk, m5_t *addr) -{ - if (blk < 0x3f) return ((int)addr & 0xffff); - return ((int)addr & 0x1fff); -} - -/* - * int m5_get_blk_size() - * return block size in byte - */ -static inline int m5_get_blk_size(int blk) -{ - if (blk >= 63) return M5_BLOCK_SIZE8; - return M5_BLOCK_SIZE64; -} - -/* - * cache operations - */ -static int m5_read_blk_cache(m5_t *addr) -{ - int blk; - int size; - int result; - - result = SUCCESS; - blk = m5_get_blk_num(addr); - if (blk < 0) return FAILED; - if (M5_BLK_CACHED(blk)) - return result; - if (M5_STATE_DIRTY()) { /* cached other block */ - result = m5_write_blk_cache(); - if (result != SUCCESS) return result; - } - /* ok, we can use cache */ - size = m5_get_blk_size(blk); - addr = m5_get_blk_base(blk, addr); - memcpy((void *)M5_CACHED_BASE, (void *)addr, size); - M5_MARK_CACHED(blk, addr); - M5_MARK_CLEAN(); - return result; -} - -static int m5_write_blk_cache(void) -{ - int size; - int pages; - int i; - m5_t *reg, *addr, *buf; - int result; - - result = SUCCESS; - - if (M5_BLK_NOCACHED()) - return result; - if (! M5_STATE_DIRTY()) - return result; - - /* we have to write cache */ - m5_led_on(); - size = m5_get_blk_size(M5_CACHED_BLK); - addr = M5_CACHED_ADDR; - buf = M5_CACHED_BASE; - reg = addr; - - result = m5_erase_blk(reg); - if (result != SUCCESS) return result; - - DEBUG(1, "m5: wrting addr=0x%08x, buf=0x%08x, size=%d\n",\ - (int)addr, (int)buf, size); - for (pages = 0; pages < (size/M5_PAGE_SIZE); pages++) { - m5_out(M5_CMD_PROGRAM_PAGE, reg); - for (i = 0; i < (M5_PAGE_SIZE/sizeof(m5_t)); i++) - *addr++ = *buf++; - if (m5_wait_for_ready(reg) != SUCCESS) - result = FAILED; - reg = addr; - } - m5_out(M5_CMD_READ_ARRAY, reg); /* array mode */ - if (result == SUCCESS) - M5_MARK_CLEAN(); - m5_led_off(); - return result; /* SUCCESS or FAILED */ -} - -/* - * int m5_full_status_check() - * m5_t status: status - * m5_t *reg: bank address - * SUCCESS: no error - * FAILED: error happen - */ -static inline int m5_full_status_check(m5_t status, m5_t *reg) -{ - if ((status & M5_STATUS_PROGRAM) && - (status & M5_STATUS_ERASE)) { - printk("m5: command sequence error (addr=0x%08x, sts=0x%02x).\n", - (int)reg, status); - return FAILED; - } - if(status & M5_STATUS_ERASE){ - printk("m5: erase error (addr=0x%08x, sts=0x%02x).\n", - (int)reg, status); - return FAILED; - } - if(status & M5_STATUS_PROGRAM){ - printk("m5: program write error (addr=0x%08x, sts=0x%02x).\n", - (int)reg, status); - return FAILED; - } - if(status & M5_STATUS_BLOCK){ - printk("m5: block write error (addr=0x%08x, sts=0x%02x).\n", - (int)reg, status); - return FAILED; - } - /* passed */ - return SUCCESS; -} - -/* - * void m5_clear_status() - * m5_t *reg: address of status register - */ -static inline void m5_clear_status(m5_t *reg) -{ - m5_out(M5_CMD_CLEAR_STATUS, reg); -} - -#if 0 -/* - * int m5_status_check() - * m5_t *reg: address of command register - * SUCCESS: ready now - * FAILED: error happen while waiting - */ -static int m5_status_check(m5_t *reg) -{ - m5_t status; - int result; - int n; - static int error_count = 0; - - m5_out(M5_CMD_READ_STATUS, reg); - for (n = WAIT_COUNT; n > 0; n--) { - status = m5_in(reg); - if (status & M5_STATUS_READY) - break; - udelay(WAIT_TIME); - } - if (n <= 0) { - if (error_count++ < M5_MAX_ERROR) - printk("m5: time out (sts=0x%02x).\n", status); - m5_clear_status(reg); - return FAILED; - } - result = m5_full_status_check(status, reg); - if (result != SUCCESS) { - m5_clear_status(reg); - return FAILED; - } - m5_clear_status(reg); - return SUCCESS; -} -#endif - -/* - * int m5_wait_for_ready() - * m5_t *reg: address of command register - * SUCCESS: ready now - * FAILED: error happen while waiting - */ -static int m5_wait_for_ready(m5_t *reg) -{ - m5_t status; - int result; - int n; - static int error_count = 0; - - for (n = WAIT_COUNT; n > 0; n--) { - status = m5_in(reg); - if (status & M5_STATUS_READY) - break; - udelay(WAIT_TIME); - } - if (n <= 0) { - if (error_count++ < M5_MAX_ERROR) - printk("m5: time out (sts=0x%02x).\n", status); - m5_clear_status(reg); - return FAILED; - } - result = m5_full_status_check(status, reg); - if (result != SUCCESS) { - m5_clear_status(reg); - return FAILED; - } - return SUCCESS; -} - -/* - * int m5_write_page(m5_t *addr, const m5_t *buf) - * m5_t *addr: sector address - * m5_t *buf: buffer address - * SUCCESS: ok - * FAILED: error - */ -static int m5_write_page(m5_t *addr, const m5_t *buf) -{ - int blk; - int offset; - - if (((int)addr % M5_PAGE_SIZE) != 0) - printk("m5: invalid sector addres (0x%08x)\n", (int)addr); - - if (m5_read_blk_cache(addr) != SUCCESS) - return FAILED; - if ((blk = m5_get_blk_num(addr)) < 0) - return FAILED; - offset = m5_get_blk_offset(blk, addr); - memcpy((void *)M5_CACHED_BASE + offset, (void *)buf, M5_PAGE_SIZE); - M5_MARK_DIRTY(); - return SUCCESS; -} - -/* - * int m5_write(const m5_t *buf, int offset, int len) - * m5_t *buf: write buffer address - * int offset: offset from flash base address - * int len: write length - * SUCCESS: ok - * FAILE: error - */ -static int m5_write(const m5_t *buf, int offset, int len) -{ - m5_t *addr; - int result; - - if (len % M5_PAGE_SIZE) { - printk("m5: invalid write size (%d).\n", len); - return FAILED; - } - addr = (m5_t *)(m5_addr[MINOR(CURRENT_DEV)] + offset); - - DEBUG(1, "m5: writing 0x%08x - 0x%08x\n", \ - (int)addr, (int)addr + len); - - for (; len > 0; len -= M5_PAGE_SIZE) { - result = m5_write_page(addr, buf); - if (result != SUCCESS) - return result; - addr = (m5_t *)((int)addr + M5_PAGE_SIZE); - buf = (m5_t *)((int)buf + M5_PAGE_SIZE); - } - return SUCCESS; -} - -/* - * int m5_read_page() - * m5_t *buf: read buffer address - * m5_t *addr: page address - * SUCCESS: ok - * FAILED: error - */ -static int m5_read_page(m5_t *buf, m5_t *addr) -{ - int blk; - int offset; - - if ((blk = m5_get_blk_num(addr)) < 0) - return FAILED; - if (M5_BLK_CACHED(blk)) { - offset = m5_get_blk_offset(blk, addr); - memcpy((void *)buf, (void *)M5_CACHED_BASE + offset, - M5_PAGE_SIZE); - } else { - /* read from flash memory directory */ - memcpy((void *)buf, (void *)addr, M5_PAGE_SIZE); - } - return SUCCESS; -} - -/* - * int m5_read() - * m5_t *buf: read buffer address - * int offset: offset from flash base address - * int len: read length - * SUCCESS: ok - * FAILED: error - */ -static int m5_read(m5_t *buf, int offset, int len) -{ - m5_t *addr; - - if (len % M5_PAGE_SIZE) { - printk("m5: invalid read size (%d).\n", len); - return FAILED; - } - - addr = (m5_t *)(m5_addr[MINOR(CURRENT_DEV)] + offset); - - DEBUG(1, "m5: reading 0x%08x - 0x%08x\n", \ - (int)addr, (int)addr + len); - - for (; len > 0; len -= M5_PAGE_SIZE) { - if (m5_read_page(buf, addr) != SUCCESS) - return FAILED; - buf = (m5_t *)((int)buf + M5_PAGE_SIZE); - addr = (m5_t *)((int)addr + M5_PAGE_SIZE); - } - return SUCCESS; -} - -/* - * int m5_erase_blk() - * m5_t *addr: - */ -static int m5_erase_blk(m5_t *addr) -{ - int result; - - DEBUG(1, "m5: erasing addr=0x%08x\n", (int)addr); - m5_out(M5_CMD_BLOCK_ERASE, addr); - m5_out(M5_CMD_CONFIRM, addr); - result = m5_wait_for_ready(addr); - return result; -} - -/* - * void m5_request() - * request_queue_t *req: I/O request - * end_request(0): error (-EIO) - * end_request(1): ok - */ -static void m5_request(request_queue_t *req) -{ - unsigned int minor; - int offset; - int len; - static int error_count = 0; - - sti(); - while (1) { - INIT_REQUEST; - minor = MINOR(CURRENT_DEV); - if (minor >= M5_PARTITIONS) { - printk( "m5: out of partition (%d)\n", minor ); - end_request(0); - continue; - } - offset = CURRENT->sector * m5_hardsect_size[minor]; - len = (CURRENT->current_nr_sectors * - m5_hardsect_size[minor]); - if ((offset + len) > m5_len[minor]) { - printk( "m5: out of sector (sector=%d, nr=%d)\n", - (int)(CURRENT->sector), - (int)(CURRENT->current_nr_sectors)); - end_request(0); - continue; - } - switch(CURRENT->cmd) { - case READ: - if (m5_read((m5_t *)CURRENT->buffer, - offset, len) != SUCCESS) - end_request(0); - else - end_request(1); - break; - case WRITE: - if (m5_write((m5_t *)(CURRENT->buffer), - offset, len) != SUCCESS) - end_request(0); - else - end_request(1); - break; - default: - if (error_count++ < M5_MAX_ERROR) { - printk("m5: invalid I/O request(%d)\n", - CURRENT->cmd); - } - end_request(0); - break; - } - } -} - -/* - * int m5_ioctl() - * struct inode *inode: - * struct file *file: - * unsigned int cmd: - * unsigned long arg: - */ -static int m5_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, unsigned long arg) -{ - int size; - - DEBUG(2, "m5_ioctl()\n"); - switch (cmd) { - case BLKGETSIZE: - if (!arg) return -EINVAL; - size = (1024 * m5_blk_size[MINOR(inode->i_rdev)] / - m5_hardsect_size[MINOR(inode->i_rdev)]); - return put_user(size, (long __user *)arg); - case BLKFLSBUF: - if (!capable(CAP_SYS_ADMIN)) return -EACCES; - fsync_dev(inode->i_rdev); - invalidate_buffers(inode->i_rdev); - return 0; - case BLKRRPART: - return -EINVAL; - - case BLKRAGET: - case BLKRASET: - case BLKGETSIZE64: - case BLKROSET: - case BLKROGET: - case BLKSSZGET: - return blk_ioctl(inode->i_rdev, cmd, arg); - default: - printk( "m5: unsupported ioctl(0x%08x)\n", cmd); - return -EINVAL; - } - return 0; -} - -/* - * int m5_open() - * struct inode *inode: - * struct file *fp: - */ -static int m5_open(struct inode *inode, struct file *fp) -{ - if (DEVICE_NR(inode->i_rdev) >= M5_PARTITIONS) return -ENXIO; - MOD_INC_USE_COUNT; - return 0; -} - -/* - * int m5_release() - * struct inode *inode: - * struct file *fp: - */ -static int m5_release(struct inode *inode, struct file *fp) -{ - sync_dev(inode->i_rdev); - MOD_DEC_USE_COUNT; - return 0; -} - -#ifdef CONFIG_PROC_FS -/* - * int proc_m5_read() - * char *buf: - * char **start: - * off_t offset: - * int len: - * int *eof: - * void *unused: - */ -static int proc_m5_read(char *buf, char **start, off_t offset, int len, int *eof, void *unused) -{ - len = sprintf(buf, "partition: %d\n", M5_PARTITIONS); - return len; -} -#endif - -static struct block_device_operations m5_fops = { - open: m5_open, - release: m5_release, - ioctl: m5_ioctl, - /* check_media_change: */ - /* revalidate: */ - owner: THIS_MODULE, -}; - -/* - * int m5_init() - */ -static int __init m5_init(void) -{ - int i; - int result; - - result = -EIO; - - printk("%s (%s %s)\n", version, date, time); -#if M5_SUPPORT_PROBE - if (m5_probe((m5_t *)M5_BASE_ADDR) != SUCCESS) - return result; -#endif /* M5_SUPPORT_PROBE */ - - if (register_blkdev(major, DEVICE_NAME, &m5_fops) ) { - printk("m5: can not not get major %d", major); - return result; - } - - if (devfs_register_blkdev(major, DEVICE_NAME, &m5_fops) ) { - printk("m5: can not not get major %d", major); - goto fail_devfs; - } - devfs_handle = devfs_mk_dir(NULL, "m5", NULL); - devfs_register_series(devfs_handle, "%u", M5_PARTITIONS, - DEVFS_FL_DEFAULT, major, 0, - S_IFBLK | S_IRUSR | S_IWUSR, - &m5_fops, NULL); - - for (i = 0; i < M5_PARTITIONS; i++) { - if (i) { - m5_addr[i] = m5_addr[i-1] + m5_len[i-1]; - } else { - m5_addr[i] = M5_BASE_ADDR; - } - m5_blk_size[i] = m5_len[i]/1024; /* KB order */ - m5_blksize_size[i] = BLOCK_SIZE; /* 1024 byte */ - m5_hardsect_size[i] = BLOCK_SIZE/2; /* 512 byte */ - } - /* defined in ll_rw_blk.c */ - blk_size[major] = m5_blk_size; - blksize_size[major] = m5_blksize_size; - hardsect_size[major] = m5_hardsect_size; - read_ahead[major] = m5_read_ahead; - - blk_init_queue(BLK_DEFAULT_QUEUE(major), &m5_request); - - for (i = 0; i < M5_PARTITIONS; i++) - register_disk( NULL, MKDEV(major,i), 1, - &m5_fops, m5_len[i]>>9 ); - -#ifdef CONFIG_PROC_FS -#if 1 - proc_m5 = proc_mkdir("m5", proc_root_driver); - if (!proc_m5) { - printk(KERN_ERR "m5: unable to register driver/m5\n"); - goto fail_proc; - } - create_proc_read_entry("0", 0, proc_m5, proc_m5_read, 0); - create_proc_read_entry("1", 0, proc_m5, proc_m5_read, 0); - create_proc_read_entry("2", 0, proc_m5, proc_m5_read, 0); -#else - proc_m5 = create_proc_entry("driver/m5", 666, 0); - if (!proc_m5) { - printk(KERN_ERR "m5: unable to register driver/m5\n"); - goto fail_proc; - } - proc_m5->read_proc = proc_m5_read; -#endif -#endif - - printk("m5: Major=%d Partitions=%d\n", major,M5_PARTITIONS); - for (i = 0; i < M5_PARTITIONS; i++) { - printk(" %d: 0x%08x-0x%08x (all=%dKB,blk=%dB,sect=%dB,ahead=%d)\n", - i, m5_addr[i], - m5_addr[i] + m5_len[i], - m5_blk_size[i], - m5_blksize_size[i], - m5_hardsect_size[i], - m5_read_ahead); - } - - /* clear cache */ - M5_MARK_CLEAN(); - M5_MARK_NOCACHED(); - - m5_led_off(); - return 0; - -fail_proc: - devfs_unregister(devfs_handle); -fail_devfs: - unregister_blkdev(major, DEVICE_NAME); - return result; -} - -static int __init m5_init_module(void) -{ - return m5_init(); -} - -static void __exit m5_cleanup_module(void) -{ - int i; - - for (i = 0 ; i < M5_PARTITIONS; i++) { - fsync_dev(MKDEV(major, i)); /* flush buffer */ - destroy_buffers(MKDEV(major, i)); - } - m5_write_blk_cache(); /* flush m5 cache */ - devfs_unregister(devfs_handle); - unregister_blkdev(major, DEVICE_NAME); -#ifdef CONFIG_PROC_FS - remove_proc_entry("0", proc_m5); - remove_proc_entry("1", proc_m5); - remove_proc_entry("2", proc_m5); - remove_proc_entry("m5", proc_root_driver); -#endif - blk_cleanup_queue(BLK_DEFAULT_QUEUE(major)); - blk_size[major] = NULL; - blksize_size[major] = NULL; - hardsect_size[major] = NULL; - read_ahead[major] = 0; -} - -module_init(m5_init_module); -module_exit(m5_cleanup_module); - -MODULE_AUTHOR("Takeo Takahashi"); -MODULE_DESCRIPTION("M5 Flash Driver for M32700UT-CPU"); -MODULE_LICENSE("GPL"); -EXPORT_NO_SYMBOLS; - diff -Nru a/arch/m32r/drivers/m5.h b/arch/m32r/drivers/m5.h --- a/arch/m32r/drivers/m5.h 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,73 +0,0 @@ -/* - * Flash Memory Driver for M32700UT-CPU - * - * Copyright 2003 (C) Takeo Takahashi - * - * 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. - * - * 2003-02-01: Takeo Takahashi, support M5M29GT320VP. - */ - -#include - -#ifdef __KERNEL__ -#undef DEBUG -/* debug routine: - * 0x00000001: print debug information - */ -# define DEBUG(n, args...) if ((n) & debug) \ - printk(KERN_DEBUG args) -#endif /* __KERNEL__ */ - -/* - * data type to access flash memory - */ -typedef volatile unsigned short m5_t; - -/* - * - Page program buffer size in byte - * - block size in byte - * - number of block - */ -#define M5_PAGE_SIZE (256) -#define M5_BLOCK_SIZE8 (8*1024) -#define M5_BLOCK_SIZE64 (64*1024) -#define MAX_BLOCK_NUM 70 - -/* - * Software commands - */ -#define M5_CMD_READ_ARRAY 0xff -#define M5_CMD_DEVICE_IDENT 0x90 -#define M5_CMD_READ_STATUS 0x70 -#define M5_CMD_CLEAR_STATUS 0x50 -#define M5_CMD_BLOCK_ERASE 0x20 -#define M5_CMD_CONFIRM 0xd0 -#define M5_CMD_PROGRAM_BYTE 0x40 -#define M5_CMD_PROGRAM_WORD M5_CMD_PROGRAM_BYTE -#define M5_CMD_PROGRAM_PAGE 0x41 -#define M5_CMD_SINGLE_LOAD_DATA 0x74 -#define M5_CMD_BUFF2FLASH 0x0e -#define M5_CMD_FLASH2BUFF 0xf1 -#define M5_CMD_CLEAR_BUFF 0x55 -#define M5_CMD_SUSPEND 0xb0 -#define M5_CMD_RESUME 0xd0 - -/* - * Status - */ -#define M5_STATUS_READY 0x80 /* 0:busy 1:ready */ -#define M5_STATUS_SUSPEND 0x40 /* 0:progress/complete 1:suspend */ -#define M5_STATUS_ERASE 0x20 /* 0:pass 1:error */ -#define M5_STATUS_PROGRAM 0x10 /* 0:pass 1:error */ -#define M5_STATUS_BLOCK 0x08 /* 0:pass 1:error */ - -/* - * Device Code - */ -#define M5_MAKER (0x1c) -#define M5_M5M29GT320VP (0x20) -#define M5_M5M29GB320VP (0x21) diff -Nru a/arch/m32r/drivers/m5drv.c b/arch/m32r/drivers/m5drv.c --- a/arch/m32r/drivers/m5drv.c 2004-10-06 19:37:46 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,664 +0,0 @@ -/* - * MTD chip driver for M5M29GT320VP - * - * Copyright (C) 2003 Takeo Takahashi - * - * 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. - * - * $Id$ - */ - -#ifndef __KERNEL__ -# define __KERNEL__ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define M5DRV_DEBUG(n, args...) if ((n) & m5drv_debug) printk(KERN_DEBUG args) - -#undef UNLOCK_BEFORE_ERASE - -#define M5DRV_PAGE_SIZE (256) /* page program size */ -#define M5DRV_BLOCK_SIZE8 (8*1024) /* 8K block size in byte */ -#define M5DRV_BLOCK_SIZE64 (64*1024) /* 64K block size in byte */ -#define M5DRV_MAX_BLOCK_NUM 70 /* number of blocks */ -#define M5DRV_ERASE_REGION 2 /* 64KB and 8KB */ - -/* - * Software commands - */ -#define CMD_READ_ARRAY 0xff -#define CMD_DEVICE_IDENT 0x90 -#define CMD_READ_STATUS 0x70 -#define CMD_CLEAR_STATUS 0x50 -#define CMD_BLOCK_ERASE 0x20 -#define CMD_CONFIRM 0xd0 -#define CMD_PROGRAM_BYTE 0x40 -#define CMD_PROGRAM_WORD CMD_PROGRAM_BYTE -#define CMD_PROGRAM_PAGE 0x41 -#define CMD_SINGLE_LOAD_DATA 0x74 -#define CMD_BUFF2FLASH 0x0e -#define CMD_FLASH2BUFF 0xf1 -#define CMD_CLEAR_BUFF 0x55 -#define CMD_SUSPEND 0xb0 -#define CMD_RESUME 0xd0 -#define IDENT_OFFSET 0 /* indent command offset */ - -/* - * Status - */ -#define STATUS_READY 0x80 /* 0:busy 1:ready */ -#define STATUS_SUSPEND 0x40 /* 0:progress/complete 1:suspend */ -#define STATUS_ERASE 0x20 /* 0:pass 1:error */ -#define STATUS_PROGRAM 0x10 /* 0:pass 1:error */ -#define STATUS_BLOCK 0x08 /* 0:pass 1:error */ - -/* - * Device Code - */ -#define MAKER (0x1c) -#define M5M29GT320VP (0x20) -#define M5M29GB320VP (0x21) - -static const char version[] = "M5DRV Flash Driver"; -static const char date[] = __DATE__; -static const char time[] = __TIME__; -static int m5drv_debug = 0; -MODULE_PARM(m5drv_debug, "i"); - -struct m5drv_info { - struct flchip *chip; - int chipshift; - int numchips; - struct flchip chips[1]; - unsigned char buf[M5DRV_BLOCK_SIZE64]; -#define M5BUF (m5drv->buf) -}; - -struct mtd_info *m5drv_probe(struct map_info *map); -static int m5drv_probe_map(struct map_info *map, struct mtd_info *mtd); -static int m5drv_wait(struct map_info *map, struct flchip *chip, loff_t adr); -static void m5drv_release(struct flchip *chip); -static int m5drv_query_blksize(loff_t ofs); -static int m5drv_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); -static int m5drv_read_oneblock(struct map_info *map, loff_t from); -static int m5drv_write(struct mtd_info *mtd, loff_t adr, size_t len, size_t *retlen, const u_char *buf); -static int m5drv_write_oneblock(struct map_info *map, loff_t adr, size_t len, const u_char *buf); -static int m5drv_write_onepage(struct map_info *map, struct flchip *chip, unsigned long adr, const u_char *buf); -static int m5drv_erase(struct mtd_info *mtd, struct erase_info *instr); -static int m5drv_do_wait_for_ready(struct map_info *map, struct flchip *chip, unsigned long adr); -static int m5drv_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr); -static void m5drv_sync(struct mtd_info *mtd); -static int m5drv_suspend(struct mtd_info *mtd); -static void m5drv_resume(struct mtd_info *mtd); -static void m5drv_destroy(struct mtd_info *mtd); -#ifdef UNLOCK_BEFORE_ERASE -static void m5drv_unlock_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr); -#endif - -static struct mtd_chip_driver m5drv_chipdrv = { - probe: m5drv_probe, - destroy: m5drv_destroy, - name: "m5drv", - module: THIS_MODULE -}; - -struct mtd_info *m5drv_probe(struct map_info *map) -{ - struct mtd_info *mtd = NULL; - struct m5drv_info *m5drv = NULL; - int width; - - mtd = kmalloc(sizeof(*mtd), GFP_KERNEL); - if (!mtd) { - printk("m5drv: can not allocate memory for mtd_info\n"); - return NULL; - } - - m5drv = kmalloc(sizeof(*m5drv), GFP_KERNEL); - if (!m5drv) { - printk("m5drv: can not allocate memory for m5drv_info\n"); - kfree(mtd); - return NULL; - } - - memset(mtd, 0, sizeof(*mtd)); - width = m5drv_probe_map(map, mtd); - if (!width) { - printk("m5drv: m5drv_probe_map error (width=%d)\n", width); - kfree(mtd); - kfree(m5drv); - return NULL; - } - mtd->priv = map; - mtd->type = MTD_OTHER; - mtd->erase = m5drv_erase; - mtd->read = m5drv_read; - mtd->write = m5drv_write; - mtd->sync = m5drv_sync; - mtd->suspend = m5drv_suspend; - mtd->resume = m5drv_resume; - mtd->flags = MTD_CAP_NORFLASH; /* ??? */ - mtd->name = map->name; - - memset(m5drv, 0, sizeof(*m5drv)); - m5drv->chipshift = 23; - m5drv->numchips = 1; - m5drv->chips[0].start = 0; - m5drv->chips[0].state = FL_READY; - m5drv->chips[0].mutex = &m5drv->chips[0]._spinlock; - m5drv->chips[0].word_write_time = 0; - init_waitqueue_head(&m5drv->chips[0].wq); - spin_lock_init(&m5drv->chips[0]._spinlock); - - map->fldrv = &m5drv_chipdrv; - map->fldrv_priv = m5drv; - - MOD_INC_USE_COUNT; - return mtd; -} - -static int m5drv_probe_map(struct map_info *map, struct mtd_info *mtd) -{ - u16 tmp; - u16 maker, device; - int width = 2; - struct mtd_erase_region_info *einfo; - - map->write16(map, CMD_READ_ARRAY, IDENT_OFFSET); - tmp = map->read16(map, IDENT_OFFSET); - map->write16(map, CMD_DEVICE_IDENT, IDENT_OFFSET); - maker = map->read16(map, IDENT_OFFSET); - maker &= 0xff; - if (maker == MAKER) { - /* FIXME: check device */ - device = maker >> 8; - printk("m5drv: detected M5M29GT320VP\n"); - einfo = kmalloc(sizeof(*einfo) * M5DRV_ERASE_REGION, GFP_KERNEL); - if (!einfo) { - printk("m5drv: cannot allocate memory for erase_region\n"); - return 0; - } - /* 64KB erase block (blk no# 0-62) */ - einfo[0].offset = 0; - einfo[0].erasesize = 0x8000 * width; - einfo[0].numblocks = (7 + 8 + 24 + 24); - /* 8KB erase block (blk no# 63-70) */ - einfo[1].offset = 0x3f0000; - einfo[1].erasesize = 0x1000 * width; - einfo[1].numblocks = (2 + 8); - mtd->numeraseregions = M5DRV_ERASE_REGION; - mtd->eraseregions = einfo; - mtd->size = 0x200000 * width; /* total 4MB */ - /* - * mtd->erasesize is used in parse_xxx_partitions. - * last erase block has a partition table. - */ - mtd->erasesize = 0x8000 * width; - return width; - } else if (map->read16(map, IDENT_OFFSET) == CMD_DEVICE_IDENT) { - printk("m5drv: looks like RAM\n"); - map->write16(map, tmp, IDENT_OFFSET); - } else { - printk("m5drv: can not detect flash memory (0x%04x)\n", maker); - } - map->write16(map, CMD_READ_ARRAY, IDENT_OFFSET); - return 0; -} - -static int m5drv_query_blksize(loff_t ofs) -{ - int blk; - - blk = ofs >> 16; - if (blk > 0x3f) { - printk("m5drv: out of block address (0x%08x)\n", (u32)ofs); - return M5DRV_BLOCK_SIZE64; - } - if (blk == 63) blk += ((ofs & 0x0000e000) >> 13); - if (blk > M5DRV_MAX_BLOCK_NUM) { - printk("m5drv: out of block address (0x%08x)\n", (u32)ofs); - return M5DRV_BLOCK_SIZE64; - } - return ((blk >= 63)? M5DRV_BLOCK_SIZE8:M5DRV_BLOCK_SIZE64); -} - -static int m5drv_wait(struct map_info *map, struct flchip *chip, loff_t adr) -{ - __u16 status; - unsigned long timeo; - DECLARE_WAITQUEUE(wait, current); - - timeo = jiffies + HZ; - adr &= ~1; /* align 2 */ - -retry: - spin_lock_bh(chip->mutex); - - switch (chip->state) { - case FL_READY: - map->write16(map, CMD_READ_STATUS, adr); - chip->state = FL_STATUS; - case FL_STATUS: - status = map->read16(map, adr); - if ((status & STATUS_READY) != STATUS_READY) { - udelay(100); - } - break; - default: - printk("m5drv: waiting for chip\n"); - if (time_after(jiffies, timeo)) { /* jiffies is after timeo */ - set_current_state(TASK_INTERRUPTIBLE); - add_wait_queue(&chip->wq, &wait); - spin_unlock_bh(chip->mutex); - schedule(); - remove_wait_queue(&chip->wq, &wait); - spin_lock_bh(chip->mutex); // by takeo - if (signal_pending(current)) { - printk("m5drv: canceled\n"); - map->write16(map, CMD_CLEAR_STATUS, adr); - map->write16(map, CMD_READ_ARRAY, adr); - chip->state = FL_READY; - return -EINTR; - } - } - timeo = jiffies + HZ; - goto retry; - } - map->write16(map, CMD_READ_ARRAY, adr); - chip->state = FL_READY; - return 0; -} - -static void m5drv_release(struct flchip *chip) -{ - M5DRV_DEBUG(1, "m5drv_release\n"); - wake_up(&chip->wq); - spin_unlock_bh(chip->mutex); -} - -static int m5drv_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) -{ - struct map_info *map = mtd->priv; - struct m5drv_info *m5drv = map->fldrv_priv; - int chipnum; - int ret; - - *retlen = 0; - - chipnum = (from >> m5drv->chipshift); - if (chipnum >= m5drv->numchips) { - printk("m5drv: out of chip number (%d)\n", chipnum); - return -EIO; - } - - /* We don't support erase suspend */ - ret = m5drv_wait(map, &m5drv->chips[chipnum], from); - if (ret < 0) return ret; - - map->copy_from(map, buf, from, len); - - m5drv_release(&m5drv->chips[chipnum]); - *retlen = len; - return 0; -} - -static int m5drv_read_oneblock(struct map_info *map, loff_t from) -{ - struct m5drv_info *m5drv = map->fldrv_priv; - int ofs; - int ret; - int blksize; - int chipnum; - - M5DRV_DEBUG(1, "m5drv_read_oneblock(0x%08x)\n", (u32)from); - chipnum = (from >> m5drv->chipshift); - blksize = m5drv_query_blksize(from); - ofs = (from & ~(blksize - 1)); - - ret = m5drv_wait(map, &m5drv->chips[chipnum], from); - if (ret < 0) return ret; - - map->copy_from(map, M5BUF, ofs, blksize); - - m5drv_release(&m5drv->chips[chipnum]); - return 0; -} - -static int m5drv_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) -{ - struct map_info *map = mtd->priv; - struct m5drv_info *m5drv = map->fldrv_priv; - int ret = 0; - int blksize; - int chipnum; - int thislen; - - M5DRV_DEBUG(1, "m5drv_write(to=0x%08x, len=%d, buf=0x%08x\n", (u32)to, (u32)len, (u32)buf); - *retlen = 0; - blksize = m5drv_query_blksize(to); - chipnum = (to >> m5drv->chipshift); - - /* - * we does not support byte/word program yet. - */ - for (thislen = len; thislen > 0; thislen -= blksize) { - thislen = ((thislen >= blksize)? blksize:thislen); - ret = m5drv_write_oneblock(map, to, thislen, buf); - if (ret < 0) return ret; - to += blksize; - buf += blksize; - *retlen += thislen; - } - return 0; -} - -static int m5drv_write_oneblock(struct map_info *map, loff_t adr, size_t len, const u_char *buf) -{ - struct m5drv_info *m5drv = map->fldrv_priv; - int ofs; - int blksize; - int ret; - int chipnum; - int i; - - M5DRV_DEBUG(1, "m5drv_write_oneblock(0x%08x, %d)\n", (u32)adr, (u32)len); - chipnum = (adr >> m5drv->chipshift); - ret = m5drv_read_oneblock(map, adr); - if (ret < 0) return ret; - blksize = m5drv_query_blksize(adr); - ofs = (adr & (blksize - 1)); - adr = adr & ~(blksize - 1); - memcpy(M5BUF + ofs, buf, len); /* copy to block buffer */ -#if 0 /* - * FIXME: erasing is unnecessary. - */ - ret = m5drv_erase_oneblock(map, &m5drv->chips[chipnum], adr); - if (ret < 0) return ret; -#endif - for (i = 0; i < len; i += M5DRV_PAGE_SIZE) { - ret = m5drv_write_onepage(map, &m5drv->chips[chipnum], adr, M5BUF+i); - if (ret < 0) return ret; - adr += M5DRV_PAGE_SIZE; - } - return 0; -} - -static int m5drv_write_onepage(struct map_info *map, struct flchip *chip, unsigned long adr, const u_char *buf) -{ - int ret; - int i; - u_short data; - long padr; /* page address */ - u_short status; - int chipnum; - struct m5drv_info *m5drv = map->fldrv_priv; - - M5DRV_DEBUG(1, "m5drv_write_onepage(0x%08x, 0x%08x)\n", (u32)adr, (u32)buf); - padr = adr; - padr &= ~1; /* align 2 */ - chipnum = (adr >> m5drv->chipshift); - - ret = m5drv_wait(map, chip, padr); - if (ret < 0) return ret; - - map->write16(map, CMD_PROGRAM_PAGE, padr); - chip->state = FL_WRITING; - for (i = 0; i < M5DRV_PAGE_SIZE; i += map->buswidth) { - data = ((*buf << 8)| *(buf + 1)); - /* - * FIXME: convert be->le ? - */ - map->write16(map, data, adr); - adr += map->buswidth; - buf += map->buswidth; - } - - ret = m5drv_do_wait_for_ready(map, chip, padr); - if (ret < 0) { - m5drv_release(&m5drv->chips[chipnum]); - return ret; - } - - status = map->read16(map, padr); - if ((status & STATUS_READY) != STATUS_READY) { - printk("m5drv: error page writing at addr=0x%08x status=0x%08x\n", - (u32)padr, (u32)status); - map->write16(map, CMD_CLEAR_STATUS, padr); - } - map->write16(map, CMD_READ_ARRAY, padr); - chip->state = FL_READY; - m5drv_release(&m5drv->chips[chipnum]); - return 0; -} - -static int m5drv_erase(struct mtd_info *mtd, struct erase_info *instr) -{ - struct map_info *map = mtd->priv; - struct m5drv_info *m5drv = map->fldrv_priv; - unsigned long adr,len; - int chipnum, ret=0; - int erasesize = 0; - int i; - - M5DRV_DEBUG(2, "m5drv_erase(0x%08x)\n", instr->addr); - chipnum = instr->addr >> m5drv->chipshift; - if (chipnum >= m5drv->numchips) { - printk("m5drv: out of chip number (%d)\n", chipnum); - return -EIO; - } - adr = instr->addr & ((1<chipshift)-1); - len = instr->len; - if (mtd->numeraseregions == 0) { - erasesize = mtd->erasesize; - } else if (mtd->numeraseregions == 1) { - erasesize = mtd->eraseregions->erasesize; - } else { - for (i = 0; i < (mtd->numeraseregions - 1); i++) { - if (adr < mtd->eraseregions[i+1].offset) { - erasesize = mtd->eraseregions[i].erasesize; - break; - } - } - if (i == (mtd->numeraseregions - 1)) { /* last region */ - erasesize = mtd->eraseregions[i].erasesize; - } - } - M5DRV_DEBUG(2, "erasesize=%d, len=%ld\n", erasesize, len); - if (erasesize == 0) return -EINVAL; - if(instr->addr & (erasesize - 1)) - return -EINVAL; - if(instr->len & (erasesize - 1)) - return -EINVAL; - if(instr->len + instr->addr > mtd->size) - return -EINVAL; - - while (len) { - ret = m5drv_erase_oneblock(map, &m5drv->chips[chipnum], adr); - if (ret < 0) return ret; - - adr += erasesize; - len -= erasesize; - if(adr >> m5drv->chipshift){ - adr = 0; - chipnum++; - if(chipnum >= m5drv->numchips) - break; - } - } - instr->state = MTD_ERASE_DONE; - if(instr->callback) { - M5DRV_DEBUG(1, "m5drv: call callback\n"); - instr->callback(instr); - } - return 0; -} - -static int m5drv_do_wait_for_ready(struct map_info *map, struct flchip *chip, unsigned long adr) -{ - int ret; - int timeo; - u_short status; - DECLARE_WAITQUEUE(wait, current); - - /* unnecessary CMD_READ_STATUS */ -/* - map->write16(map, CMD_READ_STATUS, adr); - status = map->read16(map, adr); -*/ - - timeo = jiffies + HZ; - - while (time_before(jiffies, timeo)) { -/* - map->write16(map, CMD_READ_STATUS, adr); -*/ - status = map->read16(map, adr); - if ((status & STATUS_READY) == STATUS_READY) { - M5DRV_DEBUG(1, "m5drv_wait_for_ready: ok, ready\n"); - /* - * FIXME: do full status check - */ - ret = 0; - goto out; - } - set_current_state(TASK_INTERRUPTIBLE); - add_wait_queue(&chip->wq, &wait); - - // enabled by takeo - spin_unlock_bh(chip->mutex); - - schedule_timeout(1); - schedule(); - remove_wait_queue(&chip->wq, &wait); - - // enabled by takeo - spin_lock_bh(chip->mutex); - - if (signal_pending(current)) { - ret = -EINTR; - goto out; - } - //timeo = jiffies + HZ; - } - ret = -ETIME; -out: - if (ret < 0) { - map->write16(map, CMD_CLEAR_STATUS, adr); - map->write16(map, CMD_READ_ARRAY, adr); - chip->state = FL_READY; - } - return ret; -} - -static int m5drv_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr) -{ - int ret; - u_short status; - struct m5drv_info *m5drv = map->fldrv_priv; - int chipnum; - - M5DRV_DEBUG(1, "m5drv_erase_oneblock()\n"); - -#ifdef UNLOCK_BEFORE_ERASE - m5drv_unlock_oneblock(map, chip, adr); -#endif - - chipnum = (adr >> m5drv->chipshift); - adr &= ~1; /* align 2 */ - - ret = m5drv_wait(map, chip, adr); - if (ret < 0) return ret; - - map->write16(map, CMD_BLOCK_ERASE, adr); - map->write16(map, CMD_CONFIRM, adr); - chip->state = FL_ERASING; - - ret = m5drv_do_wait_for_ready(map, chip, adr); - if(ret < 0) { - m5drv_release(&m5drv->chips[chipnum]); - return ret; - } - - status = map->read16(map, adr); - if ((status & STATUS_READY) == STATUS_READY) { - M5DRV_DEBUG(1, "m5drv: erase completed status=%04x\n", status); - map->write16(map, CMD_READ_ARRAY, adr); - chip->state = FL_READY; - m5drv_release(&m5drv->chips[chipnum]); - return 0; /* ok, erasing completed */ - } - - printk("m5drv: error erasing block at addr=%08lx status=%08x\n", - adr,status); - map->write16(map, CMD_READ_ARRAY, adr); /* cancel erasing */ - chip->state = FL_READY; - m5drv_release(&m5drv->chips[chipnum]); - return -EIO; -} - - -#ifdef UNLOCK_BEFORE_ERASE -/* - * we don't support unlock yet - */ -static void m5drv_unlock_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr) -{ - M5DRV_DEBUG(1, "m5drv_unlock_oneblock\n"); -} -#endif - -static void m5drv_sync(struct mtd_info *mtd) -{ - M5DRV_DEBUG(1, "m5drv_sync()\n"); -} - -static int m5drv_suspend(struct mtd_info *mtd) -{ - M5DRV_DEBUG(1, "m5drv_suspend()\n"); - return -EINVAL; -} - -static void m5drv_resume(struct mtd_info *mtd) -{ - M5DRV_DEBUG(1, "m5drv_resume()\n"); -} - -static void m5drv_destroy(struct mtd_info *mtd) -{ - M5DRV_DEBUG(1, "m5drv_destroy()\n"); -} - -int __init m5drv_probe_init(void) -{ - printk("MTD chip driver\n"); - register_mtd_chip_driver(&m5drv_chipdrv); - return 0; -} - -static void __exit m5drv_probe_exit(void) -{ - M5DRV_DEBUG(1, "m5drv_probe_exit()\n"); - unregister_mtd_chip_driver(&m5drv_chipdrv); -} - -module_init(m5drv_probe_init); -module_exit(m5drv_probe_exit); - -MODULE_AUTHOR("Takeo Takahashi"); -MODULE_DESCRIPTION("MTD chip driver for M5M29GT320VP"); -MODULE_LICENSE("GPL"); -EXPORT_NO_SYMBOLS; diff -Nru a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S --- a/arch/m32r/kernel/entry.S 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/entry.S 2004-10-06 19:37:47 -07:00 @@ -992,6 +992,16 @@ .long sys_mq_notify .long sys_mq_getsetattr .long sys_ni_syscall /* reserved for kexec */ + .long sys_waitid + .long sys_perfctr_info + .long sys_vperfctr_open + .long sys_vperfctr_control + .long sys_vperfctr_unlink + .long sys_vperfctr_iresume + .long sys_vperfctr_read /* 290 */ + .long sys_add_key + .long sys_request_key + .long sys_keyctl syscall_table_size=(.-sys_call_table) diff -Nru a/arch/m32r/kernel/io_m32102.c b/arch/m32r/kernel/io_m32102.c --- a/arch/m32r/kernel/io_m32102.c 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,277 +0,0 @@ -/* - * Mitsubishi M32R 32102 group - * Typical I/O routines. - * - * Copyright (c) 2001 Hitoshi Yamamoto - */ - -/* $Id$ */ - -#include -#include - -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) -#include - -#define M32R_PCC_IOMAP_SIZE 0x1000 - -#define M32R_PCC_IOSTART0 0x1000 -#define M32R_PCC_IOEND0 (M32R_PCC_IOSTART0 + M32R_PCC_IOMAP_SIZE - 1) -#define M32R_PCC_IOSTART1 0x2000 -#define M32R_PCC_IOEND1 (M32R_PCC_IOSTART1 + M32R_PCC_IOMAP_SIZE - 1) - -extern void pcc_ioread(int, unsigned long, void *, size_t, size_t, int); -extern void pcc_iowrite(int, unsigned long, void *, size_t, size_t, int); -#endif /* CONFIG_PCMCIA && CONFIG_M32RPCC */ - - -/* - * Function prototypes - */ -unsigned char ne_inb(unsigned long); -void ne_outb(unsigned char, unsigned long); -void ne_insb(unsigned int, void *, unsigned long); -void ne_insw(unsigned int, void *, unsigned long); -void ne_outsb(unsigned int, const void *, unsigned long); -void ne_outsw(unsigned int, const void *, unsigned long); - -#define PORT2ADDR(port) m32102_port2addr(port) - -static __inline__ unsigned long -m32102_port2addr(unsigned long port) -{ - unsigned long ul; - ul = port + PAGE_OFFSET + 0x20000000; - return (ul); -} - -unsigned char -m32102_inb(unsigned long port) -{ -#ifdef CONFIG_PLAT_MAPPI - if(port >= 0x300 && port < 0x320) - return ne_inb(port); - else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned char b; - pcc_ioread(0, port, &b, sizeof(b), 1, 0); - return b; - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned char b; - pcc_ioread(1, port, &b, sizeof(b), 1, 0); - return b; - } else -#endif -#endif /* CONFIG_PLAT_MAPPI */ - return *(unsigned char *)PORT2ADDR(port); -} - -unsigned short -m32102_inw(unsigned long port) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned short w; - pcc_ioread(0, port, &w, sizeof(w), 1, 0); - return w; - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned short w; - pcc_ioread(1, port, &w, sizeof(w), 1, 0); - return w; - } else -#endif - return *(unsigned short *)PORT2ADDR(port); -} - -unsigned long -m32102_inl(unsigned long port) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - unsigned long l; - pcc_ioread(0, port, &l, sizeof(l), 1, 0); - return l; - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - unsigned short l; - pcc_ioread(1, port, &l, sizeof(l), 1, 0); - return l; - } else -#endif - return *(unsigned long *)PORT2ADDR(port); -} - -void -m32102_outb(unsigned char b, unsigned long port) -{ -#ifdef CONFIG_PLAT_MAPPI - if(port >= 0x300 && port < 0x320) - ne_outb(b,port); - else -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &b, sizeof(b), 1, 0); - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &b, sizeof(b), 1, 0); - } else -#endif -#endif /* CONFIG_PLAT_MAPPI */ - *(unsigned volatile char *)PORT2ADDR(port) = b; -} - -void -m32102_outw(unsigned short w, unsigned long port) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &w, sizeof(w), 1, 0); - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &w, sizeof(w), 1, 0); - } else -#endif -*(unsigned volatile short *)PORT2ADDR(port) = w; -} - -void -m32102_outl(unsigned long l, unsigned long port) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, &l, sizeof(l), 1, 0); - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, &l, sizeof(l), 1, 0); - } else -#endif - *(unsigned volatile long *)PORT2ADDR(port) = l; -} - -void -m32102_insb(unsigned int port, void * addr, unsigned long count) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread(0, port, (void *)addr, sizeof(unsigned char), count, 1); - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_ioread(1, port, (void *)addr, sizeof(unsigned char), count, 1); - } else -#endif - while(count--){ - *(unsigned char *)addr = *(unsigned volatile char *)PORT2ADDR(port); - addr+=1; - } -} - -void -m32102_insw(unsigned int port, void * addr, unsigned long count) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_ioread(0, port, (void *)addr, sizeof(unsigned short), count, 1); - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_ioread(1, port, (void *)addr, sizeof(unsigned short), count, 1); - } else -#endif -while(count--){ - *(unsigned short *)addr = *(unsigned volatile short *)PORT2ADDR(port); - addr+=2; - } -} - -void -m32102_outsb(unsigned int port, const void * addr, unsigned long count) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, (void *)addr, sizeof(unsigned char), count, 1); - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, (void *)addr, sizeof(unsigned char), count, 1); - } else -#endif -while(count--){ - *(unsigned volatile char *)PORT2ADDR(port) = *(unsigned char *)addr; - addr+=1; - } -} -void -m32102_outsw(unsigned int port, const void * addr, unsigned long count) -{ -#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32RPCC) - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { - pcc_iowrite(0, port, (void *)addr, sizeof(unsigned short), count, 1); - } else if (port >= M32R_PCC_IOSTART1 && port <= M32R_PCC_IOEND1) { - pcc_iowrite(1, port, (void *)addr, sizeof(unsigned short), count, 1); - } else -#endif -while(count--){ - *(unsigned volatile short *)PORT2ADDR(port) = *(unsigned short *)addr; - addr+=2; - } -} - -#ifdef CONFIG_PLAT_MAPPI -unsigned char -ne_inb(unsigned long port) -{ - unsigned short tmp; - port <<= 1; - port+= PAGE_OFFSET + 0x20000000 + 0x0c000000; - tmp = *(unsigned short *)port; - return (unsigned char)tmp; -} -void -ne_outb(unsigned char b, unsigned long port) -{ - port <<= 1; - port += PAGE_OFFSET + 0x20000000 + 0x0c000000; - *(unsigned volatile short *)port = (unsigned short)b; -} -void -ne_insb(unsigned int port, void * addr, unsigned long count) -{ - - unsigned short tmp; - port <<= 1; - port+= PAGE_OFFSET + 0x20000000 + 0x0c000000; - tmp = *(unsigned short *)port; - while(count--){ - *(unsigned char *)addr = *(unsigned volatile char *)port; - addr+=1; - } -} - -void -ne_insw(unsigned int port, void * addr, unsigned long count) { - unsigned short tmp; - port <<= 1; - port+= PAGE_OFFSET + 0x20000000 + 0x0c000000; - while(count--){ - tmp = *(unsigned volatile short *)port; - *(unsigned short *)addr = (tmp>>8) | (tmp <<8); - addr+=2; - } -} - -void -ne_outsb(unsigned int port, const void * addr, unsigned long count) -{ - port <<= 1; - port += PAGE_OFFSET + 0x20000000 + 0x0c000000; - while(count--){ - *(unsigned volatile short *)port = *(unsigned char *)addr; - addr+=1; - } -} -void -ne_outsw(unsigned int port, const void * addr, unsigned long count) -{ - unsigned short tmp; - port <<= 1; - port += PAGE_OFFSET + 0x20000000 + 0x0c000000; - while(count--){ - tmp = *(unsigned short *)addr; - *(unsigned volatile short *)port = (tmp>>8)|(tmp<<8); - addr+=2; - } -} - -#endif /* CONFIG_PLAT_MAPPI */ diff -Nru a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c --- a/arch/m32r/kernel/irq.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/irq.c 2004-10-06 19:37:47 -07:00 @@ -187,15 +187,17 @@ struct pt_regs *regs, struct irqaction *action) { int status = 1; /* Force the "do bottom halves" bit */ - int retval = 0; + int ret, retval = 0; if (!(action->flags & SA_INTERRUPT)) local_irq_enable(); do { - status |= action->flags; - retval |= action->handler(irq, action->dev_id, regs); + ret = action->handler(irq, action->dev_id, regs); + if (ret == IRQ_HANDLED) + status |= action->flags; action = action->next; + retval |= ret; } while (action); if (status & SA_SAMPLE_RANDOM) add_interrupt_randomness(irq); diff -Nru a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c --- a/arch/m32r/kernel/setup.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/setup.c 2004-10-06 19:37:47 -07:00 @@ -1,7 +1,7 @@ /* * linux/arch/m32r/kernel/setup.c * - * Setup routines for MITSUBISHI M32R + * Setup routines for Renesas M32R * * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, * Hitoshi Yamamoto diff -Nru a/arch/m32r/kernel/setup_m32700ut.c b/arch/m32r/kernel/setup_m32700ut.c --- a/arch/m32r/kernel/setup_m32700ut.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/setup_m32700ut.c 2004-10-06 19:37:47 -07:00 @@ -1,7 +1,7 @@ /* * linux/arch/m32r/kernel/setup_m32700ut.c * - * Setup routines for MITSUBISHI M32700UT Board + * Setup routines for Renesas M32700UT Board * * Copyright (c) 2002 Hiroyuki Kondo, Hirokazu Takata, * Hitoshi Yamamoto, Takeo Takahashi @@ -9,8 +9,6 @@ * 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. - * - * $Id: setup_m32700ut.c,v 1.6 2003/11/27 10:18:49 takeo Exp $ */ #include diff -Nru a/arch/m32r/kernel/setup_mappi.c b/arch/m32r/kernel/setup_mappi.c --- a/arch/m32r/kernel/setup_mappi.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/setup_mappi.c 2004-10-06 19:37:47 -07:00 @@ -1,15 +1,11 @@ /* * linux/arch/m32r/kernel/setup_mappi.c * - * Setup routines for MITSUBISHI MAPPI Board + * Setup routines for Renesas MAPPI Board * * Copyright (c) 2001, 2002 Hiroyuki Kondo, Hirokazu Takata, * Hitoshi Yamamoto */ - -static char *rcsid = -"$Id$"; -static void use_rcsid(void) {rcsid = rcsid; use_rcsid();} #include #include diff -Nru a/arch/m32r/kernel/setup_mappi2.c b/arch/m32r/kernel/setup_mappi2.c --- a/arch/m32r/kernel/setup_mappi2.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/setup_mappi2.c 2004-10-06 19:37:47 -07:00 @@ -7,10 +7,6 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ -static char *rcsid = -"$Id$"; -static void use_rcsid(void) {rcsid = rcsid; use_rcsid();} - #include #include #include diff -Nru a/arch/m32r/kernel/setup_oaks32r.c b/arch/m32r/kernel/setup_oaks32r.c --- a/arch/m32r/kernel/setup_oaks32r.c 2004-10-06 19:37:48 -07:00 +++ b/arch/m32r/kernel/setup_oaks32r.c 2004-10-06 19:37:48 -07:00 @@ -7,10 +7,6 @@ * Hitoshi Yamamoto, Mamoru Sakugawa */ -static char *rcsid = -"$Id: setup_oaks32r.c,v 1.1 2004/03/31 05:06:18 sakugawa Exp $"; -static void use_rcsid(void) {rcsid = rcsid; use_rcsid();} - #include #include #include diff -Nru a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c --- a/arch/m32r/kernel/setup_opsput.c 2004-10-06 19:37:46 -07:00 +++ b/arch/m32r/kernel/setup_opsput.c 2004-10-06 19:37:46 -07:00 @@ -10,8 +10,6 @@ * 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. - * - * $Id: setup_opsput.c,v 1.1 2004/07/27 06:54:20 sakugawa Exp $ */ #include diff -Nru a/arch/m32r/kernel/setup_usrv.c b/arch/m32r/kernel/setup_usrv.c --- a/arch/m32r/kernel/setup_usrv.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/setup_usrv.c 2004-10-06 19:37:47 -07:00 @@ -7,10 +7,6 @@ * Hitoshi Yamamoto */ -static char *rcsid = -"$Id$"; -static void use_rcsid(void) {rcsid = rcsid; use_rcsid();} - #include #include #include diff -Nru a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c --- a/arch/m32r/kernel/signal.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/signal.c 2004-10-06 19:37:47 -07:00 @@ -404,9 +404,7 @@ return; give_sigsegv: - if (sig == SIGSEGV) - ka->sa.sa_handler = SIG_DFL; - force_sig(SIGSEGV, current); + force_sigsegv(sig, current); } static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, @@ -482,9 +480,7 @@ return; give_sigsegv: - if (sig == SIGSEGV) - ka->sa.sa_handler = SIG_DFL; - force_sig(SIGSEGV, current); + force_sigsegv(sig, current); } /* @@ -527,9 +523,6 @@ setup_rt_frame(sig, ka, info, oldset, regs); else setup_frame(sig, ka, oldset, regs); - - if (ka->sa.sa_flags & SA_ONESHOT) - ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sighand->siglock); diff -Nru a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c --- a/arch/m32r/kernel/smp.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/kernel/smp.c 2004-10-06 19:37:47 -07:00 @@ -441,9 +441,10 @@ */ send_IPI_mask(cpumask, INVALIDATE_TLB_IPI, 0); - while (!cpus_empty(flush_cpumask)) + while (!cpus_empty(flush_cpumask)) { /* nothing. lockup detection does not belong here */ mb(); + } flush_mm = NULL; flush_vma = NULL; diff -Nru a/arch/m32r/m32700ut/m32r-flash.c b/arch/m32r/m32700ut/m32r-flash.c --- a/arch/m32r/m32700ut/m32r-flash.c 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,227 +0,0 @@ -/* - * Flash memory access on M32R based devices - * - * Copyright (C) 2003 Takeo Takahashi - * - * 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. - * - * $Id$ - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#define WINDOW_ADDR (0xa0000000) /* start of flash memory */ - -static __u8 m32r_read8(struct map_info *map, unsigned long ofs) -{ - return readb(map->map_priv_1 + ofs); -} - -static __u16 m32r_read16(struct map_info *map, unsigned long ofs) -{ - return readw(map->map_priv_1 + ofs); -} - -static __u32 m32r_read32(struct map_info *map, unsigned long ofs) -{ - return readl(map->map_priv_1 + ofs); -} - -static void m32r_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) -{ - memcpy(to, (void *)(map->map_priv_1 + from), len); -} - -static void m32r_write8(struct map_info *map, __u8 d, unsigned long adr) -{ - writeb(d, map->map_priv_1 + adr); -} - -static void m32r_write16(struct map_info *map, __u16 d, unsigned long adr) -{ - writew(d, map->map_priv_1 + adr); -} - -static void m32r_write32(struct map_info *map, __u32 d, unsigned long adr) -{ - writel(d, map->map_priv_1 + adr); -} - -static void m32r_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) -{ - memcpy((void *)(map->map_priv_1 + to), from, len); -} - -static struct map_info m32r_map = { - name: "M32R flash", - read8: m32r_read8, - read16: m32r_read16, - read32: m32r_read32, - copy_from: m32r_copy_from, - write8: m32r_write8, - write16: m32r_write16, - write32: m32r_write32, - copy_to: m32r_copy_to, - - map_priv_1: WINDOW_ADDR, - map_priv_2: -1, -}; - -#ifdef CONFIG_PLAT_M32700UT -#define M32700UT_FLASH_SIZE 0x00400000 -static struct mtd_partition m32700ut_partitions[] = { - { - name: "M32700UT boot firmware", - size: 0x30000, /* 192KB */ - offset: 0, - mask_flags: MTD_WRITEABLE, /* force read-only */ - }, { - name: "M32700UT kernel", - size: 0xd0000, /* 832KB */ - offset: MTDPART_OFS_APPEND, - }, { - name: "M32700UT root", - size: 0x2f0000, /* 3008KB */ - offset: MTDPART_OFS_APPEND, - }, { - name: "M32700UT params", - size: MTDPART_SIZ_FULL, /* 64KB */ - offset: MTDPART_OFS_APPEND, - } -}; -#endif - -extern int parse_redboot_partitions(struct mtd_info *master, struct mtd_partition **pparts); -extern int parse_bootldr_partitions(struct mtd_info *master, struct mtd_partition **pparts); - -static struct mtd_partition *parsed_parts; -static struct mtd_info *mymtd; - -int __init m32r_mtd_init(void) -{ - struct mtd_partition *parts; - int nb_parts = 0, ret; - int parsed_nr_parts = 0; - const char *part_type; - unsigned long base = -1UL; - - - /* Default flash buswidth */ - m32r_map.buswidth = 2; - - /* - * Static partition definition selection - */ - part_type = "static"; - -#ifdef CONFIG_PLAT_M32700UT - parts = m32700ut_partitions; - nb_parts = ARRAY_SIZE(m32700ut_partitions); - m32r_map.size = M32700UT_FLASH_SIZE; - m32r_map.buswidth = 2; -#endif - - /* - * For simple flash devices, use ioremap to map the flash. - */ - if (base != (unsigned long)-1) { - if (!request_mem_region(base, m32r_map.size, "flash")) - return -EBUSY; - m32r_map.map_priv_2 = base; - m32r_map.map_priv_1 = (unsigned long) - ioremap(base, m32r_map.size); - ret = -ENOMEM; - if (!m32r_map.map_priv_1) - goto out_err; - } - - /* - * Now let's probe for the actual flash. Do it here since - * specific machine settings might have been set above. - */ - printk(KERN_NOTICE "M32R flash: probing %d-bit flash bus\n", m32r_map.buswidth*8); - mymtd = do_map_probe("m5drv", &m32r_map); - ret = -ENXIO; - if (!mymtd) - goto out_err; - mymtd->module = THIS_MODULE; - - /* - * Dynamic partition selection stuff (might override the static ones) - */ -#ifdef CONFIG_MTD_REDBOOT_PARTS - if (parsed_nr_parts == 0) { - ret = parse_redboot_partitions(mymtd, &parsed_parts); - - if (ret > 0) { - part_type = "RedBoot"; - parsed_nr_parts = ret; - } - } -#endif -#ifdef CONFIG_MTD_BOOTLDR_PARTS - if (parsed_nr_parts == 0) { - ret = parse_bootldr_partitions(mymtd, &parsed_parts); - if (ret > 0) { - part_type = "Compaq bootldr"; - parsed_nr_parts = ret; - } - } -#endif - - if (parsed_nr_parts > 0) { - parts = parsed_parts; - nb_parts = parsed_nr_parts; - } - - if (nb_parts == 0) { - printk(KERN_NOTICE "M32R flash: no partition info available, registering whole flash at once\n"); - add_mtd_device(mymtd); - } else { - printk(KERN_NOTICE "Using %s partition definition\n", part_type); - add_mtd_partitions(mymtd, parts, nb_parts); - } - return 0; - - out_err: - if (m32r_map.map_priv_2 != -1) { - iounmap((void *)m32r_map.map_priv_1); - release_mem_region(m32r_map.map_priv_2, m32r_map.size); - } - return ret; -} - -static void __exit m32r_mtd_cleanup(void) -{ - if (mymtd) { - del_mtd_partitions(mymtd); - map_destroy(mymtd); - if (parsed_parts) - kfree(parsed_parts); - } - if (m32r_map.map_priv_2 != -1) { - iounmap((void *)m32r_map.map_priv_1); - release_mem_region(m32r_map.map_priv_2, m32r_map.size); - } -} - -module_init(m32r_mtd_init); -module_exit(m32r_mtd_cleanup); - -MODULE_AUTHOR("Takeo Takahashi"); -MODULE_DESCRIPTION("M32R Flash map driver"); -MODULE_LICENSE("GPL"); diff -Nru a/arch/m32r/mm/ioremap-nommu.c b/arch/m32r/mm/ioremap-nommu.c --- a/arch/m32r/mm/ioremap-nommu.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/mm/ioremap-nommu.c 2004-10-06 19:37:47 -07:00 @@ -1,5 +1,5 @@ /* - * linux/arch/m32r/mm/io_remap.c + * linux/arch/m32r/mm/ioremap-nommu.c * * Copyright (c) 2001, 2002 Hiroyuki Kondo * @@ -38,14 +38,15 @@ #define IS_LOW512(addr) (!((unsigned long)(addr) & ~0x1fffffffUL)) -void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) +void __iomem * +__ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { return (void *)phys_addr; } #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) -void iounmap(void *addr) +void iounmap(volatile void __iomem *addr) { } diff -Nru a/arch/m32r/mm/ioremap.c b/arch/m32r/mm/ioremap.c --- a/arch/m32r/mm/ioremap.c 2004-10-06 19:37:47 -07:00 +++ b/arch/m32r/mm/ioremap.c 2004-10-06 19:37:47 -07:00 @@ -1,5 +1,5 @@ /* - * linux/arch/m32r/mm/io_remap.c + * linux/arch/m32r/mm/ioremap.c * * Copyright (c) 2001, 2002 Hiroyuki Kondo * @@ -25,8 +25,9 @@ #include #include -static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, - unsigned long phys_addr, unsigned long flags) +static inline void +remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, + unsigned long phys_addr, unsigned long flags) { unsigned long end; unsigned long pfn; @@ -52,8 +53,9 @@ } while (address && (address < end)); } -static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, - unsigned long phys_addr, unsigned long flags) +static inline int +remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, + unsigned long phys_addr, unsigned long flags) { unsigned long end; @@ -75,8 +77,9 @@ return 0; } -static int remap_area_pages(unsigned long address, unsigned long phys_addr, - unsigned long size, unsigned long flags) +static int +remap_area_pages(unsigned long address, unsigned long phys_addr, + unsigned long size, unsigned long flags) { int error; pgd_t * dir; @@ -122,7 +125,8 @@ #define IS_LOW512(addr) (!((unsigned long)(addr) & ~0x1fffffffUL)) -void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) +void __iomem * +__ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { void __iomem * addr; struct vm_struct * area; @@ -180,7 +184,7 @@ #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) -void iounmap(void *addr) +void iounmap(volatile void __iomem *addr) { if (!IS_KSEG1(addr)) vfree((void *) (PAGE_MASK & (unsigned long) addr)); diff -Nru a/arch/m68k/Makefile b/arch/m68k/Makefile --- a/arch/m68k/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/m68k/Makefile 2004-10-06 19:37:47 -07:00 @@ -28,7 +28,7 @@ LDFLAGS_vmlinux = -N endif -CHECKFLAGS += -D__mc68000__=1 -I$(shell $(CC) -print-file-name=include) +CHECKFLAGS += -D__mc68000__ -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/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c --- a/arch/mips/vr41xx/common/icu.c 2004-10-06 19:37:46 -07:00 +++ b/arch/mips/vr41xx/common/icu.c 2004-10-06 19:37:46 -07:00 @@ -165,217 +165,267 @@ { irq_desc_t *desc = irq_desc + PIU_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MPIUINTREG); - val |= mask; - write_icu1(val, MPIUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4111 || + current_cpu_data.cputype == CPU_VR4121) { + spin_lock_irqsave(&desc->lock, flags); + set_icu1(MPIUINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_enable_piuint); + void vr41xx_disable_piuint(uint16_t mask) { irq_desc_t *desc = irq_desc + PIU_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MPIUINTREG); - val &= ~mask; - write_icu1(val, MPIUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4111 || + current_cpu_data.cputype == CPU_VR4121) { + spin_lock_irqsave(&desc->lock, flags); + clear_icu1(MPIUINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_disable_piuint); + void vr41xx_enable_aiuint(uint16_t mask) { irq_desc_t *desc = irq_desc + AIU_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MAIUINTREG); - val |= mask; - write_icu1(val, MAIUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4111 || + current_cpu_data.cputype == CPU_VR4121) { + spin_lock_irqsave(&desc->lock, flags); + set_icu1(MAIUINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_enable_aiuint); + void vr41xx_disable_aiuint(uint16_t mask) { irq_desc_t *desc = irq_desc + AIU_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MAIUINTREG); - val &= ~mask; - write_icu1(val, MAIUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4111 || + current_cpu_data.cputype == CPU_VR4121) { + spin_lock_irqsave(&desc->lock, flags); + clear_icu1(MAIUINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_disable_aiuint); + void vr41xx_enable_kiuint(uint16_t mask) { irq_desc_t *desc = irq_desc + KIU_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MKIUINTREG); - val |= mask; - write_icu1(val, MKIUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4111 || + current_cpu_data.cputype == CPU_VR4121) { + spin_lock_irqsave(&desc->lock, flags); + set_icu1(MKIUINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_enable_kiuint); + void vr41xx_disable_kiuint(uint16_t mask) { irq_desc_t *desc = irq_desc + KIU_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MKIUINTREG); - val &= ~mask; - write_icu1(val, MKIUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4111 || + current_cpu_data.cputype == CPU_VR4121) { + spin_lock_irqsave(&desc->lock, flags); + clear_icu1(MKIUINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_disable_kiuint); + void vr41xx_enable_dsiuint(uint16_t mask) { irq_desc_t *desc = irq_desc + DSIU_IRQ; unsigned long flags; - uint16_t val; spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MDSIUINTREG); - val |= mask; - write_icu1(val, MDSIUINTREG); + set_icu1(MDSIUINTREG, mask); spin_unlock_irqrestore(&desc->lock, flags); } +EXPORT_SYMBOL(vr41xx_enable_dsiuint); + void vr41xx_disable_dsiuint(uint16_t mask) { irq_desc_t *desc = irq_desc + DSIU_IRQ; unsigned long flags; - uint16_t val; spin_lock_irqsave(&desc->lock, flags); - val = read_icu1(MDSIUINTREG); - val &= ~mask; - write_icu1(val, MDSIUINTREG); + clear_icu1(MDSIUINTREG, mask); spin_unlock_irqrestore(&desc->lock, flags); } +EXPORT_SYMBOL(vr41xx_disable_dsiuint); + void vr41xx_enable_firint(uint16_t mask) { irq_desc_t *desc = irq_desc + FIR_IRQ; unsigned long flags; - uint16_t val; spin_lock_irqsave(&desc->lock, flags); - val = read_icu2(MFIRINTREG); - val |= mask; - write_icu2(val, MFIRINTREG); + set_icu2(MFIRINTREG, mask); spin_unlock_irqrestore(&desc->lock, flags); } +EXPORT_SYMBOL(vr41xx_enable_firint); + void vr41xx_disable_firint(uint16_t mask) { irq_desc_t *desc = irq_desc + FIR_IRQ; unsigned long flags; - uint16_t val; spin_lock_irqsave(&desc->lock, flags); - val = read_icu2(MFIRINTREG); - val &= ~mask; - write_icu2(val, MFIRINTREG); + clear_icu2(MFIRINTREG, mask); spin_unlock_irqrestore(&desc->lock, flags); } +EXPORT_SYMBOL(vr41xx_disable_firint); + void vr41xx_enable_pciint(void) { irq_desc_t *desc = irq_desc + PCI_IRQ; unsigned long flags; - spin_lock_irqsave(&desc->lock, flags); - write_icu2(PCIINT0, MPCIINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + write_icu2(PCIINT0, MPCIINTREG); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_enable_pciint); + void vr41xx_disable_pciint(void) { irq_desc_t *desc = irq_desc + PCI_IRQ; unsigned long flags; - spin_lock_irqsave(&desc->lock, flags); - write_icu2(0, MPCIINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + write_icu2(0, MPCIINTREG); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_disable_pciint); + void vr41xx_enable_scuint(void) { irq_desc_t *desc = irq_desc + SCU_IRQ; unsigned long flags; - spin_lock_irqsave(&desc->lock, flags); - write_icu2(SCUINT0, MSCUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + write_icu2(SCUINT0, MSCUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_enable_scuint); + void vr41xx_disable_scuint(void) { irq_desc_t *desc = irq_desc + SCU_IRQ; unsigned long flags; - spin_lock_irqsave(&desc->lock, flags); - write_icu2(0, MSCUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + write_icu2(0, MSCUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_disable_scuint); + void vr41xx_enable_csiint(uint16_t mask) { irq_desc_t *desc = irq_desc + CSI_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu2(MCSIINTREG); - val |= mask; - write_icu2(val, MCSIINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + set_icu2(MCSIINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_enable_csiint); + void vr41xx_disable_csiint(uint16_t mask) { irq_desc_t *desc = irq_desc + CSI_IRQ; unsigned long flags; - uint16_t val; - spin_lock_irqsave(&desc->lock, flags); - val = read_icu2(MCSIINTREG); - val &= ~mask; - write_icu2(val, MCSIINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + clear_icu2(MCSIINTREG, mask); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_disable_csiint); + void vr41xx_enable_bcuint(void) { irq_desc_t *desc = irq_desc + BCU_IRQ; unsigned long flags; - spin_lock_irqsave(&desc->lock, flags); - write_icu2(BCUINTR, MBCUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + write_icu2(BCUINTR, MBCUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); + } } +EXPORT_SYMBOL(vr41xx_enable_bcuint); + void vr41xx_disable_bcuint(void) { irq_desc_t *desc = irq_desc + BCU_IRQ; unsigned long flags; - spin_lock_irqsave(&desc->lock, flags); - write_icu2(0, MBCUINTREG); - spin_unlock_irqrestore(&desc->lock, flags); + if (current_cpu_data.cputype == CPU_VR4122 || + current_cpu_data.cputype == CPU_VR4131 || + current_cpu_data.cputype == CPU_VR4133) { + spin_lock_irqsave(&desc->lock, flags); + write_icu2(0, MBCUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); + } } + +EXPORT_SYMBOL(vr41xx_disable_bcuint); /*=======================================================================*/ diff -Nru a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c --- a/arch/mips/vr41xx/common/vrc4173.c 2004-10-06 19:37:47 -07:00 +++ b/arch/mips/vr41xx/common/vrc4173.c 2004-10-06 19:37:47 -07:00 @@ -316,6 +316,96 @@ spin_lock_init(&vrc4173_giu_lock); } +void vrc4173_enable_piuint(uint16_t mask) +{ + irq_desc_t *desc = irq_desc + VRC4173_PIU_IRQ; + unsigned long flags; + uint16_t val; + + spin_lock_irqsave(&desc->lock, flags); + val = vrc4173_inw(VRC4173_MPIUINTREG); + val |= mask; + vrc4173_outw(val, VRC4173_MPIUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); +} + +EXPORT_SYMBOL(vrc4173_eanble_piuint); + +void vrc4173_disable_piuint(uint16_t mask) +{ + irq_desc_t *desc = irq_desc + VRC4173_PIU_IRQ; + unsigned long flags; + uint16_t val; + + spin_lock_irqsave(&desc->lock, flags); + val = vrc4173_inw(VRC4173_MPIUINTREG); + val &= ~mask; + vrc4173_outw(val, VRC4173_MPIUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); +} + +EXPORT_SYMBOL(vrc4173_disable_piuint); + +void vrc4173_enable_aiuint(uint16_t mask) +{ + irq_desc_t *desc = irq_desc + VRC4173_AIU_IRQ; + unsigned long flags; + uint16_t val; + + spin_lock_irqsave(&desc->lock, flags); + val = vrc4173_inw(VRC4173_MAIUINTREG); + val |= mask; + vrc4173_outw(val, VRC4173_MAIUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); +} + +EXPORT_SYMBOL(vrc4173_enable_aiuint); + +void vrc4173_disable_aiuint(uint16_t mask) +{ + irq_desc_t *desc = irq_desc + VRC4173_AIU_IRQ; + unsigned long flags; + uint16_t val; + + spin_lock_irqsave(&desc->lock, flags); + val = vrc4173_inw(VRC4173_MAIUINTREG); + val &= ~mask; + vrc4173_outw(val, VRC4173_MAIUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); +} + +EXPORT_SYMBOL(vrc4173_disable_aiuint); + +void vrc4173_enable_kiuint(uint16_t mask) +{ + irq_desc_t *desc = irq_desc + VRC4173_KIU_IRQ; + unsigned long flags; + uint16_t val; + + spin_lock_irqsave(&desc->lock, flags); + val = vrc4173_inw(VRC4173_MKIUINTREG); + val |= mask; + vrc4173_outw(val, VRC4173_MKIUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); +} + +EXPORT_SYMBOL(vrc4173_enable_kiuint); + +void vrc4173_disable_kiuint(uint16_t mask) +{ + irq_desc_t *desc = irq_desc + VRC4173_KIU_IRQ; + unsigned long flags; + uint16_t val; + + spin_lock_irqsave(&desc->lock, flags); + val = vrc4173_inw(VRC4173_MKIUINTREG); + val &= ~mask; + vrc4173_outw(val, VRC4173_MKIUINTREG); + spin_unlock_irqrestore(&desc->lock, flags); +} + +EXPORT_SYMBOL(vrc4173_disable_kiuint); + static void enable_vrc4173_irq(unsigned int irq) { uint16_t val; diff -Nru a/arch/ppc/Makefile b/arch/ppc/Makefile --- a/arch/ppc/Makefile 2004-10-06 19:37:46 -07:00 +++ b/arch/ppc/Makefile 2004-10-06 19:37:46 -07:00 @@ -27,7 +27,7 @@ -ffixed-r2 -mmultiple CPP = $(CC) -E $(CFLAGS) -CHECKFLAGS += -D__powerpc__=1 +CHECKFLAGS += -D__powerpc__ ifndef CONFIG_E500 CFLAGS += -mstring diff -Nru a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile --- a/arch/ppc/boot/simple/Makefile 2004-10-06 19:37:46 -07:00 +++ b/arch/ppc/boot/simple/Makefile 2004-10-06 19:37:46 -07:00 @@ -64,6 +64,7 @@ zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE end-$(CONFIG_OCOTEA) := ocotea entrypoint-$(CONFIG_OCOTEA) := 0x01000000 + extra.o-$(CONFIG_OCOTEA) := pibs.o extra.o-$(CONFIG_EV64260) := direct.o misc-ev64260.o end-$(CONFIG_EV64260) := ev64260 diff -Nru a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c --- a/arch/ppc/boot/simple/misc.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/boot/simple/misc.c 2004-10-06 19:37:47 -07:00 @@ -48,7 +48,9 @@ * Val Henson has requested that Gemini doesn't wait for the * user to edit the cmdline or not. */ -#if (defined(CONFIG_SERIAL_8250_CONSOLE) || defined(CONFIG_VGA_CONSOLE)) \ +#if (defined(CONFIG_SERIAL_8250_CONSOLE) \ + || defined(CONFIG_VGA_CONSOLE) \ + || defined(CONFIG_SERIAL_MPC52xx_CONSOLE)) \ && !defined(CONFIG_GEMINI) #define INTERACTIVE_CONSOLE 1 #endif diff -Nru a/arch/ppc/boot/simple/pibs.c b/arch/ppc/boot/simple/pibs.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/boot/simple/pibs.c 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,101 @@ +/* + * 2004 (c) MontaVista, Software, Inc. This file is licensed under + * the terms of the GNU General Public License version 2. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. + */ + +#include +#include +#include +#include +#include +#include + +extern unsigned long decompress_kernel(unsigned long load_addr, int num_words, + unsigned long cksum); + +/* We need to make sure that this is before the images to ensure + * that it's in a mapped location. - Tom */ +bd_t hold_resid_buf __attribute__ ((__section__ (".data.boot"))); +bd_t *hold_residual = &hold_resid_buf; + +/* String functions lifted from lib/vsprintf.c and lib/ctype.c */ +unsigned char _ctype[] = { +_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */ +_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */ +_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */ +_C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */ +_S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */ +_P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */ +_D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */ +_D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */ +_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */ +_U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */ +_U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */ +_U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */ +_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */ +_L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */ +_L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */ +_L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */ +_S|_SP,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 160-175 */ +_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P,_P, /* 176-191 */ +_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U,_U, /* 192-207 */ +_U,_U,_U,_U,_U,_U,_U,_P,_U,_U,_U,_U,_U,_U,_U,_L, /* 208-223 */ +_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L,_L, /* 224-239 */ +_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ + +/** + * simple_strtoull - convert a string to an unsigned long long + * @cp: The start of the string + * @endp: A pointer to the end of the parsed string will be placed here + * @base: The number base to use + */ +unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base) +{ + unsigned long long result = 0,value; + + if (!base) { + base = 10; + if (*cp == '0') { + base = 8; + cp++; + if ((toupper(*cp) == 'X') && isxdigit(cp[1])) { + cp++; + base = 16; + } + } + } else if (base == 16) { + if (cp[0] == '0' && toupper(cp[1]) == 'X') + cp += 2; + } + while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) + ? toupper(*cp) : *cp)-'A'+10) < base) { + result = result*base + value; + cp++; + } + if (endp) + *endp = (char *)cp; + return result; +} + +void * +load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, + void *ign1, void *ign2) +{ + unsigned long long mac64; + + decompress_kernel(load_addr, num_words, cksum); + + mac64 = simple_strtoull((char *)OCOTEA_PIBS_MAC_BASE, 0, 16); + memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6); + mac64 = simple_strtoull((char *)(OCOTEA_PIBS_MAC_BASE+OCOTEA_PIBS_MAC_OFFSET), 0, 16); + memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6); + mac64 = simple_strtoull((char *)(OCOTEA_PIBS_MAC_BASE+OCOTEA_PIBS_MAC_OFFSET*2), 0, 16); + memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6); + mac64 = simple_strtoull((char *)(OCOTEA_PIBS_MAC_BASE+OCOTEA_PIBS_MAC_OFFSET*3), 0, 16); + memcpy(hold_residual->bi_enet3addr, (char *)&mac64+2, 6); + return (void *)hold_residual; +} diff -Nru a/arch/ppc/configs/mvme5100_defconfig b/arch/ppc/configs/mvme5100_defconfig --- a/arch/ppc/configs/mvme5100_defconfig 2004-10-06 19:37:46 -07:00 +++ b/arch/ppc/configs/mvme5100_defconfig 2004-10-06 19:37:46 -07:00 @@ -1,5 +1,7 @@ # # Automatically generated make config: don't edit +# Linux kernel version: 2.6.9-rc2 +# Wed Sep 22 09:53:26 2004 # CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y @@ -7,6 +9,7 @@ CONFIG_PPC=y CONFIG_PPC32=y CONFIG_GENERIC_NVRAM=y +CONFIG_GENERIC_IOMAP=y # # Code maturity level options @@ -18,6 +21,7 @@ # # General setup # +CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -27,7 +31,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set # CONFIG_IKCONFIG is not set -# CONFIG_EMBEDDED is not set +CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y @@ -37,6 +41,8 @@ CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +# CONFIG_TINY_SHMEM is not set # # Loadable module support @@ -95,7 +101,6 @@ # CONFIG_SMP is not set # CONFIG_PREEMPT is not set # CONFIG_HIGHMEM is not set -CONFIG_KERNEL_ELF=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_CMDLINE_BOOL=y @@ -233,7 +238,8 @@ # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_MEGARAID is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set @@ -316,6 +322,7 @@ # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=m # # IP: Virtual Server Configuration @@ -329,54 +336,47 @@ # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m +# CONFIG_IP_NF_CT_ACCT is not set +# CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m -# CONFIG_IP_NF_TFTP is not set -# CONFIG_IP_NF_AMANDA is not set +CONFIG_IP_NF_TFTP=m +CONFIG_IP_NF_AMANDA=m # CONFIG_IP_NF_QUEUE is not set CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_MATCH_LIMIT=m +# CONFIG_IP_NF_MATCH_LIMIT is not set # CONFIG_IP_NF_MATCH_IPRANGE is not set -CONFIG_IP_NF_MATCH_MAC=m -CONFIG_IP_NF_MATCH_PKTTYPE=m -CONFIG_IP_NF_MATCH_MARK=m -CONFIG_IP_NF_MATCH_MULTIPORT=m -CONFIG_IP_NF_MATCH_TOS=m +# CONFIG_IP_NF_MATCH_MAC is not set +# CONFIG_IP_NF_MATCH_PKTTYPE is not set +# CONFIG_IP_NF_MATCH_MARK is not set +# CONFIG_IP_NF_MATCH_MULTIPORT is not set +# CONFIG_IP_NF_MATCH_TOS is not set # CONFIG_IP_NF_MATCH_RECENT is not set -CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_DSCP=m -CONFIG_IP_NF_MATCH_AH_ESP=m -CONFIG_IP_NF_MATCH_LENGTH=m -CONFIG_IP_NF_MATCH_TTL=m -CONFIG_IP_NF_MATCH_TCPMSS=m +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_DSCP is not set +# CONFIG_IP_NF_MATCH_AH_ESP is not set +# CONFIG_IP_NF_MATCH_LENGTH is not set +# CONFIG_IP_NF_MATCH_TTL is not set +# CONFIG_IP_NF_MATCH_TCPMSS is not set CONFIG_IP_NF_MATCH_HELPER=m -CONFIG_IP_NF_MATCH_STATE=m -CONFIG_IP_NF_MATCH_CONNTRACK=m -CONFIG_IP_NF_MATCH_OWNER=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_NAT=m -CONFIG_IP_NF_NAT_NEEDED=y -CONFIG_IP_NF_TARGET_MASQUERADE=m -CONFIG_IP_NF_TARGET_REDIRECT=m -# CONFIG_IP_NF_TARGET_NETMAP is not set -# CONFIG_IP_NF_TARGET_SAME is not set -# CONFIG_IP_NF_NAT_LOCAL is not set -# CONFIG_IP_NF_NAT_SNMP_BASIC is not set -CONFIG_IP_NF_NAT_IRC=m -CONFIG_IP_NF_NAT_FTP=m -# CONFIG_IP_NF_MANGLE is not set -# CONFIG_IP_NF_TARGET_LOG is not set -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m -CONFIG_IP_NF_ARPTABLES=m -CONFIG_IP_NF_ARPFILTER=m -# CONFIG_IP_NF_ARP_MANGLE is not set -CONFIG_IP_NF_COMPAT_IPCHAINS=m -# CONFIG_IP_NF_COMPAT_IPFWADM is not set -# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_MATCH_STATE is not set +# CONFIG_IP_NF_MATCH_CONNTRACK is not set +# CONFIG_IP_NF_MATCH_OWNER is not set # CONFIG_IP_NF_MATCH_ADDRTYPE is not set # CONFIG_IP_NF_MATCH_REALM is not set +# CONFIG_IP_NF_MATCH_SCTP is not set +# CONFIG_IP_NF_FILTER is not set +# CONFIG_IP_NF_TARGET_LOG is not set +# CONFIG_IP_NF_TARGET_ULOG is not set +# CONFIG_IP_NF_TARGET_TCPMSS is not set +# CONFIG_IP_NF_NAT is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_ARPTABLES is not set +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set +# CONFIG_IP_NF_COMPAT_IPFWADM is not set +CONFIG_XFRM=y +CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) @@ -434,7 +434,15 @@ # # Tulip family network device support # -# CONFIG_NET_TULIP is not set +CONFIG_NET_TULIP=y +# CONFIG_DE2104X is not set +CONFIG_TULIP=y +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +# CONFIG_DE4X5 is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_DM9102 is not set # CONFIG_HP100 is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set @@ -512,54 +520,28 @@ # # Input device support # -CONFIG_INPUT=y +# CONFIG_INPUT is not set # # Userland interfaces # -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_TSDEV is not set -# CONFIG_INPUT_EVDEV is not set -# CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y -CONFIG_SERIO=y -CONFIG_SERIO_I8042=y -CONFIG_SERIO_SERPORT=y -# CONFIG_SERIO_CT82C710 is not set -# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO is not set +# CONFIG_SERIO_I8042 is not set # # Input Device Drivers # -CONFIG_INPUT_KEYBOARD=y -CONFIG_KEYBOARD_ATKBD=y -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_XTKBD is not set -# CONFIG_KEYBOARD_NEWTON is not set -CONFIG_INPUT_MOUSE=y -CONFIG_MOUSE_PS2=y -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set # # Character devices # -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_HW_CONSOLE=y +# CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set # @@ -578,7 +560,6 @@ CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 -# CONFIG_QIC02_TAPE is not set # # IPMI @@ -633,13 +614,6 @@ # CONFIG_FB is not set # -# Console display driver support -# -CONFIG_VGA_CONSOLE=y -# CONFIG_MDA_CONSOLE is not set -CONFIG_DUMMY_CONSOLE=y - -# # Sound # # CONFIG_SOUND is not set @@ -726,6 +700,7 @@ # CONFIG_EXPORTFS is not set CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -747,7 +722,7 @@ # Library routines # # CONFIG_CRC_CCITT is not set -# CONFIG_CRC32 is not set +CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set # diff -Nru a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c --- a/arch/ppc/kernel/cputable.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/kernel/cputable.c 2004-10-06 19:37:47 -07:00 @@ -63,6 +63,17 @@ #define CPU_FTR_COMMON 0 #endif +/* The powersave features NAP & DOZE seems to confuse BDI when + debugging. So if a BDI is used, disable theses + */ +#ifndef CONFIG_BDI_SWITCH +#define CPU_FTR_MAYBE_CAN_DOZE CPU_FTR_CAN_DOZE +#define CPU_FTR_MAYBE_CAN_NAP CPU_FTR_CAN_NAP +#else +#define CPU_FTR_MAYBE_CAN_DOZE 0 +#define CPU_FTR_MAYBE_CAN_NAP 0 +#endif + struct cpu_spec cpu_specs[] = { #if CLASSIC_PPC { /* 601 */ @@ -76,8 +87,8 @@ { /* 603 */ 0xffff0000, 0x00030000, "603", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_603 @@ -85,8 +96,8 @@ { /* 603e */ 0xffff0000, 0x00060000, "603e", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_603 @@ -94,8 +105,8 @@ { /* 603ev */ 0xffff0000, 0x00070000, "603ev", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_603 @@ -139,8 +150,8 @@ { /* 740/750 (0x4202, don't support TAU ?) */ 0xffffffff, 0x00084202, "740/750", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_750 @@ -148,8 +159,8 @@ { /* 745/755 */ 0xfffff000, 0x00083000, "745/755", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_750 @@ -157,8 +168,8 @@ { /* 750CX (80100 and 8010x?) */ 0xfffffff0, 0x00080100, "750CX", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_750cx @@ -166,8 +177,8 @@ { /* 750CX (82201 and 82202) */ 0xfffffff0, 0x00082200, "750CX", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_750cx @@ -175,8 +186,8 @@ { /* 750CXe (82214) */ 0xfffffff0, 0x00082210, "750CXe", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_750cx @@ -184,8 +195,8 @@ { /* 750FX rev 1.x */ 0xffffff00, 0x70000100, "750FX", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM, COMMON_PPC, 32, 32, @@ -194,8 +205,8 @@ { /* 750FX rev 2.0 must disable HID0[DPM] */ 0xffffffff, 0x70000200, "750FX", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NO_DPM, COMMON_PPC, 32, 32, @@ -204,8 +215,8 @@ { /* 750FX (All revs except 2.0) */ 0xffff0000, 0x70000000, "750FX", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, COMMON_PPC, 32, 32, @@ -213,8 +224,8 @@ }, { /* 750GX */ 0xffff0000, 0x70020000, "750GX", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, COMMON_PPC, 32, 32, @@ -223,8 +234,8 @@ { /* 740/750 (L2CR bit need fixup for 740) */ 0xffff0000, 0x00080000, "740/750", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC, 32, 32, __setup_cpu_750 @@ -232,9 +243,9 @@ { /* 7400 rev 1.1 ? (no TAU) */ 0xffffffff, 0x000c1101, "7400 (1.1)", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_CAN_NAP, + CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, 32, 32, __setup_cpu_7400 @@ -242,9 +253,9 @@ { /* 7400 */ 0xffff0000, 0x000c0000, "7400", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_CAN_NAP, + CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, 32, 32, __setup_cpu_7400 @@ -252,9 +263,9 @@ { /* 7410 */ 0xffff0000, 0x800c0000, "7410", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | - CPU_FTR_CAN_NAP, + CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP, 32, 32, __setup_cpu_7410 @@ -272,7 +283,7 @@ { /* 7450 2.1 */ 0xffffffff, 0x80000201, "7450", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | CPU_FTR_NEED_COHERENT, @@ -283,7 +294,7 @@ { /* 7450 2.3 and newer */ 0xffff0000, 0x80000000, "7450", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT, @@ -305,7 +316,7 @@ { /* 7455 rev 2.0 */ 0xffffffff, 0x80010200, "7455", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS, @@ -316,7 +327,7 @@ { /* 7455 others */ 0xffff0000, 0x80010000, "7455", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, @@ -327,7 +338,7 @@ { /* 7447/7457 Rev 1.0 */ 0xffffffff, 0x80020100, "7447/7457", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, @@ -338,7 +349,7 @@ { /* 7447/7457 Rev 1.1 */ 0xffffffff, 0x80020101, "7447/7457", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, @@ -349,7 +360,7 @@ { /* 7447/7457 Rev 1.2 and later */ 0xffff0000, 0x80020000, "7447/7457", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, @@ -360,7 +371,7 @@ { /* 7447A */ 0xffff0000, 0x80030000, "7447A", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP | + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT, @@ -371,15 +382,15 @@ { /* 82xx (8240, 8245, 8260 are all 603e cores) */ 0x7fff0000, 0x00810000, "82xx", CPU_FTR_COMMON | - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB, COMMON_PPC, 32, 32, __setup_cpu_603 }, { /* All G2_LE (603e core, plus some) have the same pvr */ 0x7fff0000, 0x00820000, "G2_LE", - CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB | - CPU_FTR_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | + CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, COMMON_PPC, 32, 32, __setup_cpu_603 @@ -440,7 +451,7 @@ 0xffff0000, 0x00390000, "PPC970", CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP, + CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC | PPC_FEATURE_64 | PPC_FEATURE_ALTIVEC_COMP, 128, 128, __setup_cpu_ppc970 @@ -449,7 +460,7 @@ 0xffff0000, 0x003c0000, "PPC970FX", CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP, + CPU_FTR_ALTIVEC_COMP | CPU_FTR_MAYBE_CAN_NAP, COMMON_PPC | PPC_FEATURE_64 | PPC_FEATURE_ALTIVEC_COMP, 128, 128, __setup_cpu_ppc970 @@ -458,7 +469,8 @@ #ifdef CONFIG_8xx { /* 8xx */ 0xffff0000, 0x00500000, "8xx", - /* CPU_FTR_CAN_DOZE is possible, if the 8xx code is there.... */ + /* CPU_FTR_MAYBE_CAN_DOZE is possible, + * if the 8xx code is there.... */ CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 16, 16, @@ -599,7 +611,7 @@ #ifdef CONFIG_E500 { /* e500 */ 0xffff0000, 0x80200000, "e500", - /* xxx - galak: add CPU_FTR_CAN_DOZE */ + /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 32, 32, diff -Nru a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c --- a/arch/ppc/kernel/ppc_ksyms.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/kernel/ppc_ksyms.c 2004-10-06 19:37:47 -07:00 @@ -352,3 +352,7 @@ extern unsigned long agp_special_page; EXPORT_SYMBOL(agp_special_page); #endif +#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) +EXPORT_SYMBOL(__mtdcr); +EXPORT_SYMBOL(__mfdcr); +#endif diff -Nru a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c --- a/arch/ppc/kernel/signal.c 2004-10-06 19:37:48 -07:00 +++ b/arch/ppc/kernel/signal.c 2004-10-06 19:37:48 -07:00 @@ -270,7 +270,7 @@ static int restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig) { - unsigned long save_r2; + unsigned long save_r2 = 0; #if defined(CONFIG_ALTIVEC) || defined(CONFIG_SPE) unsigned long msr; #endif diff -Nru a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c --- a/arch/ppc/mm/44x_mmu.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/mm/44x_mmu.c 2004-10-06 19:37:47 -07:00 @@ -72,7 +72,7 @@ static void __init ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys) { - unsigned long attrib; + unsigned long attrib = 0; __asm__ __volatile__("\ clrrwi %2,%2,10\n\ diff -Nru a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c --- a/arch/ppc/platforms/4xx/ocotea.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/platforms/4xx/ocotea.c 2004-10-06 19:37:47 -07:00 @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -58,13 +59,25 @@ #include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h" extern void abort(void); +bd_t __res; + +static struct ibm44x_clocks clocks; + +static int __init +ocotea_get_dec_freq(void) +{ + if (mfspr(SPRN_CCR1) & CCR1_TCS) + return OCOTEA_TMR_CLK; + else + return clocks.cpu; +} static void __init ocotea_calibrate_decr(void) { unsigned int freq; - freq = OCOTEA_SYSCLK; + freq = ocotea_get_dec_freq(); tb_ticks_per_jiffy = freq / HZ; tb_to_us = mulhwu_scale_factor(freq, 1000000); @@ -107,6 +120,46 @@ return PCI_IRQ_TABLE_LOOKUP; } +static void __init ocotea_set_emacdata(void) +{ + struct ocp_def *def; + struct ocp_func_emac_data *emacdata; + int i; + + /* + * Note: Current rev. board only operates in Group 4a + * mode, so we always set EMAC0-1 for SMII and EMAC2-3 + * for RGMII (though these could run in RTBI just the same). + * + * The FPGA reg 3 information isn't even suitable for + * determining the phy_mode, so if the board becomes + * usable in !4a, it will be necessary to parse an environment + * variable from the firmware or similar to properly configure + * the phy_map/phy_mode. + */ + /* Set phy_map, phy_mode, and mac_addr for each EMAC */ + for (i=0; i<4; i++) { + def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i); + emacdata = def->additions; + if (i < 2) { + emacdata->phy_map = 0x00000001; /* Skip 0x00 */ + emacdata->phy_mode = PHY_MODE_SMII; + } + else { + emacdata->phy_map = 0x0000ffff; /* Skip 0x00-0x0f */ + emacdata->phy_mode = PHY_MODE_RGMII; + } + if (i == 0) + memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6); + else if (i == 1) + memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6); + else if (i == 2) + memcpy(emacdata->mac_addr, __res.bi_enet2addr, 6); + else if (i == 3) + memcpy(emacdata->mac_addr, __res.bi_enet3addr, 6); + } +} + #define PCIX_READW(offset) \ (readw((u32)pcix_reg_base+offset)) @@ -209,7 +262,7 @@ TODC_ALLOC(); static void __init -ocotea_early_serial_map(const struct ibm44x_clocks *clks) +ocotea_early_serial_map(void) { struct uart_port port; @@ -217,7 +270,7 @@ memset(&port, 0, sizeof(port)); port.membase = ioremap64(PPC440GX_UART0_ADDR, 8); port.irq = UART0_INT; - port.uartclk = clks->uart0; + port.uartclk = clocks.uart0; port.regshift = 0; port.iotype = SERIAL_IO_MEM; port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; @@ -229,7 +282,7 @@ port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); port.irq = UART1_INT; - port.uartclk = clks->uart1; + port.uartclk = clocks.uart1; port.line = 1; if (early_serial_setup(&port) != 0) { @@ -240,41 +293,7 @@ static void __init ocotea_setup_arch(void) { - unsigned char *addr; - unsigned long long mac64; - struct ocp_def *def; - struct ocp_func_emac_data *emacdata; - int i; - struct ibm44x_clocks clocks; - - /* - * Note: Current rev. board only operates in Group 4a - * mode, so we always set EMAC0-1 for SMII and EMAC2-3 - * for RGMII (though these could run in RTBI just the same). - * - * The FPGA reg 3 information isn't even suitable for - * determining the phy_mode, so if the board becomes - * usable in !4a, it will be necessary to parse an environment - * variable from the firmware or similar to properly configure - * the phy_map/phy_mode. - */ - /* Set phy_map, phy_mode, and mac_addr for each EMAC */ - addr = ioremap64(OCOTEA_MAC_BASE, OCOTEA_MAC_SIZE); - for (i=0; i<4; i++) { - mac64 = simple_strtoull(addr+OCOTEA_MAC_OFFSET*i, 0, 16); - def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i); - emacdata = def->additions; - if (i < 2) { - emacdata->phy_map = 0x00000001; /* Skip 0x00 */ - emacdata->phy_mode = PHY_MODE_SMII; - } - else { - emacdata->phy_map = 0x0000ffff; /* Skip 0x00-0x0f */ - emacdata->phy_mode = PHY_MODE_RGMII; - } - memcpy(emacdata->mac_addr, (char *)&mac64+2, 6); - } - iounmap(addr); + ocotea_set_emacdata(); ibm440gx_tah_enable(); @@ -319,7 +338,7 @@ ROOT_DEV = Root_HDA1; #endif - ocotea_early_serial_map(&clocks); + ocotea_early_serial_map(); /* Identify the system */ printk("IBM Ocotea port (MontaVista Software, Inc. )\n"); @@ -454,19 +473,17 @@ } #endif /* CONFIG_SERIAL_TEXT_DEBUG */ -#if 0 -static void __init -ocotea_map_io(void) -{ - io_block_mapping(0xe0000000, 0x0000000140000000, - 0x00001000, _PAGE_IO); -} -#endif - void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { - parse_bootinfo((struct bi_record *) (r3 + KERNELBASE)); + parse_bootinfo(find_bootinfo()); + + /* + * If we were passed in a board information, copy it into the + * residual data area. + */ + if (r3) + __res = *(bd_t *)(r3 + KERNELBASE); /* Disable L2-Cache due to hardware issues */ ibm440gx_l2c_disable(); diff -Nru a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h --- a/arch/ppc/platforms/4xx/ocotea.h 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/platforms/4xx/ocotea.h 2004-10-06 19:37:47 -07:00 @@ -24,13 +24,14 @@ /* F/W TLB mapping used in bootloader glue to reset EMAC */ #define PPC44x_EMAC0_MR0 0xE0000800 -/* Location of MAC addresses in firmware */ -#define OCOTEA_MAC_BASE (OCOTEA_SMALL_FLASH_HIGH+0xb0500) -#define OCOTEA_MAC_SIZE 0x200 -#define OCOTEA_MAC_OFFSET 0x100 +/* Location of MAC addresses in PIBS image */ +#define OCOTEA_PIBS_FLASH 0xfff00000 +#define OCOTEA_PIBS_MAC_BASE (OCOTEA_PIBS_FLASH+0xb0500) +#define OCOTEA_PIBS_MAC_SIZE 0x200 +#define OCOTEA_PIBS_MAC_OFFSET 0x100 -/* Default clock rate */ -#define OCOTEA_SYSCLK 25000000 +/* External timer clock frequency */ +#define OCOTEA_TMR_CLK 25000000 /* RTC/NVRAM location */ #define OCOTEA_RTC_ADDR 0x0000000148000000ULL diff -Nru a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c --- a/arch/ppc/platforms/lite5200.c 2004-10-06 19:37:46 -07:00 +++ b/arch/ppc/platforms/lite5200.c 2004-10-06 19:37:46 -07:00 @@ -36,6 +36,8 @@ #include +extern int powersave_nap; + /* Board data given by U-Boot */ bd_t __res; EXPORT_SYMBOL(__res); /* For modules */ @@ -64,25 +66,55 @@ .vendor = OCP_VENDOR_INVALID } }; - + /* ======================================================================== */ /* Platform specific code */ /* ======================================================================== */ static int -icecube_show_cpuinfo(struct seq_file *m) +lite5200_show_cpuinfo(struct seq_file *m) { seq_printf(m, "machine\t\t: Freescale LITE5200\n"); return 0; } static void __init -icecube_setup_arch(void) +lite5200_setup_cpu(void) { + struct mpc52xx_intr *intr; + + u32 intr_ctrl; + + /* Map zones */ + intr = (struct mpc52xx_intr *) + ioremap(MPC52xx_INTR,sizeof(struct mpc52xx_intr)); + + if (!intr) { + printk("lite5200.c: Error while mapping INTR during lite5200_setup_cpu\n"); + goto unmap_regs; + } + + /* IRQ[0-3] setup : IRQ0 - Level Active Low */ + /* IRQ[1-3] - Level Active High */ + intr_ctrl = in_be32(&intr->ctrl); + intr_ctrl &= ~0x00ff0000; + intr_ctrl |= 0x00c00000; + out_be32(&intr->ctrl, intr_ctrl); + + /* Unmap reg zone */ +unmap_regs: + if (intr) iounmap(intr); +} +static void __init +lite5200_setup_arch(void) +{ /* Add board OCP definitions */ mpc52xx_add_board_devices(board_ocp); + + /* CPU & Port mux setup */ + lite5200_setup_cpu(); } void __init @@ -110,7 +142,7 @@ initrd_end = r5 + KERNELBASE; } #endif - + /* Load the command line */ if (r6) { *(char *)(r7+KERNELBASE) = 0; @@ -120,14 +152,17 @@ /* BAT setup */ mpc52xx_set_bat(); - + /* No ISA bus AFAIK */ isa_io_base = 0; isa_mem_base = 0; + /* Powersave */ + powersave_nap = 1; /* We allow this platform to NAP */ + /* Setup the ppc_md struct */ - ppc_md.setup_arch = icecube_setup_arch; - ppc_md.show_cpuinfo = icecube_show_cpuinfo; + ppc_md.setup_arch = lite5200_setup_arch; + ppc_md.show_cpuinfo = lite5200_show_cpuinfo; ppc_md.show_percpuinfo = NULL; ppc_md.init_IRQ = mpc52xx_init_irq; ppc_md.get_irq = mpc52xx_get_irq; @@ -138,12 +173,12 @@ ppc_md.restart = mpc52xx_restart; ppc_md.power_off = mpc52xx_power_off; ppc_md.halt = mpc52xx_halt; - - /* No time keeper on the IceCube */ + + /* No time keeper on the LITE5200 */ ppc_md.time_init = NULL; ppc_md.get_rtc_time = NULL; ppc_md.set_rtc_time = NULL; - + ppc_md.calibrate_decr = mpc52xx_calibrate_decr; #ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.progress = mpc52xx_progress; diff -Nru a/arch/ppc/platforms/mpc5200.c b/arch/ppc/platforms/mpc5200.c --- a/arch/ppc/platforms/mpc5200.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/platforms/mpc5200.c 2004-10-06 19:37:47 -07:00 @@ -16,6 +16,12 @@ #include #include + +struct ocp_fs_i2c_data mpc5200_i2c_def = { + .flags = FS_I2C_CLOCK_5200, +}; + + /* Here is the core_ocp struct. * With all the devices common to all board. Even if port multiplexing is * not setup for them (if the user don't want them, just don't select the @@ -23,6 +29,24 @@ * board specific file. */ struct ocp_def core_ocp[] = { + { + .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_IIC, + .index = 0, + .paddr = MPC52xx_I2C1, + .irq = OCP_IRQ_NA, /* MPC52xx_IRQ_I2C1 - Buggy */ + .pm = OCP_CPM_NA, + .additions = &mpc5200_i2c_def, + }, + { + .vendor = OCP_VENDOR_FREESCALE, + .function = OCP_FUNC_IIC, + .index = 1, + .paddr = MPC52xx_I2C2, + .irq = OCP_IRQ_NA, /* MPC52xx_IRQ_I2C2 - Buggy */ + .pm = OCP_CPM_NA, + .additions = &mpc5200_i2c_def, + }, { /* Terminating entry */ .vendor = OCP_VENDOR_INVALID } diff -Nru a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c --- a/arch/ppc/platforms/pmac_pci.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/platforms/pmac_pci.c 2004-10-06 19:37:47 -07:00 @@ -316,6 +316,10 @@ unsigned int addr; int i; + struct device_node *np = pci_busdev_to_OF_node(bus, devfn); + if (np == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; + /* * When a device in K2 is powered down, we die on config * cycle accesses. Fix that here. @@ -363,6 +367,9 @@ unsigned int addr; int i; + struct device_node *np = pci_busdev_to_OF_node(bus, devfn); + if (np == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; /* * When a device in K2 is powered down, we die on config * cycle accesses. Fix that here. diff -Nru a/arch/ppc/syslib/mpc52xx_pic.c b/arch/ppc/syslib/mpc52xx_pic.c --- a/arch/ppc/syslib/mpc52xx_pic.c 2004-10-06 19:37:48 -07:00 +++ b/arch/ppc/syslib/mpc52xx_pic.c 2004-10-06 19:37:48 -07:00 @@ -114,7 +114,7 @@ /* * Only some irqs are reset here, others in interrupting hardware. */ - + switch (irq) { case MPC52xx_IRQ0: val = in_be32(&intr->ctrl); @@ -180,13 +180,14 @@ mpc52xx_init_irq(void) { int i; + u32 intr_ctrl; /* Remap the necessary zones */ intr = (struct mpc52xx_intr *) ioremap(MPC52xx_INTR, sizeof(struct mpc52xx_intr)); sdma = (struct mpc52xx_sdma *) ioremap(MPC52xx_SDMA, sizeof(struct mpc52xx_sdma)); - + if ((intr==NULL) || (sdma==NULL)) panic("Can't ioremap PIC/SDMA register for init_irq !"); @@ -195,12 +196,13 @@ out_be32(&sdma->IntMask, 0xffffffff); /* 1 means disabled */ out_be32(&intr->per_mask, 0x7ffffc00); /* 1 means disabled */ out_be32(&intr->main_mask, 0x00010fff); /* 1 means disabled */ - out_be32(&intr->ctrl, - 0x0f000000 | /* clear IRQ 0-3 */ - 0x00c00000 | /* IRQ0: level-sensitive, active low */ + intr_ctrl = in_be32(&intr->ctrl); + intr_ctrl &= 0x00ff0000; /* Keeps IRQ[0-3] config */ + intr_ctrl |= 0x0f000000 | /* clear IRQ 0-3 */ 0x00001000 | /* MEE master external enable */ 0x00000000 | /* 0 means disable IRQ 0-3 */ - 0x00000001); /* CEb route critical normally */ + 0x00000001; /* CEb route critical normally */ + out_be32(&intr->ctrl, intr_ctrl); /* Zero a bunch of the priority settings. */ out_be32(&intr->per_pri1, 0); @@ -213,6 +215,14 @@ for (i = 0; i < NR_IRQS; i++) { irq_desc[i].handler = &mpc52xx_ic; irq_desc[i].status = IRQ_LEVEL; + } + + #define IRQn_MODE(intr_ctrl,irq) (((intr_ctrl) >> (22-(i<<1))) & 0x03) + for (i=0 ; i<4 ; i++) { + int mode; + mode = IRQn_MODE(intr_ctrl,i); + if ((mode == 0x1) || (mode == 0x2)) + irq_desc[i?MPC52xx_IRQ1+i-1:MPC52xx_IRQ0].status = 0; } } diff -Nru a/arch/ppc/syslib/mpc52xx_setup.c b/arch/ppc/syslib/mpc52xx_setup.c --- a/arch/ppc/syslib/mpc52xx_setup.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/syslib/mpc52xx_setup.c 2004-10-06 19:37:47 -07:00 @@ -1,5 +1,5 @@ /* - * arch/ppc/syslib/mpc52xx_common.c + * arch/ppc/syslib/mpc52xx_setup.c * * Common code for the boards based on Freescale MPC52xx embedded CPU. * @@ -23,6 +23,7 @@ #include #include #include +#include #include extern bd_t __res; @@ -38,9 +39,9 @@ mpc52xx_restart(char *cmd) { struct mpc52xx_gpt* gpt0 = (struct mpc52xx_gpt*) MPC52xx_GPTx(0); - + local_irq_disable(); - + /* Turn on the watchdog and wait for it to expire. It effectively does a reset */ if (gpt0 != NULL) { @@ -99,24 +100,28 @@ #error "mpc52xx PSC for console not selected" #endif +static void +mpc52xx_psc_putc(struct mpc52xx_psc * psc, unsigned char c) +{ + while (!(in_be16(&psc->mpc52xx_psc_status) & + MPC52xx_PSC_SR_TXRDY)); + out_8(&psc->mpc52xx_psc_buffer_8, c); +} + void mpc52xx_progress(char *s, unsigned short hex) { struct mpc52xx_psc *psc = (struct mpc52xx_psc *)MPC52xx_CONSOLE; char c; - /* Don't we need to disable serial interrupts ? */ - while ((c = *s++) != 0) { - if (c == '\n') { - while (!(in_be16(&psc->mpc52xx_psc_status) & - MPC52xx_PSC_SR_TXRDY)) ; - out_8(&psc->mpc52xx_psc_buffer_8, '\r'); - } - while (!(in_be16(&psc->mpc52xx_psc_status) & - MPC52xx_PSC_SR_TXRDY)) ; - out_8(&psc->mpc52xx_psc_buffer_8, c); + if (c == '\n') + mpc52xx_psc_putc(psc, '\r'); + mpc52xx_psc_putc(psc, c); } + + mpc52xx_psc_putc(psc, '\r'); + mpc52xx_psc_putc(psc, '\n'); } #endif /* CONFIG_SERIAL_TEXT_DEBUG */ @@ -137,7 +142,7 @@ /* Temp BAT2 mapping active when this is called ! */ mmap_ctl = (struct mpc52xx_mmap_ctl*) MPC52xx_MMAP_CTL; - + sdram_config_0 = in_be32(&mmap_ctl->sdram0); sdram_config_1 = in_be32(&mmap_ctl->sdram1); @@ -147,10 +152,8 @@ if (((sdram_config_1 & 0x1f) >= 0x13) && ((sdram_config_1 & 0xfff00000) == ramsize)) ramsize += 1 << ((sdram_config_1 & 0xf) + 17); - - iounmap(mmap_ctl); } - + return ramsize; } @@ -167,7 +170,7 @@ /* Get RTC & Clock manager modules */ struct mpc52xx_rtc *rtc; struct mpc52xx_cdm *cdm; - + rtc = (struct mpc52xx_rtc*) ioremap(MPC52xx_RTC, sizeof(struct mpc52xx_rtc)); cdm = (struct mpc52xx_cdm*) @@ -206,7 +209,7 @@ __res.bi_intfreq = cpufreq; __res.bi_ipbfreq = ipbfreq; __res.bi_pcifreq = pcifreq; - + /* Release mapping */ iounmap((void*)rtc); iounmap((void*)cdm); diff -Nru a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c --- a/arch/ppc/syslib/ppc4xx_pic.c 2004-10-06 19:37:46 -07:00 +++ b/arch/ppc/syslib/ppc4xx_pic.c 2004-10-06 19:37:46 -07:00 @@ -256,7 +256,7 @@ ppc4xx_uic_end(unsigned int irq) { int bit, word; - unsigned int tr_bits; + unsigned int tr_bits = 0; bit = irq & 0x1f; word = irq >> 5; diff -Nru a/arch/ppc/syslib/todc_time.c b/arch/ppc/syslib/todc_time.c --- a/arch/ppc/syslib/todc_time.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc/syslib/todc_time.c 2004-10-06 19:37:47 -07:00 @@ -277,9 +277,9 @@ ulong todc_get_rtc_time(void) { - uint year, mon, day, hour, min, sec; + uint year = 0, mon = 0, day = 0, hour = 0, min = 0, sec = 0; uint limit, i; - u_char save_control, uip; + u_char save_control, uip = 0; spin_lock(&rtc_lock); save_control = todc_read_val(todc_info->control_a); @@ -361,7 +361,7 @@ todc_set_rtc_time(unsigned long nowtime) { struct rtc_time tm; - u_char save_control, save_freq_select; + u_char save_control, save_freq_select = 0; spin_lock(&rtc_lock); to_tm(nowtime, &tm); @@ -416,7 +416,7 @@ */ static unsigned char __init todc_read_timereg(int addr) { - unsigned char save_control, val; + unsigned char save_control = 0, val; switch (todc_info->rtc_type) { case TODC_TYPE_DS1557: diff -Nru a/arch/ppc64/Makefile b/arch/ppc64/Makefile --- a/arch/ppc64/Makefile 2004-10-06 19:37:46 -07:00 +++ b/arch/ppc64/Makefile 2004-10-06 19:37:46 -07:00 @@ -28,7 +28,7 @@ NM := $(NM) --synthetic endif -CHECKFLAGS += -m64 -D__powerpc__=1 +CHECKFLAGS += -m64 -D__powerpc__ LDFLAGS := -m elf64ppc LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD) diff -Nru a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile --- a/arch/ppc64/boot/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/boot/Makefile 2004-10-06 19:37:47 -07:00 @@ -31,7 +31,6 @@ BOOTLD := $(CROSS32_COMPILE)ld BOOTLFLAGS := -Ttext 0x00400000 -e _start -T $(srctree)/$(src)/zImage.lds BOOTOBJCOPY := $(CROSS32_COMPILE)objcopy -BOOTSTRIP := $(CROSS32_COMPILE)strip OBJCOPYFLAGS := contents,alloc,load,readonly,data src-boot := crt0.S string.S prom.c main.c zlib.c imagesize.c div64.S @@ -71,7 +70,7 @@ cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@ quiet_cmd_stripvm = STRIP $@ - cmd_stripvm = $(BOOTSTRIP) -s $< -o $@ + cmd_stripvm = $(STRIP) -s $< -o $@ vmlinux.strip: vmlinux FORCE $(call if_changed,stripvm) diff -Nru a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S --- a/arch/ppc64/kernel/head.S 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/kernel/head.S 2004-10-06 19:37:47 -07:00 @@ -551,14 +551,14 @@ .llong 0 /* Reserved */ .llong 0 /* Reserved */ .llong (KERNELBASE>>SID_SHIFT) - .llong 0x40bffffd5 /* KERNELBASE VSID */ + .llong 0x408f92c94 /* KERNELBASE VSID */ /* We have to list the bolted VMALLOC segment here, too, so that it * will be restored on shared processor switch */ .llong (VMALLOCBASE>>SID_SHIFT) - .llong 0xb0cffffd1 /* VMALLOCBASE VSID */ + .llong 0xf09b89af5 /* VMALLOCBASE VSID */ .llong 8192 /* # pages to map (32 MB) */ .llong 0 /* Offset from start of loadarea to start of map */ - .llong 0x40bffffd50000 /* VPN of first page to map */ + .llong 0x408f92c940000 /* VPN of first page to map */ . = 0x6100 diff -Nru a/arch/ppc64/kernel/pmac_feature.c b/arch/ppc64/kernel/pmac_feature.c --- a/arch/ppc64/kernel/pmac_feature.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/kernel/pmac_feature.c 2004-10-06 19:37:47 -07:00 @@ -343,6 +343,10 @@ PMAC_TYPE_POWERMAC_G5, g5_features, 0, }, + { "PowerMac7,3", "PowerMac G5", + PMAC_TYPE_POWERMAC_G5, g5_features, + 0, + }, { "RackMac3,1", "XServe G5", PMAC_TYPE_POWERMAC_G5, g5_features, 0, diff -Nru a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c --- a/arch/ppc64/kernel/pmac_pci.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/kernel/pmac_pci.c 2004-10-06 19:37:47 -07:00 @@ -271,7 +271,7 @@ int offset, int len, u32 *val) { struct pci_controller *hose; - struct device_node *busdn; + struct device_node *busdn, *dn; unsigned long addr; if (bus->self) @@ -282,6 +282,16 @@ return PCIBIOS_DEVICE_NOT_FOUND; hose = busdn->phb; if (hose == NULL) + return PCIBIOS_DEVICE_NOT_FOUND; + + /* We only allow config cycles to devices that are in OF device-tree + * as we are apparently having some weird things going on with some + * revs of K2 on recent G5s + */ + for (dn = busdn->child; dn; dn = dn->sibling) + if (dn->devfn == devfn) + break; + if (dn == NULL) return PCIBIOS_DEVICE_NOT_FOUND; addr = u3_ht_cfg_access(hose, bus->number, devfn, offset); diff -Nru a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c --- a/arch/ppc64/kernel/process.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/kernel/process.c 2004-10-06 19:37:47 -07:00 @@ -147,7 +147,6 @@ */ 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) { @@ -158,7 +157,6 @@ } preempt_enable(); } -#endif } int dump_task_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs) @@ -410,7 +408,7 @@ unsigned long childregs = (unsigned long)current->thread_info + THREAD_SIZE; childregs -= sizeof(struct pt_regs); - current->thread.regs = childregs; + current->thread.regs = (struct pt_regs *)childregs; } regs->nip = entry; diff -Nru a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c --- a/arch/ppc64/kernel/setup.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/kernel/setup.c 2004-10-06 19:37:47 -07:00 @@ -121,8 +121,8 @@ static int ppc64_panic_event(struct notifier_block *, unsigned long, void *); static struct notifier_block ppc64_panic_block = { - notifier_call: ppc64_panic_event, - priority: INT_MIN /* may not return; must be done last */ + .notifier_call = ppc64_panic_event, + .priority = INT_MIN /* may not return; must be done last */ }; /* diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c --- a/arch/ppc64/kernel/sys_ppc32.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/kernel/sys_ppc32.c 2004-10-06 19:37:47 -07:00 @@ -642,7 +642,7 @@ unsigned long childregs = (unsigned long)current->thread_info + THREAD_SIZE; childregs -= sizeof(struct pt_regs); - current->thread.regs = childregs; + current->thread.regs = (struct pt_regs *)childregs; } /* diff -Nru a/arch/ppc64/mm/hash_native.c b/arch/ppc64/mm/hash_native.c --- a/arch/ppc64/mm/hash_native.c 2004-10-06 19:37:47 -07:00 +++ b/arch/ppc64/mm/hash_native.c 2004-10-06 19:37:47 -07:00 @@ -407,13 +407,13 @@ model = get_property(root, "model", NULL); if (!strcmp(model, "CHRP IBM,9076-N81")) { of_node_put(root); - return; + goto bail; } of_node_put(root); } #endif /* CONFIG_PPC_PSERIES */ ppc_md.flush_hash_range = native_flush_hash_range; - + bail: htab_finish_init(); } diff -Nru a/arch/sparc/Makefile b/arch/sparc/Makefile --- a/arch/sparc/Makefile 2004-10-06 19:37:46 -07:00 +++ b/arch/sparc/Makefile 2004-10-06 19:37:46 -07:00 @@ -13,7 +13,7 @@ AS := $(AS) -32 LDFLAGS := -m elf32_sparc -CHECKFLAGS += -D__sparc__=1 +CHECKFLAGS += -D__sparc__ #CFLAGS := $(CFLAGS) -g -pipe -fcall-used-g5 -fcall-used-g7 CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 diff -Nru a/arch/sparc64/Makefile b/arch/sparc64/Makefile --- a/arch/sparc64/Makefile 2004-10-06 19:37:48 -07:00 +++ b/arch/sparc64/Makefile 2004-10-06 19:37:48 -07:00 @@ -8,7 +8,7 @@ # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) # -CHECKFLAGS += -D__sparc__=1 -D__sparc_v9__=1 +CHECKFLAGS += -D__sparc__ -D__sparc_v9__ CPPFLAGS_vmlinux.lds += -Usparc diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig --- a/arch/sparc64/defconfig 2004-10-06 19:37:47 -07:00 +++ b/arch/sparc64/defconfig 2004-10-06 19:37:47 -07:00 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.9-rc2 -# Fri Sep 24 12:34:43 2004 +# Linux kernel version: 2.6.9-rc3 +# Sun Oct 3 14:28:53 2004 # CONFIG_64BIT=y CONFIG_MMU=y @@ -561,6 +561,7 @@ CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_MATCH_REALM=m CONFIG_IP_NF_MATCH_SCTP=m +CONFIG_IP_NF_MATCH_COMMENT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m @@ -1784,7 +1785,7 @@ CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m -CONFIG_CRYPTO_WHIRLPOOL=m +CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m diff -Nru a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c --- a/arch/sparc64/kernel/kprobes.c 2004-10-06 19:37:47 -07:00 +++ b/arch/sparc64/kernel/kprobes.c 2004-10-06 19:37:47 -07:00 @@ -10,84 +10,69 @@ #include #include -/* We do not have hardware single-stepping, so in order - * to implement post handlers correctly we use two breakpoint - * instructions. +/* We do not have hardware single-stepping on sparc64. + * So we implement software single-stepping with breakpoint + * traps. The top-level scheme is similar to that used + * in the x86 kprobes implementation. * - * 1) ta 0x70 --> 0x91d02070 - * 2) ta 0x71 --> 0x91d02071 + * In the kprobe->insn[] array we store the original + * instruction at index zero and a break instruction at + * index one. * - * When these are hit, control is transferred to kprobe_trap() - * below. The arg 'level' tells us which of the two traps occurred. + * When we hit a kprobe we: + * - Run the pre-handler + * - Remember "regs->tnpc" and interrupt level stored in + * "regs->tstate" so we can restore them later + * - Disable PIL interrupts + * - Set regs->tpc to point to kprobe->insn[0] + * - Set regs->tnpc to point to kprobe->insn[1] + * - Mark that we are actively in a kprobe * - * Initially, the instruction at p->addr gets set to "ta 0x70" - * by code in register_kprobe() by setting that memory address - * to BREAKPOINT_INSTRUCTION. When this breakpoint is hit - * the following happens: - * - * 1) We run the pre-handler - * 2) We replace p->addr with the original opcode - * 3) We set the instruction at "regs->npc" to "ta 0x71" - * 4) We mark that we are waiting for the second breakpoint - * to hit and return from the trap. - * - * At this point we wait for the second breakpoint to hit. - * When it does: - * - * 1) We run the post-handler - * 2) We re-install "ta 0x70" at p->addr - * 3) We restore the opcode at the "ta 0x71" breakpoint - * 4) We reset our "waiting for "ta 0x71" state - * 5) We return from the trap - * - * We could use the trick used by the i386 kprobe code but I - * think that scheme has problems with exception tables. On i386 - * they single-step over the original instruction stored at - * kprobe->insn. So they set the processor to single step, and - * set the program counter to kprobe->insn. - * - * But that explodes if the original opcode is a user space - * access instruction and that faults. It will go wrong because - * since the location of the instruction being executed is - * different from that recorded in the exception tables, the - * kernel will not find it and this will cause an erroneous - * kernel OOPS. + * At this point we wait for the second breakpoint at + * kprobe->insn[1] to hit. When it does we: + * - Run the post-handler + * - Set regs->tpc to "remembered" regs->tnpc stored above, + * restore the PIL interrupt level in "regs->tstate" as well + * - Make any adjustments necessary to regs->tnpc in order + * to handle relative branches correctly. See below. + * - Mark that we are no longer actively in a kprobe. */ void arch_prepare_kprobe(struct kprobe *p) { p->insn[0] = *p->addr; - p->insn[1] = 0xdeadbeef; + p->insn[1] = BREAKPOINT_INSTRUCTION_2; } -static void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) -{ - u32 *insn2 = (u32 *) regs->tpc; - - p->insn[1] = *insn2; +/* kprobe_status settings */ +#define KPROBE_HIT_ACTIVE 0x00000001 +#define KPROBE_HIT_SS 0x00000002 - *insn2 = BREAKPOINT_INSTRUCTION_2; - flushi(insn2); -} +static struct kprobe *current_kprobe; +static unsigned long current_kprobe_orig_tnpc; +static unsigned long current_kprobe_orig_tstate_pil; +static unsigned int kprobe_status; -static void undo_singlestep(struct kprobe *p, struct pt_regs *regs) +static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) { - u32 *insn2 = (u32 *) regs->tpc; - - BUG_ON(p->insn[1] == 0xdeadbeef); + current_kprobe_orig_tnpc = regs->tnpc; + current_kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); + regs->tstate |= TSTATE_PIL; - *insn2 = p->insn[1]; - flushi(insn2); - - p->insn[1] = 0xdeadbeef; + regs->tpc = (unsigned long) &p->insn[0]; + regs->tnpc = (unsigned long) &p->insn[1]; } -/* kprobe_status settings */ -#define KPROBE_HIT_ACTIVE 0x00000001 -#define KPROBE_HIT_SS 0x00000002 +static inline void disarm_kprobe(struct kprobe *p, struct pt_regs *regs) +{ + *p->addr = p->opcode; + flushi(p->addr); -static struct kprobe *current_kprobe; -static unsigned int kprobe_status; + regs->tpc = (unsigned long) p->addr; + regs->tnpc = current_kprobe_orig_tnpc; + regs->tstate = ((regs->tstate & ~TSTATE_PIL) | + current_kprobe_orig_tstate_pil); +} static int kprobe_handler(struct pt_regs *regs) { @@ -98,16 +83,19 @@ preempt_disable(); if (kprobe_running()) { + /* We *are* holding lock here, so this is safe. + * Disarm the probe we just hit, and ignore it. + */ p = get_kprobe(addr); if (p) { - *p->addr = p->opcode; - flushi(p->addr); + disarm_kprobe(p, regs); ret = 1; } else { p = current_kprobe; if (p->break_handler && p->break_handler(p, regs)) goto ss_probe; } + /* If it's not ours, can't be delete race, (we hold lock). */ goto no_kprobe; } @@ -115,8 +103,17 @@ p = get_kprobe(addr); if (!p) { unlock_kprobes(); - if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) + if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) { + /* + * The breakpoint instruction was removed right + * after we hit it. Another cpu has removed + * either a probepoint or a debugger breakpoint + * at this address. In either case, no further + * handling of this interrupt is appropriate. + */ ret = 1; + } + /* Not one of ours: let kernel handle it */ goto no_kprobe; } @@ -135,17 +132,102 @@ return ret; } -static int post_kprobe_handler(struct pt_regs *regs) +/* If INSN is a relative control transfer instruction, + * return the corrected branch destination value. + * + * The original INSN location was REAL_PC, it actually + * executed at PC and produced destination address NPC. + */ +static unsigned long relbranch_fixup(u32 insn, unsigned long real_pc, + unsigned long pc, unsigned long npc) { - u32 *insn_p = (u32 *) regs->tpc; + /* Branch not taken, no mods necessary. */ + if (npc == pc + 0x4UL) + return real_pc + 0x4UL; - if (!kprobe_running() || (*insn_p != BREAKPOINT_INSTRUCTION_2)) + /* The three cases are call, branch w/prediction, + * and traditional branch. + */ + if ((insn & 0xc0000000) == 0x40000000 || + (insn & 0xc1c00000) == 0x00400000 || + (insn & 0xc1c00000) == 0x00800000) { + /* The instruction did all the work for us + * already, just apply the offset to the correct + * instruction location. + */ + return (real_pc + (npc - pc)); + } + + return real_pc + 0x4UL; +} + +/* If INSN is an instruction which writes it's PC location + * into a destination register, fix that up. + */ +static void retpc_fixup(struct pt_regs *regs, u32 insn, unsigned long real_pc) +{ + unsigned long *slot = NULL; + + /* Simplest cast is call, which always uses %o7 */ + if ((insn & 0xc0000000) == 0x40000000) { + slot = ®s->u_regs[UREG_I7]; + } + + /* Jmpl encodes the register inside of the opcode */ + if ((insn & 0xc1f80000) == 0x81c00000) { + unsigned long rd = ((insn >> 25) & 0x1f); + + if (rd <= 15) { + slot = ®s->u_regs[rd]; + } else { + /* Hard case, it goes onto the stack. */ + flushw_all(); + + rd -= 16; + slot = (unsigned long *) + (regs->u_regs[UREG_FP] + STACK_BIAS); + slot += rd; + } + } + if (slot != NULL) + *slot = real_pc; +} + +/* + * Called after single-stepping. p->addr is the address of the + * instruction whose first byte has been replaced by the breakpoint + * instruction. To avoid the SMP problems that can occur when we + * temporarily put back the original opcode to single-step, we + * single-stepped a copy of the instruction. The address of this + * copy is p->insn. + * + * This function prepares to return from the post-single-step + * breakpoint trap. + */ +static void resume_execution(struct kprobe *p, struct pt_regs *regs) +{ + u32 insn = p->insn[0]; + + regs->tpc = current_kprobe_orig_tnpc; + regs->tnpc = relbranch_fixup(insn, + (unsigned long) p->addr, + (unsigned long) &p->insn[0], + regs->tnpc); + retpc_fixup(regs, insn, (unsigned long) p->addr); + + regs->tstate = ((regs->tstate & ~TSTATE_PIL) | + current_kprobe_orig_tstate_pil); +} + +static inline int post_kprobe_handler(struct pt_regs *regs) +{ + if (!kprobe_running()) return 0; if (current_kprobe->post_handler) current_kprobe->post_handler(current_kprobe, regs, 0); - undo_singlestep(current_kprobe, regs); + resume_execution(current_kprobe, regs); unlock_kprobes(); preempt_enable_no_resched(); @@ -161,7 +243,7 @@ return 1; if (kprobe_status & KPROBE_HIT_SS) { - undo_singlestep(current_kprobe, regs); + resume_execution(current_kprobe, regs); unlock_kprobes(); preempt_enable_no_resched(); @@ -179,26 +261,26 @@ switch (val) { case DIE_DEBUG: if (kprobe_handler(args->regs)) - return NOTIFY_OK; + return NOTIFY_STOP; break; case DIE_DEBUG_2: if (post_kprobe_handler(args->regs)) - return NOTIFY_OK; + return NOTIFY_STOP; break; case DIE_GPF: if (kprobe_running() && kprobe_fault_handler(args->regs, args->trapnr)) - return NOTIFY_OK; + return NOTIFY_STOP; break; case DIE_PAGE_FAULT: if (kprobe_running() && kprobe_fault_handler(args->regs, args->trapnr)) - return NOTIFY_OK; + return NOTIFY_STOP; break; default: break; } - return NOTIFY_BAD; + return NOTIFY_DONE; } asmlinkage void kprobe_trap(unsigned long trap_level, struct pt_regs *regs) @@ -216,18 +298,20 @@ */ if (notify_die((trap_level == 0x170) ? DIE_DEBUG : DIE_DEBUG_2, (trap_level == 0x170) ? "debug" : "debug_2", - regs, 0, trap_level, SIGTRAP) != NOTIFY_OK) + regs, 0, trap_level, SIGTRAP) != NOTIFY_STOP) bad_trap(regs, trap_level); } /* Jprobes support. */ static struct pt_regs jprobe_saved_regs; +static struct pt_regs *jprobe_saved_regs_location; static struct sparc_stackf jprobe_saved_stack; int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) { struct jprobe *jp = container_of(p, struct jprobe, kp); + jprobe_saved_regs_location = regs; memcpy(&jprobe_saved_regs, regs, sizeof(*regs)); /* Save a whole stack frame, this gets arguments @@ -240,6 +324,7 @@ regs->tpc = (unsigned long) jp->entry; regs->tnpc = ((unsigned long) jp->entry) + 0x4UL; + regs->tstate |= TSTATE_PIL; return 1; } @@ -255,11 +340,23 @@ extern void jprobe_return_trap_instruction(void); +extern void __show_regs(struct pt_regs * regs); + int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) { u32 *addr = (u32 *) regs->tpc; if (addr == (u32 *) jprobe_return_trap_instruction) { + if (jprobe_saved_regs_location != regs) { + printk("JPROBE: Current regs (%p) does not match " + "saved regs (%p).\n", + regs, jprobe_saved_regs_location); + printk("JPROBE: Saved registers\n"); + __show_regs(jprobe_saved_regs_location); + printk("JPROBE: Current registers\n"); + __show_regs(regs); + BUG(); + } /* Restore old register state. Do pt_regs * first so that UREG_FP is the original one for * the stack frame restore. diff -Nru a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c --- a/arch/sparc64/kernel/signal32.c 2004-10-06 19:37:46 -07:00 +++ b/arch/sparc64/kernel/signal32.c 2004-10-06 19:37:46 -07:00 @@ -181,7 +181,7 @@ case __SI_TIMER >> 16: err |= __put_user(from->si_tid, &to->si_tid); err |= __put_user(from->si_overrun, &to->si_overrun); - err |= __put_user((u32)(u64)from->si_ptr, &to->si_ptr); + err |= __put_user(from->si_int, &to->si_int); break; case __SI_CHLD >> 16: err |= __put_user(from->si_utime, &to->si_utime); diff -Nru a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c --- a/arch/sparc64/kernel/traps.c 2004-10-06 19:37:48 -07:00 +++ b/arch/sparc64/kernel/traps.c 2004-10-06 19:37:48 -07:00 @@ -96,7 +96,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "bad trap", regs, - 0, lvl, SIGTRAP) == NOTIFY_OK) + 0, lvl, SIGTRAP) == NOTIFY_STOP) return; if (lvl < 0x100) { @@ -126,7 +126,7 @@ char buffer[32]; if (notify_die(DIE_TRAP_TL1, "bad trap tl1", regs, - 0, lvl, SIGTRAP) == NOTIFY_OK) + 0, lvl, SIGTRAP) == NOTIFY_STOP) return; dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); @@ -149,7 +149,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "instruction access exception", regs, - 0, 0x8, SIGTRAP) == NOTIFY_OK) + 0, 0x8, SIGTRAP) == NOTIFY_STOP) return; if (regs->tstate & TSTATE_PRIV) { @@ -173,7 +173,7 @@ unsigned long sfsr, unsigned long sfar) { if (notify_die(DIE_TRAP_TL1, "instruction access exception tl1", regs, - 0, 0x8, SIGTRAP) == NOTIFY_OK) + 0, 0x8, SIGTRAP) == NOTIFY_STOP) return; dump_tl1_traplog((struct tl1_traplog *)(regs + 1)); @@ -186,7 +186,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "data access exception", regs, - 0, 0x30, SIGTRAP) == NOTIFY_OK) + 0, 0x30, SIGTRAP) == NOTIFY_STOP) return; if (regs->tstate & TSTATE_PRIV) { @@ -260,7 +260,7 @@ spitfire_clean_and_reenable_l1_caches(); if (notify_die(DIE_TRAP, "instruction access exception", regs, - 0, 0x8, SIGTRAP) == NOTIFY_OK) + 0, 0x8, SIGTRAP) == NOTIFY_STOP) return; info.si_signo = SIGBUS; @@ -292,7 +292,7 @@ spitfire_clean_and_reenable_l1_caches(); if (notify_die(DIE_TRAP, "data access exception", regs, - 0, 0x30, SIGTRAP) == NOTIFY_OK) + 0, 0x30, SIGTRAP) == NOTIFY_STOP) return; info.si_signo = SIGBUS; @@ -1695,7 +1695,7 @@ void do_fpieee(struct pt_regs *regs) { if (notify_die(DIE_TRAP, "fpu exception ieee", regs, - 0, 0x24, SIGFPE) == NOTIFY_OK) + 0, 0x24, SIGFPE) == NOTIFY_STOP) return; do_fpe_common(regs); @@ -1709,7 +1709,7 @@ int ret = 0; if (notify_die(DIE_TRAP, "fpu exception other", regs, - 0, 0x25, SIGFPE) == NOTIFY_OK) + 0, 0x25, SIGFPE) == NOTIFY_STOP) return; switch ((current_thread_info()->xfsr[0] & 0x1c000)) { @@ -1728,7 +1728,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "tagged arithmetic overflow", regs, - 0, 0x26, SIGEMT) == NOTIFY_OK) + 0, 0x26, SIGEMT) == NOTIFY_STOP) return; if (regs->tstate & TSTATE_PRIV) @@ -1750,7 +1750,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "integer division by zero", regs, - 0, 0x28, SIGFPE) == NOTIFY_OK) + 0, 0x28, SIGFPE) == NOTIFY_STOP) return; if (regs->tstate & TSTATE_PRIV) @@ -1936,7 +1936,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "illegal instruction", regs, - 0, 0x10, SIGILL) == NOTIFY_OK) + 0, 0x10, SIGILL) == NOTIFY_STOP) return; if (tstate & TSTATE_PRIV) @@ -1965,7 +1965,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "memory address unaligned", regs, - 0, 0x34, SIGSEGV) == NOTIFY_OK) + 0, 0x34, SIGSEGV) == NOTIFY_STOP) return; if (regs->tstate & TSTATE_PRIV) { @@ -1991,7 +1991,7 @@ siginfo_t info; if (notify_die(DIE_TRAP, "privileged operation", regs, - 0, 0x11, SIGILL) == NOTIFY_OK) + 0, 0x11, SIGILL) == NOTIFY_STOP) return; if (test_thread_flag(TIF_32BIT)) { diff -Nru a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c --- a/arch/sparc64/mm/fault.c 2004-10-06 19:37:48 -07:00 +++ b/arch/sparc64/mm/fault.c 2004-10-06 19:37:48 -07:00 @@ -149,7 +149,7 @@ (tsk->mm ? (unsigned long) tsk->mm->pgd : (unsigned long) tsk->active_mm->pgd)); if (notify_die(DIE_GPF, "general protection fault", regs, - 0, 0, SIGSEGV) == NOTIFY_OK) + 0, 0, SIGSEGV) == NOTIFY_STOP) return; die_if_kernel("Oops", regs); } @@ -325,7 +325,7 @@ fault_code = get_thread_fault_code(); if (notify_die(DIE_PAGE_FAULT, "page_fault", regs, - fault_code, 0, SIGSEGV) == NOTIFY_OK) + fault_code, 0, SIGSEGV) == NOTIFY_STOP) return; si_code = SEGV_MAPERR; diff -Nru a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c --- a/arch/sparc64/solaris/misc.c 2004-10-06 19:37:47 -07:00 +++ b/arch/sparc64/solaris/misc.c 2004-10-06 19:37:47 -07:00 @@ -148,10 +148,10 @@ if (copy_to_user(to, from, len)) return -EFAULT; + off = len < to_size? len: len - 1; if (dotchop) { - off = (strnchr(from, len, '.') - from); - } else{ - off = len - 1; + const char *p = strnchr(from, len, '.'); + if (p) off = p - from; } if (__put_user('\0', to + off)) diff -Nru a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile --- a/arch/um/kernel/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/um/kernel/Makefile 2004-10-06 19:37:47 -07:00 @@ -3,7 +3,7 @@ # Licensed under the GPL # -extra-y := vmlinux.lds uml.lds dyn.lds +extra-y := vmlinux.lds # Descend into ../util for make clean. This is here because it doesn't work # in arch/um/Makefile. @@ -47,7 +47,7 @@ $(obj)/config.o : $(obj)/config.c -quiet_cmd_quote = QUOTE $@ +quiet_cmd_quote = QUOTE $@ cmd_quote = $(PERL) -e $(QUOTE) < $< > $@ targets += config.c diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig --- a/arch/x86_64/Kconfig 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/Kconfig 2004-10-06 19:37:47 -07:00 @@ -359,7 +359,6 @@ config UNORDERED_IO bool "Unordered IO mapping access" depends on EXPERIMENTAL - select UNORDERED_IO help Use unordered stores to access IO memory mappings in device drivers. Still very experimental. When a driver works on IA64/ppc64/pa-risc it should diff -Nru a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug --- a/arch/x86_64/Kconfig.debug 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/Kconfig.debug 2004-10-06 19:37:47 -07:00 @@ -30,15 +30,6 @@ application, you can say N to avoid the very slight overhead this adds. -config FRAME_POINTER - bool "Compile the kernel with frame pointers" - help - Compile the kernel with frame pointers. This may help for some - debugging with external debuggers. Note the standard oops backtracer - doesn't make use of this and the x86-64 kernel doesn't ensure a - consistent frame pointer through inline assembly (semaphores etc.) - Normally you should say N. - config IOMMU_DEBUG depends on GART_IOMMU && DEBUG_KERNEL bool "Enable IOMMU debugging" diff -Nru a/arch/x86_64/Makefile b/arch/x86_64/Makefile --- a/arch/x86_64/Makefile 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/Makefile 2004-10-06 19:37:47 -07:00 @@ -37,7 +37,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := -e stext -CHECKFLAGS += -D__x86_64__=1 -m64 +CHECKFLAGS += -D__x86_64__ -m64 cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) diff -Nru a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c --- a/arch/x86_64/ia32/syscall32.c 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/ia32/syscall32.c 2004-10-06 19:37:47 -07:00 @@ -30,16 +30,20 @@ char *syscall32_page; static int use_sysenter __initdata = -1; -/* RED-PEN: This knows too much about high level VM */ -/* Alternative would be to generate a vma with appropriate backing options - and let it be handled by generic VM */ -int map_syscall32(struct mm_struct *mm, unsigned long address) +/* + * Map the 32bit vsyscall page on demand. + * + * RED-PEN: This knows too much about high level VM. + * + * Alternative would be to generate a vma with appropriate backing options + * and let it be handled by generic VM. + */ +int __map_syscall32(struct mm_struct *mm, unsigned long address) { pte_t *pte; pmd_t *pmd; int err = 0; - down_read(&mm->mmap_sem); spin_lock(&mm->page_table_lock); pmd = pmd_alloc(mm, pgd_offset(mm, address), address); if (pmd && (pte = pte_alloc_map(mm, pmd, address)) != NULL) { @@ -54,6 +58,14 @@ } else err = -ENOMEM; spin_unlock(&mm->page_table_lock); + return err; +} + +int map_syscall32(struct mm_struct *mm, unsigned long address) +{ + int err; + down_read(&mm->mmap_sem); + err = __map_syscall32(mm, address); up_read(&mm->mmap_sem); return err; } diff -Nru a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c --- a/arch/x86_64/kernel/io_apic.c 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/kernel/io_apic.c 2004-10-06 19:37:47 -07:00 @@ -735,7 +735,7 @@ entry.delivery_mode = dest_LowestPrio; entry.dest_mode = INT_DELIVERY_MODE; entry.mask = 0; /* enable IRQ */ - entry.dest.logical.logical_dest = TARGET_CPUS; + entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); idx = find_irq_entry(apic,pin,mp_INT); if (idx == -1) { @@ -753,7 +753,7 @@ if (irq_trigger(idx)) { entry.trigger = 1; entry.mask = 1; - entry.dest.logical.logical_dest = TARGET_CPUS; + entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); } irq = pin_2_irq(idx, apic, pin); @@ -803,7 +803,7 @@ */ entry.dest_mode = INT_DELIVERY_MODE; entry.mask = 0; /* unmask IRQ now */ - entry.dest.logical.logical_dest = TARGET_CPUS; + entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); entry.delivery_mode = dest_LowestPrio; entry.polarity = 0; entry.trigger = 0; @@ -2011,7 +2011,7 @@ entry.delivery_mode = dest_LowestPrio; entry.dest_mode = INT_DELIVERY_MODE; - entry.dest.logical.logical_dest = TARGET_CPUS; + entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); entry.trigger = edge_level; entry.polarity = active_high_low; entry.mask = 1; /* Disabled (masked) */ @@ -2069,3 +2069,28 @@ apic_write_around(APIC_ICR, cfg); } #endif + + +/* + * This function currently is only a helper for the i386 smp boot process where + * we need to reprogram the ioredtbls to cater for the cpus which have come online + * so mask in all cases should simply be TARGET_CPUS + */ +void __init setup_ioapic_dest(void) +{ + int pin, ioapic, irq, irq_entry; + + if (skip_ioapic_setup == 1) + return; + + for (ioapic = 0; ioapic < nr_ioapics; ioapic++) { + for (pin = 0; pin < nr_ioapic_registers[ioapic]; pin++) { + irq_entry = find_irq_entry(ioapic, pin, mp_INT); + if (irq_entry == -1) + continue; + irq = pin_2_irq(irq_entry, ioapic, pin); + set_ioapic_affinity_irq(irq, TARGET_CPUS); + } + + } +} diff -Nru a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c --- a/arch/x86_64/kernel/mce.c 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/kernel/mce.c 2004-10-06 19:37:47 -07:00 @@ -72,7 +72,8 @@ static void print_mce(struct mce *m) { - printk(KERN_EMERG + printk(KERN_EMERG "\n" + KERN_EMERG "CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n", m->cpu, m->mcgstatus, m->bank, m->status); if (m->rip) { @@ -101,7 +102,7 @@ if (time_before(tsc, start)) continue; print_mce(&mcelog.entry[i]); - if (mcelog.entry[i].tsc == backup->tsc) + if (backup && mcelog.entry[i].tsc == backup->tsc) backup = NULL; } if (backup) diff -Nru a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c --- a/arch/x86_64/kernel/nmi.c 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/kernel/nmi.c 2004-10-06 19:37:47 -07:00 @@ -390,7 +390,8 @@ */ alert_counter[cpu]++; if (alert_counter[cpu] == 5*nmi_hz) { - if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_BAD) { + if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) + == NOTIFY_STOP) { alert_counter[cpu] = 0; return; } diff -Nru a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c --- a/arch/x86_64/kernel/smp.c 2004-10-06 19:37:48 -07:00 +++ b/arch/x86_64/kernel/smp.c 2004-10-06 19:37:48 -07:00 @@ -382,28 +382,14 @@ * this function sends a 'generic call function' IPI to all other CPUs * in the system. */ - -int smp_call_function (void (*func) (void *info), void *info, int nonatomic, - int wait) -/* - * [SUMMARY] Run a function on all other CPUs. - * The function to run. This must be fast and non-blocking. - * An arbitrary pointer to pass to the function. - * currently unused. - * If true, wait (atomically) until function has completed on other CPUs. - * [RETURNS] 0 on success, else a negative status code. Does not return until - * remote CPUs are nearly ready to execute <> or are or have executed. - * - * You must not call this function with disabled interrupts or from a - * hardware interrupt handler or from a bottom half handler. - * Actually there are a few legal cases, like panic. - */ +static void __smp_call_function (void (*func) (void *info), void *info, + int nonatomic, int wait) { struct call_data_struct data; int cpus = num_online_cpus()-1; if (!cpus) - return 0; + return; data.func = func; data.info = info; @@ -412,7 +398,6 @@ if (wait) atomic_set(&data.finished, 0); - spin_lock(&call_lock); call_data = &data; wmb(); /* Send a message to all other CPUs and wait for them to respond */ @@ -425,8 +410,29 @@ if (wait) while (atomic_read(&data.finished) != cpus) barrier(); - spin_unlock(&call_lock); +} +/* + * smp_call_function - run a function on all other CPUs. + * @func: The function to run. This must be fast and non-blocking. + * @info: An arbitrary pointer to pass to the function. + * @nonatomic: currently unused. + * @wait: If true, wait (atomically) until function has completed on other + * CPUs. + * + * Returns 0 on success, else a negative status code. Does not return until + * remote CPUs are nearly ready to execute func or are or have executed. + * + * You must not call this function with disabled interrupts or from a + * hardware interrupt handler or from a bottom half handler. + * Actually there are a few legal cases, like panic. + */ +int smp_call_function (void (*func) (void *info), void *info, int nonatomic, + int wait) +{ + spin_lock(&call_lock); + __smp_call_function(func,info,nonatomic,wait); + spin_unlock(&call_lock); return 0; } @@ -450,7 +456,16 @@ void smp_send_stop(void) { - smp_call_function(smp_really_stop_cpu, NULL, 1, 0); + int nolock = 0; + /* Don't deadlock on the call lock in panic */ + if (!spin_trylock(&call_lock)) { + udelay(100); + /* ignore locking because we have paniced anyways */ + nolock = 1; + } + __smp_call_function(smp_really_stop_cpu, NULL, 1, 0); + if (!nolock) + spin_unlock(&call_lock); smp_stop_cpu(); } diff -Nru a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c --- a/arch/x86_64/kernel/smpboot.c 2004-10-06 19:37:48 -07:00 +++ b/arch/x86_64/kernel/smpboot.c 2004-10-06 19:37:48 -07:00 @@ -950,6 +950,9 @@ void __init smp_cpus_done(unsigned int max_cpus) { +#ifdef CONFIG_X86_IO_APIC + setup_ioapic_dest(); +#endif zap_low_mappings(); } diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c --- a/arch/x86_64/kernel/time.c 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/kernel/time.c 2004-10-06 19:37:47 -07:00 @@ -32,6 +32,7 @@ #include #include #include +#include #include #ifdef CONFIG_X86_LOCAL_APIC #include @@ -179,17 +180,27 @@ EXPORT_SYMBOL(do_settimeofday); -#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) unsigned long profile_pc(struct pt_regs *regs) { unsigned long pc = instruction_pointer(regs); - if (in_lock_functions(pc)) - return *(unsigned long *)regs->rbp; + /* Assume the lock function has either no stack frame or only a single word. + This checks if the address on the stack looks like a kernel text address. + There is a small window for false hits, but in that case the tick + is just accounted to the spinlock function. + Better would be to write these functions in assembler again + and check exactly. */ + if (in_lock_functions(pc)) { + char *v = *(char **)regs->rsp; + if ((v >= _stext && v <= _etext) || + (v >= _sinittext && v <= _einittext) || + (v >= (char *)MODULES_VADDR && v <= (char *)MODULES_END)) + return (unsigned long)v; + return ((unsigned long *)regs->rsp)[1]; + } return pc; } EXPORT_SYMBOL(profile_pc); -#endif /* * In order to set the CMOS clock precisely, set_rtc_mmss has to be called 500 @@ -802,9 +813,9 @@ outl(0x800038a0, 0xcf8); outl(0xff000001, 0xcfc); outl(0x800038a0, 0xcf8); - hpet_address = inl(0xcfc) & 0xfffffffe; + vxtime.hpet_address = inl(0xcfc) & 0xfffffffe; printk(KERN_WARNING "time.c: WARNING: Enabled HPET " - "at %#lx.\n", hpet_address); + "at %#lx.\n", vxtime.hpet_address); } #endif if (nohpet) @@ -873,11 +884,12 @@ static int time_resume(struct sys_device *dev) { + unsigned long flags; unsigned long sec = get_cmos_time() + clock_cmos_diff; - write_seqlock_irq(&xtime_lock); + write_seqlock_irqsave(&xtime_lock,flags); xtime.tv_sec = sec; xtime.tv_nsec = 0; - write_sequnlock_irq(&xtime_lock); + write_sequnlock_irqrestore(&xtime_lock,flags); return 0; } diff -Nru a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c --- a/arch/x86_64/kernel/traps.c 2004-10-06 19:37:46 -07:00 +++ b/arch/x86_64/kernel/traps.c 2004-10-06 19:37:46 -07:00 @@ -437,7 +437,8 @@ #define DO_ERROR(trapnr, signr, str, name) \ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ { \ - if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_BAD) \ + if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ + == NOTIFY_STOP) \ return; \ do_trap(trapnr, signr, str, regs, error_code, NULL); \ } @@ -450,7 +451,8 @@ info.si_errno = 0; \ info.si_code = sicode; \ info.si_addr = (void __user *)siaddr; \ - if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_BAD) \ + if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ + == NOTIFY_STOP) \ return; \ do_trap(trapnr, signr, str, regs, error_code, &info); \ } @@ -471,7 +473,8 @@ asmlinkage void *do_##name(struct pt_regs * regs, long error_code) \ { \ struct pt_regs *pr = ((struct pt_regs *)(current->thread.rsp0))-1; \ - if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_BAD) \ + if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ + == NOTIFY_STOP) \ return regs; \ if (regs->cs & 3) { \ memcpy(pr, regs, sizeof(struct pt_regs)); \ @@ -565,7 +568,8 @@ unsigned char reason = inb(0x61); if (!(reason & 0xc0)) { - if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) == NOTIFY_BAD) + if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) + == NOTIFY_STOP) return; #ifdef CONFIG_X86_LOCAL_APIC /* @@ -580,7 +584,7 @@ unknown_nmi_error(reason, regs); return; } - if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_BAD) + if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP) return; if (reason & 0x80) mem_parity_error(reason, regs); @@ -676,7 +680,7 @@ clear_TF: /* RED-PEN could cause spurious errors */ if (notify_die(DIE_DEBUG, "debug2", regs, condition, 1, SIGTRAP) - != NOTIFY_BAD) + != NOTIFY_STOP) regs->eflags &= ~TF_MASK; return regs; } diff -Nru a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c --- a/arch/x86_64/mm/init.c 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/mm/init.c 2004-10-06 19:37:47 -07:00 @@ -609,7 +609,7 @@ if (test_tsk_thread_flag(tsk, TIF_IA32)) { /* lookup code assumes the pages are present. set them up now */ - if (map_syscall32(tsk->mm, 0xfffe000) < 0) + if (__map_syscall32(tsk->mm, 0xfffe000) < 0) return NULL; return &gate32_vma; } diff -Nru a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c --- a/arch/x86_64/mm/ioremap.c 2004-10-06 19:37:47 -07:00 +++ b/arch/x86_64/mm/ioremap.c 2004-10-06 19:37:47 -07:00 @@ -111,7 +111,7 @@ * have to convert them into an offset in a page-aligned mapping, but the * caller shouldn't need to know that small detail. */ -void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) +void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { void * addr; struct vm_struct * area; @@ -126,7 +126,7 @@ * Don't remap the low PCI/ISA area, it's always mapped.. */ if (phys_addr >= 0xA0000 && last_addr < 0x100000) - return phys_to_virt(phys_addr); + return (__force void __iomem *)phys_to_virt(phys_addr); /* * Don't allow anybody to remap normal RAM that we're using.. @@ -164,7 +164,7 @@ vunmap(addr); return NULL; } - return (void *) (offset + (char *)addr); + return (__force void __iomem *) (offset + (char *)addr); } /** @@ -189,9 +189,9 @@ * Must be freed with iounmap. */ -void *ioremap_nocache (unsigned long phys_addr, unsigned long size) +void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size) { - void *p = __ioremap(phys_addr, size, _PAGE_PCD); + void __iomem *p = __ioremap(phys_addr, size, _PAGE_PCD); if (!p) return p; @@ -212,7 +212,7 @@ return p; } -void iounmap(void *addr) +void iounmap(void __iomem *addr) { struct vm_struct *p; if (addr <= high_memory) diff -Nru a/crypto/aes.c b/crypto/aes.c --- a/crypto/aes.c 2004-10-06 19:37:48 -07:00 +++ b/crypto/aes.c 2004-10-06 19:37:48 -07:00 @@ -102,10 +102,10 @@ #define E_KEY ctx->E #define D_KEY ctx->D -static u8 pow_tab[256]; -static u8 log_tab[256]; -static u8 sbx_tab[256]; -static u8 isb_tab[256]; +static u8 pow_tab[256] __initdata; +static u8 log_tab[256] __initdata; +static u8 sbx_tab[256] __initdata; +static u8 isb_tab[256] __initdata; static u32 rco_tab[10]; static u32 ft_tab[4][256]; static u32 it_tab[4][256]; @@ -113,7 +113,7 @@ static u32 fl_tab[4][256]; static u32 il_tab[4][256]; -static inline u8 +static inline u8 __init f_mult (u8 a, u8 b) { u8 aa = log_tab[a], cc = aa + log_tab[b]; @@ -153,7 +153,7 @@ il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) -static void +static void __init gen_tabs (void) { u32 i, t; diff -Nru a/drivers/block/DAC960.c b/drivers/block/DAC960.c --- a/drivers/block/DAC960.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/block/DAC960.c 2004-10-06 19:37:47 -07:00 @@ -540,7 +540,7 @@ static void DAC960_BA_QueueCommand(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox; DAC960_V2_CommandMailbox_T *NextCommandMailbox = Controller->V2.NextCommandMailbox; @@ -565,7 +565,7 @@ static void DAC960_LP_QueueCommand(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox; DAC960_V2_CommandMailbox_T *NextCommandMailbox = Controller->V2.NextCommandMailbox; @@ -591,7 +591,7 @@ static void DAC960_LA_QueueCommandDualMode(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox; DAC960_V1_CommandMailbox_T *NextCommandMailbox = Controller->V1.NextCommandMailbox; @@ -617,7 +617,7 @@ static void DAC960_LA_QueueCommandSingleMode(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox; DAC960_V1_CommandMailbox_T *NextCommandMailbox = Controller->V1.NextCommandMailbox; @@ -643,7 +643,7 @@ static void DAC960_PG_QueueCommandDualMode(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox; DAC960_V1_CommandMailbox_T *NextCommandMailbox = Controller->V1.NextCommandMailbox; @@ -669,7 +669,7 @@ static void DAC960_PG_QueueCommandSingleMode(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox; DAC960_V1_CommandMailbox_T *NextCommandMailbox = Controller->V1.NextCommandMailbox; @@ -694,7 +694,7 @@ static void DAC960_PD_QueueCommand(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox; CommandMailbox->Common.CommandIdentifier = Command->CommandIdentifier; while (DAC960_PD_MailboxFullP(ControllerBaseAddress)) @@ -711,7 +711,7 @@ static void DAC960_P_QueueCommand(DAC960_Command_T *Command) { DAC960_Controller_T *Controller = Command->Controller; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox; CommandMailbox->Common.CommandIdentifier = Command->CommandIdentifier; switch (CommandMailbox->Common.CommandOpcode) @@ -1132,7 +1132,7 @@ static boolean DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T *Controller) { - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_HardwareType_T hw_type = Controller->HardwareType; struct pci_dev *PCI_Device = Controller->PCIDevice; struct dma_loaf *DmaPages = &Controller->DmaPages; @@ -1338,7 +1338,7 @@ static boolean DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T *Controller) { - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; struct pci_dev *PCI_Device = Controller->PCIDevice; struct dma_loaf *DmaPages = &Controller->DmaPages; size_t DmaPagesSize; @@ -2679,7 +2679,7 @@ unsigned char DeviceFunction = PCI_Device->devfn; unsigned char ErrorStatus, Parameter0, Parameter1; unsigned int IRQ_Channel = PCI_Device->irq; - void *BaseAddress; + void __iomem *BaseAddress; int i; Controller = (DAC960_Controller_T *) @@ -5201,7 +5201,7 @@ struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5244,7 +5244,7 @@ struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5287,7 +5287,7 @@ struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5326,7 +5326,7 @@ struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5365,7 +5365,7 @@ struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; unsigned long flags; spin_lock_irqsave(&Controller->queue_lock, flags); @@ -5404,7 +5404,7 @@ struct pt_regs *InterruptRegisters) { DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; - void *ControllerBaseAddress = Controller->BaseAddress; + void __iomem *ControllerBaseAddress = Controller->BaseAddress; unsigned long flags; spin_lock_irqsave(&Controller->queue_lock, flags); diff -Nru a/drivers/block/DAC960.h b/drivers/block/DAC960.h --- a/drivers/block/DAC960.h 2004-10-06 19:37:48 -07:00 +++ b/drivers/block/DAC960.h 2004-10-06 19:37:48 -07:00 @@ -2282,8 +2282,8 @@ typedef struct DAC960_Controller { - void *BaseAddress; - void *MemoryMappedAddress; + void __iomem *BaseAddress; + void __iomem *MemoryMappedAddress; DAC960_FirmwareType_T FirmwareType; DAC960_HardwareType_T HardwareType; DAC960_IO_Address_T IO_Address; @@ -2527,7 +2527,7 @@ * dma_addr_t. */ static inline -void dma_addr_writeql(dma_addr_t addr, void *write_address) +void dma_addr_writeql(dma_addr_t addr, void __iomem *write_address) { union { u64 wq; @@ -2643,7 +2643,7 @@ */ static inline -void DAC960_BA_HardwareMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_BA_HardwareMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2653,7 +2653,7 @@ } static inline -void DAC960_BA_AcknowledgeHardwareMailboxStatus(void *ControllerBaseAddress) +void DAC960_BA_AcknowledgeHardwareMailboxStatus(void __iomem *ControllerBaseAddress) { DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2663,7 +2663,7 @@ } static inline -void DAC960_BA_GenerateInterrupt(void *ControllerBaseAddress) +void DAC960_BA_GenerateInterrupt(void __iomem *ControllerBaseAddress) { DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2673,7 +2673,7 @@ } static inline -void DAC960_BA_ControllerReset(void *ControllerBaseAddress) +void DAC960_BA_ControllerReset(void __iomem *ControllerBaseAddress) { DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2683,7 +2683,7 @@ } static inline -void DAC960_BA_MemoryMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_BA_MemoryMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2693,7 +2693,7 @@ } static inline -boolean DAC960_BA_HardwareMailboxFullP(void *ControllerBaseAddress) +boolean DAC960_BA_HardwareMailboxFullP(void __iomem *ControllerBaseAddress) { DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -2702,7 +2702,7 @@ } static inline -boolean DAC960_BA_InitializationInProgressP(void *ControllerBaseAddress) +boolean DAC960_BA_InitializationInProgressP(void __iomem *ControllerBaseAddress) { DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -2711,7 +2711,7 @@ } static inline -void DAC960_BA_AcknowledgeHardwareMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_BA_AcknowledgeHardwareMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -2721,7 +2721,7 @@ } static inline -void DAC960_BA_AcknowledgeMemoryMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_BA_AcknowledgeMemoryMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -2731,7 +2731,7 @@ } static inline -void DAC960_BA_AcknowledgeInterrupt(void *ControllerBaseAddress) +void DAC960_BA_AcknowledgeInterrupt(void __iomem *ControllerBaseAddress) { DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -2742,7 +2742,7 @@ } static inline -boolean DAC960_BA_HardwareMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_BA_HardwareMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -2751,7 +2751,7 @@ } static inline -boolean DAC960_BA_MemoryMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_BA_MemoryMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -2760,7 +2760,7 @@ } static inline -void DAC960_BA_EnableInterrupts(void *ControllerBaseAddress) +void DAC960_BA_EnableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_BA_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0xFF; @@ -2771,7 +2771,7 @@ } static inline -void DAC960_BA_DisableInterrupts(void *ControllerBaseAddress) +void DAC960_BA_DisableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_BA_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0xFF; @@ -2782,7 +2782,7 @@ } static inline -boolean DAC960_BA_InterruptsEnabledP(void *ControllerBaseAddress) +boolean DAC960_BA_InterruptsEnabledP(void __iomem *ControllerBaseAddress) { DAC960_BA_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = @@ -2805,7 +2805,7 @@ static inline -void DAC960_BA_WriteHardwareMailbox(void *ControllerBaseAddress, +void DAC960_BA_WriteHardwareMailbox(void __iomem *ControllerBaseAddress, dma_addr_t CommandMailboxDMA) { dma_addr_writeql(CommandMailboxDMA, @@ -2814,19 +2814,19 @@ } static inline DAC960_V2_CommandIdentifier_T -DAC960_BA_ReadCommandIdentifier(void *ControllerBaseAddress) +DAC960_BA_ReadCommandIdentifier(void __iomem *ControllerBaseAddress) { return readw(ControllerBaseAddress + DAC960_BA_CommandStatusOffset); } static inline DAC960_V2_CommandStatus_T -DAC960_BA_ReadCommandStatus(void *ControllerBaseAddress) +DAC960_BA_ReadCommandStatus(void __iomem *ControllerBaseAddress) { return readw(ControllerBaseAddress + DAC960_BA_CommandStatusOffset + 2); } static inline boolean -DAC960_BA_ReadErrorStatus(void *ControllerBaseAddress, +DAC960_BA_ReadErrorStatus(void __iomem *ControllerBaseAddress, unsigned char *ErrorStatus, unsigned char *Parameter0, unsigned char *Parameter1) @@ -2948,7 +2948,7 @@ */ static inline -void DAC960_LP_HardwareMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_LP_HardwareMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2958,7 +2958,7 @@ } static inline -void DAC960_LP_AcknowledgeHardwareMailboxStatus(void *ControllerBaseAddress) +void DAC960_LP_AcknowledgeHardwareMailboxStatus(void __iomem *ControllerBaseAddress) { DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2968,7 +2968,7 @@ } static inline -void DAC960_LP_GenerateInterrupt(void *ControllerBaseAddress) +void DAC960_LP_GenerateInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2978,7 +2978,7 @@ } static inline -void DAC960_LP_ControllerReset(void *ControllerBaseAddress) +void DAC960_LP_ControllerReset(void __iomem *ControllerBaseAddress) { DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2988,7 +2988,7 @@ } static inline -void DAC960_LP_MemoryMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_LP_MemoryMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -2998,7 +2998,7 @@ } static inline -boolean DAC960_LP_HardwareMailboxFullP(void *ControllerBaseAddress) +boolean DAC960_LP_HardwareMailboxFullP(void __iomem *ControllerBaseAddress) { DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3007,7 +3007,7 @@ } static inline -boolean DAC960_LP_InitializationInProgressP(void *ControllerBaseAddress) +boolean DAC960_LP_InitializationInProgressP(void __iomem *ControllerBaseAddress) { DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3016,7 +3016,7 @@ } static inline -void DAC960_LP_AcknowledgeHardwareMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_LP_AcknowledgeHardwareMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3026,7 +3026,7 @@ } static inline -void DAC960_LP_AcknowledgeMemoryMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_LP_AcknowledgeMemoryMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3036,7 +3036,7 @@ } static inline -void DAC960_LP_AcknowledgeInterrupt(void *ControllerBaseAddress) +void DAC960_LP_AcknowledgeInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3047,7 +3047,7 @@ } static inline -boolean DAC960_LP_HardwareMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_LP_HardwareMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -3056,7 +3056,7 @@ } static inline -boolean DAC960_LP_MemoryMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_LP_MemoryMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -3065,7 +3065,7 @@ } static inline -void DAC960_LP_EnableInterrupts(void *ControllerBaseAddress) +void DAC960_LP_EnableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_LP_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0xFF; @@ -3075,7 +3075,7 @@ } static inline -void DAC960_LP_DisableInterrupts(void *ControllerBaseAddress) +void DAC960_LP_DisableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_LP_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0xFF; @@ -3085,7 +3085,7 @@ } static inline -boolean DAC960_LP_InterruptsEnabledP(void *ControllerBaseAddress) +boolean DAC960_LP_InterruptsEnabledP(void __iomem *ControllerBaseAddress) { DAC960_LP_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = @@ -3107,7 +3107,7 @@ } static inline -void DAC960_LP_WriteHardwareMailbox(void *ControllerBaseAddress, +void DAC960_LP_WriteHardwareMailbox(void __iomem *ControllerBaseAddress, dma_addr_t CommandMailboxDMA) { dma_addr_writeql(CommandMailboxDMA, @@ -3116,19 +3116,19 @@ } static inline DAC960_V2_CommandIdentifier_T -DAC960_LP_ReadCommandIdentifier(void *ControllerBaseAddress) +DAC960_LP_ReadCommandIdentifier(void __iomem *ControllerBaseAddress) { return readw(ControllerBaseAddress + DAC960_LP_CommandStatusOffset); } static inline DAC960_V2_CommandStatus_T -DAC960_LP_ReadCommandStatus(void *ControllerBaseAddress) +DAC960_LP_ReadCommandStatus(void __iomem *ControllerBaseAddress) { return readw(ControllerBaseAddress + DAC960_LP_CommandStatusOffset + 2); } static inline boolean -DAC960_LP_ReadErrorStatus(void *ControllerBaseAddress, +DAC960_LP_ReadErrorStatus(void __iomem *ControllerBaseAddress, unsigned char *ErrorStatus, unsigned char *Parameter0, unsigned char *Parameter1) @@ -3262,7 +3262,7 @@ */ static inline -void DAC960_LA_HardwareMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_LA_HardwareMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3272,7 +3272,7 @@ } static inline -void DAC960_LA_AcknowledgeHardwareMailboxStatus(void *ControllerBaseAddress) +void DAC960_LA_AcknowledgeHardwareMailboxStatus(void __iomem *ControllerBaseAddress) { DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3282,7 +3282,7 @@ } static inline -void DAC960_LA_GenerateInterrupt(void *ControllerBaseAddress) +void DAC960_LA_GenerateInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3292,7 +3292,7 @@ } static inline -void DAC960_LA_ControllerReset(void *ControllerBaseAddress) +void DAC960_LA_ControllerReset(void __iomem *ControllerBaseAddress) { DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3302,7 +3302,7 @@ } static inline -void DAC960_LA_MemoryMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_LA_MemoryMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3312,7 +3312,7 @@ } static inline -boolean DAC960_LA_HardwareMailboxFullP(void *ControllerBaseAddress) +boolean DAC960_LA_HardwareMailboxFullP(void __iomem *ControllerBaseAddress) { DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3321,7 +3321,7 @@ } static inline -boolean DAC960_LA_InitializationInProgressP(void *ControllerBaseAddress) +boolean DAC960_LA_InitializationInProgressP(void __iomem *ControllerBaseAddress) { DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3330,7 +3330,7 @@ } static inline -void DAC960_LA_AcknowledgeHardwareMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_LA_AcknowledgeHardwareMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3340,7 +3340,7 @@ } static inline -void DAC960_LA_AcknowledgeMemoryMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_LA_AcknowledgeMemoryMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3350,7 +3350,7 @@ } static inline -void DAC960_LA_AcknowledgeInterrupt(void *ControllerBaseAddress) +void DAC960_LA_AcknowledgeInterrupt(void __iomem *ControllerBaseAddress) { DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3361,7 +3361,7 @@ } static inline -boolean DAC960_LA_HardwareMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_LA_HardwareMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -3370,7 +3370,7 @@ } static inline -boolean DAC960_LA_MemoryMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_LA_MemoryMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -3379,7 +3379,7 @@ } static inline -void DAC960_LA_EnableInterrupts(void *ControllerBaseAddress) +void DAC960_LA_EnableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_LA_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0xFF; @@ -3389,7 +3389,7 @@ } static inline -void DAC960_LA_DisableInterrupts(void *ControllerBaseAddress) +void DAC960_LA_DisableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_LA_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0xFF; @@ -3399,7 +3399,7 @@ } static inline -boolean DAC960_LA_InterruptsEnabledP(void *ControllerBaseAddress) +boolean DAC960_LA_InterruptsEnabledP(void __iomem *ControllerBaseAddress) { DAC960_LA_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = @@ -3422,7 +3422,7 @@ } static inline -void DAC960_LA_WriteHardwareMailbox(void *ControllerBaseAddress, +void DAC960_LA_WriteHardwareMailbox(void __iomem *ControllerBaseAddress, DAC960_V1_CommandMailbox_T *CommandMailbox) { writel(CommandMailbox->Words[0], @@ -3436,20 +3436,20 @@ } static inline DAC960_V1_CommandIdentifier_T -DAC960_LA_ReadStatusCommandIdentifier(void *ControllerBaseAddress) +DAC960_LA_ReadStatusCommandIdentifier(void __iomem *ControllerBaseAddress) { return readb(ControllerBaseAddress + DAC960_LA_StatusCommandIdentifierRegOffset); } static inline DAC960_V1_CommandStatus_T -DAC960_LA_ReadStatusRegister(void *ControllerBaseAddress) +DAC960_LA_ReadStatusRegister(void __iomem *ControllerBaseAddress) { return readw(ControllerBaseAddress + DAC960_LA_StatusRegisterOffset); } static inline boolean -DAC960_LA_ReadErrorStatus(void *ControllerBaseAddress, +DAC960_LA_ReadErrorStatus(void __iomem *ControllerBaseAddress, unsigned char *ErrorStatus, unsigned char *Parameter0, unsigned char *Parameter1) @@ -3583,7 +3583,7 @@ */ static inline -void DAC960_PG_HardwareMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_PG_HardwareMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3593,7 +3593,7 @@ } static inline -void DAC960_PG_AcknowledgeHardwareMailboxStatus(void *ControllerBaseAddress) +void DAC960_PG_AcknowledgeHardwareMailboxStatus(void __iomem *ControllerBaseAddress) { DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3603,7 +3603,7 @@ } static inline -void DAC960_PG_GenerateInterrupt(void *ControllerBaseAddress) +void DAC960_PG_GenerateInterrupt(void __iomem *ControllerBaseAddress) { DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3613,7 +3613,7 @@ } static inline -void DAC960_PG_ControllerReset(void *ControllerBaseAddress) +void DAC960_PG_ControllerReset(void __iomem *ControllerBaseAddress) { DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3623,7 +3623,7 @@ } static inline -void DAC960_PG_MemoryMailboxNewCommand(void *ControllerBaseAddress) +void DAC960_PG_MemoryMailboxNewCommand(void __iomem *ControllerBaseAddress) { DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3633,7 +3633,7 @@ } static inline -boolean DAC960_PG_HardwareMailboxFullP(void *ControllerBaseAddress) +boolean DAC960_PG_HardwareMailboxFullP(void __iomem *ControllerBaseAddress) { DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3642,7 +3642,7 @@ } static inline -boolean DAC960_PG_InitializationInProgressP(void *ControllerBaseAddress) +boolean DAC960_PG_InitializationInProgressP(void __iomem *ControllerBaseAddress) { DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3651,7 +3651,7 @@ } static inline -void DAC960_PG_AcknowledgeHardwareMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_PG_AcknowledgeHardwareMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3661,7 +3661,7 @@ } static inline -void DAC960_PG_AcknowledgeMemoryMailboxInterrupt(void *ControllerBaseAddress) +void DAC960_PG_AcknowledgeMemoryMailboxInterrupt(void __iomem *ControllerBaseAddress) { DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3671,7 +3671,7 @@ } static inline -void DAC960_PG_AcknowledgeInterrupt(void *ControllerBaseAddress) +void DAC960_PG_AcknowledgeInterrupt(void __iomem *ControllerBaseAddress) { DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3682,7 +3682,7 @@ } static inline -boolean DAC960_PG_HardwareMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_PG_HardwareMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -3691,7 +3691,7 @@ } static inline -boolean DAC960_PG_MemoryMailboxStatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_PG_MemoryMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -3700,7 +3700,7 @@ } static inline -void DAC960_PG_EnableInterrupts(void *ControllerBaseAddress) +void DAC960_PG_EnableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_PG_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0; @@ -3712,7 +3712,7 @@ } static inline -void DAC960_PG_DisableInterrupts(void *ControllerBaseAddress) +void DAC960_PG_DisableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_PG_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = 0; @@ -3724,7 +3724,7 @@ } static inline -boolean DAC960_PG_InterruptsEnabledP(void *ControllerBaseAddress) +boolean DAC960_PG_InterruptsEnabledP(void __iomem *ControllerBaseAddress) { DAC960_PG_InterruptMaskRegister_T InterruptMaskRegister; InterruptMaskRegister.All = @@ -3747,7 +3747,7 @@ } static inline -void DAC960_PG_WriteHardwareMailbox(void *ControllerBaseAddress, +void DAC960_PG_WriteHardwareMailbox(void __iomem *ControllerBaseAddress, DAC960_V1_CommandMailbox_T *CommandMailbox) { writel(CommandMailbox->Words[0], @@ -3761,20 +3761,20 @@ } static inline DAC960_V1_CommandIdentifier_T -DAC960_PG_ReadStatusCommandIdentifier(void *ControllerBaseAddress) +DAC960_PG_ReadStatusCommandIdentifier(void __iomem *ControllerBaseAddress) { return readb(ControllerBaseAddress + DAC960_PG_StatusCommandIdentifierRegOffset); } static inline DAC960_V1_CommandStatus_T -DAC960_PG_ReadStatusRegister(void *ControllerBaseAddress) +DAC960_PG_ReadStatusRegister(void __iomem *ControllerBaseAddress) { return readw(ControllerBaseAddress + DAC960_PG_StatusRegisterOffset); } static inline boolean -DAC960_PG_ReadErrorStatus(void *ControllerBaseAddress, +DAC960_PG_ReadErrorStatus(void __iomem *ControllerBaseAddress, unsigned char *ErrorStatus, unsigned char *Parameter0, unsigned char *Parameter1) @@ -3903,7 +3903,7 @@ */ static inline -void DAC960_PD_NewCommand(void *ControllerBaseAddress) +void DAC960_PD_NewCommand(void __iomem *ControllerBaseAddress) { DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3913,7 +3913,7 @@ } static inline -void DAC960_PD_AcknowledgeStatus(void *ControllerBaseAddress) +void DAC960_PD_AcknowledgeStatus(void __iomem *ControllerBaseAddress) { DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3923,7 +3923,7 @@ } static inline -void DAC960_PD_GenerateInterrupt(void *ControllerBaseAddress) +void DAC960_PD_GenerateInterrupt(void __iomem *ControllerBaseAddress) { DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3933,7 +3933,7 @@ } static inline -void DAC960_PD_ControllerReset(void *ControllerBaseAddress) +void DAC960_PD_ControllerReset(void __iomem *ControllerBaseAddress) { DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = 0; @@ -3943,7 +3943,7 @@ } static inline -boolean DAC960_PD_MailboxFullP(void *ControllerBaseAddress) +boolean DAC960_PD_MailboxFullP(void __iomem *ControllerBaseAddress) { DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3952,7 +3952,7 @@ } static inline -boolean DAC960_PD_InitializationInProgressP(void *ControllerBaseAddress) +boolean DAC960_PD_InitializationInProgressP(void __iomem *ControllerBaseAddress) { DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister; InboundDoorBellRegister.All = @@ -3961,7 +3961,7 @@ } static inline -void DAC960_PD_AcknowledgeInterrupt(void *ControllerBaseAddress) +void DAC960_PD_AcknowledgeInterrupt(void __iomem *ControllerBaseAddress) { DAC960_PD_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = 0; @@ -3971,7 +3971,7 @@ } static inline -boolean DAC960_PD_StatusAvailableP(void *ControllerBaseAddress) +boolean DAC960_PD_StatusAvailableP(void __iomem *ControllerBaseAddress) { DAC960_PD_OutboundDoorBellRegister_T OutboundDoorBellRegister; OutboundDoorBellRegister.All = @@ -3980,7 +3980,7 @@ } static inline -void DAC960_PD_EnableInterrupts(void *ControllerBaseAddress) +void DAC960_PD_EnableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_PD_InterruptEnableRegister_T InterruptEnableRegister; InterruptEnableRegister.All = 0; @@ -3990,7 +3990,7 @@ } static inline -void DAC960_PD_DisableInterrupts(void *ControllerBaseAddress) +void DAC960_PD_DisableInterrupts(void __iomem *ControllerBaseAddress) { DAC960_PD_InterruptEnableRegister_T InterruptEnableRegister; InterruptEnableRegister.All = 0; @@ -4000,7 +4000,7 @@ } static inline -boolean DAC960_PD_InterruptsEnabledP(void *ControllerBaseAddress) +boolean DAC960_PD_InterruptsEnabledP(void __iomem *ControllerBaseAddress) { DAC960_PD_InterruptEnableRegister_T InterruptEnableRegister; InterruptEnableRegister.All = @@ -4009,7 +4009,7 @@ } static inline -void DAC960_PD_WriteCommandMailbox(void *ControllerBaseAddress, +void DAC960_PD_WriteCommandMailbox(void __iomem *ControllerBaseAddress, DAC960_V1_CommandMailbox_T *CommandMailbox) { writel(CommandMailbox->Words[0], @@ -4023,20 +4023,20 @@ } static inline DAC960_V1_CommandIdentifier_T -DAC960_PD_ReadStatusCommandIdentifier(void *ControllerBaseAddress) +DAC960_PD_ReadStatusCommandIdentifier(void __iomem *ControllerBaseAddress) { return readb(ControllerBaseAddress + DAC960_PD_StatusCommandIdentifierRegOffset); } static inline DAC960_V1_CommandStatus_T -DAC960_PD_ReadStatusRegister(void *ControllerBaseAddress) +DAC960_PD_ReadStatusRegister(void __iomem *ControllerBaseAddress) { return readw(ControllerBaseAddress + DAC960_PD_StatusRegisterOffset); } static inline boolean -DAC960_PD_ReadErrorStatus(void *ControllerBaseAddress, +DAC960_PD_ReadErrorStatus(void __iomem *ControllerBaseAddress, unsigned char *ErrorStatus, unsigned char *Parameter0, unsigned char *Parameter1) diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/block/cciss.c 2004-10-06 19:37:48 -07:00 @@ -1509,8 +1509,8 @@ return_code = sendcmd(CCISS_READ_CAPACITY, ctlr, buf, sizeof(*buf), 1, logvol, 0, NULL, TYPE_CMD); if (return_code == IO_OK) { - *total_size = be32_to_cpu(*((__u32 *) &buf->total_size[0]))+1; - *block_size = be32_to_cpu(*((__u32 *) &buf->block_size[0])); + *total_size = be32_to_cpu(*((__be32 *) &buf->total_size[0]))+1; + *block_size = be32_to_cpu(*((__be32 *) &buf->block_size[0])); } else { /* read capacity command failed */ printk(KERN_WARNING "cciss: read capacity failed\n"); *total_size = 0; @@ -1844,13 +1844,13 @@ /* * Map (physical) PCI mem into (virtual) kernel space */ -static ulong remap_pci_mem(ulong base, ulong size) +static void __iomem *remap_pci_mem(ulong base, ulong size) { ulong page_base = ((ulong) base) & PAGE_MASK; ulong page_offs = ((ulong) base) - page_base; - ulong page_remapped = (ulong) ioremap(page_base, page_offs+size); + void __iomem *page_remapped = ioremap(page_base, page_offs+size); - return (ulong) (page_remapped ? (page_remapped + page_offs) : 0UL); + return page_remapped ? (page_remapped + page_offs) : NULL; } /* @@ -2410,9 +2410,9 @@ #ifdef CCISS_DEBUG printk("cfg offset = %x\n", cfg_offset); #endif /* CCISS_DEBUG */ - c->cfgtable = (CfgTable_struct *) - remap_pci_mem(pci_resource_start(pdev, cfg_base_addr_index) - + cfg_offset, sizeof(CfgTable_struct)); + c->cfgtable = remap_pci_mem(pci_resource_start(pdev, + cfg_base_addr_index) + cfg_offset, + sizeof(CfgTable_struct)); c->board_id = board_id; #ifdef CCISS_DEBUG @@ -2824,7 +2824,7 @@ } free_irq(hba[i]->intr, hba[i]); pci_set_drvdata(pdev, NULL); - iounmap((void*)hba[i]->vaddr); + iounmap(hba[i]->vaddr); cciss_unregister_scsi(i); /* unhook from SCSI subsystem */ unregister_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname); remove_proc_entry(hba[i]->devname, proc_cciss); diff -Nru a/drivers/block/cciss.h b/drivers/block/cciss.h --- a/drivers/block/cciss.h 2004-10-06 19:37:46 -07:00 +++ b/drivers/block/cciss.h 2004-10-06 19:37:46 -07:00 @@ -43,11 +43,11 @@ char firm_ver[4]; // Firmware version struct pci_dev *pdev; __u32 board_id; - unsigned long vaddr; + void __iomem *vaddr; unsigned long paddr; unsigned long io_mem_addr; unsigned long io_mem_length; - CfgTable_struct *cfgtable; + CfgTable_struct __iomem *cfgtable; unsigned int intr; int interrupts_enabled; int max_commands; diff -Nru a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c --- a/drivers/block/cpqarray.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/block/cpqarray.c 2004-10-06 19:37:47 -07:00 @@ -138,7 +138,7 @@ int cpqarray_init_step2(void); static int cpqarray_pci_init(ctlr_info_t *c, struct pci_dev *pdev); -static void *remap_pci_mem(ulong base, ulong size); +static void __iomem *remap_pci_mem(ulong base, ulong size); static int cpqarray_eisa_detect(void); static int pollcomplete(int ctlr); static void getgeometry(int ctlr); @@ -551,10 +551,10 @@ } static struct pci_driver cpqarray_pci_driver = { - name: "cpqarray", - probe: cpqarray_init_one, - remove: __devexit_p(cpqarray_remove_one_pci), - id_table: cpqarray_pci_device_id, + .name = "cpqarray", + .probe = cpqarray_init_one, + .remove = __devexit_p(cpqarray_remove_one_pci), + .id_table = cpqarray_pci_device_id, }; /* @@ -722,11 +722,11 @@ /* * Map (physical) PCI mem into (virtual) kernel space */ -static void *remap_pci_mem(ulong base, ulong size) +static void __iomem *remap_pci_mem(ulong base, ulong size) { ulong page_base = ((ulong) base) & PAGE_MASK; ulong page_offs = ((ulong) base) - page_base; - void *page_remapped = ioremap(page_base, page_offs+size); + void __iomem *page_remapped = ioremap(page_base, page_offs+size); return (page_remapped ? (page_remapped + page_offs) : NULL); } diff -Nru a/drivers/block/cpqarray.h b/drivers/block/cpqarray.h --- a/drivers/block/cpqarray.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/block/cpqarray.h 2004-10-06 19:37:47 -07:00 @@ -90,7 +90,7 @@ __u32 board_id; char *product_name; - void *vaddr; + void __iomem *vaddr; unsigned long paddr; unsigned long io_mem_addr; unsigned long io_mem_length; diff -Nru a/drivers/block/ioctl.c b/drivers/block/ioctl.c --- a/drivers/block/ioctl.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/block/ioctl.c 2004-10-06 19:37:46 -07:00 @@ -194,7 +194,8 @@ return -EACCES; if (disk->fops->ioctl) { ret = disk->fops->ioctl(inode, file, cmd, arg); - if (ret != -EINVAL) + /* -EINVAL to handle old uncorrected drivers */ + if (ret != -EINVAL && ret != -ENOTTY) return ret; } fsync_bdev(bdev); diff -Nru a/drivers/block/sx8.c b/drivers/block/sx8.c --- a/drivers/block/sx8.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/block/sx8.c 2004-10-06 19:37:48 -07:00 @@ -242,7 +242,7 @@ struct carm_host { unsigned long flags; - void *mmio; + void __iomem *mmio; void *shm; dma_addr_t shm_dma; @@ -283,13 +283,13 @@ }; struct carm_response { - u32 ret_handle; - u32 status; + __le32 ret_handle; + __le32 status; } __attribute__((packed)); struct carm_msg_sg { - u32 start; - u32 len; + __le32 start; + __le32 len; } __attribute__((packed)); struct carm_msg_rw { @@ -297,10 +297,10 @@ u8 id; u8 sg_count; u8 sg_type; - u32 handle; - u32 lba; - u16 lba_count; - u16 lba_high; + __le32 handle; + __le32 lba; + __le16 lba_count; + __le16 lba_high; struct carm_msg_sg sg[32]; } __attribute__((packed)); @@ -309,15 +309,15 @@ 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; + __le32 handle; + __le32 addr; + __le32 len; + __le32 evt_pool; + __le32 n_evt; + __le32 rbuf_pool; + __le32 n_rbuf; + __le32 msg_pool; + __le32 n_msg; struct carm_msg_sg sg[8]; } __attribute__((packed)); @@ -326,8 +326,8 @@ u8 subtype; u8 array_id; u8 reserved1; - u32 handle; - u32 data_addr; + __le32 handle; + __le32 data_addr; u32 reserved2; } __attribute__((packed)); @@ -335,48 +335,48 @@ u8 type; u8 subtype; u16 reserved1; - u32 handle; + __le32 handle; u32 reserved2; - u32 timestamp; + __le32 timestamp; } __attribute__((packed)); struct carm_msg_get_fw_ver { u8 type; u8 subtype; u16 reserved1; - u32 handle; - u32 data_addr; + __le32 handle; + __le32 data_addr; u32 reserved2; } __attribute__((packed)); struct carm_fw_ver { - u32 version; + __le32 version; u8 features; u8 reserved1; u16 reserved2; } __attribute__((packed)); struct carm_array_info { - u32 size; + __le32 size; - u16 size_hi; - u16 stripe_size; + __le16 size_hi; + __le16 stripe_size; - u32 mode; + __le32 mode; - u16 stripe_blk_sz; - u16 reserved1; + __le16 stripe_blk_sz; + __le16 reserved1; - u16 cyl; - u16 head; + __le16 cyl; + __le16 head; - u16 sect; + __le16 sect; u8 array_id; u8 reserved2; char name[40]; - u32 array_status; + __le32 array_status; /* device list continues beyond this point? */ } __attribute__((packed)); @@ -451,7 +451,7 @@ return -ENOENT; } -static void carm_init_buckets(void *mmio) +static void carm_init_buckets(void __iomem *mmio) { unsigned int i; @@ -474,7 +474,7 @@ static int carm_send_msg(struct carm_host *host, struct carm_request *crq) { - void *mmio = host->mmio; + void __iomem *mmio = host->mmio; u32 msg = (u32) carm_ref_msg_dma(host, crq->tag); u32 cm_bucket = crq->msg_bucket; u32 tmp; @@ -965,7 +965,7 @@ port = &host->port[cur_port]; lo = (u64) le32_to_cpu(desc->size); - hi = (u64) le32_to_cpu(desc->size_hi); + hi = (u64) le16_to_cpu(desc->size_hi); port->capacity = lo | (hi << 32); port->dev_geom_head = le16_to_cpu(desc->head); @@ -1060,7 +1060,7 @@ } static inline void carm_handle_resp(struct carm_host *host, - u32 ret_handle_le, u32 status) + __le32 ret_handle_le, u32 status) { u32 handle = le32_to_cpu(ret_handle_le); unsigned int msg_idx; @@ -1158,7 +1158,7 @@ static inline void carm_handle_responses(struct carm_host *host) { - void *mmio = host->mmio; + void __iomem *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; @@ -1176,7 +1176,7 @@ 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; + resp[idx].status = cpu_to_le32(0xffffffff); } /* asynchronous events the hardware throws our way */ @@ -1185,7 +1185,7 @@ 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; + resp[idx].status = cpu_to_le32(0xffffffff); } idx = NEXT_RESP(idx); @@ -1199,7 +1199,7 @@ static irqreturn_t carm_interrupt(int irq, void *__host, struct pt_regs *regs) { struct carm_host *host = __host; - void *mmio; + void __iomem *mmio; u32 mask; int handled = 0; unsigned long flags; @@ -1364,7 +1364,7 @@ schedule_work(&host->fsm_task); } -static int carm_init_wait(void *mmio, u32 bits, unsigned int test_bit) +static int carm_init_wait(void __iomem *mmio, u32 bits, unsigned int test_bit) { unsigned int i; @@ -1390,19 +1390,19 @@ static void carm_init_responses(struct carm_host *host) { - void *mmio = host->mmio; + void __iomem *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; + resp[i].status = cpu_to_le32(0xffffffff); writel(0, mmio + CARM_RESP_IDX); } static int carm_init_host(struct carm_host *host) { - void *mmio = host->mmio; + void __iomem *mmio = host->mmio; u32 tmp; u8 tmp8; int rc; diff -Nru a/drivers/block/umem.c b/drivers/block/umem.c --- a/drivers/block/umem.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/block/umem.c 2004-10-06 19:37:48 -07:00 @@ -108,11 +108,11 @@ int irq; unsigned long csr_base; - unsigned char *csr_remap; + unsigned char __iomem *csr_remap; unsigned long csr_len; #ifdef CONFIG_MM_MAP_MEMORY unsigned long mem_base; - unsigned char *mem_remap; + unsigned char __iomem *mem_remap; unsigned long mem_len; #endif @@ -926,7 +926,7 @@ goto failed_req_mem; } - if (!(card->mem_remap = (unsigned char *)ioremap(card->mem_base, cards->mem_len))) { + if (!(card->mem_remap = ioremap(card->mem_base, cards->mem_len))) { printk(KERN_ERR "MM%d: Unable to remap memory region\n", card->card_number); ret = -ENOMEM; @@ -1107,12 +1107,12 @@ card->mm_pages[1].page_dma); failed_magic: #ifdef CONFIG_MM_MAP_MEMORY - iounmap((void *) card->mem_remap); + iounmap(card->mem_remap); failed_remap_mem: release_mem_region(card->mem_base, card->mem_len); failed_req_mem: #endif - iounmap((void *) card->csr_remap); + iounmap(card->csr_remap); failed_remap_csr: release_mem_region(card->csr_base, card->csr_len); failed_req_csr: diff -Nru a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c --- a/drivers/char/agp/amd-k7-agp.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/char/agp/amd-k7-agp.c 2004-10-06 19:37:48 -07:00 @@ -24,11 +24,11 @@ struct amd_page_map { unsigned long *real; - unsigned long *remapped; + unsigned long __iomem *remapped; }; static struct _amd_irongate_private { - volatile u8 *registers; + volatile u8 __iomem *registers; struct amd_page_map **gatt_pages; int num_tables; } amd_irongate_private; @@ -54,7 +54,7 @@ global_cache_flush(); for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) - page_map->remapped[i] = agp_bridge->scratch_page; + writel(agp_bridge->scratch_page, page_map->remapped+i); return 0; } @@ -151,7 +151,7 @@ } agp_bridge->gatt_table_real = (u32 *)page_dir.real; - agp_bridge->gatt_table = (u32 *)page_dir.remapped; + agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); /* Get the address for the gart region. @@ -165,9 +165,8 @@ /* Calculate the agp offset */ for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { - page_dir.remapped[GET_PAGE_DIR_OFF(addr)] = - virt_to_phys(amd_irongate_private.gatt_pages[i]->real); - page_dir.remapped[GET_PAGE_DIR_OFF(addr)] |= 0x00000001; + writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1, + page_dir.remapped+GET_PAGE_DIR_OFF(addr)); } return 0; @@ -178,7 +177,7 @@ struct amd_page_map page_dir; page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; - page_dir.remapped = (unsigned long *)agp_bridge->gatt_table; + page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; amd_free_gatt_pages(); amd_free_page_map(&page_dir); @@ -218,7 +217,7 @@ /* Get the memory mapped registers */ pci_read_config_dword(agp_bridge->dev, AMD_MMBASE, &temp); temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); - amd_irongate_private.registers = (volatile u8 *) ioremap(temp, 4096); + amd_irongate_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); /* Write out the address of the gatt table */ OUTREG32(amd_irongate_private.registers, AMD_ATTBASE, @@ -263,7 +262,7 @@ pci_read_config_dword(agp_bridge->dev, AMD_APSIZE, &temp); temp = ((temp & ~(0x0000000f)) | previous_size->size_value); pci_write_config_dword(agp_bridge->dev, AMD_APSIZE, temp); - iounmap((void *) amd_irongate_private.registers); + iounmap((void __iomem *) amd_irongate_private.registers); } /* @@ -282,7 +281,7 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) { int i, j, num_entries; - unsigned long *cur_gatt; + unsigned long __iomem *cur_gatt; unsigned long addr; num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; @@ -297,7 +296,7 @@ while (j < (pg_start + mem->page_count)) { addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); - if (!PGE_EMPTY(agp_bridge, cur_gatt[GET_GATT_OFF(addr)])) + if (!PGE_EMPTY(agp_bridge, readl(cur_gatt+GET_GATT_OFF(addr)))) return -EBUSY; j++; } @@ -310,8 +309,7 @@ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = - agp_generic_mask_memory(mem->memory[i], mem->type); + writel(agp_generic_mask_memory(mem->memory[i], mem->type), cur_gatt+GET_GATT_OFF(addr)); } amd_irongate_tlbflush(mem); return 0; @@ -320,7 +318,7 @@ static int amd_remove_memory(struct agp_memory *mem, off_t pg_start, int type) { int i; - unsigned long *cur_gatt; + unsigned long __iomem *cur_gatt; unsigned long addr; if (type != 0 || mem->type != 0) @@ -329,8 +327,7 @@ for (i = pg_start; i < (mem->page_count + pg_start); i++) { addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = - (unsigned long) agp_bridge->scratch_page; + writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); } amd_irongate_tlbflush(mem); diff -Nru a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c --- a/drivers/char/agp/amd64-agp.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/agp/amd64-agp.c 2004-10-06 19:37:47 -07:00 @@ -73,7 +73,7 @@ static int amd64_insert_memory(struct agp_memory *mem, off_t pg_start, int type) { int i, j, num_entries; - long tmp; + long long tmp; u32 pte; num_entries = agp_num_entries(); @@ -90,7 +90,7 @@ /* gatt table should be empty. */ while (j < (pg_start + mem->page_count)) { - if (!PGE_EMPTY(agp_bridge, agp_bridge->gatt_table[j])) + if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j))) return -EBUSY; j++; } @@ -108,7 +108,7 @@ pte |=(tmp & 0x00000000fffff000ULL); pte |= GPTE_VALID | GPTE_COHERENT; - agp_bridge->gatt_table[j] = pte; + writel(pte, agp_bridge->gatt_table+j); } amd64_tlbflush(mem); return 0; diff -Nru a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c --- a/drivers/char/agp/ati-agp.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/agp/ati-agp.c 2004-10-06 19:37:47 -07:00 @@ -42,11 +42,11 @@ typedef struct _ati_page_map { unsigned long *real; - unsigned long *remapped; + unsigned long __iomem *remapped; } ati_page_map; static struct _ati_generic_private { - volatile u8 *registers; + volatile u8 __iomem *registers; ati_page_map **gatt_pages; int num_tables; } ati_generic_private; @@ -76,7 +76,7 @@ global_cache_flush(); for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) - page_map->remapped[i] = agp_bridge->scratch_page; + writel(agp_bridge->scratch_page, page_map->remapped+i); return 0; } @@ -206,7 +206,7 @@ temp = ((temp & ~(0x0000000f)) | previous_size->size_value); pci_write_config_dword(agp_bridge->dev, ATI_RS300_APSIZE, temp); } - iounmap((void *) ati_generic_private.registers); + iounmap((volatile u8 __iomem *)ati_generic_private.registers); } @@ -217,7 +217,7 @@ /* Get the memory mapped registers */ pci_read_config_dword(agp_bridge->dev, ATI_GART_MMBASE_ADDR, &temp); temp = (temp & 0xfffff000); - ati_generic_private.registers = (volatile u8 *) ioremap(temp, 4096); + ati_generic_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); if (is_r200()) pci_write_config_dword(agp_bridge->dev, ATI_RS100_IG_AGPMODE, 0x20000); @@ -261,7 +261,7 @@ off_t pg_start, int type) { int i, j, num_entries; - unsigned long *cur_gatt; + unsigned long __iomem *cur_gatt; unsigned long addr; num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; @@ -276,7 +276,7 @@ while (j < (pg_start + mem->page_count)) { addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); - if (!PGE_EMPTY(agp_bridge,cur_gatt[GET_GATT_OFF(addr)])) + if (!PGE_EMPTY(agp_bridge,readl(cur_gatt+GET_GATT_OFF(addr)))) return -EBUSY; j++; } @@ -290,8 +290,7 @@ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = - agp_bridge->driver->mask_memory(mem->memory[i], mem->type); + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), cur_gatt+GET_GATT_OFF(addr)); } agp_bridge->driver->tlb_flush(mem); return 0; @@ -301,7 +300,7 @@ int type) { int i; - unsigned long *cur_gatt; + unsigned long __iomem *cur_gatt; unsigned long addr; if (type != 0 || mem->type != 0) { @@ -310,8 +309,7 @@ for (i = pg_start; i < (mem->page_count + pg_start); i++) { addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = - (unsigned long) agp_bridge->scratch_page; + writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); } agp_bridge->driver->tlb_flush(mem); @@ -340,7 +338,7 @@ } agp_bridge->gatt_table_real = (u32 *)page_dir.real; - agp_bridge->gatt_table = (u32 *)page_dir.remapped; + agp_bridge->gatt_table = (u32 __iomem *) page_dir.remapped; agp_bridge->gatt_bus_addr = virt_to_bus(page_dir.real); /* Write out the size register */ @@ -371,9 +369,8 @@ /* Calculate the agp offset */ for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { - page_dir.remapped[GET_PAGE_DIR_OFF(addr)] = - virt_to_bus(ati_generic_private.gatt_pages[i]->real); - page_dir.remapped[GET_PAGE_DIR_OFF(addr)] |= 0x00000001; + writel(virt_to_bus(ati_generic_private.gatt_pages[i]->real) | 1, + page_dir.remapped+GET_PAGE_DIR_OFF(addr)); } return 0; @@ -384,7 +381,7 @@ ati_page_map page_dir; page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; - page_dir.remapped = (unsigned long *)agp_bridge->gatt_table; + page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; ati_free_gatt_pages(); ati_free_page_map(&page_dir); diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c --- a/drivers/char/agp/generic.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/agp/generic.c 2004-10-06 19:37:47 -07:00 @@ -35,6 +35,7 @@ #include #include #include +#include #include "agp.h" __u32 *agp_gatt_table; @@ -737,7 +738,7 @@ /* AK: bogus, should encode addresses > 4GB */ for (i = 0; i < num_entries; i++) - agp_bridge->gatt_table[i] = (unsigned long) agp_bridge->scratch_page; + writel(agp_bridge->scratch_page, agp_bridge->gatt_table+i); return 0; } @@ -843,9 +844,8 @@ j = pg_start; while (j < (pg_start + mem->page_count)) { - if (!PGE_EMPTY(agp_bridge, agp_bridge->gatt_table[j])) { + if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j))) return -EBUSY; - } j++; } @@ -855,9 +855,7 @@ } for (i = 0, j = pg_start; i < mem->page_count; i++, j++) - agp_bridge->gatt_table[j] = - agp_bridge->driver->mask_memory( - mem->memory[i], mem->type); + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), agp_bridge->gatt_table+j); agp_bridge->driver->tlb_flush(mem); return 0; @@ -875,10 +873,8 @@ } /* AK: bogus, should encode addresses > 4GB */ - for (i = pg_start; i < (mem->page_count + pg_start); i++) { - agp_bridge->gatt_table[i] = - (unsigned long) agp_bridge->scratch_page; - } + for (i = pg_start; i < (mem->page_count + pg_start); i++) + writel(agp_bridge->scratch_page, agp_bridge->gatt_table+i); agp_bridge->driver->tlb_flush(mem); return 0; diff -Nru a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c --- a/drivers/char/agp/intel-agp.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/agp/intel-agp.c 2004-10-06 19:37:47 -07:00 @@ -202,7 +202,7 @@ return -EINVAL; } for (j = pg_start; j < (pg_start + mem->page_count); j++) { - if (!PGE_EMPTY(agp_bridge, agp_bridge->gatt_table[j])) + if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j))) return -EBUSY; } @@ -1768,6 +1768,7 @@ ID(PCI_DEVICE_ID_INTEL_82875_HB), ID(PCI_DEVICE_ID_INTEL_7505_0), ID(PCI_DEVICE_ID_INTEL_7205_0), + ID(PCI_DEVICE_ID_INTEL_82915G_HB), { } }; diff -Nru a/drivers/char/agp/intel-mch-agp.c b/drivers/char/agp/intel-mch-agp.c --- a/drivers/char/agp/intel-mch-agp.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/char/agp/intel-mch-agp.c 2004-10-06 19:37:46 -07:00 @@ -84,7 +84,7 @@ static struct _intel_i830_private { struct pci_dev *i830_dev; /* device one */ - volatile u8 *registers; + volatile u8 __iomem *registers; int gtt_entries; } intel_i830_private; @@ -172,7 +172,7 @@ pci_read_config_dword(intel_i830_private.i830_dev,I810_MMADDR,&temp); temp &= 0xfff80000; - intel_i830_private.registers = (volatile u8 *) ioremap(temp,128 * 4096); + intel_i830_private.registers = (volatile u8 __iomem*) ioremap(temp,128 * 4096); if (!intel_i830_private.registers) return (-ENOMEM); @@ -255,7 +255,7 @@ static void intel_i830_cleanup(void) { - iounmap((void *) intel_i830_private.registers); + iounmap((void __iomem *) intel_i830_private.registers); } static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, diff -Nru a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c --- a/drivers/char/agp/nvidia-agp.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/agp/nvidia-agp.c 2004-10-06 19:37:47 -07:00 @@ -28,7 +28,7 @@ struct pci_dev *dev_1; struct pci_dev *dev_2; struct pci_dev *dev_3; - volatile u32 *aperture; + volatile u32 __iomem *aperture; int num_active_entries; off_t pg_offset; u32 wbc_mask; @@ -154,7 +154,7 @@ /* map aperture */ nvidia_private.aperture = - (volatile u32 *) ioremap(apbase, 33 * PAGE_SIZE); + (volatile u32 __iomem *) ioremap(apbase, 33 * PAGE_SIZE); return 0; } @@ -173,7 +173,7 @@ pci_write_config_dword(nvidia_private.dev_2, NVIDIA_2_GARTCTRL, temp & ~(0x11)); /* unmap aperture */ - iounmap((void *) nvidia_private.aperture); + iounmap((void __iomem *) nvidia_private.aperture); /* restore previous aperture size */ previous_size = A_SIZE_8(agp_bridge->previous_size); @@ -206,7 +206,7 @@ return -EINVAL; for(j = pg_start; j < (pg_start + mem->page_count); j++) { - if (!PGE_EMPTY(agp_bridge, agp_bridge->gatt_table[nvidia_private.pg_offset + j])) + if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+nvidia_private.pg_offset+j))) return -EBUSY; } @@ -215,9 +215,8 @@ mem->is_flushed = TRUE; } for (i = 0, j = pg_start; i < mem->page_count; i++, j++) - agp_bridge->gatt_table[nvidia_private.pg_offset + j] = - agp_bridge->driver->mask_memory(mem->memory[i], mem->type); - + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), + agp_bridge->gatt_table+nvidia_private.pg_offset+j); agp_bridge->driver->tlb_flush(mem); return 0; } @@ -229,11 +228,9 @@ if ((type != 0) || (mem->type != 0)) return -EINVAL; - - for (i = pg_start; i < (mem->page_count + pg_start); i++) { - agp_bridge->gatt_table[nvidia_private.pg_offset + i] = - (unsigned long) agp_bridge->scratch_page; - } + + for (i = pg_start; i < (mem->page_count + pg_start); i++) + writel(agp_bridge->scratch_page, agp_bridge->gatt_table+nvidia_private.pg_offset+i); agp_bridge->driver->tlb_flush(mem); return 0; @@ -265,9 +262,9 @@ /* flush TLB entries */ for(i = 0; i < 32 + 1; i++) - temp = nvidia_private.aperture[i * PAGE_SIZE / sizeof(u32)]; + temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32))); for(i = 0; i < 32 + 1; i++) - temp = nvidia_private.aperture[i * PAGE_SIZE / sizeof(u32)]; + temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32))); } diff -Nru a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c --- a/drivers/char/agp/sworks-agp.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/agp/sworks-agp.c 2004-10-06 19:37:47 -07:00 @@ -27,12 +27,12 @@ struct serverworks_page_map { unsigned long *real; - unsigned long *remapped; + unsigned long __iomem *remapped; }; static struct _serverworks_private { struct pci_dev *svrwrks_dev; /* device one */ - volatile u8 *registers; + volatile u8 __iomem *registers; struct serverworks_page_map **gatt_pages; int num_tables; struct serverworks_page_map scratch_dir; @@ -61,9 +61,8 @@ } global_cache_flush(); - for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { - page_map->remapped[i] = agp_bridge->scratch_page; - } + for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) + writel(agp_bridge->scratch_page, page_map->remapped+i); return 0; } @@ -162,10 +161,8 @@ } /* Create a fake scratch directory */ for(i = 0; i < 1024; i++) { - serverworks_private.scratch_dir.remapped[i] = (unsigned long) agp_bridge->scratch_page; - page_dir.remapped[i] = - virt_to_phys(serverworks_private.scratch_dir.real); - page_dir.remapped[i] |= 0x00000001; + writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); + writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); } retval = serverworks_create_gatt_pages(value->num_entries / 1024); @@ -176,7 +173,7 @@ } agp_bridge->gatt_table_real = (u32 *)page_dir.real; - agp_bridge->gatt_table = (u32 *)page_dir.remapped; + agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); /* Get the address for the gart region. @@ -189,11 +186,8 @@ /* Calculate the agp offset */ - for(i = 0; i < value->num_entries / 1024; i++) { - page_dir.remapped[i] = - virt_to_phys(serverworks_private.gatt_pages[i]->real); - page_dir.remapped[i] |= 0x00000001; - } + for(i = 0; i < value->num_entries / 1024; i++) + writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); return 0; } @@ -203,7 +197,7 @@ struct serverworks_page_map page_dir; page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; - page_dir.remapped = (unsigned long *)agp_bridge->gatt_table; + page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; serverworks_free_gatt_pages(); serverworks_free_page_map(&page_dir); @@ -269,7 +263,7 @@ /* Get the memory mapped registers */ pci_read_config_dword(agp_bridge->dev, serverworks_private.mm_addr_ofs, &temp); temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); - serverworks_private.registers = (volatile u8 *) ioremap(temp, 4096); + serverworks_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); if (!serverworks_private.registers) { printk (KERN_ERR PFX "Unable to ioremap() memory.\n"); return -ENOMEM; @@ -311,14 +305,14 @@ static void serverworks_cleanup(void) { - iounmap((void *) serverworks_private.registers); + iounmap((void __iomem *) serverworks_private.registers); } static int serverworks_insert_memory(struct agp_memory *mem, off_t pg_start, int type) { int i, j, num_entries; - unsigned long *cur_gatt; + unsigned long __iomem *cur_gatt; unsigned long addr; num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; @@ -334,9 +328,8 @@ while (j < (pg_start + mem->page_count)) { addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = SVRWRKS_GET_GATT(addr); - if (!PGE_EMPTY(agp_bridge, cur_gatt[GET_GATT_OFF(addr)])) { + if (!PGE_EMPTY(agp_bridge, readl(cur_gatt+GET_GATT_OFF(addr)))) return -EBUSY; - } j++; } @@ -348,8 +341,7 @@ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = SVRWRKS_GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = - agp_bridge->driver->mask_memory(mem->memory[i], mem->type); + writel(agp_bridge->driver->mask_memory(mem->memory[i], mem->type), cur_gatt+GET_GATT_OFF(addr)); } serverworks_tlbflush(mem); return 0; @@ -359,7 +351,7 @@ int type) { int i; - unsigned long *cur_gatt; + unsigned long __iomem *cur_gatt; unsigned long addr; if (type != 0 || mem->type != 0) { @@ -372,8 +364,7 @@ for (i = pg_start; i < (mem->page_count + pg_start); i++) { addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr; cur_gatt = SVRWRKS_GET_GATT(addr); - cur_gatt[GET_GATT_OFF(addr)] = - (unsigned long) agp_bridge->scratch_page; + writel(agp_bridge->scratch_page, cur_gatt+GET_GATT_OFF(addr)); } serverworks_tlbflush(mem); diff -Nru a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c --- a/drivers/char/agp/via-agp.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/agp/via-agp.c 2004-10-06 19:37:47 -07:00 @@ -438,6 +438,33 @@ agp_put_bridge(bridge); } +#ifdef CONFIG_PM + +static int agp_via_suspend(struct pci_dev *pdev, u32 state) +{ + pci_save_state (pdev, pdev->saved_config_space); + pci_set_power_state (pdev, 3); + + return 0; +} + +static int agp_via_resume(struct pci_dev *pdev) +{ + struct agp_bridge_data *bridge = pci_get_drvdata(pdev); + + pci_set_power_state (pdev, 0); + pci_restore_state(pdev, pdev->saved_config_space); + + if (bridge->driver == &via_agp3_driver) + return via_configure_agp3(); + else if (bridge->driver == &via_driver) + return via_configure(); + + return 0; +} + +#endif /* CONFIG_PM */ + /* must be the same order as name table above */ static struct pci_device_id agp_via_pci_table[] = { #define ID(x) \ @@ -487,6 +514,10 @@ .id_table = agp_via_pci_table, .probe = agp_via_probe, .remove = agp_via_remove, +#ifdef CONFIG_PM + .suspend = agp_via_suspend, + .resume = agp_via_resume, +#endif }; diff -Nru a/drivers/char/cyclades.c b/drivers/char/cyclades.c --- a/drivers/char/cyclades.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/cyclades.c 2004-10-06 19:37:47 -07:00 @@ -682,13 +682,13 @@ #define IS_CYC_Z(card) ((card).num_chips == -1) #define Z_FPGA_CHECK(card) \ - ((cy_readl(&((struct RUNTIME_9060 *) \ + ((cy_readl(&((struct RUNTIME_9060 __iomem *) \ ((card).ctl_addr))->init_ctrl) & (1<<17)) != 0) -#define ISZLOADED(card) (((ZO_V1==cy_readl(&((struct RUNTIME_9060 *) \ +#define ISZLOADED(card) (((ZO_V1==cy_readl(&((struct RUNTIME_9060 __iomem *) \ ((card).ctl_addr))->mail_box_0)) || \ Z_FPGA_CHECK(card)) && \ - (ZFIRM_ID==cy_readl(&((struct FIRM_ID *) \ + (ZFIRM_ID==cy_readl(&((struct FIRM_ID __iomem *) \ ((card).base_addr+ID_ADDRESS))->signature))) #ifndef SERIAL_XMIT_SIZE @@ -712,16 +712,16 @@ boot options line. The form is "cyclades=address,address..." */ -static unsigned char *cy_isa_addresses[] = { - (unsigned char *) 0xD0000, - (unsigned char *) 0xD2000, - (unsigned char *) 0xD4000, - (unsigned char *) 0xD6000, - (unsigned char *) 0xD8000, - (unsigned char *) 0xDA000, - (unsigned char *) 0xDC000, - (unsigned char *) 0xDE000, - NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL +static unsigned int cy_isa_addresses[] = { + 0xD0000, + 0xD2000, + 0xD4000, + 0xD6000, + 0xD8000, + 0xDA000, + 0xDC000, + 0xDE000, + 0,0,0,0,0,0,0,0 }; #define NR_ISA_ADDRS (sizeof(cy_isa_addresses)/sizeof(unsigned char*)) @@ -854,7 +854,7 @@ static void set_line_char(struct cyclades_port *); static int cyz_issue_cmd(struct cyclades_card *, uclong, ucchar, uclong); #ifdef CONFIG_ISA -static unsigned detect_isa_irq (volatile ucchar *); +static unsigned detect_isa_irq(void __iomem *); #endif /* CONFIG_ISA */ static int cyclades_get_proc_info(char *, char **, off_t , int , int *, void *); @@ -992,7 +992,7 @@ This function is only called from inside spinlock-protected code. */ static int -cyy_issue_cmd(volatile ucchar *base_addr, u_char cmd, int index) +cyy_issue_cmd(void __iomem *base_addr, u_char cmd, int index) { volatile int i; @@ -1008,7 +1008,7 @@ if (i == 100) return (-1); /* Issue the new command */ - cy_writeb((u_long)base_addr+(CyCCR< 0)? irq : 0; @@ -1076,7 +1076,7 @@ int status; struct cyclades_card *cinfo; struct cyclades_port *info; - volatile unsigned char *base_addr, *card_base_addr; + void __iomem *base_addr, *card_base_addr; int chip; int save_xir, channel, save_car; char data; @@ -1095,7 +1095,7 @@ return IRQ_NONE; /* spurious interrupt */ } - card_base_addr = (unsigned char *)cinfo->base_addr; + card_base_addr = cinfo->base_addr; index = cinfo->bus_index; @@ -1107,8 +1107,7 @@ do{ had_work = 0; for ( chip = 0 ; chip < cinfo->num_chips ; chip ++) { - base_addr = (unsigned char *) - (cinfo->base_addr + (cy_chip_offset[chip]<base_addr + (cy_chip_offset[chip]<last_active = jiffies; save_car = cy_readb(base_addr+(CyCAR<tty == 0){ @@ -1261,8 +1260,8 @@ schedule_delayed_work(&tty->flip.work, 1); } /* end of service */ - cy_writeb((u_long)base_addr+(CyRIR<card_lock); } @@ -1281,18 +1280,18 @@ channel = (u_short ) (save_xir & CyIRChannel); i = channel + chip * 4 + cinfo->first_line; save_car = cy_readb(base_addr+(CyCAR<last_active = jiffies; if(info->tty == 0){ - cy_writeb((u_long)base_addr+(CySRER<x_char) { /* send special char */ outch = info->x_char; - cy_writeb((u_long)base_addr+(CyTDR<icount.tx++; info->x_char = 0; @@ -1310,14 +1309,14 @@ if (info->breakon || info->breakoff) { if (info->breakon) { - cy_writeb((u_long)base_addr + (CyTDR<breakon = 0; char_count -= 2; } if (info->breakoff) { - cy_writeb((u_long)base_addr + (CyTDR<breakoff = 0; char_count -= 2; } @@ -1326,11 +1325,11 @@ while (char_count-- > 0){ if (!info->xmit_cnt){ if (cy_readb(base_addr+(CySRER<xmit_buf == 0){ - cy_writeb((u_long)base_addr+(CySRER<tty->stopped || info->tty->hw_stopped){ - cy_writeb((u_long)base_addr+(CySRER<xmit_cnt--; info->xmit_tail = (info->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1); - cy_writeb((u_long)base_addr+(CyTDR<icount.tx++; }else{ if(char_count > 1){ info->xmit_cnt--; info->xmit_tail = (info->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1); - cy_writeb((u_long)base_addr+(CyTDR<icount.tx++; char_count--; }else{ @@ -1388,9 +1387,9 @@ } txend: /* end of service */ - cy_writeb((u_long)base_addr+(CyTIR<card_lock); } @@ -1404,7 +1403,7 @@ + cinfo->first_line]; info->last_active = jiffies; save_car = cy_readb(base_addr+(CyCAR<tty->hw_stopped = 0; - cy_writeb((u_long)base_addr+(CySRER<tty->hw_stopped = 1; - cy_writeb((u_long)base_addr+(CySRER<card_lock); } } /* end while status != 0 */ @@ -1473,7 +1472,7 @@ /* clear interrupts */ spin_lock(&cinfo->card_lock); - cy_writeb((u_long)card_base_addr + (Cy_ClrIntr<card_lock); return IRQ_HANDLED; @@ -1488,27 +1487,25 @@ cyz_fetch_msg( struct cyclades_card *cinfo, uclong *channel, ucchar *cmd, uclong *param) { - struct FIRM_ID *firm_id; - struct ZFW_CTRL *zfw_ctrl; - struct BOARD_CTRL *board_ctrl; + struct FIRM_ID __iomem *firm_id; + struct ZFW_CTRL __iomem *zfw_ctrl; + struct BOARD_CTRL __iomem *board_ctrl; unsigned long loc_doorbell; - firm_id = (struct FIRM_ID *)(cinfo->base_addr + ID_ADDRESS); + firm_id = cinfo->base_addr + ID_ADDRESS; if (!ISZLOADED(*cinfo)){ return (-1); } - zfw_ctrl = (struct ZFW_CTRL *) - (cinfo->base_addr + - (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); + zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; - loc_doorbell = cy_readl(&((struct RUNTIME_9060 *) + loc_doorbell = cy_readl(&((struct RUNTIME_9060 __iomem *) (cinfo->ctl_addr))->loc_doorbell); if (loc_doorbell){ *cmd = (char)(0xff & loc_doorbell); *channel = cy_readl(&board_ctrl->fwcmd_channel); *param = (uclong)cy_readl(&board_ctrl->fwcmd_param); - cy_writel(&((struct RUNTIME_9060 *)(cinfo->ctl_addr))->loc_doorbell, + cy_writel(&((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->loc_doorbell, 0xffffffff); return 1; } @@ -1519,40 +1516,38 @@ cyz_issue_cmd( struct cyclades_card *cinfo, uclong channel, ucchar cmd, uclong param) { - struct FIRM_ID *firm_id; - struct ZFW_CTRL *zfw_ctrl; - struct BOARD_CTRL *board_ctrl; - volatile uclong *pci_doorbell; + struct FIRM_ID __iomem *firm_id; + struct ZFW_CTRL __iomem *zfw_ctrl; + struct BOARD_CTRL __iomem *board_ctrl; + unsigned long __iomem *pci_doorbell; int index; - firm_id = (struct FIRM_ID *)(cinfo->base_addr + ID_ADDRESS); + firm_id = cinfo->base_addr + ID_ADDRESS; if (!ISZLOADED(*cinfo)){ return (-1); } - zfw_ctrl = (struct ZFW_CTRL *) - (cinfo->base_addr + - (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); + zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; index = 0; - pci_doorbell = (uclong *)(&((struct RUNTIME_9060 *) - (cinfo->ctl_addr))->pci_doorbell); + pci_doorbell = &((struct RUNTIME_9060 __iomem *) (cinfo->ctl_addr))->pci_doorbell; while( (cy_readl(pci_doorbell) & 0xff) != 0){ if (index++ == 1000){ return((int)(cy_readl(pci_doorbell) & 0xff)); } udelay(50L); } - cy_writel((u_long)&board_ctrl->hcmd_channel, channel); - cy_writel((u_long)&board_ctrl->hcmd_param , param); - cy_writel((u_long)pci_doorbell, (long)cmd); + cy_writel(&board_ctrl->hcmd_channel, channel); + cy_writel(&board_ctrl->hcmd_param , param); + cy_writel(pci_doorbell, (long)cmd); return(0); } /* cyz_issue_cmd */ static void -cyz_handle_rx(struct cyclades_port *info, volatile struct CH_CTRL *ch_ctrl, - volatile struct BUF_CTRL *buf_ctrl) +cyz_handle_rx(struct cyclades_port *info, + volatile struct CH_CTRL __iomem *ch_ctrl, + volatile struct BUF_CTRL __iomem *buf_ctrl) { struct cyclades_card *cinfo = &cy_card[info->card]; struct tty_struct *tty = info->tty; @@ -1649,8 +1644,9 @@ } static void -cyz_handle_tx(struct cyclades_port *info, volatile struct CH_CTRL *ch_ctrl, - volatile struct BUF_CTRL *buf_ctrl) +cyz_handle_tx(struct cyclades_port *info, + volatile struct CH_CTRL __iomem *ch_ctrl, + volatile struct BUF_CTRL __iomem *buf_ctrl) { struct cyclades_card *cinfo = &cy_card[info->card]; struct tty_struct *tty = info->tty; @@ -1737,11 +1733,11 @@ { struct tty_struct *tty; struct cyclades_port *info; - static volatile struct FIRM_ID *firm_id; - static volatile struct ZFW_CTRL *zfw_ctrl; - static volatile struct BOARD_CTRL *board_ctrl; - static volatile struct CH_CTRL *ch_ctrl; - static volatile struct BUF_CTRL *buf_ctrl; + static volatile struct FIRM_ID __iomem *firm_id; + static volatile struct ZFW_CTRL __iomem *zfw_ctrl; + static volatile struct BOARD_CTRL __iomem *board_ctrl; + static volatile struct CH_CTRL __iomem *ch_ctrl; + static volatile struct BUF_CTRL __iomem *buf_ctrl; uclong channel; ucchar cmd; uclong param; @@ -1749,13 +1745,11 @@ int special_count; int delta_count; - firm_id = (struct FIRM_ID *)(cinfo->base_addr + ID_ADDRESS); - zfw_ctrl = (struct ZFW_CTRL *) - (cinfo->base_addr + - (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); - board_ctrl = &(zfw_ctrl->board_ctrl); + firm_id = cinfo->base_addr + ID_ADDRESS; + zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); + board_ctrl = &zfw_ctrl->board_ctrl; fw_ver = cy_readl(&board_ctrl->fw_version); - hw_ver = cy_readl(&((struct RUNTIME_9060 *)(cinfo->ctl_addr))->mail_box_0); + hw_ver = cy_readl(&((struct RUNTIME_9060 __iomem *)(cinfo->ctl_addr))->mail_box_0); while(cyz_fetch_msg(cinfo, &channel, &cmd, ¶m) == 1) { @@ -1922,10 +1916,8 @@ if (!IS_CYC_Z(*cinfo)) continue; if (!ISZLOADED(*cinfo)) continue; - firm_id = (struct FIRM_ID *)(cinfo->base_addr + ID_ADDRESS); - zfw_ctrl = (struct ZFW_CTRL *) - (cinfo->base_addr + - (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); + firm_id = cinfo->base_addr + ID_ADDRESS; + zfw_ctrl = cinfo->base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &(zfw_ctrl->board_ctrl); /* Skip first polling cycle to avoid racing conditions with the FW */ @@ -1969,7 +1961,7 @@ { unsigned long flags; int retval = 0; - unsigned char *base_addr; + void __iomem *base_addr; int card,chip,channel,index; unsigned long page; @@ -2008,8 +2000,7 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr + (cy_chip_offset[chip]<default_timeout + cy_writeb(base_addr+(CyRTPR<default_timeout ? info->default_timeout : 0x02)); /* 10ms rx timeout */ cyy_issue_cmd(base_addr,CyCHAN_CTL|CyENB_RCVR|CyENB_XMTR,index); - cy_writeb((ulong)base_addr+(CyCAR<flags |= ASYNC_INITIALIZED; @@ -2053,22 +2044,20 @@ CY_UNLOCK(info, flags); } else { - struct FIRM_ID *firm_id; - struct ZFW_CTRL *zfw_ctrl; - struct BOARD_CTRL *board_ctrl; - struct CH_CTRL *ch_ctrl; + struct FIRM_ID __iomem *firm_id; + struct ZFW_CTRL __iomem *zfw_ctrl; + struct BOARD_CTRL __iomem *board_ctrl; + struct CH_CTRL __iomem *ch_ctrl; int retval; - base_addr = (unsigned char*) (cy_card[card].base_addr); + base_addr = cy_card[card].base_addr; - firm_id = (struct FIRM_ID *) (base_addr + ID_ADDRESS); + firm_id = base_addr + ID_ADDRESS; if (!ISZLOADED(cy_card[card])){ return -ENODEV; } - zfw_ctrl = (struct ZFW_CTRL *) - (cy_card[card].base_addr + - (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); + zfw_ctrl = cy_card[card].base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; ch_ctrl = zfw_ctrl->ch_ctrl; @@ -2160,7 +2149,7 @@ start_xmit( struct cyclades_port *info ) { unsigned long flags; - unsigned char *base_addr; + void __iomem *base_addr; int card,chip,channel,index; card = info->card; @@ -2169,13 +2158,11 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<flags & ASYNC_INITIALIZED)){ @@ -2216,9 +2203,7 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<xmit_buf = NULL; free_page((unsigned long) temp); } - cy_writeb((u_long)base_addr+(CyCAR<tty || (info->tty->termios->c_cflag & HUPCL)) { - cy_writeb((u_long)base_addr+(CyMSVR1<flags &= ~ASYNC_INITIALIZED; CY_UNLOCK(info, flags); } else { - struct FIRM_ID *firm_id; - struct ZFW_CTRL *zfw_ctrl; - struct BOARD_CTRL *board_ctrl; - struct CH_CTRL *ch_ctrl; + struct FIRM_ID __iomem *firm_id; + struct ZFW_CTRL __iomem *zfw_ctrl; + struct BOARD_CTRL __iomem *board_ctrl; + struct CH_CTRL __iomem *ch_ctrl; int retval; - base_addr = (unsigned char*) (cy_card[card].base_addr); + base_addr = cy_card[card].base_addr; #ifdef CY_DEBUG_OPEN printk("cyc shutdown Z card %d, channel %d, base_addr %lx\n", card, channel, (long)base_addr); #endif - firm_id = (struct FIRM_ID *) (base_addr + ID_ADDRESS); + firm_id = base_addr + ID_ADDRESS; if (!ISZLOADED(cy_card[card])) { return; } - zfw_ctrl = (struct ZFW_CTRL *) - (cy_card[card].base_addr + - (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); - board_ctrl = &(zfw_ctrl->board_ctrl); + zfw_ctrl = cy_card[card].base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); + board_ctrl = &zfw_ctrl->board_ctrl; ch_ctrl = zfw_ctrl->ch_ctrl; CY_LOCK(info, flags); @@ -2290,7 +2273,7 @@ } if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) { - cy_writel((u_long)&ch_ctrl[channel].rs_control, + cy_writel(&ch_ctrl[channel].rs_control, (uclong)(cy_readl(&ch_ctrl[channel].rs_control) & ~(C_RS_RTS | C_RS_DTR))); retval = cyz_issue_cmd(&cy_card[info->card], @@ -2334,7 +2317,7 @@ unsigned long flags; int chip, channel,index; int retval; - char *base_addr; + void __iomem *base_addr; cinfo = &cy_card[info->card]; channel = info->line - cinfo->first_line; @@ -2387,15 +2370,14 @@ chip = channel>>2; channel &= 0x03; index = cinfo->bus_index; - base_addr = (char *)(cinfo->base_addr - + (cy_chip_offset[chip]<base_addr + (cy_chip_offset[chip]<termios->c_cflag & CBAUD)){ - cy_writeb((u_long)base_addr+(CyCAR<flags & ASYNC_CLOSING) && (C_CLOCAL(tty) || (cy_readb(base_addr+(CyMSVR1<base_addr); - firm_id = (struct FIRM_ID *) - (base_addr + ID_ADDRESS); + base_addr = cinfo->base_addr; + firm_id = base_addr + ID_ADDRESS; if (!ISZLOADED(*cinfo)){ current->state = TASK_RUNNING; remove_wait_queue(&info->open_wait, &wait); return -EINVAL; } - zfw_ctrl = (struct ZFW_CTRL *) - (base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); + zfw_ctrl = base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; ch_ctrl = zfw_ctrl->ch_ctrl; @@ -2540,11 +2520,10 @@ */ if (IS_CYC_Z(cy_card[info->card])) { struct cyclades_card *cinfo = &cy_card[info->card]; - struct FIRM_ID *firm_id = (struct FIRM_ID *) - (cinfo->base_addr + ID_ADDRESS); + struct FIRM_ID __iomem *firm_id = cinfo->base_addr + ID_ADDRESS; if (!ISZLOADED(*cinfo)) { - if (((ZE_V1 ==cy_readl(&((struct RUNTIME_9060 *) + if (((ZE_V1 ==cy_readl(&((struct RUNTIME_9060 __iomem *) (cinfo->ctl_addr))->mail_box_0)) && Z_FPGA_CHECK (*cinfo)) && (ZFIRM_HLT == cy_readl (&firm_id->signature))) @@ -2561,12 +2540,10 @@ interrupts should be enabled as soon as the first open happens to one of its ports. */ if (!cinfo->intr_enabled) { - struct ZFW_CTRL *zfw_ctrl; - struct BOARD_CTRL *board_ctrl; + struct ZFW_CTRL __iomem *zfw_ctrl; + struct BOARD_CTRL __iomem *board_ctrl; - zfw_ctrl = (struct ZFW_CTRL *) - (cinfo->base_addr + - (cy_readl (&firm_id->zfwctrl_addr) & 0xfffff)); + zfw_ctrl = cinfo->base_addr + (cy_readl (&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; @@ -2658,7 +2635,7 @@ cy_wait_until_sent(struct tty_struct *tty, int timeout) { struct cyclades_port * info = (struct cyclades_port *)tty->driver_data; - unsigned char *base_addr; + void __iomem *base_addr; int card,chip,channel,index; unsigned long orig_jiffies; int char_time; @@ -2708,8 +2685,7 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char *) - (cy_card[card].base_addr + (cy_chip_offset[chip]<card])) { int channel = info->line - cy_card[info->card].first_line; int index = cy_card[info->card].bus_index; - unsigned char *base_addr = (unsigned char *) - (cy_card[info->card].base_addr + - (cy_chip_offset[channel>>2] <card].base_addr + (cy_chip_offset[channel>>2] << index); /* Stop accepting input */ channel &= 0x03; - cy_writeb((ulong)base_addr+(CyCAR<flags & ASYNC_INITIALIZED) { /* Waiting for on-board buffers to be empty before closing @@ -2820,12 +2794,10 @@ } else { #ifdef Z_WAKE /* Waiting for on-board buffers to be empty before closing the port */ - unsigned char *base_addr = (unsigned char *) - cy_card[info->card].base_addr; - struct FIRM_ID *firm_id = (struct FIRM_ID *) (base_addr + ID_ADDRESS); - struct ZFW_CTRL *zfw_ctrl = (struct ZFW_CTRL *) - (base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); - struct CH_CTRL *ch_ctrl = zfw_ctrl->ch_ctrl; + void __iomem *base_addr = cy_card[info->card].base_addr; + struct FIRM_ID __iomem *firm_id = base_addr + ID_ADDRESS; + struct ZFW_CTRL __iomem *zfw_ctrl = base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); + struct CH_CTRL __iomem *ch_ctrl = zfw_ctrl->ch_ctrl; int channel = info->line - cy_card[info->card].first_line; int retval; @@ -3084,10 +3056,8 @@ int char_count; volatile uclong tx_put, tx_get, tx_bufsize; - firm_id = (struct FIRM_ID *)(cy_card[card].base_addr + ID_ADDRESS); - zfw_ctrl = (struct ZFW_CTRL *) - (cy_card[card].base_addr + - (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff)); + firm_id = cy_card[card].base_addr + ID_ADDRESS; + zfw_ctrl = cy_card[card].base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]); buf_ctrl = &(zfw_ctrl->buf_ctrl[channel]); @@ -3147,7 +3117,7 @@ set_line_char(struct cyclades_port * info) { unsigned long flags; - unsigned char *base_addr; + void __iomem *base_addr; int card,chip,channel,index; unsigned cflag, iflag; unsigned short chip_number; @@ -3299,76 +3269,74 @@ chip = channel>>2; channel &= 0x03; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<tco); - cy_writeb((u_long)base_addr+(CyTBPR<tbpr); - cy_writeb((u_long)base_addr+(CyRCOR<rco); - cy_writeb((u_long)base_addr+(CyRBPR<rbpr); + cy_writeb(base_addr+(CyTCOR<tco); + cy_writeb(base_addr+(CyTBPR<tbpr); + cy_writeb(base_addr+(CyRCOR<rco); + cy_writeb(base_addr+(CyRBPR<rbpr); /* set line characteristics according configuration */ - cy_writeb((u_long)base_addr+(CySCHR1<tty)); - cy_writeb((u_long)base_addr+(CySCHR2<tty)); - cy_writeb((u_long)base_addr+(CyCOR1<cor1); - cy_writeb((u_long)base_addr+(CyCOR2<cor2); - cy_writeb((u_long)base_addr+(CyCOR3<cor3); - cy_writeb((u_long)base_addr+(CyCOR4<cor4); - cy_writeb((u_long)base_addr+(CyCOR5<cor5); + cy_writeb(base_addr+(CyCOR1<cor1); + cy_writeb(base_addr+(CyCOR2<cor2); + cy_writeb(base_addr+(CyCOR3<cor3); + cy_writeb(base_addr+(CyCOR4<cor4); + cy_writeb(base_addr+(CyCOR5<cor5); cyy_issue_cmd(base_addr, CyCOR_CHANGE|CyCOR1ch|CyCOR2ch|CyCOR3ch,index); - cy_writeb((u_long)base_addr+(CyCAR<default_timeout + cy_writeb(base_addr+(CyRTPR<default_timeout ? info->default_timeout : 0x02)); /* 10ms rx timeout */ if (C_CLOCAL(info->tty)) { /* without modem intr */ - cy_writeb((u_long)base_addr+(CySRER<0 modem transitions */ if ((cflag & CRTSCTS) && info->rflow) { - cy_writeb((u_long)base_addr+(CyMCOR1<1 modem transitions */ - cy_writeb((u_long)base_addr+(CyMCOR2<0 modem transitions */ if ((cflag & CRTSCTS) && info->rflow) { - cy_writeb((u_long)base_addr+(CyMCOR1<1 modem transitions */ - cy_writeb((u_long)base_addr+(CyMCOR2<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR1<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR1<zfwctrl_addr) & 0xfffff)); + zfw_ctrl = cy_card[card].base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; ch_ctrl = &(zfw_ctrl->ch_ctrl[channel]); buf_ctrl = &zfw_ctrl->buf_ctrl[channel]; @@ -3613,7 +3578,7 @@ unsigned char status; unsigned int result; unsigned long flags; - unsigned char *base_addr; + void __iomem *base_addr; card = info->card; channel = (info->line) - (cy_card[card].first_line); @@ -3621,8 +3586,7 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char *) - (cy_card[card].base_addr + (cy_chip_offset[chip]<driver_data; int card,chip,channel,index; - unsigned char *base_addr; + void __iomem *base_addr; unsigned long flags; unsigned char status; unsigned long lstatus; unsigned int result; - struct FIRM_ID *firm_id; - struct ZFW_CTRL *zfw_ctrl; - struct BOARD_CTRL *board_ctrl; - struct CH_CTRL *ch_ctrl; + struct FIRM_ID __iomem *firm_id; + struct ZFW_CTRL __iomem *zfw_ctrl; + struct BOARD_CTRL __iomem *board_ctrl; + struct CH_CTRL __iomem *ch_ctrl; if (serial_paranoia_check(info, tty->name, __FUNCTION__)) return -ENODEV; @@ -3659,12 +3623,10 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<zfwctrl_addr) & 0xfffff)); + zfw_ctrl = cy_card[card].base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; ch_ctrl = zfw_ctrl->ch_ctrl; lstatus = cy_readl(&ch_ctrl[channel].rs_status); @@ -3718,12 +3677,12 @@ { struct cyclades_port * info = (struct cyclades_port *)tty->driver_data; int card,chip,channel,index; - unsigned char *base_addr; + void __iomem *base_addr; unsigned long flags; - struct FIRM_ID *firm_id; - struct ZFW_CTRL *zfw_ctrl; - struct BOARD_CTRL *board_ctrl; - struct CH_CTRL *ch_ctrl; + struct FIRM_ID __iomem *firm_id; + struct ZFW_CTRL __iomem *zfw_ctrl; + struct BOARD_CTRL __iomem *board_ctrl; + struct CH_CTRL __iomem *ch_ctrl; int retval; if (serial_paranoia_check(info, tty->name, __FUNCTION__)) @@ -3735,37 +3694,35 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR2<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR2<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR1<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR1<zfwctrl_addr) & 0xfffff)); + zfw_ctrl = cy_card[card].base_addr + (cy_readl(&firm_id->zfwctrl_addr) & 0xfffff); board_ctrl = &zfw_ctrl->board_ctrl; ch_ctrl = zfw_ctrl->ch_ctrl; @@ -3926,7 +3880,7 @@ static int set_threshold(struct cyclades_port * info, unsigned long value) { - unsigned char *base_addr; + void __iomem *base_addr; int card,channel,chip,index; unsigned long flags; @@ -3936,15 +3890,13 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<cor3 &= ~CyREC_FIFO; info->cor3 |= value & CyREC_FIFO; CY_LOCK(info, flags); - cy_writeb((u_long)base_addr+(CyCOR3<cor3); + cy_writeb(base_addr+(CyCOR3<cor3); cyy_issue_cmd(base_addr,CyCOR_CHANGE|CyCOR3ch,index); CY_UNLOCK(info, flags); } else { @@ -3957,7 +3909,7 @@ static int get_threshold(struct cyclades_port * info, unsigned long __user *value) { - unsigned char *base_addr; + void __iomem *base_addr; int card,channel,chip,index; unsigned long tmp; @@ -3967,9 +3919,7 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<driver_data; unsigned long flags; - unsigned char *base_addr; + void __iomem *base_addr; int card,chip,channel,index; #ifdef CY_DEBUG_THROTTLE @@ -4355,16 +4301,14 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR2<driver_data; unsigned long flags; - unsigned char *base_addr; + void __iomem *base_addr; int card,chip,channel,index; #ifdef CY_DEBUG_THROTTLE @@ -4415,16 +4359,14 @@ chip = channel>>2; channel &= 0x03; index = cy_card[card].bus_index; - base_addr = (unsigned char*) - (cy_card[card].base_addr - + (cy_chip_offset[chip]<rtsdtr_inv) { - cy_writeb((u_long)base_addr+(CyMSVR2<driver_data; - unsigned char *base_addr; + void __iomem *base_addr; int chip,channel,index; unsigned long flags; @@ -4461,14 +4403,12 @@ index = cinfo->bus_index; chip = channel>>2; channel &= 0x03; - base_addr = (unsigned char*) - (cy_card[info->card].base_addr - + (cy_chip_offset[chip]<card].base_addr + (cy_chip_offset[chip]<driver_data; - unsigned char *base_addr; + void __iomem *base_addr; int chip,channel,index; unsigned long flags; @@ -4501,14 +4441,12 @@ if (!IS_CYC_Z(*cinfo)) { chip = channel>>2; channel &= 0x03; - base_addr = (unsigned char*) - (cy_card[info->card].base_addr - + (cy_chip_offset[chip]<card].base_addr + (cy_chip_offset[chip]<= CD1400_REV_J){ /* It is a CD1400 rev. J or later */ /* Impossible to reach 5ms with this chip. Changed to 2ms instead (f = 500 Hz). */ - cy_writeb((u_long)base_addr+(CyPPR<mail_box_0); if (pci_resource_flags(pdev, 2) & IORESOURCE_IO) { @@ -5031,7 +4967,7 @@ } if (mailbox == ZE_V1) { - cy_pci_addr2 = (ulong)ioremap(cy_pci_phys2, CyPCI_Ze_win); + cy_pci_addr2 = ioremap(cy_pci_phys2, CyPCI_Ze_win); if (ZeIndex == NR_CARDS) { printk("Cyclades-Ze/PCI found at 0x%lx ", (ulong)cy_pci_phys2); @@ -5049,7 +4985,7 @@ i--; continue; } else { - cy_pci_addr2 = (ulong)ioremap(cy_pci_phys2, CyPCI_Zwin); + cy_pci_addr2 = ioremap(cy_pci_phys2, CyPCI_Zwin); } #ifdef CY_PCI_DEBUG @@ -5076,7 +5012,7 @@ */ PAUSE if ((mailbox == ZO_V1) || (mailbox == ZO_V2)) - cy_writel((ulong)(cy_pci_addr2+ID_ADDRESS), 0L); + cy_writel(cy_pci_addr2 + ID_ADDRESS, 0L); /* This must be a Cyclades-8Zo/PCI. The extendable version will have a different device_id and will @@ -5166,7 +5102,7 @@ Ze_pdev[j] = Ze_pdev[j+1]; } ZeIndex--; - mailbox = (uclong)cy_readl(&((struct RUNTIME_9060 *) + mailbox = (uclong)cy_readl(&((struct RUNTIME_9060 __iomem *) cy_pci_addr0)->mail_box_0); #ifdef CY_PCI_DEBUG printk("Cyclades-Z/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n", @@ -5407,7 +5343,7 @@ for (i = 0; i < NR_CARDS; i++) { /* base_addr=0 indicates board not found */ - cy_card[i].base_addr = 0; + cy_card[i].base_addr = NULL; } /* the code below is responsible to find the boards. Each different @@ -5429,7 +5365,7 @@ for (i = 0 ; i < NR_CARDS ; i++) { if (cy_card[i].base_addr == 0) { cy_card[i].first_line = -1; - cy_card[i].ctl_addr = 0; + cy_card[i].ctl_addr = NULL; cy_card[i].irq = 0; cy_card[i].bus_index = 0; cy_card[i].first_line = 0; @@ -5447,7 +5383,7 @@ cinfo = &cy_card[board]; if (cinfo->num_chips == -1) { /* Cyclades-Z */ number_z_boards++; - mailbox = cy_readl(&((struct RUNTIME_9060 *) + mailbox = cy_readl(&((struct RUNTIME_9060 __iomem *) cy_card[board].ctl_addr)->mail_box_0); nports = (mailbox == ZE_V1) ? ZE_V1_NPORTS : 8; cinfo->intr_enabled = 0; @@ -5617,10 +5553,10 @@ put_tty_driver(cy_serial_driver); for (i = 0; i < NR_CARDS; i++) { - if (cy_card[i].base_addr != 0) { - iounmap((void *)cy_card[i].base_addr); - if (cy_card[i].ctl_addr != 0) - iounmap((void *)cy_card[i].ctl_addr); + if (cy_card[i].base_addr) { + iounmap(cy_card[i].base_addr); + if (cy_card[i].ctl_addr) + iounmap(cy_card[i].ctl_addr); if (cy_card[i].irq #ifndef CONFIG_CYZ_INTR && cy_card[i].num_chips != -1 /* not a Z card */ diff -Nru a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig --- a/drivers/char/drm/Kconfig 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/drm/Kconfig 2004-10-06 19:37:47 -07:00 @@ -55,9 +55,13 @@ selected, the module will be called i810. AGP support is required for this driver to work. -config DRM_I830 - tristate "Intel 830M, 845G, 852GM, 855GM, 865G" +choice + prompt "Intel 830M, 845G, 852GM, 855GM, 865G" depends on DRM && AGP && AGP_INTEL + optional + +config DRM_I830 + tristate "i830 driver" help Choose this option if you have a system that has Intel 830M, 845G, 852GM, 855GM or 865G integrated graphics. If M is selected, the @@ -65,8 +69,7 @@ to work. This driver will eventually be replaced by the i915 one. config DRM_I915 - tristate "Intel 830M, 845G, 852GM, 855GM, 865G, 915G" - depends on DRM && AGP && AGP_INTEL + tristate "i915 driver" help Choose this option if you have a system that has Intel 830M, 845G, 852GM, 855GM 865G or 915G integrated graphics. If M is selected, the @@ -74,6 +77,7 @@ to work. This driver will eventually replace the I830 driver, when later release of X start to use the new DDX and DRI. +endchoice config DRM_MGA tristate "Matrox g200/g400" diff -Nru a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c --- a/drivers/char/generic_serial.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/generic_serial.c 2004-10-06 19:37:47 -07:00 @@ -691,7 +691,7 @@ unsigned long flags; struct gs_port *port; - func_enter () + func_enter (); if (!tty) return; diff -Nru a/drivers/char/hpet.c b/drivers/char/hpet.c --- a/drivers/char/hpet.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/hpet.c 2004-10-06 19:37:47 -07:00 @@ -925,7 +925,7 @@ return 0; } -static struct acpi_driver hpet_acpi_driver __initdata = { +static struct acpi_driver hpet_acpi_driver = { .name = "hpet", .ids = "PNP0103", .ops = { diff -Nru a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c --- a/drivers/char/ipmi/ipmi_poweroff.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/ipmi/ipmi_poweroff.c 2004-10-06 19:37:47 -07:00 @@ -83,7 +83,7 @@ static struct ipmi_user_hndl ipmi_poweroff_handler = { - ipmi_recv_hndl : receive_handler + .ipmi_recv_hndl = receive_handler }; diff -Nru a/drivers/char/moxa.c b/drivers/char/moxa.c --- a/drivers/char/moxa.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/moxa.c 2004-10-06 19:37:47 -07:00 @@ -952,7 +952,7 @@ if (MoxaPortTxQueue(ch->port) <= WAKEUP_CHARS) { if (!tp->stopped) { ch->statusflags &= ~LOWWAIT; - tty_wakeup(tty); + tty_wakeup(tp); wake_up_interruptible(&tp->write_wait); } } @@ -1119,7 +1119,7 @@ if (ch->tty && (ch->statusflags & EMPTYWAIT)) { if (MoxaPortTxQueue(ch->port) == 0) { ch->statusflags &= ~EMPTYWAIT; - tty_wakeup(tty); + tty_wakeup(ch->tty); wake_up_interruptible(&ch->tty->write_wait); return; } diff -Nru a/drivers/char/random.c b/drivers/char/random.c --- a/drivers/char/random.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/char/random.c 2004-10-06 19:37:46 -07:00 @@ -807,10 +807,11 @@ long delta, delta2, delta3; int entropy = 0; + preempt_disable(); /* if over the trickle threshold, use only 1 in 4096 samples */ if ( random_state->entropy_count > trickle_thresh && (__get_cpu_var(trickle_count)++ & 0xfff)) - return; + goto out; /* * Use get_cycles() if implemented, otherwise fall back to @@ -861,6 +862,8 @@ entropy = int_ln_12bits(delta); } batch_entropy_store(num, time, entropy); +out: + preempt_enable(); } void add_keyboard_randomness(unsigned char scancode) @@ -2184,7 +2187,7 @@ #undef K3 /* This should not be decreased so low that ISNs wrap too fast. */ -#define REKEY_INTERVAL 300 +#define REKEY_INTERVAL (300*HZ) /* * Bit layout of the tcp sequence numbers (before adding current time): * bit 24-31: increased after every key exchange @@ -2210,48 +2213,55 @@ #define HASH_MASK ( (1<rekey_time = tv.tv_sec; get_random_bytes(keyptr->secret, sizeof(keyptr->secret)); keyptr->count = (ip_cnt&COUNT_MASK)<rekey_time || (time - keyptr->rekey_time) > REKEY_INTERVAL) { - schedule_work(&rekey_work); - } + smp_rmb(); return keyptr; } +static __init int seqgen_init(void) +{ + rekey_seq_generator(NULL); + return 0; +} +late_initcall(seqgen_init); + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, __u16 sport, __u16 dport) @@ -2259,14 +2269,12 @@ struct timeval tv; __u32 seq; __u32 hash[12]; - struct keydata *keyptr; + struct keydata *keyptr = get_keyptr(); /* The procedure is the same as for IPv4, but addresses are longer. * Thus we must use twothirdsMD4Transform. */ - do_gettimeofday(&tv); /* We need the usecs below... */ - keyptr = check_and_rekey(tv.tv_sec); memcpy(hash, saddr, 16); hash[4]=(sport << 16) + dport; @@ -2274,6 +2282,8 @@ seq = twothirdsMD4Transform(daddr, hash) & HASH_MASK; seq += keyptr->count; + + do_gettimeofday(&tv); seq += tv.tv_usec + tv.tv_sec*1000000; return seq; @@ -2287,13 +2297,7 @@ struct timeval tv; __u32 seq; __u32 hash[4]; - struct keydata *keyptr; - - /* - * Pick a random secret every REKEY_INTERVAL seconds. - */ - do_gettimeofday(&tv); /* We need the usecs below... */ - keyptr = check_and_rekey(tv.tv_sec); + struct keydata *keyptr = get_keyptr(); /* * Pick a unique starting offset for each TCP connection endpoints @@ -2316,6 +2320,7 @@ * That's funny, Linux has one built in! Use it! * (Networks are faster now - should this be increased?) */ + do_gettimeofday(&tv); seq += tv.tv_usec + tv.tv_sec*1000000; #if 0 printk("init_seq(%lx, %lx, %d, %d) = %d\n", @@ -2334,7 +2339,7 @@ struct keydata *keyptr; __u32 hash[4]; - keyptr = check_and_rekey(get_seconds()); + keyptr = get_keyptr(); /* * Pick a unique starting offset for each IP destination. diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c --- a/drivers/char/tty_io.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/tty_io.c 2004-10-06 19:37:47 -07:00 @@ -130,8 +130,6 @@ /* Semaphore to protect creating and releasing a tty. This is shared with vt.c for deeply disgusting hack reasons */ DECLARE_MUTEX(tty_sem); -/* Lock for tty_termios changes - private to tty_io/tty_ioctl */ -spinlock_t tty_termios_lock = SPIN_LOCK_UNLOCKED; #ifdef CONFIG_UNIX98_PTYS extern struct tty_driver *ptm_driver; /* Unix98 pty masters; for /dev/ptmx */ @@ -239,10 +237,9 @@ static void tty_set_termios_ldisc(struct tty_struct *tty, int num) { - unsigned long flags; - spin_lock_irqsave(&tty_termios_lock, flags); + down(&tty->termios_sem); tty->termios->c_line = num; - spin_unlock_irqrestore(&tty_termios_lock, flags); + up(&tty->termios_sem); } /* @@ -811,10 +808,9 @@ */ if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { - unsigned long flags; - spin_lock_irqsave(&tty_termios_lock, flags); + down(&tty->termios_sem); *tty->termios = tty->driver->init_termios; - spin_unlock_irqrestore(&tty_termios_lock, flags); + up(&tty->termios_sem); } /* Defer ldisc switch */ @@ -2606,6 +2602,7 @@ tty->flip.flag_buf_ptr = tty->flip.flag_buf; INIT_WORK(&tty->flip.work, flush_to_ldisc, tty); init_MUTEX(&tty->flip.pty_sem); + init_MUTEX(&tty->termios_sem); init_waitqueue_head(&tty->write_wait); init_waitqueue_head(&tty->read_wait); INIT_WORK(&tty->hangup_work, do_tty_hangup, tty); diff -Nru a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c --- a/drivers/char/tty_ioctl.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/char/tty_ioctl.c 2004-10-06 19:37:48 -07:00 @@ -29,8 +29,6 @@ #undef DEBUG -extern spinlock_t tty_termios_lock; - /* * Internal flag options for termios setting behavior */ @@ -101,7 +99,6 @@ int canon_change; struct termios old_termios = *tty->termios; struct tty_ldisc *ld; - unsigned long flags; /* * Perform the actual termios internal changes under lock. @@ -110,7 +107,7 @@ /* FIXME: we need to decide on some locking/ordering semantics for the set_termios notification eventually */ - spin_lock_irqsave(&tty_termios_lock, flags); + down(&tty->termios_sem); *tty->termios = *new_termios; unset_locked_termios(tty->termios, &old_termios, tty->termios_locked); @@ -155,7 +152,7 @@ (ld->set_termios)(tty, &old_termios); tty_ldisc_deref(ld); } - spin_unlock_irqrestore(&tty_termios_lock, flags); + up(&tty->termios_sem); } static int set_termios(struct tty_struct * tty, void __user *arg, int opt) @@ -249,15 +246,14 @@ static int get_sgttyb(struct tty_struct * tty, struct sgttyb __user * sgttyb) { struct sgttyb tmp; - unsigned long flags; - spin_lock_irqsave(&tty_termios_lock, flags); + down(&tty->termios_sem); tmp.sg_ispeed = 0; tmp.sg_ospeed = 0; tmp.sg_erase = tty->termios->c_cc[VERASE]; tmp.sg_kill = tty->termios->c_cc[VKILL]; tmp.sg_flags = get_sgflags(tty); - spin_unlock_irqrestore(&tty_termios_lock, flags); + up(&tty->termios_sem); return copy_to_user(sgttyb, &tmp, sizeof(tmp)) ? -EFAULT : 0; } @@ -293,7 +289,6 @@ int retval; struct sgttyb tmp; struct termios termios; - unsigned long flags; retval = tty_check_change(tty); if (retval) @@ -301,13 +296,13 @@ if (copy_from_user(&tmp, sgttyb, sizeof(tmp))) return -EFAULT; - - spin_lock_irqsave(&tty_termios_lock, flags); + + down(&tty->termios_sem); termios = *tty->termios; termios.c_cc[VERASE] = tmp.sg_erase; termios.c_cc[VKILL] = tmp.sg_kill; set_sgflags(&termios, tmp.sg_flags); - spin_unlock_irqrestore(&tty_termios_lock, flags); + up(&tty->termios_sem); change_termios(tty, &termios); return 0; } @@ -399,7 +394,6 @@ void __user *p = (void __user *)arg; int retval; struct tty_ldisc *ld; - unsigned long flags; if (tty->driver->type == TTY_DRIVER_TYPE_PTY && tty->driver->subtype == PTY_TYPE_MASTER) @@ -543,11 +537,11 @@ case TIOCSSOFTCAR: if (get_user(arg, (unsigned int __user *) arg)) return -EFAULT; - spin_lock_irqsave(&tty_termios_lock, flags); + down(&tty->termios_sem); tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0)); - spin_unlock_irqrestore(&tty_termios_lock, flags); + up(&tty->termios_sem); return 0; default: return -ENOIOCTLCMD; diff -Nru a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c --- a/drivers/char/watchdog/sa1100_wdt.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/char/watchdog/sa1100_wdt.c 2004-10-06 19:37:47 -07:00 @@ -27,6 +27,10 @@ #include #include +#ifdef CONFIG_ARCH_PXA +#include +#endif + #include #include #include diff -Nru a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c --- a/drivers/cpufreq/cpufreq_ondemand.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/cpufreq/cpufreq_ondemand.c 2004-10-06 19:37:47 -07:00 @@ -59,7 +59,7 @@ #define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000) #define DEF_SAMPLING_DOWN_FACTOR (10) #define TRANSITION_LATENCY_LIMIT (10 * 1000) -#define sampling_rate_in_HZ(x) ((x * HZ) / (1000 * 1000)) +#define sampling_rate_in_HZ(x) (((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000))) static void do_dbs_timer(void *data); @@ -221,6 +221,7 @@ static void dbs_check_cpu(int cpu) { unsigned int idle_ticks, up_idle_ticks, down_idle_ticks; + unsigned int total_idle_ticks; unsigned int freq_down_step; unsigned int freq_down_sampling_rate; static int down_skip[NR_CPUS]; @@ -244,19 +245,23 @@ * 5% of max_frequency */ /* Check for frequency increase */ - idle_ticks = kstat_cpu(cpu).cpustat.idle - + total_idle_ticks = kstat_cpu(cpu).cpustat.idle + + kstat_cpu(cpu).cpustat.iowait; + idle_ticks = total_idle_ticks - this_dbs_info->prev_cpu_idle_up; - this_dbs_info->prev_cpu_idle_up = kstat_cpu(cpu).cpustat.idle; + this_dbs_info->prev_cpu_idle_up = total_idle_ticks; + /* Scale idle ticks by 100 and compare with up and down ticks */ + idle_ticks *= 100; up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) * - sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate) / 100; + sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate); if (idle_ticks < up_idle_ticks) { __cpufreq_driver_target(this_dbs_info->cur_policy, this_dbs_info->cur_policy->max, CPUFREQ_RELATION_H); down_skip[cpu] = 0; - this_dbs_info->prev_cpu_idle_down = kstat_cpu(cpu).cpustat.idle; + this_dbs_info->prev_cpu_idle_down = total_idle_ticks; return; } @@ -265,18 +270,25 @@ if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor) return; - idle_ticks = kstat_cpu(cpu).cpustat.idle - + idle_ticks = total_idle_ticks - this_dbs_info->prev_cpu_idle_down; + /* Scale idle ticks by 100 and compare with up and down ticks */ + idle_ticks *= 100; down_skip[cpu] = 0; - this_dbs_info->prev_cpu_idle_down = kstat_cpu(cpu).cpustat.idle; + this_dbs_info->prev_cpu_idle_down = total_idle_ticks; freq_down_sampling_rate = dbs_tuners_ins.sampling_rate * dbs_tuners_ins.sampling_down_factor; down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) * - sampling_rate_in_HZ(freq_down_sampling_rate) / 100; + sampling_rate_in_HZ(freq_down_sampling_rate); if (idle_ticks > down_idle_ticks ) { freq_down_step = (5 * this_dbs_info->cur_policy->max) / 100; + + /* max freq cannot be less than 100. But who knows.... */ + if (unlikely(freq_down_step == 0)) + freq_down_step = 5; + __cpufreq_driver_target(this_dbs_info->cur_policy, this_dbs_info->cur_policy->cur - freq_down_step, CPUFREQ_RELATION_H); @@ -333,9 +345,11 @@ this_dbs_info->cur_policy = policy; this_dbs_info->prev_cpu_idle_up = - kstat_cpu(cpu).cpustat.idle; + kstat_cpu(cpu).cpustat.idle + + kstat_cpu(cpu).cpustat.iowait; this_dbs_info->prev_cpu_idle_down = - kstat_cpu(cpu).cpustat.idle; + kstat_cpu(cpu).cpustat.idle + + kstat_cpu(cpu).cpustat.iowait; this_dbs_info->enable = 1; sysfs_create_group(&policy->kobj, &dbs_attr_group); dbs_enable++; @@ -344,8 +358,14 @@ * is used for first time */ if (dbs_enable == 1) { + unsigned int latency; /* policy latency is in nS. Convert it to uS first */ - def_sampling_rate = (policy->cpuinfo.transition_latency / 1000) * + + latency = policy->cpuinfo.transition_latency; + if (latency < 1000) + latency = 1000; + + def_sampling_rate = (latency / 1000) * DEF_SAMPLING_RATE_LATENCY_MULTIPLIER; dbs_tuners_ins.sampling_rate = def_sampling_rate; diff -Nru a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig --- a/drivers/firmware/Kconfig 2004-10-06 19:37:46 -07:00 +++ b/drivers/firmware/Kconfig 2004-10-06 19:37:46 -07:00 @@ -14,8 +14,9 @@ Services real mode BIOS calls to determine which disk BIOS tries boot from. This information is then exported via sysfs. - This option is experimental, but believed to be safe, - and most disk controller BIOS vendors do not yet implement this feature. + This option is experimental and is known to fail to boot on some + obscure configurations. Most disk controller BIOS vendors do + not yet implement this feature. config EFI_VARS tristate "EFI Variable Support via sysfs" diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig --- a/drivers/ide/Kconfig 2004-10-06 19:37:47 -07:00 +++ b/drivers/ide/Kconfig 2004-10-06 19:37:47 -07:00 @@ -830,6 +830,13 @@ Say Y here if you want to support the Yellowstone RapIDE controller manufactured for use with Acorn computers. +config BLK_DEV_IDE_BAST + tristate "Simtec BAST / Thorcom VR1000 IDE support" + depends on ARM && (ARCH_BAST || MACH_VR100) + help + Say Y here if you want to support the onboard IDE channels on the + Simtec BAST or the Thorcom VR1000 + config BLK_DEV_GAYLE bool "Amiga Gayle IDE interface support" depends on AMIGA diff -Nru a/drivers/ide/arm/Makefile b/drivers/ide/arm/Makefile --- a/drivers/ide/arm/Makefile 2004-10-06 19:37:46 -07:00 +++ b/drivers/ide/arm/Makefile 2004-10-06 19:37:46 -07:00 @@ -1,5 +1,6 @@ obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o +obj-$(CONFIG_BLK_DEV_IDE_BAST) += bast-ide.o EXTRA_CFLAGS := -Idrivers/ide diff -Nru a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/ide/arm/bast-ide.c 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,71 @@ +/* linux/drivers/ide/arm/bast-ide.c + * + * Copyright (c) 2003-2004 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 version 2 as + * published by the Free Software Foundation. + * +*/ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +/* list of registered interfaces */ +static ide_hwif_t *ifs[2]; + +static int __init +bastide_register(unsigned int base, unsigned int aux, int irq, + ide_hwif_t **hwif) +{ + hw_regs_t hw; + int i; + + memset(&hw, 0, sizeof(hw)); + + base += BAST_IDE_CS; + aux += BAST_IDE_CS; + + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { + hw.io_ports[i] = (unsigned long)base; + base += 0x20; + } + + hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20); + hw.irq = irq; + + ide_register_hw(&hw, hwif); + + return 0; +} + +static int __init bastide_init(void) +{ + /* we can treat the VR1000 and the BAST the same */ + + if (!(machine_is_bast() || machine_is_vr1000())) + return 0; + + printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n"); + + bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]); + bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]); + return 0; +} + +module_init(bastide_init); + +MODULE_AUTHOR("Ben Dooks "); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Simtec BAST / Thorcom VR1000 IDE driver"); diff -Nru a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c --- a/drivers/ide/ide-probe.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/ide/ide-probe.c 2004-10-06 19:37:47 -07:00 @@ -389,15 +389,6 @@ */ printk("%s: IRQ probe failed (0x%lx)\n", drive->name, cookie); -#ifdef CONFIG_BLK_DEV_CMD640 -#ifdef CMD640_DUMP_REGS - if (hwif->chipset == ide_cmd640) { - printk("%s: Hmmm.. probably a driver " - "problem.\n", drive->name); - CMD640_DUMP_REGS; - } -#endif /* CMD640_DUMP_REGS */ -#endif /* CONFIG_BLK_DEV_CMD640 */ } } } diff -Nru a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c --- a/drivers/ide/ide-proc.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/ide/ide-proc.c 2004-10-06 19:37:47 -07:00 @@ -360,27 +360,14 @@ int err = 0; len = sprintf(page, "\n"); - - if (drive) - { + + if (drive) { unsigned short *val = (unsigned short *) page; - - /* - * The current code can't handle a driverless - * identify query taskfile. Now the right fix is - * to add a 'default' driver but that is a bit - * more work. - * - * FIXME: this has to be fixed for hotswap devices - */ - - if(DRIVER(drive)) - err = taskfile_lib_get_identify(drive, page); - else /* This relies on the ID changes */ - val = (unsigned short *)drive->id; - if(!err) - { + BUG_ON(!drive->driver); + + err = taskfile_lib_get_identify(drive, page); + if (!err) { char *out = ((char *)page) + (SECTOR_WORDS * 4); page = out; do { diff -Nru a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c --- a/drivers/ide/ide-taskfile.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/ide/ide-taskfile.c 2004-10-06 19:37:46 -07:00 @@ -103,30 +103,6 @@ EXPORT_SYMBOL(taskfile_lib_get_identify); -#ifdef CONFIG_IDE_TASK_IOCTL_DEBUG -void debug_taskfile (ide_drive_t *drive, ide_task_t *args) -{ - printk(KERN_INFO "%s: ", drive->name); -// printk("TF.0=x%02x ", args->tfRegister[IDE_DATA_OFFSET]); - printk("TF.1=x%02x ", args->tfRegister[IDE_FEATURE_OFFSET]); - printk("TF.2=x%02x ", args->tfRegister[IDE_NSECTOR_OFFSET]); - printk("TF.3=x%02x ", args->tfRegister[IDE_SECTOR_OFFSET]); - printk("TF.4=x%02x ", args->tfRegister[IDE_LCYL_OFFSET]); - printk("TF.5=x%02x ", args->tfRegister[IDE_HCYL_OFFSET]); - printk("TF.6=x%02x ", args->tfRegister[IDE_SELECT_OFFSET]); - printk("TF.7=x%02x\n", args->tfRegister[IDE_COMMAND_OFFSET]); - printk(KERN_INFO "%s: ", drive->name); -// printk("HTF.0=x%02x ", args->hobRegister[IDE_DATA_OFFSET]); - printk("HTF.1=x%02x ", args->hobRegister[IDE_FEATURE_OFFSET]); - printk("HTF.2=x%02x ", args->hobRegister[IDE_NSECTOR_OFFSET]); - printk("HTF.3=x%02x ", args->hobRegister[IDE_SECTOR_OFFSET]); - printk("HTF.4=x%02x ", args->hobRegister[IDE_LCYL_OFFSET]); - printk("HTF.5=x%02x ", args->hobRegister[IDE_HCYL_OFFSET]); - printk("HTF.6=x%02x ", args->hobRegister[IDE_SELECT_OFFSET]); - printk("HTF.7=x%02x\n", args->hobRegister[IDE_CONTROL_OFFSET_HOB]); -} -#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ - ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) { ide_hwif_t *hwif = HWIF(drive); @@ -134,10 +110,6 @@ hob_struct_t *hobfile = (hob_struct_t *) task->hobRegister; u8 HIHI = (drive->addressing == 1) ? 0xE0 : 0xEF; -#ifdef CONFIG_IDE_TASK_IOCTL_DEBUG - void debug_taskfile(drive, task); -#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ - /* ALL Command Block Executions SHALL clear nIEN, unless otherwise */ if (IDE_CONTROL_REG) { /* clear nIEN */ @@ -852,11 +824,6 @@ #if DEBUG_TASKFILE u8 status; #endif - - -#ifdef CONFIG_IDE_TASK_IOCTL_DEBUG - void debug_taskfile(drive, task); -#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ if (task->data_phase == TASKFILE_MULTI_IN || task->data_phase == TASKFILE_MULTI_OUT) { diff -Nru a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c --- a/drivers/ide/pci/aec62xx.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/ide/pci/aec62xx.c 2004-10-06 19:37:47 -07:00 @@ -29,8 +29,6 @@ static struct pci_dev *aec_devs[AEC_MAX_DEVS]; static int n_aec_devs; -#undef DEBUG_AEC_REGS - static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count) { char *p = buffer; @@ -44,9 +42,6 @@ struct pci_dev *dev = aec_devs[i]; unsigned long iobase = pci_resource_start(dev, 4); u8 c0 = 0, c1 = 0, art = 0; -#ifdef DEBUG_AEC_REGS - u8 uart = 0; -#endif /* DEBUG_AEC_REGS */ c0 = inb(iobase + 0x02); c1 = inb(iobase + 0x0a); @@ -83,24 +78,6 @@ p += sprintf(p, " %s(%s)\n", (c1&0x40)?((art&0xc0)?"UDMA":" DMA"):" PIO", (art&0x80)?"2":(art&0x40)?"1":"0"); -#ifdef DEBUG_AEC_REGS - (void) pci_read_config_byte(dev, 0x40, &art); - p += sprintf(p, "Active: 0x%02x", art); - (void) pci_read_config_byte(dev, 0x42, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(dev, 0x44, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(dev, 0x46, &art); - p += sprintf(p, " 0x%02x\n", art); - (void) pci_read_config_byte(dev, 0x41, &art); - p += sprintf(p, "Recovery: 0x%02x", art); - (void) pci_read_config_byte(dev, 0x43, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(dev, 0x45, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(dev, 0x47, &art); - p += sprintf(p, " 0x%02x\n", art); -#endif /* DEBUG_AEC_REGS */ } else { /* * case PCI_DEVICE_ID_ARTOP_ATP860: @@ -146,28 +123,6 @@ ((art&0x30)==0x30)?"2": ((art&0x20)==0x20)?"1": ((art&0x10)==0x10)?"0":"?"); -#ifdef DEBUG_AEC_REGS - (void) pci_read_config_byte(dev, 0x40, &art); - p += sprintf(p, "Active: 0x%02x", HIGH_4(art)); - (void) pci_read_config_byte(dev, 0x41, &art); - p += sprintf(p, " 0x%02x", HIGH_4(art)); - (void) pci_read_config_byte(dev, 0x42, &art); - p += sprintf(p, " 0x%02x", HIGH_4(art)); - (void) pci_read_config_byte(dev, 0x43, &art); - p += sprintf(p, " 0x%02x\n", HIGH_4(art)); - (void) pci_read_config_byte(dev, 0x40, &art); - p += sprintf(p, "Recovery: 0x%02x", LOW_4(art)); - (void) pci_read_config_byte(dev, 0x41, &art); - p += sprintf(p, " 0x%02x", LOW_4(art)); - (void) pci_read_config_byte(dev, 0x42, &art); - p += sprintf(p, " 0x%02x", LOW_4(art)); - (void) pci_read_config_byte(dev, 0x43, &art); - p += sprintf(p, " 0x%02x\n", LOW_4(art)); - (void) pci_read_config_byte(dev, 0x49, &uart); - p += sprintf(p, "reg49h = 0x%02x ", uart); - (void) pci_read_config_byte(dev, 0x4a, &uart); - p += sprintf(p, "reg4ah = 0x%02x\n", uart); -#endif /* DEBUG_AEC_REGS */ } } /* p - buffer must be less than 4k! */ @@ -240,6 +195,7 @@ unsigned long flags; local_irq_save(flags); + /* 0x40|(2*drive->dn): Active, 0x41|(2*drive->dn): Recovery */ pci_read_config_word(dev, 0x40|(2*drive->dn), &d_conf); tmp0 = pci_bus_clock_list(speed, BUSCLOCK(dev)); SPLIT_BYTE(tmp0,tmp1,tmp2); @@ -268,6 +224,7 @@ unsigned long flags; local_irq_save(flags); + /* high 4-bits: Active, low 4-bits: Recovery */ pci_read_config_byte(dev, 0x40|drive->dn, &drive_conf); drive_conf = pci_bus_clock_list(speed, BUSCLOCK(dev)); pci_write_config_byte(dev, 0x40|drive->dn, drive_conf); diff -Nru a/drivers/ide/pci/aec62xx.h b/drivers/ide/pci/aec62xx.h --- a/drivers/ide/pci/aec62xx.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/ide/pci/aec62xx.h 2004-10-06 19:37:47 -07:00 @@ -53,13 +53,6 @@ { 0, 0x00, 0x00 } }; - -#ifndef HIGH_4 -#define HIGH_4(H) ((H)=(H>>4)) -#endif -#ifndef LOW_4 -#define LOW_4(L) ((L)=(L-((L>>4)<<4))) -#endif #ifndef SPLIT_BYTE #define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) #endif diff -Nru a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c --- a/drivers/ide/pci/cmd640.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/ide/pci/cmd640.c 2004-10-06 19:37:47 -07:00 @@ -101,6 +101,8 @@ #undef REALLY_SLOW_IO /* most systems can safely undef this */ #define CMD640_PREFETCH_MASKS 1 +//#define CMD640_DUMP_REGS + #include #include #include @@ -748,7 +750,7 @@ put_cmd640_reg(0x5b, 0); #ifdef CMD640_DUMP_REGS - CMD640_DUMP_REGS; + cmd640_dump_regs(); #endif /* @@ -870,7 +872,7 @@ } #ifdef CMD640_DUMP_REGS - CMD640_DUMP_REGS; + cmd640_dump_regs(); #endif return 1; } diff -Nru a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c --- a/drivers/ide/pci/piix.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/ide/pci/piix.c 2004-10-06 19:37:46 -07:00 @@ -561,36 +561,31 @@ drive->init_speed = 0; if ((id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ if (__ide_dma_bad_drive(drive)) goto fast_ata_pio; - if (id->field_valid & 4) { - if (id->dma_ultra & hwif->ultra_mask) { - /* Force if Capable UltraDMA */ - if ((id->field_valid & 2) && - (!piix_config_drive_for_dma(drive))) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & hwif->mwdma_mask) || - (id->dma_1word & hwif->swdma_mask)) { - /* Force if Capable regular DMA modes */ - if (!piix_config_drive_for_dma(drive)) - goto no_dma_set; - } - } else if (__ide_dma_good_drive(drive) && - (id->eide_dma_time < 150)) { - /* Consult the list of known "good" drives */ - if (!piix_config_drive_for_dma(drive)) - goto no_dma_set; - } else { - goto fast_ata_pio; + + /** + * Try to turn DMA on if: + * - UDMA or EIDE modes are supported or + * - drive is a known "good" drive + * + * Checks for best mode supported are down later by + * piix_config_drive_for_dma() -> ide_dma_speed() + */ + if ((id->field_valid & (4 | 2)) || + (__ide_dma_good_drive(drive) && id->eide_dma_time < 150)) { + if (piix_config_drive_for_dma(drive)) + return hwif->ide_dma_on(drive); } - return hwif->ide_dma_on(drive); + + /* For some reason DMA wasn't turned on, so try PIO. */ + goto fast_ata_pio; + } else if ((id->capability & 8) || (id->field_valid & 2)) { fast_ata_pio: -no_dma_set: + /* Find best PIO mode. */ hwif->tuneproc(drive, 255); return hwif->ide_dma_off_quietly(drive); } diff -Nru a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c --- a/drivers/ide/pci/triflex.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/ide/pci/triflex.c 2004-10-06 19:37:47 -07:00 @@ -41,57 +41,6 @@ #include #include -static struct pci_dev *triflex_dev; - -#ifdef CONFIG_PROC_FS -static int triflex_get_info(char *buf, char **addr, off_t offset, int count) -{ - char *p = buf; - int len; - - struct pci_dev *dev = triflex_dev; - unsigned long bibma = pci_resource_start(dev, 4); - u8 c0 = 0, c1 = 0; - u32 pri_timing, sec_timing; - - p += sprintf(p, "\n Compaq Triflex Chipset\n"); - - pci_read_config_dword(dev, 0x70, &pri_timing); - pci_read_config_dword(dev, 0x74, &sec_timing); - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - c0 = inb((unsigned short)bibma + 0x02); - c1 = inb((unsigned short)bibma + 0x0a); - - p += sprintf(p, "--------------- Primary Channel " - "---------------- Secondary Channel " - "-------------\n"); - p += sprintf(p, " %sabled " - " %sabled\n", - (c0&0x80) ? "dis" : " en", - (c1&0x80) ? "dis" : " en"); - p += sprintf(p, "--------------- drive0 --------- drive1 " - "-------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s " - " %s %s\n", - (c0&0x20) ? "yes" : "no ", - (c0&0x40) ? "yes" : "no ", - (c1&0x20) ? "yes" : "no ", - (c1&0x40) ? "yes" : "no " ); - - p += sprintf(p, "DMA\n"); - p += sprintf(p, "PIO\n"); - - len = (p - buf) - offset; - *addr = buf + offset; - - return len > count ? count : len; -} -#endif - static int triflex_tune_chipset(ide_drive_t *drive, u8 xferspeed) { ide_hwif_t *hwif = HWIF(drive); @@ -206,18 +155,8 @@ hwif->drives[1].autodma = hwif->autodma; } -static unsigned int __init init_chipset_triflex(struct pci_dev *dev, - const char *name) -{ -#ifdef CONFIG_PROC_FS - ide_pci_create_host_proc("triflex", triflex_get_info); -#endif - return 0; -} - static ide_pci_device_t triflex_device __devinitdata = { .name = "TRIFLEX", - .init_chipset = init_chipset_triflex, .init_hwif = init_hwif_triflex, .channels = 2, .autodma = AUTODMA, @@ -229,7 +168,6 @@ const struct pci_device_id *id) { ide_setup_pci_device(dev, &triflex_device); - triflex_dev = dev; return 0; } diff -Nru a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c --- a/drivers/isdn/capi/capi.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/isdn/capi/capi.c 2004-10-06 19:37:47 -07:00 @@ -646,7 +646,7 @@ kfree_skb(skb); (void)capiminor_del_ack(mp, datahandle); if (mp->tty) - tty_wakeup(tty); + tty_wakeup(mp->tty); (void)handle_minor_send(mp); } else { diff -Nru a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c --- a/drivers/isdn/i4l/isdn_tty.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/isdn/i4l/isdn_tty.c 2004-10-06 19:37:47 -07:00 @@ -2673,7 +2673,7 @@ if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) { return; } - tty_ldisc_flush(tty); + tty_ldisc_flush(info->tty); if ((info->flags & ISDN_ASYNC_CHECK_CD) && (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) && (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) { diff -Nru a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c --- a/drivers/macintosh/therm_adt746x.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/macintosh/therm_adt746x.c 2004-10-06 19:37:47 -07:00 @@ -28,6 +28,7 @@ #include #include #include +#include #undef DEBUG @@ -70,9 +71,7 @@ static int therm_bus, therm_address; static struct of_device * of_dev; static struct thermostat* thermostat; -static pid_t monitor_thread_id; -static int monitor_running; -static struct completion monitor_task_compl; +static struct task_struct *thread_therm = NULL; static int attach_one_thermostat(struct i2c_adapter *adapter, int addr, int busno); static void write_both_fan_speed(struct thermostat *th, int speed); @@ -136,9 +135,8 @@ th = thermostat; - if (monitor_running) { - monitor_running = 0; - wait_for_completion(&monitor_task_compl); + if (thread_therm != NULL) { + kthread_stop(thread_therm); } printk(KERN_INFO "adt746x: Putting max temperatures back from %d, %d, %d," @@ -237,16 +235,9 @@ #ifdef DEBUG int mfan_speed; #endif - - lock_kernel(); - daemonize("kfand"); - unlock_kernel(); - strcpy(current->comm, "thermostat"); - monitor_running = 1; - - while(monitor_running) + while(!kthread_should_stop()) { - msleep(2000); + msleep_interruptible(2000); /* Check status */ /* local : chip */ @@ -321,7 +312,6 @@ #endif } - complete_and_exit(&monitor_task_compl, 0); return 0; } @@ -387,7 +377,7 @@ thermostat = th; if (i2c_attach_client(&th->clt)) { - printk("adt746x: Thermostat failed to attach client !\n"); + printk(KERN_INFO "adt746x: Thermostat failed to attach client !\n"); thermostat = NULL; kfree(th); return -ENODEV; @@ -403,10 +393,13 @@ write_both_fan_speed(th, -1); } - init_completion(&monitor_task_compl); - - monitor_thread_id = kernel_thread(monitor_task, th, - SIGCHLD | CLONE_KERNEL); + thread_therm = kthread_run(monitor_task, th, "kfand"); + + if (thread_therm == ERR_PTR(-ENOMEM)) { + printk(KERN_INFO "adt746x: Kthread creation failed\n"); + thread_therm = NULL; + return -ENOMEM; + } return 0; } diff -Nru a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2004-10-06 19:37:47 -07:00 @@ -1484,21 +1484,20 @@ static struct file_operations dvb_ca_fops = { - owner: THIS_MODULE, - read: dvb_ca_en50221_io_read, - write: dvb_ca_en50221_io_write, - ioctl: dvb_ca_en50221_io_ioctl, - open: dvb_ca_en50221_io_open, - release: dvb_ca_en50221_io_release, - poll: dvb_ca_en50221_io_poll, + .owner = THIS_MODULE, + .read = dvb_ca_en50221_io_read, + .write = dvb_ca_en50221_io_write, + .ioctl = dvb_ca_en50221_io_ioctl, + .open = dvb_ca_en50221_io_open, + .release = dvb_ca_en50221_io_release, + .poll = dvb_ca_en50221_io_poll, }; static struct dvb_device dvbdev_ca = { - priv: NULL, - users: 1, - readers: 1, - writers: 1, - fops: &dvb_ca_fops, + .users = 1, + .readers = 1, + .writers = 1, + .fops = &dvb_ca_fops, }; diff -Nru a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c --- a/drivers/media/dvb/frontends/stv0299.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/media/dvb/frontends/stv0299.c 2004-10-06 19:37:48 -07:00 @@ -319,7 +319,7 @@ static int pll_write (struct dvb_i2c_bus *i2c, u8 addr, u8 *data, int len) { int ret; - struct i2c_msg msg = { addr: addr, .flags = 0, .buf = data, .len = len }; + struct i2c_msg msg = { .addr = addr, .buf = data, .len = len }; stv0299_writereg(i2c, 0x05, 0xb5); /* enable i2c repeater on stv0299 */ @@ -1257,12 +1257,12 @@ u8 stat [] = { 0 }; u8 tda6100_buf [] = { 0, 0 }; int ret; - struct i2c_msg msg1 [] = {{ .addr = 0x68, .flags = 0, .buf = rpt, len: 2 }, + struct i2c_msg msg1 [] = {{ .addr = 0x68, .buf = rpt, .len = 2 }, { .addr = 0x60, .flags = I2C_M_RD, .buf = stat, .len = 1 }}; - struct i2c_msg msg2 [] = {{ .addr = 0x68, .flags = 0, .buf = rpt, len: 2 }, + struct i2c_msg msg2 [] = {{ .addr = 0x68, .buf = rpt, .len = 2 }, { .addr = 0x61, .flags = I2C_M_RD, .buf = stat, .len = 1 }}; - struct i2c_msg msg3 [] = {{ .addr = 0x68, .flags = 0, .buf = rpt, len: 2 }, - { .addr = 0x60, .flags = 0, .buf = tda6100_buf, .len = 2 }}; + struct i2c_msg msg3 [] = {{ .addr = 0x68, .buf = rpt, .len = 2 }, + { .addr = 0x60, .buf = tda6100_buf, .len = 2 }}; stv0299_writereg (i2c, 0x01, 0x15); stv0299_writereg (i2c, 0x02, 0x30); diff -Nru a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c --- a/drivers/media/video/dpc7146.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/media/video/dpc7146.c 2004-10-06 19:37:47 -07:00 @@ -123,6 +123,7 @@ /* check if all devices are present */ if( 0 == dpc->saa7111a ) { DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); + i2c_del_adapter(&dpc->i2c_adapter); kfree(dpc); return -ENODEV; } diff -Nru a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c --- a/drivers/message/i2o/i2o_config.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/message/i2o/i2o_config.c 2004-10-06 19:37:47 -07:00 @@ -624,15 +624,15 @@ return 0; } -#if BITS_PER_LONG == 64 +#ifdef CONFIG_COMPAT static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg, struct file *file) { struct i2o_cmd_passthru32 __user *cmd; struct i2o_controller *c; - u32 *user_msg; + u32 __user *user_msg; u32 *reply = NULL; - u32 *user_reply = NULL; + u32 __user *user_reply = NULL; u32 size = 0; u32 reply_size = 0; u32 rcode = 0; @@ -752,7 +752,7 @@ flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { // TODO 64bit fix if (copy_from_user - (p->virt, (void *)(u64) sg[i].addr_bus, + (p->virt, (void __user *)(unsigned long)sg[i].addr_bus, sg_size)) { printk(KERN_DEBUG "%s: Could not copy SG buf %d FROM user\n", @@ -1105,7 +1105,7 @@ ret = i2o_cfg_evt_get(arg, fp); break; -#if BITS_PER_LONG != 64 +#ifndef CONFIG_COMPAT case I2OPASSTHRU: ret = i2o_cfg_passthru(arg); break; @@ -1225,7 +1225,7 @@ misc_deregister(&i2o_miscdev); return -EBUSY; } -#if BITS_PER_LONG ==64 +#ifdef CONFIG_COMPAT register_ioctl32_conversion(I2OPASSTHRU32, i2o_cfg_passthru32); register_ioctl32_conversion(I2OGETIOPS, (void *)sys_ioctl); #endif @@ -1234,7 +1234,7 @@ static void i2o_config_exit(void) { -#if BITS_PER_LONG ==64 +#ifdef CONFIG_COMPAT unregister_ioctl32_conversion(I2OPASSTHRU32); unregister_ioctl32_conversion(I2OGETIOPS); #endif diff -Nru a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c --- a/drivers/mtd/chips/jedec_probe.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/mtd/chips/jedec_probe.c 2004-10-06 19:37:48 -07:00 @@ -512,12 +512,12 @@ ERASEINFO(0x10000,8), } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F002T, - name: "AMD AM29F002T", - DevSize: SIZE_256KiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,3), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F002T, + .name = "AMD AM29F002T", + .DevSize = SIZE_256KiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,3), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) @@ -768,12 +768,12 @@ ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_HYUNDAI, - dev_id: HY29F002T, - name: "Hyundai HY29F002T", - DevSize: SIZE_256KiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,3), + .mfr_id = MANUFACTURER_HYUNDAI, + .dev_id = HY29F002T, + .name = "Hyundai HY29F002T", + .DevSize = SIZE_256KiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,3), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) @@ -1162,12 +1162,12 @@ ERASEINFO(0x10000,7), } }, { - mfr_id: MANUFACTURER_MACRONIX, - dev_id: MX29F002T, - name: "Macronix MX29F002T", - DevSize: SIZE_256KiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,3), + .mfr_id = MANUFACTURER_MACRONIX, + .dev_id = MX29F002T, + .name = "Macronix MX29F002T", + .DevSize = SIZE_256KiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,3), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) @@ -1247,7 +1247,7 @@ .DevSize = SIZE_256KiB, .CmdSet = P_ID_SST_PAGE, .NumEraseRegions= 1, - regions: {ERASEINFO(0x01000,64), + .regions = {ERASEINFO(0x01000,64), } }, { .mfr_id = MANUFACTURER_SST, @@ -1259,7 +1259,7 @@ .DevSize = SIZE_256KiB, .CmdSet = P_ID_SST_PAGE, .NumEraseRegions= 1, - regions: {ERASEINFO(0x01000,64), + .regions = {ERASEINFO(0x01000,64), } }, { .mfr_id = MANUFACTURER_SST, diff -Nru a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c --- a/drivers/mtd/maps/ixp4xx.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/mtd/maps/ixp4xx.c 2004-10-06 19:37:46 -07:00 @@ -1,5 +1,5 @@ /* - * $Id: ixp4xx.c,v 1.4 2004/08/31 22:55:51 dsaxena Exp $ + * $Id: ixp4xx.c,v 1.6 2004/09/17 00:25:06 gleixner Exp $ * * drivers/mtd/maps/ixp4xx.c * @@ -69,9 +69,22 @@ dest[len - 1] = BYTE0(src[i]); } +/* + * Unaligned writes are ignored, causing the 8-bit + * probe to fail and proceed to the 16-bit probe (which succeeds). + */ +static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) +{ + if (!(adr & 1)) + *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; +} + +/* + * Fast write16 function without the probing check above + */ static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) { - *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; + *(__u16 *) (map->map_priv_1 + adr) = d.x[0]; } struct ixp4xx_flash_info { @@ -171,7 +184,7 @@ info->map.bankwidth = 2; info->map.name = dev->dev.bus_id; info->map.read = ixp4xx_read16, - info->map.write = ixp4xx_write16, + info->map.write = ixp4xx_probe_write16, info->map.copy_from = ixp4xx_copy_from, info->res = request_mem_region(dev->resource->start, @@ -184,7 +197,7 @@ } info->map.map_priv_1 = - (unsigned long) ioremap(dev->resource->start, + (void __iomem *) ioremap(dev->resource->start, dev->resource->end - dev->resource->start + 1); if (!info->map.map_priv_1) { printk(KERN_ERR "IXP4XXFlash: Failed to ioremap region\n"); @@ -199,6 +212,9 @@ goto Error; } info->mtd->owner = THIS_MODULE; + + /* Use the fast version */ + info->map.write = ixp4xx_write16, err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0); if (err > 0) { diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c --- a/drivers/net/3c59x.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/net/3c59x.c 2004-10-06 19:37:46 -07:00 @@ -1297,6 +1297,13 @@ for (i = 0; i < 6; i++) printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]); } + /* Unfortunately an all zero eeprom passes the checksum and this + gets found in the wild in failure cases. Crypto is hard 8) */ + if (!is_valid_ether_addr(dev->dev_addr)) { + retval = -EINVAL; + printk(KERN_ERR "*** EEPROM MAC address is invalid.\n"); + goto free_ring; /* With every pack */ + } EL3WINDOW(2); for (i = 0; i < 6; i++) outb(dev->dev_addr[i], ioaddr + i); diff -Nru a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c --- a/drivers/net/arcnet/arc-rimi.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/net/arcnet/arc-rimi.c 2004-10-06 19:37:46 -07:00 @@ -231,7 +231,7 @@ static int arcrimi_reset(struct net_device *dev, int really_reset) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *ioaddr = lp->mem_start + 0x800; + void __iomem *ioaddr = lp->mem_start + 0x800; BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); @@ -252,7 +252,7 @@ static void arcrimi_setmask(struct net_device *dev, int mask) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *ioaddr = lp->mem_start + 0x800; + void __iomem *ioaddr = lp->mem_start + 0x800; AINTMASK(mask); } @@ -260,7 +260,7 @@ static int arcrimi_status(struct net_device *dev) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *ioaddr = lp->mem_start + 0x800; + void __iomem *ioaddr = lp->mem_start + 0x800; return ASTATUS(); } @@ -268,7 +268,7 @@ static void arcrimi_command(struct net_device *dev, int cmd) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *ioaddr = lp->mem_start + 0x800; + void __iomem *ioaddr = lp->mem_start + 0x800; ACOMMAND(cmd); } @@ -277,7 +277,7 @@ void *buf, int count) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; + void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); } @@ -286,7 +286,7 @@ void *buf, int count) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; + void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); } diff -Nru a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c --- a/drivers/net/arcnet/com90xx.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/arcnet/com90xx.c 2004-10-06 19:37:47 -07:00 @@ -566,7 +566,7 @@ void *buf, int count) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *memaddr = lp->mem_start + bufnum * 512 + offset; + void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); } @@ -575,7 +575,7 @@ void *buf, int count) { struct arcnet_local *lp = (struct arcnet_local *) dev->priv; - void *memaddr = lp->mem_start + bufnum * 512 + offset; + void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); } diff -Nru a/drivers/net/defxx.c b/drivers/net/defxx.c --- a/drivers/net/defxx.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/net/defxx.c 2004-10-06 19:37:46 -07:00 @@ -1814,16 +1814,18 @@ /* Fill the bp->stats structure with driver-maintained counters */ - bp->stats.rx_packets = bp->rcv_total_frames; - bp->stats.tx_packets = bp->xmt_total_frames; - bp->stats.rx_bytes = bp->rcv_total_bytes; - bp->stats.tx_bytes = bp->xmt_total_bytes; - bp->stats.rx_errors = (u32)(bp->rcv_crc_errors + bp->rcv_frame_status_errors + bp->rcv_length_errors); - bp->stats.tx_errors = bp->xmt_length_errors; - bp->stats.rx_dropped = bp->rcv_discards; - bp->stats.tx_dropped = bp->xmt_discards; - bp->stats.multicast = bp->rcv_multicast_frames; - bp->stats.transmit_collision = 0; /* always zero (0) for FDDI */ + bp->stats.gen.rx_packets = bp->rcv_total_frames; + bp->stats.gen.tx_packets = bp->xmt_total_frames; + bp->stats.gen.rx_bytes = bp->rcv_total_bytes; + bp->stats.gen.tx_bytes = bp->xmt_total_bytes; + bp->stats.gen.rx_errors = bp->rcv_crc_errors + + bp->rcv_frame_status_errors + + bp->rcv_length_errors; + bp->stats.gen.tx_errors = bp->xmt_length_errors; + bp->stats.gen.rx_dropped = bp->rcv_discards; + bp->stats.gen.tx_dropped = bp->xmt_discards; + bp->stats.gen.multicast = bp->rcv_multicast_frames; + bp->stats.gen.collisions = 0; /* always zero (0) for FDDI */ /* Get FDDI SMT MIB objects */ diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c --- a/drivers/net/natsemi.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/net/natsemi.c 2004-10-06 19:37:46 -07:00 @@ -719,7 +719,7 @@ }; static void move_int_phy(struct net_device *dev, int addr); -static int eeprom_read(long ioaddr, int location); +static int eeprom_read(void __iomem *ioaddr, int location); static int mdio_read(struct net_device *dev, int reg); static void mdio_write(struct net_device *dev, int reg, u16 data); static void init_phy_fixup(struct net_device *dev); @@ -769,9 +769,15 @@ static int netdev_get_regs(struct net_device *dev, u8 *buf); static int netdev_get_eeprom(struct net_device *dev, u8 *buf); +static inline void __iomem *ns_ioaddr(struct net_device *dev) +{ + return (void __iomem *) dev->base_addr; +} + static void move_int_phy(struct net_device *dev, int addr) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); int target = 31; /* @@ -788,8 +794,8 @@ target--; if (target == np->phy_addr_external) target--; - writew(target, dev->base_addr + PhyCtrl); - readw(dev->base_addr + PhyCtrl); + writew(target, ioaddr + PhyCtrl); + readw(ioaddr + PhyCtrl); udelay(1); } @@ -800,7 +806,8 @@ struct netdev_private *np; int i, option, irq, chip_idx = ent->driver_data; static int find_cnt = -1; - unsigned long ioaddr, iosize; + unsigned long iostart, iosize; + void __iomem *ioaddr; const int pcibar = 1; /* PCI base address register */ int prev_eedata; u32 tmp; @@ -827,7 +834,7 @@ } find_cnt++; - ioaddr = pci_resource_start(pdev, pcibar); + iostart = pci_resource_start(pdev, pcibar); iosize = pci_resource_len(pdev, pcibar); irq = pdev->irq; @@ -844,7 +851,7 @@ if (i) goto err_pci_request_regions; - ioaddr = (unsigned long) ioremap (ioaddr, iosize); + ioaddr = ioremap(iostart, iosize); if (!ioaddr) { i = -ENOMEM; goto err_ioremap; @@ -859,7 +866,7 @@ prev_eedata = eedata; } - dev->base_addr = ioaddr; + dev->base_addr = (unsigned long __force) ioaddr; dev->irq = irq; np = netdev_priv(dev); @@ -879,7 +886,7 @@ * The address would be used to access a phy over the mii bus, but * the internal phy is accessed through mapped registers. */ - if (readl(dev->base_addr + ChipConfig) & CfgExtPhy) + if (readl(ioaddr + ChipConfig) & CfgExtPhy) dev->if_port = PORT_MII; else dev->if_port = PORT_TP; @@ -971,7 +978,7 @@ if (netif_msg_drv(np)) { printk(KERN_INFO "natsemi %s: %s at %#08lx (%s), ", - dev->name, natsemi_pci_info[chip_idx].name, ioaddr, + dev->name, natsemi_pci_info[chip_idx].name, iostart, pci_name(np->pci_dev)); for (i = 0; i < ETH_ALEN-1; i++) printk("%02x:", dev->dev_addr[i]); @@ -984,7 +991,7 @@ return 0; err_register_netdev: - iounmap ((void *) dev->base_addr); + iounmap(ioaddr); err_ioremap: pci_release_regions(pdev); @@ -1016,12 +1023,13 @@ EE_WriteCmd=(5 << 6), EE_ReadCmd=(6 << 6), EE_EraseCmd=(7 << 6), }; -static int eeprom_read(long addr, int location) +static int eeprom_read(void __iomem *addr, int location) { int i; int retval = 0; - long ee_addr = addr + EECtrl; + void __iomem *ee_addr = addr + EECtrl; int read_cmd = location | EE_ReadCmd; + writel(EE_Write0, ee_addr); /* Shift the read command bits out. */ @@ -1058,33 +1066,35 @@ /* clock transitions >= 20ns (25MHz) * One readl should be good to PCI @ 100MHz */ -#define mii_delay(dev) readl(dev->base_addr + EECtrl) +#define mii_delay(ioaddr) readl(ioaddr + EECtrl) static int mii_getbit (struct net_device *dev) { int data; + void __iomem *ioaddr = ns_ioaddr(dev); - writel(MII_ShiftClk, dev->base_addr + EECtrl); - data = readl(dev->base_addr + EECtrl); - writel(0, dev->base_addr + EECtrl); - mii_delay(dev); + writel(MII_ShiftClk, ioaddr + EECtrl); + data = readl(ioaddr + EECtrl); + writel(0, ioaddr + EECtrl); + mii_delay(ioaddr); return (data & MII_Data)? 1 : 0; } static void mii_send_bits (struct net_device *dev, u32 data, int len) { u32 i; + void __iomem *ioaddr = ns_ioaddr(dev); for (i = (1 << (len-1)); i; i >>= 1) { u32 mdio_val = MII_Write | ((data & i)? MII_Data : 0); - writel(mdio_val, dev->base_addr + EECtrl); - mii_delay(dev); - writel(mdio_val | MII_ShiftClk, dev->base_addr + EECtrl); - mii_delay(dev); + writel(mdio_val, ioaddr + EECtrl); + mii_delay(ioaddr); + writel(mdio_val | MII_ShiftClk, ioaddr + EECtrl); + mii_delay(ioaddr); } - writel(0, dev->base_addr + EECtrl); - mii_delay(dev); + writel(0, ioaddr + EECtrl); + mii_delay(ioaddr); } static int miiport_read(struct net_device *dev, int phy_id, int reg) @@ -1129,13 +1139,14 @@ static int mdio_read(struct net_device *dev, int reg) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); /* The 83815 series has two ports: * - an internal transceiver * - an external mii bus */ if (dev->if_port == PORT_TP) - return readw(dev->base_addr+BasicControl+(reg<<2)); + return readw(ioaddr+BasicControl+(reg<<2)); else return miiport_read(dev, np->phy_addr_external, reg); } @@ -1143,10 +1154,11 @@ static void mdio_write(struct net_device *dev, int reg, u16 data) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); /* The 83815 series has an internal transceiver; handle separately */ if (dev->if_port == PORT_TP) - writew(data, dev->base_addr+BasicControl+(reg<<2)); + writew(data, ioaddr+BasicControl+(reg<<2)); else miiport_write(dev, np->phy_addr_external, reg, data); } @@ -1154,7 +1166,7 @@ static void init_phy_fixup(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = ns_ioaddr(dev); int i; u32 cfg; u16 tmp; @@ -1186,7 +1198,7 @@ */ } mdio_write(dev, MII_BMCR, tmp); - readl(dev->base_addr + ChipConfig); + readl(ioaddr + ChipConfig); udelay(1); /* find out what phy this is */ @@ -1208,7 +1220,7 @@ default: break; } - cfg = readl(dev->base_addr + ChipConfig); + cfg = readl(ioaddr + ChipConfig); if (cfg & CfgExtPhy) return; @@ -1266,9 +1278,10 @@ static int switch_port_external(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); u32 cfg; - cfg = readl(dev->base_addr + ChipConfig); + cfg = readl(ioaddr + ChipConfig); if (cfg & CfgExtPhy) return 0; @@ -1278,8 +1291,8 @@ } /* 1) switch back to external phy */ - writel(cfg | (CfgExtPhy | CfgPhyDis), dev->base_addr + ChipConfig); - readl(dev->base_addr + ChipConfig); + writel(cfg | (CfgExtPhy | CfgPhyDis), ioaddr + ChipConfig); + readl(ioaddr + ChipConfig); udelay(1); /* 2) reset the external phy: */ @@ -1298,11 +1311,12 @@ static int switch_port_internal(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); int i; u32 cfg; u16 bmcr; - cfg = readl(dev->base_addr + ChipConfig); + cfg = readl(ioaddr + ChipConfig); if (!(cfg &CfgExtPhy)) return 0; @@ -1312,17 +1326,17 @@ } /* 1) switch back to internal phy: */ cfg = cfg & ~(CfgExtPhy | CfgPhyDis); - writel(cfg, dev->base_addr + ChipConfig); - readl(dev->base_addr + ChipConfig); + writel(cfg, ioaddr + ChipConfig); + readl(ioaddr + ChipConfig); udelay(1); /* 2) reset the internal phy: */ - bmcr = readw(dev->base_addr+BasicControl+(MII_BMCR<<2)); - writel(bmcr | BMCR_RESET, dev->base_addr+BasicControl+(MII_BMCR<<2)); - readl(dev->base_addr + ChipConfig); + bmcr = readw(ioaddr+BasicControl+(MII_BMCR<<2)); + writel(bmcr | BMCR_RESET, ioaddr+BasicControl+(MII_BMCR<<2)); + readl(ioaddr + ChipConfig); udelay(10); for (i=0;ibase_addr+BasicControl+(MII_BMCR<<2)); + bmcr = readw(ioaddr+BasicControl+(MII_BMCR<<2)); if (!(bmcr & BMCR_RESET)) break; udelay(10); @@ -1398,6 +1412,7 @@ u16 pmatch[3]; u16 sopass[3]; struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); /* * Resetting the chip causes some registers to be lost. @@ -1408,26 +1423,26 @@ */ /* CFG */ - cfg = readl(dev->base_addr + ChipConfig) & CFG_RESET_SAVE; + cfg = readl(ioaddr + ChipConfig) & CFG_RESET_SAVE; /* WCSR */ - wcsr = readl(dev->base_addr + WOLCmd) & WCSR_RESET_SAVE; + wcsr = readl(ioaddr + WOLCmd) & WCSR_RESET_SAVE; /* RFCR */ - rfcr = readl(dev->base_addr + RxFilterAddr) & RFCR_RESET_SAVE; + rfcr = readl(ioaddr + RxFilterAddr) & RFCR_RESET_SAVE; /* PMATCH */ for (i = 0; i < 3; i++) { - writel(i*2, dev->base_addr + RxFilterAddr); - pmatch[i] = readw(dev->base_addr + RxFilterData); + writel(i*2, ioaddr + RxFilterAddr); + pmatch[i] = readw(ioaddr + RxFilterData); } /* SOPAS */ for (i = 0; i < 3; i++) { - writel(0xa+(i*2), dev->base_addr + RxFilterAddr); - sopass[i] = readw(dev->base_addr + RxFilterData); + writel(0xa+(i*2), ioaddr + RxFilterAddr); + sopass[i] = readw(ioaddr + RxFilterData); } /* now whack the chip */ - writel(ChipReset, dev->base_addr + ChipCmd); + writel(ChipReset, ioaddr + ChipCmd); for (i=0;ibase_addr + ChipCmd) & ChipReset)) + if (!(readl(ioaddr + ChipCmd) & ChipReset)) break; udelay(5); } @@ -1440,40 +1455,41 @@ } /* restore CFG */ - cfg |= readl(dev->base_addr + ChipConfig) & ~CFG_RESET_SAVE; + cfg |= readl(ioaddr + ChipConfig) & ~CFG_RESET_SAVE; /* turn on external phy if it was selected */ if (dev->if_port == PORT_TP) cfg &= ~(CfgExtPhy | CfgPhyDis); else cfg |= (CfgExtPhy | CfgPhyDis); - writel(cfg, dev->base_addr + ChipConfig); + writel(cfg, ioaddr + ChipConfig); /* restore WCSR */ - wcsr |= readl(dev->base_addr + WOLCmd) & ~WCSR_RESET_SAVE; - writel(wcsr, dev->base_addr + WOLCmd); + wcsr |= readl(ioaddr + WOLCmd) & ~WCSR_RESET_SAVE; + writel(wcsr, ioaddr + WOLCmd); /* read RFCR */ - rfcr |= readl(dev->base_addr + RxFilterAddr) & ~RFCR_RESET_SAVE; + rfcr |= readl(ioaddr + RxFilterAddr) & ~RFCR_RESET_SAVE; /* restore PMATCH */ for (i = 0; i < 3; i++) { - writel(i*2, dev->base_addr + RxFilterAddr); - writew(pmatch[i], dev->base_addr + RxFilterData); + writel(i*2, ioaddr + RxFilterAddr); + writew(pmatch[i], ioaddr + RxFilterData); } for (i = 0; i < 3; i++) { - writel(0xa+(i*2), dev->base_addr + RxFilterAddr); - writew(sopass[i], dev->base_addr + RxFilterData); + writel(0xa+(i*2), ioaddr + RxFilterAddr); + writew(sopass[i], ioaddr + RxFilterData); } /* restore RFCR */ - writel(rfcr, dev->base_addr + RxFilterAddr); + writel(rfcr, ioaddr + RxFilterAddr); } static void natsemi_reload_eeprom(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); int i; - writel(EepromReload, dev->base_addr + PCIBusCfg); + writel(EepromReload, ioaddr + PCIBusCfg); for (i=0;ibase_addr + PCIBusCfg) & EepromReload)) + if (!(readl(ioaddr + PCIBusCfg) & EepromReload)) break; } if (i==NATSEMI_HW_TIMEOUT) { @@ -1487,7 +1503,7 @@ static void natsemi_stop_rxtx(struct net_device *dev) { - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); int i; @@ -1509,7 +1525,7 @@ static int netdev_open(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); int i; /* Reset the chip, just in case. */ @@ -1558,6 +1574,7 @@ static void do_cable_magic(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = ns_ioaddr(dev); if (dev->if_port != PORT_TP) return; @@ -1571,15 +1588,15 @@ * activity LED while idle. This process is based on instructions * from engineers at National. */ - if (readl(dev->base_addr + ChipConfig) & CfgSpeed100) { + if (readl(ioaddr + ChipConfig) & CfgSpeed100) { u16 data; - writew(1, dev->base_addr + PGSEL); + writew(1, ioaddr + PGSEL); /* * coefficient visibility should already be enabled via * DSPCFG | 0x1000 */ - data = readw(dev->base_addr + TSTDAT) & 0xff; + data = readw(ioaddr + TSTDAT) & 0xff; /* * the value must be negative, and within certain values * (these values all come from National) @@ -1588,13 +1605,13 @@ struct netdev_private *np = netdev_priv(dev); /* the bug has been triggered - fix the coefficient */ - writew(TSTDAT_FIXED, dev->base_addr + TSTDAT); + writew(TSTDAT_FIXED, ioaddr + TSTDAT); /* lock the value */ - data = readw(dev->base_addr + DSPCFG); + data = readw(ioaddr + DSPCFG); np->dspcfg = data | DSPCFG_LOCK; - writew(np->dspcfg, dev->base_addr + DSPCFG); + writew(np->dspcfg, ioaddr + DSPCFG); } - writew(0, dev->base_addr + PGSEL); + writew(0, ioaddr + PGSEL); } } @@ -1602,6 +1619,7 @@ { u16 data; struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = ns_ioaddr(dev); if (dev->if_port != PORT_TP) return; @@ -1609,18 +1627,18 @@ if (np->srr >= SRR_DP83816_A5) return; - writew(1, dev->base_addr + PGSEL); + writew(1, ioaddr + PGSEL); /* make sure the lock bit is clear */ - data = readw(dev->base_addr + DSPCFG); + data = readw(ioaddr + DSPCFG); np->dspcfg = data & ~DSPCFG_LOCK; - writew(np->dspcfg, dev->base_addr + DSPCFG); - writew(0, dev->base_addr + PGSEL); + writew(np->dspcfg, ioaddr + DSPCFG); + writew(0, ioaddr + PGSEL); } static void check_link(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); int duplex; u16 bmsr; @@ -1681,7 +1699,7 @@ static void init_registers(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); init_phy_fixup(dev); @@ -1760,6 +1778,7 @@ { struct net_device *dev = (struct net_device *)data; struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = ns_ioaddr(dev); int next_tick = 5*HZ; if (netif_msg_timer(np)) { @@ -1771,7 +1790,6 @@ } if (dev->if_port == PORT_TP) { - long ioaddr = dev->base_addr; u16 dspcfg; spin_lock_irq(&np->lock); @@ -1814,7 +1832,7 @@ refill_rx(dev); enable_irq(dev->irq); if (!np->oom) { - writel(RxOn, dev->base_addr + ChipCmd); + writel(RxOn, ioaddr + ChipCmd); } else { next_tick = 1; } @@ -1848,7 +1866,7 @@ static void tx_timeout(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); disable_irq(dev->irq); spin_lock_irq(&np->lock); @@ -2048,6 +2066,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = ns_ioaddr(dev); unsigned entry; /* Note: Ordering is important here, set the field with the @@ -2076,7 +2095,7 @@ netif_stop_queue(dev); } /* Wake the potentially-idle transmit channel. */ - writel(TxOn, dev->base_addr + ChipCmd); + writel(TxOn, ioaddr + ChipCmd); } else { dev_kfree_skb_irq(skb); np->stats.tx_dropped++; @@ -2141,7 +2160,7 @@ { struct net_device *dev = dev_instance; struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); int boguscnt = max_interrupt_work; unsigned int handled = 0; @@ -2203,6 +2222,7 @@ int boguscnt = np->dirty_rx + RX_RING_SIZE - np->cur_rx; s32 desc_status = le32_to_cpu(np->rx_head_desc->cmd_status); unsigned int buflen = np->rx_buf_sz; + void __iomem * ioaddr = ns_ioaddr(dev); /* If the driver owns the next entry it's a new packet. Send it up. */ while (desc_status < 0) { /* e.g. & DescOwn */ @@ -2284,13 +2304,13 @@ if (np->oom) mod_timer(&np->timer, jiffies + 1); else - writel(RxOn, dev->base_addr + ChipCmd); + writel(RxOn, ioaddr + ChipCmd); } static void netdev_error(struct net_device *dev, int intr_status) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); spin_lock(&np->lock); if (intr_status & LinkChange) { @@ -2349,7 +2369,7 @@ static void __get_stats(struct net_device *dev) { - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); /* The chip only need report frame silently dropped. */ @@ -2382,7 +2402,7 @@ #define HASH_TABLE 0x200 static void __set_rx_mode(struct net_device *dev) { - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); u8 mc_filter[64]; /* Multicast hash filter */ u32 rx_mode; @@ -2428,7 +2448,7 @@ /* synchronized against open : rtnl_lock() held by caller */ if (netif_running(dev)) { struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); disable_irq(dev->irq); spin_lock(&np->lock); @@ -2631,7 +2651,8 @@ static int netdev_set_wol(struct net_device *dev, u32 newval) { struct netdev_private *np = netdev_priv(dev); - u32 data = readl(dev->base_addr + WOLCmd) & ~WakeOptsSummary; + void __iomem * ioaddr = ns_ioaddr(dev); + u32 data = readl(ioaddr + WOLCmd) & ~WakeOptsSummary; /* translate to bitmasks this chip understands */ if (newval & WAKE_PHY) @@ -2652,7 +2673,7 @@ } } - writel(data, dev->base_addr + WOLCmd); + writel(data, ioaddr + WOLCmd); return 0; } @@ -2660,7 +2681,8 @@ static int netdev_get_wol(struct net_device *dev, u32 *supported, u32 *cur) { struct netdev_private *np = netdev_priv(dev); - u32 regval = readl(dev->base_addr + WOLCmd); + void __iomem * ioaddr = ns_ioaddr(dev); + u32 regval = readl(ioaddr + WOLCmd); *supported = (WAKE_PHY | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | WAKE_ARP | WAKE_MAGIC); @@ -2695,6 +2717,7 @@ static int netdev_set_sopass(struct net_device *dev, u8 *newval) { struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = ns_ioaddr(dev); u16 *sval = (u16 *)newval; u32 addr; @@ -2703,22 +2726,22 @@ } /* enable writing to these registers by disabling the RX filter */ - addr = readl(dev->base_addr + RxFilterAddr) & ~RFCRAddressMask; + addr = readl(ioaddr + RxFilterAddr) & ~RFCRAddressMask; addr &= ~RxFilterEnable; - writel(addr, dev->base_addr + RxFilterAddr); + writel(addr, ioaddr + RxFilterAddr); /* write the three words to (undocumented) RFCR vals 0xa, 0xc, 0xe */ - writel(addr | 0xa, dev->base_addr + RxFilterAddr); - writew(sval[0], dev->base_addr + RxFilterData); + writel(addr | 0xa, ioaddr + RxFilterAddr); + writew(sval[0], ioaddr + RxFilterData); - writel(addr | 0xc, dev->base_addr + RxFilterAddr); - writew(sval[1], dev->base_addr + RxFilterData); + writel(addr | 0xc, ioaddr + RxFilterAddr); + writew(sval[1], ioaddr + RxFilterData); - writel(addr | 0xe, dev->base_addr + RxFilterAddr); - writew(sval[2], dev->base_addr + RxFilterData); + writel(addr | 0xe, ioaddr + RxFilterAddr); + writew(sval[2], ioaddr + RxFilterData); /* re-enable the RX filter */ - writel(addr | RxFilterEnable, dev->base_addr + RxFilterAddr); + writel(addr | RxFilterEnable, ioaddr + RxFilterAddr); return 0; } @@ -2726,6 +2749,7 @@ static int netdev_get_sopass(struct net_device *dev, u8 *data) { struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = ns_ioaddr(dev); u16 *sval = (u16 *)data; u32 addr; @@ -2735,18 +2759,18 @@ } /* read the three words from (undocumented) RFCR vals 0xa, 0xc, 0xe */ - addr = readl(dev->base_addr + RxFilterAddr) & ~RFCRAddressMask; + addr = readl(ioaddr + RxFilterAddr) & ~RFCRAddressMask; - writel(addr | 0xa, dev->base_addr + RxFilterAddr); - sval[0] = readw(dev->base_addr + RxFilterData); + writel(addr | 0xa, ioaddr + RxFilterAddr); + sval[0] = readw(ioaddr + RxFilterData); - writel(addr | 0xc, dev->base_addr + RxFilterAddr); - sval[1] = readw(dev->base_addr + RxFilterData); + writel(addr | 0xc, ioaddr + RxFilterAddr); + sval[1] = readw(ioaddr + RxFilterData); - writel(addr | 0xe, dev->base_addr + RxFilterAddr); - sval[2] = readw(dev->base_addr + RxFilterData); + writel(addr | 0xe, ioaddr + RxFilterAddr); + sval[2] = readw(ioaddr + RxFilterData); - writel(addr, dev->base_addr + RxFilterAddr); + writel(addr, ioaddr + RxFilterAddr); return 0; } @@ -2909,10 +2933,11 @@ int j; u32 rfcr; u32 *rbuf = (u32 *)buf; + void __iomem * ioaddr = ns_ioaddr(dev); /* read non-mii page 0 of registers */ for (i = 0; i < NATSEMI_PG0_NREGS/2; i++) { - rbuf[i] = readl(dev->base_addr + i*4); + rbuf[i] = readl(ioaddr + i*4); } /* read current mii registers */ @@ -2920,20 +2945,20 @@ rbuf[i] = mdio_read(dev, i & 0x1f); /* read only the 'magic' registers from page 1 */ - writew(1, dev->base_addr + PGSEL); - rbuf[i++] = readw(dev->base_addr + PMDCSR); - rbuf[i++] = readw(dev->base_addr + TSTDAT); - rbuf[i++] = readw(dev->base_addr + DSPCFG); - rbuf[i++] = readw(dev->base_addr + SDCFG); - writew(0, dev->base_addr + PGSEL); + writew(1, ioaddr + PGSEL); + rbuf[i++] = readw(ioaddr + PMDCSR); + rbuf[i++] = readw(ioaddr + TSTDAT); + rbuf[i++] = readw(ioaddr + DSPCFG); + rbuf[i++] = readw(ioaddr + SDCFG); + writew(0, ioaddr + PGSEL); /* read RFCR indexed registers */ - rfcr = readl(dev->base_addr + RxFilterAddr); + rfcr = readl(ioaddr + RxFilterAddr); for (j = 0; j < NATSEMI_RFDR_NREGS; j++) { - writel(j*2, dev->base_addr + RxFilterAddr); - rbuf[i++] = readw(dev->base_addr + RxFilterData); + writel(j*2, ioaddr + RxFilterAddr); + rbuf[i++] = readw(ioaddr + RxFilterData); } - writel(rfcr, dev->base_addr + RxFilterAddr); + writel(rfcr, ioaddr + RxFilterAddr); /* the interrupt status is clear-on-read - see if we missed any */ if (rbuf[4] & rbuf[5]) { @@ -2958,10 +2983,11 @@ { int i; u16 *ebuf = (u16 *)buf; + void __iomem * ioaddr = ns_ioaddr(dev); /* eeprom_read reads 16 bits, and indexes by 16 bits */ for (i = 0; i < NATSEMI_EEPROM_SIZE/2; i++) { - ebuf[i] = eeprom_read(dev->base_addr, i); + ebuf[i] = eeprom_read(ioaddr, i); /* The EEPROM itself stores data bit-swapped, but eeprom_read * reads it back "sanely". So we swap it back here in order to * present it to userland as it is stored. */ @@ -3031,7 +3057,7 @@ static void enable_wol_mode(struct net_device *dev, int enable_intr) { - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); if (netif_msg_wol(np)) @@ -3064,7 +3090,7 @@ static int netdev_close(struct net_device *dev) { - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); if (netif_msg_ifdown(np)) @@ -3141,10 +3167,11 @@ static void __devexit natsemi_remove1 (struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); + void __iomem * ioaddr = ns_ioaddr(dev); unregister_netdev (dev); pci_release_regions (pdev); - iounmap ((char *) dev->base_addr); + iounmap(ioaddr); free_netdev (dev); pci_set_drvdata(pdev, NULL); } @@ -3178,7 +3205,7 @@ { struct net_device *dev = pci_get_drvdata (pdev); struct netdev_private *np = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem * ioaddr = ns_ioaddr(dev); rtnl_lock(); if (netif_running (dev)) { diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c --- a/drivers/net/s2io.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/s2io.c 2004-10-06 19:37:47 -07:00 @@ -235,10 +235,10 @@ MODULE_DEVICE_TABLE(pci, s2io_tbl); static struct pci_driver s2io_driver = { - name:"S2IO", - id_table:s2io_tbl, - probe:s2io_init_nic, - remove:__devexit_p(s2io_rem_nic), + .name = "S2IO", + .id_table = s2io_tbl, + .probe = s2io_init_nic, + .remove = __devexit_p(s2io_rem_nic), }; /* diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c --- a/drivers/net/skfp/skfddi.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/net/skfp/skfddi.c 2004-10-06 19:37:46 -07:00 @@ -1095,7 +1095,7 @@ */ if (!(skb->len >= FDDI_K_LLC_ZLEN && skb->len <= FDDI_K_LLC_LEN)) { - bp->MacStat.tx_errors++; /* bump error counter */ + bp->MacStat.gen.tx_errors++; /* bump error counter */ // dequeue packets from xmt queue and send them netif_start_queue(dev); dev_kfree_skb(skb); @@ -1546,8 +1546,8 @@ skb->len, PCI_DMA_TODEVICE); txd->txd_os.dma_addr = 0; - smc->os.MacStat.tx_packets++; // Count transmitted packets. - smc->os.MacStat.tx_bytes+=skb->len; // Count bytes + smc->os.MacStat.gen.tx_packets++; // Count transmitted packets. + smc->os.MacStat.gen.tx_bytes+=skb->len; // Count bytes // free the skb dev_kfree_skb_irq(skb); @@ -1629,7 +1629,7 @@ skb = rxd->rxd_os.skb; if (!skb) { PRINTK(KERN_INFO "No skb in rxd\n"); - smc->os.MacStat.rx_errors++; + smc->os.MacStat.gen.rx_errors++; goto RequeueRxd; } virt = skb->data; @@ -1682,13 +1682,14 @@ } // Count statistics. - smc->os.MacStat.rx_packets++; // Count indicated receive packets. - smc->os.MacStat.rx_bytes+=len; // Count bytes + smc->os.MacStat.gen.rx_packets++; // Count indicated receive + // packets. + smc->os.MacStat.gen.rx_bytes+=len; // Count bytes. // virt points to header again if (virt[1] & 0x01) { // Check group (multicast) bit. - smc->os.MacStat.multicast++; + smc->os.MacStat.gen.multicast++; } // deliver frame to system @@ -1706,7 +1707,8 @@ RequeueRxd: PRINTK(KERN_INFO "Rx: re-queue RXD.\n"); mac_drv_requeue_rxd(smc, rxd, frag_count); - smc->os.MacStat.rx_errors++; // Count receive packets not indicated. + smc->os.MacStat.gen.rx_errors++; // Count receive packets + // not indicated. } // mac_drv_rx_complete @@ -2081,7 +2083,7 @@ break; case 1: PRINTK(KERN_INFO "Receive fifo overflow.\n"); - smc->os.MacStat.rx_errors++; + smc->os.MacStat.gen.rx_errors++; break; default: PRINTK(KERN_INFO "Unknown status (%d).\n", stat); diff -Nru a/drivers/net/sungem.c b/drivers/net/sungem.c --- a/drivers/net/sungem.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/sungem.c 2004-10-06 19:37:47 -07:00 @@ -2742,23 +2742,6 @@ } #endif /* not Sparc and not PPC */ -#ifdef CONFIG_NET_POLL_CONTROLLER -/* - * Polling 'interrupt' - used by things like netconsole to send skbs - * without having to re-enable interrupts. It's not called while - * the interrupt routine is executing. - */ -static void gem_netpoll(struct net_device *netdev) -{ - struct gem *gp = netdev->priv; - if (!gp->pdev) - return; - disable_irq(gp->pdev->irq); - gem_interrupt(gp->pdev->irq, netdev, NULL); - enable_irq(gp->pdev->irq); -} -#endif - static int __devinit gem_get_device_address(struct gem *gp) { #if defined(__sparc__) || defined(CONFIG_PPC_PMAC) @@ -2957,9 +2940,6 @@ dev->set_multicast_list = gem_set_multicast; dev->do_ioctl = gem_ioctl; dev->poll = gem_poll; -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = gem_netpoll; -#endif dev->weight = 64; dev->ethtool_ops = &gem_ethtool_ops; dev->tx_timeout = gem_tx_timeout; @@ -2968,7 +2948,7 @@ dev->irq = pdev->irq; dev->dma = 0; #ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = gem_poll_controller; + dev->poll_controller = gem_poll_controller; #endif if (register_netdev(dev)) { diff -Nru a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig --- a/drivers/net/tokenring/Kconfig 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/tokenring/Kconfig 2004-10-06 19:37:47 -07:00 @@ -84,7 +84,8 @@ config TMS380TR tristate "Generic TMS380 Token Ring ISA/PCI adapter support" - depends on TR && (PCI || ISA) + depends on TR && (PCI || ISA) && HOTPLUG + select FW_LOADER ---help--- This driver provides generic support for token ring adapters based on the Texas Instruments TMS380 series chipsets. This diff -Nru a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c --- a/drivers/net/tokenring/olympic.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/tokenring/olympic.c 2004-10-06 19:37:47 -07:00 @@ -221,6 +221,8 @@ olympic_priv = dev->priv ; + spin_lock_init(&olympic_priv->olympic_lock) ; + init_waitqueue_head(&olympic_priv->srb_wait); init_waitqueue_head(&olympic_priv->trb_wait); #if OLYMPIC_DEBUG @@ -311,7 +313,6 @@ } } - spin_lock_init(&olympic_priv->olympic_lock) ; /* Needed for cardbus */ if(!(readl(olympic_mmio+BCTL) & BCTL_MODE_INDICATOR)) { @@ -442,6 +443,8 @@ DECLARE_WAITQUEUE(wait,current) ; + olympic_init(dev); + if(request_irq(dev->irq, &olympic_interrupt, SA_SHIRQ , "olympic", dev)) { return -EAGAIN; } @@ -898,7 +901,10 @@ int i; for(i=0;irx_ring_skb[olympic_priv->rx_status_last_received]); + if (olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received] != NULL) { + dev_kfree_skb_irq(olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received]); + olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received] = NULL; + } if (olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer != 0xdeadbeef) { pci_unmap_single(olympic_priv->pdev, le32_to_cpu(olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer), @@ -944,9 +950,6 @@ /* Hotswap gives us this on removal */ if (sisr == 0xffffffff) { printk(KERN_WARNING "%s: Hotswap adapter removal.\n",dev->name) ; - olympic_freemem(dev) ; - free_irq(dev->irq, dev) ; - dev->stop = NULL ; spin_unlock(&olympic_priv->olympic_lock) ; return IRQ_NONE; } @@ -961,9 +964,7 @@ printk(KERN_ERR "The adapter must be reset to clear this condition.\n") ; printk(KERN_ERR "Please report this error to the driver maintainer and/\n") ; printk(KERN_ERR "or the linux-tr mailing list.\n") ; - olympic_freemem(dev) ; - free_irq(dev->irq, dev) ; - dev->stop = NULL ; + wake_up_interruptible(&olympic_priv->srb_wait); spin_unlock(&olympic_priv->olympic_lock) ; return IRQ_HANDLED; } /* SISR_ERR */ @@ -1006,9 +1007,6 @@ writel(readl(olympic_mmio+LAPWWC),olympic_mmio+LAPA); adapter_check_area = olympic_priv->olympic_lap + ((readl(olympic_mmio+LAPWWC)) & (~0xf800)) ; printk(KERN_WARNING "%s: Bytes %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",dev->name, readb(adapter_check_area+0), readb(adapter_check_area+1), readb(adapter_check_area+2), readb(adapter_check_area+3), readb(adapter_check_area+4), readb(adapter_check_area+5), readb(adapter_check_area+6), readb(adapter_check_area+7)) ; - olympic_freemem(dev) ; - free_irq(dev->irq, dev) ; - dev->stop = NULL ; spin_unlock(&olympic_priv->olympic_lock) ; return IRQ_HANDLED; } /* SISR_ADAPTER_CHECK */ @@ -1094,34 +1092,32 @@ writeb(0,srb+1); writeb(OLYMPIC_CLEAR_RET_CODE,srb+2); + add_wait_queue(&olympic_priv->srb_wait,&wait) ; + set_current_state(TASK_INTERRUPTIBLE) ; + spin_lock_irqsave(&olympic_priv->olympic_lock,flags); olympic_priv->srb_queued=1; writel(LISR_SRB_CMD,olympic_mmio+LISR_SUM); spin_unlock_irqrestore(&olympic_priv->olympic_lock,flags); - - t = jiffies ; - - add_wait_queue(&olympic_priv->srb_wait,&wait) ; - set_current_state(TASK_INTERRUPTIBLE) ; while(olympic_priv->srb_queued) { - schedule() ; + + t = schedule_timeout(60*HZ); + if(signal_pending(current)) { printk(KERN_WARNING "%s: SRB timed out.\n",dev->name); printk(KERN_WARNING "SISR=%x MISR=%x\n",readl(olympic_mmio+SISR),readl(olympic_mmio+LISR)); olympic_priv->srb_queued=0; break; } - if ((jiffies-t) > 60*HZ) { + + if (t == 0) { printk(KERN_WARNING "%s: SRB timed out. May not be fatal. \n",dev->name) ; - olympic_priv->srb_queued=0; - break ; } - set_current_state(TASK_INTERRUPTIBLE) ; + olympic_priv->srb_queued=0; } remove_wait_queue(&olympic_priv->srb_wait,&wait) ; - set_current_state(TASK_RUNNING) ; olympic_priv->rx_status_last_received++; olympic_priv->rx_status_last_received&=OLYMPIC_RX_RING_SIZE-1; @@ -1513,29 +1509,6 @@ writel(readl(olympic_mmio+BCTL)&~(3<<13),olympic_mmio+BCTL); netif_stop_queue(dev); olympic_priv->srb = readw(olympic_priv->olympic_lap + LAPWWO) ; - for(i=0;irx_ring_skb[olympic_priv->rx_status_last_received]); - if (olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer != 0xdeadbeef) { - pci_unmap_single(olympic_priv->pdev, - le32_to_cpu(olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer), - olympic_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE); - } - olympic_priv->rx_status_last_received++; - olympic_priv->rx_status_last_received&=OLYMPIC_RX_RING_SIZE-1; - } - /* unmap rings */ - pci_unmap_single(olympic_priv->pdev, olympic_priv->rx_status_ring_dma_addr, - sizeof(struct olympic_rx_status) * OLYMPIC_RX_RING_SIZE, PCI_DMA_FROMDEVICE); - pci_unmap_single(olympic_priv->pdev, olympic_priv->rx_ring_dma_addr, - sizeof(struct olympic_rx_desc) * OLYMPIC_RX_RING_SIZE, PCI_DMA_TODEVICE); - - pci_unmap_single(olympic_priv->pdev, olympic_priv->tx_status_ring_dma_addr, - sizeof(struct olympic_tx_status) * OLYMPIC_TX_RING_SIZE, PCI_DMA_FROMDEVICE); - pci_unmap_single(olympic_priv->pdev, olympic_priv->tx_ring_dma_addr, - sizeof(struct olympic_tx_desc) * OLYMPIC_TX_RING_SIZE, PCI_DMA_TODEVICE); - - free_irq(dev->irq,dev); - dev->stop=NULL; printk(KERN_WARNING "%s: Adapter has been closed \n", dev->name) ; } /* If serious error */ diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c --- a/drivers/net/via-velocity.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/via-velocity.c 2004-10-06 19:37:47 -07:00 @@ -359,6 +359,8 @@ pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); free_netdev(dev); + + velocity_nics--; } /** @@ -462,7 +464,7 @@ { struct mac_regs * regs = vptr->mac_regs; - /* T urn on MCFG_PQEN, turn off MCFG_RTGOPT */ + /* Turn on MCFG_PQEN, turn off MCFG_RTGOPT */ WORD_REG_BITS_SET(MCFG_PQEN, MCFG_RTGOPT, ®s->MCFG); WORD_REG_BITS_ON(MCFG_VIDFR, ®s->MCFG); @@ -490,12 +492,6 @@ } } -static inline void velocity_give_rx_desc(struct rx_desc *rd) -{ - *(u32 *)&rd->rdesc0 = 0; - rd->rdesc0.owner = cpu_to_le32(OWNED_BY_NIC); -} - /** * velocity_rx_reset - handle a receive reset * @vptr: velocity we are resetting @@ -516,7 +512,7 @@ * Init state, all RD entries belong to the NIC */ for (i = 0; i < vptr->options.numrx; ++i) - velocity_give_rx_desc(vptr->rd_ring + i); + vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC; writew(vptr->options.numrx, ®s->RBRDU); writel(vptr->rd_pool_dma, ®s->RDBaseLo); @@ -591,11 +587,16 @@ writeb(WOLCFG_SAM | WOLCFG_SAB, ®s->WOLCFGSet); /* - * Bback off algorithm use original IEEE standard + * Back off algorithm use original IEEE standard */ BYTE_REG_BITS_SET(CFGB_OFSET, (CFGB_CRANDOM | CFGB_CAP | CFGB_MBA | CFGB_BAKOPT), ®s->CFGB); /* + * Init CAM filter + */ + velocity_init_cam_filter(vptr); + + /* * Set packet filter: Receive directed and broadcast address */ velocity_set_multi(vptr->dev); @@ -619,8 +620,6 @@ mac_tx_queue_run(regs, i); } - velocity_init_cam_filter(vptr); - init_flow_control_register(vptr); writel(CR0_STOP, ®s->CR0Clr); @@ -628,7 +627,6 @@ mii_status = velocity_get_opt_media_mode(vptr); netif_stop_queue(vptr->dev); - mac_clear_isr(regs); mii_init(vptr, mii_status); @@ -695,7 +693,7 @@ struct mac_regs * regs; int ret = -ENOMEM; - if (velocity_nics++ >= MAX_UNITS) { + if (velocity_nics >= MAX_UNITS) { printk(KERN_NOTICE VELOCITY_NAME ": already found %d NICs.\n", velocity_nics); return -ENODEV; @@ -727,7 +725,6 @@ vptr->dev = dev; - dev->priv = vptr; dev->irq = pdev->irq; ret = pci_enable_device(pdev); @@ -762,7 +759,7 @@ dev->dev_addr[i] = readb(®s->PAR[i]); - velocity_get_options(&vptr->options, velocity_nics - 1, dev->name); + velocity_get_options(&vptr->options, velocity_nics, dev->name); /* * Mask out the options cannot be set to the chip @@ -817,6 +814,7 @@ spin_unlock_irqrestore(&velocity_dev_list_lock, flags); } #endif + velocity_nics++; out: return ret; @@ -869,10 +867,7 @@ vptr->io_size = info->io_size; vptr->num_txq = info->txqueue; vptr->multicast_limit = MCAM_SIZE; - spin_lock_init(&vptr->lock); - spin_lock_init(&vptr->xmit_lock); - INIT_LIST_HEAD(&vptr->list); } @@ -1024,11 +1019,11 @@ wmb(); - unusable = vptr->rd_filled | 0x0003; - dirty = vptr->rd_dirty - unusable + 1; + unusable = vptr->rd_filled & 0x0003; + dirty = vptr->rd_dirty - unusable; for (avail = vptr->rd_filled & 0xfffc; avail; avail--) { dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1; - velocity_give_rx_desc(vptr->rd_ring + dirty); + vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC; } writew(vptr->rd_filled & 0xfffc, ®s->RBRDU); @@ -1043,7 +1038,7 @@ struct rx_desc *rd = vptr->rd_ring + dirty; /* Fine for an all zero Rx desc at init time as well */ - if (rd->rdesc0.owner == cpu_to_le32(OWNED_BY_NIC)) + if (rd->rdesc0.owner == OWNED_BY_NIC) break; if (!vptr->rd_info[dirty].skb) { @@ -1096,7 +1091,7 @@ } /** - * velocity_free_rd_ring - set up receive ring + * velocity_free_rd_ring - free receive ring * @vptr: velocity to clean up * * Free the receive buffers for each ring slot and any @@ -1161,8 +1156,10 @@ for (i = 0; i < vptr->options.numtx; i++, curr += sizeof(struct tx_desc)) { td = &(vptr->td_rings[j][i]); td_info = &(vptr->td_infos[j][i]); - td_info->buf = vptr->tx_bufs + (i + j) * PKT_BUF_SZ; - td_info->buf_dma = vptr->tx_bufs_dma + (i + j) * PKT_BUF_SZ; + td_info->buf = vptr->tx_bufs + + (j * vptr->options.numtx + i) * PKT_BUF_SZ; + td_info->buf_dma = vptr->tx_bufs_dma + + (j * vptr->options.numtx + i) * PKT_BUF_SZ; } vptr->td_tail[j] = vptr->td_curr[j] = vptr->td_used[j] = 0; } @@ -1238,15 +1235,17 @@ int rd_curr = vptr->rd_curr; int works = 0; - while (1) { + do { struct rx_desc *rd = vptr->rd_ring + rd_curr; - if (!vptr->rd_info[rd_curr].skb || (works++ > 15)) + if (!vptr->rd_info[rd_curr].skb) break; if (rd->rdesc0.owner == OWNED_BY_NIC) break; + rmb(); + /* * Don't drop CE or RL error frame although RXOK is off */ @@ -1269,14 +1268,15 @@ rd_curr++; if (rd_curr >= vptr->options.numrx) rd_curr = 0; - } + } while (++works <= 15); - if (velocity_rx_refill(vptr) < 0) { + vptr->rd_curr = rd_curr; + + if (works > 0 && velocity_rx_refill(vptr) < 0) { VELOCITY_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: rx buf allocation failure\n", vptr->dev->name); } - vptr->rd_curr = rd_curr; VAR_USED(stats); return works; } diff -Nru a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h --- a/drivers/net/via-velocity.h 2004-10-06 19:37:48 -07:00 +++ b/drivers/net/via-velocity.h 2004-10-06 19:37:48 -07:00 @@ -1319,7 +1319,7 @@ /* disable CAMEN */ writeb(0, ®s->CAMADDR); - /* Select CAM mask */ + /* Select mar */ BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR); } @@ -1360,7 +1360,7 @@ writeb(0, ®s->CAMADDR); - /* Select CAM mask */ + /* Select mar */ BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR); } @@ -1401,7 +1401,7 @@ writeb(0, ®s->CAMADDR); - /* Select CAM mask */ + /* Select mar */ BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR); } @@ -1792,7 +1792,6 @@ u8 mCAMmask[(MCAM_SIZE / 8)]; spinlock_t lock; - spinlock_t xmit_lock; int wol_opts; u8 wol_passwd[6]; diff -Nru a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c --- a/drivers/net/wan/pc300_tty.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/wan/pc300_tty.c 2004-10-06 19:37:47 -07:00 @@ -192,13 +192,14 @@ */ void cpc_tty_init(pc300dev_t *pc300dev) { - int port, aux; + unsigned long port; + int aux; st_cpc_tty_area * cpc_tty; /* hdlcX - X=interface number */ port = pc300dev->dev->name[4] - '0'; if (port >= CPC_TTY_NPORTS) { - printk("%s-tty: invalid interface selected (0-%i): %i", + printk("%s-tty: invalid interface selected (0-%i): %li", pc300dev->dev->name, CPC_TTY_NPORTS-1,port); return; @@ -682,7 +683,8 @@ */ static void cpc_tty_rx_work(void * data) { - int port, i, j; + unsigned long port; + int i, j; st_cpc_tty_area *cpc_tty; volatile st_cpc_rx_buf * buf; char flags=0,flg_rx=1; @@ -693,18 +695,15 @@ for (i=0; (i < 4) && flg_rx ; i++) { flg_rx = 0; - port = (int) data; + port = (unsigned long)data; for (j=0; j < CPC_TTY_NPORTS; j++) { cpc_tty = &cpc_tty_area[port]; if ((buf=cpc_tty->buf_rx.first) != 0) { - - if(cpc_tty->tty) - { - ld = tty_ldisc_ref(cpc_tty); - if(ld) - { - if (ld->receive_buf)) { + if(cpc_tty->tty) { + ld = tty_ldisc_ref(cpc_tty->tty); + if(ld) { + if (ld->receive_buf) { CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name); ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size); } diff -Nru a/drivers/net/wireless/prism54/isl_38xx.c b/drivers/net/wireless/prism54/isl_38xx.c --- a/drivers/net/wireless/prism54/isl_38xx.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/wireless/prism54/isl_38xx.c 2004-10-06 19:37:47 -07:00 @@ -44,7 +44,7 @@ * register located at offset %ISL38XX_INT_IDENT_REG. */ void -isl38xx_disable_interrupts(void *device) +isl38xx_disable_interrupts(void __iomem *device) { isl38xx_w32_flush(device, 0x00000000, ISL38XX_INT_EN_REG); udelay(ISL38XX_WRITEIO_DELAY); @@ -52,7 +52,7 @@ void isl38xx_handle_sleep_request(isl38xx_control_block *control_block, - int *powerstate, void *device_base) + int *powerstate, void __iomem *device_base) { /* device requests to go into sleep mode * check whether the transmit queues for data and management are empty */ @@ -88,7 +88,7 @@ void isl38xx_handle_wakeup(isl38xx_control_block *control_block, - int *powerstate, void *device_base) + int *powerstate, void __iomem *device_base) { /* device is in active state, update the powerstate flag */ *powerstate = ISL38XX_PSM_ACTIVE_STATE; @@ -110,7 +110,7 @@ } void -isl38xx_trigger_device(int asleep, void *device_base) +isl38xx_trigger_device(int asleep, void __iomem *device_base) { struct timeval current_time; u32 reg, counter = 0; @@ -190,7 +190,7 @@ } void -isl38xx_interface_reset(void *device_base, dma_addr_t host_address) +isl38xx_interface_reset(void __iomem *device_base, dma_addr_t host_address) { u32 reg; @@ -219,7 +219,7 @@ } void -isl38xx_enable_common_interrupts(void *device_base) { +isl38xx_enable_common_interrupts(void __iomem *device_base) { u32 reg; reg = ( ISL38XX_INT_IDENT_UPDATE | ISL38XX_INT_IDENT_SLEEP | ISL38XX_INT_IDENT_WAKEUP); diff -Nru a/drivers/net/wireless/prism54/isl_38xx.h b/drivers/net/wireless/prism54/isl_38xx.h --- a/drivers/net/wireless/prism54/isl_38xx.h 2004-10-06 19:37:48 -07:00 +++ b/drivers/net/wireless/prism54/isl_38xx.h 2004-10-06 19:37:48 -07:00 @@ -75,7 +75,7 @@ * from the %ISL38XX_PCI_POSTING_FLUSH offset. */ static inline void -isl38xx_w32_flush(void *base, u32 val, unsigned long offset) +isl38xx_w32_flush(void __iomem *base, u32 val, unsigned long offset) { writel(val, base + offset); (void) readl(base + ISL38XX_PCI_POSTING_FLUSH); @@ -157,13 +157,13 @@ /* determine number of entries currently in queue */ int isl38xx_in_queue(isl38xx_control_block *cb, int queue); -void isl38xx_disable_interrupts(void *); -void isl38xx_enable_common_interrupts(void *); +void isl38xx_disable_interrupts(void __iomem *); +void isl38xx_enable_common_interrupts(void __iomem *); void isl38xx_handle_sleep_request(isl38xx_control_block *, int *, - void *); -void isl38xx_handle_wakeup(isl38xx_control_block *, int *, void *); -void isl38xx_trigger_device(int, void *); -void isl38xx_interface_reset(void *, dma_addr_t); + void __iomem *); +void isl38xx_handle_wakeup(isl38xx_control_block *, int *, void __iomem *); +void isl38xx_trigger_device(int, void __iomem *); +void isl38xx_interface_reset(void __iomem *, dma_addr_t); #endif /* _ISL_38XX_H */ diff -Nru a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c --- a/drivers/net/wireless/prism54/islpci_dev.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/net/wireless/prism54/islpci_dev.c 2004-10-06 19:37:46 -07:00 @@ -58,7 +58,7 @@ isl_upload_firmware(islpci_private *priv) { u32 reg, rc; - void *device_base = priv->device_base; + void __iomem *device_base = priv->device_base; /* clear the RAMBoot and the Reset bit */ reg = readl(device_base + ISL38XX_CTRL_STAT_REG); @@ -113,7 +113,7 @@ (fw_len > ISL38XX_MEMORY_WINDOW_SIZE) ? ISL38XX_MEMORY_WINDOW_SIZE : fw_len; - u32 *dev_fw_ptr = device_base + ISL38XX_DIRECT_MEM_WIN; + u32 __iomem *dev_fw_ptr = device_base + ISL38XX_DIRECT_MEM_WIN; /* set the cards base address for writting the data */ isl38xx_w32_flush(device_base, reg, @@ -183,7 +183,7 @@ u32 reg; islpci_private *priv = config; struct net_device *ndev = priv->ndev; - void *device = priv->device_base; + void __iomem *device = priv->device_base; int powerstate = ISL38XX_PSM_POWERSAVE_STATE; /* lock the interrupt handler */ @@ -405,7 +405,7 @@ static int prism54_bring_down(islpci_private *priv) { - void *device_base = priv->device_base; + void __iomem *device_base = priv->device_base; u32 reg; /* we are going to shutdown the device */ islpci_set_state(priv, PRV_STATE_PREBOOT); diff -Nru a/drivers/net/wireless/prism54/islpci_dev.h b/drivers/net/wireless/prism54/islpci_dev.h --- a/drivers/net/wireless/prism54/islpci_dev.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/net/wireless/prism54/islpci_dev.h 2004-10-06 19:37:47 -07:00 @@ -109,7 +109,7 @@ u32 pci_state[16]; /* used for suspend/resume */ char firmware[33]; - void *device_base; /* ioremapped device base address */ + void __iomem *device_base; /* ioremapped device base address */ /* consistent DMA region */ void *driver_mem_address; /* base DMA address */ diff -Nru a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c --- a/drivers/pci/hotplug/shpchp_ctrl.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/pci/hotplug/shpchp_ctrl.c 2004-10-06 19:37:48 -07:00 @@ -2163,11 +2163,13 @@ u32 rc = 0; int ret = 0; unsigned int devfn; - struct pci_bus *pci_bus = p_slot->ctrl->pci_dev->subordinate; + struct pci_bus *pci_bus; struct pci_func *func; if (!p_slot->ctrl) return 1; + + pci_bus = p_slot->ctrl->pci_dev->subordinate; /* Check to see if (latch closed, card present, power on) */ down(&p_slot->ctrl->crit_sect); diff -Nru a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c --- a/drivers/pcmcia/cardbus.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/cardbus.c 2004-10-06 19:37:47 -07:00 @@ -85,7 +85,7 @@ =====================================================================*/ -static u_int xlate_rom_addr(u_char * b, u_int addr) +static u_int xlate_rom_addr(void __iomem *b, u_int addr) { u_int img = 0, ofs = 0, sz; u_short data; diff -Nru a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c --- a/drivers/pcmcia/cistpl.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/cistpl.c 2004-10-06 19:37:47 -07:00 @@ -103,7 +103,7 @@ * If flags & MAP_ATTRIB, map the attribute space, otherwise * map the memory space. */ -static unsigned char * +static void __iomem * set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags) { pccard_mem_map *mem = &s->cis_mem; @@ -141,7 +141,8 @@ int read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, u_int len, void *ptr) { - u_char *sys, *end, *buf = ptr; + void __iomem *sys, *end; + unsigned char *buf = ptr; cs_dbg(s, 3, "read_cis_mem(%d, %#x, %u)\n", attr, addr, len); @@ -204,7 +205,8 @@ void write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, u_int len, void *ptr) { - u_char *sys, *end, *buf = ptr; + void __iomem *sys, *end; + unsigned char *buf = ptr; cs_dbg(s, 3, "write_cis_mem(%d, %#x, %u)\n", attr, addr, len); diff -Nru a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c --- a/drivers/pcmcia/cs.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/cs.c 2004-10-06 19:37:47 -07:00 @@ -427,8 +427,6 @@ return ret; } /* send_event */ -#define cs_to_timeout(cs) (((cs) * HZ + 99) / 100) - static void socket_remove_drivers(struct pcmcia_socket *skt) { client_t *client; @@ -448,8 +446,7 @@ socket_remove_drivers(skt); skt->state &= SOCKET_INUSE|SOCKET_PRESENT; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cs_to_timeout(shutdown_delay)); + msleep(shutdown_delay * 10); skt->state &= SOCKET_INUSE; shutdown_socket(skt); } @@ -467,8 +464,7 @@ skt->socket.flags &= ~SS_RESET; skt->ops->set_socket(skt, &skt->socket); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cs_to_timeout(unreset_delay)); + msleep(unreset_delay * 10); for (i = 0; i < unreset_limit; i++) { skt->ops->get_status(skt, &status); @@ -478,8 +474,7 @@ if (status & SS_READY) return CS_SUCCESS; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cs_to_timeout(unreset_check)); + msleep(unreset_check * 10); } cs_err(skt, "time out after reset.\n"); @@ -496,8 +491,7 @@ if (!(status & SS_DETECT)) return CS_NO_CARD; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cs_to_timeout(initial_delay)); + msleep(initial_delay * 10); for (i = 0; i < 100; i++) { skt->ops->get_status(skt, &status); @@ -507,8 +501,7 @@ if (!(status & SS_PENDING)) break; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cs_to_timeout(10)); + msleep(100); } if (status & SS_PENDING) { @@ -541,8 +534,7 @@ /* * Wait "vcc_settle" for the supply to stabilise. */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cs_to_timeout(vcc_settle)); + msleep(vcc_settle * 10); skt->ops->get_status(skt, &status); if (!(status & SS_POWERON)) { @@ -659,10 +651,8 @@ if (!(skt->state & SOCKET_SUSPEND)) { int status; - if (!(skt->state & SOCKET_PRESENT)) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cs_to_timeout(2)); - } + if (!(skt->state & SOCKET_PRESENT)) + msleep(20); skt->ops->get_status(skt, &status); if ((skt->state & SOCKET_PRESENT) && diff -Nru a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c --- a/drivers/pcmcia/ds.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/ds.c 2004-10-06 19:37:47 -07:00 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -1080,8 +1081,7 @@ * Ugly. But we want to wait for the socket threads to have started up. * We really should let the drivers themselves drive some of this.. */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/4); + msleep(250); init_waitqueue_head(&s->queue); init_waitqueue_head(&s->request); diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c --- a/drivers/pcmcia/i82365.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/i82365.c 2004-10-06 19:37:47 -07:00 @@ -513,8 +513,7 @@ if (request_irq(irq, i365_count_irq, 0, "scan", i365_count_irq) != 0) return 1; irq_hits = 0; irq_sock = sock; - __set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/100); + msleep(10); if (irq_hits) { free_irq(irq, i365_count_irq); debug(2, " spurious hit!\n"); diff -Nru a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c --- a/drivers/pcmcia/rsrc_mgr.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/rsrc_mgr.c 2004-10-06 19:37:47 -07:00 @@ -321,7 +321,7 @@ { pccard_mem_map map; int i, a = 0, b = -1, d; - void *virt; + void __iomem *virt; virt = ioremap(res->start, s->map_size); if (virt) { diff -Nru a/drivers/pcmcia/sa1100_h3600.c b/drivers/pcmcia/sa1100_h3600.c --- a/drivers/pcmcia/sa1100_h3600.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/sa1100_h3600.c 2004-10-06 19:37:47 -07:00 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -96,8 +97,7 @@ set_h3600_egpio(IPAQ_EGPIO_OPT_ON); clr_h3600_egpio(IPAQ_EGPIO_OPT_RESET); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(10*HZ / 1000); + msleep(10); soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); } diff -Nru a/drivers/pcmcia/yenta_socket.h b/drivers/pcmcia/yenta_socket.h --- a/drivers/pcmcia/yenta_socket.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/pcmcia/yenta_socket.h 2004-10-06 19:37:47 -07:00 @@ -107,7 +107,7 @@ struct yenta_socket { struct pci_dev *dev; int cb_irq, io_irq; - void *base; + void __iomem *base; struct timer_list poll_timer; struct pcmcia_socket socket; diff -Nru a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c --- a/drivers/s390/char/sclp_tty.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/s390/char/sclp_tty.c 2004-10-06 19:37:48 -07:00 @@ -277,7 +277,7 @@ wake_up(&sclp_tty_waitq); /* check if the tty needs a wake up call */ if (sclp_tty != NULL) { - tty_wakeup(tty); + tty_wakeup(sclp_tty); } } diff -Nru a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c --- a/drivers/s390/char/sclp_vt220.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/s390/char/sclp_vt220.c 2004-10-06 19:37:47 -07:00 @@ -139,7 +139,7 @@ wake_up(&sclp_vt220_waitq); /* Check if the tty needs a wake up call */ if (sclp_vt220_tty != NULL) { - tty_wakeup(tty); + tty_wakeup(sclp_vt220_tty); } } diff -Nru a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c --- a/drivers/scsi/3w-xxxx.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/scsi/3w-xxxx.c 2004-10-06 19:37:47 -07:00 @@ -551,7 +551,7 @@ /* Now post the command packet */ if ((status_reg_value & TW_STATUS_COMMAND_QUEUE_FULL) == 0) { dprintk(KERN_WARNING "3w-xxxx: tw_aen_read_queue(): Post succeeded.\n"); - tw_dev->srb[request_id] = 0; /* Flag internal command */ + tw_dev->srb[request_id] = NULL; /* Flag internal command */ tw_dev->state[request_id] = TW_S_POSTED; outl(command_que_value, command_que_addr); } else { @@ -718,7 +718,7 @@ tw_state_request_start(tw_dev, &request_id); /* Flag internal command */ - tw_dev->srb[request_id] = 0; + tw_dev->srb[request_id] = NULL; /* Flag chrdev ioctl */ tw_dev->chrdev_request_id = request_id; @@ -2692,7 +2692,7 @@ /* Fake like we just shut down, so notify the card that * we "shut down cleanly". */ - tw_halt(0, 0, 0); // parameters aren't actually used + tw_halt(NULL, 0, NULL); // parameters aren't actually used /* Free up the IO region */ release_region((tw_dev->tw_pci_dev->resource[0].start), TW_IO_ADDRESS_RANGE); diff -Nru a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c --- a/drivers/scsi/NCR53C9x.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/scsi/NCR53C9x.c 2004-10-06 19:37:47 -07:00 @@ -94,7 +94,7 @@ }; /* The master ring of all esp hosts we are managing in this driver. */ -struct NCR_ESP *espchain = 0; +struct NCR_ESP *espchain; int nesps = 0, esps_in_use = 0, esps_running = 0; irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs); @@ -555,7 +555,7 @@ } else { espchain = esp; } - esp->next = 0; + esp->next = NULL; return esp; } @@ -565,7 +565,7 @@ struct NCR_ESP *elink; if(espchain == esp) { - espchain = 0; + espchain = NULL; } else { for(elink = espchain; elink && (elink->next != esp); elink = elink->next); if(elink) @@ -708,9 +708,9 @@ } /* Initialize the command queues */ - esp->current_SC = 0; - esp->disconnected_SC = 0; - esp->issue_SC = 0; + esp->current_SC = NULL; + esp->disconnected_SC = NULL; + esp->issue_SC = NULL; /* Clear the state machines. */ esp->targets_present = 0; @@ -1728,7 +1728,7 @@ ESPLOG(("esp%d: Weird, being reselected but disconnected " "command queue is empty.\n", esp->esp_id)); esp->snip = 0; - esp->current_SC = 0; + esp->current_SC = NULL; sp->SCp.phase = not_issued; append_SC(&esp->issue_SC, sp); } @@ -3393,7 +3393,7 @@ } static espfunc_t isvc_vector[] = { - 0, + NULL, esp_do_phase_determine, esp_do_resetbus, esp_finish_reset, diff -Nru a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c --- a/drivers/scsi/atp870u.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/scsi/atp870u.c 2004-10-06 19:37:47 -07:00 @@ -363,7 +363,7 @@ /* * Clear it off the queue */ - dev->id[target_id].curr_req = 0; + dev->id[target_id].curr_req = NULL; dev->working--; spin_unlock_irqrestore(dev->host->host_lock, flags); /* @@ -2263,10 +2263,10 @@ dev->in_snd = 0; dev->in_int = 0; for (k = 0; k < qcnt; k++) { - dev->querequ[k] = 0; + dev->querequ[k] = NULL; } for (k = 0; k < 16; k++) { - dev->id[k].curr_req = 0; + dev->id[k].curr_req = NULL; dev->sp[k] = 0x04; } return 0; diff -Nru a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c --- a/drivers/scsi/dc395x.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/scsi/dc395x.c 2004-10-06 19:37:47 -07:00 @@ -989,7 +989,7 @@ srb->sg_count = 0; srb->total_xfer_length = 0; srb->sg_bus_addr = 0; - srb->virt_addr = 0; + srb->virt_addr = NULL; srb->sg_index = 0; srb->adapter_status = 0; srb->target_status = 0; @@ -2016,7 +2016,7 @@ } dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); - srb->virt_addr = 0; + srb->virt_addr = NULL; } @@ -3656,7 +3656,7 @@ } else { acb->acb_flag |= RESET_DETECT; reset_dev_param(acb); - doing_srb_done(acb, DID_RESET, 0, 1); + doing_srb_done(acb, DID_RESET, NULL, 1); /*DC395x_RecoverSRB( acb ); */ acb->active_dcb = NULL; acb->acb_flag = 0; diff -Nru a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c --- a/drivers/scsi/gdth.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/scsi/gdth.c 2004-10-06 19:37:47 -07:00 @@ -571,12 +571,12 @@ #define BUS_L2P(a,b) ((b)>(a)->virt_bus ? (b-1):(b)) -#define gdth_readb(addr) readb((ulong)(addr)) -#define gdth_readw(addr) readw((ulong)(addr)) -#define gdth_readl(addr) (ulong32)readl((ulong)(addr)) -#define gdth_writeb(b,addr) writeb((b),(ulong)(addr)) -#define gdth_writew(b,addr) writew((b),(ulong)(addr)) -#define gdth_writel(b,addr) writel((ulong32)(b),(ulong)(addr)) +#define gdth_readb(addr) readb(addr) +#define gdth_readw(addr) readw(addr) +#define gdth_readl(addr) readl(addr) +#define gdth_writeb(b,addr) writeb((b),(addr)) +#define gdth_writew(b,addr) writew((b),(addr)) +#define gdth_writel(b,addr) writel((b),(addr)) static unchar gdth_drq_tab[4] = {5,6,7,7}; /* DRQ table */ static unchar gdth_irq_tab[6] = {0,10,11,12,14,0}; /* IRQ table */ @@ -775,7 +775,7 @@ GDTH_INITFUNC(static int, gdth_search_isa(ulong32 bios_adr)) { - void *addr; + void __iomem *addr; ulong32 id; TRACE(("gdth_search_isa() bios adr. %x\n",bios_adr)); @@ -1050,7 +1050,7 @@ GDTH_INITFUNC(static int, gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha)) { - register gdt2_dpram_str *dp2_ptr; + register gdt2_dpram_str __iomem *dp2_ptr; int i; unchar irq_drq,prot_ver; ulong32 retries; @@ -1062,10 +1062,10 @@ printk("GDT-ISA: Initialization error (DPMEM remap error)\n"); return 0; } - dp2_ptr = (gdt2_dpram_str *)ha->brd; + dp2_ptr = ha->brd; gdth_writeb(1, &dp2_ptr->io.memlock); /* switch off write protection */ /* reset interface area */ - memset_io((char *)&dp2_ptr->u,0,sizeof(dp2_ptr->u)); + memset_io(&dp2_ptr->u, 0, sizeof(dp2_ptr->u)); if (gdth_readl(&dp2_ptr->u) != 0) { printk("GDT-ISA: Initialization error (DPMEM write error)\n"); iounmap(ha->brd); @@ -1150,9 +1150,9 @@ GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha)) { - register gdt6_dpram_str *dp6_ptr; - register gdt6c_dpram_str *dp6c_ptr; - register gdt6m_dpram_str *dp6m_ptr; + register gdt6_dpram_str __iomem *dp6_ptr; + register gdt6c_dpram_str __iomem *dp6c_ptr; + register gdt6m_dpram_str __iomem *dp6m_ptr; ulong32 retries; unchar prot_ver; ushort command; @@ -1180,7 +1180,7 @@ return 0; } /* check and reset interface area */ - dp6_ptr = (gdt6_dpram_str *)ha->brd; + dp6_ptr = ha->brd; gdth_writel(DPMEM_MAGIC, &dp6_ptr->u); if (gdth_readl(&dp6_ptr->u) != DPMEM_MAGIC) { printk("GDT-PCI: Cannot access DPMEM at 0x%lx (shadowed?)\n", @@ -1205,7 +1205,7 @@ printk("GDT-PCI: Initialization error (DPMEM remap error)\n"); return 0; } - dp6_ptr = (gdt6_dpram_str *)ha->brd; + dp6_ptr = ha->brd; gdth_writel(DPMEM_MAGIC, &dp6_ptr->u); if (gdth_readl(&dp6_ptr->u) == DPMEM_MAGIC) { printk("GDT-PCI: Use free address at 0x%x\n", i); @@ -1219,7 +1219,7 @@ return 0; } } - memset_io((char *)&dp6_ptr->u,0,sizeof(dp6_ptr->u)); + memset_io(&dp6_ptr->u, 0, sizeof(dp6_ptr->u)); if (gdth_readl(&dp6_ptr->u) != 0) { printk("GDT-PCI: Initialization error (DPMEM write error)\n"); iounmap(ha->brd); @@ -1290,7 +1290,7 @@ return 0; } /* check and reset interface area */ - dp6c_ptr = (gdt6c_dpram_str *)ha->brd; + dp6c_ptr = ha->brd; gdth_writel(DPMEM_MAGIC, &dp6c_ptr->u); if (gdth_readl(&dp6c_ptr->u) != DPMEM_MAGIC) { printk("GDT-PCI: Cannot access DPMEM at 0x%lx (shadowed?)\n", @@ -1315,7 +1315,7 @@ printk("GDT-PCI: Initialization error (DPMEM remap error)\n"); return 0; } - dp6c_ptr = (gdt6c_dpram_str *)ha->brd; + dp6c_ptr = ha->brd; gdth_writel(DPMEM_MAGIC, &dp6c_ptr->u); if (gdth_readl(&dp6c_ptr->u) == DPMEM_MAGIC) { printk("GDT-PCI: Use free address at 0x%x\n", i); @@ -1329,7 +1329,7 @@ return 0; } } - memset_io((char *)&dp6c_ptr->u,0,sizeof(dp6c_ptr->u)); + memset_io(&dp6c_ptr->u, 0, sizeof(dp6c_ptr->u)); if (gdth_readl(&dp6c_ptr->u) != 0) { printk("GDT-PCI: Initialization error (DPMEM write error)\n"); iounmap(ha->brd); @@ -1425,13 +1425,14 @@ pcistr->pdev->rom_address); #endif + dp6m_ptr = ha->brd; + /* Ensure that it is safe to access the non HW portions of DPMEM. * Aditional check needed for Xscale based RAID controllers */ - while( ((int)gdth_readb(&((gdt6m_dpram_str *)ha->brd)->i960r.sema0_reg) ) & 3 ) + while( ((int)gdth_readb(&dp6m_ptr->i960r.sema0_reg) ) & 3 ) gdth_delay(1); /* check and reset interface area */ - dp6m_ptr = (gdt6m_dpram_str *)ha->brd; gdth_writel(DPMEM_MAGIC, &dp6m_ptr->u); if (gdth_readl(&dp6m_ptr->u) != DPMEM_MAGIC) { printk("GDT-PCI: Cannot access DPMEM at 0x%lx (shadowed?)\n", @@ -1456,7 +1457,7 @@ printk("GDT-PCI: Initialization error (DPMEM remap error)\n"); return 0; } - dp6m_ptr = (gdt6m_dpram_str *)ha->brd; + dp6m_ptr = ha->brd; gdth_writel(DPMEM_MAGIC, &dp6m_ptr->u); if (gdth_readl(&dp6m_ptr->u) == DPMEM_MAGIC) { printk("GDT-PCI: Use free address at 0x%x\n", i); @@ -1470,7 +1471,7 @@ return 0; } } - memset_io((char *)&dp6m_ptr->u,0,sizeof(dp6m_ptr->u)); + memset_io(&dp6m_ptr->u, 0, sizeof(dp6m_ptr->u)); /* disable board interrupts, deinit services */ gdth_writeb(gdth_readb(&dp6m_ptr->i960r.edoor_en_reg) | 4, @@ -1553,9 +1554,9 @@ { gdth_ha_str *ha; ulong flags; - gdt2_dpram_str *dp2_ptr; - gdt6_dpram_str *dp6_ptr; - gdt6m_dpram_str *dp6m_ptr; + gdt2_dpram_str __iomem *dp2_ptr; + gdt6_dpram_str __iomem *dp6_ptr; + gdt6m_dpram_str __iomem *dp6m_ptr; TRACE(("gdth_enable_int() hanum %d\n",hanum)); ha = HADATA(gdth_ctr_tab[hanum]); @@ -1566,12 +1567,12 @@ outb(0xff, ha->bmic + EDENABREG); outb(0x01, ha->bmic + EINTENABREG); } else if (ha->type == GDT_ISA) { - dp2_ptr = (gdt2_dpram_str *)ha->brd; + dp2_ptr = ha->brd; gdth_writeb(1, &dp2_ptr->io.irqdel); gdth_writeb(0, &dp2_ptr->u.ic.Cmd_Index); gdth_writeb(1, &dp2_ptr->io.irqen); } else if (ha->type == GDT_PCI) { - dp6_ptr = (gdt6_dpram_str *)ha->brd; + dp6_ptr = ha->brd; gdth_writeb(1, &dp6_ptr->io.irqdel); gdth_writeb(0, &dp6_ptr->u.ic.Cmd_Index); gdth_writeb(1, &dp6_ptr->io.irqen); @@ -1579,7 +1580,7 @@ outb(0xff, PTR2USHORT(&ha->plx->edoor_reg)); outb(0x03, PTR2USHORT(&ha->plx->control1)); } else if (ha->type == GDT_PCIMPR) { - dp6m_ptr = (gdt6m_dpram_str *)ha->brd; + dp6m_ptr = ha->brd; gdth_writeb(0xff, &dp6m_ptr->i960r.edoor_reg); gdth_writeb(gdth_readb(&dp6m_ptr->i960r.edoor_en_reg) & ~4, &dp6m_ptr->i960r.edoor_en_reg); @@ -1605,15 +1606,15 @@ *pIStatus = inb((ushort)ha->bmic + EDOORREG); else if (ha->type == GDT_ISA) *pIStatus = - gdth_readb(&((gdt2_dpram_str *)ha->brd)->u.ic.Cmd_Index); + gdth_readb(&((gdt2_dpram_str __iomem *)ha->brd)->u.ic.Cmd_Index); else if (ha->type == GDT_PCI) *pIStatus = - gdth_readb(&((gdt6_dpram_str *)ha->brd)->u.ic.Cmd_Index); + gdth_readb(&((gdt6_dpram_str __iomem *)ha->brd)->u.ic.Cmd_Index); else if (ha->type == GDT_PCINEW) *pIStatus = inb(PTR2USHORT(&ha->plx->edoor_reg)); else if (ha->type == GDT_PCIMPR) *pIStatus = - gdth_readb(&((gdt6m_dpram_str *)ha->brd)->i960r.edoor_reg); + gdth_readb(&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.edoor_reg); if (*pIStatus) return i; /* board found */ @@ -1633,14 +1634,14 @@ if (ha->type == GDT_EISA) gdtsema0 = (int)inb(ha->bmic + SEMA0REG); else if (ha->type == GDT_ISA) - gdtsema0 = (int)gdth_readb(&((gdt2_dpram_str *)ha->brd)->u.ic.Sema0); + gdtsema0 = (int)gdth_readb(&((gdt2_dpram_str __iomem *)ha->brd)->u.ic.Sema0); else if (ha->type == GDT_PCI) - gdtsema0 = (int)gdth_readb(&((gdt6_dpram_str *)ha->brd)->u.ic.Sema0); + gdtsema0 = (int)gdth_readb(&((gdt6_dpram_str __iomem *)ha->brd)->u.ic.Sema0); else if (ha->type == GDT_PCINEW) gdtsema0 = (int)inb(PTR2USHORT(&ha->plx->sema0_reg)); else if (ha->type == GDT_PCIMPR) gdtsema0 = - (int)gdth_readb(&((gdt6m_dpram_str *)ha->brd)->i960r.sema0_reg); + (int)gdth_readb(&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.sema0_reg); return (gdtsema0 & 1); } @@ -1676,13 +1677,13 @@ if (ha->type == GDT_EISA) { outb(1, ha->bmic + SEMA0REG); } else if (ha->type == GDT_ISA) { - gdth_writeb(1, &((gdt2_dpram_str *)ha->brd)->u.ic.Sema0); + gdth_writeb(1, &((gdt2_dpram_str __iomem *)ha->brd)->u.ic.Sema0); } else if (ha->type == GDT_PCI) { - gdth_writeb(1, &((gdt6_dpram_str *)ha->brd)->u.ic.Sema0); + gdth_writeb(1, &((gdt6_dpram_str __iomem *)ha->brd)->u.ic.Sema0); } else if (ha->type == GDT_PCINEW) { outb(1, PTR2USHORT(&ha->plx->sema0_reg)); } else if (ha->type == GDT_PCIMPR) { - gdth_writeb(1, &((gdt6m_dpram_str *)ha->brd)->i960r.sema0_reg); + gdth_writeb(1, &((gdt6m_dpram_str __iomem *)ha->brd)->i960r.sema0_reg); } } @@ -1691,10 +1692,10 @@ { register gdth_ha_str *ha; register gdth_cmd_str *cmd_ptr; - register gdt6m_dpram_str *dp6m_ptr; - register gdt6c_dpram_str *dp6c_ptr; - gdt6_dpram_str *dp6_ptr; - gdt2_dpram_str *dp2_ptr; + register gdt6m_dpram_str __iomem *dp6m_ptr; + register gdt6c_dpram_str __iomem *dp6c_ptr; + gdt6_dpram_str __iomem *dp6_ptr; + gdt2_dpram_str __iomem *dp2_ptr; ushort cp_count,dp_offset,cmd_no; TRACE(("gdth_copy_command() hanum %d\n",hanum)); @@ -1717,28 +1718,28 @@ /* set offset and service, copy command to DPMEM */ if (ha->type == GDT_ISA) { - dp2_ptr = (gdt2_dpram_str *)ha->brd; + dp2_ptr = ha->brd; gdth_writew(dp_offset + DPMEM_COMMAND_OFFSET, &dp2_ptr->u.ic.comm_queue[cmd_no].offset); gdth_writew((ushort)cmd_ptr->Service, &dp2_ptr->u.ic.comm_queue[cmd_no].serv_id); memcpy_toio(&dp2_ptr->u.ic.gdt_dpr_cmd[dp_offset],cmd_ptr,cp_count); } else if (ha->type == GDT_PCI) { - dp6_ptr = (gdt6_dpram_str *)ha->brd; + dp6_ptr = ha->brd; gdth_writew(dp_offset + DPMEM_COMMAND_OFFSET, &dp6_ptr->u.ic.comm_queue[cmd_no].offset); gdth_writew((ushort)cmd_ptr->Service, &dp6_ptr->u.ic.comm_queue[cmd_no].serv_id); memcpy_toio(&dp6_ptr->u.ic.gdt_dpr_cmd[dp_offset],cmd_ptr,cp_count); } else if (ha->type == GDT_PCINEW) { - dp6c_ptr = (gdt6c_dpram_str *)ha->brd; + dp6c_ptr = ha->brd; gdth_writew(dp_offset + DPMEM_COMMAND_OFFSET, &dp6c_ptr->u.ic.comm_queue[cmd_no].offset); gdth_writew((ushort)cmd_ptr->Service, &dp6c_ptr->u.ic.comm_queue[cmd_no].serv_id); memcpy_toio(&dp6c_ptr->u.ic.gdt_dpr_cmd[dp_offset],cmd_ptr,cp_count); } else if (ha->type == GDT_PCIMPR) { - dp6m_ptr = (gdt6m_dpram_str *)ha->brd; + dp6m_ptr = ha->brd; gdth_writew(dp_offset + DPMEM_COMMAND_OFFSET, &dp6m_ptr->u.ic.comm_queue[cmd_no].offset); gdth_writew((ushort)cmd_ptr->Service, @@ -1777,13 +1778,13 @@ outl(ha->ccb_phys, ha->bmic + MAILBOXREG); outb(ha->pccb->Service, ha->bmic + LDOORREG); } else if (ha->type == GDT_ISA) { - gdth_writeb(0, &((gdt2_dpram_str *)ha->brd)->io.event); + gdth_writeb(0, &((gdt2_dpram_str __iomem *)ha->brd)->io.event); } else if (ha->type == GDT_PCI) { - gdth_writeb(0, &((gdt6_dpram_str *)ha->brd)->io.event); + gdth_writeb(0, &((gdt6_dpram_str __iomem *)ha->brd)->io.event); } else if (ha->type == GDT_PCINEW) { outb(1, PTR2USHORT(&ha->plx->ldoor_reg)); } else if (ha->type == GDT_PCIMPR) { - gdth_writeb(1, &((gdt6m_dpram_str *)ha->brd)->i960r.ldoor_reg); + gdth_writeb(1, &((gdt6m_dpram_str __iomem *)ha->brd)->i960r.ldoor_reg); } } @@ -3416,7 +3417,7 @@ /* no GDTH_LOCK_HA() ! */ TRACE2(("gdth_store_event() source %d idx %d\n", source, idx)); if (source == 0) /* no source -> no event */ - return 0; + return NULL; if (ebuffer[elastidx].event_source == source && ebuffer[elastidx].event_idx == idx && @@ -3535,9 +3536,9 @@ #endif { register gdth_ha_str *ha; - gdt6m_dpram_str *dp6m_ptr = NULL; - gdt6_dpram_str *dp6_ptr; - gdt2_dpram_str *dp2_ptr; + gdt6m_dpram_str __iomem *dp6m_ptr = NULL; + gdt6_dpram_str __iomem *dp6_ptr; + gdt2_dpram_str __iomem *dp2_ptr; Scsi_Cmnd *scp; int hanum, rval, i; unchar IStatus; @@ -3616,7 +3617,7 @@ outb(0xff, ha->bmic + EDOORREG); /* acknowledge interrupt */ outb(0x00, ha->bmic + SEMA1REG); /* reset status semaphore */ } else if (ha->type == GDT_ISA) { - dp2_ptr = (gdt2_dpram_str *)ha->brd; + dp2_ptr = ha->brd; if (IStatus & 0x80) { /* error flag */ IStatus &= ~0x80; ha->status = gdth_readw(&dp2_ptr->u.ic.Status); @@ -3631,7 +3632,7 @@ gdth_writeb(0, &dp2_ptr->u.ic.Cmd_Index);/* reset command index */ gdth_writeb(0, &dp2_ptr->io.Sema1); /* reset status semaphore */ } else if (ha->type == GDT_PCI) { - dp6_ptr = (gdt6_dpram_str *)ha->brd; + dp6_ptr = ha->brd; if (IStatus & 0x80) { /* error flag */ IStatus &= ~0x80; ha->status = gdth_readw(&dp6_ptr->u.ic.Status); @@ -3659,7 +3660,7 @@ outb(0xff, PTR2USHORT(&ha->plx->edoor_reg)); outb(0x00, PTR2USHORT(&ha->plx->sema1_reg)); } else if (ha->type == GDT_PCIMPR) { - dp6m_ptr = (gdt6m_dpram_str *)ha->brd; + dp6m_ptr = ha->brd; if (IStatus & 0x80) { /* error flag */ IStatus &= ~0x80; #ifdef INT_COAL @@ -3689,10 +3690,10 @@ if (ha->service != SCREENSERVICE && (ha->fw_vers & 0xff) >= 0x1a) { ha->dvr.severity = gdth_readb - (&((gdt6m_dpram_str *)ha->brd)->i960r.severity); + (&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.severity); for (i = 0; i < 256; ++i) { ha->dvr.event_string[i] = gdth_readb - (&((gdt6m_dpram_str *)ha->brd)->i960r.evt_str[i]); + (&((gdt6m_dpram_str __iomem *)ha->brd)->i960r.evt_str[i]); if (ha->dvr.event_string[i] == 0) break; } diff -Nru a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h --- a/drivers/scsi/gdth.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/scsi/gdth.h 2004-10-06 19:37:47 -07:00 @@ -868,7 +868,7 @@ ushort raw_feat; /* feat. raw service (s/g,..)*/ ushort screen_feat; /* feat. raw service (s/g,..)*/ ushort bmic; /* BMIC address (EISA) */ - void *brd; /* DPRAM address */ + void __iomem *brd; /* DPRAM address */ ulong32 brd_phys; /* slot number/BIOS address */ gdt6c_plx_regs *plx; /* PLX regs (new PCI contr.) */ gdth_cmd_str *pccb; /* address command structure */ diff -Nru a/drivers/scsi/ips.c b/drivers/scsi/ips.c --- a/drivers/scsi/ips.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/scsi/ips.c 2004-10-06 19:37:46 -07:00 @@ -215,7 +215,7 @@ #endif #else #define IPS_SG_ADDRESS(sg) (page_address((sg)->page) ? \ - page_address((sg)->page)+(sg)->offset : 0) + page_address((sg)->page)+(sg)->offset : NULL) #define IPS_LOCK_SAVE(lock,flags) do{spin_lock(lock);(void)flags;}while(0) #define IPS_UNLOCK_RESTORE(lock,flags) do{spin_unlock(lock);(void)flags;}while(0) #endif @@ -6854,8 +6854,8 @@ { ha->active = 0; ips_free(ha); - ips_ha[index] = 0; - ips_sh[index] = 0; + ips_ha[index] = NULL; + ips_sh[index] = NULL; return -1; } diff -Nru a/drivers/scsi/mca_53c9x.c b/drivers/scsi/mca_53c9x.c --- a/drivers/scsi/mca_53c9x.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/scsi/mca_53c9x.c 2004-10-06 19:37:47 -07:00 @@ -238,15 +238,15 @@ /* Optional functions */ - esp->dma_barrier = 0; - esp->dma_drain = 0; - esp->dma_invalidate = 0; - esp->dma_irq_entry = 0; - esp->dma_irq_exit = 0; + esp->dma_barrier = NULL; + esp->dma_drain = NULL; + esp->dma_invalidate = NULL; + esp->dma_irq_entry = NULL; + esp->dma_irq_exit = NULL; esp->dma_led_on = dma_led_on; esp->dma_led_off = dma_led_off; - esp->dma_poll = 0; - esp->dma_reset = 0; + esp->dma_poll = NULL; + esp->dma_reset = NULL; /* Set the command buffer */ diff -Nru a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c --- a/drivers/scsi/pcmcia/nsp_cs.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/scsi/pcmcia/nsp_cs.c 2004-10-06 19:37:48 -07:00 @@ -1528,7 +1528,7 @@ thislength = pos - (buffer + offset); if(thislength < 0) { - *start = 0; + *start = NULL; return 0; } diff -Nru a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c --- a/drivers/scsi/qla2xxx/qla_init.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/scsi/qla2xxx/qla_init.c 2004-10-06 19:37:47 -07:00 @@ -841,7 +841,7 @@ /* Clear outstanding commands array. */ for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) - ha->outstanding_cmds[cnt] = 0; + ha->outstanding_cmds[cnt] = NULL; ha->current_outstanding_cmd = 0; @@ -4131,7 +4131,7 @@ for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { sp = ha->outstanding_cmds[cnt]; if (sp) { - ha->outstanding_cmds[cnt] = 0; + ha->outstanding_cmds[cnt] = NULL; if (ha->actthreads) ha->actthreads--; sp->lun_queue->out_cnt--; diff -Nru a/drivers/scsi/scsiiom.c b/drivers/scsi/scsiiom.c --- a/drivers/scsi/scsiiom.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/scsi/scsiiom.c 2004-10-06 19:37:46 -07:00 @@ -1155,7 +1155,7 @@ } DC390_write8 (ScsiCmd, EN_SEL_RESEL); pSRB = pDCB->pActiveSRB; - pACB->pActiveDCB = 0; + pACB->pActiveDCB = NULL; pSRB->ScsiPhase = SCSI_NOP0; if( pSRB->SRBState & SRB_UNEXPECT_RESEL ) { @@ -1175,7 +1175,7 @@ dc390_Free_insert (pACB, pSRB); pSRB = psrb; } - pDCB->pGoingSRB = 0; + pDCB->pGoingSRB = NULL; dc390_Waiting_process (pACB); } else @@ -1204,7 +1204,7 @@ { disc1: dc390_freetag (pDCB, pSRB); - pDCB->pActiveSRB = 0; + pDCB->pActiveSRB = NULL; pSRB->SRBState = SRB_FREE; dc390_SRBdone( pACB, pDCB, pSRB); } @@ -1644,7 +1644,7 @@ pACB->ACBFlag |= RESET_DETECT; dc390_ResetDevParam( pACB ); - dc390_DoingSRB_Done( pACB, 0 ); + dc390_DoingSRB_Done( pACB, NULL ); //dc390_RecoverSRB( pACB ); pACB->pActiveDCB = NULL; pACB->ACBFlag = 0; diff -Nru a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c --- a/drivers/scsi/tmscsim.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/scsi/tmscsim.c 2004-10-06 19:37:48 -07:00 @@ -604,12 +604,12 @@ **********************************************************************/ static struct dc390_dcb __inline__ *dc390_findDCB ( struct dc390_acb* pACB, u8 id, u8 lun) { - struct dc390_dcb* pDCB = pACB->pLinkDCB; if (!pDCB) return 0; + struct dc390_dcb* pDCB = pACB->pLinkDCB; if (!pDCB) return NULL; while (pDCB->TargetID != id || pDCB->TargetLUN != lun) { pDCB = pDCB->pNextDCB; if (pDCB == pACB->pLinkDCB) - return 0; + return NULL; } DCBDEBUG1( printk (KERN_DEBUG "DCB %p (%02x,%02x) found.\n", \ pDCB, pDCB->TargetID, pDCB->TargetLUN)); @@ -1382,7 +1382,7 @@ static int dc390_slave_alloc(struct scsi_device *scsi_device) { struct dc390_acb *pACB = (struct dc390_acb*) scsi_device->host->hostdata; - struct dc390_dcb *pDCB, *pDCB2 = 0; + struct dc390_dcb *pDCB, *pDCB2 = NULL; uint id = scsi_device->id; uint lun = scsi_device->lun; diff -Nru a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c --- a/drivers/serial/amba-pl011.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/serial/amba-pl011.c 2004-10-06 19:37:48 -07:00 @@ -696,7 +696,6 @@ int bits = 8; int parity = 'n'; int flow = 'n'; - int ret; /* * Check whether an invalid uart number has been specified, and diff -Nru a/drivers/serial/bast_sio.c b/drivers/serial/bast_sio.c --- a/drivers/serial/bast_sio.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/serial/bast_sio.c 2004-10-06 19:37:46 -07:00 @@ -1,3 +1,19 @@ +/* linux/drivers/serial/bast_sio.c + * + * Copyright (c) 2004 Simtec Electronics + * Ben Dooks + * + * http://www.simtec.co.uk/products/EB2410ITX/ + * + * 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. + * + * Modifications: + * 23-Sep-2004 BJD Added copyright header + * 23-Sep-2004 BJD Added serial port remove code +*/ + #include #include #include @@ -20,10 +36,6 @@ { struct serial_struct serial_req; -#if 0 - printk("BAST: SuperIO serial (%08lx,%d)\n", port, irq); -#endif - serial_req.flags = UPF_AUTOPROBE | UPF_SHARE_IRQ; serial_req.baud_base = BASE_BAUD; serial_req.irq = irq; @@ -37,11 +49,13 @@ #define SERIAL_BASE (S3C2410_CS2 + BAST_PA_SUPERIO) +static int port[2] = { -1, -1 }; + static int __init serial_bast_init(void) { if (machine_is_bast()) { - serial_bast_register(SERIAL_BASE + 0x2f8, IRQ_PCSERIAL1); - serial_bast_register(SERIAL_BASE + 0x3f8, IRQ_PCSERIAL2); + port[0] = serial_bast_register(SERIAL_BASE + 0x2f8, IRQ_PCSERIAL1); + port[1] = serial_bast_register(SERIAL_BASE + 0x3f8, IRQ_PCSERIAL2); } return 0; @@ -49,7 +63,10 @@ static void __exit serial_bast_exit(void) { - /* todo -> remove both our ports */ + if (port[0] != -1) + unregister_serial(port[0]); + if (port[1] != -1) + unregister_serial(port[1]); } diff -Nru a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c --- a/drivers/serial/s3c2410.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/serial/s3c2410.c 2004-10-06 19:37:47 -07:00 @@ -26,8 +26,6 @@ #include #include -#include - #if 0 #include #define dbg(x...) llprintk(x) @@ -677,7 +675,7 @@ default: case S3C2410_LCON_PNONE: - /* nothing */ + *parity = 'n'; } /* now calculate the baud rate */ diff -Nru a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c --- a/drivers/serial/serial_core.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/serial/serial_core.c 2004-10-06 19:37:47 -07:00 @@ -395,7 +395,7 @@ if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) quot = port->custom_divisor; else - quot = port->uartclk / (16 * baud); + quot = (port->uartclk + (8 * baud)) / (16 * baud); return quot; } diff -Nru a/drivers/usb/class/bluetty.c b/drivers/usb/class/bluetty.c --- a/drivers/usb/class/bluetty.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/class/bluetty.c 2004-10-06 19:37:47 -07:00 @@ -988,14 +988,13 @@ static void bluetooth_softint(void *private) { struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)private, __FUNCTION__); - struct tty_struct *tty; dbg("%s", __FUNCTION__); if (!bluetooth) return; - tty_wakeup(&bluetooth->tty); + tty_wakeup(bluetooth->tty); } diff -Nru a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c --- a/drivers/usb/class/cdc-acm.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/class/cdc-acm.c 2004-10-06 19:37:47 -07:00 @@ -142,7 +142,7 @@ case ACM_IRQ_LINE_STATE: - newctrl = le16_to_cpu(get_unaligned((__u16 *) data)); + newctrl = le16_to_cpu(get_unaligned((__le16 *) data)); if (acm->tty && !acm->clocal && (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) { dbg("calling hangup"); diff -Nru a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h --- a/drivers/usb/class/cdc-acm.h 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/class/cdc-acm.h 2004-10-06 19:37:48 -07:00 @@ -70,7 +70,7 @@ */ struct acm_line { - __u32 speed; + __le32 speed; __u8 stopbits; __u8 parity; __u8 databits; diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c --- a/drivers/usb/class/usblp.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/class/usblp.c 2004-10-06 19:37:47 -07:00 @@ -1129,7 +1129,7 @@ /* First two bytes are length in big-endian. * They count themselves, and we copy them into * the user's buffer. */ - length = be16_to_cpu(*((u16 *)usblp->device_id_string)); + length = be16_to_cpu(*((__be16 *)usblp->device_id_string)); if (length < 2) length = 2; else if (length >= USBLP_DEVICE_ID_SIZE) diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c --- a/drivers/usb/core/hcd.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/core/hcd.c 2004-10-06 19:37:47 -07:00 @@ -708,6 +708,7 @@ bus->busnum = busnum; } else { printk (KERN_ERR "%s: too many buses\n", usbcore_name); + up(&usb_bus_list_lock); return -E2BIG; } diff -Nru a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h --- a/drivers/usb/core/hub.h 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/core/hub.h 2004-10-06 19:37:46 -07:00 @@ -60,8 +60,8 @@ * See USB 2.0 spec Table 11-19 and Table 11-20 */ struct usb_port_status { - __u16 wPortStatus; - __u16 wPortChange; + __le16 wPortStatus; + __le16 wPortChange; } __attribute__ ((packed)); /* @@ -103,8 +103,8 @@ #define HUB_CHAR_PORTIND 0x0080 /* D7 */ struct usb_hub_status { - __u16 wHubStatus; - __u16 wHubChange; + __le16 wHubStatus; + __le16 wHubChange; } __attribute__ ((packed)); /* diff -Nru a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c --- a/drivers/usb/host/ehci-dbg.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/ehci-dbg.c 2004-10-06 19:37:47 -07:00 @@ -119,16 +119,16 @@ dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) { ehci_dbg (ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, - cpu_to_le32p (&qtd->hw_next), - cpu_to_le32p (&qtd->hw_alt_next), - cpu_to_le32p (&qtd->hw_token), - cpu_to_le32p (&qtd->hw_buf [0])); + le32_to_cpup (&qtd->hw_next), + le32_to_cpup (&qtd->hw_alt_next), + le32_to_cpup (&qtd->hw_token), + le32_to_cpup (&qtd->hw_buf [0])); if (qtd->hw_buf [1]) ehci_dbg (ehci, " p1=%08x p2=%08x p3=%08x p4=%08x\n", - cpu_to_le32p (&qtd->hw_buf [1]), - cpu_to_le32p (&qtd->hw_buf [2]), - cpu_to_le32p (&qtd->hw_buf [3]), - cpu_to_le32p (&qtd->hw_buf [4])); + le32_to_cpup (&qtd->hw_buf [1]), + le32_to_cpup (&qtd->hw_buf [2]), + le32_to_cpup (&qtd->hw_buf [3]), + le32_to_cpup (&qtd->hw_buf [4])); } static void __attribute__((__unused__)) @@ -331,14 +331,14 @@ default: tmp = '?'; break; \ }; tmp; }) -static inline char token_mark (u32 token) +static inline char token_mark (__le32 token) { - token = le32_to_cpu (token); - if (token & QTD_STS_ACTIVE) + __u32 v = le32_to_cpu (token); + if (v & QTD_STS_ACTIVE) return '*'; - if (token & QTD_STS_HALT) + if (v & QTD_STS_HALT) return '-'; - if (!IS_SHORT_READ (token)) + if (!IS_SHORT_READ (v)) return ' '; /* tries to advance through hw_alt_next */ return '/'; @@ -371,25 +371,25 @@ mark = '.'; /* use hw_qtd_next */ /* else alt_next points to some other qtd */ } - scratch = cpu_to_le32p (&qh->hw_info1); - hw_curr = (mark == '*') ? cpu_to_le32p (&qh->hw_current) : 0; + scratch = le32_to_cpup (&qh->hw_info1); + hw_curr = (mark == '*') ? le32_to_cpup (&qh->hw_current) : 0; temp = scnprintf (next, size, "qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)", qh, scratch & 0x007f, speed_char (scratch), (scratch >> 8) & 0x000f, - scratch, cpu_to_le32p (&qh->hw_info2), - cpu_to_le32p (&qh->hw_token), mark, + scratch, le32_to_cpup (&qh->hw_info2), + le32_to_cpup (&qh->hw_token), mark, (__constant_cpu_to_le32 (QTD_TOGGLE) & qh->hw_token) ? "data1" : "data0", - (cpu_to_le32p (&qh->hw_alt_next) >> 1) & 0x0f); + (le32_to_cpup (&qh->hw_alt_next) >> 1) & 0x0f); size -= temp; next += temp; /* hc may be modifying the list as we read it ... */ list_for_each (entry, &qh->qtd_list) { td = list_entry (entry, struct ehci_qtd, qtd_list); - scratch = cpu_to_le32p (&td->hw_token); + scratch = le32_to_cpup (&td->hw_token); mark = ' '; if (hw_curr == td->qtd_dma) mark = '*'; @@ -488,7 +488,8 @@ union ehci_shadow p, *seen; unsigned temp, size, seen_count; char *next; - unsigned i, tag; + unsigned i; + __le32 tag; if (!(seen = kmalloc (DBG_SCHED_LIMIT * sizeof *seen, SLAB_ATOMIC))) return 0; @@ -541,7 +542,7 @@ } /* show more info the first time around */ if (temp == seen_count && p.ptr) { - u32 scratch = cpu_to_le32p ( + u32 scratch = le32_to_cpup ( &p.qh->hw_info1); struct ehci_qtd *qtd; char *type = ""; diff -Nru a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c --- a/drivers/usb/host/ehci-hub.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/host/ehci-hub.c 2004-10-06 19:37:48 -07:00 @@ -455,7 +455,7 @@ #endif dbg_port (ehci, "GetStatus", wIndex + 1, temp); // we "know" this alignment is good, caller used kmalloc()... - *((u32 *) buf) = cpu_to_le32 (status); + *((__le32 *) buf) = cpu_to_le32 (status); break; case SetHubFeature: switch (wValue) { diff -Nru a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c --- a/drivers/usb/host/ehci-mem.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/ehci-mem.c 2004-10-06 19:37:47 -07:00 @@ -235,9 +235,9 @@ } /* Hardware periodic table */ - ehci->periodic = (u32 *) + ehci->periodic = (__le32 *) dma_alloc_coherent (ehci->hcd.self.controller, - ehci->periodic_size * sizeof (u32), + ehci->periodic_size * sizeof(__le32), &ehci->periodic_dma, 0); if (ehci->periodic == 0) { goto fail; diff -Nru a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c --- a/drivers/usb/host/ehci-q.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/ehci-q.c 2004-10-06 19:37:47 -07:00 @@ -721,7 +721,7 @@ static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh) { - u32 dma = QH_NEXT (qh->qh_dma); + __le32 dma = QH_NEXT (qh->qh_dma); struct ehci_qh *head; /* (re)start the async schedule? */ @@ -756,7 +756,7 @@ /*-------------------------------------------------------------------------*/ -#define QH_ADDR_MASK __constant_le32_to_cpu(0x7f) +#define QH_ADDR_MASK __constant_cpu_to_le32(0x7f) /* * For control/bulk/interrupt, return QH with these TDs appended. @@ -840,7 +840,7 @@ if (likely (qtd != 0)) { struct ehci_qtd *dummy; dma_addr_t dma; - u32 token; + __le32 token; /* to avoid racing the HC, use the dummy td instead of * the first td of our list (becomes new dummy). both diff -Nru a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c --- a/drivers/usb/host/ehci-sched.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/ehci-sched.c 2004-10-06 19:37:47 -07:00 @@ -44,7 +44,7 @@ * @tag: hardware tag for type of this record */ static union ehci_shadow * -periodic_next_shadow (union ehci_shadow *periodic, int tag) +periodic_next_shadow (union ehci_shadow *periodic, __le32 tag) { switch (tag) { case Q_TYPE_QH: @@ -64,7 +64,7 @@ static int periodic_unlink (struct ehci_hcd *ehci, unsigned frame, void *ptr) { union ehci_shadow *prev_p = &ehci->pshadow [frame]; - u32 *hw_p = &ehci->periodic [frame]; + __le32 *hw_p = &ehci->periodic [frame]; union ehci_shadow here = *prev_p; union ehci_shadow *next_p; @@ -98,7 +98,7 @@ static unsigned short periodic_usecs (struct ehci_hcd *ehci, unsigned frame, unsigned uframe) { - u32 *hw_p = &ehci->periodic [frame]; + __le32 *hw_p = &ehci->periodic [frame]; union ehci_shadow *q = &ehci->pshadow [frame]; unsigned usecs = 0; @@ -196,7 +196,7 @@ */ for (; frame < ehci->periodic_size; frame += period) { union ehci_shadow here; - u32 type; + __le32 type; here = ehci->pshadow [frame]; type = Q_NEXT_TYPE (ehci->periodic [frame]); @@ -403,7 +403,7 @@ unsigned frame, unsigned uframe, const struct ehci_qh *qh, - u32 *c_maskp + __le32 *c_maskp ) { int retval = -ENOSPC; @@ -412,7 +412,7 @@ goto done; if (!qh->c_usecs) { retval = 0; - *c_maskp = cpu_to_le32 (0); + *c_maskp = 0; goto done; } @@ -447,7 +447,7 @@ { int status; unsigned uframe; - u32 c_mask; + __le32 c_mask; unsigned frame; /* 0..(qh->period - 1), or NO_FRAME */ qh->hw_next = EHCI_LIST_END; @@ -1008,8 +1008,7 @@ uframe += period_uframes; } while (uframe < mod); - stream->splits = stream->raw_mask << (uframe & 7); - cpu_to_le32s (&stream->splits); + stream->splits = cpu_to_le32(stream->raw_mask << (uframe & 7)); return 1; } @@ -1812,7 +1811,7 @@ for (;;) { union ehci_shadow q, *q_p; - u32 type, *hw_p; + __le32 type, *hw_p; unsigned uframes; /* don't scan past the live uframe */ diff -Nru a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h --- a/drivers/usb/host/ehci.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/ehci.h 2004-10-06 19:37:47 -07:00 @@ -57,7 +57,7 @@ /* periodic schedule support */ #define DEFAULT_I_TDPS 1024 /* some HCs can do less */ unsigned periodic_size; - u32 *periodic; /* hw periodic table */ + __le32 *periodic; /* hw periodic table */ dma_addr_t periodic_dma; unsigned i_thresh; /* uframes HC might cache */ @@ -72,7 +72,7 @@ struct usb_hcd hcd; struct ehci_caps __iomem *caps; struct ehci_regs __iomem *regs; - u32 hcs_params; /* cached register copy */ + __u32 hcs_params; /* cached register copy */ /* per-HC memory pools (could be per-bus, but ...) */ struct dma_pool *qh_pool; /* qh per active urb */ @@ -272,9 +272,9 @@ */ struct ehci_qtd { /* first part defined by EHCI spec */ - u32 hw_next; /* see EHCI 3.5.1 */ - u32 hw_alt_next; /* see EHCI 3.5.2 */ - u32 hw_token; /* see EHCI 3.5.3 */ + __le32 hw_next; /* see EHCI 3.5.1 */ + __le32 hw_alt_next; /* see EHCI 3.5.2 */ + __le32 hw_token; /* see EHCI 3.5.3 */ #define QTD_TOGGLE (1 << 31) /* data toggle */ #define QTD_LENGTH(tok) (((tok)>>16) & 0x7fff) #define QTD_IOC (1 << 15) /* interrupt on complete */ @@ -288,8 +288,8 @@ #define QTD_STS_MMF (1 << 2) /* incomplete split transaction */ #define QTD_STS_STS (1 << 1) /* split transaction state */ #define QTD_STS_PING (1 << 0) /* issue PING? */ - u32 hw_buf [5]; /* see EHCI 3.5.4 */ - u32 hw_buf_hi [5]; /* Appendix B */ + __le32 hw_buf [5]; /* see EHCI 3.5.4 */ + __le32 hw_buf_hi [5]; /* Appendix B */ /* the rest is HCD-private */ dma_addr_t qtd_dma; /* qtd address */ @@ -349,18 +349,18 @@ struct ehci_qh { /* first part defined by EHCI spec */ - u32 hw_next; /* see EHCI 3.6.1 */ - u32 hw_info1; /* see EHCI 3.6.2 */ + __le32 hw_next; /* see EHCI 3.6.1 */ + __le32 hw_info1; /* see EHCI 3.6.2 */ #define QH_HEAD 0x00008000 - u32 hw_info2; /* see EHCI 3.6.2 */ - u32 hw_current; /* qtd list - see EHCI 3.6.4 */ + __le32 hw_info2; /* see EHCI 3.6.2 */ + __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ /* qtd overlay (hardware parts of a struct ehci_qtd) */ - u32 hw_qtd_next; - u32 hw_alt_next; - u32 hw_token; - u32 hw_buf [5]; - u32 hw_buf_hi [5]; + __le32 hw_qtd_next; + __le32 hw_alt_next; + __le32 hw_token; + __le32 hw_buf [5]; + __le32 hw_buf_hi [5]; /* the rest is HCD-private */ dma_addr_t qh_dma; /* address of qh */ @@ -396,7 +396,7 @@ struct ehci_iso_packet { /* These will be copied to iTD when scheduling */ u64 bufp; /* itd->hw_bufp{,_hi}[pg] |= */ - u32 transaction; /* itd->hw_transaction[i] |= */ + __le32 transaction; /* itd->hw_transaction[i] |= */ u8 cross; /* buf crosses pages */ /* for full speed OUT splits */ u16 buf1; @@ -418,8 +418,8 @@ */ struct ehci_iso_stream { /* first two fields match QH, but info1 == 0 */ - u32 hw_next; - u32 hw_info1; + __le32 hw_next; + __le32 hw_info1; u32 refcount; u8 bEndpointAddress; @@ -433,7 +433,7 @@ unsigned long start; /* jiffies */ unsigned long rescheduled; int next_uframe; - u32 splits; + __le32 splits; /* the rest is derived from the endpoint descriptor, * trusting urb->interval == f(epdesc->bInterval) and @@ -446,12 +446,12 @@ unsigned bandwidth; /* This is used to initialize iTD's hw_bufp fields */ - u32 buf0; - u32 buf1; - u32 buf2; + __le32 buf0; + __le32 buf1; + __le32 buf2; /* this is used to initialize sITD's tt info */ - u32 address; + __le32 address; }; /*-------------------------------------------------------------------------*/ @@ -464,8 +464,8 @@ */ struct ehci_itd { /* first part defined by EHCI spec */ - u32 hw_next; /* see EHCI 3.3.1 */ - u32 hw_transaction [8]; /* see EHCI 3.3.2 */ + __le32 hw_next; /* see EHCI 3.3.1 */ + __le32 hw_transaction [8]; /* see EHCI 3.3.2 */ #define EHCI_ISOC_ACTIVE (1<<31) /* activate transfer this slot */ #define EHCI_ISOC_BUF_ERR (1<<30) /* Data buffer error */ #define EHCI_ISOC_BABBLE (1<<29) /* babble detected */ @@ -475,8 +475,8 @@ #define ITD_ACTIVE __constant_cpu_to_le32(EHCI_ISOC_ACTIVE) - u32 hw_bufp [7]; /* see EHCI 3.3.3 */ - u32 hw_bufp_hi [7]; /* Appendix B */ + __le32 hw_bufp [7]; /* see EHCI 3.3.3 */ + __le32 hw_bufp_hi [7]; /* Appendix B */ /* the rest is HCD-private */ dma_addr_t itd_dma; /* for this itd */ @@ -503,11 +503,11 @@ */ struct ehci_sitd { /* first part defined by EHCI spec */ - u32 hw_next; + __le32 hw_next; /* uses bit field macros above - see EHCI 0.95 Table 3-8 */ - u32 hw_fullspeed_ep; /* EHCI table 3-9 */ - u32 hw_uframe; /* EHCI table 3-10 */ - u32 hw_results; /* EHCI table 3-11 */ + __le32 hw_fullspeed_ep; /* EHCI table 3-9 */ + __le32 hw_uframe; /* EHCI table 3-10 */ + __le32 hw_results; /* EHCI table 3-11 */ #define SITD_IOC (1 << 31) /* interrupt on completion */ #define SITD_PAGE (1 << 30) /* buffer 0/1 */ #define SITD_LENGTH(x) (0x3ff & ((x)>>16)) @@ -521,9 +521,9 @@ #define SITD_ACTIVE __constant_cpu_to_le32(SITD_STS_ACTIVE) - u32 hw_buf [2]; /* EHCI table 3-12 */ - u32 hw_backpointer; /* EHCI table 3-13 */ - u32 hw_buf_hi [2]; /* Appendix B */ + __le32 hw_buf [2]; /* EHCI table 3-12 */ + __le32 hw_backpointer; /* EHCI table 3-13 */ + __le32 hw_buf_hi [2]; /* Appendix B */ /* the rest is HCD-private */ dma_addr_t sitd_dma; @@ -548,8 +548,8 @@ * it hits a "restore" FSTN; then it returns to finish other uframe 0/1 work. */ struct ehci_fstn { - u32 hw_next; /* any periodic q entry */ - u32 hw_prev; /* qh or EHCI_LIST_END */ + __le32 hw_next; /* any periodic q entry */ + __le32 hw_prev; /* qh or EHCI_LIST_END */ /* the rest is HCD-private */ dma_addr_t fstn_dma; diff -Nru a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c --- a/drivers/usb/host/ohci-dbg.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/ohci-dbg.c 2004-10-06 19:37:47 -07:00 @@ -336,7 +336,7 @@ ohci_dump_ed (const struct ohci_hcd *ohci, const char *label, const struct ed *ed, int verbose) { - u32 tmp = ed->hwINFO; + __le32 tmp = ed->hwINFO; char *type = ""; ohci_dbg (ohci, "%s, ed %p state 0x%x type %s; next ed %08x\n", @@ -359,7 +359,7 @@ type, 0x007f & le32_to_cpu (tmp)); ohci_dbg (ohci, " tds: head %08x %s%s tail %08x%s\n", - tmp = le32_to_cpup (&ed->hwHeadP), + le32_to_cpup (&ed->hwHeadP), (ed->hwHeadP & ED_C) ? data1 : data0, (ed->hwHeadP & ED_H) ? " HALT" : "", le32_to_cpup (&ed->hwTailP), @@ -415,8 +415,8 @@ /* dump a snapshot of the bulk or control schedule */ while (ed) { - u32 info = ed->hwINFO; - u32 scratch = cpu_to_le32p (&ed->hwINFO); + __le32 info = ed->hwINFO; + u32 scratch = le32_to_cpup (&ed->hwINFO); struct list_head *entry; struct td *td; @@ -439,7 +439,7 @@ u32 cbp, be; td = list_entry (entry, struct td, td_list); - scratch = cpu_to_le32p (&td->hwINFO); + scratch = le32_to_cpup (&td->hwINFO); cbp = le32_to_cpup (&td->hwCBP); be = le32_to_cpup (&td->hwBE); temp = scnprintf (buf, size, @@ -541,8 +541,8 @@ /* show more info the first time around */ if (temp == seen_count) { - u32 info = ed->hwINFO; - u32 scratch = cpu_to_le32p (&ed->hwINFO); + __le32 info = ed->hwINFO; + u32 scratch = le32_to_cpup (&ed->hwINFO); struct list_head *entry; unsigned qlen = 0; diff -Nru a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c --- a/drivers/usb/host/ohci-hub.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/host/ohci-hub.c 2004-10-06 19:37:46 -07:00 @@ -586,14 +586,14 @@ break; case GetHubStatus: temp = roothub_status (ohci) & ~(RH_HS_CRWE | RH_HS_DRWE); - *(u32 *) buf = cpu_to_le32 (temp); + *(__le32 *) buf = cpu_to_le32 (temp); break; case GetPortStatus: if (!wIndex || wIndex > ports) goto error; wIndex--; temp = roothub_portstatus (ohci, wIndex); - *(u32 *) buf = cpu_to_le32 (temp); + *(__le32 *) buf = cpu_to_le32 (temp); #ifndef OHCI_VERBOSE_DEBUG if (*(u16*)(buf+2)) /* only if wPortChange is interesting */ diff -Nru a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c --- a/drivers/usb/host/ohci-q.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/ohci-q.c 2004-10-06 19:37:47 -07:00 @@ -136,7 +136,7 @@ for (i = ed->branch; i < NUM_INTS; i += ed->interval) { struct ed **prev = &ohci->periodic [i]; - u32 *prev_p = &ohci->hcca->int_table [i]; + __le32 *prev_p = &ohci->hcca->int_table [i]; struct ed *here = *prev; /* sorting each branch by period (slow before fast) @@ -156,7 +156,7 @@ ed->hwNextED = *prev_p; wmb (); *prev = ed; - *prev_p = cpu_to_le32p (&ed->dma); + *prev_p = cpu_to_le32(ed->dma); wmb(); } ohci->load [i] += ed->load; @@ -257,7 +257,7 @@ for (i = ed->branch; i < NUM_INTS; i += ed->interval) { struct ed *temp; struct ed **prev = &ohci->periodic [i]; - u32 *prev_p = &ohci->hcca->int_table [i]; + __le32 *prev_p = &ohci->hcca->int_table [i]; while (*prev && (temp = *prev) != ed) { prev_p = &temp->hwNextED; @@ -427,20 +427,21 @@ */ if (ed->state == ED_IDLE) { u32 info; + __le32 hw_info; info = usb_pipedevice (pipe); info |= (ep >> 1) << 7; info |= usb_maxpacket (udev, pipe, is_out) << 16; - info = cpu_to_le32 (info); + hw_info = cpu_to_le32 (info); if (udev->speed == USB_SPEED_LOW) - info |= ED_LOWSPEED; + hw_info |= ED_LOWSPEED; /* only control transfers store pids in tds */ if (type != PIPE_CONTROL) { - info |= is_out ? ED_OUT : ED_IN; + hw_info |= is_out ? ED_OUT : ED_IN; if (type != PIPE_BULK) { /* periodic transfers... */ if (type == PIPE_ISOCHRONOUS) - info |= ED_ISO; + hw_info |= ED_ISO; else if (interval > 32) /* iso can be bigger */ interval = 32; ed->interval = interval; @@ -451,7 +452,7 @@ / 1000; } } - ed->hwINFO = info; + ed->hwINFO = hw_info; } done: @@ -789,7 +790,7 @@ struct urb *urb = td->urb; struct ed *ed = td->ed; struct list_head *tmp = td->td_list.next; - u32 toggle = ed->hwHeadP & ED_C; + __le32 toggle = ed->hwHeadP & ED_C; /* clear ed halt; this is the td that caused it, but keep it inactive * until its urb->complete() has a chance to clean up. @@ -804,7 +805,7 @@ */ while (tmp != &ed->td_list) { struct td *next; - u32 info; + __le32 info; next = list_entry (tmp, struct td, td_list); tmp = next->td_list.next; @@ -910,7 +911,7 @@ for (last = &ohci->ed_rm_list, ed = *last; ed != NULL; ed = *last) { struct list_head *entry, *tmp; int completed, modified; - u32 *prev; + __le32 *prev; /* only take off EDs that the HC isn't using, accounting for * frame counter wraps and EDs with partially retired TDs @@ -928,7 +929,7 @@ td = list_entry (ed->td_list.next, struct td, td_list); - head = cpu_to_le32 (ed->hwHeadP) & TD_MASK; + head = le32_to_cpu (ed->hwHeadP) & TD_MASK; /* INTR_WDH may need to clean up first */ if (td->td_dma != head) @@ -959,7 +960,7 @@ struct td *td; struct urb *urb; urb_priv_t *urb_priv; - u32 savebits; + __le32 savebits; td = list_entry (entry, struct td, td_list); urb = td->urb; diff -Nru a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h --- a/drivers/usb/host/ohci.h 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/host/ohci.h 2004-10-06 19:37:48 -07:00 @@ -16,7 +16,7 @@ */ struct ed { /* first fields are hardware-specified, le32 */ - __u32 hwINFO; /* endpoint config bitmap */ + __le32 hwINFO; /* endpoint config bitmap */ /* info bits defined by hcd */ #define ED_DEQUEUE __constant_cpu_to_le32(1 << 27) /* info bits defined by the hardware */ @@ -25,11 +25,11 @@ #define ED_LOWSPEED __constant_cpu_to_le32(1 << 13) #define ED_OUT __constant_cpu_to_le32(0x01 << 11) #define ED_IN __constant_cpu_to_le32(0x02 << 11) - __u32 hwTailP; /* tail of TD list */ - __u32 hwHeadP; /* head of TD list (hc r/w) */ + __le32 hwTailP; /* tail of TD list */ + __le32 hwHeadP; /* head of TD list (hc r/w) */ #define ED_C __constant_cpu_to_le32(0x02) /* toggle carry */ #define ED_H __constant_cpu_to_le32(0x01) /* halted */ - __u32 hwNextED; /* next ED in list */ + __le32 hwNextED; /* next ED in list */ /* rest are purely for the driver's use */ dma_addr_t dma; /* addr of ED */ @@ -71,7 +71,7 @@ */ struct td { /* first fields are hardware-specified, le32 */ - __u32 hwINFO; /* transfer info bitmask */ + __le32 hwINFO; /* transfer info bitmask */ /* hwINFO bits for both general and iso tds: */ #define TD_CC 0xf0000000 /* condition code */ @@ -100,13 +100,13 @@ /* (no hwINFO #defines yet for iso tds) */ - __u32 hwCBP; /* Current Buffer Pointer (or 0) */ - __u32 hwNextTD; /* Next TD Pointer */ - __u32 hwBE; /* Memory Buffer End Pointer */ + __le32 hwCBP; /* Current Buffer Pointer (or 0) */ + __le32 hwNextTD; /* Next TD Pointer */ + __le32 hwBE; /* Memory Buffer End Pointer */ /* PSW is only for ISO */ #define MAXPSW 1 /* hardware allows 8 */ - __u16 hwPSW [MAXPSW]; + __le16 hwPSW [MAXPSW]; /* rest are purely for the driver's use */ __u8 index; @@ -171,16 +171,16 @@ */ struct ohci_hcca { #define NUM_INTS 32 - __u32 int_table [NUM_INTS]; /* periodic schedule */ + __le32 int_table [NUM_INTS]; /* periodic schedule */ /* * OHCI defines u16 frame_no, followed by u16 zero pad. * Since some processors can't do 16 bit bus accesses, * portable access must be a 32 bit byteswapped access. */ - u32 frame_no; /* current frame number */ + __le32 frame_no; /* current frame number */ #define OHCI_FRAME_NO(hccap) ((u16)le32_to_cpup(&(hccap)->frame_no)) - __u32 done_head; /* info returned for an interrupt */ + __le32 done_head; /* info returned for an interrupt */ u8 reserved_for_hc [116]; u8 what [4]; /* spec only identifies 252 bytes :) */ } __attribute__ ((aligned(256))); diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c --- a/drivers/usb/host/uhci-hcd.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/uhci-hcd.c 2004-10-06 19:37:47 -07:00 @@ -232,7 +232,7 @@ /* * Inserts a td into qh list at the top. */ -static void uhci_insert_tds_in_qh(struct uhci_qh *qh, struct urb *urb, u32 breadth) +static void uhci_insert_tds_in_qh(struct uhci_qh *qh, struct urb *urb, __le32 breadth) { struct list_head *tmp, *head; struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv; @@ -376,7 +376,7 @@ static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) { struct uhci_qh *pqh; - u32 newlink; + __le32 newlink; unsigned int age; if (!qh) diff -Nru a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h --- a/drivers/usb/host/uhci-hcd.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/host/uhci-hcd.h 2004-10-06 19:37:47 -07:00 @@ -80,7 +80,7 @@ #define CAN_SCHEDULE_FRAMES 1000 /* how far future frames can be scheduled */ struct uhci_frame_list { - u32 frame[UHCI_NUMFRAMES]; + __le32 frame[UHCI_NUMFRAMES]; void *frame_cpu[UHCI_NUMFRAMES]; @@ -105,8 +105,8 @@ */ struct uhci_qh { /* Hardware fields */ - u32 link; /* Next queue */ - u32 element; /* Queue element pointer */ + __le32 link; /* Next queue */ + __le32 element; /* Queue element pointer */ /* Software fields */ dma_addr_t dma_handle; @@ -185,10 +185,10 @@ */ struct uhci_td { /* Hardware fields */ - u32 link; - u32 status; - u32 token; - u32 buffer; + __le32 link; + __le32 status; + __le32 token; + __le32 buffer; /* Software fields */ dma_addr_t dma_handle; diff -Nru a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c --- a/drivers/usb/host/uhci-hub.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/host/uhci-hub.c 2004-10-06 19:37:46 -07:00 @@ -82,7 +82,7 @@ */ case GetHubStatus: - *(__u32 *)buf = cpu_to_le32(0); + *(__le32 *)buf = cpu_to_le32(0); OK(4); /* hub power */ case GetPortStatus: if (!wIndex || wIndex > uhci->rh_numports) @@ -126,8 +126,8 @@ dev_dbg(uhci_dev(uhci), "port %d portsc %04x\n", wIndex, status); - *(__u16 *)buf = cpu_to_le16(wPortStatus); - *(__u16 *)(buf + 2) = cpu_to_le16(wPortChange); + *(__le16 *)buf = cpu_to_le16(wPortStatus); + *(__le16 *)(buf + 2) = cpu_to_le16(wPortChange); OK(4); case SetHubFeature: /* We don't implement these */ case ClearHubFeature: diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c --- a/drivers/usb/input/aiptek.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/input/aiptek.c 2004-10-06 19:37:47 -07:00 @@ -494,9 +494,9 @@ } else { input_regs(inputdev, regs); - x = le16_to_cpu(get_unaligned((__u16 *) (data + 1))); - y = le16_to_cpu(get_unaligned((__u16 *) (data + 3))); - z = le16_to_cpu(get_unaligned((__u16 *) (data + 6))); + x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); + y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); + z = le16_to_cpu(get_unaligned((__le16 *) (data + 6))); p = (data[5] & 0x01) != 0 ? 1 : 0; dv = (data[5] & 0x02) != 0 ? 1 : 0; @@ -573,8 +573,8 @@ aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; } else { input_regs(inputdev, regs); - x = le16_to_cpu(get_unaligned((__u16 *) (data + 1))); - y = le16_to_cpu(get_unaligned((__u16 *) (data + 3))); + x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); + y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); jitterable = data[5] & 0x1c; @@ -632,7 +632,7 @@ pck = (data[1] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0; macro = data[3]; - z = le16_to_cpu(get_unaligned((__u16 *) (data + 4))); + z = le16_to_cpu(get_unaligned((__le16 *) (data + 4))); if (dv != 0) { input_regs(inputdev, regs); @@ -729,7 +729,7 @@ * hat switches (which just so happen to be the macroKeys.) */ else if (data[0] == 6) { - macro = le16_to_cpu(get_unaligned((__u16 *) (data + 1))); + macro = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); input_regs(inputdev, regs); if (macro > 0) { @@ -930,7 +930,7 @@ buf[0], buf[1], buf[2]); ret = -EIO; } else { - ret = le16_to_cpu(get_unaligned((__u16 *) (buf + 1))); + ret = le16_to_cpu(get_unaligned((__le16 *) (buf + 1))); } kfree(buf); return ret; diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c --- a/drivers/usb/input/hid-core.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/input/hid-core.c 2004-10-06 19:37:47 -07:00 @@ -605,16 +605,16 @@ case 2: if ((end - start) < 2) return NULL; - item->data.u16 = le16_to_cpu(get_unaligned((__u16*)start)); - start = (__u8 *)((__u16 *)start + 1); + item->data.u16 = le16_to_cpu(get_unaligned((__le16*)start)); + start = (__u8 *)((__le16 *)start + 1); return start; case 3: item->size++; if ((end - start) < 4) return NULL; - item->data.u32 = le32_to_cpu(get_unaligned((__u32*)start)); - start = (__u8 *)((__u32 *)start + 1); + item->data.u32 = le32_to_cpu(get_unaligned((__le32*)start)); + start = (__u8 *)((__le32 *)start + 1); return start; } @@ -756,15 +756,15 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) { report += (offset >> 5) << 2; offset &= 31; - return (le64_to_cpu(get_unaligned((__u64*)report)) >> offset) & ((1 << n) - 1); + return (le64_to_cpu(get_unaligned((__le64*)report)) >> offset) & ((1 << n) - 1); } static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) { report += (offset >> 5) << 2; offset &= 31; - put_unaligned((get_unaligned((__u64*)report) + put_unaligned((get_unaligned((__le64*)report) & cpu_to_le64(~((((__u64) 1 << n) - 1) << offset))) - | cpu_to_le64((__u64)value << offset), (__u64*)report); + | cpu_to_le64((__u64)value << offset), (__le64*)report); } /* diff -Nru a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c --- a/drivers/usb/input/kbtab.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/input/kbtab.c 2004-10-06 19:37:46 -07:00 @@ -66,8 +66,8 @@ goto exit; } - kbtab->x = le16_to_cpu(get_unaligned((u16 *) &data[1])); - kbtab->y = le16_to_cpu(get_unaligned((u16 *) &data[3])); + kbtab->x = le16_to_cpu(get_unaligned((__le16 *) &data[1])); + kbtab->y = le16_to_cpu(get_unaligned((__le16 *) &data[3])); kbtab->pressure = (data[5]); diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c --- a/drivers/usb/input/wacom.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/input/wacom.c 2004-10-06 19:37:46 -07:00 @@ -285,8 +285,8 @@ input_regs(dev, regs); input_report_key(dev, BTN_TOOL_PEN, 1); - input_report_abs(dev, ABS_X, le16_to_cpu(get_unaligned((u16 *) &data[1]))); - input_report_abs(dev, ABS_Y, le16_to_cpu(get_unaligned((u16 *) &data[3]))); + input_report_abs(dev, ABS_X, le16_to_cpu(get_unaligned((__le16 *) &data[1]))); + input_report_abs(dev, ABS_Y, le16_to_cpu(get_unaligned((__le16 *) &data[3]))); input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); input_report_key(dev, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20)); input_report_key(dev, BTN_STYLUS, (data[5] & 0x40)); @@ -329,8 +329,8 @@ if (data[0] != 2) dbg("wacom_graphire_irq: received unknown report #%d", data[0]); - x = le16_to_cpu(*(u16 *) &data[2]); - y = le16_to_cpu(*(u16 *) &data[4]); + x = le16_to_cpu(*(__le16 *) &data[2]); + y = le16_to_cpu(*(__le16 *) &data[4]); input_regs(dev, regs); @@ -367,7 +367,7 @@ input_report_abs(dev, ABS_Y, y); } - input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(u16 *) &data[6])); + input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); input_report_key(dev, BTN_TOUCH, data[1] & 0x01); input_report_key(dev, BTN_STYLUS, data[1] & 0x02); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); @@ -456,8 +456,8 @@ goto exit; } - input_report_abs(dev, ABS_X, be16_to_cpu(*(u16 *) &data[2])); - input_report_abs(dev, ABS_Y, be16_to_cpu(*(u16 *) &data[4])); + input_report_abs(dev, ABS_X, be16_to_cpu(*(__be16 *) &data[2])); + input_report_abs(dev, ABS_Y, be16_to_cpu(*(__be16 *) &data[4])); input_report_abs(dev, ABS_DISTANCE, data[9]); if ((data[1] & 0xb8) == 0xa0) { /* general pen packet */ diff -Nru a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c --- a/drivers/usb/media/ov511.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/media/ov511.c 2004-10-06 19:37:47 -07:00 @@ -473,7 +473,7 @@ down(&ov->cbuf_lock); - *((u32 *)ov->cbuf) = __cpu_to_le32(val); + *((__le32 *)ov->cbuf) = __cpu_to_le32(val); rc = usb_control_msg(ov->dev, usb_sndctrlpipe(ov->dev, 0), diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c --- a/drivers/usb/misc/auerswald.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/misc/auerswald.c 2004-10-06 19:37:47 -07:00 @@ -1931,7 +1931,7 @@ struct usb_device *usbdev = interface_to_usbdev(intf); pauerswald_t cp = NULL; unsigned int u = 0; - u16 *pbuf; + __le16 *pbuf; int ret; dbg ("probe: vendor id 0x%x, device id 0x%x", @@ -2003,7 +2003,7 @@ info("device is a %s", cp->dev_desc); /* get the maximum allowed control transfer length */ - pbuf = (u16 *) kmalloc (2, GFP_KERNEL); /* use an allocated buffer because of urb target */ + pbuf = (__le16 *) kmalloc (2, GFP_KERNEL); /* use an allocated buffer because of urb target */ if (!pbuf) { err( "out of memory"); goto pfail; diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c --- a/drivers/usb/misc/legousbtower.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/misc/legousbtower.c 2004-10-06 19:37:47 -07:00 @@ -177,18 +177,18 @@ #define LEGO_USB_TOWER_REQUEST_GET_VERSION 0xFD struct tower_reset_reply { - __u16 size; /* little-endian */ + __le16 size; /* little-endian */ __u8 err_code; __u8 spare; } __attribute__ ((packed)); struct tower_get_version_reply { - __u16 size; /* little-endian */ + __le16 size; /* little-endian */ __u8 err_code; __u8 spare; __u8 major; __u8 minor; - __u16 build_no; /* little-endian */ + __le16 build_no; /* little-endian */ } __attribute__ ((packed)); diff -Nru a/drivers/usb/net/catc.c b/drivers/usb/net/catc.c --- a/drivers/usb/net/catc.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/net/catc.c 2004-10-06 19:37:47 -07:00 @@ -242,7 +242,7 @@ do { if(!catc->is_f5u011) { - pkt_len = le16_to_cpup((u16*)pkt_start); + pkt_len = le16_to_cpup((__le16*)pkt_start); if (pkt_len > urb->actual_length) { catc->stats.rx_length_errors++; catc->stats.rx_errors++; @@ -303,7 +303,7 @@ else if (data[1] & 0x20) linksts = LinkBad; } else { - hasdata = (unsigned int)(be16_to_cpup((u16*)data) & 0x0fff); + hasdata = (unsigned int)(be16_to_cpup((__be16*)data) & 0x0fff); if (data[0] == 0x90) linksts = LinkGood; else if (data[0] == 0xA0) diff -Nru a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c --- a/drivers/usb/net/kaweth.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/net/kaweth.c 2004-10-06 19:37:47 -07:00 @@ -203,7 +203,7 @@ __u8 reserved2; eth_addr_t hw_addr; __u32 statistics_mask; - __u16 segment_size; + __le16 segment_size; __u16 max_multicast_filters; __u8 reserved3; } __attribute__ ((packed)); @@ -588,7 +588,7 @@ int count = urb->actual_length; int count2 = urb->transfer_buffer_length; - __u16 pkt_len = le16_to_cpup((u16 *)kaweth->rx_buf); + __u16 pkt_len = le16_to_cpup((__le16 *)kaweth->rx_buf); struct sk_buff *skb; @@ -763,7 +763,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net) { struct kaweth_device *kaweth = net->priv; - u16 *private_header; + __le16 *private_header; int res; @@ -794,7 +794,7 @@ } } - private_header = (u16 *)__skb_push(skb, 2); + private_header = (__le16 *)__skb_push(skb, 2); *private_header = cpu_to_le16(skb->len-2); kaweth->tx_skb = skb; diff -Nru a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c --- a/drivers/usb/net/pegasus.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/net/pegasus.c 2004-10-06 19:37:48 -07:00 @@ -286,7 +286,7 @@ { int i; __u8 data[4] = { phy, 0, 0, indx }; - __u16 regdi; + __le16 regdi; set_register(pegasus, PhyCtrl, 0); set_registers(pegasus, PhyAddr, sizeof (data), data); @@ -347,7 +347,7 @@ { int i; __u8 tmp; - __u16 retdatai; + __le16 retdatai; set_register(pegasus, EpromCtrl, 0); set_register(pegasus, EpromOffset, index); @@ -417,7 +417,7 @@ for (i = 0; i < 3; i++) { read_eprom_word(pegasus, i, &w16); - ((__u16 *) id)[i] = cpu_to_le16p(&w16); + ((__le16 *) id)[i] = cpu_to_le16p(&w16); } } @@ -581,7 +581,7 @@ if (!count) goto goon; - rx_status = le32_to_cpu(*(int *) (urb->transfer_buffer + count - 4)); + rx_status = le32_to_cpu(*(__le32 *) (urb->transfer_buffer + count - 4)); if (rx_status & 0x000e0000) { dbg("%s: RX packet error %x", net->name, rx_status & 0xe0000); pegasus->stats.rx_errors++; @@ -594,7 +594,7 @@ goto goon; } if (pegasus->chip == 0x8513) { - pkt_len = le32_to_cpu(*(int *)urb->transfer_buffer); + pkt_len = le32_to_cpu(*(__le32 *)urb->transfer_buffer); pkt_len &= 0x0fff; pegasus->rx_skb->data += 2; } else { @@ -774,7 +774,7 @@ netif_stop_queue(net); - ((__u16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16); + ((__le16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16); memcpy(pegasus->tx_buff + 2, skb->data, skb->len); usb_fill_bulk_urb(pegasus->tx_urb, pegasus->usb, usb_sndbulkpipe(pegasus->usb, 2), diff -Nru a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c --- a/drivers/usb/net/rtl8150.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/net/rtl8150.c 2004-10-06 19:37:47 -07:00 @@ -160,7 +160,7 @@ spinlock_t rx_pool_lock; struct usb_ctrlrequest dr; int intr_interval; - u16 rx_creg; + __le16 rx_creg; u8 *intr_buff; u8 phy; }; @@ -450,7 +450,7 @@ goto goon; res = urb->actual_length; - rx_stat = le16_to_cpu(*(short *)(urb->transfer_buffer + res - 4)); + rx_stat = le16_to_cpu(*(__le16 *)(urb->transfer_buffer + res - 4)); pkt_len = res - 4; skb_put(dev->rx_skb, pkt_len); diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c --- a/drivers/usb/net/usbnet.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/net/usbnet.c 2004-10-06 19:37:47 -07:00 @@ -937,8 +937,8 @@ u8 iMACAddress; u32 bmEthernetStatistics; - u16 wMaxSegmentSize; - u16 wNumberMCFilters; + __le16 wMaxSegmentSize; + __le16 wNumberMCFilters; u8 bNumberPowerFilters; } __attribute__ ((packed)); @@ -1074,7 +1074,7 @@ info->u->bLength); goto bad_desc; } - dev->net->mtu = cpu_to_le16p ( + dev->net->mtu = le16_to_cpup ( &info->ether->wMaxSegmentSize) - ETH_HLEN; /* because of Zaurus, we may be ignoring the host diff -Nru a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c --- a/drivers/usb/serial/empeg.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/serial/empeg.c 2004-10-06 19:37:48 -07:00 @@ -516,13 +516,7 @@ */ port->tty->low_latency = 1; - /* Notify the tty driver that the termios have changed. - FIXME: Why - the ldisc will do this anyway and NULL is not - a valid previous state */ - port->tty->ldisc.set_termios(port->tty, NULL); - return; - } diff -Nru a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c --- a/drivers/usb/serial/io_edgeport.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/serial/io_edgeport.c 2004-10-06 19:37:46 -07:00 @@ -479,7 +479,7 @@ static void load_application_firmware (struct edgeport_serial *edge_serial); -static void unicode_to_ascii (char *string, short *unicode, int unicode_size); +static void unicode_to_ascii (char *string, __le16 *unicode, int unicode_size); @@ -504,7 +504,7 @@ __u32 BootNewVer; __u8 BootMajorVersion; __u8 BootMinorVersion; - __u16 BootBuildNumber; + __le16 BootBuildNumber; __u8 *BootImage; __u32 BootSize; struct edge_firmware_image_record *record; @@ -2742,7 +2742,7 @@ * ASCII range, but it's only for debugging... * NOTE: expects the unicode in LE format ****************************************************************************/ -static void unicode_to_ascii (char *string, short *unicode, int unicode_size) +static void unicode_to_ascii (char *string, __le16 *unicode, int unicode_size) { int i; for (i = 0; i < unicode_size; ++i) { diff -Nru a/drivers/usb/serial/io_edgeport.h b/drivers/usb/serial/io_edgeport.h --- a/drivers/usb/serial/io_edgeport.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/serial/io_edgeport.h 2004-10-06 19:37:47 -07:00 @@ -107,11 +107,11 @@ __u8 BootMajorVersion; /* Boot Firmware version: xx. */ __u8 BootMinorVersion; /* yy. */ - __u16 BootBuildNumber; /* zzzz (LE format) */ + __le16 BootBuildNumber; /* zzzz (LE format) */ __u8 FirmwareMajorVersion; /* Operational Firmware version:xx. */ __u8 FirmwareMinorVersion; /* yy. */ - __u16 FirmwareBuildNumber; /* zzzz (LE format) */ + __le16 FirmwareBuildNumber; /* zzzz (LE format) */ __u8 ManufactureDescDate[3]; /* MM/DD/YY when descriptor template was compiled */ __u8 Unused1[1]; /* Available */ diff -Nru a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c --- a/drivers/usb/serial/io_ti.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/serial/io_ti.c 2004-10-06 19:37:48 -07:00 @@ -270,7 +270,7 @@ { int status = 0; __u8 read_length; - __u16 be_start_address; + __be16 be_start_address; dbg ("%s - @ %x for %d", __FUNCTION__, start_address, length); @@ -387,7 +387,7 @@ { int status = 0; int write_length; - __u16 be_start_address; + __be16 be_start_address; /* We can only send a maximum of 1 aligned byte page at a time */ diff -Nru a/drivers/usb/serial/io_usbvend.h b/drivers/usb/serial/io_usbvend.h --- a/drivers/usb/serial/io_usbvend.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/serial/io_usbvend.h 2004-10-06 19:37:47 -07:00 @@ -347,7 +347,7 @@ // (Currently must be 0). __u8 MajorVersion; // Firmware version: xx. __u8 MinorVersion; // yy. - __u16 BuildNumber; // zzzz (LE format) + __le16 BuildNumber; // zzzz (LE format) // The following structure contains __u32s, with each bit // specifying whether the EPiC device supports the given @@ -443,19 +443,19 @@ __u8 SerNumLength; // F0C USB string descriptor len __u8 SerNumDescType; // F0D USB descriptor type (=STRING type) - __u16 SerialNumber[MAX_SERIALNUMBER_LEN]; // F0E "01-01-000100" Unicode Serial Number + __le16 SerialNumber[MAX_SERIALNUMBER_LEN]; // F0E "01-01-000100" Unicode Serial Number __u8 AssemblyNumLength; // F26 USB string descriptor len __u8 AssemblyNumDescType; // F27 USB descriptor type (=STRING type) - __u16 AssemblyNumber[MAX_ASSEMBLYNUMBER_LEN]; // F28 "350-1000-01-A " assembly number + __le16 AssemblyNumber[MAX_ASSEMBLYNUMBER_LEN]; // F28 "350-1000-01-A " assembly number __u8 OemAssyNumLength; // F44 USB string descriptor len __u8 OemAssyNumDescType; // F45 USB descriptor type (=STRING type) - __u16 OemAssyNumber[MAX_ASSEMBLYNUMBER_LEN]; // F46 "xxxxxxxxxxxxxx" OEM assembly number + __le16 OemAssyNumber[MAX_ASSEMBLYNUMBER_LEN]; // F46 "xxxxxxxxxxxxxx" OEM assembly number __u8 ManufDateLength; // F62 USB string descriptor len __u8 ManufDateDescType; // F63 USB descriptor type (=STRING type) - __u16 ManufDate[6]; // F64 "MMDDYY" manufacturing date + __le16 ManufDate[6]; // F64 "MMDDYY" manufacturing date __u8 Reserved3[0x4D]; // F70 -- unused, set to 0 -- @@ -532,19 +532,19 @@ __u8 DescVer; // C2 Desc version/format __u8 Reserved1; // C3 -- unused, set to 0 -- - __u16 BootCodeLength; // C4 Boot code goes from FF:0000 to FF:(len-1) + __le16 BootCodeLength; // C4 Boot code goes from FF:0000 to FF:(len-1) // (LE format) __u8 MajorVersion; // C6 Firmware version: xx. __u8 MinorVersion; // C7 yy. - __u16 BuildNumber; // C8 zzzz (LE format) + __le16 BuildNumber; // C8 zzzz (LE format) __u16 EnumRootDescTable; // CA Root of ROM-based descriptor table __u8 NumDescTypes; // CC Number of supported descriptor types __u8 Reserved4; // CD Fix Compiler Packing - __u16 Capabilities; // CE-CF Capabilities flags (LE format) + __le16 Capabilities; // CE-CF Capabilities flags (LE format) __u8 Reserved2[0x28]; // D0 -- unused, set to 0 -- __u8 UConfig0; // F8 930-defined CPU configuration byte 0 __u8 UConfig1; // F9 930-defined CPU configuration byte 1 diff -Nru a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c --- a/drivers/usb/storage/datafab.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/storage/datafab.c 2004-10-06 19:37:48 -07:00 @@ -486,7 +486,7 @@ if (sense_6) ptr[0] = i - 1; else - ((u16 *) ptr)[0] = cpu_to_be16(i - 2); + ((__be16 *) ptr)[0] = cpu_to_be16(i - 2); usb_stor_set_xfer_buf(ptr, i, srb); return USB_STOR_TRANSPORT_GOOD; @@ -543,8 +543,8 @@ // build the reply // we need the last sector, not the number of sectors - ((u32 *) ptr)[0] = cpu_to_be32(info->sectors - 1); - ((u32 *) ptr)[1] = cpu_to_be32(info->ssize); + ((__be32 *) ptr)[0] = cpu_to_be32(info->sectors - 1); + ((__be32 *) ptr)[1] = cpu_to_be32(info->ssize); usb_stor_set_xfer_buf(ptr, 8, srb); return USB_STOR_TRANSPORT_GOOD; diff -Nru a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c --- a/drivers/usb/storage/freecom.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/usb/storage/freecom.c 2004-10-06 19:37:48 -07:00 @@ -59,14 +59,14 @@ struct freecom_xfer_wrap { u8 Type; /* Command type. */ u8 Timeout; /* Timeout in seconds. */ - u32 Count; /* Number of bytes to transfer. */ + __le32 Count; /* Number of bytes to transfer. */ u8 Pad[58]; } __attribute__ ((packed)); struct freecom_ide_out { u8 Type; /* Type + IDE register. */ u8 Pad; - u16 Value; /* Value to write. */ + __le16 Value; /* Value to write. */ u8 Pad2[60]; }; @@ -78,7 +78,7 @@ struct freecom_status { u8 Status; u8 Reason; - u16 Count; + __le16 Count; u8 Pad[60]; }; diff -Nru a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c --- a/drivers/usb/storage/isd200.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/storage/isd200.c 2004-10-06 19:37:47 -07:00 @@ -295,8 +295,8 @@ */ struct read_capacity_data { - unsigned long LogicalBlockAddress; - unsigned long BytesPerBlock; + __be32 LogicalBlockAddress; + __be32 BytesPerBlock; }; /* @@ -1016,7 +1016,8 @@ } else { /* ATA Command Identify successful */ int i; - __u16 *src, *dest; + __be16 *src; + __u16 *dest; ide_fix_driveid(id); US_DEBUGP(" Identify Data Structure:\n"); @@ -1068,17 +1069,17 @@ } /* Fill in vendor identification fields */ - src = (__u16*)id->model; + src = (__be16*)id->model; dest = (__u16*)info->InquiryData.VendorId; for (i=0;i<4;i++) dest[i] = be16_to_cpu(src[i]); - src = (__u16*)(id->model+8); + src = (__be16*)(id->model+8); dest = (__u16*)info->InquiryData.ProductId; for (i=0;i<8;i++) dest[i] = be16_to_cpu(src[i]); - src = (__u16*)id->fw_rev; + src = (__be16*)id->fw_rev; dest = (__u16*)info->InquiryData.ProductRevisionLevel; for (i=0;i<2;i++) dest[i] = be16_to_cpu(src[i]); @@ -1221,8 +1222,7 @@ case READ_10: US_DEBUGP(" ATA OUT - SCSIOP_READ\n"); - lba = *(unsigned long *)&srb->cmnd[2]; - lba = cpu_to_be32(lba); + lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]); blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8]; if (id->capability & CAPABILITY_LBA) { @@ -1254,8 +1254,7 @@ case WRITE_10: US_DEBUGP(" ATA OUT - SCSIOP_WRITE\n"); - lba = *(unsigned long *)&srb->cmnd[2]; - lba = cpu_to_be32(lba); + lba = be32_to_cpu(*(__be32 *)&srb->cmnd[2]); blockCount = (unsigned long)srb->cmnd[7]<<8 | (unsigned long)srb->cmnd[8]; if (id->capability & CAPABILITY_LBA) { diff -Nru a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c --- a/drivers/usb/storage/jumpshot.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/storage/jumpshot.c 2004-10-06 19:37:46 -07:00 @@ -413,7 +413,7 @@ if (sense_6) ptr[0] = i - 1; else - ((u16 *) ptr)[0] = cpu_to_be16(i - 2); + ((__be16 *) ptr)[0] = cpu_to_be16(i - 2); usb_stor_set_xfer_buf(ptr, i, srb); return USB_STOR_TRANSPORT_GOOD; @@ -475,8 +475,8 @@ // build the reply // - ((u32 *) ptr)[0] = cpu_to_be32(info->sectors - 1); - ((u32 *) ptr)[1] = cpu_to_be32(info->ssize); + ((__be32 *) ptr)[0] = cpu_to_be32(info->sectors - 1); + ((__be32 *) ptr)[1] = cpu_to_be32(info->ssize); usb_stor_set_xfer_buf(ptr, 8, srb); return USB_STOR_TRANSPORT_GOOD; diff -Nru a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c --- a/drivers/usb/storage/protocol.c 2004-10-06 19:37:46 -07:00 +++ b/drivers/usb/storage/protocol.c 2004-10-06 19:37:46 -07:00 @@ -96,7 +96,7 @@ static void fix_read_capacity(struct scsi_cmnd *srb) { unsigned int index, offset; - u32 c; + __be32 c; unsigned long capacity; /* verify that it's a READ CAPACITY command */ diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c --- a/drivers/usb/storage/sddr09.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/storage/sddr09.c 2004-10-06 19:37:47 -07:00 @@ -1489,11 +1489,11 @@ capacity = (info->lbact << info->blockshift) - 1; - ((u32 *) ptr)[0] = cpu_to_be32(capacity); + ((__be32 *) ptr)[0] = cpu_to_be32(capacity); // Report page size - ((u32 *) ptr)[1] = cpu_to_be32(info->pagesize); + ((__be32 *) ptr)[1] = cpu_to_be32(info->pagesize); usb_stor_set_xfer_buf(ptr, 8, srb); return USB_STOR_TRANSPORT_GOOD; @@ -1510,7 +1510,7 @@ "mode page 0x%x\n", modepage); memcpy(ptr, mode_page_01, sizeof(mode_page_01)); - ((u16*)ptr)[0] = cpu_to_be16(sizeof(mode_page_01) - 2); + ((__be16*)ptr)[0] = cpu_to_be16(sizeof(mode_page_01) - 2); ptr[3] = (info->flags & SDDR09_WP) ? 0x80 : 0; usb_stor_set_xfer_buf(ptr, sizeof(mode_page_01), srb); return USB_STOR_TRANSPORT_GOOD; diff -Nru a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c --- a/drivers/usb/storage/sddr55.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/storage/sddr55.c 2004-10-06 19:37:47 -07:00 @@ -838,8 +838,8 @@ capacity /= PAGESIZE; capacity--; - ((u32 *) ptr)[0] = cpu_to_be32(capacity); - ((u32 *) ptr)[1] = cpu_to_be32(PAGESIZE); + ((__be32 *) ptr)[0] = cpu_to_be32(capacity); + ((__be32 *) ptr)[1] = cpu_to_be32(PAGESIZE); usb_stor_set_xfer_buf(ptr, 8, srb); sddr55_read_map(us); diff -Nru a/drivers/usb/storage/transport.h b/drivers/usb/storage/transport.h --- a/drivers/usb/storage/transport.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/usb/storage/transport.h 2004-10-06 19:37:47 -07:00 @@ -83,9 +83,9 @@ /* command block wrapper */ struct bulk_cb_wrap { - __u32 Signature; /* contains 'USBC' */ + __le32 Signature; /* contains 'USBC' */ __u32 Tag; /* unique per command id */ - __u32 DataTransferLength; /* size of data */ + __le32 DataTransferLength; /* size of data */ __u8 Flags; /* direction in bit 0 */ __u8 Lun; /* LUN normally 0 */ __u8 Length; /* of of the CDB */ @@ -99,9 +99,9 @@ /* command status wrapper */ struct bulk_cs_wrap { - __u32 Signature; /* should = 'USBS' */ + __le32 Signature; /* should = 'USBS' */ __u32 Tag; /* same as original command */ - __u32 Residue; /* amount not transferred */ + __le32 Residue; /* amount not transferred */ __u8 Status; /* see below */ __u8 Filler[18]; }; diff -Nru a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c --- a/drivers/video/amba-clcd.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/video/amba-clcd.c 2004-10-06 19:37:48 -07:00 @@ -207,7 +207,7 @@ clcdfb_set_start(fb); - clk_set_rate(fb->clk, 1000000000 / regs.pixclock); + clk_set_rate(fb->clk, (1000000000 / regs.pixclock) * 1000); fb->clcd_cntl = regs.cntl; diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c --- a/drivers/video/radeonfb.c 2004-10-06 19:37:48 -07:00 +++ b/drivers/video/radeonfb.c 2004-10-06 19:37:48 -07:00 @@ -360,13 +360,13 @@ unsigned long mmio_base_phys; unsigned long fb_base_phys; - unsigned long mmio_base; - unsigned long fb_base; + void __iomem *mmio_base; + void __iomem *fb_base; struct pci_dev *pdev; unsigned char *EDID; - unsigned char *bios_seg; + unsigned char __iomem *bios_seg; u32 pseudo_palette[17]; struct { u8 red, green, blue, pad; } palette[256]; @@ -702,8 +702,8 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo); static int __devinit radeon_init_disp (struct radeonfb_info *rinfo); static int radeon_init_disp_var (struct radeonfb_info *rinfo, struct fb_var_screeninfo *var); -static char *radeon_find_rom(struct radeonfb_info *rinfo); -static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg); +static void __iomem *radeon_find_rom(struct radeonfb_info *rinfo); +static void radeon_get_pllinfo(struct radeonfb_info *rinfo, void __iomem *bios_seg); static void radeon_get_moninfo (struct radeonfb_info *rinfo); static int radeon_get_dfpinfo (struct radeonfb_info *rinfo); static int radeon_get_dfpinfo_BIOS(struct radeonfb_info *rinfo); @@ -735,12 +735,12 @@ #endif /* CONFIG_PPC_OF */ -static char *radeon_find_rom(struct radeonfb_info *rinfo) +static void __iomem *radeon_find_rom(struct radeonfb_info *rinfo) { #if defined(__i386__) u32 segstart; - char *rom_base; - char *rom; + char __iomem *rom_base; + char __iomem *rom; int stage; int i,j; char aty_rom_sig[] = "761295520"; @@ -753,7 +753,7 @@ stage = 1; - rom_base = (char *)ioremap(segstart, 0x1000); + rom_base = ioremap(segstart, 0x1000); if ((*rom_base == 0x55) && (((*(rom_base + 1)) & 0xff) == 0xaa)) stage = 2; @@ -804,10 +804,10 @@ -static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg) +static void radeon_get_pllinfo(struct radeonfb_info *rinfo, void __iomem *bios_seg) { - void *bios_header; - void *header_ptr; + void __iomem *bios_header; + void __iomem *header_ptr; u16 bios_header_offset, pll_info_offset; PLL_BLOCK pll; @@ -1077,7 +1077,7 @@ static int radeon_get_dfpinfo_BIOS(struct radeonfb_info *rinfo) { - char *fpbiosstart, *tmp, *tmp0; + char __iomem *fpbiosstart, *tmp, *tmp0; char stmp[30]; int i; @@ -2252,7 +2252,7 @@ info->pseudo_palette = rinfo->pseudo_palette; info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; info->fbops = &radeonfb_ops; - info->screen_base = (char *)rinfo->fb_base; + info->screen_base = rinfo->fb_base; /* Fill fix common fields */ strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id)); @@ -2851,7 +2851,7 @@ } /* map the regions */ - rinfo->mmio_base = (unsigned long) ioremap (rinfo->mmio_base_phys, RADEON_REGSIZE); + rinfo->mmio_base = ioremap (rinfo->mmio_base_phys, RADEON_REGSIZE); if (!rinfo->mmio_base) { printk ("radeonfb: cannot map MMIO\n"); release_mem_region (rinfo->mmio_base_phys, @@ -2978,7 +2978,7 @@ if ((rinfo->dviDisp_type == MT_DFP) || (rinfo->dviDisp_type == MT_LCD) || (rinfo->crtDisp_type == MT_DFP)) { if (!radeon_get_dfpinfo(rinfo)) { - iounmap ((void*)rinfo->mmio_base); + iounmap(rinfo->mmio_base); release_mem_region (rinfo->mmio_base_phys, pci_resource_len(pdev, 2)); release_mem_region (rinfo->fb_base_phys, @@ -2988,10 +2988,10 @@ } } - rinfo->fb_base = (unsigned long) ioremap (rinfo->fb_base_phys, rinfo->video_ram); + rinfo->fb_base = ioremap (rinfo->fb_base_phys, rinfo->video_ram); if (!rinfo->fb_base) { printk ("radeonfb: cannot map FB\n"); - iounmap ((void*)rinfo->mmio_base); + iounmap(rinfo->mmio_base); release_mem_region (rinfo->mmio_base_phys, pci_resource_len(pdev, 2)); release_mem_region (rinfo->fb_base_phys, @@ -3043,8 +3043,8 @@ if (register_framebuffer ((struct fb_info *) rinfo) < 0) { printk ("radeonfb: could not register framebuffer\n"); - iounmap ((void*)rinfo->fb_base); - iounmap ((void*)rinfo->mmio_base); + iounmap(rinfo->fb_base); + iounmap(rinfo->mmio_base); release_mem_region (rinfo->mmio_base_phys, pci_resource_len(pdev, 2)); release_mem_region (rinfo->fb_base_phys, @@ -3113,8 +3113,8 @@ unregister_framebuffer ((struct fb_info *) rinfo); - iounmap ((void*)rinfo->mmio_base); - iounmap ((void*)rinfo->fb_base); + iounmap(rinfo->mmio_base); + iounmap(rinfo->fb_base); release_mem_region (rinfo->mmio_base_phys, pci_resource_len(pdev, 2)); diff -Nru a/drivers/video/sis/sis.h b/drivers/video/sis/sis.h --- a/drivers/video/sis/sis.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/video/sis/sis.h 2004-10-06 19:37:47 -07:00 @@ -360,10 +360,10 @@ unsigned long mmio_base; unsigned long vga_base; - unsigned long video_vbase; - unsigned long mmio_vbase; - char * bios_vbase; - char * bios_abase; + void __iomem * video_vbase; + void __iomem * mmio_vbase; + void __iomem * bios_vbase; + void * bios_abase; int mtrr; @@ -392,8 +392,8 @@ #endif u32 heapstart; /* offset */ - unsigned long sisfb_heap_start; /* address */ - unsigned long sisfb_heap_end; /* address */ + void __iomem * sisfb_heap_start; /* address */ + void __iomem * sisfb_heap_end; /* address */ u32 sisfb_heap_size; int havenoheap; #if 0 @@ -469,7 +469,7 @@ u8 detectedpdca; u8 detectedlcda; - unsigned long hwcursor_vbase; + void __iomem * hwcursor_vbase; int chronteltype; int tvxpos, tvypos; diff -Nru a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c --- a/drivers/video/sis/sis_main.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/video/sis/sis_main.c 2004-10-06 19:37:47 -07:00 @@ -3952,19 +3952,19 @@ } #endif -static char * __devinit sis_find_rom(struct pci_dev *pdev) +static void __iomem * __devinit sis_find_rom(struct pci_dev *pdev) { struct sis_video_info *ivideo = pci_get_drvdata(pdev); #if defined(__i386__) || defined(__x86_64__) u32 segstart; - unsigned char *rom_base, *rom; + void __iomem *rom_base, *rom; int romptr; unsigned short pciid; for(segstart=0x000c0000; segstart<0x000f0000; segstart+=0x00001000) { - rom_base = (unsigned char *)ioremap(segstart, 0x10000); + rom_base = ioremap(segstart, 0x10000); if(!rom_base) continue; if((readb(rom_base) != 0x55) || (readb(rom_base + 1) != 0xaa)) { @@ -3998,7 +3998,7 @@ iounmap(rom_base); } #else - unsigned char *rom_base, *rom, *myrombase = NULL; + void __iomem *rom_base, *rom, *myrombase = NULL; int romptr; unsigned short pciid; u32 backup; @@ -4037,7 +4037,7 @@ #ifdef CONFIG_FB_SIS_300 static int __devinit -sisfb_chkbuswidth300(struct pci_dev *pdev, ULONG FBAddress) +sisfb_chkbuswidth300(struct pci_dev *pdev, void __iomem *FBAddress) { struct sis_video_info *ivideo = pci_get_drvdata(pdev); int i, j; @@ -4080,7 +4080,7 @@ sisfb_setramsize300(struct pci_dev *pdev) { struct sis_video_info *ivideo = pci_get_drvdata(pdev); - ULONG FBAddr = (ULONG)ivideo->sishw_ext.pjVideoMemoryAddress, Addr; + void __iomem *FBAddr = ivideo->sishw_ext.pjVideoMemoryAddress, *Addr; USHORT SR13, SR14=0, buswidth, Done, data, TotalCapacity, PhysicalAdrOtherPage=0; int PseudoRankCapacity, PseudoTotalCapacity, PseudoAdrPinCount; int RankCapacity, AdrPinCount, BankNumHigh, BankNumMid, MB2Bank; @@ -4959,7 +4959,7 @@ ivideo->modeprechange = 0x03; #if defined(__i386__) || defined(__x86_64__) { - unsigned char *tt = ioremap(0, 0x1000); + unsigned char __iomem *tt = ioremap(0, 0x1000); if(tt) { ivideo->modeprechange = tt[0x449]; iounmap(tt); @@ -4993,7 +4993,8 @@ } #endif - ivideo->bios_vbase = ivideo->bios_abase = NULL; + ivideo->bios_abase = NULL; + ivideo->bios_vbase = NULL; if(ivideo->sisfb_userom) { ivideo->sishw_ext.pjVirtualRomBase = sis_find_rom(pdev); #if defined(__i386__) || defined(__x86_64__) @@ -5147,8 +5148,8 @@ return -ENODEV; } - ivideo->video_vbase = (unsigned long)ioremap(ivideo->video_base, ivideo->video_size); - ivideo->sishw_ext.pjVideoMemoryAddress = (unsigned char *)ivideo->video_vbase; + ivideo->video_vbase = ioremap(ivideo->video_base, ivideo->video_size); + ivideo->sishw_ext.pjVideoMemoryAddress = ivideo->video_vbase; if(!ivideo->video_vbase) { printk(KERN_ERR "sisfb: Fatal error: Unable to map frame buffer memory\n"); release_mem_region(ivideo->video_base, ivideo->video_size); @@ -5160,10 +5161,10 @@ return -ENODEV; } - ivideo->mmio_vbase = (unsigned long)ioremap(ivideo->mmio_base, ivideo->mmio_size); + ivideo->mmio_vbase = ioremap(ivideo->mmio_base, ivideo->mmio_size); if(!ivideo->mmio_vbase) { printk(KERN_ERR "sisfb: Fatal error: Unable to map MMIO region\n"); - iounmap((void *)ivideo->video_vbase); + iounmap(ivideo->video_vbase); release_mem_region(ivideo->video_base, ivideo->video_size); release_mem_region(ivideo->mmio_base, ivideo->mmio_size); if(ivideo->bios_abase) vfree(ivideo->bios_abase); @@ -5173,10 +5174,10 @@ return -ENODEV; } - printk(KERN_INFO "sisfb: Framebuffer at 0x%lx, mapped to 0x%lx, size %ldk\n", + printk(KERN_INFO "sisfb: Framebuffer at 0x%lx, mapped to 0x%p, size %ldk\n", ivideo->video_base, ivideo->video_vbase, ivideo->video_size / 1024); - printk(KERN_INFO "sisfb: MMIO at 0x%lx, mapped to 0x%lx, size %ldk\n", + printk(KERN_INFO "sisfb: MMIO at 0x%lx, mapped to 0x%p, size %ldk\n", ivideo->mmio_base, ivideo->mmio_vbase, ivideo->mmio_size / 1024); if((ivideo->havenoheap = sisfb_heap_init(ivideo))) { @@ -5450,8 +5451,8 @@ if(SiSSetMode(&ivideo->SiS_Pr, &ivideo->sishw_ext, ivideo->mode_no) == 0) { printk(KERN_ERR "sisfb: Fatal error: Setting mode[0x%x] failed\n", ivideo->mode_no); - iounmap((void *)ivideo->video_vbase); - iounmap((void *)ivideo->mmio_vbase); + iounmap(ivideo->video_vbase); + iounmap(ivideo->mmio_vbase); release_mem_region(ivideo->video_base, ivideo->video_size); release_mem_region(ivideo->mmio_base, ivideo->mmio_size); if(ivideo->bios_abase) vfree(ivideo->bios_abase); @@ -5549,7 +5550,7 @@ #endif sis_fb_info->var = ivideo->default_var; sis_fb_info->fix = ivideo->sisfb_fix; - sis_fb_info->screen_base = (char *)ivideo->video_vbase; + sis_fb_info->screen_base = ivideo->video_vbase; sis_fb_info->fbops = &sisfb_ops; sisfb_get_fix(&sis_fb_info->fix, -1, sis_fb_info); @@ -5574,8 +5575,8 @@ if(register_framebuffer(sis_fb_info) < 0) { printk(KERN_ERR "sisfb: Fatal error: Failed to register framebuffer\n"); - iounmap((void *)ivideo->video_vbase); - iounmap((void *)ivideo->mmio_vbase); + iounmap(ivideo->video_vbase); + iounmap(ivideo->mmio_vbase); release_mem_region(ivideo->video_base, ivideo->video_size); release_mem_region(ivideo->mmio_base, ivideo->mmio_size); if(ivideo->bios_abase) vfree(ivideo->bios_abase); @@ -5669,8 +5670,8 @@ #endif /* Unmap */ - iounmap((void *)ivideo->video_vbase); - iounmap((void *)ivideo->mmio_vbase); + iounmap(ivideo->video_vbase); + iounmap(ivideo->mmio_vbase); if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase); if(ivideo->bios_abase) vfree(ivideo->bios_abase); diff -Nru a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h --- a/drivers/video/sis/sis_main.h 2004-10-06 19:37:47 -07:00 +++ b/drivers/video/sis/sis_main.h 2004-10-06 19:37:47 -07:00 @@ -880,7 +880,7 @@ struct fb_info *info); static void sisfb_pre_setmode(struct sis_video_info *ivideo); static void sisfb_post_setmode(struct sis_video_info *ivideo); -static char * sis_find_rom(struct pci_dev *pdev); +static void __iomem *sis_find_rom(struct pci_dev *pdev); static BOOLEAN sisfb_CheckVBRetrace(struct sis_video_info *ivideo); static BOOLEAN sisfbcheckvretracecrt2(struct sis_video_info *ivideo); static BOOLEAN sisfbcheckvretracecrt1(struct sis_video_info *ivideo); diff -Nru a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c --- a/drivers/video/tridentfb.c 2004-10-06 19:37:47 -07:00 +++ b/drivers/video/tridentfb.c 2004-10-06 19:37:47 -07:00 @@ -28,7 +28,7 @@ struct tridentfb_par { int vclk; //in MHz - unsigned long io_virt; //iospace virtual memory address + void __iomem * io_virt; //iospace virtual memory address }; unsigned char eng_oper; //engine operation... @@ -1107,7 +1107,7 @@ return -1; } - default_par.io_virt = (unsigned long)ioremap_nocache(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len); + default_par.io_virt = ioremap_nocache(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len); if (!default_par.io_virt) { release_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len); @@ -1178,8 +1178,8 @@ { struct tridentfb_par *par = (struct tridentfb_par*)fb_info.par; unregister_framebuffer(&fb_info); - iounmap((void *)par->io_virt); - iounmap((void*)fb_info.screen_base); + iounmap(par->io_virt); + iounmap(fb_info.screen_base); release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len); release_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len); } diff -Nru a/fs/eventpoll.c b/fs/eventpoll.c --- a/fs/eventpoll.c 2004-10-06 19:37:47 -07:00 +++ b/fs/eventpoll.c 2004-10-06 19:37:47 -07:00 @@ -148,6 +148,9 @@ /* Get the "struct epitem" from an epoll queue wrapper */ #define EP_ITEM_FROM_EPQUEUE(p) (container_of(p, struct ep_pqueue, pt)->epi) +/* Tells if the epoll_ctl(2) operation needs an event copy from userspace */ +#define EP_OP_HASH_EVENT(op) ((op) != EPOLL_CTL_DEL) + struct epoll_filefd { struct file *file; @@ -531,7 +534,8 @@ current, epfd, op, fd, event)); error = -EFAULT; - if (copy_from_user(&epds, event, sizeof(struct epoll_event))) + if (EP_OP_HASH_EVENT(op) && + copy_from_user(&epds, event, sizeof(struct epoll_event))) goto eexit_1; /* Get the "struct file *" for the eventpoll file */ diff -Nru a/fs/hfs/bfind.c b/fs/hfs/bfind.c --- a/fs/hfs/bfind.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/bfind.c 2004-10-06 19:37:47 -07:00 @@ -85,7 +85,8 @@ { struct hfs_btree *tree; struct hfs_bnode *bnode; - u32 data, nidx, parent; + u32 nidx, parent; + __be32 data; int height, res; tree = fd->tree; diff -Nru a/fs/hfs/bitmap.c b/fs/hfs/bitmap.c --- a/fs/hfs/bitmap.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/bitmap.c 2004-10-06 19:37:47 -07:00 @@ -26,10 +26,11 @@ * Accesses memory in 32-bit aligned chunks of 32-bits and thus * may read beyond the 'size'th bit. */ -static u32 hfs_find_set_zero_bits(u32 *bitmap, u32 size, u32 offset, u32 *max) +static u32 hfs_find_set_zero_bits(__be32 *bitmap, u32 size, u32 offset, u32 *max) { - u32 *curr, *end; - u32 val, mask, start, len; + __be32 *curr, *end; + u32 mask, start, len, n; + __be32 val; int i; len = *max; @@ -42,11 +43,11 @@ /* scan the first partial u32 for zero bits */ val = *curr; if (~val) { - val = be32_to_cpu(val); + n = be32_to_cpu(val); i = offset % 32; mask = (1U << 31) >> i; for (; i < 32; mask >>= 1, i++) { - if (!(val & mask)) + if (!(n & mask)) goto found; } } @@ -55,10 +56,10 @@ while (++curr < end) { val = *curr; if (~val) { - val = be32_to_cpu(val); + n = be32_to_cpu(val); mask = 1 << 31; for (i = 0; i < 32; mask >>= 1, i++) { - if (!(val & mask)) + if (!(n & mask)) goto found; } } @@ -72,38 +73,38 @@ /* do any partial u32 at the start */ len = min(size - start, len); while (1) { - val |= mask; + n |= mask; if (++i >= 32) break; mask >>= 1; - if (!--len || val & mask) + if (!--len || n & mask) goto done; } if (!--len) goto done; - *curr++ = cpu_to_be32(val); + *curr++ = cpu_to_be32(n); /* do full u32s */ while (1) { - val = be32_to_cpu(*curr); + n = be32_to_cpu(*curr); if (len < 32) break; - if (val) { + if (n) { len = 32; break; } - *curr++ = 0xffffffffU; + *curr++ = cpu_to_be32(0xffffffff); len -= 32; } /* do any partial u32 at end */ mask = 1U << 31; for (i = 0; i < len; i++) { - if (val & mask) + if (n & mask) break; - val |= mask; + n |= mask; mask >>= 1; } done: - *curr = cpu_to_be32(val); + *curr = cpu_to_be32(n); *max = (curr - bitmap) * 32 + i - start; return start; } @@ -191,7 +192,7 @@ */ int hfs_clear_vbm_bits(struct super_block *sb, u16 start, u16 count) { - u32 *curr; + __be32 *curr; u32 mask; int i, len; diff -Nru a/fs/hfs/bnode.c b/fs/hfs/bnode.c --- a/fs/hfs/bnode.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/bnode.c 2004-10-06 19:37:47 -07:00 @@ -29,7 +29,7 @@ u16 hfs_bnode_read_u16(struct hfs_bnode *node, int off) { - u16 data; + __be16 data; // optimize later... hfs_bnode_read(node, &data, off, 2); return be16_to_cpu(data); @@ -72,9 +72,9 @@ void hfs_bnode_write_u16(struct hfs_bnode *node, int off, u16 data) { - data = cpu_to_be16(data); + __be16 v = cpu_to_be16(data); // optimize later... - hfs_bnode_write(node, &data, off, 2); + hfs_bnode_write(node, &v, off, 2); } void hfs_bnode_write_u8(struct hfs_bnode *node, int off, u8 data) @@ -136,7 +136,7 @@ void hfs_bnode_dump(struct hfs_bnode *node) { struct hfs_bnode_desc desc; - u32 cnid; + __be32 cnid; int i, off, key_off; dprint(DBG_BNODE_MOD, "bnode: %d\n", node->this); @@ -173,7 +173,7 @@ { struct hfs_btree *tree; struct hfs_bnode *tmp; - u32 cnid; + __be32 cnid; tree = node->tree; if (node->prev) { diff -Nru a/fs/hfs/brec.c b/fs/hfs/brec.c --- a/fs/hfs/brec.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/brec.c 2004-10-06 19:37:47 -07:00 @@ -13,7 +13,7 @@ /* Get the length and offset of the given record in the given node */ u16 hfs_brec_lenoff(struct hfs_bnode *node, u16 rec, u16 *off) { - u16 retval[2]; + __be16 retval[2]; u16 dataoff; dataoff = node->tree->node_size - (rec + 2) * 2; @@ -55,7 +55,7 @@ int size, key_len, rec; int data_off, end_off; int idx_rec_off, data_rec_off, end_rec_off; - u32 cnid; + __be32 cnid; tree = fd->tree; if (!fd->bnode) { @@ -391,7 +391,7 @@ node = parent; if (new_node) { - u32 cnid; + __be32 cnid; fd->bnode = hfs_bnode_find(tree, new_node->parent); /* create index key and entry */ @@ -423,7 +423,7 @@ struct hfs_bnode *node, *new_node; struct hfs_bnode_desc node_desc; int key_size, rec; - u32 cnid; + __be32 cnid; node = NULL; if (tree->root) { diff -Nru a/fs/hfs/btree.c b/fs/hfs/btree.c --- a/fs/hfs/btree.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/btree.c 2004-10-06 19:37:47 -07:00 @@ -154,7 +154,7 @@ struct hfs_btree *tree = prev->tree; struct hfs_bnode *node; struct hfs_bnode_desc desc; - u32 cnid; + __be32 cnid; node = hfs_bnode_create(tree, idx); if (IS_ERR(node)) diff -Nru a/fs/hfs/btree.h b/fs/hfs/btree.h --- a/fs/hfs/btree.h 2004-10-06 19:37:48 -07:00 +++ b/fs/hfs/btree.h 2004-10-06 19:37:48 -07:00 @@ -125,11 +125,11 @@ struct hfs_bnode_desc { - u32 next; /* (V) Number of the next node at this level */ - u32 prev; /* (V) Number of the prev node at this level */ + __be32 next; /* (V) Number of the next node at this level */ + __be32 prev; /* (V) Number of the prev node at this level */ u8 type; /* (F) The type of node */ u8 height; /* (F) The level of this node (leaves=1) */ - u16 num_recs; /* (V) The number of records in this node */ + __be16 num_recs; /* (V) The number of records in this node */ u16 reserved; } __packed; @@ -139,20 +139,20 @@ #define HFS_NODE_LEAF 0xFF /* A leaf (ndNHeight==1) node */ struct hfs_btree_header_rec { - u16 depth; /* (V) The number of levels in this B-tree */ - u32 root; /* (V) The node number of the root node */ - u32 leaf_count; /* (V) The number of leaf records */ - u32 leaf_head; /* (V) The number of the first leaf node */ - u32 leaf_tail; /* (V) The number of the last leaf node */ - u16 node_size; /* (F) The number of bytes in a node (=512) */ - u16 max_key_len; /* (F) The length of a key in an index node */ - u32 node_count; /* (V) The total number of nodes */ - u32 free_nodes; /* (V) The number of unused nodes */ + __be16 depth; /* (V) The number of levels in this B-tree */ + __be32 root; /* (V) The node number of the root node */ + __be32 leaf_count; /* (V) The number of leaf records */ + __be32 leaf_head; /* (V) The number of the first leaf node */ + __be32 leaf_tail; /* (V) The number of the last leaf node */ + __be16 node_size; /* (F) The number of bytes in a node (=512) */ + __be16 max_key_len; /* (F) The length of a key in an index node */ + __be32 node_count; /* (V) The total number of nodes */ + __be32 free_nodes; /* (V) The number of unused nodes */ u16 reserved1; - u32 clump_size; /* (F) clump size. not usually used. */ + __be32 clump_size; /* (F) clump size. not usually used. */ u8 btree_type; /* (F) BTree type */ u8 reserved2; - u32 attributes; /* (F) attributes */ + __be32 attributes; /* (F) attributes */ u32 reserved3[16]; } __packed; diff -Nru a/fs/hfs/catalog.c b/fs/hfs/catalog.c --- a/fs/hfs/catalog.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/catalog.c 2004-10-06 19:37:47 -07:00 @@ -35,7 +35,7 @@ int hfs_cat_build_record(hfs_cat_rec *rec, u32 cnid, struct inode *inode) { - u32 mtime = hfs_mtime(); + __be32 mtime = hfs_mtime(); memset(rec, 0, sizeof(*rec)); if (S_ISDIR(inode->i_mode)) { diff -Nru a/fs/hfs/extent.c b/fs/hfs/extent.c --- a/fs/hfs/extent.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/extent.c 2004-10-06 19:37:47 -07:00 @@ -279,13 +279,13 @@ int res, i; if (type == HFS_FK_DATA) { - total_blocks = file->PyLen; + total_blocks = be32_to_cpu(file->PyLen); extent = file->ExtRec; } else { - total_blocks = file->RPyLen; + total_blocks = be32_to_cpu(file->RPyLen); extent = file->RExtRec; } - total_blocks = be32_to_cpu(total_blocks) / HFS_SB(sb)->alloc_blksz; + total_blocks /= HFS_SB(sb)->alloc_blksz; if (!total_blocks) return 0; diff -Nru a/fs/hfs/hfs.h b/fs/hfs/hfs.h --- a/fs/hfs/hfs.h 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/hfs.h 2004-10-06 19:37:47 -07:00 @@ -91,45 +91,45 @@ } __packed; struct hfs_point { - u16 v; - u16 h; + __be16 v; + __be16 h; } __packed; struct hfs_rect { - u16 top; - u16 left; - u16 bottom; - u16 right; + __be16 top; + __be16 left; + __be16 bottom; + __be16 right; } __packed; struct hfs_finfo { - u32 fdType; - u32 fdCreator; - u16 fdFlags; + __be32 fdType; + __be32 fdCreator; + __be16 fdFlags; struct hfs_point fdLocation; - u16 fdFldr; + __be16 fdFldr; } __packed; struct hfs_fxinfo { - u16 fdIconID; + __be16 fdIconID; u8 fdUnused[8]; - u16 fdComment; - u32 fdPutAway; + __be16 fdComment; + __be32 fdPutAway; } __packed; struct hfs_dinfo { struct hfs_rect frRect; - u16 frFlags; + __be16 frFlags; struct hfs_point frLocation; - u16 frView; + __be16 frView; } __packed; struct hfs_dxinfo { struct hfs_point frScroll; - u32 frOpenChain; - u16 frUnused; - u16 frComment; - u32 frPutAway; + __be32 frOpenChain; + __be16 frUnused; + __be16 frComment; + __be32 frPutAway; } __packed; union hfs_finder_info { @@ -150,7 +150,7 @@ struct hfs_cat_key { u8 key_len; /* number of bytes in the key */ u8 reserved; /* padding */ - u32 ParID; /* CNID of the parent dir */ + __be32 ParID; /* CNID of the parent dir */ struct hfs_name CName; /* The filename of the entry */ } __packed; @@ -158,8 +158,8 @@ struct hfs_ext_key { u8 key_len; /* number of bytes in the key */ u8 FkType; /* HFS_FK_{DATA,RSRC} */ - u32 FNum; /* The File ID of the file */ - u16 FABN; /* allocation blocks number*/ + __be32 FNum; /* The File ID of the file */ + __be16 FABN; /* allocation blocks number*/ } __packed; typedef union hfs_btree_key { @@ -171,8 +171,8 @@ typedef union hfs_btree_key btree_key; struct hfs_extent { - u16 block; - u16 count; + __be16 block; + __be16 count; }; typedef struct hfs_extent hfs_extent_rec[3]; @@ -183,18 +183,18 @@ u8 Flags; /* Flags such as read-only */ s8 Typ; /* file version number = 0 */ struct hfs_finfo UsrWds; /* data used by the Finder */ - u32 FlNum; /* The CNID */ - u16 StBlk; /* obsolete */ - u32 LgLen; /* The logical EOF of the data fork*/ - u32 PyLen; /* The physical EOF of the data fork */ - u16 RStBlk; /* obsolete */ - u32 RLgLen; /* The logical EOF of the rsrc fork */ - u32 RPyLen; /* The physical EOF of the rsrc fork */ - u32 CrDat; /* The creation date */ - u32 MdDat; /* The modified date */ - u32 BkDat; /* The last backup date */ + __be32 FlNum; /* The CNID */ + __be16 StBlk; /* obsolete */ + __be32 LgLen; /* The logical EOF of the data fork*/ + __be32 PyLen; /* The physical EOF of the data fork */ + __be16 RStBlk; /* obsolete */ + __be32 RLgLen; /* The logical EOF of the rsrc fork */ + __be32 RPyLen; /* The physical EOF of the rsrc fork */ + __be32 CrDat; /* The creation date */ + __be32 MdDat; /* The modified date */ + __be32 BkDat; /* The last backup date */ struct hfs_fxinfo FndrInfo; /* more data for the Finder */ - u16 ClpSize; /* number of bytes to allocate + __be16 ClpSize; /* number of bytes to allocate when extending files */ hfs_extent_rec ExtRec; /* first extent record for the data fork */ @@ -207,13 +207,13 @@ struct hfs_cat_dir { s8 type; /* The type of entry */ u8 reserved; - u16 Flags; /* flags */ - u16 Val; /* Valence: number of files and + __be16 Flags; /* flags */ + __be16 Val; /* Valence: number of files and dirs in the directory */ - u32 DirID; /* The CNID */ - u32 CrDat; /* The creation date */ - u32 MdDat; /* The modification date */ - u32 BkDat; /* The last backup date */ + __be32 DirID; /* The CNID */ + __be32 CrDat; /* The creation date */ + __be32 MdDat; /* The modification date */ + __be32 BkDat; /* The last backup date */ struct hfs_dinfo UsrInfo; /* data used by the Finder */ struct hfs_dxinfo FndrInfo; /* more data used by Finder */ u8 Resrv[16]; /* reserved by Apple */ @@ -223,7 +223,7 @@ struct hfs_cat_thread { s8 type; /* The type of entry */ u8 reserved[9]; /* reserved by Apple */ - u32 ParID; /* CNID of parent directory */ + __be32 ParID; /* CNID of parent directory */ struct hfs_name CName; /* The name of this entry */ } __packed; @@ -236,43 +236,43 @@ } hfs_cat_rec; struct hfs_mdb { - u16 drSigWord; /* Signature word indicating fs type */ - u32 drCrDate; /* fs creation date/time */ - u32 drLsMod; /* fs modification date/time */ - u16 drAtrb; /* fs attributes */ - u16 drNmFls; /* number of files in root directory */ - u16 drVBMSt; /* location (in 512-byte blocks) + __be16 drSigWord; /* Signature word indicating fs type */ + __be32 drCrDate; /* fs creation date/time */ + __be32 drLsMod; /* fs modification date/time */ + __be16 drAtrb; /* fs attributes */ + __be16 drNmFls; /* number of files in root directory */ + __be16 drVBMSt; /* location (in 512-byte blocks) of the volume bitmap */ - u16 drAllocPtr; /* location (in allocation blocks) + __be16 drAllocPtr; /* location (in allocation blocks) to begin next allocation search */ - u16 drNmAlBlks; /* number of allocation blocks */ - u32 drAlBlkSiz; /* bytes in an allocation block */ - u32 drClpSiz; /* clumpsize, the number of bytes to + __be16 drNmAlBlks; /* number of allocation blocks */ + __be32 drAlBlkSiz; /* bytes in an allocation block */ + __be32 drClpSiz; /* clumpsize, the number of bytes to allocate when extending a file */ - u16 drAlBlSt; /* location (in 512-byte blocks) + __be16 drAlBlSt; /* location (in 512-byte blocks) of the first allocation block */ - u32 drNxtCNID; /* CNID to assign to the next + __be32 drNxtCNID; /* CNID to assign to the next file or directory created */ - u16 drFreeBks; /* number of free allocation blocks */ + __be16 drFreeBks; /* number of free allocation blocks */ u8 drVN[28]; /* the volume label */ - u32 drVolBkUp; /* fs backup date/time */ - u16 drVSeqNum; /* backup sequence number */ - u32 drWrCnt; /* fs write count */ - u32 drXTClpSiz; /* clumpsize for the extents B-tree */ - u32 drCTClpSiz; /* clumpsize for the catalog B-tree */ - u16 drNmRtDirs; /* number of directories in + __be32 drVolBkUp; /* fs backup date/time */ + __be16 drVSeqNum; /* backup sequence number */ + __be32 drWrCnt; /* fs write count */ + __be32 drXTClpSiz; /* clumpsize for the extents B-tree */ + __be32 drCTClpSiz; /* clumpsize for the catalog B-tree */ + __be16 drNmRtDirs; /* number of directories in the root directory */ - u32 drFilCnt; /* number of files in the fs */ - u32 drDirCnt; /* number of directories in the fs */ + __be32 drFilCnt; /* number of files in the fs */ + __be32 drDirCnt; /* number of directories in the fs */ u8 drFndrInfo[32]; /* data used by the Finder */ - u16 drEmbedSigWord; /* embedded volume signature */ - u32 drEmbedExtent; /* starting block number (xdrStABN) + __be16 drEmbedSigWord; /* embedded volume signature */ + __be32 drEmbedExtent; /* starting block number (xdrStABN) and number of allocation blocks (xdrNumABlks) occupied by embedded volume */ - u32 drXTFlSize; /* bytes in the extents B-tree */ + __be32 drXTFlSize; /* bytes in the extents B-tree */ hfs_extent_rec drXTExtRec; /* extents B-tree's first 3 extents */ - u32 drCTFlSize; /* bytes in the catalog B-tree */ + __be32 drCTFlSize; /* bytes in the catalog B-tree */ hfs_extent_rec drCTExtRec; /* catalog B-tree's first 3 extents */ } __packed; diff -Nru a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h --- a/fs/hfs/hfs_fs.h 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/hfs_fs.h 2004-10-06 19:37:47 -07:00 @@ -90,7 +90,7 @@ struct buffer_head *alt_mdb_bh; /* The hfs_buffer holding the alternate superblock */ struct hfs_mdb *alt_mdb; - u32 *bitmap; /* The page holding the + __be32 *bitmap; /* The page holding the allocation bitmap */ struct hfs_btree *ext_tree; /* Information about the extents b-tree */ @@ -129,8 +129,8 @@ "allocation block" */ int s_quiet; /* Silent failure when changing owner or mode? */ - u32 s_type; /* Type for new files */ - u32 s_creator; /* Creator for new files */ + __be32 s_type; /* Type for new files */ + __be32 s_creator; /* Creator for new files */ umode_t s_file_umask; /* The umask applied to the permissions on all files */ umode_t s_dir_umask; /* The umask applied to the @@ -197,11 +197,11 @@ extern struct address_space_operations hfs_btree_aops; extern struct inode *hfs_new_inode(struct inode *, struct qstr *, int); -extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, u32 *, u32 *); +extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *); extern int hfs_write_inode(struct inode *, int); extern int hfs_inode_setattr(struct dentry *, struct iattr *); extern void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext, - u32 log_size, u32 phys_size, u32 clump_size); + __be32 log_size, __be32 phys_size, u32 clump_size); extern struct inode *hfs_iget(struct super_block *, struct hfs_cat_key *, hfs_cat_rec *); extern void hfs_clear_inode(struct inode *); extern void hfs_delete_inode(struct inode *); diff -Nru a/fs/hfs/inode.c b/fs/hfs/inode.c --- a/fs/hfs/inode.c 2004-10-06 19:37:48 -07:00 +++ b/fs/hfs/inode.c 2004-10-06 19:37:48 -07:00 @@ -210,14 +210,14 @@ dprint(DBG_INODE, "delete_inode: %lu\n", inode->i_ino); if (S_ISDIR(inode->i_mode)) { HFS_SB(sb)->folder_count--; - if (HFS_I(inode)->cat_key.ParID == be32_to_cpu(HFS_ROOT_CNID)) + if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID)) HFS_SB(sb)->root_dirs--; set_bit(HFS_FLG_MDB_DIRTY, &HFS_SB(sb)->flags); sb->s_dirt = 1; return; } HFS_SB(sb)->file_count--; - if (HFS_I(inode)->cat_key.ParID == be32_to_cpu(HFS_ROOT_CNID)) + if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID)) HFS_SB(sb)->root_files--; if (S_ISREG(inode->i_mode)) { if (!inode->i_nlink) { @@ -230,9 +230,10 @@ } void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext, - u32 log_size, u32 phys_size, u32 clump_size) + __be32 __log_size, __be32 phys_size, u32 clump_size) { struct super_block *sb = inode->i_sb; + u32 log_size = be32_to_cpu(__log_size); u16 count; int i; @@ -241,7 +242,6 @@ count += be16_to_cpu(ext[i].count); HFS_I(inode)->first_blocks = count; - log_size = be32_to_cpu(log_size); inode->i_size = HFS_I(inode)->phys_size = log_size; inode->i_blocks = (log_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; HFS_I(inode)->alloc_blocks = be32_to_cpu(phys_size) / @@ -370,7 +370,7 @@ } void hfs_inode_write_fork(struct inode *inode, struct hfs_extent *ext, - u32 *log_size, u32 *phys_size) + __be32 *log_size, __be32 *phys_size) { memcpy(ext, HFS_I(inode)->first_extents, sizeof(hfs_extent_rec)); diff -Nru a/fs/hfs/mdb.c b/fs/hfs/mdb.c --- a/fs/hfs/mdb.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/mdb.c 2004-10-06 19:37:47 -07:00 @@ -71,7 +71,7 @@ int off2, len, size, sect; sector_t part_start, part_size; loff_t off; - u16 attrib; + __be16 attrib; /* set the device driver to 512-byte blocks */ size = sb_min_blocksize(sb, HFS_SECTOR_SIZE); @@ -164,7 +164,7 @@ hfs_warn("hfs_fs: continuing without an alternate MDB\n"); } - HFS_SB(sb)->bitmap = (u32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0); + HFS_SB(sb)->bitmap = (__be32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0); if (!HFS_SB(sb)->bitmap) goto out; diff -Nru a/fs/hfs/part_tbl.c b/fs/hfs/part_tbl.c --- a/fs/hfs/part_tbl.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/part_tbl.c 2004-10-06 19:37:47 -07:00 @@ -19,11 +19,11 @@ * contiguous starting at block 1. */ struct new_pmap { - u16 pmSig; /* signature */ - u16 reSigPad; /* padding */ - u32 pmMapBlkCnt; /* partition blocks count */ - u32 pmPyPartStart; /* physical block start of partition */ - u32 pmPartBlkCnt; /* physical block count of partition */ + __be16 pmSig; /* signature */ + __be16 reSigPad; /* padding */ + __be32 pmMapBlkCnt; /* partition blocks count */ + __be32 pmPyPartStart; /* physical block start of partition */ + __be32 pmPartBlkCnt; /* physical block count of partition */ u8 pmPartName[32]; /* (null terminated?) string giving the name of this partition */ @@ -41,11 +41,11 @@ * one of these. */ struct old_pmap { - u16 pdSig; /* Signature bytes */ + __be16 pdSig; /* Signature bytes */ struct old_pmap_entry { - u32 pdStart; - u32 pdSize; - u32 pdFSID; + __be32 pdStart; + __be32 pdSize; + __be32 pdFSID; } pdEntry[42]; } __packed; @@ -59,7 +59,7 @@ sector_t *part_start, sector_t *part_size) { struct buffer_head *bh; - u16 *data; + __be16 *data; int i, size, res; res = -ENOENT; diff -Nru a/fs/hfs/super.c b/fs/hfs/super.c --- a/fs/hfs/super.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfs/super.c 2004-10-06 19:37:47 -07:00 @@ -152,8 +152,7 @@ hsb->s_gid = current->gid; hsb->s_file_umask = 0644; hsb->s_dir_umask = 0755; - hsb->s_type = 0x3f3f3f3f; /* == '????' */ - hsb->s_creator = 0x3f3f3f3f; /* == '????' */ + hsb->s_type = hsb->s_creator = cpu_to_be32(0x3f3f3f3f); /* == '????' */ hsb->s_quiet = 0; hsb->part = -1; hsb->session = -1; @@ -216,11 +215,11 @@ } else if (!strcmp(this_char, "type") && value) { if (strlen(value) != 4) return 0; - hsb->s_type = *(u32 *)value; + memcpy(&hsb->s_type, value, 4); } else if (!strcmp(this_char, "creator") && value) { if (strlen(value) != 4) return 0; - hsb->s_creator = *(u32 *)value; + memcpy(&hsb->s_creator, value, 4); /* Boolean-valued options */ } else if (!strcmp(this_char, "quiet")) { if (value) diff -Nru a/fs/hfsplus/bfind.c b/fs/hfsplus/bfind.c --- a/fs/hfsplus/bfind.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/bfind.c 2004-10-06 19:37:47 -07:00 @@ -85,7 +85,8 @@ { struct hfs_btree *tree; struct hfs_bnode *bnode; - u32 data, nidx, parent; + u32 nidx, parent; + __be32 data; int height, res; tree = fd->tree; diff -Nru a/fs/hfsplus/bitmap.c b/fs/hfsplus/bitmap.c --- a/fs/hfsplus/bitmap.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/bitmap.c 2004-10-06 19:37:47 -07:00 @@ -19,8 +19,9 @@ { struct page *page; struct address_space *mapping; - u32 *pptr, *curr, *end; - u32 val, mask, start, len; + __be32 *pptr, *curr, *end; + u32 mask, start, len, n; + __be32 val; int i; len = *max; @@ -44,10 +45,10 @@ /* scan the first partial u32 for zero bits */ val = *curr; if (~val) { - val = be32_to_cpu(val); + n = be32_to_cpu(val); mask = (1U << 31) >> i; for (; i < 32; mask >>= 1, i++) { - if (!(val & mask)) + if (!(n & mask)) goto found; } } @@ -58,10 +59,10 @@ while (curr < end) { val = *curr; if (~val) { - val = be32_to_cpu(val); + n = be32_to_cpu(val); mask = 1 << 31; for (i = 0; i < 32; mask >>= 1, i++) { - if (!(val & mask)) + if (!(n & mask)) goto found; } } @@ -92,27 +93,27 @@ /* do any partial u32 at the start */ len = min(size - start, len); while (1) { - val |= mask; + n |= mask; if (++i >= 32) break; mask >>= 1; - if (!--len || val & mask) + if (!--len || n & mask) goto done; } if (!--len) goto done; - *curr++ = cpu_to_be32(val); + *curr++ = cpu_to_be32(n); /* do full u32s */ while (1) { while (curr < end) { - val = be32_to_cpu(*curr); + n = be32_to_cpu(*curr); if (len < 32) goto last; - if (val) { + if (n) { len = 32; goto last; } - *curr++ = 0xffffffffU; + *curr++ = cpu_to_be32(0xffffffff); len -= 32; } set_page_dirty(page); @@ -128,13 +129,13 @@ /* do any partial u32 at end */ mask = 1U << 31; for (i = 0; i < len; i++) { - if (val & mask) + if (n & mask) break; - val |= mask; + n |= mask; mask >>= 1; } done: - *curr = cpu_to_be32(val); + *curr = cpu_to_be32(n); set_page_dirty(page); kunmap(page); *max = offset + (curr - pptr) * 32 + i - start; @@ -150,7 +151,7 @@ { struct page *page; struct address_space *mapping; - u32 *pptr, *curr, *end; + __be32 *pptr, *curr, *end; u32 mask, len, pnr; int i; diff -Nru a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c --- a/fs/hfsplus/bnode.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/bnode.c 2004-10-06 19:37:47 -07:00 @@ -44,7 +44,7 @@ u16 hfs_bnode_read_u16(struct hfs_bnode *node, int off) { - u16 data; + __be16 data; // optimize later... hfs_bnode_read(node, &data, off, 2); return be16_to_cpu(data); @@ -55,7 +55,7 @@ u8 data; // optimize later... hfs_bnode_read(node, &data, off, 1); - return be16_to_cpu(data); + return data; } void hfs_bnode_read_key(struct hfs_bnode *node, void *key, int off) @@ -98,9 +98,9 @@ void hfs_bnode_write_u16(struct hfs_bnode *node, int off, u16 data) { - data = cpu_to_be16(data); + __be16 v = cpu_to_be16(data); // optimize later... - hfs_bnode_write(node, &data, off, 2); + hfs_bnode_write(node, &v, off, 2); } void hfs_bnode_clear(struct hfs_bnode *node, int off, int len) @@ -297,7 +297,7 @@ void hfs_bnode_dump(struct hfs_bnode *node) { struct hfs_bnode_desc desc; - u32 cnid; + __be32 cnid; int i, off, key_off; dprint(DBG_BNODE_MOD, "bnode: %d\n", node->this); @@ -334,7 +334,7 @@ { struct hfs_btree *tree; struct hfs_bnode *tmp; - u32 cnid; + __be32 cnid; tree = node->tree; if (node->prev) { diff -Nru a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c --- a/fs/hfsplus/brec.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/brec.c 2004-10-06 19:37:47 -07:00 @@ -14,7 +14,7 @@ /* Get the length and offset of the given record in the given node */ u16 hfs_brec_lenoff(struct hfs_bnode *node, u16 rec, u16 *off) { - u16 retval[2]; + __be16 retval[2]; u16 dataoff; dataoff = node->tree->node_size - (rec + 2) * 2; @@ -53,7 +53,7 @@ int size, key_len, rec; int data_off, end_off; int idx_rec_off, data_rec_off, end_rec_off; - u32 cnid; + __be32 cnid; tree = fd->tree; if (!fd->bnode) { @@ -387,7 +387,7 @@ node = parent; if (new_node) { - u32 cnid; + __be32 cnid; fd->bnode = hfs_bnode_find(tree, new_node->parent); /* create index key and entry */ @@ -419,7 +419,7 @@ struct hfs_bnode *node, *new_node; struct hfs_bnode_desc node_desc; int key_size, rec; - u32 cnid; + __be32 cnid; node = NULL; if (tree->root) { diff -Nru a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c --- a/fs/hfsplus/btree.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/btree.c 2004-10-06 19:37:47 -07:00 @@ -142,7 +142,7 @@ struct hfs_btree *tree = prev->tree; struct hfs_bnode *node; struct hfs_bnode_desc desc; - u32 cnid; + __be32 cnid; node = hfs_bnode_create(tree, idx); if (IS_ERR(node)) diff -Nru a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c --- a/fs/hfsplus/catalog.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/catalog.c 2004-10-06 19:37:47 -07:00 @@ -15,7 +15,7 @@ int hfsplus_cat_cmp_key(hfsplus_btree_key *k1, hfsplus_btree_key *k2) { - u32 k1p, k2p; + __be32 k1p, k2p; k1p = k1->cat.parent; k2p = k2->cat.parent; @@ -34,8 +34,10 @@ if (str) { hfsplus_asc2uni(&key->cat.name, str->name, str->len); len = be16_to_cpu(key->cat.name.length); - } else - len = key->cat.name.length = 0; + } else { + key->cat.name.length = 0; + len = 0; + } key->key_len = cpu_to_be16(6 + 2 * len); } diff -Nru a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c --- a/fs/hfsplus/extents.c 2004-10-06 19:37:46 -07:00 +++ b/fs/hfsplus/extents.c 2004-10-06 19:37:46 -07:00 @@ -19,8 +19,8 @@ /* Compare two extents keys, returns 0 on same, pos/neg for difference */ int hfsplus_ext_cmp_key(hfsplus_btree_key *k1, hfsplus_btree_key *k2) { - u32 k1id, k2id; - u32 k1s, k2s; + __be32 k1id, k2id; + __be32 k1s, k2s; k1id = k1->ext.cnid; k2id = k2->ext.cnid; diff -Nru a/fs/hfsplus/hfsplus_raw.h b/fs/hfsplus/hfsplus_raw.h --- a/fs/hfsplus/hfsplus_raw.h 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/hfsplus_raw.h 2004-10-06 19:37:47 -07:00 @@ -45,12 +45,12 @@ /* Structures used on disk */ -typedef u32 hfsplus_cnid; -typedef u16 hfsplus_unichr; +typedef __be32 hfsplus_cnid; +typedef __be16 hfsplus_unichr; /* A "string" as used in filenames, etc. */ struct hfsplus_unistr { - u16 length; + __be16 length; hfsplus_unichr unicode[255]; } __packed; @@ -58,12 +58,12 @@ /* POSIX permissions */ struct hfsplus_perm { - u32 owner; - u32 group; + __be32 owner; + __be32 group; u8 rootflags; u8 userflags; - u16 mode; - u32 dev; + __be16 mode; + __be32 dev; } __packed; #define HFSPLUS_FLG_NODUMP 0x01 @@ -72,46 +72,46 @@ /* A single contiguous area of a file */ struct hfsplus_extent { - u32 start_block; - u32 block_count; + __be32 start_block; + __be32 block_count; } __packed; typedef struct hfsplus_extent hfsplus_extent_rec[8]; /* Information for a "Fork" in a file */ struct hfsplus_fork_raw { - u64 total_size; - u32 clump_size; - u32 total_blocks; + __be64 total_size; + __be32 clump_size; + __be32 total_blocks; hfsplus_extent_rec extents; } __packed; /* HFS+ Volume Header */ struct hfsplus_vh { - u16 signature; - u16 version; - u32 attributes; - u32 last_mount_vers; + __be16 signature; + __be16 version; + __be32 attributes; + __be32 last_mount_vers; u32 reserved; - u32 create_date; - u32 modify_date; - u32 backup_date; - u32 checked_date; - - u32 file_count; - u32 folder_count; - - u32 blocksize; - u32 total_blocks; - u32 free_blocks; - - u32 next_alloc; - u32 rsrc_clump_sz; - u32 data_clump_sz; + __be32 create_date; + __be32 modify_date; + __be32 backup_date; + __be32 checked_date; + + __be32 file_count; + __be32 folder_count; + + __be32 blocksize; + __be32 total_blocks; + __be32 free_blocks; + + __be32 next_alloc; + __be32 rsrc_clump_sz; + __be32 data_clump_sz; hfsplus_cnid next_cnid; - u32 write_count; - u64 encodings_bmp; + __be32 write_count; + __be64 encodings_bmp; u8 finder_info[32]; @@ -131,11 +131,11 @@ /* HFS+ BTree node descriptor */ struct hfs_bnode_desc { - u32 next; - u32 prev; + __be32 next; + __be32 prev; s8 type; u8 height; - u16 num_recs; + __be16 num_recs; u16 reserved; } __packed; @@ -147,20 +147,20 @@ /* HFS+ BTree header */ struct hfs_btree_header_rec { - u16 depth; - u32 root; - u32 leaf_count; - u32 leaf_head; - u32 leaf_tail; - u16 node_size; - u16 max_key_len; - u32 node_count; - u32 free_nodes; + __be16 depth; + __be32 root; + __be32 leaf_count; + __be32 leaf_head; + __be32 leaf_tail; + __be16 node_size; + __be16 max_key_len; + __be32 node_count; + __be32 free_nodes; u16 reserved1; - u32 clump_size; + __be32 clump_size; u8 btree_type; u8 reserved2; - u32 attributes; + __be32 attributes; u32 reserved3[16]; } __packed; @@ -186,7 +186,7 @@ /* HFS+ catalog entry key */ struct hfsplus_cat_key { - u16 key_len; + __be16 key_len; hfsplus_cnid parent; struct hfsplus_unistr name; } __packed; @@ -194,83 +194,83 @@ /* Structs from hfs.h */ struct hfsp_point { - u16 v; - u16 h; + __be16 v; + __be16 h; } __packed; struct hfsp_rect { - u16 top; - u16 left; - u16 bottom; - u16 right; + __be16 top; + __be16 left; + __be16 bottom; + __be16 right; } __packed; /* HFS directory info (stolen from hfs.h */ struct DInfo { struct hfsp_rect frRect; - u16 frFlags; + __be16 frFlags; struct hfsp_point frLocation; - u16 frView; + __be16 frView; } __packed; struct DXInfo { struct hfsp_point frScroll; - u32 frOpenChain; - u16 frUnused; - u16 frComment; - u32 frPutAway; + __be32 frOpenChain; + __be16 frUnused; + __be16 frComment; + __be32 frPutAway; } __packed; /* HFS+ folder data (part of an hfsplus_cat_entry) */ struct hfsplus_cat_folder { - s16 type; - u16 flags; - u32 valence; + __be16 type; + __be16 flags; + __be32 valence; hfsplus_cnid id; - u32 create_date; - u32 content_mod_date; - u32 attribute_mod_date; - u32 access_date; - u32 backup_date; + __be32 create_date; + __be32 content_mod_date; + __be32 attribute_mod_date; + __be32 access_date; + __be32 backup_date; struct hfsplus_perm permissions; struct DInfo user_info; struct DXInfo finder_info; - u32 text_encoding; + __be32 text_encoding; u32 reserved; } __packed; /* HFS file info (stolen from hfs.h) */ struct FInfo { - u32 fdType; - u32 fdCreator; - u16 fdFlags; + __be32 fdType; + __be32 fdCreator; + __be16 fdFlags; struct hfsp_point fdLocation; - u16 fdFldr; + __be16 fdFldr; } __packed; struct FXInfo { - u16 fdIconID; + __be16 fdIconID; u8 fdUnused[8]; - u16 fdComment; - u32 fdPutAway; + __be16 fdComment; + __be32 fdPutAway; } __packed; /* HFS+ file data (part of a cat_entry) */ struct hfsplus_cat_file { - s16 type; - u16 flags; + __be16 type; + __be16 flags; u32 reserved1; hfsplus_cnid id; - u32 create_date; - u32 content_mod_date; - u32 attribute_mod_date; - u32 access_date; - u32 backup_date; + __be32 create_date; + __be32 content_mod_date; + __be32 attribute_mod_date; + __be32 access_date; + __be32 backup_date; struct hfsplus_perm permissions; struct FInfo user_info; struct FXInfo finder_info; - u32 text_encoding; + __be32 text_encoding; u32 reserved2; struct hfsplus_fork_raw data_fork; @@ -283,7 +283,7 @@ /* HFS+ catalog thread (part of a cat_entry) */ struct hfsplus_cat_thread { - s16 type; + __be16 type; s16 reserved; hfsplus_cnid parentID; struct hfsplus_unistr nodeName; @@ -293,7 +293,7 @@ /* A data record in the catalog tree */ typedef union { - s16 type; + __be16 type; struct hfsplus_cat_folder folder; struct hfsplus_cat_file file; struct hfsplus_cat_thread thread; @@ -307,18 +307,18 @@ /* HFS+ extents tree key */ struct hfsplus_ext_key { - u16 key_len; + __be16 key_len; u8 fork_type; u8 pad; hfsplus_cnid cnid; - u32 start_block; + __be32 start_block; } __packed; #define HFSPLUS_EXT_KEYLEN 12 /* HFS+ generic BTree key */ typedef union { - u16 key_len; + __be16 key_len; struct hfsplus_cat_key cat; struct hfsplus_ext_key ext; } __packed hfsplus_btree_key; diff -Nru a/fs/hfsplus/part_tbl.c b/fs/hfsplus/part_tbl.c --- a/fs/hfsplus/part_tbl.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/part_tbl.c 2004-10-06 19:37:47 -07:00 @@ -35,11 +35,11 @@ * contiguous starting at block 1. */ struct new_pmap { - u16 pmSig; /* signature */ - u16 reSigPad; /* padding */ - u32 pmMapBlkCnt; /* partition blocks count */ - u32 pmPyPartStart; /* physical block start of partition */ - u32 pmPartBlkCnt; /* physical block count of partition */ + __be16 pmSig; /* signature */ + __be16 reSigPad; /* padding */ + __be32 pmMapBlkCnt; /* partition blocks count */ + __be32 pmPyPartStart; /* physical block start of partition */ + __be32 pmPartBlkCnt; /* physical block count of partition */ u8 pmPartName[32]; /* (null terminated?) string giving the name of this partition */ @@ -57,11 +57,11 @@ * one of these. */ struct old_pmap { - u16 pdSig; /* Signature bytes */ + __be16 pdSig; /* Signature bytes */ struct old_pmap_entry { - u32 pdStart; - u32 pdSize; - u32 pdFSID; + __be32 pdStart; + __be32 pdSize; + __be32 pdFSID; } pdEntry[42]; } __packed; @@ -75,7 +75,7 @@ sector_t *part_start, sector_t *part_size) { struct buffer_head *bh; - u16 *data; + __be16 *data; int i, size, res; res = -ENOENT; diff -Nru a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c --- a/fs/hfsplus/wrapper.c 2004-10-06 19:37:47 -07:00 +++ b/fs/hfsplus/wrapper.c 2004-10-06 19:37:47 -07:00 @@ -30,22 +30,22 @@ u32 extent; u16 attrib; - if (be16_to_cpu(*(u16 *)(bufptr + HFSP_WRAPOFF_EMBEDSIG)) != HFSPLUS_VOLHEAD_SIG) + if (be16_to_cpu(*(__be16 *)(bufptr + HFSP_WRAPOFF_EMBEDSIG)) != HFSPLUS_VOLHEAD_SIG) return 0; - attrib = be16_to_cpu(*(u16 *)(bufptr + HFSP_WRAPOFF_ATTRIB)); + attrib = be16_to_cpu(*(__be16 *)(bufptr + HFSP_WRAPOFF_ATTRIB)); if (!(attrib & HFSP_WRAP_ATTRIB_SLOCK) || !(attrib & HFSP_WRAP_ATTRIB_SPARED)) return 0; - wd->ablk_size = be32_to_cpu(*(u32 *)(bufptr + HFSP_WRAPOFF_ABLKSIZE)); + wd->ablk_size = be32_to_cpu(*(__be32 *)(bufptr + HFSP_WRAPOFF_ABLKSIZE)); if (wd->ablk_size < HFSPLUS_SECTOR_SIZE) return 0; if (wd->ablk_size % HFSPLUS_SECTOR_SIZE) return 0; - wd->ablk_start = be16_to_cpu(*(u16 *)(bufptr + HFSP_WRAPOFF_ABLKSTART)); + wd->ablk_start = be16_to_cpu(*(__be16 *)(bufptr + HFSP_WRAPOFF_ABLKSTART)); - extent = be32_to_cpu(get_unaligned((u32 *)(bufptr + HFSP_WRAPOFF_EMBEDEXT))); + extent = be32_to_cpu(get_unaligned((__be32 *)(bufptr + HFSP_WRAPOFF_EMBEDEXT))); wd->embed_start = (extent >> 16) & 0xFFFF; wd->embed_count = extent & 0xFFFF; diff -Nru a/fs/isofs/compress.c b/fs/isofs/compress.c --- a/fs/isofs/compress.c 2004-10-06 19:37:46 -07:00 +++ b/fs/isofs/compress.c 2004-10-06 19:37:46 -07:00 @@ -132,7 +132,7 @@ brelse(ptrbh[1]); goto eio; } - cstart = le32_to_cpu(*(u32 *)(bh->b_data + (blockptr & bufmask))); + cstart = le32_to_cpu(*(__le32 *)(bh->b_data + (blockptr & bufmask))); if ( indexblocks == 2 ) { /* We just crossed a block boundary. Switch to the next block */ @@ -144,7 +144,7 @@ goto eio; } } - cend = le32_to_cpu(*(u32 *)(bh->b_data + (blockendptr & bufmask))); + cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask))); brelse(bh); csize = cend-cstart; diff -Nru a/fs/jffs2/super.c b/fs/jffs2/super.c --- a/fs/jffs2/super.c 2004-10-06 19:37:47 -07:00 +++ b/fs/jffs2/super.c 2004-10-06 19:37:47 -07:00 @@ -7,7 +7,7 @@ * * For licensing information, see the file 'LICENCE' in this directory. * - * $Id: super.c,v 1.97 2004/07/16 15:17:57 dwmw2 Exp $ + * $Id: super.c,v 1.99 2004/08/24 07:59:57 dwmw2 Exp $ * */ @@ -130,7 +130,7 @@ mtd->index, mtd->name)); sb->s_op = &jffs2_super_operations; - sb->s_flags |= MS_NOATIME; + sb->s_flags = flags | MS_NOATIME; ret = jffs2_do_fill_super(sb, data, (flags&MS_VERBOSE)?1:0); @@ -330,6 +330,7 @@ out_compressors: jffs2_compressors_exit(); out: + kmem_cache_destroy(jffs2_inode_cachep); return ret; } diff -Nru a/fs/locks.c b/fs/locks.c --- a/fs/locks.c 2004-10-06 19:37:47 -07:00 +++ b/fs/locks.c 2004-10-06 19:37:47 -07:00 @@ -1766,7 +1766,12 @@ while ((fl = *before) != NULL) { if (fl->fl_file == filp) { - if (IS_FLOCK(fl)) { + /* + * We might have a POSIX lock that was created at the same time + * the filp was closed for the last time. Just remove that too, + * regardless of ownership, since nobody can own it. + */ + if (IS_FLOCK(fl) || IS_POSIX(fl)) { locks_delete_lock(before); continue; } @@ -1774,9 +1779,7 @@ lease_modify(before, F_UNLCK); continue; } - /* FL_POSIX locks of this process have already been - * removed in filp_close->locks_remove_posix. - */ + /* What? */ BUG(); } before = &fl->fl_next; diff -Nru a/fs/namei.c b/fs/namei.c --- a/fs/namei.c 2004-10-06 19:37:47 -07:00 +++ b/fs/namei.c 2004-10-06 19:37:47 -07:00 @@ -1825,13 +1825,12 @@ dput(dentry); } up(&nd.dentry->d_inode->i_sem); + if (inode) + iput(inode); /* truncate the inode here */ exit1: path_release(&nd); exit: putname(name); - - if (inode) - iput(inode); /* truncate the inode here */ return error; slashes: diff -Nru a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c --- a/fs/ncpfs/dir.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ncpfs/dir.c 2004-10-06 19:37:47 -07:00 @@ -174,7 +174,7 @@ { int res=0x9c,res2; struct nw_modify_dos_info info; - __u32 old_nwattr; + __le32 old_nwattr; struct inode *inode; memset(&info, 0, sizeof(info)); @@ -211,8 +211,8 @@ struct nw_modify_dos_info info; int res=0x90,res2; struct inode *old_inode = old_dentry->d_inode; - __u32 old_nwattr = NCP_FINFO(old_inode)->nwattr; - __u32 new_nwattr = 0; /* shut compiler warning */ + __le32 old_nwattr = NCP_FINFO(old_inode)->nwattr; + __le32 new_nwattr = 0; /* shut compiler warning */ int old_nwattr_changed = 0; int new_nwattr_changed = 0; @@ -395,8 +395,7 @@ if (ncp_obtain_info(server, inode, NULL, &i)) return 0; - return ncp_date_dos2unix(le16_to_cpu(i.modifyTime), - le16_to_cpu(i.modifyDate)); + return ncp_date_dos2unix(i.modifyTime, i.modifyDate); } static int ncp_readdir(struct file *filp, void *dirent, filldir_t filldir) @@ -767,7 +766,9 @@ if (ncp_single_volume(server)) { int len; struct dentry* dent; - __u32 volNumber, dirEntNum, DosDirNum; + __u32 volNumber; + __le32 dirEntNum; + __le32 DosDirNum; __u8 __name[NCP_MAXPATHLEN + 1]; len = sizeof(__name); @@ -886,7 +887,7 @@ } int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode, - dev_t rdev, int attributes) + dev_t rdev, __le32 attributes) { struct ncp_server *server = NCP_SERVER(dir); struct ncp_entry_info finfo; @@ -979,7 +980,8 @@ error = -EACCES; if (ncp_open_create_file_or_subdir(server, dir, __name, - OC_MODE_CREATE, aDIR, 0xffff, + OC_MODE_CREATE, aDIR, + cpu_to_le16(0xffff), &finfo) == 0) { if (ncp_is_nfs_extras(server, finfo.volume)) { @@ -1213,8 +1215,9 @@ /* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */ int -ncp_date_dos2unix(unsigned short time, unsigned short date) +ncp_date_dos2unix(__le16 t, __le16 d) { + unsigned short time = le16_to_cpu(t), date = le16_to_cpu(d); int month, year, secs; /* first subtract and mask after that... Otherwise, if @@ -1231,13 +1234,14 @@ /* Convert linear UNIX date to a MS-DOS time/date pair. */ void -ncp_date_unix2dos(int unix_date, unsigned short *time, unsigned short *date) +ncp_date_unix2dos(int unix_date, __le16 *time, __le16 *date) { int day, year, nl_day, month; unix_date = utc2local(unix_date); - *time = (unix_date % 60) / 2 + (((unix_date / 60) % 60) << 5) + - (((unix_date / 3600) % 24) << 11); + *time = cpu_to_le16( + (unix_date % 60) / 2 + (((unix_date / 60) % 60) << 5) + + (((unix_date / 3600) % 24) << 11)); day = unix_date / 86400 - 3652; year = day / 365; if ((year + 3) / 4 + 365 * year > day) @@ -1252,5 +1256,5 @@ if (day_n[month] > nl_day) break; } - *date = nl_day - day_n[month - 1] + 1 + (month << 5) + (year << 9); + *date = cpu_to_le16(nl_day - day_n[month - 1] + 1 + (month << 5) + (year << 9)); } diff -Nru a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c --- a/fs/ncpfs/inode.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ncpfs/inode.c 2004-10-06 19:37:47 -07:00 @@ -142,12 +142,9 @@ inode->i_blocks = (inode->i_size + NCP_BLOCK_SIZE - 1) >> NCP_BLOCK_SHIFT; - inode->i_mtime.tv_sec = ncp_date_dos2unix(le16_to_cpu(nwi->modifyTime), - le16_to_cpu(nwi->modifyDate)); - inode->i_ctime.tv_sec = ncp_date_dos2unix(le16_to_cpu(nwi->creationTime), - le16_to_cpu(nwi->creationDate)); - inode->i_atime.tv_sec = ncp_date_dos2unix(0, - le16_to_cpu(nwi->lastAccessDate)); + inode->i_mtime.tv_sec = ncp_date_dos2unix(nwi->modifyTime, nwi->modifyDate); + inode->i_ctime.tv_sec = ncp_date_dos2unix(nwi->creationTime, nwi->creationDate); + inode->i_atime.tv_sec = ncp_date_dos2unix(0, nwi->lastAccessDate); inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; inode->i_ctime.tv_nsec = 0; @@ -463,7 +460,7 @@ break; default: error = -ECHRNG; - if (*(__u32*)raw_data == cpu_to_be32(0x76657273)) { + if (memcmp(raw_data, "vers", 4) == 0) { error = ncp_parse_options(&data, raw_data); } if (error) @@ -626,7 +623,7 @@ memset(&finfo, 0, sizeof(finfo)); finfo.i.attributes = aDIR; - finfo.i.dataStreamSize = NCP_BLOCK_SIZE; + finfo.i.dataStreamSize = 0; /* ignored */ finfo.i.dirEntNum = 0; finfo.i.DosDirNum = 0; #ifdef CONFIG_NCPFS_SMALLDOS @@ -795,7 +792,7 @@ { struct inode *inode = dentry->d_inode; int result = 0; - int info_mask; + __le32 info_mask; struct nw_modify_dos_info info; struct ncp_server *server; @@ -918,23 +915,18 @@ if ((attr->ia_valid & ATTR_CTIME) != 0) { info_mask |= (DM_CREATE_TIME | DM_CREATE_DATE); ncp_date_unix2dos(attr->ia_ctime.tv_sec, - &(info.creationTime), &(info.creationDate)); - info.creationTime = le16_to_cpu(info.creationTime); - info.creationDate = le16_to_cpu(info.creationDate); + &info.creationTime, &info.creationDate); } if ((attr->ia_valid & ATTR_MTIME) != 0) { info_mask |= (DM_MODIFY_TIME | DM_MODIFY_DATE); ncp_date_unix2dos(attr->ia_mtime.tv_sec, - &(info.modifyTime), &(info.modifyDate)); - info.modifyTime = le16_to_cpu(info.modifyTime); - info.modifyDate = le16_to_cpu(info.modifyDate); + &info.modifyTime, &info.modifyDate); } if ((attr->ia_valid & ATTR_ATIME) != 0) { - __u16 dummy; + __le16 dummy; info_mask |= (DM_LAST_ACCESS_DATE); ncp_date_unix2dos(attr->ia_atime.tv_sec, - &(dummy), &(info.lastAccessDate)); - info.lastAccessDate = le16_to_cpu(info.lastAccessDate); + &dummy, &info.lastAccessDate); } if (info_mask != 0) { result = ncp_modify_file_or_subdir_dos_info(NCP_SERVER(inode), diff -Nru a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c --- a/fs/ncpfs/ioctl.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ncpfs/ioctl.c 2004-10-06 19:37:47 -07:00 @@ -299,7 +299,9 @@ case NCP_IOC_SETROOT: { struct ncp_setroot_ioctl sr; - __u32 vnum, de, dosde; + __u32 vnum; + __le32 de; + __le32 dosde; struct dentry* dentry; if (!capable(CAP_SYS_ADMIN)) diff -Nru a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c --- a/fs/ncpfs/ncplib_kernel.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ncpfs/ncplib_kernel.c 2004-10-06 19:37:47 -07:00 @@ -29,22 +29,36 @@ return; } -static void ncp_add_word(struct ncp_server *server, __u16 x) +static void ncp_add_word(struct ncp_server *server, __le16 x) { assert_server_locked(server); - put_unaligned(x, (__u16 *) (&(server->packet[server->current_size]))); + put_unaligned(x, (__le16 *) (&(server->packet[server->current_size]))); server->current_size += 2; return; } -static void ncp_add_dword(struct ncp_server *server, __u32 x) +static void ncp_add_be16(struct ncp_server *server, __u16 x) { assert_server_locked(server); - put_unaligned(x, (__u32 *) (&(server->packet[server->current_size]))); + put_unaligned(cpu_to_be16(x), (__be16 *) (&(server->packet[server->current_size]))); + server->current_size += 2; +} + +static void ncp_add_dword(struct ncp_server *server, __le32 x) +{ + assert_server_locked(server); + put_unaligned(x, (__le32 *) (&(server->packet[server->current_size]))); server->current_size += 4; return; } +static void ncp_add_be32(struct ncp_server *server, __u32 x) +{ + assert_server_locked(server); + put_unaligned(cpu_to_be32(x), (__be32 *)(&(server->packet[server->current_size]))); + server->current_size += 4; +} + static inline void ncp_add_dword_lh(struct ncp_server *server, __u32 x) { ncp_add_dword(server, cpu_to_le32(x)); } @@ -107,24 +121,30 @@ static inline __u16 WVAL_LH(void* data) { - return le16_to_cpu(get_unaligned((__u16*)data)); + return le16_to_cpu(get_unaligned((__le16*)data)); +} + +static __u16 + ncp_reply_le16(struct ncp_server *server, int offset) +{ + return le16_to_cpu(get_unaligned((__le16 *) ncp_reply_data(server, offset))); } static __u16 - ncp_reply_word(struct ncp_server *server, int offset) + ncp_reply_be16(struct ncp_server *server, int offset) { - return get_unaligned((__u16 *) ncp_reply_data(server, offset)); + return be16_to_cpu(get_unaligned((__be16 *) ncp_reply_data(server, offset))); } static inline __u32 DVAL_LH(void* data) { - return le32_to_cpu(get_unaligned((__u32*)data)); + return le32_to_cpu(get_unaligned((__le32*)data)); } -static __u32 +static __le32 ncp_reply_dword(struct ncp_server *server, int offset) { - return get_unaligned((__u32 *) ncp_reply_data(server, offset)); + return get_unaligned((__le32 *) ncp_reply_data(server, offset)); } static inline __u32 ncp_reply_dword_lh(struct ncp_server* server, int offset) { @@ -137,13 +157,13 @@ int result; ncp_init_request(server); - ncp_add_word(server, htons(size)); + ncp_add_be16(server, size); if ((result = ncp_request(server, 33)) != 0) { ncp_unlock_server(server); return result; } - *target = min_t(unsigned int, ntohs(ncp_reply_word(server, 0)), size); + *target = min_t(unsigned int, ncp_reply_be16(server, 0), size); ncp_unlock_server(server); return 0; @@ -163,7 +183,7 @@ if (size < NCP_BLOCK_SIZE) size = NCP_BLOCK_SIZE; ncp_init_request(server); - ncp_add_word(server, htons(size)); + ncp_add_be16(server, size); ncp_add_byte(server, options); if ((result = ncp_request(server, 0x61)) != 0) @@ -173,7 +193,7 @@ } /* NCP over UDP returns 0 (!!!) */ - result = ntohs(ncp_reply_word(server, 0)); + result = ncp_reply_be16(server, 0); if (result >= NCP_BLOCK_SIZE) size = min(result, size); *ret_size = size; @@ -286,7 +306,7 @@ } static void ncp_add_handle_path(struct ncp_server *server, __u8 vol_num, - __u32 dir_base, int have_dir_base, + __le32 dir_base, int have_dir_base, const char *path) { ncp_add_byte(server, vol_num); @@ -304,7 +324,7 @@ } } -int ncp_dirhandle_alloc(struct ncp_server* server, __u8 volnum, __u32 dirent, +int ncp_dirhandle_alloc(struct ncp_server* server, __u8 volnum, __le32 dirent, __u8* dirhandle) { int result; @@ -403,7 +423,7 @@ struct nw_info_struct *target) { __u8 volnum = NCP_FINFO(dir)->volNumber; - __u32 dirent = NCP_FINFO(dir)->dirEntNum; + __le32 dirent = NCP_FINFO(dir)->dirEntNum; int result; if (target == NULL) { @@ -414,7 +434,7 @@ ncp_add_byte(server, 6); /* subfunction */ ncp_add_byte(server, server->name_space[volnum]); ncp_add_byte(server, server->name_space[volnum]); /* N.B. twice ?? */ - ncp_add_word(server, htons(0x0680)); /* get all */ + ncp_add_word(server, cpu_to_le16(0x8006)); /* get all */ ncp_add_dword(server, RIM_ALL); ncp_add_handle_path(server, volnum, dirent, 1, path); @@ -434,9 +454,9 @@ #ifdef CONFIG_NCPFS_NFS_NS static int ncp_obtain_DOS_dir_base(struct ncp_server *server, - __u8 volnum, __u32 dirent, + __u8 volnum, __le32 dirent, char *path, /* At most 1 component */ - __u32 *DOS_dir_base) + __le32 *DOS_dir_base) { int result; @@ -444,7 +464,7 @@ ncp_add_byte(server, 6); /* subfunction */ ncp_add_byte(server, server->name_space[volnum]); ncp_add_byte(server, server->name_space[volnum]); - ncp_add_word(server, htons(0x0680)); /* get all */ + ncp_add_word(server, cpu_to_le16(0x8006)); /* get all */ ncp_add_dword(server, RIM_DIRECTORY); ncp_add_handle_path(server, volnum, dirent, 1, path); @@ -476,7 +496,7 @@ } result = NW_NS_DOS; - no_namespaces = le16_to_cpu(ncp_reply_word(server, 0)); + no_namespaces = ncp_reply_le16(server, 0); namespace = ncp_reply_data(server, 2); while (no_namespaces > 0) { @@ -507,9 +527,9 @@ static int ncp_ObtainSpecificDirBase(struct ncp_server *server, - __u8 nsSrc, __u8 nsDst, __u8 vol_num, __u32 dir_base, + __u8 nsSrc, __u8 nsDst, __u8 vol_num, __le32 dir_base, char *path, /* At most 1 component */ - __u32 *dirEntNum, __u32 *DosDirNum) + __le32 *dirEntNum, __le32 *DosDirNum) { int result; @@ -517,7 +537,7 @@ ncp_add_byte(server, 6); /* subfunction */ ncp_add_byte(server, nsSrc); ncp_add_byte(server, nsDst); - ncp_add_word(server, htons(0x0680)); /* get all */ + ncp_add_word(server, cpu_to_le16(0x8006)); /* get all */ ncp_add_dword(server, RIM_ALL); ncp_add_handle_path(server, vol_num, dir_base, 1, path); @@ -537,8 +557,8 @@ int ncp_mount_subdir(struct ncp_server *server, - __u8 volNumber, __u8 srcNS, __u32 dirEntNum, - __u32* volume, __u32* newDirEnt, __u32* newDosEnt) + __u8 volNumber, __u8 srcNS, __le32 dirEntNum, + __u32* volume, __le32* newDirEnt, __le32* newDosEnt) { int dstNS; int result; @@ -558,7 +578,7 @@ int ncp_get_volume_root(struct ncp_server *server, const char *volname, - __u32* volume, __u32* dirent, __u32* dosdirent) + __u32* volume, __le32* dirent, __le32* dosdirent) { int result; __u8 volnum; @@ -620,18 +640,18 @@ int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *server, struct inode *dir, const char *path, - __u32 info_mask, + __le32 info_mask, const struct nw_modify_dos_info *info) { __u8 volnum = NCP_FINFO(dir)->volNumber; - __u32 dirent = NCP_FINFO(dir)->dirEntNum; + __le32 dirent = NCP_FINFO(dir)->dirEntNum; int result; ncp_init_request(server); ncp_add_byte(server, 7); /* subfunction */ ncp_add_byte(server, server->name_space[volnum]); ncp_add_byte(server, 0); /* reserved */ - ncp_add_word(server, htons(0x0680)); /* search attribs: all */ + ncp_add_word(server, cpu_to_le16(0x8006)); /* search attribs: all */ ncp_add_dword(server, info_mask); ncp_add_mem(server, info, sizeof(*info)); @@ -644,7 +664,7 @@ int ncp_modify_file_or_subdir_dos_info(struct ncp_server *server, struct inode *dir, - __u32 info_mask, + __le32 info_mask, const struct nw_modify_dos_info *info) { return ncp_modify_file_or_subdir_dos_info_path(server, dir, NULL, @@ -652,7 +672,7 @@ } #ifdef CONFIG_NCPFS_NFS_NS -int ncp_modify_nfs_info(struct ncp_server *server, __u8 volnum, __u32 dirent, +int ncp_modify_nfs_info(struct ncp_server *server, __u8 volnum, __le32 dirent, __u32 mode, __u32 rdev) { @@ -681,8 +701,8 @@ static int ncp_DeleteNSEntry(struct ncp_server *server, - __u8 have_dir_base, __u8 volnum, __u32 dirent, - char* name, __u8 ns, int attr) + __u8 have_dir_base, __u8 volnum, __le32 dirent, + char* name, __u8 ns, __le16 attr) { int result; @@ -704,7 +724,7 @@ { struct inode *inode = dentry->d_inode; __u8 volnum; - __u32 dirent; + __le32 dirent; if (!inode) { #ifdef CONFIG_NCPFS_DEBUGDENTRY @@ -714,7 +734,7 @@ } volnum = NCP_FINFO(inode)->volNumber; dirent = NCP_FINFO(inode)->DosDirNum; - return ncp_DeleteNSEntry(server, 1, volnum, dirent, NULL, NW_NS_DOS, htons(0x0680)); + return ncp_DeleteNSEntry(server, 1, volnum, dirent, NULL, NW_NS_DOS, cpu_to_le16(0x8006)); } int @@ -722,7 +742,7 @@ struct inode *dir, char *name) { __u8 volnum = NCP_FINFO(dir)->volNumber; - __u32 dirent = NCP_FINFO(dir)->dirEntNum; + __le32 dirent = NCP_FINFO(dir)->dirEntNum; #ifdef CONFIG_NCPFS_NFS_NS if (server->name_space[volnum]==NW_NS_NFS) @@ -731,18 +751,19 @@ result=ncp_obtain_DOS_dir_base(server, volnum, dirent, name, &dirent); if (result) return result; - return ncp_DeleteNSEntry(server, 1, volnum, dirent, NULL, NW_NS_DOS, htons(0x0680)); + return ncp_DeleteNSEntry(server, 1, volnum, dirent, NULL, NW_NS_DOS, cpu_to_le16(0x8006)); } else #endif /* CONFIG_NCPFS_NFS_NS */ - return ncp_DeleteNSEntry(server, 1, volnum, dirent, name, server->name_space[volnum], htons(0x0680)); + return ncp_DeleteNSEntry(server, 1, volnum, dirent, name, server->name_space[volnum], cpu_to_le16(0x8006)); } -static inline void ConvertToNWfromDWORD(__u32 sfd, __u8 ret[6]) +static inline void ConvertToNWfromDWORD(__u16 v0, __u16 v1, __u8 ret[6]) { - __u16 *dest = (__u16 *) ret; - memcpy(ret + 2, &sfd, 4); - dest[0] = cpu_to_le16((le16_to_cpu(dest[1]) + le16_to_cpu(1))); + __le16 *dest = (__le16 *) ret; + dest[1] = cpu_to_le16(v0); + dest[2] = cpu_to_le16(v1); + dest[0] = cpu_to_le16(v0 + 1); return; } @@ -751,20 +772,20 @@ int ncp_open_create_file_or_subdir(struct ncp_server *server, struct inode *dir, char *name, int open_create_mode, - __u32 create_attributes, - int desired_acc_rights, + __le32 create_attributes, + __le16 desired_acc_rights, struct ncp_entry_info *target) { - __u16 search_attribs = ntohs(0x0600); + __le16 search_attribs = cpu_to_le16(0x0006); __u8 volnum; - __u32 dirent; + __le32 dirent; int result; volnum = NCP_FINFO(dir)->volNumber; dirent = NCP_FINFO(dir)->dirEntNum; if ((create_attributes & aDIR) != 0) { - search_attribs |= ntohs(0x0080); + search_attribs |= cpu_to_le16(0x8000); } ncp_init_request(server); ncp_add_byte(server, 1); /* subfunction */ @@ -786,7 +807,9 @@ /* in target there's a new finfo to fill */ ncp_extract_file_info(ncp_reply_data(server, 6), &(target->i)); target->volume = target->i.volNumber; - ConvertToNWfromDWORD(ncp_reply_dword(server, 0), target->file_handle); + ConvertToNWfromDWORD(ncp_reply_le16(server, 0), + ncp_reply_le16(server, 2), + target->file_handle); ncp_unlock_server(server); @@ -803,7 +826,7 @@ struct nw_search_sequence *target) { __u8 volnum = NCP_FINFO(dir)->volNumber; - __u32 dirent = NCP_FINFO(dir)->dirEntNum; + __le32 dirent = NCP_FINFO(dir)->dirEntNum; int result; ncp_init_request(server); @@ -833,7 +856,7 @@ ncp_add_byte(server, 3); /* subfunction */ ncp_add_byte(server, server->name_space[seq->volNumber]); ncp_add_byte(server, 0); /* data stream (???) */ - ncp_add_word(server, htons(0x0680)); /* Search attribs */ + ncp_add_word(server, cpu_to_le16(0x8006)); /* Search attribs */ ncp_add_dword(server, RIM_ALL); /* return info mask */ ncp_add_mem(server, seq, 9); #ifdef CONFIG_NCPFS_NFS_NS @@ -877,9 +900,9 @@ ncp_add_byte(server, 20); ncp_add_byte(server, server->name_space[seq->volNumber]); ncp_add_byte(server, 0); /* datastream */ - ncp_add_word(server, htons(0x0680)); + ncp_add_word(server, cpu_to_le16(0x8006)); ncp_add_dword(server, RIM_ALL); - ncp_add_word(server, 32767); /* max returned items */ + ncp_add_word(server, cpu_to_le16(32767)); /* max returned items */ ncp_add_mem(server, seq, 9); #ifdef CONFIG_NCPFS_NFS_NS if (server->name_space[seq->volNumber] == NW_NS_NFS) { @@ -912,7 +935,7 @@ int ncp_RenameNSEntry(struct ncp_server *server, - struct inode *old_dir, char *old_name, int old_type, + struct inode *old_dir, char *old_name, __le16 old_type, struct inode *new_dir, char *new_name) { int result = -EINVAL; @@ -955,14 +978,14 @@ struct inode *new_dir, char *new_name) { int result; - int old_type = htons(0x0600); + __le16 old_type = cpu_to_le16(0x06); /* If somebody can do it atomic, call me... vandrove@vc.cvut.cz */ result = ncp_RenameNSEntry(server, old_dir, old_name, old_type, new_dir, new_name); if (result == 0xFF) /* File Not Found, try directory */ { - old_type = htons(0x1600); + old_type = cpu_to_le16(0x16); result = ncp_RenameNSEntry(server, old_dir, old_name, old_type, new_dir, new_name); } @@ -986,13 +1009,13 @@ ncp_init_request(server); ncp_add_byte(server, 0); ncp_add_mem(server, file_id, 6); - ncp_add_dword(server, htonl(offset)); - ncp_add_word(server, htons(to_read)); + ncp_add_be32(server, offset); + ncp_add_be16(server, to_read); if ((result = ncp_request(server, 72)) != 0) { goto out; } - *bytes_read = ntohs(ncp_reply_word(server, 0)); + *bytes_read = ncp_reply_be16(server, 0); source = ncp_reply_data(server, 2 + (offset & 1)); memcpy(target, source, *bytes_read); @@ -1022,12 +1045,12 @@ ncp_init_request(server); ncp_add_byte(server, 0); ncp_add_mem(server, file_id, 6); - ncp_add_dword(server, htonl(offset)); - ncp_add_word(server, htons(to_read)); + ncp_add_be32(server, offset); + ncp_add_be16(server, to_read); result = ncp_request2(server, 72, bounce, bufsize); ncp_unlock_server(server); if (!result) { - int len = be16_to_cpu(get_unaligned((__u16*)((char*)bounce + + int len = be16_to_cpu(get_unaligned((__be16*)((char*)bounce + sizeof(struct ncp_reply_header)))); result = -EIO; if (len <= to_read) { @@ -1055,8 +1078,8 @@ ncp_init_request(server); ncp_add_byte(server, 0); ncp_add_mem(server, file_id, 6); - ncp_add_dword(server, htonl(offset)); - ncp_add_word(server, htons(to_write)); + ncp_add_be32(server, offset); + ncp_add_be16(server, to_write); ncp_add_mem(server, source, to_write); if ((result = ncp_request(server, 73)) == 0) @@ -1075,9 +1098,9 @@ ncp_init_request(server); ncp_add_byte(server, locktype); ncp_add_mem(server, file_id, 6); - ncp_add_dword(server, htonl(offset)); - ncp_add_dword(server, htonl(length)); - ncp_add_word(server, htons(timeout)); + ncp_add_be32(server, offset); + ncp_add_be32(server, length); + ncp_add_be16(server, timeout); if ((result = ncp_request(server, 0x1A)) != 0) { @@ -1097,8 +1120,8 @@ ncp_init_request(server); ncp_add_byte(server, 0); /* who knows... lanalyzer says that */ ncp_add_mem(server, file_id, 6); - ncp_add_dword(server, htonl(offset)); - ncp_add_dword(server, htonl(length)); + ncp_add_be32(server, offset); + ncp_add_be32(server, length); if ((result = ncp_request(server, 0x1E)) != 0) { diff -Nru a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h --- a/fs/ncpfs/ncplib_kernel.h 2004-10-06 19:37:47 -07:00 +++ b/fs/ncpfs/ncplib_kernel.h 2004-10-06 19:37:47 -07:00 @@ -71,19 +71,19 @@ struct nw_info_struct *target); int ncp_obtain_nfs_info(struct ncp_server *server, struct nw_info_struct *target); int ncp_get_volume_root(struct ncp_server *server, const char *volname, - __u32 *volume, __u32 *dirent, __u32 *dosdirent); + __u32 *volume, __le32 *dirent, __le32 *dosdirent); int ncp_lookup_volume(struct ncp_server *, const char *, struct nw_info_struct *); int ncp_modify_file_or_subdir_dos_info(struct ncp_server *, struct inode *, - __u32, const struct nw_modify_dos_info *info); + __le32, const struct nw_modify_dos_info *info); int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *, struct inode *, - const char* path, __u32, const struct nw_modify_dos_info *info); -int ncp_modify_nfs_info(struct ncp_server *, __u8 volnum, __u32 dirent, + const char* path, __le32, const struct nw_modify_dos_info *info); +int ncp_modify_nfs_info(struct ncp_server *, __u8 volnum, __le32 dirent, __u32 mode, __u32 rdev); int ncp_del_file_or_subdir2(struct ncp_server *, struct dentry*); int ncp_del_file_or_subdir(struct ncp_server *, struct inode *, char *); int ncp_open_create_file_or_subdir(struct ncp_server *, struct inode *, char *, - int, __u32, int, struct ncp_entry_info *); + int, __le32, __le16, struct ncp_entry_info *); int ncp_initialize_search(struct ncp_server *, struct inode *, struct nw_search_sequence *target); @@ -113,13 +113,13 @@ #endif /* CONFIG_NCPFS_IOCTL_LOCKING */ int -ncp_mount_subdir(struct ncp_server *, __u8, __u8, __u32, - __u32* volume, __u32* dirent, __u32* dosdirent); -int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __u32 dirent, __u8 *dirhandle); +ncp_mount_subdir(struct ncp_server *, __u8, __u8, __le32, + __u32* volume, __le32* dirent, __le32* dosdirent); +int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __le32 dirent, __u8 *dirhandle); int ncp_dirhandle_free(struct ncp_server *, __u8 dirhandle); int ncp_create_new(struct inode *dir, struct dentry *dentry, - int mode, dev_t rdev, int attributes); + int mode, dev_t rdev, __le32 attributes); static inline int ncp_is_nfs_extras(struct ncp_server* server, unsigned int volnum) { #ifdef CONFIG_NCPFS_NFS_NS diff -Nru a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c --- a/fs/ncpfs/sock.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ncpfs/sock.c 2004-10-06 19:37:47 -07:00 @@ -337,7 +337,7 @@ { if (server->info_sock) { struct kvec iov[2]; - __u32 hdr[2]; + __be32 hdr[2]; hdr[0] = cpu_to_be32(len + 8); hdr[1] = cpu_to_be32(id); diff -Nru a/fs/ncpfs/symlink.c b/fs/ncpfs/symlink.c --- a/fs/ncpfs/symlink.c 2004-10-06 19:37:48 -07:00 +++ b/fs/ncpfs/symlink.c 2004-10-06 19:37:48 -07:00 @@ -36,8 +36,8 @@ /* these magic numbers must appear in the symlink file -- this makes it a bit more resilient against the magic attributes being set on random files. */ -#define NCP_SYMLINK_MAGIC0 le32_to_cpu(0x6c6d7973) /* "symlnk->" */ -#define NCP_SYMLINK_MAGIC1 le32_to_cpu(0x3e2d6b6e) +#define NCP_SYMLINK_MAGIC0 cpu_to_le32(0x6c6d7973) /* "symlnk->" */ +#define NCP_SYMLINK_MAGIC1 cpu_to_le32(0x3e2d6b6e) /* ----- read a symbolic link ------------------------------------------ */ @@ -67,8 +67,8 @@ if (NCP_FINFO(inode)->flags & NCPI_KLUDGE_SYMLINK) { if (lengthal_entry but it was still set due to + changes in ntfs_attr_lookup() and ntfs_external_attr_find() in + particular. + - Fix another stupid bug in fs/ntfs/attrib.c::ntfs_external_attr_find() + where we forgot to unmap the extent mft record when we had finished + enumerating an attribute which caused a bug check to trigger when the + VFS calls ->clear_inode. + 2.1.19 - Many cleanups, improvements, and a minor bug fix. - Update ->setattr (fs/ntfs/inode.c::ntfs_setattr()) to refuse to diff -Nru a/fs/ntfs/Makefile b/fs/ntfs/Makefile --- a/fs/ntfs/Makefile 2004-10-06 19:37:47 -07:00 +++ b/fs/ntfs/Makefile 2004-10-06 19:37:47 -07:00 @@ -6,7 +6,7 @@ index.o inode.o mft.o mst.o namei.o super.o sysctl.o unistr.o \ upcase.o -EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.19\" +EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.20\" ifeq ($(CONFIG_NTFS_DEBUG),y) EXTRA_CFLAGS += -DDEBUG diff -Nru a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c --- a/fs/ntfs/attrib.c 2004-10-06 19:37:48 -07:00 +++ b/fs/ntfs/attrib.c 2004-10-06 19:37:48 -07:00 @@ -1738,11 +1738,13 @@ * correctly yet as we do not know what @ctx->attr will be set to by * the call to ntfs_attr_find() below. */ + if (ni != base_ni) + unmap_extent_mft_record(ni); ctx->mrec = ctx->base_mrec; ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + le16_to_cpu(ctx->mrec->attrs_offset)); ctx->is_first = TRUE; - ctx->ntfs_ino = ctx->base_ntfs_ino; + ctx->ntfs_ino = base_ni; ctx->base_ntfs_ino = NULL; ctx->base_mrec = NULL; ctx->base_attr = NULL; @@ -1861,6 +1863,11 @@ /* Sanity checks are performed elsewhere. */ ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec + le16_to_cpu(ctx->mrec->attrs_offset)); + /* + * This needs resetting due to ntfs_external_attr_find() which + * can leave it set despite having zeroed ctx->base_ntfs_ino. + */ + ctx->al_entry = NULL; return; } /* Attribute list. */ if (ctx->ntfs_ino != ctx->base_ntfs_ino) diff -Nru a/fs/partitions/acorn.c b/fs/partitions/acorn.c --- a/fs/partitions/acorn.c 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/acorn.c 2004-10-06 19:37:47 -07:00 @@ -53,16 +53,16 @@ #ifdef CONFIG_ACORN_PARTITION_RISCIX struct riscix_part { - __u32 start; - __u32 length; - __u32 one; + __le32 start; + __le32 length; + __le32 one; char name[16]; }; struct riscix_record { - __u32 magic; + __le32 magic; #define RISCIX_MAGIC cpu_to_le32(0x4a657320) - __u32 date; + __le32 date; struct riscix_part part[8]; }; @@ -111,9 +111,9 @@ #define LINUX_SWAP_MAGIC 0xdeafab1e struct linux_part { - __u32 magic; - __u32 start_sect; - __u32 nr_sects; + __le32 magic; + __le32 start_sect; + __le32 nr_sects; }; static int @@ -306,8 +306,8 @@ #ifdef CONFIG_ACORN_PARTITION_ICS struct ics_part { - __u32 start; - __s32 size; + __le32 start; + __le32 size; }; static int adfspart_check_ICSLinux(struct block_device *bdev, unsigned long block) @@ -336,7 +336,7 @@ for (i = 0, sum = 0x50617274; i < 508; i++) sum += data[i]; - sum -= le32_to_cpu(*(__u32 *)(&data[508])); + sum -= le32_to_cpu(*(__le32 *)(&data[508])); return sum == 0; } @@ -412,11 +412,11 @@ #ifdef CONFIG_ACORN_PARTITION_POWERTEC struct ptec_part { - __u32 unused1; - __u32 unused2; - __u32 start; - __u32 size; - __u32 unused5; + __le32 unused1; + __le32 unused2; + __le32 start; + __le32 size; + __le32 unused5; char type[8]; }; @@ -486,10 +486,10 @@ struct eesox_part { char magic[6]; char name[10]; - u32 start; - u32 unused6; - u32 unused7; - u32 unused8; + __le32 start; + __le32 unused6; + __le32 unused7; + __le32 unused8; }; /* diff -Nru a/fs/partitions/amiga.c b/fs/partitions/amiga.c --- a/fs/partitions/amiga.c 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/amiga.c 2004-10-06 19:37:47 -07:00 @@ -14,7 +14,7 @@ #include "amiga.h" static __inline__ u32 -checksum_block(u32 *m, int size) +checksum_block(__be32 *m, int size) { u32 sum = 0; @@ -45,17 +45,17 @@ bdevname(bdev, b), blk); goto rdb_done; } - if (*(u32 *)data != cpu_to_be32(IDNAME_RIGIDDISK)) + if (*(__be32 *)data != cpu_to_be32(IDNAME_RIGIDDISK)) continue; rdb = (struct RigidDiskBlock *)data; - if (checksum_block((u32 *)data, be32_to_cpu(rdb->rdb_SummedLongs) & 0x7F) == 0) + if (checksum_block((__be32 *)data, be32_to_cpu(rdb->rdb_SummedLongs) & 0x7F) == 0) break; /* Try again with 0xdc..0xdf zeroed, Windows might have * trashed it. */ - *(u32 *)(data+0xdc) = 0; - if (checksum_block((u32 *)data, + *(__be32 *)(data+0xdc) = 0; + if (checksum_block((__be32 *)data, be32_to_cpu(rdb->rdb_SummedLongs) & 0x7F)==0) { printk("Warning: Trashed word at 0xd0 in block %d " "ignored in checksum calculation\n",blk); @@ -85,7 +85,7 @@ blk = be32_to_cpu(pb->pb_Next); if (pb->pb_ID != cpu_to_be32(IDNAME_PARTITION)) continue; - if (checksum_block((u32 *)pb, be32_to_cpu(pb->pb_SummedLongs) & 0x7F) != 0 ) + if (checksum_block((__be32 *)pb, be32_to_cpu(pb->pb_SummedLongs) & 0x7F) != 0 ) continue; /* Tell Kernel about it */ @@ -105,7 +105,7 @@ { /* Be even more informative to aid mounting */ char dostype[4]; - u32 *dt = (u32 *)dostype; + __be32 *dt = (__be32 *)dostype; *dt = pb->pb_Environment[16]; if (dostype[3] < ' ') printk(" (%c%c%c^%c)", diff -Nru a/fs/partitions/atari.h b/fs/partitions/atari.h --- a/fs/partitions/atari.h 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/atari.h 2004-10-06 19:37:47 -07:00 @@ -15,8 +15,8 @@ { u8 flg; /* bit 0: active; bit 7: bootable */ char id[3]; /* "GEM", "BGM", "XGM", or other */ - u32 st; /* start of partition */ - u32 siz; /* length of partition */ + __be32 st; /* start of partition */ + __be32 siz; /* length of partition */ }; struct rootsector diff -Nru a/fs/partitions/efi.h b/fs/partitions/efi.h --- a/fs/partitions/efi.h 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/efi.h 2004-10-06 19:37:47 -07:00 @@ -66,20 +66,20 @@ 0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28) typedef struct _gpt_header { - u64 signature; - u32 revision; - u32 header_size; - u32 header_crc32; - u32 reserved1; - u64 my_lba; - u64 alternate_lba; - u64 first_usable_lba; - u64 last_usable_lba; + __le64 signature; + __le32 revision; + __le32 header_size; + __le32 header_crc32; + __le32 reserved1; + __le64 my_lba; + __le64 alternate_lba; + __le64 first_usable_lba; + __le64 last_usable_lba; efi_guid_t disk_guid; - u64 partition_entry_lba; - u32 num_partition_entries; - u32 sizeof_partition_entry; - u32 partition_entry_array_crc32; + __le64 partition_entry_lba; + __le32 num_partition_entries; + __le32 sizeof_partition_entry; + __le32 partition_entry_array_crc32; u8 reserved2[GPT_BLOCK_SIZE - 92]; } __attribute__ ((packed)) gpt_header; @@ -92,18 +92,18 @@ typedef struct _gpt_entry { efi_guid_t partition_type_guid; efi_guid_t unique_partition_guid; - u64 starting_lba; - u64 ending_lba; + __le64 starting_lba; + __le64 ending_lba; gpt_entry_attributes attributes; efi_char16_t partition_name[72 / sizeof (efi_char16_t)]; } __attribute__ ((packed)) gpt_entry; typedef struct _legacy_mbr { u8 boot_code[440]; - u32 unique_mbr_signature; - u16 unknown; + __le32 unique_mbr_signature; + __le16 unknown; struct partition partition_record[4]; - u16 signature; + __le16 signature; } __attribute__ ((packed)) legacy_mbr; /* Functions */ diff -Nru a/fs/partitions/ldm.c b/fs/partitions/ldm.c --- a/fs/partitions/ldm.c 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/ldm.c 2004-10-06 19:37:47 -07:00 @@ -566,7 +566,7 @@ return FALSE; } - if (*(u16*) (data + 0x01FE) != cpu_to_le16 (MSDOS_LABEL_MAGIC)) + if (*(__le16*) (data + 0x01FE) != cpu_to_le16 (MSDOS_LABEL_MAGIC)) goto out; p = (struct partition*)(data + 0x01BE); diff -Nru a/fs/partitions/ldm.h b/fs/partitions/ldm.h --- a/fs/partitions/ldm.h 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/ldm.h 2004-10-06 19:37:47 -07:00 @@ -99,9 +99,9 @@ #define TOC_BITMAP2 "log" /* bitmaps in the TOCBLOCK. */ /* Most numbers we deal with are big-endian and won't be aligned. */ -#define BE16(x) ((u16)be16_to_cpu(get_unaligned((u16*)(x)))) -#define BE32(x) ((u32)be32_to_cpu(get_unaligned((u32*)(x)))) -#define BE64(x) ((u64)be64_to_cpu(get_unaligned((u64*)(x)))) +#define BE16(x) ((u16)be16_to_cpu(get_unaligned((__be16*)(x)))) +#define BE32(x) ((u32)be32_to_cpu(get_unaligned((__be32*)(x)))) +#define BE64(x) ((u64)be64_to_cpu(get_unaligned((__be64*)(x)))) /* Borrowed from msdos.c */ #define SYS_IND(p) (get_unaligned(&(p)->sys_ind)) diff -Nru a/fs/partitions/mac.h b/fs/partitions/mac.h --- a/fs/partitions/mac.h 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/mac.h 2004-10-06 19:37:47 -07:00 @@ -8,23 +8,23 @@ #define APPLE_AUX_TYPE "Apple_UNIX_SVR2" struct mac_partition { - __u16 signature; /* expected to be MAC_PARTITION_MAGIC */ - __u16 res1; - __u32 map_count; /* # blocks in partition map */ - __u32 start_block; /* absolute starting block # of partition */ - __u32 block_count; /* number of blocks in partition */ + __be16 signature; /* expected to be MAC_PARTITION_MAGIC */ + __be16 res1; + __be32 map_count; /* # blocks in partition map */ + __be32 start_block; /* absolute starting block # of partition */ + __be32 block_count; /* number of blocks in partition */ char name[32]; /* partition name */ char type[32]; /* string type description */ - __u32 data_start; /* rel block # of first data block */ - __u32 data_count; /* number of data blocks */ - __u32 status; /* partition status bits */ - __u32 boot_start; - __u32 boot_size; - __u32 boot_load; - __u32 boot_load2; - __u32 boot_entry; - __u32 boot_entry2; - __u32 boot_cksum; + __be32 data_start; /* rel block # of first data block */ + __be32 data_count; /* number of data blocks */ + __be32 status; /* partition status bits */ + __be32 boot_start; + __be32 boot_size; + __be32 boot_load; + __be32 boot_load2; + __be32 boot_entry; + __be32 boot_entry2; + __be32 boot_cksum; char processor[16]; /* identifies ISA of boot */ /* there is more stuff after this that we don't need */ }; @@ -35,9 +35,9 @@ /* Driver descriptor structure, in block 0 */ struct mac_driver_desc { - __u16 signature; /* expected to be MAC_DRIVER_MAGIC */ - __u16 block_size; - __u32 block_count; + __be16 signature; /* expected to be MAC_DRIVER_MAGIC */ + __be16 block_size; + __be32 block_count; /* ... more stuff */ }; diff -Nru a/fs/partitions/osf.c b/fs/partitions/osf.c --- a/fs/partitions/osf.c 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/osf.c 2004-10-06 19:37:47 -07:00 @@ -17,34 +17,34 @@ Sector sect; unsigned char *data; struct disklabel { - u32 d_magic; - u16 d_type,d_subtype; + __le32 d_magic; + __le16 d_type,d_subtype; u8 d_typename[16]; u8 d_packname[16]; - u32 d_secsize; - u32 d_nsectors; - u32 d_ntracks; - u32 d_ncylinders; - u32 d_secpercyl; - u32 d_secprtunit; - u16 d_sparespertrack; - u16 d_sparespercyl; - u32 d_acylinders; - u16 d_rpm, d_interleave, d_trackskew, d_cylskew; - u32 d_headswitch, d_trkseek, d_flags; - u32 d_drivedata[5]; - u32 d_spare[5]; - u32 d_magic2; - u16 d_checksum; - u16 d_npartitions; - u32 d_bbsize, d_sbsize; + __le32 d_secsize; + __le32 d_nsectors; + __le32 d_ntracks; + __le32 d_ncylinders; + __le32 d_secpercyl; + __le32 d_secprtunit; + __le16 d_sparespertrack; + __le16 d_sparespercyl; + __le32 d_acylinders; + __le16 d_rpm, d_interleave, d_trackskew, d_cylskew; + __le32 d_headswitch, d_trkseek, d_flags; + __le32 d_drivedata[5]; + __le32 d_spare[5]; + __le32 d_magic2; + __le16 d_checksum; + __le16 d_npartitions; + __le32 d_bbsize, d_sbsize; struct d_partition { - u32 p_size; - u32 p_offset; - u32 p_fsize; + __le32 p_size; + __le32 p_offset; + __le32 p_fsize; u8 p_fstype; u8 p_frag; - u16 p_cpg; + __le16 p_cpg; } d_partitions[8]; } * label; struct d_partition * partition; diff -Nru a/fs/partitions/sgi.c b/fs/partitions/sgi.c --- a/fs/partitions/sgi.c 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/sgi.c 2004-10-06 19:37:47 -07:00 @@ -8,30 +8,32 @@ #include "sgi.h" struct sgi_disklabel { - s32 magic_mushroom; /* Big fat spliff... */ - s16 root_part_num; /* Root partition number */ - s16 swap_part_num; /* Swap partition number */ + __be32 magic_mushroom; /* Big fat spliff... */ + __be16 root_part_num; /* Root partition number */ + __be16 swap_part_num; /* Swap partition number */ s8 boot_file[16]; /* Name of boot file for ARCS */ u8 _unused0[48]; /* Device parameter useless crapola.. */ struct sgi_volume { s8 name[8]; /* Name of volume */ - s32 block_num; /* Logical block number */ - s32 num_bytes; /* How big, in bytes */ + __be32 block_num; /* Logical block number */ + __be32 num_bytes; /* How big, in bytes */ } volume[15]; struct sgi_partition { - u32 num_blocks; /* Size in logical blocks */ - u32 first_block; /* First logical block */ - s32 type; /* Type of this partition */ + __be32 num_blocks; /* Size in logical blocks */ + __be32 first_block; /* First logical block */ + __be32 type; /* Type of this partition */ } partitions[16]; - s32 csum; /* Disk label checksum */ - s32 _unused1; /* Padding */ + __be32 csum; /* Disk label checksum */ + __be32 _unused1; /* Padding */ }; int sgi_partition(struct parsed_partitions *state, struct block_device *bdev) { - int i, csum, magic; + int i, csum; + __be32 magic; int slot = 1; - unsigned int *ui, start, blocks, cs; + unsigned int start, blocks; + __be32 *ui, cs; Sector sect; struct sgi_disklabel *label; struct sgi_partition *p; @@ -44,12 +46,12 @@ magic = label->magic_mushroom; if(be32_to_cpu(magic) != SGI_LABEL_MAGIC) { /*printk("Dev %s SGI disklabel: bad magic %08x\n", - bdevname(bdev, b), magic);*/ + bdevname(bdev, b), be32_to_cpu(magic));*/ put_dev_sector(sect); return 0; } - ui = ((unsigned int *) (label + 1)) - 1; - for(csum = 0; ui >= ((unsigned int *) label);) { + ui = ((__be32 *) (label + 1)) - 1; + for(csum = 0; ui >= ((__be32 *) label);) { cs = *ui--; csum += be32_to_cpu(cs); } diff -Nru a/fs/partitions/sun.c b/fs/partitions/sun.c --- a/fs/partitions/sun.c 2004-10-06 19:37:47 -07:00 +++ b/fs/partitions/sun.c 2004-10-06 19:37:47 -07:00 @@ -12,9 +12,10 @@ int sun_partition(struct parsed_partitions *state, struct block_device *bdev) { - int i, csum; + int i; + __be16 csum; int slot = 1; - unsigned short *ush; + __be16 *ush; Sector sect; struct sun_disklabel { unsigned char info[128]; /* Informative text string */ @@ -26,22 +27,22 @@ unsigned char flags; } infos[8]; unsigned char spare[246]; /* Boot information etc. */ - unsigned short rspeed; /* Disk rotational speed */ - unsigned short pcylcount; /* Physical cylinder count */ - unsigned short sparecyl; /* extra sects per cylinder */ + __be16 rspeed; /* Disk rotational speed */ + __be16 pcylcount; /* Physical cylinder count */ + __be16 sparecyl; /* extra sects per cylinder */ unsigned char spare2[4]; /* More magic... */ - unsigned short ilfact; /* Interleave factor */ - unsigned short ncyl; /* Data cylinder count */ - unsigned short nacyl; /* Alt. cylinder count */ - unsigned short ntrks; /* Tracks per cylinder */ - unsigned short nsect; /* Sectors per track */ + __be16 ilfact; /* Interleave factor */ + __be16 ncyl; /* Data cylinder count */ + __be16 nacyl; /* Alt. cylinder count */ + __be16 ntrks; /* Tracks per cylinder */ + __be16 nsect; /* Sectors per track */ unsigned char spare3[4]; /* Even more magic... */ struct sun_partition { - __u32 start_cylinder; - __u32 num_sectors; + __be32 start_cylinder; + __be32 num_sectors; } partitions[8]; - unsigned short magic; /* Magic number */ - unsigned short csum; /* Label xor'd checksum */ + __be16 magic; /* Magic number */ + __be16 csum; /* Label xor'd checksum */ } * label; struct sun_partition *p; unsigned long spc; @@ -59,8 +60,8 @@ return 0; } /* Look at the checksum */ - ush = ((unsigned short *) (label+1)) - 1; - for (csum = 0; ush >= ((unsigned short *) label);) + ush = ((__be16 *) (label+1)) - 1; + for (csum = 0; ush >= ((__be16 *) label);) csum ^= *ush--; if (csum) { printk("Dev %s Sun disklabel: Csum bad, label corrupted\n", diff -Nru a/fs/quota_v1.c b/fs/quota_v1.c --- a/fs/quota_v1.c 2004-10-06 19:37:47 -07:00 +++ b/fs/quota_v1.c 2004-10-06 19:37:47 -07:00 @@ -115,8 +115,8 @@ /* Header of new quota format */ struct v2_disk_dqheader { - __u32 dqh_magic; /* Magic number identifying file */ - __u32 dqh_version; /* File version */ + __le32 dqh_magic; /* Magic number identifying file */ + __le32 dqh_version; /* File version */ }; static int v1_check_quota_file(struct super_block *sb, int type) diff -Nru a/fs/quota_v2.c b/fs/quota_v2.c --- a/fs/quota_v2.c 2004-10-06 19:37:47 -07:00 +++ b/fs/quota_v2.c 2004-10-06 19:37:47 -07:00 @@ -357,7 +357,7 @@ struct file *filp = sb_dqopt(dquot->dq_sb)->files[dquot->dq_type]; dqbuf_t buf; int ret = 0, newson = 0, newact = 0; - u32 *ref; + __le32 *ref; uint newblk; if (!(buf = getdqbuf())) @@ -376,7 +376,7 @@ goto out_buf; } } - ref = (u32 *)buf; + ref = (__le32 *)buf; newblk = le32_to_cpu(ref[GETIDINDEX(dquot->dq_id, depth)]); if (!newblk) newson = 1; @@ -510,7 +510,7 @@ dqbuf_t buf = getdqbuf(); int ret = 0; uint newblk; - u32 *ref = (u32 *)buf; + __le32 *ref = (__le32 *)buf; if (!buf) return -ENOMEM; @@ -595,7 +595,7 @@ struct file *filp = sb_dqopt(dquot->dq_sb)->files[dquot->dq_type]; dqbuf_t buf = getdqbuf(); loff_t ret = 0; - u32 *ref = (u32 *)buf; + __le32 *ref = (__le32 *)buf; if (!buf) return -ENOMEM; diff -Nru a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c --- a/fs/reiserfs/xattr_acl.c 2004-10-06 19:37:47 -07:00 +++ b/fs/reiserfs/xattr_acl.c 2004-10-06 19:37:47 -07:00 @@ -508,11 +508,11 @@ } struct reiserfs_xattr_handler posix_acl_access_handler = { - prefix: XATTR_NAME_ACL_ACCESS, - get: posix_acl_access_get, - set: posix_acl_access_set, - del: posix_acl_access_del, - list: posix_acl_access_list, + .prefix = XATTR_NAME_ACL_ACCESS, + .get = posix_acl_access_get, + .set = posix_acl_access_set, + .del = posix_acl_access_del, + .list = posix_acl_access_list, }; static int @@ -561,9 +561,9 @@ } struct reiserfs_xattr_handler posix_acl_default_handler = { - prefix: XATTR_NAME_ACL_DEFAULT, - get: posix_acl_default_get, - set: posix_acl_default_set, - del: posix_acl_default_del, - list: posix_acl_default_list, + .prefix = XATTR_NAME_ACL_DEFAULT, + .get = posix_acl_default_get, + .set = posix_acl_default_set, + .del = posix_acl_default_del, + .list = posix_acl_default_list, }; diff -Nru a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c --- a/fs/reiserfs/xattr_security.c 2004-10-06 19:37:47 -07:00 +++ b/fs/reiserfs/xattr_security.c 2004-10-06 19:37:47 -07:00 @@ -61,9 +61,9 @@ struct reiserfs_xattr_handler security_handler = { - prefix: XATTR_SECURITY_PREFIX, - get: security_get, - set: security_set, - del: security_del, - list: security_list, + .prefix = XATTR_SECURITY_PREFIX, + .get = security_get, + .set = security_set, + .del = security_del, + .list = security_list, }; diff -Nru a/fs/reiserfs/xattr_trusted.c b/fs/reiserfs/xattr_trusted.c --- a/fs/reiserfs/xattr_trusted.c 2004-10-06 19:37:47 -07:00 +++ b/fs/reiserfs/xattr_trusted.c 2004-10-06 19:37:47 -07:00 @@ -73,9 +73,9 @@ struct reiserfs_xattr_handler trusted_handler = { - prefix: XATTR_TRUSTED_PREFIX, - get: trusted_get, - set: trusted_set, - del: trusted_del, - list: trusted_list, + .prefix = XATTR_TRUSTED_PREFIX, + .get = trusted_get, + .set = trusted_set, + .del = trusted_del, + .list = trusted_list, }; diff -Nru a/fs/reiserfs/xattr_user.c b/fs/reiserfs/xattr_user.c --- a/fs/reiserfs/xattr_user.c 2004-10-06 19:37:47 -07:00 +++ b/fs/reiserfs/xattr_user.c 2004-10-06 19:37:47 -07:00 @@ -91,9 +91,9 @@ } struct reiserfs_xattr_handler user_handler = { - prefix: XATTR_USER_PREFIX, - get: user_get, - set: user_set, - del: user_del, - list: user_list, + .prefix = XATTR_USER_PREFIX, + .get = user_get, + .set = user_set, + .del = user_del, + .list = user_list, }; diff -Nru a/fs/romfs/inode.c b/fs/romfs/inode.c --- a/fs/romfs/inode.c 2004-10-06 19:37:47 -07:00 +++ b/fs/romfs/inode.c 2004-10-06 19:37:47 -07:00 @@ -95,15 +95,16 @@ return list_entry(inode, struct romfs_inode_info, vfs_inode); } -static __s32 +static __u32 romfs_checksum(void *data, int size) { - __s32 sum, *ptr; + __u32 sum; + __be32 *ptr; sum = 0; ptr = data; size>>=2; while (size>0) { - sum += ntohl(*ptr++); + sum += be32_to_cpu(*ptr++); size--; } return sum; @@ -131,7 +132,7 @@ } rsb = (struct romfs_super_block *)bh->b_data; - sz = ntohl(rsb->size); + sz = be32_to_cpu(rsb->size); if (rsb->word0 != ROMSB_WORD0 || rsb->word1 != ROMSB_WORD1 || sz < ROMFH_SIZE) { if (!silent) @@ -292,7 +293,7 @@ offset = i->i_ino & ROMFH_MASK; if (romfs_copyfrom(i, &ri, offset, ROMFH_SIZE) <= 0) goto out; - offset = ntohl(ri.spec) & ROMFH_MASK; + offset = be32_to_cpu(ri.spec) & ROMFH_MASK; } /* Not really failsafe, but we are read-only... */ @@ -316,9 +317,9 @@ romfs_copyfrom(i, fsname, offset+ROMFH_SIZE, j); ino = offset; - nextfh = ntohl(ri.next); + nextfh = be32_to_cpu(ri.next); if ((nextfh & ROMFH_TYPE) == ROMFH_HRD) - ino = ntohl(ri.spec); + ino = be32_to_cpu(ri.spec); if (filldir(dirent, fsname, j, offset, ino, romfs_dtype_table[nextfh & ROMFH_TYPE]) < 0) { goto out; @@ -349,7 +350,7 @@ goto out; maxoff = romfs_maxsize(dir->i_sb); - offset = ntohl(ri.spec) & ROMFH_MASK; + offset = be32_to_cpu(ri.spec) & ROMFH_MASK; /* OK, now find the file whose name is in "dentry" in the * directory specified by "dir". */ @@ -382,12 +383,12 @@ } } /* next entry */ - offset = ntohl(ri.next) & ROMFH_MASK; + offset = be32_to_cpu(ri.next) & ROMFH_MASK; } /* Hard link handling */ - if ((ntohl(ri.next) & ROMFH_TYPE) == ROMFH_HRD) - offset = ntohl(ri.spec) & ROMFH_MASK; + if ((be32_to_cpu(ri.next) & ROMFH_TYPE) == ROMFH_HRD) + offset = be32_to_cpu(ri.spec) & ROMFH_MASK; if ((inode = iget(dir->i_sb, offset))) goto outi; @@ -495,15 +496,15 @@ } /* XXX: do romfs_checksum here too (with name) */ - nextfh = ntohl(ri.next); + nextfh = be32_to_cpu(ri.next); if ((nextfh & ROMFH_TYPE) != ROMFH_HRD) break; - ino = ntohl(ri.spec) & ROMFH_MASK; + ino = be32_to_cpu(ri.spec) & ROMFH_MASK; } i->i_nlink = 1; /* Hard to decide.. */ - i->i_size = ntohl(ri.size); + i->i_size = be32_to_cpu(ri.size); i->i_mtime.tv_sec = i->i_atime.tv_sec = i->i_ctime.tv_sec = 0; i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0; i->i_uid = i->i_gid = 0; @@ -544,7 +545,7 @@ break; default: /* depending on MBZ for sock/fifos */ - nextfh = ntohl(ri.spec); + nextfh = be32_to_cpu(ri.spec); init_special_inode(i, ino, MKDEV(nextfh>>16,nextfh&0xffff)); } diff -Nru a/fs/udf/balloc.c b/fs/udf/balloc.c --- a/fs/udf/balloc.c 2004-10-06 19:37:47 -07:00 +++ b/fs/udf/balloc.c 2004-10-06 19:37:47 -07:00 @@ -49,8 +49,8 @@ extern inline int find_next_one_bit (void * addr, int size, int offset) { uintBPL_t * p = ((uintBPL_t *) addr) + (offset / BITS_PER_LONG); - uintBPL_t result = offset & ~(BITS_PER_LONG-1); - uintBPL_t tmp; + int result = offset & ~(BITS_PER_LONG-1); + unsigned long tmp; if (offset >= size) return size; diff -Nru a/fs/ufs/balloc.c b/fs/ufs/balloc.c --- a/fs/ufs/balloc.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ufs/balloc.c 2004-10-06 19:37:47 -07:00 @@ -235,7 +235,7 @@ brelse (bh); \ } -unsigned ufs_new_fragments (struct inode * inode, u32 * p, unsigned fragment, +unsigned ufs_new_fragments (struct inode * inode, __fs32 * p, unsigned fragment, unsigned goal, unsigned count, int * err ) { struct super_block * sb; @@ -412,7 +412,7 @@ count = newcount - oldcount; cgno = ufs_dtog(fragment); - if (UFS_SB(sb)->fs_cs(cgno).cs_nffree < count) + if (fs32_to_cpu(sb, UFS_SB(sb)->fs_cs(cgno).cs_nffree) < count) return 0; if ((ufs_fragnum (fragment) + newcount) > uspi->s_fpb) return 0; @@ -771,11 +771,11 @@ i = back + forw + 1; if (i > uspi->s_contigsumsize) i = uspi->s_contigsumsize; - fs32_add(sb, (u32*)ubh_get_addr(UCPI_UBH, ucpi->c_clustersumoff + (i << 2)), cnt); + fs32_add(sb, (__fs32*)ubh_get_addr(UCPI_UBH, ucpi->c_clustersumoff + (i << 2)), cnt); if (back > 0) - fs32_sub(sb, (u32*)ubh_get_addr(UCPI_UBH, ucpi->c_clustersumoff + (back << 2)), cnt); + fs32_sub(sb, (__fs32*)ubh_get_addr(UCPI_UBH, ucpi->c_clustersumoff + (back << 2)), cnt); if (forw > 0) - fs32_sub(sb, (u32*)ubh_get_addr(UCPI_UBH, ucpi->c_clustersumoff + (forw << 2)), cnt); + fs32_sub(sb, (__fs32*)ubh_get_addr(UCPI_UBH, ucpi->c_clustersumoff + (forw << 2)), cnt); } diff -Nru a/fs/ufs/inode.c b/fs/ufs/inode.c --- a/fs/ufs/inode.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ufs/inode.c 2004-10-06 19:37:47 -07:00 @@ -99,8 +99,8 @@ sector_t offsets[4], *p; int depth = ufs_block_to_path(inode, frag >> uspi->s_fpbshift, offsets); u64 ret = 0L; - u32 block; - u64 u2_block = 0L; + __fs32 block; + __fs64 u2_block = 0L; unsigned flags = UFS_SB(sb)->s_flags; u64 temp = 0L; @@ -126,7 +126,7 @@ bh = sb_bread(sb, uspi->s_sbbase + fs32_to_cpu(sb, block)+(n>>shift)); if (!bh) goto out; - block = ((u32*) bh->b_data)[n & mask]; + block = ((__fs32 *) bh->b_data)[n & mask]; brelse (bh); if (!block) goto out; @@ -148,7 +148,7 @@ bh = sb_bread(sb, temp +(u64) (n>>shift)); if (!bh) goto out; - u2_block = ((u64*)bh->b_data)[n & mask]; + u2_block = ((__fs64 *)bh->b_data)[n & mask]; brelse(bh); if (!u2_block) goto out; @@ -171,7 +171,7 @@ struct buffer_head * result; unsigned block, blockoff, lastfrag, lastblock, lastblockoff; unsigned tmp, goal; - u32 * p, * p2; + __fs32 * p, * p2; unsigned flags = 0; UFSD(("ENTER, ino %lu, fragment %u, new_fragment %u, required %u\n", @@ -303,7 +303,7 @@ struct ufs_sb_private_info * uspi; struct buffer_head * result; unsigned tmp, goal, block, blockoff; - u32 * p; + __fs32 * p; sb = inode->i_sb; uspi = UFS_SB(sb)->s_uspi; @@ -322,7 +322,7 @@ goto out; } - p = (u32 *) bh->b_data + block; + p = (__fs32 *) bh->b_data + block; repeat: tmp = fs32_to_cpu(sb, *p); if (tmp) { @@ -338,7 +338,7 @@ } } - if (block && (tmp = fs32_to_cpu(sb, ((u32*)bh->b_data)[block-1]) + uspi->s_fpb)) + if (block && (tmp = fs32_to_cpu(sb, ((__fs32*)bh->b_data)[block-1]) + uspi->s_fpb)) goal = tmp + uspi->s_fpb; else goal = bh->b_blocknr + uspi->s_fpb; diff -Nru a/fs/ufs/super.c b/fs/ufs/super.c --- a/fs/ufs/super.c 2004-10-06 19:37:46 -07:00 +++ b/fs/ufs/super.c 2004-10-06 19:37:46 -07:00 @@ -743,22 +743,22 @@ /* * Check ufs magic number */ - switch ((uspi->fs_magic = __constant_le32_to_cpu(usb3->fs_magic))) { + sbi->s_bytesex = BYTESEX_LE; + switch ((uspi->fs_magic = fs32_to_cpu(sb, usb3->fs_magic))) { case UFS_MAGIC: case UFS2_MAGIC: case UFS_MAGIC_LFN: case UFS_MAGIC_FEA: case UFS_MAGIC_4GB: - sbi->s_bytesex = BYTESEX_LE; goto magic_found; } - switch ((uspi->fs_magic = __constant_be32_to_cpu(usb3->fs_magic))) { + sbi->s_bytesex = BYTESEX_BE; + switch ((uspi->fs_magic = fs32_to_cpu(sb, usb3->fs_magic))) { case UFS_MAGIC: case UFS2_MAGIC: case UFS_MAGIC_LFN: case UFS_MAGIC_FEA: case UFS_MAGIC_4GB: - sbi->s_bytesex = BYTESEX_BE; goto magic_found; } @@ -1129,7 +1129,7 @@ flags = UFS_SB(sb)->s_flags; if ((flags & UFS_TYPE_MASK) == UFS_TYPE_UFS2) { buf->f_type = UFS2_MAGIC; - buf->f_blocks = usb->fs_u11.fs_u2.fs_dsize; + buf->f_blocks = fs64_to_cpu(sb, usb->fs_u11.fs_u2.fs_dsize); buf->f_bfree = ufs_blkstofrags(fs64_to_cpu(sb, usb->fs_u11.fs_u2.fs_cstotal.cs_nbfree)) + fs64_to_cpu(sb, usb->fs_u11.fs_u2.fs_cstotal.cs_nffree); buf->f_ffree = fs64_to_cpu(sb, diff -Nru a/fs/ufs/swab.h b/fs/ufs/swab.h --- a/fs/ufs/swab.h 2004-10-06 19:37:48 -07:00 +++ b/fs/ufs/swab.h 2004-10-06 19:37:48 -07:00 @@ -22,22 +22,22 @@ BYTESEX_BE }; -static __inline u64 -fs64_to_cpu(struct super_block *sbp, u64 n) +static inline u64 +fs64_to_cpu(struct super_block *sbp, __fs64 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return le64_to_cpu(n); + return le64_to_cpu((__force __le64)n); else - return be64_to_cpu(n); + return be64_to_cpu((__force __be64)n); } -static __inline u64 +static inline __fs64 cpu_to_fs64(struct super_block *sbp, u64 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return cpu_to_le64(n); + return (__force __fs64)cpu_to_le64(n); else - return cpu_to_be64(n); + return (__force __fs64)cpu_to_be64(n); } static __inline u32 @@ -59,75 +59,75 @@ } static __inline u32 -fs32_to_cpu(struct super_block *sbp, u32 n) +fs32_to_cpu(struct super_block *sbp, __fs32 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return le32_to_cpu(n); + return le32_to_cpu((__force __le32)n); else - return be32_to_cpu(n); + return be32_to_cpu((__force __be32)n); } -static __inline u32 +static inline __fs32 cpu_to_fs32(struct super_block *sbp, u32 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return cpu_to_le32(n); + return (__force __fs32)cpu_to_le32(n); else - return cpu_to_be32(n); + return (__force __fs32)cpu_to_be32(n); } -static __inline u32 -fs32_add(struct super_block *sbp, u32 *n, int d) +static inline void +fs32_add(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le32(le32_to_cpu(*n)+d); + *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)+d); else - return *n = cpu_to_be32(be32_to_cpu(*n)+d); + *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)+d); } -static __inline u32 -fs32_sub(struct super_block *sbp, u32 *n, int d) +static inline void +fs32_sub(struct super_block *sbp, __fs32 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le32(le32_to_cpu(*n)-d); + *(__le32 *)n = cpu_to_le32(le32_to_cpu(*(__le32 *)n)-d); else - return *n = cpu_to_be32(be32_to_cpu(*n)-d); + *(__be32 *)n = cpu_to_be32(be32_to_cpu(*(__be32 *)n)-d); } -static __inline u16 -fs16_to_cpu(struct super_block *sbp, u16 n) +static inline u16 +fs16_to_cpu(struct super_block *sbp, __fs16 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return le16_to_cpu(n); + return le16_to_cpu((__force __le16)n); else - return be16_to_cpu(n); + return be16_to_cpu((__force __be16)n); } -static __inline u16 +static inline __fs16 cpu_to_fs16(struct super_block *sbp, u16 n) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return cpu_to_le16(n); + return (__force __fs16)cpu_to_le16(n); else - return cpu_to_be16(n); + return (__force __fs16)cpu_to_be16(n); } -static __inline u16 -fs16_add(struct super_block *sbp, u16 *n, int d) +static inline void +fs16_add(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le16(le16_to_cpu(*n)+d); + *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)+d); else - return *n = cpu_to_be16(be16_to_cpu(*n)+d); + *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)+d); } -static __inline u16 -fs16_sub(struct super_block *sbp, u16 *n, int d) +static inline void +fs16_sub(struct super_block *sbp, __fs16 *n, int d) { if (UFS_SB(sbp)->s_bytesex == BYTESEX_LE) - return *n = cpu_to_le16(le16_to_cpu(*n)-d); + *(__le16 *)n = cpu_to_le16(le16_to_cpu(*(__le16 *)n)-d); else - return *n = cpu_to_be16(be16_to_cpu(*n)-d); + *(__be16 *)n = cpu_to_be16(be16_to_cpu(*(__be16 *)n)-d); } #endif /* _UFS_SWAB_H */ diff -Nru a/fs/ufs/truncate.c b/fs/ufs/truncate.c --- a/fs/ufs/truncate.c 2004-10-06 19:37:47 -07:00 +++ b/fs/ufs/truncate.c 2004-10-06 19:37:47 -07:00 @@ -74,7 +74,7 @@ struct super_block * sb; struct ufs_sb_private_info * uspi; struct buffer_head * bh; - u32 * p; + __fs32 * p; unsigned frag1, frag2, frag3, frag4, block1, block2; unsigned frag_to_free, free_count; unsigned i, j, tmp; @@ -199,13 +199,13 @@ } -static int ufs_trunc_indirect (struct inode * inode, unsigned offset, u32 * p) +static int ufs_trunc_indirect (struct inode * inode, unsigned offset, __fs32 *p) { struct super_block * sb; struct ufs_sb_private_info * uspi; struct ufs_buffer_head * ind_ubh; struct buffer_head * bh; - u32 * ind; + __fs32 * ind; unsigned indirect_block, i, j, tmp; unsigned frag_to_free, free_count; int retry; @@ -296,13 +296,13 @@ return retry; } -static int ufs_trunc_dindirect (struct inode * inode, unsigned offset, u32 * p) +static int ufs_trunc_dindirect (struct inode *inode, unsigned offset, __fs32 *p) { struct super_block * sb; struct ufs_sb_private_info * uspi; struct ufs_buffer_head * dind_bh; unsigned i, tmp, dindirect_block; - u32 * dind; + __fs32 * dind; int retry = 0; UFSD(("ENTER\n")) @@ -371,7 +371,7 @@ struct ufs_sb_private_info * uspi; struct ufs_buffer_head * tind_bh; unsigned tindirect_block, tmp, i; - u32 * tind, * p; + __fs32 * tind, * p; int retry; UFSD(("ENTER\n")) @@ -449,9 +449,9 @@ while (1) { retry = ufs_trunc_direct(inode); retry |= ufs_trunc_indirect (inode, UFS_IND_BLOCK, - (u32 *) &ufsi->i_u1.i_data[UFS_IND_BLOCK]); + (__fs32 *) &ufsi->i_u1.i_data[UFS_IND_BLOCK]); retry |= ufs_trunc_dindirect (inode, UFS_IND_BLOCK + uspi->s_apb, - (u32 *) &ufsi->i_u1.i_data[UFS_DIND_BLOCK]); + (__fs32 *) &ufsi->i_u1.i_data[UFS_DIND_BLOCK]); retry |= ufs_trunc_tindirect (inode); if (!retry) break; diff -Nru a/fs/ufs/util.h b/fs/ufs/util.h --- a/fs/ufs/util.h 2004-10-06 19:37:47 -07:00 +++ b/fs/ufs/util.h 2004-10-06 19:37:47 -07:00 @@ -72,20 +72,20 @@ static inline u64 ufs_get_fs_qbmask(struct super_block *sb, struct ufs_super_block_third *usb3) { - u64 tmp; + __fs64 tmp; switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { case UFS_ST_SUN: - ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sun.fs_qbmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sun.fs_qbmask[1]; + ((__fs32 *)&tmp)[0] = usb3->fs_u2.fs_sun.fs_qbmask[0]; + ((__fs32 *)&tmp)[1] = usb3->fs_u2.fs_sun.fs_qbmask[1]; break; case UFS_ST_SUNx86: - ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sunx86.fs_qbmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sunx86.fs_qbmask[1]; + ((__fs32 *)&tmp)[0] = usb3->fs_u2.fs_sunx86.fs_qbmask[0]; + ((__fs32 *)&tmp)[1] = usb3->fs_u2.fs_sunx86.fs_qbmask[1]; break; case UFS_ST_44BSD: - ((u32 *)&tmp)[0] = usb3->fs_u2.fs_44.fs_qbmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u2.fs_44.fs_qbmask[1]; + ((__fs32 *)&tmp)[0] = usb3->fs_u2.fs_44.fs_qbmask[0]; + ((__fs32 *)&tmp)[1] = usb3->fs_u2.fs_44.fs_qbmask[1]; break; } @@ -95,20 +95,20 @@ static inline u64 ufs_get_fs_qfmask(struct super_block *sb, struct ufs_super_block_third *usb3) { - u64 tmp; + __fs64 tmp; switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) { case UFS_ST_SUN: - ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sun.fs_qfmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sun.fs_qfmask[1]; + ((__fs32 *)&tmp)[0] = usb3->fs_u2.fs_sun.fs_qfmask[0]; + ((__fs32 *)&tmp)[1] = usb3->fs_u2.fs_sun.fs_qfmask[1]; break; case UFS_ST_SUNx86: - ((u32 *)&tmp)[0] = usb3->fs_u2.fs_sunx86.fs_qfmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u2.fs_sunx86.fs_qfmask[1]; + ((__fs32 *)&tmp)[0] = usb3->fs_u2.fs_sunx86.fs_qfmask[0]; + ((__fs32 *)&tmp)[1] = usb3->fs_u2.fs_sunx86.fs_qfmask[1]; break; case UFS_ST_44BSD: - ((u32 *)&tmp)[0] = usb3->fs_u2.fs_44.fs_qfmask[0]; - ((u32 *)&tmp)[1] = usb3->fs_u2.fs_44.fs_qfmask[1]; + ((__fs32 *)&tmp)[0] = usb3->fs_u2.fs_44.fs_qfmask[0]; + ((__fs32 *)&tmp)[1] = usb3->fs_u2.fs_44.fs_qfmask[1]; break; } @@ -273,11 +273,11 @@ ((begin) & ~uspi->s_fmask)) #define ubh_get_addr16(ubh,begin) \ - (((u16*)((ubh)->bh[(begin) >> (uspi->s_fshift-1)]->b_data)) + \ + (((__fs16*)((ubh)->bh[(begin) >> (uspi->s_fshift-1)]->b_data)) + \ ((begin) & (uspi->fsize>>1) - 1))) #define ubh_get_addr32(ubh,begin) \ - (((u32*)((ubh)->bh[(begin) >> (uspi->s_fshift-2)]->b_data)) + \ + (((__fs32*)((ubh)->bh[(begin) >> (uspi->s_fshift-2)]->b_data)) + \ ((begin) & ((uspi->s_fsize>>2) - 1))) #define ubh_get_addr ubh_get_addr8 @@ -315,10 +315,10 @@ * Macros to access cylinder group array structures */ #define ubh_cg_blktot(ucpi,cylno) \ - (*((__u32*)ubh_get_addr(UCPI_UBH, (ucpi)->c_btotoff + ((cylno) << 2)))) + (*((__fs32*)ubh_get_addr(UCPI_UBH, (ucpi)->c_btotoff + ((cylno) << 2)))) #define ubh_cg_blks(ucpi,cylno,rpos) \ - (*((__u16*)ubh_get_addr(UCPI_UBH, \ + (*((__fs16*)ubh_get_addr(UCPI_UBH, \ (ucpi)->c_boff + (((cylno) * uspi->s_nrpos + (rpos)) << 1 )))) /* @@ -476,7 +476,7 @@ } static inline void ufs_fragacct (struct super_block * sb, unsigned blockmap, - unsigned * fraglist, int cnt) + __fs32 * fraglist, int cnt) { struct ufs_sb_private_info * uspi; unsigned fragsize, pos; diff -Nru a/fs/xfs/Makefile b/fs/xfs/Makefile --- a/fs/xfs/Makefile 2004-10-06 19:37:47 -07:00 +++ b/fs/xfs/Makefile 2004-10-06 19:37:47 -07:00 @@ -67,8 +67,6 @@ xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o -xfs-$(CONFIG_XFS_POSIX_CAP) += xfs_cap.o -xfs-$(CONFIG_XFS_POSIX_MAC) += xfs_mac.o xfs-$(CONFIG_PROC_FS) += linux-2.6/xfs_stats.o xfs-$(CONFIG_SYSCTL) += linux-2.6/xfs_sysctl.o xfs-$(CONFIG_COMPAT) += linux-2.6/xfs_ioctl32.o diff -Nru a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c --- a/fs/xfs/linux-2.6/xfs_aops.c 2004-10-06 19:37:47 -07:00 +++ b/fs/xfs/linux-2.6/xfs_aops.c 2004-10-06 19:37:47 -07:00 @@ -552,18 +552,21 @@ struct page *page, struct writeback_control *wbc, struct buffer_head *bh_arr[], - int cnt) + int bh_count, + int probed_page, + int clear_dirty) { struct buffer_head *bh; int i; BUG_ON(PageWriteback(page)); set_page_writeback(page); - clear_page_dirty(page); + if (clear_dirty) + clear_page_dirty(page); unlock_page(page); - if (cnt) { - for (i = 0; i < cnt; i++) { + if (bh_count) { + for (i = 0; i < bh_count; i++) { bh = bh_arr[i]; mark_buffer_async_write(bh); if (buffer_unwritten(bh)) @@ -572,8 +575,11 @@ clear_buffer_dirty(bh); } - for (i = 0; i < cnt; i++) + for (i = 0; i < bh_count; i++) submit_bh(WRITE, bh_arr[i]); + + if (probed_page && clear_dirty) + wbc->nr_to_write--; /* Wrote an "extra" page */ } else { end_page_writeback(page); wbc->pages_skipped++; /* We didn't write this page */ @@ -612,11 +618,13 @@ bh = head = page_buffers(page); do { offset = i << bbits; + if (offset >= end) + break; if (!(PageUptodate(page) || buffer_uptodate(bh))) continue; if (buffer_mapped(bh) && all_bh && - !buffer_unwritten(bh) && !buffer_delay(bh)) { - if (startio && (offset < end)) { + !(buffer_unwritten(bh) || buffer_delay(bh))) { + if (startio) { lock_buffer(bh); bh_arr[index++] = bh; } @@ -644,7 +652,7 @@ ASSERT(private); } } - if (startio && (offset < end)) { + if (startio) { bh_arr[index++] = bh; } else { set_buffer_dirty(bh); @@ -654,8 +662,7 @@ } while (i++, (bh = bh->b_this_page) != head); if (startio) { - wbc->nr_to_write--; - xfs_submit_page(page, wbc, bh_arr, index); + xfs_submit_page(page, wbc, bh_arr, index, 1, index == i); } else { unlock_page(page); } @@ -867,7 +874,7 @@ SetPageUptodate(page); if (startio) - xfs_submit_page(page, wbc, bh_arr, cnt); + xfs_submit_page(page, wbc, bh_arr, cnt, 0, 1); if (iomp) { tlast = (iomp->iomap_offset + iomp->iomap_bsize - 1) >> @@ -1174,7 +1181,7 @@ return 0; out_fail: - set_page_dirty(page); + redirty_page_for_writepage(wbc, page); unlock_page(page); return 0; out_unlock: diff -Nru a/fs/xfs/xfs_cap.c b/fs/xfs/xfs_cap.c --- a/fs/xfs/xfs_cap.c 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ - */ - -#include "xfs.h" - -STATIC int xfs_cap_allow_set(vnode_t *); - - -/* - * Test for existence of capability attribute as efficiently as possible. - */ -int -xfs_cap_vhascap( - vnode_t *vp) -{ - int error; - int len = sizeof(xfs_cap_set_t); - int flags = ATTR_KERNOVAL|ATTR_ROOT; - - VOP_ATTR_GET(vp, SGI_CAP_LINUX, NULL, &len, flags, sys_cred, error); - return (error == 0); -} - -/* - * Convert from extended attribute representation to in-memory for XFS. - */ -STATIC int -posix_cap_xattr_to_xfs( - posix_cap_xattr *src, - size_t size, - xfs_cap_set_t *dest) -{ - if (!src || !dest) - return EINVAL; - - if (src->c_version != cpu_to_le32(POSIX_CAP_XATTR_VERSION)) - return EINVAL; - if (src->c_abiversion != cpu_to_le32(_LINUX_CAPABILITY_VERSION)) - return EINVAL; - - if (size < sizeof(posix_cap_xattr)) - return EINVAL; - - ASSERT(sizeof(dest->cap_effective) == sizeof(src->c_effective)); - - dest->cap_effective = src->c_effective; - dest->cap_permitted = src->c_permitted; - dest->cap_inheritable = src->c_inheritable; - - return 0; -} - -/* - * Convert from in-memory XFS to extended attribute representation. - */ -STATIC int -posix_cap_xfs_to_xattr( - xfs_cap_set_t *src, - posix_cap_xattr *xattr_cap, - size_t size) -{ - size_t new_size = posix_cap_xattr_size(); - - if (size < new_size) - return -ERANGE; - - ASSERT(sizeof(xattr_cap->c_effective) == sizeof(src->cap_effective)); - - xattr_cap->c_version = cpu_to_le32(POSIX_CAP_XATTR_VERSION); - xattr_cap->c_abiversion = cpu_to_le32(_LINUX_CAPABILITY_VERSION); - xattr_cap->c_effective = src->cap_effective; - xattr_cap->c_permitted = src->cap_permitted; - xattr_cap->c_inheritable= src->cap_inheritable; - - return new_size; -} - -int -xfs_cap_vget( - vnode_t *vp, - void *cap, - size_t size) -{ - int error; - int len = sizeof(xfs_cap_set_t); - int flags = ATTR_ROOT; - xfs_cap_set_t xfs_cap = { 0 }; - posix_cap_xattr *xattr_cap = cap; - char *data = (char *)&xfs_cap; - - VN_HOLD(vp); - if ((error = _MAC_VACCESS(vp, NULL, VREAD))) - goto out; - - if (!size) { - flags |= ATTR_KERNOVAL; - data = NULL; - } - VOP_ATTR_GET(vp, SGI_CAP_LINUX, data, &len, flags, sys_cred, error); - if (error) - goto out; - ASSERT(len == sizeof(xfs_cap_set_t)); - - error = (size)? -posix_cap_xattr_size() : - -posix_cap_xfs_to_xattr(&xfs_cap, xattr_cap, size); -out: - VN_RELE(vp); - return -error; -} - -int -xfs_cap_vremove( - vnode_t *vp) -{ - int error; - - VN_HOLD(vp); - error = xfs_cap_allow_set(vp); - if (!error) { - VOP_ATTR_REMOVE(vp, SGI_CAP_LINUX, ATTR_ROOT, sys_cred, error); - if (error == ENOATTR) - error = 0; /* 'scool */ - } - VN_RELE(vp); - return -error; -} - -int -xfs_cap_vset( - vnode_t *vp, - void *cap, - size_t size) -{ - posix_cap_xattr *xattr_cap = cap; - xfs_cap_set_t xfs_cap; - int error; - - if (!cap) - return -EINVAL; - - error = posix_cap_xattr_to_xfs(xattr_cap, size, &xfs_cap); - if (error) - return -error; - - VN_HOLD(vp); - error = xfs_cap_allow_set(vp); - if (error) - goto out; - - VOP_ATTR_SET(vp, SGI_CAP_LINUX, (char *)&xfs_cap, - sizeof(xfs_cap_set_t), ATTR_ROOT, sys_cred, error); -out: - VN_RELE(vp); - return -error; -} - -STATIC int -xfs_cap_allow_set( - vnode_t *vp) -{ - vattr_t va; - int error; - - if (vp->v_vfsp->vfs_flag & VFS_RDONLY) - return EROFS; - if (vp->v_inode.i_flags & (S_IMMUTABLE|S_APPEND)) - return EPERM; - if ((error = _MAC_VACCESS(vp, NULL, VWRITE))) - return error; - va.va_mask = XFS_AT_UID; - VOP_GETATTR(vp, &va, 0, NULL, error); - if (error) - return error; - if (va.va_uid != current->fsuid && !capable(CAP_FOWNER)) - return EPERM; - return error; -} diff -Nru a/fs/xfs/xfs_mac.c b/fs/xfs/xfs_mac.c --- a/fs/xfs/xfs_mac.c 2004-10-06 19:37:47 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ - */ - -#include "xfs.h" - -static xfs_mac_label_t *mac_low_high_lp; -static xfs_mac_label_t *mac_high_low_lp; -static xfs_mac_label_t *mac_admin_high_lp; -static xfs_mac_label_t *mac_equal_equal_lp; - -/* - * Test for the existence of a MAC label as efficiently as possible. - */ -int -xfs_mac_vhaslabel( - vnode_t *vp) -{ - int error; - int len = sizeof(xfs_mac_label_t); - int flags = ATTR_KERNOVAL|ATTR_ROOT; - - VOP_ATTR_GET(vp, SGI_MAC_FILE, NULL, &len, flags, sys_cred, error); - return (error == 0); -} - -int -xfs_mac_iaccess(xfs_inode_t *ip, mode_t mode, struct cred *cr) -{ - xfs_mac_label_t mac; - xfs_mac_label_t *mp = mac_high_low_lp; - - if (cr == NULL || sys_cred == NULL ) { - return EACCES; - } - - if (xfs_attr_fetch(ip, SGI_MAC_FILE, (char *)&mac, sizeof(mac)) == 0) { - if ((mp = mac_add_label(&mac)) == NULL) { - return mac_access(mac_high_low_lp, cr, mode); - } - } - - return mac_access(mp, cr, mode); -} diff -Nru a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c --- a/fs/xfs/xfs_vnodeops.c 2004-10-06 19:37:48 -07:00 +++ b/fs/xfs/xfs_vnodeops.c 2004-10-06 19:37:48 -07:00 @@ -841,17 +841,17 @@ if (vap->va_xflags & XFS_XFLAG_NODUMP) di_flags |= XFS_DIFLAG_NODUMP; if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { - if (vap->va_xflags & XFS_XFLAG_REALTIME) { - ip->i_iocore.io_flags |= XFS_IOCORE_RT; - di_flags |= XFS_DIFLAG_REALTIME; - } if (vap->va_xflags & XFS_XFLAG_RTINHERIT) di_flags |= XFS_DIFLAG_RTINHERIT; if (vap->va_xflags & XFS_XFLAG_NOSYMLINKS) di_flags |= XFS_DIFLAG_NOSYMLINKS; } else { - if (!(vap->va_xflags & XFS_XFLAG_REALTIME)) + if (vap->va_xflags & XFS_XFLAG_REALTIME) { + di_flags |= XFS_DIFLAG_REALTIME; + ip->i_iocore.io_flags |= XFS_IOCORE_RT; + } else { ip->i_iocore.io_flags &= ~XFS_IOCORE_RT; + } } ip->i_d.di_flags = di_flags; } diff -Nru a/include/asm-arm/arch-pxa/serial.h b/include/asm-arm/arch-pxa/serial.h --- a/include/asm-arm/arch-pxa/serial.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/arch-pxa/serial.h 2004-10-06 19:37:47 -07:00 @@ -9,6 +9,7 @@ * published by the Free Software Foundation. */ +#include #define BAUD_BASE 921600 diff -Nru a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h --- a/include/asm-arm/arch-rpc/uncompress.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/arch-rpc/uncompress.h 2004-10-06 19:37:47 -07:00 @@ -60,8 +60,8 @@ * params_phys is a linker defined symbol - see * arch/arm/boot/compressed/Makefile */ -extern struct param_struct params_phys; -#define params (¶ms_phys) +extern __attribute__((pure)) struct param_struct *params(void); +#define params (params()) #ifndef STANDALONE_DEBUG /* diff -Nru a/include/asm-arm/arch-s3c2410/bast-irq.h b/include/asm-arm/arch-s3c2410/bast-irq.h --- a/include/asm-arm/arch-s3c2410/bast-irq.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/arch-s3c2410/bast-irq.h 2004-10-06 19:37:47 -07:00 @@ -10,6 +10,7 @@ * published by the Free Software Foundation. * * Changelog: + * 14-Sep-2004 BJD Fixed IRQ_USBOC definition * 06-Jan-2003 BJD Linux 2.6.0 version */ @@ -18,7 +19,7 @@ /* irq numbers to onboard peripherals */ -#define IRQ_USBOC IRQ_EINT19 +#define IRQ_USBOC IRQ_EINT18 #define IRQ_IDE0 IRQ_EINT16 #define IRQ_IDE1 IRQ_EINT17 #define IRQ_PCSERIAL1 IRQ_EINT15 diff -Nru a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h --- a/include/asm-arm/arch-s3c2410/hardware.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/arch-s3c2410/hardware.h 2004-10-06 19:37:47 -07:00 @@ -15,6 +15,7 @@ * 03-Sep-2003 BJD Linux v2.6 support * 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars * 14-Sep-2004 BJD Added misccr and getpin to gpio + * 01-Oct-2004 BJD Added the new gpio functions */ #ifndef __ASM_ARCH_HARDWARE_H @@ -44,6 +45,35 @@ */ extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); + +extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); + +/* s3c2410_gpio_getirq + * + * turn the given pin number into the corresponding IRQ number + * + * returns: + * < 0 = no interrupt for this pin + * >=0 = interrupt number for the pin +*/ + +extern int s3c2410_gpio_getirq(unsigned int pin); + +/* s3c2410_gpio_irqfilter + * + * set the irq filtering on the given pin + * + * on = 0 => disable filtering + * 1 => enable filtering + * + * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with + * width of filter (0 through 63) + * + * +*/ + +extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, + unsigned int config); /* s3c2410_gpio_pullup * diff -Nru a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h --- a/include/asm-arm/arch-s3c2410/regs-gpio.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h 2004-10-06 19:37:47 -07:00 @@ -14,7 +14,8 @@ * 23-06-2003 BJD Updated GSTATUS registers * 12-03-2004 BJD Updated include protection * 20-07-2004 BJD Added GPIO pin numbers, added Port A definitions - */ + * 04-10-2004 BJD Fixed number of bugs, added EXT IRQ filter defs +*/ #ifndef __ASM_ARCH_REGS_GPIO_H @@ -614,34 +615,34 @@ #define S3C2410_GPG10_OUTP (0x01 << 20) #define S3C2410_GPG10_EINT18 (0x02 << 20) -#define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) +#define S3C2410_GPG11 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 11) #define S3C2410_GPG11_INP (0x00 << 22) #define S3C2410_GPG11_OUTP (0x01 << 22) #define S3C2410_GPG11_EINT19 (0x02 << 22) #define S3C2410_GPG11_TCLK1 (0x03 << 22) -#define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) +#define S3C2410_GPG12 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12) #define S3C2410_GPG12_INP (0x00 << 24) #define S3C2410_GPG12_OUTP (0x01 << 24) -#define S3C2410_GPG12_EINT18 (0x02 << 24) +#define S3C2410_GPG12_EINT20 (0x02 << 24) #define S3C2410_GPG12_XMON (0x03 << 24) -#define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) +#define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13) #define S3C2410_GPG13_INP (0x00 << 26) #define S3C2410_GPG13_OUTP (0x01 << 26) -#define S3C2410_GPG13_EINT18 (0x02 << 26) +#define S3C2410_GPG13_EINT21 (0x02 << 26) #define S3C2410_GPG13_nXPON (0x03 << 26) -#define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) +#define S3C2410_GPG14 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14) #define S3C2410_GPG14_INP (0x00 << 28) #define S3C2410_GPG14_OUTP (0x01 << 28) -#define S3C2410_GPG14_EINT18 (0x02 << 28) +#define S3C2410_GPG14_EINT22 (0x02 << 28) #define S3C2410_GPG14_YMON (0x03 << 28) -#define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) +#define S3C2410_GPG15 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15) #define S3C2410_GPG15_INP (0x00 << 30) #define S3C2410_GPG15_OUTP (0x01 << 30) -#define S3C2410_GPG15_EINT18 (0x02 << 30) +#define S3C2410_GPG15_EINT23 (0x02 << 30) #define S3C2410_GPG15_nYPON (0x03 << 30) @@ -751,6 +752,11 @@ #define S3C2410_MISCCR_nRSTCON (1<<16) +#define S3C2410_MISCCR_nEN_SCLK0 (1<<17) +#define S3C2410_MISCCR_nEN_SCLK1 (1<<18) +#define S3C2410_MISCCR_nEN_SCLKE (1<<19) +#define S3C2410_MISCCR_SDSLEEP (7<<17) + /* external interrupt control... */ /* S3C2410_EXTINT0 -> irq sense control for EINT0..EINT7 * S3C2410_EXTINT1 -> irq sense control for EINT8..EINT15 @@ -777,6 +783,11 @@ #define S3C2410_EINFLT1 S3C2410_GPIOREG(0x98) #define S3C2410_EINFLT2 S3C2410_GPIOREG(0x9C) #define S3C2410_EINFLT3 S3C2410_GPIOREG(0xA0) + +/* values for interrupt filtering */ +#define S3C2410_EINTFLT_PCLK (0x00) +#define S3C2410_EINTFLT_EXTCLK (1<<7) +#define S3C2410_EINTFLT_WIDTHMSK(x) ((x) & 0x3f) /* removed EINTxxxx defs from here, not meant for this */ diff -Nru a/include/asm-arm/arch-s3c2410/regs-iic.h b/include/asm-arm/arch-s3c2410/regs-iic.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-s3c2410/regs-iic.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,50 @@ +/* linux/include/asm-arm/arch-s3c2410/regs-iic.h + * + * Copyright (c) 2004 Simtec Electronics + * http://www.simtec.co.uk/products/SWLINUX/ + * + * 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. + * + * S3C2410 I2C Controller + * + * Changelog: + * 03-Oct-2004 BJD Initial include for Linux +*/ + +#ifndef __ASM_ARCH_IIC_H +#define __ASM_ARCH_IIC_H __FILE__ + +/* see s3c2410x user guide, v1.1, section 9 (p447) for more info */ + +#define S3C2410_IICREG(x) (x) + +#define S3C2410_IICCON S3C2410_IICREG(0x00) +#define S3C2410_IICSTAT S3C2410_IICREG(0x04) +#define S3C2410_IICADD S3C2410_IICREG(0x08) +#define S3C2410_IICDS S3C2410_IICREG(0x0C) + +#define S3C2410_IICCON_ACKEN (1<<7) +#define S3C2410_IICCON_TXDIV_16 (0<<6) +#define S3C2410_IICCON_TXDIV_512 (1<<6) +#define S3C2410_IICCON_IRQEN (1<<5) +#define S3C2410_IICCON_IRQPEND (1<<4) +#define S3C2410_IICCON_SCALE(x) ((x)&15) +#define S3C2410_IICCON_SCALEMASK (0xf) + +#define S3C2410_IICSTAT_MASTER_RX (2<<6) +#define S3C2410_IICSTAT_MASTER_TX (3<<6) +#define S3C2410_IICSTAT_SLAVE_RX (0<<6) +#define S3C2410_IICSTAT_SLAVE_TX (1<<6) +#define S3C2410_IICSTAT_MODEMASK (3<<6) + +#define S3C2410_IICSTAT_START (1<<5) +#define S3C2410_IICSTAT_BUSBUSY (1<<5) +#define S3C2410_IICSTAT_TXRXEN (1<<4) +#define S3C2410_IICSTAT_ARBITR (1<<3) +#define S3C2410_IICSTAT_ASSLAVE (1<<2) +#define S3C2410_IICSTAT_ADDR0 (1<<1) +#define S3C2410_IICSTAT_LASTBIT (1<<0) + +#endif /* __ASM_ARCH_IIC_H */ diff -Nru a/include/asm-arm/arch-s3c2410/regs-mem.h b/include/asm-arm/arch-s3c2410/regs-mem.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-s3c2410/regs-mem.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,190 @@ +/* linux/include/asm-arm/arch-s3c2410/regs-mem.h + * + * Copyright (c) 2004 Simtec Electronics + * http://www.simtec.co.uk/products/SWLINUX/ + * + * 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. + * + * S3C2410 Memory Control register definitions + * + * Changelog: + * 29-Sep-2004 BJD Initial include for Linux + * +*/ + +#ifndef __ASM_ARM_MEMREGS_H +#define __ASM_ARM_MEMREGS_H "$Id: regs.h,v 1.8 2003/05/01 15:55:41 ben Exp $" + +#ifndef S3C2410_MEMREG +#define S3C2410_MEMREG(x) (S3C2410_VA_MEMCTRL + (x)) +#endif + +/* bus width, and wait state control */ +#define S3C2410_BWSCON S3C2410_MEMREG(0x0000) + +/* bank zero config - note, pinstrapped from OM pins! */ +#define S3C2410_BWSCON_DW0_16 (1<<1) +#define S3C2410_BWSCON_DW0_32 (2<<1) + +/* bank one configs */ +#define S3C2410_BWSCON_DW1_8 (0<<4) +#define S3C2410_BWSCON_DW1_16 (1<<4) +#define S3C2410_BWSCON_DW1_32 (2<<4) +#define S3C2410_BWSCON_WS1 (1<<6) +#define S3C2410_BWSCON_ST1 (1<<7) + +/* bank 2 configurations */ +#define S3C2410_BWSCON_DW2_8 (0<<8) +#define S3C2410_BWSCON_DW2_16 (1<<8) +#define S3C2410_BWSCON_DW2_32 (2<<8) +#define S3C2410_BWSCON_WS2 (1<<10) +#define S3C2410_BWSCON_ST2 (1<<11) + +/* bank 3 configurations */ +#define S3C2410_BWSCON_DW3_8 (0<<12) +#define S3C2410_BWSCON_DW3_16 (1<<12) +#define S3C2410_BWSCON_DW3_32 (2<<12) +#define S3C2410_BWSCON_WS3 (1<<14) +#define S3C2410_BWSCON_ST3 (1<<15) + +/* bank 4 configurations */ +#define S3C2410_BWSCON_DW4_8 (0<<16) +#define S3C2410_BWSCON_DW4_16 (1<<16) +#define S3C2410_BWSCON_DW4_32 (2<<16) +#define S3C2410_BWSCON_WS4 (1<<18) +#define S3C2410_BWSCON_ST4 (1<<19) + +/* bank 5 configurations */ +#define S3C2410_BWSCON_DW5_8 (0<<20) +#define S3C2410_BWSCON_DW5_16 (1<<20) +#define S3C2410_BWSCON_DW5_32 (2<<20) +#define S3C2410_BWSCON_WS5 (1<<22) +#define S3C2410_BWSCON_ST5 (1<<23) + +/* bank 6 configurations */ +#define S3C2410_BWSCON_DW6_8 (0<<24) +#define S3C2410_BWSCON_DW6_16 (1<<24) +#define S3C2410_BWSCON_DW6_32 (2<<24) +#define S3C2410_BWSCON_WS6 (1<<26) +#define S3C2410_BWSCON_ST6 (1<<27) + +/* bank 7 configurations */ +#define S3C2410_BWSCON_DW7_8 (0<<28) +#define S3C2410_BWSCON_DW7_16 (1<<28) +#define S3C2410_BWSCON_DW7_32 (2<<28) +#define S3C2410_BWSCON_WS7 (1<<30) +#define S3C2410_BWSCON_ST7 (1<<31) + +/* memory set (rom, ram) */ +#define S3C2410_BANKCON0 S3C2410_MEMREG(0x0004) +#define S3C2410_BANKCON1 S3C2410_MEMREG(0x0008) +#define S3C2410_BANKCON2 S3C2410_MEMREG(0x000C) +#define S3C2410_BANKCON3 S3C2410_MEMREG(0x0010) +#define S3C2410_BANKCON4 S3C2410_MEMREG(0x0014) +#define S3C2410_BANKCON5 S3C2410_MEMREG(0x0018) +#define S3C2410_BANKCON6 S3C2410_MEMREG(0x001C) +#define S3C2410_BANKCON7 S3C2410_MEMREG(0x0020) + +/* bank configuration registers */ + +#define S3C2410_BANKCON_PMCnorm (0x00) +#define S3C2410_BANKCON_PMC4 (0x01) +#define S3C2410_BANKCON_PMC8 (0x02) +#define S3C2410_BANKCON_PMC16 (0x03) + +/* bank configurations for banks 0..7, note banks + * 6 and 7 have differnt configurations depending on + * the memory type bits */ + +#define S3C2410_BANKCON_Tacp2 (0x0 << 2) +#define S3C2410_BANKCON_Tacp3 (0x1 << 2) +#define S3C2410_BANKCON_Tacp4 (0x2 << 2) +#define S3C2410_BANKCON_Tacp6 (0x3 << 2) + +#define S3C2410_BANKCON_Tcah0 (0x0 << 4) +#define S3C2410_BANKCON_Tcah1 (0x1 << 4) +#define S3C2410_BANKCON_Tcah2 (0x2 << 4) +#define S3C2410_BANKCON_Tcah4 (0x3 << 4) + +#define S3C2410_BANKCON_Tcoh0 (0x0 << 6) +#define S3C2410_BANKCON_Tcoh1 (0x1 << 6) +#define S3C2410_BANKCON_Tcoh2 (0x2 << 6) +#define S3C2410_BANKCON_Tcoh4 (0x3 << 6) + +#define S3C2410_BANKCON_Tacc1 (0x0 << 8) +#define S3C2410_BANKCON_Tacc2 (0x1 << 8) +#define S3C2410_BANKCON_Tacc3 (0x2 << 8) +#define S3C2410_BANKCON_Tacc4 (0x3 << 8) +#define S3C2410_BANKCON_Tacc6 (0x4 << 8) +#define S3C2410_BANKCON_Tacc8 (0x5 << 8) +#define S3C2410_BANKCON_Tacc10 (0x6 << 8) +#define S3C2410_BANKCON_Tacc14 (0x7 << 8) + +#define S3C2410_BANKCON_Tcos0 (0x0 << 11) +#define S3C2410_BANKCON_Tcos1 (0x1 << 11) +#define S3C2410_BANKCON_Tcos2 (0x2 << 11) +#define S3C2410_BANKCON_Tcos4 (0x3 << 11) + +#define S3C2410_BANKCON_Tacs0 (0x0 << 13) +#define S3C2410_BANKCON_Tacs1 (0x1 << 13) +#define S3C2410_BANKCON_Tacs2 (0x2 << 13) +#define S3C2410_BANKCON_Tacs4 (0x3 << 13) + +#define S3C2410_BANKCON_SRAM (0x0 << 15) +#define S3C2410_BANKCON_SDRAM (0x3 << 15) + +/* next bits only for SDRAM in 6,7 */ +#define S3C2410_BANKCON_Trdc2 (0x00 << 2) +#define S3C2410_BANKCON_Trdc3 (0x01 << 2) +#define S3C2410_BANKCON_Trdc4 (0x02 << 2) + +/* control column address select */ +#define S3C2410_BANKCON_SCANb8 (0x00 << 0) +#define S3C2410_BANKCON_SCANb9 (0x01 << 0) +#define S3C2410_BANKCON_SCANb10 (0x02 << 0) + +#define S3C2410_REFRESH S3C2410_MEMREG(0x0024) +#define S3C2410_BANKSIZE S3C2410_MEMREG(0x0028) +#define S3C2410_MRSRB6 S3C2410_MEMREG(0x002C) +#define S3C2410_MRSRB7 S3C2410_MEMREG(0x0030) + +/* refresh control */ + +#define S3C2410_REFRESH_REFEN (1<<23) +#define S3C2410_REFRESH_SELF (1<<22) +#define S3C2410_REFRESH_REFCOUNTER ((1<<11)-1) + +#define S3C2410_REFRESH_TRP_MASK (3<<20) +#define S3C2410_REFRESH_TRP_2clk (0<<20) +#define S3C2410_REFRESH_TRP_3clk (1<<20) +#define S3C2410_REFRESH_TRP_4clk (2<<20) + +#define S3C2410_REFRESH_TSRC_MASK (3<<18) +#define S3C2410_REFRESH_TSRC_4clk (0<<18) +#define S3C2410_REFRESH_TSRC_5clk (1<<18) +#define S3C2410_REFRESH_TSRC_6clk (2<<18) +#define S3C2410_REFRESH_TSRC_7clk (3<<18) + + +/* mode select register(s) */ + +#define S3C2410_MRSRB_CL1 (0x00 << 4) +#define S3C2410_MRSRB_CL2 (0x02 << 4) +#define S3C2410_MRSRB_CL3 (0x03 << 4) + +/* bank size register */ +#define S3C2410_BANKSIZE_128M (0x2 << 0) +#define S3C2410_BANKSIZE_64M (0x1 << 0) +#define S3C2410_BANKSIZE_32M (0x0 << 0) +#define S3C2410_BANKSIZE_16M (0x7 << 0) +#define S3C2410_BANKSIZE_8M (0x6 << 0) +#define S3C2410_BANKSIZE_4M (0x5 << 0) +#define S3C2410_BANKSIZE_2M (0x4 << 0) +#define S3C2410_BANKSIZE_MASK (0x7 << 0) +#define S3C2410_BANKSIZE_SCLK_EN (1<<4) +#define S3C2410_BANKSIZE_SCKE_EN (1<<5) +#define S3C2410_BANKSIZE_BURST (1<<7) + +#endif /* __ASM_ARM_MEMREGS_H */ diff -Nru a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/arch-s3c2410/regs-spi.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-s3c2410/regs-spi.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,56 @@ +/* linux/include/asm-arm/arch-s3c2410/regs-spi.h + * + * Copyright (c) 2004 Fetron GmbH + * + * 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. + * + * S3C2410 SPI register definition + * + * Changelog: + * 20-04-2004 KF Created file + * 04-10-2004 BJD Removed VA address (no longer mapped) + * tidied file for submission + */ + +#ifndef __ASM_ARCH_REGS_SPI_H +#define __ASM_ARCH_REGS_SPI_H + + +#define S3C2410_SPCON (0x00) + +#define S3C2410_SPCON_SMOD_DMA (2<<5) /* DMA mode */ +#define S3C2410_SPCON_SMOD_INT (1<<5) /* interrupt mode */ +#define S3C2410_SPCON_SMOD_POLL (0<<5) /* polling mode */ +#define S3C2410_SPCON_ENSCK (1<<4) /* Enable SCK */ +#define S3C2410_SPCON_MSTR (1<<3) /* Master/Slave select + 0: slave, 1: master */ +#define S3C2410_SPCON_CPOL_HIGH (1<<2) /* Clock polarity select */ +#define S3C2410_SPCON_CPOL_LOW (0<<2) /* Clock polarity select */ + +#define S3C2410_SPCON_CPHA_FMTB (1<<1) /* Clock Phase Select */ +#define S3C2410_SPCON_CPHA_FMTA (0<<1) /* Clock Phase Select */ + +#define S3C2410_SPCON_TAGD (1<<0) /* Tx auto garbage data mode */ + + +#define S3C2410_SPSTA (0x04) + +#define S3C2410_SPSTA_DCOL (1<<2) /* Data Collision Error */ +#define S3C2410_SPSTA_MULD (1<<1) /* Multi Master Error */ +#define S3C2410_SPSTA_READY (1<<0) /* Data Tx/Rx ready */ + + +#define S3C2410_SPPIN (0x08) + +#define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */ +#define S3C2410_SPPIN_RESERVED (1<<1) +#define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ + + +#define S3C2410_SPPRE (0x0C) +#define S3C2410_SPTDAT (0x10) +#define S3C2410_SPRDAT (0x14) + +#endif /* __ASM_ARCH_REGS_SPI_H */ diff -Nru a/include/asm-arm/arch-s3c2410/usb-control.h b/include/asm-arm/arch-s3c2410/usb-control.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-s3c2410/usb-control.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,45 @@ +/* linux/include/asm-arm/arch-s3c2410/usb-control.h + * + * (c) 2004 Simtec Electronics + * Ben Dooks + * + * S3C2410 - usb port information + * + * 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: + * 11-Sep-2004 BJD Created file + * 21-Sep-2004 BJD Updated port info +*/ + +#ifndef __ASM_ARCH_USBCONTROL_H +#define __ASM_ARCH_USBCONTROL_H "include/asm-arm/arch-s3c2410/usb-control.h" + +#define S3C_HCDFLG_USED (1) + +struct s3c2410_hcd_port { + unsigned char flags; + unsigned char power; + unsigned char oc_status; + unsigned char oc_changed; +}; + +struct s3c2410_hcd_info { + struct usb_hcd *hcd; + struct s3c2410_hcd_port port[2]; + + void (*power_control)(int port, int to); + void (*enable_oc)(struct s3c2410_hcd_info *, int on); + void (*report_oc)(struct s3c2410_hcd_info *, int ports); +}; + +static void inline s3c2410_report_oc(struct s3c2410_hcd_info *info, int ports) +{ + if (info->report_oc != NULL) { + (info->report_oc)(info, ports); + } +} + +#endif /*__ASM_ARCH_USBCONTROL_H */ diff -Nru a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h --- a/include/asm-arm/bitops.h 2004-10-06 19:37:46 -07:00 +++ b/include/asm-arm/bitops.h 2004-10-06 19:37:46 -07:00 @@ -345,7 +345,7 @@ extern __inline__ int generic_fls(int x); #define fls(x) \ ( __builtin_constant_p(x) ? generic_fls(x) : \ - ({ int __r; asm("clz%?\t%0, %1" : "=r"(__r) : "r"(x)); 32-__r; }) ) + ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); }) #define __ffs(x) (ffs(x) - 1) #define ffz(x) __ffs( ~(x) ) diff -Nru a/include/asm-arm/hardware/clock.h b/include/asm-arm/hardware/clock.h --- a/include/asm-arm/hardware/clock.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/hardware/clock.h 2004-10-06 19:37:47 -07:00 @@ -64,7 +64,7 @@ void clk_unuse(struct clk *clk); /** - * clk_get_rate - obtain the current clock rate for a clock source. + * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. * This is only valid once the clock source has been enabled. * @clk: clock source */ @@ -85,16 +85,16 @@ /** * clk_round_rate - adjust a rate to the exact rate a clock can provide * @clk: clock source - * @rate: desired clock rate in kHz + * @rate: desired clock rate in Hz * - * Returns rounded clock rate, or negative errno. + * Returns rounded clock rate in Hz, or negative errno. */ long clk_round_rate(struct clk *clk, unsigned long rate); /** * clk_set_rate - set the clock rate for a clock source * @clk: clock source - * @rate: desired clock rate in kHz + * @rate: desired clock rate in Hz * * Returns success (0) or negative errno. */ diff -Nru a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h --- a/include/asm-arm/mach/time.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/mach/time.h 2004-10-06 19:37:47 -07:00 @@ -13,8 +13,11 @@ extern void (*init_arch_time)(void); extern int (*set_rtc)(void); -extern unsigned long(*gettimeoffset)(void); +extern unsigned long (*gettimeoffset)(void); -void timer_tick(struct pt_regs *); +extern void timer_tick(struct pt_regs *); + +extern void save_time_delta(struct timespec *delta, struct timespec *rtc); +extern void restore_time_delta(struct timespec *delta, struct timespec *rtc); #endif diff -Nru a/include/asm-arm/system.h b/include/asm-arm/system.h --- a/include/asm-arm/system.h 2004-10-06 19:37:46 -07:00 +++ b/include/asm-arm/system.h 2004-10-06 19:37:46 -07:00 @@ -50,8 +50,10 @@ #define read_cpuid(reg) \ ({ \ unsigned int __val; \ - asm("mrc%? p15, 0, %0, c0, c0, " __stringify(reg) \ - : "=r" (__val)); \ + asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \ + : "=r" (__val) \ + : \ + : "cc"); \ __val; \ }) diff -Nru a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h --- a/include/asm-arm/unistd.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-arm/unistd.h 2004-10-06 19:37:47 -07:00 @@ -299,6 +299,13 @@ #define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271) #define __NR_pciconfig_read (__NR_SYSCALL_BASE+272) #define __NR_pciconfig_write (__NR_SYSCALL_BASE+273) +#define __NR_mq_open (__NR_SYSCALL_BASE+274) +#define __NR_mq_unlink (__NR_SYSCALL_BASE+275) +#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276) +#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277) +#define __NR_mq_notify (__NR_SYSCALL_BASE+278) +#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279) +#define __NR_waitid (__NR_SYSCALL_BASE+280) /* * The following SWIs are ARM private. diff -Nru a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h --- a/include/asm-ia64/mca.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ia64/mca.h 2004-10-06 19:37:47 -07:00 @@ -22,6 +22,11 @@ #define IA64_MCA_RENDEZ_TIMEOUT (20 * 1000) /* value in milliseconds - 20 seconds */ +typedef struct ia64_fptr { + unsigned long fp; + unsigned long gp; +} ia64_fptr_t; + typedef union cmcv_reg_u { u64 cmcv_regval; struct { @@ -114,6 +119,8 @@ extern void ia64_monarch_init_handler(void); extern void ia64_slave_init_handler(void); extern void ia64_mca_cmc_vector_setup(void); +extern int ia64_reg_MCA_extension(void*); +extern void ia64_unreg_MCA_extension(void); #endif /* !__ASSEMBLY__ */ #endif /* _ASM_IA64_MCA_H */ diff -Nru a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h --- a/include/asm-ia64/sn/sn_sal.h 2004-10-06 19:37:48 -07:00 +++ b/include/asm-ia64/sn/sn_sal.h 2004-10-06 19:37:48 -07:00 @@ -34,6 +34,7 @@ #define SN_SAL_NO_FAULT_ZONE_PHYSICAL 0x02000011 #define SN_SAL_PRINT_ERROR 0x02000012 #define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant +#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant #define SN_SAL_CONSOLE_PUTC 0x02000021 #define SN_SAL_CONSOLE_GETC 0x02000022 #define SN_SAL_CONSOLE_PUTS 0x02000023 @@ -107,12 +108,13 @@ /* - * SN_SAL_GET_PARTITION_ADDR return constants + * SAL Error Codes */ #define SALRET_MORE_PASSES 1 #define SALRET_OK 0 -#define SALRET_INVALID_ARG -2 -#define SALRET_ERROR -3 +#define SALRET_NOT_IMPLEMENTED (-1) +#define SALRET_INVALID_ARG (-2) +#define SALRET_ERROR (-3) /* * SN_SAL_SET_ERROR_HANDLING_FEATURES bit settings @@ -827,6 +829,34 @@ SAL_CALL_REENTRANT(rv, SN_SAL_IROUTER_OP, SAL_IROUTER_INTR_OFF, (u64) nasid, (u64) subch, intr, 0, 0, 0); return (int) rv.v0; +} + +/** + * ia64_sn_get_fit_compt - read a FIT entry from the PROM header + * @nasid: NASID of node to read + * @index: FIT entry index to be retrieved (0..n) + * @fitentry: 16 byte buffer where FIT entry will be stored. + * @banbuf: optional buffer for retrieving banner + * @banlen: length of banner buffer + * + * Access to the physical PROM chips needs to be serialized since reads and + * writes can't occur at the same time, so we need to call into the SAL when + * we want to look at the FIT entries on the chips. + * + * Returns: + * %SALRET_OK if ok + * %SALRET_INVALID_ARG if index too big + * %SALRET_NOT_IMPLEMENTED if running on older PROM + * ??? if nasid invalid OR banner buffer not large enough + */ +static inline int +ia64_sn_get_fit_compt(u64 nasid, u64 index, void *fitentry, void *banbuf, + u64 banlen) +{ + struct ia64_sal_retval rv; + SAL_CALL_NOLOCK(rv, SN_SAL_GET_FIT_COMPT, nasid, index, fitentry, + banbuf, banlen, 0, 0); + return (int) rv.status; } /* diff -Nru a/include/asm-m32r/bitops.h b/include/asm-m32r/bitops.h --- a/include/asm-m32r/bitops.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/bitops.h 2004-10-06 19:37:47 -07:00 @@ -1,17 +1,14 @@ #ifndef _ASM_M32R_BITOPS_H #define _ASM_M32R_BITOPS_H -/* $Id$ */ - /* * linux/include/asm-m32r/bitops.h - * orig : i386 2.4.10 * * Copyright 1992, Linus Torvalds. * * M32R version: * Copyright (C) 2001, 2002 Hitoshi Yamamoto - * Copyright (C) 2004 Hirokazu Takata + * Copyright (C) 2004 Hirokazu Takata */ #include @@ -50,24 +47,25 @@ * Note that @nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static __inline__ void set_bit(int nr, volatile void * addr) +static inline void set_bit(int nr, volatile void * addr) { __u32 mask; volatile __u32 *a = addr; - unsigned long flags; + unsigned long flags; + unsigned long tmp; a += (nr >> 5); mask = (1 << (nr & 0x1F)); local_irq_save(flags); __asm__ __volatile__ ( - DCACHE_CLEAR("r4", "r6", "%0") - LOAD" r4, @%0; \n\t" - "or r4, %1; \n\t" - STORE" r4, @%0; \n\t" - : /* no outputs */ + DCACHE_CLEAR("%0", "r6", "%1") + LOAD" %0, @%1; \n\t" + "or %0, %2; \n\t" + STORE" %0, @%1; \n\t" + : "=&r" (tmp) : "r" (a), "r" (mask) - : "memory", "r4" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r6" #endif /* CONFIG_CHIP_M32700_TS1 */ @@ -84,7 +82,7 @@ * If it's called on the same region of memory simultaneously, the effect * may be that only one operation succeeds. */ -static __inline__ void __set_bit(int nr, volatile void * addr) +static inline void __set_bit(int nr, volatile void * addr) { __u32 mask; volatile __u32 *a = addr; @@ -104,11 +102,12 @@ * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit() * in order to ensure changes are visible on other processors. */ -static __inline__ void clear_bit(int nr, volatile void * addr) +static inline void clear_bit(int nr, volatile void * addr) { __u32 mask; volatile __u32 *a = addr; - unsigned long flags; + unsigned long flags; + unsigned long tmp; a += (nr >> 5); mask = (1 << (nr & 0x1F)); @@ -116,13 +115,13 @@ local_irq_save(flags); __asm__ __volatile__ ( - DCACHE_CLEAR("r4", "r6", "%0") - LOAD" r4, @%0; \n\t" - "and r4, %1; \n\t" - STORE" r4, @%0; \n\t" - : /* no outputs */ + DCACHE_CLEAR("%0", "r6", "%1") + LOAD" %0, @%1; \n\t" + "and %0, %2; \n\t" + STORE" %0, @%1; \n\t" + : "=&r" (tmp) : "r" (a), "r" (~mask) - : "memory", "r4" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r6" #endif /* CONFIG_CHIP_M32700_TS1 */ @@ -130,7 +129,7 @@ local_irq_restore(flags); } -static __inline__ void __clear_bit(int nr, volatile unsigned long * addr) +static inline void __clear_bit(int nr, volatile unsigned long * addr) { unsigned long mask; volatile unsigned long *a = addr; @@ -152,7 +151,7 @@ * If it's called on the same region of memory simultaneously, the effect * may be that only one operation succeeds. */ -static __inline__ void __change_bit(int nr, volatile void * addr) +static inline void __change_bit(int nr, volatile void * addr) { __u32 mask; volatile __u32 *a = addr; @@ -171,24 +170,25 @@ * Note that @nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static __inline__ void change_bit(int nr, volatile void * addr) +static inline void change_bit(int nr, volatile void * addr) { __u32 mask; volatile __u32 *a = addr; - unsigned long flags; + unsigned long flags; + unsigned long tmp; a += (nr >> 5); mask = (1 << (nr & 0x1F)); local_irq_save(flags); __asm__ __volatile__ ( - DCACHE_CLEAR("r4", "r6", "%0") - LOAD" r4, @%0; \n\t" - "xor r4, %1; \n\t" - STORE" r4, @%0; \n\t" - : /* no outputs */ + DCACHE_CLEAR("%0", "r6", "%1") + LOAD" %0, @%1; \n\t" + "xor %0, %2; \n\t" + STORE" %0, @%1; \n\t" + : "=&r" (tmp) : "r" (a), "r" (mask) - : "memory", "r4" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r6" #endif /* CONFIG_CHIP_M32700_TS1 */ @@ -204,28 +204,30 @@ * This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ -static __inline__ int test_and_set_bit(int nr, volatile void * addr) +static inline int test_and_set_bit(int nr, volatile void * addr) { __u32 mask, oldbit; volatile __u32 *a = addr; - unsigned long flags; + unsigned long flags; + unsigned long tmp; a += (nr >> 5); mask = (1 << (nr & 0x1F)); local_irq_save(flags); __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%1") - LOAD" %0, @%1; \n\t" - "mv r4, %0; \n\t" - "and %0, %2; \n\t" - "or r4, %2; \n\t" - STORE" r4, @%1; \n\t" - : "=&r" (oldbit) + DCACHE_CLEAR("%0", "%1", "%2") + LOAD" %0, @%2; \n\t" + "mv %1, %0; \n\t" + "and %0, %3; \n\t" + "or %1, %3; \n\t" + STORE" %1, @%2; \n\t" + : "=&r" (oldbit), "=&r" (tmp) : "r" (a), "r" (mask) - : "memory", "r4" + : "memory" ); local_irq_restore(flags); + return (oldbit != 0); } @@ -238,7 +240,7 @@ * If two examples of this operation race, one can appear to succeed * but actually fail. You must protect multiple accesses with a lock. */ -static __inline__ int __test_and_set_bit(int nr, volatile void * addr) +static inline int __test_and_set_bit(int nr, volatile void * addr) { __u32 mask, oldbit; volatile __u32 *a = addr; @@ -259,11 +261,12 @@ * This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ -static __inline__ int test_and_clear_bit(int nr, volatile void * addr) +static inline int test_and_clear_bit(int nr, volatile void * addr) { __u32 mask, oldbit; volatile __u32 *a = addr; - unsigned long flags; + unsigned long flags; + unsigned long tmp; a += (nr >> 5); mask = (1 << (nr & 0x1F)); @@ -271,16 +274,16 @@ local_irq_save(flags); __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%2") - LOAD" %0, @%2; \n\t" - "mv r4, %0; \n\t" - "and %0, %1; \n\t" - "not %1, %1; \n\t" - "and r4, %1; \n\t" - STORE" r4, @%2; \n\t" - : "=&r" (oldbit), "+r" (mask) + DCACHE_CLEAR("%0", "%1", "%3") + LOAD" %0, @%3; \n\t" + "mv %1, %0; \n\t" + "and %0, %2; \n\t" + "not %2, %2; \n\t" + "and %1, %2; \n\t" + STORE" %1, @%3; \n\t" + : "=&r" (oldbit), "=&r" (tmp), "+r" (mask) : "r" (a) - : "memory", "r4" + : "memory" ); local_irq_restore(flags); @@ -296,7 +299,7 @@ * If two examples of this operation race, one can appear to succeed * but actually fail. You must protect multiple accesses with a lock. */ -static __inline__ int __test_and_clear_bit(int nr, volatile void * addr) +static inline int __test_and_clear_bit(int nr, volatile void * addr) { __u32 mask, oldbit; volatile __u32 *a = addr; @@ -310,7 +313,7 @@ } /* WARNING: non atomic and it can be reordered! */ -static __inline__ int __test_and_change_bit(int nr, volatile void * addr) +static inline int __test_and_change_bit(int nr, volatile void * addr) { __u32 mask, oldbit; volatile __u32 *a = addr; @@ -331,28 +334,30 @@ * This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ -static __inline__ int test_and_change_bit(int nr, volatile void * addr) +static inline int test_and_change_bit(int nr, volatile void * addr) { __u32 mask, oldbit; volatile __u32 *a = addr; - unsigned long flags; + unsigned long flags; + unsigned long tmp; a += (nr >> 5); mask = (1 << (nr & 0x1F)); local_irq_save(flags); __asm__ __volatile__ ( - DCACHE_CLEAR("%0", "r4", "%1") - LOAD" %0, @%1; \n\t" - "mv r4, %0; \n\t" - "and %0, %2; \n\t" - "xor r4, %2; \n\t" - STORE" r4, @%1; \n\t" - : "=&r" (oldbit) + DCACHE_CLEAR("%0", "%1", "%2") + LOAD" %0, @%2; \n\t" + "mv %1, %0; \n\t" + "and %0, %3; \n\t" + "xor %1, %3; \n\t" + STORE" %1, @%2; \n\t" + : "=&r" (oldbit), "=&r" (tmp) : "r" (a), "r" (mask) - : "memory", "r4" + : "memory" ); local_irq_restore(flags); + return (oldbit != 0); } @@ -365,7 +370,7 @@ static int test_bit(int nr, const volatile void * addr); #endif -static __inline__ int test_bit(int nr, const volatile void * addr) +static inline int test_bit(int nr, const volatile void * addr) { __u32 mask; const volatile __u32 *a = addr; @@ -382,7 +387,7 @@ * * Undefined if no zero exists, so code should check against ~0UL first. */ -static __inline__ unsigned long ffz(unsigned long word) +static inline unsigned long ffz(unsigned long word) { int k; @@ -415,7 +420,7 @@ * @offset: The bitnumber to start searching at * @size: The maximum size to search */ -static __inline__ int find_next_zero_bit(void *addr, int size, int offset) +static inline int find_next_zero_bit(void *addr, int size, int offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 5); unsigned long result = offset & ~31UL; @@ -457,7 +462,7 @@ * * Undefined if no bit exists, so code should check against 0 first. */ -static __inline__ unsigned long __ffs(unsigned long word) +static inline unsigned long __ffs(unsigned long word) { int k = 0; @@ -483,7 +488,7 @@ * unlikely to be set. It's guaranteed that at least one of the 140 * bits is cleared. */ -static __inline__ int sched_find_first_bit(unsigned long *b) +static inline int sched_find_first_bit(unsigned long *b) { if (unlikely(b[0])) return __ffs(b[0]); @@ -502,7 +507,7 @@ * @offset: The bitnumber to start searching at * @size: The maximum size to search */ -static __inline__ unsigned long find_next_bit(const unsigned long *addr, +static inline unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) { unsigned int *p = ((unsigned int *) addr) + (offset >> 5); @@ -589,7 +594,7 @@ #define ext2_find_first_zero_bit find_first_zero_bit #define ext2_find_next_zero_bit find_next_zero_bit #else -static __inline__ int ext2_set_bit(int nr, volatile void * addr) +static inline int ext2_set_bit(int nr, volatile void * addr) { __u8 mask, oldbit; volatile __u8 *a = addr; @@ -602,7 +607,7 @@ return (oldbit != 0); } -static __inline__ int ext2_clear_bit(int nr, volatile void * addr) +static inline int ext2_clear_bit(int nr, volatile void * addr) { __u8 mask, oldbit; volatile __u8 *a = addr; @@ -615,7 +620,7 @@ return (oldbit != 0); } -static __inline__ int ext2_test_bit(int nr, const volatile void * addr) +static inline int ext2_test_bit(int nr, const volatile void * addr) { __u32 mask; const volatile __u8 *a = addr; @@ -629,7 +634,7 @@ #define ext2_find_first_zero_bit(addr, size) \ ext2_find_next_zero_bit((addr), (size), 0) -static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, +static inline unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 5); @@ -709,4 +714,3 @@ #endif /* __KERNEL__ */ #endif /* _ASM_M32R_BITOPS_H */ - diff -Nru a/include/asm-m32r/hardirq.h b/include/asm-m32r/hardirq.h --- a/include/asm-m32r/hardirq.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/hardirq.h 2004-10-06 19:37:47 -07:00 @@ -30,7 +30,12 @@ #define PREEMPT_BITS 8 #define SOFTIRQ_BITS 8 + +#if NR_IRQS > 256 +#define HARDIRQ_BITS 9 +#else #define HARDIRQ_BITS 8 +#endif #define PREEMPT_SHIFT 0 #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) @@ -45,29 +50,10 @@ # error HARDIRQ_BITS is too low! #endif -/* - * Are we doing bottom half or hardware interrupt processing? - * Are we in a softirq context? Interrupt context? - */ -#define in_irq() (hardirq_count()) -#define in_softirq() (softirq_count()) -#define in_interrupt() (irq_count()) - - -#define hardirq_trylock() (!in_interrupt()) -#define hardirq_endlock() do { } while (0) - #define irq_enter() (preempt_count() += HARDIRQ_OFFSET) #define nmi_enter() (irq_enter()) #define nmi_exit() (preempt_count() -= HARDIRQ_OFFSET) -#ifdef CONFIG_PREEMPT -# define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked()) -# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) -#else -# define in_atomic() (preempt_count() != 0) -# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET -#endif #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ @@ -75,11 +61,5 @@ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) - -#ifndef CONFIG_SMP -# define synchronize_irq(irq) barrier() -#else - extern void synchronize_irq(unsigned int irq); -#endif /* CONFIG_SMP */ #endif /* __ASM_HARDIRQ_H */ diff -Nru a/include/asm-m32r/io.h b/include/asm-m32r/io.h --- a/include/asm-m32r/io.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/io.h 2004-10-06 19:37:47 -07:00 @@ -1,8 +1,8 @@ #ifndef _ASM_M32R_IO_H #define _ASM_M32R_IO_H -/* $Id$ */ - +#include +#include #include /* __va */ #ifdef __KERNEL__ @@ -22,7 +22,7 @@ * this function */ -static __inline__ unsigned long virt_to_phys(volatile void * address) +static inline unsigned long virt_to_phys(volatile void * address) { return __pa(address); } @@ -40,12 +40,13 @@ * this function */ -static __inline__ void *phys_to_virt(unsigned long address) +static inline void *phys_to_virt(unsigned long address) { return __va(address); } -extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); +extern void __iomem * +__ioremap(unsigned long offset, unsigned long size, unsigned long flags); /** * ioremap - map bus memory into CPU space @@ -59,12 +60,12 @@ * address. */ -static __inline__ void * ioremap(unsigned long offset, unsigned long size) +static inline void * ioremap(unsigned long offset, unsigned long size) { return __ioremap(offset, size, 0); } -extern void iounmap(void *addr); +extern void iounmap(volatile void __iomem *addr); #define ioremap_nocache(off,size) ioremap(off,size) /* @@ -95,32 +96,32 @@ static inline unsigned char _readb(unsigned long addr) { - return *(volatile unsigned char *)addr; + return *(volatile unsigned char __force *)addr; } static inline unsigned short _readw(unsigned long addr) { - return *(volatile unsigned short *)addr; + return *(volatile unsigned short __force *)addr; } static inline unsigned long _readl(unsigned long addr) { - return *(volatile unsigned long *)addr; + return *(volatile unsigned long __force *)addr; } static inline void _writeb(unsigned char b, unsigned long addr) { - *(volatile unsigned char *)addr = b; + *(volatile unsigned char __force *)addr = b; } static inline void _writew(unsigned short w, unsigned long addr) { - *(volatile unsigned short *)addr = w; + *(volatile unsigned short __force *)addr = w; } static inline void _writel(unsigned long l, unsigned long addr) { - *(volatile unsigned long *)addr = l; + *(volatile unsigned long __force *)addr = l; } #define inb _inb @@ -192,9 +193,23 @@ return retval; } -#define memset_io(a, b, c) memset((void *)(a), (b), (c)) -#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c)) -#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c)) +static inline void +memset_io(volatile void __iomem *addr, unsigned char val, int count) +{ + memset((void __force *) addr, val, count); +} + +static inline void +memcpy_fromio(void *dst, volatile void __iomem *src, int count) +{ + memcpy(dst, (void __force *) src, count); +} + +static inline void +memcpy_toio(volatile void __iomem *dst, const void *src, int count) +{ + memcpy((void __force *) dst, src, count); +} #endif /* __KERNEL__ */ diff -Nru a/include/asm-m32r/m32102.h b/include/asm-m32r/m32102.h --- a/include/asm-m32r/m32102.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/m32102.h 2004-10-06 19:37:47 -07:00 @@ -2,10 +2,11 @@ #define _M32102_H_ /* - * Mitsubishi M32R 32102 group - * Copyright (c) 2001 [Hitoshi Yamamoto] All rights reserved. + * Renesas M32R 32102 group + * + * Copyright (c) 2001 Hitoshi Yamamoto + * Copyright (c) 2003, 2004 Renesas Technology Corp. */ -/* $Id$ */ /*======================================================================* * Special Function Register diff -Nru a/include/asm-m32r/m32r.h b/include/asm-m32r/m32r.h --- a/include/asm-m32r/m32r.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/m32r.h 2004-10-06 19:37:47 -07:00 @@ -2,11 +2,10 @@ #define _ASM_M32R_M32R_H_ /* - * Mitsubishi M32R processor - * Copyright (C) 1997-2002, Mitsubishi Electric Corporation + * Renesas M32R processor + * + * Copyright (C) 2003, 2004 Renesas Technology Corp. */ - -/* $Id$ */ #include diff -Nru a/include/asm-m32r/m32r_mp_fpga.h b/include/asm-m32r/m32r_mp_fpga.h --- a/include/asm-m32r/m32r_mp_fpga.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/m32r_mp_fpga.h 2004-10-06 19:37:47 -07:00 @@ -2,11 +2,11 @@ #define _ASM_M32R_M32R_MP_FPGA_ /* - * Mitsubishi M32R-MP-FPGA - * Copyright (c) 2002 [Hitoshi Yamamoto] All rights reserved. + * Renesas M32R-MP-FPGA + * + * Copyright (c) 2002 Hitoshi Yamamoto + * Copyright (c) 2003, 2004 Renesas Technology Corp. */ - -/* $Id$ */ /* * ======================================================== diff -Nru a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h --- a/include/asm-m32r/semaphore.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/semaphore.h 2004-10-06 19:37:47 -07:00 @@ -1,8 +1,6 @@ #ifndef _ASM_M32R_SEMAPHORE_H #define _ASM_M32R_SEMAPHORE_H -/* $Id$ */ - #include #ifdef __KERNEL__ @@ -10,39 +8,15 @@ /* * SMP- and interrupt-safe semaphores.. * - * (C) Copyright 1996 Linus Torvalds - * - * Modified 1996-12-23 by Dave Grothe to fix bugs in - * the original code and to make semaphore waits - * interruptible so that processes waiting on - * semaphores can be killed. - * Modified 1999-02-14 by Andrea Arcangeli, split the sched.c helper - * functions in asm/sempahore-helper.h while fixing a - * potential and subtle race discovered by Ulrich Schmid - * in down_interruptible(). Since I started to play here I - * also implemented the `trylock' semaphore operation. - * 1999-07-02 Artur Skawina - * Optimized "0(ecx)" -> "(ecx)" (the assembler does not - * do this). Changed calling sequences from push/jmp to - * traditional call/ret. - * Modified 2001-01-01 Andreas Franck - * Some hacks to ensure compatibility with recent - * GCC snapshots, to avoid stack corruption when compiling - * with -fomit-frame-pointer. It's not sure if this will - * be fixed in GCC, as our previous implementation was a - * bit dubious. - * - * If you would like to see an analysis of this implementation, please - * ftp to gcom.com and download the file - * /pub/linux/src/semaphore/semaphore-2.0.24.tar.gz. - * + * Copyright (C) 1996 Linus Torvalds + * Copyright (C) 2004 Hirokazu Takata */ #include -#include -#include #include #include +#include +#include #undef LOAD #undef STORE @@ -58,21 +32,14 @@ atomic_t count; int sleepers; wait_queue_head_t wait; -#ifdef WAITQUEUE_DEBUG - long __magic; -#endif }; -#ifdef WAITQUEUE_DEBUG -# define __SEM_DEBUG_INIT(name) \ - , (int)&(name).__magic -#else -# define __SEM_DEBUG_INIT(name) -#endif - -#define __SEMAPHORE_INITIALIZER(name,count) \ -{ ATOMIC_INIT(count), 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ - __SEM_DEBUG_INIT(name) } +#define __SEMAPHORE_INITIALIZER(name, n) \ +{ \ + .count = ATOMIC_INIT(n), \ + .sleepers = 0, \ + .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ +} #define __MUTEX_INITIALIZER(name) \ __SEMAPHORE_INITIALIZER(name,1) @@ -83,7 +50,7 @@ #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) -static __inline__ void sema_init (struct semaphore *sem, int val) +static inline void sema_init (struct semaphore *sem, int val) { /* * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); @@ -94,17 +61,14 @@ atomic_set(&sem->count, val); sem->sleepers = 0; init_waitqueue_head(&sem->wait); -#ifdef WAITQUEUE_DEBUG - sem->__magic = (int)&sem->__magic; -#endif } -static __inline__ void init_MUTEX (struct semaphore *sem) +static inline void init_MUTEX (struct semaphore *sem) { sema_init(sem, 1); } -static __inline__ void init_MUTEX_LOCKED (struct semaphore *sem) +static inline void init_MUTEX_LOCKED (struct semaphore *sem) { sema_init(sem, 0); } @@ -120,19 +84,15 @@ asmlinkage void __up(struct semaphore * sem); /* - * This is ugly, but we want the default case to fall through. - * "__down_failed" is a special asm handler that calls the C - * routine that actually waits. See arch/i386/kernel/semaphore.c + * Atomically decrement the semaphore's count. If it goes negative, + * block the calling thread in the TASK_UNINTERRUPTIBLE state. */ -static __inline__ void down(struct semaphore * sem) +static inline void down(struct semaphore * sem) { unsigned long flags; - int temp; - -#ifdef WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif + long count; + might_sleep(); local_irq_save(flags); __asm__ __volatile__ ( "# down \n\t" @@ -140,7 +100,7 @@ LOAD" %0, @%1; \n\t" "addi %0, #-1; \n\t" STORE" %0, @%1; \n\t" - : "=&r" (temp) + : "=&r" (count) : "r" (&sem->count) : "memory" #ifdef CONFIG_CHIP_M32700_TS1 @@ -149,7 +109,7 @@ ); local_irq_restore(flags); - if (temp < 0) + if (unlikely(count < 0)) __down(sem); } @@ -157,16 +117,13 @@ * Interruptible try to acquire a semaphore. If we obtained * it, return zero. If we were interrupted, returns -EINTR */ -static __inline__ int down_interruptible(struct semaphore * sem) +static inline int down_interruptible(struct semaphore * sem) { unsigned long flags; - int temp; + long count; int result = 0; -#ifdef WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif - + might_sleep(); local_irq_save(flags); __asm__ __volatile__ ( "# down_interruptible \n\t" @@ -174,7 +131,7 @@ LOAD" %0, @%1; \n\t" "addi %0, #-1; \n\t" STORE" %0, @%1; \n\t" - : "=&r" (temp) + : "=&r" (count) : "r" (&sem->count) : "memory" #ifdef CONFIG_CHIP_M32700_TS1 @@ -183,7 +140,7 @@ ); local_irq_restore(flags); - if (temp < 0) + if (unlikely(count < 0)) result = __down_interruptible(sem); return result; @@ -193,16 +150,12 @@ * Non-blockingly attempt to down() a semaphore. * Returns zero if we acquired it */ -static __inline__ int down_trylock(struct semaphore * sem) +static inline int down_trylock(struct semaphore * sem) { unsigned long flags; - int temp; + long count; int result = 0; -#ifdef WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif - local_irq_save(flags); __asm__ __volatile__ ( "# down_trylock \n\t" @@ -210,7 +163,7 @@ LOAD" %0, @%1; \n\t" "addi %0, #-1; \n\t" STORE" %0, @%1; \n\t" - : "=&r" (temp) + : "=&r" (count) : "r" (&sem->count) : "memory" #ifdef CONFIG_CHIP_M32700_TS1 @@ -219,7 +172,7 @@ ); local_irq_restore(flags); - if (temp < 0) + if (unlikely(count < 0)) result = __down_trylock(sem); return result; @@ -231,14 +184,10 @@ * The default case (no contention) will result in NO * jumps for both down() and up(). */ -static __inline__ void up(struct semaphore * sem) +static inline void up(struct semaphore * sem) { unsigned long flags; - int temp; - -#ifdef WAITQUEUE_DEBUG - CHECK_MAGIC(sem->__magic); -#endif + long count; local_irq_save(flags); __asm__ __volatile__ ( @@ -247,7 +196,7 @@ LOAD" %0, @%1; \n\t" "addi %0, #1; \n\t" STORE" %0, @%1; \n\t" - : "=&r" (temp) + : "=&r" (count) : "r" (&sem->count) : "memory" #ifdef CONFIG_CHIP_M32700_TS1 @@ -256,11 +205,10 @@ ); local_irq_restore(flags); - if (temp <= 0) + if (unlikely(count <= 0)) __up(sem); } #endif /* __KERNEL__ */ #endif /* _ASM_M32R_SEMAPHORE_H */ - diff -Nru a/include/asm-m32r/spinlock.h b/include/asm-m32r/spinlock.h --- a/include/asm-m32r/spinlock.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-m32r/spinlock.h 2004-10-06 19:37:47 -07:00 @@ -1,14 +1,12 @@ #ifndef _ASM_M32R_SPINLOCK_H #define _ASM_M32R_SPINLOCK_H -/* $Id$ */ - /* * linux/include/asm-m32r/spinlock.h - * orig : i386 2.4.10 * * M32R version: * Copyright (C) 2001, 2002 Hitoshi Yamamoto + * Copyright (C) 2004 Hirokazu Takata */ #include /* CONFIG_DEBUG_SPINLOCK, CONFIG_SMP */ @@ -41,6 +39,9 @@ #if SPINLOCK_DEBUG unsigned magic; #endif +#ifdef CONFIG_PREEMPT + unsigned int break_lock; +#endif } spinlock_t; #define SPINLOCK_MAGIC 0xdead4ead @@ -66,22 +67,17 @@ #define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x)) #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) -/* - * This works. Despite all the confusion. +/** + * _raw_spin_trylock - Try spin lock and return a result + * @lock: Pointer to the lock variable + * + * _raw_spin_trylock() tries to get the lock and returns a result. + * On the m32r, the result value is 1 (= Success) or 0 (= Failure). */ - -/*======================================================================* - * Try spin lock - *======================================================================* - * Argument: - * arg0: lock - * Return value: - * =1: Success - * =0: Failure - *======================================================================*/ -static __inline__ int _raw_spin_trylock(spinlock_t *lock) +static inline int _raw_spin_trylock(spinlock_t *lock) { int oldval; + unsigned long tmp1, tmp2; /* * lock->lock : =1 : unlock @@ -93,16 +89,16 @@ */ __asm__ __volatile__ ( "# spin_trylock \n\t" - "ldi r4, #0; \n\t" - "mvfc r5, psw; \n\t" + "ldi %1, #0; \n\t" + "mvfc %2, psw; \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("%0", "r6", "%1") - "lock %0, @%1; \n\t" - "unlock r4, @%1; \n\t" - "mvtc r5, psw; \n\t" - : "=&r" (oldval) + DCACHE_CLEAR("%0", "r6", "%3") + "lock %0, @%3; \n\t" + "unlock %1, @%3; \n\t" + "mvtc %2, psw; \n\t" + : "=&r" (oldval), "=&r" (tmp1), "=&r" (tmp2) : "r" (&lock->lock) - : "memory", "r4", "r5" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r6" #endif /* CONFIG_CHIP_M32700_TS1 */ @@ -111,8 +107,10 @@ return (oldval > 0); } -static __inline__ void _raw_spin_lock(spinlock_t *lock) +static inline void _raw_spin_lock(spinlock_t *lock) { + unsigned long tmp0, tmp1; + #if SPINLOCK_DEBUG __label__ here; here: @@ -135,31 +133,31 @@ "# spin_lock \n\t" ".fillinsn \n" "1: \n\t" - "mvfc r5, psw; \n\t" + "mvfc %1, psw; \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("r4", "r6", "%0") - "lock r4, @%0; \n\t" - "addi r4, #-1; \n\t" - "unlock r4, @%0; \n\t" - "mvtc r5, psw; \n\t" - "bltz r4, 2f; \n\t" + DCACHE_CLEAR("%0", "r6", "%2") + "lock %0, @%2; \n\t" + "addi %0, #-1; \n\t" + "unlock %0, @%2; \n\t" + "mvtc %1, psw; \n\t" + "bltz %0, 2f; \n\t" LOCK_SECTION_START(".balign 4 \n\t") ".fillinsn \n" "2: \n\t" - "ld r4, @%0; \n\t" - "bgtz r4, 1b; \n\t" + "ld %0, @%2; \n\t" + "bgtz %0, 1b; \n\t" "bra 2b; \n\t" LOCK_SECTION_END - : /* no outputs */ + : "=&r" (tmp0), "=&r" (tmp1) : "r" (&lock->lock) - : "memory", "r4", "r5" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r6" #endif /* CONFIG_CHIP_M32700_TS1 */ ); } -static __inline__ void _raw_spin_unlock(spinlock_t *lock) +static inline void _raw_spin_unlock(spinlock_t *lock) { #if SPINLOCK_DEBUG BUG_ON(lock->magic != SPINLOCK_MAGIC); @@ -184,6 +182,9 @@ #if SPINLOCK_DEBUG unsigned magic; #endif +#ifdef CONFIG_PREEMPT + unsigned int break_lock; +#endif } rwlock_t; #define RWLOCK_MAGIC 0xdeaf1eed @@ -211,8 +212,10 @@ */ /* the spinlock helpers are in arch/i386/kernel/semaphore.c */ -static __inline__ void _raw_read_lock(rwlock_t *rw) +static inline void _raw_read_lock(rwlock_t *rw) { + unsigned long tmp0, tmp1; + #if SPINLOCK_DEBUG BUG_ON(rw->magic != RWLOCK_MAGIC); #endif @@ -231,40 +234,42 @@ "# read_lock \n\t" ".fillinsn \n" "1: \n\t" - "mvfc r5, psw; \n\t" + "mvfc %1, psw; \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("r4", "r6", "%0") - "lock r4, @%0; \n\t" - "addi r4, #-1; \n\t" - "unlock r4, @%0; \n\t" - "mvtc r5, psw; \n\t" - "bltz r4, 2f; \n\t" + DCACHE_CLEAR("%0", "r6", "%2") + "lock %0, @%2; \n\t" + "addi %0, #-1; \n\t" + "unlock %0, @%2; \n\t" + "mvtc %1, psw; \n\t" + "bltz %0, 2f; \n\t" LOCK_SECTION_START(".balign 4 \n\t") ".fillinsn \n" "2: \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("r4", "r6", "%0") - "lock r4, @%0; \n\t" - "addi r4, #1; \n\t" - "unlock r4, @%0; \n\t" - "mvtc r5, psw; \n\t" + DCACHE_CLEAR("%0", "r6", "%2") + "lock %0, @%2; \n\t" + "addi %0, #1; \n\t" + "unlock %0, @%2; \n\t" + "mvtc %1, psw; \n\t" ".fillinsn \n" "3: \n\t" - "ld r4, @%0; \n\t" - "bgtz r4, 1b; \n\t" + "ld %0, @%2; \n\t" + "bgtz %0, 1b; \n\t" "bra 3b; \n\t" LOCK_SECTION_END - : /* no outputs */ + : "=&r" (tmp0), "=&r" (tmp1) : "r" (&rw->lock) - : "memory", "r4", "r5" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r6" #endif /* CONFIG_CHIP_M32700_TS1 */ ); } -static __inline__ void _raw_write_lock(rwlock_t *rw) +static inline void _raw_write_lock(rwlock_t *rw) { + unsigned long tmp0, tmp1, tmp2; + #if SPINLOCK_DEBUG BUG_ON(rw->magic != RWLOCK_MAGIC); #endif @@ -281,85 +286,91 @@ */ __asm__ __volatile__ ( "# write_lock \n\t" - "seth r5, #high(" RW_LOCK_BIAS_STR "); \n\t" - "or3 r5, r5, #low(" RW_LOCK_BIAS_STR "); \n\t" + "seth %1, #high(" RW_LOCK_BIAS_STR "); \n\t" + "or3 %1, %1, #low(" RW_LOCK_BIAS_STR "); \n\t" ".fillinsn \n" "1: \n\t" - "mvfc r6, psw; \n\t" + "mvfc %2, psw; \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("r4", "r7", "%0") - "lock r4, @%0; \n\t" - "sub r4, r5; \n\t" - "unlock r4, @%0; \n\t" - "mvtc r6, psw; \n\t" - "bnez r4, 2f; \n\t" + DCACHE_CLEAR("%0", "r7", "%3") + "lock %0, @%3; \n\t" + "sub %0, %1; \n\t" + "unlock %0, @%3; \n\t" + "mvtc %2, psw; \n\t" + "bnez %0, 2f; \n\t" LOCK_SECTION_START(".balign 4 \n\t") ".fillinsn \n" "2: \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("r4", "r7", "%0") - "lock r4, @%0; \n\t" - "add r4, r5; \n\t" - "unlock r4, @%0; \n\t" - "mvtc r6, psw; \n\t" + DCACHE_CLEAR("%0", "r7", "%3") + "lock %0, @%3; \n\t" + "add %0, %1; \n\t" + "unlock %0, @%3; \n\t" + "mvtc %2, psw; \n\t" ".fillinsn \n" "3: \n\t" - "ld r4, @%0; \n\t" - "beq r4, r5, 1b; \n\t" + "ld %0, @%3; \n\t" + "beq %0, %1, 1b; \n\t" "bra 3b; \n\t" LOCK_SECTION_END - : /* no outputs */ + : "=&r" (tmp0), "=&r" (tmp1), "=&r" (tmp2) : "r" (&rw->lock) - : "memory", "r4", "r5", "r6" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r7" #endif /* CONFIG_CHIP_M32700_TS1 */ ); } -static __inline__ void _raw_read_unlock(rwlock_t *rw) +static inline void _raw_read_unlock(rwlock_t *rw) { + unsigned long tmp0, tmp1; + __asm__ __volatile__ ( "# read_unlock \n\t" - "mvfc r5, psw; \n\t" + "mvfc %1, psw; \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("r4", "r6", "%0") - "lock r4, @%0; \n\t" - "addi r4, #1; \n\t" - "unlock r4, @%0; \n\t" - "mvtc r5, psw; \n\t" - : /* no outputs */ + DCACHE_CLEAR("%0", "r6", "%2") + "lock %0, @%2; \n\t" + "addi %0, #1; \n\t" + "unlock %0, @%2; \n\t" + "mvtc %1, psw; \n\t" + : "=&r" (tmp0), "=&r" (tmp1) : "r" (&rw->lock) - : "memory", "r4", "r5" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r6" #endif /* CONFIG_CHIP_M32700_TS1 */ ); } -static __inline__ void _raw_write_unlock(rwlock_t *rw) +static inline void _raw_write_unlock(rwlock_t *rw) { + unsigned long tmp0, tmp1, tmp2; + __asm__ __volatile__ ( "# write_unlock \n\t" - "seth r5, #high(" RW_LOCK_BIAS_STR "); \n\t" - "or3 r5, r5, #low(" RW_LOCK_BIAS_STR "); \n\t" - "mvfc r6, psw; \n\t" + "seth %1, #high(" RW_LOCK_BIAS_STR "); \n\t" + "or3 %1, %1, #low(" RW_LOCK_BIAS_STR "); \n\t" + "mvfc %2, psw; \n\t" "clrpsw #0x40 -> nop; \n\t" - DCACHE_CLEAR("r4", "r7", "%0") - "lock r4, @%0; \n\t" - "add r4, r5; \n\t" - "unlock r4, @%0; \n\t" - "mvtc r6, psw; \n\t" - : /* no outputs */ + DCACHE_CLEAR("%0", "r7", "%3") + "lock %0, @%3; \n\t" + "add %0, %1; \n\t" + "unlock %0, @%3; \n\t" + "mvtc %2, psw; \n\t" + : "=&r" (tmp0), "=&r" (tmp1), "=&r" (tmp2) : "r" (&rw->lock) - : "memory", "r4", "r5", "r6" + : "memory" #ifdef CONFIG_CHIP_M32700_TS1 , "r7" #endif /* CONFIG_CHIP_M32700_TS1 */ ); } -static __inline__ int _raw_write_trylock(rwlock_t *lock) +#define _raw_read_trylock(lock) generic_raw_read_trylock(lock) + +static inline int _raw_write_trylock(rwlock_t *lock) { atomic_t *count = (atomic_t *)lock; if (atomic_sub_and_test(RW_LOCK_BIAS, count)) diff -Nru a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h --- a/include/asm-mips/vr41xx/vrc4173.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-mips/vr41xx/vrc4173.h 2004-10-06 19:37:47 -07:00 @@ -48,6 +48,8 @@ /* * PCI I/O accesses */ +#ifdef CONFIG_VRC4173 + extern unsigned long vrc4173_io_offset; #define set_vrc4173_io_offset(offset) do { vrc4173_io_offset = (offset); } while (0) @@ -74,6 +76,34 @@ #define vrc4173_insw(port,addr,count) insw(vrc4173_io_offset+(port),(addr),(count)) #define vrc4173_insl(port,addr,count) insl(vrc4173_io_offset+(port),(addr),(count)) +#else + +#define set_vrc4173_io_offset(offset) do {} while (0) + +#define vrc4173_outb(val,port) do {} while (0) +#define vrc4173_outw(val,port) do {} while (0) +#define vrc4173_outl(val,port) do {} while (0) +#define vrc4173_outb_p(val,port) do {} while (0) +#define vrc4173_outw_p(val,port) do {} while (0) +#define vrc4173_outl_p(val,port) do {} while (0) + +#define vrc4173_inb(port) 0 +#define vrc4173_inw(port) 0 +#define vrc4173_inl(port) 0 +#define vrc4173_inb_p(port) 0 +#define vrc4173_inw_p(port) 0 +#define vrc4173_inl_p(port) 0 + +#define vrc4173_outsb(port,addr,count) do {} while (0) +#define vrc4173_outsw(port,addr,count) do {} while (0) +#define vrc4173_outsl(port,addr,count) do {} while (0) + +#define vrc4173_insb(port,addr,count) do {} while (0) +#define vrc4173_insw(port,addr,count) do {} while (0) +#define vrc4173_insl(port,addr,count) do {} while (0) + +#endif + /* * Clock Mask Unit */ @@ -92,9 +122,77 @@ VRC4173_48MHz_CLOCK, } vrc4173_clock_t; +#ifdef CONFIG_VRC4173 + extern void vrc4173_supply_clock(vrc4173_clock_t clock); extern void vrc4173_mask_clock(vrc4173_clock_t clock); +#else + +static inline void vrc4173_supply_clock(vrc4173_clock_t clock) {} +static inline void vrc4173_mask_clock(vrc4173_clock_t clock) {} + +#endif + +/* + * Interupt Control Unit + */ + +#define VRC4173_PIUINT_COMMAND 0x0040 +#define VRC4173_PIUINT_DATA 0x0020 +#define VRC4173_PIUINT_PAGE1 0x0010 +#define VRC4173_PIUINT_PAGE0 0x0008 +#define VRC4173_PIUINT_DATALOST 0x0004 +#define VRC4173_PIUINT_STATUSCHANGE 0x0001 + +#ifdef CONFIG_VRC4173 + +extern void vrc4173_enable_piuint(uint16_t mask); +extern void vrc4173_disable_piuint(uint16_t mask); + +#else + +static inline void vrc4173_enable_piuint(uint16_t mask) {} +static inline void vrc4173_disable_piuint(uint16_t mask) {} + +#endif + +#define VRC4173_AIUINT_INPUT_DMAEND 0x0800 +#define VRC4173_AIUINT_INPUT_DMAHALT 0x0400 +#define VRC4173_AIUINT_INPUT_DATALOST 0x0200 +#define VRC4173_AIUINT_INPUT_DATA 0x0100 +#define VRC4173_AIUINT_OUTPUT_DMAEND 0x0008 +#define VRC4173_AIUINT_OUTPUT_DMAHALT 0x0004 +#define VRC4173_AIUINT_OUTPUT_NODATA 0x0002 + +#ifdef CONFIG_VRC4173 + +extern void vrc4173_enable_aiuint(uint16_t mask); +extern void vrc4173_disable_aiuint(uint16_t mask); + +#else + +static inline void vrc4173_enable_aiuint(uint16_t mask) {} +static inline void vrc4173_disable_aiuint(uint16_t mask) {} + +#endif + +#define VRC4173_KIUINT_DATALOST 0x0004 +#define VRC4173_KIUINT_DATAREADY 0x0002 +#define VRC4173_KIUINT_SCAN 0x0001 + +#ifdef CONFIG_VRC4173 + +extern void vrc4173_enable_kiuint(uint16_t mask); +extern void vrc4173_disable_kiuint(uint16_t mask); + +#else + +static inline void vrc4173_enable_kiuint(uint16_t mask) {} +static inline void vrc4173_disable_kiuint(uint16_t mask) {} + +#endif + /* * General-Purpose I/O Unit */ @@ -109,6 +207,14 @@ GPIO_16_20PINS, } vrc4173_function_t; +#ifdef CONFIG_VRC4173 + extern void vrc4173_select_function(vrc4173_function_t function); + +#else + +static inline void vrc4173_select_function(vrc4173_function_t function) {} + +#endif #endif /* __NEC_VRC4173_H */ diff -Nru a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h --- a/include/asm-ppc/ibm44x.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ppc/ibm44x.h 2004-10-06 19:37:47 -07:00 @@ -94,8 +94,8 @@ #define DCRN_SDR_CONFIG_DATA 0xf #define DCRN_SDR_PFC0 0x4100 #define DCRN_SDR_PFC1 0x4101 -#define DCRN_SDR_PFC1_EPS 0x1c000000 -#define DCRN_SDR_PFC1_EPS_SHIFT 26 +#define DCRN_SDR_PFC1_EPS 0x1c00000 +#define DCRN_SDR_PFC1_EPS_SHIFT 22 #define DCRN_SDR_PFC1_RMII 0x02000000 #define DCRN_SDR_MFR 0x4300 #define DCRN_SDR_MFR_TAH0 0x80000000 /* TAHOE0 Enable */ diff -Nru a/include/asm-ppc/mpc52xx.h b/include/asm-ppc/mpc52xx.h --- a/include/asm-ppc/mpc52xx.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ppc/mpc52xx.h 2004-10-06 19:37:47 -07:00 @@ -42,6 +42,7 @@ #define MPC52xx_MBAR_VIRT 0xf0000000 /* Virt address */ #define MPC52xx_MMAP_CTL (MPC52xx_MBAR + 0x0000) +#define MPC52xx_SDRAM (MPC52xx_MBAR + 0x0100) #define MPC52xx_CDM (MPC52xx_MBAR + 0x0200) #define MPC52xx_SFTRST (MPC52xx_MBAR + 0x0220) #define MPC52xx_SFTRST_BIT 0x01000000 @@ -51,6 +52,7 @@ #define MPC52xx_MSCAN1 (MPC52xx_MBAR + 0x0900) #define MPC52xx_MSCAN2 (MPC52xx_MBAR + 0x0980) #define MPC52xx_GPIO (MPC52xx_MBAR + 0x0b00) +#define MPC52xx_GPIO_WKUP (MPC52xx_MBAR + 0x0c00) #define MPC52xx_PCI (MPC52xx_MBAR + 0x0d00) #define MPC52xx_USB_OHCI (MPC52xx_MBAR + 0x1000) #define MPC52xx_SDMA (MPC52xx_MBAR + 0x1200) @@ -71,10 +73,6 @@ /* SRAM used for SDMA */ #define MPC52xx_SRAM (MPC52xx_MBAR + 0x8000) #define MPC52xx_SRAM_SIZE (16*1024) -#define MPC52xx_SDMA_MAX_TASKS 16 - - /* Memory allocation block size */ -#define MPC52xx_SDRAM_UNIT 0x8000 /* 32K byte */ /* ======================================================================== */ @@ -137,206 +135,240 @@ /* Memory Mapping Control */ struct mpc52xx_mmap_ctl { - volatile u32 mbar; /* MMAP_CTRL + 0x00 */ + u32 mbar; /* MMAP_CTRL + 0x00 */ + + u32 cs0_start; /* MMAP_CTRL + 0x04 */ + u32 cs0_stop; /* MMAP_CTRL + 0x08 */ + u32 cs1_start; /* MMAP_CTRL + 0x0c */ + u32 cs1_stop; /* MMAP_CTRL + 0x10 */ + u32 cs2_start; /* MMAP_CTRL + 0x14 */ + u32 cs2_stop; /* MMAP_CTRL + 0x18 */ + u32 cs3_start; /* MMAP_CTRL + 0x1c */ + u32 cs3_stop; /* MMAP_CTRL + 0x20 */ + u32 cs4_start; /* MMAP_CTRL + 0x24 */ + u32 cs4_stop; /* MMAP_CTRL + 0x28 */ + u32 cs5_start; /* MMAP_CTRL + 0x2c */ + u32 cs5_stop; /* MMAP_CTRL + 0x30 */ + + u32 sdram0; /* MMAP_CTRL + 0x34 */ + u32 sdram1; /* MMAP_CTRL + 0X38 */ + + u32 reserved[4]; /* MMAP_CTRL + 0x3c .. 0x48 */ + + u32 boot_start; /* MMAP_CTRL + 0x4c */ + u32 boot_stop; /* MMAP_CTRL + 0x50 */ + + u32 ipbi_ws_ctrl; /* MMAP_CTRL + 0x54 */ + + u32 cs6_start; /* MMAP_CTRL + 0x58 */ + u32 cs6_stop; /* MMAP_CTRL + 0x5c */ + u32 cs7_start; /* MMAP_CTRL + 0x60 */ + u32 cs7_stop; /* MMAP_CTRL + 0x60 */ +}; - volatile u32 cs0_start; /* MMAP_CTRL + 0x04 */ - volatile u32 cs0_stop; /* MMAP_CTRL + 0x08 */ - volatile u32 cs1_start; /* MMAP_CTRL + 0x0c */ - volatile u32 cs1_stop; /* MMAP_CTRL + 0x10 */ - volatile u32 cs2_start; /* MMAP_CTRL + 0x14 */ - volatile u32 cs2_stop; /* MMAP_CTRL + 0x18 */ - volatile u32 cs3_start; /* MMAP_CTRL + 0x1c */ - volatile u32 cs3_stop; /* MMAP_CTRL + 0x20 */ - volatile u32 cs4_start; /* MMAP_CTRL + 0x24 */ - volatile u32 cs4_stop; /* MMAP_CTRL + 0x28 */ - volatile u32 cs5_start; /* MMAP_CTRL + 0x2c */ - volatile u32 cs5_stop; /* MMAP_CTRL + 0x30 */ - - volatile u32 sdram0; /* MMAP_CTRL + 0x34 */ - volatile u32 sdram1; /* MMAP_CTRL + 0X38 */ - - volatile u32 reserved[4]; /* MMAP_CTRL + 0x3c .. 0x48 */ - - volatile u32 boot_start; /* MMAP_CTRL + 0x4c */ - volatile u32 boot_stop; /* MMAP_CTRL + 0x50 */ - - volatile u32 ipbi_ws_ctrl; /* MMAP_CTRL + 0x54 */ - - volatile u32 cs6_start; /* MMAP_CTRL + 0x58 */ - volatile u32 cs6_stop; /* MMAP_CTRL + 0x5c */ - volatile u32 cs7_start; /* MMAP_CTRL + 0x60 */ - volatile u32 cs7_stop; /* MMAP_CTRL + 0x60 */ +/* SDRAM control */ +struct mpc52xx_sdram { + u32 mode; /* SDRAM + 0x00 */ + u32 ctrl; /* SDRAM + 0x04 */ + u32 config1; /* SDRAM + 0x08 */ + u32 config2; /* SDRAM + 0x0c */ }; /* Interrupt controller */ struct mpc52xx_intr { - volatile u32 per_mask; /* INTR + 0x00 */ - volatile u32 per_pri1; /* INTR + 0x04 */ - volatile u32 per_pri2; /* INTR + 0x08 */ - volatile u32 per_pri3; /* INTR + 0x0c */ - volatile u32 ctrl; /* INTR + 0x10 */ - volatile u32 main_mask; /* INTR + 0x14 */ - volatile u32 main_pri1; /* INTR + 0x18 */ - volatile u32 main_pri2; /* INTR + 0x1c */ - volatile u32 reserved1; /* INTR + 0x20 */ - volatile u32 enc_status; /* INTR + 0x24 */ - volatile u32 crit_status; /* INTR + 0x28 */ - volatile u32 main_status; /* INTR + 0x2c */ - volatile u32 per_status; /* INTR + 0x30 */ - volatile u32 reserved2; /* INTR + 0x34 */ - volatile u32 per_error; /* INTR + 0x38 */ + u32 per_mask; /* INTR + 0x00 */ + u32 per_pri1; /* INTR + 0x04 */ + u32 per_pri2; /* INTR + 0x08 */ + u32 per_pri3; /* INTR + 0x0c */ + u32 ctrl; /* INTR + 0x10 */ + u32 main_mask; /* INTR + 0x14 */ + u32 main_pri1; /* INTR + 0x18 */ + u32 main_pri2; /* INTR + 0x1c */ + u32 reserved1; /* INTR + 0x20 */ + u32 enc_status; /* INTR + 0x24 */ + u32 crit_status; /* INTR + 0x28 */ + u32 main_status; /* INTR + 0x2c */ + u32 per_status; /* INTR + 0x30 */ + u32 reserved2; /* INTR + 0x34 */ + u32 per_error; /* INTR + 0x38 */ }; /* SDMA */ struct mpc52xx_sdma { - volatile u32 taskBar; /* SDMA + 0x00 */ - volatile u32 currentPointer; /* SDMA + 0x04 */ - volatile u32 endPointer; /* SDMA + 0x08 */ - volatile u32 variablePointer;/* SDMA + 0x0c */ - - volatile u8 IntVect1; /* SDMA + 0x10 */ - volatile u8 IntVect2; /* SDMA + 0x11 */ - volatile u16 PtdCntrl; /* SDMA + 0x12 */ - - volatile u32 IntPend; /* SDMA + 0x14 */ - volatile u32 IntMask; /* SDMA + 0x18 */ - - volatile u16 tcr[16]; /* SDMA + 0x1c .. 0x3a */ - - volatile u8 ipr[31]; /* SDMA + 0x3c .. 5b */ - - volatile u32 res1; /* SDMA + 0x5c */ - volatile u32 task_size0; /* SDMA + 0x60 */ - volatile u32 task_size1; /* SDMA + 0x64 */ - volatile u32 MDEDebug; /* SDMA + 0x68 */ - volatile u32 ADSDebug; /* SDMA + 0x6c */ - volatile u32 Value1; /* SDMA + 0x70 */ - volatile u32 Value2; /* SDMA + 0x74 */ - volatile u32 Control; /* SDMA + 0x78 */ - volatile u32 Status; /* SDMA + 0x7c */ + u32 taskBar; /* SDMA + 0x00 */ + u32 currentPointer; /* SDMA + 0x04 */ + u32 endPointer; /* SDMA + 0x08 */ + u32 variablePointer;/* SDMA + 0x0c */ + + u8 IntVect1; /* SDMA + 0x10 */ + u8 IntVect2; /* SDMA + 0x11 */ + u16 PtdCntrl; /* SDMA + 0x12 */ + + u32 IntPend; /* SDMA + 0x14 */ + u32 IntMask; /* SDMA + 0x18 */ + + u16 tcr[16]; /* SDMA + 0x1c .. 0x3a */ + + u8 ipr[32]; /* SDMA + 0x3c .. 5b */ + + u32 cReqSelect; /* SDMA + 0x5c */ + u32 task_size0; /* SDMA + 0x60 */ + u32 task_size1; /* SDMA + 0x64 */ + u32 MDEDebug; /* SDMA + 0x68 */ + u32 ADSDebug; /* SDMA + 0x6c */ + u32 Value1; /* SDMA + 0x70 */ + u32 Value2; /* SDMA + 0x74 */ + u32 Control; /* SDMA + 0x78 */ + u32 Status; /* SDMA + 0x7c */ + u32 PTDDebug; /* SDMA + 0x80 */ }; /* GPT */ struct mpc52xx_gpt { - volatile u32 mode; /* GPTx + 0x00 */ - volatile u32 count; /* GPTx + 0x04 */ - volatile u32 pwm; /* GPTx + 0x08 */ - volatile u32 status; /* GPTx + 0X0c */ + u32 mode; /* GPTx + 0x00 */ + u32 count; /* GPTx + 0x04 */ + u32 pwm; /* GPTx + 0x08 */ + u32 status; /* GPTx + 0X0c */ }; /* RTC */ struct mpc52xx_rtc { - volatile u32 time_set; /* RTC + 0x00 */ - volatile u32 date_set; /* RTC + 0x04 */ - volatile u32 stopwatch; /* RTC + 0x08 */ - volatile u32 int_enable; /* RTC + 0x0c */ - volatile u32 time; /* RTC + 0x10 */ - volatile u32 date; /* RTC + 0x14 */ - volatile u32 stopwatch_intr; /* RTC + 0x18 */ - volatile u32 bus_error; /* RTC + 0x1c */ - volatile u32 dividers; /* RTC + 0x20 */ + u32 time_set; /* RTC + 0x00 */ + u32 date_set; /* RTC + 0x04 */ + u32 stopwatch; /* RTC + 0x08 */ + u32 int_enable; /* RTC + 0x0c */ + u32 time; /* RTC + 0x10 */ + u32 date; /* RTC + 0x14 */ + u32 stopwatch_intr; /* RTC + 0x18 */ + u32 bus_error; /* RTC + 0x1c */ + u32 dividers; /* RTC + 0x20 */ }; /* GPIO */ struct mpc52xx_gpio { - volatile u32 port_config; /* GPIO + 0x00 */ - volatile u32 simple_gpioe; /* GPIO + 0x04 */ - volatile u32 simple_ode; /* GPIO + 0x08 */ - volatile u32 simple_ddr; /* GPIO + 0x0c */ - volatile u32 simple_dvo; /* GPIO + 0x10 */ - volatile u32 simple_ival; /* GPIO + 0x14 */ - volatile u8 outo_gpioe; /* GPIO + 0x18 */ - volatile u8 reserved1[3]; /* GPIO + 0x19 */ - volatile u8 outo_dvo; /* GPIO + 0x1c */ - volatile u8 reserved2[3]; /* GPIO + 0x1d */ - volatile u8 sint_gpioe; /* GPIO + 0x20 */ - volatile u8 reserved3[3]; /* GPIO + 0x21 */ - volatile u8 sint_ode; /* GPIO + 0x24 */ - volatile u8 reserved4[3]; /* GPIO + 0x25 */ - volatile u8 sint_ddr; /* GPIO + 0x28 */ - volatile u8 reserved5[3]; /* GPIO + 0x29 */ - volatile u8 sint_dvo; /* GPIO + 0x2c */ - volatile u8 reserved6[3]; /* GPIO + 0x2d */ - volatile u8 sint_inten; /* GPIO + 0x30 */ - volatile u8 reserved7[3]; /* GPIO + 0x31 */ - volatile u16 sint_itype; /* GPIO + 0x34 */ - volatile u16 reserved8; /* GPIO + 0x36 */ - volatile u8 gpio_control; /* GPIO + 0x38 */ - volatile u8 reserved9[3]; /* GPIO + 0x39 */ - volatile u8 sint_istat; /* GPIO + 0x3c */ - volatile u8 sint_ival; /* GPIO + 0x3d */ - volatile u8 bus_errs; /* GPIO + 0x3e */ - volatile u8 reserved10; /* GPIO + 0x3f */ + u32 port_config; /* GPIO + 0x00 */ + u32 simple_gpioe; /* GPIO + 0x04 */ + u32 simple_ode; /* GPIO + 0x08 */ + u32 simple_ddr; /* GPIO + 0x0c */ + u32 simple_dvo; /* GPIO + 0x10 */ + u32 simple_ival; /* GPIO + 0x14 */ + u8 outo_gpioe; /* GPIO + 0x18 */ + u8 reserved1[3]; /* GPIO + 0x19 */ + u8 outo_dvo; /* GPIO + 0x1c */ + u8 reserved2[3]; /* GPIO + 0x1d */ + u8 sint_gpioe; /* GPIO + 0x20 */ + u8 reserved3[3]; /* GPIO + 0x21 */ + u8 sint_ode; /* GPIO + 0x24 */ + u8 reserved4[3]; /* GPIO + 0x25 */ + u8 sint_ddr; /* GPIO + 0x28 */ + u8 reserved5[3]; /* GPIO + 0x29 */ + u8 sint_dvo; /* GPIO + 0x2c */ + u8 reserved6[3]; /* GPIO + 0x2d */ + u8 sint_inten; /* GPIO + 0x30 */ + u8 reserved7[3]; /* GPIO + 0x31 */ + u16 sint_itype; /* GPIO + 0x34 */ + u16 reserved8; /* GPIO + 0x36 */ + u8 gpio_control; /* GPIO + 0x38 */ + u8 reserved9[3]; /* GPIO + 0x39 */ + u8 sint_istat; /* GPIO + 0x3c */ + u8 sint_ival; /* GPIO + 0x3d */ + u8 bus_errs; /* GPIO + 0x3e */ + u8 reserved10; /* GPIO + 0x3f */ }; #define MPC52xx_GPIO_PSC_CONFIG_UART_WITHOUT_CD 4 #define MPC52xx_GPIO_PSC_CONFIG_UART_WITH_CD 5 #define MPC52xx_GPIO_PCI_DIS (1<<15) +/* GPIO with WakeUp*/ +struct mpc52xx_gpio_wkup { + u8 wkup_gpioe; /* GPIO_WKUP + 0x00 */ + u8 reserved1[3]; /* GPIO_WKUP + 0x03 */ + u8 wkup_ode; /* GPIO_WKUP + 0x04 */ + u8 reserved2[3]; /* GPIO_WKUP + 0x05 */ + u8 wkup_ddr; /* GPIO_WKUP + 0x08 */ + u8 reserved3[3]; /* GPIO_WKUP + 0x09 */ + u8 wkup_dvo; /* GPIO_WKUP + 0x0C */ + u8 reserved4[3]; /* GPIO_WKUP + 0x0D */ + u8 wkup_inten; /* GPIO_WKUP + 0x10 */ + u8 reserved5[3]; /* GPIO_WKUP + 0x11 */ + u8 wkup_iinten; /* GPIO_WKUP + 0x14 */ + u8 reserved6[3]; /* GPIO_WKUP + 0x15 */ + u16 wkup_itype; /* GPIO_WKUP + 0x18 */ + u8 reserved7[2]; /* GPIO_WKUP + 0x1A */ + u8 wkup_maste; /* GPIO_WKUP + 0x1C */ + u8 reserved8[3]; /* GPIO_WKUP + 0x1D */ + u8 wkup_ival; /* GPIO_WKUP + 0x20 */ + u8 reserved9[3]; /* GPIO_WKUP + 0x21 */ + u8 wkup_istat; /* GPIO_WKUP + 0x24 */ + u8 reserved10[3]; /* GPIO_WKUP + 0x25 */ +}; + /* XLB Bus control */ struct mpc52xx_xlb { - volatile u8 reserved[0x40]; - volatile u32 config; /* XLB + 0x40 */ - volatile u32 version; /* XLB + 0x44 */ - volatile u32 status; /* XLB + 0x48 */ - volatile u32 int_enable; /* XLB + 0x4c */ - volatile u32 addr_capture; /* XLB + 0x50 */ - volatile u32 bus_sig_capture; /* XLB + 0x54 */ - volatile u32 addr_timeout; /* XLB + 0x58 */ - volatile u32 data_timeout; /* XLB + 0x5c */ - volatile u32 bus_act_timeout; /* XLB + 0x60 */ - volatile u32 master_pri_enable; /* XLB + 0x64 */ - volatile u32 master_priority; /* XLB + 0x68 */ - volatile u32 base_address; /* XLB + 0x6c */ - volatile u32 snoop_window; /* XLB + 0x70 */ + u8 reserved[0x40]; + u32 config; /* XLB + 0x40 */ + u32 version; /* XLB + 0x44 */ + u32 status; /* XLB + 0x48 */ + u32 int_enable; /* XLB + 0x4c */ + u32 addr_capture; /* XLB + 0x50 */ + u32 bus_sig_capture; /* XLB + 0x54 */ + u32 addr_timeout; /* XLB + 0x58 */ + u32 data_timeout; /* XLB + 0x5c */ + u32 bus_act_timeout; /* XLB + 0x60 */ + u32 master_pri_enable; /* XLB + 0x64 */ + u32 master_priority; /* XLB + 0x68 */ + u32 base_address; /* XLB + 0x6c */ + u32 snoop_window; /* XLB + 0x70 */ }; +#define MPC52xx_XLB_CFG_SNOOP (1 << 15) /* Clock Distribution control */ struct mpc52xx_cdm { - volatile u32 jtag_id; /* MBAR_CDM + 0x00 reg0 read only */ - volatile u32 rstcfg; /* MBAR_CDM + 0x04 reg1 read only */ - volatile u32 breadcrumb; /* MBAR_CDM + 0x08 reg2 */ - - volatile u8 mem_clk_sel; /* MBAR_CDM + 0x0c reg3 byte0 */ - volatile u8 xlb_clk_sel; /* MBAR_CDM + 0x0d reg3 byte1 read only */ - volatile u8 ipb_clk_sel; /* MBAR_CDM + 0x0e reg3 byte2 */ - volatile u8 pci_clk_sel; /* MBAR_CDM + 0x0f reg3 byte3 */ - - volatile u8 ext_48mhz_en; /* MBAR_CDM + 0x10 reg4 byte0 */ - volatile u8 fd_enable; /* MBAR_CDM + 0x11 reg4 byte1 */ - volatile u16 fd_counters; /* MBAR_CDM + 0x12 reg4 byte2,3 */ - - volatile u32 clk_enables; /* MBAR_CDM + 0x14 reg5 */ - - volatile u8 osc_disable; /* MBAR_CDM + 0x18 reg6 byte0 */ - volatile u8 reserved0[3]; /* MBAR_CDM + 0x19 reg6 byte1,2,3 */ - - volatile u8 ccs_sleep_enable;/* MBAR_CDM + 0x1c reg7 byte0 */ - volatile u8 osc_sleep_enable;/* MBAR_CDM + 0x1d reg7 byte1 */ - volatile u8 reserved1; /* MBAR_CDM + 0x1e reg7 byte2 */ - volatile u8 ccs_qreq_test; /* MBAR_CDM + 0x1f reg7 byte3 */ - - volatile u8 soft_reset; /* MBAR_CDM + 0x20 u8 byte0 */ - volatile u8 no_ckstp; /* MBAR_CDM + 0x21 u8 byte0 */ - volatile u8 reserved2[2]; /* MBAR_CDM + 0x22 u8 byte1,2,3 */ - - volatile u8 pll_lock; /* MBAR_CDM + 0x24 reg9 byte0 */ - volatile u8 pll_looselock; /* MBAR_CDM + 0x25 reg9 byte1 */ - volatile u8 pll_sm_lockwin; /* MBAR_CDM + 0x26 reg9 byte2 */ - volatile u8 reserved3; /* MBAR_CDM + 0x27 reg9 byte3 */ - - volatile u16 reserved4; /* MBAR_CDM + 0x28 reg10 byte0,1 */ - volatile u16 mclken_div_psc1;/* MBAR_CDM + 0x2a reg10 byte2,3 */ - - volatile u16 reserved5; /* MBAR_CDM + 0x2c reg11 byte0,1 */ - volatile u16 mclken_div_psc2;/* MBAR_CDM + 0x2e reg11 byte2,3 */ - - volatile u16 reserved6; /* MBAR_CDM + 0x30 reg12 byte0,1 */ - volatile u16 mclken_div_psc3;/* MBAR_CDM + 0x32 reg12 byte2,3 */ - - volatile u16 reserved7; /* MBAR_CDM + 0x34 reg13 byte0,1 */ - volatile u16 mclken_div_psc6;/* MBAR_CDM + 0x36 reg13 byte2,3 */ + u32 jtag_id; /* CDM + 0x00 reg0 read only */ + u32 rstcfg; /* CDM + 0x04 reg1 read only */ + u32 breadcrumb; /* CDM + 0x08 reg2 */ + + u8 mem_clk_sel; /* CDM + 0x0c reg3 byte0 */ + u8 xlb_clk_sel; /* CDM + 0x0d reg3 byte1 read only */ + u8 ipb_clk_sel; /* CDM + 0x0e reg3 byte2 */ + u8 pci_clk_sel; /* CDM + 0x0f reg3 byte3 */ + + u8 ext_48mhz_en; /* CDM + 0x10 reg4 byte0 */ + u8 fd_enable; /* CDM + 0x11 reg4 byte1 */ + u16 fd_counters; /* CDM + 0x12 reg4 byte2,3 */ + + u32 clk_enables; /* CDM + 0x14 reg5 */ + + u8 osc_disable; /* CDM + 0x18 reg6 byte0 */ + u8 reserved0[3]; /* CDM + 0x19 reg6 byte1,2,3 */ + + u8 ccs_sleep_enable; /* CDM + 0x1c reg7 byte0 */ + u8 osc_sleep_enable; /* CDM + 0x1d reg7 byte1 */ + u8 reserved1; /* CDM + 0x1e reg7 byte2 */ + u8 ccs_qreq_test; /* CDM + 0x1f reg7 byte3 */ + + u8 soft_reset; /* CDM + 0x20 u8 byte0 */ + u8 no_ckstp; /* CDM + 0x21 u8 byte0 */ + u8 reserved2[2]; /* CDM + 0x22 u8 byte1,2,3 */ + + u8 pll_lock; /* CDM + 0x24 reg9 byte0 */ + u8 pll_looselock; /* CDM + 0x25 reg9 byte1 */ + u8 pll_sm_lockwin; /* CDM + 0x26 reg9 byte2 */ + u8 reserved3; /* CDM + 0x27 reg9 byte3 */ + + u16 reserved4; /* CDM + 0x28 reg10 byte0,1 */ + u16 mclken_div_psc1; /* CDM + 0x2a reg10 byte2,3 */ + + u16 reserved5; /* CDM + 0x2c reg11 byte0,1 */ + u16 mclken_div_psc2; /* CDM + 0x2e reg11 byte2,3 */ + + u16 reserved6; /* CDM + 0x30 reg12 byte0,1 */ + u16 mclken_div_psc3; /* CDM + 0x32 reg12 byte2,3 */ + + u16 reserved7; /* CDM + 0x34 reg13 byte0,1 */ + u16 mclken_div_psc6; /* CDM + 0x36 reg13 byte2,3 */ }; #endif /* __ASSEMBLY__ */ diff -Nru a/include/asm-ppc/mpc52xx_psc.h b/include/asm-ppc/mpc52xx_psc.h --- a/include/asm-ppc/mpc52xx_psc.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ppc/mpc52xx_psc.h 2004-10-06 19:37:47 -07:00 @@ -19,8 +19,8 @@ * kind, whether express or implied. */ -#ifndef __MPC52xx_PSC_H__ -#define __MPC52xx_PSC_H__ +#ifndef __ASM_MPC52xx_PSC_H__ +#define __ASM_MPC52xx_PSC_H__ #include @@ -95,97 +95,97 @@ /* Structure of the hardware registers */ struct mpc52xx_psc { - volatile u8 mode; /* PSC + 0x00 */ - volatile u8 reserved0[3]; - union { /* PSC + 0x04 */ - volatile u16 status; - volatile u16 clock_select; + u8 mode; /* PSC + 0x00 */ + u8 reserved0[3]; + union { /* PSC + 0x04 */ + u16 status; + u16 clock_select; } sr_csr; #define mpc52xx_psc_status sr_csr.status -#define mpc52xx_psc_clock_select sr_csr.clock_select - volatile u16 reserved1; - volatile u8 command; /* PSC + 0x08 */ -volatile u8 reserved2[3]; - union { /* PSC + 0x0c */ - volatile u8 buffer_8; - volatile u16 buffer_16; - volatile u32 buffer_32; +#define mpc52xx_psc_clock_select sr_csr.clock_select + u16 reserved1; + u8 command; /* PSC + 0x08 */ + u8 reserved2[3]; + union { /* PSC + 0x0c */ + u8 buffer_8; + u16 buffer_16; + u32 buffer_32; } buffer; #define mpc52xx_psc_buffer_8 buffer.buffer_8 #define mpc52xx_psc_buffer_16 buffer.buffer_16 #define mpc52xx_psc_buffer_32 buffer.buffer_32 - union { /* PSC + 0x10 */ - volatile u8 ipcr; - volatile u8 acr; + union { /* PSC + 0x10 */ + u8 ipcr; + u8 acr; } ipcr_acr; #define mpc52xx_psc_ipcr ipcr_acr.ipcr #define mpc52xx_psc_acr ipcr_acr.acr - volatile u8 reserved3[3]; - union { /* PSC + 0x14 */ - volatile u16 isr; - volatile u16 imr; + u8 reserved3[3]; + union { /* PSC + 0x14 */ + u16 isr; + u16 imr; } isr_imr; #define mpc52xx_psc_isr isr_imr.isr #define mpc52xx_psc_imr isr_imr.imr - volatile u16 reserved4; - volatile u8 ctur; /* PSC + 0x18 */ - volatile u8 reserved5[3]; - volatile u8 ctlr; /* PSC + 0x1c */ - volatile u8 reserved6[3]; - volatile u16 ccr; /* PSC + 0x20 */ - volatile u8 reserved7[14]; - volatile u8 ivr; /* PSC + 0x30 */ - volatile u8 reserved8[3]; - volatile u8 ip; /* PSC + 0x34 */ - volatile u8 reserved9[3]; - volatile u8 op1; /* PSC + 0x38 */ - volatile u8 reserved10[3]; - volatile u8 op0; /* PSC + 0x3c */ - volatile u8 reserved11[3]; - volatile u32 sicr; /* PSC + 0x40 */ - volatile u8 ircr1; /* PSC + 0x44 */ - volatile u8 reserved13[3]; - volatile u8 ircr2; /* PSC + 0x44 */ - volatile u8 reserved14[3]; - volatile u8 irsdr; /* PSC + 0x4c */ - volatile u8 reserved15[3]; - volatile u8 irmdr; /* PSC + 0x50 */ - volatile u8 reserved16[3]; - volatile u8 irfdr; /* PSC + 0x54 */ - volatile u8 reserved17[3]; - volatile u16 rfnum; /* PSC + 0x58 */ - volatile u16 reserved18; - volatile u16 tfnum; /* PSC + 0x5c */ - volatile u16 reserved19; - volatile u32 rfdata; /* PSC + 0x60 */ - volatile u16 rfstat; /* PSC + 0x64 */ - volatile u16 reserved20; - volatile u8 rfcntl; /* PSC + 0x68 */ - volatile u8 reserved21[5]; - volatile u16 rfalarm; /* PSC + 0x6e */ - volatile u16 reserved22; - volatile u16 rfrptr; /* PSC + 0x72 */ - volatile u16 reserved23; - volatile u16 rfwptr; /* PSC + 0x76 */ - volatile u16 reserved24; - volatile u16 rflrfptr; /* PSC + 0x7a */ - volatile u16 reserved25; - volatile u16 rflwfptr; /* PSC + 0x7e */ - volatile u32 tfdata; /* PSC + 0x80 */ - volatile u16 tfstat; /* PSC + 0x84 */ - volatile u16 reserved26; - volatile u8 tfcntl; /* PSC + 0x88 */ - volatile u8 reserved27[5]; - volatile u16 tfalarm; /* PSC + 0x8e */ - volatile u16 reserved28; - volatile u16 tfrptr; /* PSC + 0x92 */ - volatile u16 reserved29; - volatile u16 tfwptr; /* PSC + 0x96 */ - volatile u16 reserved30; - volatile u16 tflrfptr; /* PSC + 0x9a */ - volatile u16 reserved31; - volatile u16 tflwfptr; /* PSC + 0x9e */ + u16 reserved4; + u8 ctur; /* PSC + 0x18 */ + u8 reserved5[3]; + u8 ctlr; /* PSC + 0x1c */ + u8 reserved6[3]; + u16 ccr; /* PSC + 0x20 */ + u8 reserved7[14]; + u8 ivr; /* PSC + 0x30 */ + u8 reserved8[3]; + u8 ip; /* PSC + 0x34 */ + u8 reserved9[3]; + u8 op1; /* PSC + 0x38 */ + u8 reserved10[3]; + u8 op0; /* PSC + 0x3c */ + u8 reserved11[3]; + u32 sicr; /* PSC + 0x40 */ + u8 ircr1; /* PSC + 0x44 */ + u8 reserved13[3]; + u8 ircr2; /* PSC + 0x44 */ + u8 reserved14[3]; + u8 irsdr; /* PSC + 0x4c */ + u8 reserved15[3]; + u8 irmdr; /* PSC + 0x50 */ + u8 reserved16[3]; + u8 irfdr; /* PSC + 0x54 */ + u8 reserved17[3]; + u16 rfnum; /* PSC + 0x58 */ + u16 reserved18; + u16 tfnum; /* PSC + 0x5c */ + u16 reserved19; + u32 rfdata; /* PSC + 0x60 */ + u16 rfstat; /* PSC + 0x64 */ + u16 reserved20; + u8 rfcntl; /* PSC + 0x68 */ + u8 reserved21[5]; + u16 rfalarm; /* PSC + 0x6e */ + u16 reserved22; + u16 rfrptr; /* PSC + 0x72 */ + u16 reserved23; + u16 rfwptr; /* PSC + 0x76 */ + u16 reserved24; + u16 rflrfptr; /* PSC + 0x7a */ + u16 reserved25; + u16 rflwfptr; /* PSC + 0x7e */ + u32 tfdata; /* PSC + 0x80 */ + u16 tfstat; /* PSC + 0x84 */ + u16 reserved26; + u8 tfcntl; /* PSC + 0x88 */ + u8 reserved27[5]; + u16 tfalarm; /* PSC + 0x8e */ + u16 reserved28; + u16 tfrptr; /* PSC + 0x92 */ + u16 reserved29; + u16 tfwptr; /* PSC + 0x96 */ + u16 reserved30; + u16 tflrfptr; /* PSC + 0x9a */ + u16 reserved31; + u16 tflwfptr; /* PSC + 0x9e */ }; -#endif /* __MPC52xx_PSC_H__ */ +#endif /* __ASM_MPC52xx_PSC_H__ */ diff -Nru a/include/asm-ppc/ppcboot.h b/include/asm-ppc/ppcboot.h --- a/include/asm-ppc/ppcboot.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ppc/ppcboot.h 2004-10-06 19:37:47 -07:00 @@ -30,20 +30,6 @@ #ifndef __ASSEMBLY__ #include -typedef void (interrupt_handler_t)(void *); - -typedef struct monitor_functions { - int (*getc)(void); - int (*tstc)(void); - void (*putc)(const char c); - void (*puts)(const char *s); - void (*printf)(const char *fmt, ...); - void (*install_hdlr)(int, interrupt_handler_t *, void *); - void (*free_hdlr)(int); - void *(*malloc)(size_t); - void (*free)(void *); -} mon_fnc_t; - typedef struct bd_info { unsigned long bi_memstart; /* start of DRAM memory */ unsigned long bi_memsize; /* size of DRAM memory in bytes */ @@ -75,7 +61,7 @@ unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */ #endif unsigned long bi_baudrate; /* Console Baudrate */ -#if defined(CONFIG_405GP) +#if defined(CONFIG_4xx) unsigned char bi_s_version[4]; /* Version of this structure */ unsigned char bi_r_version[32]; /* Version of the ROM (IBM) */ unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */ @@ -86,12 +72,26 @@ #if defined(CONFIG_HYMOD) hymod_conf_t bi_hymod_conf; /* hymod configuration information */ #endif -#if defined(CONFIG_EVB64260) || defined(CONFIG_85xx) - /* the board has three onboard ethernet ports */ +#if defined(CONFIG_EVB64260) || defined(CONFIG_44x) || defined(CONFIG_85xx) + /* second onboard ethernet port */ unsigned char bi_enet1addr[6]; +#endif +#if defined(CONFIG_EVB64260) || defined(CONFIG_440GX) || defined(CONFIG_85xx) + /* third onboard ethernet ports */ unsigned char bi_enet2addr[6]; #endif - mon_fnc_t *bi_mon_fnc; /* Pointer to monitor functions */ +#if defined(CONFIG_440GX) + /* fourth onboard ethernet ports */ + unsigned char bi_enet3addr[6]; +#endif +#if defined(CONFIG_4xx) + unsigned int bi_opbfreq; /* OB clock in Hz */ + int bi_iic_fast[2]; /* Use fast i2c mode */ +#endif +#if defined(CONFIG_440GX) + int bi_phynum[4]; /* phy mapping */ + int bi_phymode[4]; /* phy mode */ +#endif } bd_t; #endif /* __ASSEMBLY__ */ diff -Nru a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h --- a/include/asm-ppc/reg_booke.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ppc/reg_booke.h 2004-10-06 19:37:47 -07:00 @@ -123,9 +123,10 @@ #define SPRN_PID2 0x27A /* Process ID Register 2 */ #define SPRN_TLB0CFG 0x2B0 /* TLB 0 Config Register */ #define SPRN_TLB1CFG 0x2B1 /* TLB 1 Config Register */ +#define SPRN_CCR1 0x378 /* Core Configuration Register 1 */ #define SPRN_ZPR 0x3B0 /* Zone Protection Register (40x) */ #define SPRN_MMUCR 0x3B2 /* MMU Control Register */ -#define SPRN_CCR0 0x3B3 /* Core Configuration Register */ +#define SPRN_CCR0 0x3B3 /* Core Configuration Register 0 */ #define SPRN_SGR 0x3B9 /* Storage Guarded Register */ #define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */ #define SPRN_SLER 0x3BB /* Little-endian real mode */ @@ -178,6 +179,9 @@ #define SPRN_CSRR0 SPRN_SRR2 /* Critical Save and Restore Register 0 */ #define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */ #endif + +/* Bit definitions for CCR1. */ +#define CCR1_TCS 0x00000080 /* Timer Clock Select */ /* Bit definitions for the MCSR. */ #ifdef CONFIG_440A diff -Nru a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h --- a/include/asm-ppc64/eeh.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ppc64/eeh.h 2004-10-06 19:37:47 -07:00 @@ -71,16 +71,10 @@ /* * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure. * - * Order this macro for performance. - * If EEH is off for a device and it is a memory BAR, ioremap will - * map it to the IOREGION. In this case addr == vaddr and since these - * should be in registers we compare them first. Next we check for - * ff's which indicates a (very) possible failure. - * * If this macro yields TRUE, the caller relays to eeh_check_failure() * which does further tests out of line. */ -#define EEH_POSSIBLE_IO_ERROR(val, type) ((val) == (type)~0) +#define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0) /* * Reads from a device which has been isolated by EEH will return @@ -89,21 +83,13 @@ */ #define EEH_IO_ERROR_VALUE(size) (~0U >> ((4 - (size)) * 8)) -/* - * The vaddr will equal the addr if EEH checking is disabled for - * this device. This is because eeh_ioremap() will not have - * remapped to 0xA0, and thus both vaddr and addr will be 0xE0... - */ -#define EEH_POSSIBLE_ERROR(addr, vaddr, val, type) \ - ((vaddr) != (addr) && EEH_POSSIBLE_IO_ERROR(val, type)) - /* * MMIO read/write operations with EEH support. */ static inline u8 eeh_readb(const volatile void __iomem *addr) { volatile u8 *vaddr = (volatile u8 __force *) addr; u8 val = in_8(vaddr); - if (EEH_POSSIBLE_ERROR(addr, vaddr, val, u8)) + if (EEH_POSSIBLE_ERROR(val, u8)) return eeh_check_failure(addr, val); return val; } @@ -115,7 +101,7 @@ static inline u16 eeh_readw(const volatile void __iomem *addr) { volatile u16 *vaddr = (volatile u16 __force *) addr; u16 val = in_le16(vaddr); - if (EEH_POSSIBLE_ERROR(addr, vaddr, val, u16)) + if (EEH_POSSIBLE_ERROR(val, u16)) return eeh_check_failure(addr, val); return val; } @@ -126,7 +112,7 @@ static inline u16 eeh_raw_readw(const volatile void __iomem *addr) { volatile u16 *vaddr = (volatile u16 __force *) addr; u16 val = in_be16(vaddr); - if (EEH_POSSIBLE_ERROR(addr, vaddr, val, u16)) + if (EEH_POSSIBLE_ERROR(val, u16)) return eeh_check_failure(addr, val); return val; } @@ -138,7 +124,7 @@ static inline u32 eeh_readl(const volatile void __iomem *addr) { volatile u32 *vaddr = (volatile u32 __force *) addr; u32 val = in_le32(vaddr); - if (EEH_POSSIBLE_ERROR(addr, vaddr, val, u32)) + if (EEH_POSSIBLE_ERROR(val, u32)) return eeh_check_failure(addr, val); return val; } @@ -149,7 +135,7 @@ static inline u32 eeh_raw_readl(const volatile void __iomem *addr) { volatile u32 *vaddr = (volatile u32 __force *) addr; u32 val = in_be32(vaddr); - if (EEH_POSSIBLE_ERROR(addr, vaddr, val, u32)) + if (EEH_POSSIBLE_ERROR(val, u32)) return eeh_check_failure(addr, val); return val; } @@ -161,7 +147,7 @@ static inline u64 eeh_readq(const volatile void __iomem *addr) { volatile u64 *vaddr = (volatile u64 __force *) addr; u64 val = in_le64(vaddr); - if (EEH_POSSIBLE_ERROR(addr, vaddr, val, u64)) + if (EEH_POSSIBLE_ERROR(val, u64)) return eeh_check_failure(addr, val); return val; } @@ -172,7 +158,7 @@ static inline u64 eeh_raw_readq(const volatile void __iomem *addr) { volatile u64 *vaddr = (volatile u64 __force *) addr; u64 val = in_be64(vaddr); - if (EEH_POSSIBLE_ERROR(addr, vaddr, val, u64)) + if (EEH_POSSIBLE_ERROR(val, u64)) return eeh_check_failure(addr, val); return val; } @@ -209,8 +195,7 @@ } static inline void eeh_memcpy_fromio(void *dest, const volatile void __iomem *src, unsigned long n) { void *vsrc = (void __force *) src; - void *vsrcsave = vsrc, *destsave = dest; - const volatile void __iomem *srcsave = src; + void *destsave = dest; unsigned long nsave = n; while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) { @@ -240,9 +225,8 @@ * were copied. Check all four bytes. */ if ((nsave >= 4) && - (EEH_POSSIBLE_ERROR(srcsave, vsrcsave, (*((u32 *) destsave+nsave-4)), - u32))) { - eeh_check_failure(srcsave, (*((u32 *) destsave+nsave-4))); + (EEH_POSSIBLE_ERROR((*((u32 *) destsave+nsave-4)), u32))) { + eeh_check_failure(src, (*((u32 *) destsave+nsave-4))); } } @@ -281,7 +265,7 @@ if (!_IO_IS_VALID(port)) return ~0; val = in_8((u8 *)(port+pci_io_base)); - if (EEH_POSSIBLE_IO_ERROR(val, u8)) + if (EEH_POSSIBLE_ERROR(val, u8)) return eeh_check_failure((void __iomem *)(port), val); return val; } @@ -296,7 +280,7 @@ if (!_IO_IS_VALID(port)) return ~0; val = in_le16((u16 *)(port+pci_io_base)); - if (EEH_POSSIBLE_IO_ERROR(val, u16)) + if (EEH_POSSIBLE_ERROR(val, u16)) return eeh_check_failure((void __iomem *)(port), val); return val; } @@ -311,7 +295,7 @@ if (!_IO_IS_VALID(port)) return ~0; val = in_le32((u32 *)(port+pci_io_base)); - if (EEH_POSSIBLE_IO_ERROR(val, u32)) + if (EEH_POSSIBLE_ERROR(val, u32)) return eeh_check_failure((void __iomem *)(port), val); return val; } @@ -324,19 +308,19 @@ /* in-string eeh macros */ static inline void eeh_insb(unsigned long port, void * buf, int ns) { _insb((u8 *)(port+pci_io_base), buf, ns); - if (EEH_POSSIBLE_IO_ERROR((*(((u8*)buf)+ns-1)), u8)) + if (EEH_POSSIBLE_ERROR((*(((u8*)buf)+ns-1)), u8)) eeh_check_failure((void __iomem *)(port), *(u8*)buf); } static inline void eeh_insw_ns(unsigned long port, void * buf, int ns) { _insw_ns((u16 *)(port+pci_io_base), buf, ns); - if (EEH_POSSIBLE_IO_ERROR((*(((u16*)buf)+ns-1)), u16)) + if (EEH_POSSIBLE_ERROR((*(((u16*)buf)+ns-1)), u16)) eeh_check_failure((void __iomem *)(port), *(u16*)buf); } static inline void eeh_insl_ns(unsigned long port, void * buf, int nl) { _insl_ns((u32 *)(port+pci_io_base), buf, nl); - if (EEH_POSSIBLE_IO_ERROR((*(((u32*)buf)+nl-1)), u32)) + if (EEH_POSSIBLE_ERROR((*(((u32*)buf)+nl-1)), u32)) eeh_check_failure((void __iomem *)(port), *(u32*)buf); } diff -Nru a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h --- a/include/asm-ppc64/mmu.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-ppc64/mmu.h 2004-10-06 19:37:47 -07:00 @@ -202,7 +202,7 @@ #define SLB_VSID_KERNEL (SLB_VSID_KP|SLB_VSID_C) #define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS) -#define VSID_MULTIPLIER ASM_CONST(268435399) /* largest 28-bit prime */ +#define VSID_MULTIPLIER ASM_CONST(200730139) /* 28-bit prime */ #define VSID_BITS 36 #define VSID_MODULUS ((1UL< +#include #define LAST_DEVICE_VECTOR 232 #define MSI_DEST_MODE MSI_LOGICAL_MODE #define MSI_TARGET_CPU_SHIFT 12 -#define MSI_TARGET_CPU TARGET_CPUS +#define MSI_TARGET_CPU logical_smp_processor_id() #endif /* ASM_MSI_H */ diff -Nru a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h --- a/include/asm-x86_64/proto.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-x86_64/proto.h 2004-10-06 19:37:47 -07:00 @@ -70,6 +70,7 @@ extern void show_regs(struct pt_regs * regs); extern int map_syscall32(struct mm_struct *mm, unsigned long address); +extern int __map_syscall32(struct mm_struct *mm, unsigned long address); extern char *syscall32_page; extern void syscall32_cpu_init(void); diff -Nru a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h --- a/include/asm-x86_64/ptrace.h 2004-10-06 19:37:47 -07:00 +++ b/include/asm-x86_64/ptrace.h 2004-10-06 19:37:47 -07:00 @@ -83,11 +83,7 @@ #if defined(__KERNEL__) && !defined(__ASSEMBLY__) #define user_mode(regs) (!!((regs)->cs & 3)) #define instruction_pointer(regs) ((regs)->rip) -#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) extern unsigned long profile_pc(struct pt_regs *regs); -#else -#define profile_pc(regs) instruction_pointer(regs) -#endif void signal_fault(struct pt_regs *regs, void __user *frame, char *where); enum { diff -Nru a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h --- a/include/asm-x86_64/smp.h 2004-10-06 19:37:46 -07:00 +++ b/include/asm-x86_64/smp.h 2004-10-06 19:37:46 -07:00 @@ -110,9 +110,13 @@ #endif #define INT_DELIVERY_MODE 1 /* logical delivery */ -#define TARGET_CPUS 1 #ifndef ASSEMBLY +#ifdef CONFIG_SMP +#define TARGET_CPUS cpu_online_map +#else +#define TARGET_CPUS cpumask_of_cpu(0) +#endif static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) { return cpus_addr(cpumask)[0]; @@ -131,6 +135,14 @@ __asm__("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \ ti->cpu; \ }) +#endif + +#ifndef __ASSEMBLY__ +static __inline int logical_smp_processor_id(void) +{ + /* we don't want to mark this access volatile - bad code generation */ + return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)); +} #endif #endif diff -Nru a/include/linux/arcdevice.h b/include/linux/arcdevice.h --- a/include/linux/arcdevice.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/arcdevice.h 2004-10-06 19:37:47 -07:00 @@ -305,7 +305,7 @@ void *buf, int count); } hw; - void *mem_start; /* pointer to ioremap'ed MMIO */ + void __iomem *mem_start; /* pointer to ioremap'ed MMIO */ }; diff -Nru a/include/linux/byteorder/big_endian.h b/include/linux/byteorder/big_endian.h --- a/include/linux/byteorder/big_endian.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/byteorder/big_endian.h 2004-10-06 19:37:47 -07:00 @@ -11,10 +11,10 @@ #include #include -#define __constant_htonl(x) ((__u32)(x)) -#define __constant_ntohl(x) ((__u32)(x)) -#define __constant_htons(x) ((__u16)(x)) -#define __constant_ntohs(x) ((__u16)(x)) +#define __constant_htonl(x) ((__force __be32)(__u32)(x)) +#define __constant_ntohl(x) ((__force __u32)(__be32)(x)) +#define __constant_htons(x) ((__force __be16)(__u16)(x)) +#define __constant_ntohs(x) ((__force __u16)(__be16)(x)) #define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x))) #define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x)) #define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x))) diff -Nru a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h --- a/include/linux/byteorder/generic.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/byteorder/generic.h 2004-10-06 19:37:46 -07:00 @@ -147,10 +147,10 @@ * Do the prototypes. Somebody might want to take the * address or some such sick thing.. */ -extern __u32 ntohl(__u32); -extern __u32 htonl(__u32); -extern unsigned short int ntohs(unsigned short int); -extern unsigned short int htons(unsigned short int); +extern __u32 ntohl(__be32); +extern __be32 htonl(__u32); +extern __u16 ntohs(__be16); +extern __be16 htons(__u16); #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) diff -Nru a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h --- a/include/linux/byteorder/little_endian.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/byteorder/little_endian.h 2004-10-06 19:37:47 -07:00 @@ -11,10 +11,10 @@ #include #include -#define __constant_htonl(x) ___constant_swab32((x)) -#define __constant_ntohl(x) ___constant_swab32((x)) -#define __constant_htons(x) ___constant_swab16((x)) -#define __constant_ntohs(x) ___constant_swab16((x)) +#define __constant_htonl(x) ((__force __be32)___constant_swab32((x))) +#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x)) +#define __constant_htons(x) ((__force __be16)___constant_swab16((x))) +#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x)) #define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x)) #define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x)) #define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x)) diff -Nru a/include/linux/cyclades.h b/include/linux/cyclades.h --- a/include/linux/cyclades.h 2004-10-06 19:37:48 -07:00 +++ b/include/linux/cyclades.h 2004-10-06 19:37:48 -07:00 @@ -511,8 +511,8 @@ struct cyclades_card { unsigned long base_phys; unsigned long ctl_phys; - unsigned long base_addr; - unsigned long ctl_addr; + void __iomem *base_addr; + void __iomem *ctl_addr; int irq; int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ int first_line; /* minor number of first channel on card */ @@ -539,9 +539,9 @@ * (required to support Alpha systems) * ***************************************/ -#define cy_writeb(port,val) {writeb((ucchar)(val),(ulong)(port)); mb();} -#define cy_writew(port,val) {writew((ushort)(val),(ulong)(port)); mb();} -#define cy_writel(port,val) {writel((uclong)(val),(ulong)(port)); mb();} +#define cy_writeb(port,val) {writeb((val),(port)); mb();} +#define cy_writew(port,val) {writew((val),(port)); mb();} +#define cy_writel(port,val) {writel((val),(port)); mb();} #define cy_readb(port) readb(port) #define cy_readw(port) readw(port) diff -Nru a/include/linux/gen_stats.h b/include/linux/gen_stats.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/linux/gen_stats.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,62 @@ +#ifndef __LINUX_GEN_STATS_H +#define __LINUX_GEN_STATS_H + +#include + +enum { + TCA_STATS_UNSPEC, + TCA_STATS_BASIC, + TCA_STATS_RATE_EST, + TCA_STATS_QUEUE, + TCA_STATS_APP, + __TCA_STATS_MAX, +}; +#define TCA_STATS_MAX (__TCA_STATS_MAX - 1) + +/** + * @bytes: number of seen bytes + * @packets: number of seen packets + */ +struct gnet_stats_basic +{ + __u64 bytes; + __u32 packets; +}; + +/** + * @bps: current byte rate + * @pps: current packet rate + */ +struct gnet_stats_rate_est +{ + __u32 bps; + __u32 pps; +}; + +/** + * @qlen: queue length + * @backlog: backlog size of queue + * @drops: number of dropped packets + * @requeues: number of requeues + */ +struct gnet_stats_queue +{ + __u32 qlen; + __u32 backlog; + __u32 drops; + __u32 requeues; + __u32 overlimits; +}; + +/** + * @interval: sampling period + * @ewma_log: the log of measurement window weight + */ +struct gnet_estimator +{ + signed char interval; + unsigned char ewma_log; +}; + + +#endif /* __LINUX_GEN_STATS_H */ diff -Nru a/include/linux/genhd.h b/include/linux/genhd.h --- a/include/linux/genhd.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/genhd.h 2004-10-06 19:37:47 -07:00 @@ -42,6 +42,8 @@ UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ }; +#ifndef __KERNEL__ + struct partition { unsigned char boot_ind; /* 0x80 - active */ unsigned char head; /* starting head */ @@ -55,7 +57,22 @@ unsigned int nr_sects; /* nr of sectors in partition */ } __attribute__((packed)); +#endif + #ifdef __KERNEL__ +struct partition { + unsigned char boot_ind; /* 0x80 - active */ + unsigned char head; /* starting head */ + unsigned char sector; /* starting sector */ + unsigned char cyl; /* starting cylinder */ + unsigned char sys_ind; /* What partition type */ + unsigned char end_head; /* end head */ + unsigned char end_sector; /* end sector */ + unsigned char end_cyl; /* end cylinder */ + __le32 start_sect; /* starting sector counting from 0 */ + __le32 nr_sects; /* nr of sectors in partition */ +} __attribute__((packed)); + struct hd_struct { sector_t start_sect; sector_t nr_sects; @@ -218,19 +235,19 @@ #define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) struct solaris_x86_slice { - ushort s_tag; /* ID tag of partition */ - ushort s_flag; /* permission flags */ - unsigned int s_start; /* start sector no of partition */ - unsigned int s_size; /* # of blocks in partition */ + __le16 s_tag; /* ID tag of partition */ + __le16 s_flag; /* permission flags */ + __le32 s_start; /* start sector no of partition */ + __le32 s_size; /* # of blocks in partition */ }; struct solaris_x86_vtoc { unsigned int v_bootinfo[3]; /* info needed by mboot (unsupported) */ - unsigned int v_sanity; /* to verify vtoc sanity */ - unsigned int v_version; /* layout version */ + __le32 v_sanity; /* to verify vtoc sanity */ + __le32 v_version; /* layout version */ char v_volume[8]; /* volume name */ - ushort v_sectorsz; /* sector size in bytes */ - ushort v_nparts; /* number of partitions */ + __le16 v_sectorsz; /* sector size in bytes */ + __le16 v_nparts; /* number of partitions */ unsigned int v_reserved[10]; /* free space */ struct solaris_x86_slice v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */ @@ -253,7 +270,7 @@ #define OPENBSD_MAXPARTITIONS 16 #define BSD_FS_UNUSED 0 /* disklabel unused partition entry ID */ struct bsd_disklabel { - __u32 d_magic; /* the magic number */ + __le32 d_magic; /* the magic number */ __s16 d_type; /* drive type */ __s16 d_subtype; /* controller/d_type specific */ char d_typename[16]; /* type name, e.g. "eagle" */ @@ -278,20 +295,20 @@ __u32 d_drivedata[NDDATA]; /* drive-type specific information */ #define NSPARE 5 __u32 d_spare[NSPARE]; /* reserved for future use */ - __u32 d_magic2; /* the magic number (again) */ - __u16 d_checksum; /* xor of data incl. partitions */ + __le32 d_magic2; /* the magic number (again) */ + __le16 d_checksum; /* xor of data incl. partitions */ /* filesystem and partition information: */ - __u16 d_npartitions; /* number of partitions in following */ - __u32 d_bbsize; /* size of boot area at sn0, bytes */ - __u32 d_sbsize; /* max size of fs superblock, bytes */ + __le16 d_npartitions; /* number of partitions in following */ + __le32 d_bbsize; /* size of boot area at sn0, bytes */ + __le32 d_sbsize; /* max size of fs superblock, bytes */ struct bsd_partition { /* the partition table */ - __u32 p_size; /* number of sectors in partition */ - __u32 p_offset; /* starting sector */ - __u32 p_fsize; /* filesystem basic fragment size */ + __le32 p_size; /* number of sectors in partition */ + __le32 p_offset; /* starting sector */ + __le32 p_fsize; /* filesystem basic fragment size */ __u8 p_fstype; /* filesystem type, see below */ __u8 p_frag; /* filesystem fragments per block */ - __u16 p_cpg; /* filesystem cylinders per group */ + __le16 p_cpg; /* filesystem cylinders per group */ } d_partitions[BSD_MAXPARTITIONS]; /* actually may be more */ }; @@ -309,40 +326,40 @@ #define UNIXWARE_FS_UNUSED 0 /* Unused slice entry ID */ struct unixware_slice { - __u16 s_label; /* label */ - __u16 s_flags; /* permission flags */ - __u32 start_sect; /* starting sector */ - __u32 nr_sects; /* number of sectors in slice */ + __le16 s_label; /* label */ + __le16 s_flags; /* permission flags */ + __le32 start_sect; /* starting sector */ + __le32 nr_sects; /* number of sectors in slice */ }; struct unixware_disklabel { - __u32 d_type; /* drive type */ - __u32 d_magic; /* the magic number */ - __u32 d_version; /* version number */ + __le32 d_type; /* drive type */ + __le32 d_magic; /* the magic number */ + __le32 d_version; /* version number */ char d_serial[12]; /* serial number of the device */ - __u32 d_ncylinders; /* # of data cylinders per device */ - __u32 d_ntracks; /* # of tracks per cylinder */ - __u32 d_nsectors; /* # of data sectors per track */ - __u32 d_secsize; /* # of bytes per sector */ - __u32 d_part_start; /* # of first sector of this partition */ - __u32 d_unknown1[12]; /* ? */ - __u32 d_alt_tbl; /* byte offset of alternate table */ - __u32 d_alt_len; /* byte length of alternate table */ - __u32 d_phys_cyl; /* # of physical cylinders per device */ - __u32 d_phys_trk; /* # of physical tracks per cylinder */ - __u32 d_phys_sec; /* # of physical sectors per track */ - __u32 d_phys_bytes; /* # of physical bytes per sector */ - __u32 d_unknown2; /* ? */ - __u32 d_unknown3; /* ? */ - __u32 d_pad[8]; /* pad */ + __le32 d_ncylinders; /* # of data cylinders per device */ + __le32 d_ntracks; /* # of tracks per cylinder */ + __le32 d_nsectors; /* # of data sectors per track */ + __le32 d_secsize; /* # of bytes per sector */ + __le32 d_part_start; /* # of first sector of this partition */ + __le32 d_unknown1[12]; /* ? */ + __le32 d_alt_tbl; /* byte offset of alternate table */ + __le32 d_alt_len; /* byte length of alternate table */ + __le32 d_phys_cyl; /* # of physical cylinders per device */ + __le32 d_phys_trk; /* # of physical tracks per cylinder */ + __le32 d_phys_sec; /* # of physical sectors per track */ + __le32 d_phys_bytes; /* # of physical bytes per sector */ + __le32 d_unknown2; /* ? */ + __le32 d_unknown3; /* ? */ + __le32 d_pad[8]; /* pad */ struct unixware_vtoc { - __u32 v_magic; /* the magic number */ - __u32 v_version; /* version number */ + __le32 v_magic; /* the magic number */ + __le32 v_version; /* version number */ char v_name[8]; /* volume name */ - __u16 v_nslices; /* # of slices */ - __u16 v_unknown1; /* ? */ - __u32 v_reserved[10]; /* reserved */ + __le16 v_nslices; /* # of slices */ + __le16 v_unknown1; /* ? */ + __le32 v_reserved[10]; /* reserved */ struct unixware_slice v_slice[UNIXWARE_NUMSLICE]; /* slice headers */ } vtoc; diff -Nru a/include/linux/ide.h b/include/linux/ide.h --- a/include/linux/ide.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/ide.h 2004-10-06 19:37:47 -07:00 @@ -52,13 +52,6 @@ #define OK_TO_RESET_CONTROLLER 1 /* 0 for use with AH2372A/B interface */ #endif -#ifdef CONFIG_BLK_DEV_CMD640 -#if 0 /* change to 1 when debugging cmd640 problems */ -void cmd640_dump_regs (void); -#define CMD640_DUMP_REGS cmd640_dump_regs() /* for debugging cmd640 chipset */ -#endif -#endif /* CONFIG_BLK_DEV_CMD640 */ - #ifndef DISABLE_IRQ_NOSYNC #define DISABLE_IRQ_NOSYNC 0 #endif diff -Nru a/include/linux/if_fddi.h b/include/linux/if_fddi.h --- a/include/linux/if_fddi.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/if_fddi.h 2004-10-06 19:37:47 -07:00 @@ -5,7 +5,7 @@ * * Global definitions for the ANSI FDDI interface. * - * Version: @(#)if_fddi.h 1.0.1 09/16/96 + * Version: @(#)if_fddi.h 1.0.2 Sep 29 2004 * * Author: Lawrence V. Stefani, * @@ -103,38 +103,12 @@ } __attribute__ ((packed)); /* Define FDDI statistics structure */ -struct fddi_statistics - { - __u32 rx_packets; /* total packets received */ - __u32 tx_packets; /* total packets transmitted */ - __u32 rx_bytes; /* total bytes received */ - __u32 tx_bytes; /* total bytes transmitted */ - __u32 rx_errors; /* bad packets received */ - __u32 tx_errors; /* packet transmit problems */ - __u32 rx_dropped; /* no space in linux buffers */ - __u32 tx_dropped; /* no space available in linux */ - __u32 multicast; /* multicast packets received */ - __u32 transmit_collision; /* always 0 for FDDI */ - - /* detailed rx_errors */ - __u32 rx_length_errors; - __u32 rx_over_errors; /* receiver ring buff overflow */ - __u32 rx_crc_errors; /* recved pkt with crc error */ - __u32 rx_frame_errors; /* recv'd frame alignment error */ - __u32 rx_fifo_errors; /* recv'r fifo overrun */ - __u32 rx_missed_errors; /* receiver missed packet */ - - /* detailed tx_errors */ - __u32 tx_aborted_errors; - __u32 tx_carrier_errors; - __u32 tx_fifo_errors; - __u32 tx_heartbeat_errors; - __u32 tx_window_errors; - - /* for cslip etc */ - __u32 rx_compressed; - __u32 tx_compressed; - +struct fddi_statistics { + + /* Generic statistics. */ + + struct net_device_stats gen; + /* Detailed FDDI statistics. Adopted from RFC 1512 */ __u8 smt_station_id[8]; diff -Nru a/include/linux/iso_fs.h b/include/linux/iso_fs.h --- a/include/linux/iso_fs.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/iso_fs.h 2004-10-06 19:37:47 -07:00 @@ -192,29 +192,29 @@ } static inline unsigned int isonum_721(char *p) { - return le16_to_cpu(get_unaligned((u16 *)p)); + return le16_to_cpu(get_unaligned((__le16 *)p)); } static inline unsigned int isonum_722(char *p) { - return be16_to_cpu(get_unaligned((u16 *)p)); + return be16_to_cpu(get_unaligned((__le16 *)p)); } static inline unsigned int isonum_723(char *p) { /* Ignore bigendian datum due to broken mastering programs */ - return le16_to_cpu(get_unaligned((u16 *)p)); + return le16_to_cpu(get_unaligned((__le16 *)p)); } static inline unsigned int isonum_731(char *p) { - return le32_to_cpu(get_unaligned((u32 *)p)); + return le32_to_cpu(get_unaligned((__le32 *)p)); } static inline unsigned int isonum_732(char *p) { - return be32_to_cpu(get_unaligned((u32 *)p)); + return be32_to_cpu(get_unaligned((__le32 *)p)); } static inline unsigned int isonum_733(char *p) { /* Ignore bigendian datum due to broken mastering programs */ - return le32_to_cpu(get_unaligned((u32 *)p)); + return le32_to_cpu(get_unaligned((__le32 *)p)); } extern int iso_date(char *, int); diff -Nru a/include/linux/mman.h b/include/linux/mman.h --- a/include/linux/mman.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/mman.h 2004-10-06 19:37:46 -07:00 @@ -10,6 +10,9 @@ #define MREMAP_MAYMOVE 1 #define MREMAP_FIXED 2 +#define OVERCOMMIT_GUESS 0 +#define OVERCOMMIT_ALWAYS 1 +#define OVERCOMMIT_NEVER 2 extern int sysctl_overcommit_memory; extern int sysctl_overcommit_ratio; extern atomic_t vm_committed_space; diff -Nru a/include/linux/ncp.h b/include/linux/ncp.h --- a/include/linux/ncp.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/ncp.h 2004-10-06 19:37:46 -07:00 @@ -57,9 +57,9 @@ char volume_name[NCP_VOLNAME_LEN + 1]; }; -#define AR_READ (ntohs(0x0100)) -#define AR_WRITE (ntohs(0x0200)) -#define AR_EXCLUSIVE (ntohs(0x2000)) +#define AR_READ (cpu_to_le16(1)) +#define AR_WRITE (cpu_to_le16(2)) +#define AR_EXCLUSIVE (cpu_to_le16(0x20)) #define NCP_FILE_ID_LEN 6 @@ -71,20 +71,20 @@ #define NW_NS_OS2 4 /* Defines for ReturnInformationMask */ -#define RIM_NAME (ntohl(0x01000000L)) -#define RIM_SPACE_ALLOCATED (ntohl(0x02000000L)) -#define RIM_ATTRIBUTES (ntohl(0x04000000L)) -#define RIM_DATA_SIZE (ntohl(0x08000000L)) -#define RIM_TOTAL_SIZE (ntohl(0x10000000L)) -#define RIM_EXT_ATTR_INFO (ntohl(0x20000000L)) -#define RIM_ARCHIVE (ntohl(0x40000000L)) -#define RIM_MODIFY (ntohl(0x80000000L)) -#define RIM_CREATION (ntohl(0x00010000L)) -#define RIM_OWNING_NAMESPACE (ntohl(0x00020000L)) -#define RIM_DIRECTORY (ntohl(0x00040000L)) -#define RIM_RIGHTS (ntohl(0x00080000L)) -#define RIM_ALL (ntohl(0xFF0F0000L)) -#define RIM_COMPRESSED_INFO (ntohl(0x00000080L)) +#define RIM_NAME (cpu_to_le32(1)) +#define RIM_SPACE_ALLOCATED (cpu_to_le32(2)) +#define RIM_ATTRIBUTES (cpu_to_le32(4)) +#define RIM_DATA_SIZE (cpu_to_le32(8)) +#define RIM_TOTAL_SIZE (cpu_to_le32(0x10)) +#define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20)) +#define RIM_ARCHIVE (cpu_to_le32(0x40)) +#define RIM_MODIFY (cpu_to_le32(0x80)) +#define RIM_CREATION (cpu_to_le32(0x100)) +#define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200)) +#define RIM_DIRECTORY (cpu_to_le32(0x400)) +#define RIM_RIGHTS (cpu_to_le32(0x800)) +#define RIM_ALL (cpu_to_le32(0xFFF)) +#define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000)) /* Defines for NSInfoBitMask */ #define NSIBM_NFS_NAME 0x0001 @@ -129,24 +129,24 @@ struct nw_info_struct { __u32 spaceAlloc __attribute__((packed)); - __u32 attributes __attribute__((packed)); + __le32 attributes __attribute__((packed)); __u16 flags __attribute__((packed)); - __u32 dataStreamSize __attribute__((packed)); - __u32 totalStreamSize __attribute__((packed)); + __le32 dataStreamSize __attribute__((packed)); + __le32 totalStreamSize __attribute__((packed)); __u16 numberOfStreams __attribute__((packed)); - __u16 creationTime __attribute__((packed)); - __u16 creationDate __attribute__((packed)); + __le16 creationTime __attribute__((packed)); + __le16 creationDate __attribute__((packed)); __u32 creatorID __attribute__((packed)); - __u16 modifyTime __attribute__((packed)); - __u16 modifyDate __attribute__((packed)); + __le16 modifyTime __attribute__((packed)); + __le16 modifyDate __attribute__((packed)); __u32 modifierID __attribute__((packed)); - __u16 lastAccessDate __attribute__((packed)); + __le16 lastAccessDate __attribute__((packed)); __u16 archiveTime __attribute__((packed)); __u16 archiveDate __attribute__((packed)); __u32 archiverID __attribute__((packed)); __u16 inheritedRightsMask __attribute__((packed)); - __u32 dirEntNum __attribute__((packed)); - __u32 DosDirNum __attribute__((packed)); + __le32 dirEntNum __attribute__((packed)); + __le32 DosDirNum __attribute__((packed)); __u32 volNumber __attribute__((packed)); __u32 EADataSize __attribute__((packed)); __u32 EAKeyCount __attribute__((packed)); @@ -161,32 +161,32 @@ }; /* modify mask - use with MODIFY_DOS_INFO structure */ -#define DM_ATTRIBUTES (ntohl(0x02000000L)) -#define DM_CREATE_DATE (ntohl(0x04000000L)) -#define DM_CREATE_TIME (ntohl(0x08000000L)) -#define DM_CREATOR_ID (ntohl(0x10000000L)) -#define DM_ARCHIVE_DATE (ntohl(0x20000000L)) -#define DM_ARCHIVE_TIME (ntohl(0x40000000L)) -#define DM_ARCHIVER_ID (ntohl(0x80000000L)) -#define DM_MODIFY_DATE (ntohl(0x00010000L)) -#define DM_MODIFY_TIME (ntohl(0x00020000L)) -#define DM_MODIFIER_ID (ntohl(0x00040000L)) -#define DM_LAST_ACCESS_DATE (ntohl(0x00080000L)) -#define DM_INHERITED_RIGHTS_MASK (ntohl(0x00100000L)) -#define DM_MAXIMUM_SPACE (ntohl(0x00200000L)) +#define DM_ATTRIBUTES (cpu_to_le32(0x02)) +#define DM_CREATE_DATE (cpu_to_le32(0x04)) +#define DM_CREATE_TIME (cpu_to_le32(0x08)) +#define DM_CREATOR_ID (cpu_to_le32(0x10)) +#define DM_ARCHIVE_DATE (cpu_to_le32(0x20)) +#define DM_ARCHIVE_TIME (cpu_to_le32(0x40)) +#define DM_ARCHIVER_ID (cpu_to_le32(0x80)) +#define DM_MODIFY_DATE (cpu_to_le32(0x0100)) +#define DM_MODIFY_TIME (cpu_to_le32(0x0200)) +#define DM_MODIFIER_ID (cpu_to_le32(0x0400)) +#define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800)) +#define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000)) +#define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000)) struct nw_modify_dos_info { - __u32 attributes __attribute__((packed)); - __u16 creationDate __attribute__((packed)); - __u16 creationTime __attribute__((packed)); + __le32 attributes __attribute__((packed)); + __le16 creationDate __attribute__((packed)); + __le16 creationTime __attribute__((packed)); __u32 creatorID __attribute__((packed)); - __u16 modifyDate __attribute__((packed)); - __u16 modifyTime __attribute__((packed)); + __le16 modifyDate __attribute__((packed)); + __le16 modifyTime __attribute__((packed)); __u32 modifierID __attribute__((packed)); __u16 archiveDate __attribute__((packed)); __u16 archiveTime __attribute__((packed)); __u32 archiverID __attribute__((packed)); - __u16 lastAccessDate __attribute__((packed)); + __le16 lastAccessDate __attribute__((packed)); __u16 inheritanceGrantMask __attribute__((packed)); __u16 inheritanceRevokeMask __attribute__((packed)); __u32 maximumSpace __attribute__((packed)); diff -Nru a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h --- a/include/linux/ncp_fs.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/ncp_fs.h 2004-10-06 19:37:47 -07:00 @@ -36,7 +36,7 @@ used for read/write requests! */ int volume_number; - __u32 directory_id; + __le32 directory_id; }; struct ncp_fs_info_v2 { @@ -46,7 +46,7 @@ unsigned int buffer_size; unsigned int volume_number; - __u32 directory_id; + __le32 directory_id; __u32 dummy1; __u32 dummy2; @@ -78,7 +78,7 @@ { int volNumber; int namespace; - __u32 dirEntNum; + __le32 dirEntNum; }; struct ncp_objectname_ioctl @@ -239,8 +239,8 @@ extern struct inode_operations ncp_dir_inode_operations; extern struct file_operations ncp_dir_operations; int ncp_conn_logged_in(struct super_block *); -int ncp_date_dos2unix(__u16 time, __u16 date); -void ncp_date_unix2dos(int unix_date, __u16 * time, __u16 * date); +int ncp_date_dos2unix(__le16 time, __le16 date); +void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); /* linux/fs/ncpfs/ioctl.c */ int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); diff -Nru a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h --- a/include/linux/ncp_fs_i.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/ncp_fs_i.h 2004-10-06 19:37:47 -07:00 @@ -15,10 +15,10 @@ * all the information we need to work with an inode after creation. */ struct ncp_inode_info { - __u32 dirEntNum; - __u32 DosDirNum; - __u32 volNumber; - __u32 nwattr; + __le32 dirEntNum; + __le32 DosDirNum; + __u8 volNumber; + __le32 nwattr; struct semaphore open_sem; atomic_t opened; int access; diff -Nru a/include/linux/ncp_no.h b/include/linux/ncp_no.h --- a/include/linux/ncp_no.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/ncp_no.h 2004-10-06 19:37:46 -07:00 @@ -2,18 +2,18 @@ #define _NCP_NO /* these define the attribute byte as seen by NCP */ -#define aRONLY (ntohl(0x01000000)) -#define aHIDDEN (__constant_ntohl(0x02000000)) -#define aSYSTEM (__constant_ntohl(0x04000000)) -#define aEXECUTE (ntohl(0x08000000)) -#define aDIR (ntohl(0x10000000)) -#define aARCH (ntohl(0x20000000)) -#define aSHARED (ntohl(0x80000000)) -#define aDONTSUBALLOCATE (ntohl(1L<<(11+8))) -#define aTRANSACTIONAL (ntohl(1L<<(12+8))) -#define aPURGE (ntohl(1L<<(16-8))) -#define aRENAMEINHIBIT (ntohl(1L<<(17-8))) -#define aDELETEINHIBIT (ntohl(1L<<(18-8))) -#define aDONTCOMPRESS (nothl(1L<<(27-24))) +#define aRONLY (__constant_cpu_to_le32(1)) +#define aHIDDEN (__constant_cpu_to_le32(2)) +#define aSYSTEM (__constant_cpu_to_le32(4)) +#define aEXECUTE (__constant_cpu_to_le32(8)) +#define aDIR (__constant_cpu_to_le32(0x10)) +#define aARCH (__constant_cpu_to_le32(0x20)) +#define aSHARED (__constant_cpu_to_le32(0x80)) +#define aDONTSUBALLOCATE (__constant_cpu_to_le32(1L<<11)) +#define aTRANSACTIONAL (__constant_cpu_to_le32(1L<<12)) +#define aPURGE (__constant_cpu_to_le32(1L<<16)) +#define aRENAMEINHIBIT (__constant_cpu_to_le32(1L<<17)) +#define aDELETEINHIBIT (__constant_cpu_to_le32(1L<<18)) +#define aDONTCOMPRESS (__constant_cpu_to_le32(1L<<27)) #endif /* _NCP_NO */ diff -Nru a/include/linux/notifier.h b/include/linux/notifier.h --- a/include/linux/notifier.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/notifier.h 2004-10-06 19:37:46 -07:00 @@ -29,6 +29,10 @@ #define NOTIFY_OK 0x0001 /* Suits me */ #define NOTIFY_STOP_MASK 0x8000 /* Don't call further */ #define NOTIFY_BAD (NOTIFY_STOP_MASK|0x0002) /* Bad/Veto action */ +/* + * Clean way to return from the notifier and stop further calls. + */ +#define NOTIFY_STOP (NOTIFY_OK|NOTIFY_STOP_MASK) /* * Declared notifiers so far. I can imagine quite a few more chains diff -Nru a/include/linux/percpu.h b/include/linux/percpu.h --- a/include/linux/percpu.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/percpu.h 2004-10-06 19:37:47 -07:00 @@ -58,26 +58,4 @@ #define alloc_percpu(type) \ ((type *)(__alloc_percpu(sizeof(type), __alignof__(type)))) -/* - * Use these with alloc_percpu. If - * 1. You want to operate on memory allocated by alloc_percpu (dereference - * and read/modify/write) AND - * 2. You want "this cpu's version" of the object AND - * 3. You want to do this safely since: - * a. On multiprocessors, you don't want to switch between cpus after - * you've read the current processor id due to preemption -- this would - * take away the implicit advantage to not have any kind of traditional - * serialization for per-cpu data - * b. On uniprocessors, you don't want another kernel thread messing - * up with the same per-cpu data due to preemption - * - * So, Use get_cpu_ptr to disable preemption and get pointer to the - * local cpu version of the per-cpu object. Use put_cpu_ptr to enable - * preemption. Operations on per-cpu data between get_ and put_ is - * then considered to be safe. And ofcourse, "Thou shalt not sleep between - * get_cpu_ptr and put_cpu_ptr" - */ -#define get_cpu_ptr(ptr) per_cpu_ptr(ptr, get_cpu()) -#define put_cpu_ptr(ptr) put_cpu() - #endif /* __LINUX_PERCPU_H */ diff -Nru a/include/linux/quotaio_v2.h b/include/linux/quotaio_v2.h --- a/include/linux/quotaio_v2.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/quotaio_v2.h 2004-10-06 19:37:47 -07:00 @@ -27,15 +27,15 @@ * to blocks of these structures. */ struct v2_disk_dqblk { - __u32 dqb_id; /* id this quota applies to */ - __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ - __u32 dqb_isoftlimit; /* preferred inode limit */ - __u32 dqb_curinodes; /* current # allocated inodes */ - __u32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ - __u32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ - __u64 dqb_curspace; /* current space occupied (in bytes) */ - __u64 dqb_btime; /* time limit for excessive disk use */ - __u64 dqb_itime; /* time limit for excessive inode use */ + __le32 dqb_id; /* id this quota applies to */ + __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */ + __le32 dqb_isoftlimit; /* preferred inode limit */ + __le32 dqb_curinodes; /* current # allocated inodes */ + __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ + __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ + __le64 dqb_curspace; /* current space occupied (in bytes) */ + __le64 dqb_btime; /* time limit for excessive disk use */ + __le64 dqb_itime; /* time limit for excessive inode use */ }; /* @@ -43,18 +43,18 @@ */ /* First generic header */ struct v2_disk_dqheader { - __u32 dqh_magic; /* Magic number identifying file */ - __u32 dqh_version; /* File version */ + __le32 dqh_magic; /* Magic number identifying file */ + __le32 dqh_version; /* File version */ }; /* Header with type and version specific information */ struct v2_disk_dqinfo { - __u32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ - __u32 dqi_igrace; /* Time before inode soft limit becomes hard limit */ - __u32 dqi_flags; /* Flags for quotafile (DQF_*) */ - __u32 dqi_blocks; /* Number of blocks in file */ - __u32 dqi_free_blk; /* Number of first free block in the list */ - __u32 dqi_free_entry; /* Number of block with at least one free entry */ + __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ + __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */ + __le32 dqi_flags; /* Flags for quotafile (DQF_*) */ + __le32 dqi_blocks; /* Number of blocks in file */ + __le32 dqi_free_blk; /* Number of first free block in the list */ + __le32 dqi_free_entry; /* Number of block with at least one free entry */ }; /* @@ -62,11 +62,11 @@ * there will be space for exactly 21 quota-entries in a block */ struct v2_disk_dqdbheader { - __u32 dqdh_next_free; /* Number of next block with free entry */ - __u32 dqdh_prev_free; /* Number of previous block with free entry */ - __u16 dqdh_entries; /* Number of valid entries in block */ - __u16 dqdh_pad1; - __u32 dqdh_pad2; + __le32 dqdh_next_free; /* Number of next block with free entry */ + __le32 dqdh_prev_free; /* Number of previous block with free entry */ + __le16 dqdh_entries; /* Number of valid entries in block */ + __le16 dqdh_pad1; + __le32 dqdh_pad2; }; #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ diff -Nru a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h --- a/include/linux/romfs_fs.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/romfs_fs.h 2004-10-06 19:37:47 -07:00 @@ -12,27 +12,27 @@ #define __mkw(h,l) (((h)&0x00ff)<< 8|((l)&0x00ff)) #define __mkl(h,l) (((h)&0xffff)<<16|((l)&0xffff)) -#define __mk4(a,b,c,d) htonl(__mkl(__mkw(a,b),__mkw(c,d))) +#define __mk4(a,b,c,d) cpu_to_be32(__mkl(__mkw(a,b),__mkw(c,d))) #define ROMSB_WORD0 __mk4('-','r','o','m') #define ROMSB_WORD1 __mk4('1','f','s','-') /* On-disk "super block" */ struct romfs_super_block { - __u32 word0; - __u32 word1; - __u32 size; - __u32 checksum; + __be32 word0; + __be32 word1; + __be32 size; + __be32 checksum; char name[0]; /* volume name */ }; /* On disk inode */ struct romfs_inode { - __u32 next; /* low 4 bits see ROMFH_ */ - __u32 spec; - __u32 size; - __u32 checksum; + __be32 next; /* low 4 bits see ROMFH_ */ + __be32 spec; + __be32 size; + __be32 checksum; char name[0]; }; diff -Nru a/include/linux/sched.h b/include/linux/sched.h --- a/include/linux/sched.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/sched.h 2004-10-06 19:37:46 -07:00 @@ -449,7 +449,7 @@ unsigned long sleep_avg; long interactive_credit; - unsigned long long timestamp; + unsigned long long timestamp, last_ran; int activated; unsigned long policy; diff -Nru a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h --- a/include/linux/sunrpc/auth_gss.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/sunrpc/auth_gss.h 2004-10-06 19:37:46 -07:00 @@ -15,11 +15,9 @@ #define _LINUX_SUNRPC_AUTH_GSS_H #ifdef __KERNEL__ -#ifdef __linux__ #include #include #include -#endif #define RPC_GSS_VERSION 1 diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h --- a/include/linux/sysctl.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/sysctl.h 2004-10-06 19:37:47 -07:00 @@ -341,6 +341,7 @@ NET_TCP_BIC_LOW_WINDOW=104, NET_TCP_DEFAULT_WIN_SCALE=105, NET_TCP_MODERATE_RCVBUF=106, + NET_TCP_TSO_WIN_DIVISOR=107, }; enum { diff -Nru a/include/linux/time.h b/include/linux/time.h --- a/include/linux/time.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/time.h 2004-10-06 19:37:47 -07:00 @@ -208,6 +208,8 @@ static inline unsigned long msecs_to_jiffies(const unsigned int m) { + if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET)) + return MAX_JIFFY_OFFSET; #if HZ <= 1000 && !(1000 % HZ) return (m + (1000 / HZ) - 1) / (1000 / HZ); #elif HZ > 1000 && !(HZ % 1000) diff -Nru a/include/linux/timex.h b/include/linux/timex.h --- a/include/linux/timex.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/timex.h 2004-10-06 19:37:46 -07:00 @@ -55,10 +55,8 @@ #include #include -#include #include -#include /* * The following defines establish the engineering parameters of the PLL diff -Nru a/include/linux/tty.h b/include/linux/tty.h --- a/include/linux/tty.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/tty.h 2004-10-06 19:37:47 -07:00 @@ -244,6 +244,7 @@ struct tty_driver *driver; int index; struct tty_ldisc ldisc; + struct semaphore termios_sem; struct termios *termios, *termios_locked; char name[64]; int pgrp; diff -Nru a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h --- a/include/linux/ufs_fs.h 2004-10-06 19:37:48 -07:00 +++ b/include/linux/ufs_fs.h 2004-10-06 19:37:48 -07:00 @@ -36,6 +36,16 @@ #include #include +#ifndef __KERNEL__ +typedef __u64 __fs64; +typedef __u32 __fs32; +typedef __u16 __fs16; +#else +typedef __u64 __bitwise __fs64; +typedef __u32 __bitwise __fs32; +typedef __u16 __bitwise __fs16; +#endif + #include #include @@ -297,15 +307,15 @@ #define UFS_DIR_REC_LEN(name_len) (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND) struct ufs_timeval { - __s32 tv_sec; - __s32 tv_usec; + __fs32 tv_sec; + __fs32 tv_usec; }; struct ufs_dir_entry { - __u32 d_ino; /* inode number of this entry */ - __u16 d_reclen; /* length of this entry */ + __fs32 d_ino; /* inode number of this entry */ + __fs16 d_reclen; /* length of this entry */ union { - __u16 d_namlen; /* actual length of d_name */ + __fs16 d_namlen; /* actual length of d_name */ struct { __u8 d_type; /* file type */ __u8 d_namlen; /* length of string in d_name */ @@ -315,92 +325,92 @@ }; struct ufs_csum { - __u32 cs_ndir; /* number of directories */ - __u32 cs_nbfree; /* number of free blocks */ - __u32 cs_nifree; /* number of free inodes */ - __u32 cs_nffree; /* number of free frags */ + __fs32 cs_ndir; /* number of directories */ + __fs32 cs_nbfree; /* number of free blocks */ + __fs32 cs_nifree; /* number of free inodes */ + __fs32 cs_nffree; /* number of free frags */ }; struct ufs2_csum_total { - __u64 cs_ndir; /* number of directories */ - __u64 cs_nbfree; /* number of free blocks */ - __u64 cs_nifree; /* number of free inodes */ - __u64 cs_nffree; /* number of free frags */ - __u64 cs_numclusters; /* number of free clusters */ - __u64 cs_spare[3]; /* future expansion */ + __fs64 cs_ndir; /* number of directories */ + __fs64 cs_nbfree; /* number of free blocks */ + __fs64 cs_nifree; /* number of free inodes */ + __fs64 cs_nffree; /* number of free frags */ + __fs64 cs_numclusters; /* number of free clusters */ + __fs64 cs_spare[3]; /* future expansion */ }; /* * This is the actual superblock, as it is laid out on the disk. */ struct ufs_super_block { - __u32 fs_link; /* UNUSED */ - __u32 fs_rlink; /* UNUSED */ - __u32 fs_sblkno; /* addr of super-block in filesys */ - __u32 fs_cblkno; /* offset of cyl-block in filesys */ - __u32 fs_iblkno; /* offset of inode-blocks in filesys */ - __u32 fs_dblkno; /* offset of first data after cg */ - __u32 fs_cgoffset; /* cylinder group offset in cylinder */ - __u32 fs_cgmask; /* used to calc mod fs_ntrak */ - __u32 fs_time; /* last time written -- time_t */ - __u32 fs_size; /* number of blocks in fs */ - __u32 fs_dsize; /* number of data blocks in fs */ - __u32 fs_ncg; /* number of cylinder groups */ - __u32 fs_bsize; /* size of basic blocks in fs */ - __u32 fs_fsize; /* size of frag blocks in fs */ - __u32 fs_frag; /* number of frags in a block in fs */ + __fs32 fs_link; /* UNUSED */ + __fs32 fs_rlink; /* UNUSED */ + __fs32 fs_sblkno; /* addr of super-block in filesys */ + __fs32 fs_cblkno; /* offset of cyl-block in filesys */ + __fs32 fs_iblkno; /* offset of inode-blocks in filesys */ + __fs32 fs_dblkno; /* offset of first data after cg */ + __fs32 fs_cgoffset; /* cylinder group offset in cylinder */ + __fs32 fs_cgmask; /* used to calc mod fs_ntrak */ + __fs32 fs_time; /* last time written -- time_t */ + __fs32 fs_size; /* number of blocks in fs */ + __fs32 fs_dsize; /* number of data blocks in fs */ + __fs32 fs_ncg; /* number of cylinder groups */ + __fs32 fs_bsize; /* size of basic blocks in fs */ + __fs32 fs_fsize; /* size of frag blocks in fs */ + __fs32 fs_frag; /* number of frags in a block in fs */ /* these are configuration parameters */ - __u32 fs_minfree; /* minimum percentage of free blocks */ - __u32 fs_rotdelay; /* num of ms for optimal next block */ - __u32 fs_rps; /* disk revolutions per second */ + __fs32 fs_minfree; /* minimum percentage of free blocks */ + __fs32 fs_rotdelay; /* num of ms for optimal next block */ + __fs32 fs_rps; /* disk revolutions per second */ /* these fields can be computed from the others */ - __u32 fs_bmask; /* ``blkoff'' calc of blk offsets */ - __u32 fs_fmask; /* ``fragoff'' calc of frag offsets */ - __u32 fs_bshift; /* ``lblkno'' calc of logical blkno */ - __u32 fs_fshift; /* ``numfrags'' calc number of frags */ + __fs32 fs_bmask; /* ``blkoff'' calc of blk offsets */ + __fs32 fs_fmask; /* ``fragoff'' calc of frag offsets */ + __fs32 fs_bshift; /* ``lblkno'' calc of logical blkno */ + __fs32 fs_fshift; /* ``numfrags'' calc number of frags */ /* these are configuration parameters */ - __u32 fs_maxcontig; /* max number of contiguous blks */ - __u32 fs_maxbpg; /* max number of blks per cyl group */ + __fs32 fs_maxcontig; /* max number of contiguous blks */ + __fs32 fs_maxbpg; /* max number of blks per cyl group */ /* these fields can be computed from the others */ - __u32 fs_fragshift; /* block to frag shift */ - __u32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */ - __u32 fs_sbsize; /* actual size of super block */ - __u32 fs_csmask; /* csum block offset */ - __u32 fs_csshift; /* csum block number */ - __u32 fs_nindir; /* value of NINDIR */ - __u32 fs_inopb; /* value of INOPB */ - __u32 fs_nspf; /* value of NSPF */ + __fs32 fs_fragshift; /* block to frag shift */ + __fs32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */ + __fs32 fs_sbsize; /* actual size of super block */ + __fs32 fs_csmask; /* csum block offset */ + __fs32 fs_csshift; /* csum block number */ + __fs32 fs_nindir; /* value of NINDIR */ + __fs32 fs_inopb; /* value of INOPB */ + __fs32 fs_nspf; /* value of NSPF */ /* yet another configuration parameter */ - __u32 fs_optim; /* optimization preference, see below */ + __fs32 fs_optim; /* optimization preference, see below */ /* these fields are derived from the hardware */ union { struct { - __u32 fs_npsect; /* # sectors/track including spares */ + __fs32 fs_npsect; /* # sectors/track including spares */ } fs_sun; struct { - __s32 fs_state; /* file system state time stamp */ + __fs32 fs_state; /* file system state time stamp */ } fs_sunx86; } fs_u1; - __u32 fs_interleave; /* hardware sector interleave */ - __u32 fs_trackskew; /* sector 0 skew, per track */ + __fs32 fs_interleave; /* hardware sector interleave */ + __fs32 fs_trackskew; /* sector 0 skew, per track */ /* a unique id for this filesystem (currently unused and unmaintained) */ /* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */ /* Neither of those fields is used in the Tahoe code right now but */ /* there could be problems if they are. */ - __u32 fs_id[2]; /* file system id */ + __fs32 fs_id[2]; /* file system id */ /* sizes determined by number of cylinder groups and their sizes */ - __u32 fs_csaddr; /* blk addr of cyl grp summary area */ - __u32 fs_cssize; /* size of cyl grp summary area */ - __u32 fs_cgsize; /* cylinder group size */ + __fs32 fs_csaddr; /* blk addr of cyl grp summary area */ + __fs32 fs_cssize; /* size of cyl grp summary area */ + __fs32 fs_cgsize; /* cylinder group size */ /* these fields are derived from the hardware */ - __u32 fs_ntrak; /* tracks per cylinder */ - __u32 fs_nsect; /* sectors per track */ - __u32 fs_spc; /* sectors per cylinder */ + __fs32 fs_ntrak; /* tracks per cylinder */ + __fs32 fs_nsect; /* sectors per track */ + __fs32 fs_spc; /* sectors per cylinder */ /* this comes from the disk driver partitioning */ - __u32 fs_ncyl; /* cylinders in file system */ + __fs32 fs_ncyl; /* cylinders in file system */ /* these fields can be computed from the others */ - __u32 fs_cpg; /* cylinders per group */ - __u32 fs_ipg; /* inodes per cylinder group */ - __u32 fs_fpg; /* blocks per group * fs_frag */ + __fs32 fs_cpg; /* cylinders per group */ + __fs32 fs_ipg; /* inodes per cylinder group */ + __fs32 fs_fpg; /* blocks per group * fs_frag */ /* this data must be re-computed after crashes */ struct ufs_csum fs_cstotal; /* cylinder summary information */ /* these fields are cleared at mount time */ @@ -411,69 +421,69 @@ union { struct { __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ - __u32 fs_cgrotor; /* last cg searched */ - __u32 fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */ - __u32 fs_maxcluster; - __u32 fs_cpc; /* cyl per cycle in postbl */ - __u16 fs_opostbl[16][8]; /* old rotation block list head */ + __fs32 fs_cgrotor; /* last cg searched */ + __fs32 fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */ + __fs32 fs_maxcluster; + __fs32 fs_cpc; /* cyl per cycle in postbl */ + __fs16 fs_opostbl[16][8]; /* old rotation block list head */ } fs_u1; struct { __s8 fs_fsmnt[UFS2_MAXMNTLEN]; /* name mounted on */ __u8 fs_volname[UFS2_MAXVOLLEN]; /* volume name */ - __u64 fs_swuid; /* system-wide uid */ - __s32 fs_pad; /* due to alignment of fs_swuid */ - __u32 fs_cgrotor; /* last cg searched */ - __u32 fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */ - __u32 fs_contigdirs;/*# of contiguously allocated dirs */ - __u32 fs_csp; /* cg summary info buffer for fs_cs */ - __u32 fs_maxcluster; - __u32 fs_active;/* used by snapshots to track fs */ - __s32 fs_old_cpc; /* cyl per cycle in postbl */ - __s32 fs_maxbsize;/*maximum blocking factor permitted */ - __s64 fs_sparecon64[17];/*old rotation block list head */ - __s64 fs_sblockloc; /* byte offset of standard superblock */ + __fs64 fs_swuid; /* system-wide uid */ + __fs32 fs_pad; /* due to alignment of fs_swuid */ + __fs32 fs_cgrotor; /* last cg searched */ + __fs32 fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */ + __fs32 fs_contigdirs;/*# of contiguously allocated dirs */ + __fs32 fs_csp; /* cg summary info buffer for fs_cs */ + __fs32 fs_maxcluster; + __fs32 fs_active;/* used by snapshots to track fs */ + __fs32 fs_old_cpc; /* cyl per cycle in postbl */ + __fs32 fs_maxbsize;/*maximum blocking factor permitted */ + __fs64 fs_sparecon64[17];/*old rotation block list head */ + __fs64 fs_sblockloc; /* byte offset of standard superblock */ struct ufs2_csum_total fs_cstotal;/*cylinder summary information*/ struct ufs_timeval fs_time; /* last time written */ - __s64 fs_size; /* number of blocks in fs */ - __s64 fs_dsize; /* number of data blocks in fs */ - __u64 fs_csaddr; /* blk addr of cyl grp summary area */ - __s64 fs_pendingblocks;/* blocks in process of being freed */ - __s32 fs_pendinginodes;/*inodes in process of being freed */ + __fs64 fs_size; /* number of blocks in fs */ + __fs64 fs_dsize; /* number of data blocks in fs */ + __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ + __fs64 fs_pendingblocks;/* blocks in process of being freed */ + __fs32 fs_pendinginodes;/*inodes in process of being freed */ } fs_u2; } fs_u11; union { struct { - __s32 fs_sparecon[53];/* reserved for future constants */ - __s32 fs_reclaim; - __s32 fs_sparecon2[1]; - __s32 fs_state; /* file system state time stamp */ - __u32 fs_qbmask[2]; /* ~usb_bmask */ - __u32 fs_qfmask[2]; /* ~usb_fmask */ + __fs32 fs_sparecon[53];/* reserved for future constants */ + __fs32 fs_reclaim; + __fs32 fs_sparecon2[1]; + __fs32 fs_state; /* file system state time stamp */ + __fs32 fs_qbmask[2]; /* ~usb_bmask */ + __fs32 fs_qfmask[2]; /* ~usb_fmask */ } fs_sun; struct { - __s32 fs_sparecon[53];/* reserved for future constants */ - __s32 fs_reclaim; - __s32 fs_sparecon2[1]; - __u32 fs_npsect; /* # sectors/track including spares */ - __u32 fs_qbmask[2]; /* ~usb_bmask */ - __u32 fs_qfmask[2]; /* ~usb_fmask */ + __fs32 fs_sparecon[53];/* reserved for future constants */ + __fs32 fs_reclaim; + __fs32 fs_sparecon2[1]; + __fs32 fs_npsect; /* # sectors/track including spares */ + __fs32 fs_qbmask[2]; /* ~usb_bmask */ + __fs32 fs_qfmask[2]; /* ~usb_fmask */ } fs_sunx86; struct { - __s32 fs_sparecon[50];/* reserved for future constants */ - __s32 fs_contigsumsize;/* size of cluster summary array */ - __s32 fs_maxsymlinklen;/* max length of an internal symlink */ - __s32 fs_inodefmt; /* format of on-disk inodes */ - __u32 fs_maxfilesize[2]; /* max representable file size */ - __u32 fs_qbmask[2]; /* ~usb_bmask */ - __u32 fs_qfmask[2]; /* ~usb_fmask */ - __s32 fs_state; /* file system state time stamp */ + __fs32 fs_sparecon[50];/* reserved for future constants */ + __fs32 fs_contigsumsize;/* size of cluster summary array */ + __fs32 fs_maxsymlinklen;/* max length of an internal symlink */ + __fs32 fs_inodefmt; /* format of on-disk inodes */ + __fs32 fs_maxfilesize[2]; /* max representable file size */ + __fs32 fs_qbmask[2]; /* ~usb_bmask */ + __fs32 fs_qfmask[2]; /* ~usb_fmask */ + __fs32 fs_state; /* file system state time stamp */ } fs_44; } fs_u2; - __s32 fs_postblformat; /* format of positional layout tables */ - __s32 fs_nrpos; /* number of rotational positions */ - __s32 fs_postbloff; /* (__s16) rotation block list head */ - __s32 fs_rotbloff; /* (__u8) blocks for each rotation */ - __s32 fs_magic; /* magic number */ + __fs32 fs_postblformat; /* format of positional layout tables */ + __fs32 fs_nrpos; /* number of rotational positions */ + __fs32 fs_postbloff; /* (__s16) rotation block list head */ + __fs32 fs_rotbloff; /* (__u8) blocks for each rotation */ + __fs32 fs_magic; /* magic number */ __u8 fs_space[1]; /* list of blocks for each rotation */ }; @@ -509,41 +519,41 @@ * size of this structure is 172 B */ struct ufs_cylinder_group { - __u32 cg_link; /* linked list of cyl groups */ - __u32 cg_magic; /* magic number */ - __u32 cg_time; /* time last written */ - __u32 cg_cgx; /* we are the cgx'th cylinder group */ - __u16 cg_ncyl; /* number of cyl's this cg */ - __u16 cg_niblk; /* number of inode blocks this cg */ - __u32 cg_ndblk; /* number of data blocks this cg */ + __fs32 cg_link; /* linked list of cyl groups */ + __fs32 cg_magic; /* magic number */ + __fs32 cg_time; /* time last written */ + __fs32 cg_cgx; /* we are the cgx'th cylinder group */ + __fs16 cg_ncyl; /* number of cyl's this cg */ + __fs16 cg_niblk; /* number of inode blocks this cg */ + __fs32 cg_ndblk; /* number of data blocks this cg */ struct ufs_csum cg_cs; /* cylinder summary information */ - __u32 cg_rotor; /* position of last used block */ - __u32 cg_frotor; /* position of last used frag */ - __u32 cg_irotor; /* position of last used inode */ - __u32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */ - __u32 cg_btotoff; /* (__u32) block totals per cylinder */ - __u32 cg_boff; /* (short) free block positions */ - __u32 cg_iusedoff; /* (char) used inode map */ - __u32 cg_freeoff; /* (u_char) free block map */ - __u32 cg_nextfreeoff; /* (u_char) next available space */ + __fs32 cg_rotor; /* position of last used block */ + __fs32 cg_frotor; /* position of last used frag */ + __fs32 cg_irotor; /* position of last used inode */ + __fs32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */ + __fs32 cg_btotoff; /* (__u32) block totals per cylinder */ + __fs32 cg_boff; /* (short) free block positions */ + __fs32 cg_iusedoff; /* (char) used inode map */ + __fs32 cg_freeoff; /* (u_char) free block map */ + __fs32 cg_nextfreeoff; /* (u_char) next available space */ union { struct { - __u32 cg_clustersumoff; /* (u_int32) counts of avail clusters */ - __u32 cg_clusteroff; /* (u_int8) free cluster map */ - __u32 cg_nclusterblks; /* number of clusters this cg */ - __u32 cg_sparecon[13]; /* reserved for future use */ + __fs32 cg_clustersumoff; /* (u_int32) counts of avail clusters */ + __fs32 cg_clusteroff; /* (u_int8) free cluster map */ + __fs32 cg_nclusterblks; /* number of clusters this cg */ + __fs32 cg_sparecon[13]; /* reserved for future use */ } cg_44; struct { - __u32 cg_clustersumoff;/* (u_int32) counts of avail clusters */ - __u32 cg_clusteroff; /* (u_int8) free cluster map */ - __u32 cg_nclusterblks;/* number of clusters this cg */ - __u32 cg_niblk; /* number of inode blocks this cg */ - __u32 cg_initediblk; /* last initialized inode */ - __u32 cg_sparecon32[3];/* reserved for future use */ - __u64 cg_time; /* time last written */ - __u64 cg_sparecon[3]; /* reserved for future use */ + __fs32 cg_clustersumoff;/* (u_int32) counts of avail clusters */ + __fs32 cg_clusteroff; /* (u_int8) free cluster map */ + __fs32 cg_nclusterblks;/* number of clusters this cg */ + __fs32 cg_niblk; /* number of inode blocks this cg */ + __fs32 cg_initediblk; /* last initialized inode */ + __fs32 cg_sparecon32[3];/* reserved for future use */ + __fs64 cg_time; /* time last written */ + __fs64 cg_sparecon[3]; /* reserved for future use */ } cg_u2; - __u32 cg_sparecon[16]; /* reserved for future use */ + __fs32 cg_sparecon[16]; /* reserved for future use */ } cg_u; __u8 cg_space[1]; /* space for cylinder group maps */ /* actually longer */ @@ -553,82 +563,82 @@ * structure of an on-disk inode */ struct ufs_inode { - __u16 ui_mode; /* 0x0 */ - __u16 ui_nlink; /* 0x2 */ + __fs16 ui_mode; /* 0x0 */ + __fs16 ui_nlink; /* 0x2 */ union { struct { - __u16 ui_suid; /* 0x4 */ - __u16 ui_sgid; /* 0x6 */ + __fs16 ui_suid; /* 0x4 */ + __fs16 ui_sgid; /* 0x6 */ } oldids; - __u32 ui_inumber; /* 0x4 lsf: inode number */ - __u32 ui_author; /* 0x4 GNU HURD: author */ + __fs32 ui_inumber; /* 0x4 lsf: inode number */ + __fs32 ui_author; /* 0x4 GNU HURD: author */ } ui_u1; - __u64 ui_size; /* 0x8 */ + __fs64 ui_size; /* 0x8 */ struct ufs_timeval ui_atime; /* 0x10 access */ struct ufs_timeval ui_mtime; /* 0x18 modification */ struct ufs_timeval ui_ctime; /* 0x20 creation */ union { struct { - __u32 ui_db[UFS_NDADDR];/* 0x28 data blocks */ - __u32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */ + __fs32 ui_db[UFS_NDADDR];/* 0x28 data blocks */ + __fs32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */ } ui_addr; __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ } ui_u2; - __u32 ui_flags; /* 0x64 immutable, append-only... */ - __u32 ui_blocks; /* 0x68 blocks in use */ - __u32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */ + __fs32 ui_flags; /* 0x64 immutable, append-only... */ + __fs32 ui_blocks; /* 0x68 blocks in use */ + __fs32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */ union { struct { - __u32 ui_shadow; /* 0x70 shadow inode with security data */ - __u32 ui_uid; /* 0x74 long EFT version of uid */ - __u32 ui_gid; /* 0x78 long EFT version of gid */ - __u32 ui_oeftflag; /* 0x7c reserved */ + __fs32 ui_shadow; /* 0x70 shadow inode with security data */ + __fs32 ui_uid; /* 0x74 long EFT version of uid */ + __fs32 ui_gid; /* 0x78 long EFT version of gid */ + __fs32 ui_oeftflag; /* 0x7c reserved */ } ui_sun; struct { - __u32 ui_uid; /* 0x70 File owner */ - __u32 ui_gid; /* 0x74 File group */ - __s32 ui_spare[2]; /* 0x78 reserved */ + __fs32 ui_uid; /* 0x70 File owner */ + __fs32 ui_gid; /* 0x74 File group */ + __fs32 ui_spare[2]; /* 0x78 reserved */ } ui_44; struct { - __u32 ui_uid; /* 0x70 */ - __u32 ui_gid; /* 0x74 */ - __u16 ui_modeh; /* 0x78 mode high bits */ - __u16 ui_spare; /* 0x7A unused */ - __u32 ui_trans; /* 0x7c filesystem translator */ + __fs32 ui_uid; /* 0x70 */ + __fs32 ui_gid; /* 0x74 */ + __fs16 ui_modeh; /* 0x78 mode high bits */ + __fs16 ui_spare; /* 0x7A unused */ + __fs32 ui_trans; /* 0x7c filesystem translator */ } ui_hurd; } ui_u3; }; #define UFS_NXADDR 2 /* External addresses in inode. */ struct ufs2_inode { - __u16 ui_mode; /* 0: IFMT, permissions; see below. */ - __s16 ui_nlink; /* 2: File link count. */ - __u32 ui_uid; /* 4: File owner. */ - __u32 ui_gid; /* 8: File group. */ - __u32 ui_blksize; /* 12: Inode blocksize. */ - __u64 ui_size; /* 16: File byte count. */ - __u64 ui_blocks; /* 24: Bytes actually held. */ + __fs16 ui_mode; /* 0: IFMT, permissions; see below. */ + __fs16 ui_nlink; /* 2: File link count. */ + __fs32 ui_uid; /* 4: File owner. */ + __fs32 ui_gid; /* 8: File group. */ + __fs32 ui_blksize; /* 12: Inode blocksize. */ + __fs64 ui_size; /* 16: File byte count. */ + __fs64 ui_blocks; /* 24: Bytes actually held. */ struct ufs_timeval ui_atime; /* 32: Last access time. */ struct ufs_timeval ui_mtime; /* 40: Last modified time. */ struct ufs_timeval ui_ctime; /* 48: Last inode change time. */ struct ufs_timeval ui_birthtime; /* 56: Inode creation time. */ - __s32 ui_mtimensec; /* 64: Last modified time. */ - __s32 ui_atimensec; /* 68: Last access time. */ - __s32 ui_ctimensec; /* 72: Last inode change time. */ - __s32 ui_birthnsec; /* 76: Inode creation time. */ - __s32 ui_gen; /* 80: Generation number. */ - __u32 ui_kernflags; /* 84: Kernel flags. */ - __u32 ui_flags; /* 88: Status flags (chflags). */ - __s32 ui_extsize; /* 92: External attributes block. */ - __s64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */ + __fs32 ui_mtimensec; /* 64: Last modified time. */ + __fs32 ui_atimensec; /* 68: Last access time. */ + __fs32 ui_ctimensec; /* 72: Last inode change time. */ + __fs32 ui_birthnsec; /* 76: Inode creation time. */ + __fs32 ui_gen; /* 80: Generation number. */ + __fs32 ui_kernflags; /* 84: Kernel flags. */ + __fs32 ui_flags; /* 88: Status flags (chflags). */ + __fs32 ui_extsize; /* 92: External attributes block. */ + __fs64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */ union { struct { - __s64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ - __s64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/ + __fs64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ + __fs64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/ } ui_addr; __u8 ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ } ui_u2; - __s64 ui_spare[3]; /* 232: Reserved; currently unused */ + __fs64 ui_spare[3]; /* 232: Reserved; currently unused */ }; @@ -752,60 +762,60 @@ * ufs_super_block_third 356 */ struct ufs_super_block_first { - __u32 fs_link; - __u32 fs_rlink; - __u32 fs_sblkno; - __u32 fs_cblkno; - __u32 fs_iblkno; - __u32 fs_dblkno; - __u32 fs_cgoffset; - __u32 fs_cgmask; - __u32 fs_time; - __u32 fs_size; - __u32 fs_dsize; - __u32 fs_ncg; - __u32 fs_bsize; - __u32 fs_fsize; - __u32 fs_frag; - __u32 fs_minfree; - __u32 fs_rotdelay; - __u32 fs_rps; - __u32 fs_bmask; - __u32 fs_fmask; - __u32 fs_bshift; - __u32 fs_fshift; - __u32 fs_maxcontig; - __u32 fs_maxbpg; - __u32 fs_fragshift; - __u32 fs_fsbtodb; - __u32 fs_sbsize; - __u32 fs_csmask; - __u32 fs_csshift; - __u32 fs_nindir; - __u32 fs_inopb; - __u32 fs_nspf; - __u32 fs_optim; + __fs32 fs_link; + __fs32 fs_rlink; + __fs32 fs_sblkno; + __fs32 fs_cblkno; + __fs32 fs_iblkno; + __fs32 fs_dblkno; + __fs32 fs_cgoffset; + __fs32 fs_cgmask; + __fs32 fs_time; + __fs32 fs_size; + __fs32 fs_dsize; + __fs32 fs_ncg; + __fs32 fs_bsize; + __fs32 fs_fsize; + __fs32 fs_frag; + __fs32 fs_minfree; + __fs32 fs_rotdelay; + __fs32 fs_rps; + __fs32 fs_bmask; + __fs32 fs_fmask; + __fs32 fs_bshift; + __fs32 fs_fshift; + __fs32 fs_maxcontig; + __fs32 fs_maxbpg; + __fs32 fs_fragshift; + __fs32 fs_fsbtodb; + __fs32 fs_sbsize; + __fs32 fs_csmask; + __fs32 fs_csshift; + __fs32 fs_nindir; + __fs32 fs_inopb; + __fs32 fs_nspf; + __fs32 fs_optim; union { struct { - __u32 fs_npsect; + __fs32 fs_npsect; } fs_sun; struct { - __s32 fs_state; + __fs32 fs_state; } fs_sunx86; } fs_u1; - __u32 fs_interleave; - __u32 fs_trackskew; - __u32 fs_id[2]; - __u32 fs_csaddr; - __u32 fs_cssize; - __u32 fs_cgsize; - __u32 fs_ntrak; - __u32 fs_nsect; - __u32 fs_spc; - __u32 fs_ncyl; - __u32 fs_cpg; - __u32 fs_ipg; - __u32 fs_fpg; + __fs32 fs_interleave; + __fs32 fs_trackskew; + __fs32 fs_id[2]; + __fs32 fs_csaddr; + __fs32 fs_cssize; + __fs32 fs_cgsize; + __fs32 fs_ntrak; + __fs32 fs_nsect; + __fs32 fs_spc; + __fs32 fs_ncyl; + __fs32 fs_cpg; + __fs32 fs_ipg; + __fs32 fs_fpg; struct ufs_csum fs_cstotal; __s8 fs_fmod; __s8 fs_clean; @@ -817,48 +827,48 @@ struct ufs_super_block_second { __s8 fs_fsmnt[212]; - __u32 fs_cgrotor; - __u32 fs_csp[UFS_MAXCSBUFS]; - __u32 fs_maxcluster; - __u32 fs_cpc; - __u16 fs_opostbl[82]; + __fs32 fs_cgrotor; + __fs32 fs_csp[UFS_MAXCSBUFS]; + __fs32 fs_maxcluster; + __fs32 fs_cpc; + __fs16 fs_opostbl[82]; }; struct ufs_super_block_third { - __u16 fs_opostbl[46]; + __fs16 fs_opostbl[46]; union { struct { - __s32 fs_sparecon[53];/* reserved for future constants */ - __s32 fs_reclaim; - __s32 fs_sparecon2[1]; - __s32 fs_state; /* file system state time stamp */ - __u32 fs_qbmask[2]; /* ~usb_bmask */ - __u32 fs_qfmask[2]; /* ~usb_fmask */ + __fs32 fs_sparecon[53];/* reserved for future constants */ + __fs32 fs_reclaim; + __fs32 fs_sparecon2[1]; + __fs32 fs_state; /* file system state time stamp */ + __fs32 fs_qbmask[2]; /* ~usb_bmask */ + __fs32 fs_qfmask[2]; /* ~usb_fmask */ } fs_sun; struct { - __s32 fs_sparecon[53];/* reserved for future constants */ - __s32 fs_reclaim; - __s32 fs_sparecon2[1]; - __u32 fs_npsect; /* # sectors/track including spares */ - __u32 fs_qbmask[2]; /* ~usb_bmask */ - __u32 fs_qfmask[2]; /* ~usb_fmask */ + __fs32 fs_sparecon[53];/* reserved for future constants */ + __fs32 fs_reclaim; + __fs32 fs_sparecon2[1]; + __fs32 fs_npsect; /* # sectors/track including spares */ + __fs32 fs_qbmask[2]; /* ~usb_bmask */ + __fs32 fs_qfmask[2]; /* ~usb_fmask */ } fs_sunx86; struct { - __s32 fs_sparecon[50];/* reserved for future constants */ - __s32 fs_contigsumsize;/* size of cluster summary array */ - __s32 fs_maxsymlinklen;/* max length of an internal symlink */ - __s32 fs_inodefmt; /* format of on-disk inodes */ - __u32 fs_maxfilesize[2]; /* max representable file size */ - __u32 fs_qbmask[2]; /* ~usb_bmask */ - __u32 fs_qfmask[2]; /* ~usb_fmask */ - __s32 fs_state; /* file system state time stamp */ + __fs32 fs_sparecon[50];/* reserved for future constants */ + __fs32 fs_contigsumsize;/* size of cluster summary array */ + __fs32 fs_maxsymlinklen;/* max length of an internal symlink */ + __fs32 fs_inodefmt; /* format of on-disk inodes */ + __fs32 fs_maxfilesize[2]; /* max representable file size */ + __fs32 fs_qbmask[2]; /* ~usb_bmask */ + __fs32 fs_qfmask[2]; /* ~usb_fmask */ + __fs32 fs_state; /* file system state time stamp */ } fs_44; } fs_u2; - __s32 fs_postblformat; - __s32 fs_nrpos; - __s32 fs_postbloff; - __s32 fs_rotbloff; - __s32 fs_magic; + __fs32 fs_postblformat; + __fs32 fs_nrpos; + __fs32 fs_postbloff; + __fs32 fs_rotbloff; + __fs32 fs_magic; __u8 fs_space[1]; }; @@ -867,7 +877,7 @@ /* balloc.c */ extern void ufs_free_fragments (struct inode *, unsigned, unsigned); extern void ufs_free_blocks (struct inode *, unsigned, unsigned); -extern unsigned ufs_new_fragments (struct inode *, u32 *, unsigned, unsigned, unsigned, int *); +extern unsigned ufs_new_fragments (struct inode *, __fs32 *, unsigned, unsigned, unsigned, int *); /* cylinder.c */ extern struct ufs_cg_private_info * ufs_load_cylinder (struct super_block *, unsigned); diff -Nru a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h --- a/include/linux/ufs_fs_i.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/ufs_fs_i.h 2004-10-06 19:37:47 -07:00 @@ -15,9 +15,9 @@ struct ufs_inode_info { union { - __u32 i_data[15]; + __fs32 i_data[15]; __u8 i_symlink[4*15]; - __u64 u2_i_data[15]; + __fs64 u2_i_data[15]; } i_u1; __u32 i_flags; __u32 i_gen; diff -Nru a/include/linux/umem.h b/include/linux/umem.h --- a/include/linux/umem.h 2004-10-06 19:37:46 -07:00 +++ b/include/linux/umem.h 2004-10-06 19:37:46 -07:00 @@ -110,19 +110,19 @@ #define DMA_WRITE_TO_HOST 1 struct mm_dma_desc { - u64 pci_addr; - u64 local_addr; - u32 transfer_size; + __le64 pci_addr; + __le64 local_addr; + __le32 transfer_size; u32 zero1; - u64 next_desc_addr; - u64 sem_addr; - u32 control_bits; + __le64 next_desc_addr; + __le64 sem_addr; + __le32 control_bits; u32 zero2; dma_addr_t data_dma_handle; /* Copy of the bits */ - u64 sem_control_bits; + __le64 sem_control_bits; } __attribute__((aligned(8))); #define PCI_VENDOR_ID_MICRO_MEMORY 0x1332 diff -Nru a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h --- a/include/linux/usb_ch9.h 2004-10-06 19:37:47 -07:00 +++ b/include/linux/usb_ch9.h 2004-10-06 19:37:47 -07:00 @@ -103,9 +103,9 @@ struct usb_ctrlrequest { __u8 bRequestType; __u8 bRequest; - __u16 wValue; - __u16 wIndex; - __u16 wLength; + __le16 wValue; + __le16 wIndex; + __le16 wLength; } __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ @@ -230,7 +230,7 @@ __u8 bLength; __u8 bDescriptorType; - __u16 wData[1]; /* UTF-16LE encoded */ + __le16 wData[1]; /* UTF-16LE encoded */ } __attribute__ ((packed)); /* note that "string" zero is special, it holds language codes that diff -Nru a/include/net/gen_stats.h b/include/net/gen_stats.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/net/gen_stats.h 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,45 @@ +#ifndef __NET_GEN_STATS_H +#define __NET_GEN_STATS_H + +#include +#include +#include +#include + +struct gnet_dump +{ + spinlock_t * lock; + struct sk_buff * skb; + struct rtattr * tail; + + /* Backward compatability */ + int compat_tc_stats; + int compat_xstats; + struct rtattr * xstats; + struct tc_stats tc_stats; +}; + +extern int gnet_stats_start_copy(struct sk_buff *skb, int type, + spinlock_t *lock, struct gnet_dump *d); + +extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, + int tc_stats_type,int xstats_type, + spinlock_t *lock, struct gnet_dump *d); + +extern int gnet_stats_copy_basic(struct gnet_dump *d, + struct gnet_stats_basic *b); +extern int gnet_stats_copy_rate_est(struct gnet_dump *d, + struct gnet_stats_rate_est *r); +extern int gnet_stats_copy_queue(struct gnet_dump *d, + struct gnet_stats_queue *q); +extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); + +extern int gnet_stats_finish_copy(struct gnet_dump *d); + +extern int gen_new_estimator(struct gnet_stats_basic *bstats, + struct gnet_stats_rate_est *rate_est, + spinlock_t *stats_lock, struct rtattr *opt); +extern void gen_kill_estimator(struct gnet_stats_basic *bstats, + struct gnet_stats_rate_est *rate_est); + +#endif diff -Nru a/include/net/inet_ecn.h b/include/net/inet_ecn.h --- a/include/net/inet_ecn.h 2004-10-06 19:37:47 -07:00 +++ b/include/net/inet_ecn.h 2004-10-06 19:37:47 -07:00 @@ -30,7 +30,8 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) { outer &= ~INET_ECN_MASK; - outer |= (inner & INET_ECN_MASK) ?: INET_ECN_ECT_0; + outer |= !INET_ECN_is_ce(inner) ? (inner & INET_ECN_MASK) : + INET_ECN_ECT_0; return outer; } diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h --- a/include/net/pkt_sched.h 2004-10-06 19:37:47 -07:00 +++ b/include/net/pkt_sched.h 2004-10-06 19:37:47 -07:00 @@ -376,7 +376,7 @@ extern int tcf_register_action(struct tc_action_ops *a); extern int tcf_unregister_action(struct tc_action_ops *a); extern void tcf_action_destroy(struct tc_action *a, int bind); -extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a); +extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res); extern int tcf_action_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind); extern int tcf_action_init_1(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind); extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); diff -Nru a/include/net/tcp.h b/include/net/tcp.h --- a/include/net/tcp.h 2004-10-06 19:37:46 -07:00 +++ b/include/net/tcp.h 2004-10-06 19:37:46 -07:00 @@ -609,6 +609,7 @@ extern int sysctl_tcp_bic_fast_convergence; extern int sysctl_tcp_bic_low_window; extern int sysctl_tcp_moderate_rcvbuf; +extern int sysctl_tcp_tso_win_divisor; extern atomic_t tcp_memory_allocated; extern atomic_t tcp_sockets_allocated; @@ -944,6 +945,7 @@ extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); extern void tcp_xmit_retransmit_queue(struct sock *); extern void tcp_simple_retransmit(struct sock *); +extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); extern void tcp_send_probe0(struct sock *); extern void tcp_send_partial(struct sock *); @@ -1150,8 +1152,6 @@ __u16 urg_ptr; /* Valid w/URG flags is set. */ __u32 ack_seq; /* Sequence number ACK'd */ - __u16 tso_factor; /* If > 1, TSO frame */ - __u16 tso_mss; /* MSS that FACTOR's in terms of*/ }; #define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0])) @@ -1163,7 +1163,13 @@ */ static inline int tcp_skb_pcount(struct sk_buff *skb) { - return TCP_SKB_CB(skb)->tso_factor; + return skb_shinfo(skb)->tso_segs; +} + +/* This is valid iff tcp_skb_pcount() > 1. */ +static inline int tcp_skb_mss(struct sk_buff *skb) +{ + return skb_shinfo(skb)->tso_size; } static inline void tcp_inc_pcount(tcp_pcount_t *count, struct sk_buff *skb) @@ -1438,7 +1444,7 @@ tcp_minshall_check(tp)))); } -extern void tcp_set_skb_tso_factor(struct sk_buff *, unsigned int); +extern void tcp_set_skb_tso_segs(struct sk_buff *, unsigned int); /* This checks if the data bearing packet SKB (usually sk->sk_send_head) * should be put on the wire right now. @@ -1446,11 +1452,11 @@ static __inline__ int tcp_snd_test(struct tcp_opt *tp, struct sk_buff *skb, unsigned cur_mss, int nonagle) { - int pkts = TCP_SKB_CB(skb)->tso_factor; + int pkts = tcp_skb_pcount(skb); if (!pkts) { - tcp_set_skb_tso_factor(skb, tp->mss_cache_std); - pkts = TCP_SKB_CB(skb)->tso_factor; + tcp_set_skb_tso_segs(skb, tp->mss_cache_std); + pkts = tcp_skb_pcount(skb); } /* RFC 1122 - section 4.2.3.4 diff -Nru a/include/pcmcia/ss.h b/include/pcmcia/ss.h --- a/include/pcmcia/ss.h 2004-10-06 19:37:47 -07:00 +++ b/include/pcmcia/ss.h 2004-10-06 19:37:47 -07:00 @@ -176,7 +176,7 @@ u_short lock_count; client_handle_t clients; pccard_mem_map cis_mem; - u_char *cis_virt; + void __iomem *cis_virt; struct config_t *config; struct { u_int AssignedIRQ; @@ -227,7 +227,7 @@ /* cardbus (32-bit) */ #ifdef CONFIG_CARDBUS struct resource * cb_cis_res; - u_char *cb_cis_virt; + void __iomem *cb_cis_virt; #endif /* socket device */ diff -Nru a/include/sound/asequencer.h b/include/sound/asequencer.h --- a/include/sound/asequencer.h 2004-10-06 19:37:47 -07:00 +++ b/include/sound/asequencer.h 2004-10-06 19:37:47 -07:00 @@ -640,7 +640,7 @@ * etc. if the queue is locked for other clients */ int owner; /* client id for owner of the queue */ - int locked:1; /* timing queue locked for other queues */ + unsigned locked:1; /* timing queue locked for other queues */ char name[64]; /* name of this queue */ unsigned int flags; /* flags */ char reserved[60]; /* for future use */ diff -Nru a/include/sound/pcm.h b/include/sound/pcm.h --- a/include/sound/pcm.h 2004-10-06 19:37:47 -07:00 +++ b/include/sound/pcm.h 2004-10-06 19:37:47 -07:00 @@ -384,7 +384,7 @@ snd_pcm_runtime_t *runtime; /* -- timer section -- */ snd_timer_t *timer; /* timer */ - int timer_running: 1; /* time is running */ + unsigned timer_running: 1; /* time is running */ spinlock_t timer_lock; /* -- next substream -- */ snd_pcm_substream_t *next; diff -Nru a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h --- a/include/sound/pcm_oss.h 2004-10-06 19:37:47 -07:00 +++ b/include/sound/pcm_oss.h 2004-10-06 19:37:47 -07:00 @@ -39,10 +39,10 @@ }; typedef struct _snd_pcm_oss_runtime { - int params: 1, /* format/parameter change */ - prepare: 1, /* need to prepare the operation */ - trigger: 1, /* trigger flag */ - sync_trigger: 1; /* sync trigger flag */ + unsigned params: 1, /* format/parameter change */ + prepare: 1, /* need to prepare the operation */ + trigger: 1, /* trigger flag */ + sync_trigger: 1; /* sync trigger flag */ int rate; /* requested rate */ int format; /* requested OSS format */ unsigned int channels; /* requested channels */ @@ -68,7 +68,7 @@ } snd_pcm_oss_file_t; typedef struct _snd_pcm_oss_substream { - int oss: 1; /* oss mode */ + unsigned oss: 1; /* oss mode */ snd_pcm_oss_setup_t *setup; /* active setup */ snd_pcm_oss_file_t *file; } snd_pcm_oss_substream_t; diff -Nru a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h --- a/include/sound/seq_kernel.h 2004-10-06 19:37:47 -07:00 +++ b/include/sound/seq_kernel.h 2004-10-06 19:37:48 -07:00 @@ -129,8 +129,8 @@ typedef struct { void *private_data; - int allow_input: 1, - allow_output: 1; + unsigned allow_input: 1, + allow_output: 1; /*...*/ } snd_seq_client_callback_t; diff -Nru a/kernel/cpu.c b/kernel/cpu.c --- a/kernel/cpu.c 2004-10-06 19:37:47 -07:00 +++ b/kernel/cpu.c 2004-10-06 19:37:47 -07:00 @@ -61,13 +61,13 @@ * cpu' with certain environment variables set. */ static int cpu_run_sbin_hotplug(unsigned int cpu, const char *action) { - char *argv[3], *envp[5], cpu_str[12], action_str[32]; + char *argv[3], *envp[6], cpu_str[12], action_str[32], devpath_str[40]; int i; sprintf(cpu_str, "CPU=%d", cpu); sprintf(action_str, "ACTION=%s", action); - /* FIXME: Add DEVPATH. --RR */ - + sprintf(devpath_str, "DEVPATH=devices/system/cpu/cpu%d", cpu); + i = 0; argv[i++] = hotplug_path; argv[i++] = "cpu"; @@ -79,6 +79,7 @@ envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; envp[i++] = cpu_str; envp[i++] = action_str; + envp[i++] = devpath_str; envp[i] = NULL; return call_usermodehelper(argv[0], argv, envp, 0); diff -Nru a/kernel/kprobes.c b/kernel/kprobes.c --- a/kernel/kprobes.c 2004-10-06 19:37:48 -07:00 +++ b/kernel/kprobes.c 2004-10-06 19:37:48 -07:00 @@ -25,6 +25,8 @@ * hlists and exceptions notifier as suggested by Andi Kleen. * 2004-July Suparna Bhattacharya added jumper probes * interface to access function arguments. + * 2004-Sep Prasanna S Panchamukhi Changed Kprobes + * exceptions notifier to be first on the priority list. */ #include #include @@ -108,6 +110,7 @@ static struct notifier_block kprobe_exceptions_nb = { .notifier_call = kprobe_exceptions_notify, + .priority = 0x7fffffff /* we need to notified first */ }; int register_jprobe(struct jprobe *jp) diff -Nru a/kernel/power/swsusp.c b/kernel/power/swsusp.c --- a/kernel/power/swsusp.c 2004-10-06 19:37:47 -07:00 +++ b/kernel/power/swsusp.c 2004-10-06 19:37:47 -07:00 @@ -856,7 +856,9 @@ local_irq_disable(); save_processor_state(); error = swsusp_arch_suspend(); + /* Restore control flow magically appears here */ restore_processor_state(); + restore_highmem(); local_irq_enable(); return error; } @@ -876,8 +878,13 @@ { int error; local_irq_disable(); + /* We'll ignore saved state, but this gets preempt count (etc) right */ save_processor_state(); error = swsusp_arch_resume(); + /* Code below is only ever reached in case of failure. Otherwise + * execution continues at place where swsusp_arch_suspend was called + */ + BUG_ON(!error); restore_processor_state(); restore_highmem(); local_irq_enable(); diff -Nru a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c 2004-10-06 19:37:47 -07:00 +++ b/kernel/sched.c 2004-10-06 19:37:47 -07:00 @@ -180,7 +180,8 @@ else return SCALE_PRIO(DEF_TIMESLICE, p->static_prio); } -#define task_hot(p, now, sd) ((now) - (p)->timestamp < (sd)->cache_hot_time) +#define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran) \ + < (long long) (sd)->cache_hot_time) enum idle_type { @@ -2764,7 +2765,7 @@ if (!(HIGH_CREDIT(prev) || LOW_CREDIT(prev))) prev->interactive_credit--; } - prev->timestamp = now; + prev->timestamp = prev->last_ran = now; sched_info_switch(prev, next); if (likely(prev != next)) { diff -Nru a/kernel/timer.c b/kernel/timer.c --- a/kernel/timer.c 2004-10-06 19:37:47 -07:00 +++ b/kernel/timer.c 2004-10-06 19:37:47 -07:00 @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef CONFIG_TIME_INTERPOLATION static void time_interpolator_update(long delta_nsec); @@ -1624,13 +1625,13 @@ */ unsigned long msleep_interruptible(unsigned int msecs) { - unsigned long timeout = msecs_to_jiffies(msecs); + unsigned long timeout = msecs_to_jiffies(msecs); - while (timeout && !signal_pending(current)) { - set_current_state(TASK_INTERRUPTIBLE); - timeout = schedule_timeout(timeout); - } - return jiffies_to_msecs(timeout); + while (timeout && !signal_pending(current)) { + set_current_state(TASK_INTERRUPTIBLE); + timeout = schedule_timeout(timeout); + } + return jiffies_to_msecs(timeout); } EXPORT_SYMBOL(msleep_interruptible); diff -Nru a/mm/mlock.c b/mm/mlock.c --- a/mm/mlock.c 2004-10-06 19:37:46 -07:00 +++ b/mm/mlock.c 2004-10-06 19:37:46 -07:00 @@ -60,8 +60,6 @@ struct vm_area_struct * vma, * next; int error; - if (on && !can_do_mlock()) - return -EPERM; len = PAGE_ALIGN(len); end = start + len; if (end < start) @@ -107,6 +105,9 @@ unsigned long lock_limit; int error = -ENOMEM; + if (!can_do_mlock()) + return -EPERM; + down_write(¤t->mm->mmap_sem); len = PAGE_ALIGN(len + (start & ~PAGE_MASK)); start &= PAGE_MASK; @@ -118,7 +119,7 @@ lock_limit >>= PAGE_SHIFT; /* check against resource limits */ - if ( (locked <= lock_limit) || capable(CAP_IPC_LOCK)) + if ((locked <= lock_limit) || capable(CAP_IPC_LOCK)) error = do_mlock(start, len, 1); up_write(¤t->mm->mmap_sem); return error; @@ -138,19 +139,15 @@ static int do_mlockall(int flags) { - int error; - unsigned int def_flags; struct vm_area_struct * vma; + unsigned int def_flags = 0; - if (!can_do_mlock()) - return -EPERM; - - def_flags = 0; if (flags & MCL_FUTURE) def_flags = VM_LOCKED; current->mm->def_flags = def_flags; + if (flags == MCL_FUTURE) + goto out; - error = 0; for (vma = current->mm->mmap; vma ; vma = vma->vm_next) { unsigned int newflags; @@ -161,7 +158,8 @@ /* Ignore errors */ mlock_fixup(vma, vma->vm_start, vma->vm_end, newflags); } - return error; +out: + return 0; } asmlinkage long sys_mlockall(int flags) @@ -169,18 +167,24 @@ unsigned long lock_limit; int ret = -EINVAL; - down_write(¤t->mm->mmap_sem); if (!flags || (flags & ~(MCL_CURRENT | MCL_FUTURE))) goto out; + ret = -EPERM; + if (!can_do_mlock()) + goto out; + + down_write(¤t->mm->mmap_sem); + lock_limit = current->rlim[RLIMIT_MEMLOCK].rlim_cur; lock_limit >>= PAGE_SHIFT; ret = -ENOMEM; - if ((current->mm->total_vm <= lock_limit) || capable(CAP_IPC_LOCK)) + if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) || + capable(CAP_IPC_LOCK)) ret = do_mlockall(flags); -out: up_write(¤t->mm->mmap_sem); +out: return ret; } diff -Nru a/mm/mmap.c b/mm/mmap.c --- a/mm/mmap.c 2004-10-06 19:37:47 -07:00 +++ b/mm/mmap.c 2004-10-06 19:37:47 -07:00 @@ -54,7 +54,7 @@ __S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111 }; -int sysctl_overcommit_memory = 0; /* default is heuristic overcommit */ +int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ int sysctl_overcommit_ratio = 50; /* default is 50% */ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; atomic_t vm_committed_space = ATOMIC_INIT(0); @@ -773,13 +773,6 @@ int accountable = 1; unsigned long charged = 0; - /* - * Does the application expect PROT_READ to imply PROT_EXEC: - */ - if (unlikely((prot & PROT_READ) && - (current->personality & READ_IMPLIES_EXEC))) - prot |= PROT_EXEC; - if (file) { if (is_file_hugepages(file)) accountable = 0; @@ -791,6 +784,15 @@ (file->f_vfsmnt->mnt_flags & MNT_NOEXEC)) return -EPERM; } + /* + * Does the application expect PROT_READ to imply PROT_EXEC? + * + * (the exception is when the underlying filesystem is noexec + * mounted, in which case we dont add PROT_EXEC.) + */ + if ((prot & PROT_READ) && (current->personality & READ_IMPLIES_EXEC)) + if (!(file && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))) + prot |= PROT_EXEC; if (!len) return addr; @@ -907,7 +909,7 @@ return -ENOMEM; if (accountable && (!(flags & MAP_NORESERVE) || - sysctl_overcommit_memory > 1)) { + sysctl_overcommit_memory == OVERCOMMIT_NEVER)) { if (vm_flags & VM_SHARED) { /* Check memory availability in shmem_file_setup? */ vm_flags |= VM_ACCOUNT; diff -Nru a/mm/nommu.c b/mm/nommu.c --- a/mm/nommu.c 2004-10-06 19:37:47 -07:00 +++ b/mm/nommu.c 2004-10-06 19:37:47 -07:00 @@ -30,7 +30,7 @@ unsigned long num_physpages; unsigned long askedalloc, realalloc; atomic_t vm_committed_space = ATOMIC_INIT(0); -int sysctl_overcommit_memory; /* default is heuristic overcommit */ +int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ int sysctl_overcommit_ratio = 50; /* default is 50% */ int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT; diff -Nru a/mm/slab.c b/mm/slab.c --- a/mm/slab.c 2004-10-06 19:37:48 -07:00 +++ b/mm/slab.c 2004-10-06 19:37:48 -07:00 @@ -2435,8 +2435,7 @@ /** * __alloc_percpu - allocate one copy of the object for every present * cpu in the system, zeroing them. - * Objects should be dereferenced using per_cpu_ptr/get_cpu_ptr - * macros only. + * Objects should be dereferenced using the per_cpu_ptr macro only. * * @size: how many bytes of memory are required. * @align: the alignment, which can't be greater than SMP_CACHE_BYTES. diff -Nru a/mm/vmscan.c b/mm/vmscan.c --- a/mm/vmscan.c 2004-10-06 19:37:46 -07:00 +++ b/mm/vmscan.c 2004-10-06 19:37:46 -07:00 @@ -968,12 +968,16 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages) { int to_free = nr_pages; + int all_zones_ok; int priority; int i; - int total_scanned = 0, total_reclaimed = 0; + int total_scanned, total_reclaimed; struct reclaim_state *reclaim_state = current->reclaim_state; struct scan_control sc; +loop_again: + total_scanned = 0; + total_reclaimed = 0; sc.gfp_mask = GFP_KERNEL; sc.may_writepage = 0; sc.nr_mapped = read_page_state(nr_mapped); @@ -987,10 +991,11 @@ } for (priority = DEF_PRIORITY; priority >= 0; priority--) { - int all_zones_ok = 1; int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */ unsigned long lru_pages = 0; + all_zones_ok = 1; + if (nr_pages == 0) { /* * Scan in the highmem->dma direction for the highest @@ -1072,6 +1077,15 @@ */ if (total_scanned && priority < DEF_PRIORITY - 2) blk_congestion_wait(WRITE, HZ/10); + + /* + * We do this so kswapd doesn't build up large priorities for + * example when it is freeing in parallel with allocators. It + * matches the direct reclaim path behaviour in terms of impact + * on zone->*_priority. + */ + if (total_reclaimed >= SWAP_CLUSTER_MAX) + break; } out: for (i = 0; i < pgdat->nr_zones; i++) { @@ -1079,6 +1093,9 @@ zone->prev_priority = zone->temp_priority; } + if (!all_zones_ok) + goto loop_again; + return total_reclaimed; } diff -Nru a/net/8021q/vlan.c b/net/8021q/vlan.c --- a/net/8021q/vlan.c 2004-10-06 19:37:47 -07:00 +++ b/net/8021q/vlan.c 2004-10-06 19:37:47 -07:00 @@ -537,7 +537,7 @@ out_free_unregister: unregister_netdev(new_dev); - goto out_put_dev; + goto out_unlock; out_free_newdev: free_netdev(new_dev); diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c 2004-10-06 19:37:48 -07:00 +++ b/net/atm/clip.c 2004-10-06 19:37:48 -07:00 @@ -984,19 +984,7 @@ static int __init atm_clip_init(void) { - /* we should use neigh_table_init() */ - clip_tbl.lock = RW_LOCK_UNLOCKED; - clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, - clip_tbl.entry_size, 0, SLAB_HWCACHE_ALIGN, NULL, NULL); - - if (!clip_tbl.kmem_cachep) - return -ENOMEM; - - /* so neigh_ifdown() doesn't complain */ - clip_tbl.proxy_timer.data = 0; - clip_tbl.proxy_timer.function = NULL; - init_timer(&clip_tbl.proxy_timer); - skb_queue_head_init(&clip_tbl.proxy_queue); + neigh_table_init(&clip_tbl); clip_tbl_hook = &clip_tbl; register_atm_ioctl(&clip_ioctl_ops); @@ -1022,7 +1010,18 @@ deregister_atm_ioctl(&clip_ioctl_ops); + /* First, stop the idle timer, so it stops banging + * on the table. + */ + if (start_timer == 0) + del_timer(&idle_timer); + + /* Next, purge the table, so that the device + * unregister loop below does not hang due to + * device references remaining in the table. + */ neigh_ifdown(&clip_tbl, NULL); + dev = clip_devs; while (dev) { next = PRIV(dev)->next; @@ -1030,9 +1029,9 @@ free_netdev(dev); dev = next; } - if (start_timer == 0) del_timer(&idle_timer); - kmem_cache_destroy(clip_tbl.kmem_cachep); + /* Now it is safe to fully shutdown whole table. */ + neigh_table_clear(&clip_tbl); clip_tbl_hook = NULL; } diff -Nru a/net/core/Makefile b/net/core/Makefile --- a/net/core/Makefile 2004-10-06 19:37:47 -07:00 +++ b/net/core/Makefile 2004-10-06 19:37:47 -07:00 @@ -2,7 +2,7 @@ # Makefile for the Linux networking core. # -obj-y := sock.o skbuff.o iovec.o datagram.o stream.o scm.o +obj-y := sock.o skbuff.o iovec.o datagram.o stream.o scm.o gen_stats.o gen_estimator.o obj-$(CONFIG_SYSCTL) += sysctl_net_core.o diff -Nru a/net/core/gen_estimator.c b/net/core/gen_estimator.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/net/core/gen_estimator.c 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,204 @@ +/* + * net/sched/gen_estimator.c Simple rate estimator. + * + * 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. + * + * Authors: Alexey Kuznetsov, + * + * Changes: + * Jamal Hadi Salim - moved it to net/core and reshulfed + * names to make it usable in general net subsystem. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + This code is NOT intended to be used for statistics collection, + its purpose is to provide a base for statistical multiplexing + for controlled load service. + If you need only statistics, run a user level daemon which + periodically reads byte counters. + + Unfortunately, rate estimation is not a very easy task. + F.e. I did not find a simple way to estimate the current peak rate + and even failed to formulate the problem 8)8) + + So I preferred not to built an estimator into the scheduler, + but run this task separately. + Ideally, it should be kernel thread(s), but for now it runs + from timers, which puts apparent top bounds on the number of rated + flows, has minimal overhead on small, but is enough + to handle controlled load service, sets of aggregates. + + We measure rate over A=(1<next) { + u64 nbytes; + u32 npackets; + u32 rate; + + spin_lock(e->stats_lock); + nbytes = e->bstats->bytes; + npackets = e->bstats->packets; + rate = (nbytes - e->last_bytes)<<(7 - idx); + e->last_bytes = nbytes; + e->avbps += ((long)rate - (long)e->avbps) >> e->ewma_log; + e->rate_est->bps = (e->avbps+0xF)>>5; + + rate = (npackets - e->last_packets)<<(12 - idx); + e->last_packets = npackets; + e->avpps += ((long)rate - (long)e->avpps) >> e->ewma_log; + e->rate_est->pps = (e->avpps+0x1FF)>>10; + spin_unlock(e->stats_lock); + } + + mod_timer(&elist[idx].timer, jiffies + ((HZ<interval < -2 || parm->interval > 3) + return -EINVAL; + + est = kmalloc(sizeof(*est), GFP_KERNEL); + if (est == NULL) + return -ENOBUFS; + + memset(est, 0, sizeof(*est)); + est->interval = parm->interval + 2; + est->bstats = bstats; + est->rate_est = rate_est; + est->stats_lock = stats_lock; + est->ewma_log = parm->ewma_log; + est->last_bytes = bstats->bytes; + est->avbps = rate_est->bps<<5; + est->last_packets = bstats->packets; + est->avpps = rate_est->pps<<10; + + est->next = elist[est->interval].list; + if (est->next == NULL) { + init_timer(&elist[est->interval].timer); + elist[est->interval].timer.data = est->interval; + elist[est->interval].timer.expires = jiffies + ((HZ<interval)/4); + elist[est->interval].timer.function = est_timer; + add_timer(&elist[est->interval].timer); + } + write_lock_bh(&est_lock); + elist[est->interval].list = est; + write_unlock_bh(&est_lock); + return 0; +} + +void gen_kill_estimator(struct gnet_stats_basic *bstats, + struct gnet_stats_rate_est *rate_est) +{ + int idx; + struct gen_estimator *est, **pest; + + for (idx=0; idx <= EST_MAX_INTERVAL; idx++) { + int killed = 0; + pest = &elist[idx].list; + while ((est=*pest) != NULL) { + if (est->rate_est != rate_est || est->bstats != bstats) { + pest = &est->next; + continue; + } + + write_lock_bh(&est_lock); + *pest = est->next; + write_unlock_bh(&est_lock); + + kfree(est); + killed++; + } + if (killed && elist[idx].list == NULL) + del_timer(&elist[idx].timer); + } +} + +EXPORT_SYMBOL(gen_kill_estimator); +EXPORT_SYMBOL(gen_new_estimator); diff -Nru a/net/core/gen_stats.c b/net/core/gen_stats.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/net/core/gen_stats.c 2004-10-06 19:37:48 -07:00 @@ -0,0 +1,132 @@ +/* + * net/core/gen_stats.c + * + * 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. + * + * Authors: Thomas Graf + * Jamal Hadi Salim + * Alexey Kuznetsov, + * + * See Documentation/networking/gen_stats.txt + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +static inline int +gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size) +{ + RTA_PUT(d->skb, type, size, buf); + return 0; + +rtattr_failure: + spin_unlock_bh(d->lock); + return -1; +} + +int +gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, + int xstats_type, spinlock_t *lock, struct gnet_dump *d) +{ + spin_lock_bh(lock); + d->lock = lock; + d->tail = (struct rtattr *) skb->tail; + d->skb = skb; + d->compat_tc_stats = tc_stats_type; + d->compat_xstats = xstats_type; + d->xstats = NULL; + + if (d->compat_tc_stats) + memset(&d->tc_stats, 0, sizeof(d->tc_stats)); + + return gnet_stats_copy(d, type, NULL, 0); +} + +int +gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock, + struct gnet_dump *d) +{ + return gnet_stats_start_copy_compat(skb, type, 0, 0, lock, d); +} + + +int +gnet_stats_copy_basic(struct gnet_dump *d, struct gnet_stats_basic *b) +{ + if (d->compat_tc_stats) { + d->tc_stats.bytes = b->bytes; + d->tc_stats.packets = b->packets; + } + + return gnet_stats_copy(d, TCA_STATS_BASIC, b, sizeof(*b)); +} + +int +gnet_stats_copy_rate_est(struct gnet_dump *d, struct gnet_stats_rate_est *r) +{ + if (d->compat_tc_stats) { + d->tc_stats.bps = r->bps; + d->tc_stats.pps = r->pps; + } + + return gnet_stats_copy(d, TCA_STATS_RATE_EST, r, sizeof(*r)); +} + +int +gnet_stats_copy_queue(struct gnet_dump *d, struct gnet_stats_queue *q) +{ + if (d->compat_tc_stats) { + d->tc_stats.drops = q->drops; + d->tc_stats.qlen = q->qlen; + d->tc_stats.backlog = q->backlog; + d->tc_stats.overlimits = q->overlimits; + } + + return gnet_stats_copy(d, TCA_STATS_QUEUE, q, sizeof(*q)); +} + +int +gnet_stats_copy_app(struct gnet_dump *d, void *st, int len) +{ + if (d->compat_xstats) + d->xstats = (struct rtattr *) d->skb->tail; + return gnet_stats_copy(d, TCA_STATS_APP, st, len); +} + +int +gnet_stats_finish_copy(struct gnet_dump *d) +{ + d->tail->rta_len = d->skb->tail - (u8 *) d->tail; + + if (d->compat_tc_stats) + if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats, + sizeof(d->tc_stats)) < 0) + return -1; + + if (d->compat_xstats && d->xstats) { + if (gnet_stats_copy(d, d->compat_xstats, RTA_DATA(d->xstats), + RTA_PAYLOAD(d->xstats)) < 0) + return -1; + } + + spin_unlock_bh(d->lock); + return 0; +} + + +EXPORT_SYMBOL(gnet_stats_start_copy); +EXPORT_SYMBOL(gnet_stats_copy_basic); +EXPORT_SYMBOL(gnet_stats_copy_rate_est); +EXPORT_SYMBOL(gnet_stats_copy_queue); +EXPORT_SYMBOL(gnet_stats_copy_app); +EXPORT_SYMBOL(gnet_stats_finish_copy); diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c --- a/net/core/neighbour.c 2004-10-06 19:37:46 -07:00 +++ b/net/core/neighbour.c 2004-10-06 19:37:46 -07:00 @@ -406,12 +406,6 @@ goto out; } - if (tbl->entries > (tbl->hash_mask + 1)) { - write_lock_bh(&tbl->lock); - neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); - write_unlock_bh(&tbl->lock); - } - memcpy(n->primary_key, pkey, key_len); n->dev = dev; dev_hold(dev); @@ -433,6 +427,9 @@ write_lock_bh(&tbl->lock); + if (tbl->entries > (tbl->hash_mask + 1)) + neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); + hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; if (n->parms->dead) { @@ -496,8 +493,12 @@ memcpy(n->key, pkey, key_len); n->dev = dev; + if (dev) + dev_hold(dev); if (tbl->pconstructor && tbl->pconstructor(n)) { + if (dev) + dev_put(dev); kfree(n); n = NULL; goto out; @@ -532,6 +533,8 @@ write_unlock_bh(&tbl->lock); if (tbl->pdestructor) tbl->pdestructor(n); + if (n->dev) + dev_put(n->dev); kfree(n); return 0; } @@ -552,6 +555,8 @@ *np = n->next; if (tbl->pdestructor) tbl->pdestructor(n); + if (n->dev) + dev_put(n->dev); kfree(n); continue; } @@ -805,9 +810,15 @@ add_timer(&neigh->timer); } if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) { + struct sk_buff *skb = skb_peek(&neigh->arp_queue); + /* keep skb alive even if arp_queue overflows */ + if (skb) + skb_get(skb); write_unlock(&neigh->lock); - neigh->ops->solicit(neigh, skb_peek(&neigh->arp_queue)); + neigh->ops->solicit(neigh, skb); atomic_inc(&neigh->probes); + if (skb) + kfree_skb(skb); } else { out: write_unlock(&neigh->lock); diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c --- a/net/ipv4/af_inet.c 2004-10-06 19:37:46 -07:00 +++ b/net/ipv4/af_inet.c 2004-10-06 19:37:46 -07:00 @@ -312,7 +312,6 @@ sk_set_owner(sk, THIS_MODULE); sk->sk_destruct = inet_sock_destruct; - sk->sk_zapped = 0; sk->sk_family = PF_INET; sk->sk_protocol = protocol; sk->sk_backlog_rcv = sk->sk_prot->backlog_rcv; diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c --- a/net/ipv4/arp.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/arp.c 2004-10-06 19:37:47 -07:00 @@ -1005,8 +1005,26 @@ if (!dev) return -EINVAL; } - if (r->arp_ha.sa_family != dev->type) - return -EINVAL; + switch (dev->type) { +#ifdef CONFIG_FDDI + case ARPHRD_FDDI: + /* + * According to RFC 1390, FDDI devices should accept ARP + * hardware types of 1 (Ethernet). However, to be more + * robust, we'll accept hardware types of either 1 (Ethernet) + * or 6 (IEEE 802.2). + */ + if (r->arp_ha.sa_family != ARPHRD_FDDI && + r->arp_ha.sa_family != ARPHRD_ETHER && + r->arp_ha.sa_family != ARPHRD_IEEE802) + return -EINVAL; + break; +#endif + default: + if (r->arp_ha.sa_family != dev->type) + return -EINVAL; + break; + } neigh = __neigh_lookup_errno(&arp_tbl, &ip, dev); err = PTR_ERR(neigh); diff -Nru a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c --- a/net/ipv4/ip_gre.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/ip_gre.c 2004-10-06 19:37:47 -07:00 @@ -1250,7 +1250,7 @@ static int __init ipgre_init(void) { - int err = -EINVAL; + int err; printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); @@ -1263,18 +1263,19 @@ ipgre_tunnel_setup); if (!ipgre_fb_tunnel_dev) { err = -ENOMEM; - goto fail; + goto err1; } ipgre_fb_tunnel_dev->init = ipgre_fb_tunnel_init; if ((err = register_netdev(ipgre_fb_tunnel_dev))) - goto fail; + goto err2; out: return err; -fail: - inet_del_protocol(&ipgre_protocol, IPPROTO_GRE); +err2: free_netdev(ipgre_fb_tunnel_dev); +err1: + inet_del_protocol(&ipgre_protocol, IPPROTO_GRE); goto out; } diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c 2004-10-06 19:37:48 -07:00 +++ b/net/ipv4/ip_output.c 2004-10-06 19:37:48 -07:00 @@ -305,7 +305,6 @@ struct ip_options *opt = inet->opt; struct rtable *rt; struct iphdr *iph; - u32 mtu; /* Skip all of this if the packet is already routed, * f.e. by something like SCTP. @@ -366,21 +365,9 @@ skb->nh.iph = iph; /* Transport layer set skb->h.foo itself. */ - if(opt && opt->optlen) { + if (opt && opt->optlen) { iph->ihl += opt->optlen >> 2; ip_options_build(skb, opt, inet->daddr, rt, 0); - } - - mtu = dst_pmtu(&rt->u.dst); - if (skb->len > mtu && (sk->sk_route_caps & NETIF_F_TSO)) { - unsigned int hlen; - - /* Hack zone: all this must be done by TCP. */ - hlen = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); - skb_shinfo(skb)->tso_size = mtu - hlen; - skb_shinfo(skb)->tso_segs = - (skb->len - hlen + skb_shinfo(skb)->tso_size - 1)/ - skb_shinfo(skb)->tso_size - 1; } ip_select_ident_more(iph, &rt->u.dst, sk, skb_shinfo(skb)->tso_segs); diff -Nru a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c --- a/net/ipv4/ipconfig.c 2004-10-06 19:37:46 -07:00 +++ b/net/ipv4/ipconfig.c 2004-10-06 19:37:46 -07:00 @@ -720,6 +720,8 @@ b->htype = dev->type; else if (dev->type == ARPHRD_IEEE802_TR) /* fix for token ring */ b->htype = ARPHRD_IEEE802; + else if (dev->type == ARPHRD_FDDI) + b->htype = ARPHRD_ETHER; else { printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name); b->htype = dev->type; /* can cause undefined behavior */ diff -Nru a/net/ipv4/ipip.c b/net/ipv4/ipip.c --- a/net/ipv4/ipip.c 2004-10-06 19:37:48 -07:00 +++ b/net/ipv4/ipip.c 2004-10-06 19:37:48 -07:00 @@ -246,7 +246,6 @@ nt = dev->priv; SET_MODULE_OWNER(dev); dev->init = ipip_tunnel_init; - dev->destructor = free_netdev; nt->parms = *parms; if (register_netdevice(dev) < 0) { @@ -784,6 +783,7 @@ dev->get_stats = ipip_tunnel_get_stats; dev->do_ioctl = ipip_tunnel_ioctl; dev->change_mtu = ipip_tunnel_change_mtu; + dev->destructor = free_netdev; dev->type = ARPHRD_TUNNEL; dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); @@ -876,18 +876,19 @@ ipip_tunnel_setup); if (!ipip_fb_tunnel_dev) { err = -ENOMEM; - goto fail; + goto err1; } ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init; if ((err = register_netdev(ipip_fb_tunnel_dev))) - goto fail; + goto err2; out: return err; - fail: - xfrm4_tunnel_deregister(&ipip_handler); + err2: free_netdev(ipip_fb_tunnel_dev); + err1: + xfrm4_tunnel_deregister(&ipip_handler); goto out; } diff -Nru a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c --- a/net/ipv4/ipvs/ip_vs_sync.c 2004-10-06 19:37:46 -07:00 +++ b/net/ipv4/ipvs/ip_vs_sync.c 2004-10-06 19:37:46 -07:00 @@ -16,6 +16,7 @@ * Alexandre Cassen : Added master & backup support at a time. * Alexandre Cassen : Added SyncID support for incoming sync * messages filtering. + * Justin Ossevoort : Fix endian problem on sync message size. */ #include @@ -279,6 +280,9 @@ char *p; int i; + /* Convert size back to host byte order */ + m->size = ntohs(m->size); + if (buflen != m->size) { IP_VS_ERR("bogus message\n"); return; @@ -569,6 +573,19 @@ return len; } +static void +ip_vs_send_sync_msg(struct socket *sock, struct ip_vs_sync_mesg *msg) +{ + int msize; + + msize = msg->size; + + /* Put size in network byte order */ + msg->size = htons(msg->size); + + if (ip_vs_send_async(sock, (char *)msg, msize) != msize) + IP_VS_ERR("ip_vs_send_async error\n"); +} static int ip_vs_receive(struct socket *sock, char *buffer, const size_t buflen) @@ -605,7 +622,6 @@ { struct socket *sock; struct ip_vs_sync_buff *sb; - struct ip_vs_sync_mesg *m; /* create the sending multicast socket */ sock = make_send_sock(); @@ -618,19 +634,13 @@ for (;;) { while ((sb=sb_dequeue())) { - m = sb->mesg; - if (ip_vs_send_async(sock, (char *)m, - m->size) != m->size) - IP_VS_ERR("ip_vs_send_async error\n"); + ip_vs_send_sync_msg(sock, sb->mesg); ip_vs_sync_buff_release(sb); } /* check if entries stay in curr_sb for 2 seconds */ if ((sb = get_curr_sync_buff(2*HZ))) { - m = sb->mesg; - if (ip_vs_send_async(sock, (char *)m, - m->size) != m->size) - IP_VS_ERR("ip_vs_send_async error\n"); + ip_vs_send_sync_msg(sock, sb->mesg); ip_vs_sync_buff_release(sb); } diff -Nru a/net/ipv4/netfilter/ip_nat_helper.c b/net/ipv4/netfilter/ip_nat_helper.c --- a/net/ipv4/netfilter/ip_nat_helper.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/netfilter/ip_nat_helper.c 2004-10-06 19:37:47 -07:00 @@ -347,7 +347,7 @@ return 1; } -/* TCP sequence number adjustment. Returns true or false. */ +/* TCP sequence number adjustment. Returns 1 on success, 0 on failure */ int ip_nat_seq_adjust(struct sk_buff **pskb, struct ip_conntrack *ct, @@ -396,7 +396,12 @@ tcph->seq = newseq; tcph->ack_seq = newack; - return ip_nat_sack_adjust(pskb, tcph, ct, ctinfo); + if (!ip_nat_sack_adjust(pskb, tcph, ct, ctinfo)) + return 0; + + ip_conntrack_tcp_update(*pskb, ct, dir); + + return 1; } static inline int diff -Nru a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c --- a/net/ipv4/sysctl_net_ipv4.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/sysctl_net_ipv4.c 2004-10-06 19:37:47 -07:00 @@ -674,6 +674,14 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, + { + .ctl_name = NET_TCP_TSO_WIN_DIVISOR, + .procname = "tcp_tso_win_divisor", + .data = &sysctl_tcp_tso_win_divisor, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, { .ctl_name = 0 } }; diff -Nru a/net/ipv4/tcp.c b/net/ipv4/tcp.c --- a/net/ipv4/tcp.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/tcp.c 2004-10-06 19:37:47 -07:00 @@ -691,7 +691,7 @@ skb->ip_summed = CHECKSUM_HW; tp->write_seq += copy; TCP_SKB_CB(skb)->end_seq += copy; - TCP_SKB_CB(skb)->tso_factor = 0; + skb_shinfo(skb)->tso_segs = 0; if (!copied) TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_PSH; @@ -938,7 +938,7 @@ tp->write_seq += copy; TCP_SKB_CB(skb)->end_seq += copy; - TCP_SKB_CB(skb)->tso_factor = 0; + skb_shinfo(skb)->tso_segs = 0; from += copy; copied += copy; @@ -1592,14 +1592,6 @@ /* If it has not 0 inet_sk(sk)->num, it must be bound */ BUG_TRAP(!inet_sk(sk)->num || tcp_sk(sk)->bind_hash); - -#ifdef TCP_DEBUG - if (sk->sk_zapped) { - printk(KERN_DEBUG "TCP: double destroy sk=%p\n", sk); - sock_hold(sk); - } - sk->sk_zapped = 1; -#endif sk->sk_prot->destroy(sk); diff -Nru a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c --- a/net/ipv4/tcp_diag.c 2004-10-06 19:37:46 -07:00 +++ b/net/ipv4/tcp_diag.c 2004-10-06 19:37:46 -07:00 @@ -495,21 +495,22 @@ sk_for_each(sk, node, &tcp_listening_hash[i]) { struct inet_opt *inet = inet_sk(sk); if (num < s_num) - continue; + goto next_listen; if (!(r->tcpdiag_states&TCPF_LISTEN) || r->id.tcpdiag_dport) - continue; + goto next_listen; if (r->id.tcpdiag_sport != inet->sport && r->id.tcpdiag_sport) - continue; + goto next_listen; if (bc && !tcpdiag_bc_run(RTA_DATA(bc), RTA_PAYLOAD(bc), sk)) - continue; + goto next_listen; if (tcpdiag_fill(skb, sk, r->tcpdiag_ext, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq) <= 0) { tcp_listen_unlock(); goto done; } +next_listen: ++num; } } @@ -537,22 +538,23 @@ struct inet_opt *inet = inet_sk(sk); if (num < s_num) - continue; + goto next_normal; if (!(r->tcpdiag_states & (1 << sk->sk_state))) - continue; + goto next_normal; if (r->id.tcpdiag_sport != inet->sport && r->id.tcpdiag_sport) - continue; + goto next_normal; if (r->id.tcpdiag_dport != inet->dport && r->id.tcpdiag_dport) - continue; + goto next_normal; if (bc && !tcpdiag_bc_run(RTA_DATA(bc), RTA_PAYLOAD(bc), sk)) - continue; + goto next_normal; if (tcpdiag_fill(skb, sk, r->tcpdiag_ext, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq) <= 0) { read_unlock_bh(&head->lock); goto done; } +next_normal: ++num; } @@ -562,23 +564,22 @@ struct inet_opt *inet = inet_sk(sk); if (num < s_num) - continue; - if (!(r->tcpdiag_states & (1 << sk->sk_zapped))) - continue; + goto next_dying; if (r->id.tcpdiag_sport != inet->sport && r->id.tcpdiag_sport) - continue; + goto next_dying; if (r->id.tcpdiag_dport != inet->dport && r->id.tcpdiag_dport) - continue; + goto next_dying; if (bc && !tcpdiag_bc_run(RTA_DATA(bc), RTA_PAYLOAD(bc), sk)) - continue; + goto next_dying; if (tcpdiag_fill(skb, sk, r->tcpdiag_ext, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq) <= 0) { read_unlock_bh(&head->lock); goto done; } +next_dying: ++num; } } diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/tcp_input.c 2004-10-06 19:37:47 -07:00 @@ -1035,7 +1035,7 @@ if(!before(TCP_SKB_CB(skb)->seq, end_seq)) break; - fack_count += TCP_SKB_CB(skb)->tso_factor; + fack_count += tcp_skb_pcount(skb); in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) && !before(end_seq, TCP_SKB_CB(skb)->end_seq); @@ -1224,7 +1224,7 @@ tcp_set_pcount(&tp->fackets_out, 0); sk_stream_for_retrans_queue(skb, sk) { - cnt += TCP_SKB_CB(skb)->tso_factor;; + cnt += tcp_skb_pcount(skb); TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST; if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED)) { @@ -1299,7 +1299,7 @@ tp->undo_marker = tp->snd_una; sk_stream_for_retrans_queue(skb, sk) { - cnt += TCP_SKB_CB(skb)->tso_factor; + cnt += tcp_skb_pcount(skb); if (TCP_SKB_CB(skb)->sacked&TCPCB_RETRANS) tp->undo_marker = 0; TCP_SKB_CB(skb)->sacked &= (~TCPCB_TAGBITS)|TCPCB_SACKED_ACKED; @@ -1550,7 +1550,7 @@ BUG_TRAP(cnt <= tcp_get_pcount(&tp->packets_out)); sk_stream_for_retrans_queue(skb, sk) { - cnt -= TCP_SKB_CB(skb)->tso_factor; + cnt -= tcp_skb_pcount(skb); if (cnt < 0 || after(TCP_SKB_CB(skb)->end_seq, high_seq)) break; if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { @@ -2364,13 +2364,14 @@ * then making a write space wakeup callback is a possible * future enhancement. WARNING: it is not trivial to make. */ -static int tcp_tso_acked(struct tcp_opt *tp, struct sk_buff *skb, +static int tcp_tso_acked(struct sock *sk, struct sk_buff *skb, __u32 now, __s32 *seq_rtt) { + struct tcp_opt *tp = tcp_sk(sk); struct tcp_skb_cb *scb = TCP_SKB_CB(skb); - __u32 mss = scb->tso_mss; + __u32 mss = tcp_skb_mss(skb); __u32 snd_una = tp->snd_una; - __u32 seq = scb->seq; + __u32 orig_seq, seq; __u32 packets_acked = 0; int acked = 0; @@ -2379,22 +2380,18 @@ */ BUG_ON(!after(scb->end_seq, snd_una)); + seq = orig_seq = scb->seq; while (!after(seq + mss, snd_una)) { packets_acked++; seq += mss; } + if (tcp_trim_head(sk, skb, (seq - orig_seq))) + return 0; + if (packets_acked) { __u8 sacked = scb->sacked; - /* We adjust scb->seq but we do not pskb_pull() the - * SKB. We let tcp_retransmit_skb() handle this case - * by checking skb->len against the data sequence span. - * This way, we avoid the pskb_pull() work unless we - * actually need to retransmit the SKB. - */ - scb->seq = seq; - acked |= FLAG_DATA_ACKED; if (sacked) { if (sacked & TCPCB_RETRANS) { @@ -2413,7 +2410,7 @@ packets_acked); if (sacked & TCPCB_URG) { if (tp->urg_mode && - !before(scb->seq, tp->snd_up)) + !before(seq, tp->snd_up)) tp->urg_mode = 0; } } else if (*seq_rtt < 0) @@ -2425,9 +2422,8 @@ tcp_dec_pcount_explicit(&tp->fackets_out, dval); } tcp_dec_pcount_explicit(&tp->packets_out, packets_acked); - scb->tso_factor -= packets_acked; - BUG_ON(scb->tso_factor == 0); + BUG_ON(tcp_skb_pcount(skb) == 0); BUG_ON(!before(scb->seq, scb->end_seq)); } @@ -2454,8 +2450,8 @@ * the other end. */ if (after(scb->end_seq, tp->snd_una)) { - if (scb->tso_factor > 1) - acked |= tcp_tso_acked(tp, skb, + if (tcp_skb_pcount(skb) > 1) + acked |= tcp_tso_acked(sk, skb, now, &seq_rtt); break; } diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c --- a/net/ipv4/tcp_ipv4.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/tcp_ipv4.c 2004-10-06 19:37:47 -07:00 @@ -2175,8 +2175,14 @@ sk = sk_next(st->syn_wait_sk); st->state = TCP_SEQ_STATE_LISTENING; read_unlock_bh(&tp->syn_wait_lock); - } else + } else { + tp = tcp_sk(sk); + read_lock_bh(&tp->syn_wait_lock); + if (tp->listen_opt && tp->listen_opt->qlen) + goto start_req; + read_unlock_bh(&tp->syn_wait_lock); sk = sk_next(sk); + } get_sk: sk_for_each_from(sk, node) { if (sk->sk_family == st->family) { @@ -2186,6 +2192,7 @@ tp = tcp_sk(sk); read_lock_bh(&tp->syn_wait_lock); if (tp->listen_opt && tp->listen_opt->qlen) { +start_req: st->uid = sock_i_uid(sk); st->syn_wait_sk = sk; st->state = TCP_SEQ_STATE_OPENREQ; diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv4/tcp_output.c 2004-10-06 19:37:47 -07:00 @@ -45,6 +45,12 @@ /* People can turn this off for buggy TCP's found in printers etc. */ int sysctl_tcp_retrans_collapse = 1; +/* This limits the percentage of the congestion window which we + * will allow a single TSO frame to consume. Building TSO frames + * which are too large can cause TCP streams to be bursty. + */ +int sysctl_tcp_tso_win_divisor = 8; + static __inline__ void update_send_head(struct sock *sk, struct tcp_opt *tp, struct sk_buff *skb) { @@ -268,7 +274,7 @@ int sysctl_flags; int err; - BUG_ON(!TCP_SKB_CB(skb)->tso_factor); + BUG_ON(!tcp_skb_pcount(skb)); #define SYSCTL_FLAG_TSTAMPS 0x1 #define SYSCTL_FLAG_WSCALE 0x2 @@ -422,21 +428,22 @@ } } -void tcp_set_skb_tso_factor(struct sk_buff *skb, unsigned int mss_std) +void tcp_set_skb_tso_segs(struct sk_buff *skb, unsigned int mss_std) { if (skb->len <= mss_std) { /* Avoid the costly divide in the normal * non-TSO case. */ - TCP_SKB_CB(skb)->tso_factor = 1; + skb_shinfo(skb)->tso_segs = 1; + skb_shinfo(skb)->tso_size = 0; } else { unsigned int factor; factor = skb->len + (mss_std - 1); factor /= mss_std; - TCP_SKB_CB(skb)->tso_factor = factor; + skb_shinfo(skb)->tso_segs = factor; + skb_shinfo(skb)->tso_size = mss_std; } - TCP_SKB_CB(skb)->tso_mss = mss_std; } /* Function to create two new TCP segments. Shrinks the given segment @@ -502,8 +509,8 @@ } /* Fix up tso_factor for both original and new SKB. */ - tcp_set_skb_tso_factor(skb, tp->mss_cache_std); - tcp_set_skb_tso_factor(buff, tp->mss_cache_std); + tcp_set_skb_tso_segs(skb, tp->mss_cache_std); + tcp_set_skb_tso_segs(buff, tp->mss_cache_std); if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { tcp_inc_pcount(&tp->lost_out, skb); @@ -525,7 +532,7 @@ * eventually). The difference is that pulled data not copied, but * immediately discarded. */ -unsigned char * __pskb_trim_head(struct sk_buff *skb, int len) +static unsigned char *__pskb_trim_head(struct sk_buff *skb, int len) { int i, k, eat; @@ -553,8 +560,10 @@ return skb->tail; } -static int __tcp_trim_head(struct tcp_opt *tp, struct sk_buff *skb, u32 len) +int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) { + struct tcp_opt *tp = tcp_sk(sk); + if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) return -ENOMEM; @@ -566,26 +575,22 @@ return -ENOMEM; } + TCP_SKB_CB(skb)->seq += len; skb->ip_summed = CHECKSUM_HW; + skb->truesize -= len; + sk->sk_queue_shrunk = 1; + sk->sk_wmem_queued -= len; + sk->sk_forward_alloc += len; + /* Any change of skb->len requires recalculation of tso * factor and mss. */ - tcp_set_skb_tso_factor(skb, tp->mss_cache_std); + tcp_set_skb_tso_segs(skb, tp->mss_cache_std); return 0; } -static inline int tcp_trim_head(struct tcp_opt *tp, struct sk_buff *skb, u32 len) -{ - int err = __tcp_trim_head(tp, skb, len); - - if (!err) - TCP_SKB_CB(skb)->seq += len; - - return err; -} - /* This function synchronize snd mss to current pmtu/exthdr set. tp->user_mss is mss set by user by TCP_MAXSEG. It does NOT counts @@ -660,7 +665,7 @@ { struct tcp_opt *tp = tcp_sk(sk); struct dst_entry *dst = __sk_dst_get(sk); - int do_large, mss_now; + unsigned int do_large, mss_now; mss_now = tp->mss_cache_std; if (dst) { @@ -675,7 +680,7 @@ !tp->urg_mode); if (do_large) { - int large_mss, factor; + unsigned int large_mss, factor, limit; large_mss = 65535 - tp->af_specific->net_header_len - tp->ext_header_len - tp->ext2_header_len - @@ -685,12 +690,19 @@ large_mss = max((tp->max_window>>1), 68U - tp->tcp_header_len); + factor = large_mss / mss_now; + /* Always keep large mss multiple of real mss, but - * do not exceed congestion window. + * do not exceed 1/tso_win_divisor of the congestion window + * so we can keep the ACK clock ticking and minimize + * bursting. */ - factor = large_mss / mss_now; - if (factor > tp->snd_cwnd) - factor = tp->snd_cwnd; + limit = tp->snd_cwnd; + if (sysctl_tcp_tso_win_divisor) + limit /= sysctl_tcp_tso_win_divisor; + limit = max(1U, limit); + if (factor > limit) + factor = limit; tp->mss_cache = mss_now * factor; @@ -903,8 +915,8 @@ ((skb_size + next_skb_size) > mss_now)) return; - BUG_ON(TCP_SKB_CB(skb)->tso_factor != 1 || - TCP_SKB_CB(next_skb)->tso_factor != 1); + BUG_ON(tcp_skb_pcount(skb) != 1 || + tcp_skb_pcount(next_skb) != 1); /* Ok. We will be able to collapse the packet. */ __skb_unlink(next_skb, next_skb->list); @@ -1003,7 +1015,6 @@ { struct tcp_opt *tp = tcp_sk(sk); unsigned int cur_mss = tcp_current_mss(sk, 0); - __u32 data_seq, data_end_seq; int err; /* Do not sent more than we queued. 1/4 is reserved for possible @@ -1013,24 +1024,6 @@ min(sk->sk_wmem_queued + (sk->sk_wmem_queued >> 2), sk->sk_sndbuf)) return -EAGAIN; - /* What is going on here? When TSO packets are partially ACK'd, - * we adjust the TCP_SKB_CB(skb)->seq value forward but we do - * not adjust the data area of the SKB. We defer that to here - * so that we can avoid the work unless we really retransmit - * the packet. - */ - data_seq = TCP_SKB_CB(skb)->seq; - data_end_seq = TCP_SKB_CB(skb)->end_seq; - if (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) - data_end_seq--; - - if (skb->len > (data_end_seq - data_seq)) { - u32 to_trim = skb->len - (data_end_seq - data_seq); - - if (__tcp_trim_head(tp, skb, to_trim)) - return -ENOMEM; - } - if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { if (before(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) BUG(); @@ -1041,7 +1034,7 @@ tp->mss_cache = tp->mss_cache_std; } - if (tcp_trim_head(tp, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) + if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) return -ENOMEM; } @@ -1055,14 +1048,14 @@ return -EAGAIN; if (skb->len > cur_mss) { - int old_factor = TCP_SKB_CB(skb)->tso_factor; + int old_factor = tcp_skb_pcount(skb); int new_factor; if (tcp_fragment(sk, skb, cur_mss)) return -ENOMEM; /* We'll try again later. */ /* New SKB created, account for it. */ - new_factor = TCP_SKB_CB(skb)->tso_factor; + new_factor = tcp_skb_pcount(skb); tcp_dec_pcount_explicit(&tp->packets_out, old_factor - new_factor); tcp_inc_pcount(&tp->packets_out, skb->next); @@ -1089,7 +1082,8 @@ tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) { if (!pskb_trim(skb, 0)) { TCP_SKB_CB(skb)->seq = TCP_SKB_CB(skb)->end_seq - 1; - TCP_SKB_CB(skb)->tso_factor = 1; + skb_shinfo(skb)->tso_segs = 1; + skb_shinfo(skb)->tso_size = 0; skb->ip_summed = CHECKSUM_NONE; skb->csum = 0; } @@ -1174,7 +1168,7 @@ tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto); } - packet_cnt -= TCP_SKB_CB(skb)->tso_factor; + packet_cnt -= tcp_skb_pcount(skb); if (packet_cnt <= 0) break; } @@ -1264,8 +1258,8 @@ skb->csum = 0; TCP_SKB_CB(skb)->flags = (TCPCB_FLAG_ACK | TCPCB_FLAG_FIN); TCP_SKB_CB(skb)->sacked = 0; - TCP_SKB_CB(skb)->tso_factor = 1; - TCP_SKB_CB(skb)->tso_mss = tp->mss_cache_std; + skb_shinfo(skb)->tso_segs = 1; + skb_shinfo(skb)->tso_size = 0; /* FIN eats a sequence byte, write_seq advanced by tcp_queue_skb(). */ TCP_SKB_CB(skb)->seq = tp->write_seq; @@ -1297,8 +1291,8 @@ skb->csum = 0; TCP_SKB_CB(skb)->flags = (TCPCB_FLAG_ACK | TCPCB_FLAG_RST); TCP_SKB_CB(skb)->sacked = 0; - TCP_SKB_CB(skb)->tso_factor = 1; - TCP_SKB_CB(skb)->tso_mss = tp->mss_cache_std; + skb_shinfo(skb)->tso_segs = 1; + skb_shinfo(skb)->tso_size = 0; /* Send it off. */ TCP_SKB_CB(skb)->seq = tcp_acceptable_seq(sk, tp); @@ -1379,8 +1373,8 @@ TCP_SKB_CB(skb)->seq = req->snt_isn; TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq + 1; TCP_SKB_CB(skb)->sacked = 0; - TCP_SKB_CB(skb)->tso_factor = 1; - TCP_SKB_CB(skb)->tso_mss = tp->mss_cache_std; + skb_shinfo(skb)->tso_segs = 1; + skb_shinfo(skb)->tso_size = 0; th->seq = htonl(TCP_SKB_CB(skb)->seq); th->ack_seq = htonl(req->rcv_isn + 1); if (req->rcv_wnd == 0) { /* ignored for retransmitted syns */ @@ -1482,8 +1476,8 @@ TCP_SKB_CB(buff)->flags = TCPCB_FLAG_SYN; TCP_ECN_send_syn(sk, tp, buff); TCP_SKB_CB(buff)->sacked = 0; - TCP_SKB_CB(buff)->tso_factor = 1; - TCP_SKB_CB(buff)->tso_mss = tp->mss_cache_std; + skb_shinfo(buff)->tso_segs = 1; + skb_shinfo(buff)->tso_size = 0; buff->csum = 0; TCP_SKB_CB(buff)->seq = tp->write_seq++; TCP_SKB_CB(buff)->end_seq = tp->write_seq; @@ -1583,8 +1577,8 @@ buff->csum = 0; TCP_SKB_CB(buff)->flags = TCPCB_FLAG_ACK; TCP_SKB_CB(buff)->sacked = 0; - TCP_SKB_CB(buff)->tso_factor = 1; - TCP_SKB_CB(buff)->tso_mss = tp->mss_cache_std; + skb_shinfo(buff)->tso_segs = 1; + skb_shinfo(buff)->tso_size = 0; /* Send it off, this clears delayed acks for us. */ TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk, tp); @@ -1619,8 +1613,8 @@ skb->csum = 0; TCP_SKB_CB(skb)->flags = TCPCB_FLAG_ACK; TCP_SKB_CB(skb)->sacked = urgent; - TCP_SKB_CB(skb)->tso_factor = 1; - TCP_SKB_CB(skb)->tso_mss = tp->mss_cache_std; + skb_shinfo(skb)->tso_segs = 1; + skb_shinfo(skb)->tso_size = 0; /* Use a previous sequence. This should cause the other * end to send an ack. Don't queue or clone SKB, just @@ -1664,8 +1658,8 @@ sk->sk_route_caps &= ~NETIF_F_TSO; tp->mss_cache = tp->mss_cache_std; } - } else if (!TCP_SKB_CB(skb)->tso_factor) - tcp_set_skb_tso_factor(skb, tp->mss_cache_std); + } else if (!tcp_skb_pcount(skb)) + tcp_set_skb_tso_segs(skb, tp->mss_cache_std); TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; TCP_SKB_CB(skb)->when = tcp_time_stamp; diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c --- a/net/ipv6/af_inet6.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv6/af_inet6.c 2004-10-06 19:37:47 -07:00 @@ -191,7 +191,6 @@ } sk->sk_destruct = inet6_sock_destruct; - sk->sk_zapped = 0; sk->sk_family = PF_INET6; sk->sk_protocol = protocol; diff -Nru a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c --- a/net/ipv6/reassembly.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv6/reassembly.c 2004-10-06 19:37:47 -07:00 @@ -665,7 +665,7 @@ head->next = NULL; head->dev = dev; head->stamp = fq->stamp; - head->nh.ipv6h->payload_len = ntohs(payload_len); + head->nh.ipv6h->payload_len = htons(payload_len); *skb_in = head; diff -Nru a/net/ipv6/sit.c b/net/ipv6/sit.c --- a/net/ipv6/sit.c 2004-10-06 19:37:47 -07:00 +++ b/net/ipv6/sit.c 2004-10-06 19:37:47 -07:00 @@ -487,6 +487,7 @@ } } if (rt->rt_type != RTN_UNICAST) { + ip_rt_put(rt); tunnel->stat.tx_carrier_errors++; goto tx_error_icmp; } @@ -814,18 +815,19 @@ ipip6_tunnel_setup); if (!ipip6_fb_tunnel_dev) { err = -ENOMEM; - goto fail; + goto err1; } ipip6_fb_tunnel_dev->init = ipip6_fb_tunnel_init; if ((err = register_netdev(ipip6_fb_tunnel_dev))) - goto fail; + goto err2; out: return err; - fail: - inet_del_protocol(&sit_protocol, IPPROTO_IPV6); + err2: free_netdev(ipip6_fb_tunnel_dev); + err1: + inet_del_protocol(&sit_protocol, IPPROTO_IPV6); goto out; } diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2004-10-06 19:37:48 -07:00 +++ b/net/sched/act_api.c 2004-10-06 19:37:48 -07:00 @@ -155,7 +155,7 @@ return a; } -int tcf_action_exec(struct sk_buff *skb,struct tc_action *act) +int tcf_action_exec(struct sk_buff *skb,struct tc_action *act, struct tcf_result *res) { struct tc_action *a; @@ -164,7 +164,8 @@ if (skb->tc_verd & TC_NCLS) { skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); D2PRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",skb,skb->input_dev?skb->input_dev->name:"xxx",skb->dev->name); - return TC_ACT_OK; + ret = TC_ACT_OK; + goto exec_done; } while ((a = act) != NULL) { repeat: @@ -186,6 +187,11 @@ } exec_done: + if (skb->tc_classid > 0) { + res->classid = skb->tc_classid; + res->class = 0; + skb->tc_classid = 0; + } return ret; } diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2004-10-06 19:37:47 -07:00 +++ b/net/sched/cls_api.c 2004-10-06 19:37:47 -07:00 @@ -139,7 +139,7 @@ struct tcf_proto_ops *tp_ops; struct Qdisc_class_ops *cops; unsigned long cl = 0; - unsigned long fh, fh_s; + unsigned long fh; int err; if (prio == 0) { @@ -231,8 +231,12 @@ tp->classify = tp_ops->classify; tp->classid = parent; err = -EBUSY; - if (!try_module_get(tp_ops->owner) || - (err = tp_ops->init(tp)) != 0) { + if (!try_module_get(tp_ops->owner)) { + kfree(tp); + goto errout; + } + if ((err = tp_ops->init(tp)) != 0) { + module_put(tp_ops->owner); kfree(tp); goto errout; } @@ -245,7 +249,7 @@ } else if (tca[TCA_KIND-1] && rtattr_strcmp(tca[TCA_KIND-1], tp->ops->kind)) goto errout; - fh_s = fh = tp->ops->get(tp, t->tcm_handle); + fh = tp->ops->get(tp, t->tcm_handle); if (fh == 0) { if (n->nlmsg_type == RTM_DELTFILTER && t->tcm_handle == 0) { @@ -253,7 +257,7 @@ *back = tp->next; qdisc_unlock_tree(dev); - tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER); + tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER); tcf_destroy(tp); err = 0; goto errout; @@ -272,7 +276,7 @@ case RTM_DELTFILTER: err = tp->ops->delete(tp, fh); if (err == 0) - tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER); + tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER); goto errout; case RTM_GETTFILTER: err = tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER); diff -Nru a/net/sched/cls_fw.c b/net/sched/cls_fw.c --- a/net/sched/cls_fw.c 2004-10-06 19:37:47 -07:00 +++ b/net/sched/cls_fw.c 2004-10-06 19:37:47 -07:00 @@ -102,7 +102,7 @@ } #endif if (f->action) { - int pol_res = tcf_action_exec(skb, f->action); + int pol_res = tcf_action_exec(skb, f->action, res); if (pol_res >= 0) return pol_res; } else diff -Nru a/net/sched/cls_u32.c b/net/sched/cls_u32.c --- a/net/sched/cls_u32.c 2004-10-06 19:37:47 -07:00 +++ b/net/sched/cls_u32.c 2004-10-06 19:37:47 -07:00 @@ -175,12 +175,7 @@ #endif #ifdef CONFIG_NET_CLS_ACT if (n->action) { - int pol_res = tcf_action_exec(skb, n->action); - if (skb->tc_classid > 0) { - res->classid = skb->tc_classid; - skb->tc_classid = 0; - } - + int pol_res = tcf_action_exec(skb, n->action, res); if (pol_res >= 0) return pol_res; } else diff -Nru a/net/sched/estimator.c b/net/sched/estimator.c --- a/net/sched/estimator.c 2004-10-06 19:37:46 -07:00 +++ b/net/sched/estimator.c 2004-10-06 19:37:46 -07:00 @@ -66,15 +66,11 @@ * Minimal interval is HZ/4=250msec (it is the greatest common divisor for HZ=100 and HZ=1024 8)), maximal interval - is (HZ/4)*2^EST_MAX_INTERVAL = 8sec. Shorter intervals + is (HZ*2^EST_MAX_INTERVAL)/4 = 8sec. Shorter intervals are too expensive, longer ones can be implemented at user level painlessly. */ -#if (HZ%4) != 0 -#error Bad HZ value. -#endif - #define EST_MAX_INTERVAL 5 struct qdisc_estimator @@ -128,7 +124,7 @@ spin_unlock(e->stats_lock); } - mod_timer(&elist[idx].timer, jiffies + ((HZ/4)<next == NULL) { init_timer(&elist[est->interval].timer); elist[est->interval].timer.data = est->interval; - elist[est->interval].timer.expires = jiffies + ((HZ/4)<interval); + elist[est->interval].timer.expires = jiffies + ((HZ<interval)/4); elist[est->interval].timer.function = est_timer; add_timer(&elist[est->interval].timer); } diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c 2004-10-06 19:37:46 -07:00 +++ b/net/sched/sch_cbq.c 2004-10-06 19:37:46 -07:00 @@ -1675,7 +1675,6 @@ cl->xstats.undertime = 0; if (!PSCHED_IS_PASTPERFECT(cl->undertime)) cl->xstats.undertime = PSCHED_TDIFF(cl->undertime, q->now); - q->link.xstats.avgidle = q->link.avgidle; if (cbq_copy_xstats(skb, &cl->xstats)) { spin_unlock_bh(&sch->dev->queue_lock); goto rtattr_failure; diff -Nru a/security/commoncap.c b/security/commoncap.c --- a/security/commoncap.c 2004-10-06 19:37:47 -07:00 +++ b/security/commoncap.c 2004-10-06 19:37:47 -07:00 @@ -314,10 +314,10 @@ /* * Sometimes we want to use more memory than we have */ - if (sysctl_overcommit_memory == 1) + if (sysctl_overcommit_memory == OVERCOMMIT_ALWAYS) return 0; - if (sysctl_overcommit_memory == 0) { + if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) { unsigned long n; free = get_page_cache_size(); diff -Nru a/security/dummy.c b/security/dummy.c --- a/security/dummy.c 2004-10-06 19:37:47 -07:00 +++ b/security/dummy.c 2004-10-06 19:37:47 -07:00 @@ -121,10 +121,10 @@ /* * Sometimes we want to use more memory than we have */ - if (sysctl_overcommit_memory == 1) + if (sysctl_overcommit_memory == OVERCOMMIT_ALWAYS) return 0; - if (sysctl_overcommit_memory == 0) { + if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) { free = get_page_cache_size(); free += nr_free_pages(); free += nr_swap_pages; diff -Nru a/security/selinux/hooks.c b/security/selinux/hooks.c --- a/security/selinux/hooks.c 2004-10-06 19:37:47 -07:00 +++ b/security/selinux/hooks.c 2004-10-06 19:37:47 -07:00 @@ -1554,10 +1554,10 @@ /* * Sometimes we want to use more memory than we have */ - if (sysctl_overcommit_memory == 1) + if (sysctl_overcommit_memory == OVERCOMMIT_ALWAYS) return 0; - if (sysctl_overcommit_memory == 0) { + if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) { free = get_page_cache_size(); free += nr_free_pages(); free += nr_swap_pages; diff -Nru a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c --- a/sound/pci/intel8x0.c 2004-10-06 19:37:47 -07:00 +++ b/sound/pci/intel8x0.c 2004-10-06 19:37:47 -07:00 @@ -418,13 +418,13 @@ snd_pcm_t *pcm[6]; ichdev_t ichd[6]; - int multi4: 1, - multi6: 1, - smp20bit: 1; - int in_ac97_init: 1, - in_sdin_init: 1; - int fix_nocache: 1; /* workaround for 440MX */ - int buggy_irq: 1; /* workaround for buggy mobos */ + unsigned multi4: 1, + multi6: 1, + smp20bit: 1; + unsigned in_ac97_init: 1, + in_sdin_init: 1; + unsigned fix_nocache: 1; /* workaround for 440MX */ + unsigned buggy_irq: 1; /* workaround for buggy mobos */ ac97_bus_t *ac97_bus; ac97_t *ac97[3];