Commit Graph

737 Commits

Author SHA1 Message Date
Nate Lawson
0025fb0f4f 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.
2004-05-14 04:17:56 +00:00
Nate Lawson
c868ac7d12 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.
2004-05-13 03:17:08 +00:00
John Baldwin
fb0ac5433b If an ACPI PCI-PCI bridge doesn't have a _PRT object, fall back to using
the swizzle method for routing PCI interrupts across the bridge.  This
fixes problems with motherboards (typically laptops) whose BIOS doesn't
provide a PRT for the AGP bridge even though there is a device entry for
the bridge in the ACPI namespace.

Tested by:	Kenneth Culver culverk at sweetdreamsracing dot biz
2004-05-10 18:26:22 +00:00
Nate Lawson
ccc09458fa Change hw.acpi.cpu.cx_lowest to accept values in the form of C1,
C2, ...  Update power_profile to use the new format.  Update the
man page to reflect this and give more info on Cx states.
2004-05-07 05:22:38 +00:00
Nate Lawson
b0e2b625f2 Rename acpi_cpu to cpu. Change the probe routine to early on reject
devices it cannot attach to.  This gets rid of extraneous but harmless
device_probe_and_attach() errors.  While I'm here, make the device
description more useful.  The !acpi case for cpu is handled by legacy0.
2004-05-06 17:25:23 +00:00
Nate Lawson
ea27c63ec6 Select the highest valid (i.e., S3) sleep state for the default for the
sleep button.  Change the default for the lid switch to NONE.  This can
be overridden in /etc/sysctl.conf as desired.
2004-05-06 08:04:34 +00:00
Nate Lawson
2fb3498126 Add back sys/reboot.h which is needed. 2004-05-06 02:57:24 +00:00
Nate Lawson
869ec176fc Make unnecessary globals static and remove unused includes.
Pointed out by:	cscout
2004-05-06 02:18:58 +00:00
Nate Lawson
7e639165c2 Fix setting debug strings via sysctl. Also, clean up the way we print
debug strings.
2004-05-06 02:05:45 +00:00
Nate Lawson
c8dd768173 Remove extra parentheses. 2004-05-05 20:07:52 +00:00
Nate Lawson
65a7c90189 Add an MI implementation of the ACPI global lock routines and retire the
individual asm versions.  The global lock is shared between the BIOS and
OS and thus cannot use our mutexes.  It is defined in section 5.2.9.1 of
the ACPI specification.

Reviewed by:	marcel, bde, jhb
2004-05-05 20:04:14 +00:00
Takanori Watanabe
d33f4987f6 Fix build breakage.
Submitted by: Xin LI <delphij@frontfree.net>
PR: 65979
2004-04-26 08:49:11 +00:00
Nate Lawson
904bf0c2f7 Move the call to AcpiEnterSleepStatePrep() to before we select the BSP
(cpuid 0) as the processor.  It mallocs some data and smp_rendezvous
calls functions with locks held.
2004-04-26 05:25:06 +00:00
Warner Losh
1c168bb710 Fix two typos from PR: 65694
1) In pci.c, we need to check the child device's state, not the parent
   device's state.
2) In acpi_pci.c, we have to run the power state change after the acpi
   method when the old_state is > new state, not the other way around.

Submitted by: Dmitry Remesov
PR: 65694
2004-04-26 02:11:38 +00:00
Nate Lawson
c0b9a6de4a Disable interrupts while testing the timer. Not doing this unnecessarily
added an arbitrary delay to our readings, causing us to use the ACPI-safe
read method when not necessary.  Submitted by: bde

Old:
ACPI timer looks GOOD min = 3, max = 5, width = 2
ACPI timer looks BAD  min = 3, max = 19, width = 16
ACPI timer looks GOOD min = 3, max = 5, width = 2
ACPI timer looks GOOD min = 3, max = 5, width = 2
ACPI timer looks GOOD min = 3, max = 5, width = 2
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 5, width = 2
ACPI timer looks BAD  min = 3, max = 19, width = 16
ACPI timer looks GOOD min = 3, max = 5, width = 2
ACPI timer looks GOOD min = 3, max = 4, width = 1
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000

New:
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
ACPI timer looks GOOD min = 3, max = 4, width = 1
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000

Also, reduce unnecesary overhead in ACPI-fast by remove the barrier for
reads.  The timer in the ACPI-fast case is known to increase monotonically
so there is no need to serialize access to it.
2004-04-24 16:25:00 +00:00
Philip Paeps
9a1fc77e3a Add the ACPI Asus extras driver. Provides support for cool ACPI-controled
gadgets (hotkeys, lcd, ...) on Asus laptops.  I aim to closely track the
acpi4asus project which implements these features in the Linux kernel.

If this breaks your laptop, please let me know how it does it :-)

Approved by:	njl (mentor)
2004-04-22 21:29:02 +00:00
Nate Lawson
d9b6df606a Fix stepping in ddb by not checking for a maximum interval. The ACPI-safe
workaround was for hardware where the clock was not latched, not for
hardware that was too slow.  Also, make variable names more specific for ddb
printing.
2004-04-22 01:50:08 +00:00
Nate Lawson
af807c0f33 Add comments, including restoring the PIIX4 errata comment, to indicate
what the ACPI-safe workaround is intended to fix.  Requested by phk.

Set the bushandle and tag when attaching the timer, don't do it each time
in read_counter().  Pointed out by bde.

Move test_counter() to the end.  Staticize acpi_timer_reg.
2004-04-21 18:07:21 +00:00
Nate Lawson
75988358a2 Fix several bugs where 32-bit timers and wraparound were not properly
supported.  Symptoms of this bug included unnecessary use of ACPI-safe
and a dmesg that has deltas of about 2^24:

    ACPI timer looks BAD  min = 2, max = 16777206, width = 16777204
    ACPI timer looks BAD  min = 2, max = 7, width = 5
    ACPI timer looks GOOD min = 4, max = 5, width = 1
    ACPI timer looks BAD  min = 2, max = 16777206, width = 16777204
    ACPI timer looks BAD  min = 2, max = 7, width = 5
    ACPI timer looks BAD  min = 2, max = 16777210, width = 16777208
    ACPI timer looks BAD  min = 4, max = 16777189, width = 16777185
    ACPI timer looks GOOD min = 4, max = 5, width = 1
    ACPI timer looks BAD  min = 2, max = 7, width = 5
    ACPI timer looks BAD  min = 4, max = 16777189, width = 16777185

To fix this:
* Use a 32 bit timecounter mask when the timer is 32 bits.
* In test_counter(), use the acpi_TimerDelta function which handles 24/32
  bit timers and wraparound.

Miscellaneous fixes:
* Use C99 initializers for timecounter struct.
* Use u_int and uint32_t where appropriate instead of unsigned.
* Remove whitespace-only lines
* Remove the old PIIX4 PCI workaround.  The timecounter testing code has
  been in use for long enough to prove it's functional.
2004-04-21 00:48:16 +00:00
Nate Lawson
8d01ceefd8 Remove extran parens. 2004-04-21 00:38:54 +00:00
Nate Lawson
eea17c34cd Move the timer difference convenience function from acpi_cpu.c to make it
globally available.  acpi_TimerDelta() subtracts two readings from the
ACPI PM timer and returns the difference.  It properly distinguishes between
24-bit and 32-bit timers and handles wraparound.
2004-04-21 00:36:15 +00:00
Nate Lawson
43813837ed Style fixes. 2004-04-20 17:13:08 +00:00
Nate Lawson
0b84952197 Allow the AC adapter device to be disabled with debug.acpi.disable="acad".
Even though documented, this option was never enabled even in rev 1.1.

Submitted by:	sos
2004-04-20 13:09:17 +00:00
Nate Lawson
4ed2b85d66 Add a temporary workaround for acpi_AppendBufferResource() returning with
a NULL crsbuf pointer.  This shouldn't happen if it returns AE_OK.  We'll
figure out why this is happening later.

Submitted by:	Bruno Ducrot <ducrot@poupinou.org>
2004-04-19 17:52:20 +00:00
Nate Lawson
a50f2c9f42 Disable the new wake GPE behavior. With it enabled, my laptop won't stay
suspended after the second try.  Intel is working on a fix to properly
differentiate the non-standard wake/runtime GPEs from wake-only GPEs.
2004-04-16 16:27:37 +00:00
Nate Lawson
a34ec6cdf6 Return an error immediately if asked to switch a non-existent consumer. 2004-04-14 17:58:19 +00:00
Nate Lawson
865b8d0bfd Remove a non-variable static and move other static variables to the same
location.
2004-04-14 17:48:33 +00:00
Nate Lawson
dfd36c130b Fix some warnings by commenting out unused code. 2004-04-14 17:47:42 +00:00
Nate Lawson
916dc0e20c Only try to set the ACPI power state if the handle is valid. There was
probably no problem with this except it may have had the side effect of
registering a NULL consumer.
2004-04-14 17:46:21 +00:00
Nate Lawson
0f4f8be30d Unbreak the DDB build by replacing #includes that were deleted.
Pointed out by:	Tai-hwa Liang, Xin LI
Pointed hat to:	njl
2004-04-14 16:24:28 +00:00
Nate Lawson
a3924cd9b4 Style cleanups, M_ZERO instead of bzero. 2004-04-14 03:45:20 +00:00
Nate Lawson
e4a5123464 Style cleanups, use M_ZERO instead of bzero, unify the !semaphore and
semaphore return paths.
2004-04-14 03:43:06 +00:00
Nate Lawson
e6f06f99f6 Style cleanup, plus properly backup partial resource allocation in
AcpiOsInstallInterruptHandler() in the case of failure to initialize.
2004-04-14 03:41:06 +00:00
Nate Lawson
c871a6da4c Style cleanups to reduce diffs to locking tree. 2004-04-14 03:39:08 +00:00
Nate Lawson
ea6b2bc923 Style and printf message cleanups. 2004-04-14 03:34:11 +00:00
Nate Lawson
c2b3a864be Use TRUE for a boolean and a style nit. 2004-04-14 03:30:09 +00:00
Nate Lawson
b7d13479aa Update the name for edge triggered for the 20040402 import. 2004-04-14 02:20:35 +00:00
Nate Lawson
881c6e063e Remove a check for the return value added in rev 1.41. It's not an error
to fail to turn off a fan, since the case is that it's usually already off.
2004-04-12 05:04:47 +00:00
Nate Lawson
64278df5e0 Add MODULE_DEPEND entries so some of these drivers can eventually be
loaded separately from ACPI (i.e., embedded use).
2004-04-09 18:14:32 +00:00
Warner Losh
cd8b53ed2d Omnibus PCI commit:
o Save and restore bars for suspend/resume as well as for D3->D0
	  transitions.
	o preallocate resources that the PCI devices use to avoid resource
	  conflicts
	o lazy allocation of resources not allocated by the BIOS.
	o set unattached drivers to state D3.  Set power state to D0
	  before probe/attach.  Right now there's two special cases
	  for this (display and memory devices) that need work in other
	  areas of the tree.

