summaryrefslogtreecommitdiffstats
path: root/sys/x86/isa
Commit message (Collapse)AuthorAgeFilesLines
* MFcalloutng:mav2013-02-282-18/+10
| | | | | | | Switch eventtimers(9) from using struct bintime to sbintime_t. Even before this not a single driver really supported full dynamic range of struct bintime even in theory, not speaking about practical inexpediency. This change legitimates the status quo and cleans up the code.
* Use critical_enter/critical_exit around the time sensitive part ofimp2013-02-211-4/+12
| | | | | | | | | | | | | this code to depessimize the worst case we've lived with silently and uneventfully for the past 12 years. Add a comment about a refinement for those needing more assurance of accuracy. Fix ddb's show rtc command deadlock potential when debugging rtc code by not taking the lock if we're in the debugger. If you need a thumb to count the number of people that have encountered this, I'd be surprised. Submitted by: bde
* Correct comment about use of pmtimer, and the real reason it isn'timp2013-02-211-3/+4
| | | | used or desirable for amd64.
* Fix broken usage of splhigh() by removing it.imp2013-02-211-6/+2
|
* Fixup r246916 in case gcc is used to build.davide2013-02-191-0/+2
| | | | Reported by: attilio, simon
* MFcalloutng:mav2013-02-171-4/+21
| | | | | | | Microoptimize i8254 one-shot operation mode (disabled by default to allow timecounter functionality) by not writing to mode and MSB registers when it is not required. This saves several microseconds of CPU time per call, reducing minimal measured interrupts interval to 19.5us.
* This isn't functionally identical. In some cases a hint to disableeadler2012-10-221-0/+2
| | | | | | | | unit 0 would in fact disable all units. This reverts r241856 Approved by: cperciva (implicit)
* Now that device disabling is generic, remove extraneous code from theeadler2012-10-221-2/+0
| | | | | | | | device drivers that used to provide this feature. Reviewed by: des Approved by: cperciva MFC after: 1 week
* Restore proper use of bounce buffers for ISA DMA. When locking wasjhb2012-03-291-2/+3
| | | | | | | | | | added, the call to pmap_kextract() was moved up, and as a result the code never updated the physical address to use for DMA if a bounce buffer was used. Restore the earlier location of pmap_kextract() so it takes bounce buffers into account. Tested by: kargl MFC after: 1 week
* - Fix to build a native i386 kernel without the SMP and atpic.nyan2012-03-162-42/+42
| | | | | | | | | - Merge r232744 changes to pc98. (Allow a kernel to be built with 'nodevice atpic'.) - Move ICU related defines from x86/isa/atpic.c to x86/isa/icu.h and use them in x86/x86/intr_machdep.c. Reviewed by: jhb
* Implement boot-time TSC synchronization test for SMP. This test is executedjkim2011-05-091-1/+0
| | | | | | | when the user has indicated that the system has synchronized TSCs or it has P-state invariant TSCs. For the former case, we may clear the tunable if it fails the test to prevent accidental foot-shooting. For the latter case, we may set it if it passes the test to notify the user that it may be usable.
* Retire isa_setup_intr() and isa_teardown_intr() and use the generic busjhb2011-05-061-22/+0
| | | | | | versions instead. They were never needed as bus_generic_intr() and bus_teardown_intr() had been changed to pass the original child device up in 42734, but the ISA bus was not converted to new-bus until 45720.
* Use newly added rdtsc32() for DELAY(9) as well.jkim2011-04-141-1/+1
|
* Add some tunable descriptions about x86 timers.jkim2011-04-141-1/+2
| | | | Requested by: arundel
* Do not use TSC for DELAY(9) if it not P-state invariant to avoid possiblejkim2011-04-121-1/+1
| | | | | foot-shooting. DELAY() becomes unreliable when TSC frequency varies wildly, especially cpufreq(4) and powerd(8) are used at the same time.
* Merge two similar functions to reduce duplication.jkim2011-04-111-30/+29
|
* Refactor DELAYDEBUG as it is only useful for correcting i8254 frequency.jkim2011-04-081-13/+14
|
* Use atomic load & store for TSC frequency. It may be overkill for amd64 butjkim2011-04-071-4/+6
| | | | | | | | | safer for i386 because it can be easily over 4 GHz now. More worse, it can be easily changed by user with 'machdep.tsc_freq' tunable (directly) or cpufreq(4) (indirectly). Note it is intentionally not used in performance critical paths to avoid performance regression (but we should, in theory). Alternatively, we may add "virtual TSC" with lower frequency if maximum frequency overflows 32 bits (and ignore possible incoherency as we do now).
* When TSC is unavailable, broken or disabled and the current timecounter hasjkim2011-03-141-10/+43
| | | | better quality than i8254 timer, use it for DELAY(9).
* Deprecate rarely used tsc_is_broken. Instead, we zero out tsc_freq becausejkim2011-03-101-1/+1
| | | | it is almost always used with tsc_freq any way.
* Fix typos - remove duplicate "is".brucec2011-02-231-1/+1
| | | | | | PR: docs/154934 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Small style fixes:jhb2010-12-161-10/+10
| | | | | | | | | - Avoid side-effect assignments in if statements when possible. - Don't use ! to check for NULL pointers, explicitly check against NULL. - Explicitly check error return values against 0. - Don't use INTR_MPSAFE for interrupt handlers with only filters as it is meaningless. - Remove unneeded function casts.
* atrtc: remove (pre-)historic check of RTC NVRAM at address 0x0eavg2010-10-161-4/+1
| | | | | | | | | | | | | | Old scrolls tell that once upon a time IBM AT BIOS was known to put some useful system diagnostic information into RTC NVRAM. It is not really known if and for how long PC BIOSes followed that convention, but I believe that many, if not all, modern BIOSes do not do that any more (not mentioning other types of x86 firmware). Some diagnostic bits don't even make any sense any longer. The check results in confusing messages upon boot on some systems. So I am removing it. Discussed with: bde, jhb, mav MFC after: 3 weeks
* Restore pre-r212778 optimization, skipping timer reprogramming when it ismav2010-09-181-19/+27
| | | | | | | | not neccessary. It allows to avoid time counter jump of up to 1/18s, when base frequency slightly tuned via machdep.i8254_freq sysctl. Fix few style things. Suggested by: bde
* Add one-shot mode support to attimer (i8254) event timer.mav2010-09-171-44/+71
| | | | | | | | Unluckily, using one-shot mode is impossible, when same hardware used for time counting. Introduce new tunable hint.attimer.0.timecounter, setting which to 0 disables i8254 time counter and allows one-shot mode. Note, that on some systems there may be no other reliable enough time counters, so this tunable should be used with understanding.
* Fix several un-/signedness bugs of r210290 and r210293. Add one more check.mav2010-07-202-4/+5
|
* Extend timer driver API to report also minimal and maximal supported periodmav2010-07-202-1/+10
| | | | | | lengths. Make MI wrapper code to validate periods in request. Make kernel clock management code to honor these hardware limitations while choosing hz, stathz and profhz values.
* Rise knowledge about curthread->td_intr_frame by one step. Make timermav2010-07-132-9/+4
| | | | | callback argument really opaque. Not repeat interrupt handler's problem in case somebody will ever need to have both argument and frame.
* Unify pc98 event timer code with the rest of x86.mav2010-07-131-0/+97
| | | | Reviewed by: nyan@
* Instead of deleting existing IRQ resource, which is not really working formav2010-07-122-3/+13
| | | | | ACPI bus, find wanted IRQ rid or spare one. This should fix panic during boot on systems reporting fancy IRQ numbers for attimer and atrtc.
* Allow attimer to be hinted at ISA if not reported by ISA PNP or ACPI.mav2010-07-012-7/+12
| | | | Rephrase respective atrtc code same way to be more readable.
* Rework r209456:mav2010-07-012-2/+4
| | | | | Instead of using fake rid (which ISA doesn't like), delete untrusted IRQ resource and let it be recreated.
* Do not trust IRQ reported by ACPI. There are cases when it is wrong.mav2010-06-232-0/+2
|
* Add "legacy route" support to HPET driver. When enabled, this mode makesmav2010-06-222-28/+32
| | | | | | | | | | | | HPET to steal IRQ0 from i8254 and IRQ8 from RTC timers. It can be suitable for HPETs without FSB interrupts support, as it gives them two unshared IRQs. It allows them to provide one per-CPU event timer on dual-CPU system, that should be suitable for further tickless kernels. To enable it, such lines may be added to /boot/loader.conf: hint.atrtc.0.clock=0 hint.attimer.0.clock=0 hint.hpet.0.legacy_route=1
* Fix i386 LINT build broken by r209371.mav2010-06-211-0/+3
| | | | There appeared such legacy thing as APM, that somehow breaking RTC.
* Implement new event timers infrastructure. It provides unified APIs formav2010-06-202-256/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writing event timer drivers, for choosing best possible drivers by machine independent code and for operating them to supply kernel with hardclock(), statclock() and profclock() events in unified fashion on various hardware. Infrastructure provides support for both per-CPU (independent for every CPU core) and global timers in periodic and one-shot modes. MI management code at this moment uses only periodic mode, but one-shot mode use planned for later, as part of tickless kernel project. For this moment infrastructure used on i386 and amd64 architectures. Other archs are welcome to follow, while their current operation should not be affected. This patch updates existing drivers (i8254, RTC and LAPIC) for the new order, and adds event timers support into the HPET driver. These drivers have different capabilities: LAPIC - per-CPU timer, supports periodic and one-shot operation, may freeze in C3 state, calibrated on first use, so may be not exactly precise. HPET - depending on hardware can work as per-CPU or global, supports periodic and one-shot operation, usually provides several event timers. i8254 - global, limited to periodic mode, because same hardware used also as time counter. RTC - global, supports only periodic mode, set of frequencies in Hz limited by powers of 2. Depending on hardware capabilities, drivers preferred in following orders, either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. User may explicitly specify wanted timers via loader tunables or sysctls: kern.eventtimer.timer1 and kern.eventtimer.timer2. If requested driver is unavailable or unoperational, system will try to replace it. If no more timers available or "NONE" specified for second, system will operate using only one timer, multiplying it's frequency by few times and uing respective dividers to honor hz, stathz and profhz values, set during initial setup.
* - Implement MI helper functions, dividing one or two timer interrupts withmav2010-05-241-53/+13
| | | | | | | | arbitrary frequencies into hardclock(), statclock() and profclock() calls. Same code with minor variations duplicated several times over the tree for different timer drivers and architectures. - Switch all x86 archs to new functions, simplifying the code and removing extra logic from timer drivers. Other archs are also welcome.
* Fix another instance of lapic_cyclic_clock_func.rpaulo2010-04-201-2/+2
|
* Default the machdep.lapic_allclocks to be enabled in order to cope withattilio2010-04-091-1/+1
| | | | | | | | | | broken atrtc. Now if you want more correct stats on profhz and stathz it may be disabled by setting to 0. Reported by: A. Akephalos <akephalos dot akephalos at gmail dot com>, Jakub Lach <jakub_lach at mailplus dot pl> MFC: 1 week
* Improving the clocks auto-tunning by firstly checking if the atrtc may beattilio2010-03-031-5/+20
| | | | | | | | | | | | | | | | | | | correctly initialized and just then assign to softclock/profclock. Right now, some atrtc seems reporting strange diagnostic error* making the current pattern bogus. In order to do that cleanly, lapic_setup_clock(), on both ia32 and amd64, now accepts as arguments the desired sources to handle, and returns the actual ones (LAPIC_CLOCK_NONE is forbidden because otherwise there is no meaning in calling such function). This allows to bring out into commont x86 code the handling part for machdep.lapic_allclocks tunable, which is retained. Sponsored by: Sandvine Incorporated Tested by: yongari, Richard Todd <rmtodd at ichotolot dot servalan dot com> MFC: 3 weeks X-MFC: r202387, 204309
* Introduce the new kernel sub-tree x86 which should contain all the codeattilio2010-02-2510-0/+3198
shared and generalized between our current amd64, i386 and pc98. This is just an initial step that should lead to a more complete effort. For the moment, a very simple porting of cpufreq modules, BIOS calls and the whole MD specific ISA bus part is added to the sub-tree but ideally a lot of code might be added and more shared support should grow. Sponsored by: Sandvine Incorporated Reviewed by: emaste, kib, jhb, imp Discussed on: arch MFC: 3 weeks
OpenPOWER on IntegriCloud