From owner-svn-src-head@FreeBSD.ORG Sun May 10 18:16:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE71F1065672; Sun, 10 May 2009 18:16:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBEBB8FC0A; Sun, 10 May 2009 18:16:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4AIG7OP064711; Sun, 10 May 2009 18:16:07 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4AIG7Ek064707; Sun, 10 May 2009 18:16:07 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200905101816.n4AIG7Ek064707@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 10 May 2009 18:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191966 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2009 18:16:08 -0000 Author: dchagin Date: Sun May 10 18:16:07 2009 New Revision: 191966 URL: http://svn.freebsd.org/changeset/base/191966 Log: Rework r189362, r191883. The frequency of the statistics clock is given by stathz. Use stathz if it is available, otherwise use hz. Pointed out by: bde Approved by: kib (mentor) Modified: head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun May 10 18:11:14 2009 (r191965) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun May 10 18:16:07 2009 (r191966) @@ -261,7 +261,7 @@ elf_linux_fixup(register_t **stack_base, pos = base + (imgp->args->argc + imgp->args->envc + 2); AUXARGS_ENTRY_32(pos, LINUX_AT_HWCAP, cpu_feature); - AUXARGS_ENTRY_32(pos, LINUX_AT_CLKTCK, hz); + AUXARGS_ENTRY_32(pos, LINUX_AT_CLKTCK, stclohz); AUXARGS_ENTRY_32(pos, AT_PHDR, args->phdr); AUXARGS_ENTRY_32(pos, AT_PHENT, args->phent); AUXARGS_ENTRY_32(pos, AT_PHNUM, args->phnum); @@ -1125,6 +1125,7 @@ linux_elf_modevent(module_t mod, int typ linux_szplatform = roundup(strlen(linux_platform) + 1, sizeof(char *)); linux_osd_jail_register(); + stclohz = (stathz ? stathz : hz); if (bootverbose) printf("Linux ELF exec handler installed\n"); } else Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun May 10 18:11:14 2009 (r191965) +++ head/sys/compat/linux/linux_misc.c Sun May 10 18:16:07 2009 (r191966) @@ -92,6 +92,8 @@ __FBSDID("$FreeBSD$"); #include #include +int stclohz; /* Statistics clock frequency */ + #define BSD_TO_LINUX_SIGNAL(sig) \ (((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig) @@ -659,7 +661,7 @@ struct l_times_argv { l_clock_t tms_cstime; }; -#define CONVTCK(r) (r.tv_sec * hz + r.tv_usec / (1000000 / hz)) +#define CONVTCK(r) (r.tv_sec * stclohz + r.tv_usec / (1000000 / stclohz)) int linux_times(struct thread *td, struct linux_times_args *args) Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Sun May 10 18:11:14 2009 (r191965) +++ head/sys/compat/linux/linux_misc.h Sun May 10 18:16:07 2009 (r191966) @@ -65,4 +65,6 @@ extern const char *linux_platform; #define __LINUX_NPXCW__ 0x37f #endif +extern int stclohz; + #endif /* _LINUX_MISC_H_ */ Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun May 10 18:11:14 2009 (r191965) +++ head/sys/i386/linux/linux_sysvec.c Sun May 10 18:16:07 2009 (r191966) @@ -255,7 +255,7 @@ elf_linux_fixup(register_t **stack_base, pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2); AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature); - AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, hz); + AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz); AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); AUXARGS_ENTRY(pos, AT_PHENT, args->phent); AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum); @@ -1092,6 +1092,7 @@ linux_elf_modevent(module_t mod, int typ linux_szplatform = roundup(strlen(linux_platform) + 1, sizeof(char *)); linux_osd_jail_register(); + stclohz = (stathz ? stathz : hz); if (bootverbose) printf("Linux ELF exec handler installed\n"); } else