Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica: (41 commits)
  ACPICA: Update version to 20160422
  ACPICA: Move all ASCII utilities to a common file
  ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for acpi_hw_write()
  ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support in acpi_hw_read()
  ACPICA: Executer: Introduce a set of macros to handle bit width mask generation
  ACPICA: Hardware: Add optimized access bit width support
  ACPICA: Utilities: Add ACPI_IS_ALIGNED() macro
  ACPICA: Renamed some #defined flag constants for clarity
  ACPICA: ACPI 6.0, tools/iasl: Add support for new resource descriptors
  ACPICA: ACPI 6.0: Update _BIX support for new package element
  ACPICA: ACPI 6.1: Support for new PCCT subtable
  ACPICA: Refactor evaluate_object to reduce nesting
  ACPICA: Divergence: remove unwanted spaces for typedef
  ACPICA: Update version to 20160318
  ACPICA: Namespace: Reorder \_SB._INI to make sure it is evaluated before _REG evaluations
  ACPICA: Events: Fix an issue that _REG association can happen before namespace is initialized
  ACPICA: Tables: Fix wrong MLC condition for dynamic table loading
  ACPICA: Interpreter: Fix wrong conditions for acpi_ev_install_region_handlers() invocation
  ACPICA: Hardware: Enhance acpi_hw_validate_register() with access_width/bit_offset awareness
  Utilities: Fix missing parentheses in ACPI_GET_BITS()/ACPI_SET_BITS()
  ...
  • Loading branch information
Rafael J. Wysocki committed May 16, 2016
2 parents 44549e8 + d1ce3bb commit 407aa3f
Show file tree
Hide file tree
Showing 129 changed files with 1,928 additions and 1,260 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ acpi-y += \
evxfregn.o

acpi-y += \
exconcat.o \
exconfig.o \
exconvrt.o \
excreate.o \
Expand Down Expand Up @@ -149,6 +150,7 @@ acpi-y += \
acpi-y += \
utaddress.o \
utalloc.o \
utascii.o \
utbuffer.o \
utcopy.o \
utexcep.o \
Expand Down
10 changes: 5 additions & 5 deletions drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */

struct acpi_db_command_info {
char *name; /* Command Name */
const char *name; /* Command Name */
u8 min_args; /* Minimum arguments required */
};

Expand All @@ -64,7 +64,7 @@ struct acpi_db_command_help {
};

struct acpi_db_argument_info {
char *name; /* Argument Name */
const char *name; /* Argument Name */
};

struct acpi_db_execute_walk {
Expand Down Expand Up @@ -196,7 +196,7 @@ ACPI_DBR_DEPENDENT_RETURN_VOID(void
acpi_walk_state
*walk_state))

acpi_status acpi_db_display_all_methods(char *display_count_arg);
acpi_status acpi_db_display_all_methods(char *display_count_arg);

void acpi_db_display_arguments(void);

Expand All @@ -220,7 +220,7 @@ ACPI_DBR_DEPENDENT_RETURN_VOID(void
* dbexec - debugger control method execution
*/
void
acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags);
acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags);

void
acpi_db_create_execution_threads(char *num_threads_arg,
Expand Down Expand Up @@ -271,7 +271,7 @@ void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context);
acpi_status acpi_db_user_commands(void);

char *acpi_db_get_next_token(char *string,
char **next, acpi_object_type * return_type);
char **next, acpi_object_type *return_type);

/*
* dbobject
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/acevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ 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);

/*
Expand Down Expand Up @@ -198,8 +199,6 @@ void
acpi_ev_detach_region(union acpi_operand_object *region_obj,
u8 acpi_ns_is_locked);

void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj);

void
acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
acpi_adr_space_type space_id, u32 function);
Expand Down
11 changes: 11 additions & 0 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
extern const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS];
extern const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS];
extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
extern const char acpi_gbl_lower_hex_digits[];
extern const char acpi_gbl_upper_hex_digits[];
extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];

#ifdef ACPI_DBG_TRACK_ALLOCATIONS
Expand Down Expand Up @@ -361,6 +363,15 @@ ACPI_GLOBAL(u32, acpi_gbl_num_objects);

#endif /* ACPI_DEBUGGER */

#if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER)

ACPI_GLOBAL(const char, *acpi_gbl_pld_panel_list[]);
ACPI_GLOBAL(const char, *acpi_gbl_pld_vertical_position_list[]);
ACPI_GLOBAL(const char, *acpi_gbl_pld_horizontal_position_list[]);
ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]);

#endif

/*****************************************************************************
*
* Application globals
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/acinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
typedef const struct acpi_exdump_info {
u8 opcode;
u8 offset;
char *name;
const char *name;

} acpi_exdump_info;

Expand Down Expand Up @@ -370,7 +370,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
acpi_status
acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
union acpi_operand_object *operand,
acpi_object_type * return_type,
acpi_object_type *return_type,
union acpi_operand_object **return_desc);

/*
Expand Down
62 changes: 33 additions & 29 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ struct acpi_create_field_info {
};

typedef
acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state);
acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state);

/*
* Bitmapped ACPI types. Used internally only
Expand Down Expand Up @@ -395,11 +395,12 @@ union acpi_predefined_info {

/* Return object auto-repair info */

