ACPI: ACPICA 20060310

Tagged all external interfaces to the subsystem with the
new ACPI_EXPORT_SYMBOL macro. This macro can be defined
as necessary to assist kernel integration. For Linux,
the macro resolves to the EXPORT_SYMBOL macro. The default
definition is NULL.

Added the ACPI_THREAD_ID type for the return value from
acpi_os_get_thread_id(). This allows the host to define this
as necessary to simplify kernel integration. The default
definition is ACPI_NATIVE_UINT.

Valery Podrezov fixed two interpreter problems related
to error processing, the deletion of objects, and placing
invalid pointers onto the internal operator result stack.
http://bugzilla.kernel.org/show_bug.cgi?id=6028
http://bugzilla.kernel.org/show_bug.cgi?id=6151

Increased the reference count threshold where a warning is
emitted for large reference counts in order to eliminate
unnecessary warnings on systems with large namespaces
(especially 64-bit.) Increased the value from 0x400
to 0x800.

Due to universal disagreement as to the meaning of the
'c' in the calloc() function, the ACPI_MEM_CALLOCATE
macro has been renamed to ACPI_ALLOCATE_ZEROED so that the
purpose of the interface is 'clear'. ACPI_MEM_ALLOCATE and
ACPI_MEM_FREE are renamed to ACPI_ALLOCATE and ACPI_FREE.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 7885022..ebe793f 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20060217
+#define ACPI_CA_VERSION                 0x20060310
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
@@ -102,9 +102,9 @@
 
 #define ACPI_MAX_SEMAPHORE_COUNT        256
 
-/* Max reference count (for debug only) */
+/* Maximum object reference count (detects object deletion issues) */
 
-#define ACPI_MAX_REFERENCE_COUNT        0x400
+#define ACPI_MAX_REFERENCE_COUNT        0x800
 
 /* Size of cached memory mapping for system memory operation region */
 
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 0727c13..f004461 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -50,6 +50,7 @@
 #define BLOCK_PAREN             1
 #define BLOCK_BRACE             2
 #define BLOCK_COMMA_LIST        4
