From bb3fec146c8561441db058db07b3fbdd7fe7e1df Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 8 Jan 2014 13:43:23 +0800 Subject: ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change. This macro is no longer used by ACPICA and it is not public. Also update comments related to the use of ACPI_ALLOCATE_BUFFER and the use of acpi_os_free (kfree is equivalent and prefered in the kernel) to free the buffer. Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- include/acpi/actypes.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 809b1a0fee7f..68a3ada689c9 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -928,22 +928,14 @@ struct acpi_object_list { * Miscellaneous common Data Structures used by the interfaces */ #define ACPI_NO_BUFFER 0 -#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) -#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) +#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) /* Let ACPICA allocate buffer */ +#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) /* For internal use only (enables tracking) */ struct acpi_buffer { acpi_size length; /* Length in bytes of the buffer */ void *pointer; /* pointer to buffer */ }; -/* - * Free a buffer created in an struct acpi_buffer 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 internal allocation tracking - * mechanism (if it is enabled). - */ -#define ACPI_FREE_BUFFER(b) acpi_os_free((b).pointer) - /* * name_type for acpi_get_name */ -- cgit v1.2.3 From b1c1029d72730bd18cee3518965cf699af708322 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 8 Jan 2014 13:43:29 +0800 Subject: ACPICA: Linux Header: Remove unused OSL prototypes. This patch removes 2 useless OSL prototypes as they are not used by Linux now. Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- include/acpi/platform/aclinux.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 28f4f4dba0b6..008aa287c7a9 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -239,10 +239,6 @@ void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); */ void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size); -void acpi_os_gpe_count(u32 gpe_number); - -void acpi_os_fixed_event_count(u32 fixed_event_number); - #endif /* __KERNEL__ */ #endif /* __ACLINUX_H__ */ -- cgit v1.2.3 From 671cc68dc61f029d44b43a681356078e02d8dab8 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 8 Jan 2014 13:43:34 +0800 Subject: ACPICA: Back port and refine validation of the XSDT root table. Some platforms contain an XSDT that is ill-formed or otherwise invalid (such as containing some or all entries that are NULL pointers). This change adds a new function to validate the XSDT before actually using it. If the XSDT is found to be invalid, ACPICA will now fall back to using the RSDT instead. This feature is already in the Linux kernel. When it is back ported to ACPICA, code is refined to follow ACPICA coding style and this patch is the generation of the integration. Original-by: Zhao Yakui Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/tbutils.c | 210 ++++++++++++++++++++++++------------------ include/acpi/actbl.h | 3 + 2 files changed, 123 insertions(+), 90 deletions(-) (limited to 'include/acpi') diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 3d6bb83aa7e7..ee6067062cdc 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -49,69 +49,11 @@ 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) /******************************************************************************* * @@ -383,7 +325,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 == sizeof(u32)) { + if (table_entry_size == ACPI_RSDT_ENTRY_SIZE) { /* * 32-bit platform, RSDT: Return 32-bit table entry * 64-bit platform, RSDT: Expand 32-bit to 64-bit and return @@ -413,6 +355,87 @@ 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 @@ -438,16 +461,14 @@ 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); @@ -459,22 +480,20 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) /* Differentiate between RSDT and XSDT root tables */ - if (rsdp->revision > 1 && rsdp->xsdt_physical_address + if ((rsdp->revision > 1) && rsdp->xsdt_physical_address && !acpi_rsdt_forced) { /* - * 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. + * 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. */ address = (acpi_physical_address) rsdp->xsdt_physical_address; - table_entry_size = sizeof(u64); - rsdt_address = (acpi_physical_address) - rsdp->rsdt_physical_address; + table_entry_size = ACPI_XSDT_ENTRY_SIZE; } else { /* Root table is an RSDT (32-bit physical addresses) */ address = (acpi_physical_address) rsdp->rsdt_physical_address; - table_entry_size = sizeof(u32); + table_entry_size = ACPI_RSDT_ENTRY_SIZE; } /* @@ -483,15 +502,25 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) */ acpi_os_unmap_memory(rsdp, sizeof(struct acpi_table_rsdp)); - 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")); + /* + * If it is present, 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; } } + /* Map the RSDT/XSDT table header to get the full table length */ table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); @@ -501,12 +530,14 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) acpi_tb_print_table_header(address, table); - /* Get the length of the full table, verify length and map entire table */ - + /* + * Validate length of the table, and map entire table. + * Minimum length table must contain at least one entry. + */ length = table->length; acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); - if (length < sizeof(struct acpi_table_header)) { + if (length < (sizeof(struct acpi_table_header) + table_entry_size)) { ACPI_BIOS_ERROR((AE_INFO, "Invalid table length 0x%X in RSDT/XSDT", length)); @@ -526,22 +557,21 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) return_ACPI_STATUS(status); } - /* Calculate the number of tables described in the root table */ + /* Get the number of entries and pointer to first entry */ 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) { @@ -584,7 +614,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 - get the DSDT and FACS */ + /* Special case for FADT - validate it then get the DSDT and FACS */ if (ACPI_COMPARE_NAME (&acpi_gbl_root_table_list.tables[i].signature, diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 94970880126f..325aeae1fa99 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -182,6 +182,9 @@ 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) -- cgit v1.2.3 From fab4610583855d544394320d47fccb43305a6398 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 8 Jan 2014 13:43:40 +0800 Subject: ACPICA: Cleanup the option of forcing the use of the RSDT. This change adds a runtime option that will force ACPICA to use the RSDT instead of the XSDT. Although the ACPI spec requires that an XSDT be used instead of the RSDT, the XSDT has been found to be corrupt or ill-formed on some machines. This option is already in the Linux kernel. When it is back ported to ACPICA, code is re-written to follow ACPICA coding style. This patch is the generation of the integration. Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- arch/ia64/kernel/acpi.c | 1 - arch/x86/kernel/acpi/boot.c | 3 +-- drivers/acpi/acpica/acglobal.h | 8 ++++++++ drivers/acpi/acpica/tbutils.c | 10 +++++----- include/acpi/acpixf.h | 16 ++++++++-------- 5 files changed, 22 insertions(+), 16 deletions(-) (limited to 'include/acpi') diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 59d52e3aef12..28dc6ba6690a 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -61,7 +61,6 @@ #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 6c0b43bd024b..0b0b91b83d51 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -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); @@ -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) { diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index e9f1fc7f99c7..cffb45742aa5 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h @@ -118,6 +118,14 @@ 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 truncate I/O addresses to 16 bits. Provides compatibility * with other ACPI implementations. NOTE: During ACPICA initialization, diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index ee6067062cdc..6412d3c301cb 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -478,10 +478,10 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) ACPI_CAST_PTR(struct acpi_table_header, rsdp)); - /* Differentiate between RSDT and XSDT root tables */ + /* Use XSDT if present and not overridden. Otherwise, use RSDT */ - if ((rsdp->revision > 1) && rsdp->xsdt_physical_address - && !acpi_rsdt_forced) { + if ((rsdp->revision > 1) && + rsdp->xsdt_physical_address && !acpi_gbl_do_not_use_xsdt) { /* * RSDP contains an XSDT (64-bit physical addresses). We must use * the XSDT if the revision is > 1 and the XSDT pointer is present, @@ -503,8 +503,8 @@ 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, validate the XSDT for access/size and ensure - * that all table entries are at least non-NULL + * 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); diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 4278aba96503..30b01f889538 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -54,7 +54,6 @@ #include extern u8 acpi_gbl_permanent_mmap; -extern u32 acpi_rsdt_forced; /* * Globals that are publically available @@ -72,17 +71,18 @@ 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_create_osi_method; -extern u8 acpi_gbl_use_default_register_widths; -extern acpi_name acpi_gbl_trace_method_name; -extern u32 acpi_gbl_trace_flags; -extern bool acpi_gbl_enable_aml_debug_object; extern u8 acpi_gbl_copy_dsdt_locally; -extern u8 acpi_gbl_truncate_io_addresses; +extern u8 acpi_gbl_create_osi_method; extern u8 acpi_gbl_disable_auto_repair; extern u8 acpi_gbl_disable_ssdt_table_load; +extern u8 acpi_gbl_do_not_use_xsdt; +extern bool acpi_gbl_enable_aml_debug_object; +extern u8 acpi_gbl_enable_interpreter_slack; +extern u32 acpi_gbl_trace_flags; +extern acpi_name acpi_gbl_trace_method_name; +extern u8 acpi_gbl_truncate_io_addresses; +extern u8 acpi_gbl_use_default_register_widths; /* * Hardware-reduced prototypes. All interfaces that use these macros will -- cgit v1.2.3 From 0249ed2444d65d65fc3f3f64f398f1ad0b7e54cd Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 8 Jan 2014 13:43:46 +0800 Subject: ACPICA: Add option to favor 32-bit FADT addresses. This change adds an option to favor 32-bit FADT addresses when there is a conflict between the 32-bit and 64-bit versions of the same address. The default behavior is to use the 64-bit version in accordance with the ACPI specification. This can now be overridden via the AcpiGbl_Use32BitFadtAddresses flag. Lv Zheng. Also, the "Convert FADT" and "Verify FADT" functions have been merged to simplify the code, make it easier to understand, and make it easier to maintain. Bob Moore. References: https://bugs.acpica.org/show_bug.cgi?id=885 References: https://bugs.acpica.org/show_bug.cgi?id=993 Original-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acglobal.h | 10 ++ drivers/acpi/acpica/tbfadt.c | 335 ++++++++++++++++++++++------------------- include/acpi/acpixf.h | 1 + 3 files changed, 194 insertions(+), 152 deletions(-) (limited to 'include/acpi') diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index cffb45742aa5..268699879904 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h @@ -126,6 +126,16 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE); */ 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, diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 9d99f2189693..8f89263ac47e 100644 --- a/drivers/acpi/acpica/tbfadt.c +++ b/drivers/acpi/acpica/tbfadt.c @@ -56,10 +56,11 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, static void acpi_tb_convert_fadt(void); -static void acpi_tb_validate_fadt(void); - static void acpi_tb_setup_fadt_registers(void); +static u64 +acpi_tb_select_address(char *register_name, u32 address32, u64 address64); + /* Table for conversion of FADT to common internal format and FADT validation */ typedef struct acpi_fadt_info { @@ -175,6 +176,7 @@ 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 * @@ -218,6 +220,68 @@ acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, generic_address->access_width = 0; /* Access width ANY */ } +/******************************************************************************* + * + * 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 @@ -331,10 +395,6 @@ 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(); @@ -344,65 +404,54 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) * * FUNCTION: acpi_tb_convert_fadt * - * PARAMETERS: None, uses acpi_gbl_FADT + * PARAMETERS: none - acpi_gbl_FADT is used. * * RETURN: None * * DESCRIPTION: Converts all versions of the FADT to a common internal format. - * Expand 32-bit addresses to 64-bit as necessary. + * Expand 32-bit addresses to 64-bit as necessary. Also validate + * important fields within the FADT. * - * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), - * and must contain a copy of the actual FADT. + * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), and must + * contain a copy of the actual BIOS-provided 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 if the corresponding X field is zero. + * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is + * originally zero. * - * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the - * corresponding "X" fields in the internal FADT. + * 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 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded - * 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. + * 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 * ******************************************************************************/ 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 @@ -421,119 +470,24 @@ 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); - /* - * 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. + * 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. */ - 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; + acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt); /* - * 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. + * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. + * Later ACPICA code will always use the X 64-bit field. */ - 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.Xfacs = acpi_tb_select_address("FACS", + acpi_gbl_FADT.facs, + acpi_gbl_FADT.Xfacs); - acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt; - } + acpi_gbl_FADT.Xdsdt = acpi_tb_select_address("DSDT", + acpi_gbl_FADT.dsdt, + acpi_gbl_FADT.Xdsdt); /* If Hardware Reduced flag is set, we are all done */ @@ -545,17 +499,94 @@ static void acpi_tb_validate_fadt(void) for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { /* - * Generate pointer to the 64-bit address, get the register - * length (width) and the register name + * Get the 32-bit and 64-bit addresses, as well as the register + * length and 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. diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 30b01f889538..01ba80b1f91f 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -82,6 +82,7 @@ extern u8 acpi_gbl_enable_interpreter_slack; extern u32 acpi_gbl_trace_flags; extern acpi_name acpi_gbl_trace_method_name; extern u8 acpi_gbl_truncate_io_addresses; +extern u8 acpi_gbl_use32_bit_fadt_addresses; extern u8 acpi_gbl_use_default_register_widths; /* -- cgit v1.2.3 From 774552229afe908f630f7f7b276ae3c28d544742 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 8 Jan 2014 13:43:52 +0800 Subject: ACPICA: Tables: Add full support for the DBG2 table. Updates the DBG2 (Debug Port 2) table definition in the actbl2.h header. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- include/acpi/actbl2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/acpi') diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 40f7ed115452..094a906a0e98 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -327,6 +327,11 @@ 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 { -- cgit v1.2.3 From f0d73664c14db3bac3389435ac572306ce59c9b2 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 8 Jan 2014 13:43:57 +0800 Subject: ACPICA: Tables: Add full support for the PCCT table, update table definition. Updates the PCCT table definition in the actbl3.h header. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- include/acpi/actbl3.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index e2c0931a3d67..01c2a9013e40 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h @@ -374,16 +374,22 @@ struct acpi_mpst_shared { struct acpi_table_pcct { struct acpi_table_header header; /* Common ACPI table header */ u32 flags; - u32 latency; - u32 reserved; + u64 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 + * PCCT Subtables, correspond to Type in struct acpi_subtable_header */ /* 0: Generic Communications Subspace */ @@ -396,6 +402,9 @@ 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; }; /* -- cgit v1.2.3 From 36f3615152c139cfb4f4789fd6f3c84d32f142da Mon Sep 17 00:00:00 2001 From: Betty Dall Date: Wed, 8 Jan 2014 13:44:04 +0800 Subject: ACPICA: Add helper macros to extract bus/segment numbers from HEST table. This change adds two macros to extract the encoded bus and segment numbers from the HEST Bus field. Signed-off-by: Betty Dall Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- include/acpi/actbl1.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include/acpi') diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 556c83ee6b42..4ec8c194bfe5 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -457,7 +457,7 @@ struct acpi_hest_aer_common { u8 enabled; u32 records_to_preallocate; u32 max_sections_per_record; - u32 bus; + u32 bus; /* Bus and Segment numbers */ u16 device; u16 function; u16 device_control; @@ -473,6 +473,14 @@ struct acpi_hest_aer_common { #define ACPI_HEST_FIRMWARE_FIRST (1) #define ACPI_HEST_GLOBAL (1<<1) +/* + * Macros to access the bus/segment numbers in Bus field above: + * Bus number is encoded in bits 7:0 + * Segment number is encoded in bits 23:8 + */ +#define ACPI_HEST_BUS(bus) ((bus) & 0xFF) +#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF) + /* Hardware Error Notification */ struct acpi_hest_notify { -- cgit v1.2.3 From a2c8633b406deb8e79cccbefc06786878d33c6e4 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 8 Jan 2014 13:44:45 +0800 Subject: ACPICA: Update ACPI example code to make it an actual working program. Previously, the example code (tools/examples) showed the ACPICA init code, but was not an actual working program. Added ACPI tables to make it actually function. Linux kernel behaviour is not affected as the change only applies to the ACPICA userspace utilities which are not shipped in the kernel currently. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- include/acpi/platform/acenv.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/acpi') diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 974d3ef7c141..9c9031381792 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -96,13 +96,14 @@ #endif /* - * acpi_bin/acpi_dump/acpi_src/acpi_xtract configuration. All single + * acpi_bin/acpi_dump/acpi_src/acpi_xtract/Example 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) +#if (defined ACPI_BIN_APP) || \ + (defined ACPI_DUMP_APP) || \ + (defined ACPI_SRC_APP) || \ + (defined ACPI_XTRACT_APP) || \ + (defined ACPI_EXAMPLE_APP) #define ACPI_APPLICATION #define ACPI_SINGLE_THREADED #endif -- cgit v1.2.3 From ed6069445dbfd765d0b652aba8589eb8a6a0a197 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 8 Jan 2014 13:44:56 +0800 Subject: ACPICA: Linuxize: Cleanup spaces after special macro invocations. This patch reflects the improvment of a cleanup step which is performed in the release process. There are still spaces in the "linuxized" ACPICA files after special macro invocations. This is because indent treats comments and pre-processor directives as spaces, thus we need to skip them. Before applying this patch, cleanup code will search from keyword back to end of line and wipe spaces between them. After applying this patch, cleanup code will search to the end of the macro invocations, skip "empty lines", "comments" and "pre-processor directives", then wipe the spaces between the new line and the first non-spaces characters. Following improvements are thus achieved in the release automation by this commit which are originally maintained manually: - acpi_status acpi_ev_remove_global_lock_handler(void); +acpi_status acpi_ev_remove_global_lock_handler(void); - acpi_status +acpi_status acpi_ev_match_gpe_method(acpi_handle obj_handle, - acpi_status acpi_subsystem_status(void); +acpi_status acpi_subsystem_status(void); - acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, +acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, - acpi_status +acpi_status acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout); - acpi_status +acpi_status acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b); - acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); Some empty lines are restored by this commit due to the change of the removal implementation. Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acdebug.h | 1 - drivers/acpi/acpica/acevents.h | 5 ++--- drivers/acpi/acpica/utglobal.c | 4 ---- include/acpi/acpixf.h | 20 +++----------------- 4 files changed, 5 insertions(+), 25 deletions(-) (limited to 'include/acpi') diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h index a9fd0b872062..2bf3ca2b8a7a 100644 --- a/drivers/acpi/acpica/acdebug.h +++ b/drivers/acpi/acpica/acdebug.h @@ -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)) /* diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index 073830512d84..0fb0adf435d6 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h @@ -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 @@ -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); diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index 81f9a9584451..030cb0dc673c 100644 --- a/drivers/acpi/acpica/utglobal.c +++ b/drivers/acpi/acpica/utglobal.c @@ -388,11 +388,7 @@ 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/include/acpi/acpixf.h b/include/acpi/acpixf.h index 01ba80b1f91f..cfe929b23d8a 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -131,10 +131,9 @@ 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 @@ -279,16 +278,13 @@ 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, @@ -296,12 +292,10 @@ 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, @@ -310,15 +304,14 @@ 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, @@ -367,7 +360,6 @@ 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 @@ -405,20 +397,16 @@ 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 @@ -432,7 +420,6 @@ 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)) @@ -533,7 +520,6 @@ 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 -- cgit v1.2.3 From 71487f3ffd77a33a5335e8350e8828daa0941c28 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 8 Jan 2014 13:45:02 +0800 Subject: ACPICA: Utilities: Cleanup declarations of the acpi_gbl_debug_file global. This global is acting as an OSL global variable, implemented in the oswinxf.c and osunixxf.c. This patch cleans up the definition of this variable so that new utilities do not need to define it in order to link. Linux kernel behaviour is not affected as the changes only applies to the ACPICA userspace utilities which are not shipped in the kernel currently. Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acglobal.h | 12 ++++++++++++ include/acpi/platform/acenv.h | 9 +++++++++ 2 files changed, 21 insertions(+) (limited to 'include/acpi') diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 268699879904..24db8e153bf0 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h @@ -500,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 diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 9c9031381792..b402eb67af83 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -395,4 +395,13 @@ 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__ */ -- cgit v1.2.3 From c14ced0464bf5ef3a3fad6d69bbf07c80bfbaf5b Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 8 Jan 2014 13:45:11 +0800 Subject: ACPICA: Update version to 20131218. Version 20131218. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- include/acpi/acpixf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/acpi') diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index cfe929b23d8a..d2f16f14b419 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 0x20131115 +#define ACPI_CA_VERSION 0x20131218 #include #include -- cgit v1.2.3