Commit b5f520b7 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] s390: general update.

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.
parent cb57118e
......@@ -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
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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 */
/*
......
......@@ -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)
......
......@@ -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
/*
* 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
/*
* 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
......@@ -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
......@@ -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
......@@ -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
......
......@@ -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__ */
}
......
......@@ -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>
......
......@@ -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 */
......@@ -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);
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment