diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 07d209c..bfa1931 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -60,6 +60,7 @@ #define PREFIX "ACPI: " +u32 acpi_rsdt_forced; unsigned int acpi_cpei_override; unsigned int acpi_cpei_phys_cpuid; diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 1dac942..d359d0f 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -46,6 +46,7 @@ #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); @@ -1561,7 +1562,7 @@ static int __init parse_acpi(char *arg) } /* acpi=rsdt use RSDT instead of XSDT */ else if (strcmp(arg, "rsdt") == 0) { - acpi_gbl_do_not_use_xsdt = TRUE; + acpi_rsdt_forced = 1; } /* "acpi=noirq" disables ACPI interrupt routing */ else if (strcmp(arg, "noirq") == 0) { diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h index 2bf3ca2..a9fd0b8 100644 --- a/drivers/acpi/acpica/acdebug.h +++ b/drivers/acpi/acpica/acdebug.h @@ -113,6 +113,7 @@ 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)) /* diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index 0fb0adf..41abe55 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h @@ -71,8 +71,9 @@ 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 @@ -132,7 +133,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); @@ -148,9 +149,7 @@ acpi_status acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block, void *context); -acpi_status -acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, - struct acpi_gpe_xrupt_info **gpe_xrupt_block); +struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number); acpi_status acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt); diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 4ed1aa3..6f001fe 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h @@ -119,24 +119,6 @@ u8 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, * this value is set to TRUE if any Windows OSI strings have been @@ -502,18 +484,6 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; /***************************************************************************** * - * Application globals - * - ****************************************************************************/ - -#ifdef ACPI_APPLICATION - -ACPI_FILE ACPI_INIT_GLOBAL(acpi_gbl_debug_file, NULL); - -#endif /* ACPI_APPLICATION */ - -/***************************************************************************** - * * Info/help support * ****************************************************************************/ diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c index d7f53fb..ade44e4 100644 --- a/drivers/acpi/acpica/dsutils.c +++ b/drivers/acpi/acpica/dsutils.c @@ -727,26 +727,27 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state, index++; } - ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, - "NumOperands %d, ArgCount %d, Index %d\n", - walk_state->num_operands, arg_count, index)); + index--; - /* Create the interpreter arguments, in reverse order */ + /* It is the appropriate order to get objects from the Result stack */ - index--; for (i = 0; i < arg_count; i++) { arg = arguments[index]; - walk_state->operand_index = (u8)index; + + /* Force the filling of the operand stack in inverse order */ + + walk_state->operand_index = (u8) index; status = acpi_ds_create_operand(walk_state, arg, index); if (ACPI_FAILURE(status)) { goto cleanup; } - ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, - "Created Arg #%u (%p) %u args total\n", - index, arg, arg_count)); index--; + + ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, + "Arg #%u (%p) done, Arg1=%p\n", index, arg, + first_arg)); } return_ACPI_STATUS(status); diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index a31e549..a9e76bc 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c @@ -87,9 +87,9 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, return_ACPI_STATUS(status); } - status = - acpi_ev_get_gpe_xrupt_block(interrupt_number, &gpe_xrupt_block); - if (ACPI_FAILURE(status)) { + gpe_xrupt_block = acpi_ev_get_gpe_xrupt_block(interrupt_number); + if (!gpe_xrupt_block) { + status = AE_NO_MEMORY; goto unlock_and_exit; } @@ -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: - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); + status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); return_ACPI_STATUS(status); } diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c index 4d764e8..d3f5e1e 100644 --- a/drivers/acpi/acpica/evgpeutil.c +++ b/drivers/acpi/acpica/evgpeutil.c @@ -197,9 +197,8 @@ 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: Status + * RETURN: A GPE interrupt block * * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt * block per unique interrupt level used for GPEs. Should be @@ -208,9 +207,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, * ******************************************************************************/ -acpi_status -acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, - struct acpi_gpe_xrupt_info ** gpe_xrupt_block) +struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number) { struct acpi_gpe_xrupt_info *next_gpe_xrupt; struct acpi_gpe_xrupt_info *gpe_xrupt; @@ -224,8 +221,7 @@ 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) { - *gpe_xrupt_block = next_gpe_xrupt; - return_ACPI_STATUS(AE_OK); + return_PTR(next_gpe_xrupt); } next_gpe_xrupt = next_gpe_xrupt->next; @@ -235,7 +231,7 @@ acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info)); if (!gpe_xrupt) { - return_ACPI_STATUS(AE_NO_MEMORY); + return_PTR(NULL); } gpe_xrupt->interrupt_number = interrupt_number; @@ -254,7 +250,6 @@ 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 */ @@ -264,15 +259,14 @@ acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, acpi_ev_gpe_xrupt_handler, gpe_xrupt); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "Could not install GPE interrupt handler at level 0x%X", - interrupt_number)); - return_ACPI_STATUS(status); + ACPI_ERROR((AE_INFO, + "Could not install GPE interrupt handler at level 0x%X", + interrupt_number)); + return_PTR(NULL); } } - *gpe_xrupt_block = gpe_xrupt; - return_ACPI_STATUS(AE_OK); + return_PTR(gpe_xrupt); } /******************************************************************************* diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c index 7ca6925..acd34f5 100644 --- a/drivers/acpi/acpica/exresnte.c +++ b/drivers/acpi/acpica/exresnte.c @@ -124,8 +124,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, } if (!source_desc) { - ACPI_ERROR((AE_INFO, "No object attached to node [%4.4s] %p", - node->name.ascii, node)); + ACPI_ERROR((AE_INFO, "No object attached to node %p", node)); return_ACPI_STATUS(AE_AML_NO_OPERAND); } diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c index b0c9787..9ba5301 100644 --- a/drivers/acpi/acpica/psopinfo.c +++ b/drivers/acpi/acpica/psopinfo.c @@ -71,10 +71,6 @@ static const u8 acpi_gbl_argument_count[] = const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode) { -#ifdef ACPI_DEBUG_OUTPUT - const char *opcode_name = "Unknown AML opcode"; -#endif - ACPI_FUNCTION_NAME(ps_get_opcode_info); /* @@ -96,54 +92,11 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode) return (&acpi_gbl_aml_op_info [acpi_gbl_long_op_index[(u8)opcode]]); } -#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT -#include "asldefine.h" - - switch (opcode) { - case AML_RAW_DATA_BYTE: - opcode_name = "-Raw Data Byte-"; - break; - - case AML_RAW_DATA_WORD: - opcode_name = "-Raw Data Word-"; - break; - - case AML_RAW_DATA_DWORD: - opcode_name = "-Raw Data Dword-"; - break; - - case AML_RAW_DATA_QWORD: - opcode_name = "-Raw Data Qword-"; - break; - - case AML_RAW_DATA_BUFFER: - opcode_name = "-Raw Data Buffer-"; - break; - - case AML_RAW_DATA_CHAIN: - opcode_name = "-Raw Data Buffer Chain-"; - break; - - case AML_PACKAGE_LENGTH: - opcode_name = "-Package Length-"; - break; - - case AML_UNASSIGNED_OPCODE: - opcode_name = "-Unassigned Opcode-"; - break; - - case AML_DEFAULT_ARG_OP: - opcode_name = "-Default Arg-"; - break; - - default: - break; - } -#endif /* Unknown AML opcode */ - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%4.4X]\n", opcode_name, opcode)); + ACPI_DEBUG_PRINT((ACPI_DB_EXEC, + "Unknown AML opcode [%4.4X]\n", opcode)); return (&acpi_gbl_aml_op_info[_UNK]); } diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 8f89263..9d99f21 100644 --- a/drivers/acpi/acpica/tbfadt.c +++ b/drivers/acpi/acpica/tbfadt.c @@ -56,10 +56,9 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, static void acpi_tb_convert_fadt(void); -static void acpi_tb_setup_fadt_registers(void); +static void acpi_tb_validate_fadt(void); -static u64 -acpi_tb_select_address(char *register_name, u32 address32, u64 address64); +static void acpi_tb_setup_fadt_registers(void); /* Table for conversion of FADT to common internal format and FADT validation */ @@ -176,7 +175,6 @@ static struct acpi_fadt_pm_info fadt_pm_info_table[] = { * space_id - ACPI Space ID for this register * byte_width - Width of this register * address - Address of the register - * register_name - ASCII name of the ACPI register * * RETURN: None * @@ -222,68 +220,6 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, /******************************************************************************* * - * FUNCTION: acpi_tb_select_address - * - * PARAMETERS: register_name - ASCII name of the ACPI register - * address32 - 32-bit address of the register - * address64 - 64-bit address of the register - * - * RETURN: The resolved 64-bit address - * - * DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within - * the FADT. Used for the FACS and DSDT addresses. - * - * NOTES: - * - * Check for FACS and DSDT address mismatches. An address mismatch between - * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and - * DSDT/X_DSDT) could be a corrupted address field or it might indicate - * the presence of two FACS or two DSDT tables. - * - * November 2013: - * By default, as per the ACPICA specification, a valid 64-bit address is - * used regardless of the value of the 32-bit address. However, this - * behavior can be overridden via the acpi_gbl_use32_bit_fadt_addresses flag. - * - ******************************************************************************/ - -static u64 -acpi_tb_select_address(char *register_name, u32 address32, u64 address64) -{ - - if (!address64) { - - /* 64-bit address is zero, use 32-bit address */ - - return ((u64)address32); - } - - if (address32 && (address64 != (u64)address32)) { - - /* Address mismatch between 32-bit and 64-bit versions */ - - ACPI_BIOS_WARNING((AE_INFO, - "32/64X %s address mismatch in FADT: " - "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", - register_name, address32, - ACPI_FORMAT_UINT64(address64), - acpi_gbl_use32_bit_fadt_addresses ? 32 : - 64)); - - /* 32-bit address override */ - - if (acpi_gbl_use32_bit_fadt_addresses) { - return ((u64)address32); - } - } - - /* Default is to use the 64-bit address */ - - return (address64); -} - -/******************************************************************************* - * * FUNCTION: acpi_tb_parse_fadt * * PARAMETERS: table_index - Index for the FADT @@ -395,6 +331,10 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) acpi_tb_convert_fadt(); + /* Validate FADT values now, before we make any changes */ + + acpi_tb_validate_fadt(); + /* Initialize the global ACPI register structures */ acpi_tb_setup_fadt_registers(); @@ -404,55 +344,66 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) * * FUNCTION: acpi_tb_convert_fadt * - * PARAMETERS: none - acpi_gbl_FADT is used. + * PARAMETERS: None, uses acpi_gbl_FADT * * RETURN: None * * DESCRIPTION: Converts all versions of the FADT to a common internal format. - * Expand 32-bit addresses to 64-bit as necessary. Also validate - * important fields within the FADT. + * Expand 32-bit addresses to 64-bit as necessary. * - * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), and must - * contain a copy of the actual BIOS-provided FADT. + * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), + * and must contain a copy of the actual FADT. * * Notes on 64-bit register addresses: * * After this FADT conversion, later ACPICA code will only use the 64-bit "X" * fields of the FADT for all ACPI register addresses. * - * The 64-bit X fields are optional extensions to the original 32-bit FADT + * The 64-bit "X" fields are optional extensions to the original 32-bit FADT * V1.0 fields. Even if they are present in the FADT, they are optional and * are unused if the BIOS sets them to zero. Therefore, we must copy/expand - * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is - * originally zero. + * 32-bit V1.0 fields if the corresponding X field is zero. * - * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address - * fields are expanded to the corresponding 64-bit X fields in the internal - * common FADT. + * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the + * corresponding "X" fields in the internal FADT. * * For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded - * to the corresponding 64-bit X fields, if the 64-bit field is originally - * zero. Adhering to the ACPI specification, we completely ignore the 32-bit - * field if the 64-bit field is valid, regardless of whether the host OS is - * 32-bit or 64-bit. - * - * Possible additional checks: - * (acpi_gbl_FADT.pm1_event_length >= 4) - * (acpi_gbl_FADT.pm1_control_length >= 2) - * (acpi_gbl_FADT.pm_timer_length >= 4) - * Gpe block lengths must be multiple of 2 + * to the corresponding 64-bit X fields. For compatibility with other ACPI + * implementations, we ignore the 64-bit field if the 32-bit field is valid, + * regardless of whether the host OS is 32-bit or 64-bit. * ******************************************************************************/ static void acpi_tb_convert_fadt(void) { - char *name; struct acpi_generic_address *address64; u32 address32; - u8 length; u32 i; /* + * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. + * Later code will always use the X 64-bit field. Also, check for an + * address mismatch between the 32-bit and 64-bit address fields + * (FIRMWARE_CTRL/X_FIRMWARE_CTRL, DSDT/X_DSDT) which would indicate + * the presence of two FACS or two DSDT tables. + */ + if (!acpi_gbl_FADT.Xfacs) { + acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs; + } else if (acpi_gbl_FADT.facs && + (acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) { + ACPI_WARNING((AE_INFO, + "32/64 FACS address mismatch in FADT - two FACS tables!")); + } + + if (!acpi_gbl_FADT.Xdsdt) { + acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt; + } else if (acpi_gbl_FADT.dsdt && + (acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) { + ACPI_WARNING((AE_INFO, + "32/64 DSDT address mismatch in FADT - two DSDT tables!")); + } + + /* * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which * should be zero are indeed zero. This will workaround BIOSs that * inadvertently place values in these fields. @@ -470,24 +421,119 @@ static void acpi_tb_convert_fadt(void) acpi_gbl_FADT.boot_flags = 0; } + /* Update the local FADT table header length */ + + acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt); + /* - * Now we can update the local FADT length to the length of the - * current FADT version as defined by the ACPI specification. - * Thus, we will have a common FADT internally. + * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X" + * generic address structures as necessary. Later code will always use + * the 64-bit address structures. + * + * March 2009: + * We now always use the 32-bit address if it is valid (non-null). This + * is not in accordance with the ACPI specification which states that + * the 64-bit address supersedes the 32-bit version, but we do this for + * compatibility with other ACPI implementations. Most notably, in the + * case where both the 32 and 64 versions are non-null, we use the 32-bit + * version. This is the only address that is guaranteed to have been + * tested by the BIOS manufacturer. */ - acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt); + for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { + address32 = *ACPI_ADD_PTR(u32, + &acpi_gbl_FADT, + fadt_info_table[i].address32); + + address64 = ACPI_ADD_PTR(struct acpi_generic_address, + &acpi_gbl_FADT, + fadt_info_table[i].address64); + + /* + * If both 32- and 64-bit addresses are valid (non-zero), + * they must match. + */ + if (address64->address && address32 && + (address64->address != (u64)address32)) { + ACPI_BIOS_ERROR((AE_INFO, + "32/64X address mismatch in FADT/%s: " + "0x%8.8X/0x%8.8X%8.8X, using 32", + fadt_info_table[i].name, address32, + ACPI_FORMAT_UINT64(address64-> + address))); + } + + /* Always use 32-bit address if it is valid (non-null) */ + + if (address32) { + /* + * Copy the 32-bit address to the 64-bit GAS structure. The + * Space ID is always I/O for 32-bit legacy address fields + */ + acpi_tb_init_generic_address(address64, + ACPI_ADR_SPACE_SYSTEM_IO, + *ACPI_ADD_PTR(u8, + &acpi_gbl_FADT, + fadt_info_table + [i].length), + (u64) address32, + fadt_info_table[i].name); + } + } +} + +/******************************************************************************* + * + * FUNCTION: acpi_tb_validate_fadt + * + * PARAMETERS: table - Pointer to the FADT to be validated + * + * RETURN: None + * + * DESCRIPTION: Validate various important fields within the FADT. If a problem + * is found, issue a message, but no status is returned. + * Used by both the table manager and the disassembler. + * + * Possible additional checks: + * (acpi_gbl_FADT.pm1_event_length >= 4) + * (acpi_gbl_FADT.pm1_control_length >= 2) + * (acpi_gbl_FADT.pm_timer_length >= 4) + * Gpe block lengths must be multiple of 2 + * + ******************************************************************************/ + +static void acpi_tb_validate_fadt(void) +{ + char *name; + struct acpi_generic_address *address64; + u8 length; + u32 i; /* - * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. - * Later ACPICA code will always use the X 64-bit field. + * Check for FACS and DSDT address mismatches. An address mismatch between + * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and + * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. */ - acpi_gbl_FADT.Xfacs = acpi_tb_select_address("FACS", - acpi_gbl_FADT.facs, - acpi_gbl_FADT.Xfacs); + if (acpi_gbl_FADT.facs && + (acpi_gbl_FADT.Xfacs != (u64)acpi_gbl_FADT.facs)) { + ACPI_BIOS_WARNING((AE_INFO, + "32/64X FACS address mismatch in FADT - " + "0x%8.8X/0x%8.8X%8.8X, using 32", + acpi_gbl_FADT.facs, + ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); + + acpi_gbl_FADT.Xfacs = (u64)acpi_gbl_FADT.facs; + } + + if (acpi_gbl_FADT.dsdt && + (acpi_gbl_FADT.Xdsdt != (u64)acpi_gbl_FADT.dsdt)) { + ACPI_BIOS_WARNING((AE_INFO, + "32/64X DSDT address mismatch in FADT - " + "0x%8.8X/0x%8.8X%8.8X, using 32", + acpi_gbl_FADT.dsdt, + ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); - acpi_gbl_FADT.Xdsdt = acpi_tb_select_address("DSDT", - acpi_gbl_FADT.dsdt, - acpi_gbl_FADT.Xdsdt); + acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt; + } /* If Hardware Reduced flag is set, we are all done */ @@ -499,95 +545,18 @@ static void acpi_tb_convert_fadt(void) for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { /* - * Get the 32-bit and 64-bit addresses, as well as the register - * length and register name. + * Generate pointer to the 64-bit address, get the register + * length (width) and the register name */ - address32 = *ACPI_ADD_PTR(u32, - &acpi_gbl_FADT, - fadt_info_table[i].address32); - address64 = ACPI_ADD_PTR(struct acpi_generic_address, &acpi_gbl_FADT, fadt_info_table[i].address64); - - length = *ACPI_ADD_PTR(u8, - &acpi_gbl_FADT, - fadt_info_table[i].length); - + length = + *ACPI_ADD_PTR(u8, &acpi_gbl_FADT, + fadt_info_table[i].length); name = fadt_info_table[i].name; /* - * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X" - * generic address structures as necessary. Later code will always use - * the 64-bit address structures. - * - * November 2013: - * Now always use the 64-bit address if it is valid (non-zero), in - * accordance with the ACPI specification which states that a 64-bit - * address supersedes the 32-bit version. This behavior can be - * overridden by the acpi_gbl_use32_bit_fadt_addresses flag. - * - * During 64-bit address construction and verification, - * these cases are handled: - * - * Address32 zero, Address64 [don't care] - Use Address64 - * - * Address32 non-zero, Address64 zero - Copy/use Address32 - * Address32 non-zero == Address64 non-zero - Use Address64 - * Address32 non-zero != Address64 non-zero - Warning, use Address64 - * - * Override: if acpi_gbl_use32_bit_fadt_addresses is TRUE, and: - * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32 - * - * Note: space_id is always I/O for 32-bit legacy address fields - */ - if (address32) { - if (!address64->address) { - - /* 64-bit address is zero, use 32-bit address */ - - acpi_tb_init_generic_address(address64, - ACPI_ADR_SPACE_SYSTEM_IO, - *ACPI_ADD_PTR(u8, - &acpi_gbl_FADT, - fadt_info_table - [i]. - length), - (u64)address32, - name); - } else if (address64->address != (u64)address32) { - - /* Address mismatch */ - - ACPI_BIOS_WARNING((AE_INFO, - "32/64X address mismatch in FADT/%s: " - "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", - name, address32, - ACPI_FORMAT_UINT64 - (address64->address), - acpi_gbl_use32_bit_fadt_addresses - ? 32 : 64)); - - if (acpi_gbl_use32_bit_fadt_addresses) { - - /* 32-bit address override */ - - acpi_tb_init_generic_address(address64, - ACPI_ADR_SPACE_SYSTEM_IO, - *ACPI_ADD_PTR - (u8, - &acpi_gbl_FADT, - fadt_info_table - [i]. - length), - (u64) - address32, - name); - } - } - } - - /* * For each extended field, check for length mismatch between the * legacy length field and the corresponding 64-bit X length field. * Note: If the legacy length field is > 0xFF bits, ignore this diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 6412d3c..3d6bb83 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -49,11 +49,69 @@ ACPI_MODULE_NAME("tbutils") /* Local prototypes */ -static acpi_status acpi_tb_validate_xsdt(acpi_physical_address address); - static acpi_physical_address acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size); +/******************************************************************************* + * + * FUNCTION: acpi_tb_check_xsdt + * + * PARAMETERS: address - Pointer to the XSDT + * + * RETURN: status + * AE_OK - XSDT is okay + * AE_NO_MEMORY - can't map XSDT + * AE_INVALID_TABLE_LENGTH - invalid table length + * AE_NULL_ENTRY - XSDT has NULL entry + * + * DESCRIPTION: validate XSDT +******************************************************************************/ + +static acpi_status +acpi_tb_check_xsdt(acpi_physical_address address) +{ + struct acpi_table_header *table; + u32 length; + u64 xsdt_entry_address; + u8 *table_entry; + u32 table_count; + int i; + + table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); + if (!table) + return AE_NO_MEMORY; + + length = table->length; + acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); + if (length < sizeof(struct acpi_table_header)) + return AE_INVALID_TABLE_LENGTH; + + table = acpi_os_map_memory(address, length); + if (!table) + return AE_NO_MEMORY; + + /* Calculate the number of tables described in XSDT */ + table_count = + (u32) ((table->length - + sizeof(struct acpi_table_header)) / sizeof(u64)); + table_entry = + ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); + for (i = 0; i < table_count; i++) { + ACPI_MOVE_64_TO_64(&xsdt_entry_address, table_entry); + if (!xsdt_entry_address) { + /* XSDT has NULL entry */ + break; + } + table_entry += sizeof(u64); + } + acpi_os_unmap_memory(table, length); + + if (i < table_count) + return AE_NULL_ENTRY; + else + return AE_OK; +} + #if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * @@ -325,7 +383,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) * Get the table physical address (32-bit for RSDT, 64-bit for XSDT): * Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT */ - if (table_entry_size == ACPI_RSDT_ENTRY_SIZE) { + if (table_entry_size == sizeof(u32)) { /* * 32-bit platform, RSDT: Return 32-bit table entry * 64-bit platform, RSDT: Expand 32-bit to 64-bit and return @@ -357,87 +415,6 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) /******************************************************************************* * - * FUNCTION: acpi_tb_validate_xsdt - * - * PARAMETERS: address - Physical address of the XSDT (from RSDP) - * - * RETURN: Status. AE_OK if the table appears to be valid. - * - * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does - * not contain any NULL entries. A problem that is seen in the - * field is that the XSDT exists, but is actually useless because - * of one or more (or all) NULL entries. - * - ******************************************************************************/ - -static acpi_status acpi_tb_validate_xsdt(acpi_physical_address xsdt_address) -{ - struct acpi_table_header *table; - u8 *next_entry; - acpi_physical_address address; - u32 length; - u32 entry_count; - acpi_status status; - u32 i; - - /* Get the XSDT length */ - - table = - acpi_os_map_memory(xsdt_address, sizeof(struct acpi_table_header)); - if (!table) { - return (AE_NO_MEMORY); - } - - length = table->length; - acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); - - /* - * Minimum XSDT length is the size of the standard ACPI header - * plus one physical address entry - */ - if (length < (sizeof(struct acpi_table_header) + ACPI_XSDT_ENTRY_SIZE)) { - return (AE_INVALID_TABLE_LENGTH); - } - - /* Map the entire XSDT */ - - table = acpi_os_map_memory(xsdt_address, length); - if (!table) { - return (AE_NO_MEMORY); - } - - /* Get the number of entries and pointer to first entry */ - - status = AE_OK; - next_entry = ACPI_ADD_PTR(u8, table, sizeof(struct acpi_table_header)); - entry_count = (u32)((table->length - sizeof(struct acpi_table_header)) / - ACPI_XSDT_ENTRY_SIZE); - - /* Validate each entry (physical address) within the XSDT */ - - for (i = 0; i < entry_count; i++) { - address = - acpi_tb_get_root_table_entry(next_entry, - ACPI_XSDT_ENTRY_SIZE); - if (!address) { - - /* Detected a NULL entry, XSDT is invalid */ - - status = AE_NULL_ENTRY; - break; - } - - next_entry += ACPI_XSDT_ENTRY_SIZE; - } - - /* Unmap table */ - - acpi_os_unmap_memory(table, length); - return (status); -} - -/******************************************************************************* - * * FUNCTION: acpi_tb_parse_root_table * * PARAMETERS: rsdp - Pointer to the RSDP @@ -461,14 +438,16 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) u32 table_count; struct acpi_table_header *table; acpi_physical_address address; + acpi_physical_address uninitialized_var(rsdt_address); u32 length; u8 *table_entry; acpi_status status; ACPI_FUNCTION_TRACE(tb_parse_root_table); - /* Map the entire RSDP and extract the address of the RSDT or XSDT */ - + /* + * Map the entire RSDP and extract the address of the RSDT or XSDT + */ rsdp = acpi_os_map_memory(rsdp_address, sizeof(struct acpi_table_rsdp)); if (!rsdp) { return_ACPI_STATUS(AE_NO_MEMORY); @@ -478,22 +457,24 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) ACPI_CAST_PTR(struct acpi_table_header, rsdp)); - /* Use XSDT if present and not overridden. Otherwise, use RSDT */ + /* Differentiate between RSDT and XSDT root tables */ - if ((rsdp->revision > 1) && - rsdp->xsdt_physical_address && !acpi_gbl_do_not_use_xsdt) { + if (rsdp->revision > 1 && rsdp->xsdt_physical_address + && !acpi_rsdt_forced) { /* - * RSDP contains an XSDT (64-bit physical addresses). We must use - * the XSDT if the revision is > 1 and the XSDT pointer is present, - * as per the ACPI specification. + * Root table is an XSDT (64-bit physical addresses). We must use the + * XSDT if the revision is > 1 and the XSDT pointer is present, as per + * the ACPI specification. */ address = (acpi_physical_address) rsdp->xsdt_physical_address; - table_entry_size = ACPI_XSDT_ENTRY_SIZE; + table_entry_size = sizeof(u64); + rsdt_address = (acpi_physical_address) + rsdp->rsdt_physical_address; } else { /* Root table is an RSDT (32-bit physical addresses) */ address = (acpi_physical_address) rsdp->rsdt_physical_address; - table_entry_size = ACPI_RSDT_ENTRY_SIZE; + table_entry_size = sizeof(u32); } /* @@ -502,25 +483,15 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) */ acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp)); - /* - * If it is present and used, validate the XSDT for access/size - * and ensure that all table entries are at least non-NULL - */ - if (table_entry_size == ACPI_XSDT_ENTRY_SIZE) { - status = acpi_tb_validate_xsdt(address); - if (ACPI_FAILURE(status)) { - ACPI_BIOS_WARNING((AE_INFO, - "XSDT is invalid (%s), using RSDT", - acpi_format_exception(status))); - - /* Fall back to the RSDT */ - - address = - (acpi_physical_address) rsdp->rsdt_physical_address; - table_entry_size = ACPI_RSDT_ENTRY_SIZE; + if (table_entry_size == sizeof(u64)) { + if (acpi_tb_check_xsdt(address) == AE_NULL_ENTRY) { + /* XSDT has NULL entry, RSDT is used */ + address = rsdt_address; + table_entry_size = sizeof(u32); + ACPI_WARNING((AE_INFO, "BIOS XSDT has NULL entry, " + "using RSDT")); } } - /* Map the RSDT/XSDT table header to get the full table length */ table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); @@ -530,14 +501,12 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) acpi_tb_print_table_header(address, table); - /* - * Validate length of the table, and map entire table. - * Minimum length table must contain at least one entry. - */ + /* Get the length of the full table, verify length and map entire table */ + length = table->length; acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); - if (length < (sizeof(struct acpi_table_header) + table_entry_size)) { + if (length < sizeof(struct acpi_table_header)) { ACPI_BIOS_ERROR((AE_INFO, "Invalid table length 0x%X in RSDT/XSDT", length)); @@ -557,21 +526,22 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) return_ACPI_STATUS(status); } - /* Get the number of entries and pointer to first entry */ + /* Calculate the number of tables described in the root table */ table_count = (u32)((table->length - sizeof(struct acpi_table_header)) / table_entry_size); - table_entry = ACPI_ADD_PTR(u8, table, sizeof(struct acpi_table_header)); - /* * First two entries in the table array are reserved for the DSDT * and FACS, which are not actually present in the RSDT/XSDT - they * come from the FADT */ + table_entry = + ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); acpi_gbl_root_table_list.current_table_count = 2; - /* Initialize the root table array from the RSDT/XSDT */ - + /* + * Initialize the root table array from the RSDT/XSDT + */ for (i = 0; i < table_count; i++) { if (acpi_gbl_root_table_list.current_table_count >= acpi_gbl_root_table_list.max_table_count) { @@ -614,7 +584,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) acpi_tb_install_table(acpi_gbl_root_table_list.tables[i]. address, NULL, i); - /* Special case for FADT - validate it then get the DSDT and FACS */ + /* Special case for FADT - get the DSDT and FACS */ if (ACPI_COMPARE_NAME (&acpi_gbl_root_table_list.tables[i].signature, diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c index 2c2b6ae..e0a2e27 100644 --- a/drivers/acpi/acpica/utaddress.c +++ b/drivers/acpi/acpica/utaddress.c @@ -224,11 +224,10 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id, while (range_info) { /* - * Check if the requested address/length overlaps this - * address range. There are four cases to consider: + * Check if the requested Address/Length overlaps this address_range. + * Four cases to consider: * - * 1) Input address/length is contained completely in the - * address range + * 1) Input address/length is contained completely in the address range * 2) Input address/length overlaps range at the range start * 3) Input address/length overlaps range at the range end * 4) Input address/length completely encompasses the range @@ -245,17 +244,11 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id, region_node); ACPI_WARNING((AE_INFO, - "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)", - acpi_ut_get_region_name(space_id), + "0x%p-0x%p %s conflicts with Region %s %d", ACPI_CAST_PTR(void, address), ACPI_CAST_PTR(void, end_address), - ACPI_CAST_PTR(void, - range_info-> - start_address), - ACPI_CAST_PTR(void, - range_info-> - end_address), - pathname)); + acpi_ut_get_region_name(space_id), + pathname, overlap_count)); ACPI_FREE(pathname); } } diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index 030cb0d..81f9a95 100644 --- a/drivers/acpi/acpica/utglobal.c +++ b/drivers/acpi/acpica/utglobal.c @@ -388,7 +388,11 @@ acpi_status acpi_ut_init_globals(void) /* Public globals */ ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) + ACPI_EXPORT_SYMBOL(acpi_dbg_level) + ACPI_EXPORT_SYMBOL(acpi_dbg_layer) + ACPI_EXPORT_SYMBOL(acpi_gpe_count) + ACPI_EXPORT_SYMBOL(acpi_current_gpe_count) diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c index 246ef68..75efea0 100644 --- a/drivers/acpi/acpica/utxfinit.c +++ b/drivers/acpi/acpica/utxfinit.c @@ -122,16 +122,8 @@ acpi_status __init acpi_initialize_subsystem(void) /* If configured, initialize the AML debugger */ -#ifdef ACPI_DEBUGGER - status = acpi_db_initialize(); - if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, - "During Debugger initialization")); - return_ACPI_STATUS(status); - } -#endif - - return_ACPI_STATUS(AE_OK); + ACPI_DEBUGGER_EXEC(status = acpi_db_initialize()); + return_ACPI_STATUS(status); } ACPI_EXPORT_SYMBOL_INIT(acpi_initialize_subsystem) diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index fea6773..4a7e7f3 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20131218 +#define ACPI_CA_VERSION 0x20131115 #include #include @@ -54,6 +54,7 @@ #include extern u8 acpi_gbl_permanent_mmap; +extern u32 acpi_rsdt_forced; /* * Globals that are publically available @@ -71,6 +72,7 @@ extern u32 acpi_dbg_layer; /* ACPICA runtime options */ +extern u8 acpi_gbl_enable_interpreter_slack; extern u8 acpi_gbl_all_methods_serialized; extern u8 acpi_gbl_copy_dsdt_locally; extern u8 acpi_gbl_create_osi_method; @@ -80,9 +82,14 @@ extern u8 acpi_gbl_do_not_use_xsdt; extern u8 acpi_gbl_enable_aml_debug_object; extern u8 acpi_gbl_enable_interpreter_slack; extern u32 acpi_gbl_trace_flags; +extern u8 acpi_gbl_use_default_register_widths; extern acpi_name acpi_gbl_trace_method_name; +extern u32 acpi_gbl_trace_flags; +extern u8 acpi_gbl_enable_aml_debug_object; +extern u8 acpi_gbl_copy_dsdt_locally; extern u8 acpi_gbl_truncate_io_addresses; -extern u8 acpi_gbl_use32_bit_fadt_addresses; +extern u8 acpi_gbl_disable_auto_repair; +extern u8 acpi_gbl_disable_ssdt_table_load; extern u8 acpi_gbl_use_default_register_widths; /* @@ -131,9 +138,10 @@ acpi_status __init acpi_terminate(void); * Miscellaneous global interfaces */ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) #ifdef ACPI_FUTURE_USAGE -acpi_status acpi_subsystem_status(void); + acpi_status acpi_subsystem_status(void); #endif #ifdef ACPI_FUTURE_USAGE @@ -278,13 +286,16 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_install_sci_handler(acpi_sci_handler address, void *context)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_remove_sci_handler(acpi_sci_handler address)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_install_global_event_handler (acpi_gbl_event_handler handler, void *context)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_install_fixed_event_handler(u32 acpi_event, @@ -292,10 +303,12 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status handler, void *context)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_install_gpe_handler(acpi_handle gpe_device, @@ -304,14 +317,15 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_gpe_handler address, void *context)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_remove_gpe_handler(acpi_handle gpe_device, u32 gpe_number, acpi_gpe_handler address)) acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, - acpi_notify_handler handler, - void *context); + acpi_notify_handler handler, + void *context); acpi_status acpi_remove_notify_handler(acpi_handle device, @@ -360,6 +374,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_event(u32 event, u32 flags)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status @@ -397,16 +412,20 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status parent_device, acpi_handle gpe_device, u32 gpe_number)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_gpe_status(acpi_handle gpe_device, u32 gpe_number, acpi_event_status *event_status)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status @@ -420,6 +439,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status *gpe_block_address, u32 register_count, u32 interrupt_number)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_remove_gpe_block(acpi_handle gpe_device)) @@ -520,6 +540,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status #ifdef ACPI_FUTURE_USAGE ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer_resolution(u32 *resolution)) + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 325aeae..9497088 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -182,9 +182,6 @@ struct acpi_table_xsdt { u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ }; -#define ACPI_RSDT_ENTRY_SIZE (sizeof (u32)) -#define ACPI_XSDT_ENTRY_SIZE (sizeof (u64)) - /******************************************************************************* * * FACS - Firmware ACPI Control Structure (FACS) diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 094a906..40f7ed1 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -327,11 +327,6 @@ struct acpi_table_dbg2 { u32 info_count; }; -struct acpi_dbg2_header { - u32 info_offset; - u32 info_count; -}; - /* Debug Device Information Subtable */ struct acpi_dbg2_device { diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index 01c2a90..e2c0931 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h @@ -374,22 +374,16 @@ struct acpi_mpst_shared { struct acpi_table_pcct { struct acpi_table_header header; /* Common ACPI table header */ u32 flags; - u64 reserved; + u32 latency; + u32 reserved; }; /* Values for Flags field above */ #define ACPI_PCCT_DOORBELL 1 -/* Values for subtable type in struct acpi_subtable_header */ - -enum acpi_pcct_type { - ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, - ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */ -}; - /* - * PCCT Subtables, correspond to Type in struct acpi_subtable_header + * PCCT subtables */ /* 0: Generic Communications Subspace */ @@ -402,9 +396,6 @@ struct acpi_pcct_subspace { struct acpi_generic_address doorbell_register; u64 preserve_mask; u64 write_mask; - u32 latency; - u32 max_access_rate; - u16 min_turnaround_time; }; /* diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index b402eb6..974d3ef 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -96,14 +96,13 @@ #endif /* - * acpi_bin/acpi_dump/acpi_src/acpi_xtract/Example configuration. All single + * acpi_bin/acpi_dump/acpi_src/acpi_xtract configuration. All single * threaded, with no debug output. */ -#if (defined ACPI_BIN_APP) || \ - (defined ACPI_DUMP_APP) || \ - (defined ACPI_SRC_APP) || \ - (defined ACPI_XTRACT_APP) || \ - (defined ACPI_EXAMPLE_APP) +#if (defined ACPI_BIN_APP) || \ + (defined ACPI_DUMP_APP) || \ + (defined ACPI_SRC_APP) || \ + (defined ACPI_XTRACT_APP) #define ACPI_APPLICATION #define ACPI_SINGLE_THREADED #endif @@ -395,13 +394,4 @@ typedef char *va_list; #endif /* ACPI_USE_SYSTEM_CLIBRARY */ -#ifndef ACPI_FILE -#ifdef ACPI_APPLICATION -#include -#define ACPI_FILE FILE * -#else -#define ACPI_FILE void * -#endif /* ACPI_APPLICATION */ -#endif /* ACPI_FILE */ - #endif /* __ACENV_H__ */