diff options
author | avg <avg@FreeBSD.org> | 2011-06-04 07:02:06 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2011-06-04 07:02:06 +0000 |
commit | 8f7fb42f839ea22deef245521778f75295fa826e (patch) | |
tree | 1f634cb007c5d3e36ca42dd6b7a31c2e712fa6c0 /sys/cddl/compat/opensolaris/kern/opensolaris.c | |
parent | 726cd905450aa0bbd03426859bca15a8c375ca58 (diff) | |
download | FreeBSD-src-8f7fb42f839ea22deef245521778f75295fa826e.zip FreeBSD-src-8f7fb42f839ea22deef245521778f75295fa826e.tar.gz |
opensolaris compat / zfs: avoid early overflow in ddi_get_lbolt*
Reported by: David P. Discher <dpd@bitgravity.com>
Tested by: will
Reviewed by: art
Discussed with: dwhite
MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/compat/opensolaris/kern/opensolaris.c')
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris.c b/sys/cddl/compat/opensolaris/kern/opensolaris.c index 54118eb..640b2f3 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris.c @@ -40,6 +40,7 @@ cpu_core_t cpu_core[MAXCPU]; kmutex_t cpu_lock; solaris_cpu_t solaris_cpu[MAXCPU]; +int nsec_per_tick; /* * OpenSolaris subsystem initialisation. @@ -60,6 +61,8 @@ opensolaris_load(void *dummy) } mutex_init(&cpu_lock, "OpenSolaris CPU lock", MUTEX_DEFAULT, NULL); + + nsec_per_tick = NANOSEC / hz; } SYSINIT(opensolaris_register, SI_SUB_OPENSOLARIS, SI_ORDER_FIRST, opensolaris_load, NULL); |