aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/compat_linux.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 13:02:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 13:02:14 -0400
commit9fd815b55f31be48dbb3dd23922587d247a4e497 (patch)
tree63814130acf3e472cc660ae71208c146f16dc5d6 /arch/s390/kernel/compat_linux.c
parent31bbb9b58d1e8ebcf2b28c95c2250a9f8e31e397 (diff)
parented87b27e00d2ca240f62f3903583a2f1541fb9ef (diff)
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (22 commits) [S390] Update default configuration. [S390] hibernate: Do real CPU swap at resume time [S390] dasd: tolerate devices that have no feature codes [S390] zcrypt: Do not add/remove devices in s/r callbacks [S390] hibernate: make sure pfn_is_nosave handles lowcore pages [S390] smp: introduce LC_ORDER and simplify lowcore handling [S390] ptrace: use common code for simple peek/poke operations [S390] fix disabled_wait inline assembly clobber list [S390] Change kernel_page_present coding style. [S390] hibernation: reset system after resume [S390] hibernation: fix guest page hinting related crash [S390] Get rid of init_module/delete_module compat functions. [S390] Convert sys_execve to function with parameters. [S390] Convert sys_clone to function with parameters. [S390] qdio: change state of all primed input buffers [S390] qdio: reduce per device debug messages [S390] cio: introduce consistent subchannel scanning [S390] cio: idset use actual number of ssids [S390] cio: dont kfree vmalloced memory [S390] cio: introduce css_settle ...
Diffstat (limited to 'arch/s390/kernel/compat_linux.c')
-rw-r--r--arch/s390/kernel/compat_linux.c83
1 files changed, 14 insertions, 69 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 9ab188d67a3d..5519cb745106 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -443,66 +443,28 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
443 * sys32_execve() executes a new program after the asm stub has set 443 * sys32_execve() executes a new program after the asm stub has set
444 * things up for us. This should basically do what I want it to. 444 * things up for us. This should basically do what I want it to.
445 */ 445 */
446asmlinkage long sys32_execve(void) 446asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
447 compat_uptr_t __user *envp)
447{ 448{
448 struct pt_regs *regs = task_pt_regs(current); 449 struct pt_regs *regs = task_pt_regs(current);
449 char *filename; 450 char *filename;
450 unsigned long result; 451 long rc;
451 int rc; 452
452 453 filename = getname(name);
453 filename = getname(compat_ptr(regs->orig_gpr2)); 454 rc = PTR_ERR(filename);
454 if (IS_ERR(filename)) { 455 if (IS_ERR(filename))
455 result = PTR_ERR(filename); 456 return rc;
456 goto out; 457 rc = compat_do_execve(filename, argv, envp, regs);
457 } 458 if (rc)
458 rc = compat_do_execve(filename, compat_ptr(regs->gprs[3]), 459 goto out;
459 compat_ptr(regs->gprs[4]), regs);
460 if (rc) {
461 result = rc;
462 goto out_putname;
463 }
464 current->thread.fp_regs.fpc=0; 460 current->thread.fp_regs.fpc=0;
465 asm volatile("sfpc %0,0" : : "d" (0)); 461 asm volatile("sfpc %0,0" : : "d" (0));
466 result = regs->gprs[2]; 462 rc = regs->gprs[2];
467out_putname:
468 putname(filename);
469out: 463out:
470 return result; 464 putname(filename);
471} 465 return rc;
472
473
474#ifdef CONFIG_MODULES
475
476asmlinkage long
477sys32_init_module(void __user *umod, unsigned long len,
478 const char __user *uargs)
479{
480 return sys_init_module(umod, len, uargs);
481}
482
483asmlinkage long
484sys32_delete_module(const char __user *name_user, unsigned int flags)
485{
486 return sys_delete_module(name_user, flags);
487}
488
489#else /* CONFIG_MODULES */
490
491asmlinkage long
492sys32_init_module(void __user *umod, unsigned long len,
493 const char __user *uargs)
494{
495 return -ENOSYS;
496} 466}
497 467
498asmlinkage long
499sys32_delete_module(const char __user *name_user, unsigned int flags)
500{
501 return -ENOSYS;
502}
503
504#endif /* CONFIG_MODULES */
505
506asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, 468asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf,
507 size_t count, u32 poshi, u32 poslo) 469 size_t count, u32 poshi, u32 poslo)
508{ 470{
@@ -801,23 +763,6 @@ asmlinkage long sys32_write(unsigned int fd, char __user * buf, size_t count)
801 return sys_write(fd, buf, count); 763 return sys_write(fd, buf, count);
802} 764}
803 765
804asmlinkage long sys32_clone(void)
805{
806 struct pt_regs *regs = task_pt_regs(current);
807 unsigned long clone_flags;
808 unsigned long newsp;
809 int __user *parent_tidptr, *child_tidptr;
810
811 clone_flags = regs->gprs[3] & 0xffffffffUL;
812 newsp = regs->orig_gpr2 & 0x7fffffffUL;
813 parent_tidptr = compat_ptr(regs->gprs[4]);
814 child_tidptr = compat_ptr(regs->gprs[5]);
815 if (!newsp)
816 newsp = regs->gprs[15];
817 return do_fork(clone_flags, newsp, regs, 0,
818 parent_tidptr, child_tidptr);
819}
820
821/* 766/*
822 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64. 767 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
823 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE} 768 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}