Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica: (21 commits)
  ACPICA: Update version to 20131218.
  ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global.
  ACPICA: Linuxize: Cleanup spaces after special macro invocations.
  ACPICA: Interpreter: Add additional debug info for an error case.
  ACPICA: Update ACPI example code to make it an actual working program.
  ACPICA: Add an error message if the Debugger fails initialization.
  ACPICA: Conditionally define a local variable that is used for debug only.
  ACPICA: Parser: Updates/fixes for debug output.
  ACPICA: Enhance ACPI warning for memory/IO address conflicts.
  ACPICA: Update several debug statements - no functional change.
  ACPICA: Improve exception handling for GPE block installation.
  ACPICA: Add helper macros to extract bus/segment numbers from HEST table.
  ACPICA: Tables: Add full support for the PCCT table, update table definition.
  ACPICA: Tables: Add full support for the DBG2 table.
  ACPICA: Add option to favor 32-bit FADT addresses.
  ACPICA: Cleanup the option of forcing the use of the RSDT.
  ACPICA: Back port and refine validation of the XSDT root table.
  ACPICA: Linux Header: Remove unused OSL prototypes.
  ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.
  ACPICA: Disassembler: Improve pathname support for emitted External() statements.
  ...
  • Loading branch information
Rafael J. Wysocki committed Jan 12, 2014
2 parents 25d412d + c14ced0 commit 3e7cc14
Show file tree
Hide file tree
Showing 30 changed files with 538 additions and 367 deletions.
1 change: 0 additions & 1 deletion arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

#define PREFIX "ACPI: "

u32 acpi_rsdt_forced;
unsigned int acpi_cpei_override;
unsigned int acpi_cpei_phys_cpuid;

Expand Down
3 changes: 1 addition & 2 deletions arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

#include "sleep.h" /* To include x86_acpi_suspend_lowlevel */
static int __initdata acpi_force = 0;
u32 acpi_rsdt_forced;
int acpi_disabled;
EXPORT_SYMBOL(acpi_disabled);

Expand Down Expand Up @@ -1564,7 +1563,7 @@ static int __init parse_acpi(char *arg)
}
/* acpi=rsdt use RSDT instead of XSDT */
else if (strcmp(arg, "rsdt") == 0) {
acpi_rsdt_forced = 1;
acpi_gbl_do_not_use_xsdt = TRUE;
}
/* "acpi=noirq" disables ACPI interrupt routing */
else if (strcmp(arg, "noirq") == 0) {
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ void acpi_db_display_handlers(void);
ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_db_generate_gpe(char *gpe_arg,
char *block_arg))

ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void))

/*
Expand Down
9 changes: 5 additions & 4 deletions drivers/acpi/acpica/acevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ acpi_status acpi_ev_init_global_lock_handler(void);

ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
acpi_ev_acquire_global_lock(u16 timeout))

ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void))
acpi_status acpi_ev_remove_global_lock_handler(void);
acpi_status acpi_ev_remove_global_lock_handler(void);

/*
* evgpe - Low-level GPE support
Expand Down Expand Up @@ -133,7 +132,7 @@ acpi_status acpi_ev_gpe_initialize(void);
ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_ev_update_gpes(acpi_owner_id table_owner_id))

acpi_status
acpi_status
acpi_ev_match_gpe_method(acpi_handle obj_handle,
u32 level, void *context, void **return_value);

Expand All @@ -149,7 +148,9 @@ acpi_status
acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block, void *context);

struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number);
acpi_status
acpi_ev_get_gpe_xrupt_block(u32 interrupt_number,
struct acpi_gpe_xrupt_info **gpe_xrupt_block);

acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt);

Expand Down
30 changes: 30 additions & 0 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,24 @@ bool ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
*/
u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE);

/*
* Optionally ignore an XSDT if present and use the RSDT instead.
* Although the ACPI specification requires that an XSDT be used instead
* of the RSDT, the XSDT has been found to be corrupt or ill-formed on
* some machines. Default behavior is to use the XSDT if present.
*/
u8 ACPI_INIT_GLOBAL(acpi_gbl_do_not_use_xsdt, FALSE);

