From owner-svn-src-stable@FreeBSD.ORG Fri Sep 25 15:14:33 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBE04106568D; Fri, 25 Sep 2009 15:14:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A12D98FC18; Fri, 25 Sep 2009 15:14:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PFEXcK032227; Fri, 25 Sep 2009 15:14:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PFEXRK032225; Fri, 25 Sep 2009 15:14:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200909251514.n8PFEXRK032225@svn.freebsd.org> From: John Baldwin Date: Fri, 25 Sep 2009 15:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197487 - in stable/7/sys: . contrib/pf dev/acpi_support X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 15:14:33 -0000 Author: jhb Date: Fri Sep 25 15:14:33 2009 New Revision: 197487 URL: http://svn.freebsd.org/changeset/base/197487 Log: MFC 197415: The elements in the component arrays may be direct Package objects rather than references to objects. In that case, simply use the Package directly. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpi_support/acpi_aiboost.c Modified: stable/7/sys/dev/acpi_support/acpi_aiboost.c ============================================================================== --- stable/7/sys/dev/acpi_support/acpi_aiboost.c Fri Sep 25 15:14:11 2009 (r197486) +++ stable/7/sys/dev/acpi_support/acpi_aiboost.c Fri Sep 25 15:14:33 2009 (r197487) @@ -44,7 +44,6 @@ ACPI_MODULE_NAME("AIBOOST") #define DESCSTRLEN 32 struct acpi_aiboost_element{ - ACPI_HANDLE h; uint32_t id; char desc[DESCSTRLEN]; }; @@ -125,22 +124,23 @@ static ACPI_STATUS acpi_aiboost_getcompo for(i = 1 ; i < o->Package.Count; i++){ elem = &o->Package.Elements[i]; - if(elem->Type != ACPI_TYPE_ANY){ - printf("NOREF\n"); - goto error; - } - c->elem[ i - 1].h = elem->Reference.Handle; - - buf2.Pointer = NULL; - buf2.Length = ACPI_ALLOCATE_BUFFER; - - status = AcpiEvaluateObject(c->elem[i - 1].h, NULL, NULL, - &buf2); - if(ACPI_FAILURE(status)){ - printf("FETCH OBJECT\n"); + if (elem->Type == ACPI_TYPE_ANY) { + buf2.Pointer = NULL; + buf2.Length = ACPI_ALLOCATE_BUFFER; + + status = AcpiEvaluateObject(elem->Reference.Handle, + NULL, NULL, &buf2); + if (ACPI_FAILURE(status)){ + printf("FETCH OBJECT\n"); + goto error; + } + subobj = buf2.Pointer; + } else if (elem->Type == ACPI_TYPE_PACKAGE) + subobj = elem; + else { + printf("NO PACKAGE\n"); goto error; } - subobj = buf2.Pointer; if(ACPI_FAILURE(acpi_PkgInt32(subobj,0, &c->elem[i -1].id))){ printf("ID FAILED\n"); goto error; @@ -149,15 +149,17 @@ static ACPI_STATUS acpi_aiboost_getcompo sizeof(c->elem[i - 1].desc)); if(ACPI_FAILURE(status)){ if(status == E2BIG){ - c->elem[i-1].desc[DESCSTRLEN-1] = 0; + c->elem[i - 1].desc[DESCSTRLEN-1] = 0; }else{ printf("DESC FAILED %d\n", i-1); goto error; } } - if(buf2.Pointer) - AcpiOsFree(buf2.Pointer); + if (buf2.Pointer) { + AcpiOsFree(buf2.Pointer); + buf2.Pointer = NULL; + } } if(buf.Pointer)