Skip to content

Commit d1ce3bb

Browse files
committed
Merge back new ACPICA material for v4.7.
2 parents 93d6884 + 878a872 commit d1ce3bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1928
-1260
lines changed

drivers/acpi/acpica/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ acpi-y += \
4343
evxfregn.o
4444

4545
acpi-y += \
46+
exconcat.o \
4647
exconfig.o \
4748
exconvrt.o \
4849
excreate.o \
@@ -149,6 +150,7 @@ acpi-y += \
149150
acpi-y += \
150151
utaddress.o \
151152
utalloc.o \
153+
utascii.o \
152154
utbuffer.o \
153155
utcopy.o \
154156
utexcep.o \

drivers/acpi/acpica/acdebug.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
5454

5555
struct acpi_db_command_info {
56-
char *name; /* Command Name */
56+
const char *name; /* Command Name */
5757
u8 min_args; /* Minimum arguments required */
5858
};
5959

@@ -64,7 +64,7 @@ struct acpi_db_command_help {
6464
};
6565

6666
struct acpi_db_argument_info {
67-
char *name; /* Argument Name */
67+
const char *name; /* Argument Name */
6868
};
6969

7070
struct acpi_db_execute_walk {
@@ -196,7 +196,7 @@ ACPI_DBR_DEPENDENT_RETURN_VOID(void
196196
acpi_walk_state
197197
*walk_state))
198198

199-
acpi_status acpi_db_display_all_methods(char *display_count_arg);
199+
acpi_status acpi_db_display_all_methods(char *display_count_arg);
200200

201201
void acpi_db_display_arguments(void);
202202

@@ -220,7 +220,7 @@ ACPI_DBR_DEPENDENT_RETURN_VOID(void
220220
* dbexec - debugger control method execution
221221
*/
222222
void
223-
acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags);
223+
acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags);
224224

225225
void
226226
acpi_db_create_execution_threads(char *num_threads_arg,
@@ -271,7 +271,7 @@ void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context);
271271
acpi_status acpi_db_user_commands(void);
272272

273273
char *acpi_db_get_next_token(char *string,
274-
char **next, acpi_object_type * return_type);
274+
char **next, acpi_object_type *return_type);
275275

276276
/*
277277
* dbobject

drivers/acpi/acpica/acevents.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ acpi_status acpi_ev_init_global_lock_handler(void);
7272
ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
7373
acpi_ev_acquire_global_lock(u16 timeout))
7474
ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void))
75+
7576
acpi_status acpi_ev_remove_global_lock_handler(void);
7677

7778
/*
@@ -198,8 +199,6 @@ void
198199
acpi_ev_detach_region(union acpi_operand_object *region_obj,
199200
u8 acpi_ns_is_locked);
200201

201-
void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj);
202-
203202
void
204203
acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
205204
acpi_adr_space_type space_id, u32 function);

drivers/acpi/acpica/acglobal.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
187187
extern const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS];
188188
extern const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS];
189189
extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
190+
extern const char acpi_gbl_lower_hex_digits[];
191+
extern const char acpi_gbl_upper_hex_digits[];
190192
extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
191193

192194
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
@@ -361,6 +363,15 @@ ACPI_GLOBAL(u32, acpi_gbl_num_objects);
361363

362364
#endif /* ACPI_DEBUGGER */
363365

366+
#if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER)
367+
368+
ACPI_GLOBAL(const char, *acpi_gbl_pld_panel_list[]);
369+
ACPI_GLOBAL(const char, *acpi_gbl_pld_vertical_position_list[]);
370+
ACPI_GLOBAL(const char, *acpi_gbl_pld_horizontal_position_list[]);
371+
ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]);
372+
373+
#endif
374+
364375
/*****************************************************************************
365376
*
366377
* Application globals

drivers/acpi/acpica/acinterp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
typedef const struct acpi_exdump_info {
6868
u8 opcode;
6969
u8 offset;
70-
char *name;
70+
const char *name;
7171

7272
} acpi_exdump_info;
7373

@@ -370,7 +370,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
370370
acpi_status
371371
acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
372372
union acpi_operand_object *operand,
373-
acpi_object_type * return_type,
373+
acpi_object_type *return_type,
374374
union acpi_operand_object **return_desc);
375375

376376
/*

drivers/acpi/acpica/aclocal.h

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ struct acpi_create_field_info {
278278
};
279279

280280
typedef
281-
acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state);
281+
acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state);
282282

283283
/*
284284
* Bitmapped ACPI types. Used internally only
@@ -395,11 +395,12 @@ union acpi_predefined_info {
395395

396396
/* Return object auto-repair info */
397397

398-
typedef acpi_status(*acpi_object_converter) (struct acpi_namespace_node * scope,
399-
union acpi_operand_object
400-
*original_object,
401-
union acpi_operand_object
402-
**converted_object);
398+
typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node *
399+
scope,
400+
union acpi_operand_object *
401+
original_object,
402+
union acpi_operand_object **
403+
converted_object);
403404

