History log of /freebsd-9.3-release/sys/dev/acpica/acpi_ec.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 248085 09-Mar-2013 marius

MFC: r227309 (partial)

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


# 237822 29-Jun-2012 jhb

MFC 235024,235029,235556,235834,235845:
Use MADT to match ACPI Processor objects to CPUs. MADT and DSDT/SSDTs may
list CPUs in different orders, especially for disabled logical cores. Now
we match ACPI IDs from the MADT with Processor objects, strictly order CPUs
accordingly, and ignore disabled cores. This prevents us from executing
methods for other CPUs, e. g., _PSS for disabled logical core, which may not
exist. Unfortunately, it is known that there are a few systems with buggy
BIOSes that do not have unique ACPI IDs for MADT and Processor objects. To
work around these problems, 'debug.acpi.cpu_unordered' tunable is added.
Set this to a non-zero value to restore the old behavior.


# 232086 23-Feb-2012 jkim

MFC: r231161

- Give all clocks and timers on acpi0 the equal probing order.
- 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.


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 216965 04-Jan-2011 jkim

Clarify the previous commit. AcpiFinishGpe() will not clear GPE for us
because we set it to edge-trigger.


# 216942 03-Jan-2011 jkim

Clear GPE from a query handler if the task was deferred.


# 216940 03-Jan-2011 jkim

Fix parameters for wakeup(9) and tsleep(9).

MFC after: 3 days


# 216471 15-Dec-2010 jkim

Merge ACPICA 20101209.


# 213737 12-Oct-2010 avg

acpi_ec: changes in communication with hardware

Short description of the changes:
- attempt to retry some commands for which it is possible (read, query)
- always make a short sleep before checking EC status in polled mode
- periodically poll EC status in interrupt mode
- change logic for detecting broken interrupt delivery and falling back
to polled mode
- check that EC is ready for input before starting a new command, wait
if necessary

This commit is based on the original patch by David Naylor.

PR: kern/150517
Submitted by: David Naylor <naylor.b.david@gmail.com>
Reviewed by: jkim
MFC after: 3 weeks


# 210977 06-Aug-2010 jkim

When EC burst mode is activated and multiple bytes are accessed, do not
disable and enable repeatedly, just do it once per call. It also reduces
code duplication. Check all parameters early and fail immediately.


# 209746 06-Jul-2010 jkim

Merge ACPICA 20100702.


# 208722 01-Jun-2010 jkim

Remove unnecessary pointer type castings, shift operations and dead code.


# 206117 02-Apr-2010 jkim

Merge ACPICA 20100331 (and four additional upstream patches).


# 202771 21-Jan-2010 jkim

Merge ACPICA 20100121.


# 202567 18-Jan-2010 avg

acpi_ec: remove redundant acpi_disabled check in probe method

MFC after: 4 days


# 202558 18-Jan-2010 avg

acpi_ec: clean up 'private' ivar when freeing memory to which it points

This is not only a prudent thing to do, but also makes sure that probe
method is not confused by non-NULL 'private', if the previous attach
attempt fails for any reason.

PR: kern/142561
Tested by: Alex Goncharov <alex-goncharov@comcast.net>
MFC after: 4 days


# 199016 07-Nov-2009 avg

acpi: remove 'magic' ivar

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


# 193530 05-Jun-2009 jkim

Import ACPICA 20090521.


# 189903 16-Mar-2009 jkim

Initial suspend/resume support for amd64.

This code is heavily inspired by Takanori Watanabe's experimental SMP patch
for i386 and large portion was shamelessly cut and pasted from Peter Wemm's
AP boot code.


# 173480 08-Nov-2007 njl

Whitespace only.


# 172987 25-Oct-2007 takawata

More style nit.
Pointed out by: njl.


# 172978 25-Oct-2007 takawata

Fix variable name to be clear what it means.


# 172973 25-Oct-2007 takawata

Turn EC into poll mode before device_resume invoked .


# 172313 24-Sep-2007 njl

