summaryrefslogtreecommitdiffstats
path: root/sys/isa/atrtc.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed initialization of a variable that went away. Oops.bde1996-10-261-5/+3
|
* Print the clock calibration messages all on one (long) line again sobde1996-10-251-21/+18
| | | | | | | | that they are easy to grep for. Removed now-unused i586 counter variables. Fixed some style bugs.
* Put I*86_CPU defines in opt_cpu.h.bde1996-10-091-1/+2
|
* Attached simple external ddb commands `show rtc', `show pgrpdump'bde1996-09-141-5/+7
| | | | | and `show cbstat'. The pgrpdump code was previously controlled by `#ifdef DEBUG'.
* Changed cncheckc() interface so that it is 8-bit clean - return -1bde1996-09-141-2/+2
| | | | | | | | | instead of 0 if there is no input. syscons.c: Added missing spl locking in sccncheckc(). Return the same value as sccngetc() would. It is wrong for sccngetc() to return non-ASCII, but stripping the non-ASCII bits doesn't help.
* Eliminated i586_ctr_rate. Use i586_ctr_freq instead.bde1996-08-021-12/+6
|
* Fixed the machdep.i8254_freq and machdep.i586_freq sysctls. Writes werebde1996-07-301-18/+41
| | | | | | | handled bogusly. Centralized the setting of all the frequency variables. Set these variables atomically. Some new ones aren't used yet.
* Post-commit review by Bruce. Mostly stylistic changes.joerg1996-07-211-51/+56
| | | | Submitted by: bde
* Major cleanup of the timerX_{acquire,release} stuff. In particular,joerg1996-07-201-48/+96
| | | | | | | | | | | | | make it more intelligible, improve the partially bogus locking, and allow for a ``quick re-acquiration'' from a pending release of timer 0 that happened ``recently'', so it was not processed yet by clkintr(). This latter modification now finally allows to play XBoing over pcaudio without losing sounds or getting complaints. ;-) (XBoing opens/writes/closes the sound device all over the day.) Correct locking for sysbeep(). Extensively (:-) reviewed by: bde
* Fixed adjustment of `time' when timer0 is released. 27465 was 27645 inbde1996-07-171-2/+2
| | | | | a comment and in code that was only used when pcaudio was closed. The maximum error was 66 usec.
* Use the standard timer (interrupt) frequency while calibrating the clocks.bde1996-07-011-7/+4
| | | | | | | | | | Testing with the high frequency of 20000 Hz (to find problems) only found the problem that this frequency is too high for slow i386's. Disable interrupts while setting the timer frequency. This was unnecessary before rev.1.57 and forgotten in rev.1.57. The critical (i8254) interrupts are disabled in another way at boot time but not in the sysctl to change the frequency.
* In getit(), use read_eflags()/write_eflags() to preserve the interruptbde1996-06-171-3/+8
| | | | | | | | enable flag instead of enable_intr() to restore it to its usual state. getit() is only called from DELAY() so there is no point in optimising its speed (this wasn't so clear when it was extern), and using enable_intr() made it inconvenient to call DELAY() from probes that need to run with interrupts disabled.
* Move warning messages under bootverbosepst1996-06-111-4/+8
|
* Put clock calibration #defines in opt_clock.h to ease reconfigurationpst1996-06-111-1/+2
|
* Added calibration the i8254 and the i586 clocks agains the RTC at bootbde1996-05-011-43/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+23
| | | | | | | | | | | 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
* Fix adjkerntz expression priorityache1996-04-051-3/+3
|
* Add wall_cmos_clock sysctl variable, needed to manage adjkerntz even forache1996-04-051-5/+7
| | | | UTC cmos clocks (needed for Local Timezone FSes)
* Moved rtcin() to clock.c.bde1996-03-311-1/+14
| | | | | | | | 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().
* Whoops, back out the last commit, which was accidentally committed atnate1996-03-231-16/+1
| | | | | | | the same time as the if_zp cleanup patch. The commit that occurred was an incomplete patch for APM on my laptop and needs more work.
* Now that ac->ac_ipaddr and arpwhohas() no longer exist, remove thenate1996-03-231-2/+17
| | | | ifdef'd out code that used it.
* No longer use the cyclecounter to attempt to correct for late or missedwollman1996-01-301-1/+2
| | | | | | | | 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'.
* Since new bcd* macros not argument range overflow resistant,ache1996-01-161-4/+2
| | | | fix argument overflow for years >= 2000
* My wife is busy making me a new conical hat, so you don't need tophk1996-01-151-23/+12
| | | | | send any to me this time. Commited an old copy of this files where the tables were swapped. Duh!.
* Soren called an said that I screwed up badly, so I backup untilphk1996-01-151-11/+22
| | | | I find out how... Sorry.
* Make bin2bcd and bcd2bin global macroes instead of having localphk1996-01-151-23/+12
| | | | implementations all over the place.
* Fixed handling of Feb 29 in resettodr().bde1996-01-121-5/+11
|
* Replace ugly year/month calculations in resettodr to more cleanache1996-01-081-14/+12
| | | | | | variants, idea taken from NetBSD clock.c. At least year calculation was wrong, pointed by Bruce. Use different strategy to store year for BIOS without RTC_CENTURY
* Convert DDB to new-style option.wollman1996-01-041-1/+3
|
* Add Pentium Pro CPU detection and special handling. For now, all thedg1995-12-241-4/+4
| | | | | optimizations we have for 586s also apply to 686s...this will be fine- tuned in the future as appropriate.
* Increase Pentium cyclecounter calibration time to 131072 us. Thiswollman1995-12-201-2/+2
| | | | experimentally seems to give better results on my machine.
* Fixed staticization of DDB functions.bde1995-12-141-2/+2
|
* Staticize and cleanup.phk1995-12-101-5/+5
|
* Fix Pentium CPU rate diagnosis:wollman1995-11-291-8/+8
| | | | | | | | | | | | - 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.
* Remove unused functions and variables, make things static, and other cleanups.phk1995-10-281-2/+2
|
* Reduce jitter of Pentium microtime() implementation by letting the counterwollman1995-10-121-6/+15
| | | | | | | 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.
* Remove extra args from the calls to getit(). The bug was benign with thebde1995-08-251-4/+4
| | | | default function call convention.
* Merge RELENG_2_0_5 into HEADrgrimes1995-06-111-2/+2
|
* Remove trailing whitespace.rgrimes1995-05-301-9/+9
|
* Add variable `idelayed' and macros setdelayed() and schedsofttty()bde1995-05-111-1/+7
| | | | | | | | | | | | to access it. setdelayed() actually ORs the bits in `idelayed' into `ipending' and clears `idelayed'. Call setdelayed() every (normal) clock tick to convert delayed interrupts into pending ones. Drivers can set bits in `idelayed' at any time to schedule an interrupt at the next clock tick. This is more efficient than calling timeout(). Currently only software interrupts can be scheduled.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-5/+8
| | | | | | (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.
* Submitted by: Bruce Evansats1995-01-191-30/+9
| | | | | | Put in the much shorter and cleaner version for the calibrate_cycle_counter for the Pentium that Bruce suggested. Tested here on my Pentium and it works okay.
* Work around a compiler bug in gcc2.6.3 in handling (long long) variables andats1995-01-071-3/+24
| | | | | | | shifting. Also correct the original code as Garrett noticed it in mail. Leave the mishandled code in to use it later if future versions of gcc are correct. The code was part of the calibrate_cyclecounter routine to get the speed of the pentium chip.
* icu.s:bde1994-12-301-78/+40
| | | | | | | | | | | | | | | | | | | | | Move definition of `stat_imask' to clock.c. clock.c: Rename `rtcmask' to `stat_imask' and export it. Rename `clkmask' to `clk_imask' for consistency. Only calculate TIMER_DIV(hz) once. Merge debugging and "garbage" code to produce debugging code and format the output better. Make writertc() static inline and use it everywhere. Now all accesses to the clock registers go through rtcin() and writertc(). Move rtc initialization to cpu_initclocks(). Merge enablertclock() with cpu_initclocks() and remove enablertclock(). The extra entry point was just a leftover from 1.1.5.
* Revision 1.6 fix was lost: don't write 0 to RTC_DIAGache1994-11-121-2/+1
|
* Use adjkerntz into inittodr too (for APM stuff)ache1994-11-101-2/+2
|
* Maintain a new variable `timer0_overflow_threshold' so that microtime()bde1994-11-051-41/+87
| | | | | | | | | | | | | | | | | | | | | doesn't have to calculate it every call. Rename `timer0_prescale' to `timer0_prescaler_count' and maintain it correctly. Previously we lost a few 8253 cycles for every "prescaled" clock interrupt, and the lossage grows rapidly at 16 KHz. Now we only lose a few cycles for every standard clock interrupt. Rename `*_divisor' to `*_max_count'. Do the calculation of TIMER_DIV(rate) only once instead of 3 times each time the rate is changed. Don't allow preposterously large interrupt rates. Bug fixes elsewhere should allow the system to survive rates that saturate the system, however. Clean up declarations. Include <machine/clock.h> to check our own declarations.
* BEWARE: Interface change of register_intr() !se1994-10-251-3/+7
| | | | | | Changed the fifth parameter to register_intr() from u_int mask into u_int *maskptr in preparation for new features (shared interrupts and removable devices, eg. for PCMCIA).
* Add disable_rtc_set variable to block resettodr() call, needed forache1994-10-041-2/+6
| | | | adjkerntz -i, per Bruce suggestion
* RTC_CENTURY usage ifdefed out by USE_RTC_CENTURY compile option,ache1994-10-041-1/+9
| | | | pointed by Bruce
OpenPOWER on IntegriCloud