History log of /freebsd-10-stable/sys/i386/acpica/
Revision Date Author Comments
256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

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


246855 15-Feb-2013 jkim

Consistently use round_page(x) rather than roundup(x, PAGE_SIZE). There is
no functional change.


241885 22-Oct-2012 eadler

This isn't functionally identical. In some cases a hint to disable
unit 0 would in fact disable all units.

This reverts r241856

Approved by: cperciva (implicit)


241856 22-Oct-2012 eadler

Now that device disabling is generic, remove extraneous code from the
device drivers that used to provide this feature.

Reviewed by: des
Approved by: cperciva
MFC after: 1 week


237027 13-Jun-2012 jkim

- Fix resumectx() prototypes to reflect reality.
- For i386, simply jump to resumectx() with PCB in %ecx.
- Fix a style(9) nit while I am here.


236772 09-Jun-2012 iwasaki

Add x86/acpica/acpi_wakeup.c for amd64 and i386. Difference of
suspend/resume procedures are minimized among them.

common:
- Add global cpuset suspended_cpus to indicate APs are suspended/resumed.
- Remove acpi_waketag and acpi_wakemap from acpivar.h (no longer used).
- Add some variables in acpi_wakecode.S in order to minimize the difference
among amd64 and i386.
- Disable load_cr3() because now CR3 is restored in resumectx().

amd64:
- Add suspend/resume related members (such as MSR) in PCB.
- Modify savectx() for above new PCB members.
- Merge acpi_switch.S into cpu_switch.S as resumectx().

i386:
- Merge(and remove) suspendctx() into savectx() in order to match with
amd64 code.

Reviewed by: attilio@, acpi@


236424 01-Jun-2012 jkim

Consistently use ACPI_SUCCESS() and ACPI_FAILURE() macros wherever possible.


236419 01-Jun-2012 jkim

Tidy up code clutter in SMP case a bit. No functional change.


236414 01-Jun-2012 jkim

Call AcpiSetFirmwareWakingVector() with interrupt disabled for consistency.


236409 01-Jun-2012 jkim

Improve style(9) in the previous commit.


236403 01-Jun-2012 iwasaki

Call AcpiLeaveSleepStatePrep() in interrupt disabled context
(described in ACPICA source code).

- Move intr_disable() and intr_restore() from acpi_wakeup.c to acpi.c
and call AcpiLeaveSleepStatePrep() in interrupt disabled context.
- Add acpi_wakeup_machdep() to execute wakeup MD procedures and call
it twice in interrupt disabled/enabled context (ia64 version is
just dummy).
- Rename wakeup_cpus variable in acpi_sleep_machdep() to suspcpus in
order to be shared by acpi_sleep_machdep() and acpi_wakeup_machdep().
- Move identity mapping related code to acpi_install_wakeup_handler()
(i386 version) for preparation of x86/acpica/acpi_wakeup.c
(MFC candidate).

Reviewed by: jkim@
MFC after: 2 days


235639 19-May-2012 iwasaki

Revert the previous commit on wakecode address verbose printing.
This broke PAE kernel building.


235622 18-May-2012 iwasaki

Add SMP/i386 suspend/resume support.
Most part is merged from amd64.

- i386/acpica/acpi_wakecode.S
Replaced with amd64 code (from realmode to paging enabling code).

- i386/acpica/acpi_wakeup.c
Replaced with amd64 code (except for wakeup_pagetables stuff).

- i386/include/pcb.h
- i386/i386/genassym.c
Added PCB new members (CR0, CR2, CR4, DS, ED, FS, SS, GDT, IDT, LDT
and TR) needed for suspend/resume, not for context switch.

- i386/i386/swtch.s
Added suspendctx() and resumectx().
Note that savectx() was not changed and used for suspending (while
amd64 code uses it).
BSP and AP execute the same sequence, suspendctx(), acpi_wakecode()
and resumectx() for suspend/resume (in case of UP system also).

- i386/i386/apic_vector.s
Added cpususpend().

- i386/i386/mp_machdep.c
- i386/include/smp.h
Added cpususpend_handler().

- i386/include/apicvar.h
- kern/subr_smp.c
- sys/smp.h
Added IPI_SUSPEND and suspend_cpus().

- i386/i386/initcpu.c
- i386/i386/machdep.c
- i386/include/md_var.h
- pc98/pc98/machdep.c
Moved initializecpu() declarations to md_var.h.

MFC after: 3 days


235556 17-May-2012 jhb

Centralize declaration of the debug.acpi sysctl node.


233250 20-Mar-2012 jkim

Merge ACPICA 20120320.


232742 09-Mar-2012 jhb

MFamd64:
- Return failure for a suspend attempt if we have no wake address.
- Use intr_disable()/intr_restore() instead of ACPI_DISABLE_IRQS().
- Invoke intr_suspend() earlier and call intr_resume() if suspend
fails.
- Use pause in the loop waiting for CPU to suspend.
- Restore PAT MSR, switchtime, switchticks, and MTRRs on resume.

Reviewed by: jkim (earlier version)
MFC after: 2 weeks


215200 12-Nov-2010 jkim

MFamd64: (based on) r209957

Move logic of building ACPI headers for acpi_wakeup.c into better places,
remove intermediate makefile and shell script, and reduce diff between i386
and amd64.


215097 10-Nov-2010 jkim

Make APM emulation look more closer to its origin. Use device_get_softc(9)
instead of hardcoding acpi(4) unit number as we have device_t for it.


215072 10-Nov-2010 jkim

Refactor acpi_machdep.c for amd64 and i386, move APM emulation into a new
file acpi_apm.c, and place it on sys/x86/acpica.


215024 09-Nov-2010 jkim

Now OsdEnvironment.c is identical on amd64 and i386. Move it to a new home.


215023 09-Nov-2010 jkim

Reduce diff between platforms and fix style(9) bugs.


215012 08-Nov-2010 jhb

Move the MADT parser for amd64 and i386 to sys/x86/acpica now that it is
identical on both platforms.


215009 08-Nov-2010 jhb

Sync the APIC startup sequence with amd64:
- Register APIC enumerators at SI_SUB_TUNABLES - 1 instead of SI_SUB_CPU - 1.
- Probe CPUs at SI_SUB_TUNABLES - 1. This allows i386 to set a truly
accurate mp_maxid value rather than always setting it to MAXCPU - 1.


215002 08-Nov-2010 jhb

A few small style and whitespace fixes.


214631 01-Nov-2010 jhb

Move <machine/apicreg.h> to <x86/apicreg.h>.


214630 01-Nov-2010 jhb

Move the <machine/mca.h> header to <x86/mca.h>.


211437 17-Aug-2010 rpaulo

For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename
of the compiler command (excluding any arguments) is considered.

This allows you to use, for example, CC="/nondefault/path/clang -xxx",
and still have the various tests in bsd.*.mk identify your compiler as
clang correctly.

ICC if cases were also changed.

Submitted by: Dimitry Andric <dimitry at andric.com>


