summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpivar.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-09-22 15:46:16 +0000
committerjhb <jhb@FreeBSD.org>2004-09-22 15:46:16 +0000
commitcf1b8fbca5432f624ea9a8b572cc5ba250278fa5 (patch)
tree5929701468e47aab4540fb10f7ae335e5bd17547 /sys/dev/acpica/acpivar.h
parent39563036071c35de79aa935b7bdfc209277f3afb (diff)
downloadFreeBSD-src-cf1b8fbca5432f624ea9a8b572cc5ba250278fa5.zip
FreeBSD-src-cf1b8fbca5432f624ea9a8b572cc5ba250278fa5.tar.gz
Add a couple of macros to extract the PCI slot (device) and function from
an ACPI _ADR value and use that rather than inlining the same shifts and masks everywhere.
Diffstat (limited to 'sys/dev/acpica/acpivar.h')
-rw-r--r--sys/dev/acpica/acpivar.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index 811c3ed..3722160 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -98,6 +98,10 @@ struct acpi_prw_data {
/* Flags for each device defined in the AML namespace. */
#define ACPI_FLAG_WAKE_ENABLED 0x1
+/* Macros for extracting parts of a PCI address from an _ADR value. */
+#define ACPI_ADR_PCI_SLOT(adr) (((adr) & 0xffff0000) >> 16)
+#define ACPI_ADR_PCI_FUNC(adr) ((adr) & 0xffff)
+
/*
* Entry points to ACPI from above are global functions defined in this
* file, sysctls, and I/O on the control device. Entry points from below
OpenPOWER on IntegriCloud