Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica: (45 commits)
  ACPICA: Parser: Fix a regression in LoadTable support
  ACPICA: Tables: Fix "UNLOAD" code path lock issues
  ACPICA: Tables: Fix a regression in acpi_tb_find_table()
  ACPICA: Update version to 20160831
  ACPICA: Tables: Tune table mutex to be a leaf lock
  ACPICA: Dispatcher: Fix a mutex issue for method auto serialization
  ACPICA: Namespace: Fix dynamic table loading issues
  ACPICA: Namespace: Add acpi_ns_get_node_unlocked()
  ACPICA: Interpreter: Fix MLC issues by switching to new term_list grammar for table loading
  ACPICA: Update return value for intenal _OSI method
  ACPICA: Tables: Override all 64-bit GAS fields when acpi_gbl_use32_bit_fadt_addresses is TRUE
  ACPICA: Tables: Add new table events indicating table installation/uninstallation
  ACPICA: Tables: Remove wrong table event macros
  ACPICA: Tables: Remove acpi_tb_install_fixed_table()
  ACPICA: Add a couple of casts to uthex.c
  ACPICA: Cleanup for all string-to-integer conversions
  ACPICA: Debugger: Add subcommand for predefined name execution
  ACPICA: Update version to 20160729
  ACPICA: OSL: Fix a regression that old GCC requires a workaround for strchr()
  ACPICA: OSL: Cleanup the inclusion order of the compiler-specific headers
  ...
  • Loading branch information
rafaeljw committed Oct 1, 2016
2 parents 52ff5ad + 7a0b71d commit 9274139
Show file tree
Hide file tree
Showing 84 changed files with 1,958 additions and 1,519 deletions.
1 change: 1 addition & 0 deletions drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ acpi-y += \
utresrc.o \
utstate.o \
utstring.o \
utstrtoul64.o \
utxface.o \
utxfinit.o \
utxferror.o \
Expand Down
10 changes: 6 additions & 4 deletions drivers/acpi/acpica/acapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
#ifndef _ACAPPS
#define _ACAPPS

#include <stdio.h>
#ifdef ACPI_USE_STANDARD_HEADERS
#include <sys/stat.h>
#endif /* ACPI_USE_STANDARD_HEADERS */

/* Common info for tool signons */

Expand Down Expand Up @@ -81,13 +83,13 @@
/* Macros for usage messages */

#define ACPI_USAGE_HEADER(usage) \
acpi_os_printf ("Usage: %s\nOptions:\n", usage);
printf ("Usage: %s\nOptions:\n", usage);

#define ACPI_USAGE_TEXT(description) \
acpi_os_printf (description);
printf (description);

#define ACPI_OPTION(name, description) \
acpi_os_printf (" %-20s%s\n", name, description);
printf (" %-20s%s\n", name, description);

/* Check for unexpected exceptions */

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ acpi_status acpi_db_disassemble_method(char *name);

void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op);

void acpi_db_batch_execute(char *count_arg);
void acpi_db_evaluate_predefined_names(void);

/*
* dbnames - namespace commands
Expand Down
3 changes: 3 additions & 0 deletions drivers/acpi/acpica/acevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info);

acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info);

acpi_status
acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked);

acpi_status
acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);

Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_noop_operator, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_cstyle_disassembly, TRUE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_force_aml_disassembly, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_opt_verbose, TRUE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_emit_external_opcodes, FALSE);

ACPI_GLOBAL(u8, acpi_gbl_dm_opt_disasm);
ACPI_GLOBAL(u8, acpi_gbl_dm_opt_listing);
Expand Down Expand Up @@ -382,6 +383,7 @@ ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]);

ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_debug_file, NULL);
ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_output_file, NULL);
ACPI_INIT_GLOBAL(u8, acpi_gbl_debug_timeout, FALSE);

/* Print buffer */

Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ struct acpi_gpe_event_info {
u8 flags; /* Misc info about this GPE */
u8 gpe_number; /* This GPE */
u8 runtime_count; /* References to a run GPE */
u8 disable_for_dispatch; /* Masked during dispatching */
};

/* Information about a GPE register pair, one per each status/enable pair in an array */
Expand All @@ -494,6 +495,7 @@ struct acpi_gpe_register_info {
u16 base_gpe_number; /* Base GPE number for this register */
u8 enable_for_wake; /* GPEs to keep enabled when sleeping */
u8 enable_for_run; /* GPEs to keep enabled when running */
u8 mask_for_run; /* GPEs to keep masked when running */
u8 enable_mask; /* Current mask of enabled GPEs */
};

Expand Down
8 changes: 8 additions & 0 deletions drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type,
acpi_status
acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node);

acpi_status
acpi_ns_execute_table(u32 table_index, struct acpi_namespace_node *start_node);

acpi_status
acpi_ns_one_complete_parse(u32 pass_number,
u32 table_index,
Expand Down Expand Up @@ -295,6 +298,11 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,
u8
acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);

