acpivar.h (170783) | acpivar.h (170976) |
---|---|
1/*- 2 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 3 * Copyright (c) 2000 Michael Smith <msmith@freebsd.org> 4 * Copyright (c) 2000 BSDi 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> 3 * Copyright (c) 2000 Michael Smith <msmith@freebsd.org> 4 * Copyright (c) 2000 BSDi 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/acpica/acpivar.h 170783 2007-06-15 18:02:34Z njl $ | 28 * $FreeBSD: head/sys/dev/acpica/acpivar.h 170976 2007-06-21 22:50:37Z njl $ |
29 */ 30 31#ifndef _ACPIVAR_H_ 32#define _ACPIVAR_H_ 33 34#ifdef _KERNEL 35 36#include "acpi_if.h" 37#include "bus_if.h" 38#include <sys/eventhandler.h> 39#include <sys/ktr.h> 40#include <sys/lock.h> 41#include <sys/mutex.h> | 29 */ 30 31#ifndef _ACPIVAR_H_ 32#define _ACPIVAR_H_ 33 34#ifdef _KERNEL 35 36#include "acpi_if.h" 37#include "bus_if.h" 38#include <sys/eventhandler.h> 39#include <sys/ktr.h> 40#include <sys/lock.h> 41#include <sys/mutex.h> |
42#include <sys/selinfo.h> |
|
42#include <sys/sx.h> 43#include <sys/sysctl.h> 44 45#include <machine/bus.h> 46#include <machine/resource.h> 47 | 43#include <sys/sx.h> 44#include <sys/sysctl.h> 45 46#include <machine/bus.h> 47#include <machine/resource.h> 48 |
49struct apm_clone_data; |
|
48struct acpi_softc { 49 device_t acpi_dev; 50 struct cdev *acpi_dev_t; 51 52 struct resource *acpi_irq; 53 int acpi_irq_rid; 54 void *acpi_irq_handle; 55 --- 15 unchanged lines hidden (view full) --- 71 int acpi_do_disable; 72 int acpi_verbose; 73 int acpi_handle_reboot; 74 75 bus_dma_tag_t acpi_waketag; 76 bus_dmamap_t acpi_wakemap; 77 vm_offset_t acpi_wakeaddr; 78 vm_paddr_t acpi_wakephys; | 50struct acpi_softc { 51 device_t acpi_dev; 52 struct cdev *acpi_dev_t; 53 54 struct resource *acpi_irq; 55 int acpi_irq_rid; 56 void *acpi_irq_handle; 57 --- 15 unchanged lines hidden (view full) --- 73 int acpi_do_disable; 74 int acpi_verbose; 75 int acpi_handle_reboot; 76 77 bus_dma_tag_t acpi_waketag; 78 bus_dmamap_t acpi_wakemap; 79 vm_offset_t acpi_wakeaddr; 80 vm_paddr_t acpi_wakephys; |
81 82 int acpi_next_sstate; /* Next suspend Sx state. */ 83 struct apm_clone_data *acpi_clone; /* Pseudo-dev for devd(8). */ 84 STAILQ_HEAD(,apm_clone_data) apm_cdevs; /* All apm/apmctl/acpi cdevs. */ 85 struct callout susp_force_to; /* Force suspend if no acks. */ |
|
79}; 80 81struct acpi_device { 82 /* ACPI ivars */ 83 ACPI_HANDLE ad_handle; 84 uintptr_t ad_magic; 85 void *ad_private; 86 int ad_flags; 87 88 /* Resources */ 89 struct resource_list ad_rl; 90}; 91 | 86}; 87 88struct acpi_device { 89 /* ACPI ivars */ 90 ACPI_HANDLE ad_handle; 91 uintptr_t ad_magic; 92 void *ad_private; 93 int ad_flags; 94 95 /* Resources */ 96 struct resource_list ad_rl; 97}; 98 |
99/* Track device (/dev/{apm,apmctl} and /dev/acpi) notification status. */ 100struct apm_clone_data { 101 STAILQ_ENTRY(apm_clone_data) entries; 102 struct cdev *cdev; 103 int flags; 104#define ACPI_EVF_NONE 0 /* /dev/apm semantics */ 105#define ACPI_EVF_DEVD 1 /* /dev/acpi is handled via devd(8) */ 106#define ACPI_EVF_WRITE 2 /* Device instance is opened writable. */ 107 int notify_status; 108#define APM_EV_NONE 0 /* Device not yet aware of pending sleep. */ 109#define APM_EV_NOTIFIED 1 /* Device saw next sleep state. */ 110#define APM_EV_ACKED 2 /* Device agreed sleep can occur. */ 111 struct acpi_softc *acpi_sc; 112 struct selinfo sel_read; 113}; 114 |
|
92#define ACPI_PRW_MAX_POWERRES 8 93 94struct acpi_prw_data { 95 ACPI_HANDLE gpe_handle; 96 int gpe_bit; 97 int lowest_wake; 98 ACPI_OBJECT power_res[ACPI_PRW_MAX_POWERRES]; 99 int power_res_count; --- 199 unchanged lines hidden (view full) --- 299ACPI_STATUS acpi_ForeachPackageObject(ACPI_OBJECT *obj, 300 void (*func)(ACPI_OBJECT *comp, void *arg), void *arg); 301ACPI_STATUS acpi_FindIndexedResource(ACPI_BUFFER *buf, int index, 302 ACPI_RESOURCE **resp); 303ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf, 304 ACPI_RESOURCE *res); 305ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); 306ACPI_STATUS acpi_SetIntrModel(int model); | 115#define ACPI_PRW_MAX_POWERRES 8 116 117struct acpi_prw_data { 118 ACPI_HANDLE gpe_handle; 119 int gpe_bit; 120 int lowest_wake; 121 ACPI_OBJECT power_res[ACPI_PRW_MAX_POWERRES]; 122 int power_res_count; --- 199 unchanged lines hidden (view full) --- 322ACPI_STATUS acpi_ForeachPackageObject(ACPI_OBJECT *obj, 323 void (*func)(ACPI_OBJECT *comp, void *arg), void *arg); 324ACPI_STATUS acpi_FindIndexedResource(ACPI_BUFFER *buf, int index, 325 ACPI_RESOURCE **resp); 326ACPI_STATUS acpi_AppendBufferResource(ACPI_BUFFER *buf, 327 ACPI_RESOURCE *res); 328ACPI_STATUS acpi_OverrideInterruptLevel(UINT32 InterruptNumber); 329ACPI_STATUS acpi_SetIntrModel(int model); |
330int acpi_ReqSleepState(struct acpi_softc *sc, int state); 331int acpi_AckSleepState(struct apm_clone_data *clone, int error); |
|
307ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); 308int acpi_wake_init(device_t dev, int type); 309int acpi_wake_set_enable(device_t dev, int enable); 310int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); 311ACPI_STATUS acpi_Startup(void); 312void acpi_UserNotify(const char *subsystem, ACPI_HANDLE h, 313 uint8_t notify); 314int acpi_bus_alloc_gas(device_t dev, int *type, int *rid, --- 122 unchanged lines hidden --- | 332ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); 333int acpi_wake_init(device_t dev, int type); 334int acpi_wake_set_enable(device_t dev, int enable); 335int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); 336ACPI_STATUS acpi_Startup(void); 337void acpi_UserNotify(const char *subsystem, ACPI_HANDLE h, 338 uint8_t notify); 339int acpi_bus_alloc_gas(device_t dev, int *type, int *rid, --- 122 unchanged lines hidden --- |