summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_timer.c
Commit message (Collapse)AuthorAgeFilesLines
* o Don't announce that the timer is good when in fact it isn't timingmarcel2003-04-301-22/+43
| | | | | | | | | | | | | | | | at all (ie reads yield constant values). Display the width as the difference between max and min so that constant timers have width zero. o Get the address of the timer from the XPmTmrBlk field instead of the V1_PmTmrBlk field. The former is a generic address and can specify a memory mapped I/O address. Remove <machine/bus_pio.h> to account for this. The timer is now properly configured on machines with ACPI v2 tables, whether PIO or MEMIO. Note that the acpica code converts v1 tables into v2 tables so the address is always present in XPmTmrBlk. o Replace the TIMER_READ macro with a call to the read_counter() function and add a barrier to make sure that we observe proper ordering of the reads.
* struct timecounter is defined in sys/time.h on 4-stable.jhb2002-10-161-0/+4
| | | | Sponsored by: The Weather Channel
* Include <dev/acpica/acpivar.h> instead of <acpica/acpivar.h> like all thejhb2002-10-091-1/+1
| | | | other sys/dev/acpica files.
* Brutally deal with __func__ being 'const char *' on gcc-3.1.peter2002-05-191-1/+1
|
* Don't export timecounter structures under debug. with sysctl, theyphk2002-04-301-2/+0
| | | | contain no truly interesting data anymore.
* Remove the tc_update() function. Any frequency change to thephk2002-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.
* Rework the kernel environment subsystem. We now convert the staticmux2002-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
* Hide the ACPI counter probing printf behind bootverbose.phk2002-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!
* Add a new test_counter() function which tries to determine the width ofphk2002-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
* Tests by numerous people have shown that many chipsets do not properlydillon2002-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
* Match namespace cleanup changes in ACPI CA 20020217 update.msmith2002-02-231-2/+2
|
* Staticise devclasses and some unnecessarily global variables.msmith2002-01-081-1/+1
|
* The Intel 440MX ACPI timer seems to work properly, so add it to the listmsmith2001-08-051-5/+12
| | | | | | here. Restructure slightly so that adding more devices is easier. Submitted by: Jose Gabriel J Marcelino <gabriel@maquina.com>
* Reverse the logic here again with regards to "trusted" ACPI timermsmith2001-08-031-30/+54
| | | | | implementations. More of them seem to be broken, so only "trust" timers we know work.
* Minor updates (no functional changes)msmith2001-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.
* The ACPI timer register corruption problem is resolved in the PIIX4msmith2001-07-271-4/+6
| | | | | starting with the PIIX4M. Restrict enabling the workaround to those chips known to be buggy.
* Implement a "proper" timecounter hung off the ACPI timer device.msmith2001-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.
* - Updates for new constant naming in the ACPI CA 20010518 update.msmith2001-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).
* ACPI_NUMBER becomes ACPI_INTEGER. acpi_EvaluateNumber becomesmsmith2001-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.
* - Convert a lot of homebrew debugging output to use the ACPI CA debuggingmsmith2000-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.
* Update to work with the new ACPI CA snapshot.msmith2000-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
* Initial FreeBSD OSPM (operating system power management) modules formsmith2000-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.
OpenPOWER on IntegriCloud