Date: Fri, 8 Jan 2010 22:29:32 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 172808 for review Message-ID: <201001082229.o08MTWv7039420@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=172808 Change 172808 by bz@bz_dumpster on 2010/01/08 22:29:11 Reflect SVN r199135: Extract the code that records syscall results in the frame into MD function cpu_set_syscall_retval(). Affected files ... .. //depot/projects/s390/sys/s390/include/pcb.h#3 edit .. //depot/projects/s390/sys/s390/s390/trap.c#14 edit .. //depot/projects/s390/sys/s390/s390/vm_machdep.c#12 edit Differences ... ==== //depot/projects/s390/sys/s390/include/pcb.h#3 (text+ko) ==== ==== //depot/projects/s390/sys/s390/s390/trap.c#14 (text+ko) ==== @@ -482,7 +482,6 @@ struct sysentvec *sv; struct sysent *callp; struct thread *td; - int be32_hack = 0; struct proc *p; caddr_t params; u_int code; @@ -520,7 +519,6 @@ code = *argp++; nreg = 4; } else if (code == SYS___syscall) { - be32_hack = 1; argp++; code = *argp++; nreg = 3; @@ -555,32 +553,7 @@ error = (*callp->sy_call)(td, argp); } - switch (error) { - case 0: - if (be32_hack) { - tf->tf_gpr[3] = td->td_retval[0]; - } else { - tf->tf_gpr[2] = td->td_retval[0]; - tf->tf_gpr[3] = td->td_retval[1]; - } - tf->tf_psw.mask &= ~PSW_CC3; - break; - case ERESTART: - tf->tf_psw.addr -= 2; - break; - case EJUSTRETURN: - break; - default: - if (sv->sv_errsize) { - error = (error >= sv->sv_errsize) - ? -1 - : sv->sv_errtbl[error]; - } - tf->tf_gpr[2] = error; - tf->tf_psw.mask |= PSW_CC3; - break; - } - + cpu_set_syscall_retval(td, error); userret(td, tf); #ifdef KTRACE ==== //depot/projects/s390/sys/s390/s390/vm_machdep.c#12 (text+ko) ==== @@ -60,7 +60,9 @@ #include <sys/sf_buf.h> #include <sys/smp.h> #include <sys/socketvar.h> +#include <sys/syscall.h> #include <sys/sysctl.h> +#include <sys/sysent.h> #include <sys/unistd.h> #include <sys/user.h> #include <sys/lock.h> @@ -75,6 +77,7 @@ #include <machine/cpu.h> #include <machine/md_var.h> #include <machine/pcb.h> +#include <machine/psw.h> #include <s390/s390/dat.h> @@ -158,6 +161,53 @@ } void +cpu_set_syscall_retval(struct thread *td, int error) +{ + struct trapframe *tf; + struct proc *p; + struct sysentvec *sv; + u_int code; + int be32_hack; + + tf = td->td_frame; + p = td->td_proc; + sv = p->p_sysent; + + code = tf->tf_gpr[0]; + be32_hack = 0; +#ifndef __s390x__ + if (code == SYS___syscall) + be32_hack = 1; +#endif + + switch (error) { + case 0: + if (be32_hack) { + tf->tf_gpr[3] = td->td_retval[0]; + } else { + tf->tf_gpr[2] = td->td_retval[0]; + tf->tf_gpr[3] = td->td_retval[1]; + } + tf->tf_psw.mask &= ~PSW_CC3; + break; + case ERESTART: + tf->tf_psw.addr -= 2; + break; + case EJUSTRETURN: + break; + default: + if (sv->sv_errsize) { + error = (error >= sv->sv_errsize) + ? -1 + : sv->sv_errtbl[error]; + } + tf->tf_gpr[2] = error; + tf->tf_psw.mask |= PSW_CC3; + break; + } +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct trapframe *tf;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001082229.o08MTWv7039420>