typedef acpi_status(*acpi_object_converter) (struct acpi_namespace_node * scope,
union acpi_operand_object
*original_object,
union acpi_operand_object
**converted_object);
typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node *
scope,
union acpi_operand_object *
original_object,
union acpi_operand_object **
converted_object);

struct acpi_simple_repair_info {
char name[ACPI_NAME_SIZE];
Expand Down Expand Up @@ -539,10 +540,10 @@ struct acpi_gpe_device_info {
struct acpi_namespace_node *gpe_device;
};

typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block,
void *context);
typedef acpi_status (*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
gpe_xrupt_info,
struct acpi_gpe_block_info *
gpe_block, void *context);

/* Information about each particular fixed event */

Expand Down Expand Up @@ -657,10 +658,11 @@ struct acpi_result_values {
};

typedef
acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
union acpi_parse_object ** out_op);
acpi_status (*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
union acpi_parse_object ** out_op);

typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
typedef
acpi_status (*acpi_parse_upwards) (struct acpi_walk_state * walk_state);

/* Global handlers for AML Notifies */

Expand Down Expand Up @@ -700,7 +702,8 @@ union acpi_generic_state {
*
****************************************************************************/

typedef acpi_status(*acpi_execute_op) (struct acpi_walk_state * walk_state);
typedef
acpi_status (*acpi_execute_op) (struct acpi_walk_state * walk_state);

/* Address Range info block */

Expand Down Expand Up @@ -853,24 +856,24 @@ struct acpi_parse_state {

/* Parse object flags */

#define ACPI_PARSEOP_GENERIC 0x01
#define ACPI_PARSEOP_NAMED 0x02
#define ACPI_PARSEOP_DEFERRED 0x04
#define ACPI_PARSEOP_BYTELIST 0x08
#define ACPI_PARSEOP_IN_STACK 0x10
#define ACPI_PARSEOP_TARGET 0x20
#define ACPI_PARSEOP_IN_CACHE 0x80
#define ACPI_PARSEOP_GENERIC 0x01
#define ACPI_PARSEOP_NAMED_OBJECT 0x02
#define ACPI_PARSEOP_DEFERRED 0x04
#define ACPI_PARSEOP_BYTELIST 0x08
#define ACPI_PARSEOP_IN_STACK 0x10
#define ACPI_PARSEOP_TARGET 0x20
#define ACPI_PARSEOP_IN_CACHE 0x80

/* Parse object disasm_flags */

#define ACPI_PARSEOP_IGNORE 0x01
#define ACPI_PARSEOP_PARAMLIST 0x02
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
#define ACPI_PARSEOP_PREDEF_CHECKED 0x08
#define ACPI_PARSEOP_CLOSING_PAREN 0x10
#define ACPI_PARSEOP_COMPOUND 0x20
#define ACPI_PARSEOP_ASSIGNMENT 0x40
#define ACPI_PARSEOP_ELSEIF 0x80
#define ACPI_PARSEOP_IGNORE 0x01
#define ACPI_PARSEOP_PARAMETER_LIST 0x02
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
#define ACPI_PARSEOP_PREDEFINED_CHECKED 0x08
#define ACPI_PARSEOP_CLOSING_PAREN 0x10
#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x20
#define ACPI_PARSEOP_ASSIGNMENT 0x40
#define ACPI_PARSEOP_ELSEIF 0x80

/*****************************************************************************
*
Expand Down Expand Up @@ -1096,6 +1099,7 @@ struct acpi_external_list {
#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
#define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */

struct acpi_external_file {
char *path;
Expand Down
21 changes: 19 additions & 2 deletions drivers/acpi/acpica/acmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,31 @@

#define ACPI_IS_MISALIGNED(value) (((acpi_size) value) & (sizeof(acpi_size)-1))

/* Generic (power-of-two) rounding */

#define ACPI_IS_ALIGNED(a, s) (((a) & ((s) - 1)) == 0)
#define ACPI_IS_POWER_OF_TWO(a) ACPI_IS_ALIGNED(a, a)

/*
* Bitmask creation
* Bit positions start at zero.
* MASK_BITS_ABOVE creates a mask starting AT the position and above
* MASK_BITS_BELOW creates a mask starting one bit BELOW the position
* MASK_BITS_ABOVE/BELOW accpets a bit offset to create a mask
* MASK_BITS_ABOVE/BELOW_32/64 accpets a bit width to create a mask
* Note: The ACPI_INTEGER_BIT_SIZE check is used to bypass compiler
* differences with the shift operator
*/
#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((u32) (position))))
#define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((u32) (position)))
#define ACPI_MASK_BITS_ABOVE_32(width) ((u32) ACPI_MASK_BITS_ABOVE(width))
#define ACPI_MASK_BITS_BELOW_32(width) ((u32) ACPI_MASK_BITS_BELOW(width))
#define ACPI_MASK_BITS_ABOVE_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \
ACPI_UINT64_MAX : \
ACPI_MASK_BITS_ABOVE(width))
#define ACPI_MASK_BITS_BELOW_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \
(u64) 0 : \
ACPI_MASK_BITS_BELOW(width))

/* Bitfields within ACPI registers */

Expand All @@ -283,10 +300,10 @@
/* Generic bitfield macros and masks */

#define ACPI_GET_BITS(source_ptr, position, mask) \
((*source_ptr >> position) & mask)
((*(source_ptr) >> (position)) & (mask))

#define ACPI_SET_BITS(target_ptr, position, mask, value) \
(*target_ptr |= ((value & mask) << position))
(*(target_ptr) |= (((value) & (mask)) << (position)))

#define ACPI_1BIT_MASK 0x00000001
#define ACPI_2BIT_MASK 0x00000003
Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);

