diff options
author | dillon <dillon@FreeBSD.org> | 2002-02-18 19:49:30 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2002-02-18 19:49:30 +0000 |
commit | f2e166dc7a7880a8564c2a7cb8ca2b94566d8d6b (patch) | |
tree | 202bd9c83cb98f48fa43893be6625275f939f5b8 | |
parent | 7b1c9df62b74476d71ce4b66fa61a31d897cfaac (diff) | |
download | FreeBSD-src-f2e166dc7a7880a8564c2a7cb8ca2b94566d8d6b.zip FreeBSD-src-f2e166dc7a7880a8564c2a7cb8ca2b94566d8d6b.tar.gz |
Load the current timecounter into tc. The timecounter global can change
at any time and we do not want to call one timercounter's function with
another timecounter's structural pointer.
MFC after: 3 days
-rw-r--r-- | sys/kern/kern_random.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_random.c b/sys/kern/kern_random.c index 901715b..1c85964 100644 --- a/sys/kern/kern_random.c +++ b/sys/kern/kern_random.c @@ -199,8 +199,9 @@ add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state, int delta, delta2; u_int nbits; u_int32_t time; + struct timecounter *tc = timecounter; /* can change at any time */ - num ^= timecounter->tc_get_timecount(timecounter) << 16; + num ^= tc->tc_get_timecount(tc) << 16; r->entropy_count += 2; time = ticks; |