acpi_status
acpi_ns_get_node_unlocked(struct acpi_namespace_node *prefix_node,
const char *external_pathname,
u32 flags, struct acpi_namespace_node **out_node);

acpi_status
acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
const char *external_pathname,
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ extern const u8 acpi_gbl_long_op_index[];
*/
acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info);

acpi_status acpi_ps_execute_table(struct acpi_evaluate_info *info);

/*
* psargs - Parse AML opcode arguments
*/
Expand Down
12 changes: 8 additions & 4 deletions drivers/acpi/acpica/actables.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ acpi_tb_install_standard_table(acpi_physical_address address,

void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc);

acpi_status
acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node);

acpi_status
acpi_tb_install_and_load_table(struct acpi_table_header *table,
acpi_physical_address address,
u8 flags, u8 override, u32 *table_index);

void acpi_tb_terminate(void);

acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index);
Expand Down Expand Up @@ -155,10 +163,6 @@ void
acpi_tb_install_table_with_override(struct acpi_table_desc *new_table_desc,
u8 override, u32 *table_index);

acpi_status
acpi_tb_install_fixed_table(acpi_physical_address address,
char *signature, u32 *table_index);

acpi_status acpi_tb_parse_root_table(acpi_physical_address rsdp_address);

/*
Expand Down
53 changes: 27 additions & 26 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,25 @@ extern const char *acpi_gbl_pt_decode[];
/*
* Common error message prefixes
*/
#ifndef ACPI_MSG_ERROR
#define ACPI_MSG_ERROR "ACPI Error: "
#endif
#ifndef ACPI_MSG_EXCEPTION
#define ACPI_MSG_EXCEPTION "ACPI Exception: "
#endif
#ifndef ACPI_MSG_WARNING
#define ACPI_MSG_WARNING "ACPI Warning: "
#endif
#ifndef ACPI_MSG_INFO
#define ACPI_MSG_INFO "ACPI: "
#endif

#ifndef ACPI_MSG_BIOS_ERROR
#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): "
#endif
#ifndef ACPI_MSG_BIOS_WARNING
#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): "
#endif

/*
* Common message suffix
Expand Down Expand Up @@ -184,14 +196,15 @@ void acpi_ut_strlwr(char *src_string);

int acpi_ut_stricmp(char *string1, char *string2);

acpi_status
acpi_ut_strtoul64(char *string,
u32 base, u32 max_integer_byte_width, u64 *ret_integer);

/* Values for max_integer_byte_width above */
acpi_status acpi_ut_strtoul64(char *string, u32 flags, u64 *ret_integer);

#define ACPI_MAX32_BYTE_WIDTH 4
#define ACPI_MAX64_BYTE_WIDTH 8
/*
* Values for Flags above
* Note: LIMIT values correspond to acpi_gbl_integer_byte_width values (4/8)
*/
#define ACPI_STRTOUL_32BIT 0x04 /* 4 bytes */
#define ACPI_STRTOUL_64BIT 0x08 /* 8 bytes */
#define ACPI_STRTOUL_BASE16 0x10 /* Default: Base10/16 */

/*
* utglobal - Global data structures and procedures
Expand Down Expand Up @@ -221,6 +234,8 @@ const char *acpi_ut_get_event_name(u32 event_id);

char acpi_ut_hex_to_ascii_char(u64 integer, u32 position);

acpi_status acpi_ut_ascii_to_hex_byte(char *two_ascii_chars, u8 *return_byte);

u8 acpi_ut_ascii_char_to_hex(int hex_char);

u8 acpi_ut_valid_object_type(acpi_object_type type);
Expand Down Expand Up @@ -317,6 +332,11 @@ acpi_ut_ptr_exit(u32 line_number,
const char *function_name,
const char *module_name, u32 component_id, u8 *ptr);

void
acpi_ut_str_exit(u32 line_number,
const char *function_name,
const char *module_name, u32 component_id, const char *string);

void
acpi_ut_debug_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id);

Expand Down Expand Up @@ -706,25 +726,6 @@ const struct ah_device_id *acpi_ah_match_hardware_id(char *hid);

const char *acpi_ah_match_uuid(u8 *data);

/*
* utprint - printf/vprintf output functions
*/
const char *acpi_ut_scan_number(const char *string, u64 *number_ptr);

const char *acpi_ut_print_number(char *string, u64 number);

int
acpi_ut_vsnprintf(char *string,
acpi_size size, const char *format, va_list args);

int acpi_ut_snprintf(char *string, acpi_size size, const char *format, ...);

#ifdef ACPI_APPLICATION
int acpi_ut_file_vprintf(ACPI_FILE file, const char *format, va_list args);

int acpi_ut_file_printf(ACPI_FILE file, const char *format, ...);
#endif

/*
* utuuid -- UUID support functions
*/
Expand Down
7 changes: 4 additions & 3 deletions drivers/acpi/acpica/dbconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ acpi_db_convert_to_object(acpi_object_type type,
default:

object->type = ACPI_TYPE_INTEGER;
status =
acpi_ut_strtoul64(string, 16, acpi_gbl_integer_byte_width,
&object->integer.value);
status = acpi_ut_strtoul64(string,
(acpi_gbl_integer_byte_width |
ACPI_STRTOUL_BASE16),
&object->integer.value);
break;
}