Rewrite the EC driver event model. The main goal is to avoid
polling/interrupt-driven fallback and instead use polling only during
boot and pure interrupt-driven mode after boot. Polled mode could be
relegated completely to a legacy role if we could enable interrupts
during boot. Polled mode can be forced after boot by setting
debug.acpi.ec.polled="1", i.e. if there are timeouts.

- Use polling only during boot, shutdown, or if requested by the user.
Otherwise, use a generation count of GPEs, incremented atomically. This
prevents an old status value from being used if the EC is really slow
and the same condition (i.e. multiple IBEs for a write transaction) is
being checked.
- Check for and run the query handler directly if the SCI bit is set in
the status register during boot. Previously, the query handler wouldn't
run until interrupts were finally enabled late in boot.
- During boot and after starting a command, check if the event appears
to already have occurred before we even start waiting. If so, it's
possible the EC is very slow and we might accept an old status value.
Print a warning in this case. Once we've booted, interrupt-driven mode
should work just fine but polled mode could be unreliable. There's not
much more we can do about this until interrupts are enabled during boot.
- In the above case, we also do one final check if the interrupt-driven
mode gets a timeout. If the status is complete, it will force the
system back into polled mode since interrupt mode doesn't work. For
polled mode during boot, if the status appears to be already complete
before beginning the check loop, it waits 10 us before actually checking
the status, just in case the EC is really slow and hasn't gotten to work
on the new request yet.
- Use upper-case hex for the _Qxx method
- Use device_printf for errors, don't hide them under verbose
- Increase default total timeout to 750 ms and decrease polling interval
to 5 us.
- Don't pass the status value via the softc. Just read it directly.
- Remove the mutex. We use the sx lock for transaction serialization
with the query handler.
- Remove the Intel copyright notice as no code of theirs was ever
present in this file (verified against rev 1.1)
- Allow KTR module-only builds for ease of testing

Thanks to jkim and Alexey Starikovskiy for helpful discussions and testing.

Approved by: re
MFC after: 2 weeks


# 170783 15-Jun-2007 njl

Convert magic to a uintptr_t. This should get rid of some warnings on
gcc4.


# 170211 02-Jun-2007 njl

AcpiAcquireGlobalLock() can sometimes sleep if the mutex is contested.
The global lock is a memory region shared with the BIOS and thus
has some strange behavior like the fact that the sleep is 1 ms max.
We use standard mutexes to synchronize with the SCI so acquiring
the global lock after locking the mutex resulted in a witness
warning.

To deal with this for now, acquire the global lock before all other
locks, similar to Giant. This should fix the witness "sleeping
with mutex held" issue on boot that occurred after the last ACPI-CA
import. In the future, we hope to move to the new mutex interface
in ACPI-CA instead of the pseudo-semaphore version we have now.

Reviewed by: jkim


# 168191 31-Mar-2007 jhb

Optimize sx locks to use simple atomic operations for the common cases of
obtaining and releasing shared and exclusive locks. The algorithms for
manipulating the lock cookie are very similar to that rwlocks. This patch
also adds support for exclusive locks using the same algorithm as mutexes.

A new sx_init_flags() function has been added so that optional flags can be
specified to alter a given locks behavior. The flags include SX_DUPOK,
SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature
to the similar flags for mutexes.

Adaptive spinning on select locks may be enabled by enabling the
ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN
flag via sx_init_flags() will adaptively spin.

The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock()
are now performed inline in non-debug kernels. As a result, <sys/sx.h> now
requires <sys/lock.h> to be included prior to <sys/sx.h>.

The new kernel option SX_NOINLINE can be used to disable the aforementioned
inlining in non-debug kernels.

The size of struct sx has changed, so the kernel ABI is probably greatly
disturbed.

MFC after: 1 month
Submitted by: attilio
Tested by: kris, pjd


# 167814 22-Mar-2007 jkim

Catch up with ACPI-CA 20070320 import.


# 167730 19-Mar-2007 njl

If we got an OBE/IBF event, we failed to re-enable the GPE. This would
cause the EC to stop handling future events because the GPE stayed masked.
Set a flag when queueing a GPE handler since it will ultimately re-enable
the GPE. In all other cases, re-enable it ourselves. I reworked the
patch from the submitter.

Submitted by: Rong-en Fan <grafan@gmail.com>


