diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-06-25 18:56:23 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-06-25 18:56:23 +0000 |
commit | 0ad416830e124b328c29547f04ba192771edbcd6 (patch) | |
tree | 5d291d60e49cc630ab5aacdcb2973736c1d61ad2 /sys/dev | |
parent | 2fbda58435b198fcaf2a5db548561886d5b9eff0 (diff) |
So it turns out that there is AML out there that asks for an access
width that isn't compatible with the alignment of the region:
OperationRegion (SATC, SystemMemory, 0xE008800A, 0x04)
Field (SATC, DWordAcc, NoLock, Preserve)
{
STCL, 16
}
DWordAcc means 4-byte access, but 0xE008800A is only 2-byte aligned.
Moreover, the region itself is 4 bytes long. From this I conclude
that 4-byte wide access to a 2-byte aligned address is really wanted
in cases like this.
ok deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/dsdt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 3ef1b0f0d9b..6f187c5b078 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.210 2014/06/23 18:47:41 kettenis Exp $ */ +/* $OpenBSD: dsdt.c,v 1.211 2014/06/25 18:56:22 kettenis Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -2266,10 +2266,7 @@ aml_rwgas(struct aml_value *rgn, int bpos, int blen, struct aml_value *val, break; } - KASSERT(rgn->v_opregion.iobase % sz == 0); - - pi.addr = rgn->v_opregion.iobase + (bpos >> 3); - pi.addr &= ~(sz - 1); + pi.addr = rgn->v_opregion.iobase + ((bpos >> 3) & ~(sz - 1)); bpos &= ((sz << 3) - 1); if (rgn->v_opregion.iospace == GAS_PCI_CFG_SPACE) { |