Please report any bugs to me.
2004-04-09 15:44:34 +00:00
Nate Lawson
aa95c5b148 Replace more ad-hoc versions of acpi_GetReference(). Since the type of
Reference objects changed from ACPI_TYPE_ANY to ACPI_TYPE_LOCAL_REFERENCE
in Oct. 2002, this may help systems where switching the cooler on failed.
We support both types for now until this sorts out.
2004-04-09 06:55:50 +00:00
Nate Lawson
4a74bb97ed Include the prototype for acpi_GetReference. 2004-04-09 06:53:50 +00:00
Nate Lawson
074a57f560 Add support for packages as the first element of _PRW. This may allow
some machines to enable wake events for more devices although I haven't
seen a system yet that uses this form.  Also, introduce acpi_GetReference()
which retrieves an object reference from various types.
2004-04-09 06:40:03 +00:00
Nate Lawson
a4ecd54325 Unify on version 1 to be similar to the rest of the tree. After 5-stable
branches, increment version on any API change visible to other modules.
2004-04-08 16:45:12 +00:00
John Baldwin
5233e9ffda Implement an ACPI-aware pci_set_powerstate() method for PCI busses that
are enumerated in the ACPI device tree.  In addition to the normal PCI
powerstate functionality, the ACPI _PSx methods are executed and ACPI
PowerResources are switched on and off via the acpi_pwr_switch_consumer()
function.

Glanced at by:	imp, njl
2004-04-07 19:42:21 +00:00
Nate Lawson
5eb09c7066 Move the ivar accessing routines back to inlines (reverting acpivar.h
rev 1.44 and acpi.c rev 1.96).  Now gcc can handle larger inlines and we
really need external drivers to be able to read their acpi ivars.
2004-04-01 04:21:33 +00:00
Nate Lawson
63600cc345 Staticize pnp methods, style fixes. Remove unused variable to unbreak
kernel build.
2004-03-31 17:35:28 +00:00
Takanori Watanabe
cd284d7a6a Add ACPI path in location string for ACPI namespace aware PCI device. 2004-03-31 17:27:19 +00:00
Nate Lawson
72ad60ada4 Add an interface to pass an argument to the resource parsing functions.
This is just groundwork for changing sysresource behavior.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-03-31 17:23:46 +00:00
Takanori Watanabe
247648affb Style fix.
Pointed out by: njl
2004-03-31 17:21:14 +00:00
Nate Lawson
c9b8d77d80 Disable serialize_methods and enable _OSI support by default. The former
is necessary because some IBMs use recursive methods (pointed out by
Robert Moore from Intel).  The latter was a typo on my part.  It was disabled
by default when it should have been enabled.
2004-03-30 07:35:18 +00:00
Takanori Watanabe
879d6c2306 Add ACPI PnP string. This affects devinfo(8) output with -v option. 2004-03-27 16:26:00 +00:00
Nate Lawson
e548abe75b Use the correct length for appending an extended irq resource. This may
have broken APIC routing.  This bug has been present since rev 1.33.
2004-03-22 20:39:20 +00:00
Nate Lawson
3dc52520c4 Shorten some printfs to fit better. No other functional changes. 2004-03-22 20:36:33 +00:00
Nate Lawson
3304735dd9 Whitespace and comment changes. No MD5 change to the object file. 2004-03-22 20:32:27 +00:00
Nate Lawson
8e1624b6f8 Fix loop termination condition for parsing resources in _PRS buffers.
This completes the effort to handle dependent functions, which are used
in some machines for irq link resources.  Also, clean up some nearby
comments while I'm at it.
2004-03-20 20:47:08 +00:00
Nate Lawson
eeb3a05f9a Move the poweroff handler to a separate function. Make sure it is run
on the boot processor (cpuid == 0).  Some chipsets do not power off the
system if the shutdown handler runs on an AP.
2004-03-19 07:05:01 +00:00
Nate Lawson
413081d79d Add tunables for disabling serialized method execution and disabling the
new _OSI method.  These can be used if these new features end up causing
regression for users.
2004-03-18 18:42:22 +00:00
Nate Lawson
d19b6e67ac Support the DPF (start dependent function) resource type in parsing _PRS.
This should fix this error people get attaching cardbus controllers:

    pcib0: _PRS resource entry has unsupported type 2
2004-03-18 02:33:58 +00:00
Nate Lawson
e5ada020f1 Fix border error to allow systems that specify 100 for latency also use
C2 and 1000 to use C3.

Submitted by:	Bruno Ducrot <ducrot@poupinou.org>
Tested by:	Scott Lambert <lambert@lambertfam.org>
2004-03-17 21:49:47 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Nate Lawson
dba55fa26d Simplify some logic in converting a buffer to an integer. 2004-03-09 05:44:47 +00:00
Nate Lawson
cc58e4ee5e Use an unsigned int instead of an int for the Get/Set Integer interface.
Pointed out by:	le
2004-03-09 05:41:28 +00:00
Nate Lawson
08b994c07e Document a sysctl.
Submitted by:	Craig Rodrigues <rodrigc@crodrigues.org>
2004-03-05 18:08:23 +00:00
Nate Lawson
9db195a8d1 A user can set tz_requested via the hw.acpi.thermal.tzX.active sysctl.
The previous logic meant that if a user sets it to a minimal cooling value
acpi_thermal will not use higher cooling levels.  Reverse the logic so that
the user requesting a level (say, 2) also gets 0 - 1 also.

PR:		kern/61592
Submitted by:	Andrew Thompson <andy@fud.org.nz>
2004-03-05 18:06:31 +00:00
Nate Lawson
4ed391b8d7 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.
2004-03-04 05:58:50 +00:00
Nate Lawson
c181b89bc1 Don't disable Cx support and throttling on machines with a P_BLK_LEN != 6
even though the spec mandates this.  Some have a value of 5 to indicate
throttling + C2 and some have 7 to indicate an extra C3 state.  Support
throttling if the value is >= 4, C2 for >= 5, and C3 for >= 6.
2004-03-04 05:17:52 +00:00
Nate Lawson
4e376d58dc Add a "quirks" value to disable quirks handling for a given boot.
Also, disable quirks if booting with a custom DSDT.  Add a quirk
to disable loading ACPI so known bad systems can be completely
blacklisted.
2004-03-04 04:42:59 +00:00
Nate Lawson
c310653ea1 Change to acpi_{Get,Set}Integer to provide both methods. Convert all
callers to the new API.

Submitted by:	Mark Santcroos <marks@ripe.net>
2004-03-03 18:34:42 +00:00
Nate Lawson
3184cf5a6b Add support for quirks for acpi tables. Key off OEM vendor and revision.
Sort acpi debug values.  Change "disable" to "disabled" to match rest of
the kernel.  Remove debugging from acpi_toshiba since it was only used for
probe/attach.
2004-03-03 03:02:17 +00:00
Nate Lawson
c58375c3a5 Add the ACPI standard video extensions driver. I've done some style cleanup
but a bit more reamins to be done.  For now, it is usable.

Submitted by:	Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>
2004-03-01 08:12:56 +00:00
Nate Lawson
2881b39793 Call _INI on Thermal Zones as well as devices. 2004-02-28 22:43:18 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Nate Lawson
abcbc5bc60 Use ACPI_NEXT_RESOURCE instead of defining our own copy. The one provided
with ACPI-CA is identical now.
2004-02-19 18:20:03 +00:00
Nate Lawson
bb949efb95 Do not remove the fixed handlers. Several systems (e.g., ASUS) only
return events on the fixed handler even after defining a duplicate in the
AML.  While this violates the spec, hopefully we can get by with leaving
both installed.
2004-02-19 18:16:34 +00:00
Nate Lawson
968c0e1bf4 Fix problem caused by previous commit where some users' buttons
stopped returning events.  Don't disable the event when removing
the handler because it still needs to be enabled for the other
handler.  Also, remove duplicate AcpiEnableEvent calls since the
install function now does this for us.
2004-02-19 05:35:20 +00:00
Nate Lawson
d3e1c2411e Fix hw.acpi.os_name by renaming it to hw.acpi.osname. The "_name" suffix
is reserved by the loader, and thus any tunable name with that suffix will
be silently discarded.

Document this in the header and man page so that other developers do not
develop so many bumps on the head after banging it against the wall.

Detective work by:	Mark Santcroos, grehan
2004-02-14 03:17:30 +00:00
John Baldwin
e4a87c455e Fix a whitespace nit. 2004-02-12 20:45:01 +00:00
Nate Lawson
33febf93d6 Prefer buttons defined in the AML over the ones in the FADT. Some
systems define power/sleep buttons in both places but only deliver
notifies to the ones defined in the AML.

Also, reduce length of various function handler names.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-02-11 02:57:33 +00:00
Philip Paeps
1527dcc82e Make all ACPI debug layers unique again. This makes debugging a more
pleasant experience (for certain definition of 'pleasant').

