acpi_powerres.c (134908) | acpi_powerres.c (139339) |
---|---|
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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> | 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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_powerres.c 134908 2004-09-07 16:58:12Z njl $"); | 28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_powerres.c 139339 2004-12-27 05:36:47Z njl $"); |
29 30#include "opt_acpi.h" 31#include <sys/param.h> 32#include <sys/kernel.h> 33#include <sys/malloc.h> 34#include <sys/bus.h> 35 36#include "acpi.h" --- 426 unchanged lines hidden (view full) --- 463 * pass now. 464 */ 465 if (ACPI_FAILURE(status = acpi_pwr_switch_power())) { 466 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, 467 "failed to switch resources from %s to D%d\n", 468 acpi_name(consumer), state)); 469 470 /* XXX is this appropriate? Should we return to previous state? */ | 29 30#include "opt_acpi.h" 31#include <sys/param.h> 32#include <sys/kernel.h> 33#include <sys/malloc.h> 34#include <sys/bus.h> 35 36#include "acpi.h" --- 426 unchanged lines hidden (view full) --- 463 * pass now. 464 */ 465 if (ACPI_FAILURE(status = acpi_pwr_switch_power())) { 466 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, 467 "failed to switch resources from %s to D%d\n", 468 acpi_name(consumer), state)); 469 470 /* XXX is this appropriate? Should we return to previous state? */ |
471 goto out; | 471 goto out; |
472 } 473 474 /* Invoke power state switch method (if present) */ 475 if (method_handle != NULL) { 476 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, 477 "invoking state transition method %s\n", 478 acpi_name(method_handle))); 479 status = AcpiEvaluateObject(method_handle, NULL, NULL, NULL); 480 if (ACPI_FAILURE(status)) { 481 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "failed to set state - %s\n", 482 AcpiFormatException(status))); 483 pc->ac_state = ACPI_STATE_UNKNOWN; 484 485 /* XXX Should we return to previous state? */ 486 goto out; 487 } 488 } | 472 } 473 474 /* Invoke power state switch method (if present) */ 475 if (method_handle != NULL) { 476 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, 477 "invoking state transition method %s\n", 478 acpi_name(method_handle))); 479 status = AcpiEvaluateObject(method_handle, NULL, NULL, NULL); 480 if (ACPI_FAILURE(status)) { 481 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "failed to set state - %s\n", 482 AcpiFormatException(status))); 483 pc->ac_state = ACPI_STATE_UNKNOWN; 484 485 /* XXX Should we return to previous state? */ 486 goto out; 487 } 488 } |
489 | 489 |
490 /* Transition was successful */ 491 pc->ac_state = state; 492 status = AE_OK; 493 494out: 495 ACPI_SERIAL_END(powerres); 496 if (reslist_buffer.Pointer != NULL) 497 AcpiOsFree(reslist_buffer.Pointer); --- 260 unchanged lines hidden --- | 490 /* Transition was successful */ 491 pc->ac_state = state; 492 status = AE_OK; 493 494out: 495 ACPI_SERIAL_END(powerres); 496 if (reslist_buffer.Pointer != NULL) 497 AcpiOsFree(reslist_buffer.Pointer); --- 260 unchanged lines hidden --- |