diff options
author | Nate Lawson <njl@FreeBSD.org> | 2004-08-06 00:38:50 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2004-08-06 00:38:50 +0000 |
commit | 17dbe0f79f8da1e5d4aaf196162af2cd976bc9fe (patch) | |
tree | c2e980906fe8511082d3d93d6ce2a7963dff5925 /sys/dev/acpica/acpivar.h | |
parent | 503680203194c34f83c65bda3cf5281d08a3fd49 (diff) | |
download | src-17dbe0f79f8da1e5d4aaf196162af2cd976bc9fe.tar.gz src-17dbe0f79f8da1e5d4aaf196162af2cd976bc9fe.zip |
Add flags for _STA (status) methods and convenience macros for checking
the presence of batteries and devices.
Notes
Notes:
svn path=/head/; revision=133188
Diffstat (limited to 'sys/dev/acpica/acpivar.h')
-rw-r--r-- | sys/dev/acpica/acpivar.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 251a09d0e7d9..21292177d774 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -222,7 +222,21 @@ void acpi_EnterDebugger(void); device_printf(dev, x); \ } while (0) -#define ACPI_DEVINFO_PRESENT(x) (((x) & 0x9) == 9) +/* Values for the device _STA (status) method. */ +#define ACPI_STA_PRESENT (1 << 0) +#define ACPI_STA_ENABLED (1 << 1) +#define ACPI_STA_SHOW_IN_UI (1 << 2) +#define ACPI_STA_FUNCTIONAL (1 << 3) +#define ACPI_STA_BATT_PRESENT (1 << 4) + +#define ACPI_DEVINFO_PRESENT(x, flags) \ + (((x) & (flags)) == (flags)) +#define ACPI_DEVICE_PRESENT(x) \ + ACPI_DEVINFO_PRESENT(x, ACPI_STA_PRESENT | ACPI_STA_FUNCTIONAL) +#define ACPI_BATTERY_PRESENT(x) \ + ACPI_DEVINFO_PRESENT(x, ACPI_STA_PRESENT | ACPI_STA_FUNCTIONAL | \ + ACPI_STA_BATT_PRESENT) + BOOLEAN acpi_DeviceIsPresent(device_t dev); BOOLEAN acpi_BatteryIsPresent(device_t dev); ACPI_STATUS acpi_GetHandleInScope(ACPI_HANDLE parent, char *path, |