Submitted by:	Mark Santcroos <marks@ripe.net>
Approved by:	njl (mentor)
2004-02-06 19:38:05 +00:00
Nate Lawson
526785c638 Notify the user (at kern.emerg) that the system will be shutting down if
it is still above the critical temperature on the next poll cycle.  This
is a 10 second advance notice by default.  Document the private
(non-standard) notify we will be using with devd(8).
2004-02-03 04:18:56 +00:00
Nate Lawson
322141f1e2 If the temperature is at _HOT or _CRT for 3 sequential readings, shutdown
the system.  Also, decrease the poll interval to 10 seconds from 30
seconds.  This is needed because some systems will report an invalid high
temperature for one poll cycle.  It is suspected this is due to the
embedded controller timing out.  A typical value is 138C for one cycle on a
system that is otherwise 65C.  This prevents the system from prematurely
shutting down after one invalid reading.  It will still shut down after 30
seconds of high temperature, which is the same as previous default
behavior.

Tested by:	Scott Lambert <lambert AT lambertfam.org>
2004-02-02 18:03:35 +00:00
Peter Pentchev
1b8c233de3 Add an ACPI_FUNCTION_TRACE() to the newly-added acpi_Startup() routine
to get the ACPI_DEBUG case (and LINT in particular) to build.

Reviewed by:	jhb, njl
Approved by:	jhb
2004-01-28 07:48:03 +00:00
Nate Lawson
e0ccb58ad9 Add TUNABLE_STR to make "hw.acpi.os_name" more correct. However, the call
to getenv_string() still doesn't work.
2004-01-27 06:07:09 +00:00
John Baldwin
bbc2815c8d Move the code to initialize ACPI-CA into a separate acpi_Startup() function
that other modules can call to initialize ACPI-CA before the new-bus probe
and change acpi_identify() to call it.

Reviewed by:	njl
2004-01-26 19:29:04 +00:00
John Baldwin
1aa9b61068 Use getenv_int() rather than reimplementing it. 2004-01-20 21:38:48 +00:00
John Baldwin
0657fe7356 Add a component constant for ACPI_TOSHIBA to fix compilation of
acpi_toshiba(4) driver with ACPI_DEBUG and thus fix LINT on i386.
2004-01-13 21:27:50 +00:00
Nate Lawson
5ce6805764 Bite the bullet and uncomment the shutdown() in case we hit the _CRT or
_HOT temperatures.  We have to do this at some point to keep from getting
imp(tm) melted hardware.
2004-01-12 17:59:10 +00:00
Nate Lawson
2ccd1cac95 Clean up the acpi announce message of trailing spaces. 2004-01-09 21:04:28 +00:00
Nate Lawson
25611cfe97 Expand the check for overriding the OS name to override _OS* (including
_OS_, _OS, and _OSI).  This should fix this option for people who reported
it not changing anything.
2004-01-09 20:01:42 +00:00
Nate Lawson
16844a97c8 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.
2004-01-03 02:01:39 +00:00
Nate Lawson
3fb343ac12 Use the appropriate values for the notifies. No change in behavior
since both notifies result in the same function being called.

Found by:	documenting the code
2003-12-31 19:11:19 +00:00
Nate Lawson
5016979369 Don't attach throttling if the P_BLK is 0, even if the P_BLK_LEN is 6.
This is more strict but no known systems have this problem.
2003-12-28 22:15:24 +00:00
John Baldwin
c59c9a8e1c Fix acpi_MatchHid() to check the compatibility ID's if the hardware ID
doesn't match.

Submitted by:	marcel
2003-12-26 15:42:13 +00:00
Nate Lawson
bd189fe7fa Fix locking broken by recent _CID changes. Always be sure to unlock
in the error case.
2003-12-23 18:47:31 +00:00
Nate Lawson
8d181eb589 Update to use the new package routines instead of rolling our own
macros.
2003-12-23 18:27:35 +00:00
Nate Lawson
21cea91f6e Remove the device_t parameter from package routines that only used it to
print an error message.  Update all callers of the package routines.
2003-12-23 18:26:53 +00:00
Peter Wemm
8070ad52a1 Don't use NULL (pointer) when we're testing for a count of 0 (integer). 2003-12-23 02:29:46 +00:00
Alexander Kabaev
2b26028dce Initialize acpi buffer structs early in order to avoid freeing
unallocated pointers later in done: section.
2003-12-18 17:04:11 +00:00
Nate Lawson
0d8fb61a49 Remove power profile support from acpi_cpu, it will be managed by a
script run from devd(8).
2003-12-18 04:38:45 +00:00
Nate Lawson
1e4925e8d3 Add support for multiple CIDs since _CID can contain a package of values.
Implement this in acpi_MatchHid() and acpi_isa_get_compatid().  This
should fix mouse support for some users.

Move all users of AcpiGetObjectInfo() to use dynamic storage instead of
a devinfo on the stack.  This is necessary since ACPI-CA needs to
allocate different sized arrays for the CompatList.
2003-12-18 03:25:22 +00:00
Nate Lawson
b279c35a4f Fix throttling to use the proper mask. The bug resulted in only two
throttling values being available regardless of the CPU's capabilities.
This has been broken since rev 1.1.  Also clarify a comment.

Submitted by:	Taku YAMAMATO <taku@cent.saitama-u.ac.jp>
2003-12-12 19:42:16 +00:00
John Baldwin
4d5f2cbbd6 Trim trailing whitespace. 2003-12-10 19:10:27 +00:00
Nate Lawson
54f6bca07c Use sbufs instead of snprintf for parsing debug strings. 2003-12-09 06:29:57 +00:00
Nate Lawson
0911e271e3 Delete madt.h since definitions are now used from actbl.h 2003-12-09 03:18:06 +00:00
Nate Lawson
73a34dd424 We don't need to call _INI on processor objects now that ACPI-CA does
this as it should.
2003-12-09 03:01:54 +00:00
John Baldwin
447a5fa113 Update this driver to be more module friendly:
- Dynamically allocate the cpu_softc[] array based on mp_maxid instead of
  using a statically sized array that depended on 'options SMP'.
- Use mp_maxid rather than MAXCPU when walking all the CPUs looking for a
  match.
- Always call smp_rendezvous() since UP kernels now provide this.
- Use mp_ncpus rather than cpu_ndevices when determining if we need to
  disable C3 for SMP machines.

Approved by:	re (rwatson)
Reviewed by:	njl
2003-12-03 20:27:48 +00:00
Nate Lawson
cd1f3db9ba * If a processor's softc is NULL, use C1 since there is no ACPI
processor object for this CPU.  This occurs for logical CPUs which
  do not have an associated processor object (e.g., HTT).

Approved by:	re (rwatson)
2003-11-27 16:32:46 +00:00
Nate Lawson
b6426963c4 * Add acpi_pcpu_get_id(idx, *acpi_id, *cpu_id) which fetches the
idx'th present CPU with pc_acpi_id equal to *acpi_id.  If *acpi_id
  does not match that processor's pc_acpi_id, return the value for
  ProcId derived from the MADT in *acpi_id.  If pc_acpi_id is 0xffffffff,
  always override it with the value of *acpi_id.  Finally, return
  pc_cpuid in *cpu_id and use that as our primary key.

* Use pc_cpuid as our unique key because we know it is valid since
  MD code set it.  The values for ProcId in the ASL and MADT don't
  match up on some machines (!), forcing us to fall back to ordered
  probing in that case.

* Remove some #ifdef SMP since the refcount doesn't hurt performance
  and will be needed for dynamic _CST objects.  Only one #ifdef SMP
  (for smp_rendezvous) remains.

* Hook up SMP in the compile flags in the Makefile.

Tested by:	marcel, truckman
Approved by:	re (scottl)
2003-11-26 19:01:33 +00:00
John Baldwin
3500189b0e Fix a typo in my patches to support extended IRQ resources that broke the
type checking for _PRS for a link device's interrupt resources.

Approved by:	re (scottl)
2003-11-20 22:21:51 +00:00
John Baldwin
d784bc82f2 Try all of the possible interrupts for a link device when programming
boot-disabled devices instead of skipping the last interrupt.  This is
especially important for devices that only have one interrupt as this
bug was keeping any interrupt from being tried at all.

Reviewed by:	msmith
Approved by:	re (scottl)
2003-11-20 21:23:49 +00:00
Nate Lawson
56a70eadf5 * Add a DEVMETHOD for acpi so that child detach methods get called. Add
an acpi_cpu method for shutdown that disables entry to acpi_cpu_idle
  and then IPIs/waits for threads to exit.  This fixes a panic late in
  reboot in the SMP case.

* In the !SMP case, don't use the processor id filled out by the MADT
  since there can only be one processor.  This was causing a panic in
  acpi_cpu_idle if the id was 1 since the data was being dereferenced from
  cpu_softc[1] even though the actual data was in cpu_softc[0] (which is
  correct).

* Rework the initialization functions so that cpu_idle_hook is written
  late in the boot process.

* Make the P_BLK, P_BLK_LEN, and cpu_cx_count all softc-local variables.
  This will help SMP boxes that have _CST or multiple P_BLKs.  No such
  boxes are known at this time.

* Always allocate the C1 state, even if the P_BLK is invalid.  This means
  we will always take over idling if enabled.  Remove the value -1 as
  valid for cx_lowest since this is redundant with machdep.cpu_idle_hlt.

* Reduce locking for the throttle initialization case to around the write
  to the smi_cmd port.  Add disabled code to write the CST_CNT.  It will
  be enabled once _CST re-evaluation is tested (post 5.2R).

Thank you:	dfr, imp, jhb, marcel, peter
Tested by:	rwatson, Harald Schmalzbauer <h@schmalzbauer.de>
Approved by:	re (rwatson)
2003-11-19 20:27:06 +00:00
Nate Lawson
6b74f9b7f5 Implement Cx CPU idle states and updated throttling support.
* Use the cpu_idle_hook() to do idling for C1-C3.
* Use both _CST and the FADT to detect Cx states.
* Use both _PTC and P_CNT for controlling throttling.
* Add a notify handler to detect changes in _CST and _PSS
* Call the _INI function for each processor if present.  This will be
  done by ACPI-CA in the future.
* Fix a bug on SMP systems where CPUs will attach multiple times if the
  bus is rescan.
