summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
Commit message (Collapse)AuthorAgeFilesLines
* Move the pnp and location info into the common pci bus. Make all knownimp2003-02-171-0/+2
| | | | | | | | | pci busses implement this. Also minor comment smithing in cardbus. Fix copyright to this year with my name on it since I've been doing a lot to this file. Reviewed by: jhb
* Allow non-privilaged user to retrive battery or AC line information.takawata2003-02-154-1/+27
| | | | Reviewed by: rwatson
* More useful announce message containing current speed of CPUnjl2003-01-231-3/+3
|
* For the cpu throttling message, s/enabled/availablenjl2003-01-141-1/+2
| | | | Requested by: many
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* Change ACPI make_dev() calls to use UID_ and GID_ constants ratherrwatson2002-12-281-1/+2
| | | | | | | | | | | | | than hard-coded uids and gids. Switch the device to a group of wheel instead of operator. Narrow down the permissions on the device to require root privilege to manipulate the system power state. It may be that we can broaden access to the device after review of the access control in ACPI. Submitted by: kris Reviewed by: takawata
* Fix a De Morgan bug: If we only expect a memory range OR anmarcel2002-12-231-8/+8
| | | | | | | | | | I/O port range, then we should ignore a resource if it's NOT a memory range AND NOT an I/O port range. The OR in the condition caused us to ignore perfectly valid memory addresses. While here, remove redundant parenthesis and reindent the debug print to avoid long lines.
* Add sysctl knob to stop disabling acpi on shutdown.takawata2002-12-112-2/+10
| | | | Approved by: re(jhb)
* Resolve conflicts arising from the ACPI CA 20021118 import.iwasaki2002-11-272-5/+5
|
* Disable debug output from acpi_pci_link.iwasaki2002-11-271-5/+5
| | | | | | | | | There were no serious problem reports on this in spite of my concern. To get debug output from acpi_pci_link, just enable bootverbose flag in usual manner (boot -v). Approved by: re
* - Assume a bus number of zero if evaluating _BBN fails, not if it succeeds.jhb2002-11-251-9/+8
| | | | | | | | This was effectively rendering _BBN useless. - Cleanup handling of the busok variable a bit. Submitted by: marcel (1) Approved by: re (rwatson)
* Add `if (!cold)' checkings for functions which is called via SYSINIT.iwasaki2002-11-241-7/+13
| | | | | | | Loading acpi.ko with kldload is disallowed, however some functions were executed unexpectedly. Approved by: re
* According to the ACPI spec, the bus number of the child PCI bus of a hostjhb2002-11-221-7/+52
| | | | | | | | | | | | | | | | | | | | | | to PCI bridge can be read be evaluating the _BBN method of the host to PCI device. Unfortunately, there appear to be some lazy/ignorant/moronic/ whatever BIOS writers that return 0 for _BBN for all host to PCI bridges in the system. On a system with a single host to PCI bridge this is not a problem as the child bus of that single bridge will be bus 0 anyway. However, on systems with multiple host to PCI bridges and l/i/m/w BIOS writers this is a major problem resulting in all but the first host to PCI bridge failing to attach. So, this adds a workaround. If the _BBN of a host to PCI bridge is zero and pcib0 already exists and is not us, the we use _ADR to look up our PCI function and slot (we currently assume we are on bus 0) and use that to call host_pcib_get_busno() to try and extract our bus number from config registers on the host to PCI bridge device. If that fails, then we make an evil assumption that ACPI's _SB_ namespace lays out the host to PCI bridges in ascending order and use our pcib unit number as our bus number. Approved by: re
* Add status initialization code for acpi_cmbat and acpi_acad,iwasaki2002-11-032-7/+120
| | | | | | | | acpi_cmbat_init_battery() and acpi_cmbat_init_acline() respectively. Call acpi_cmbat_init_battery() from acpi_cmbat_resume() too just in case. This is a workaround for embedded controller operations which is unstable for about a minute (typically 30 or 40 sec.) at boot time.
* Don't examine ACPI_STA_ENABLE bit of device's_STA object on initialiwasaki2002-10-311-5/+4
| | | | | | | | | | state. Instead, use ACPI_STA_PRESENT and ACPI_STA_FUNCTIONAL for it. In some ACPI BIOS implementations, boot disabled devices don't have ACPI_STA_ENABLE bit in _STA object. Also it is not fatal if getting current IRQ of boot disabled devices is failed in initial state. And minor fixes.
* Interpret new loader tunable "hw.acpi.verbose" to turniwasaki2002-10-311-2/+6
| | | | verbose mode on at boot time.
* Invoke 3 ACPI task threads as default if option ACPI_MAX_THREADS isiwasaki2002-10-313-6/+9
| | | | | | not defined. To make previous default behavior (ACPI_MAX_THREADS undefined), define option ACPI_MAX_THREADS as 0.
* Add a missing newline to the end of a device_printf().jhb2002-10-291-1/+1
| | | | Reported by: Michael G. Petry <petry@NetMasters.Com>
* Add new loader tunable hw.acpi.ec.event_driven so that we controliwasaki2002-10-241-1/+4
| | | | | | EcWaitEventIntr()'s behavior. Some EC controllers require this for working properly (including sleep/wakeup).
* Catch up to changes in acpivar.h to add support for using ACPI onjhb2002-10-168-12/+23
| | | | | | 4-stable systems. Sponsored by: The Weather Channel
* struct timecounter is defined in sys/time.h on 4-stable.jhb2002-10-161-0/+4
| | | | Sponsored by: The Weather Channel
* - Include lock headers on current in this header instead of puttingjhb2002-10-161-3/+18
| | | | | | | #if's in all the other ACPI source files. - Use splhigh() for the ACPI subsystem lock on 4-stable. Sponsored by: The Weather Channel
* - In AcpiOsGetThreadId(), allow for curproc to be NULL on 4-stable systems.jhb2002-10-161-4/+14
| | | | | | | | In that case use proc0's pid to return the thread ID. - For 4-stable, use the generic swi taskqueue for ACPI events rather than implementing our own. Sponsored by: The Weather Channel
* Implement the internal locks of an ACPI semaphore with splhigh() onjhb2002-10-161-8/+31
| | | | | | 4-stable. -current uses a mutex for this purpose. Sponsored by: The Weather Channel
* Fix a possible bug about freeing non-malloc'ed pointer.iwasaki2002-10-161-2/+3
| | | | Suggested by: jhb (in -current ML)
* Use d_thread_t for cdevsw functions instead of struct thread * so that itjhb2002-10-091-3/+3
| | | | is easier to share this code with 4-stable.
* Include <dev/acpica/acpivar.h> instead of <acpica/acpivar.h> like all thejhb2002-10-091-1/+1
| | | | other sys/dev/acpica files.
* Don't panic for a bad ivar request, just return ENOENT.jhb2002-10-081-1/+0
|
* Make sure that ACPI PCI driver probe routine call pci_cfgregopen()iwasaki2002-10-052-0/+6
| | | | | | before start accessing PCI config space. Reviewed by: jhb
* Oops, forgot to add main file for my previous commit :-)iwasaki2002-10-051-0/+1077
|
* Add code for ACPI PCI link object manipulation.iwasaki2002-10-054-2/+32
| | | | | | | | | This allocate the best IRQ to boot-disable devices (have IRQ 0). Allocated IRQ will be used for PCI interrupt routing when ACPI is enabled. Note that verbose messaging enabled for the time being so that people can easily notice the strange behavior if it happened.
* Oops, missed this one. Fix a printf format error on 64 bit systemspeter2002-10-041-2/+2
| | | | where sizes are long instead of int.
* Fix printf format errors on 64 bit systems where sizes are longpeter2002-10-041-2/+4
| | | | instead of just int.
* Display the name of the acpi node that we do not find the pci interruptpeter2002-10-041-2/+3
| | | | routing table for.
* Some kernel threads try to do significant work, and the default KSTACK_PAGESscottl2002-10-022-2/+2
| | | | | | | | | | | | | doesn't give them enough stack to do much before blowing away the pcb. This adds MI and MD code to allow the allocation of an alternate kstack who's size can be speficied when calling kthread_create. Passing the value 0 prevents the alternate kstack from being created. Note that the ia64 MD code is missing for now, and PowerPC was only partially written due to the pmap.c being incomplete there. Though this patch does not modify anything to make use of the alternate kstack, acpi and usb are good candidates. Reviewed by: jake, peter, jhb
* Now that we only probe host-PCI bridges once, we no longer have to check tojhb2002-09-231-12/+0
| | | | see if we have been probed before by checking for a pciX bus device.
* Attach ACPI children a bit later in attach(), specifically after performingjhb2002-09-061-2/+3
| | | | | | any machine dependent initialization. This allows the MD code to set the interrupt routing model so that PCI interrupts are routed correctly when using an APIC or SAPIC for example.
* Add a helper routine acpi_SetIntrModel() to call the _PIC method to setjhb2002-09-062-0/+24
| | | | | the interrupt model in use so that ACPI can properly route interrupts for machines using APIC's or SAPIC's.
* Make the printf messages when routing interrupts more consistent in thejhb2002-09-051-5/+6
| | | | various PCI bridge drivers.
* - Make pci_load_vendor_data() static and do it during MOD_LOAD instead ofjhb2002-09-041-2/+0
| | | | | | | when the first PCI bus attaches. - Create /dev/pci during MOD_LOAD as well. - Destroy /dev/pci during MOD_UNLOAD (not that you can kldunload pci, but might as well get the code right)
* Use resource_list_print_types() instead of duplicating the code.jhb2002-09-041-40/+4
|
* s/hint.acpi.0.disable/hint.acpi.0.disabled/iwasaki2002-08-301-0/+5
| | | | | | | | | Fix device hints entry for disabling acpi(4). This also should fix the arbitration with apm(4) when both drivers are enabled. Note that your /boot/device.hints needs to be updated if you want to stop auto-loading acpi.ko or disable acpi(4).
* Resolve conflicts arising from the ACPI CA 20020815 import.iwasaki2002-08-293-18/+31
|
* Change default value of hw.acpi.sleep_delay to 0.iwasaki2002-08-281-1/+1
| | | | This caused problems (reset or lock up) at wakeup.
* Fix a bug about the cooling system controlling in acpi_thermal driver.iwasaki2002-08-272-11/+37
| | | | | | | Recent version of ACPI CA returns the package object which contains object reference elements if the elements are named objects. We need to be careful when you use acpi_ForeachPackageObject() in new code...
* Overhaul the ACPI PCI bridge driver a bit:jhb2002-08-264-588/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add an ACPI PCI-PCI bridge driver (the previous driver just handled Host-PCI bridges) that is a PCI driver that is a subclass of the generic PCI-PCI bridge driver. It overrides probe, attach, read_ivar, and pci_route_interrupt. - The probe routine only succeeds if our parent is an ACPI PCI bus which we test for by seeing if we can read our ACPI_HANDLE as an ivar. - The attach routine saves a copy of our handle and calls the new acpi_pcib_attach_common() function described below. - The read_ivar routine handles normal PCI-PCI bridge ivars and adds an ivar to return the ACPI_HANDLE of the bus this bridge represents. - The route_interrupt routine fetches the _PRT (PCI Interrupt Routing Table) from the bridge device's softc and passes it off to acpi_pcib_route_interrupt() to route the interrupt. - Split the old ACPI Host-PCI bridge driver into two pieces. Part of the attach routine and most of the route_interrupt routine remain in acpi_pcib.c and are shared by both ACPI PCI bridge drivers. - The attach routine verifies the PCI bridge is present, reads in the _PRT for the bridge, and attaches the child PCI bus. - The route_interrupt routine uses the passed in _PRT to route a PCI interrupt. The rest of the driver is the ACPI Host-PCI bridge specific bits that live in acpi_pcib_acpi.c. - We no longer duplicate pcib_maxslots but use it directly. - The driver now uses the pcib devclass instead of its own devclass. This means that PCI busses are now only children of pcib devices. - Allow the ACPI_HANDLE for the child PCI bus to be read as an ivar of the child bus. - Fetch the _PRT for routing PCI interrupts directly from our softc instead of walking the devclass to find ourself and then fetch our own softc. With this change and the new ACPI PCI bus driver, ACPI can now properly route interrupts for devices behind PCI-PCI bridges. That is, the Itanium2 with like 10 PCI busses can now boot ok and route all the PCI interrupts. Hopefully this will also fix problems people are having with CardBus bridges behind PCI-PCI bridges not properly routing interrupts when ACPI is used. Tested on: i386, ia64
* Add an ACPI PCI bus driver that is a subclass of the generic PCI busjhb2002-08-261-0/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | driver. This driver overrides the probe, attach, and read_ivar methods. If the parent bridge is an ACPI PCI bridge, then the probe routine will match, otherwise it will fail. It tests this by seeing if it can get the ACPI_HANDLE ivar from the bridge device. In the attach routine, it uses pci_add_children() to add all the child devices (but with a slightly larger ivar so it can store ACPI_HANDLE's for child devices) and then walks through the ACPI namespace below the bus device to cache ACPI_HANDLE's for all child devices present in the namespace. It does this by comparing the pci slot and function to the address encoded in _ADR of the devices in the ACPI namespace. The read_ivar routine passes most requests off to pci_read_ivar() and adds a new request so that the ACPI_HANDLE for a child device can be read. To add proper power support the power methods can be overridden as well, but that is not currently implemented. Also, there are cases where a device may show in the ACPI namespace as a PCI device that the PCI probe does not find. Currently such devices are ignored. Tested on: i386, ia64
* In acpi_pcib_route_interrupt(), the code claims to check to see if a PCIjhb2002-08-262-4/+4
| | | | | | | LNK device (interrupt source provider sort of) is present before using it, but the code actually tested the status (_STA) of the PCI bridge device doing the routing, not the actual LNK device. Fix it to check the status of the LNK device.
* Add new sysctl MIB (hw.acpi.sleep_delay) to specify the delay (iniwasaki2002-08-252-0/+9
| | | | | seconds) before ACPI sleep. Some machines might need this to sleep by Hot-key.
* Use the _STA method of a battery control method to see if a battery isjhb2002-08-211-10/+16
| | | | | | present or not. My laptop now properly notices when a battery is removed. Reviewed by: iwasaki
OpenPOWER on IntegriCloud