* was just loaded
*/
if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
- info->table_desc->table_id) {
+ info->table_desc->owner_id) {
return (AE_OK);
}
*/
acpi_ns_delete_namespace_subtree (obj_handle);
acpi_ns_delete_namespace_by_owner (
- ((struct acpi_namespace_node *) obj_handle)->object->method.owning_id);
+ ((struct acpi_namespace_node *) obj_handle)->object->method.owner_id);
break;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
"\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
- table_desc->pointer->signature, table_desc->table_id, info.object_count,
+ table_desc->pointer->signature, table_desc->owner_id, info.object_count,
info.device_count, info.method_count, info.op_region_count));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
union acpi_operand_object *obj_desc;
union acpi_parse_object *op;
struct acpi_namespace_node *node;
- acpi_owner_id owner_id;
struct acpi_walk_state *walk_state;
* objects (such as Operation Regions) can be created during the
* first pass parse.
*/
- owner_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
- obj_desc->method.owning_id = owner_id;
+ status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
+ if (ACPI_FAILURE (status)) {
+ goto cleanup;
+ }
/* Create and initialize a new walk state */
- walk_state = acpi_ds_create_walk_state (owner_id, NULL, NULL, NULL);
+ walk_state = acpi_ds_create_walk_state (
+ obj_desc->method.owner_id, NULL, NULL, NULL);
if (!walk_state) {
status = AE_NO_MEMORY;
- goto cleanup;
+ goto cleanup2;
}
status = acpi_ds_init_aml_walk (walk_state, op, node,
obj_desc->method.aml_length, NULL, 1);
if (ACPI_FAILURE (status)) {
acpi_ds_delete_walk_state (walk_state);
- goto cleanup;
+ goto cleanup2;
}
/*
*/
status = acpi_ps_parse_aml (walk_state);
if (ACPI_FAILURE (status)) {
- goto cleanup;
+ goto cleanup2;
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
acpi_ut_get_node_name (obj_handle), obj_handle, op));
+cleanup2:
+ (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
+
cleanup:
acpi_ps_delete_parse_tree (op);
return_ACPI_STATUS (status);
{
acpi_status status;
struct acpi_namespace_node *method_node;
- struct acpi_walk_state *next_walk_state;
+ struct acpi_walk_state *next_walk_state = NULL;
union acpi_operand_object *obj_desc;
struct acpi_parameter_info info;
u32 i;
return_ACPI_STATUS (AE_NULL_OBJECT);
}
- obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
+ status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
/* Init for new method, wait on concurrency semaphore */
status = acpi_ds_begin_method_execution (method_node, obj_desc,
this_walk_state->method_node);
if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
+ goto cleanup;
}
if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) {
/* 1) Parse: Create a new walk state for the preempting walk */
- next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
+ next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
op, obj_desc, NULL);
if (!next_walk_state) {
return_ACPI_STATUS (AE_NO_MEMORY);
/* 2) Execute: Create a new state for the preempting walk */
- next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
+ next_walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
NULL, obj_desc, thread);
if (!next_walk_state) {
status = AE_NO_MEMORY;
/* On error, we must delete the new walk state */
cleanup:
+ (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
if (next_walk_state && (next_walk_state->method_desc)) {
/* Decrement the thread count on the method parse tree */
* Delete any namespace entries created anywhere else within
* the namespace
*/
- acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owning_id);
+ acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
* Delete the entire namespace under this table Node
* (Offset contains the table_id)
*/
- acpi_ns_delete_namespace_by_owner (table_info->table_id);
+ acpi_ns_delete_namespace_by_owner (table_info->owner_id);
/* Delete the table itself */
acpi_ex_out_integer ("param_count", obj_desc->method.param_count);
acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency);
acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore);
- acpi_ex_out_integer ("owning_id", obj_desc->method.owning_id);
+ acpi_ex_out_integer ("owner_id", obj_desc->method.owner_id);
acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length);
acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start);
break;
*/
return_desc = acpi_ns_get_attached_object (
(struct acpi_namespace_node *) operand[0]);
+ acpi_ut_add_reference (return_desc);
}
else {
/*
* add another reference to the referenced object, however.
*/
return_desc = *(operand[0]->reference.where);
- if (!return_desc) {
- /*
- * We can't return a NULL dereferenced value. This is
- * an uninitialized package element and is thus a
- * severe error.
- */
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "NULL package element obj %p\n",
- operand[0]));
- status = AE_AML_UNINITIALIZED_ELEMENT;
- goto cleanup;
+ if (return_desc) {
+ acpi_ut_add_reference (return_desc);
}
- acpi_ut_add_reference (return_desc);
break;
return_ACPI_STATUS (status);
}
+
+ if (obj_desc != *stack_ptr) {
+ acpi_ut_remove_reference (obj_desc);
+ }
goto next_operand;
return_ACPI_STATUS (status);
}
+
+ if (obj_desc != *stack_ptr) {
+ acpi_ut_remove_reference (obj_desc);
+ }
goto next_operand;
return_ACPI_STATUS (status);
}
+
+ if (obj_desc != *stack_ptr) {
+ acpi_ut_remove_reference (obj_desc);
+ }
goto next_operand;
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
+
+ if (obj_desc != *stack_ptr) {
+ acpi_ut_remove_reference (obj_desc);
+ }
break;
default:
/*
* i_aSL Compiler cheats by putting parameter count
- * in the owner_iD
+ * in the owner_iD (param_count max is 7)
*/
new_node->owner_id = obj_desc->method.param_count;
#else
struct acpi_namespace_node *node, /* New Child*/
acpi_object_type type)
{
- u16 owner_id = 0;
+ acpi_owner_id owner_id = 0;
struct acpi_namespace_node *child_node;
#ifdef ACPI_ALPHABETIC_NAMESPACE
void
acpi_ns_delete_namespace_by_owner (
- u16 owner_id)
+ acpi_owner_id owner_id)
{
struct acpi_namespace_node *child_node;
struct acpi_namespace_node *deletion_node;
}
}
+ (void) acpi_ut_release_owner_id (owner_id);
return_VOID;
}
/* Check if the owner matches */
- if ((info->owner_id != ACPI_UINT32_MAX) &&
+ if ((info->owner_id != ACPI_OWNER_ID_MAX) &&
(info->owner_id != this_node->owner_id)) {
return (AE_OK);
}
acpi_object_type type,
u8 display_type,
u32 max_depth,
- u32 owner_id,
+ acpi_owner_id owner_id,
acpi_handle start_handle)
{
struct acpi_walk_info info;
info.debug_level = debug_level;
- info.owner_id = ACPI_UINT32_MAX;
+ info.owner_id = ACPI_OWNER_ID_MAX;
info.display_type = ACPI_DISPLAY_SUMMARY;
(void) acpi_ns_dump_one_object (handle, 1, &info, NULL);
}
acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth,
- ACPI_UINT32_MAX, search_handle);
+ ACPI_OWNER_ID_MAX, search_handle);
return_VOID;
}
#endif /* _ACPI_ASL_COMPILER */
/* Create and initialize a new walk state */
- walk_state = acpi_ds_create_walk_state (table_desc->table_id,
+ walk_state = acpi_ds_create_walk_state (table_desc->owner_id,
NULL, NULL, NULL);
if (!walk_state) {
acpi_ps_free_op (parse_root);
INCREMENT_ARG_LIST (walk_state->arg_types);
}
+
/* Special processing for certain opcodes */
- if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
+ /* TBD (remove): Temporary mechanism to disable this code if needed */
+
+#ifndef ACPI_NO_MODULE_LEVEL_CODE
+
+ if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
/*
* We want to skip If/Else/While constructs during Pass1
break;
}
}
-
+#endif
switch (op->common.aml_opcode) {
case AML_METHOD_OP:
* objects (such as Operation Regions) can be created during the
* first pass parse.
*/
- obj_desc->method.owning_id = acpi_ut_allocate_owner_id (ACPI_OWNER_TYPE_METHOD);
+ status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
+ if (ACPI_FAILURE (status)) {
+ goto cleanup2;
+ }
/* Create and initialize a new walk state */
- walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id,
+ walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
NULL, NULL, NULL);
if (!walk_state) {
status = AE_NO_MEMORY;
{
struct acpi_table_list *list_head;
struct acpi_table_desc *table_desc;
+ acpi_status status;
ACPI_FUNCTION_TRACE_U32 ("tb_init_table_descriptor", table_type);
return_ACPI_STATUS (AE_NO_MEMORY);
}
+ /* Get a new owner ID for the table */
+
+ status = acpi_ut_allocate_owner_id (&table_desc->owner_id);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+
/* Install the table into the global data structure */
list_head = &acpi_gbl_table_lists[table_type];
table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
table_desc->aml_length = (u32) (table_desc->length -
(u32) sizeof (struct acpi_table_header));
- table_desc->table_id = acpi_ut_allocate_owner_id (
- ACPI_OWNER_TYPE_TABLE);
table_desc->loaded_into_namespace = FALSE;
/*
/* Return Data */
- table_info->table_id = table_desc->table_id;
+ table_info->owner_id = table_desc->owner_id;
table_info->installed_desc = table_desc;
return_ACPI_STATUS (AE_OK);
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /*
- * The signature and checksum must both be correct
- */
- if (ACPI_STRNCMP ((char *) rsdp, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
- /* Nope, BAD Signature */
-
- status = AE_BAD_SIGNATURE;
- goto cleanup;
- }
-
- /* Check the standard checksum */
+ /* Verify RSDP signature and checksum */
- if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
- status = AE_BAD_CHECKSUM;
+ status = acpi_tb_validate_rsdp (rsdp);
+ if (ACPI_FAILURE (status)) {
goto cleanup;
}
- /* Check extended checksum if table version >= 2 */
-
- if (rsdp->revision >= 2) {
- if (acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0) {
- status = AE_BAD_CHECKSUM;
- goto cleanup;
- }
- }
-
/* The RSDP supplied is OK */
table_info.pointer = ACPI_CAST_PTR (struct acpi_table_header, rsdp);
* "Scope" operator. Thus, we need to track ownership by an ID, not
* simply a position within the hierarchy
*/
- acpi_ns_delete_namespace_by_owner (table_desc->table_id);
-
+ acpi_ns_delete_namespace_by_owner (table_desc->owner_id);
table_desc = table_desc->next;
}
u32 length);
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_tb_validate_rsdp
+ *
+ * PARAMETERS: Rsdp - Pointer to unvalidated RSDP
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Validate the RSDP (ptr)
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_tb_validate_rsdp (
+ struct rsdp_descriptor *rsdp)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /*
+ * The signature and checksum must both be correct
+ */
+ if (ACPI_STRNCMP ((char *) rsdp, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) {
+ /* Nope, BAD Signature */
+
+ return (AE_BAD_SIGNATURE);
+ }
+
+ /* Check the standard checksum */
+
+ if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
+ return (AE_BAD_CHECKSUM);
+ }
+
+ /* Check extended checksum if table version >= 2 */
+
+ if ((rsdp->revision >= 2) &&
+ (acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
+ return (AE_BAD_CHECKSUM);
+ }
+
+ return (AE_OK);
+}
+
+
/*******************************************************************************
*
* FUNCTION: acpi_tb_find_table
acpi_gbl_RSDP = address.pointer.logical;
}
- /* The signature and checksum must both be correct */
-
- if (ACPI_STRNCMP ((char *) acpi_gbl_RSDP, RSDP_SIG,
- sizeof (RSDP_SIG)-1) != 0) {
- /* Nope, BAD Signature */
+ /* The RDSP signature and checksum must both be correct */
- return_ACPI_STATUS (AE_BAD_SIGNATURE);
- }
-
- if (acpi_tb_checksum (acpi_gbl_RSDP, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
- /* Nope, BAD Checksum */
-
- return_ACPI_STATUS (AE_BAD_CHECKSUM);
+ status = acpi_tb_validate_rsdp (acpi_gbl_RSDP);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
}
}
u8 *start_address,
u32 length)
{
+ acpi_status status;
u8 *mem_rover;
u8 *end_address;
- u8 checksum;
ACPI_FUNCTION_TRACE ("tb_scan_memory_for_rsdp");
for (mem_rover = start_address; mem_rover < end_address;
mem_rover += ACPI_RSDP_SCAN_STEP) {
- /* The signature and checksum must both be correct */
+ /* The RSDP signature and checksum must both be correct */
- if (ACPI_STRNCMP ((char *) mem_rover,
- RSDP_SIG, sizeof (RSDP_SIG) - 1) != 0) {
- /* No signature match, keep looking */
-
- continue;
- }
-
- /* Signature matches, check the appropriate checksum */
-
- if ((ACPI_CAST_PTR (struct rsdp_descriptor, mem_rover))->revision < 2) {
- /* ACPI version 1.0 */
-
- checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_CHECKSUM_LENGTH);
- }
- else {
- /* Post ACPI 1.0, use extended_checksum */
-
- checksum = acpi_tb_checksum (mem_rover, ACPI_RSDP_XCHECKSUM_LENGTH);
- }
-
- if (checksum == 0) {
- /* Checksum valid, we have found a valid RSDP */
+ status = acpi_tb_validate_rsdp (ACPI_CAST_PTR (struct rsdp_descriptor, mem_rover));
+ if (ACPI_SUCCESS (status)) {
+ /* Sig and checksum valid, we have found a real RSDP */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"RSDP located at physical address %p\n", mem_rover));
return_PTR (mem_rover);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Found an RSDP at physical address %p, but it has a bad checksum\n",
- mem_rover));
+ /* No sig match or bad checksum, keep searching */
}
/* Searched entire block, no RSDP was found */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Searched entire block, no valid RSDP was found.\n"));
+ "Searched entire block from %p, valid RSDP was not found\n",
+ start_address));
return_PTR (NULL);
}
acpi_os_unmap_memory (table_ptr, ACPI_EBDA_WINDOW_SIZE);
if (mem_rover) {
- /* Found it, return the physical address */
+ /* Return the physical address */
physical_address += ACPI_PTR_DIFF (mem_rover, table_ptr);
acpi_os_unmap_memory (table_ptr, ACPI_HI_RSDP_WINDOW_SIZE);
if (mem_rover) {
- /* Found it, return the physical address */
+ /* Return the physical address */
physical_address =
ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (mem_rover, table_ptr);
ACPI_PHYSADDR_TO_PTR (physical_address),
ACPI_EBDA_WINDOW_SIZE);
if (mem_rover) {
- /* Found it, return the physical address */
+ /* Return the physical address */
table_info->physical_address = ACPI_TO_INTEGER (mem_rover);
return_ACPI_STATUS (AE_OK);
}
}
- /* RSDP signature was not found */
+ /* A valid RSDP was not found */
+ ACPI_REPORT_ERROR (("No valid RSDP was found\n"));
return_ACPI_STATUS (AE_NOT_FOUND);
}
struct acpi_memory_list *cache;
+ ACPI_FUNCTION_ENTRY ();
+
+
if (!cache_name || !return_cache || (object_size < 16)) {
return (AE_BAD_PARAMETER);
}
acpi_status status;
- /* Purge all objects in the cache */
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Purge all objects in the cache */
status = acpi_os_purge_cache (cache);
if (ACPI_FAILURE (status)) {
void *object;
- ACPI_FUNCTION_NAME ("ut_acquire_from_cache");
+ ACPI_FUNCTION_NAME ("os_acquire_object");
if (!cache) {
ACPI_MEM_TRACKING (cache->hits++);
ACPI_MEM_TRACKING (ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Object %p from %s\n", object, cache->list_name)));
+ "Object %p from %s cache\n", object, cache->list_name)));
status = acpi_ut_release_mutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (status)) {
*
* PARAMETERS: requested_debug_level - Requested debug print level
* line_number - Caller's line number (for error output)
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Format - Printf format field
* ... - Optional printf arguments
*
acpi_ut_debug_print (
u32 requested_debug_level,
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
char *format,
...)
{
* Stay silent if the debug level or component ID is disabled
*/
if (!(requested_debug_level & acpi_dbg_level) ||
- !(dbg_info->component_id & acpi_dbg_layer)) {
+ !(component_id & acpi_dbg_layer)) {
return;
}
* Display the module name, current line number, thread ID (if requested),
* current procedure nesting level, and the current procedure name
*/
- acpi_os_printf ("%8s-%04ld ", dbg_info->module_name, line_number);
+ acpi_os_printf ("%8s-%04ld ", module_name, line_number);
if (ACPI_LV_THREADS & acpi_dbg_level) {
acpi_os_printf ("[%04lX] ", thread_id);
}
acpi_os_printf ("[%02ld] %-22.22s: ",
- acpi_gbl_nesting_level, dbg_info->proc_name);
+ acpi_gbl_nesting_level, function_name);
va_start (args, format);
acpi_os_vprintf (format, args);
*
* PARAMETERS: requested_debug_level - Requested debug print level
* line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Format - Printf format field
* ... - Optional printf arguments
*
acpi_ut_debug_print_raw (
u32 requested_debug_level,
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
char *format,
...)
{
if (!(requested_debug_level & acpi_dbg_level) ||
- !(dbg_info->component_id & acpi_dbg_layer)) {
+ !(component_id & acpi_dbg_layer)) {
return;
}
* FUNCTION: acpi_ut_trace
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
*
* RETURN: None
*
void
acpi_ut_trace (
u32 line_number,
- struct acpi_debug_print_info *dbg_info)
+ char *function_name,
+ char *module_name,
+ u32 component_id)
{
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr ();
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s\n", acpi_gbl_fn_entry_str);
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s\n", acpi_gbl_fn_entry_str);
}
EXPORT_SYMBOL(acpi_ut_trace);
* FUNCTION: acpi_ut_trace_ptr
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Pointer - Pointer to display
*
* RETURN: None
void
acpi_ut_trace_ptr (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
void *pointer)
{
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr ();
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s %p\n", acpi_gbl_fn_entry_str, pointer);
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s %p\n", acpi_gbl_fn_entry_str, pointer);
}
* FUNCTION: acpi_ut_trace_str
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* String - Additional string to display
*
* RETURN: None
void
acpi_ut_trace_str (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
char *string)
{
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr ();
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s %s\n", acpi_gbl_fn_entry_str, string);
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s %s\n", acpi_gbl_fn_entry_str, string);
}
* FUNCTION: acpi_ut_trace_u32
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Integer - Integer to display
*
* RETURN: None
void
acpi_ut_trace_u32 (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
u32 integer)
{
acpi_gbl_nesting_level++;
acpi_ut_track_stack_ptr ();
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s %08X\n", acpi_gbl_fn_entry_str, integer);
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s %08X\n", acpi_gbl_fn_entry_str, integer);
}
* FUNCTION: acpi_ut_exit
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
*
* RETURN: None
*
void
acpi_ut_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info)
+ char *function_name,
+ char *module_name,
+ u32 component_id)
{
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s\n", acpi_gbl_fn_exit_str);
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s\n", acpi_gbl_fn_exit_str);
acpi_gbl_nesting_level--;
}
* FUNCTION: acpi_ut_status_exit
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Status - Exit status code
*
* RETURN: None
void
acpi_ut_status_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
acpi_status status)
{
if (ACPI_SUCCESS (status)) {
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s %s\n", acpi_gbl_fn_exit_str,
- acpi_format_exception (status));
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s %s\n", acpi_gbl_fn_exit_str,
+ acpi_format_exception (status));
}
else {
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s ****Exception****: %s\n", acpi_gbl_fn_exit_str,
- acpi_format_exception (status));
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s ****Exception****: %s\n", acpi_gbl_fn_exit_str,
+ acpi_format_exception (status));
}
acpi_gbl_nesting_level--;
* FUNCTION: acpi_ut_value_exit
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_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
*
* RETURN: None
void
acpi_ut_value_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
acpi_integer value)
{
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str,
- ACPI_FORMAT_UINT64 (value));
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str,
+ ACPI_FORMAT_UINT64 (value));
acpi_gbl_nesting_level--;
}
* FUNCTION: acpi_ut_ptr_exit
*
* PARAMETERS: line_number - Caller's line number
- * dbg_info - Contains:
- * proc_name - Caller's procedure name
- * module_name - Caller's module name
- * component_id - Caller's component ID
+ * function_name - Caller's procedure name
+ * module_name - Caller's module name
+ * component_id - Caller's component ID
* Ptr - Pointer to display
*
* RETURN: None
void
acpi_ut_ptr_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
u8 *ptr)
{
- acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
- "%s %p\n", acpi_gbl_fn_exit_str, ptr);
+ acpi_ut_debug_print (ACPI_LV_FUNCTIONS,
+ line_number, function_name, module_name, component_id,
+ "%s %p\n", acpi_gbl_fn_exit_str, ptr);
acpi_gbl_nesting_level--;
}
union acpi_operand_object *object,
u16 action)
{
- acpi_status status;
- u32 i;
- union acpi_generic_state *state_list = NULL;
- union acpi_generic_state *state;
+ acpi_status status = AE_OK;
+ union acpi_generic_state *state_list = NULL;
+ union acpi_operand_object *next_object = NULL;
+ union acpi_generic_state *state;
+ acpi_native_uint i;
ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object);
- /* Ignore a null object ptr */
+ while (object) {
+ /* Make sure that this isn't a namespace handle */
- if (!object) {
- return_ACPI_STATUS (AE_OK);
- }
-
- /* 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));
- return_ACPI_STATUS (AE_OK);
- }
-
- state = acpi_ut_create_update_state (object, action);
-
- while (state) {
- object = state->update.object;
- action = state->update.value;
- acpi_ut_delete_generic_state (state);
+ if (ACPI_GET_DESCRIPTOR_TYPE (object) == ACPI_DESC_TYPE_NAMED) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
+ "Object %p is NS handle\n", object));
+ return_ACPI_STATUS (AE_OK);
+ }
/*
* All sub-objects must have their reference count incremented also.
acpi_ut_update_ref_count (object->device.device_notify, action);
break;
-
case ACPI_TYPE_PACKAGE:
-
/*
- * We must update all the sub-objects of the package
- * (Each of whom may have their own sub-objects, etc.
+ * We must update all the sub-objects of the package,
+ * each of whom may have their own sub-objects.
*/
for (i = 0; i < object->package.count; i++) {
/*
}
break;
-
case ACPI_TYPE_BUFFER_FIELD:
- status = acpi_ut_create_update_state_and_push (
- object->buffer_field.buffer_obj, action, &state_list);
- if (ACPI_FAILURE (status)) {
- goto error_exit;
- }
+ next_object = object->buffer_field.buffer_obj;
break;
-
case ACPI_TYPE_LOCAL_REGION_FIELD:
- status = acpi_ut_create_update_state_and_push (
- object->field.region_obj, action, &state_list);
- if (ACPI_FAILURE (status)) {
- goto error_exit;
- }
- break;
-
+ next_object = object->field.region_obj;
+ break;
case ACPI_TYPE_LOCAL_BANK_FIELD:
- status = acpi_ut_create_update_state_and_push (
- object->bank_field.bank_obj, action, &state_list);
- if (ACPI_FAILURE (status)) {
- goto error_exit;
- }
-
+ next_object = object->bank_field.bank_obj;
status = acpi_ut_create_update_state_and_push (
object->bank_field.region_obj, action, &state_list);
if (ACPI_FAILURE (status)) {
}
break;
-
case ACPI_TYPE_LOCAL_INDEX_FIELD:
- status = acpi_ut_create_update_state_and_push (
- object->index_field.index_obj, action, &state_list);
- if (ACPI_FAILURE (status)) {
- goto error_exit;
- }
-
+ next_object = object->index_field.index_obj;
status = acpi_ut_create_update_state_and_push (
object->index_field.data_obj, action, &state_list);
if (ACPI_FAILURE (status)) {
}
break;
-
case ACPI_TYPE_LOCAL_REFERENCE:
-
/*
* The target of an Index (a package, string, or buffer) must track
* changes to the ref count of the index.
*/
if (object->reference.opcode == AML_INDEX_OP) {
- status = acpi_ut_create_update_state_and_push (
- object->reference.object, action, &state_list);
- if (ACPI_FAILURE (status)) {
- goto error_exit;
- }
+ next_object = object->reference.object;
}
break;
-
case ACPI_TYPE_REGION:
default:
-
- /* No subobjects */
- break;
+ break;/* No subobjects */
}
/*
* main object to be deleted.
*/
acpi_ut_update_ref_count (object, action);
+ object = NULL;
/* Move on to the next object to be updated */
- state = acpi_ut_pop_generic_state (&state_list);
+ if (next_object) {
+ object = next_object;
+ next_object = NULL;
+ }
+ else if (state_list) {
+ state = acpi_ut_pop_generic_state (&state_list);
+ object = state->update.object;
+ acpi_ut_delete_generic_state (state);
+ }
}
return_ACPI_STATUS (AE_OK);
-
error_exit:
ACPI_REPORT_ERROR (("Could not update object reference count, %s\n",
}
-/*******************************************************************************
- *
- * FUNCTION: acpi_ut_allocate_owner_id
- *
- * PARAMETERS: id_type - Type of ID (method or table)
- *
- * 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 (
- u32 id_type)
-{
- acpi_owner_id owner_id = 0xFFFF;
-
-
- ACPI_FUNCTION_TRACE ("ut_allocate_owner_id");
-
-
- if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES)))
- {
- return (0);
- }
-
- switch (id_type)
- {
- case ACPI_OWNER_TYPE_TABLE:
-
- owner_id = acpi_gbl_next_table_owner_id;
- acpi_gbl_next_table_owner_id++;
-
- /* Check for wraparound */
-
- if (acpi_gbl_next_table_owner_id == ACPI_FIRST_METHOD_ID)
- {
- acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID;
- ACPI_REPORT_WARNING (("Table owner ID wraparound\n"));
- }
- break;
-
-
- case ACPI_OWNER_TYPE_METHOD:
-
- owner_id = acpi_gbl_next_method_owner_id;
- acpi_gbl_next_method_owner_id++;
-
- if (acpi_gbl_next_method_owner_id == ACPI_FIRST_TABLE_ID)
- {
- /* Check for wraparound */
-
- acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID;
- }
- break;
-
- default:
- break;
- }
-
- (void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
- return_VALUE (owner_id);
-}
-
-
/*******************************************************************************
*
* FUNCTION: acpi_ut_init_globals
for (i = 0; i < NUM_MUTEX; i++)
{
acpi_gbl_mutex_info[i].mutex = NULL;
- acpi_gbl_mutex_info[i].owner_id = ACPI_MUTEX_NOT_ACQUIRED;
+ acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
acpi_gbl_mutex_info[i].use_count = 0;
}
acpi_gbl_ns_lookup_count = 0;
acpi_gbl_ps_find_count = 0;
acpi_gbl_acpi_hardware_present = TRUE;
- acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID;
- acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID;
+ acpi_gbl_owner_id_mask = 0;
acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
ACPI_MODULE_NAME ("utmisc")
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ut_allocate_owner_id
+ *
+ * PARAMETERS: owner_id - Where the new owner ID is returned
+ *
+ * DESCRIPTION: Allocate a table or method owner id
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ut_allocate_owner_id (
+ acpi_owner_id *owner_id)
+{
+ acpi_native_uint i;
+ acpi_status status;
+
+
+ ACPI_FUNCTION_TRACE ("ut_allocate_owner_id");
+
+
+ status = acpi_ut_acquire_mutex (ACPI_MTX_CACHES);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+
+ /* Find a free owner ID */
+
+ for (i = 0; i < 32; i++) {
+ if (!(acpi_gbl_owner_id_mask & (1 << i))) {
+ acpi_gbl_owner_id_mask |= (1 << i);
+ *owner_id = (acpi_owner_id) i;
+ goto exit;
+ }
+ }
+
+ /*
+ * If we are here, all owner_ids have been allocated. This probably should
+ * not happen since the IDs are reused after deallocation. The IDs are
+ * allocated upon table load (one per table) and method execution, and
+ * they are released when a table is unloaded or a method completes
+ * execution.
+ */
+ status = AE_OWNER_ID_LIMIT;
+ ACPI_REPORT_ERROR ((
+ "Could not allocate new owner_id (32 max), AE_OWNER_ID_LIMIT\n"));
+
+exit:
+ (void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
+ return_ACPI_STATUS (status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: acpi_ut_release_owner_id
+ *
+ * PARAMETERS: owner_id - A previously allocated owner ID
+ *
+ * DESCRIPTION: Release a table or method owner id
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ut_release_owner_id (
+ acpi_owner_id owner_id)
+{
+ acpi_status status;
+
+
+ ACPI_FUNCTION_TRACE ("ut_release_owner_id");
+
+
+ status = acpi_ut_acquire_mutex (ACPI_MTX_CACHES);
+ if (ACPI_FAILURE (status)) {
+ return_ACPI_STATUS (status);
+ }
+
+ /* Free the owner ID */
+
+ if (acpi_gbl_owner_id_mask & (1 << owner_id)) {
+ acpi_gbl_owner_id_mask ^= (1 << owner_id);
+ }
+ else {
+ /* This owner_id has not been allocated */
+
+ status = AE_NOT_EXIST;
+ }
+
+ (void) acpi_ut_release_mutex (ACPI_MTX_CACHES);
+ return_ACPI_STATUS (status);
+}
+
+
/*******************************************************************************
*
* FUNCTION: acpi_ut_strupr (strupr)
if (!acpi_gbl_mutex_info[mutex_id].mutex) {
status = acpi_os_create_semaphore (1, 1,
&acpi_gbl_mutex_info[mutex_id].mutex);
- acpi_gbl_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED;
+ acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
acpi_gbl_mutex_info[mutex_id].use_count = 0;
}
status = acpi_os_delete_semaphore (acpi_gbl_mutex_info[mutex_id].mutex);
acpi_gbl_mutex_info[mutex_id].mutex = NULL;
- acpi_gbl_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED;
+ acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
return_ACPI_STATUS (status);
}
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;
+ acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id;
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
/*
* Mutex must be acquired in order to release it!
*/
- if (acpi_gbl_mutex_info[mutex_id].owner_id == ACPI_MUTEX_NOT_ACQUIRED) {
+ if (acpi_gbl_mutex_info[mutex_id].thread_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)));
/* Mark unlocked FIRST */
- acpi_gbl_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED;
+ acpi_gbl_mutex_info[mutex_id].thread_id = ACPI_MUTEX_NOT_ACQUIRED;
status = acpi_os_signal_semaphore (acpi_gbl_mutex_info[mutex_id].mutex, 1);
/* Version string */
-#define ACPI_CA_VERSION 0x20050624
+#define ACPI_CA_VERSION 0x20050708
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
union acpi_parse_object *op);
void
-acpi_is_eisa_id (
+acpi_dm_is_eisa_id (
union acpi_parse_object *op);
void
#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL)
#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL)
+#define AE_OWNER_ID_LIMIT (acpi_status) (0x001F | AE_CODE_ENVIRONMENTAL)
-#define AE_CODE_ENV_MAX 0x001E
+#define AE_CODE_ENV_MAX 0x001F
/*
"AE_LOGICAL_ADDRESS",
"AE_ABORT_METHOD",
"AE_SAME_HANDLER",
- "AE_WAKE_ONLY_GPE"
+ "AE_WAKE_ONLY_GPE",
+ "AE_OWNER_ID_LIMIT"
};
char const *acpi_gbl_exception_names_pgm[] =
ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
ACPI_EXTERN u32 acpi_gbl_ps_find_count;
+ACPI_EXTERN u32 acpi_gbl_owner_id_mask;
ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
-ACPI_EXTERN u16 acpi_gbl_next_table_owner_id;
-ACPI_EXTERN u16 acpi_gbl_next_method_owner_id;
ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
#define AML_NUM_OPCODES 0x7F
+/* Forward declarations */
+
+struct acpi_walk_state ;
+struct acpi_obj_mutex;
+union acpi_parse_object ;
+
+
/*****************************************************************************
*
* Mutex typedefs and structs
#endif
+/* Owner IDs are used to track namespace nodes for selective deletion */
+
+typedef u8 acpi_owner_id;
+#define ACPI_OWNER_ID_MAX 0xFF
+
+/* This Thread ID means that the mutex is not in use (unlocked) */
+
+#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1
+
/* Table for the global mutexes */
struct acpi_mutex_info
{
acpi_mutex mutex;
u32 use_count;
- u32 owner_id;
+ u32 thread_id;
};
-/* This owner ID means that the mutex is not in use (unlocked) */
-
-#define ACPI_MUTEX_NOT_ACQUIRED (u32) (-1)
-
/* Lock flag parameter for various interfaces */
#define ACPI_MTX_LOCK 1
-typedef u16 acpi_owner_id;
-#define ACPI_OWNER_TYPE_TABLE 0x0
-#define ACPI_OWNER_TYPE_METHOD 0x1
-#define ACPI_FIRST_METHOD_ID 0x0001
-#define ACPI_FIRST_TABLE_ID 0xF000
-
-
/* Field access granularities */
#define ACPI_FIELD_BYTE_GRANULARITY 1
{
u8 descriptor; /* Used to differentiate object descriptor types */
u8 type; /* Type associated with this name */
- u16 owner_id;
+ u16 reference_count; /* Current count of references and children */
union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
struct acpi_namespace_node *child; /* First child */
struct acpi_namespace_node *peer; /* Next peer*/
- u16 reference_count; /* Current count of references and children */
+ u8 owner_id; /* Who created this node */
u8 flags;
+
+ /* Fields used by the ASL compiler only */
+
+#ifdef ACPI_ASL_COMPILER
+ u32 value;
+ union acpi_parse_object *op;
+#endif
};
u64 physical_address;
u32 aml_length;
acpi_size length;
- acpi_owner_id table_id;
+ acpi_owner_id owner_id;
u8 type;
u8 allocation;
u8 loaded_into_namespace;
#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
-/* Forward declarations */
-
-struct acpi_walk_state ;
-struct acpi_obj_mutex;
-union acpi_parse_object ;
-
-
#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
u8 data_type; /* To differentiate various internal objs */\
u8 flags; \
*
****************************************************************************/
-struct acpi_debug_print_info
-{
- u32 component_id;
- char *proc_name;
- char *module_name;
-};
-
-
/* Entry for a memory allocation (debug only) */
#define ACPI_MEM_MALLOC 0
#define ACPI_PARAM_LIST(pl) pl
/*
- * Error reporting. These versions add callers module and line#. Since
- * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only
- * use it in debug mode.
+ * Error reporting. These versions add callers module and line#.
+ *
+ * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT
+ * isn't defined, only use it in debug mode.
*/
#ifdef ACPI_DEBUG_OUTPUT
-#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \
+#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \
acpi_os_printf ACPI_PARAM_LIST(fp);}
-#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \
+#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \
acpi_os_printf ACPI_PARAM_LIST(fp);}
-#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \
+#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \
acpi_os_printf ACPI_PARAM_LIST(fp);}
-#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e);
+#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e);
-#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e);
+#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e);
#else
* Debug macros that are conditionally compiled
*/
#ifdef ACPI_DEBUG_OUTPUT
+#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
-#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name;
+/*
+ * Common parameters used for debug output functions:
+ * line number, function name, module(file) name, component ID
+ */
+#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
/*
- * Function entry tracing.
- * The first parameter should be the procedure name as a quoted string. This is declared
- * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
+ * Function entry tracing
*/
-#define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _debug_info; \
- _debug_info.component_id = _COMPONENT; \
- _debug_info.proc_name = a; \
- _debug_info.module_name = _THIS_MODULE;
-
-#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace(__LINE__,&_debug_info)
-#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b)
-#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b)
-#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
- acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b)
-
-#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
+
+/*
+ * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
+ * define it now. This is the case where there the compiler does not support
+ * a __FUNCTION__ macro or equivalent. We save the function name on the
+ * local stack.
+ */
+#ifndef ACPI_GET_FUNCTION_NAME
+#define ACPI_GET_FUNCTION_NAME _acpi_function_name
+/*
+ * The Name parameter should be the procedure name as a quoted string.
+ * This is declared as a local string ("my_function_name") so that it can
+ * be also used by the function exit macros below.
+ */
+#define ACPI_FUNCTION_NAME(name) char *_acpi_function_name = name;
+
+#else
+/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
+
+#define ACPI_FUNCTION_NAME(name)
+#endif
+
+#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
+ acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
+#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
+ acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
+#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
+ acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
+#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
+ acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
+
+#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
/*
* Function exit tracing.
* WARNING: These macros include a return statement. This is usually considered
* bad form, but having a separate exit macro is very ugly and difficult to maintain.
* One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
- * so that "_proc_name" is defined.
+ * so that "_acpi_function_name" is defined.
*/
#ifdef ACPI_USE_DO_WHILE_0
#define ACPI_DO_WHILE0(a) do a while(0)
#define ACPI_DO_WHILE0(a) a
#endif
-#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;})
-#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));})
-#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));})
-#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));})
+#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;})
+#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));})
+#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));})
+#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));})
/* Conditional execution */
/* Stack and buffer dumping */
#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0)
-#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__)
+#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__)
#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
* leaving no executable debug code!
*/
#define ACPI_MODULE_NAME(name)
-#define _THIS_MODULE ""
+#define _acpi_module_name ""
#define ACPI_DEBUG_EXEC(a)
#define ACPI_NORMAL_EXEC(a) a;
/* Memory allocation */
-#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__)
-#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__)
+#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_MEM_TRACKING(a)
-
#else
/* Memory allocation */
-#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__)
-#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__)
-#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__)
+#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_MEM_TRACKING(a) a
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
void
acpi_ns_delete_namespace_by_owner (
- u16 table_id);
+ acpi_owner_id owner_id);
void
acpi_ns_detach_object (
acpi_object_type type,
u8 display_type,
u32 max_depth,
- u32 ownder_id,
+ acpi_owner_id owner_id,
acpi_handle start_handle);
#endif /* ACPI_FUTURE_USAGE */
ACPI_INTERNAL_METHOD implementation;
u8 concurrency;
u8 thread_count;
- acpi_owner_id owning_id;
+ acpi_owner_id owner_id;
};
/*
* Debug level macros that are used in the DEBUG_PRINT macros
*/
-#define ACPI_DEBUG_LEVEL(dl) (u32) dl,__LINE__,&_debug_info
+#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS
/* Exception level -- used in the global "debug_level" */
u8 walk_type;
acpi_owner_id owner_id; /* Owner of objects created during the walk */
u8 last_predicate; /* Result of last predicate */
- u8 reserved; /* For alignment */
u8 current_result; /* */
u8 next_op_info; /* Info about next_op */
u8 num_operands; /* Stack pointer for Operands[] array */
struct acpi_walk_info
{
u32 debug_level;
- u32 owner_id;
+ acpi_owner_id owner_id;
u8 display_type;
};
/* Display Types */
-#define ACPI_DISPLAY_SUMMARY 0
-#define ACPI_DISPLAY_OBJECTS 1
-#define ACPI_DISPLAY_MASK 1
+#define ACPI_DISPLAY_SUMMARY (u8) 0
+#define ACPI_DISPLAY_OBJECTS (u8) 1
+#define ACPI_DISPLAY_MASK (u8) 1
-#define ACPI_DISPLAY_SHORT 2
+#define ACPI_DISPLAY_SHORT (u8) 2
struct acpi_get_devices_info
{
acpi_tb_get_table_rsdt (
void);
+acpi_status
+acpi_tb_validate_rsdp (
+ struct rsdp_descriptor *rsdp);
+
/*
* tbutils - common table utilities
*/
struct rsdp_descriptor /* Root System Descriptor Pointer */
{
- char signature [8]; /* ACPI signature, contains "RSD PTR " */
- u8 checksum; /* To make sum of struct == 0 */
- char oem_id [6]; /* OEM identification */
- u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */
- u32 rsdt_physical_address; /* 32-bit physical address of RSDT */
- u32 length; /* XSDT Length in bytes including hdr */
- u64 xsdt_physical_address; /* 64-bit physical address of XSDT */
- u8 extended_checksum; /* Checksum of entire table */
- char reserved [3]; /* Reserved field must be 0 */
+ char signature[8]; /* ACPI signature, contains "RSD PTR " */
+ u8 checksum; /* ACPI 1.0 checksum */
+ char oem_id[6]; /* OEM identification */
+ u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
+ u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
+ u32 length; /* XSDT Length in bytes, including header */
+ u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */
+ u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */
+ char reserved[3]; /* Reserved, must be zero */
};
#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
- char signature [4]; /* ACPI signature (4 ASCII characters) */\
- u32 length; /* Length of table, in bytes, including header */\
+ char signature[4]; /* ASCII table signature */\
+ u32 length; /* Length of table in bytes, including this header */\
u8 revision; /* ACPI Specification minor version # */\
u8 checksum; /* To make sum of entire table == 0 */\
- char oem_id [6]; /* OEM identification */\
- char oem_table_id [8]; /* OEM table identification */\
+ char oem_id[6]; /* ASCII OEM identification */\
+ char oem_table_id[8]; /* ASCII OEM table identification */\
u32 oem_revision; /* OEM revision number */\
- char asl_compiler_id [4]; /* ASL compiler vendor ID */\
- u32 asl_compiler_revision; /* ASL compiler revision number */
+ char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\
+ u32 asl_compiler_revision; /* ASL compiler version */
struct acpi_table_header /* ACPI common table header */
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
u32 local_apic_address; /* Physical address of local APIC */
- u32 PCATcompat : 1; /* A one indicates system also has dual 8259s */
- u32 reserved1 : 31;
+
+ /* Flags (32 bits) */
+
+ u8 PCATcompat : 1; /* 00: System also has dual 8259s */
+ u8 : 7; /* 01-07: Reserved, must be zero */
+ u8 reserved1[3]; /* 08-31: Reserved, must be zero */
};
/* Values for Type in APIC_HEADER_DEF */
#define TRIGGER_RESERVED 2
#define TRIGGER_LEVEL 3
-/* Common flag definitions */
+/* Common flag definitions (16 bits each) */
#define MPS_INTI_FLAGS \
- u16 polarity : 2; /* Polarity of APIC I/O input signals */\
- u16 trigger_mode : 2; /* Trigger mode of APIC input signals */\
- u16 reserved1 : 12; /* Reserved, must be zero */
+ u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
+ u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
+ u8 : 4; /* 04-07: Reserved, must be zero */\
+ u8 reserved1; /* 08-15: Reserved, must be zero */
#define LOCAL_APIC_FLAGS \
- u32 processor_enabled: 1; /* Processor is usable if set */\
- u32 reserved2 : 31; /* Reserved, must be zero */
+ u8 processor_enabled: 1; /* 00: Processor is usable if set */\
+ u8 : 7; /* 01-07: Reserved, must be zero */\
+ u8 reserved2; /* 08-15: Reserved, must be zero */
/* Sub-structures for MADT */
struct madt_address_override
{
APIC_HEADER_DEF
- u16 reserved; /* Reserved - must be zero */
+ u16 reserved; /* Reserved, must be zero */
u64 address; /* APIC physical address */
};
{
APIC_HEADER_DEF
u8 io_sapic_id; /* I/O SAPIC ID */
- u8 reserved; /* Reserved - must be zero */
+ u8 reserved; /* Reserved, must be zero */
u32 interrupt_base; /* Glocal interrupt for SAPIC start */
u64 address; /* SAPIC physical address */
};
u8 processor_id; /* ACPI processor id */
u8 local_sapic_id; /* SAPIC ID */
u8 local_sapic_eid; /* SAPIC EID */
- u8 reserved [3]; /* Reserved - must be zero */
+ u8 reserved[3]; /* Reserved, must be zero */
LOCAL_APIC_FLAGS
u32 processor_uID; /* Numeric UID - ACPI 3.0 */
char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
struct rsdt_descriptor_rev1
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
- u32 table_offset_entry [1]; /* Array of pointers to other */
- /* ACPI tables */
+ u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
};
*/
struct facs_descriptor_rev1
{
- char signature[4]; /* ACPI Signature */
- u32 length; /* Length of structure, in bytes */
+ char signature[4]; /* ASCII table signature */
+ u32 length; /* Length of structure in bytes */
u32 hardware_signature; /* Hardware configuration signature */
u32 firmware_waking_vector; /* ACPI OS waking vector */
u32 global_lock; /* Global Lock */
- u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */
- u32 reserved1 : 31; /* Must be 0 */
- u8 resverved3 [40]; /* Reserved - must be zero */
+
+ /* Flags (32 bits) */
+
+ u8 S4bios_f : 1; /* 00: S4BIOS support is present */
+ u8 : 7; /* 01-07: Reserved, must be zero */
+ u8 reserved1[3]; /* 08-31: Reserved, must be zero */
+
+ u8 reserved2[40]; /* Reserved, must be zero */
};
u32 firmware_ctrl; /* Physical address of FACS */
u32 dsdt; /* Physical address of DSDT */
u8 model; /* System Interrupt Model */
- u8 reserved1; /* Reserved */
+ u8 reserved1; /* Reserved, must be zero */
u16 sci_int; /* System vector of SCI interrupt */
u32 smi_cmd; /* Port address of SMI command port */
u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
- u8 reserved2; /* Reserved - must be zero */
+ u8 reserved2; /* Reserved, must be zero */
u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
u8 gpe1_base; /* Offset in gpe model where gpe1 events start */
- u8 reserved3; /* Reserved */
+ u8 reserved3; /* Reserved, must be zero */
u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */
u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */
u16 flush_size; /* Size of area read to flush caches */
u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */
u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */
u8 century; /* Index to century in RTC CMOS RAM */
- u8 reserved4; /* Reserved */
- u8 reserved4a; /* Reserved */
- u8 reserved4b; /* Reserved */
- u32 wb_invd : 1; /* The wbinvd instruction works properly */
- u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */
- u32 proc_c1 : 1; /* All processors support C1 state */
- u32 plvl2_up : 1; /* C2 state works on MP system */
- u32 pwr_button : 1; /* Power button is handled as a generic feature */
- u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */
- u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */
- u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */
- u32 tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */
- u32 reserved5 : 23; /* Reserved - must be zero */
+ u8 reserved4[3]; /* Reserved, must be zero */
+
+ /* Flags (32 bits) */
+
+ u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */
+ u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */
+ u8 proc_c1 : 1; /* 02: All processors support C1 state */
+ u8 plvl2_up : 1; /* 03: C2 state works on MP system */
+ u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */
+ u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */
+ u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */
+ u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */
+ u8 tmr_val_ext : 1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */
+ u8 : 7; /* 09-15: Reserved, must be zero */
+ u8 reserved5[2]; /* 16-31: Reserved, must be zero */
};
#pragma pack()
struct rsdt_descriptor_rev2
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
- u32 table_offset_entry [1]; /* Array of pointers to */
- /* ACPI table headers */
+ u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
};
struct xsdt_descriptor_rev2
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
- u64 table_offset_entry [1]; /* Array of pointers to */
- /* ACPI table headers */
+ u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
};
*/
struct facs_descriptor_rev2
{
- char signature[4]; /* ACPI signature */
+ char signature[4]; /* ASCII table signature */
u32 length; /* Length of structure, in bytes */
u32 hardware_signature; /* Hardware configuration signature */
- u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */
+ u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */
u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
- u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */
- u32 reserved1 : 31; /* Must be 0 */
- u64 xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */
+
+ /* Flags (32 bits) */
+
+ u8 S4bios_f : 1; /* 00: S4BIOS support is present */
+ u8 : 7; /* 01-07: Reserved, must be zero */
+ u8 reserved1[3]; /* 08-31: Reserved, must be zero */
+
+ u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */
u8 version; /* Version of this table */
- u8 reserved3 [31]; /* Reserved - must be zero */
+ u8 reserved3[31]; /* Reserved, must be zero */
};
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
FADT_REV2_COMMON
- u8 reserved2; /* Reserved */
- u32 wb_invd : 1; /* The wbinvd instruction works properly */
- u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */
- u32 proc_c1 : 1; /* All processors support C1 state */
- u32 plvl2_up : 1; /* C2 state works on MP system */
- u32 pwr_button : 1; /* Power button is handled as a generic feature */
- u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */
- u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */
- u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */
- u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits */
- u32 dock_cap : 1; /* Supports Docking */
- u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG */
- u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed */
- u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices */
- u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */
- /* must be executed after writing the SLP_TYPx register */
- /* ACPI 3.0 flag bits */
-
- u32 pci_exp_wak : 1; /* System supports PCIEXP_WAKE (STS/EN) bits */
- u32 use_platform_clock : 1; /* OSPM should use platform-provided timer */
- u32 S4rtc_sts_valid : 1; /* Contents of RTC_STS valid after S4 wake */
- u32 remote_power_on_capable : 1; /* System is compatible with remote power on */
- u32 force_apic_cluster_model : 1; /* All local APICs must use cluster model */
- u32 force_apic_physical_destination_mode : 1; /* all local x_aPICs must use physical dest mode */
- u32 reserved6 : 12;/* Reserved - must be zero */
+ u8 reserved2; /* Reserved, must be zero */
+
+ /* Flags (32 bits) */
+
+ u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */
+ u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */
+ u8 proc_c1 : 1; /* 02: All processors support C1 state */
+ u8 plvl2_up : 1; /* 03: C2 state works on MP system */
+ u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */
+ u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */
+ u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */
+ u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */
+ u8 tmr_val_ext : 1; /* 08: tmr_val is 32 bits 0=24-bits */
+ u8 dock_cap : 1; /* 09: Docking supported */
+ u8 reset_reg_sup : 1; /* 10: System reset via the FADT RESET_REG supported */
+ u8 sealed_case : 1; /* 11: No internal expansion capabilities and case is sealed */
+ u8 headless : 1; /* 12: No local video capabilities or local input devices */
+ u8 cpu_sw_sleep : 1; /* 13: Must execute native instruction after writing SLP_TYPx register */
+
+ u8 pci_exp_wak : 1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
+ u8 use_platform_clock : 1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
+ u8 S4rtc_sts_valid : 1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
+ u8 remote_power_on_capable : 1; /* 17: System is compatible with remote power on (ACPI 3.0) */
+ u8 force_apic_cluster_model : 1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
+ u8 force_apic_physical_destination_mode : 1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */
+ u8 : 4; /* 20-23: Reserved, must be zero */
+ u8 reserved3; /* 24-31: Reserved, must be zero */
struct acpi_generic_address reset_register; /* Reset register address in GAS format */
u8 reset_value; /* Value to write to the reset_register port to reset the system */
- u8 reserved7[3]; /* These three bytes must be zero */
+ u8 reserved4[3]; /* These three bytes must be zero */
u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
u64 Xdsdt; /* 64-bit physical address of DSDT */
struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
{
ACPI_TABLE_HEADER_DEF /* ACPI common table header */
FADT_REV2_COMMON
- u8 reserved2; /* Reserved */
+ u8 reserved2; /* Reserved, must be zero */
u32 flags;
struct acpi_generic_address reset_register; /* Reset register address in GAS format */
u8 reset_value; /* Value to write to the reset_register port to reset the system. */
- u8 reserved7[3]; /* These three bytes must be zero */
+ u8 reserved7[3]; /* Reserved, must be zero */
};
u8 length;
u8 proximity_domain_lo;
u8 apic_id;
- u32 enabled :1;
- u32 reserved3 :31;
+
+ /* Flags (32 bits) */
+
+ u8 enabled :1; /* 00: Use affinity structure */
+ u8 :7; /* 01-07: Reserved, must be zero */
+ u8 reserved3[3]; /* 08-31: Reserved, must be zero */
+
u8 local_sapic_eid;
u8 proximity_domain_hi[3];
- u32 reserved4;
+ u32 reserved4; /* Reserved, must be zero */
};
struct memory_affinity
u64 base_address;
u64 address_length;
u32 reserved4;
- u32 enabled :1;
- u32 hot_pluggable :1;
- u32 non_volatile :1;
- u32 reserved5 :29;
- u64 reserved6;
+
+ /* Flags (32 bits) */
+
+ u8 enabled :1; /* 00: Use affinity structure */
+ u8 hot_pluggable :1; /* 01: Memory region is hot pluggable */
+ u8 non_volatile :1; /* 02: Memory is non-volatile */
+ u8 :5; /* 03-07: Reserved, must be zero */
+ u8 reserved5[3]; /* 08-31: Reserved, must be zero */
+
+ u64 reserved6; /* Reserved, must be zero */
};
struct system_resource_affinity
{
ACPI_TABLE_HEADER_DEF
u32 reserved1; /* Must be value '1' */
- u64 reserved2;
+ u64 reserved2; /* Reserved, must be zero */
};
/*
- * Miscellaneous common types
+ * This type is used for bitfields in ACPI tables. The only type that is
+ * even remotely portable is u8. Anything else is not portable, so
+ * do not add any more bitfield types.
*/
-typedef u16 UINT16_BIT;
-typedef u32 UINT32_BIT;
+typedef u8 UINT8_BIT;
typedef acpi_native_uint ACPI_PTRDIFF;
/*
#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
-/* Types for the OS interface layer (OSL) */
-
-#ifdef ACPI_USE_LOCAL_CACHE
-#define acpi_cache_t struct acpi_memory_list
+/*
+ * If acpi_cache_t was not defined in the OS-dependent header,
+ * define it now. This is typically the case where the local cache
+ * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
+ */
+#ifndef acpi_cache_t
+#define acpi_cache_t struct acpi_memory_list
#endif
/*
acpi_ut_valid_object_type (
acpi_object_type type);
-acpi_owner_id
-acpi_ut_allocate_owner_id (
- u32 id_type);
-
/*
* utinit - miscellaneous initialization and shutdown
void
acpi_ut_trace (
u32 line_number,
- struct acpi_debug_print_info *dbg_info);
+ char *function_name,
+ char *module_name,
+ u32 component_id);
void
acpi_ut_trace_ptr (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
void *pointer);
void
acpi_ut_trace_u32 (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
u32 integer);
void
acpi_ut_trace_str (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
char *string);
void
acpi_ut_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info);
+ char *function_name,
+ char *module_name,
+ u32 component_id);
void
acpi_ut_status_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
acpi_status status);
void
acpi_ut_value_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
acpi_integer value);
void
acpi_ut_ptr_exit (
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
u8 *ptr);
void
acpi_ut_debug_print (
u32 requested_debug_level,
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
char *format,
...) ACPI_PRINTF_LIKE_FUNC;
acpi_ut_debug_print_raw (
u32 requested_debug_level,
u32 line_number,
- struct acpi_debug_print_info *dbg_info,
+ char *function_name,
+ char *module_name,
+ u32 component_id,
char *format,
...) ACPI_PRINTF_LIKE_FUNC;
u32 line_number,
u32 component_id);
-#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t)
-#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT)
+#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
+#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT)
void
acpi_ut_delete_object_desc (
* utmisc
*/
acpi_status
+acpi_ut_allocate_owner_id (
+ acpi_owner_id *owner_id);
+
+acpi_status
+acpi_ut_release_owner_id (
+ acpi_owner_id owner_id);
+
+acpi_status
acpi_ut_walk_package_tree (
union acpi_operand_object *source_object,
void *target_object,
#ifndef __ACGCC_H__
#define __ACGCC_H__
+/* Function name is used for debug output. Non-ANSI, compiler-dependent */
+
+#define ACPI_GET_FUNCTION_NAME __FUNCTION__
+
/* This macro is used to tag functions as "printf-like" because
* some compilers (like GCC) can catch printf format string problems.
*/
-#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 4, 5)))
+#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7)))
/* Some compilers complain about unused variables. Sometimes we don't want to
- * use all the variables (most specifically for _THIS_MODULE). This allow us
+ * use all the variables (for example, _acpi_module_name). This allows us
* to to tell the compiler warning in a per-variable manner that a variable
* is unused.
*/