* Document new sysctls for controlling idling.
2003-11-15 19:26:06 +00:00
Nate Lawson
b5049ddbf0 Add acpi_package.c with routines for validating packages and pulling
various data types from them.  This is loosely based on the acpi_cmbat
macros (by Mike Smith) and will eventually replace them.
2003-11-15 19:20:46 +00:00
Nate Lawson
dc75086936 Add acpi_bus_alloc_gas() for allocating a memory or IO resource from its
Generic Address Structure.
2003-11-15 19:18:29 +00:00
John Baldwin
3d9644ef0b Improve support for extended IRQ resources:
- For acpi_pci_link_entry_dump(), add a few helper functions to display
  the trigger mode, polarity, and sharemode of an individual IRQ resource.
  These functions are then called for both regular and extended IRQ
  resources.
- In acpi_pci_link_set_irq(), use the same type of IRQ resource
  (regular vs. extended) for the new current resource as the type of
  the resources from _PRS.
- When routing an interrupt don't ignore extended IRQ resources.  Also,
  use the same type of IRQ resource (regular vs. extended) for the new
  current resource when as the type of the resource from _PRS.

Tested by:	peter
2003-11-14 21:36:09 +00:00
John Baldwin
68cb89dc06 Fix some typos. 2003-11-12 19:46:17 +00:00
John Baldwin
284739a942 Reindent to non-style(9) compliant 4 space indent to match rest of file. 2003-11-12 16:24:16 +00:00
John Baldwin
07f0d09e81 Add an ACPI_FUNCTION_TRACE() invocation to acpi_OverrideInterruptLevel()
to fix compile with ACPI_DEBUG.

Reported by:	tinderbox
2003-11-12 16:23:21 +00:00
John Baldwin
801cc576ec Add an acpi_OverrideInterruptLevel() method that OSPM can use to override
the InterruptLevel used for the SCI.
2003-11-11 18:12:12 +00:00
Nate Lawson
9b937d4836 Add devctl(4) notify support to ACPI. Various subsystems now notify
userland whenever events occur.  See the example in devd.conf below
to see how to use it.
2003-10-25 05:03:25 +00:00
Nate Lawson
5539804740 Disable irqs before entering the power-off state. This is not known
to fix any problems but is similar to how Linux implements this
function.
2003-10-19 05:56:59 +00:00
Nate Lawson
8525ffefc2 If requested to Sleep for less than our hz granularity (e.g., 10 ms),
use DELAY instead of tsleep.

Submitted by:	peter
2003-10-02 05:09:37 +00:00
Nate Lawson
ae0781a1cb Revert 1.24. It causes a hang on shutdown for Marcel. This is due to
AcpiEnterSleepState() calling a long AcpiOsStall() with interrupts
disabled.  This fix will instead be added to ACPI-CA.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2003-09-30 19:12:37 +00:00
Nate Lawson
b22df41bbd If asked to stall for more than 100 us (which is specified as the max in
the ACPI standard), call sleep instead since that is probably what the
caller meant.

Mentioned by:		peter
2003-09-29 07:29:26 +00:00
Nate Lawson
1d7b121ca4 Make debug.acpi.level and debug.acpi.layer sysctls that can be set with
the strings found in acpi(4).  Also make acpi_ca_version a string so it
is more readable.
2003-09-26 21:22:10 +00:00
Nate Lawson
656b9dd5c3 Consistently print attach messages. 2003-09-26 05:24:55 +00:00
Nate Lawson
297835bcd5 Sort debugging levels and update the man page to match reality. Also
update man page to reflect iasl(8) import.
2003-09-26 04:32:40 +00:00
Nate Lawson
a6a1d01594 Fix the ACPI_DEBUG case.
Reported by:	Larry Rosenman <ler@lerctr.org>
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2003-09-22 04:50:29 +00:00
Poul-Henning Kamp
d2f243d06a Make this compile. 2003-09-21 18:54:52 +00:00
Nate Lawson
be8dca590c Add support for fixed event buttons defined in the DSDT (HID "ACPI_FSB"
and "ACPI_FPB").

Pointed out by:		Linux
2003-09-21 02:49:59 +00:00
Nate Lawson
6c0e8467af Add necessary newlines. 2003-09-18 05:12:45 +00:00
Nate Lawson
a0e5a00957 Shorten the message announcing fixed power/sleep buttons. 2003-09-18 05:01:03 +00:00
Mitsuru IWASAKI
526b5e659d Add pci_resume() to reestablish interrupt routing after
suspend/resume.
Especially after hibernation, interrupt routing went back to initial
status on some machines.
2003-09-17 08:32:44 +00:00
Nate Lawson
c87cfaedf2 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).
2003-09-15 21:20:55 +00:00
Nate Lawson
2d610c4638 Only enable S4BIOS by default if the FACS says it is available. The
user can override this with a sysctl.

Be sure to return the acpi_SetSleepState return value to userland.
2003-09-15 06:29:31 +00:00
Nate Lawson
5f7e1e2f82 Print notify values as hex. 2003-09-14 17:47:44 +00:00
Nate Lawson
64fdad2352 Add the -i flag to acpiconf(8) to retrieve battery information.
Rename a few structure elements.
2003-09-13 20:13:01 +00:00
Nate Lawson
5c5967082f Add a system notify handler in addition to the device notify handler.
At least some Toshiba notebooks use a Notify of 0 or 1 for this.

PR:
Submitted by:	Hiroyuki Aizu <aizu@navi.org>
2003-09-11 03:17:33 +00:00
Marcel Moolenaar
24752c4291 Extend the ACPI resource handling to make use of the BUS_CONFIG_INTR()
method. This is necessary on ia64 where it's known that serial interfaces
described in the ACPI namespace may not have the well-known IRQs assigned
to them. This confuses us in thinking they are PCI based interrupts and
wrongly program the APIC.
2003-09-10 22:06:41 +00:00
John Baldwin
42a12b2bd8 Move the definitions for ACPI MADT table entries not present in the ACPICA
distribution to a MI header so it can be shared with other architectures.
2003-09-10 06:32:27 +00:00
Nate Lawson
9817561470 Disallow attempts to suspend to S0. It was only enabled for testing.
Print a more informative message if a sleep state is not supported by BIOS.
Add comments.
2003-09-09 04:09:25 +00:00
Nate Lawson
f97739da4d Don't free the buffer if it wasn't actually allocated. 2003-09-04 15:55:41 +00:00
Nate Lawson
ad1fdf57d2 Use the ACPICA AcpiEnterSleepStateS4bios instead of rolling our own. This
change also disables interrupts around non-S4 suspends whereas before we
did not do this.  Our version of AcpiEnterSleepStateS4bios was almost
identical to the ACPICA version.
2003-08-29 04:02:19 +00:00
John Baldwin
729d7ffbcf - Rename PCIx_HEADERTYPE* to PCIx_HDRTYPE* so the constants aren't so long.
- Add a new PCIM_HDRTYPE constant for the field in PCIR_HDRTYPE that holds
  the header type.
- Replace several magic numbers with appropriate constants for the header
  type register and a couple of PCI_FUNCMAX.
- Merge to amd64 the fix to the i386 bridge code to skip devices with
  unknown header types.

Requested by:	imp (1, 2)
2003-08-28 21:22:25 +00:00
Nate Lawson
be2b179704 Style and whitespace changes. Also, make the ivar functions non-inline
since inlining failed due to the size of BUS_*
2003-08-28 16:06:30 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
cace7a2a4d Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 06:06:16 +00:00
Takanori Watanabe
f09e4e876e Update my mail address on copyright notice.
Noticed by: njl
2003-08-19 01:54:34 +00:00
Poul-Henning Kamp
78a49a45bc Give timecounters a numeric quality field.
A timecounter will be selected when registered if its quality is
not negative and no less than the current timecounters.

Add a sysctl to report all available timecounters and their qualities.

Give the dummy timecounter a solid negative quality of minus a million.

Give the i8254 zero and the ACPI 1000.

The TSC gets 800, unless APM or SMP forces it negative.

Other timecounters default to zero quality and thereby retain current
selection behaviour.
2003-08-16 08:23:53 +00:00
Nate Lawson
92aa3b6885 Revert part of rev. 1.16 -- reinstate system notify handler. It turns out
at least the Casio FIVA requires this.

Requested by:	takawata
2003-08-15 06:33:11 +00:00
Nate Lawson
ec2e60b457 De-inline functions which do not need to be inline. Move the DEVMETHOD
block to where it is in similar drivers.
2003-08-15 02:18:15 +00:00
Nate Lawson
e9247df73d Don't install a system notify handler. Move the device notify handler
installation to just before we're ready to handle events.  Make a loop
more readable (no functional change).
2003-08-15 02:17:23 +00:00
Nate Lawson
59ddeb18b8 Fix a couple changes that were incorrect in updating for 0619. Only unlock
the hardware mutex if it is held.  Re-add calls to Enable/Clear fixed events.

This is not known to have caused problems.  Bug symptoms might have included
instability after an aborted suspend attempt or power/sleep buttons not
being enabled.
2003-08-15 02:10:38 +00:00
Nate Lawson
798fb860d5 Style cleanups to match the rest of this directory. For acpi_battery.c,
remove unused includes.
2003-08-11 15:34:43 +00:00
Nate Lawson
bf0c18ec43 Default to 5 seconds before sleeping to give some machines time to stabilize.
This doesn't break anything on my laptop and some claim it helps them.
2003-08-08 03:19:22 +00:00
John Baldwin
8b149b5131 Consistently use the BSD u_int and u_short instead of the SYSV uint and
ushort.  In most of these files, there was a mixture of both styles and
this change just makes them self-consistent.

Requested by:	bde (kern_ktrace.c)
2003-08-07 15:04:27 +00:00
Nate Lawson
a329ebca91 Add and document the hw.acpi.ec.poll_timeout tunable. 2003-07-30 16:22:53 +00:00
Takanori Watanabe
62d4c42b21 Enable wake up GPE before shutdown, not only for sleeping. 2003-07-26 09:54:17 +00:00
Nate Lawson
44904c4020 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.
2003-07-25 16:49:46 +00:00
Nate Lawson
c72508e283 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
2003-07-20 21:12:21 +00:00
Nate Lawson
3a371f32b3 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
2003-07-20 21:11:32 +00:00
Nate Lawson
e1a90ae12f Clarify the ACPI shutdown messages. 2003-07-20 00:52:57 +00:00
Nate Lawson
f8335e3a97 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
2003-07-20 00:48:38 +00:00
John Baldwin
9e66b98a4a Fix a bogon in the previous commit. When suppressing multiple isab
devices, we have to allow for the case when the isab0 device is ourselves.

