Merge pull request #744 from rafaeljw/headers

Headers: Use uintptr_t and offsetof() in Linux kernel builds
This commit is contained in:
Robert Moore 2022-01-27 13:24:24 -08:00 committed by GitHub
commit 84449c1eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -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 */

View File

@ -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