Expand Down
62 changes: 34 additions & 28 deletions drivers/acpi/acpica/dbexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,42 +392,48 @@ acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags)
acpi_db_execution_walk, NULL, NULL,
NULL);
return;
} else {
name_string = ACPI_ALLOCATE(strlen(name) + 1);
if (!name_string) {
return;
}
}

memset(&acpi_gbl_db_method_info, 0,
sizeof(struct acpi_db_method_info));
name_string = ACPI_ALLOCATE(strlen(name) + 1);
if (!name_string) {
return;
}

strcpy(name_string, name);
acpi_ut_strupr(name_string);
acpi_gbl_db_method_info.name = name_string;
acpi_gbl_db_method_info.args = args;
acpi_gbl_db_method_info.types = types;
acpi_gbl_db_method_info.flags = flags;
memset(&acpi_gbl_db_method_info, 0, sizeof(struct acpi_db_method_info));
strcpy(name_string, name);
acpi_ut_strupr(name_string);

return_obj.pointer = NULL;
return_obj.length = ACPI_ALLOCATE_BUFFER;
/* Subcommand to Execute all predefined names in the namespace */

status = acpi_db_execute_setup(&acpi_gbl_db_method_info);
if (ACPI_FAILURE(status)) {
ACPI_FREE(name_string);
return;
}
if (!strncmp(name_string, "PREDEF", 6)) {
acpi_db_evaluate_predefined_names();
ACPI_FREE(name_string);
return;
}

/* Get the NS node, determines existence also */
acpi_gbl_db_method_info.name = name_string;
acpi_gbl_db_method_info.args = args;
acpi_gbl_db_method_info.types = types;
acpi_gbl_db_method_info.flags = flags;

status = acpi_get_handle(NULL, acpi_gbl_db_method_info.pathname,
&acpi_gbl_db_method_info.method);
if (ACPI_SUCCESS(status)) {
status =
acpi_db_execute_method(&acpi_gbl_db_method_info,
&return_obj);
}
return_obj.pointer = NULL;
return_obj.length = ACPI_ALLOCATE_BUFFER;

status = acpi_db_execute_setup(&acpi_gbl_db_method_info);
if (ACPI_FAILURE(status)) {
ACPI_FREE(name_string);
return;
}

/* Get the NS node, determines existence also */

status = acpi_get_handle(NULL, acpi_gbl_db_method_info.pathname,
&acpi_gbl_db_method_info.method);
if (ACPI_SUCCESS(status)) {
status = acpi_db_execute_method(&acpi_gbl_db_method_info,
&return_obj);
}
ACPI_FREE(name_string);

/*
* Allow any handlers in separate threads to complete.
Expand Down
20 changes: 6 additions & 14 deletions drivers/acpi/acpica/dbfileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@
#include "accommon.h"
#include "acdebug.h"
#include "actables.h"
#include <stdio.h>
#ifdef ACPI_APPLICATION
#include "acapps.h"
#endif

#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME("dbfileio")

#ifdef ACPI_APPLICATION
#include "acapps.h"
#ifdef ACPI_DEBUGGER
/*******************************************************************************
*
Expand All @@ -69,16 +67,13 @@ ACPI_MODULE_NAME("dbfileio")
void acpi_db_close_debug_file(void)
{

#ifdef ACPI_APPLICATION

if (acpi_gbl_debug_file) {
fclose(acpi_gbl_debug_file);
acpi_gbl_debug_file = NULL;
acpi_gbl_db_output_to_file = FALSE;
acpi_os_printf("Debug output file %s closed\n",
acpi_gbl_db_debug_filename);
}
#endif
}

/*******************************************************************************
Expand All @@ -96,8 +91,6 @@ void acpi_db_close_debug_file(void)
void acpi_db_open_debug_file(char *name)
{

#ifdef ACPI_APPLICATION

acpi_db_close_debug_file();
acpi_gbl_debug_file = fopen(name, "w+");
if (!acpi_gbl_debug_file) {
Expand All @@ -109,8 +102,6 @@ void acpi_db_open_debug_file(char *name)
strncpy(acpi_gbl_db_debug_filename, name,
sizeof(acpi_gbl_db_debug_filename));
acpi_gbl_db_output_to_file = TRUE;

#endif
}
#endif

Expand Down Expand Up @@ -152,12 +143,13 @@ acpi_status acpi_db_load_tables(struct acpi_new_table_desc *list_head)
return (status);
}

fprintf(stderr,
"Acpi table [%4.4s] successfully installed and loaded\n",
table->signature);
acpi_os_printf
("Acpi table [%4.4s] successfully installed and loaded\n",
table->signature);

table_list_head = table_list_head->next;
}

return (AE_OK);
}
#endif
Loading

0 comments on commit 9274139

Please sign in to comment.