]> git.hungrycats.org Git - linux/commitdiff
[PATCH] s390: general update.
authorAndrew Morton <akpm@osdl.org>
Thu, 26 Feb 2004 00:18:22 +0000 (16:18 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 26 Feb 2004 00:18:22 +0000 (16:18 -0800)
From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Core s/390 changes:
 - Add -mbackchain to CFLAGS to prepare for gcc 3.4 with comes with a
   default setting of -mno-backchain
 - Add implementation of strcpy.
 - Pad bytes after string end in strncpy.
 - Fix __sem_update_count inline assembly for gcc 3.4.
 - Export smp_ptlb_all for tlb flushing in module code.
 - Fix sched_clock.
 - Remove the last KERNEL_VERSION #if in s390 code.
 - Add dummy implementation for missing dma_{alloc,free}_coherent.
 - Avoid cast of lvalue in idal_buffer_{from,to}_user.
 - Remove _exit definition from unistd.h.

16 files changed:
arch/s390/Makefile
arch/s390/kernel/s390_ksyms.c
arch/s390/kernel/semaphore.c
arch/s390/kernel/smp.c
arch/s390/kernel/time.c
arch/s390/lib/Makefile
arch/s390/lib/strcpy.S [new file with mode: 0644]
arch/s390/lib/strcpy64.S [new file with mode: 0644]
arch/s390/lib/strncpy.S
arch/s390/lib/strncpy64.S
arch/s390/math-emu/math.c
include/asm-s390/byteorder.h
include/asm-s390/debug.h
include/asm-s390/dma-mapping.h
include/asm-s390/idals.h
include/asm-s390/unistd.h

index d18a5731e31fa7961ce4131b7813e6ff9c4541e0..c34e7d0ac5b7b2fbbea7e42cff18c46b5a241287 100644 (file)
@@ -35,6 +35,7 @@ cflags-$(CONFIG_MARCH_Z990) += $(call check_gcc,-march=z990,)
 CFLAGS         += $(cflags-y)
 CFLAGS         += $(call check_gcc,-finline-limit=10000,)
 CFLAGS                 += -pipe -fno-strength-reduce -Wno-sign-compare 
+CFLAGS         += -mbackchain
 
 OBJCOPYFLAGS   := -O binary
 LDFLAGS_vmlinux := -e start
index 078b427d8d2d57271c58150abdcd3b832c7c9dfc..4e257f8ce5ccc5d8b0a78990aede9858df46e525 100644 (file)
@@ -54,6 +54,7 @@ EXPORT_SYMBOL_NOVERS(strnlen);
 EXPORT_SYMBOL_NOVERS(strrchr);
 EXPORT_SYMBOL_NOVERS(strstr);
 EXPORT_SYMBOL_NOVERS(strpbrk);
+EXPORT_SYMBOL_NOVERS(strcpy);
 
 /*
  * binfmt_elf loader 
index f6cfdd7c00a8ea98542efd6aee96f15c6710b4b5..8203f5e0228dffb2b6da6241cc8c48c208329b5e 100644 (file)
@@ -33,8 +33,9 @@ static inline int __sem_update_count(struct semaphore *sem, int incr)
                              "   cs    %0,%1,0(%3)\n"
                              "   jl    0b\n"
                              : "=&d" (old_val), "=&d" (new_val),
-                              "+m" (sem->count)
-                            : "a" (&sem->count), "d" (incr) : "cc" );
+                              "=m" (sem->count)
+                            : "a" (&sem->count), "d" (incr), "m" (sem->count)
+                            : "cc" );
        return old_val;
 }
 
index 14646c5a10b32b62438d77d4a3ec3cabcbe95657..3230ed0adbb9ae133cc3b1d58f74fb8c7690b86b 100644 (file)
@@ -350,6 +350,7 @@ void smp_ptlb_all(void)
 {
         on_each_cpu(smp_ptlb_callback, NULL, 0, 1);
 }
+EXPORT_SYMBOL(smp_ptlb_all);
 #endif /* ! CONFIG_ARCH_S390X */
 
 /*
index 1f772fe96af593ed13327eaca72e814562e7dc05..763196174948435af2af18702ce8493901c832c1 100644 (file)
@@ -63,7 +63,7 @@ extern unsigned long wall_jiffies;
  */
 unsigned long long sched_clock(void)
 {
-       return (get_clock() - jiffies_timer_cc) >> 2;
+       return ((get_clock() - jiffies_timer_cc) * 1000) >> 12;
 }
 
 void tod_to_timeval(__u64 todval, struct timespec *xtime)
index b94603bdc63907a1fdad99cd85900e01bf9dcbd7..3cf8418ae4380a8fe85133172d906511c6e270f3 100644 (file)
@@ -5,5 +5,5 @@
 EXTRA_AFLAGS := -traditional
 
 lib-y += delay.o 
-lib-$(CONFIG_ARCH_S390_31) += memset.o strcmp.o strncpy.o uaccess.o
-lib-$(CONFIG_ARCH_S390X) += memset64.o strcmp64.o strncpy64.o uaccess64.o
+lib-$(CONFIG_ARCH_S390_31) += memset.o strcmp.o strcpy.o strncpy.o uaccess.o
+lib-$(CONFIG_ARCH_S390X) += memset64.o strcmp64.o strcpy64.o strncpy64.o uaccess64.o
diff --git a/arch/s390/lib/strcpy.S b/arch/s390/lib/strcpy.S
new file mode 100644 (file)
index 0000000..1d36b9c
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ *  arch/s390/kernel/strcpy.S
+ *    S390 strcpy routine
+ *
+ *  S390 version
+ *    Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
+ */
+
+/*
+ * R2 = address of destination
+ * R3 = address of source string
+ */
+        .globl   strcpy
+strcpy:
+       sr      %r0,%r0
+0:     mvst    %r2,%r3
+       jo      0b
+       br      %r14
+
diff --git a/arch/s390/lib/strcpy64.S b/arch/s390/lib/strcpy64.S
new file mode 100644 (file)
index 0000000..06815dc
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ *  arch/s390/kernel/strcpy.S
+ *    S390 strcpy routine
+ *
+ *  S390 version
+ *    Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
+ */
+
+/*
+ * R2 = address of destination
+ * R3 = address of source string
+ */
+        .globl   strcpy
+strcpy:
+       sgr     %r0,%r0
+0:     mvst    %r2,%r3
+       jo      0b
+       br      %r14
+
index 3065be2b440ce0f92436a9e0e9cc39f62b921907..a3285bd0494eb588709c5457ef6d666f5cb2eb23 100644 (file)
@@ -23,8 +23,13 @@ strncpy_loop:
        LA      3,1(3)
         STC     0,0(1)
        LA      1,1(1)
-        JZ      strncpy_exit   # ICM inserted a 0x00
+        JZ      strncpy_pad    # ICM inserted a 0x00
         BRCT    4,strncpy_loop # R4 -= 1, jump to strncpy_loop if >  0
 strncpy_exit:
         BR      14
-
+strncpy_clear:
+       STC     0,0(1)
+       LA      1,1(1)
+strncpy_pad:
+       BRCT    4,strncpy_clear
+       BR      14
index 0360a38c3951c54f19234ee9c5526b86271efc73..1e455e52b3f56ef9c9e6455db1b6517bf278ee04 100644 (file)
@@ -23,8 +23,13 @@ strncpy_loop:
        LA      3,1(3)
         STC     0,0(1)
        LA      1,1(1)
-        JZ      strncpy_exit   # ICM inserted a 0x00
+        JZ      strncpy_pad    # ICM inserted a 0x00
         BRCTG   4,strncpy_loop # R4 -= 1, jump to strncpy_loop if > 0
 strncpy_exit:
         BR      14
-
+strncpy_clear:
+       STC     0,0(1)
+       LA      1,1(1)
+strncpy_pad:
+       BRCTG   4,strncpy_clear
+       BR      14
index c203afbe1a3fae49f0c468aa874265a400909010..648df71403353a50c35afc8fc387a1f01cc6653f 100644 (file)
@@ -99,7 +99,6 @@ int sysctl_ieee_emulation_warnings=1;
 
 static void display_emulation_not_implemented(struct pt_regs *regs, char *instr)
 {
-        struct pt_regs *regs;
         __u16 *location;
         
 #ifdef CONFIG_SYSCTL
index 43b0645bacd8ffb59e89b2ea0e51a54caad4649a..91a6f3893bcd54ef2e1758277db2122a3b0f7ab5 100644 (file)
@@ -67,7 +67,7 @@ static __inline__ __u32 ___arch__swab32(__u32 x)
        
        __asm__ __volatile__ (
                "   lrvr  %0,%1"
-               : "=d" (result) : "d" (x), "m" (x) );
+               : "=d" (result) : "d" (x) );
        return result;
 #endif /* __s390x__ */
 }