404405
struct acpi_simple_repair_info {
405406
char name[ACPI_NAME_SIZE];
@@ -539,10 +540,10 @@ struct acpi_gpe_device_info {
539540
struct acpi_namespace_node *gpe_device;
540541
};
541542

542-
typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
543-
gpe_xrupt_info,
544-
struct acpi_gpe_block_info *gpe_block,
545-
void *context);
543+
typedef acpi_status (*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
544+
gpe_xrupt_info,
545+
struct acpi_gpe_block_info *
546+
gpe_block, void *context);
546547

547548
/* Information about each particular fixed event */
548549

@@ -657,10 +658,11 @@ struct acpi_result_values {
657658
};
658659

659660
typedef
660-
acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
661-
union acpi_parse_object ** out_op);
661+
acpi_status (*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
662+
union acpi_parse_object ** out_op);
662663

663-
typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
664+
typedef
665+
acpi_status (*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
664666

665667
/* Global handlers for AML Notifies */
666668

@@ -700,7 +702,8 @@ union acpi_generic_state {
700702
*
701703
****************************************************************************/
702704

703-
typedef acpi_status(*acpi_execute_op) (struct acpi_walk_state * walk_state);
705+
typedef
706+
acpi_status (*acpi_execute_op) (struct acpi_walk_state * walk_state);
704707

705708
/* Address Range info block */
706709

@@ -853,24 +856,24 @@ struct acpi_parse_state {
853856

854857
/* Parse object flags */
855858

856-
#define ACPI_PARSEOP_GENERIC 0x01
857-
#define ACPI_PARSEOP_NAMED 0x02
858-
#define ACPI_PARSEOP_DEFERRED 0x04
859-
#define ACPI_PARSEOP_BYTELIST 0x08
860-
#define ACPI_PARSEOP_IN_STACK 0x10
861-
#define ACPI_PARSEOP_TARGET 0x20
862-
#define ACPI_PARSEOP_IN_CACHE 0x80
859+
#define ACPI_PARSEOP_GENERIC 0x01
860+
#define ACPI_PARSEOP_NAMED_OBJECT 0x02
861+
#define ACPI_PARSEOP_DEFERRED 0x04
862+
#define ACPI_PARSEOP_BYTELIST 0x08
863+
#define ACPI_PARSEOP_IN_STACK 0x10
864+
#define ACPI_PARSEOP_TARGET 0x20
865+
#define ACPI_PARSEOP_IN_CACHE 0x80
863866

864867
/* Parse object disasm_flags */
865868

866-
#define ACPI_PARSEOP_IGNORE 0x01
867-
#define ACPI_PARSEOP_PARAMLIST 0x02
868-
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
869-
#define ACPI_PARSEOP_PREDEF_CHECKED 0x08
870-
#define ACPI_PARSEOP_CLOSING_PAREN 0x10
871-
#define ACPI_PARSEOP_COMPOUND 0x20
872-
#define ACPI_PARSEOP_ASSIGNMENT 0x40
873-
#define ACPI_PARSEOP_ELSEIF 0x80
869+
#define ACPI_PARSEOP_IGNORE 0x01
870+
#define ACPI_PARSEOP_PARAMETER_LIST 0x02
871+
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
872+
#define ACPI_PARSEOP_PREDEFINED_CHECKED 0x08
873+
#define ACPI_PARSEOP_CLOSING_PAREN 0x10
874+
#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x20
875+
#define ACPI_PARSEOP_ASSIGNMENT 0x40
876+
#define ACPI_PARSEOP_ELSEIF 0x80
874877

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

11001104
struct acpi_external_file {
11011105
char *path;

drivers/acpi/acpica/acmacros.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,31 @@
260260

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

263+
/* Generic (power-of-two) rounding */
264+
265+
#define ACPI_IS_ALIGNED(a, s) (((a) & ((s) - 1)) == 0)
266+
#define ACPI_IS_POWER_OF_TWO(a) ACPI_IS_ALIGNED(a, a)
267+
263268
/*
264269
* Bitmask creation
265270
* Bit positions start at zero.
266271
* MASK_BITS_ABOVE creates a mask starting AT the position and above
267272
* MASK_BITS_BELOW creates a mask starting one bit BELOW the position
273+
* MASK_BITS_ABOVE/BELOW accpets a bit offset to create a mask
274+
* MASK_BITS_ABOVE/BELOW_32/64 accpets a bit width to create a mask
275+
* Note: The ACPI_INTEGER_BIT_SIZE check is used to bypass compiler
276+
* differences with the shift operator
268277
*/
269278
#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((u32) (position))))
270279
#define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((u32) (position)))
280+
#define ACPI_MASK_BITS_ABOVE_32(width) ((u32) ACPI_MASK_BITS_ABOVE(width))
281+
#define ACPI_MASK_BITS_BELOW_32(width) ((u32) ACPI_MASK_BITS_BELOW(width))
282+
#define ACPI_MASK_BITS_ABOVE_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \
283+
ACPI_UINT64_MAX : \
284+
ACPI_MASK_BITS_ABOVE(width))
285+
#define ACPI_MASK_BITS_BELOW_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \
286+
(u64) 0 : \
287+
ACPI_MASK_BITS_BELOW(width))
271288

272289
/* Bitfields within ACPI registers */
273290

@@ -283,10 +300,10 @@
283300
/* Generic bitfield macros and masks */
284301

285302
#define ACPI_GET_BITS(source_ptr, position, mask) \
286-
((*source_ptr >> position) & mask)
303+
((*(source_ptr) >> (position)) & (mask))
287304

288305
#define ACPI_SET_BITS(target_ptr, position, mask, value) \
289-
(*target_ptr |= ((value & mask) << position))
306+
(*(target_ptr) |= (((value) & (mask)) << (position)))
290307

291308
#define ACPI_1BIT_MASK 0x00000001
292309
#define ACPI_2BIT_MASK 0x00000003

drivers/acpi/acpica/acnamesp.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
206206
void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
207207

208208
void
209-
acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component);
209+
acpi_ns_dump_pathname(acpi_handle handle,
210+
const char *msg, u32 level, u32 component);
210211

211-
void acpi_ns_print_pathname(u32 num_segments, char *pathname);
212+
void acpi_ns_print_pathname(u32 num_segments, const char *pathname);
212213

213214
acpi_status
214215
acpi_ns_dump_one_object(acpi_handle obj_handle,

drivers/acpi/acpica/acparser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
139139
*/
140140
const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode);
141141

142-
char *acpi_ps_get_opcode_name(u16 opcode);
142+
const char *acpi_ps_get_opcode_name(u16 opcode);
143143

144144
u8 acpi_ps_get_argument_count(u32 op_type);
145145

drivers/acpi/acpica/acpredef.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ enum acpi_return_package_types {
129129
ACPI_PTYPE2_REV_FIXED = 9,
130130
ACPI_PTYPE2_FIX_VAR = 10,
131131
ACPI_PTYPE2_VAR_VAR = 11,
132-
ACPI_PTYPE2_UUID_PAIR = 12
132+
ACPI_PTYPE2_UUID_PAIR = 12,
133+
ACPI_PTYPE_CUSTOM = 13
133134
};
134135

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

341342
{{"_BIX", METHOD_0ARGS,
342343
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (16 Int),(4 Str) */
343-
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,
344+
PACKAGE_INFO(ACPI_PTYPE_CUSTOM, ACPI_RTYPE_INTEGER, 16,
344345
ACPI_RTYPE_STRING, 4, 0),
345346

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

527+
{{"_FIT", METHOD_0ARGS,
528+
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}}, /* ACPI 6.0 */
529+
526530
{{"_FIX", METHOD_0ARGS,
527531
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */
528532
PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0),
@@ -1053,6 +1057,12 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
10531057
METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
10541058
ACPI_RTYPE_BUFFER)}},
10551059

1060+
{{"_WPC", METHOD_0ARGS,
1061+
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */
1062+
1063+
{{"_WPP", METHOD_0ARGS,
1064+
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */
1065+
10561066
PACKAGE_INFO(0, 0, 0, 0, 0, 0) /* Table terminator */
10571067
};
10581068
#else

drivers/acpi/acpica/acresrc.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ typedef enum {
124124
typedef const struct acpi_rsdump_info {
125125
u8 opcode;
126126
u8 offset;
127-
char *name;
127+
const char *name;
128128
const char **pointer;
129129

130130
} acpi_rsdump_info;
@@ -209,7 +209,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
209209

210210
acpi_status
211211
acpi_rs_get_method_data(acpi_handle handle,
212-
char *path, struct acpi_buffer *ret_buffer);
212+
const char *path, struct acpi_buffer *ret_buffer);
213213

214214
acpi_status
215215
acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
@@ -223,16 +223,16 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
223223
* rscalc
224224
*/
225225
acpi_status
226-
acpi_rs_get_list_length(u8 * aml_buffer,
227-
u32 aml_buffer_length, acpi_size * size_needed);
226+
acpi_rs_get_list_length(u8 *aml_buffer,
227+
u32 aml_buffer_length, acpi_size *size_needed);
228228

229229
acpi_status
230230
acpi_rs_get_aml_length(struct acpi_resource *resource_list,
231-
acpi_size resource_list_size, acpi_size * size_needed);
231+
acpi_size resource_list_size, acpi_size *size_needed);
232232

233233
acpi_status
234234
acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
235-
acpi_size * buffer_size_needed);
235+
acpi_size *buffer_size_needed);
236236

237237
acpi_status
238238
acpi_rs_convert_aml_to_resources(u8 * aml,

drivers/acpi/acpica/acstruct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ struct acpi_evaluate_info {
184184
/* The first 3 elements are passed by the caller to acpi_ns_evaluate */
185185

186186
struct acpi_namespace_node *prefix_node; /* Input: starting node */
187-
char *relative_pathname; /* Input: path relative to prefix_node */
187+
const char *relative_pathname; /* Input: path relative to prefix_node */
188188
union acpi_operand_object **parameters; /* Input: argument list */
189189

190190
struct acpi_namespace_node *node; /* Resolved node (prefix_node:relative_pathname) */

0 commit comments

Comments
 (0)