summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpivar.h
Commit message (Collapse)AuthorAgeFilesLines
* Add a new bus method to fetch device-specific CPU sets.jhb2016-05-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bus_get_cpus() returns a specified set of CPUs for a device. It accepts an enum for the second parameter that indicates the type of cpuset to request. Currently two valus are supported: - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to the device when DEVICE_NUMA is enabled) - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core) For systems that do not support NUMA (or if it is not enabled in the kernel config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus' by default. The idea is that INTR_CPUS should always return a valid set. Device drivers which want to use per-CPU interrupts should start using INTR_CPUS instead of simply assigning interrupts to all available CPUs. In the future we may wish to add tunables to control the policy of INTR_CPUS (e.g. should it be local-only or global, should it ignore SMT threads or not). The x86 nexus driver exposes the internal set of interrupt CPUs from the the x86 interrupt code via INTR_CPUS. The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and the global INTR_CPUS set from the nexus driver with the per-domain set from _PXM to generate a local INTR_CPUS set for child devices. Compared to the r298933, this version uses 'struct _cpuset' in <sys/bus.h> instead of 'cpuset_t' to avoid requiring <sys/param.h> (<sys/_cpuset.h> still requires <sys/param.h> for MAXCPU even though <sys/_bitset.h> does not after recent changes).
* Revert bus_get_cpus() for now.jhb2016-05-031-2/+1
| | | | | I really thought I had run this through the tinderbox before committing, but many places need <sys/types.h> -> <sys/param.h> for <sys/bus.h> now.
* Add a new bus method to fetch device-specific CPU sets.jhb2016-05-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bus_get_cpus() returns a specified set of CPUs for a device. It accepts an enum for the second parameter that indicates the type of cpuset to request. Currently two valus are supported: - LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to the device when DEVICE_NUMA is enabled) - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core) For systems that do not support NUMA (or if it is not enabled in the kernel config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus' by default. The idea is that INTR_CPUS should always return a valid set. Device drivers which want to use per-CPU interrupts should start using INTR_CPUS instead of simply assigning interrupts to all available CPUs. In the future we may wish to add tunables to control the policy of INTR_CPUS (e.g. should it be local-only or global, should it ignore SMT threads or not). The x86 nexus driver exposes the internal set of interrupt CPUs from the the x86 interrupt code via INTR_CPUS. The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and the global INTR_CPUS set from the nexus driver with the per-domain set from _PXM to generate a local INTR_CPUS set for child devices. Reviewed by: wblock (manpage) Differential Revision: https://reviews.freebsd.org/D5519
* Adjust prototypes for NUMA-related functions to match the style of thejhb2016-04-271-3/+3
| | | | rest of this file.
* Optionally return the output capabilities list from _OSC.jhb2016-04-221-1/+2
| | | | | | | | Both of the callers were expecting the input cap_set to be modified. This fixes them to request cap_set to be updated with the returned buffer. Reviewed by: jkim Differential Revision: https://reviews.freebsd.org/D6040
* Remove query flag from acpi_EvaluateOSC(). This function does not supportjkim2016-04-201-1/+1
| | | | return buffer (yet).
* Add a wrapper for evaluating _OSC methods.jhb2016-04-201-0/+2
| | | | | | | | | | | This wrapper does not translate errors in the first word to ACPI error status returns. Use this wrapper in the acpi_cpu(4) driver in place of the existing _OSC code. While here, fix a bug where the wrong count of words was passed when invoking _OSC. Reviewed by: jkim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6022
* Add more fine-grained kernel options for NUMA support.jhb2016-04-091-2/+0
| | | | | | | | | | | | | VM_NUMA_ALLOC is used to enable use of domain-aware memory allocation in the virtual memory system. DEVICE_NUMA is used to enable affinity reporting for devices such as bus_get_domain(). MAXMEMDOM must still be set to a value greater than for any NUMA support to be effective. Note that 'cpuset -gd' always works if MAXMEMDOM is enabled and the system supports NUMA. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5782
* Some BIOSes ACPI bytecode needs to take (sleepable) acpi mutex forkib2016-02-201-0/+2
| | | | | | | | | | | | | | | acpi_GetInteger() execution. Intel DMAR interrupt remapping code needs to know UID of the HPET to properly route the FSB interrupts from the HPET, even when interrupt remapping is disabled, and the code is executed under some non-sleepable mutexes. Cache HPET UIDs in the device softc at the attach time and provide lock-less method to get UID, use the method from the dmar hpet handling code instead of calling GetInteger(). Reported and tested by: Larry Rosenman <ler@lerctr.org> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Convert rman to use rman_res_t instead of u_longjhibbits2016-01-271-1/+2
| | | | | | | | | | | | | | | | | | | | Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075
* If x86 CPU implementation of the MWAIT instruction reasonablykib2015-05-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | interacts with interrupts, query ACPI and use MWAIT for entrance into Cx sleep states. Support C1 "I/O then halt" mode. See Intel' document 302223-007 "Intelб╝ Processor Vendor-Specific ACPI Interface Specification" for description. Move the acpi_cpu_c1() function into x86/cpu_machdep.c and use it instead of inlining "sti; hlt" sequence in several places. In the acpi(4) man page, besides documenting the dev.cpu.N.cx_methods sysctl, correct the names for dev.cpu.N.{cx_usage,cx_lowest,cx_supported} sysctls. Both jkim and avg have some other patches implementing the mwait functionality; this work is unrelated. Linux does not rely on the ACPI to provide correct tables describing Cx modes. Instead, the driver has pre-defined knowledge of the CPU models, it was supplied by Intel. Tested by: pho (previous versions) Sponsored by: The FreeBSD Foundation
* Refactor out the _PXM -> VM domain lookup done in ACPI, in preparation foradrian2015-04-191-1/+1
| | | | | | | | | | | | | its use in upcoming code. This is inspired by something in jhb's NUMA IRQ allocation patchset. However, the tricky bit here is that the PXM lookup for a node may fail, requiring a lookup on the parent node. So if it doesn't exist, don't fail - just go up to the parent. Only error out of the lookup is the ACPI lookup returns an error. Sponsored by: Norse Corp, Inc.
* Define capabilities bits from the revision 007 of the document 302223kib2015-04-121-1/+4
| | | | | | | | "Intelб╝ Processor Vendor-Specific ACPI Interface Specification", issied Dec 2014. Previous revision 005 was from Sep 2006. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Add a bus method to fetch the VM domain for the given device/bus.adrian2014-10-091-0/+11
| | | | | | | | | | | | | | | | | | | * Add a bus_if.m method - get_domain() - returning the VM domain or ENOENT if the device isn't in a VM domain; * Add bus methods to print out the domain of the device if appropriate; * Add code in srat.c to save the PXM -> VM domain mapping that's done and expose a function to translate VM domain -> PXM; * Add ACPI and ACPI PCI methods to check if the bus has a _PXM attribute and if so map it to the VM domain; * (.. yes, this works recursively.) * Have the pci bus glue print out the device VM domain if present. Note: this is just the plumbing to start enumerating information - it doesn't at all modify behaviour. Differential Revision: D906 Reviewed by: jhb Sponsored by: Norse Corp
* Increase ACPI_MAX_TASKS to be 4 x the number of CPU's as 2 x was stillsmh2014-04-241-1/+1
| | | | | | insufficient on some machines MFC after: 2 weeks
* Update MAX_TASKS to scale a bit based on MAXCPUsbruno2012-11-121-1/+1
| | | | | | | | | This alleviates issues on newer Sandy/Ivy Bridge gear that seems to require boatloads more ACPI resources than before. Reviewed by: avg@ Obtained from: Yahoo! Inc. MFC after: 2 weeks
* Merge ACPICA 20120816.jkim2012-08-161-5/+0
|
* Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference ofiwasaki2012-06-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | suspend/resume procedures are minimized among them. common: - Add global cpuset suspended_cpus to indicate APs are suspended/resumed. - Remove acpi_waketag and acpi_wakemap from acpivar.h (no longer used). - Add some variables in acpi_wakecode.S in order to minimize the difference among amd64 and i386. - Disable load_cr3() because now CR3 is restored in resumectx(). amd64: - Add suspend/resume related members (such as MSR) in PCB. - Modify savectx() for above new PCB members. - Merge acpi_switch.S into cpu_switch.S as resumectx(). i386: - Merge(and remove) suspendctx() into savectx() in order to match with amd64 code. Reviewed by: attilio@, acpi@
* Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible.jkim2012-06-011-1/+1
|
* Call AcpiLeaveSleepStatePrep() in interrupt disabled contextiwasaki2012-06-011-0/+2
| | | | | | | | | | | | | | | | | | (described in ACPICA source code). - Move intr_disable() and intr_restore() from acpi_wakeup.c to acpi.c and call AcpiLeaveSleepStatePrep() in interrupt disabled context. - Add acpi_wakeup_machdep() to execute wakeup MD procedures and call it twice in interrupt disabled/enabled context (ia64 version is just dummy). - Rename wakeup_cpus variable in acpi_sleep_machdep() to suspcpus in order to be shared by acpi_sleep_machdep() and acpi_wakeup_machdep(). - Move identity mapping related code to acpi_install_wakeup_handler() (i386 version) for preparation of x86/acpica/acpi_wakeup.c (MFC candidate). Reviewed by: jkim@ MFC after: 2 days
* Centralize declaration of the debug.acpi sysctl node.jhb2012-05-171-0/+2
|
* Merge ACPICA 20120320.jkim2012-03-201-0/+5
|
* Reset clock after atrtc(4) is properly resumed.jkim2012-02-081-1/+0
|
* - Give all clocks and timers on acpi0 the equal probing order.jkim2012-02-071-1/+1
| | | | | | | - Increase probing order for ECDT table to match HID-based probing. - Decrease probing order for HPET table to match HID-based probing. - Decrease probing order for CPUs and system resources. - Fix ACPI_DEV_BASE_ORDER to reflect the reality.
* If an allocation for a specific resource range fails because it is not injhb2011-10-121-0/+2
| | | | | | | | a decoded range for an ACPI Host-PCI bridge, try to allocate it from the ACPI system resource range. If that works, permit the resource allocation regardless. MFC after: 1 week
* Use AcpiWalkResources() to parse the resource list from _CRS rather thanjhb2011-06-211-11/+11
| | | | | | | using a home-rolled loop. While here, add support for 64-bit address range resources. Silence on: acpi@ (older version)
* Move a trivial acpi_TimerDelta() to acpivar.h to make it inlineable.jkim2011-04-041-1/+10
|
* Add more definitions for vendor-specific CPU capability bits to the lastjkim2011-02-251-11/+13
| | | | revision, which is renamed to "Intel Processor Vendor-Specific ACPI".
* 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.
OpenPOWER on IntegriCloud