Date: Mon, 14 Feb 2011 20:05:37 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r218687 - head/sys/dev/acpica Message-ID: <201102142005.p1EK5bYJ005067@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Mon Feb 14 20:05:37 2011 New Revision: 218687 URL: http://svn.freebsd.org/changeset/base/218687 Log: Rework r218685. Copy just enough data for the resource type. Reviewed by: jhb, mdf Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Feb 14 17:24:58 2011 (r218686) +++ head/sys/dev/acpica/acpi_resource.c Mon Feb 14 20:05:37 2011 (r218687) @@ -65,31 +65,30 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *r switch (res->Type) { case ACPI_RESOURCE_TYPE_IRQ: + irqnum = res->Data.Irq.InterruptCount; + irq = res->Data.Irq.Interrupts[0]; + len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ); + break; case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: - if (res->Type == ACPI_RESOURCE_TYPE_IRQ) { - irqnum = res->Data.Irq.InterruptCount; - irq = res->Data.Irq.Interrupts[0]; - } else { - irqnum = res->Data.ExtendedIrq.InterruptCount; - irq = res->Data.ExtendedIrq.Interrupts[0]; - } - if (irqnum != 1) - break; - req = (struct lookup_irq_request *)context; - if (req->counter != req->rid) { - req->counter++; - break; - } - req->found = 1; - KASSERT(irq == rman_get_start(req->res), - ("IRQ resources do not match")); - len = res->Length; - if (len > sizeof(ACPI_RESOURCE)) - len = sizeof(ACPI_RESOURCE); - bcopy(res, req->acpi_res, len); - return (AE_CTRL_TERMINATE); + irqnum = res->Data.ExtendedIrq.InterruptCount; + irq = res->Data.ExtendedIrq.Interrupts[0]; + len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ); + break; + default: + return (AE_OK); + } + if (irqnum != 1) + return (AE_OK); + req = (struct lookup_irq_request *)context; + if (req->counter != req->rid) { + req->counter++; + return (AE_OK); } - return (AE_OK); + req->found = 1; + KASSERT(irq == rman_get_start(req->res), + ("IRQ resources do not match")); + bcopy(res, req->acpi_res, len); + return (AE_CTRL_TERMINATE); } ACPI_STATUS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102142005.p1EK5bYJ005067>