Tested by:	markm
2003-07-17 19:13:41 +00:00
Nate Lawson
ff40920e9e 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
2003-07-15 19:24:36 +00:00
Nate Lawson
fa1045a79d Remove old defines since they are no longer used. 2003-07-15 19:19:54 +00:00
Marcel Moolenaar
6613111b55 Fix build breakage on ia64. The second argument of AcpiOsReadable()
and AcpiOsWritable() have type ACPI_SIZE and not UINT32.
2003-07-14 02:42:15 +00:00
Nate Lawson
6fca9360db 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
2003-07-13 22:57:16 +00:00
Nate Lawson
1f04e8f501 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
2003-07-10 17:22:46 +00:00
John Baldwin
852989bdbf - Fix a typo in the call to acpi_disabled() in probe() by removing an
extra trailing space.
- Don't bother probing a generic ISA bus device if isab0 already exists.
  Some BIOSes place an ACPI psuedo-device with the HID of a generic ISA bus
  device under the PCI-ISA bridge device.  This is not the best solution
  but will work for now.  The isa bus driver only allows for one ISA bus
  anyways.
2003-07-09 18:28:53 +00:00
John Baldwin
6c525ee43c Add an ACPI to ISA psuedo bridge driver. It attaches an isab(4) device to
ACPI nodes with the plug and play ID's defined for a "Generic ISA Bus
Device" as defined in section 10.7 of the ACPI 2.0 specification.  This
gives machines like the Libretto that contain a fake ISA bus that is not
connected via a PCI-ISA bridge an ISA bus for ISA devices to attach to.

Tested by:	markm
2003-07-08 18:59:32 +00:00
John Baldwin
8a9bc9c03b - Use the new resource_disabled() helper function to see if devices are
disabled.
- Change the apm driver to match the acpi driver's behavior by checking to
  see if the device is disabled in the identify routine instead of in the
  probe routine.  This way if the device is disabled it is never created.

Note that a few places (ips(4), Alpha SMP) used "disable" instead of
"disabled" for their hint names, and these hints must be changed to
"disabled".  If this is a big problem, resource_disabled() can always be
changed to honor both names.
2003-07-02 16:09:02 +00:00
Thomas Moestl
3920999db7 Add a new PCI interface method, assign_interrupt, to determine the
interrupt to be used for a device. This is intended solely for internal
use of PCI bus implementations, and exists so that PCI bus drivers
implementing special interrupt assignment methods which require
additional work at the bus level to work right can be easily derived
from the generic driver (or any other one) without resorting to hacks.

It will be used in the sparc64 ofw_pcibus driver, which will be
committed shortly.

Make use of this method in the generic implementation, and add it to
the method table of bus drivers derived from the PCI one.

Reviewed by:	imp, -hackers
2003-07-01 14:08:33 +00:00
Nate Lawson
464c662efa 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.
2003-06-27 21:57:42 +00:00
Peter Wemm
151cd71608 Add the MD ifdefs for amd64 to point to the IO space bustag/handle.
Approved by:  re ("safe" amd64 support)
2003-05-31 06:45:28 +00:00
John Baldwin
dea7cce585 Add some extra #ifdef stubs so that this compiles on 4.8.
Approved by:	re (rwatson/bmah)
2003-05-13 16:59:46 +00:00
Nate Lawson
014ed75b27 Move some printfs under bootverbose since they are not true errors.
Approved by:	re (bmah)
2003-05-12 16:54:55 +00:00
John Baldwin
9501b60383 Catch up to reworked debugging levels in latest Intel import. 2003-05-01 18:51:43 +00:00
Marcel Moolenaar
214475d865 o Don't announce that the timer is good when in fact it isn't timing
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.
2003-04-30 05:27:01 +00:00
Nate Lawson
51773ddf47 Support functions for the new ACPI import.
* AcpiOsDerivePciId(): finds a bus number, given the slot/func and the
    acpi parse tree.
  * AcpiOsPredefinedOverride(): use the sysctl hw.acpi.os_name to
    override the value for _OS.

Ideas from:	takawata, jhb
Reviewed by:	takawata, marcel
Tested on:	i386, ia64
2003-04-29 18:50:34 +00:00
Mitsuru IWASAKI
d75de53699 Add new sysctl MIB (hw.acpi.supported_sleep_state) to indicate
the list of supported sleep state.
This should help people understand what following message means.

acpi0: AcpiGetSleepTypeData failed - AE_NOT_FOUND

MFC after:	3 days
2003-04-11 16:53:56 +00:00
Jake Burkholder
07515f29ce Fix 2 vm_offset_t -> vm_paddr_t missed in previous commit.
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-25 01:47:29 +00:00
Takanori Watanabe
b256620797 Add integer value of _CID handling.
If _CID is string, it will need more complicated
handling to distinguish bus other than ISA.

Submitted by: Paul Wankadia <junyer@gmx.net>
2003-03-06 14:40:15 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Poul-Henning Kamp
6fee404efa Use canonical form for cdevsw initialization. 2003-03-02 18:47:38 +00:00
Warner Losh
5794c59372 Move the pnp and location info into the common pci bus. Make all known
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
2003-02-17 21:20:35 +00:00
Takanori Watanabe
a89fcf2843 Allow non-privilaged user to retrive battery or AC line information.
Reviewed by: rwatson
2003-02-15 01:46:22 +00:00
Nate Lawson
a40f20c791 More useful announce message containing current speed of CPU 2003-01-23 22:18:14 +00:00
Nate Lawson
d6b992c723 For the cpu throttling message, s/enabled/available
Requested by:	many
2003-01-14 19:39:41 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Robert Watson
2a4689e84a Change ACPI make_dev() calls to use UID_ and GID_ constants rather
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
2002-12-28 14:58:50 +00:00
Marcel Moolenaar
991fcff585 Fix a De Morgan bug: If we only expect a memory range OR an
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.
2002-12-23 03:48:59 +00:00
Takanori Watanabe
c6a78e9840 Add sysctl knob to stop disabling acpi on shutdown.
Approved by: re(jhb)
2002-12-11 18:48:50 +00:00
Mitsuru IWASAKI
21b5fd3cfd Resolve conflicts arising from the ACPI CA 20021118 import. 2002-11-27 18:09:20 +00:00
Mitsuru IWASAKI
3fd2b0260e Disable debug output from acpi_pci_link.
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
2002-11-27 09:32:24 +00:00
John Baldwin
8745ec57d0 - Assume a bus number of zero if evaluating _BBN fails, not if it succeeds.
This was effectively rendering _BBN useless.
- Cleanup handling of the busok variable a bit.

