acpi_powerres.c (131340) | acpi_powerres.c (131366) |
---|---|
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 131340 2004-06-30 16:02:40Z njl $"); | 28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_powerres.c 131366 2004-06-30 20:31:13Z 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" --- 448 unchanged lines hidden (view full) --- 485ACPI_STATUS 486acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable) 487{ 488 ACPI_STATUS status; 489 struct acpi_powerconsumer *pc; 490 struct acpi_prw_data prw; 491 int i; 492 | 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" --- 448 unchanged lines hidden (view full) --- 485ACPI_STATUS 486acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable) 487{ 488 ACPI_STATUS status; 489 struct acpi_powerconsumer *pc; 490 struct acpi_prw_data prw; 491 int i; 492 |
493 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); 494 |
|
493 if (consumer == NULL) 494 return (AE_BAD_PARAMETER); 495 496 if ((pc = acpi_pwr_find_consumer(consumer)) == NULL) { 497 if (ACPI_FAILURE(status = acpi_pwr_register_consumer(consumer))) 498 return_ACPI_STATUS (status); 499 if ((pc = acpi_pwr_find_consumer(consumer)) == NULL) { 500 return_ACPI_STATUS (AE_ERROR); /* something very wrong */ --- 66 unchanged lines hidden (view full) --- 567} 568 569static int 570acpi_pwr_dereference_resource(struct acpi_powerconsumer *pc) 571{ 572 struct acpi_powerreference *pr; 573 int changed; 574 | 495 if (consumer == NULL) 496 return (AE_BAD_PARAMETER); 497 498 if ((pc = acpi_pwr_find_consumer(consumer)) == NULL) { 499 if (ACPI_FAILURE(status = acpi_pwr_register_consumer(consumer))) 500 return_ACPI_STATUS (status); 501 if ((pc = acpi_pwr_find_consumer(consumer)) == NULL) { 502 return_ACPI_STATUS (AE_ERROR); /* something very wrong */ --- 66 unchanged lines hidden (view full) --- 569} 570 571static int 572acpi_pwr_dereference_resource(struct acpi_powerconsumer *pc) 573{ 574 struct acpi_powerreference *pr; 575 int changed; 576 |
577 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); 578 |
|
575 changed = 0; 576 while ((pr = TAILQ_FIRST(&pc->ac_references)) != NULL) { 577 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "removing reference to %s\n", 578 acpi_name(pr->ar_resource->ap_resource))); 579 TAILQ_REMOVE(&pr->ar_resource->ap_references, pr, ar_rlink); 580 TAILQ_REMOVE(&pc->ac_references, pr, ar_clink); 581 free(pr, M_ACPIPWR); 582 changed = 1; --- 143 unchanged lines hidden --- | 579 changed = 0; 580 while ((pr = TAILQ_FIRST(&pc->ac_references)) != NULL) { 581 ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "removing reference to %s\n", 582 acpi_name(pr->ar_resource->ap_resource))); 583 TAILQ_REMOVE(&pr->ar_resource->ap_references, pr, ar_rlink); 584 TAILQ_REMOVE(&pc->ac_references, pr, ar_clink); 585 free(pr, M_ACPIPWR); 586 changed = 1; --- 143 unchanged lines hidden --- |