aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/utilities
diff options
context:
space:
mode:
authorRobert Moore <robert.moore@intel.com>2005-04-18 22:49:35 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:08:52 -0400
commit44f6c01242da4e162f28d8e1216a8c7a91174605 (patch)
tree53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/utilities
parentebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff)
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index" argument to an ASL function was still (internally) 32 bits instead of the required 64 bits. This was the Index argument to the Index, Mid, and Match operators. The "strupr" function is now permanently local (acpi_ut_strupr), since this is not a POSIX-defined function and not present in most kernel-level C libraries. References to the C library strupr function have been removed from the headers. Completed the deployment of static functions/prototypes. All prototypes with the static attribute have been moved from the headers to the owning C file. ACPICA 20050329 from Bob Moore An error is now generated if an attempt is made to create a Buffer Field of length zero (A CreateField with a length operand of zero.) The interpreter now issues a warning whenever executable code at the module level is detected during ACPI table load. This will give some idea of the prevalence of this type of code. Implemented support for references to named objects (other than control methods) within package objects. Enhanced package object output for the debug object. Package objects are now completely dumped, showing all elements. Enhanced miscellaneous object output for the debug object. Any object can now be written to the debug object (for example, a device object can be written, and the type of the object will be displayed.) The "static" qualifier has been added to all local functions across the core subsystem. The number of "long" lines (> 80 chars) within the source has been significantly reduced, by about 1/3. Cleaned up all header files to ensure that all CA/iASL functions are prototyped (even static functions) and the formatting is consistent. Two new header files have been added, acopcode.h and acnames.h. Removed several obsolete functions that were no longer used. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities')
-rw-r--r--drivers/acpi/utilities/utalloc.c84
-rw-r--r--drivers/acpi/utilities/utcopy.c126
-rw-r--r--drivers/acpi/utilities/utdebug.c106
-rw-r--r--drivers/acpi/utilities/utdelete.c63
-rw-r--r--drivers/acpi/utilities/uteval.c36
-rw-r--r--drivers/acpi/utilities/utglobal.c133
-rw-r--r--drivers/acpi/utilities/utinit.c36
-rw-r--r--drivers/acpi/utilities/utmath.c2
-rw-r--r--drivers/acpi/utilities/utmisc.c187
-rw-r--r--drivers/acpi/utilities/utobject.c68
-rw-r--r--drivers/acpi/utilities/utxface.c61
11 files changed, 548 insertions, 354 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 3313439c4bc..c4e7f989a2b 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -47,8 +47,35 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utalloc")
+/* Local prototypes */
-/******************************************************************************
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+static struct acpi_debug_mem_block *
+acpi_ut_find_allocation (
+ u32 list_id,
+ void *allocation);
+
+static acpi_status
+acpi_ut_track_allocation (
+ u32 list_id,
+ struct acpi_debug_mem_block *address,
+ acpi_size size,
+ u8 alloc_type,
+ u32 component,
+ char *module,
+ u32 line);
+
+static acpi_status
+acpi_ut_remove_allocation (
+ u32 list_id,
+ struct acpi_debug_mem_block *address,
+ u32 component,
+ char *module,
+ u32 line);
+#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+
+
+/*******************************************************************************
*
* FUNCTION: acpi_ut_release_to_cache
*
@@ -98,7 +125,8 @@ acpi_ut_release_to_cache (
/* Put the object at the head of the cache list */
- * (ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset]))) = cache_info->list_head;
+ * (ACPI_CAST_INDIRECT_PTR (char,
+ &(((char *) object)[cache_info->link_offset]))) = cache_info->list_head;
cache_info->list_head = object;
cache_info->cache_depth++;
@@ -115,7 +143,7 @@ acpi_ut_release_to_cache (
}
-/******************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_acquire_from_cache
*
@@ -156,7 +184,8 @@ acpi_ut_acquire_from_cache (
/* There is an object available, use it */
object = cache_info->list_head;
- cache_info->list_head = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset])));
+ cache_info->list_head = *(ACPI_CAST_INDIRECT_PTR (char,
+ &(((char *) object)[cache_info->link_offset])));
ACPI_MEM_TRACKING (cache_info->cache_hits++);
cache_info->cache_depth--;
@@ -201,7 +230,7 @@ acpi_ut_acquire_from_cache (
#ifdef ACPI_ENABLE_OBJECT_CACHE
-/******************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_delete_generic_cache
*
@@ -228,7 +257,8 @@ acpi_ut_delete_generic_cache (
while (cache_info->list_head) {
/* Delete one cached state object */
- next = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) cache_info->list_head)[cache_info->link_offset])));
+ next = *(ACPI_CAST_INDIRECT_PTR (char,
+ &(((char *) cache_info->list_head)[cache_info->link_offset])));
ACPI_MEM_FREE (cache_info->list_head);
cache_info->list_head = next;
@@ -497,8 +527,8 @@ acpi_ut_allocate_and_track (
acpi_status status;
- allocation = acpi_ut_allocate (size + sizeof (struct acpi_debug_mem_header), component,
- module, line);
+ allocation = acpi_ut_allocate (size + sizeof (struct acpi_debug_mem_header),
+ component, module, line);
if (!allocation) {
return (NULL);
}
@@ -543,8 +573,8 @@ acpi_ut_callocate_and_track (
acpi_status status;
- allocation = acpi_ut_callocate (size + sizeof (struct acpi_debug_mem_header), component,
- module, line);
+ allocation = acpi_ut_callocate (size + sizeof (struct acpi_debug_mem_header),
+ component, module, line);
if (!allocation) {
/* Report allocation error */
@@ -637,7 +667,7 @@ acpi_ut_free_and_track (
*
******************************************************************************/
-struct acpi_debug_mem_block *
+static struct acpi_debug_mem_block *
acpi_ut_find_allocation (
u32 list_id,
void *allocation)
@@ -686,7 +716,7 @@ acpi_ut_find_allocation (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_track_allocation (
u32 list_id,
struct acpi_debug_mem_block *allocation,
@@ -721,10 +751,12 @@ acpi_ut_track_allocation (
element = acpi_ut_find_allocation (list_id, allocation);
if (element) {
- ACPI_REPORT_ERROR (("ut_track_allocation: Allocation already present in list! (%p)\n",
+ ACPI_REPORT_ERROR ((
+ "ut_track_allocation: Allocation already present in list! (%p)\n",
allocation));
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n", element, allocation));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Element %p Address %p\n",
+ element, allocation));
goto unlock_and_exit;
}
@@ -773,7 +805,7 @@ unlock_and_exit:
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_remove_allocation (
u32 list_id,
struct acpi_debug_mem_block *allocation,
@@ -797,7 +829,7 @@ acpi_ut_remove_allocation (
/* No allocations! */
_ACPI_REPORT_ERROR (module, line, component,
- ("ut_remove_allocation: Empty allocation list, nothing to free!\n"));
+ ("ut_remove_allocation: Empty allocation list, nothing to free!\n"));
return_ACPI_STATUS (AE_OK);
}
@@ -824,7 +856,8 @@ acpi_ut_remove_allocation (
ACPI_MEMSET (&allocation->user_space, 0xEA, allocation->size);
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n", allocation->size));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n",
+ allocation->size));
status = acpi_ut_release_mutex (ACPI_MTX_MEMORY);
return_ACPI_STATUS (status);
@@ -842,6 +875,7 @@ acpi_ut_remove_allocation (
* DESCRIPTION: Print some info about the outstanding allocations.
*
******************************************************************************/
+
#ifdef ACPI_FUTURE_USAGE
void
acpi_ut_dump_allocation_info (
@@ -884,7 +918,8 @@ acpi_ut_dump_allocation_info (
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Max Nodes",
acpi_gbl_max_concurrent_node_count,
- ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count * sizeof (struct acpi_namespace_node)))));
+ ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count *
+ sizeof (struct acpi_namespace_node)))));
*/
return_VOID;
}
@@ -933,26 +968,26 @@ acpi_ut_dump_allocations (
descriptor = ACPI_CAST_PTR (union acpi_descriptor, &element->user_space);
if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) {
acpi_os_printf ("%p Len %04X %9.9s-%d [%s] ",
- descriptor, element->size, element->module,
- element->line, acpi_ut_get_descriptor_name (descriptor));
+ descriptor, element->size, element->module,
+ element->line, acpi_ut_get_descriptor_name (descriptor));
/* Most of the elements will be Operand objects. */
switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) {
case ACPI_DESC_TYPE_OPERAND:
acpi_os_printf ("%12.12s R%hd",
- acpi_ut_get_type_name (descriptor->object.common.type),
- descriptor->object.common.reference_count);
+ acpi_ut_get_type_name (descriptor->object.common.type),
+ descriptor->object.common.reference_count);
break;
case ACPI_DESC_TYPE_PARSER:
acpi_os_printf ("aml_opcode %04hX",
- descriptor->op.asl.aml_opcode);
+ descriptor->op.asl.aml_opcode);
break;
case ACPI_DESC_TYPE_NAMED:
acpi_os_printf ("%4.4s",
- acpi_ut_get_node_name (&descriptor->node));
+ acpi_ut_get_node_name (&descriptor->node));
break;
default:
@@ -983,6 +1018,5 @@ acpi_ut_dump_allocations (
return_VOID;
}
-
#endif /* #ifdef ACPI_DBG_TRACK_ALLOCATIONS */
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 0fcd98bde0d..11e88495716 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -49,21 +49,69 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utcopy")
+/* Local prototypes */
+
+static acpi_status
+acpi_ut_copy_isimple_to_esimple (
+ union acpi_operand_object *internal_object,
+ union acpi_object *external_object,
+ u8 *data_space,
+ acpi_size *buffer_space_used);
+
+static acpi_status
+acpi_ut_copy_ielement_to_ielement (
+ u8 object_type,
+ union acpi_operand_object *source_object,
+ union acpi_generic_state *state,
+ void *context);
+
+static acpi_status
+acpi_ut_copy_ipackage_to_epackage (
+ union acpi_operand_object *internal_object,
+ u8 *buffer,
+ acpi_size *space_used);
+
+static acpi_status
+acpi_ut_copy_esimple_to_isimple(
+ union acpi_object *user_obj,
+ union acpi_operand_object **return_obj);
+
+static acpi_status
+acpi_ut_copy_simple_object (
+ union acpi_operand_object *source_desc,
+ union acpi_operand_object *dest_desc);
+
+static acpi_status
+acpi_ut_copy_ielement_to_eelement (
+ u8 object_type,
+ union acpi_operand_object *source_object,
+ union acpi_generic_state *state,
+ void *context);
+
+static acpi_status
+acpi_ut_copy_ipackage_to_ipackage (
+ union acpi_operand_object *source_obj,
+ union acpi_operand_object *dest_obj,
+ struct acpi_walk_state *walk_state);
+
/*******************************************************************************
*
* FUNCTION: acpi_ut_copy_isimple_to_esimple
*
- * PARAMETERS: *internal_object - Pointer to the object we are examining
- * *Buffer - Where the object is returned
- * *space_used - Where the data length is returned
+ * PARAMETERS: internal_object - Source object to be copied
+ * external_object - Where to return the copied object
+ * data_space - Where object data is returned (such as
+ * buffer and string data)
+ * buffer_space_used - Length of data_space that was used
*
* RETURN: Status
*
- * DESCRIPTION: This function is called to place a simple object in a user
- * buffer.
+ * DESCRIPTION: This function is called to copy a simple internal object to
+ * an external object.
*
- * The buffer is assumed to have sufficient space for the object.
+ * The data_space buffer is assumed to have sufficient space for
+ * the object.
*
******************************************************************************/
@@ -107,10 +155,12 @@ acpi_ut_copy_isimple_to_esimple (
external_object->string.pointer = (char *) data_space;
external_object->string.length = internal_object->string.length;
- *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD ((acpi_size) internal_object->string.length + 1);
+ *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (
+ (acpi_size) internal_object->string.length + 1);
- ACPI_MEMCPY ((void *) data_space, (void *) internal_object->string.pointer,
- (acpi_size) internal_object->string.length + 1);
+ ACPI_MEMCPY ((void *) data_space,
+ (void *) internal_object->string.pointer,
+ (acpi_size) internal_object->string.length + 1);
break;
@@ -118,10 +168,12 @@ acpi_ut_copy_isimple_to_esimple (
external_object->buffer.pointer = data_space;
external_object->buffer.length = internal_object->buffer.length;
- *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (internal_object->string.length);
+ *buffer_space_used = ACPI_ROUND_UP_TO_NATIVE_WORD (
+ internal_object->string.length);
- ACPI_MEMCPY ((void *) data_space, (void *) internal_object->buffer.pointer,
- internal_object->buffer.length);
+ ACPI_MEMCPY ((void *) data_space,
+ (void *) internal_object->buffer.pointer,
+ internal_object->buffer.length);
break;
@@ -194,7 +246,7 @@ acpi_ut_copy_isimple_to_esimple (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_copy_ielement_to_eelement (
u8 object_type,
union acpi_operand_object *source_object,
@@ -213,7 +265,7 @@ acpi_ut_copy_ielement_to_eelement (
this_index = state->pkg.index;
target_object = (union acpi_object *)
- &((union acpi_object *)(state->pkg.dest_object))->package.elements[this_index];
+ &((union acpi_object *)(state->pkg.dest_object))->package.elements[this_index];
switch (object_type) {
case ACPI_COPY_TYPE_SIMPLE:
@@ -236,7 +288,8 @@ acpi_ut_copy_ielement_to_eelement (
*/
target_object->type = ACPI_TYPE_PACKAGE;
target_object->package.count = source_object->package.count;
- target_object->package.elements = ACPI_CAST_PTR (union acpi_object, info->free_space);
+ target_object->package.elements =
+ ACPI_CAST_PTR (union acpi_object, info->free_space);
/*
* Pass the new package object back to the package walk routine
@@ -248,7 +301,8 @@ acpi_ut_copy_ielement_to_eelement (
* update the buffer length counter
*/
object_space = ACPI_ROUND_UP_TO_NATIVE_WORD (
- (acpi_size) target_object->package.count * sizeof (union acpi_object));
+ (acpi_size) target_object->package.count *
+ sizeof (union acpi_object));
break;
@@ -266,9 +320,9 @@ acpi_ut_copy_ielement_to_eelement (
*
* FUNCTION: acpi_ut_copy_ipackage_to_epackage
*
- * PARAMETERS: *internal_object - Pointer to the object we are returning
- * *Buffer - Where the object is returned
- * *space_used - Where the object length is returned
+ * PARAMETERS: internal_object - Pointer to the object we are returning
+ * Buffer - Where the object is returned
+ * space_used - Where the object length is returned
*
* RETURN: Status
*
@@ -304,13 +358,15 @@ acpi_ut_copy_ipackage_to_epackage (
* Free space begins right after the first package
*/
info.length = ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object));
- info.free_space = buffer + ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object));
+ info.free_space = buffer + ACPI_ROUND_UP_TO_NATIVE_WORD (
+ sizeof (union acpi_object));
info.object_space = 0;
info.num_packages = 1;
external_object->type = ACPI_GET_OBJECT_TYPE (internal_object);
external_object->package.count = internal_object->package.count;
- external_object->package.elements = ACPI_CAST_PTR (union acpi_object, info.free_space);
+ external_object->package.elements = ACPI_CAST_PTR (union acpi_object,
+ info.free_space);
/*
* Leave room for an array of ACPI_OBJECTS in the buffer
@@ -333,8 +389,8 @@ acpi_ut_copy_ipackage_to_epackage (
*
* FUNCTION: acpi_ut_copy_iobject_to_eobject
*
- * PARAMETERS: *internal_object - The internal object to be converted
- * *buffer_ptr - Where the object is returned
+ * PARAMETERS: internal_object - The internal object to be converted
+ * buffer_ptr - Where the object is returned
*
* RETURN: Status
*
@@ -367,10 +423,10 @@ acpi_ut_copy_iobject_to_eobject (
* Build a simple object (no nested objects)
*/
status = acpi_ut_copy_isimple_to_esimple (internal_object,
- (union acpi_object *) ret_buffer->pointer,
- ((u8 *) ret_buffer->pointer +
- ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object))),
- &ret_buffer->length);
+ (union acpi_object *) ret_buffer->pointer,
+ ((u8 *) ret_buffer->pointer +
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (union acpi_object))),
+ &ret_buffer->length);
/*
* build simple does not include the object size in the length
* so we add it in here
@@ -386,8 +442,8 @@ acpi_ut_copy_iobject_to_eobject (
*
* FUNCTION: acpi_ut_copy_esimple_to_isimple
*
- * PARAMETERS: *external_object - The external object to be converted
- * *internal_object - Where the internal object is returned
+ * PARAMETERS: external_object - The external object to be converted
+ * ret_internal_object - Where the internal object is returned
*
* RETURN: Status
*
@@ -398,7 +454,7 @@ acpi_ut_copy_iobject_to_eobject (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_copy_esimple_to_isimple (
union acpi_object *external_object,
union acpi_operand_object **ret_internal_object)
@@ -417,7 +473,8 @@ acpi_ut_copy_esimple_to_isimple (
case ACPI_TYPE_BUFFER:
case ACPI_TYPE_INTEGER:
- internal_object = acpi_ut_create_internal_object ((u8) external_object->type);
+ internal_object = acpi_ut_create_internal_object (
+ (u8) external_object->type);
if (!internal_object) {
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -486,7 +543,6 @@ error_exit:
#ifdef ACPI_FUTURE_IMPLEMENTATION
-
/* Code to convert packages that are parameters to control methods */
/*******************************************************************************
@@ -614,7 +670,7 @@ acpi_ut_copy_eobject_to_iobject (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_copy_simple_object (
union acpi_operand_object *source_desc,
union acpi_operand_object *dest_desc)
@@ -724,7 +780,7 @@ acpi_ut_copy_simple_object (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_copy_ielement_to_ielement (
u8 object_type,
union acpi_operand_object *source_object,
@@ -837,7 +893,7 @@ error_exit:
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_copy_ipackage_to_ipackage (
union acpi_operand_object *source_obj,
union acpi_operand_object *dest_obj,
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 985c5d045b7..794c7df3f2a 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -56,7 +56,7 @@ static char *acpi_gbl_fn_entry_str = "----Entry";
static char *acpi_gbl_fn_exit_str = "----Exit-";
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_init_stack_ptr_trace
*
@@ -64,9 +64,9 @@ static char *acpi_gbl_fn_exit_str = "----Exit-";
*
* RETURN: None
*
- * DESCRIPTION: Save the current stack pointer
+ * DESCRIPTION: Save the current CPU stack pointer at subsystem startup
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_init_stack_ptr_trace (
@@ -79,7 +79,7 @@ acpi_ut_init_stack_ptr_trace (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_track_stack_ptr
*
@@ -87,9 +87,9 @@ acpi_ut_init_stack_ptr_trace (
*
* RETURN: None
*
- * DESCRIPTION: Save the current stack pointer
+ * DESCRIPTION: Save the current CPU stack pointer
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_track_stack_ptr (
@@ -110,16 +110,16 @@ acpi_ut_track_stack_ptr (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_debug_print
*
- * PARAMETERS: debug_level - Requested debug print level
- * proc_name - Caller's procedure name
- * module_name - Caller's module name (for error output)
+ * PARAMETERS: requested_debug_level - Requested debug print level
* line_number - Caller's line number (for error output)
- * component_id - Caller's component ID (for error output)
- *
+ * dbg_info - Contains:
+ * proc_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Format - Printf format field
* ... - Optional printf arguments
*
@@ -128,7 +128,7 @@ acpi_ut_track_stack_ptr (
* DESCRIPTION: Print error message with prefix consisting of the module name,
* line number, and component ID.
*
- ****************************************************************************/
+ ******************************************************************************/
void ACPI_INTERNAL_VAR_XFACE
acpi_ut_debug_print (
@@ -157,7 +157,8 @@ acpi_ut_debug_print (
if (thread_id != acpi_gbl_prev_thread_id) {
if (ACPI_LV_THREADS & acpi_dbg_level) {
- acpi_os_printf ("\n**** Context Switch from TID %X to TID %X ****\n\n",
+ acpi_os_printf (
+ "\n**** Context Switch from TID %X to TID %X ****\n\n",
acpi_gbl_prev_thread_id, thread_id);
}
@@ -174,15 +175,16 @@ acpi_ut_debug_print (
acpi_os_printf ("[%04lX] ", thread_id);
}
- acpi_os_printf ("[%02ld] %-22.22s: ", acpi_gbl_nesting_level, dbg_info->proc_name);
+ acpi_os_printf ("[%02ld] %-22.22s: ",
+ acpi_gbl_nesting_level, dbg_info->proc_name);
va_start (args, format);
acpi_os_vprintf (format, args);
}
-EXPORT_SYMBOL(acpi_ut_debug_print);
+EXPORT_SYMBOL(acpi_ut_debug_print);
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_debug_print_raw
*
@@ -200,7 +202,7 @@ EXPORT_SYMBOL(acpi_ut_debug_print);
* DESCRIPTION: Print message with no headers. Has same interface as
* debug_print so that the same macros can be used.
*
- ****************************************************************************/
+ ******************************************************************************/
void ACPI_INTERNAL_VAR_XFACE
acpi_ut_debug_print_raw (
@@ -224,7 +226,7 @@ acpi_ut_debug_print_raw (
EXPORT_SYMBOL(acpi_ut_debug_print_raw);
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_trace
*
@@ -239,7 +241,7 @@ EXPORT_SYMBOL(acpi_ut_debug_print_raw);
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_trace (
@@ -256,7 +258,7 @@ acpi_ut_trace (
EXPORT_SYMBOL(acpi_ut_trace);
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_trace_ptr
*
@@ -272,7 +274,7 @@ EXPORT_SYMBOL(acpi_ut_trace);
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_trace_ptr (
@@ -288,7 +290,7 @@ acpi_ut_trace_ptr (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_trace_str
*
@@ -304,7 +306,7 @@ acpi_ut_trace_ptr (
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_trace_str (
@@ -321,7 +323,7 @@ acpi_ut_trace_str (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_trace_u32
*
@@ -337,7 +339,7 @@ acpi_ut_trace_str (
* DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_trace_u32 (
@@ -354,7 +356,7 @@ acpi_ut_trace_u32 (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_exit
*
@@ -369,7 +371,7 @@ acpi_ut_trace_u32 (
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_exit (
@@ -385,7 +387,7 @@ acpi_ut_exit (
EXPORT_SYMBOL(acpi_ut_exit);
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_status_exit
*
@@ -401,7 +403,7 @@ EXPORT_SYMBOL(acpi_ut_exit);
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level. Prints exit status also.
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_status_exit (
@@ -426,7 +428,7 @@ acpi_ut_status_exit (
EXPORT_SYMBOL(acpi_ut_status_exit);
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_value_exit
*
@@ -442,7 +444,7 @@ EXPORT_SYMBOL(acpi_ut_status_exit);
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level. Prints exit value also.
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_value_exit (
@@ -460,7 +462,7 @@ acpi_ut_value_exit (
EXPORT_SYMBOL(acpi_ut_value_exit);
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_ptr_exit
*
@@ -469,14 +471,14 @@ EXPORT_SYMBOL(acpi_ut_value_exit);
* proc_name - Caller's procedure name
* module_name - Caller's module name
* component_id - Caller's component ID
- * Value - Value to be printed with exit msg
+ * Ptr - Pointer to display
*
* RETURN: None
*
* DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
* set in debug_level. Prints exit value also.
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_ptr_exit (
@@ -494,7 +496,7 @@ acpi_ut_ptr_exit (
#endif
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_dump_buffer
*
@@ -507,7 +509,7 @@ acpi_ut_ptr_exit (
*
* DESCRIPTION: Generic dump buffer in both hex and ascii.
*
- ****************************************************************************/
+ ******************************************************************************/
void
acpi_ut_dump_buffer (
@@ -533,34 +535,28 @@ acpi_ut_dump_buffer (
display = DB_BYTE_DISPLAY;
}
- acpi_os_printf ("\nOffset Value\n");
+ /* Nasty little dump buffer routine! */
- /*
- * Nasty little dump buffer routine!
- */
while (i < count) {
/* Print current offset */
- acpi_os_printf ("%05X ", (u32) i);
+ acpi_os_printf ("%6.4X: ", (u32) i);
/* Print 16 hex chars */
for (j = 0; j < 16;) {
if (i + j >= count) {
- acpi_os_printf ("\n");
- return;
- }
+ /* Dump fill spaces */
- /* Make sure that the s8 doesn't get sign-extended! */
+ acpi_os_printf ("%*s", ((display * 2) + 1), " ");
+ j += display;
+ continue;
+ }
switch (display) {
- /* Default is BYTE display */
+ default: /* Default is BYTE display */
- default:
-
- acpi_os_printf ("%02X ",
- *((u8 *) &buffer[i + j]));
- j += 1;
+ acpi_os_printf ("%02X ", buffer[i + j]);
break;
@@ -568,7 +564,6 @@ acpi_ut_dump_buffer (
ACPI_MOVE_16_TO_32 (&temp32, &buffer[i + j]);
acpi_os_printf ("%04X ", temp32);
- j += 2;
break;
@@ -576,7 +571,6 @@ acpi_ut_dump_buffer (
ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j]);
acpi_os_printf ("%08X ", temp32);
- j += 4;
break;
@@ -587,15 +581,17 @@ acpi_ut_dump_buffer (
ACPI_MOVE_32_TO_32 (&temp32, &buffer[i + j + 4]);
acpi_os_printf ("%08X ", temp32);
- j += 8;
break;
}
+
+ j += display;
}
/*
* Print the ASCII equivalent characters
* But watch out for the bad unprintable ones...
*/
+ acpi_os_printf (" ");
for (j = 0; j < 16; j++) {
if (i + j >= count) {
acpi_os_printf ("\n");
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 9a52ad52a23..bc540302268 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -51,12 +51,23 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utdelete")
+/* Local prototypes */
+
+static void
+acpi_ut_delete_internal_obj (
+ union acpi_operand_object *object);
+
+static void
+acpi_ut_update_ref_count (
+ union acpi_operand_object *object,
+ u32 action);
+
/*******************************************************************************
*
* FUNCTION: acpi_ut_delete_internal_obj
*
- * PARAMETERS: *Object - Pointer to the list to be deleted
+ * PARAMETERS: Object - Object to be deleted
*
* RETURN: None
*
@@ -65,7 +76,7 @@
*
******************************************************************************/
-void
+static void
acpi_ut_delete_internal_obj (
union acpi_operand_object *object)
{
@@ -152,7 +163,8 @@ acpi_ut_delete_internal_obj (
case ACPI_TYPE_MUTEX:
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Mutex %p, Semaphore %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "***** Mutex %p, Semaphore %p\n",
object, object->mutex.semaphore));
acpi_ex_unlink_mutex (object);
@@ -162,7 +174,8 @@ acpi_ut_delete_internal_obj (
case ACPI_TYPE_EVENT:
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Event %p, Semaphore %p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "***** Event %p, Semaphore %p\n",
object, object->event.semaphore));
(void) acpi_os_delete_semaphore (object->event.semaphore);
@@ -172,7 +185,8 @@ acpi_ut_delete_internal_obj (
case ACPI_TYPE_METHOD:
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Method %p\n", object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "***** Method %p\n", object));
/* Delete the method semaphore if it exists */
@@ -185,7 +199,8 @@ acpi_ut_delete_internal_obj (
case ACPI_TYPE_REGION:
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Region %p\n", object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "***** Region %p\n", object));
second_desc = acpi_ns_get_secondary_object (object);
if (second_desc) {
@@ -212,7 +227,8 @@ acpi_ut_delete_internal_obj (
case ACPI_TYPE_BUFFER_FIELD:
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Buffer Field %p\n", object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "***** Buffer Field %p\n", object));
second_desc = acpi_ns_get_secondary_object (object);
if (second_desc) {
@@ -247,7 +263,7 @@ acpi_ut_delete_internal_obj (
*
* FUNCTION: acpi_ut_delete_internal_object_list
*
- * PARAMETERS: *obj_list - Pointer to the list to be deleted
+ * PARAMETERS: obj_list - Pointer to the list to be deleted
*
* RETURN: None
*
@@ -283,7 +299,7 @@ acpi_ut_delete_internal_object_list (
*
* FUNCTION: acpi_ut_update_ref_count
*
- * PARAMETERS: *Object - Object whose ref count is to be updated
+ * PARAMETERS: Object - Object whose ref count is to be updated
* Action - What to do
*
* RETURN: New ref count
@@ -312,7 +328,8 @@ acpi_ut_update_ref_count (
new_count = count;
/*
- * Perform the reference count action (increment, decrement, or force delete)
+ * Perform the reference count action
+ * (increment, decrement, or force delete)
*/
switch (action) {
@@ -321,7 +338,8 @@ acpi_ut_update_ref_count (
new_count++;
object->common.reference_count = new_count;
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Incremented]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Obj %p Refs=%X, [Incremented]\n",
object, new_count));
break;
@@ -329,7 +347,8 @@ acpi_ut_update_ref_count (
case REF_DECREMENT:
if (count < 1) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, can't decrement! (Set to 0)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Obj %p Refs=%X, can't decrement! (Set to 0)\n",
object, new_count));
new_count = 0;
@@ -337,12 +356,14 @@ acpi_ut_update_ref_count (
else {
new_count--;
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, [Decremented]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Obj %p Refs=%X, [Decremented]\n",
object, new_count));
}
if (ACPI_GET_OBJECT_TYPE (object) == ACPI_TYPE_METHOD) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Method Obj %p Refs=%X, [Decremented]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Method Obj %p Refs=%X, [Decremented]\n",
object, new_count));
}
@@ -356,7 +377,8 @@ acpi_ut_update_ref_count (
case REF_FORCE_DELETE:
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Obj %p Refs=%X, Force delete! (Set to 0)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Obj %p Refs=%X, Force delete! (Set to 0)\n",
object, count));
new_count = 0;
@@ -390,7 +412,7 @@ acpi_ut_update_ref_count (
*
* FUNCTION: acpi_ut_update_object_reference
*
- * PARAMETERS: *Object - Increment ref count for this object
+ * PARAMETERS: Object - Increment ref count for this object
* and all sub-objects
* Action - Either REF_INCREMENT or REF_DECREMENT or
* REF_FORCE_DELETE
@@ -431,7 +453,8 @@ acpi_ut_update_object_reference (
/* Make sure that this isn't a namespace handle */
if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p is NS handle\n", object));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Object %p is NS handle\n", object));
return_ACPI_STATUS (AE_OK);
}
@@ -614,8 +637,8 @@ error_exit:
*
* FUNCTION: acpi_ut_add_reference
*
- * PARAMETERS: *Object - Object whose reference count is to be
- * incremented
+ * PARAMETERS: Object - Object whose reference count is to be
+ * incremented
*
* RETURN: None
*
@@ -652,7 +675,7 @@ acpi_ut_add_reference (
*
* FUNCTION: acpi_ut_remove_reference
*
- * PARAMETERS: *Object - Object whose ref count will be decremented
+ * PARAMETERS: Object - Object whose ref count will be decremented
*
* RETURN: None
*
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index ead27d2c4d1..00046dd5d92 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -50,6 +50,19 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("uteval")
+/* Local prototypes */
+
+static void
+acpi_ut_copy_id_string (
+ char *destination,
+ char *source,
+ acpi_size max_length);
+
+static acpi_status
+acpi_ut_translate_one_cid (
+ union acpi_operand_object *obj_desc,
+ struct acpi_compatible_id *one_cid);
+
/*******************************************************************************
*
@@ -237,9 +250,9 @@ acpi_ut_evaluate_object (
*
* FUNCTION: acpi_ut_evaluate_numeric_object
*
- * PARAMETERS: *object_name - Object name to be evaluated
+ * PARAMETERS: object_name - Object name to be evaluated
* device_node - Node for the device
- * *Address - Where the value is returned
+ * Address - Where the value is returned
*
* RETURN: Status
*
@@ -303,7 +316,6 @@ acpi_ut_copy_id_string (
acpi_size max_length)
{
-
/*
* Workaround for ID strings that have a leading asterisk. This construct
* is not allowed by the ACPI specification (ID strings must be
@@ -325,7 +337,7 @@ acpi_ut_copy_id_string (
* FUNCTION: acpi_ut_execute_HID
*
* PARAMETERS: device_node - Node for the device
- * *Hid - Where the HID is returned
+ * Hid - Where the HID is returned
*
* RETURN: Status
*
@@ -429,7 +441,7 @@ acpi_ut_translate_one_cid (
* FUNCTION: acpi_ut_execute_CID
*
* PARAMETERS: device_node - Node for the device
- * *Cid - Where the CID is returned
+ * return_cid_list - Where the CID list is returned
*
* RETURN: Status
*
@@ -488,10 +500,10 @@ acpi_ut_execute_CID (
cid_list->size = size;
/*
- * A _CID can return either a single compatible ID or a package of compatible
- * IDs. Each compatible ID can be one of the following:
- * -- Number (32 bit compressed EISA ID) or
- * -- String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss").
+ * A _CID can return either a single compatible ID or a package of
+ * compatible IDs. Each compatible ID can be one of the following:
+ * 1) Integer (32 bit compressed EISA ID) or
+ * 2) String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss")
*/
/* The _CID object can be either a single CID or a package (list) of CIDs */
@@ -534,7 +546,7 @@ acpi_ut_execute_CID (
* FUNCTION: acpi_ut_execute_UID
*
* PARAMETERS: device_node - Node for the device
- * *Uid - Where the UID is returned
+ * Uid - Where the UID is returned
*
* RETURN: Status
*
@@ -587,7 +599,7 @@ acpi_ut_execute_UID (
* FUNCTION: acpi_ut_execute_STA
*
* PARAMETERS: device_node - Node for the device
- * *Flags - Where the status flags are returned
+ * Flags - Where the status flags are returned
*
* RETURN: Status
*
@@ -641,7 +653,7 @@ acpi_ut_execute_STA (
* FUNCTION: acpi_ut_execute_Sxds
*
* PARAMETERS: device_node - Node for the device
- * *Flags - Where the status flags are returned
+ * Flags - Where the status flags are returned
*
* RETURN: Status
*
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 25b0f8ae1bc..4146019b543 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -44,7 +44,6 @@
#define DEFINE_ACPI_GLOBALS
#include <linux/module.h>
-
#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -52,13 +51,14 @@
ACPI_MODULE_NAME ("utglobal")
-/******************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_format_exception
*
* PARAMETERS: Status - The acpi_status code to be formatted
*
- * RETURN: A string containing the exception text
+ * RETURN: A string containing the exception text. A valid pointer is
+ * always returned.
*
* DESCRIPTION: This function translates an ACPI exception into an ASCII string.
*
@@ -68,8 +68,8 @@ const char *
acpi_format_exception (
acpi_status status)
{
- const char *exception = "UNKNOWN_STATUS_CODE";
acpi_status sub_status;
+ const char *exception = NULL;
ACPI_FUNCTION_NAME ("format_exception");
@@ -82,57 +82,55 @@ acpi_format_exception (
if (sub_status <= AE_CODE_ENV_MAX) {
exception = acpi_gbl_exception_names_env [sub_status];
- break;
}
- goto unknown;
+ break;
case AE_CODE_PROGRAMMER:
if (sub_status <= AE_CODE_PGM_MAX) {
exception = acpi_gbl_exception_names_pgm [sub_status -1];
- break;
}
- goto unknown;
+ break;
case AE_CODE_ACPI_TABLES:
if (sub_status <= AE_CODE_TBL_MAX) {
exception = acpi_gbl_exception_names_tbl [sub_status -1];
- break;
}
- goto unknown;
+ break;
case AE_CODE_AML:
if (sub_status <= AE_CODE_AML_MAX) {
exception = acpi_gbl_exception_names_aml [sub_status -1];
- break;
}
- goto unknown;
+ break;
case AE_CODE_CONTROL:
if (sub_status <= AE_CODE_CTRL_MAX) {
exception = acpi_gbl_exception_names_ctrl [sub_status -1];
- break;
}
- goto unknown;
+ break;
default:
- goto unknown;
+ break;
}
+ if (!exception) {
+ /* Exception code was not recognized */
- return ((const char *) exception);
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Unknown exception code: 0x%8.8X\n", status));
-unknown:
+ return ((const char *) "UNKNOWN_STATUS_CODE");
+ }
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown exception code: 0x%8.8X\n", status));
return ((const char *) exception);
}
-/******************************************************************************
+/*******************************************************************************
*
* Static global variable initialization.
*
@@ -212,13 +210,12 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STR
};
-/******************************************************************************
+/*******************************************************************************
*
* Namespace globals
*
******************************************************************************/
-
/*
* Predefined ACPI Names (Built-in to the Interpreter)
*
@@ -241,9 +238,11 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] =
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
{"_OSI", ACPI_TYPE_METHOD, (char *) 1},
#endif
- {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */
-};
+ /* Table terminator */
+
+ {NULL, ACPI_TYPE_ANY, NULL}
+};
/*
* Properties of the ACPI Object Types, both internal and external.
@@ -288,22 +287,25 @@ const u8 acpi_gbl_ns_properties[] =
/* Hex to ASCII conversion table */
static const char acpi_gbl_hex_to_ascii[] =
- {'0','1','2','3','4','5','6','7',
- '8','9','A','B','C','D','E','F'};
+{
+ '0','1','2','3','4','5','6','7',
+ '8','9','A','B','C','D','E','F'
+};
+
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_hex_to_ascii_char
*
* PARAMETERS: Integer - Contains the hex digit
* Position - bit position of the digit within the
- * integer
+ * integer (multiple of 4)
*
- * RETURN: Ascii character
+ * RETURN: The converted Ascii character
*
- * DESCRIPTION: Convert a hex digit to an ascii character
+ * DESCRIPTION: Convert a hex digit to an Ascii character
*
- ****************************************************************************/
+ ******************************************************************************/
char
acpi_ut_hex_to_ascii_char (
@@ -315,7 +317,7 @@ acpi_ut_hex_to_ascii_char (
}
-/******************************************************************************
+/*******************************************************************************
*
* Table name globals
*
@@ -324,7 +326,7 @@ acpi_ut_hex_to_ascii_char (
* that are not used by the subsystem are simply ignored.
*
* Do NOT add any table to this list that is not consumed directly by this
- * subsystem.
+ * subsystem (No MADT, ECDT, SBST, etc.)
*
******************************************************************************/
@@ -391,7 +393,7 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVE
/* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE},
};
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_get_region_name
*
@@ -401,7 +403,7 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVE
*
* DESCRIPTION: Translate a Space ID into a name string (Debug only)
*
- ****************************************************************************/
+ ******************************************************************************/
/* Region type decoding */
@@ -429,7 +431,6 @@ acpi_ut_get_region_name (
{
return ("user_defined_region");
}
-
else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS)
{
return ("invalid_space_id");
@@ -439,7 +440,7 @@ acpi_ut_get_region_name (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_get_event_name
*
@@ -449,7 +450,7 @@ acpi_ut_get_region_name (
*
* DESCRIPTION: Translate a Event ID into a name string (Debug only)
*
- ****************************************************************************/
+ ******************************************************************************/
/* Event type decoding */
@@ -477,7 +478,7 @@ acpi_ut_get_event_name (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_get_type_name
*
@@ -487,20 +488,21 @@ acpi_ut_get_event_name (
*
* DESCRIPTION: Translate a Type ID into a name string (Debug only)
*
- ****************************************************************************/
+ ******************************************************************************/
/*
* Elements of acpi_gbl_ns_type_names below must match
* one-to-one with values of acpi_object_type
*
- * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when
- * stored in a table it really means that we have thus far seen no evidence to
- * indicate what type is actually going to be stored for this entry.
+ * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
+ * when stored in a table it really means that we have thus far seen no
+ * evidence to indicate what type is actually going to be stored for this entry.
*/
static const char acpi_gbl_bad_type[] = "UNDEFINED";
-#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */
-static const char *acpi_gbl_ns_type_names[] = /* printable names of ACPI types */
+/* Printable names of the ACPI object types */
+
+static const char *acpi_gbl_ns_type_names[] =
{
/* 00 */ "Untyped",
/* 01 */ "Integer",
@@ -564,7 +566,7 @@ acpi_ut_get_object_type_name (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_get_node_name
*
@@ -574,7 +576,7 @@ acpi_ut_get_object_type_name (
*
* DESCRIPTION: Validate the node and return the node's ACPI name.
*
- ****************************************************************************/
+ ******************************************************************************/
char *
acpi_ut_get_node_name (
@@ -618,7 +620,7 @@ acpi_ut_get_node_name (
}
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_get_descriptor_name
*
@@ -628,9 +630,11 @@ acpi_ut_get_node_name (
*
* DESCRIPTION: Validate object and return the descriptor type
*
- ****************************************************************************/
+ ******************************************************************************/
+
+/* Printable names of object descriptor types */
-static const char *acpi_gbl_desc_type_names[] = /* printable names of descriptor types */
+static const char *acpi_gbl_desc_type_names[] =
{
/* 00 */ "Invalid",
/* 01 */ "Cached",
@@ -676,17 +680,18 @@ acpi_ut_get_descriptor_name (
* Strings and procedures used for debug only
*/
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_get_mutex_name
*
- * PARAMETERS: None.
+ * PARAMETERS: mutex_id - The predefined ID for this mutex.
*
- * RETURN: Status
+ * RETURN: String containing the name of the mutex. Always returns a valid
+ * pointer.
*
* DESCRIPTION: Translate a mutex ID into a name string (Debug only)
*
- ****************************************************************************/
+ ******************************************************************************/
char *
acpi_ut_get_mutex_name (
@@ -700,21 +705,20 @@ acpi_ut_get_mutex_name (
return (acpi_gbl_mutex_names[mutex_id]);
}
-
#endif
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_valid_object_type
*
* PARAMETERS: Type - Object type to be validated
*
- * RETURN: TRUE if valid object type
+ * RETURN: TRUE if valid object type, FALSE otherwise
*
* DESCRIPTION: Validate an object type
*
- ****************************************************************************/
+ ******************************************************************************/
u8
acpi_ut_valid_object_type (
@@ -732,7 +736,7 @@ acpi_ut_valid_object_type (
}
-/****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_allocate_owner_id
*
@@ -740,7 +744,10 @@ acpi_ut_valid_object_type (
*
* DESCRIPTION: Allocate a table or method owner id
*
- ***************************************************************************/
+ * NOTE: this algorithm has a wraparound problem at 64_k method invocations, and
+ * should be revisited (TBD)
+ *
+ ******************************************************************************/
acpi_owner_id
acpi_ut_allocate_owner_id (
@@ -796,16 +803,18 @@ acpi_ut_allocate_owner_id (
}
-/****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_ut_init_globals
*
- * PARAMETERS: none
+ * PARAMETERS: None
+ *
+ * RETURN: None
*
* DESCRIPTION: Init library globals. All globals that require specific
* initialization should be initialized here!
*
- ***************************************************************************/
+ ******************************************************************************/
void
acpi_ut_init_globals (
diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
index bdbadaf48d2..7f3713889ff 100644
--- a/drivers/acpi/utilities/utinit.c
+++ b/drivers/acpi/utilities/utinit.c
@@ -49,19 +49,29 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utinit")
+/* Local prototypes */
+
+static void
+acpi_ut_fadt_register_error (
+ char *register_name,
+ u32 value,
+ acpi_size offset);
+
+static void acpi_ut_terminate (
+ void);
+
/*******************************************************************************
*
* FUNCTION: acpi_ut_fadt_register_error
*
- * PARAMETERS: *register_name - Pointer to string identifying register
+ * PARAMETERS: register_name - Pointer to string identifying register
* Value - Actual register contents value
- * acpi_test_spec_section - TDS section containing assertion
- * acpi_assertion - Assertion number being tested
+ * Offset - Byte offset in the FADT
*
* RETURN: AE_BAD_VALUE
*
- * DESCRIPTION: Display failure message and link failure to TDS assertion
+ * DESCRIPTION: Display failure message
*
******************************************************************************/
@@ -166,12 +176,13 @@ acpi_ut_validate_fadt (
*
* RETURN: none
*
- * DESCRIPTION: free global memory
+ * DESCRIPTION: Free global memory
*
******************************************************************************/
-void
-acpi_ut_terminate (void)
+static void
+acpi_ut_terminate (
+ void)
{
struct acpi_gpe_block_info *gpe_block;
struct acpi_gpe_block_info *next_gpe_block;
@@ -183,8 +194,6 @@ acpi_ut_terminate (void)
/* Free global tables, etc. */
-
-
/* Free global GPE blocks and related info structures */
gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
@@ -221,7 +230,8 @@ acpi_ut_terminate (void)
******************************************************************************/
void
-acpi_ut_subsystem_shutdown (void)
+acpi_ut_subsystem_shutdown (
+ void)
{
ACPI_FUNCTION_TRACE ("ut_subsystem_shutdown");
@@ -229,14 +239,16 @@ acpi_ut_subsystem_shutdown (void)
/* Just exit if subsystem is already shutdown */
if (acpi_gbl_shutdown) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "ACPI Subsystem is already terminated\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "ACPI Subsystem is already terminated\n"));
return_VOID;
}
/* Subsystem appears active, go ahead and shut it down */
acpi_gbl_shutdown = TRUE;
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem...\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Shutting down ACPI Subsystem...\n"));
/* Close the acpi_event Handling */
diff --git a/drivers/acpi/utilities/utmath.c b/drivers/acpi/utilities/utmath.c
index 2525c1a9354..0d527c91543 100644
--- a/drivers/acpi/utilities/utmath.c
+++ b/drivers/acpi/utilities/utmath.c
@@ -259,6 +259,8 @@ acpi_ut_divide (
*
* FUNCTION: acpi_ut_short_divide, acpi_ut_divide
*
+ * PARAMETERS: See function headers above
+ *
* DESCRIPTION: Native versions of the ut_divide functions. Use these if either
* 1) The target is a 64-bit platform and therefore 64-bit
* integer math is supported directly by the machine.
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index f6598547389..f6de4ed3d52 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -49,12 +49,57 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utmisc")
+/* Local prototypes */
+
+static acpi_status
+acpi_ut_create_mutex (
+ acpi_mutex_handle mutex_id);
+
+static acpi_status
+acpi_ut_delete_mutex (
+ acpi_mutex_handle mutex_id);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ut_strupr (strupr)
+ *
+ * PARAMETERS: src_string - The source string to convert
+ *
+ * RETURN: Converted src_string (same as input pointer)
+ *
+ * DESCRIPTION: Convert string to uppercase
+ *
+ * NOTE: This is not a POSIX function, so it appears here, not in utclib.c
+ *
+ ******************************************************************************/
+
+char *
+acpi_ut_strupr (
+ char *src_string)
+{
+ char *string;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Walk entire string, uppercasing the letters */
+
+ for (string = src_string; *string; string++) {
+ *string = (char) ACPI_TOUPPER (*string);
+ }
+
+ return (src_string);
+}
+
/*******************************************************************************
*
* FUNCTION: acpi_ut_print_string
*
* PARAMETERS: String - Null terminated ASCII string
+ * max_length - Maximum output length
*
* RETURN: None
*
@@ -148,6 +193,8 @@ acpi_ut_print_string (
*
* PARAMETERS: Value - Value to be converted
*
+ * RETURN: u32 integer with bytes swapped
+ *
* DESCRIPTION: Convert a 32-bit value to big-endian (swap the bytes)
*
******************************************************************************/
@@ -160,7 +207,6 @@ acpi_ut_dword_byte_swap (
u32 value;
u8 bytes[4];
} out;
-
union {
u32 value;
u8 bytes[4];
@@ -219,7 +265,8 @@ acpi_ut_set_integer_width (
*
* FUNCTION: acpi_ut_display_init_pathname
*
- * PARAMETERS: obj_handle - Handle whose pathname will be displayed
+ * PARAMETERS: Type - Object type of the node
+ * obj_handle - Handle whose pathname will be displayed
* Path - Additional path string to be appended.
* (NULL if no extra path)
*
@@ -270,7 +317,8 @@ acpi_ut_display_init_pathname (
/* Print the object type and pathname */
- acpi_os_printf ("%-12s %s", acpi_ut_get_type_name (type), (char *) buffer.pointer);
+ acpi_os_printf ("%-12s %s",
+ acpi_ut_get_type_name (type), (char *) buffer.pointer);
/* Extra path is used to append names like _STA, _INI, etc. */
@@ -288,9 +336,9 @@ acpi_ut_display_init_pathname (
*
* FUNCTION: acpi_ut_valid_acpi_name
*
- * PARAMETERS: Character - The character to be examined
+ * PARAMETERS: Name - The name to be examined
*
- * RETURN: 1 if Character may appear in a name, else 0
+ * RETURN: TRUE if the name is valid, FALSE otherwise
*
* DESCRIPTION: Check for a valid ACPI name. Each character must be one of:
* 1) Upper case alpha
@@ -495,40 +543,6 @@ error_exit:
/*******************************************************************************
*
- * FUNCTION: acpi_ut_strupr
- *
- * PARAMETERS: src_string - The source string to convert to
- *
- * RETURN: src_string
- *
- * DESCRIPTION: Convert string to uppercase
- *
- ******************************************************************************/
-#ifdef ACPI_FUTURE_USAGE
-char *
-acpi_ut_strupr (
- char *src_string)
-{
- char *string;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /* Walk entire string, uppercasing the letters */
-
- for (string = src_string; *string; ) {
- *string = (char) ACPI_TOUPPER (*string);
- string++;
- }
-
- return (src_string);
-}
-#endif /* ACPI_FUTURE_USAGE */
-
-
-/*******************************************************************************
- *
* FUNCTION: acpi_ut_mutex_initialize
*
* PARAMETERS: None.
@@ -611,7 +625,7 @@ acpi_ut_mutex_terminate (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_create_mutex (
acpi_mutex_handle mutex_id)
{
@@ -648,7 +662,7 @@ acpi_ut_create_mutex (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_delete_mutex (
acpi_mutex_handle mutex_id)
{
@@ -715,16 +729,16 @@ acpi_ut_acquire_mutex (
if (acpi_gbl_mutex_info[i].owner_id == this_thread_id) {
if (i == mutex_id) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Mutex [%s] already acquired by this thread [%X]\n",
- acpi_ut_get_mutex_name (mutex_id), this_thread_id));
+ "Mutex [%s] already acquired by this thread [%X]\n",
+ acpi_ut_get_mutex_name (mutex_id), this_thread_id));
return (AE_ALREADY_ACQUIRED);
}
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Invalid acquire order: Thread %X owns [%s], wants [%s]\n",
- this_thread_id, acpi_ut_get_mutex_name (i),
- acpi_ut_get_mutex_name (mutex_id)));
+ "Invalid acquire order: Thread %X owns [%s], wants [%s]\n",
+ this_thread_id, acpi_ut_get_mutex_name (i),
+ acpi_ut_get_mutex_name (mutex_id)));
return (AE_ACQUIRE_DEADLOCK);
}
@@ -733,22 +747,23 @@ acpi_ut_acquire_mutex (
#endif
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
- "Thread %X attempting to acquire Mutex [%s]\n",
- this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
+ "Thread %X attempting to acquire Mutex [%s]\n",
+ this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
status = acpi_os_wait_semaphore (acpi_gbl_mutex_info[mutex_id].mutex,
1, ACPI_WAIT_FOREVER);
if (ACPI_SUCCESS (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X acquired Mutex [%s]\n",
- this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
+ this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
acpi_gbl_mutex_info[mutex_id].use_count++;
acpi_gbl_mutex_info[mutex_id].owner_id = this_thread_id;
}
else {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not acquire Mutex [%s] %s\n",
- this_thread_id, acpi_ut_get_mutex_name (mutex_id),
- acpi_format_exception (status)));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Thread %X could not acquire Mutex [%s] %s\n",
+ this_thread_id, acpi_ut_get_mutex_name (mutex_id),
+ acpi_format_exception (status)));
}
return (status);
@@ -793,8 +808,8 @@ acpi_ut_release_mutex (
*/
if (acpi_gbl_mutex_info[mutex_id].owner_id == ACPI_MUTEX_NOT_ACQUIRED) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Mutex [%s] is not acquired, cannot release\n",
- acpi_ut_get_mutex_name (mutex_id)));
+ "Mutex [%s] is not acquired, cannot release\n",
+ acpi_ut_get_mutex_name (mutex_id)));
return (AE_NOT_ACQUIRED);
}
@@ -812,8 +827,8 @@ acpi_ut_release_mutex (
}
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Invalid release order: owns [%s], releasing [%s]\n",
- acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id)));
+ "Invalid release order: owns [%s], releasing [%s]\n",
+ acpi_ut_get_mutex_name (i), acpi_ut_get_mutex_name (mutex_id)));
return (AE_RELEASE_DEADLOCK);
}
@@ -826,13 +841,14 @@ acpi_ut_release_mutex (
status = acpi_os_signal_semaphore (acpi_gbl_mutex_info[mutex_id].mutex, 1);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not release Mutex [%s] %s\n",
- this_thread_id, acpi_ut_get_mutex_name (mutex_id),
- acpi_format_exception (status)));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Thread %X could not release Mutex [%s] %s\n",
+ this_thread_id, acpi_ut_get_mutex_name (mutex_id),
+ acpi_format_exception (status)));
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %X released Mutex [%s]\n",
- this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
+ this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
}
return (status);
@@ -843,11 +859,11 @@ acpi_ut_release_mutex (
*
* FUNCTION: acpi_ut_create_update_state_and_push
*
- * PARAMETERS: *Object - Object to be added to the new state
+ * PARAMETERS: Object - Object to be added to the new state
* Action - Increment/Decrement
* state_list - List the state will be added to
*
- * RETURN: None
+ * RETURN: Status
*
* DESCRIPTION: Create a new state and push it
*
@@ -885,15 +901,16 @@ acpi_ut_create_update_state_and_push (
*
* FUNCTION: acpi_ut_create_pkg_state_and_push
*
- * PARAMETERS: *Object - Object to be added to the new state
+ * PARAMETERS: Object - Object to be added to the new state
* Action - Increment/Decrement
* state_list - List the state will be added to
*
- * RETURN: None
+ * RETURN: Status
*
* DESCRIPTION: Create a new state and push it
*
******************************************************************************/
+
#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ut_create_pkg_state_and_push (
@@ -925,7 +942,7 @@ acpi_ut_create_pkg_state_and_push (
* PARAMETERS: list_head - Head of the state stack
* State - State object to push
*
- * RETURN: Status
+ * RETURN: None
*
* DESCRIPTION: Push a state object onto a state stack
*
@@ -954,7 +971,7 @@ acpi_ut_push_generic_state (
*
* PARAMETERS: list_head - Head of the state stack
*
- * RETURN: Status
+ * RETURN: The popped state object
*
* DESCRIPTION: Pop a state object from a state stack
*
@@ -989,7 +1006,7 @@ acpi_ut_pop_generic_state (
*
* PARAMETERS: None
*
- * RETURN: Status
+ * RETURN: The new state object. NULL on failure.
*
* DESCRIPTION: Create a generic state object. Attempt to obtain one from
* the global state cache; If none available, create a new one.
@@ -997,7 +1014,8 @@ acpi_ut_pop_generic_state (
******************************************************************************/
union acpi_generic_state *
-acpi_ut_create_generic_state (void)
+acpi_ut_create_generic_state (
+ void)
{
union acpi_generic_state *state;
@@ -1023,7 +1041,7 @@ acpi_ut_create_generic_state (void)
*
* PARAMETERS: None
*
- * RETURN: Thread State
+ * RETURN: New Thread State. NULL on failure
*
* DESCRIPTION: Create a "Thread State" - a flavor of the generic state used
* to track per-thread info during method execution
@@ -1060,11 +1078,10 @@ acpi_ut_create_thread_state (
*
* FUNCTION: acpi_ut_create_update_state
*
- * PARAMETERS: Object - Initial Object to be installed in the
- * state
- * Action - Update action to be performed
+ * PARAMETERS: Object - Initial Object to be installed in the state
+ * Action - Update action to be performed
*
- * RETURN: Status
+ * RETURN: New state object, null on failure
*
* DESCRIPTION: Create an "Update State" - a flavor of the generic state used
* to update reference counts and delete complex objects such
@@ -1104,11 +1121,10 @@ acpi_ut_create_update_state (
*
* FUNCTION: acpi_ut_create_pkg_state
*
- * PARAMETERS: Object - Initial Object to be installed in the
- * state
- * Action - Update action to be performed
+ * PARAMETERS: Object - Initial Object to be installed in the state
+ * Action - Update action to be performed
*
- * RETURN: Status
+ * RETURN: New state object, null on failure
*
* DESCRIPTION: Create a "Package State"
*
@@ -1151,7 +1167,7 @@ acpi_ut_create_pkg_state (
*
* PARAMETERS: None
*
- * RETURN: Status
+ * RETURN: New state object, null on failure
*
* DESCRIPTION: Create a "Control State" - a flavor of the generic state used
* to support nested IF/WHILE constructs in the AML.
@@ -1190,7 +1206,7 @@ acpi_ut_create_control_state (
*
* PARAMETERS: State - The state object to be deleted
*
- * RETURN: Status
+ * RETURN: None
*
* DESCRIPTION: Put a state object back into the global state cache. The object
* is not actually freed at this time.
@@ -1216,7 +1232,7 @@ acpi_ut_delete_generic_state (
*
* PARAMETERS: None
*
- * RETURN: Status
+ * RETURN: None
*
* DESCRIPTION: Purge the global state object cache. Used during subsystem
* termination.
@@ -1240,7 +1256,10 @@ acpi_ut_delete_generic_state_cache (
*
* FUNCTION: acpi_ut_walk_package_tree
*
- * PARAMETERS: obj_desc - The Package object on which to resolve refs
+ * PARAMETERS: source_object - The package to walk
+ * target_object - Target object (if package is being copied)
+ * walk_callback - Called once for each package element
+ * Context - Passed to the callback function
*
* RETURN: Status
*
@@ -1359,7 +1378,7 @@ acpi_ut_walk_package_tree (
* PARAMETERS: Buffer - Buffer to be scanned
* Length - number of bytes to examine
*
- * RETURN: checksum
+ * RETURN: The generated checksum
*
* DESCRIPTION: Generate a checksum on a raw buffer
*
@@ -1442,7 +1461,6 @@ acpi_ut_get_resource_end_tag (
* PARAMETERS: module_name - Caller's module name (for error output)
* line_number - Caller's line number (for error output)
* component_id - Caller's component ID (for error output)
- * Message - Error message to use on failure
*
* RETURN: None
*
@@ -1457,7 +1475,6 @@ acpi_ut_report_error (
u32 component_id)
{
-
acpi_os_printf ("%8s-%04d: *** Error: ", module_name, line_number);
}
@@ -1469,7 +1486,6 @@ acpi_ut_report_error (
* PARAMETERS: module_name - Caller's module name (for error output)
* line_number - Caller's line number (for error output)
* component_id - Caller's component ID (for error output)
- * Message - Error message to use on failure
*
* RETURN: None
*
@@ -1495,7 +1511,6 @@ acpi_ut_report_warning (
* PARAMETERS: module_name - Caller's module name (for error output)
* line_number - Caller's line number (for error output)
* component_id - Caller's component ID (for error output)
- * Message - Error message to use on failure
*
* RETURN: None
*
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 9ee40a484e0..cd3899b9cc5 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -50,6 +50,25 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utobject")
+/* Local prototypes */
+
+static acpi_status
+acpi_ut_get_simple_object_size (
+ union acpi_operand_object *obj,
+ acpi_size *obj_length);
+
+static acpi_status
+acpi_ut_get_package_object_size (
+ union acpi_operand_object *obj,
+ acpi_size *obj_length);
+
+static acpi_status
+acpi_ut_get_element_length (
+ u8 object_type,
+ union acpi_operand_object *source_object,
+ union acpi_generic_state *state,
+ void *context);
+
/*******************************************************************************
*
@@ -60,7 +79,7 @@
* component_id - Component type of caller
* Type - ACPI Type of the new object
*
- * RETURN: Object - The new object. Null on failure
+ * RETURN: A new internal object, null on failure
*
* DESCRIPTION: Create and initialize a new internal object.
*
@@ -83,7 +102,8 @@ acpi_ut_create_internal_object_dbg (
union acpi_operand_object *second_object;
- ACPI_FUNCTION_TRACE_STR ("ut_create_internal_object_dbg", acpi_ut_get_type_name (type));
+ ACPI_FUNCTION_TRACE_STR ("ut_create_internal_object_dbg",
+ acpi_ut_get_type_name (type));
/* Allocate the raw object descriptor */
@@ -99,7 +119,8 @@ acpi_ut_create_internal_object_dbg (
/* These types require a secondary object */
- second_object = acpi_ut_allocate_object_desc_dbg (module_name, line_number, component_id);
+ second_object = acpi_ut_allocate_object_desc_dbg (module_name,
+ line_number, component_id);
if (!second_object) {
acpi_ut_delete_object_desc (object);
return_PTR (NULL);
@@ -138,7 +159,7 @@ acpi_ut_create_internal_object_dbg (
*
* PARAMETERS: buffer_size - Size of buffer to be created
*
- * RETURN: Pointer to a new Buffer object
+ * RETURN: Pointer to a new Buffer object, null on failure
*
* DESCRIPTION: Create a fully initialized buffer object
*
@@ -192,9 +213,9 @@ acpi_ut_create_buffer_object (
*
* FUNCTION: acpi_ut_create_string_object
*
- * PARAMETERS: string_size - Size of string to be created. Does not
- * include NULL terminator, this is added
- * automatically.
+ * PARAMETERS: string_size - Size of string to be created. Does not
+ * include NULL terminator, this is added
+ * automatically.
*
* RETURN: Pointer to a new String object
*
@@ -249,7 +270,9 @@ acpi_ut_create_string_object (
*
* PARAMETERS: Object - Object to be validated
*
- * RETURN: Validate a pointer to be an union acpi_operand_object
+ * RETURN: TRUE if object is valid, FALSE otherwise
+ *
+ * DESCRIPTION: Validate a pointer to be an union acpi_operand_object
*
******************************************************************************/
@@ -399,8 +422,8 @@ acpi_ut_delete_object_cache (
*
* FUNCTION: acpi_ut_get_simple_object_size
*
- * PARAMETERS: *internal_object - Pointer to the object we are examining
- * *obj_length - Where the length is returned
+ * PARAMETERS: internal_object - An ACPI operand object
+ * obj_length - Where the length is returned
*
* RETURN: Status
*
@@ -412,7 +435,7 @@ acpi_ut_delete_object_cache (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_get_simple_object_size (
union acpi_operand_object *internal_object,
acpi_size *obj_length)
@@ -424,8 +447,10 @@ acpi_ut_get_simple_object_size (
ACPI_FUNCTION_TRACE_PTR ("ut_get_simple_object_size", internal_object);
- /* Handle a null object (Could be a uninitialized package element -- which is legal) */
-
+ /*
+ * Handle a null object (Could be a uninitialized package
+ * element -- which is legal)
+ */
if (!internal_object) {
*obj_length = 0;
return_ACPI_STATUS (AE_OK);
@@ -480,7 +505,8 @@ acpi_ut_get_simple_object_size (
* Get the actual length of the full pathname to this object.
* The reference will be converted to the pathname to the object
*/
- length += ACPI_ROUND_UP_TO_NATIVE_WORD (acpi_ns_get_pathname_length (internal_object->reference.node));
+ length += ACPI_ROUND_UP_TO_NATIVE_WORD (
+ acpi_ns_get_pathname_length (internal_object->reference.node));
break;
default:
@@ -530,7 +556,7 @@ acpi_ut_get_simple_object_size (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_get_element_length (
u8 object_type,
union acpi_operand_object *source_object,
@@ -582,8 +608,8 @@ acpi_ut_get_element_length (
*
* FUNCTION: acpi_ut_get_package_object_size
*
- * PARAMETERS: *internal_object - Pointer to the object we are examining
- * *obj_length - Where the length is returned
+ * PARAMETERS: internal_object - An ACPI internal object
+ * obj_length - Where the length is returned
*
* RETURN: Status
*
@@ -595,7 +621,7 @@ acpi_ut_get_element_length (
*
******************************************************************************/
-acpi_status
+static acpi_status
acpi_ut_get_package_object_size (
union acpi_operand_object *internal_object,
acpi_size *obj_length)
@@ -636,8 +662,8 @@ acpi_ut_get_package_object_size (
*
* FUNCTION: acpi_ut_get_object_size
*
- * PARAMETERS: *internal_object - Pointer to the object we are examining
- * *obj_length - Where the length will be returned
+ * PARAMETERS: internal_object - An ACPI internal object
+ * obj_length - Where the length will be returned
*
* RETURN: Status
*
@@ -647,7 +673,7 @@ acpi_ut_get_package_object_size (
******************************************************************************/
acpi_status
-acpi_ut_get_object_size(
+acpi_ut_get_object_size (
union acpi_operand_object *internal_object,
acpi_size *obj_length)
{
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index 97a91f3f06f..e8803d81065 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -73,6 +73,7 @@ acpi_initialize_subsystem (
{
acpi_status status;
+
ACPI_FUNCTION_TRACE ("acpi_initialize_subsystem");
@@ -105,7 +106,6 @@ acpi_initialize_subsystem (
* Initialize the namespace manager and
* the root of the namespace tree
*/
-
status = acpi_ns_root_initialize ();
if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Namespace initialization failure, %s\n",
@@ -113,7 +113,6 @@ acpi_initialize_subsystem (
return_ACPI_STATUS (status);
}
-
/* If configured, initialize the AML debugger */
ACPI_DEBUGGER_EXEC (status = acpi_db_initialize ());
@@ -150,7 +149,8 @@ acpi_enable_subsystem (
* The values from the FADT are validated here.
*/
if (!(flags & ACPI_NO_HARDWARE_INIT)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI hardware\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Initializing ACPI hardware\n"));
status = acpi_hw_initialize ();
if (ACPI_FAILURE (status)) {
@@ -178,7 +178,8 @@ acpi_enable_subsystem (
* install_address_space_handler interface.
*/
if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing default address space handlers\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Installing default address space handlers\n"));
status = acpi_ev_install_region_handlers ();
if (ACPI_FAILURE (status)) {
@@ -189,12 +190,14 @@ acpi_enable_subsystem (
/*
* Initialize ACPI Event handling (Fixed and General Purpose)
*
- * NOTE: We must have the hardware AND events initialized before we can execute
- * ANY control methods SAFELY. Any control method can require ACPI hardware
- * support, so the hardware MUST be initialized before execution!
+ * NOTE: We must have the hardware AND events initialized before we can
+ * execute ANY control methods SAFELY. Any control method can require
+ * ACPI hardware support, so the hardware MUST be initialized before
+ * execution!
*/
if (!(flags & ACPI_NO_EVENT_INIT)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI events\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Initializing ACPI events\n"));
status = acpi_ev_initialize_events ();
if (ACPI_FAILURE (status)) {
@@ -205,7 +208,8 @@ acpi_enable_subsystem (
/* Install the SCI handler and Global Lock handler */
if (!(flags & ACPI_NO_HANDLER_INIT)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Installing SCI/GL handlers\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Installing SCI/GL handlers\n"));
status = acpi_ev_install_xrupt_handlers ();
if (ACPI_FAILURE (status)) {
@@ -247,7 +251,8 @@ acpi_initialize_objects (
* contain executable AML (see call to acpi_ns_initialize_objects below).
*/
if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Executing _REG op_region methods\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Executing _REG op_region methods\n"));
status = acpi_ev_initialize_op_regions ();
if (ACPI_FAILURE (status)) {
@@ -261,7 +266,8 @@ acpi_initialize_objects (
* objects: operation_regions, buffer_fields, Buffers, and Packages.
*/
if (!(flags & ACPI_NO_OBJECT_INIT)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Completing Initialization of ACPI Objects\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Completing Initialization of ACPI Objects\n"));
status = acpi_ns_initialize_objects ();
if (ACPI_FAILURE (status)) {
@@ -274,7 +280,8 @@ acpi_initialize_objects (
* This runs the _STA and _INI methods.
*/
if (!(flags & ACPI_NO_DEVICE_INIT)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Devices\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "[Init] Initializing ACPI Devices\n"));
status = acpi_ns_initialize_devices ();
if (ACPI_FAILURE (status)) {
@@ -307,7 +314,8 @@ acpi_initialize_objects (
******************************************************************************/
acpi_status
-acpi_terminate (void)
+acpi_terminate (
+ void)
{
acpi_status status;
@@ -344,8 +352,7 @@ acpi_terminate (void)
#ifdef ACPI_FUTURE_USAGE
-
-/*****************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_subsystem_status
*
@@ -354,14 +361,16 @@ acpi_terminate (void)
* RETURN: Status of the ACPI subsystem
*
* DESCRIPTION: Other drivers that use the ACPI subsystem should call this
- * before making any other calls, to ensure the subsystem initial-
- * ized successfully.
+ * before making any other calls, to ensure the subsystem
+ * initialized successfully.
*
- ****************************************************************************/
+ ******************************************************************************/
acpi_status
-acpi_subsystem_status (void)
+acpi_subsystem_status (
+ void)
{
+
if (acpi_gbl_startup_flags & ACPI_INITIALIZED_OK) {
return (AE_OK);
}
@@ -371,13 +380,12 @@ acpi_subsystem_status (void)
}
-/******************************************************************************
+/*******************************************************************************
*
* FUNCTION: acpi_get_system_info
*
- * PARAMETERS: out_buffer - a pointer to a buffer to receive the
- * resources for the device
- * buffer_length - the number of bytes available in the buffer
+ * PARAMETERS: out_buffer - A buffer to receive the resources for the
+ * device
*
* RETURN: Status - the status of the call
*
@@ -395,8 +403,8 @@ acpi_get_system_info (
struct acpi_buffer *out_buffer)
{
struct acpi_system_info *info_ptr;
- u32 i;
acpi_status status;
+ u32 i;
ACPI_FUNCTION_TRACE ("acpi_get_system_info");
@@ -466,6 +474,7 @@ EXPORT_SYMBOL(acpi_get_system_info);
* FUNCTION: acpi_install_initialization_handler
*
* PARAMETERS: Handler - Callback procedure
+ * Function - Not (currently) used, see below
*
* RETURN: Status
*
@@ -495,7 +504,6 @@ acpi_install_initialization_handler (
#endif /* ACPI_FUTURE_USAGE */
-
/*****************************************************************************
*
* FUNCTION: acpi_purge_cached_objects
@@ -509,7 +517,8 @@ acpi_install_initialization_handler (
****************************************************************************/
acpi_status
-acpi_purge_cached_objects (void)
+acpi_purge_cached_objects (
+ void)
{
ACPI_FUNCTION_TRACE ("acpi_purge_cached_objects");