# 167671 17-Mar-2007 njl

Disable burst mode by default. Testing has shown that while it works on
most systems, it causes the EC not to respond for some Acer and Compaq/HP
laptops. This is the default value for Linux also. For systems that need
it, burst mode can be enabled via the tunable/sysctl:
debug.acpi.ec.burst="1"


# 167044 26-Feb-2007 njl

Rework EC I/O approach. Implement burst mode, including proper handling of
case where it asynchronously exits burst mode on its own. Handle different
values of hz in sleep loop. Provide more debugging options to tune EC
behavior. These tunables/sysctls may be temporary and are not for user
access if the EC is working properly. Burst mode is now on by default for
testing and the poll interval has been increased from 100 to 500 us and
total timeout from 100 to 500 ms.

Hopefully this should be the first step of addressing reports of timeout
errors during battery or thermal access, especially on HP/Compaq laptops.
It is reasonably stable and should not cause a loss of functionality or
performance on systems that were previously working. Testing shows an
increase of responsiveness by ~75% on one system.

PR: kern/98171


# 153172 06-Dec-2005 njl

Revert two changes I was testing regarding polling delay.


# 153171 06-Dec-2005 njl

Add KTR support and move some performance debugging variables in the EC
to KTR. We're reusing the KTR_DEV level.


# 150003 11-Sep-2005 obrien

Canonize the include of acpi.h.


# 146166 12-May-2005 njl

If there is a problem during probe, be sure to free up any resources
allocated for it. The normal exit case handles this correctly so we
use it as well for errors.

Submitted by: pjd
Obtained from: Coverity Prevent


# 145059 14-Apr-2005 marks

Use AcpiUtStrupr() instead of strupr() as the latter will disappear in
future versions of acpica.

MFC after: 2 weeks


# 143861 19-Mar-2005 njl

Add the acpi_ec_read and write methods. This allows an external driver
(like an EC/SMbus controller) to access the EC address space. Access
is synchronized by the EcLock/Unlock routines in EcSpaceHandler().

Tested by: Hans Petter Selasky


# 142191 21-Feb-2005 njl

Since the GPE handler is directly called by ACPI-CA and it may have unknown
locks held, specify the ACPI_ISR flag to keep it from acquiring any more
mutexes (which could potentially sleep.) This should fix "could sleep"
warning messages on the following path:

msleep()
AcpiOsWaitSemaphore()
AcpiUtAcquireMutex()
AcpiDisableGpe()
EcGpeHandler()
AcpiEvGpeDispatch()
AcpiEvGpeDetect()
AcpiEvGpeDetect()
AcpiEvSciXruptHandler()


# 139749 05-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


# 139339 27-Dec-2004 njl

Remove trailing whitespace.


# 133617 13-Aug-2004 njl

MPSAFE locking

* Use the common serialization macros instead of rolling our own.
* Increase the coverage of the lock in EcSpaceHandler() to cover the entire
loop to avoid dropping the lock when reading more than one byte.


# 131480 02-Jul-2004 njl

Remove duplicate FreeBSD id.


# 131474 02-Jul-2004 njl

Get rid of the strict aliasing error by retrieving the ECDT via a table
header pointer and then casting it to the ecdt pointer. This fixes the
-O2 build. I'm unsure what changed recently to reveal this error since
this code has been unchanged for months.


# 131384 30-Jun-2004 njl

