summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpivar.h
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2003-11-15 19:20:46 +0000
committernjl <njl@FreeBSD.org>2003-11-15 19:20:46 +0000
commit494ae5c16ea7eda4d789f4252798e770f97f2ca3 (patch)
treef04cdf8b4441675eeffccceceee22d0fa8ee882e /sys/dev/acpica/acpivar.h
parent0fd0be9b4cadc547ffbe21338f36ab49fbd66d7a (diff)
downloadFreeBSD-src-494ae5c16ea7eda4d789f4252798e770f97f2ca3.zip
FreeBSD-src-494ae5c16ea7eda4d789f4252798e770f97f2ca3.tar.gz
Add acpi_package.c with routines for validating packages and pulling
various data types from them. This is loosely based on the acpi_cmbat macros (by Mike Smith) and will eventually replace them.
Diffstat (limited to 'sys/dev/acpica/acpivar.h')
-rw-r--r--sys/dev/acpica/acpivar.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index dad5165..b913625 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -149,6 +149,8 @@ extern int acpi_set_magic(device_t dev, int m);
extern void * acpi_get_private(device_t dev);
extern int acpi_set_private(device_t dev, void *p);
extern ACPI_OBJECT_TYPE acpi_get_type(device_t dev);
+struct resource * acpi_bus_alloc_gas(device_t dev, int *rid,
+ ACPI_GENERIC_ADDRESS *gas);
#ifdef ACPI_DEBUGGER
extern void acpi_EnterDebugger(void);
@@ -286,6 +288,19 @@ extern void acpi_ec_ecdt_probe(device_t);
/* AC adapter interface. */
extern int acpi_acad_get_acline(int *);
+/* Package manipulation convenience functions. */
+#define ACPI_PKG_VALID(pkg, size) \
+ ((pkg) != NULL && (pkg)->Type == ACPI_TYPE_PACKAGE && \
+ (pkg)->Package.Count >= (size))
+int acpi_PkgInt(device_t dev, ACPI_OBJECT *res, int idx,
+ ACPI_INTEGER *dst);
+int acpi_PkgInt32(device_t dev, ACPI_OBJECT *res, int idx,
+ uint32_t *dst);
+int acpi_PkgStr(device_t dev, ACPI_OBJECT *res, int idx, void *dst,
+ size_t size);
+int acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *rid,
+ struct resource **dst);
+
#if __FreeBSD_version >= 500000
#ifndef ACPI_MAX_THREADS
#define ACPI_MAX_THREADS 3
OpenPOWER on IntegriCloud