summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_tc.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix sign reversal in adjtime(2).phk2000-02-131-1/+1
| | | | Approved by: jkh
* Make adjtime(2) adjust boottime so it doesn't cause non-monotonousphk1999-12-081-2/+11
| | | | uptime.
* Fixed some comments in statclock(). The previous commit made it clearerbde1999-11-271-8/+8
| | | | that one comment was attached to null code.
* Moved scheduling-related code to kern_synch.c so that it is easier to fixbde1999-11-271-21/+1
| | | | | | | | and extend. The new function containing the code is named schedclock() as in NetBSD, but it has slightly different semantics (it already handles incrementation of p->p_cpticks, and it should handle any calling frequency). Agreed with in principle by: dufault
* #ifdef PPS_SYNC around "kapi" declaration to fix a -Wunused warning.peter1999-10-101-0/+2
|
* Update the PPSAPI to draft-mogul-pps-api-05.txt which is the latest.jhay1999-10-091-42/+54
| | | | | | NOTE: This will break building ntpd until ntpd has been upgraded to also support draft 05. People that want to build ntpd in the meantime can get patches from me.
* Moved the definition of `boottime' and its sysctl to the correct file.bde1999-09-131-0/+4
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Oops, the previous commit only worked in the one case it was tested for.bde1999-07-241-2/+3
|
* Added a sysctl "kern.timecounter.hardware" for selecting the hardwarebde1999-07-181-6/+41
| | | | | | | | | used for timecounting. The possible values are the names of the physically present harware timecounters ("i8254" and "TSC" on i386's). Fixed some nearby bitrot in comments in <sys/time.h>. Reviewed by: phk
* Remove four no-op casts.jdp1999-07-181-5/+5
|
* Make the machdep.i8254_freq and machdep.tsc_freq sysctls modify thephk1999-04-251-3/+9
| | | | | | timecounter as well Asked for by: bde, jhay
* Don't open window for race condition.phk1999-04-021-4/+1
| | | | Detected by: Reg Clemens <reg@dwf.com>
* Fix an old cut&paste bogon.phk1999-03-121-2/+2
| | | | Noticed by: bde
* Remove duplicate include.phk1999-03-121-4/+1
| | | | Noticed by: bde
* Make even more of the PPSAPI implementations generic.phk1999-03-111-52/+147
| | | | | | | | FLL support in hardpps() Various magic shuffles and improved comments Style fixes from Bruce.
* Integrate the new "nanokernel" PLL from Dave Mills.phk1999-03-081-5/+2
| | | | | | | This code is backwards compatible with the older "microkernel" PLL, but allows ntpd v4 to use nanosecond resolution. Many other improvements. PPS_SYNC and hardpps() are NOT supported yet.
* Introduce machine-dependent macro pgtok() to convert page count to numberluoqi1999-02-191-5/+5
| | | | | of kilobytes. Its definition for each architecture could be optimized to avoid potential numerical overflows.
* Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). Thisluoqi1999-02-191-3/+2
| | | | | | | is the preparation step for moving pmap storage out of vmspace proper. Reviewed by: Alan Cox <alc@cs.rice.edu> Matthew Dillion <dillon@apollo.backplane.com>
* Make the previous behaviour the default, add a sysctl which youphk1998-11-291-12/+42
| | | | | | | | | | | | | | can set if your hw/sw produces the "calcru negative..." message. Setting the alternate method (sysctl -w kern.timecounter.method=1) makes the the get{nano|micro}*() functions call the real thing at resulting in a measurable but minor overhead. I decided to NOT have the "calcru" change the method automatically because you should be aware of this problem if you have it. The problems currently seen, related to usleep and a few other corners are fixed for both methods.
* Make timecounters more resistant to badly behaved SW/HW which locksphk1998-11-231-10/+18
| | | | | | | | | | | out interrupts for too long. If you still see the "calcru: negative time..." message you can increase NTIMECOUNTER (see LINT). Sideeffect is that a timecounter is required to not wrap around in less than (1 + delta) seconds instead of the (1/hz + delta) required until now. Many thanks to: msmith, wpaul, wosch & bde
* Add a kludge to prevent panicing when using VM86 and hitting heresos1998-11-231-2/+2
| | | | | | with a NULL curproc. Originally by: Tor Egge (IIRC)
* Fixed breakage of the GPROF case of statclock() in the previous commit.bde1998-10-261-1/+2
|
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-251-3/+2
| | | | about unused variables, labels and other lint.
* Change the way we simulate stable storage for timecounters.phk1998-10-231-57/+52
| | | | | | If you have problems with the "calcru" messages and processes being killed for excessive cpu time, try to increase the NTIMECOUNTER #define and report your findings.
* Cast the return value of tvtohz() from a long to an int to satisfy thealex1998-10-061-2/+2
| | | | | | | compiler that we know what we're doing (the value returned has already been restricted to int ranges). Reviewed by: bde
* kern_clock.c:gibbs1998-09-151-18/+2
| | | | | | | Remove old disk statistics variables. vfs_bio.c: Enable bowrite now that B_ORDERED works for all buffer devices.
* Removed unused function hzto().bde1998-08-051-18/+1
|
* Fixed printf format errors.bde1998-07-111-2/+2
|
* Hmm, braino in last commit.phk1998-07-041-4/+5
|
* Change the sign on a race-condition, so that instead of ending up severalphk1998-07-041-8/+18
| | | | | tens of milliseconds out in the future we end up the right place with a subweeniesecond error.
* When we transfer time from one timecounter to the next, use nanouptime(),phk1998-07-021-4/+4
| | | | | | not nanotime(); Otherwise we end up in 2026... Fix the arg to dummy_get_timecount()
* Add a tc_ prefix to struct timecounter members.phk1998-06-091-88/+92
| | | | Urged by: bde
* Add a member function more to the timecounters, this one is for usephk1998-06-071-6/+32
| | | | | with latch based PPS implementations. The client that uses it will be committed after more testing.
* Add a "this" style argument and a "void *private" so timecounters canphk1998-06-071-7/+7
| | | | figure out which instance to wount with.
* Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.phk1998-05-281-11/+16
| | | | | | | | | | | | | | | | | | | | Clean up (or if antipodic: down) some of the msgbuf stuff. Use an inline function rather than a macro for timecounter delta. Maintain process "on-cpu" time as 64 bits of microseconds to avoid needless second rollover overhead. Avoid calling microuptime the second time in mi_switch() if we do not pass through _idle in cpu_switch() This should reduce our context-switch overhead a bit, in particular on pre-P5 and SMP systems. WARNING: Programs which muck about with struct proc in userland will have to be fixed. Reviewed, but found imperfect by: bde
* Change a data type internal to the timecounters, and remove the "delta"phk1998-05-191-27/+14
| | | | | | function. Reviewed, but not entirely approved by: bde
* s/nanoruntime/nanouptime/gphk1998-05-171-6/+6
| | | | | | s/microruntime/microuptime/g Reviewed by: bde
* Minor adjustments to the timecounting and proc0.phk1998-04-081-3/+3
| | | | Mostly Submitted by: bde
* Make a kernel version of the timer* functions called timerval* to bephk1998-04-061-3/+3
| | | | | | more consistent. OK'ed by: bde
* Make the dummy timecounter run at 1 MHz rather than 100kHz (noticed by bde)phk1998-04-051-2/+2
| | | | fix the itimer(REAL) handling.
* Handle double fraction overflow in nano & microtime functions (spotted by Bruce)phk1998-04-041-3/+3
| | | | Use tvtohz() a place where it fits.
* Time changes mark 2:phk1998-04-041-37/+90
| | | | | | | | | | | | | | | | | * Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others
* Fix an off by 1<<32 error.phk1998-03-311-2/+2
|
* Add a dummy timecounter until we find the real thing(s).phk1998-03-311-4/+36
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Add two new functions, get{micro|nano}time.phk1998-03-261-12/+30
| | | | | | | | | | | | They are atomic, but return in essence what is in the "time" variable. gettime() is now a macro front for getmicrotime(). Various patches to use the two new functions instead of the various hacks used in their absence. Some puntuation and grammer patches from Bruce. A couple of XXX comments.
* A bunch of BNN (Bruce Normal Nits) from bde:phk1998-03-161-55/+92
| | | | | | Bring back the softclock inlining save a couple of <<32's many white-space shuffles.
* Replace TOD clock code with more systematic approach.phk1998-02-201-94/+241
| | | | | | | | | | | | | | | Highlights: * Simple model for underlying hardware. * Hardware basis for timekeeping can be changed on the fly. * Only one hardware clock responsible for TOD keeping. * Provides a real nanotime() function. * Time granularity: .232E-18 seconds. * Frequency granularity: .238E-12 s/s * Frequency adjustment is continuous in time. * Less overhead for frequency adjustment. * Improves xntpd performance. Reviewed by: bde, bde, bde
* Add a nanotime() function so that we can start to use this call.phk1998-02-151-1/+10
|
OpenPOWER on IntegriCloud