summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2022-01-27 13:24:24 -0800
committerGitHub <noreply@github.com>2022-01-27 13:24:24 -0800
commit84449c1eef1c0d092b037dc4c2c60cec5d5cc6c4 (patch)
tree183a5ae979aa2ebafa54db8070772268799cdc33
parentb32dde35e26a63a85d78d4dc0a7260b61e626ac1 (diff)
parent7c6001f6338940e3a3d0eaf4fcd530ef560df55e (diff)
downloadacpica-84449c1eef1c0d092b037dc4c2c60cec5d5cc6c4.tar.gz
Merge pull request #744 from rafaeljw/headers
Headers: Use uintptr_t and offsetof() in Linux kernel builds
-rw-r--r--source/include/actypes.h4
-rw-r--r--source/include/platform/aclinux.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/source/include/actypes.h b/source/include/actypes.h
index de111e726..a726f1c43 100644
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -658,8 +658,12 @@ typedef UINT64 ACPI_INTEGER;
/* Pointer/Integer type conversions */
#define ACPI_TO_POINTER(i) ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
+#ifndef ACPI_TO_INTEGER
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0)
+#endif
+#ifndef ACPI_OFFSET
#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
+#endif
#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
/* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
index 17fd51131..62b64037a 100644
--- a/source/include/platform/aclinux.h
+++ b/source/include/platform/aclinux.h
@@ -252,6 +252,11 @@
#define ACPI_SPINLOCK spinlock_t *
#define ACPI_CPU_FLAGS unsigned long
+#define ACPI_UINTPTR_T uintptr_t
+
+#define ACPI_TO_INTEGER(p) ((uintptr_t)(p))
+#define ACPI_OFFSET(d, f) offsetof(d, f)
+
/* Use native linux version of AcpiOsAllocateZeroed */
#define USE_NATIVE_ALLOCATE_ZEROED