Deleted Added
full compact
acpi_powerres.c (238199) acpi_powerres.c (248415)
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 238199 2012-07-07 17:13:09Z eadler $");
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_powerres.c 248415 2013-03-17 07:28:17Z rpaulo $");
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>

--- 5 unchanged lines hidden (view full) ---

42 * ACPI power resource management.
43 *
44 * Power resource behaviour is slightly complicated by the fact that
45 * a single power resource may provide power for more than one device.
46 * Thus, we must track the device(s) being powered by a given power
47 * resource, and only deactivate it when there are no powered devices.
48 *
49 * Note that this only manages resources for known devices. There is an
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>

--- 5 unchanged lines hidden (view full) ---

42 * ACPI power resource management.
43 *
44 * Power resource behaviour is slightly complicated by the fact that
45 * a single power resource may provide power for more than one device.
46 * Thus, we must track the device(s) being powered by a given power
47 * resource, and only deactivate it when there are no powered devices.
48 *
49 * Note that this only manages resources for known devices. There is an
50 * ugly case where we may turn of power to a device which is in use because
50 * ugly case where we may turn off power to a device which is in use because
51 * we don't know that it depends on a given resource. We should perhaps
52 * try to be smarter about this, but a more complete solution would involve
53 * scanning all of the ACPI namespace to find devices we're not currently
54 * aware of, and this raises questions about whether they should be left
55 * on, turned off, etc.
56 */
57
58static MALLOC_DEFINE(M_ACPIPWR, "acpipwr", "ACPI power resources");

--- 699 unchanged lines hidden ---
51 * we don't know that it depends on a given resource. We should perhaps
52 * try to be smarter about this, but a more complete solution would involve
53 * scanning all of the ACPI namespace to find devices we're not currently
54 * aware of, and this raises questions about whether they should be left
55 * on, turned off, etc.
56 */
57
58static MALLOC_DEFINE(M_ACPIPWR, "acpipwr", "ACPI power resources");

--- 699 unchanged lines hidden ---