summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_time.c
Commit message (Collapse)AuthorAgeFilesLines
* Split the global timezone structure into two integer fields tophk2003-02-031-7/+6
| | | | | | | | | | prevent the compiler from optimizing assignments into byte-copy operations which might make access to the individual fields non-atomic. Use the individual fields throughout, and don't bother locking them with Giant: it is no longer needed. Inspired by: tjr
* No need to lock Giant around call to nanosleep1() in nanosleep().tjr2003-02-031-2/+0
|
* Avoid holding Giant across copyout() in gettimeofday() and getitimer().tjr2003-02-031-4/+4
|
* Remove unnecessary locking of Giant around nanotime() in clock_gettime().tjr2003-01-191-2/+0
|
* useracc() is mpsafe so we only need to hold Giantalfred2003-01-191-10/+5
| | | | | | over the call to nanosleep1() Pointed out by: tjr
* o reduce the overhead of calling ppsratecheck by using ticks instead ofsam2002-12-311-55/+24
| | | | | | | | | | | | | calling getmicrouptime (but maintain the struct timeval-based calling convention for compatibility) o eliminate the use of timersub in ratecheck Note that flood ping tests indicate ppsratecheck is inaccurate (but on the conservative side) with this revised implementation. If more accuracy is needed we'll have to introduce an alternate interface or increase the overhead. Reviewed by: silby, dillon, bde
* add generic rate limiting support from netbsd; ratelimit is purely time based,sam2002-12-201-0/+88
| | | | | | ppsratecheck is for controlling packets/second Obtained from: netbsd
* SCARGS removal take II.alfred2002-12-141-12/+12
|
* Backout removal SCARGS, the code freeze is only "selectively" over.alfred2002-12-131-12/+12
|
* Remove SCARGS.alfred2002-12-131-12/+12
| | | | Reviewed by: md5
* Introduce mac_check_system_settime(), a MAC check allowing policies torwatson2002-11-031-0/+13
| | | | | | | augment the system policy for changing the system time. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Round up instead of towards 0 in clock_getres() so that a resolution ofbde2002-09-251-1/+6
| | | | | | | 0 is never returned. PR: 41781 MFC after: 3 days
* A side effect of some debugging: prototypify and deregister.phk2002-08-181-45/+18
|
* more caddr_t removal.alfred2002-06-291-10/+6
|
* Hide the private parts of timecounter from a couple of places that don'tphk2002-04-261-1/+1
| | | | really need to know the gory details.
* Improve the implementation of adjtime(2).phk2002-04-151-72/+0
| | | | | | | | | | | | | | | | | | | | | | | Apply the change as a continuous slew rather than as a series of discrete steps and make it possible to adjust arbitraryly huge amounts of time in either direction. In practice this is done by hooking into the same once-per-second loop as the NTP PLL and setting a suitable frequency offset deducting the amount slewed from the remainder. If the remaining delta is larger than 1 second we slew at 5000PPM (5msec/sec), for a delta less than a second we slew at 500PPM (500usec/sec) and for the last one second period we will slew at whatever rate (less than 500PPM) it takes to eliminate the delta entirely. The old implementation stepped the clock a number of microseconds every HZ to acheive the same effect, using the same rates of change. Eliminate the global variables tickadj, tickdelta and timedelta and their various use and initializations. This removes the most significant obstacle to running timecounter and NTP housekeeping from a timeout rather than hardclock.
* - Change settime() to take a thread as its first argument instead of a procjhb2002-04-101-36/+27
| | | | | | | | | so it can use td_ucred. - Push Giant down into the end of settime() where we actually set the time on the timecounter and time of day clock. - Remove Giant from clock_settime(). - Push Giant down in settimeofday() to just protect the 'tz' global variable.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-3/+3
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Remove __P.alfred2002-03-191-6/+6
|
* Take the common case of gettimeofday(&tv, NULL) out from under Giant.phk2002-02-181-8/+4
|
* o Modify static settime() to accept the proc * for the process requestingrwatson2001-09-261-5/+6
| | | | | | | a time change, and callers so that they provide td->td_proc. o Modify settime() to use securevel_gt() for securelevel checking. Obtained from: TrustedBSD Project
* KSE Milestone 2julian2001-09-121-26/+28
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Giant Pushdowndillon2001-09-011-47/+126
| | | | | | | | clock_gettime() clock_settime() nanosleep() settimeofday() adjtime() getitimer() setitimer() __sysctl() ogetkerninfo() sigaction() osigaction() sigpending() osigpending() osigvec() osigblock() osigsetmask() sigsuspend() osigsuspend() osigstack() sigaltstack() kill() okillpg() trapsignal() nosys()
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-0/+3
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Lock the process while sending it SIGARLM and updating p_realtimer.jhb2001-03-071-0/+4
|
* Use callout_reset instead of timeout(9). Most callouts are staticallyjake2000-11-271-5/+5
| | | | | | allocated, 2 have been added to struct proc for setitimer and sleep. Reviewed by: jhb, jlemon
* Remove unneeded <sys/buf.h> includes.phk2000-04-181-1/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Isolate the Timecounter internals in their own two files.phk2000-03-201-1/+2
| | | | | | | | | | | | | | | Make the public interface more systematically named. Remove the alternate method, it doesn't do any good, only ruins performance. Add counters to profile the usage of the 8 access functions. Apply the beer-ware to my code. The weird +/- counts are caused by two repocopies behind the scenes: kern/kern_clock.c -> kern/kern_tc.c sys/time.h -> sys/timetc.h (thanks peter!)
* Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for thephk1999-10-301-1/+2
| | | | | | | | | "rw" argument, rather than hijacking B_{READ|WRITE}. Fix two bugs (physio & cam) resulting by the confusion caused by this. Submitted by: Tor.Egge@fast.no Reviewed by: alc, ken (partly)
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Minor tweaks to make sure (new) prerequisites for <sys/buf.h> (mostlypeter1999-06-271-1/+2
| | | | splbio()/splx()) are #included in time.
* Suser() simplification:phk1999-04-271-4/+4
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* More secure clock management. Allow positive steps only once per secondnsayer1999-04-071-11/+16
| | | | | | | | | | for as much as one second, but no more. Allows a miscreant to double-time march the clock, but no worse. XXX Unlike putting negative deltas in a while(1), performing small positive steps inside of a while(1) will return EPERM for the unpermitted ones. Repeated negative deltas are clamped without error (but the kernel does log a notice).
* Fix last delta so file would compile again- I think I got itmjacob1999-04-071-10/+13
| | | | | right. Add a clarifying (to me at least) comment. Some formatting fixes.
* If securelevel>1, allow the clock to be adjusted negatively only up tonsayer1999-04-071-8/+27
| | | | | | | | | | | | 1 second prior to the highest the clock has run so far. This allows time adjusters like xntpd to do their work, but the worst a miscreant can do is "freeze" the clock, not go back in time. We still need to decide on an algorithm to clamp positive adjustments. As it stands, it is possible to achieve arbitrary negative adjustments by "wrapping" time around. PR: 10361
* Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).bde1999-02-251-1/+2
|
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-2/+2
| | | | kernel compile
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-251-2/+1
| | | | about unused variables, labels and other lint.
* Add a tc_ prefix to struct timecounter members.phk1998-06-091-2/+2
| | | | Urged by: bde
* Fixed interval calculation in realitimexpire() again. Obtained from:bde1998-05-171-4/+4
| | | | | | rev.1.9. Broken in: rev.1.50. Fixed a spelling error. Obtained from: Lite2.
* Fixed stale references to hzto() in comments.bde1998-05-171-2/+2
|
* s/nanoruntime/nanouptime/gphk1998-05-171-6/+6
| | | | | | s/microruntime/microuptime/g Reviewed by: bde
* Nuke signanosleep(). (I've left nanosleep1() seperate to nanosleep()peter1998-05-141-56/+1
| | | | as I don't want to mess with the multiple returns)
* Commit an old change that has been sitting around for a long while.peter1998-05-141-2/+16
| | | | | | | | | | signanosleep() did not deal with signal masks properly. This change was based on a discussion with bde some time ago (at least 6 months or more). signanosleep() should probably go away since it was never really used for more than a few weeks and doesn't appear in released code. It should probably be killed before somebody uses it and it becomes a gratuitous nonstandard feature.
* Make a kernel version of the timer* functions called timerval* to bephk1998-04-061-13/+13
| | | | | | more consistent. OK'ed by: bde
* More fixes for the iterative case of nanosleep1 from bruce.phk1998-04-051-5/+5
| | | | I hate the 2-arg time{spec|val}{add|sub} functions!
* Make the dummy timecounter run at 1 MHz rather than 100kHz (noticed by bde)phk1998-04-051-10/+9
| | | | fix the itimer(REAL) handling.
* If there is no error code, don't copyout the remaining time. (Aspeter1998-04-051-3/+3
| | | | | documented in the man page and the standards). (and besides, nanosleep1 isn't setting it in this case at present anyway, so we'd be copying junk).
* Fix nanosleep1 based on Bruces suggestion.phk1998-04-051-28/+22
|
* tsleep() returns EWOULDBLOCK if the timeout expired. Don't return thispeter1998-04-051-2/+2
| | | | to usermode, otherwise sleep(3) fails, cron doesn't work, etc etc etc.
OpenPOWER on IntegriCloud