Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.25
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Apr 2008 18:45:48 +0000 (11:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Apr 2008 18:45:48 +0000 (11:45 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.25:
  sh: Fix up uImage compression type
  remove include/asm-sh/floppy.h
  sh: Fix TIF_USEDFPU clearing under FPU emulation.
  sh: Fix occasional FPU register corruption under preempt.

13 files changed:
arch/sh/Kconfig
arch/sh/boot/Makefile
arch/sh/kernel/cpu/sh2a/fpu.c
arch/sh/kernel/cpu/sh4/fpu.c
arch/sh/kernel/cpu/sh5/fpu.c
arch/sh/kernel/dump_task.c
arch/sh/kernel/process_32.c
arch/sh/kernel/signal_32.c
include/asm-sh/floppy.h [deleted file]
include/asm-sh/fpu.h
include/asm-sh/processor.h
include/asm-sh/processor_32.h
include/asm-sh/processor_64.h

index 12720489e458313d0c13ff17494d8a843f9a7724..8d2cd1de57265c947a340396613dd2b83ff1e5a7 100644 (file)
@@ -72,9 +72,6 @@ config SYS_SUPPORTS_NUMA
 config SYS_SUPPORTS_PCI
        bool
 
-config ARCH_MAY_HAVE_PC_FDC
-       bool
-
 config STACKTRACE_SUPPORT
        def_bool y
 
index 3dda24daa0a8ed66242cc9063a2364f88c90f2fe..89b408620dcbbfb68d2e3f02a534fc22e86f3a64 100644 (file)
@@ -44,7 +44,7 @@ KERNEL_ENTRY  := $(shell /bin/bash -c 'printf "0x%08x" \
 
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
-                  -C none -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
+                  -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
                   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
 $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
index ff99562456fbe50f80308f479c960d617fb662bb..5627c0b3ffa82e2c9496fec63eeeb2861eade897 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/signal.h>
 #include <asm/processor.h>
 #include <asm/io.h>
+#include <asm/fpu.h>
 
 /* The PR (precision) bit in the FP Status Register must be clear when
  * an frchg instruction is executed, otherwise the instruction is undefined.
index 817f9939cda69242bd88032ffb6e18dd8262d2eb..8020796139f17ef45a7f860cacea8ac24018f6da 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/cpu/fpu.h>
 #include <asm/processor.h>
 #include <asm/system.h>
+#include <asm/fpu.h>
 
 /* The PR (precision) bit in the FP Status Register must be clear when
  * an frchg instruction is executed, otherwise the instruction is undefined.
index 30b76a94abf2aedaf326fcc8ffd8d19746f227a9..dd4f51ffb50ea81f9af6f0931d27f050a55a1498 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/processor.h>
 #include <asm/user.h>
 #include <asm/io.h>
+#include <asm/fpu.h>
 
 /*
  * Initially load the FPU with signalling NANS.  This bit pattern
index 4a8a4083ff0b6a75ed166f454c5a1d3513819e09..1db7ce0f25d4a9c5089e6011984c3eba05356e16 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/elfcore.h>
 #include <linux/sched.h>
+#include <asm/fpu.h>
 
 /*
  * Capture the user space registers if the task is not running (in user space)
index 9ab1926b9d10c34e14fd24efb385f046990ee5aa..b98e37a1f54c05229c18eb4d865ff0e6e0e26437 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/pgalloc.h>
 #include <asm/system.h>
 #include <asm/ubc.h>
+#include <asm/fpu.h>
 
 static int hlt_counter;
 int ubc_usercnt = 0;
index f6b5fbfe75c459acde8d76f310462bd8282f141c..f311551d9a05b253fccd2b2d2ac0b8a78418bd6f 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/cacheflush.h>
+#include <asm/fpu.h>
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
diff --git a/include/asm-sh/floppy.h b/include/asm-sh/floppy.h
deleted file mode 100644 (file)
index 59fbfdc..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Architecture specific parts of the Floppy driver
- *   include/asm-i386/floppy.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1995
- */
-#ifndef __ASM_SH_FLOPPY_H
-#define __ASM_SH_FLOPPY_H
-
-#include <linux/vmalloc.h>
-
-
-/*
- * The DMA channel used by the floppy controller cannot access data at
- * addresses >= 16MB
- *
- * Went back to the 1MB limit, as some people had problems with the floppy
- * driver otherwise. It doesn't matter much for performance anyway, as most
- * floppy accesses go through the track buffer.
- */
-#define _CROSS_64KB(a,s,vdma) \
-(!vdma && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
-
-#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
-
-
-#define SW fd_routine[use_virtual_dma&1]
-#define CSW fd_routine[can_use_virtual_dma & 1]
-
-
-#define fd_inb(port)                   inb_p(port)
-#define fd_outb(value,port)            outb_p(value,port)
-
-#define fd_request_dma()        CSW._request_dma(FLOPPY_DMA,"floppy")
-#define fd_free_dma()           CSW._free_dma(FLOPPY_DMA)
-#define fd_enable_irq()         enable_irq(FLOPPY_IRQ)
-#define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
-#define fd_free_irq()          free_irq(FLOPPY_IRQ, NULL)
-#define fd_get_dma_residue()    SW._get_dma_residue(FLOPPY_DMA)
-#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size)
-#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io)
-
-#define FLOPPY_CAN_FALLBACK_ON_NODMA
-
-static int virtual_dma_count;
-static int virtual_dma_residue;
-static char *virtual_dma_addr;
-static int virtual_dma_mode;
-static int doing_pdma;
-
-static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
-{
-       register unsigned char st;
-
-#undef TRACE_FLPY_INT
-
-#ifdef TRACE_FLPY_INT
-       static int calls=0;
-       static int bytes=0;
-       static int dma_wait=0;
-#endif
-       if(!doing_pdma) {
-               floppy_interrupt(irq, dev_id, regs);
-               return;
-       }
-
-#ifdef TRACE_FLPY_INT
-       if(!calls)
-               bytes = virtual_dma_count;
-#endif
-
-       {
-               register int lcount;
-               register char *lptr;
-
-               st = 1;
-               for(lcount=virtual_dma_count, lptr=virtual_dma_addr; 
-                   lcount; lcount--, lptr++) {
-                       st=inb(virtual_dma_port+4) & 0xa0 ;
-                       if(st != 0xa0) 
-                               break;
-                       if(virtual_dma_mode)
-                               outb_p(*lptr, virtual_dma_port+5);
-                       else
-                               *lptr = inb_p(virtual_dma_port+5);
-               }
-               virtual_dma_count = lcount;
-               virtual_dma_addr = lptr;
-               st = inb(virtual_dma_port+4);
-       }
-
-#ifdef TRACE_FLPY_INT
-       calls++;
-#endif
-       if(st == 0x20)
-               return;
-       if(!(st & 0x20)) {
-               virtual_dma_residue += virtual_dma_count;
-               virtual_dma_count=0;
-#ifdef TRACE_FLPY_INT
-               printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", 
-                      virtual_dma_count, virtual_dma_residue, calls, bytes,
-                      dma_wait);
-               calls = 0;
-               dma_wait=0;
-#endif
-               doing_pdma = 0;
-               floppy_interrupt(irq, dev_id, regs);
-               return;
-       }
-#ifdef TRACE_FLPY_INT
-       if(!virtual_dma_count)
-               dma_wait++;
-#endif
-}
-
-static void fd_disable_dma(void)
-{
-       if(! (can_use_virtual_dma & 1))
-               disable_dma(FLOPPY_DMA);
-       doing_pdma = 0;
-       virtual_dma_residue += virtual_dma_count;
-       virtual_dma_count=0;
-}
-
-static int vdma_request_dma(unsigned int dmanr, const char * device_id)
-{
-       return 0;
-}
-
-static void vdma_nop(unsigned int dummy)
-{
-}
-
-
-static int vdma_get_dma_residue(unsigned int dummy)
-{
-       return virtual_dma_count + virtual_dma_residue;
-}
-
-
-static int fd_request_irq(void)
-{
-       if(can_use_virtual_dma)
-               return request_irq(FLOPPY_IRQ, floppy_hardint,
-                                  IRQF_DISABLED, "floppy", NULL);
-       else
-               return request_irq(FLOPPY_IRQ, floppy_interrupt,
-                                  IRQF_DISABLED, "floppy", NULL);
-}
-
-static unsigned long dma_mem_alloc(unsigned long size)
-{
-       return __get_dma_pages(GFP_KERNEL,get_order(size));
-}
-
-
-static unsigned long vdma_mem_alloc(unsigned long size)
-{
-       return (unsigned long) vmalloc(size);
-
-}
-
-#define nodma_mem_alloc(size) vdma_mem_alloc(size)
-
-static void _fd_dma_mem_free(unsigned long addr, unsigned long size)
-{
-       if((unsigned int) addr >= (unsigned int) high_memory)
-               return vfree((void *)addr);
-       else
-               free_pages(addr, get_order(size));              
-}
-
-#define fd_dma_mem_free(addr, size)  _fd_dma_mem_free(addr, size) 
-
-static void _fd_chose_dma_mode(char *addr, unsigned long size)
-{
-       if(can_use_virtual_dma == 2) {
-               if((unsigned int) addr >= (unsigned int) high_memory ||
-                  virt_to_phys(addr) >= 0x10000000)
-                       use_virtual_dma = 1;
-               else
-                       use_virtual_dma = 0;
-       } else {
-               use_virtual_dma = can_use_virtual_dma & 1;
-       }
-}
-
-#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size)
-
-
-static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
-{
-       doing_pdma = 1;
-       virtual_dma_port = io;
-       virtual_dma_mode = (mode  == DMA_MODE_WRITE);
-       virtual_dma_addr = addr;
-       virtual_dma_count = size;
-       virtual_dma_residue = 0;
-       return 0;
-}
-
-static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
-{
-#ifdef FLOPPY_SANITY_CHECK
-       if (CROSS_64KB(addr, size)) {
-               printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
-               return -1;
-       }
-#endif
-
-       __flush_purge_region(addr, size);
-
-       /* actual, physical DMA */
-       doing_pdma = 0;
-       clear_dma_ff(FLOPPY_DMA);
-       set_dma_mode(FLOPPY_DMA,mode);
-       set_dma_addr(FLOPPY_DMA,virt_to_phys(addr));
-       set_dma_count(FLOPPY_DMA,size);
-       enable_dma(FLOPPY_DMA);
-       return 0;
-}
-
-static struct fd_routine_l {
-       int (*_request_dma)(unsigned int dmanr, const char * device_id);
-       void (*_free_dma)(unsigned int dmanr);
-       int (*_get_dma_residue)(unsigned int dummy);
-       unsigned long (*_dma_mem_alloc) (unsigned long size);
-       int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
-} fd_routine[] = {
-       {
-               request_dma,
-               free_dma,
-               get_dma_residue,
-               dma_mem_alloc,
-               hard_dma_setup
-       },
-       {
-               vdma_request_dma,
-               vdma_nop,
-               vdma_get_dma_residue,
-               vdma_mem_alloc,
-               vdma_dma_setup
-       }
-};
-
-
-static int FDC1 = 0x3f0;
-static int FDC2 = -1;
-
-/*
- * Floppy types are stored in the rtc's CMOS RAM and so rtc_lock
- * is needed to prevent corrupted CMOS RAM in case "insmod floppy"
- * coincides with another rtc CMOS user.               Paul G.
- */
-#define FLOPPY0_TYPE   (4)
-#define FLOPPY1_TYPE   (0)
-
-#define N_FDC 2
-#define N_DRIVE 8
-
-#define EXTRA_FLOPPY_PARAMS
-
-#endif /* __ASM_SH_FLOPPY_H */
index f8429880a27011cab16851b2f83fad36fe3623f3..91462fea1507c69af30d42a8e2315e8730ced5b0 100644 (file)
@@ -1,9 +1,8 @@
 #ifndef __ASM_SH_FPU_H
 #define __ASM_SH_FPU_H
 
-#define SR_FD    0x00008000
-
 #ifndef __ASSEMBLY__
+#include <linux/preempt.h>
 #include <asm/ptrace.h>
 
 #ifdef CONFIG_SH_FPU
@@ -21,25 +20,35 @@ struct task_struct;
 
 extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
 #else
+
 #define release_fpu(regs)      do { } while (0)
 #define grab_fpu(regs)         do { } while (0)
-#define save_fpu(tsk, regs)    do { } while (0)
+
+static inline void save_fpu(struct task_struct *tsk, struct pt_regs *regs)
+{
+       clear_tsk_thread_flag(tsk, TIF_USEDFPU);
+}
 #endif
 
 extern int do_fpu_inst(unsigned short, struct pt_regs *);
 
-#define unlazy_fpu(tsk, regs) do {                     \
-       if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {   \
-               save_fpu(tsk, regs);                    \
-       }                                               \
-} while (0)
-
-#define clear_fpu(tsk, regs) do {                              \
-       if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {           \
-               clear_tsk_thread_flag(tsk, TIF_USEDFPU);        \
-               release_fpu(regs);                              \
-       }                                                       \
-} while (0)
+static inline void unlazy_fpu(struct task_struct *tsk, struct pt_regs *regs)
+{
+       preempt_disable();
+       if (test_tsk_thread_flag(tsk, TIF_USEDFPU))
+               save_fpu(tsk, regs);
+       preempt_enable();
+}
+
+static inline void clear_fpu(struct task_struct *tsk, struct pt_regs *regs)
+{
+       preempt_disable();
+       if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) {
+               clear_tsk_thread_flag(tsk, TIF_USEDFPU);
+               release_fpu(regs);
+       }
+       preempt_enable();
+}
 
 #endif /* __ASSEMBLY__ */
 
index 19fe47c1ca172adebdc1b2de45e3902f6352649a..ec707b98e5b91a88e9e21a6aa076490ae1ba6987 100644 (file)
@@ -2,7 +2,6 @@
 #define __ASM_SH_PROCESSOR_H
 
 #include <asm/cpu-features.h>
-#include <asm/fpu.h>
 
 #ifndef __ASSEMBLY__
 /*
index df2d5b039ef41ad5bfdf5bd0e99436461a49bb28..c09305d6a9d94b2ceabbcf5f8984ceb0fc06af93 100644 (file)
@@ -70,6 +70,7 @@ extern struct sh_cpuinfo cpu_data[];
  */
 #define SR_DSP         0x00001000
 #define SR_IMASK       0x000000f0
+#define SR_FD          0x00008000
 
 /*
  * FPU structure and data
index eda4bef448e9f867f70c23a31b9eaa2d5be2a8e4..88a2edf8fa5d000e1070443b736b0accfb3e77b7 100644 (file)
@@ -112,6 +112,7 @@ extern struct sh_cpuinfo cpu_data[];
 #endif
 
 #define SR_IMASK 0x000000f0
+#define SR_FD    0x00008000
 #define SR_SSTEP 0x08000000
 
 #ifndef __ASSEMBLY__