209212 15-Jun-2010 jhb

Restore the machine check register banks on resume. For banks being
monitored via CMCI, reset the interrupt threshold to 1 on resume.

Reviewed by: jkim
MFC after: 2 weeks


209059 11-Jun-2010 jhb

Update several places that iterate over CPUs to use CPU_FOREACH().


205332 19-Mar-2010 jhb

Use the same policy for rejecting / not-reject ACPI tables with incorrect
checksums as the base acpi(4) driver. This fixes a problem where the MADT
parser would reject the MADT table during early boot causing the MP Table
to be, but then the acpi(4) driver would attach and use non-SMP interrupt
routing.

Tested by: Alastair Hogge agh of coolrhaug com
MFC after: 1 week


197439 23-Sep-2009 jhb

Extract the code to find and map the MADT ACPI table during early kernel
startup and genericize it so it can be reused to map other tables as well:
- Add a routine to walk a list of ACPI subtables such as those used in the
APIC and SRAT tables in the MI acpi(4) driver.
- Move the routines for mapping and unmapping an ACPI table as well as
mapping the RSDT or XSDT and searching for a table with a given signature
out into acpica_machdep.c for both amd64 and i386.


197134 12-Sep-2009 rwatson

Use C99 initialization for struct filterops.

Obtained from: Mac OS X
Sponsored by: Apple Inc.
MFC after: 3 weeks


196403 20-Aug-2009 jhb

Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by: re (kib), attilio


196037 02-Aug-2009 attilio

Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by: ed, hps, jhb, imp, mav, scottl
No answer by: ariff, thompsa, yongari
Tested by: pho,
G. Trematerra <giovanni dot trematerra at gmail dot com>,
Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by: Yahoo! Incorporated
Approved by: re (ksmith)


193951 10-Jun-2009 kib

Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use
vnode interlock to protect the knote fields [1]. The locking assumes
that shared vnode lock is held, thus we get exclusive access to knote
either by exclusive vnode lock protection, or by shared vnode lock +
vnode interlock.

Do not use kl_locked() method to assert either lock ownership or the
fact that curthread does not own the lock. For shared locks, ownership
is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared
lock not owned by curthread, causing false positives in kqueue subsystem
assertions about knlist lock.

Remove kl_locked method from knlist lock vector, and add two separate
assertion methods kl_assert_locked and kl_assert_unlocked, that are
supposed to use proper asserts. Change knlist_init accordingly.

Add convenience function knlist_init_mtx to reduce number of arguments
for typical knlist initialization.

Submitted by: jhb [1]
Noted by: jhb [2]
Reviewed by: jhb
Tested by: rnoland


193530 05-Jun-2009 jkim

Import ACPICA 20090521.


192442 20-May-2009 imp

We don't need d_thread_t for cross-branch portability here anymore.
Move do struct thread * instead.


189404 05-Mar-2009 jhb

At least one BIOS bogusly includes duplicate entries for I/O APICs. The
bogus entries have a starting IRQ that is invalid (> 255, so won't fit
into a PCI intline config register). It had the side effect of breaking
MSI by "claiming" several IRQs in the MSI range. Fix this by ignoring such
I/O APICs.

MFC after: 2 weeks


188767 18-Feb-2009 rdivacky

Mark these variables as __used too. Fix a style of previous commit.

Noticed by: Christoph Mallon
Approved by: kib (mentor)


188753 18-Feb-2009 rdivacky

Mark these variables as __used as those are used in the asm block.

Approved by: kib (mentor)


183381 26-Sep-2008 ed

Remove unit2minor() use from kernel code.

When I changed kern_conf.c three months ago I made device unit numbers
equal to (unneeded) device minor numbers. We used to require
bitshifting, because there were eight bits in the middle that were
reserved for a device major number. Not very long after I turned
dev2unit(), minor(), unit2minor() and minor2unit() into macro's.
The unit2minor() and minor2unit() macro's were no-ops.

We'd better not remove these four macro's from the kernel, because there
is a lot of (external) code that may still depend on them. For now it's
harmless to remove all invocations of unit2minor() and minor2unit().

Reviewed by: kib


179726 11-Jun-2008 ed

Don't enforce unique device minor number policy anymore.

Except for the case where we use the cloner library (clone_create() and
friends), there is no reason to enforce a unique device minor number
policy. There are various drivers in the source tree that allocate unr
pools and such to provide minor numbers, without using them themselves.

Because we still need to support unique device minor numbers for the
cloner library, introduce a new flag called D_NEEDMINOR. All cdevsw's
that are used in combination with the cloner library should be marked
with this flag to make the cloning work.

This means drivers can now freely use si_drv0 to store their own flags
and state, making it effectively the same as si_drv1 and si_drv2. We
still keep the minor() and dev2unit() routines around to make drivers
happy.

The NTFS code also used the minor number in its hash table. We should
not do this anymore. If the si_drv0 field would be changed, it would no
longer end up in the same list.

Approved by: philip (mentor)


177253 16-Mar-2008 rwatson

In keeping with style(9)'s recommendations on macros, use a ';'
after each SYSINIT() macro invocation. This makes a number of
lightweight C parsers much happier with the FreeBSD kernel
source, including cflow's prcc and lxr.

MFC after: 1 month
Discussed with: imp, rink


177157 13-Mar-2008 jhb

Rework how the nexus(4) device works on x86 to better handle the idea of
different "platforms" on x86 machines. The existing code already handles
having two platforms: ACPI and legacy. However, the existing approach was
rather hardcoded and difficult to extend. These changes take the approach
that each x86 hardware platform should provide its own nexus(4) driver (it
can inherit most of its behavior from the default legacy nexus(4) driver)
which is responsible for probing for the platform and performing
appropriate platform-specific setup during attach (such as adding a
platform-specific bus device). This does mean changing the x86 platform
busses to no longer use an identify routine for probing, but to move that
logic into their matching nexus(4) driver instead.
- Make the default nexus(4) driver in nexus.c on i386 and amd64 handle the
legacy platform. It's probe routine now returns BUS_PROBE_GENERIC so it
can be overriden.
- Expose a nexus_init_resources() routine which initializes the various
resource managers so that subclassed nexus(4) drivers can invoke it from
their attach routine.
- The legacy nexus(4) driver explicitly adds a legacy0 device in its
attach routine.
- The ACPI driver no longer contains an new-bus identify method. Instead
it exposes a public function (acpi_identify()) which is a probe routine
that the MD nexus(4) drivers can use to probe for ACPI. All of the
probe logic in acpi_probe() is now moved into acpi_identify() and
acpi_probe() is just a stub.
- On i386 and amd64, an ACPI-specific nexus(4) driver checks for ACPI via
acpi_identify() and claims the nexus0 device if the probe succeeds. It
then explicitly adds an acpi0 device in its attach routine.
- The legacy(4) driver no longer knows anything about the acpi0 device.
- On ia64 if acpi_identify() fails you basically end up with no devices.
This matches the previous behavior where the old acpi_identify() would
fail to add an acpi0 device again leaving you with no devices.

