aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acmacros.h
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-11-17 13:07:00 -0500
committerLen Brown <len.brown@intel.com>2005-12-10 00:27:56 -0500
commitc51a4de85de720670f2fbc592a6f8040af72ad87 (patch)
treeccaa60c483fcc904abd63d936ff7dc380bf28e7b /include/acpi/acmacros.h
parent96db255c8f014ae3497507104e8df809785a619f (diff)
[ACPI] ACPICA 20051117
Fixed a problem in the AML parser where the method thread count could be decremented below zero if any errors occurred during the method parse phase. This should eliminate AE_AML_METHOD_LIMIT exceptions seen on some machines. This also fixed a related regression with the mechanism that detects and corrects methods that cannot properly handle reentrancy (related to the deployment of the new OwnerId mechanism.) Eliminated the pre-parsing of control methods (to detect errors) during table load. Related to the problem above, this was causing unwind issues if any errors occurred during the parse, and it seemed to be overkill. A table load should not be aborted if there are problems with any single control method, thus rendering this feature rather pointless. Fixed a problem with the new table-driven resource manager where an internal buffer overflow could occur for small resource templates. Implemented a new external interface, acpi_get_vendor_resource() This interface will find and return a vendor-defined resource descriptor within a _CRS or _PRS method via an ACPI 3.0 UUID match. (from Bjorn Helgaas) Removed the length limit (200) on string objects as per the upcoming ACPI 3.0A specification. This affects the following areas of the interpreter: 1) any implicit conversion of a Buffer to a String, 2) a String object result of the ASL Concatentate operator, 3) the String object result of the ASL ToString operator. 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.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index e42222c3d34c..5b78ff4091b9 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -107,23 +107,29 @@
107 * Extract a byte of data using a pointer. Any more than a byte and we 107 * Extract a byte of data using a pointer. Any more than a byte and we
108 * get into potential aligment issues -- see the STORE macros below 108 * get into potential aligment issues -- see the STORE macros below
109 */ 109 */
110#define ACPI_GET8(addr) (*(u8*)(addr)) 110#define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr)
111#define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr)
112#define ACPI_GET32(ptr) *ACPI_CAST_PTR (u32, ptr)
113#define ACPI_GET64(ptr) *ACPI_CAST_PTR (u64, ptr)
114#define ACPI_SET8(ptr) *ACPI_CAST_PTR (u8, ptr)
115#define ACPI_SET16(ptr) *ACPI_CAST_PTR (u16, ptr)
116#define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr)
117#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr)
111 118
112/* Pointer arithmetic */ 119/* Pointer manipulation */
113 120
114#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (acpi_native_uint)(b)) 121#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p))
122#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p))
123#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_native_uint)(b)))
115#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) 124#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b))
116 125
117/* Pointer/Integer type conversions */ 126/* Pointer/Integer type conversions */
118 127
119#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i) 128#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_native_uint)i)
120#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 129#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
121#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 130#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
122#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) 131#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f)
123 132
124#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p))
125#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p))
126
127#if ACPI_MACHINE_WIDTH == 16 133#if ACPI_MACHINE_WIDTH == 16
128#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) 134#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
129#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) 135#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i)
@@ -365,6 +371,13 @@
365#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) 371#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask)
366#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) 372#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask)
367 373
374/* Generate a UUID */
375
376#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \
377 (b) & 0xFF, ((b) >> 8) & 0xFF, \
378 (c) & 0xFF, ((c) >> 8) & 0xFF, \
379 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)
380
368/* 381/*
369 * An struct acpi_namespace_node * can appear in some contexts, 382 * An struct acpi_namespace_node * can appear in some contexts,
370 * where a pointer to an union acpi_operand_object can also 383 * where a pointer to an union acpi_operand_object can also