MFpowerpc: Work around the problem of returning a 32 bits value from
__syscall() on a 32 bits big-endian arch. Spotted out by: grehan
This commit is contained in:
parent
bcbfb8bc3d
commit
1f6c8bc54b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140462
@ -927,9 +927,22 @@ syscall(struct thread *td, trapframe_t *frame, u_int32_t insn)
|
||||
}
|
||||
switch (error) {
|
||||
case 0:
|
||||
#ifdef __ARMEB__
|
||||
if ((frame->fixreg[0] == SYS___syscall) &&
|
||||
(code != SYS_lseek)) {
|
||||
/*
|
||||
* 64-bit return, 32-bit syscall. Fixup byte order
|
||||
*/
|
||||
tf->tf_r0 = 0;
|
||||
tf->rf_r1 = td->td_retval[0];
|
||||
} else {
|
||||
tf->tf_r0 = td->td_retval[0];
|
||||
tf->tf_r1 = td->td_retval[1];
|
||||
}
|
||||
#else
|
||||
frame->tf_r0 = td->td_retval[0];
|
||||
frame->tf_r1 = td->td_retval[1];
|
||||
|
||||
#endif
|
||||
frame->tf_spsr &= ~PSR_C_bit; /* carry bit */
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user