Submitted by:	marcel (1)
Approved by:	re (rwatson)
2002-11-25 21:55:04 +00:00
Mitsuru IWASAKI
87b45ed576 Add `if (!cold)' checkings for functions which is called via SYSINIT.
Loading acpi.ko with kldload is disallowed, however some
functions were executed unexpectedly.

Approved by:	re
2002-11-24 02:27:07 +00:00
John Baldwin
9debb53220 According to the ACPI spec, the bus number of the child PCI bus of a host
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
2002-11-22 18:11:13 +00:00
Mitsuru IWASAKI
9bb04eb483 Add status initialization code for acpi_cmbat and acpi_acad,
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.
2002-11-03 10:49:24 +00:00
Mitsuru IWASAKI
21ac81ad19 Don't examine ACPI_STA_ENABLE bit of device's_STA object on initial
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.
2002-10-31 20:43:02 +00:00
Mitsuru IWASAKI
498d464fe9 Interpret new loader tunable "hw.acpi.verbose" to turn
verbose mode on at boot time.
2002-10-31 20:23:41 +00:00
Mitsuru IWASAKI
91da7c40b2 Invoke 3 ACPI task threads as default if option ACPI_MAX_THREADS is
not defined.
To make previous default behavior (ACPI_MAX_THREADS undefined), define
option ACPI_MAX_THREADS as 0.
2002-10-31 17:58:39 +00:00
John Baldwin
ebc4ae3b74 Add a missing newline to the end of a device_printf().
Reported by:	Michael G. Petry <petry@NetMasters.Com>
2002-10-29 19:08:55 +00:00
Mitsuru IWASAKI
4690674e12 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).
2002-10-24 10:56:33 +00:00
John Baldwin
fc0ea94a7d Catch up to changes in acpivar.h to add support for using ACPI on
4-stable systems.

Sponsored by:	The Weather Channel
2002-10-16 17:28:53 +00:00
John Baldwin
3a65df0084 struct timecounter is defined in sys/time.h on 4-stable.
Sponsored by:	The Weather Channel
2002-10-16 17:27:40 +00:00
John Baldwin
0b1d1f1afb - Include lock headers on current in this header instead of putting
#if's in all the other ACPI source files.
- Use splhigh() for the ACPI subsystem lock on 4-stable.

Sponsored by:	The Weather Channel
2002-10-16 17:27:11 +00:00
John Baldwin
680717ff9e - In AcpiOsGetThreadId(), allow for curproc to be NULL on 4-stable systems.
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
2002-10-16 17:25:29 +00:00
John Baldwin
b60bd0c129 Implement the internal locks of an ACPI semaphore with splhigh() on
4-stable.  -current uses a mutex for this purpose.

Sponsored by:	The Weather Channel
2002-10-16 17:23:34 +00:00
Mitsuru IWASAKI
93569b6b3a Fix a possible bug about freeing non-malloc'ed pointer.
Suggested by:	jhb (in -current ML)
2002-10-16 15:42:27 +00:00
John Baldwin
6b4d1b08a2 Use d_thread_t for cdevsw functions instead of struct thread * so that it
is easier to share this code with 4-stable.
2002-10-09 20:39:26 +00:00
John Baldwin
87e5d36101 Include <dev/acpica/acpivar.h> instead of <acpica/acpivar.h> like all the
other sys/dev/acpica files.
2002-10-09 20:38:21 +00:00
John Baldwin
422971d7d9 Don't panic for a bad ivar request, just return ENOENT. 2002-10-08 15:44:35 +00:00
Mitsuru IWASAKI
5e0ca5771b Make sure that ACPI PCI driver probe routine call pci_cfgregopen()
before start accessing PCI config space.

Reviewed by:	jhb
2002-10-05 02:16:49 +00:00
Mitsuru IWASAKI
9063802340 Oops, forgot to add main file for my previous commit :-) 2002-10-05 02:06:00 +00:00
Mitsuru IWASAKI
ba835e3fe6 Add code for ACPI PCI link object manipulation.
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.
2002-10-05 02:01:05 +00:00
Peter Wemm
f5e283f206 Oops, missed this one. Fix a printf format error on 64 bit systems
where sizes are long instead of int.
2002-10-04 00:35:22 +00:00
Peter Wemm
0b57bf8a75 Fix printf format errors on 64 bit systems where sizes are long
instead of just int.
2002-10-04 00:33:46 +00:00
Peter Wemm
f144391b8f Display the name of the acpi node that we do not find the pci interrupt
routing table for.
2002-10-04 00:32:09 +00:00
Scott Long
316ec49abd Some kernel threads try to do significant work, and the default KSTACK_PAGES
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
2002-10-02 07:44:29 +00:00
John Baldwin
b8581e0d56 Now that we only probe host-PCI bridges once, we no longer have to check to
see if we have been probed before by checking for a pciX bus device.
2002-09-23 18:14:31 +00:00
John Baldwin
eeb6dba253 Attach ACPI children a bit later in attach(), specifically after performing
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.
2002-09-06 17:01:06 +00:00
John Baldwin
da14ac9fce Add a helper routine acpi_SetIntrModel() to call the _PIC method to set
the interrupt model in use so that ACPI can properly route interrupts for
machines using APIC's or SAPIC's.
2002-09-06 16:08:08 +00:00
John Baldwin
c6a121ab5e Make the printf messages when routing interrupts more consistent in the
various PCI bridge drivers.
2002-09-05 17:08:35 +00:00
John Baldwin
1d62131385 - Make pci_load_vendor_data() static and do it during MOD_LOAD instead of
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)
2002-09-04 03:13:16 +00:00
John Baldwin
9ed79ecadf Use resource_list_print_types() instead of duplicating the code. 2002-09-04 03:11:20 +00:00
Mitsuru IWASAKI
6c40705212 s/hint.acpi.0.disable/hint.acpi.0.disabled/
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).
2002-08-30 11:11:07 +00:00
Mitsuru IWASAKI
d62ab2f4a1 Resolve conflicts arising from the ACPI CA 20020815 import. 2002-08-29 01:52:27 +00:00
Mitsuru IWASAKI
f3a6cbb651 Change default value of hw.acpi.sleep_delay to 0.
This caused problems (reset or lock up) at wakeup.
2002-08-28 18:46:09 +00:00
Mitsuru IWASAKI
cfd820d382 Fix a bug about the cooling system controlling in acpi_thermal driver.
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...
2002-08-27 07:53:55 +00:00
John Baldwin
2ccfc93222 Overhaul the ACPI PCI bridge driver a bit:
- 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
2002-08-26 18:30:27 +00:00
John Baldwin
28bf1fad05 Add an ACPI PCI bus driver that is a subclass of the generic PCI bus
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
2002-08-26 17:55:42 +00:00
John Baldwin
473f1ca90d In acpi_pcib_route_interrupt(), the code claims to check to see if a PCI
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.
2002-08-26 15:12:47 +00:00
Mitsuru IWASAKI
ff01efb50d Add new sysctl MIB (hw.acpi.sleep_delay) to specify the delay (in
seconds) before ACPI sleep.  Some machines might need this to sleep
by Hot-key.
2002-08-25 06:13:53 +00:00
John Baldwin
11dfccde73 Use the _STA method of a battery control method to see if a battery is
present or not.  My laptop now properly notices when a battery is removed.

Reviewed by:	iwasaki
2002-08-21 15:01:53 +00:00
Warner Losh
2ab060eebb don't include redunant \n in panic message 2002-08-12 22:36:18 +00:00
Mitsuru IWASAKI
27c7af4d02 Fix wrong member variable ordering of struct acpi_bif. 2002-08-09 07:08:53 +00:00
Mitsuru IWASAKI
b69ed3f4c6 Resolve conflicts arising from the ACPI CA 20020725 import. 2002-07-30 19:35:32 +00:00
Mitsuru IWASAKI
3c24196d00 Add NULL check for the output buffer from AcpiEvaluateObject().
Submitted by:	jon
2002-07-23 00:47:13 +00:00
Mitsuru IWASAKI
a1fccb4765 Add device(power/sleep button and lid) wake function from sleeping state.
This is required for some Thinkpad (and maybe VAIO) machines to wake
the system up from sleep.

Currently partially implemented, more complete implementation will come later.
2002-07-22 12:52:54 +00:00
Mitsuru IWASAKI
98479b041b Resolve conflicts arising from the ACPI CA 20020611 import. 2002-07-09 17:54:02 +00:00
Mitsuru IWASAKI
c169fc477d Fix wrong use of ACPI_NO_UNIT_LIMIT which is for as_maxunits, not as_units. 2002-07-06 13:59:59 +00:00
Takanori Watanabe
4ec593593a Make interrupt driven EC transaction optional. 2002-07-02 03:38:07 +00:00
Mitsuru IWASAKI
74fc979a09 Resolve conflicts arising from the ACPI CA 20020404 import. 2002-06-30 17:53:12 +00:00
Bruce Evans
e788f79698 Fixed printf format errors which apparently crept in while -Wformat was
disabled for gcc-3.
2002-05-25 11:18:03 +00:00
Mitsuru IWASAKI
494ae5601d Terminate ACPI subsystem on reboot.
Some machines stuck on reboot if ACPI sleep/wakeup was executed.
2002-05-19 15:12:40 +00:00
Peter Wemm
b4a052380f Brutally deal with __func__ being 'const char *' on gcc-3.1. 2002-05-19 06:16:47 +00:00
John Baldwin
3c600cfb6c Fix acpi_avoid() to call freeenv() on the original char * returned from
getenv().

Reported by:	joe
Tested by:	joe
2002-05-09 21:13:37 +00:00
Poul-Henning Kamp
2266fe776e Don't export timecounter structures under debug. with sysctl, they
contain no truly interesting data anymore.
2002-04-30 19:34:31 +00:00
Poul-Henning Kamp
7e2d76ff05 Remove the tc_update() function. Any frequency change to the
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.
2002-04-26 10:06:26 +00:00
Maxime Henrion
78689b156f Don't call freeenv() on a modified pointer.
Submitted by:	Alexander Kabaev <ak03@gte.com>
Reviewed by:	phk
Pointy hat to:	mux
2002-04-24 17:49:21 +00:00
Mike Barcroft
94aae28200 Fix compiling of acpica when debugging is enabled. In the previous
revision, two getenv()s were accidentally changed to use testenv().

Pointy hat to:	mux
2002-04-19 23:36:38 +00:00
Maxime Henrion
d786139c76 Rework the kernel environment subsystem. We now convert the static
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
2002-04-17 13:06:36 +00:00
Takanori Watanabe
32b58d137b Print DRQ resource in boot message. 2002-04-08 06:58:17 +00:00
John Baldwin
6008862bc2 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
Poul-Henning Kamp
116caf7cf7 Hide the ACPI counter probing printf behind bootverbose.
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!
2002-03-24 11:33:52 +00:00
Mike Smith
0a702a9b3a Fix error introduced in the 20020217 update, where GetPossibleResources
was spammed with GetCurrentResources.

Submitted by:	Munehiro Matsuda <haro@h4.dion.ne.jp>
2002-03-21 02:02:31 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Peter Wemm
30171114b3 Fix a gcc-3.1+ warning.
warning: deprecated use of label at end of compound statement

ie: you cannot do this anymore:
switch(foo) {
....

default:
}
2002-03-19 11:02:06 +00:00
Doug Rabson
c19da1c7af Only i386 has wbinvd(). 2002-03-12 09:45:17 +00:00
Peter Wemm
8b79649b5b Do not concatenate __func__ with strings, because it is not a string.
Later gcc's blow up on this.
2002-03-12 00:15:06 +00:00
Peter Wemm
4d3523e298 Do not do string concatenation with __func__ (which is not a string) 2002-03-12 00:12:59 +00:00
Peter Wemm
75a3a26d2a Recent acpica imports have changed the lengths from UINT32 to ACPI_SIZE,
which is 64 bit on ia64.  Fix it.
2002-03-12 00:10:40 +00:00
Mitsuru IWASAKI
899ccf541a Add generalized power profile code.
This makes other power-management system (APM for now) to be able to
generate power profile change events (ie. AC-line status changes), and
other kernel components, not only the ACPI components, can be notified
the events.

 - move subroutines in acpi_powerprofile.c (removed) to kern/subr_power.c
 - call power_profile_set_state() also from APM driver when AC-line
   status changes
 - add call-back function for Crusoe LongRun controlling on power
   profile changes for a example
2002-03-04 18:46:13 +00:00
Poul-Henning Kamp
cb877d0050 Add a new test_counter() function which tries to determine the width of
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
2002-02-25 09:51:17 +00:00
Mike Smith
5da19f398a The thermal thread needs to take Giant before it does anything with the
interpreter.

Submitted by:	Magnus B{ckstr|m <b@etek.chalmers.se>
2002-02-25 02:21:22 +00:00
Matthew Dillon
d32e27a9f4 Tests by numerous people have shown that many chipsets do not properly
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
2002-02-24 22:58:15 +00:00
Mike Smith
222c49a4c7 AcpiOsPrintf and AcpiOsVprintf now return void. 2002-02-23 05:32:51 +00:00
Mike Smith
9232a543e6 AcpiOsCallocate is no longer required. 2002-02-23 05:32:10 +00:00
Mike Smith
72e5754cfb Match namespace cleanup changes in ACPI CA 20020217 update. 2002-02-23 05:31:38 +00:00
Mike Smith
dd5d65087b Add our own private defines for driver debug layers.
Obsolete the acpi_GetInto* interfaces.

Fix a typo to be less appropriate.
2002-02-23 05:30:54 +00:00
Mike Smith
1a6f2d2ab3 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Convert to using a kthread rather than timeout() to avoid problems
with the interpreter sleeping.
2002-02-23 05:29:23 +00:00
Mike Smith
741ef403c2 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.
2002-02-23 05:28:22 +00:00
Mike Smith
c1b1f7874c Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Use _ADR as well as _BBN to get our bus number.
2002-02-23 05:27:49 +00:00
Mike Smith
9127281c88 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
2002-02-23 05:26:45 +00:00
Mike Smith
dbd0058a4e 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.
2002-02-23 05:26:31 +00:00
Mike Smith
595a08978c Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Kill off the timeouts that used to read _BIF and _BST.  These are
invoked when the battery is actually read.  timeout() is dangerous
in combination with ACPI, as the interpreter can block.

This driver still needs more work.
2002-02-23 05:24:14 +00:00
Mike Smith
b53f277167 Match namespace cleanup changes in ACPI CA 20020217 update.
Use ACPI_SUCCESS/ACPI_FAILURE consistently.
The AcpiGetInto* interfaces are obsoleted by ACPI_ALLOCATE_BUFFER.

Add AcpiBatteryIsPresent helper to determine whether a battery device
is inserted.

Add ACPI_ALL_DRIVERS to the list of debug layers, now that we own the
namespace for this.

Pr:
2002-02-23 05:21:56 +00:00
Takanori Watanabe
85dff349f4 Fix irq/drq handling. IRQ and DRQ resource information can be get
in one object for one resource. Array of values in a object means
possible values for the object.
2002-01-31 09:18:27 +00:00
Takanori Watanabe
f8372ade81 Fix error handling.
PR:30665
Submitted by:TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>
2002-01-31 01:23:22 +00:00
Mike Smith
b6b6d662bc find_devclass -> devclass_find. 2002-01-08 19:14:59 +00:00
Mike Smith
3273b00523 Staticise devclasses and some unnecessarily global variables. 2002-01-08 06:46:01 +00:00
John Baldwin
c86b6ff551 Change the preemption code for software interrupt thread schedules and
mutex releases to not require flags for the cases when preemption is
not allowed:

The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent
switching to a higher priority thread on mutex releease and swi schedule,
respectively when that switch is not safe.  Now that the critical section
API maintains a per-thread nesting count, the kernel can easily check
whether or not it should switch without relying on flags from the
programmer.  This fixes a few bugs in that all current callers of
swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from
fast interrupt handlers and the swi_sched of softclock needed this flag.
Note that to ensure that swi_sched()'s in clock and fast interrupt
handlers do not switch, these handlers have to be explicitly wrapped
in critical_enter/exit pairs.  Presently, just wrapping the handlers is
sufficient, but in the future with the fully preemptive kernel, the
interrupt must be EOI'd before critical_exit() is called.  (critical_exit()
can switch due to a deferred preemption in a fully preemptive kernel.)

I've tested the changes to the interrupt code on i386 and alpha.  I have
not tested ia64, but the interrupt code is almost identical to the alpha
code, so I expect it will work fine.  PowerPC and ARM do not yet have
interrupt code in the tree so they shouldn't be broken.  Sparc64 is
broken, but that's been ok'd by jake and tmm who will be fixing the
interrupt code for sparc64 shortly.

Reviewed by:	peter
Tested on:	i386, alpha
2002-01-05 08:47:13 +00:00
Mike Smith
3e759f3681 If the CLK_VAL register is 0 bits wide, the system does not support
CPU throttling, so don't do some bogus math to check it.
2002-01-02 10:53:10 +00:00
Mitsuru IWASAKI
586cd03a19 Oops, wrong option name. It's should be ACPI_MAX_THREADS,
not ACPI_NO_THREADS.
2001-12-25 06:06:56 +00:00
Mitsuru IWASAKI
c573e654b7 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.
2001-12-22 16:05:41 +00:00
Mitsuru IWASAKI
ece50487e9 Disable sleep requests for 5 sec after wakeup. This is needed for
some Toshiba and Thinkpad laptops.
Wakeup event is generated by power button or sleep button on some
laptops but this also generates SCI interrupt, and shutdown the system
as result.  So this is introduced so that acpi driver ignore given
requests for certain period.
2001-12-09 18:02:36 +00:00
Mitsuru IWASAKI
931a10c9d2 Add a couple of minor changes.
- set sc->acpi_s4bios to 1 by default for hibernation until
   OS-initiated S4 transition is implemented.
 - change the behavior of acpi_sleep_state_sysctl() if new value is
   the same as old one, do nothing instead of EINVAL.
2001-11-30 16:06:00 +00:00
Mitsuru IWASAKI
b9c780d64e Yet another synch with minor changes in the ACPI CA 20011120 snapshot.
We need to call AcpiEnterSleepStatePrep() before AcpiEnterSleepState().
2001-11-28 12:09:42 +00:00
Mike Smith
76f2b644fd Synch with minor changes in the ACPI CA 20011120 snapshot. 2001-11-28 04:36:29 +00:00
Mitsuru IWASAKI
6397624d9b Validate requested sleep state in acpi_SetSleepState() to avoid reentry
during wakeup procedure.
2001-11-23 05:57:03 +00:00
Mitsuru IWASAKI
dc2183bf5c Add disabling code via the debug.acpi.disable environment variable. 2001-11-22 17:43:15 +00:00
Mitsuru IWASAKI
6971b3c7d1 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.
2001-11-18 18:12:07 +00:00
Mitsuru IWASAKI
964679ce58 Fix re-enabling ACPI on wakeup from hibernation. The problem was that
acpi_Disable() cleared all GPE events.
Some old ACPI implementaions still need current re-enabling code.
2001-11-15 15:12:08 +00:00
Mitsuru IWASAKI
e0157e3edc Two minor changes.
- Change _ACx sysctl oid from ten of _AC[0-9] to one _ACx.
 - Better error printing on _TMP evaluation.

Reviewed by:    msmith
2001-11-15 12:00:48 +00:00
Mitsuru IWASAKI
b8670bed9b Remove "S4B" from sleep_state_names and add "NONE" instead.
Now you can say;
 # sysctl hw.acpi.lid_switch_state=NONE
instead of specifying unsupported _Sx object in the system.

Actually, S4B is going to disappear in ACPICA and we already have
hw.acpi.s4bios to distinguish BIOS hibernation or OS hibernation.
2001-11-15 11:59:25 +00:00
Mitsuru IWASAKI
1611ea8727 Add S4BIOS sleep (BIOS hibernation) and DSDT overriding support.
- Add S4BIOS sleep implementation.  This will works well if MIB
   hw.acpi.s4bios is set (and of course BIOS supports it and hibernation
   is enabled correctly).
 - Add DSDT overriding support which is submitted by takawata originally.
   If loader tunable acpi_dsdt_load="YES" and DSDT file is set to
   acpi_dsdt_name (default DSDT file name is /boot/acpi_dsdt.aml),
   ACPI CA core loads DSDT from given file rather than BIOS memory block.
   DSDT file can be generated by iasl in ports/devel/acpicatools/.
 - Add new files so that we can add our proposed additional code to Intel
   ACPI CA into these files temporary.  They will be removed when
   similar code is added into ACPI CA officially.
2001-11-06 15:00:30 +00:00
Mitsuru IWASAKI
09e97d2f24 Remove unnecessary WAK_STS bit waiting code for S1 sleep.
It was duplicated with AcpiEnterSleepState() since acpica-unix-20010816.
2001-11-05 14:51:58 +00:00
Mitsuru IWASAKI
3fa010222f Oops, deleted wrong BIF acquisition timeout invocation by mistake
in my previous commit.
acpi_cmbat_get_bif() from taskqueue calls acpi_cmbat_timeout() so it's
better for startup.
2001-11-01 22:20:41 +00:00
Mitsuru IWASAKI
f9390180fe Some fix for the recent apm module changes.
- Now that apm loadable module can inform its existence to other kernel
   components  (e.g. i386/isa/clock.c:startrtclock()'s TCS hack).
 - Exchange priority of SI_SUB_CPU and SI_SUB_KLD for above purpose.
 - Add simple arbitration mechanism for APM vs. ACPI.  This prevents
   the kernel enables both of them.
 - Remove obsolete `#ifdef DEV_APM' related code.
 - Add abstracted interface for Powermanagement operations.  Public apm(4)
   functions, such as apm_suspend(), should be replaced new interfaces.
   Currently only power_pm_suspend (successor of apm_suspend) is implemented.

