Date: Wed, 28 Apr 2010 09:59:28 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r207316 - stable/8/sys/compat/freebsd32 Message-ID: <201004280959.o3S9xShO093517@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Apr 28 09:59:28 2010 New Revision: 207316 URL: http://svn.freebsd.org/changeset/base/207316 Log: MFC r207007: Extract the code to copy-out struct rusage32 from struct rusage into the new function. Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/freebsd32/freebsd32_util.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 28 09:53:54 2010 (r207315) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Apr 28 09:59:28 2010 (r207316) @@ -129,6 +129,28 @@ static int freebsd32_kevent_copyin(void #define RETVAL_LO 0 #endif +void +freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32) +{ + + TV_CP(*s, *s32, ru_utime); + TV_CP(*s, *s32, ru_stime); + CP(*s, *s32, ru_maxrss); + CP(*s, *s32, ru_ixrss); + CP(*s, *s32, ru_idrss); + CP(*s, *s32, ru_isrss); + CP(*s, *s32, ru_minflt); + CP(*s, *s32, ru_majflt); + CP(*s, *s32, ru_nswap); + CP(*s, *s32, ru_inblock); + CP(*s, *s32, ru_oublock); + CP(*s, *s32, ru_msgsnd); + CP(*s, *s32, ru_msgrcv); + CP(*s, *s32, ru_nsignals); + CP(*s, *s32, ru_nvcsw); + CP(*s, *s32, ru_nivcsw); +} + int freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap) { @@ -146,22 +168,7 @@ freebsd32_wait4(struct thread *td, struc if (uap->status != NULL) error = copyout(&status, uap->status, sizeof(status)); if (uap->rusage != NULL && error == 0) { - TV_CP(ru, ru32, ru_utime); - TV_CP(ru, ru32, ru_stime); - CP(ru, ru32, ru_maxrss); - CP(ru, ru32, ru_ixrss); - CP(ru, ru32, ru_idrss); - CP(ru, ru32, ru_isrss); - CP(ru, ru32, ru_minflt); - CP(ru, ru32, ru_majflt); - CP(ru, ru32, ru_nswap); - CP(ru, ru32, ru_inblock); - CP(ru, ru32, ru_oublock); - CP(ru, ru32, ru_msgsnd); - CP(ru, ru32, ru_msgrcv); - CP(ru, ru32, ru_nsignals); - CP(ru, ru32, ru_nvcsw); - CP(ru, ru32, ru_nivcsw); + freebsd32_rusage_out(&ru, &ru32); error = copyout(&ru32, uap->rusage, sizeof(ru32)); } return (error); @@ -755,22 +762,7 @@ freebsd32_getrusage(struct thread *td, s if (error) return (error); if (uap->rusage != NULL) { - TV_CP(s, s32, ru_utime); - TV_CP(s, s32, ru_stime); - CP(s, s32, ru_maxrss); - CP(s, s32, ru_ixrss); - CP(s, s32, ru_idrss); - CP(s, s32, ru_isrss); - CP(s, s32, ru_minflt); - CP(s, s32, ru_majflt); - CP(s, s32, ru_nswap); - CP(s, s32, ru_inblock); - CP(s, s32, ru_oublock); - CP(s, s32, ru_msgsnd); - CP(s, s32, ru_msgrcv); - CP(s, s32, ru_nsignals); - CP(s, s32, ru_nvcsw); - CP(s, s32, ru_nivcsw); + freebsd32_rusage_out(&s, &s32); error = copyout(&s32, uap->rusage, sizeof(s32)); } return (error); Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_util.h Wed Apr 28 09:53:54 2010 (r207315) +++ stable/8/sys/compat/freebsd32/freebsd32_util.h Wed Apr 28 09:59:28 2010 (r207316) @@ -94,9 +94,12 @@ int syscall32_module_handler(struct m int syscall32_helper_register(struct syscall_helper_data *sd); int syscall32_helper_unregister(struct syscall_helper_data *sd); -register_t *freebsd32_copyout_strings(struct image_params *imgp); struct iovec32; +struct rusage32; +register_t *freebsd32_copyout_strings(struct image_params *imgp); int freebsd32_copyiniov(struct iovec32 *iovp, u_int iovcnt, struct iovec **iov, int error); +void freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32); + #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004280959.o3S9xShO093517>