void
acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component);
acpi_ns_dump_pathname(acpi_handle handle,
const char *msg, u32 level, u32 component);

void acpi_ns_print_pathname(u32 num_segments, char *pathname);
void acpi_ns_print_pathname(u32 num_segments, const char *pathname);

acpi_status
acpi_ns_dump_one_object(acpi_handle obj_handle,
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
*/
const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode);

char *acpi_ps_get_opcode_name(u16 opcode);
const char *acpi_ps_get_opcode_name(u16 opcode);

u8 acpi_ps_get_argument_count(u32 op_type);

Expand Down
14 changes: 12 additions & 2 deletions drivers/acpi/acpica/acpredef.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ enum acpi_return_package_types {
ACPI_PTYPE2_REV_FIXED = 9,
ACPI_PTYPE2_FIX_VAR = 10,
ACPI_PTYPE2_VAR_VAR = 11,
ACPI_PTYPE2_UUID_PAIR = 12
ACPI_PTYPE2_UUID_PAIR = 12,
ACPI_PTYPE_CUSTOM = 13
};

/* Support macros for users of the predefined info table */
Expand Down Expand Up @@ -340,7 +341,7 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {

{{"_BIX", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (16 Int),(4 Str) */
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,
PACKAGE_INFO(ACPI_PTYPE_CUSTOM, ACPI_RTYPE_INTEGER, 16,
ACPI_RTYPE_STRING, 4, 0),

{{"_BLT",
Expand Down Expand Up @@ -523,6 +524,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),

{{"_FIT", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}}, /* ACPI 6.0 */

{{"_FIX", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */
PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0),
Expand Down Expand Up @@ -1053,6 +1057,12 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
ACPI_RTYPE_BUFFER)}},

{{"_WPC", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */

{{"_WPP", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */

PACKAGE_INFO(0, 0, 0, 0, 0, 0) /* Table terminator */
};
#else
Expand Down
12 changes: 6 additions & 6 deletions drivers/acpi/acpica/acresrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ typedef enum {
typedef const struct acpi_rsdump_info {
u8 opcode;
u8 offset;
char *name;
const char *name;
const char **pointer;

} acpi_rsdump_info;
Expand Down Expand Up @@ -209,7 +209,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,

acpi_status
acpi_rs_get_method_data(acpi_handle handle,
char *path, struct acpi_buffer *ret_buffer);
const char *path, struct acpi_buffer *ret_buffer);

acpi_status
acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
Expand All @@ -223,16 +223,16 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
* rscalc
*/
acpi_status
acpi_rs_get_list_length(u8 * aml_buffer,
u32 aml_buffer_length, acpi_size * size_needed);
acpi_rs_get_list_length(u8 *aml_buffer,
u32 aml_buffer_length, acpi_size *size_needed);

acpi_status
acpi_rs_get_aml_length(struct acpi_resource *resource_list,
acpi_size resource_list_size, acpi_size * size_needed);
acpi_size resource_list_size, acpi_size *size_needed);

acpi_status
acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
acpi_size * buffer_size_needed);
acpi_size *buffer_size_needed);

acpi_status
acpi_rs_convert_aml_to_resources(u8 * aml,
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ struct acpi_evaluate_info {
/* The first 3 elements are passed by the caller to acpi_ns_evaluate */

struct acpi_namespace_node *prefix_node; /* Input: starting node */
char *relative_pathname; /* Input: path relative to prefix_node */
const char *relative_pathname; /* Input: path relative to prefix_node */
union acpi_operand_object **parameters; /* Input: argument list */

struct acpi_namespace_node *node; /* Resolved node (prefix_node:relative_pathname) */
Expand Down
Loading

0 comments on commit 407aa3f

Please sign in to comment.