index 2b3964b8628333a90b00a025f707966481a8255b..c266fe9fa0aa023c9eae4939fe9bed1f7a0fa0b3 100644 (file)
@@ -35,11 +35,7 @@ struct __debug_entry{
 
 #ifdef __KERNEL__
 #include <linux/version.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
- #include <asm/spinlock.h>
-#else
- #include <linux/spinlock.h>
-#endif /* LINUX_VERSION_CODE */
+#include <linux/spinlock.h>
 #include <linux/kernel.h>
 #include <linux/time.h>
 #include <linux/proc_fs.h>
index e60fba436834b90d848ac8e42c512cd62dbdce7d..87edaa9531b31f5b9c47e76a8d34760e12ed4ae4 100644 (file)
@@ -8,4 +8,18 @@
 
 #ifndef _ASM_DMA_MAPPING_H
 #define _ASM_DMA_MAPPING_H
+
+static inline void *dma_alloc_coherent(struct device *dev, size_t size,
+                        dma_addr_t *dma_handle, int flag)
+{
+       BUG();
+       return 0;
+}
+
+static inline void dma_free_coherent(struct device *dev, size_t size,
+                      void *vaddr, dma_addr_t dma_handle)
+{
+       BUG();
+}
+
 #endif /* _ASM_DMA_MAPPING_H */
index 890bc145f9dd7f3599d500e46785b7bbee246540..ad444dc74b9bf1e6ba20d48bf6c5f4a3f7bd24c0 100644 (file)
@@ -228,7 +228,7 @@ idal_buffer_to_user(struct idal_buffer *ib, void *to, size_t count)
                left = copy_to_user(to, ib->data[i], IDA_BLOCK_SIZE);
                if (left)
                        return left + count - IDA_BLOCK_SIZE;
-               (addr_t) to += IDA_BLOCK_SIZE;
+               to = (void *) to + IDA_BLOCK_SIZE;
                count -= IDA_BLOCK_SIZE;
        }
        return copy_to_user(to, ib->data[i], count);
@@ -248,7 +248,7 @@ idal_buffer_from_user(struct idal_buffer *ib, const void *from, size_t count)
                left = copy_from_user(ib->data[i], from, IDA_BLOCK_SIZE);
                if (left)
                        return left + count - IDA_BLOCK_SIZE;
-               (addr_t) from += IDA_BLOCK_SIZE;
+               from = (void *) from + IDA_BLOCK_SIZE;
                count -= IDA_BLOCK_SIZE;
        }
        return copy_from_user(ib->data[i], from, count);
index 1c70b1c6975414e2c73fd16cb589deddf27654da..0b364bd416ae3a28bfaf1a47c64d7fb774e2b30c 100644 (file)
@@ -533,7 +533,6 @@ static inline _syscall1(int,dup,int,fd)
 static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
 static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
 static inline _syscall1(int,close,int,fd)
-static inline _syscall1(int,_exit,int,exitcode)
 static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf)
 
 static inline pid_t waitpid(int pid, int *wait_stat, int flags)