Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place

32-bit data in r1, not r0. 64-bit data is already packed correctly.
This commit is contained in:
Andrew Turner 2014-02-06 20:26:36 +00:00
parent 15a922df35
commit a9540a2624

View file

@ -298,15 +298,25 @@ cpu_set_syscall_retval(struct thread *td, int error)
struct trapframe *frame;
int fixup;
#ifdef __ARMEB__
uint32_t insn;
u_int call;
#endif
frame = td->td_frame;
fixup = 0;
#ifdef __ARMEB__
insn = *(u_int32_t *)(frame->tf_pc - INSN_SIZE);
if ((insn & 0x000fffff) == SYS___syscall) {
/*
* __syscall returns an off_t while most other syscalls return an
* int. As an off_t is 64-bits and an int is 32-bits we need to
* place the returned data into r1. As the lseek and frerebsd6_lseek
* syscalls also return an off_t they do not need this fixup.
*/
#ifdef __ARM_EABI__
call = frame->tf_r7;
#else
call = *(u_int32_t *)(frame->tf_pc - INSN_SIZE) & 0x000fffff;
#endif
if (call == SYS___syscall) {
register_t *ap = &frame->tf_r0;
register_t code = ap[_QUAD_LOWWORD];
if (td->td_proc->p_sysent->sv_mask)