/*
* Optionally use 32-bit FADT addresses if and when there is a conflict
* (address mismatch) between the 32-bit and 64-bit versions of the
* address. Although ACPICA adheres to the ACPI specification which
* requires the use of the corresponding 64-bit address if it is non-zero,
* some machines have been found to have a corrupted non-zero 64-bit
* address. Default is FALSE, do not favor the 32-bit addresses.
*/
u8 ACPI_INIT_GLOBAL(acpi_gbl_use32_bit_fadt_addresses, FALSE);

/*
* Optionally truncate I/O addresses to 16 bits. Provides compatibility
* with other ACPI implementations. NOTE: During ACPICA initialization,
Expand Down Expand Up @@ -482,6 +500,18 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;

#endif /* ACPI_DEBUGGER */

/*****************************************************************************
*
* Application globals
*
****************************************************************************/

#ifdef ACPI_APPLICATION

ACPI_FILE ACPI_INIT_GLOBAL(acpi_gbl_debug_file, NULL);

#endif /* ACPI_APPLICATION */

/*****************************************************************************
*
* Info/help support
Expand Down
9 changes: 5 additions & 4 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1038,15 +1038,16 @@ struct acpi_external_list {
struct acpi_external_list *next;
u32 value;
u16 length;
u16 flags;
u8 type;
u8 flags;
u8 resolved;
u8 emitted;
};

/* Values for Flags field above */

#define ACPI_IPATH_ALLOCATED 0x01
#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */

struct acpi_external_file {
char *path;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dsfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ acpi_ds_create_external_region(acpi_status lookup_status,
* operation_region not found. Generate an External for it, and
* insert the name into the namespace.
*/
acpi_dm_add_to_external_list(op, path, ACPI_TYPE_REGION, 0);
acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0);
status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
walk_state, node);
Expand Down
19 changes: 9 additions & 10 deletions drivers/acpi/acpica/dsutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,27 +727,26 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
index++;
}

index--;
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"NumOperands %d, ArgCount %d, Index %d\n",
walk_state->num_operands, arg_count, index));

/* It is the appropriate order to get objects from the Result stack */
/* Create the interpreter arguments, in reverse order */

index--;
for (i = 0; i < arg_count; i++) {
arg = arguments[index];

/* Force the filling of the operand stack in inverse order */

walk_state->operand_index = (u8) index;
walk_state->operand_index = (u8)index;

status = acpi_ds_create_operand(walk_state, arg, index);
if (ACPI_FAILURE(status)) {
goto cleanup;
}

index--;

ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"Arg #%u (%p) done, Arg1=%p\n", index, arg,
first_arg));
"Created Arg #%u (%p) %u args total\n",
index, arg, arg_count));
index--;
}

return_ACPI_STATUS(status);
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/dswload.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
* Target of Scope() not found. Generate an External for it, and
* insert the name into the namespace.
*/
acpi_dm_add_to_external_list(op, path, ACPI_TYPE_DEVICE,
0);
acpi_dm_add_op_to_external_list(op, path,
ACPI_TYPE_DEVICE, 0, 0);
status =
acpi_ns_lookup(walk_state->scope_info, path,
object_type, ACPI_IMODE_LOAD_PASS1,
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/acpica/evgpeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
return_ACPI_STATUS(status);
}

gpe_xrupt_block = acpi_ev_get_gpe_xrupt_block(interrupt_number);
if (!gpe_xrupt_block) {
status = AE_NO_MEMORY;
status =
acpi_ev_get_gpe_xrupt_block(interrupt_number, &gpe_xrupt_block);
if (ACPI_FAILURE(status)) {
goto unlock_and_exit;
}

Expand All @@ -112,7 +112,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
acpi_os_release_lock(acpi_gbl_gpe_lock, flags);

unlock_and_exit:
status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
return_ACPI_STATUS(status);
}

