diff options
author | Bob Moore <robert.moore@intel.com> | 2008-06-10 01:42:13 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:03 -0400 |
commit | 67a119f990063f5662574f6d6414fe9bc5ece86a (patch) | |
tree | 96be8ffbbe56a0a2a85dba14b8c81f153ac218f2 /include/acpi/acmacros.h | |
parent | 11f2a61ab418305167f9a3f3a31a50449222f64b (diff) |
ACPICA: Eliminate acpi_native_uint type v2
No longer needed; replaced mostly with u32, but also acpi_size
where a type that changes 32/64 bit on 32/64-bit platforms is
required.
v2: Fix a cast of a 32-bit int to a pointer in ACPI to avoid a compiler warning.
from David Howells
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'include/acpi/acmacros.h')
-rw-r--r-- | include/acpi/acmacros.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 5ad6e3992304..d0494ea74b22 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -80,12 +80,12 @@ | |||
80 | */ | 80 | */ |
81 | #define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p)) | 81 | #define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p)) |
82 | #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p)) | 82 | #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p)) |
83 | #define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b))) | 83 | #define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_size)(b))) |
84 | #define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b))) | 84 | #define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b))) |
85 | 85 | ||
86 | /* Pointer/Integer type conversions */ | 86 | /* Pointer/Integer type conversions */ |
87 | 87 | ||
88 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) | 88 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL, (acpi_size) i) |
89 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) | 89 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) |
90 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) | 90 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) |
91 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) | 91 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) |
@@ -296,22 +296,22 @@ struct acpi_integer_overlay { | |||
296 | /* | 296 | /* |
297 | * Rounding macros (Power of two boundaries only) | 297 | * Rounding macros (Power of two boundaries only) |
298 | */ | 298 | */ |
299 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ | 299 | #define ACPI_ROUND_DOWN(value, boundary) (((acpi_size)(value)) & \ |
300 | (~(((acpi_native_uint) boundary)-1))) | 300 | (~(((acpi_size) boundary)-1))) |
301 | 301 | ||
302 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ | 302 | #define ACPI_ROUND_UP(value, boundary) ((((acpi_size)(value)) + \ |
303 | (((acpi_native_uint) boundary)-1)) & \ | 303 | (((acpi_size) boundary)-1)) & \ |
304 | (~(((acpi_native_uint) boundary)-1))) | 304 | (~(((acpi_size) boundary)-1))) |
305 | 305 | ||
306 | /* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */ | 306 | /* Note: sizeof(acpi_size) evaluates to either 4 or 8 (32- vs 64-bit mode) */ |
307 | 307 | ||
308 | #define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) | 308 | #define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) |
309 | #define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) | 309 | #define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) |
310 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint)) | 310 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_size)) |
311 | 311 | ||
312 | #define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) | 312 | #define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) |
313 | #define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) | 313 | #define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) |
314 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint)) | 314 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_size)) |
315 | 315 | ||
316 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) | 316 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) |
317 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) | 317 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) |
@@ -322,7 +322,7 @@ struct acpi_integer_overlay { | |||
322 | 322 | ||
323 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) | 323 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) |
324 | 324 | ||
325 | #define ACPI_IS_MISALIGNED(value) (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1)) | 325 | #define ACPI_IS_MISALIGNED(value) (((acpi_size)value) & (sizeof(acpi_size)-1)) |
326 | 326 | ||
327 | /* | 327 | /* |
328 | * Bitmask creation | 328 | * Bitmask creation |