diff options
author | Bob Moore <robert.moore@intel.com> | 2006-02-17 00:00:00 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-04-01 01:23:23 -0500 |
commit | ea936b78f46cbe089a4ac363e1682dee7d427096 (patch) | |
tree | c444b65c3d02b05934497caefcdcbbe675a00bdf /include/acpi/acmacros.h | |
parent | 52fc0b026e99b5d5d585095148d997d5634bbc25 (diff) |
ACPI: ACPICA 20060217
Implemented a change to the IndexField support to match
the behavior of the Microsoft AML interpreter. The value
written to the Index register is now a byte offset,
no longer an index based upon the width of the Data
register. This should fix IndexField problems seen on
some machines where the Data register is not exactly one
byte wide. The ACPI specification will be clarified on
this point.
Fixed a problem where several resource descriptor
types could overrun the internal descriptor buffer due
to size miscalculation: VendorShort, VendorLong, and
Interrupt. This was noticed on IA64 machines, but could
affect all platforms.
Fixed a problem where individual resource descriptors were
misaligned within the internal buffer, causing alignment
faults on IA64 platforms.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi/acmacros.h')
-rw-r--r-- | include/acpi/acmacros.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index f2be2a881730..dd5644dbe946 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -341,29 +341,33 @@ | |||
341 | /* | 341 | /* |
342 | * Rounding macros (Power of two boundaries only) | 342 | * Rounding macros (Power of two boundaries only) |
343 | */ | 343 | */ |
344 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ | 344 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ |
345 | (~(((acpi_native_uint) boundary)-1))) | 345 | (~(((acpi_native_uint) boundary)-1))) |
346 | 346 | ||
347 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ | 347 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ |
348 | (((acpi_native_uint) boundary)-1)) & \ | 348 | (((acpi_native_uint) boundary)-1)) & \ |
349 | (~(((acpi_native_uint) boundary)-1))) | 349 | (~(((acpi_native_uint) boundary)-1))) |
350 | 350 | ||
351 | #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) | 351 | /* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */ |
352 | #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) | ||
353 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) | ||
354 | 352 | ||
355 | #define ACPI_ROUND_UP_to_32_bITS(a) ACPI_ROUND_UP(a,4) | 353 | #define ACPI_ROUND_DOWN_to_32_bIT(a) ACPI_ROUND_DOWN(a,4) |
356 | #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) | 354 | #define ACPI_ROUND_DOWN_to_64_bIT(a) ACPI_ROUND_DOWN(a,8) |
357 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) | 355 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint)) |
358 | 356 | ||
359 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) | 357 | #define ACPI_ROUND_UP_to_32_bIT(a) ACPI_ROUND_UP(a,4) |
360 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) | 358 | #define ACPI_ROUND_UP_to_64_bIT(a) ACPI_ROUND_UP(a,8) |
359 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint)) | ||
361 | 360 | ||
362 | #define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) | 361 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) |
362 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) | ||
363 | |||
364 | #define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) | ||
363 | 365 | ||
364 | /* Generic (non-power-of-two) rounding */ | 366 | /* Generic (non-power-of-two) rounding */ |
365 | 367 | ||
366 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) | 368 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) |
369 | |||
370 | #define ACPI_IS_MISALIGNED(value) (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1)) | ||
367 | 371 | ||
368 | /* | 372 | /* |
369 | * Bitmask creation | 373 | * Bitmask creation |
@@ -371,10 +375,10 @@ | |||
371 | * MASK_BITS_ABOVE creates a mask starting AT the position and above | 375 | * MASK_BITS_ABOVE creates a mask starting AT the position and above |
372 | * MASK_BITS_BELOW creates a mask starting one bit BELOW the position | 376 | * MASK_BITS_BELOW creates a mask starting one bit BELOW the position |
373 | */ | 377 | */ |
374 | #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) | 378 | #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) |
375 | #define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) | 379 | #define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) |
376 | 380 | ||
377 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) | 381 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) |
378 | 382 | ||
379 | /* Bitfields within ACPI registers */ | 383 | /* Bitfields within ACPI registers */ |
380 | 384 | ||