diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2004-08-07 00:55:02 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-07 00:55:02 -0700 |
commit | f39dfb58a2a63d42f676b8621b784d6f7945dc51 (patch) | |
tree | ff0a44b4a96ef09d5df2d66e70ab7de05c34af5a /arch | |
parent | 683a0c7f28b4878ec4faea2a816f3544aefa0969 (diff) | |
download | history-f39dfb58a2a63d42f676b8621b784d6f7945dc51.tar.gz |
[PATCH] s390: core changes.
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
s390 core changes:
- Add 32 bit compat code for ptrace requests PTRACE_GETEVENTMSG,
PTRACE_GETSIGINFO and PTRACE_SETSIGINFO.
- Make non-smp kernel compile.
- Regenerate default configuration.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 1 | ||||
-rw-r--r-- | arch/s390/defconfig | 4 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.h | 3 | ||||
-rw-r--r-- | arch/s390/kernel/compat_signal.c | 47 | ||||
-rw-r--r-- | arch/s390/kernel/ptrace.c | 13 | ||||
-rw-r--r-- | arch/s390/mm/cmm.c | 1 |
6 files changed, 67 insertions, 2 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index d957683d6165ae..1395840ba98f7d 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -17,6 +17,7 @@ #include <linux/errno.h> #include <asm/uaccess.h> #include <asm/io.h> +#include <asm/smp.h> #include <linux/interrupt.h> #include <linux/proc_fs.h> #include <linux/page-flags.h> diff --git a/arch/s390/defconfig b/arch/s390/defconfig index ec342423d0d9eb..5e6b80c217bf74 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig @@ -11,7 +11,6 @@ CONFIG_UID16=y # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y -CONFIG_STANDALONE=y # # General setup @@ -93,6 +92,7 @@ CONFIG_NO_IDLE_HZ_INIT=y # # Generic Driver Options # +CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_FW_LOADER is not set # CONFIG_DEBUG_DRIVER is not set @@ -511,7 +511,7 @@ CONFIG_CRYPTO=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_AES_GENERIC is not set # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index a0e6722b6981b3..48209a81ae9fbc 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h @@ -214,4 +214,7 @@ struct sigevent32 { } _sigev_un; }; +extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from); +extern int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from); + #endif /* _ASM_S390X_S390_H */ diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 70c83cb56c3e95..e8c8b2fe7af578 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c @@ -106,6 +106,53 @@ int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from) return err; } +int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from) +{ + int err; + u32 tmp; + + if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32))) + return -EFAULT; + + err = __get_user(to->si_signo, &from->si_signo); + err |= __get_user(to->si_errno, &from->si_errno); + err |= __get_user(to->si_code, &from->si_code); + + if (from->si_code < 0) + err |= __copy_from_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE); + else { + switch (from->si_code >> 16) { + case __SI_RT >> 16: /* This is not generated by the kernel as of now. */ + case __SI_MESGQ >> 16: + err |= __get_user(to->si_int, &from->si_int); + /* fallthrough */ + case __SI_KILL >> 16: + err |= __get_user(to->si_pid, &from->si_pid); + err |= __get_user(to->si_uid, &from->si_uid); + break; + case __SI_CHLD >> 16: + err |= __get_user(to->si_pid, &from->si_pid); + err |= __get_user(to->si_uid, &from->si_uid); + err |= __get_user(to->si_utime, &from->si_utime); + err |= __get_user(to->si_stime, &from->si_stime); + err |= __get_user(to->si_status, &from->si_status); + break; + case __SI_FAULT >> 16: + err |= __get_user(tmp, &from->si_addr); + to->si_addr = (void *)(u64) (tmp & PSW32_ADDR_INSN); + break; + case __SI_POLL >> 16: + case __SI_TIMER >> 16: + err |= __get_user(to->si_band, &from->si_band); + err |= __get_user(to->si_fd, &from->si_fd); + break; + default: + break; + } + } + return err; +} + /* * Atomically swap in the new signal mask, and wait for a signal. */ diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index a0ddc4f7d9e506..26b89e55d9c1bd 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c @@ -553,6 +553,19 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data) copied += sizeof(unsigned int); } return 0; + case PTRACE_GETEVENTMSG: + return put_user((__u32) child->ptrace_message, + (unsigned int __user *) data); + case PTRACE_GETSIGINFO: + if (child->last_siginfo == NULL) + return -EINVAL; + return copy_siginfo_to_user32((siginfo_t32 __user *) data, + child->last_siginfo); + case PTRACE_SETSIGINFO: + if (child->last_siginfo == NULL) + return -EINVAL; + return copy_siginfo_from_user32(child->last_siginfo, + (siginfo_t32 __user *) data); } return ptrace_request(child, request, addr, data); } diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index 72d4f1e6ff7b70..170da71fa2ff3c 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -19,6 +19,7 @@ #include <asm/pgalloc.h> #include <asm/uaccess.h> +#include <asm/smp.h> #include "../../../drivers/s390/net/smsgiucv.h" |