+#define ACPI_DEFAULT_RESNAME    *(u32 *) "__RD"
 
 struct acpi_external_list {
 	char *path;
@@ -78,6 +79,11 @@
 acpi_status(*asl_walk_callback) (union acpi_parse_object * op,
 				 u32 level, void *context);
 
+struct acpi_resource_tag {
+	u32 bit_index;
+	char *tag;
+};
+
 /*
  * dmwalk
  */
@@ -85,6 +91,11 @@
 acpi_dm_disassemble(struct acpi_walk_state *walk_state,
 		    union acpi_parse_object *origin, u32 num_opcodes);
 
+void
+acpi_dm_walk_parse_tree(union acpi_parse_object *op,
+			asl_walk_callback descending_callback,
+			asl_walk_callback ascending_callback, void *context);
+
 /*
  * dmopcode
  */
@@ -167,6 +178,7 @@
 
 void
 acpi_dm_resource_template(struct acpi_op_walk_info *info,
+			  union acpi_parse_object *op,
 			  u8 * byte_data, u32 byte_count);
 
 u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
@@ -177,6 +189,8 @@
 
 void acpi_dm_decode_attribute(u8 attribute);
 
+void acpi_dm_descriptor_name(void);
+
 /*
  * dmresrcl
  */
@@ -251,4 +265,13 @@
  */
 void acpi_dm_add_to_external_list(char *path);
 
+/*
+ * dmrestag
+ */
+void acpi_dm_find_resources(union acpi_parse_object *root);
+
+void
+acpi_dm_check_resource_reference(union acpi_parse_object *op,
+				 struct acpi_walk_state *walk_state);
+
 #endif				/* __ACDISASM_H__ */
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 8361820..94fbf96 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -129,7 +129,7 @@
 struct acpi_mutex_info {
 	acpi_mutex mutex;
 	u32 use_count;
-	u32 thread_id;
+	acpi_thread_id thread_id;
 };
 
 /* Lock flag parameter for various interfaces */
@@ -181,9 +181,9 @@
 	u8 owner_id;		/* Who created this node */
 	u8 flags;
 
-	/* Fields used by the ASL compiler only */
+	/* Fields used by the ASL compiler and disassembler only */
 
-#ifdef ACPI_ASL_COMPILER
+#ifdef ACPI_LARGE_NAMESPACE_NODE
 	u32 value;
 	union acpi_parse_object *op;
 #endif
@@ -479,7 +479,7 @@
 struct acpi_thread_state {
 	ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list;	/* Head of list of walk_states for this thread */
 	union acpi_operand_object *acquired_mutex_list;	/* List of all currently acquired mutexes */
-	u32 thread_id;		/* Running thread ID */
+	acpi_thread_id thread_id;	/* Running thread ID */
 	u8 current_sync_level;	/* Mutex Sync (nested acquire) level */
 };
 
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index dd5644d..c8aa73f 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -713,18 +713,18 @@
 
 /* Memory allocation */
 
-#define ACPI_MEM_ALLOCATE(a)            acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
-#define ACPI_MEM_CALLOCATE(a)           acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
-#define ACPI_MEM_FREE(a)                acpi_os_free(a)
+#define ACPI_ALLOCATE(a)            acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
+#define ACPI_ALLOCATE_ZEROED(a)           acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
+#define ACPI_FREE(a)                acpi_os_free(a)
 #define ACPI_MEM_TRACKING(a)
 
 #else
 
 /* Memory allocation */
 
-#define ACPI_MEM_ALLOCATE(a)            acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
-#define ACPI_MEM_CALLOCATE(a)           acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
-#define ACPI_MEM_FREE(a)                acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
+#define ACPI_ALLOCATE(a)            acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
+#define ACPI_ALLOCATE_ZEROED(a)           acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
+#define ACPI_FREE(a)                acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
 #define ACPI_MEM_TRACKING(a)            a
 
 #endif				/* ACPI_DBG_TRACK_ALLOCATIONS */
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index b667a80..132d64a 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -63,6 +63,7 @@
 #define ACPI_NS_DONT_OPEN_SCOPE     0x02
 #define ACPI_NS_NO_PEER_SEARCH      0x04
 #define ACPI_NS_ERROR_IF_FOUND      0x08
+#define ACPI_NS_PREFIX_IS_SCOPE     0x10
 
 #define ACPI_NS_WALK_UNLOCK         TRUE
 #define ACPI_NS_WALK_NO_UNLOCK      FALSE
@@ -184,6 +185,10 @@
  */
 u32 acpi_ns_opens_scope(acpi_object_type type);
 
+void
+acpi_ns_build_external_path(struct acpi_namespace_node *node,
+			    acpi_size size, char *name_buffer);
+
 char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node);
 
 char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 970e9a6..91c3cdf 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -161,7 +161,7 @@
 /*
  * Threads and Scheduling
  */
