acpi_powerres.c (96926) | acpi_powerres.c (102470) |
---|---|
1/*- 2 * Copyright (c) 2001 Michael Smith 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2001 Michael Smith 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/acpica/acpi_powerres.c 96926 2002-05-19 06:16:47Z peter $ | 26 * $FreeBSD: head/sys/dev/acpica/acpi_powerres.c 102470 2002-08-27 07:53:55Z iwasaki $ |
27 */ 28 29#include "opt_acpi.h" /* XXX trim includes */ 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/proc.h> 33#include <sys/lock.h> 34#include <sys/malloc.h> --- 445 unchanged lines hidden (view full) --- 480 struct acpi_powerreference *pr; 481 struct acpi_powerresource *rp; 482 ACPI_HANDLE res; 483 ACPI_STATUS status; 484 485 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); 486 487 /* check the object type */ | 27 */ 28 29#include "opt_acpi.h" /* XXX trim includes */ 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/proc.h> 33#include <sys/lock.h> 34#include <sys/malloc.h> --- 445 unchanged lines hidden (view full) --- 480 struct acpi_powerreference *pr; 481 struct acpi_powerresource *rp; 482 ACPI_HANDLE res; 483 ACPI_STATUS status; 484 485 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); 486 487 /* check the object type */ |
488 if (obj->Type != ACPI_TYPE_STRING) { | 488 switch (obj->Type) { 489 case ACPI_TYPE_ANY: 490 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "building reference from %s to %s\n", 491 acpi_name(pc->ac_consumer), acpi_name(obj->Reference.Handle))); 492 493 res = obj->Reference.Handle; 494 break; 495 496 case ACPI_TYPE_STRING: 497 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "building reference from %s to %s\n", 498 acpi_name(pc->ac_consumer), obj->String.Pointer)); 499 500 /* get the handle of the resource */ 501 if (ACPI_FAILURE(status = AcpiGetHandle(NULL, obj->String.Pointer, &res))) { 502 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't find power resource %s\n", 503 obj->String.Pointer)); 504 return_VOID; 505 } 506 break; 507 508 default: |
489 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "don't know how to create a power reference to object type %d\n", 490 obj->Type)); 491 return_VOID; 492 } 493 | 509 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "don't know how to create a power reference to object type %d\n", 510 obj->Type)); 511 return_VOID; 512 } 513 |
494 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "building reference from %s to %s\n", 495 acpi_name(pc->ac_consumer), obj->String.Pointer)); 496 497 /* get the handle of the resource */ 498 if (ACPI_FAILURE(status = AcpiGetHandle(NULL, obj->String.Pointer, &res))) { 499 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't find power resource %s\n", 500 obj->String.Pointer)); 501 return_VOID; 502 } 503 | |
504 /* create/look up the resource */ 505 if (ACPI_FAILURE(status = acpi_pwr_register_resource(res))) { 506 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't register power resource %s - %s\n", 507 obj->String.Pointer, AcpiFormatException(status))); 508 return_VOID; 509 } 510 if ((rp = acpi_pwr_find_resource(res)) == NULL) { 511 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "power resource list corrupted\n")); --- 135 unchanged lines hidden --- | 514 /* create/look up the resource */ 515 if (ACPI_FAILURE(status = acpi_pwr_register_resource(res))) { 516 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't register power resource %s - %s\n", 517 obj->String.Pointer, AcpiFormatException(status))); 518 return_VOID; 519 } 520 if ((rp = acpi_pwr_find_resource(res)) == NULL) { 521 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "power resource list corrupted\n")); --- 135 unchanged lines hidden --- |