Commit Graph

31 Commits

Author SHA1 Message Date
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
ad 63baaccb6d Serialize calls to tc_windup(). 2008-01-05 18:00:37 +00:00
dyoung a72fb242fe Add tc_detach() for detaching a timecounter. It is good enough to
detach the AMD Geode SC1100 27 MHz clock, geodecntr(4), but there
may be synchronization problems on MP machines.
2008-01-03 04:42:13 +00:00
yamt 5755384fd5 fix a comment. 2007-12-15 18:20:11 +00:00
ad b470ab628d Use membar_*(). 2007-11-30 23:05:43 +00:00
elad 18558073a1 Kill another instance of KAUTH_GENERIC_ISSUSER. 2007-11-23 16:03:47 +00:00
ad 85a2e7d924 Work around broken MD headers. 2007-11-16 01:21:24 +00:00
ad ab19d73932 Kill the memory barriers: force users of the outgoing timehand to move
on quickly by also incrementing its generation number.
2007-11-15 23:16:55 +00:00
ad d3c8987b25 Oops; fix thinko. 2007-11-15 22:28:05 +00:00
ad 0239b151ae Add a bit of locking around timecounter attachment / selection. 2007-11-15 20:12:04 +00:00
simonb e7d1e5e9ea Adjust a comment. In NetBSD the time-related kernel function prototypes
are in <sys/timevar.h>, not <sys/time.h> like they are in FreeBSD.
2007-10-21 14:55:09 +00:00
ad 26c3495f7d Timecounters are lockless. Add conservative memory barriers to ensure that
loads and stores occur in the correct order.
2007-08-17 21:20:24 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad 1e70d64818 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 16:55:29 +00:00
yamt 1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
kardel d094ff8f40 Avoid printf() the selected timecounter as it is called in the path of hardclock().
The information is available via sysctl anyway.
2006-10-21 07:16:54 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
kardel 182632b893 Reduce hardclock() code path length wrt/ multiply/divide by
re-calculating the th_scale value only when necessary.
As discussed with gdamore@. Tested at (sub-)usec level with
stratum 1 reference.
2006-09-24 06:39:28 +00:00
tsutsui 3134621b5b Fix splclock()/splx() mismatch in previous. 2006-09-10 08:09:46 +00:00
simonb a6e21ef05b Guard the timecounter manipulations including the call to tc_windup()
in tc_init() with splclock().  Fixes doubled-up "selected timecounter"
messages on some architectures, including pc532 and cobalt.

Fix suggested by Frank Kardel.
2006-09-07 15:48:14 +00:00
christos 28ea22fb52 use c99 initializers, per gimpy's request 2006-09-03 06:40:39 +00:00
kardel e23bdf3c6e move MAX_TCNAMELEN into timetc.h, use constant in tmp buffer allocation 2006-09-02 13:45:04 +00:00
christos bdd0dbdf82 add missing initializers 2006-09-02 06:35:12 +00:00
bjh21 47ef6bac03 Using humanize_number() on clock speeds does more harm than good, and
precious little of either.  Go back to displaying them with all their digits.
2006-08-06 13:29:42 +00:00
bjh21 fc39059504 Clock frequencies tend to be big numbers -- use humanize_number() when
displaying them through printf.
2006-08-05 21:59:40 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
kardel 7e5391a22a rename boottimebin to timebasebin as this
struct actually keeps the start of the UTC
time scale and not the boot time. the relationship
is: utc-time = up-time + timebase.
background: when doing an ACPI sleep the uptime
freezes and on wakeup the tc_setclock() leads to
a new timebasebin - this had no relationship with
a boottime as the structure was previously called.

discussed on tech-kern@
anomalies (moving boottime, uptime describing running time)
where discovered by Arnaud Lacombe.
2006-07-14 23:01:12 +00:00
kardel 54cd6fafa8 re-order initialization sequence to have real counters available during autoconfig 2006-06-09 22:47:56 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
simonb 769d33c547 Import main FreeBSD timecounter support files as of 4th Feb 2006. 2006-02-04 08:06:23 +00:00