When returning 64bit values (from netbsd32_lseek) fix up the return

value vector (of 32bit values, most likely) via a MD macro.
This commit is contained in:
martin 2005-07-12 15:06:17 +00:00
parent 91b9c188b3
commit e14ba58310
2 changed files with 21 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.h,v 1.16 2004/02/20 16:11:44 drochner Exp $ */
/* $NetBSD: netbsd32_machdep.h,v 1.17 2005/07/12 15:06:17 martin Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -79,4 +79,15 @@ int netbsd32_md_ioctl(struct file *, netbsd32_u_long, void *, struct proc *);
#define NETBSD32_MID_MACHINE MID_SPARC
/*
* When returning an off_t to userland, we need to modify the syscall
* retval array. We return a 64 bit value in %o0 (high) and %o1 (low)
* for 32bit userland.
*/
#define NETBSD32_OFF_T_RETURN(RV) \
do { \
(RV)[1] = (RV)[0]; \
(RV)[0] >>= 32; \
} while (0)
#endif /* _MACHINE_NETBSD32_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.96 2005/07/12 07:45:34 cube Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.97 2005/07/12 15:06:17 martin Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.96 2005/07/12 07:45:34 cube Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.97 2005/07/12 15:06:17 martin Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@ -1762,12 +1762,18 @@ netbsd32_lseek(l, v, retval)
syscallarg(int) whence;
} */ *uap = v;
struct sys_lseek_args ua;
int rv;
NETBSD32TO64_UAP(fd);
NETBSD32TO64_UAP(pad);
NETBSD32TO64_UAP(offset);
NETBSD32TO64_UAP(whence);
return (sys_lseek(l, &ua, retval));
rv = sys_lseek(l, &ua, retval);
#ifdef NETBSD32_OFF_T_RETURN
if (rv == 0)
NETBSD32_OFF_T_RETURN(retval);
#endif
return rv;
}
int