summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpivar.h
Commit message (Collapse)AuthorAgeFilesLines
* Allow AcpiOsInstallInterruptHandler() and AcpiOsRemoveInterruptHandler() tojkim2011-01-101-4/+0
| | | | | | | | | install or remove non-SCI interrupt handlers per ACPI Component Architecture User Guide and Programmer Reference. ACPICA may install such interrupt handler when a GPE block device is found, for example. Add a wrapper for ACPI_OSD_HANDLER, convert its return values to ours, and make it a filter. Prefer KASSERT(9) over panic(9) as we have never seen those in reality. Clean up some style(9) nits and add my copyright.
* Use resource_list_reserve() to reserve I/O port and memory resources forjhb2010-12-221-0/+1
| | | | | ACPI devices even if they are not allocated by a device driver since the resources are in use and should not be allocated to another device.
* Make APM emulation look more closer to its origin. Use device_get_softc(9)jkim2010-11-101-1/+1
| | | | instead of hardcoding acpi(4) unit number as we have device_t for it.
* Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a newjkim2010-11-101-0/+3
| | | | file acpi_apm.c, and place it on sys/x86/acpica.
* Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). Thisjhb2010-08-171-0/+2
| | | | | | | | | | method is used by the PCI bus driver to query the power management system to determine the proper device state to be used for a device during suspend and resume. For the ACPI PCI bridge drivers this calls acpi_device_pwr_for_sleep(). This removes ACPI-specific knowledge from the PCI and PCI-PCI bridge drivers. Reviewed by: jkim
* Make table-based HPET identification more clever. Before creating fakemav2010-05-231-0/+1
| | | | | | | device, make sure we have no real HPET device entry with same ID. As side effect, it potentially allows several HPETs to be attached. Use first of them for timecounting, rest (if ever present) could later be used as event sources.
* Merge ACPICA 20100331 (and four additional upstream patches).jkim2010-04-021-1/+0
|
* Merge ACPICA 20100121.jkim2010-01-211-1/+1
|
* acpi: remove 'magic' ivaravg2009-11-071-3/+1
| | | | | | | | | | | | | o acpi_hpet: auto-added 'wildcard' devices can be identified by non-NULL handle attribute. o acpi_ec: auto-add 'wildcard' devices can be identified by unset (NULL) private attribute. o acpi_cpu: use private instead of magic to store cpu id. Reviewed by: jhb Silence from: acpi@ MFC after: 2 weeks X-MFC-Note: perhaps the ivar should stay for ABI stability
* Extract the code to find and map the MADT ACPI table during early kerneljhb2009-09-231-0/+5
| | | | | | | | | startup and genericize it so it can be reused to map other tables as well: - Add a routine to walk a list of ACPI subtables such as those used in the APIC and SRAT tables in the MI acpi(4) driver. - Move the routines for mapping and unmapping an ACPI table as well as mapping the RSDT or XSDT and searching for a table with a given signature out into acpica_machdep.c for both amd64 and i386.
* Catch up with ACPICA 20090903.jkim2009-09-111-1/+1
|
* Catch up with r193750 (OsdSynch.c locking changes):jkim2009-06-101-0/+5
| | | | | | | | | | - Preallocate some memory for ACPI tasks early enough. We cannot use malloc(9) any more because spin mutex may be held here. The reserved memory can be tuned via debug.acpi.max_tasks tunable or ACPI_MAX_TASKS in kernel configuration. The default is 32 tasks. - Implement a custom taskqueue_fast to wrap the new memory allocation. This implementation is not the fastest in the world but we are being conservative here.
* Add a function to reset system time after resuming, which will be usedjkim2009-03-231-0/+1
| | | | | by amd64 shortly. It can be turned off by setting "debug.acpi.reset_clock" tunable to zero.
* Rework how the nexus(4) device works on x86 to better handle the idea ofjhb2008-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different "platforms" on x86 machines. The existing code already handles having two platforms: ACPI and legacy. However, the existing approach was rather hardcoded and difficult to extend. These changes take the approach that each x86 hardware platform should provide its own nexus(4) driver (it can inherit most of its behavior from the default legacy nexus(4) driver) which is responsible for probing for the platform and performing appropriate platform-specific setup during attach (such as adding a platform-specific bus device). This does mean changing the x86 platform busses to no longer use an identify routine for probing, but to move that logic into their matching nexus(4) driver instead. - Make the default nexus(4) driver in nexus.c on i386 and amd64 handle the legacy platform. It's probe routine now returns BUS_PROBE_GENERIC so it can be overriden. - Expose a nexus_init_resources() routine which initializes the various resource managers so that subclassed nexus(4) drivers can invoke it from their attach routine. - The legacy nexus(4) driver explicitly adds a legacy0 device in its attach routine. - The ACPI driver no longer contains an new-bus identify method. Instead it exposes a public function (acpi_identify()) which is a probe routine that the MD nexus(4) drivers can use to probe for ACPI. All of the probe logic in acpi_probe() is now moved into acpi_identify() and acpi_probe() is just a stub. - On i386 and amd64, an ACPI-specific nexus(4) driver checks for ACPI via acpi_identify() and claims the nexus0 device if the probe succeeds. It then explicitly adds an acpi0 device in its attach routine. - The legacy(4) driver no longer knows anything about the acpi0 device. - On ia64 if acpi_identify() fails you basically end up with no devices. This matches the previous behavior where the old acpi_identify() would fail to add an acpi0 device again leaving you with no devices. Discussed with: imp Silence on: arch@
* Fix the HPET table probe routine to run from device_identify() insteadnjl2007-10-091-2/+8
| | | | | | | | | | | | of directly from acpi0. Before it would attach prior to the sysresource devices, causing the later allocation of its memory range to fail and print a warning like "acpi0: reservation of fed00000, 1000 (3) failed". Use an explicit define for our probe order base value of 10. Help from: jhb Tested by: Abdullah Ibn Hamad Al-Marri <almarrie / gmail.com> MFC after: 3 days Approved by: re
* Update the suspend/resume user API while maintaining backwards compat.njl2007-06-211-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improvements: * /etc/rc.suspend,rc.resume are always run, no matter the source of the suspend request (user or kernel, apm or acpi) * suspend now requires positive user acknowledgement. If a user program wants to cancel the suspend, they can. If one of the user programs hangs or doesn't respond within 10 seconds, the system suspends anyway. * /dev/apm is clonable, allowing multiple listeners for suspend events. In the future, xorg-server can use this to be informed about suspend even if there are other listeners (i.e. apmd). Changes: * Two new ACPI ioctls: REQSLPSTATE and ACKSLPSTATE. Request begins the process of suspending by notifying all listeners. acpi is monitored by devd(8) and /dev/apm listener(s) are also counted. Users register their approval or disapproval via Ack. If anyone disapproves, suspend is vetoed. * Old user programs or kernel modules that used SETSLPSTATE continue to work. A message is printed once that this interface is deprecated. * acpiconf gains the -k flag to ack the suspend request. This flag is undocumented on purpose since it's only used by /etc/rc.suspend. It is not intended to be a permanent change and will be removed once a better power API is implemented. * S5 (power off) is no longer supported via acpiconf -s 5 or apm -z/-Z. This restores previous behavior of halt/shutdown -p being the interface. * Miscellaneous improvements to error reporting Approved by: re
* Convert magic to a uintptr_t. This should get rid of some warnings onnjl2007-06-151-2/+2
| | | | gcc4.
* Add ACPI HPET table support.takawata2007-05-151-0/+2
| | | | Reviewed by:njl
* Catch up with ACPI-CA 20070320 import.jkim2007-03-221-0/+2
|
* Re-work Cx handling to be per-cpu and asymmetrical, fixing support onnjl2007-01-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modern dual-core systems as well. - Parse the _CST packages for each cpu and track all the states individually, on a per-cpu basis. - Revert to generic FADT/P_BLK based Cx control if the _CST package is not present on all cpus. In that case, the new driver will still support per-cpu Cx state handling. The driver will determine the highest Cx level that can be supported by all the cpus and configure the available Cx state based on that. - Fixed the case where multiple cpus in the system share the same registers for Cx state handling. To do that, added a new flag parameter to the acpi_PkgGas and acpi_bus_alloc_gas functions that enable the caller to add the RF_SHAREABLE flag. This flag could also be useful to other callers (acpi_throttle?) in the tree but this change is not yet made. - For Core Duo cpus, both cores seems to be taken out of C3 state when any one of the cores need to transition out. This broke the short sleep detection logic. It is disabled now if there is more than one cpu in the system for now as it fixed it in my case. This quirk may need to be re-enabled later differently. - Added support to control cx_lowest on a per-cpu basis. There is still a generic cx_lowest to enable changing cx_lowest for all cpus with a single sysctl and for ease of use. Sample output for the new sysctl: dev.cpu.0.cx_supported: C1/1 C2/1 C3/57 dev.cpu.0.cx_lowest: C3 dev.cpu.0.cx_usage: 0.00% 43.16% 56.83% dev.cpu.1.cx_supported: C1/1 C2/1 C3/57 dev.cpu.1.cx_lowest: C3 dev.cpu.1.cx_usage: 0.00% 45.65% 54.34% hw.acpi.cpu.cx_lowest: C3 This work was done by Stephane E. Potvin with some simple reworking by myself. Thank you. Submitted by: Stephane E. Potvin <sepotvin / videotron.ca> MFC after: 2 weeks
* Add a new sysctl, hw.acpi.handle_reboot. If set, acpi will attempt tonjl2006-07-291-1/+2
| | | | | | | | perform the reboot action via the reset register instead of our legacy method. Default is 0 (use legacy). This is needed because some systems hang on reboot even though they claim to support the reset register. MFC after: 2 days
* Check in file missed in last commit. It made it into the MFC properlynjl2006-06-121-1/+1
| | | | though.
* Add KTR support and move some performance debugging variables in the ECnjl2005-12-061-1/+5
| | | | to KTR. We're reusing the KTR_DEV level.
* Catch up with ACPI-CA 20051021 importjkim2005-11-011-4/+6
|
* Move HPET debugging under ACPI_TIMER in order to save a bitfield.scottl2005-11-011-1/+0
|
* Add proper debugging infrastructure for acpi_hpet.c.scottl2005-11-011-0/+1
|
* Rewrite the acpi_battery interface to allow for other battery typesnjl2005-07-231-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (i.e., smart battery) and fix various bugs found during the cleanup. API changes: * kernel access: Access to individual batteries is now via devclass_find("battery"). Introduce new methods ACPI_BATT_GET_STATUS (for _BST-formatted data) and ACPI_BATT_GET_INFO (for _BIF-formatted data). The helper function acpi_battery_get_battinfo() now takes a device_t instead of a unit # argument. If dev is NULL, this signifies all batteries. * ioctl access: The ACPIIO_BATT_GET_TYPE and ACPIIO_BATT_GET_BATTDESC ioctls have been removed. Since there is now no need for a mapping between "virtual" unit and physical unit, usermode programs can just specify the unit directly and skip the old translation steps. In fact, acpiconf(8) was actually already doing this and virtual unit was the same as physical unit in all cases since there was previously only one battery type (acpi_cmbat). Additionally, we now map the ACPIIO_BATT_GET_BIF and ACPIIO_BATT_GET_BST ioctls for all batteries, if they provide the associated methods. * apm compatibility device/ioctls: no change * sysctl: no change Since most third-party applications use the apm(4) compat interface, there should be very few affected applications (if any). Reviewed by: bruno MFC after: 5 days
* Simplify the ACPI taskqueue implementation. Use a thread queue type insteadmarks2005-05-091-3/+0
| | | | | | | | of swi. This allows us to use the taskqueue_thread_* functions instead of rolling our own. It also avoids a double trip through the queue. Submitted by: njl Reviewed by: sam
* Add the tunable "debug.acpi.max_threads" to allow users to set thenjl2005-04-211-3/+2
| | | | | | | | | number of task threads to start on boot. Go back to a default of 3 threads to work around lost battery state problems. Users that need a setting of 1 can set this via the tunable. I am investigating the underlying issues and this tunable can be removed once they are solved. MFC after: 2 days
* Fix support for _PDC by using the proper version/length format for thenjl2005-04-101-0/+2
| | | | | buffer. Also, reference the Intel document where the _PDC values were found. This now supports ACPI-assisted SpeedStep on my borrowed T42.
* Add the acpi_get_features() method. This method is called on child driversnjl2005-04-041-0/+14
| | | | | | | | | | to see what features they may support before calling identify/probe/attach. This is necessary because the ACPI 3.0 spec requires driver support be advertised before running any methods. For now, the flags are as specified in for the _PDC and _OSC methods but we can support private flags as needed. Add an implementation of this for acpi_cpu. It checks all its children (notably cpufreq drivers) and calls the _PDC method to report the results.
* Serialize task queue by starting only one thread instead of three. Thisnjl2005-03-271-1/+1
| | | | | | | | may help with various interdependencies between subsystems. More testing is needed to understand what the underlying issues are here. Tested by: Juho Vuori MFC after: 2 days
* Fix SCM ID's.obrien2005-03-021-1/+1
|
* Protect acpivar.h with _KERNEL. No user parts inside currently.njl2005-03-021-0/+3
|
* Protect against multiple includes and use _KERNEL to protect the PCI fns.njl2005-02-281-0/+5
|
* - Add a new quirk to indicate that pin 0 of the first I/O APIC is reallyjhb2005-02-221-3/+12
| | | | | | | | | IRQ 0 and not an ExtINT pin. The MADT enumerators ignore the PC-AT flag and ignore overrides that map IRQ 0 to pin 2 when this quirk is present. - Add a block comment above the quirks to document each quirk so that we can use more verbose descriptions quirks. MFC after: 2 weeks
* Convert the acpi_bus_alloc_gas() and acpi_PkgGas() APIs to output the memorynjl2005-02-051-4/+4
| | | | | | type. This is needed if the resource is to be released later. The RID is still also present, though less necessary since rman_get_rid() can be used to obtain it from the resource.
* Unify ACPI_DEBUG support for all OEM drivers under ACPI_OEM. Since more thannjl2004-12-131-2/+1
| | | | | | | one will never be supported on the same platform, this does not hurt debugging. MFC after: 3 days
* Allow the acpi_ibm module to be built with ACPI_DEBUG.scottl2004-12-131-0/+1
|
* Update a quirk for the ASUS P5A to disable the timer. It appears to work finenjl2004-10-081-0/+2
| | | | | | | | | | | | | | with acpi but the timer runs twice as fast. Note that the main problem (system doesn't work properly with acpi disabled) should be fixed separately. Changes: * Add a quirk to disable the timer * Merge the P5A and P5A-B quirks since they appear to be based on the same ASL. PR: i386/72450 Tested by: Kevin Oberman <oberman es.net> MFC after: 3 days
* Add a couple of macros to extract the PCI slot (device) and function fromjhb2004-09-221-0/+4
| | | | | an ACPI _ADR value and use that rather than inlining the same shifts and masks everywhere.
* Rework sysresource management. Instead of having each sysresource objectnjl2004-08-231-2/+0
| | | | | | | | | | | | | | | | | | | | hold its own values, pass them up to the parent (acpi0) and merge/uniq them on the way. After the namespace evaluation, acpi will reserve these resources and manage them via rman before bus_generic_probe() and bus_generic_attach(). This is necessary because some systems specify conflicting resources in separate sysresource objects. It's also cleaner in that the interface between sysresource and acpi is now merely the parent's resource list. This code handles the following cases: 1. Unique resource: add it to the parent via bus_set_resource(). 2. New wholly contained in old: discard new. 3. New tail overlaps old head: grow old head downward. AND/OR 4. New head overlaps old tail: grow old tail upward. Tested by: Pawel Worach <sajd_at_telia.com> Tested by: Radek Kozlowski <radek_at_raadradd.com> MFC after: 5 days
* Remove the ACPIIO_ENABLE and ACPIIO_DISABLE ioctls as well as allnjl2004-08-181-2/+0
| | | | | | | | | | callers. These ioctls attempted to enable and disable the ACPI interpreter at runtime. In practice, it is not possible to boot with ACPI and then disable it on many systems and trying to do so can cause crashes, interrupt storms, etc. Binary compatibility with userland is retained. MFC after: 2 days
* MPSAFE lockingnjl2004-08-131-28/+33
| | | | | | | | * Add and comment our locking primitives. The mutex primitives use a a static mutex and the serialization ones use a static sx lock. A global acpi_mutex is used for access to global resources (i.e., writes to the SMI_CMD register.) * Remove 4.x compat defines.
* Add flags for _STA (status) methods and convenience macros for checkingnjl2004-08-061-1/+15
| | | | the presence of batteries and devices.
* Add the ability to detach a battery. Now batteries that are detached arenjl2004-07-121-0/+1
| | | | also removed from the battery list.
* Move flags into a private ivar so it can't collide with device flags.njl2004-06-301-5/+10
| | | | | | | Unify the code to disable GPEs with the enable code. Shutdown is handled the same way. ACPI now does all wake/sleep prep for child devices so now they no longer need to call external functions in the suspend/resume path. Add the flags to non-ACPI busses (i.e., pci).
* Add machdep quirks functions. On i386, this disables acpi on systems withnjl2004-06-301-0/+6
| | | | BIOS dates earlier than Jan 1, 1999. Add prototypes and quirks flags.
* Staticize acpi_MatchHid() and include acpi_if.hnjl2004-06-291-1/+1
|
* - Defer BUS_CONFIG_INTR() on ACPI IRQ resources until the resources arejhb2004-06-231-0/+4
| | | | | | | | | | | | | | | | | actually used. For most ACPI devices this means deferring the call until bus_alloc_resource(). - Add a function acpi_config_intr() to call BUS_CONFIG_INTR() for an ACPI IRQ resource using the trigger mode and polarity information stored in the ACPI resource object. - Add a function acpi_lookup_irq_resource() to lookup the ACPI IRQ resource that corresponds to a specified rid and new-bus resource. - Have the ACPI PCI bridge driver call BUS_CONFIG_INTR() on interrupts that it routes through link devices. - Remove needactivate variable from acpi_alloc_resource() by changing the function not modify the flags variable but just mask off RF_ACTIVE when calling rman_reserve_resource(). Reviewed by: njl (1, an earlier version)
OpenPOWER on IntegriCloud