-u32 acpi_os_get_thread_id(void);
+acpi_thread_id acpi_os_get_thread_id(void);
 
 acpi_status
 acpi_os_queue_for_execution(u32 priority,
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 95c3c8b..520f315 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -288,6 +288,21 @@
 #define ACPI_UNUSED_VAR
 #endif
 
+/*
+ * All ACPICA functions that are available to the rest of the kernel are
+ * tagged with this macro which can be defined as appropriate for the host.
+ */
+#ifndef ACPI_EXPORT_SYMBOL
+#define ACPI_EXPORT_SYMBOL(symbol)
+#endif
+
+/*
+ * thread_id is returned by acpi_os_get_thread_id.
+ */
+#ifndef acpi_thread_id
+#define acpi_thread_id                          acpi_native_uint
+#endif
+
 /*******************************************************************************
  *
  * Independent types
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index fb47353..e5b42eb 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -45,36 +45,36 @@
 #ifndef __AMLRESRC_H
 #define __AMLRESRC_H
 
-#define ASL_RESNAME_ADDRESS                     "_ADR"
-#define ASL_RESNAME_ALIGNMENT                   "_ALN"
-#define ASL_RESNAME_ADDRESSSPACE                "_ASI"
-#define ASL_RESNAME_ACCESSSIZE                  "_ASZ"
-#define ASL_RESNAME_TYPESPECIFICATTRIBUTES      "_ATT"
-#define ASL_RESNAME_BASEADDRESS                 "_BAS"
-#define ASL_RESNAME_BUSMASTER                   "_BM_"	/* Master(1), Slave(0) */
-#define ASL_RESNAME_DECODE                      "_DEC"
-#define ASL_RESNAME_DMA                         "_DMA"
-#define ASL_RESNAME_DMATYPE                     "_TYP"	/* Compatible(0), A(1), B(2), F(3) */
-#define ASL_RESNAME_GRANULARITY                 "_GRA"
-#define ASL_RESNAME_INTERRUPT                   "_INT"
-#define ASL_RESNAME_INTERRUPTLEVEL              "_LL_"	/* active_lo(1), active_hi(0) */
-#define ASL_RESNAME_INTERRUPTSHARE              "_SHR"	/* Shareable(1), no_share(0) */
-#define ASL_RESNAME_INTERRUPTTYPE               "_HE_"	/* Edge(1), Level(0) */
-#define ASL_RESNAME_LENGTH                      "_LEN"
-#define ASL_RESNAME_MEMATTRIBUTES               "_MTP"	/* Memory(0), Reserved(1), ACPI(2), NVS(3) */
-#define ASL_RESNAME_MEMTYPE                     "_MEM"	/* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
-#define ASL_RESNAME_MAXADDR                     "_MAX"
-#define ASL_RESNAME_MINADDR                     "_MIN"
-#define ASL_RESNAME_MAXTYPE                     "_MAF"
-#define ASL_RESNAME_MINTYPE                     "_MIF"
-#define ASL_RESNAME_REGISTERBITOFFSET           "_RBO"
-#define ASL_RESNAME_REGISTERBITWIDTH            "_RBW"
-#define ASL_RESNAME_RANGETYPE                   "_RNG"
-#define ASL_RESNAME_READWRITETYPE               "_RW_"	/* read_only(0), Writeable (1) */
-#define ASL_RESNAME_TRANSLATION                 "_TRA"
-#define ASL_RESNAME_TRANSTYPE                   "_TRS"	/* Sparse(1), Dense(0) */
-#define ASL_RESNAME_TYPE                        "_TTP"	/* Translation(1), Static (0) */
-#define ASL_RESNAME_XFERTYPE                    "_SIz"	/* 8(0), 8_and16(1), 16(2) */
+#define ACPI_RESTAG_ADDRESS                     "_ADR"
+#define ACPI_RESTAG_ALIGNMENT                   "_ALN"
+#define ACPI_RESTAG_ADDRESSSPACE                "_ASI"
+#define ACPI_RESTAG_ACCESSSIZE                  "_ASZ"
+#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES      "_ATT"
+#define ACPI_RESTAG_BASEADDRESS                 "_BAS"
+#define ACPI_RESTAG_BUSMASTER                   "_BM_"	/* Master(1), Slave(0) */
+#define ACPI_RESTAG_DECODE                      "_DEC"
+#define ACPI_RESTAG_DMA                         "_DMA"
+#define ACPI_RESTAG_DMATYPE                     "_TYP"	/* Compatible(0), A(1), B(2), F(3) */
+#define ACPI_RESTAG_GRANULARITY                 "_GRA"
+#define ACPI_RESTAG_INTERRUPT                   "_INT"
+#define ACPI_RESTAG_INTERRUPTLEVEL              "_LL_"	/* active_lo(1), active_hi(0) */
+#define ACPI_RESTAG_INTERRUPTSHARE              "_SHR"	/* Shareable(1), no_share(0) */
+#define ACPI_RESTAG_INTERRUPTTYPE               "_HE_"	/* Edge(1), Level(0) */
+#define ACPI_RESTAG_LENGTH                      "_LEN"
+#define ACPI_RESTAG_MEMATTRIBUTES               "_MTP"	/* Memory(0), Reserved(1), ACPI(2), NVS(3) */
+#define ACPI_RESTAG_MEMTYPE                     "_MEM"	/* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
+#define ACPI_RESTAG_MAXADDR                     "_MAX"
+#define ACPI_RESTAG_MINADDR                     "_MIN"
+#define ACPI_RESTAG_MAXTYPE                     "_MAF"
+#define ACPI_RESTAG_MINTYPE                     "_MIF"
+#define ACPI_RESTAG_REGISTERBITOFFSET           "_RBO"
+#define ACPI_RESTAG_REGISTERBITWIDTH            "_RBW"
+#define ACPI_RESTAG_RANGETYPE                   "_RNG"
+#define ACPI_RESTAG_READWRITETYPE               "_RW_"	/* read_only(0), Writeable (1) */
+#define ACPI_RESTAG_TRANSLATION                 "_TRA"
+#define ACPI_RESTAG_TRANSTYPE                   "_TRS"	/* Sparse(1), Dense(0) */
+#define ACPI_RESTAG_TYPE                        "_TTP"	/* Translation(1), Static (0) */
+#define ACPI_RESTAG_XFERTYPE                    "_SIz"	/* 8(0), 8_and16(1), 16(2) */
 
 /* Default sizes for "small" resource descriptors */
 
@@ -266,6 +266,7 @@
 union aml_resource {
 	/* Descriptor headers */
 
+	u8 descriptor_type;
 	struct aml_resource_small_header small_header;
 	struct aml_resource_large_header large_header;
 
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 223ec64..d5a7f56 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -59,6 +59,7 @@
 #define ACPI_APPLICATION
 #define ACPI_DISASSEMBLER
 #define ACPI_NO_METHOD_EXECUTION
+#define ACPI_LARGE_NAMESPACE_NODE
 #endif
 
 #ifdef ACPI_EXEC_APP
@@ -76,6 +77,7 @@
 #define ACPI_APPLICATION
 #define ACPI_DISASSEMBLER
 #define ACPI_CONSTANT_EVAL_ONLY
+#define ACPI_LARGE_NAMESPACE_NODE
 #endif
 
 #ifdef ACPI_APPLICATION
@@ -271,8 +273,8 @@
 /*
  * Storage alignment properties
  */
-#define  _AUPBND                (sizeof (acpi_native_uint) - 1)
-#define  _ADNBND                (sizeof (acpi_native_uint) - 1)
+#define  _AUPBND                (sizeof (acpi_native_int) - 1)
+#define  _ADNBND                (sizeof (acpi_native_int) - 1)
 
 /*
  * Variable argument list macro definitions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 2e6d545..2f5bb5b 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -52,27 +52,22 @@
 #include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/ctype.h>
 #include <asm/system.h>
 #include <asm/atomic.h>
 #include <asm/div64.h>
 #include <asm/acpi.h>
-
-#define strtoul simple_strtoul
-
-#define ACPI_MACHINE_WIDTH  BITS_PER_LONG
-
-/* Type(s) for the OSL */
-
-#ifdef ACPI_USE_LOCAL_CACHE
-#define acpi_cache_t	struct acpi_memory_list
-#else
 #include <linux/slab.h>
-#define acpi_cache_t	kmem_cache_t
-#endif
+
+/* Host-dependent types and defines */
+
+#define ACPI_MACHINE_WIDTH          BITS_PER_LONG
+#define acpi_cache_t                        kmem_cache_t
+#define ACPI_EXPORT_SYMBOL(symbol)  EXPORT_SYMBOL(symbol);
+#define strtoul                     simple_strtoul
 
 /* Full namespace pathname length limit - arbitrary */
-
 #define ACPI_PATHNAME_MAX              256
 
 #else				/* !__KERNEL__ */