acpi_powerres.c (267647) | acpi_powerres.c (267910) |
---|---|
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 267647 2014-06-19 18:35:14Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_powerres.c 267910 2014-06-26 10:48:01Z hselasky $"); |
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 <contrib/dev/acpica/include/acpi.h> --- 50 unchanged lines hidden (view full) --- 87 TAILQ_ENTRY(acpi_powerresource) ap_link; 88 TAILQ_HEAD(,acpi_powerreference) ap_references; 89 ACPI_HANDLE ap_resource; 90 UINT64 ap_systemlevel; 91 UINT64 ap_order; 92}; 93 94static TAILQ_HEAD(acpi_powerresource_list, acpi_powerresource) | 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 <contrib/dev/acpica/include/acpi.h> --- 50 unchanged lines hidden (view full) --- 87 TAILQ_ENTRY(acpi_powerresource) ap_link; 88 TAILQ_HEAD(,acpi_powerreference) ap_references; 89 ACPI_HANDLE ap_resource; 90 UINT64 ap_systemlevel; 91 UINT64 ap_order; 92}; 93 94static TAILQ_HEAD(acpi_powerresource_list, acpi_powerresource) |
95 acpi_powerresources; | 95 acpi_powerresources = TAILQ_HEAD_INITIALIZER(acpi_powerresources); |
96static TAILQ_HEAD(acpi_powerconsumer_list, acpi_powerconsumer) | 96static TAILQ_HEAD(acpi_powerconsumer_list, acpi_powerconsumer) |
97 acpi_powerconsumers; | 97 acpi_powerconsumers = TAILQ_HEAD_INITIALIZER(acpi_powerconsumers); |
98ACPI_SERIAL_DECL(powerres, "ACPI power resources"); 99 100static ACPI_STATUS acpi_pwr_register_consumer(ACPI_HANDLE consumer); 101#ifdef notyet 102static ACPI_STATUS acpi_pwr_deregister_consumer(ACPI_HANDLE consumer); 103#endif /* notyet */ 104static ACPI_STATUS acpi_pwr_register_resource(ACPI_HANDLE res); 105#ifdef notyet --- 4 unchanged lines hidden (view full) --- 110static int acpi_pwr_dereference_resource(struct acpi_powerconsumer 111 *pc); 112static ACPI_STATUS acpi_pwr_switch_power(void); 113static struct acpi_powerresource 114 *acpi_pwr_find_resource(ACPI_HANDLE res); 115static struct acpi_powerconsumer 116 *acpi_pwr_find_consumer(ACPI_HANDLE consumer); 117 | 98ACPI_SERIAL_DECL(powerres, "ACPI power resources"); 99 100static ACPI_STATUS acpi_pwr_register_consumer(ACPI_HANDLE consumer); 101#ifdef notyet 102static ACPI_STATUS acpi_pwr_deregister_consumer(ACPI_HANDLE consumer); 103#endif /* notyet */ 104static ACPI_STATUS acpi_pwr_register_resource(ACPI_HANDLE res); 105#ifdef notyet --- 4 unchanged lines hidden (view full) --- 110static int acpi_pwr_dereference_resource(struct acpi_powerconsumer 111 *pc); 112static ACPI_STATUS acpi_pwr_switch_power(void); 113static struct acpi_powerresource 114 *acpi_pwr_find_resource(ACPI_HANDLE res); 115static struct acpi_powerconsumer 116 *acpi_pwr_find_consumer(ACPI_HANDLE consumer); 117 |
118/* Initialise our lists. */ 119static void 120acpi_pwr_init(void *junk) 121{ 122 TAILQ_INIT(&acpi_powerresources); 123 TAILQ_INIT(&acpi_powerconsumers); 124} 125SYSINIT(acpi_powerresource, SI_SUB_TUNABLES, SI_ORDER_ANY, acpi_pwr_init, NULL); 126 | |
127/* 128 * Register a power resource. 129 * 130 * It's OK to call this if we already know about the resource. 131 */ 132static ACPI_STATUS 133acpi_pwr_register_resource(ACPI_HANDLE res) 134{ --- 614 unchanged lines hidden --- | 118/* 119 * Register a power resource. 120 * 121 * It's OK to call this if we already know about the resource. 122 */ 123static ACPI_STATUS 124acpi_pwr_register_resource(ACPI_HANDLE res) 125{ --- 614 unchanged lines hidden --- |