summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/clock.h
Commit message (Collapse)AuthorAgeFilesLines
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* i8254_restore is called from apm_default_resume() to reloadiwasaki1999-10-301-0/+1
| | | | | | | | | | | | the countdown register. this should not be necessary but there are broken laptops that do not restore the countdown register on resume. when it happnes, it messes up the hardclock interval and system clock, which leads to the infamous "calcru: negative time" problem. Submitted by: kjc, iwasaki Reviewed by: Steve O'Hara-Smith <steveo@eircom.net> and committers. Obtained from: PAO3
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Stop the TSC from being used as timecounter on K5/step0 machines.phk1999-05-291-1/+2
|
* Remove special handling for resuming clock interrupt when using APIC_IO.tegge1998-03-051-1/+4
| | | | The `generic' vector stubs do the right thing.
* Removed vestiges of previous microtime() implementation.bde1998-02-251-6/+2
|
* Replace TOD clock code with more systematic approach.phk1998-02-201-65/+1
| | | | | | | | | | | | | | | 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
* Fixed a recently broken comment.bde1998-02-011-4/+4
|
* More cleanup relating to our use of the TSC.phk1997-12-281-13/+1
| | | | Look in the cpu_feature (CPUID output) to see if we have it.
* wash, sort and put in order various nits from the i586_ctr -> tscphk1997-12-281-11/+11
| | | | | | commit. Pointed out by: bde
* Rename "i586_ctr" to "tsc" (both upper and lower case instances).phk1997-12-261-13/+13
| | | | | | Fix a couple of printfs too. Warning: This changes the names of a couple of kernel options!
* correct the order of the variablespeter1997-05-051-3/+5
| | | | | | use #ifdef where possible instead of #if defined Submitted by: the KNF police, ie: bde :-)
* Don't remove i586_ctr_freq from scope, leave it defined as zero. Thispeter1997-05-041-3/+5
| | | | | | | simplifies some assumptions and stops some code compile problems. This should fix the compile hiccup in PR#3491, but smp kernel profiling isn't likely to be fixed by this.
* Man the liferafts! Here comes the long awaited SMP -> -current merge!peter1997-04-261-4/+4
| | | | | | | | | | | | | | | | 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!
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-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.
* Staticize the functions rtc_inb, rtc_outb, rtc_serialcombit, andkato1997-01-101-4/+1
| | | | rtc_serialcom. These functions are only used by PC98.
* More merge and update.asami1996-10-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | (1) deleted #if 0 pc98/pc98/mse.c (2) hold per-unit I/O ports in ed_softc pc98/pc98/if_ed.c pc98/pc98/if_ed98.h (3) merge more files by segregating changes into headers. new file (moved from pc98/pc98): i386/isa/aic_98.h deleted: well, it's already in the commit message so I won't repeat the long list here ;) Submitted by: The FreeBSD(98) Development Team
* Improved biasing of i586 clock by adjusting for hardclock() latency.bde1996-10-251-51/+62
| | | | | | | | | | | | | | | | | | | | | 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.
* Added missing extern declaration of timer_freq.bde1996-10-171-8/+7
| | | | Sorted declarations of scalars.
* Don't include "opt_cpu.h" in <machine/clock.h>, since this breaks lkm's.bde1996-10-101-3/+1
| | | | | The change breaks kern_clock.c; fix that temporarily by including "opt_cpu.h" there.
* Put I*86_CPU defines in opt_cpu.h.bde1996-10-091-1/+3
|
* Eliminated i586_ctr_rate. Use i586_ctr_freq instead.bde1996-08-021-8/+6
| | | | | | | Changed i586_ctr_bias from long long to u_int. Only the low 32 bits are used now that microtime uses a multiplication to do the scaling. Previously the high 32 bits had to match those of rdtsc() to prevent overflow traps and invalid timeval adjustments.
* Fixed the machdep.i8254_freq and machdep.i586_freq sysctls. Writes werebde1996-07-301-2/+6
| | | | | | | handled bogusly. Centralized the setting of all the frequency variables. Set these variables atomically. Some new ones aren't used yet.
* The Great PC98 Merge.asami1996-06-141-1/+9
| | | | | | | | All new code is "#ifdef PC98"ed so this should make no difference to PC/AT (and its clones) users. Ok'd by: core Submitted by: FreeBSD(98) development team
* Added calibration the i8254 and the i586 clocks agains the RTC at bootbde1996-05-011-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | time. The results are currently ignored unless certain temporary options are used. Added sysctls to support reading and writing the clock frequency variables (not the frequencies themselves). Writing is supposed to atomically adjust all related variables. machdep.c: Fixed spelling of a function name in a comment so that I can log this message which should have been with the previous commit. Initialize `cpu_class' earlier so that it can be used in startrtclock() instead of in calibrate_cyclecounter() (which no longer exists). Removed range checking of `cpu'. It is always initialized to CPU_XXX so it is less likely to be out of bounds than most variables. clock.h: Removed I586_CYCLECTR(). Use rdtsc() instead. clock.c: TIMER_FREQ is now a variable timer_freq that defaults to the old value of TIMER_FREQ. #define'ing TIMER_FREQ should still work and may be the best way of setting the frequency. Calibration involves counting cycles while watching the RTC for one second. This gives values correct to within (a few ppm) + (the innaccuracy of the RTC) on my systems.
* - add apm to the GENERIC kernel (disabled by default), and add some commentsnate1996-04-221-1/+2
| | | | | | | | | | | regarding apm to LINT - Disabled the statistics clock on machines which have an APM BIOS and have the options "APM_BROKEN_STATCLOCK" enabled (which is default in GENERIC now) - move around some of the code in clock.c dealing with the rtc to make it more obvios the effects of disabling the statistics clock Reviewed by: bde
* Add wall_cmos_clock sysctl variable, needed to manage adjkerntz even forache1996-04-051-1/+3
| | | | UTC cmos clocks (needed for Local Timezone FSes)
* Moved rtcin() to clock.c.bde1996-03-311-1/+2
| | | | | | | | Always delay using one inb(0x84) after each i/o in rtcin() - don't do this conditional on the bogus option DUMMY_NOPS not being defined. If you want an optionally slightly faster rtcin() again, then inline it and use a better named option or sysctl variable. It only needs to be fast in rtcintr().
* No longer use the cyclecounter to attempt to correct for late or missedwollman1996-01-301-6/+6
| | | | | | | | clock interrupts. Keep a 1-in-16 smoothed average of the length of each tick. If the CPU speed is correctly diagnosed, this should give experienced users enough information to figure out a more suitable value for `tick'.
* Add Pentium Pro CPU detection and special handling. For now, all thedg1995-12-241-5/+5
| | | | | optimizations we have for 586s also apply to 686s...this will be fine- tuned in the future as appropriate.
* Staticize and cleanup.phk1995-12-101-3/+1
|
* Fix Pentium CPU rate diagnosis:wollman1995-11-291-4/+9
| | | | | | | | | | | | - Don't print out meaningless iCOMP numbers, those are for droids. - Use a shorter wait to determine clock rate to avoid deficiencies in DELAY(). - Use a fixed-point representation with 8 bits of fraction to store the rate and rationalize the variable name. It would be possible to use even more fraction if it turns out to be worthwhile (I rather doubt it). The question of source code arrangement remains unaddressed.
* Reduce jitter of Pentium microtime() implementation by letting the counterwollman1995-10-121-23/+38
| | | | | | | free-run and doing a subtract in microtime() rather than resetting the counter to zero at every clock tick. In combination with the changes to kern_clock.c, this should eliminate all the immediately obvious sources of systematic jitter in timekeeping on Pentium machines.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-7/+0
| | | | | | (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.
* Declare the full uglyness of the interfaces to the clock driver (exceptbde1994-11-051-6/+46
| | | | things declared in machine-independent files).
* apm_bios.h: removed the equiv-stuff. Not needed now that the kernel modulephk1994-10-021-0/+2
| | | | | | works correctly. clock.h & reg.h: prototypes.
* Redo Kernel NTP PLL support, kernel side.wollman1994-09-181-0/+49
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.
OpenPOWER on IntegriCloud