diff options
author | dchagin <dchagin@FreeBSD.org> | 2009-05-10 18:16:07 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2009-05-10 18:16:07 +0000 |
commit | ab5a6b0d187f4be9793edc0317030df72f9c4032 (patch) | |
tree | 114c9c93722fe34db7dfcb244d922692f6146706 /sys | |
parent | 63529fb14b88074e4dc5e08468caca795750ca83 (diff) | |
download | FreeBSD-src-ab5a6b0d187f4be9793edc0317030df72f9c4032.zip FreeBSD-src-ab5a6b0d187f4be9793edc0317030df72f9c4032.tar.gz |
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)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/linux32/linux32_sysvec.c | 3 | ||||
-rw-r--r-- | sys/compat/linux/linux_misc.c | 4 | ||||
-rw-r--r-- | sys/compat/linux/linux_misc.h | 2 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 3 |
4 files changed, 9 insertions, 3 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 2d71034..6010045 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -261,7 +261,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp) 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 type, void *data) 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 diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 198818e..c5b1e54 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -92,6 +92,8 @@ __FBSDID("$FreeBSD$"); #include <compat/linux/linux_emul.h> #include <compat/linux/linux_misc.h> +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) diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index eddcd2c..5d4afc2 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -65,4 +65,6 @@ extern const char *linux_platform; #define __LINUX_NPXCW__ 0x37f #endif +extern int stclohz; + #endif /* _LINUX_MISC_H_ */ diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 7af87a7..0a3d297 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -255,7 +255,7 @@ elf_linux_fixup(register_t **stack_base, struct image_params *imgp) 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 type, void *data) 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 |