Expand Down
24 changes: 15 additions & 9 deletions drivers/acpi/acpica/evgpeutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
* FUNCTION: acpi_ev_get_gpe_xrupt_block
*
* PARAMETERS: interrupt_number - Interrupt for a GPE block
* gpe_xrupt_block - Where the block is returned
*
* RETURN: A GPE interrupt block
* RETURN: Status
*
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
* block per unique interrupt level used for GPEs. Should be
Expand All @@ -207,7 +208,9 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
*
******************************************************************************/

struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
acpi_status
acpi_ev_get_gpe_xrupt_block(u32 interrupt_number,
struct acpi_gpe_xrupt_info ** gpe_xrupt_block)
{
struct acpi_gpe_xrupt_info *next_gpe_xrupt;
struct acpi_gpe_xrupt_info *gpe_xrupt;
Expand All @@ -221,7 +224,8 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
while (next_gpe_xrupt) {
if (next_gpe_xrupt->interrupt_number == interrupt_number) {
return_PTR(next_gpe_xrupt);
*gpe_xrupt_block = next_gpe_xrupt;
return_ACPI_STATUS(AE_OK);
}

next_gpe_xrupt = next_gpe_xrupt->next;
Expand All @@ -231,7 +235,7 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)

gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info));
if (!gpe_xrupt) {
return_PTR(NULL);
return_ACPI_STATUS(AE_NO_MEMORY);
}

gpe_xrupt->interrupt_number = interrupt_number;
Expand All @@ -250,6 +254,7 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
} else {
acpi_gbl_gpe_xrupt_list_head = gpe_xrupt;
}

acpi_os_release_lock(acpi_gbl_gpe_lock, flags);

/* Install new interrupt handler if not SCI_INT */
Expand All @@ -259,14 +264,15 @@ struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
acpi_ev_gpe_xrupt_handler,
gpe_xrupt);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO,
"Could not install GPE interrupt handler at level 0x%X",
interrupt_number));
return_PTR(NULL);
ACPI_EXCEPTION((AE_INFO, status,
"Could not install GPE interrupt handler at level 0x%X",
interrupt_number));
return_ACPI_STATUS(status);
}
}

return_PTR(gpe_xrupt);
*gpe_xrupt_block = gpe_xrupt;
return_ACPI_STATUS(AE_OK);
}

/*******************************************************************************
Expand Down
3 changes: 2 additions & 1 deletion drivers/acpi/acpica/exresnte.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
}

if (!source_desc) {
ACPI_ERROR((AE_INFO, "No object attached to node %p", node));
ACPI_ERROR((AE_INFO, "No object attached to node [%4.4s] %p",
node->name.ascii, node));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}

Expand Down
23 changes: 13 additions & 10 deletions drivers/acpi/acpica/nsxfeval.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
acpi_object_type return_type)
{
acpi_status status;
u8 must_free = FALSE;
u8 free_buffer_on_error = FALSE;

ACPI_FUNCTION_TRACE(acpi_evaluate_object_typed);

Expand All @@ -95,14 +95,13 @@ acpi_evaluate_object_typed(acpi_handle handle,
}

if (return_buffer->length == ACPI_ALLOCATE_BUFFER) {
must_free = TRUE;
free_buffer_on_error = TRUE;
}

/* Evaluate the object */

status =
acpi_evaluate_object(handle, pathname, external_params,
return_buffer);
status = acpi_evaluate_object(handle, pathname,
external_params, return_buffer);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
Expand Down Expand Up @@ -135,11 +134,15 @@ acpi_evaluate_object_typed(acpi_handle handle,
pointer)->type),
acpi_ut_get_type_name(return_type)));

if (must_free) {

/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */

ACPI_FREE_BUFFER(*return_buffer);
if (free_buffer_on_error) {
/*
* Free a buffer created via ACPI_ALLOCATE_BUFFER.
* Note: We use acpi_os_free here because acpi_os_allocate was used
* to allocate the buffer. This purposefully bypasses the
* (optionally enabled) allocation tracking mechanism since we
* only want to track internal allocations.
*/
acpi_os_free(return_buffer->pointer);
return_buffer->pointer = NULL;
}

Expand Down
Loading

0 comments on commit 3e7cc14

Please sign in to comment.