diff options
author | kib <kib@FreeBSD.org> | 2009-11-10 11:43:07 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-11-10 11:43:07 +0000 |
commit | 3cf53f181e7360f48fecc50a925d46029888af1d (patch) | |
tree | bba1aed931ce7ad22617119eb8a0f3b4e1652845 /sys/powerpc/aim/trap.c | |
parent | e256ac508b1a8eb7aedb8f720f3e650ecd273b53 (diff) | |
download | FreeBSD-src-3cf53f181e7360f48fecc50a925d46029888af1d.zip FreeBSD-src-3cf53f181e7360f48fecc50a925d46029888af1d.tar.gz |
Extract the code that records syscall results in the frame into MD
function cpu_set_syscall_retval().
Suggested by: marcel
Reviewed by: marcel, davidxu
PowerPC, ARM, ia64 changes: marcel
Sparc64 tested and reviewed by: marius, also sunv reviewed
MIPS tested by: gonzo
MFC after: 1 month
Diffstat (limited to 'sys/powerpc/aim/trap.c')
-rw-r--r-- | sys/powerpc/aim/trap.c | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index ee9c7d3..60c6bb0 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -415,43 +415,8 @@ syscall(struct trapframe *frame) CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", td->td_name, syscallnames[code], td->td_retval[0]); } - switch (error) { - case 0: - if (frame->fixreg[0] == SYS___syscall && - code != SYS_freebsd6_lseek && code != SYS_lseek) { - /* - * 64-bit return, 32-bit syscall. Fixup byte order - */ - frame->fixreg[FIRSTARG] = 0; - frame->fixreg[FIRSTARG + 1] = td->td_retval[0]; - } else { - frame->fixreg[FIRSTARG] = td->td_retval[0]; - frame->fixreg[FIRSTARG + 1] = td->td_retval[1]; - } - /* XXX: Magic number */ - frame->cr &= ~0x10000000; - break; - case ERESTART: - /* - * Set user's pc back to redo the system call. - */ - frame->srr0 -= 4; - break; - case EJUSTRETURN: - /* nothing to do */ - break; - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->fixreg[FIRSTARG] = error; - /* XXX: Magic number: Carry Flag Equivalent? */ - frame->cr |= 0x10000000; - break; - } + + cpu_set_syscall_retval(td, error); /* * Check for misbehavior. |