Set the tc_quality field of the struct before calling tc_init(), since

the structure space had been obtained from malloc() its contents is
random garbage.  The choice of value being set is part of a larger effort
to solve some timecounter issues on MP machines (while working on that
we noticed this problem).

Noticed by:	marius
Reviewed by:	marius, green
MFC after:	3 days
This commit is contained in:
Ken Smith 2004-09-30 14:30:29 +00:00
parent 818d0cba7f
commit 9886f01b6f

View File

@ -37,6 +37,7 @@
#define COUNTER_MASK ((1 << 29) - 1)
#define COUNTER_FREQ 1000000
#define COUNTER_QUALITY 100
/* Bits in the limit register. */
#define CTLR_INTEN (1U << 31) /* Enable timer interrupts */
@ -94,6 +95,7 @@ sparc64_counter_init(bus_space_tag_t tag, bus_space_handle_t handle,
tc->tc_frequency = COUNTER_FREQ;
tc->tc_name = "counter-timer";
tc->tc_priv = sc;
tc->tc_quality = COUNTER_QUALITY;
tc_init(tc);
}