Rework the code that waits for a response from the EC. Use an sx lock
instead of a mutex so we do not unblock it in msleep(). If we do this,
another event could occur, resetting the status register since reads
reset it. While I'm here, remove the backoff approach. Instead, sleep
in 10 ms chunks for up to the configured timeout using either DELAY (if
we aren't booted yet) or tsleep.

Help from: dillon
Tested by: Andrew Thompson andy AT fud.org.nz


# 131339 30-Jun-2004 njl

Disable the EC GPE in the shutdown path. This is correct but is not known
to fix any bug.


# 131282 29-Jun-2004 njl

Use the acpi_id_probe() method instead of acpi_MatchHid(), which is now
static.


# 131257 28-Jun-2004 njl

While booting, use DELAY() for waiting for the EC to respond instead of
msleep(). Until we're finally up, msleep is a no-op.

Explained by: peter


# 130439 13-Jun-2004 njl

Add support to ACPI to manage its own resources. Previously, resource
allocation was passed up to nexus. Now, we probe sysresource objects and
manage the resources they describe in a local rman pool. This helps
devices which attach/detach varying resources (like the _CST object) and
module loads/unloads. The allocation/release routines now check to see if
the resource is described in a child sysresource object and if so,
allocate from the local rman. Sysresource objects add their resources to
the pool and reserve them upon boot. This means sysresources need to be
probed before other ACPI devices.

Changes include:
* Add ordering to the child device probe. The current order is: system
resource objects, embedded controllers, then everything else.
* Make acpi_MatchHid take a handle instead of a device_t arg.
* Replace acpi_{get,set}_resource with the generic equivalents.


# 129879 30-May-2004 phk

Add missing <sys/module.h> includes


# 129692 25-May-2004 njl

Changes to implement 20040514:

* Add calls to AcpiSetGpeType. We use wake/run as the type for lid and
button switches since wake-only causes Thinkpads to immediately wake on
the second suspend. Note that with wake/run, some systems return both
wake and device-specific notifies so we don't register for system notifies
for lid and button switches.
* Remove the hw.acpi.osi_method tunable since it is not needed.
* Always print unknown notifies for all types.
* Add more cleanup for the EC if it fails to attach.
* Use the GPE handle now that we parse it. This allows GPEs to be defined
in AML GPE blocks.
* Always use ACPI_NOT_ISR since it's ok to acquire a mutex in our thread
which processes queued requests.


# 129197 14-May-2004 njl

Add support for GPE being a package of { reference, gpe bit }.
Rework the ECDT probe to pass all the parameters in a temporary struct.
Note why we are mostly ok evaluating _GLK so early.


# 129168 13-May-2004 njl

Add support for retrieving _GLK in the ECDT probe. Now we no longer always
use the global lock at the beginning of the ECDT probe. Instead, we use
the handle from the ECDT to call _GLK. Also, unify the device description.


# 128220 14-Apr-2004 njl

Update the name for edge triggered for the 20040402 import.


# 128071 09-Apr-2004 njl

Add MODULE_DEPEND entries so some of these drivers can eventually be
loaded separately from ACPI (i.e., embedded use).


# 127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


# 126578 04-Mar-2004 njl

Fix an off-by-one error and rework our EC space handler. Writing to address
0xFF would fail previously as AE_BAD_PARAMETER. It's unknown if this caused
any actual problems.


# 126560 03-Mar-2004 njl

Change to acpi_{Get,Set}Integer to provide both methods. Convert all
callers to the new API.

Submitted by: Mark Santcroos <marks@ripe.net>


# 124091 03-Jan-2004 njl

Delete the region we are passed if that is the requested operation.
This should fix the problem with removing an address space handler
although we don't currently use that capability so it's unlikely anyone
saw this problem.


# 120453 26-Sep-2003 njl

Consistently print attach messages.


# 120103 15-Sep-2003 njl

Bump the EC timeout from 50 to 100 ms. I believe the underlying issue is
global lock contention as symptoms only appear under heavy load (i.e. the
nightly periodic run).


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 118216 30-Jul-2003 njl

Add and document the hw.acpi.ec.poll_timeout tunable.


# 118018 25-Jul-2003 njl

Add an informational debugging printf of the maximum time spent in
EcEventWait(). If you get AE_HARDWARE_NO_RESPONSE errors, please enable
this info by setting hw.acpi.verbose=1 in loader.conf.


# 117810 20-Jul-2003 njl

Do not call acpi_MatchHid() for all probe cases since it accesses the
namespace. To compensate for it only being used in the !ECDT case, use
a more robust approach to indicate a device was probed via ECDT by setting
the private ivar to be &acpi_ec_devclass. Without the acpi_MatchHid() call
now, it might have been possible for a non-EC device to have had its magic
match our previous flag.

Pointed out by: takawata


# 117809 20-Jul-2003 njl

Close a race condition by passing status retrieved via a non-SCI call
to EcGpeQueryHandler on to any waiting threads through the softc. Similar
behavior was in the original version.

Also:
* Merge EcQuery into EcGpeQueryHandler to simplify locking
* Hold EcLock from the initial read of the CSR down to the wakeup or
until after the query command has been processed.
* ec_gpebit only needs to be a UINT8


# 117795 19-Jul-2003 njl

Add ECDT (ACPI 2.0) support. This allows the EC to be enabled before the
namespace has been evaluated. Machines with ACPI 2.0 expect this behavior
and have AML which calls EC functions early in the boot process. If the
ECDT is not available, fall back to original probe behavior.

Other minor changes:
* Add GPE bit and GLK usage to the device announcement
* Always use the global lock in the ECDT case, but potentially downgrade to
not using it if _GLK is 0 once the namespace is available. This is
announced with "Changing GLK from 1 to 0"
* Remove the acpi_object_list definitions which were earlier deprecated

Ideas from: takawata


# 117649 15-Jul-2003 njl

Change the msleep part of EcWaitEvent to be a separate loop, fixing a
problem that for some very slow ECs (~6 ms occasionally) causes a
timeout. Also finish resource cleanup in the error case in attach.

Tested by: ume


# 117530 13-Jul-2003 njl

Update code to work with 0619 dist

* Use ACPI_BUFFER as the type for AcpiGetObjectInfo
* Remove AcpiEnableEvent/AcpiClearEvent for ACPI_EVENT_FIXED (power/sleep
buttons) as they are no longer needed
* Change calls to use the new GPE functions
* Add AcpiOs*Lock functions


# 117384 10-Jul-2003 njl

Rewrite much of the embedded controller driver.
* Always use polled mode. The intr approach did not work for many
controllers and required the hw.acpi.ec.event_driven workaround.
* Only use an edge (not level) triggered GPE handler
* Add sc->ec_mtx for locking operations to a single EC. There were
many race conditions earlier between an SCI event and EcRead/Write.
* Use 1 ms as the global lock timeout
* Only acquire global lock if _GLK != 0
* Update EcWaitEvent to use an incremental backoff delay in its
poll loop. Wait 50 ms max instead of 10. Most ECs respond
in < 5 us (50 us when heavily loaded). However, some time out
occasionally even with a 10 ms timeout. For delays past 1 ms, use
msleep instead of DELAY to give SCI interrupts a chance to occur.
* Add EcCommand to send a command and wait for the appropriate event.
* The hw.acpi.ec.event_driven tunable is no longer applicable and
has been removed.

Ideas from: Linux


# 116927 27-Jun-2003 njl

Whitespace cleanups (verified with MD5 1832ce5ede6c58c844dfb53fd48f0eea).
Also clarify a macro expansion with an XXX. I will be fixing access to
Acpi Global Lock in a subsequent commit.


# 107328 27-Nov-2002 iwasaki

Resolve conflicts arising from the ACPI CA 20021118 import.


# 105857 24-Oct-2002 iwasaki

Add new loader tunable hw.acpi.ec.event_driven so that we control
EcWaitEventIntr()'s behavior.
Some EC controllers require this for working properly (including
sleep/wakeup).


# 105282 16-Oct-2002 jhb

Catch up to changes in acpivar.h to add support for using ACPI on
4-stable systems.

Sponsored by: The Weather Channel


# 99243 02-Jul-2002 takawata

Make interrupt driven EC transaction optional.


# 96926 19-May-2002 peter

Brutally deal with __func__ being 'const char *' on gcc-3.1.


# 91122 23-Feb-2002 msmith

Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.

The ACPI global lock acquire takes a timeout value. I'm not sure what
we should do about timeouts on it; a deadlock against this lock is
catastrophic.


# 90005 30-Jan-2002 takawata

Fix error handling.

PR:30665
Submitted by:TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>


# 89054 08-Jan-2002 msmith

Staticise devclasses and some unnecessarily global variables.


# 88420 22-Dec-2001 iwasaki

Add OS layer ACPI mutex and threading support.
- Temporary fix a bug of Intel ACPI CA core code.
- Add OS layer ACPI mutex support. This can be disabled by
specifying option ACPI_NO_SEMAPHORES.
- Add ACPI threading support. Now that we have a dedicate taskqueue for
ACPI tasks and more ACPI task threads can be created by specifying option
ACPI_MAX_THREADS.
- Change acpi_EvaluateIntoBuffer() behavior slightly to reuse given
caller's buffer unless AE_BUFFER_OVERFLOW occurs. Also CM battery's
evaluations were changed to use acpi_EvaluateIntoBuffer().
- Add new utility function acpi_ConvertBufferToInteger().
- Add simple locking for CM battery and temperature updating.
- Fix a minor problem on EC locking.
- Make the thermal zone polling rate to be changeable.
- Change minor things on AcpiOsSignal(); in ACPI_SIGNAL_FATAL case,
entering Debugger is easier to investigate the problem rather than panic.


# 87036 28-Nov-2001 msmith

Synch with minor changes in the ACPI CA 20011120 snapshot.


# 86552 18-Nov-2001 iwasaki

Cleanups of verbose printing. All the messages for the debugging is
disabled unless verbose flag is set. Also fix some messages in terms
of English.
The critical messages and error messages in probe/attach routine are
unchanged by this commit.


# 84500 04-Oct-2001 msmith

Update usage of AcpiEnableEvent to reflect a new argument.

Fix acpi_DeviceIsPresent to check for valid _STA data and to check
the "present" and "functioning" bits.

Use acpi_DeviceIsPresent in acpi_pcib rather than rolling our own
(also broken) version.


# 82534 29-Aug-2001 msmith

Don't parse our resources ourself, the ACPI core code must do it.


# 82372 26-Aug-2001 msmith

Updates to match the ACPI CA 20010816 import:

- New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size.
- New debug level/subsystem codes.


# 80078 21-Jul-2001 msmith

Convert from acpi_strerror() to AcpiFormatException()

Fix dangling include of the dear departed acpi_ecreg.h


# 80069 21-Jul-2001 msmith

Merge the EC register definitions into the EC module proper, they're not
used anywhere else.

AcpiOsSleepUsec() -> AcpiOsStall()


# 79285 05-Jul-2001 msmith

Improve some error messages slightly.


# 78992 29-Jun-2001 msmith

Use msleep() when we sleep waiting for a GPE, since we are holding the
ACPI mutex.

Add some comments to EcWaitEventIntr.

Clean up deviant style, add debugging to be consistent.


# 77432 29-May-2001 msmith

- Updates for new constant naming in the ACPI CA 20010518 update.
- 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).