Reviewed by:	peter, arch@ and audit@
2001-11-01 16:34:07 +00:00
Mitsuru IWASAKI
a296c021c2 Style(9) fix, mainly white spaces. 2001-10-30 15:51:52 +00:00
Mitsuru IWASAKI
9febbb4078 Some improvements of control method battery driver.
- Add a new MIB for battery info expire time in order to make it changeable.
   Battery info expire time can be specified by
   hw.acpi.battery.info_expire in sec.
 - Add own MALLOC type and fix some potential memory leakages.
 - Change some frequent printings to verbose printing.
 - Stop timeout during acpi_cmbat_get_bst() too.  This should reduce
   the races with BIF evaluation.
 - Remove acpi_cmbat_get_bif() invocation from acpi_cmbat_attach().
   This was redundant because this should be called from
   acpi_cmbat_timeout() now.
2001-10-30 14:24:26 +00:00
Mitsuru IWASAKI
2d64460768 Some small improvements of ACPI thermal driver.
- Give a guaranteed minimum cooling run time to avoid too frequent
   cooling system On/Off switching.  The minimum cooling run time can be
   specified by hw.acpi.thermal.min_runtime in sec.
 - Refine message printing (_AC-1 -> NONE).
 - Add verbose mode enable/disable capability by hw.acpi.verbose in bool.

