Date: Thu, 3 Mar 2011 00:43:36 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r219213 - stable/8/sys/dev/acpica Message-ID: <201103030043.p230hakk074948@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Thu Mar 3 00:43:35 2011 New Revision: 219213 URL: http://svn.freebsd.org/changeset/base/219213 Log: MFC: r218685, r218687 Copy just enough data for the resource type. Modified: stable/8/sys/dev/acpica/acpi_resource.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_resource.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_resource.c Thu Mar 3 00:24:55 2011 (r219212) +++ stable/8/sys/dev/acpica/acpi_resource.c Thu Mar 3 00:43:35 2011 (r219213) @@ -60,32 +60,35 @@ static ACPI_STATUS acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context) { struct lookup_irq_request *req; + size_t len; u_int irqnum, irq; 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")); - bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE)); - 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?201103030043.p230hakk074948>