Discussed with: imp
Silence on: arch@


175859 31-Jan-2008 jhb

For no good reason I had assumed that ACPI table headers would be page
aligned (or at least not cross a page boundary). However, it turns out
that on at least one machine one table header does cross a page boundary.
This caused problems with the MADT early probe as it uses the crash dump
map to load ACPI tables by loading the RSDT/XSDT into pages 1 ... N and
loading the header of each ACPI table header into page 0 looking for the
MADT. However, if a table header crossed a page boundary, then page 1
would get trashed resulting in a panic. Fix this by reserving the first
2 pages for ACPI table headers (headers are less than a page in size,
so 2 pages will be sufficient) and use pages 2 .. N for the RSDT and XSDT.

Note: amd64 should probably be simplified to just use pmap_mapbios()
for all these tables which will use the direct map and not need the
crash dump hack.

MFC after: 5 days
Tested on: i386
Reported by: Pete French petefrench of ticketswitch.com


172144 11-Sep-2007 attilio

This is a follow-up, cleaning-up commit about recent changes involving
topology foo functions.
Working at the patch for topology problems in ia32/amd64 evicted some
problems regarding functions ordering in the SI_SUB_CPU family of
SYSINIT'ed subsystems.
In order to avoid problems with new modified to involved functions, a
correct ordering is not semantically specified for SI_SUB_CPU functions
(for a larger view of the issue please visit:
http://lists.freebsd.org/pipermail/freebsd-current/2007-July/075409.html )

Discussed with: peter
Tested by: kris, Rui Paulo <rpaulo@FreeBSD.org>
Approved by: jeff
Approved by: re


171297 07-Jul-2007 njl

Now that we have a function that can be called from a cdevsw close()
entry point, use it.

Approved by: re


170976 21-Jun-2007 njl

Update the suspend/resume user API while maintaining backwards compat.

Improvements:
* /etc/rc.suspend,rc.resume are always run, no matter the source of the
suspend request (user or kernel, apm or acpi)
* suspend now requires positive user acknowledgement. If a user program
wants to cancel the suspend, they can. If one of the user programs
hangs or doesn't respond within 10 seconds, the system suspends anyway.
* /dev/apm is clonable, allowing multiple listeners for suspend events.
In the future, xorg-server can use this to be informed about suspend
even if there are other listeners (i.e. apmd).

Changes:
* Two new ACPI ioctls: REQSLPSTATE and ACKSLPSTATE. Request begins the
process of suspending by notifying all listeners. acpi is monitored by
devd(8) and /dev/apm listener(s) are also counted. Users register their
approval or disapproval via Ack. If anyone disapproves, suspend is vetoed.
* Old user programs or kernel modules that used SETSLPSTATE continue to
work. A message is printed once that this interface is deprecated.
* acpiconf gains the -k flag to ack the suspend request. This flag is
undocumented on purpose since it's only used by /etc/rc.suspend. It is
not intended to be a permanent change and will be removed once a better
power API is implemented.
* S5 (power off) is no longer supported via acpiconf -s 5 or apm -z/-Z.
This restores previous behavior of halt/shutdown -p being the interface.
* Miscellaneous improvements to error reporting

Approved by: re


169395 08-May-2007 jhb

Handle CPUs with APIC IDs higher than 32 (at least one IBM server uses
an APIC ID of 38 for its second CPU):
- Add a new MAX_APIC_ID constant for the highest valid APIC ID for modern
systems.
- Size the various arrays in the MADT, MP Table, and SMP code that are
indexed by APIC IDs to allow for up to MAX_APIC_ID.
- Explicitly go through and assign logical cpu ids to local APICs before
starting any of the APs up rather than doing it while starting up the
APs. This step is now where we honor MAXCPU.

MFC after: 1 week


168191 31-Mar-2007 jhb

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

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

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

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

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

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

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


167814 22-Mar-2007 jkim

Catch up with ACPI-CA 20070320 import.


167578 14-Mar-2007 njl

Create an identity mapping (V=P) super page for the low memory region on
boot. Then, just switch to the kernel pmap when suspending instead of
allocating/freeing our own mapping every time. This should solve a panic
of pmap_remove() being called with interrupts disabled. Thanks to Alan
Cox for developing this patch.

Note: this means that ACPI requires super page (PG_PS) support in the CPU.
This has been present since the Pentium and first documented in the
Pentium Pro. However, it may need to be revisited later.

Submitted by: alc
MFC after: 1 month


167247 05-Mar-2007 jhb

Use vm_paddr_t rather than uintptr_t when passing the physical address of
APICs to lapic_init() and ioapic_create().


163498 19-Oct-2006 ru

Add missing acpi_wakecode.o: assym.s dependency, so that if assym.s
is newer than acpi_wakecode.h, the latter is rebuilt.

Reported by: bde


162065 06-Sep-2006 ru

Refine previous revision to allow acpi_wakecode.h to be safely built
from both the acpi module build directory and a kernel build directory.
The latter didn't work when one attempted to build a kernel which had
"device acpi" with the "make kernel-toolchain buildkernel" command
because a cross-compiler couldn't find anything in the standard system
include path (it's empty in the kernel-toolchain case).

Fix this by passing a better root path to kernel headers (src/sys)
which works for both cases, kernel and module (-I@ only worked for
module).

Also, while here, pass -nostdinc (and a different spelling for icc) --
it's a feature that the kernel source tree is self-contained, and this
change enforces this.

Reported by: glebius


161223 11-Aug-2006 jhb

First pass at allowing memory to be mapped using cache modes other than
WB (write-back) on x86 via control bits in PTEs and PDEs (including making
use of the PAT MSR). Changes include:
- A new pmap_mapdev_attr() function for amd64 and i386 which takes an
additional parameter (relative to pmap_mapdev()) specifying the cache
mode for this mapping. Note that on amd64 only WB mappings are done with
the direct map, all other modes result in a private mapping.
- pmap_mapdev() on i386 and amd64 now defaults to using UC (uncached)
mappings rather than WB. Previously we relied on the BIOS setting up
MTRR's to enforce memio regions being treated as UC. This might make
hw.cbb_start_memory unnecessary in some cases now for example.
- A new pmap_mapbios()/pmap_unmapbios() API has been added to allow places
that used pmap_mapdev() to map non-device memory (such as ACPI tables)
to do so using WB as before.
- A new pmap_change_attr() function for amd64 and i386 that changes the
caching mode for a range of KVA.

Reviewed by: alc


161064 08-Aug-2006 njl

If a beep was enabled, turn it off 3 seconds after resume.

MFC after: 3 days


159665 16-Jun-2006 mjacob

Unbreak tinderbox- fix device_printf arg to accomodate different sizes
of vm_paddr_t in different contexts (e.g., PAE vs. non PAE).


159479 10-Jun-2006 njl

* Ask for a page-aligned page instead of an arbitrary address. This should
not be necessary but might be helpful and at least reduce fragmentation.
* Add an assert to detect if the wakecode ever grows too big. We include
1 KB for stack, which should be more than enough also.
* Remove unnecessary initialization of static variables.
* Add comments and a bootverbose print giving the page phys address.


159478 10-Jun-2006 njl

Minor tweaks to the resume code. Previous commit reverted alignment back
to 4. There is no need to be more strict at assembly time since we copy
the code anyway to a private page.

* Clear the direction flag and eflags. Probably not necessary but it won't
hurt to be safe.
* Add prefixes to all instructions to prevent any assembler mistakes.
* Remove zeroing of eax - edi. We use those registers immediately after
to transfer values to protected mode so this was pointless.
* Update comments to reflect info found during code review.


159477 10-Jun-2006 njl

Move the reset beep tunable/sysctl to debug.acpi.resume_beep. This makes
more sense than under hw.acpi. Also, document this in the man page.


159409 08-Jun-2006 njl

Minor tweaks to the resume code that might help people debug.

* Add hw.acpi.resume_beep tunable and sysctl, default to 0. Beeps the PC
speaker soon after waking to diagnose whether the wakeup code is even
getting run before other drivers possibly hang the system. To stop the beep,
cause another beep (i.e. keyboard bell). Submitted by takawata@, I changed
the frequency to be lower.

* Use 4096 instead of 4 byte alignment. Might be useful although doesn't
seem to be necessary.

* Remove a useless assignment to acpi_reset_video. It was overwritten by
the default sysctl value anyway.


157179 27-Mar-2006 jhb

If the XSDT address in the RSDP for an ACPI 2.0 machine is NULL, then fall
back to using the RSDT instead. ACPI-CA already follows this same strategy
as a workaround for yet another instance of brain-damaged BIOS writers.

PR: i386/93963
Submitted by: Masayuki FUKUI <fukui.FreeBSD@fanet.net>


151948 01-Nov-2005 jkim

Catch up with ACPI-CA 20051021 import


151897 31-Oct-2005 rwatson

Normalize a significant number of kernel malloc type names:

- Prefer '_' to ' ', as it results in more easily parsed results in
memory monitoring tools such as vmstat.

- Remove punctuation that is incompatible with using memory type names
as file names, such as '/' characters.

- Disambiguate some collisions by adding subsystem prefixes to some
memory types.

- Generally prefer lower case to upper case.

- If the same type is defined in multiple architecture directories,
attempt to use the same name in additional cases.

Not all instances were caught in this change, so more work is required to
finish this conversion. Similar changes are required for UMA zone names.


150003 11-Sep-2005 obrien

Canonize the include of acpi.h.


149210 18-Aug-2005 rodrigc

Rename variables:
r_gdt -> saved_gdt
r_idt -> saved_idt
r_ldt -> saved_ldt

in order to prevent clashes with variables with same names
defined in <machine/segments.h>. This fixes compilation of this
file with GCC 4.0.

Reviewed by: njl


148352 23-Jul-2005 njl

Rewrite the acpi_battery interface to allow for other battery types
(i.e., smart battery) and fix various bugs found during the cleanup.

API changes:
* kernel access:
Access to individual batteries is now via devclass_find("battery").
Introduce new methods ACPI_BATT_GET_STATUS (for _BST-formatted data) and
ACPI_BATT_GET_INFO (for _BIF-formatted data). The helper function
acpi_battery_get_battinfo() now takes a device_t instead of a unit #
argument. If dev is NULL, this signifies all batteries.

* ioctl access:
The ACPIIO_BATT_GET_TYPE and ACPIIO_BATT_GET_BATTDESC ioctls have been
removed. Since there is now no need for a mapping between "virtual" unit
and physical unit, usermode programs can just specify the unit directly and
skip the old translation steps. In fact, acpiconf(8) was actually already
doing this and virtual unit was the same as physical unit in all cases
since there was previously only one battery type (acpi_cmbat). Additionally,
we now map the ACPIIO_BATT_GET_BIF and ACPIIO_BATT_GET_BST ioctls for all
batteries, if they provide the associated methods.

* apm compatibility device/ioctls: no change
* sysctl: no change

Since most third-party applications use the apm(4) compat interface, there
should be very few affected applications (if any).

Reviewed by: bruno
MFC after: 5 days


145397 22-Apr-2005 iedowse

Pick up the selectors to use for various kernel segments from assym.s
instead of assuming fixed offsets within the GDT. The hard-coded
values here have been incorrect since Peter's GDT rearranging around
10 days ago, causing ACPI resume problems.

Reviewed by: peter


145080 14-Apr-2005 jhb

Remove support for mixed mode altogether now that we no longer use IRQ 0
when using an APIC. This simplifies the APIC code somewhat and also allows
us to be pedantically more compliant with ACPI which mandates no use of
mixed mode.


143063 02-Mar-2005 joerg

netchild's mega-patch to isolate compiler dependencies into a central
place.

This moves the dependency on GCC's and other compiler's features into
the central sys/cdefs.h file, while the individual source files can
then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to
refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42.

By now, GCC and ICC (the Intel compiler) have been actively tested on
IA32 platforms by netchild. Extension to other compilers is supposed
to be possible, of course.

Submitted by: netchild
Reviewed by: various developers on arch@, some time ago


142257 22-Feb-2005 jhb

- Add a new quirk to indicate that pin 0 of the first I/O APIC is really
IRQ 0 and not an ExtINT pin. The MADT enumerators ignore the PC-AT flag
and ignore overrides that map IRQ 0 to pin 2 when this quirk is present.
- Add a block comment above the quirks to document each quirk so that we
can use more verbose descriptions quirks.

MFC after: 2 weeks


138725 12-Dec-2004 njl

Only export defined symbols. Note that I couldn't find any difference
between object code generated without the flag but it makes sense and might
make a difference in the future.

PR: kern/53008
Submitted by: Jens Rehsack rehsack at liwing de


137715 15-Nov-2004 imp

After discussions with Nate, repo copy the acpi assist drivers from
i386 to dev/acpi_support. In theory, these devices could be found
other than in i386 machines only as amd64 becomes more popular. These
drivers don't appear to do anything i386 specific, so move them to
dev/acpi_support. Move config lines to files so that those
architectures that don't support kernel modules can build them into
the kernel. At the same time, rename acpi_snc to acpi_sony to follow
the lead of all the other specialty devices.


137632 12-Nov-2004 philip

o Change the strcmp() to a strncmp() to allow us to attach to 'E'
models of laptops, which are essentially the same as the normal
ones, as far as acpi_asus is concerned[1]

o Use the above as an excuse to reshuffle the mess I made of the
probe function when I originally wrote it.

Reported by: Soeren Larsen <soeren@whiteswan.dk>


137631 12-Nov-2004 philip

Minor whitespace nitpicking to reduce my diffs of Real Changes[tm]


137388 08-Nov-2004 philip

Add support for gadgets on Asus L4R and M6R notebooks.


137365 07-Nov-2004 njl

Add power profile support so that the LCD changes brightness levels based
on the AC line state.

Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org>
MFC after: 1 week


137245 05-Nov-2004 philip

Fix support for the Asus-compatible gadgets in Samsung P30/P35 laptops.

PR: 73380
Submitted by: Sebastian Schulze Struchtrup <seb@struchtrup.com>


137127 02-Nov-2004 philip

Add support for Asus M6N laptops

Submitted by: Andreas Dieling <snow@quantentunnel.de>


136785 22-Oct-2004 njl

Remove a "needs Giant" flag from the /dev/apm compat device.

MFC after: 2 weeks


136367 11-Oct-2004 njl

Match surrounding style, not style(msmith).


136366 11-Oct-2004 njl

Move the code for halting the CPU (acpi_cpu_c1) into machdep files.
This removes the last MD portion of acpi_cpu.c.

MFC after: 2 weeks


134258 24-Aug-2004 njl

Be sure to always unlock the sx lock when exiting the sysctl function.

MFC after: 3 days


134027 19-Aug-2004 njl

Disable interrupts after using pmap_enter() to add the identity mapping.
Since pmap_enter() calls pmap_invalidate_page(), which needs interrupts
enabled in the SMP case, we defer the disable to right before saving the
register context. This has been incorrect for about a year but caused no
real problems because the identity page never actually replaces a previously
mapped page and suspend/resume on SMP systems has been uncommon.

Tested by: sos
MFC after: 3 days


133630 13-Aug-2004 njl

MPSAFE locking

* Serialize access to the sysctl routines and the notify handler
* Assert that the sx lock is held in any functions they call.
* Note that recursively calling to re-enable the hotkeys is sub-optimal.


133629 13-Aug-2004 njl

MPSAFE locking

* Serialize access to the sysctl routines and the notify handler
* Assert that the sx lock is held in any functions they call.


133628 13-Aug-2004 njl

MPSAFE locking

* Serialize access to the sysctl routines and the notify handler.


133155 05-Aug-2004 njl

Remove the attempt to cache the previous page mapped at our identity
location (for the wake code). It should not be needed since we don't
map other pages at the same location and if there was an old mapping, it
would be restored by a fault. The old code had serious problems, namely
that it was restoring the new page it had just removed (not opage) and
it could only guess at the right protection (since there's no
pmap_extract_protect function). Thanks to Alan Cox for explaining much
of this to me.

Also, remove a commented-out initializecpu() call since it is not needed.
Restoring the cpu context is better than attempting to init from scratch.

Reviewed by: alc (earlier version)


133118 04-Aug-2004 philip

Unbreak LINT by making sure that method is always defined.

Submitted by: roam
Pointy hat to: philip


133095 03-Aug-2004 philip

Further cleanup: merge the three led toggling functions
into a single general function to handle all leds.

Approved by: njl


133092 03-Aug-2004 njl

Use the acpi_{Get,Set}Integer functions instead of rolling custom ones.
Clean up return path of each function to have a single exit point. This
reduces diffs against the MPSAFE tree.


132774 28-Jul-2004 kan

Avoid casts as lvalues. While here, avoid storing 32bit quantities in
16bit locations.


132680 27-Jul-2004 tjr

Use file2c instead of a combination of hexdump, sed and shell script to
generate the wakecode[] array from acpi_wakecode.bin. The old method was
not safe in multibyte locales.


132619 24-Jul-2004 njl

Get the acpi softc via the devclass, not by caching the device. Replace
apm_softc with a single integer since the whole softc is not used.


132611 24-Jul-2004 njl

Whitespace cleanup and move static variables together.


132610 24-Jul-2004 njl

Remove unneeded parens and fix whitespace.


132501 21-Jul-2004 nyan

Add the ACPI Panasonic extras driver.

Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org> and nyan


132220 15-Jul-2004 alc

Push down the acquisition and release of the page queues lock into
pmap_protect() and pmap_remove(). In general, they require the lock in
order to modify a page's pv list or flags. In some cases, however,
pmap_protect() can avoid acquiring the lock.


131677 06-Jul-2004 njl

Use the proper type and then cast on assignment. This fixes warning when
building with -O2.


131312 30-Jun-2004 njl

Add machdep quirks functions. On i386, this disables acpi on systems with
BIOS dates earlier than Jan 1, 1999. Add prototypes and quirks flags.


131284 29-Jun-2004 njl

Update for acpi_id_probe()


131218 28-Jun-2004 imp

Use APM_UNKNOWN instead of 0xff. Use ~0U instead 0 for the number of
batteries. This should be -1 to match other code, but since the api
is unsigned ~0U is the same thing.


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


130534 15-Jun-2004 njl

s/device_get_handle/acpi_get_handle

Submitted by: Hiroyuki Aizu


130511 15-Jun-2004 njl

Catch one more use of acpi_MatchHid and update for new API.


130447 14-Jun-2004 njl

Use the new API for acpi_MatchHid(). The difference between ACPI_HANDLE
and device_t isn't caught by the compiler.


130313 10-Jun-2004 jhb

- Use the correct devclass name ("acpi" vs "ACPI") to detect if acpi0 is
present and thus that the PnPBIOS probe should be skipped instead of
having ACPI zero out the PnPBIOStable pointer.
- Make the PnPBIOStable pointer static to i386/i386/bios.c now that that is
the only place it is used.


130310 10-Jun-2004 jhb

Completely ignore disabled CPU entries as their APIC IDs tend to be
invalid.


129960 01-Jun-2004 jhb

Use the local APIC ID rather than the ACPI Processor ID to index the array
of CPUs since local APIC IDs are bounded but ACPI IDs are not bounded.


129882 30-May-2004 phk

Add missing #include <sys/module.h>


129128 11-May-2004 jhb

Fixup a few bogons in a comment.


129097 10-May-2004 jhb

Rework the APIC mixed mode support a bit:
- Require the APIC enumerators to explicitly enable mixed mode by calling
ioapic_enable_mixed_mode(). Calling this function tells the apic driver
that the PC-AT 8259A PICs are present and routable through the first I/O
APIC via an ExtINT pin. The mptable enumerator always calls this
function for now. The MADT enumerator only enables mixed mode if the
PC-AT compatability flag is set in the MADT header.
- Allow mixed mode to be enabled or disabled via a 'hw.apic.mixed_mode'
tunable. By default this tunable is set to 1 (true). The kernel option
NO_MIXED_MODE changes the default to 0 to preserve existing behavior, but
adding 'hw.apic.mixed_mode=0' to loader.conf achieves the same effect.
- Only use mixed mode to route IRQ 0 if it is both enabled by the APIC
enumerator and activated by the loader tunable. Note that both
conditions must be true, so if the APIC enumerator does not enable mixed
mode, then you can't set the tunable to try to override the enumerator.


129094 10-May-2004 jhb

- Change madt_map_table() to verify the checksum of any table it is asked
to map. If the checksum fails, the table is unmapped and a NULL pointer
returned.
- For ACPI version >= 2.0, check the extended checksum of the RSDP.
AcpiOsGetRootPointer() already checks the version 1.0 checksum.
- Remap the full MADT table at the end of madt_probe() so that we verify
its checksum before saying it is really there.

Requested by: njl


128990 06-May-2004 njl

Make unnecessary globals static and remove unused includes.

Pointed out by: cscout


128975 05-May-2004 njl

Style cleanups, u_intXX -> uintXX.


128932 04-May-2004 jhb

Have ACPI use BUS_CONFIG_INTR() to force the SCI to level trigger and
active low polarity when using the PIC interrupt model. This should fix
broken SCI interrupts on machines when not using the APIC where the BIOS
doesn't program the ELCR to level trigger for the ACPI SCI.

Requested by: njl


128930 04-May-2004 jhb

- Change the APIC code to mostly use the recently added intr_trigger
and intr_polarity enums for passing around interrupt trigger modes and
polarity rather than using the magic numbers 0 for level/low and 1 for
edge/high.
- Convert the mptable parsing code to use the new ELCR wrapper code rather
than reading the ELCR directly. Also, use the ELCR settings to control
both the trigger and polarity of EISA IRQs instead of just the trigger
mode.
- Rework the MADT's handling of the ACPI SCI again:
- If no override entry for the SCI exists at all, use level/low trigger
instead of the default edge/high used for ISA IRQs.
- For the ACPI SCI, use level/low values for conforming trigger and
polarity rather than the edge/high values we use for all other ISA
IRQs.
- Rework the tunables available to override the MADT. The
hw.acpi.force_sci_lo tunable is no longer supported. Instead, there
are now two tunables that can independently override the trigger mode
and/or polarity of the SCI. The hw.acpi.sci.trigger tunable can be
set to either "edge" or "level", and the hw.acpi.sci.polarity tunable
can be set to either "high" or "low". To simulate hw.acpi.force_sci_lo,
set hw.acpi.sci.trigger to "level" and hw.acpi.sci.polarity to "low".
If you are having problems with ACPI either causing an interrupt storm
or not working at all (e.g., the power button doesn't turn invoke a
shutdown -p now), you can try tweaking these two tunables to find the
combination that works.


128587 23-Apr-2004 philip

Enable the led-toggling magic. Compiling files which are in the kernel into
modules is a very nice way to produce hard-to-find panics. Who would look for
a bug in a Makefile anyway?

Has anyone seen the pointy hat? :-o

Approved by: njl (mentor)


128561 22-Apr-2004 philip

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)


128508 21-Apr-2004 njl

Don't check for NULL, device_get_softc() always succeeds.


128329 16-Apr-2004 jhb

Revert part of the "BIOS brain damage" from rev 1.10. It seems that
different BIOSs use the same exact settings to mean two very different and
incompatible things for the SCI. Thus, if the SCI is remapped to a PCI
interrupt, we now trust the trigger/polarity that the MADT provides by
default. However, the SCI can be forced to level/lo as 1.10 did by setting
the tunable "hw.acpi.force_sci_lo" to a non-zero value from the loader.

Thus, if rev 1.10 caused an interrupt storm, it should nwo fix your
machine. If rev 1.10 fixed an interrupt storm on your machine, you
probably need to set the aforementioned tunable in /boot/loader.conf to
prevent the interrupt storm.

The more general problem of getting the SCI's trigger/polarity programmed
"correctly" (for some value of correctly meaning several workarounds for
broken BIOSs and inconsistent "implementations" of the ACPI standard) is
going to require more work, but this band-aid should improve the current
situation somewhat.

Requested by: njl


128223 14-Apr-2004 njl

Use METHOD_VIDEO instead of the method string itself.

Pointed out by: Andrew Thompson


128207 14-Apr-2004 njl

Add support for video output switching. It appears no systems use HCI to
change the video output but use a separate device with a DSSX method
and a HID of "TOS6201" instead. We use a pseudo-driver to get the handle
for this object and pass it to the acpi_toshiba driver.

This is untested but seems to match the Linux Toshiba driver.


128190 13-Apr-2004 des

Use headers from the kernel source tree rather than installed headers.

Submitted by: ru


128036 08-Apr-2004 njl

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.


126891 12-Mar-2004 trhodes

These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc.

Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as
icc v8 may define __GNUC__ some parts may look strange but are
necessary.

Additional changes:
- in_cksum.[ch]:
* use a generic C version instead of the assembly version in the !gcc
case (ASM code breaks with the optimizations icc does)
-> no bad checksums with an icc compiled kernel
Help from: andre, grehan, das
Stolen from: alpha version via ppc version
The entire checksum code should IMHO be replaced with the DragonFly
version (because it isn't guaranteed future revisions of gcc will
include similar optimizations) as in:
---snip---
Revision Changes Path
1.12 +1 -0 src/sys/conf/files.i386
1.4 +142 -558 src/sys/i386/i386/in_cksum.c
1.5 +33 -69 src/sys/i386/include/in_cksum.h
1.5 +2 -0 src/sys/netinet/igmp.c
1.6 +0 -1 src/sys/netinet/in.h
1.6 +2 -0 src/sys/netinet/ip_icmp.c

1.4 +3 -4 src/contrib/ipfilter/ip_compat.h
1.3 +1 -2 src/sbin/natd/icmp.c
1.4 +0 -1 src/sbin/natd/natd.c
1.48 +1 -0 src/sys/conf/files
1.2 +0 -1 src/sys/conf/files.amd64
1.13 +0 -1 src/sys/conf/files.i386
1.5 +0 -1 src/sys/conf/files.pc98
1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c
1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h
1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c
1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c
1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c
1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c
1.6 +1 -2 src/sys/netinet/igmp.c
1.4 +158 -116 src/sys/netinet/in_cksum.c
1.6 +1 -1 src/sys/netinet/ip_gre.c
1.7 +1 -2 src/sys/netinet/ip_icmp.c
1.10 +1 -1 src/sys/netinet/ip_input.c
1.10 +1 -2 src/sys/netinet/ip_output.c
1.13 +1 -2 src/sys/netinet/tcp_input.c
1.9 +1 -2 src/sys/netinet/tcp_output.c
1.10 +1 -1 src/sys/netinet/tcp_subr.c
1.10 +1 -1 src/sys/netinet/tcp_syncache.c
1.9 +1 -2 src/sys/netinet/udp_usrreq.c

1.5 +1 -2 src/sys/netinet6/ipsec.c
1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c
1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c
1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c

and finally remove
sys/i386/i386 in_cksum.c
sys/i386/include in_cksum.h
---snip---
- endian.h:
* DTRT in C++ mode
- quad.h:
* we don't use gcc v1 anymore, remove support for it
Suggested by: bde (long ago)
- assym.h:
* avoid zero-length arrays (remove dependency on a gcc specific
feature)
This change changes the contents of the object file, but as it's
only used to generate some values for a header, and the generator
knows how to handle this, there's no impact in the gcc case.
Explained by: bde
Submitted by: Marius Strobl <marius@alchemy.franken.de>
- aicasm.c:
* minor change to teach it about the way icc spells "-nostdinc"
Not approved by: gibbs (no reply to my mail)
- bump __FreeBSD_version (lang/icc needs to know about the changes)

Incarnations of this patch survive gcc compiles since a loooong time,
I use it on my desktop. An icc compiled kernel works since Nov. 2003
(exceptions: snd_* if used as modules), it survives a build of the
entire ports collection with icc.

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by: -arch
Submitted by: netchild


126517 03-Mar-2004 njl

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.


126080 21-Feb-2004 phk

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.


126076 21-Feb-2004 phk

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.


125048 26-Jan-2004 jhb

- Call acpi_Startup() before parsing interrupt-related APIC resources so we
can look at the ACPI tables. If the startup fails, we panic and tell the
user to try rebooting with ACPI disabled. Previously in this case we
would try to use $PIR interrupt routing which only works for the atpic
while using the apic to handle interrupts which would result in misrouted
interrupts and a hang at boot time with no error message.
- Read the SCI out of the FADT instead of hardcoding 9 when checking to see
if an interrupt override entry is for the SCI.
- Try to work around some BIOS brain damage for the SCI's programming by
forcing the SCI to be level triggered and active low if it is routed
to a non-ISA interrupt (greater than 15) or if it is identity mapped with
edge trigger and active high polarity. This should fix some of the hangs
with device apic and ACPI that some people see.

Reviewed by: njl


124442 12-Jan-2004 njl

Only remove the handler if we installed it.


124415 12-Jan-2004 njl

Clean up the probe message and sort the function table according to
the function order in the file.


124386 11-Jan-2004 njl

Add the ACPI Toshiba extras driver (hotkeys, LCD backlight, video output,
forced fan control, and CPU throttling).

PR:
Submitted by: Hiroyuki Aizu <aizu@navi.org>
Reviewed by:
Approved by:
Obtained from:
MFC after:


124051 01-Jan-2004 njl

Use <machine/asmacros.h> since <machine/asm.h> is a userland-only header
and gives very wrong macros for ENTRY(), etc. for kernel programs.

PR:
Suggested by: bde
Reviewed by:
Approved by:
Obtained from:
MFC after:


123326 09-Dec-2003 njl

Use the ACPI-CA definitions for the various APIC tables instead of our
own.


123133 03-Dec-2003 jhb

- Reorder the APIC enumerator SYSINIT's to register enumeators at
SI_SUB_CPU - 1 and probe enumerators, probe CPUs, and setup the local
APIC programming all at SI_SUB_CPU / SI_ORDER_FIRST. This is needed to
help get the ACPI module working again as it moves the APIC enumeration
code after SI_SUB_KLD.
- In the MADT parser, use mp_maxid rather than MAXCPU to terminate a loop
when assigning per-cpu ACPI IDs to avoid a dependency on 'options SMP'.
- Allow the apic device to be disabled via 'hint.apic.0.disabled' from the
loader. Note that since this is done in the local APIC code, it works
for both the ACPI and non-ACPI cases.

Approved by: re (scott / blanket)


122712 14-Nov-2003 peter

Minor source sync with amd64. For %.*s printf formats, pass in an
int rather than a size_t. cast the ioapicaddress variable via
uintptr_t before going to void *.


122502 11-Nov-2003 jhb

Some motherboards like to remap the SCI (normally IRQ 9) up to a PCI
interrupt such as IRQ 22 or 19. However, the ACPI BIOS still routes
interrupts from some PCI devices to the same intpin calling the pin
IRQ 22. Thus, ACPI expects to address a single interrupt source via two
different names. To work around this, if the SCI is remapped to a non-ISA
interrupt (i.e., greater than 15), then we use
acpi_OverrideInterruptLevel() function to tell ACPI to use IRQ 22 or 19
rather than IRQ 9 for the SCI.

Previously we would change IRQ 22 or 19's name to IRQ 9 when we encountered
such an Interrupt Source Override entry in the MADT which routed the SCI
properly but left PCI devices mapped to IRQ 22 or 19 w/o a routable
interrupt.

Tested by: sos


122434 10-Nov-2003 jhb

Bump APIC ID limits up to 32 since a machine with 16 CPUs will have APIC
IDs for the I/O APICs that are greater than 16.

Reported by: John Cagle <john.cagle@hp.com>


122172 06-Nov-2003 jhb

Only disable the old pin when doing a remap if it's current vector is still
the old vector.

Reported by: sam


122149 05-Nov-2003 jhb

When remapping an ISA interrupt from one intpin to another, disable the
pin that is used by the default identity mapping if it still maps to the
old vector. The ACPI case might need some tweaking for the SCI interrupt
case since ACPI likes to address the intpin using both the IRQ remapped to
it as well as the previous existing PCI IRQ mapped to it.

Reported by: kan


122016 04-Nov-2003 peter

Make this compile with PAE.


121993 03-Nov-2003 jhb

- Update includes.
- Use intr_suspend/resume() callouts to the interrupt code layer which
suspends and resumes all the known interrupt sources instead of calling
icu_reinit() directly.


121992 03-Nov-2003 jhb

Add the ACPI MADT table APIC enumerator. This code uses the ACPI Multiple
APIC Descriptor Table to enumerate both I/O APICs and local APICs. ACPI
does not embed PCI interrupt routing information in the MADT like the MP
Table does. Instead, ACPI stores the PCI interrupt routing information
in the _PRT object under each PCI bus device. The MADT table simply
provides hints about which interrupt vectors map to which I/O APICs. Thus
when using ACPI, the existing ACPI PCI bridge drivers are sufficient to
route PCI interrupts.


121835 01-Nov-2003 njl

Fix the logic to match the new name of the tunable.

Pointed out by: iwasaki


121830 01-Nov-2003 njl

Change the reset video option to be positive (hw.acpi.reset_video).
Requested by: jhb

Initialize the real mode stack. This is needed at least for the return
address from the lcall.
Requested by: takawata

Fix style bugs in acpi_wakecode.S
Requested by: bde

Remove the kernel option now that we have the tunable.


121743 30-Oct-2003 iwasaki

Add sysctl MIB and loader tunable `hw.acpi.no_reset_video' as
the same effect as ACPI_NO_RESET_VIDEO kernel option.


121641 29-Oct-2003 iwasaki

Add kernel option ACPI_NO_RESET_VIDEO as workaround for problems
(e.g. LCD white-out after resume) on some machine cased by
re-initialize video BIOS code in acpi_wakecode.


121603 27-Oct-2003 njl

Call the VESA reset BIOS vector on the resume path. This may help displays
after resume. I have not found it to break anything.


120424 25-Sep-2003 alc

- Eliminate the pte object.
- Use kmem_alloc_nofault() rather than kmem_alloc_pageable() to allocate
KVA space for the page directory page(s). Submitted by: tegge


120156 17-Sep-2003 iwasaki

Add final adjustment code of battery status based on the battery capacity
rather than returning unknown status.


119944 10-Sep-2003 jhb

Finish an earlier commit:

Add a acpi_SetDefaultIntrModel() method to allow drivers to set the
interrupt model prior to the acpi0 device being probed and attached.


119873 08-Sep-2003 njl

Don't disable interrupts a second time. Remove an extraneous interrupt
enable (that happens elsewhere). Clarify the interrupt disabling point
by using ACPI_DISABLE_IRQS().

Tested by: Kevin Oberman


119549 29-Aug-2003 njl

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.


119530 28-Aug-2003 njl

Style cleanups.


118218 30-Jul-2003 njl

Use ACPI_FLUSH_CPU_CACHE() instead of wbinvd(). Verified .o with md5.

Pointed out by: Mark Santcroos <marks@ripe.net>


117844 21-Jul-2003 peter

Commit Ian Dowse's workaround for acpi resume resetting after the
LAZY_SWITCH changes. He pointed out the acpi code sets up an identity
mapping in the current vmspace and that got messed up by the %cr3 being
out of sync with the current page directory. As a workaround, restore
%cr3 across the sleep/resume. A more complete fix would be to undo the
lazy state and clear the pm_active bit from the borrowed pmap, but this
works and people are currently hurting. I'll clean this up.
This is mostly Ian's patch, plus a PAE tweak from me.


117126 01-Jul-2003 scottl

Mega busdma API commit.

Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma. At the moment, this is used for the
asynchronous busdma_swi and callback mechanism. Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg. dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create(). The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms. The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by: tmm, gibbs


115681 02-Jun-2003 obrien

Use __FBSDID().


114977 13-May-2003 jhb

Add some extra #ifdef stubs so that this compiles on 4.8.

Approved by: re (rwatson/bmah)


112569 25-Mar-2003 jake

- Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
with PAE.
- Use this to represent physical addresses in the MI vm system and in the
i386 pmap code. This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by: DARPA, Network Associates Laboratories
Discussed with: re, phk (cdevsw change)


112551 24-Mar-2003 mdodd

Use repo-copied files in sys/i386/bios.


111815 03-Mar-2003 phk

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)


108026 18-Dec-2002 marcel

Export the physical address of the RSDP to userland by means
of the `machdep.acpi_root' sysctl. This is required on ia64
because the root pointer hardly ever, if at all, lives in the
first MB of memory and also because scanning the first MB of
memory can cause machine checks.
This provides a save and reliable way for ACPI tools to work
with the tables if ACPI support is present in the kernel. On
ia64 ACPI is non-optional.


107618 04-Dec-2002 alc

Hold the page queues lock around calls to pmap_remove().

Approved by: re


107199 24-Nov-2002 iwasaki

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


107144 21-Nov-2002 jhb

*sigh*. It seems that in the ACPICA code, Intel defines its own APIC_IO
macro for use when parsing MADT tables, thus we always tried to set the
interrupt model to APIC. This proved to be harmful on UP machines with
IO APIC's (or for UP kernels on SMP machines) since the wrong interrupt
routing information would be returned.

Pointy hat to: jhb
Approved by: re (rwatson)


105277 16-Oct-2002 jhb

- curproc may be NULL in 4-stable. In that case use the vmspace from
proc0.
- Remove unused include.

Sponsored by: The Weather Channel


105276 16-Oct-2002 jhb

Include <sys/select.h> on -stable instead of <sys/selinfo.h> to get the
definition of struct selinfo.

Sponsored by: The Weather Channel


104727 09-Oct-2002 jhb

Use d_thread_t for cdevsw functions instead of struct thread * so that it
is easier to share this code with 4-stable.


104223 30-Sep-2002 jhb

Trash the PnPBIOStable pointer later on when we know that the acpi probe
and attach routines have succeeded so that if they fail we can still use
the PnP BIOS to find ISA on-board devices. The fact that we do this here
is gross but fixing it properly involves a lot more work.


103748 21-Sep-2002 markm

Wrap GCC-specific asm() code in #ifdef __GNUC__


103023 06-Sep-2002 jhb

If we are using APIC_IO tell ACPI so it can route interrupts properly.
This still doesn't work quite right because of other APIC_IO hacks in
the i386 PCI code.


102291 22-Aug-2002 archie

Replace (ab)uses of "NULL" where "0" is really meant.


101459 07-Aug-2002 iwasaki

Improve stack manipulation code of ACPI wakeup routine.
The new code just override stack top value with saved return address
rather than pop/push operation.

Submitted by: jhb


101140 01-Aug-2002 iwasaki

Fix a bug about stack manipulation at ACPI wakeup.
This should avoid kernel panic on kernel compiled w/o
NO_CPU_COPTFLAGS.

Suggested by: optimized code by -mcpu=pentiumpro


99149 30-Jun-2002 iwasaki

Resolve conflicts arising from the ACPI CA 20020404 import.


96929 19-May-2002 peter

Make this compile with gcc-3.1, which objects to the multi-line string.


95960 02-May-2002 peter

Makefile uses genwakecode.sh now.


95890 01-May-2002 peter

Try using genwakecode.sh instead of the perl version.


95889 01-May-2002 peter

Add a shell script to do what genwakecode.pl does.

Obtained from: ade


89179 10-Jan-2002 wes

Fix typo in function name.

Reviewed by: peter@
Obtained from: mux@sneakerz.org


89156 09-Jan-2002 takawata

Fix S3 breakage.
Now AcpiEnterSleep() is light enough, so flushing cache
before the function is not too early.


89054 08-Jan-2002 msmith

Staticise devclasses and some unnecessarily global variables.


86554 18-Nov-2001 iwasaki

Yet another verbose printing cleanup. Remove debug_wakeup flag and
check common verbose flag instead.


86262 11-Nov-2001 iwasaki

Add two minor changes.
- clean up wakeup routing fixup code by using macros.
- allocate pte object temporary for kernel thread to avoid kernel
panic by events from sleep button or lid switch.


86133 06-Nov-2001 iwasaki

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.


85556 26-Oct-2001 iwasaki

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


83181 07-Sep-2001 msmith

Now that this code is MD, we don't need the i386 ifdefs.


82968 04-Sep-2001 iwasaki

Add `-I.' option to CFLAGS so that we can compile asm code together
with `-nostdinc' option.


80160 22-Jul-2001 iwasaki

Don't do sleep state transition if specified sleep state is not
supported by the system.


80078 21-Jul-2001 msmith

Convert from acpi_strerror() to AcpiFormatException()

Fix dangling include of the dear departed acpi_ecreg.h


80071 21-Jul-2001 msmith

Update the OSD module to match the ACPI CA 20010717 import.

Submitted by: "Grover, Andrew" <andrew.grover@intel.com> (OsdHardware.c)


80028 20-Jul-2001 takawata

Add ACPI S2-S4BIOS Suspend/Resume code.
Some problems may remain.

Reviewed by:iwasaki


67760 28-Oct-2000 msmith

FreeBSD-specific OSD (operating system dependant) modules for the Intel
ACPICA code.