summaryrefslogtreecommitdiff
path: root/sys/kern/kern_timeout.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed stale references to hzto() in comments.Bruce Evans1998-05-171-2/+2
| | | | Notes: svn path=/head/; revision=36127
* Declare function pointer args as pointers, not as functions.Bruce Evans1998-02-251-3/+3
| | | | Notes: svn path=/head/; revision=33824
* A bunch of nits from bde.Poul-Henning Kamp1998-02-151-15/+13
| | | | Notes: svn path=/head/; revision=33392
* Make softticks static.Poul-Henning Kamp1998-01-141-35/+2
| | | | | | | Remove unneeded stuff. Notes: svn path=/head/; revision=32512
* Fix softclock calling so we don't loose timeouts (I broke this ~10h ago)Poul-Henning Kamp1998-01-111-6/+2
| | | | Notes: svn path=/head/; revision=32412
* Whoops. softclock is called from doreti_swi as well. Abandon call fromPoul-Henning Kamp1998-01-101-8/+2
| | | | | | | | | | | hardclock(). Forgot this: Pointed hat sent by: bd Notes: svn path=/head/; revision=32391
* Effect the divorce of kern_clock.c and kern_timeout.c (which wasPoul-Henning Kamp1998-01-101-1111/+20
| | | | | | | repository copied from kern_clock.c) Notes: svn path=/head/; revision=32388
* Improve hardpps readability a bit:Poul-Henning Kamp1998-01-071-50/+45
| | | | | | | | * Rename usec to p_usec so you can search for it. * Macroize the huge median_of_3_samples if statement. Notes: svn path=/head/; revision=32323
* This patch causes the "calltodo" timer list to be decremented by the amountNate Williams1997-12-231-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | of time that the laptop was suspending. Thus, select() calls that might have suspended rather than firing at 1hr + "time suspended" since the timer was posted. Adding: options APM_FIXUP_CALLTODO to the kernel config enables the patch. [ This patch was slightly modified to use a consistant indent style and I removed some unused local variables. After this has been tested a few weeks we'll make the options the default, so for now I'm now documenting it in LINT. Mike can later if he wants. ] Reviewed by: Mike Smith <msmith@freebsd.org> Submitted by: Ken Key <key@cs.utk.edu> Notes: svn path=/head/; revision=31950
* The improvements to clock statistics by Tor EggeSteve Passe1997-12-081-1/+20
| | | | | | | | | | Wrappered and enabled by the define BETTER_CLOCK (on by default in smpyests.h) Reviewed by: smp@csn.net Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no> Notes: svn path=/head/; revision=31639
* Removed all traces of P_IDLEPROC. It was tested but never set.Bruce Evans1997-11-241-2/+2
| | | | Notes: svn path=/head/; revision=31393
* Removed unused #include.Bruce Evans1997-11-181-3/+1
| | | | Notes: svn path=/head/; revision=31259
* Remove a bunch of variables which were unused both in GENERIC and LINT.Poul-Henning Kamp1997-11-071-3/+1
| | | | | | | Found by: -Wunused Notes: svn path=/head/; revision=31016
* Store an absolute tick value in callout entries so that a subtraction onJustin T. Gibbs1997-09-241-10/+18
| | | | | | | | | | | hash chain traversal isn't needed. This also allows untimeout to recompute the hash to find the bucket that the entry to remove is stored in so that each callout entry no longer needs to store that information. Reviewed by: Nate Williams <nate@mt.sri.com> Notes: svn path=/head/; revision=29805
* init_main.c subr_autoconf.c:Justin T. Gibbs1997-09-211-81/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for "interrupt driven configuration hooks". A component of the kernel can register a hook, most likely during auto-configuration, and receive a callback once interrupt services are available. This callback will occur before the root and dump devices are configured, so the configuration task can affect the selection of those two devices or complete any tasks that need to be performed prior to launching init. System boot is posponed so long as a hook is registered. The hook owner is responsible for removing the hook once their task is complete or the system boot can continue. kern_acct.c kern_clock.c kern_exit.c kern_synch.c kern_time.c: Change the interface and implementation for the kernel callout service. The new implemntaion is based on the work of Adam M. Costello and George Varghese, published in a technical report entitled "Redesigning the BSD Callout and Timer Facilities". The interface used in FreeBSD is a little different than the one outlined in the paper. The new function prototypes are: struct callout_handle timeout(void (*func)(void *), void *arg, int ticks); void untimeout(void (*func)(void *), void *arg, struct callout_handle handle); If a client wishes to remove a timeout, it must store the callout_handle returned by timeout and pass it to untimeout. The new implementation gives 0(1) insert and removal of callouts making this interface scale well even for applications that keep 100s of callouts outstanding. See the updated timeout.9 man page for more details. Notes: svn path=/head/; revision=29680
* Some staticized variables were still declared to be extern.Bruce Evans1997-09-071-2/+2
| | | | Notes: svn path=/head/; revision=29179
* Removed unused #includes.Bruce Evans1997-09-021-3/+1
| | | | Notes: svn path=/head/; revision=29041
* #include <machine/limits.h> explicitly in the few places that it is required.Bruce Evans1997-08-211-1/+2
| | | | Notes: svn path=/head/; revision=28551
* Add tickadj to struct clockinfo, like NetBSD and OpenBSD.John Hay1997-06-241-1/+2
| | | | | | | NOTE: libc, time, kgmon and rpc.rstatd will have to be recompiled. Notes: svn path=/head/; revision=26897
* Man the liferafts! Here comes the long awaited SMP -> -current merge!Peter Wemm1997-04-261-2/+2
| | | | | | | | | | | | | | | | | | | There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code! Notes: svn path=/head/; revision=25164
* Restore Bruce's original comment. It seems that "iff" = if and only if,Mike Pritchard1997-03-221-2/+2
| | | | | | | and is not a typo. It is used other places in the kernel, too. Notes: svn path=/head/; revision=24117
* Fix a typo in a comment of a recent commit.Mike Pritchard1997-03-221-2/+2
| | | | Notes: svn path=/head/; revision=24109
* Fixed some invalid (non-atomic) accesses to `time', mostly ones of theBruce Evans1997-03-221-1/+12
| | | | | | | | | form `tv = time'. Use a new function gettime(). The current version just forces atomicicity without fixing precision or efficiency bugs. Simplified some related valid accesses by using the central function. Notes: svn path=/head/; revision=24101
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* This is the kernel Lite/2 commit. There are some requisite userlandJohn Dyson1997-02-101-1/+1
| | | | | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org> Notes: svn path=/head/; revision=22521
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Update our kernel ntp code to the latest from David Mills. The main changeJohn Hay1996-12-301-127/+252
| | | | | | | | is the addition of the FLL code, which is used by the latest versions of xntpd. The kernel PPS code is also updated, although I can't test that yet. Notes: svn path=/head/; revision=21101
* Improved biasing of i586 clock by adjusting for hardclock() latency.Bruce Evans1996-10-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | I decided to do this for every hardclock() call instead of lazily in microtime(). The lazy method is simpler but has more overhead if microtime() is called a lot. CPU_THISTICKLEN() is now a no-op and should probably go away. Previously it did nothing directly but had the side effect of setting i586_last_tick for CPU_CLOCKUPDATE() and i586_avg_tick for debugging. CPU_CLOCKUPDATE() now uses a better method and i586_avg_tick is too much trouble to maintain. Reduced nesting of #includes in the usual case. Increased nesting of #includes when CLOCK_HAIR is defined. This is a kludge to get typedefs for inline functions only when the inline functions are used. Normally only kern_clock.c defines this. kern_clock.c can't include the i386 headers directly. Removed unused LOCORE support. Notes: svn path=/head/; revision=19172
* Don't include "opt_cpu.h" in <machine/clock.h>, since this breaks lkm's.Bruce Evans1996-10-101-1/+3
| | | | | | | | The change breaks kern_clock.c; fix that temporarily by including "opt_cpu.h" there. Notes: svn path=/head/; revision=18855
* Fixed resource usage integrals. They were too large by a factor ofBruce Evans1996-07-301-20/+21
| | | | | | | of profhz/stathz when profiling was enabled. Notes: svn path=/head/; revision=17342
* Unstaticize psratio and staticize profprocs. psratio needs to be exportedBruce Evans1996-06-231-5/+6
| | | | | | | to trap.c to fix user profiling. Notes: svn path=/head/; revision=16635
* Staticize.Poul-Henning Kamp1995-12-171-9/+10
| | | | | | | | | | | | | | | Unstaticize a function in scsi/scsi_base that was used, with an undocumented option. My last count on the LINT kernel shows: Total symbols: 3647 unref symbols: 463 undef symbols: 4 1 ref symbols: 1751 2 ref symbols: 485 Approaching the pain threshold now. Notes: svn path=/head/; revision=12913
* Untangled the vm.h include file spaghetti.David Greenman1995-12-071-1/+6
| | | | Notes: svn path=/head/; revision=12662
* A couple of minor tweaks to the sysctl stuff.Poul-Henning Kamp1995-12-061-2/+2
| | | | Notes: svn path=/head/; revision=12650
* A major sweep over the sysctl stuff.Poul-Henning Kamp1995-12-041-3/+3
| | | | | | | | | | | | | | | | Move a lot of variables home to their own code (In good time before xmas :-) Introduce the string descrition of format. Add a couple more functions to poke into these marvels, while I try to decide what the correct interface should look like. Next is adding vars on the fly, and sysctl looking at them too. Removed a tine bit of defunct and #ifdefed notused code in swapgeneric. Notes: svn path=/head/; revision=12623
* Finished (?) cleaning up sysinit stuff.Bruce Evans1995-12-021-9/+4
| | | | Notes: svn path=/head/; revision=12569
* The entire sysctl callback to read/write version. I havn't tested this asPoul-Henning Kamp1995-11-121-3/+2
| | | | | | | | | | | much as I'd like to, but the malloc stunt I tried for an interim for sure does worse. Now we can read and write from any kind of address-space, not only user and kernel, using callbacks. This may be over-generalization for now, but it's actually simpler. Notes: svn path=/head/; revision=12243
* Fix some of the sysctl broke, and add a lot more to it.Poul-Henning Kamp1995-11-081-7/+8
| | | | Notes: svn path=/head/; revision=12152
* Improve clock accuracy by accounting for late/missed clock interruptsGarrett Wollman1995-10-121-3/+3
| | | | | | | if the hardware supports it. Notes: svn path=/head/; revision=11451
* Fixed init functions argument type - caddr_t -> void *. Fixed a couple ofDavid Greenman1995-09-091-4/+4
| | | | | | | compiler warnings. Notes: svn path=/head/; revision=10653
* Reviewed by: julian with quick glances by bruce and othersJulian Elischer1995-08-281-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: terry (terry lambert) This is a composite of 3 patch sets submitted by terry. they are: New low-level init code that supports loadbal modules better some cleanups in the namei code to help terry in 16-bit character support some changes to the mount-root code to make it a little more modular.. NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able to test those cases.. certainly mounting root of disk still works just fine.. mfs should work but is untested. (tomorrows task) The low level init stuff includes a total rewrite of init_main.c to make it possible for new modules to have an init phase by simply adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can be added to the kernel without editing any other files other than the 'files' file. Notes: svn path=/head/; revision=10358
* Eliminate sloppy common-style declarations. There should be none left forBruce Evans1995-07-291-2/+1
| | | | | | | the LINT configuation. Notes: svn path=/head/; revision=9759
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-6/+6
| | | | Notes: svn path=/head/; revision=8876
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'Bruce Evans1995-03-161-3/+1
| | | | | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones. Notes: svn path=/head/; revision=7090
* Obtained from: my old fix for 1.1.5Bruce Evans1994-12-121-16/+42
| | | | | | | | | | | | | | | | | | | | | Improve hzto(): Round up instead of down and then add 1 tick. This fixes sleep(1) sometimes sleeping for < 1 second and usleep(10000) sometimes sleeping for as little as 1 usec + syscall time. Don't do all the calculations at splhigh(). Don't depend on `tick' being a multiple of 1000. Don't lose accuracy for `sec' between 0x7fffffff / 1000 - 1000 and 0x7fffffff / hz. Don't assume that longs are 32 bits or that ints have the same size as longs. Notes: svn path=/head/; revision=5081
* kern_clock.c: define dk_names[][].Garrett Wollman1994-10-161-2/+3
| | | | | | | | | kern_sysctl.c: call dev_sysctl for hw.devconf mib subtree kern_devconf.c: sysctl-accessible device-configuration and -management interface Notes: svn path=/head/; revision=3640
* All of this is cosmetic. prototypes, #includes, printfs and so on. MakesPoul-Henning Kamp1994-10-021-1/+3
| | | | | | | GCC a lot more silent. Notes: svn path=/head/; revision=3308
* Fixed bug in hardclock() that caused adjtime() to fail when givenGarrett Wollman1994-09-291-9/+4
| | | | | | | | a negative offset. This would be seen in xntpd as a rash of ``Previous time adjustment didn't complete'' messages on startup. Notes: svn path=/head/; revision=3183
* While in the real world, I had a bad case of being swapped out for a lot ofPoul-Henning Kamp1994-09-251-2/+2
| | | | | | | | | | | cycles. While waiting there I added a lot of the extra ()'s I have, (I have never used LISP to any extent). So I compiled the kernel with -Wall and shut up a lot of "suggest you add ()'s", removed a bunch of unused var's and added a couple of declarations here and there. Having a lap-top is highly recommended. My kernel still runs, yell at me if you kernel breaks. Notes: svn path=/head/; revision=3098
* Redo Kernel NTP PLL support, kernel side.Garrett Wollman1994-09-181-10/+575
| | | | | | | | | | | | | | | | | | | | This code is mostly taken from the 1.1 port (which was in turn taken from Dave Mills's kern.tar.Z example). A few significant differences: 1) ntp_gettime() is now a MIB variable rather than a system call. A few fiddles are done in libc to make it behave the same. 2) mono_time does not participate in the PLL adjustments. 3) A new interface has been defined (in <machine/clock.h>) for doing possibly machine-dependent things around the time of the clock update. This is used in Pentium kernels to disable interrupts, set `time', and reset the CPU cycle counter as quickly as possible to avoid jitter in microtime(). Measurements show an apparent resolution of a bit more than 8.14usec, which is reasonable given system-call overhead. Notes: svn path=/head/; revision=2858