| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
is blessed with IOMMU magic, if available. This is mainly for arm64,
since on amd64 and i386 the IOMMU only captures PCIe devices, as far
as I know, which uses the pci_probe_device_hook(). This though is for
non-PCI devices attached through ACPI.
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
it is used by acpihpet.c
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename klist_{insert,remove}() to klist_{insert,remove}_locked().
These functions assume that the caller has locked the klist. The current
state of locking remains intact because the kernel lock is still used
with all klists.
Add new functions klist_insert() and klist_remove() that lock the klist
internally. This allows some code simplification.
OK mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These references need to be resolved at runtime rather than when
they're parsed such that they pick up the right values for those nodes
which can be changed when for example _INI methods run.
The current approach is to replace these reference with a string that
names the node in question. The problem with that is that packages
can also contain normal strings. Which means that we need special
code that depends on the context where the package is used.
This diff takes a different approach by retaining a reference when
parsing. Code that uses a package will need to resolve this reference
but there is no ambiguiety anymore.
ok patrick@
|
|
|
|
| |
ok patrick@
|
|
|
|
|
|
|
|
|
| |
after Device() ones, since we should prefer the newer node type.
If we see any Device() nodes, don't attach acpicpu(4) to any Processor()
nodes if they're also present. This also makes acpitz(4) and
acpipwrres(4) devices attach slightly later.
ok kettenis@, also tested by jmc@
|
|
|
|
|
|
| |
Remove a dead conditional from acpi_init_gpes while there.
ok jcs@
|
|
|
|
|
|
| |
later processing. The use of a high interrupt will predate suspend/resume
efforts, we had to redesign acpi to be non-reentrant obviously
discussed with kettenis, in snaps for more than a week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_t. However,
time_t is 64-bit everywhere, so it is not generally safe to use them
on 32-bit platforms: you have a split-read problem if your hardware
cannot perform atomic 64-bit reads.
This patch replaces time_second(9) with gettime(9), a safer successor
interface, throughout the kernel. Similarly, time_uptime(9) is replaced
with getuptime(9).
There is a performance cost on 32-bit platforms in exchange for
eliminating the split-read problem: instead of two register reads you
now have a lockless read loop to pull the values from the timehands.
This is really not *too* bad in the grand scheme of things, but
compared to what we were doing before it is several times slower.
There is no performance cost on 64-bit (__LP64__) platforms.
With input from visa@, dlg@, and tedu@.
Several bugs squashed by visa@.
ok kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we refreshed the state of acpiac(4) and acpibat(4)/acpisbs(4)
by queueing fake ACPI events to be processed by the acpi thread.
acpibat(4) using ACPIDEV_POLL meant that its status could be refreshed
first, resulting in an APM_POWER_CHANGE event sent to userland before
the state of acpiac(4) was up to date. Because of this, apmd(8) could
see A/C unplugged when it was in fact plugged, possibly leading to
a wrong decision.
Instead of using fake ACPI events, refresh the status of acpiac(4) and
acpibat(4)/acpisbs(4) right away at DVACT_WAKEUP time. To reuse the
existing refresh code of those drivers, make their ACPI *_notify()
handlers responsible for sending APM_POWER_CHANGE events instead. Also
queue an APM_POWER_CHANGE event right after resume to retain existing
behavior.
This fixes the consistency of data shown to userland, and makes those
drivers less special.
Initially discussed last year (!) with mpi@ at Miod's place.
Feedback and ok jcs@, deraadt@ agrees with the use of DVACT_WAKEUP here.
|
|
|
|
|
|
| |
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.
|
|
|
|
|
|
| |
information on ACPI 5.0 and later.
ok krw@, patrick@
|
|
|
|
|
|
|
|
|
| |
Overall remaining power was computed as the average of the remaining
power of each battery, in percents. This doesn't work with batteries of
different capacity, so use the total capacity and remaining power
instead.
Reported by lidstah, successful tests by lidstah and benno@, ok kettenis@
|
|
|
|
|
|
| |
information in struct acpi_attach_args.
ok mpi@
|
|
|
|
| |
ok patrick@
|
|
|
|
|
|
|
|
|
| |
cache-coherent or not. To implement this, acpi(4) gets two bus_dma tags
and passes the appropriate one when attaching devices based on _CCA.
On i386/amd64, where for all practical purpose DMA is always cache-coherent,
the two tags are the same. But on arm64 they are distinct.
ok patrick@
|
|
|
|
|
|
| |
for example, with locking assertions.
OK mpi@, anton@
|
|
|
|
|
|
|
|
| |
EOPNOTSUPP is returned when there's no "filterops" for a given fd.
EINVAL when the requested filter isn't supported by the "filterops".
ENXIO means the underlying device is no longer valid/present.
ok visa@
|
|
|
|
|
|
| |
adding more filter properties without cluttering the struct.
OK mpi@, anton@
|
|
|
|
|
|
| |
make the structs const so that the data are put in .rodata.
OK mpi@, deraadt@, anton@, bluhm@
|
|
|
|
| |
ok kn@
|
|
|
|
| |
don't depend on indirect inclusion from acpidev.h
|
|
|
|
| |
after 6.6 as been released. The acpireg.h change stays behind.
|
|
|
|
|
|
|
|
|
|
|
| |
few additional quirks though, and attaching the PCI busses is delayed to
replicate the existing code more closely. That may be changed in the
future. Also tweak how we handle MSI support and respect to ACPI flag
that says we shouldn't attempt to use MSIs.
Some fallout is expected.
ok patrick@
|
|
|
|
|
|
|
| |
msr/pat, clock-startup, firmware upgrade, fpu initialization, and cpu
soft-state initialization in the same order. That kind of chaos is
crazy and fragile. Improve the acpi resume call sequence and unify order
of the operations.
|
|
|
|
|
|
|
|
|
|
|
| |
passing GPE_DIRECT which directly executes the supplied callback and
clears a level interrupt rather than going through acpi_taskq which
can be slow when other driver callbacks are in the queue.
This should not be used for GPE handlers that need to do anything
ACPI-related.
ok kettenis
|
|
|
|
| |
ok mlarkin@
|
|
|
|
|
|
| |
skip PCI host bridges and devices that aren't there.
ok patrick@
|
|
|
|
| |
ok patrick@
|
|
|
|
|
|
|
| |
using them. Fixes machines with ancient ACPI 1.0 (such as recent
hypervisors).
ok deraadt@
|
|
|
|
|
|
| |
representation from the FADT. Mostly fixes the Lanner NCA-1510.
ok lteo@, mlarkin@, deraadt@
|
|
|
|
| |
ok kettenis@
|
| |
|
|
|
|
| |
ok deraadt@, jsg@
|
|
|
|
| |
reported by naddy@ ok deraadt@
|
|
|
|
|
|
| |
By default, nothing changes -- shutdown is initiated. But allows turning
power button into a sleep button if desired.
(grudging) ok from a few parties
|
|
|
|
| |
method to let the ACPI implementation know what features we support.
|
|
|
|
|
|
|
| |
devices. Fixes regression caused by matching on _CID in addition to
matching on _HID.
ok matthieu@, mlarkin@
|
|
|
|
| |
ok mpi@
|
|
|
|
|
|
|
| |
for now as amd64/i386 firmware still caters for legacy OSes that only
support a single PCI segment.
ok patrick@
|
|
|
|
|
|
| |
having to add many more _HID entries to the match table.
ok deraadt@, mlarkin@
|
|
|
|
| |
ok patrick@
|
|
|
|
|
|
| |
bridges based on information provided by ACPI.
ok mlarkin@
|
|
|
|
|
|
|
| |
acpimcfg(4) to call an MD initialization functions that sets up a tag for
PCI ECAM.
ok guenther@, mlarkin@, krw@
|
|
|
|
| |
ok guenther@, deraadt@
|
|
|
|
| |
ok mlarkin@
|
|
|
|
|
|
| |
this in the acpi(4) suspend/resume code paths.
ok deraadt@
|
|
|
|
| |
ok mpi@, jung@, krw@, deraadt@
|
|
|
|
|
|
| |
a failure code.
ok kettenis
|