# 73107 26-Feb-2001 jhb

- Use a loop to read consecutive bytes from the embedded controller to
handle read and write requests for widths of multiple bytes. This
can be used to read 16-bit battery status registers for example.
- Remove some unused variables and #if 0'd debugging cruft.
- Don't complain about a GPE query that fails due to AE_NOT_FOUND if the
query method was _Q00.


# 71873 31-Jan-2001 msmith

Add some debugging.

Use acpi_EvaluateInteger where possible.

Use FuncName rather than &FuncName when passing function addresses.

Don't evaluate the _REG method when we attach to an address space -
AcpiInstallAddressSpaceHandler does it for us.


# 71460 23-Jan-2001 jhb

Axe an unused static softc.


# 70591 02-Jan-2001 takawata

Change Embedded Controller lock to ACPI Global Lock.This is needed for
mutual execution between BIOS and OS.


# 70232 20-Dec-2000 takawata

Change priority of procedure queueing.
This is needed to next ACPICA import.


# 70048 15-Dec-2000 takawata

Fix with debugging option.

Submitted by: haro@tk.kubota.co.jp


# 70018 14-Dec-2000 takawata

Make Embedded Controller driver interrupt driven.


# 69744 08-Dec-2000 msmith

- Convert a lot of homebrew debugging output to use the ACPI CA debugging
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.


# 69458 01-Dec-2000 msmith

Update to work with the new ACPI CA snapshot.

- 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


# 67761 28-Oct-2000 msmith

Initial FreeBSD OSPM (operating system power management) modules for
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.