summaryrefslogtreecommitdiff
path: root/sys/dev/acpica/acpi_timer.c
Commit message (Collapse)AuthorAgeFilesLines
* struct timecounter is defined in sys/time.h on 4-stable.John Baldwin2002-10-161-0/+4
| | | | | | | Sponsored by: The Weather Channel Notes: svn path=/head/; revision=105281
* Include <dev/acpica/acpivar.h> instead of <acpica/acpivar.h> like all theJohn Baldwin2002-10-091-1/+1
| | | | | | | other sys/dev/acpica files. Notes: svn path=/head/; revision=104726
* Brutally deal with __func__ being 'const char *' on gcc-3.1.Peter Wemm2002-05-191-1/+1
| | | | Notes: svn path=/head/; revision=96926
* Don't export timecounter structures under debug. with sysctl, theyPoul-Henning Kamp2002-04-301-2/+0
| | | | | | | contain no truly interesting data anymore. Notes: svn path=/head/; revision=95814
* Remove the tc_update() function. Any frequency change to thePoul-Henning Kamp2002-04-261-1/+0
| | | | | | | | | timecounter will be used starting at the next second, which is good enough for sysctl purposes. If better adjustment is needed the NTP PLL should be used. Notes: svn path=/head/; revision=95489
* Rework the kernel environment subsystem. We now convert the staticMaxime Henrion2002-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | environment needed at boot time to a dynamic subsystem when VM is up. The dynamic kernel environment is protected by an sx lock. This adds some new functions to manipulate the kernel environment : freeenv(), setenv(), unsetenv() and testenv(). freeenv() has to be called after every getenv() when you have finished using the string. testenv() only tests if an environment variable is present, and doesn't require a freeenv() call. setenv() and unsetenv() are self explanatory. The kenv(2) syscall exports these new functionalities to userland, mainly for kenv(1). Reviewed by: peter Notes: svn path=/head/; revision=94936
* Hide the ACPI counter probing printf behind bootverbose.Poul-Henning Kamp2002-03-241-3/+4
| | | | | | | | | | | | | | | The conclusion is that this method really can tell the perfect from the less than perfect ACPI counters. It is in fact probably a bit more discriminative than that, but we will rather condemn some otherwise perfect counters to the slightly slower "-safe" version, than certify a counter as perfect which will let us down later. Many thanks to all the people who sent email reports! Notes: svn path=/head/; revision=93093
* Add a new test_counter() function which tries to determine the width ofPoul-Henning Kamp2002-02-251-17/+46
| | | | | | | | | | | | | | | | | | | | the inter-value histogram for 2000 samples. If the width is 3 or less for 10 consequtive samples, we trust the counter to be good, otherwise we use the *_safe() method. This method may be too strict, but the worst which can happen is that we take the performance hit of the *_safe() method when we should not. Make the *_safe() method more discriminating by mandating that the three samples do not span more than 15 ticks on the counter. Disable the PCI-ident based probing as a means to recognize good counters. Inspiration from: dillon and msmith Notes: svn path=/head/; revision=91237
* Tests by numerous people have shown that many chipsets do not properlyMatthew Dillon2002-02-241-1/+1
| | | | | | | | | | | | | | latch the acpi timer, resulting in weird deltas. The problem is severe enough to adversely effect the timecounter code. Default to the 'safe' version of the get-timecount function. The probe will override it if a known-good chipset is found. This is temporary until a more complete solution is found. Reviewed by: phk Notes: svn path=/head/; revision=91204
* Match namespace cleanup changes in ACPI CA 20020217 update.Mike Smith2002-02-231-2/+2
| | | | Notes: svn path=/head/; revision=91128
* Staticise devclasses and some unnecessarily global variables.Mike Smith2002-01-081-1/+1
| | | | Notes: svn path=/head/; revision=89054
* The Intel 440MX ACPI timer seems to work properly, so add it to the listMike Smith2001-08-051-5/+12
| | | | | | | | | here. Restructure slightly so that adding more devices is easier. Submitted by: Jose Gabriel J Marcelino <gabriel@maquina.com> Notes: svn path=/head/; revision=81172
* Reverse the logic here again with regards to "trusted" ACPI timerMike Smith2001-08-031-30/+54
| | | | | | | | implementations. More of them seem to be broken, so only "trust" timers we know work. Notes: svn path=/head/; revision=81096
* Minor updates (no functional changes)Mike Smith2001-07-301-86/+82
| | | | | | | | | | | - Remove the beer-ware license (reqested by phk) - Reorganise so that the PIIX4 workaround code is kept together, and switch the workaround function via the timecounter struct, saving a compare in the read-timecounter codepath. Also indicate that the workaround is active by changing the timecounter hardware string. Notes: svn path=/head/; revision=80602
* The ACPI timer register corruption problem is resolved in the PIIX4Mike Smith2001-07-271-4/+6
| | | | | | | | starting with the PIIX4M. Restrict enabling the workaround to those chips known to be buggy. Notes: svn path=/head/; revision=80442
* Implement a "proper" timecounter hung off the ACPI timer device.Mike Smith2001-07-211-20/+207
| | | | | | | | | | | | This code is based on the mp_clock code by phk. It attempts to detect the PIIX4 (see comments for details) and use a workaround for its problems. This code is experimental, and could use some testing and review by a timekeeping enthusiast. Notes: svn path=/head/; revision=80070
* - Updates for new constant naming in the ACPI CA 20010518 update.Mike Smith2001-05-291-3/+3
| | | | | | | | | | | | | | - Use __func__ instead of __FUNCTION. - Support power-off to S3 or S5 (takawata) - Enable ACPI debugging earlier (with a sysinit) - Fix a deadlock in the EC code (takawata) - Improve arithmetic and reduce the risk of spurious wakeup in AcpiOsSleep. - Add AcpiOsGetThreadId. - Simplify mutex code (still disabled). Notes: svn path=/head/; revision=77432
* ACPI_NUMBER becomes ACPI_INTEGER. acpi_EvaluateNumber becomesMike Smith2001-01-311-14/+3
| | | | | | | | | | | | | | acpi_EvaluateInteger. Use acpi_EvaluateInteger instead of doing things the hard way where possible. AcpiSetSystemSleepState (unofficial) becomes AcpiEnterSleepState. Use the AcpiGbl_FADT pointer rather than searching for the FADT. Notes: svn path=/head/; revision=71872
* - Convert a lot of homebrew debugging output to use the ACPI CA debuggingMike Smith2000-12-081-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | infrastructure. It's not perfect, but it's a lot better than what we've been using so far. The following rules apply to this: o BSD component names should be capitalised o Layer names should be taken from the non-CA set for now. We may elect to add some new BSD-specific layers later. - Make it possible to turn off selective debugging flags or layers by listing them in debug.acpi.layer or debug.acpi.level prefixed with !. - Fully implement support for avoiding nodes in the ACPI namespace. Nodes may be listed in the debug.acpi.avoid environment variable; these nodes and all their children will be ignored (although still scanned over) by ACPI functions which scan the namespace. Multiple nodes can be specified, separated by whitespace. - Implement support for selectively disabling ACPI subsystem components via the debug.acpi.disable environment variable. The following components can be disabled: o bus creation/scanning of the ACPI 'bus' o children attachment of children to the ACPI 'bus' o button the acpi_button control-method button driver o ec the acpi_ec embedded-controller driver o isa acpi replacement of PnP BIOS for ISA device discovery o lid the control-method lid switch driver o pci pci root-bus discovery o processor CPU power/speed management o thermal system temperature detection and control o timer ACPI timecounter Multiple components may be disabled by specifying their name(s) separated by whitespace. - Add support for ioctl registration. ACPI subsystem components may register ioctl handlers with the /dev/acpi generic ioctl handler, allowing us to avoid the need for a multitude of /dev/acpi* control devices, etc. Notes: svn path=/head/; revision=69744
* Update to work with the new ACPI CA snapshot.Mike Smith2000-12-011-13/+13
| | | | | | | | | | | | | - Use ACPI_PHYSICAL_ADDRESS - RSDT -> XSDT - FACP -> FADT - No APIC table support - Don't install a global EC handler; this has bad side-effects (it invokes _REG in *all* EC spaces in the namespace!) - Check for PCI bus instances already existing before adding them Notes: svn path=/head/; revision=69458
* Initial FreeBSD OSPM (operating system power management) modules forMike Smith2000-10-281-0/+117
ACPICA. Most of these are still works in progress. Support exists for: - Fixed feature and control method power, lid and sleep buttons. - Detection of ISA PnP devices using ACPI namespace. - Detection of PCI root busses using ACPI namespace. - CPU throttling and sleep states (incomplete) - Thermal monitoring and cooling control (incomplete) - Interface to platform embedded controllers (mostly complete) - ACPI timer (incomplete) - Simple userland control of sleep states. - Shutdown and poweroff. Notes: svn path=/head/; revision=67761