Reviewed by:	acpi-jp@ folks
2001-10-29 18:09:43 +00:00
John Baldwin
282873e2c0 - Change the taskqueue locking to protect the necessary parts of a task
while it is on a queue with the queue lock and remove the per-task locks.
- Remove TASK_DESTROY now that it is no longer needed.
- Go back to inlining TASK_INIT now that it is short again.

Inspired by:	dfr
2001-10-26 18:46:48 +00:00
Mitsuru IWASAKI
f86214b6b8 Add APM compatibility feature to ACPI.
This emulates APM device node interface APIs (mainly ioctl) and
provides APM services for the applications.  The goal is to support
most of APM applications without any changes.
Implemented ioctls in this commit are:
 - APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl)
 - APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl)
 - APMIO_GETINFO and APMIO_GETINFO_OLD
 - APMIO_GETPWSTATUS

With above, many APM applications which get batteries, ac-line
info. and transition the system into suspend/standby mode (such as
wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-)

Reviewed by:	arch@, audit@ and some guys
2001-10-26 17:43:05 +00:00
John Baldwin
1de1c550b1 Add locking to taskqueues. There is one mutex per task, one mutex per
queue, and a mutex to protect the global list of taskqueues.  The only
visible change is that a TASK_DESTROY() macro has been added to mirror
the TASK_INIT() macro to destroy a task before it is free'd.

Submitted by:	Andrew Reiter <awr@watson.org>
2001-10-26 06:32:21 +00:00
John Baldwin
76e7a78292 Use TASK_INIT to initialize taskqueue task instead of violating the
abstraction.

Submitted by:	Andrew Reiter <arr@watson.org>
2001-10-25 19:56:02 +00:00
John Baldwin
e5e5b51f9f Allow hw.acpi.cpu.{economy,performance}_speed to be set from the loader
via tunables.
2001-10-23 22:37:36 +00:00
Mitsuru IWASAKI
c7a9768031 Reduce frequency of Battery info (_BIF) acquisition. This helps
avoiding EC read errors on some laptops.
 - Stop updating Battery info for all user requests
 - Update Battery info by notify events and resume method
 - Poll Battery info every one minute

Suggested by:	takawata
2001-10-22 18:01:37 +00:00
John Baldwin
7106ca0d1a Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +00:00
Doug Rabson
a067d21032 Make the interrupt routing a bit less chatty unless bootverbose is set. 2001-10-07 18:25:43 +00:00
Peter Wemm
887f6fb8d4 Fix some 64-bit uncleanliness. 2001-10-06 04:09:26 +00:00
Peter Wemm
cd5178beb8 Fix some style bugs before fixing some real bugs. 2001-10-06 04:03:20 +00:00
Peter Wemm
555143d0df Fix a stack trashing bug when int != sizeof(pointer)
This fixes the ia64 boot!  We have scsi disks!
2001-10-06 03:49:38 +00:00
Mike Smith
43896e913a 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.
2001-10-04 23:21:09 +00:00
Doug Rabson
b0ee13ad5a Add busspace hacks for ia64. 2001-10-04 08:33:16 +00:00
Doug Rabson
1983594568 Use return_PTR, not return_VALUE when returning pointers. 2001-10-04 08:32:18 +00:00
Doug Rabson
ed136da6f4 Check the compatible ID as well as the hardware ID in acpi_MatchHid. 2001-10-04 08:31:17 +00:00
Mitsuru IWASAKI
23b4e251d0 Call acpi_DeviceIsPresent() only for devices. This should make
non-ACPI_TYPE_DEVICE devices (such as acpi_tz and acpi_cpu) enabled
again.

Reviewed by:	msmith
2001-09-17 15:11:55 +00:00
Mike Smith
b519f9d660 Disable devices that are not present; at a later stage we can then enable
them if the device arrives.

This should solve the problem where devices that have been disabled eg. in
the BIOS show up with nonsense resources and hang the bootstrap process.
2001-09-15 04:14:31 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Mitsuru IWASAKI
d983e760a7 Don't call tsleep from AcpiOsStall(), call DELAY() always instead.
Process switching during calling AcpiOsStall() caused fatal trap 12 at
sleeping/wakeup on some machines.
2001-09-08 17:03:26 +00:00
Mike Smith
b525621aed Should check debug.acpi.avoid, not .disable. 2001-09-07 03:54:37 +00:00
Mike Smith
32d18aa566 Allow the ACPI subsystem to be disabled with a hint.
Avoid fully initialising the ACPI namespace if we are attempting to avoid
parts of it.  This is a workaround for some systems that still crash
the interpreter.

Implement the ISA_IVAR_LOGICALID for ISA compatibility.  Implement stubs
for other PnP ID-related ivars.
2001-09-07 02:57:29 +00:00
Mike Smith
0a8c6c7f24 Move OsdEnvironment.c into MD code; searching for the ACPI tables is not
portable.
2001-09-07 02:55:00 +00:00
Mike Smith
1dffb34a9a Initialise the adapter status to an invalid state, so that the initial check
of the adapter object will always result in a change event.

This fixes the problem where a laptop booted without an AC adapter ran
at 100% CPU speed by default.

Submitted by:	"Christopher N . Harrell" <cnh@netvmg.com>
2001-09-06 23:33:22 +00:00
John Baldwin
0c7da7acfa Add a hack to acpi_EvaluateInteger() to handle the case of a method
returning a Buffer that contains an Integer rather an an Integer directly.

Submitted by:	msmith
Approved by:	msmith
2001-09-06 23:16:55 +00:00
Mike Smith
cb97ee57c0 Allocate system resource IRQs as shareable; this is the typical case. 2001-09-06 22:34:40 +00:00
Mitsuru IWASAKI
dbad09ef38 Just print a message in acpi_tz_monitor() only when new active state
is different from the previous active state.
This reduce tons of 'acpi_tz0: _AC0: temperature 64.0 >= setpoint 64.0'
messages.

Reviewed by:	msmith
2001-09-04 15:40:12 +00:00
Mitsuru IWASAKI
dd081ed5d0 Fix typo; CTLFLAG_RO -> CTLFLAG_RD. 2001-09-02 06:28:20 +00:00
Mike Smith
dde24897d2 Add a MODULE_VERSION declaration. This should prevent duplicate loading
of the module, and allows other modules to depend on and link against
the ACPI module.

Add a sysctl that allows us to retrieve the ACPI CA version number as
well.
2001-09-01 22:41:53 +00:00
Mike Smith
2a4684aa19 Don't claim memory resources owned by a PNP0C01 device ("system memory")
as some systems claim the entire physical address space is owned by it.
2001-08-31 22:59:04 +00:00
Mike Smith
05c03ed9b8 Don't activate placeholder resources; it can be very expensive in the
SYS_RES_MEMORY case, and it shouldn't be necessary.
2001-08-31 18:08:50 +00:00
Takanori Watanabe
ff741bef86 Call OS-independent resume routine to execute _WAK .. etc.
This should also recover GPE bit,comment says, though not implemented yet.
2001-08-31 05:36:48 +00:00
Mike Smith
bc0f21954b Add support for attaching PnP-aware ISA drivers to ACPI.
Always parse ACPI device resource settings (current resources only)
and attach the resources to the device before probe/attaching.
2001-08-30 00:50:58 +00:00
Mike Smith
832183ba00 Retarget the resource parser slightly. We only fetch current resources
for the device now (we should really just be parsing a passed-in resource
buffer).

Wrap long lines so this is (more) readable.

Support Address16 and Address32 resources, in the CONSUMER case.

Support DRQs so that we can handle ISA devices.

Support ExtendedIrqs (we ignore most of their attributes)

Add a placeholder device for system memory and system resources.  This
takes the place of the nexus placeholder, which only attaches to ISA.
2001-08-30 00:49:34 +00:00
Mike Smith
d5519f129a Note that now that some ISA devices will attach to ACPI, we need to
keep the ivar indexes that ISA uses free.
2001-08-30 00:45:42 +00:00
Mike Smith
2668fa394a Don't parse our resources ourself, the ACPI core code must do it. 2001-08-30 00:45:12 +00:00
Mike Smith
93b9ee69f5 Nuke the (fairly bogus) attachment of *all* ACPI devices to ISA. 2001-08-30 00:44:29 +00:00
Mike Smith
f48bf2d715 Add missing acpi_disabled() call so that this driver can be disabled. 2001-08-30 00:44:01 +00:00
Mike Smith
4c1cdee628 Updates to match the ACPI CA 20010816 import:
- New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size.
 - New debug level/subsystem codes.
2001-08-26 22:50:15 +00:00
Mitsuru IWASAKI
eb5b463449 Fix error checking about device state transition from D0 to D3.
Turn off the resources listed in _PR0 to go to D3 if we don't have _PR3/_PS3.

Reviewed by:	msmith
2001-08-21 18:22:40 +00:00
Mike Smith
6d3d1a8100 Remove noisy printfs from the notify handler; having these go off
every couple of seconds is not useful.
2001-08-21 09:06:02 +00:00
Mike Smith
b2c98acc5e The Intel 440MX ACPI timer seems to work properly, so add it to the list
here.  Restructure slightly so that adding more devices is easier.

Submitted by:	Jose Gabriel J Marcelino <gabriel@maquina.com>
2001-08-05 23:20:32 +00:00
Mike Smith
feade91944 Reverse the logic here again with regards to "trusted" ACPI timer
implementations.  More of them seem to be broken, so only "trust"
timers we know work.
2001-08-03 09:52:53 +00:00
Mike Smith
d93b034fe9 Shoud build resources in the _CRS buffer. Oops.
Submitted by:	"neckpain@nettaxi.com" <neckpain@nettaxi.com>
2001-08-03 08:38:49 +00:00
Mike Smith
a692219d8a Move the resource pointer when we reallocate the buffer.
Submitted by:	"neckpain@nettaxi.com" <neckpain@nettaxi.com>
2001-08-03 08:38:11 +00:00
Mike Smith
f16527bb44 The current resource buffer returned from an interrupt link device
in the case where there are no interrupts routed for it does not
contain enough space to use it to route an interrupt.  In the case
where we need to route an interrupt, throw away the returned buffer
and create a new one containing the interrupt we want.
2001-07-30 09:01:18 +00:00