Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'acpi-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
"These mostly update the ACPICA code in the kernel to upstream revision
20170531 which covers all of the new material from ACPI 6.2, including
new tables (WSMT, HMAT, PPTT), new subtables and definition changes
for some existing tables (BGRT, HEST, SRAT, TPM2, PCCT), new resource
descriptor macros for pin control, support for new predefined methods
(_LSI, _LSR, _LSW, _HMA), fixes and cleanups.

On top of that, an additional ACPICA change from Kees (which also is
upstream already) switches all of the definitions of function pointer
structures in ACPICA to use designated initializers so as to make the
structure layout randomization GCC plugin work with it.

The rest is a few fixes and cleanups in the EC driver, an xpower PMIC
driver update, a new backlight blacklist entry, and update of the
tables configfs interface and a messages formatting cleanup.

Specifics:

- Update the ACPICA code in the kernel to upstream revision revision
20170531 (which covers all of the new material from ACPI 6.2)
including:
* Support for the PinFunction(), PinConfig(), PinGroup(),
PinGroupFunction(), and PinGroupConfig() resource descriptors
(Mika Westerberg).
* Support for new subtables in HEST and SRAT, new notify value for
HEST, header support for TPM2 table changes, and BGRT Status
field update (Bob Moore).
* Support for new PCCT subtables (David Box).
* Support for _LSI, _LSR, _LSW, and _HMA as predefined methods
(Erik Schmauss).
* Support for the new WSMT, HMAT, and PPTT tables (Lv Zheng).
* New UUID values for Processor Properties (Bob Moore).
* New notify values for memory attributes and graceful shutdown
(Bob Moore).
* Fix related to the PCAT_COMPAT MADT flag (Janosch Hildebrand).
* Resource to AML conversion fix for resources containing GPIOs
(Mika Westerberg).
* Disassembler-related updates (Bob Moore, David Box, Erik
Schmauss).
* Assorted fixes and cleanups (Bob Moore, Erik Schmauss, Lv Zheng,
Cao Jin).

- Modify ACPICA to always use designated initializers for function
pointer structures to make the structure layout randomization GCC
plugin work with it (Kees Cook).

- Update the tables configfs interface to unload SSDTs on configfs
entry removal (Jan Kiszka).

- Add support for the GPI1 regulator to the xpower PMIC Operation
Region handler (Hans de Goede).

- Fix ACPI EC issues related to conflicting EC definitions in the
ECDT and in the ACPI namespace (Lv Zheng, Carlo Caione, Chris
Chiu).

- Fix an interrupt storm issue in the EC driver and make its debug
output work with dynamic debug as expected (Lv Zheng).

- Add ACPI backlight quirk for Dell Precision 7510 (Shih-Yuan Lee).

- Fix whitespace in pr_fmt() to align log entries properly in some
places in the ACPI subsystem (Vincent Legoll)"

* tag 'acpi-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (63 commits)
ACPI / EC: Add quirk for GL720VMK
ACPI / EC: Fix media keys not working problem on some Asus laptops
ACPI / EC: Add support to skip boot stage DSDT probe
ACPI / EC: Enhance boot EC sanity check
ACPI / video: Add quirks for the Dell Precision 7510
ACPI: EC: Fix EC command visibility for dynamic debug
ACPI: EC: Fix an EC event IRQ storming issue
ACPICA: Use designated initializers
ACPICA: Update version to 20170531
ACPICA: Update a couple of debug output messages
ACPICA: acpiexec: enhance local signal handler
ACPICA: Simplify output for the ACPI Debug Object
ACPICA: Unix application OSL: Correctly handle control-c (EINTR)
ACPICA: Improvements for debug output only
ACPICA: Disassembler: allow conflicting external declarations to be emitted.
ACPICA: Disassembler: add external op to namespace on first pass
ACPICA: Disassembler: prevent external op's from opening a new scope
ACPICA: Changed Gbl_disasm_flag to acpi_gbl_disasm_flag
ACPICA: Changing External to a named object
ACPICA: Update two error messages to emit control method name
...

+2157 -453
+19 -1
drivers/acpi/acpi_configfs.c
··· 15 15 #include <linux/configfs.h> 16 16 #include <linux/acpi.h> 17 17 18 + #include "acpica/accommon.h" 19 + #include "acpica/actables.h" 20 + 18 21 static struct config_group *acpi_table_group; 19 22 20 23 struct acpi_table { 21 24 struct config_item cfg; 22 25 struct acpi_table_header *header; 26 + u32 index; 23 27 }; 24 28 25 29 static ssize_t acpi_table_aml_write(struct config_item *cfg, ··· 56 52 if (!table->header) 57 53 return -ENOMEM; 58 54 59 - ret = acpi_load_table(table->header); 55 + ACPI_INFO(("Host-directed Dynamic ACPI Table Load:")); 56 + ret = acpi_tb_install_and_load_table( 57 + ACPI_PTR_TO_PHYSADDR(table->header), 58 + ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, 59 + &table->index); 60 60 if (ret) { 61 61 kfree(table->header); 62 62 table->header = NULL; ··· 223 215 return &table->cfg; 224 216 } 225 217 218 + static void acpi_table_drop_item(struct config_group *group, 219 + struct config_item *cfg) 220 + { 221 + struct acpi_table *table = container_of(cfg, struct acpi_table, cfg); 222 + 223 + ACPI_INFO(("Host-directed Dynamic ACPI Table Unload")); 224 + acpi_tb_unload_table(table->index); 225 + } 226 + 226 227 struct configfs_group_operations acpi_table_group_ops = { 227 228 .make_item = acpi_table_make_item, 229 + .drop_item = acpi_table_drop_item, 228 230 }; 229 231 230 232 static struct config_item_type acpi_tables_type = {
+1 -1
drivers/acpi/acpi_dbg.c
··· 10 10 */ 11 11 12 12 /* #define DEBUG */ 13 - #define pr_fmt(fmt) "ACPI : AML: " fmt 13 + #define pr_fmt(fmt) "ACPI: AML: " fmt 14 14 15 15 #include <linux/kernel.h> 16 16 #include <linux/module.h>
+1
drivers/acpi/acpica/Makefile
··· 172 172 utosi.o \ 173 173 utownerid.o \ 174 174 utpredef.o \ 175 + utresdecode.o \ 175 176 utresrc.o \ 176 177 utstate.o \ 177 178 utstring.o \
+2 -2
drivers/acpi/acpica/acapps.h
··· 158 158 acpi_owner_id owner_id); 159 159 160 160 void 161 - acpi_dm_convert_resource_indexes(union acpi_parse_object *parse_tree_root, 162 - struct acpi_namespace_node *namespace_root); 161 + acpi_dm_convert_parse_objects(union acpi_parse_object *parse_tree_root, 162 + struct acpi_namespace_node *namespace_root); 163 163 164 164 /* 165 165 * adfile
+3
drivers/acpi/acpica/acglobal.h
··· 315 315 ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_opt_verbose, TRUE); 316 316 ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_emit_external_opcodes, FALSE); 317 317 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_disassembler_optimizations, TRUE); 318 + ACPI_INIT_GLOBAL(ACPI_PARSE_OBJECT_LIST, *acpi_gbl_temp_list_head, NULL); 318 319 319 320 ACPI_GLOBAL(u8, acpi_gbl_dm_opt_disasm); 320 321 ACPI_GLOBAL(u8, acpi_gbl_dm_opt_listing); ··· 368 367 ACPI_GLOBAL(const char, *acpi_gbl_pld_vertical_position_list[]); 369 368 ACPI_GLOBAL(const char, *acpi_gbl_pld_horizontal_position_list[]); 370 369 ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]); 370 + 371 + ACPI_INIT_GLOBAL(u8, acpi_gbl_disasm_flag, FALSE); 371 372 372 373 #endif 373 374
+13 -2
drivers/acpi/acpica/aclocal.h
··· 859 859 * and bytelists. 860 860 */ 861 861 struct acpi_parse_obj_named { 862 - ACPI_PARSE_COMMON u8 *path; 862 + ACPI_PARSE_COMMON char *path; 863 863 u8 *data; /* AML body or bytelist data */ 864 864 u32 length; /* AML length */ 865 865 u32 name; /* 4-byte name or zero if no name */ ··· 1142 1142 #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 1143 1143 #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 1144 1144 #define ACPI_RESOURCE_NAME_GPIO 0x8C 1145 + #define ACPI_RESOURCE_NAME_PIN_FUNCTION 0x8D 1145 1146 #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 1146 - #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E 1147 + #define ACPI_RESOURCE_NAME_PIN_CONFIG 0x8F 1148 + #define ACPI_RESOURCE_NAME_PIN_GROUP 0x90 1149 + #define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91 1150 + #define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92 1151 + #define ACPI_RESOURCE_NAME_LARGE_MAX 0x92 1147 1152 1148 1153 /***************************************************************************** 1149 1154 * ··· 1181 1176 #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ 1182 1177 #define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */ 1183 1178 #define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */ 1179 + #define ACPI_EXT_CONFLICTING_DECLARATION 0x20 /* External has a conflicting declaration within AML */ 1184 1180 1185 1181 struct acpi_external_file { 1186 1182 char *path; 1187 1183 struct acpi_external_file *next; 1184 + }; 1185 + 1186 + struct acpi_parse_object_list { 1187 + union acpi_parse_object *op; 1188 + struct acpi_parse_object_list *next; 1188 1189 }; 1189 1190 1190 1191 /*****************************************************************************
+1 -1
drivers/acpi/acpica/acopcode.h
··· 112 112 #define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) 113 113 #define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST) 114 114 #define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME) 115 - #define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA) 115 + #define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAME, ARGP_BYTEDATA, ARGP_BYTEDATA) 116 116 #define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG) 117 117 #define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST) 118 118 #define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
+16
drivers/acpi/acpica/acpredef.h
··· 581 581 {{"_HID", METHOD_0ARGS, 582 582 METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}}, 583 583 584 + {{"_HMA", METHOD_0ARGS, 585 + METHOD_RETURNS(ACPI_RTYPE_BUFFER)}}, 586 + 584 587 {{"_HOT", METHOD_0ARGS, 585 588 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 586 589 ··· 628 625 PACKAGE_INFO(ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 3, 629 626 ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 630 627 10, 0), 628 + 629 + {{"_LSI", METHOD_0ARGS, 630 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, 631 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0, 0, 0), 632 + 633 + {{"_LSR", METHOD_2ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), 634 + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, 635 + PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 1, 636 + ACPI_RTYPE_BUFFER, 1, 0), 637 + 638 + {{"_LSW", 639 + METHOD_3ARGS(ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_BUFFER), 640 + METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 631 641 632 642 {{"_MAT", METHOD_0ARGS, 633 643 METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
+14 -1
drivers/acpi/acpica/acresrc.h
··· 148 148 ACPI_RSD_UINT16, 149 149 ACPI_RSD_UINT32, 150 150 ACPI_RSD_UINT64, 151 - ACPI_RSD_WORDLIST 151 + ACPI_RSD_WORDLIST, 152 + ACPI_RSD_LABEL, 153 + ACPI_RSD_SOURCE_LABEL, 154 + 152 155 } ACPI_RSDUMP_OPCODES; 153 156 154 157 /* restore default alignment */ ··· 332 329 extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[]; 333 330 extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[]; 334 331 extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[]; 332 + extern struct acpi_rsconvert_info acpi_rs_convert_pin_function[]; 333 + extern struct acpi_rsconvert_info acpi_rs_convert_pin_config[]; 334 + extern struct acpi_rsconvert_info acpi_rs_convert_pin_group[]; 335 + extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[]; 336 + extern struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[]; 335 337 336 338 /* These resources require separate get/set tables */ 337 339 ··· 380 372 extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[]; 381 373 extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[]; 382 374 extern struct acpi_rsdump_info acpi_rs_dump_gpio[]; 375 + extern struct acpi_rsdump_info acpi_rs_dump_pin_function[]; 383 376 extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[]; 384 377 extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[]; 385 378 extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[]; 386 379 extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[]; 387 380 extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[]; 388 381 extern struct acpi_rsdump_info acpi_rs_dump_general_flags[]; 382 + extern struct acpi_rsdump_info acpi_rs_dump_pin_config[]; 383 + extern struct acpi_rsdump_info acpi_rs_dump_pin_group[]; 384 + extern struct acpi_rsdump_info acpi_rs_dump_pin_group_function[]; 385 + extern struct acpi_rsdump_info acpi_rs_dump_pin_group_config[]; 389 386 #endif 390 387 391 388 #endif /* __ACRESRC_H__ */
+1
drivers/acpi/acpica/acutils.h
··· 85 85 extern const char *acpi_gbl_sb_decode[]; 86 86 extern const char *acpi_gbl_fc_decode[]; 87 87 extern const char *acpi_gbl_pt_decode[]; 88 + extern const char *acpi_gbl_ptyp_decode[]; 88 89 #endif 89 90 90 91 /*
+33 -28
drivers/acpi/acpica/amlcode.h
··· 313 313 * #A is the number of required arguments 314 314 * #T is the number of target operands 315 315 * #R indicates whether there is a return value 316 + * 317 + * These types are used for the top-level dispatch of the AML 318 + * opcode. They group similar operators that can share common 319 + * front-end code before dispatch to the final code that implements 320 + * the operator. 316 321 */ 317 322 318 323 /* ··· 358 353 * The opcode Type is used in a dispatch table, do not change 359 354 * or add anything new without updating the table. 360 355 */ 361 - #define AML_TYPE_EXEC_0A_0T_1R 0x00 362 - #define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ 363 - #define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ 364 - #define AML_TYPE_EXEC_1A_1T_0R 0x03 365 - #define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */ 366 - #define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ 367 - #define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ 368 - #define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */ 369 - #define AML_TYPE_EXEC_2A_2T_1R 0x08 370 - #define AML_TYPE_EXEC_3A_0T_0R 0x09 371 - #define AML_TYPE_EXEC_3A_1T_1R 0x0A 372 - #define AML_TYPE_EXEC_6A_0T_1R 0x0B 356 + #define AML_TYPE_EXEC_0A_0T_1R 0x00 /* 0 Args, 0 Target, 1 ret_val */ 357 + #define AML_TYPE_EXEC_1A_0T_0R 0x01 /* 1 Args, 0 Target, 0 ret_val */ 358 + #define AML_TYPE_EXEC_1A_0T_1R 0x02 /* 1 Args, 0 Target, 1 ret_val */ 359 + #define AML_TYPE_EXEC_1A_1T_0R 0x03 /* 1 Args, 1 Target, 0 ret_val */ 360 + #define AML_TYPE_EXEC_1A_1T_1R 0x04 /* 1 Args, 1 Target, 1 ret_val */ 361 + #define AML_TYPE_EXEC_2A_0T_0R 0x05 /* 2 Args, 0 Target, 0 ret_val */ 362 + #define AML_TYPE_EXEC_2A_0T_1R 0x06 /* 2 Args, 0 Target, 1 ret_val */ 363 + #define AML_TYPE_EXEC_2A_1T_1R 0x07 /* 2 Args, 1 Target, 1 ret_val */ 364 + #define AML_TYPE_EXEC_2A_2T_1R 0x08 /* 2 Args, 2 Target, 1 ret_val */ 365 + #define AML_TYPE_EXEC_3A_0T_0R 0x09 /* 3 Args, 0 Target, 0 ret_val */ 366 + #define AML_TYPE_EXEC_3A_1T_1R 0x0A /* 3 Args, 1 Target, 1 ret_val */ 367 + #define AML_TYPE_EXEC_6A_0T_1R 0x0B /* 6 Args, 0 Target, 1 ret_val */ 373 368 /* End of types used in dispatch table */ 374 369 375 - #define AML_TYPE_LITERAL 0x0B 376 - #define AML_TYPE_CONSTANT 0x0C 377 - #define AML_TYPE_METHOD_ARGUMENT 0x0D 378 - #define AML_TYPE_LOCAL_VARIABLE 0x0E 379 - #define AML_TYPE_DATA_TERM 0x0F 370 + #define AML_TYPE_LITERAL 0x0C 371 + #define AML_TYPE_CONSTANT 0x0D 372 + #define AML_TYPE_METHOD_ARGUMENT 0x0E 373 + #define AML_TYPE_LOCAL_VARIABLE 0x0F 374 + #define AML_TYPE_DATA_TERM 0x10 380 375 381 376 /* Generic for an op that returns a value */ 382 377 383 - #define AML_TYPE_METHOD_CALL 0x10 378 + #define AML_TYPE_METHOD_CALL 0x11 384 379 385 380 /* Miscellaneous types */ 386 381 387 - #define AML_TYPE_CREATE_FIELD 0x11 388 - #define AML_TYPE_CREATE_OBJECT 0x12 389 - #define AML_TYPE_CONTROL 0x13 390 - #define AML_TYPE_NAMED_NO_OBJ 0x14 391 - #define AML_TYPE_NAMED_FIELD 0x15 392 - #define AML_TYPE_NAMED_SIMPLE 0x16 393 - #define AML_TYPE_NAMED_COMPLEX 0x17 394 - #define AML_TYPE_RETURN 0x18 395 - #define AML_TYPE_UNDEFINED 0x19 396 - #define AML_TYPE_BOGUS 0x1A 382 + #define AML_TYPE_CREATE_FIELD 0x12 383 + #define AML_TYPE_CREATE_OBJECT 0x13 384 + #define AML_TYPE_CONTROL 0x14 385 + #define AML_TYPE_NAMED_NO_OBJ 0x15 386 + #define AML_TYPE_NAMED_FIELD 0x16 387 + #define AML_TYPE_NAMED_SIMPLE 0x17 388 + #define AML_TYPE_NAMED_COMPLEX 0x18 389 + #define AML_TYPE_RETURN 0x19 390 + #define AML_TYPE_UNDEFINED 0x1A 391 + #define AML_TYPE_BOGUS 0x1B 397 392 398 393 /* AML Package Length encodings */ 399 394
+104
drivers/acpi/acpica/amlresrc.h
··· 65 65 #define ACPI_RESTAG_DRIVESTRENGTH "_DRS" 66 66 #define ACPI_RESTAG_ENDIANNESS "_END" 67 67 #define ACPI_RESTAG_FLOWCONTROL "_FLC" 68 + #define ACPI_RESTAG_FUNCTION "_FUN" 68 69 #define ACPI_RESTAG_GRANULARITY "_GRA" 69 70 #define ACPI_RESTAG_INTERRUPT "_INT" 70 71 #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ ··· 85 84 #define ACPI_RESTAG_PHASE "_PHA" 86 85 #define ACPI_RESTAG_PIN "_PIN" 87 86 #define ACPI_RESTAG_PINCONFIG "_PPI" 87 + #define ACPI_RESTAG_PINCONFIG_TYPE "_TYP" 88 + #define ACPI_RESTAG_PINCONFIG_VALUE "_VAL" 88 89 #define ACPI_RESTAG_POLARITY "_POL" 89 90 #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" 90 91 #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" ··· 407 404 #define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */ 408 405 #define AML_RESOURCE_UART_MIN_DATA_LEN 10 409 406 407 + struct aml_resource_pin_function { 408 + AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id; 409 + u16 flags; 410 + u8 pin_config; 411 + u16 function_number; 412 + u16 pin_table_offset; 413 + u8 res_source_index; 414 + u16 res_source_offset; 415 + u16 vendor_offset; 416 + u16 vendor_length; 417 + /* 418 + * Optional fields follow immediately: 419 + * 1) PIN list (Words) 420 + * 2) Resource Source String 421 + * 3) Vendor Data bytes 422 + */ 423 + }; 424 + 425 + #define AML_RESOURCE_PIN_FUNCTION_REVISION 1 /* ACPI 6.2 */ 426 + 427 + struct aml_resource_pin_config { 428 + AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id; 429 + u16 flags; 430 + u8 pin_config_type; 431 + u32 pin_config_value; 432 + u16 pin_table_offset; 433 + u8 res_source_index; 434 + u16 res_source_offset; 435 + u16 vendor_offset; 436 + u16 vendor_length; 437 + /* 438 + * Optional fields follow immediately: 439 + * 1) PIN list (Words) 440 + * 2) Resource Source String 441 + * 3) Vendor Data bytes 442 + */ 443 + }; 444 + 445 + #define AML_RESOURCE_PIN_CONFIG_REVISION 1 /* ACPI 6.2 */ 446 + 447 + struct aml_resource_pin_group { 448 + AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id; 449 + u16 flags; 450 + u16 pin_table_offset; 451 + u16 label_offset; 452 + u16 vendor_offset; 453 + u16 vendor_length; 454 + /* 455 + * Optional fields follow immediately: 456 + * 1) PIN list (Words) 457 + * 2) Resource Label String 458 + * 3) Vendor Data bytes 459 + */ 460 + }; 461 + 462 + #define AML_RESOURCE_PIN_GROUP_REVISION 1 /* ACPI 6.2 */ 463 + 464 + struct aml_resource_pin_group_function { 465 + AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id; 466 + u16 flags; 467 + u16 function_number; 468 + u8 res_source_index; 469 + u16 res_source_offset; 470 + u16 res_source_label_offset; 471 + u16 vendor_offset; 472 + u16 vendor_length; 473 + /* 474 + * Optional fields follow immediately: 475 + * 1) Resource Source String 476 + * 2) Resource Source Label String 477 + * 3) Vendor Data bytes 478 + */ 479 + }; 480 + 481 + #define AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION 1 /* ACPI 6.2 */ 482 + 483 + struct aml_resource_pin_group_config { 484 + AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id; 485 + u16 flags; 486 + u8 pin_config_type; 487 + u32 pin_config_value; 488 + u8 res_source_index; 489 + u16 res_source_offset; 490 + u16 res_source_label_offset; 491 + u16 vendor_offset; 492 + u16 vendor_length; 493 + /* 494 + * Optional fields follow immediately: 495 + * 1) Resource Source String 496 + * 2) Resource Source Label String 497 + * 3) Vendor Data bytes 498 + */ 499 + }; 500 + 501 + #define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION 1 /* ACPI 6.2 */ 502 + 410 503 /* restore default alignment */ 411 504 412 505 #pragma pack() ··· 545 446 struct aml_resource_spi_serialbus spi_serial_bus; 546 447 struct aml_resource_uart_serialbus uart_serial_bus; 547 448 struct aml_resource_common_serialbus common_serial_bus; 449 + struct aml_resource_pin_function pin_function; 450 + struct aml_resource_pin_config pin_config; 451 + struct aml_resource_pin_group pin_group; 452 + struct aml_resource_pin_group_function pin_group_function; 453 + struct aml_resource_pin_group_config pin_group_config; 548 454 549 455 /* Utility overlays */ 550 456
+12
drivers/acpi/acpica/dbexec.c
··· 181 181 acpi_gbl_method_executing = FALSE; 182 182 183 183 if (ACPI_FAILURE(status)) { 184 + if ((status == AE_ABORT_METHOD) || acpi_gbl_abort_method) { 185 + 186 + /* Clear the abort and fall back to the debugger prompt */ 187 + 188 + ACPI_EXCEPTION((AE_INFO, status, 189 + "Aborting top-level method")); 190 + 191 + acpi_gbl_abort_method = FALSE; 192 + status = AE_OK; 193 + goto cleanup; 194 + } 195 + 184 196 ACPI_EXCEPTION((AE_INFO, status, 185 197 "while executing %s from debugger", 186 198 info->pathname));
+3 -3
drivers/acpi/acpica/dbobject.c
··· 448 448 449 449 if (display_locals) { 450 450 acpi_os_printf 451 - ("\nInitialized Local Variables for method [%4.4s]:\n", 451 + ("\nInitialized Local Variables for Method [%4.4s]:\n", 452 452 acpi_ut_get_node_name(node)); 453 453 454 454 for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) { ··· 461 461 } 462 462 } else { 463 463 acpi_os_printf 464 - ("No Local Variables are initialized for method [%4.4s]\n", 464 + ("No Local Variables are initialized for Method [%4.4s]\n", 465 465 acpi_ut_get_node_name(node)); 466 466 } 467 467 } ··· 515 515 acpi_os_printf("Initialized Arguments for Method [%4.4s]: " 516 516 "(%X arguments defined for method invocation)\n", 517 517 acpi_ut_get_node_name(node), 518 - obj_desc->method.param_count); 518 + node->object->method.param_count); 519 519 520 520 for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { 521 521 obj_desc = walk_state->arguments[i].object;
+1 -1
drivers/acpi/acpica/dbxface.c
··· 244 244 if ((acpi_gbl_db_output_to_file) || 245 245 (acpi_dbg_level & ACPI_LV_PARSE)) { 246 246 acpi_os_printf 247 - ("\n[AmlDebug] Next AML Opcode to execute:\n"); 247 + ("\nAML Debug: Next AML Opcode to execute:\n"); 248 248 } 249 249 250 250 /*
+3 -2
drivers/acpi/acpica/dsargs.c
··· 82 82 union acpi_parse_object *op; 83 83 struct acpi_walk_state *walk_state; 84 84 85 - ACPI_FUNCTION_TRACE(ds_execute_arguments); 85 + ACPI_FUNCTION_TRACE_PTR(ds_execute_arguments, aml_start); 86 86 87 87 /* Allocate a new parser op to be the root of the parsed tree */ 88 88 ··· 338 338 return_ACPI_STATUS(AE_AML_INTERNAL); 339 339 } 340 340 341 - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Package Arg Init\n")); 341 + ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Package Argument Init, AML Ptr: %p\n", 342 + obj_desc->package.aml_start)); 342 343 343 344 /* Execute the AML code for the term_arg arguments */ 344 345
+1
drivers/acpi/acpica/dsdebug.c
··· 196 196 op->common.next = NULL; 197 197 198 198 #ifdef ACPI_DISASSEMBLER 199 + acpi_os_printf("Failed at "); 199 200 acpi_dm_disassemble(next_walk_state, op, 200 201 ACPI_UINT32_MAX); 201 202 #endif
+8 -4
drivers/acpi/acpica/dsmethod.c
··· 212 212 acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) 213 213 { 214 214 u32 aml_offset; 215 + acpi_name name = 0; 215 216 216 217 ACPI_FUNCTION_ENTRY(); 217 218 ··· 238 237 walk_state->parser_state. 239 238 aml_start); 240 239 241 - status = acpi_gbl_exception_handler(status, 242 - walk_state->method_node ? 243 - walk_state->method_node-> 244 - name.integer : 0, 240 + if (walk_state->method_node) { 241 + name = walk_state->method_node->name.integer; 242 + } else if (walk_state->deferred_node) { 243 + name = walk_state->deferred_node->name.integer; 244 + } 245 + 246 + status = acpi_gbl_exception_handler(status, name, 245 247 walk_state->opcode, 246 248 aml_offset, NULL); 247 249 acpi_ex_enter_interpreter();
+5 -6
drivers/acpi/acpica/dsopcode.c
··· 227 227 228 228 /* Entire field must fit within the current length of the buffer */ 229 229 230 - if ((bit_offset + bit_count) > (8 * (u32) buffer_desc->buffer.length)) { 230 + if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) { 231 231 ACPI_ERROR((AE_INFO, 232 - "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)", 233 - acpi_ut_get_node_name(result_desc), 234 - bit_offset + bit_count, 235 - acpi_ut_get_node_name(buffer_desc->buffer.node), 236 - 8 * (u32) buffer_desc->buffer.length)); 232 + "Field [%4.4s] at bit offset/length %u/%u " 233 + "exceeds size of target Buffer (%u bits)", 234 + acpi_ut_get_node_name(result_desc), bit_offset, 235 + bit_count, 8 * (u32)buffer_desc->buffer.length)); 237 236 status = AE_AML_BUFFER_LIMIT; 238 237 goto cleanup; 239 238 }
-9
drivers/acpi/acpica/dsutils.c
··· 633 633 634 634 if ((op_info->flags & AML_HAS_RETVAL) || 635 635 (arg->common.flags & ACPI_PARSEOP_IN_STACK)) { 636 - ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 637 - "Argument previously created, already stacked\n")); 638 - 639 - acpi_db_display_argument_object(walk_state-> 640 - operands[walk_state-> 641 - num_operands - 642 - 1], 643 - walk_state); 644 - 645 636 /* 646 637 * Use value that was already previously returned 647 638 * by the evaluation of this argument
+2 -2
drivers/acpi/acpica/dswexec.c
··· 576 576 case AML_TYPE_CREATE_OBJECT: 577 577 578 578 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 579 - "Executing CreateObject (Buffer/Package) Op=%p\n", 580 - op)); 579 + "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n", 580 + op, op->named.data)); 581 581 582 582 switch (op->common.parent->common.aml_opcode) { 583 583 case AML_NAME_OP:
+40 -2
drivers/acpi/acpica/dswload.c
··· 397 397 /* Initialize the op */ 398 398 399 399 #if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)) 400 - op->named.path = ACPI_CAST_PTR(u8, path); 400 + op->named.path = path; 401 401 #endif 402 402 403 403 if (node) { ··· 433 433 union acpi_parse_object *op; 434 434 acpi_object_type object_type; 435 435 acpi_status status = AE_OK; 436 + 437 + #ifdef ACPI_ASL_COMPILER 438 + u8 param_count; 439 + #endif 436 440 437 441 ACPI_FUNCTION_TRACE(ds_load1_end_op); 438 442 ··· 518 514 } 519 515 } 520 516 } 517 + #ifdef ACPI_ASL_COMPILER 518 + /* 519 + * For external opcode, get the object type from the argument and 520 + * get the parameter count from the argument's next. 521 + */ 522 + if (acpi_gbl_disasm_flag && 523 + op->common.node && op->common.aml_opcode == AML_EXTERNAL_OP) { 524 + /* 525 + * Note, if this external is not a method 526 + * Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0 527 + * Therefore, param_count will be 0. 528 + */ 529 + param_count = 530 + (u8)op->common.value.arg->common.next->common.value.integer; 531 + object_type = (u8)op->common.value.arg->common.value.integer; 532 + op->common.node->flags |= ANOBJ_IS_EXTERNAL; 533 + op->common.node->type = (u8)object_type; 534 + 535 + acpi_dm_create_subobject_for_external((u8)object_type, 536 + &op->common.node, 537 + param_count); 538 + 539 + /* 540 + * Add the external to the external list because we may be 541 + * emitting code based off of the items within the external list. 542 + */ 543 + acpi_dm_add_op_to_external_list(op, op->named.path, 544 + (u8)object_type, param_count, 545 + ACPI_EXT_ORIGIN_FROM_OPCODE | 546 + ACPI_EXT_RESOLVED_REFERENCE); 547 + } 548 + #endif 521 549 522 550 /* 523 551 * If we are executing a method, do not create any namespace objects ··· 599 563 600 564 /* Pop the scope stack (only if loading a table) */ 601 565 602 - if (!walk_state->method_node && acpi_ns_opens_scope(object_type)) { 566 + if (!walk_state->method_node && 567 + op->common.aml_opcode != AML_EXTERNAL_OP && 568 + acpi_ns_opens_scope(object_type)) { 603 569 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 604 570 "(%s): Popping scope for Op %p\n", 605 571 acpi_ut_get_type_name(object_type), op));
+16
drivers/acpi/acpica/dswload2.c
··· 310 310 flags |= ACPI_NS_TEMPORARY; 311 311 } 312 312 } 313 + #ifdef ACPI_ASL_COMPILER 314 + 315 + /* 316 + * Do not open a scope for AML_EXTERNAL_OP 317 + * acpi_ns_lookup can open a new scope based on the object type 318 + * of this op. AML_EXTERNAL_OP is a declaration rather than a 319 + * definition. In the case that this external is a method object, 320 + * acpi_ns_lookup will open a new scope. However, an AML_EXTERNAL_OP 321 + * associated with the ACPI_TYPE_METHOD is a declaration, rather than 322 + * a definition. Flags is set to avoid opening a scope for any 323 + * AML_EXTERNAL_OP. 324 + */ 325 + if (walk_state->opcode == AML_EXTERNAL_OP) { 326 + flags |= ACPI_NS_DONT_OPEN_SCOPE; 327 + } 328 + #endif 313 329 314 330 /* Add new entry or lookup existing entry */ 315 331
+18
drivers/acpi/acpica/evxfevnt.c
··· 180 180 181 181 ACPI_FUNCTION_TRACE(acpi_enable_event); 182 182 183 + /* If Hardware Reduced flag is set, there are no fixed events */ 184 + 185 + if (acpi_gbl_reduced_hardware) { 186 + return_ACPI_STATUS(AE_OK); 187 + } 188 + 183 189 /* Decode the Fixed Event */ 184 190 185 191 if (event > ACPI_EVENT_MAX) { ··· 243 237 244 238 ACPI_FUNCTION_TRACE(acpi_disable_event); 245 239 240 + /* If Hardware Reduced flag is set, there are no fixed events */ 241 + 242 + if (acpi_gbl_reduced_hardware) { 243 + return_ACPI_STATUS(AE_OK); 244 + } 245 + 246 246 /* Decode the Fixed Event */ 247 247 248 248 if (event > ACPI_EVENT_MAX) { ··· 301 289 acpi_status status = AE_OK; 302 290 303 291 ACPI_FUNCTION_TRACE(acpi_clear_event); 292 + 293 + /* If Hardware Reduced flag is set, there are no fixed events */ 294 + 295 + if (acpi_gbl_reduced_hardware) { 296 + return_ACPI_STATUS(AE_OK); 297 + } 304 298 305 299 /* Decode the Fixed Event */ 306 300
+2 -2
drivers/acpi/acpica/exdebug.c
··· 117 117 timer = ((u32)acpi_os_get_timer() / 10); 118 118 timer &= 0x03FFFFFF; 119 119 120 - acpi_os_printf("[ACPI Debug T=0x%8.8X] %*s", timer, 120 + acpi_os_printf("ACPI Debug: T=0x%8.8X %*s", timer, 121 121 level, " "); 122 122 } else { 123 - acpi_os_printf("[ACPI Debug] %*s", level, " "); 123 + acpi_os_printf("ACPI Debug: %*s", level, " "); 124 124 } 125 125 } 126 126
+20 -10
drivers/acpi/acpica/exdump.c
··· 645 645 /* obj_desc is a valid object */ 646 646 647 647 if (depth > 0) { 648 - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p ", 649 - depth, " ", depth, obj_desc)); 648 + ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ", 649 + depth, " ", depth, obj_desc, 650 + obj_desc->common.reference_count)); 650 651 } else { 651 - ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p ", obj_desc)); 652 + ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p Refs=%u ", 653 + obj_desc, obj_desc->common.reference_count)); 652 654 } 653 655 654 656 /* Decode object type */ ··· 692 690 693 691 case ACPI_REFCLASS_NAME: 694 692 695 - acpi_os_printf("- [%4.4s]\n", 696 - obj_desc->reference.node->name.ascii); 693 + acpi_ut_repair_name(obj_desc->reference.node->name. 694 + ascii); 695 + acpi_os_printf("- [%4.4s] (Node %p)\n", 696 + obj_desc->reference.node->name.ascii, 697 + obj_desc->reference.node); 697 698 break; 698 699 699 700 case ACPI_REFCLASS_ARG: ··· 1004 999 status = acpi_ns_handle_to_pathname(obj_desc->reference.node, 1005 1000 &ret_buf, TRUE); 1006 1001 if (ACPI_FAILURE(status)) { 1007 - acpi_os_printf(" Could not convert name to pathname\n"); 1002 + acpi_os_printf 1003 + (" Could not convert name to pathname: %s\n", 1004 + acpi_format_exception(status)); 1008 1005 } else { 1009 - acpi_os_printf("%s\n", (char *)ret_buf.pointer); 1006 + acpi_os_printf("%s: %s\n", 1007 + acpi_ut_get_type_name(obj_desc-> 1008 + reference.node-> 1009 + type), 1010 + (char *)ret_buf.pointer); 1010 1011 ACPI_FREE(ret_buf.pointer); 1011 1012 } 1012 1013 } else if (obj_desc->reference.object) { ··· 1122 1111 1123 1112 case ACPI_TYPE_LOCAL_REFERENCE: 1124 1113 1125 - acpi_os_printf("[Object Reference] Type [%s] %2.2X", 1126 - acpi_ut_get_reference_name(obj_desc), 1127 - obj_desc->reference.class); 1114 + acpi_os_printf("[Object Reference] Class [%s]", 1115 + acpi_ut_get_reference_name(obj_desc)); 1128 1116 acpi_ex_dump_reference_obj(obj_desc); 1129 1117 break; 1130 1118
+19 -6
drivers/acpi/acpica/exoparg1.c
··· 921 921 * This is a deref_of (object_reference) 922 922 * Get the actual object from the Node (This is the dereference). 923 923 * This case may only happen when a local_x or arg_x is 924 - * dereferenced above. 924 + * dereferenced above, or for references to device and 925 + * thermal objects. 925 926 */ 926 - return_desc = acpi_ns_get_attached_object((struct 927 - acpi_namespace_node 928 - *) 929 - operand[0]); 930 - acpi_ut_add_reference(return_desc); 927 + switch (((struct acpi_namespace_node *)operand[0])-> 928 + type) { 929 + case ACPI_TYPE_DEVICE: 930 + case ACPI_TYPE_THERMAL: 931 + 932 + /* These types have no node subobject, return the NS node */ 933 + 934 + return_desc = operand[0]; 935 + break; 936 + 937 + default: 938 + /* For most types, get the object attached to the node */ 939 + 940 + return_desc = acpi_ns_get_attached_object((struct acpi_namespace_node *)operand[0]); 941 + acpi_ut_add_reference(return_desc); 942 + break; 943 + } 931 944 } else { 932 945 /* 933 946 * This must be a reference object produced by either the
+18 -5
drivers/acpi/acpica/exresolv.c
··· 368 368 *)obj_desc); 369 369 } 370 370 371 - if (!obj_desc) { 372 - ACPI_ERROR((AE_INFO, 373 - "[%4.4s] Node is unresolved or uninitialized", 374 - acpi_ut_get_node_name(node))); 375 - return_ACPI_STATUS(AE_AML_UNINITIALIZED_NODE); 371 + switch (type) { 372 + case ACPI_TYPE_DEVICE: 373 + case ACPI_TYPE_THERMAL: 374 + 375 + /* These types have no attached subobject */ 376 + break; 377 + 378 + default: 379 + 380 + /* All other types require a subobject */ 381 + 382 + if (!obj_desc) { 383 + ACPI_ERROR((AE_INFO, 384 + "[%4.4s] Node is unresolved or uninitialized", 385 + acpi_ut_get_node_name(node))); 386 + return_ACPI_STATUS(AE_AML_UNINITIALIZED_NODE); 387 + } 388 + break; 376 389 } 377 390 break; 378 391
+9 -5
drivers/acpi/acpica/hwxfsleep.c
··· 70 70 /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */ 71 71 72 72 static struct acpi_sleep_functions acpi_sleep_dispatch[] = { 73 - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep), 74 - acpi_hw_extended_sleep}, 75 - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep), 76 - acpi_hw_extended_wake_prep}, 77 - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake} 73 + {ACPI_STRUCT_INIT(legacy_function, 74 + ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep)), 75 + ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_sleep) }, 76 + {ACPI_STRUCT_INIT(legacy_function, 77 + ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep)), 78 + ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_wake_prep) }, 79 + {ACPI_STRUCT_INIT(legacy_function, 80 + ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake)), 81 + ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_wake) } 78 82 }; 79 83 80 84 /*
+27
drivers/acpi/acpica/nsaccess.c
··· 47 47 #include "acnamesp.h" 48 48 #include "acdispat.h" 49 49 50 + #ifdef ACPI_ASL_COMPILER 51 + #include "acdisasm.h" 52 + #endif 53 + 50 54 #define _COMPONENT ACPI_NAMESPACE 51 55 ACPI_MODULE_NAME("nsaccess") 52 56 ··· 584 580 (char *)&current_node->name, 585 581 current_node)); 586 582 } 583 + #ifdef ACPI_ASL_COMPILER 584 + /* 585 + * If this ACPI name already exists within the namespace as an 586 + * external declaration, then mark the external as a conflicting 587 + * declaration and proceed to process the current node as if it did 588 + * not exist in the namespace. If this node is not processed as 589 + * normal, then it could cause improper namespace resolution 590 + * by failing to open a new scope. 591 + */ 592 + if (acpi_gbl_disasm_flag && 593 + (status == AE_ALREADY_EXISTS) && 594 + ((this_node->flags & ANOBJ_IS_EXTERNAL) || 595 + (walk_state 596 + && walk_state->opcode == AML_EXTERNAL_OP))) { 597 + this_node->flags &= ~ANOBJ_IS_EXTERNAL; 598 + this_node->type = (u8)this_search_type; 599 + if (walk_state->opcode != AML_EXTERNAL_OP) { 600 + acpi_dm_mark_external_conflict 601 + (this_node); 602 + } 603 + break; 604 + } 605 + #endif 587 606 588 607 *return_node = this_node; 589 608 return_ACPI_STATUS(status);
-3
drivers/acpi/acpica/nsnames.c
··· 190 190 191 191 (void)acpi_ns_build_normalized_path(node, buffer->pointer, 192 192 required_size, no_trailing); 193 - if (ACPI_FAILURE(status)) { 194 - return_ACPI_STATUS(status); 195 - } 196 193 197 194 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n", 198 195 (char *)buffer->pointer, (u32) required_size));
+1 -1
drivers/acpi/acpica/nsutils.c
··· 89 89 acpi_os_printf("%s ", message); 90 90 } 91 91 92 - acpi_os_printf("[%s] (Node %p)", (char *)buffer.pointer, node); 92 + acpi_os_printf("%s", (char *)buffer.pointer); 93 93 ACPI_FREE(buffer.pointer); 94 94 } 95 95 }
+30 -11
drivers/acpi/acpica/nsxfeval.c
··· 85 85 { 86 86 acpi_status status; 87 87 u8 free_buffer_on_error = FALSE; 88 + acpi_handle target_handle; 89 + char *full_pathname; 88 90 89 91 ACPI_FUNCTION_TRACE(acpi_evaluate_object_typed); 90 92 ··· 100 98 free_buffer_on_error = TRUE; 101 99 } 102 100 103 - /* Evaluate the object */ 104 - 105 - status = acpi_evaluate_object(handle, pathname, 106 - external_params, return_buffer); 101 + status = acpi_get_handle(handle, pathname, &target_handle); 107 102 if (ACPI_FAILURE(status)) { 108 103 return_ACPI_STATUS(status); 109 104 } 110 105 111 - /* Type ANY means "don't care" */ 106 + full_pathname = acpi_ns_get_external_pathname(target_handle); 107 + if (!full_pathname) { 108 + return_ACPI_STATUS(AE_NO_MEMORY); 109 + } 110 + 111 + /* Evaluate the object */ 112 + 113 + status = acpi_evaluate_object(target_handle, NULL, external_params, 114 + return_buffer); 115 + if (ACPI_FAILURE(status)) { 116 + goto exit; 117 + } 118 + 119 + /* Type ANY means "don't care about return value type" */ 112 120 113 121 if (return_type == ACPI_TYPE_ANY) { 114 - return_ACPI_STATUS(AE_OK); 122 + goto exit; 115 123 } 116 124 117 125 if (return_buffer->length == 0) { 118 126 119 127 /* Error because caller specifically asked for a return value */ 120 128 121 - ACPI_ERROR((AE_INFO, "No return value")); 122 - return_ACPI_STATUS(AE_NULL_OBJECT); 129 + ACPI_ERROR((AE_INFO, "%s did not return any object", 130 + full_pathname)); 131 + status = AE_NULL_OBJECT; 132 + goto exit; 123 133 } 124 134 125 135 /* Examine the object type returned from evaluate_object */ 126 136 127 137 if (((union acpi_object *)return_buffer->pointer)->type == return_type) { 128 - return_ACPI_STATUS(AE_OK); 138 + goto exit; 129 139 } 130 140 131 141 /* Return object type does not match requested type */ 132 142 133 143 ACPI_ERROR((AE_INFO, 134 - "Incorrect return type [%s] requested [%s]", 144 + "Incorrect return type from %s - received [%s], requested [%s]", 145 + full_pathname, 135 146 acpi_ut_get_type_name(((union acpi_object *)return_buffer-> 136 147 pointer)->type), 137 148 acpi_ut_get_type_name(return_type))); ··· 162 147 } 163 148 164 149 return_buffer->length = 0; 165 - return_ACPI_STATUS(AE_TYPE); 150 + status = AE_TYPE; 151 + 152 + exit: 153 + ACPI_FREE(full_pathname); 154 + return_ACPI_STATUS(status); 166 155 } 167 156 168 157 ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed)
+14
drivers/acpi/acpica/psobject.c
··· 122 122 (u32)(aml_offset + 123 123 sizeof(struct acpi_table_header))); 124 124 125 + ACPI_ERROR((AE_INFO, 126 + "Aborting disassembly, AML byte code is corrupt")); 127 + 125 128 /* Dump the context surrounding the invalid opcode */ 126 129 127 130 acpi_ut_dump_buffer(((u8 *)walk_state->parser_state. ··· 133 130 sizeof(struct acpi_table_header) - 134 131 16)); 135 132 acpi_os_printf(" */\n"); 133 + 134 + /* 135 + * Just abort the disassembly, cannot continue because the 136 + * parser is essentially lost. The disassembler can then 137 + * randomly fail because an ill-constructed parse tree 138 + * can result. 139 + */ 140 + return_ACPI_STATUS(AE_AML_BAD_OPCODE); 136 141 #endif 137 142 } 138 143 ··· 341 330 status = acpi_ps_get_aml_opcode(walk_state); 342 331 if (status == AE_CTRL_PARSE_CONTINUE) { 343 332 return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE); 333 + } 334 + if (ACPI_FAILURE(status)) { 335 + return_ACPI_STATUS(status); 344 336 } 345 337 346 338 /* Create Op structure and append to parent's argument list */
+5 -3
drivers/acpi/acpica/psopcode.c
··· 650 650 651 651 /* ACPI 6.0 opcodes */ 652 652 653 - /* 81 */ ACPI_OP("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, 654 - ACPI_TYPE_ANY, AML_CLASS_EXECUTE, /* ? */ 655 - AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), 653 + /* 81 */ ACPI_OP("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, 654 + ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, 655 + AML_TYPE_NAMED_SIMPLE, 656 + AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | 657 + AML_NSNODE | AML_NAMED), 656 658 /* 82 */ ACPI_OP("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP, 657 659 ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, 658 660 AML_TYPE_LITERAL, AML_CONSTANT)
+11 -3
drivers/acpi/acpica/psparse.c
··· 56 56 #include "acdispat.h" 57 57 #include "amlcode.h" 58 58 #include "acinterp.h" 59 + #include "acnamesp.h" 59 60 60 61 #define _COMPONENT ACPI_PARSER 61 62 ACPI_MODULE_NAME("psparse") ··· 539 538 /* Either the method parse or actual execution failed */ 540 539 541 540 acpi_ex_exit_interpreter(); 542 - ACPI_ERROR_METHOD("Method parse/execution failed", 543 - walk_state->method_node, NULL, 544 - status); 541 + if (status == AE_ABORT_METHOD) { 542 + acpi_ns_print_node_pathname(walk_state-> 543 + method_node, 544 + "Method aborted:"); 545 + acpi_os_printf("\n"); 546 + } else { 547 + ACPI_ERROR_METHOD 548 + ("Method parse/execution failed", 549 + walk_state->method_node, NULL, status); 550 + } 545 551 acpi_ex_enter_interpreter(); 546 552 547 553 /* Check for possible multi-thread reentrancy problem */
+139
drivers/acpi/acpica/rscalc.c
··· 340 340 341 341 break; 342 342 343 + case ACPI_RESOURCE_TYPE_PIN_FUNCTION: 344 + 345 + total_size = (acpi_rs_length)(total_size + 346 + (resource->data. 347 + pin_function. 348 + pin_table_length * 2) + 349 + resource->data. 350 + pin_function. 351 + resource_source. 352 + string_length + 353 + resource->data. 354 + pin_function. 355 + vendor_length); 356 + 357 + break; 358 + 343 359 case ACPI_RESOURCE_TYPE_SERIAL_BUS: 344 360 345 361 total_size = ··· 371 355 string_length + 372 356 resource->data. 373 357 i2c_serial_bus. 358 + vendor_length); 359 + 360 + break; 361 + 362 + case ACPI_RESOURCE_TYPE_PIN_CONFIG: 363 + 364 + total_size = (acpi_rs_length)(total_size + 365 + (resource->data. 366 + pin_config. 367 + pin_table_length * 2) + 368 + resource->data.pin_config. 369 + resource_source. 370 + string_length + 371 + resource->data.pin_config. 372 + vendor_length); 373 + 374 + break; 375 + 376 + case ACPI_RESOURCE_TYPE_PIN_GROUP: 377 + 378 + total_size = (acpi_rs_length)(total_size + 379 + (resource->data.pin_group. 380 + pin_table_length * 2) + 381 + resource->data.pin_group. 382 + resource_label. 383 + string_length + 384 + resource->data.pin_group. 385 + vendor_length); 386 + 387 + break; 388 + 389 + case ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION: 390 + 391 + total_size = (acpi_rs_length)(total_size + 392 + resource->data. 393 + pin_group_function. 394 + resource_source. 395 + string_length + 396 + resource->data. 397 + pin_group_function. 398 + resource_source_label. 399 + string_length + 400 + resource->data. 401 + pin_group_function. 402 + vendor_length); 403 + 404 + break; 405 + 406 + case ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG: 407 + 408 + total_size = (acpi_rs_length)(total_size + 409 + resource->data. 410 + pin_group_config. 411 + resource_source. 412 + string_length + 413 + resource->data. 414 + pin_group_config. 415 + resource_source_label. 416 + string_length + 417 + resource->data. 418 + pin_group_config. 374 419 vendor_length); 375 420 376 421 break; ··· 614 537 } 615 538 break; 616 539 540 + case ACPI_RESOURCE_NAME_PIN_FUNCTION: 541 + 542 + /* Vendor data is optional */ 543 + 544 + if (aml_resource->pin_function.vendor_length) { 545 + extra_struct_bytes += 546 + aml_resource->pin_function.vendor_offset - 547 + aml_resource->pin_function. 548 + pin_table_offset + 549 + aml_resource->pin_function.vendor_length; 550 + } else { 551 + extra_struct_bytes += 552 + aml_resource->large_header.resource_length + 553 + sizeof(struct aml_resource_large_header) - 554 + aml_resource->pin_function.pin_table_offset; 555 + } 556 + break; 557 + 617 558 case ACPI_RESOURCE_NAME_SERIAL_BUS: 618 559 619 560 minimum_aml_resource_length = ··· 640 545 extra_struct_bytes += 641 546 aml_resource->common_serial_bus.resource_length - 642 547 minimum_aml_resource_length; 548 + break; 549 + 550 + case ACPI_RESOURCE_NAME_PIN_CONFIG: 551 + 552 + /* Vendor data is optional */ 553 + 554 + if (aml_resource->pin_config.vendor_length) { 555 + extra_struct_bytes += 556 + aml_resource->pin_config.vendor_offset - 557 + aml_resource->pin_config.pin_table_offset + 558 + aml_resource->pin_config.vendor_length; 559 + } else { 560 + extra_struct_bytes += 561 + aml_resource->large_header.resource_length + 562 + sizeof(struct aml_resource_large_header) - 563 + aml_resource->pin_config.pin_table_offset; 564 + } 565 + break; 566 + 567 + case ACPI_RESOURCE_NAME_PIN_GROUP: 568 + 569 + extra_struct_bytes += 570 + aml_resource->pin_group.vendor_offset - 571 + aml_resource->pin_group.pin_table_offset + 572 + aml_resource->pin_group.vendor_length; 573 + 574 + break; 575 + 576 + case ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION: 577 + 578 + extra_struct_bytes += 579 + aml_resource->pin_group_function.vendor_offset - 580 + aml_resource->pin_group_function.res_source_offset + 581 + aml_resource->pin_group_function.vendor_length; 582 + 583 + break; 584 + 585 + case ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG: 586 + 587 + extra_struct_bytes += 588 + aml_resource->pin_group_config.vendor_offset - 589 + aml_resource->pin_group_config.res_source_offset + 590 + aml_resource->pin_group_config.vendor_length; 591 + 643 592 break; 644 593 645 594 default:
+48
drivers/acpi/acpica/rsdump.c
··· 75 75 static void 76 76 acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source); 77 77 78 + static void 79 + acpi_rs_dump_resource_label(char *title, 80 + struct acpi_resource_label *resource_label); 81 + 78 82 static void acpi_rs_dump_address_common(union acpi_resource_data *resource); 79 83 80 84 static void ··· 375 371 target)); 376 372 break; 377 373 374 + case ACPI_RSD_LABEL: 375 + /* 376 + * resource_label 377 + */ 378 + acpi_rs_dump_resource_label("Resource Label", 379 + ACPI_CAST_PTR(struct 380 + acpi_resource_label, 381 + target)); 382 + break; 383 + 384 + case ACPI_RSD_SOURCE_LABEL: 385 + /* 386 + * resource_source_label 387 + */ 388 + acpi_rs_dump_resource_label("Resource Source Label", 389 + ACPI_CAST_PTR(struct 390 + acpi_resource_label, 391 + target)); 392 + break; 393 + 378 394 default: 379 395 380 396 acpi_os_printf("**** Invalid table opcode [%X] ****\n", ··· 434 410 acpi_rs_out_string("Resource Source", 435 411 resource_source->string_ptr ? 436 412 resource_source->string_ptr : "[Not Specified]"); 413 + } 414 + 415 + /******************************************************************************* 416 + * 417 + * FUNCTION: acpi_rs_dump_resource_label 418 + * 419 + * PARAMETERS: title - Title of the dumped resource field 420 + * resource_label - Pointer to a Resource Label struct 421 + * 422 + * RETURN: None 423 + * 424 + * DESCRIPTION: Common routine for dumping the resource_label 425 + * 426 + ******************************************************************************/ 427 + 428 + static void 429 + acpi_rs_dump_resource_label(char *title, 430 + struct acpi_resource_label *resource_label) 431 + { 432 + ACPI_FUNCTION_ENTRY(); 433 + 434 + acpi_rs_out_string(title, 435 + resource_label->string_ptr ? 436 + resource_label->string_ptr : "[Not Specified]"); 437 437 } 438 438 439 439 /*******************************************************************************
+114
drivers/acpi/acpica/rsdumpinfo.c
··· 314 314 NULL}, 315 315 }; 316 316 317 + struct acpi_rsdump_info acpi_rs_dump_pin_function[10] = { 318 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_function), 319 + "PinFunction", NULL}, 320 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.revision_id), 321 + "RevisionId", NULL}, 322 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.pin_config), "PinConfig", 323 + acpi_gbl_ppc_decode}, 324 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_function.sharable), "Sharing", 325 + acpi_gbl_shr_decode}, 326 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.function_number), 327 + "FunctionNumber", NULL}, 328 + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_function.resource_source), 329 + "ResourceSource", NULL}, 330 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.pin_table_length), 331 + "PinTableLength", NULL}, 332 + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_function.pin_table), "PinTable", 333 + NULL}, 334 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.vendor_length), 335 + "VendorLength", NULL}, 336 + {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_function.vendor_data), 337 + "VendorData", NULL}, 338 + }; 339 + 340 + struct acpi_rsdump_info acpi_rs_dump_pin_config[11] = { 341 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_config), 342 + "PinConfig", NULL}, 343 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.revision_id), "RevisionId", 344 + NULL}, 345 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.producer_consumer), 346 + "ProducerConsumer", acpi_gbl_consume_decode}, 347 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.sharable), "Sharing", 348 + acpi_gbl_shr_decode}, 349 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.pin_config_type), 350 + "PinConfigType", NULL}, 351 + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(pin_config.pin_config_value), 352 + "PinConfigValue", NULL}, 353 + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_config.resource_source), 354 + "ResourceSource", NULL}, 355 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_config.pin_table_length), 356 + "PinTableLength", NULL}, 357 + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_config.pin_table), "PinTable", 358 + NULL}, 359 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_config.vendor_length), 360 + "VendorLength", NULL}, 361 + {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_config.vendor_data), 362 + "VendorData", NULL}, 363 + }; 364 + 365 + struct acpi_rsdump_info acpi_rs_dump_pin_group[8] = { 366 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group), 367 + "PinGroup", NULL}, 368 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group.revision_id), "RevisionId", 369 + NULL}, 370 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group.producer_consumer), 371 + "ProducerConsumer", acpi_gbl_consume_decode}, 372 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group.pin_table_length), 373 + "PinTableLength", NULL}, 374 + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(pin_group.pin_table), "PinTable", 375 + NULL}, 376 + {ACPI_RSD_LABEL, ACPI_RSD_OFFSET(pin_group.resource_label), 377 + "ResourceLabel", NULL}, 378 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group.vendor_length), 379 + "VendorLength", NULL}, 380 + {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group.vendor_data), 381 + "VendorData", NULL}, 382 + }; 383 + 384 + struct acpi_rsdump_info acpi_rs_dump_pin_group_function[9] = { 385 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group_function), 386 + "PinGroupFunction", NULL}, 387 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_function.revision_id), 388 + "RevisionId", NULL}, 389 + {ACPI_RSD_1BITFLAG, 390 + ACPI_RSD_OFFSET(pin_group_function.producer_consumer), 391 + "ProducerConsumer", acpi_gbl_consume_decode}, 392 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_function.sharable), 393 + "Sharing", acpi_gbl_shr_decode}, 394 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.function_number), 395 + "FunctionNumber", NULL}, 396 + {ACPI_RSD_SOURCE_LABEL, 397 + ACPI_RSD_OFFSET(pin_group_function.resource_source_label), 398 + "ResourceSourceLabel", NULL}, 399 + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_group_function.resource_source), 400 + "ResourceSource", NULL}, 401 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.vendor_length), 402 + "VendorLength", NULL}, 403 + {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group_function.vendor_data), 404 + "VendorData", NULL}, 405 + }; 406 + 407 + struct acpi_rsdump_info acpi_rs_dump_pin_group_config[10] = { 408 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_pin_group_config), 409 + "PinGroupConfig", NULL}, 410 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.revision_id), 411 + "RevisionId", NULL}, 412 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.producer_consumer), 413 + "ProducerConsumer", acpi_gbl_consume_decode}, 414 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.sharable), 415 + "Sharing", acpi_gbl_shr_decode}, 416 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.pin_config_type), 417 + "PinConfigType", NULL}, 418 + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(pin_group_config.pin_config_value), 419 + "PinConfigValue", NULL}, 420 + {ACPI_RSD_SOURCE_LABEL, 421 + ACPI_RSD_OFFSET(pin_group_config.resource_source_label), 422 + "ResourceSourceLabel", NULL}, 423 + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(pin_group_config.resource_source), 424 + "ResourceSource", NULL}, 425 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_config.vendor_length), 426 + "VendorLength", NULL}, 427 + {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(pin_group_config.vendor_data), 428 + "VendorData", NULL}, 429 + }; 430 + 317 431 struct acpi_rsdump_info acpi_rs_dump_fixed_dma[4] = { 318 432 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_dma), 319 433 "FixedDma", NULL},
+26 -2
drivers/acpi/acpica/rsinfo.c
··· 80 80 acpi_rs_convert_gpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */ 81 81 acpi_rs_convert_fixed_dma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */ 82 82 NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */ 83 + acpi_rs_convert_pin_function, /* 0x14, ACPI_RESOURCE_TYPE_PIN_FUNCTION */ 84 + acpi_rs_convert_pin_config, /* 0x15, ACPI_RESOURCE_TYPE_PIN_CONFIG */ 85 + acpi_rs_convert_pin_group, /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */ 86 + acpi_rs_convert_pin_group_function, /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ 87 + acpi_rs_convert_pin_group_config, /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ 83 88 }; 84 89 85 90 /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ ··· 124 119 acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ 125 120 acpi_rs_convert_ext_address64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ 126 121 acpi_rs_convert_gpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */ 127 - NULL, /* 0x0D, Reserved */ 122 + acpi_rs_convert_pin_function, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */ 128 123 NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */ 124 + acpi_rs_convert_pin_config, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */ 125 + acpi_rs_convert_pin_group, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */ 126 + acpi_rs_convert_pin_group_function, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */ 127 + acpi_rs_convert_pin_group_config, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */ 129 128 }; 130 129 131 130 /* Subtype table for serial_bus -- I2C, SPI, and UART */ ··· 166 157 acpi_rs_dump_gpio, /* ACPI_RESOURCE_TYPE_GPIO */ 167 158 acpi_rs_dump_fixed_dma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */ 168 159 NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ 160 + acpi_rs_dump_pin_function, /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */ 161 + acpi_rs_dump_pin_config, /* ACPI_RESOURCE_TYPE_PIN_CONFIG */ 162 + acpi_rs_dump_pin_group, /* ACPI_RESOURCE_TYPE_PIN_GROUP */ 163 + acpi_rs_dump_pin_group_function, /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ 164 + acpi_rs_dump_pin_group_config, /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ 169 165 }; 170 166 171 167 struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = { ··· 207 193 sizeof(struct aml_resource_gpio), /* ACPI_RESOURCE_TYPE_GPIO */ 208 194 sizeof(struct aml_resource_fixed_dma), /* ACPI_RESOURCE_TYPE_FIXED_DMA */ 209 195 sizeof(struct aml_resource_common_serialbus), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ 196 + sizeof(struct aml_resource_pin_function), /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */ 197 + sizeof(struct aml_resource_pin_config), /* ACPI_RESOURCE_TYPE_PIN_CONFIG */ 198 + sizeof(struct aml_resource_pin_group), /* ACPI_RESOURCE_TYPE_PIN_GROUP */ 199 + sizeof(struct aml_resource_pin_group_function), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ 200 + sizeof(struct aml_resource_pin_group_config), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ 210 201 }; 211 202 212 203 const u8 acpi_gbl_resource_struct_sizes[] = { ··· 249 230 ACPI_RS_SIZE(struct acpi_resource_address64), 250 231 ACPI_RS_SIZE(struct acpi_resource_extended_address64), 251 232 ACPI_RS_SIZE(struct acpi_resource_gpio), 252 - ACPI_RS_SIZE(struct acpi_resource_common_serialbus) 233 + ACPI_RS_SIZE(struct acpi_resource_pin_function), 234 + ACPI_RS_SIZE(struct acpi_resource_common_serialbus), 235 + ACPI_RS_SIZE(struct acpi_resource_pin_config), 236 + ACPI_RS_SIZE(struct acpi_resource_pin_group), 237 + ACPI_RS_SIZE(struct acpi_resource_pin_group_function), 238 + ACPI_RS_SIZE(struct acpi_resource_pin_group_config), 253 239 }; 254 240 255 241 const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = {
+1 -3
drivers/acpi/acpica/rsmisc.c
··· 596 596 597 597 /* Set vendor offset only if there is vendor data */ 598 598 599 - if (resource->data.gpio.vendor_length) { 600 - ACPI_SET16(target, aml_length); 601 - } 599 + ACPI_SET16(target, aml_length); 602 600 603 601 acpi_rs_set_resource_length(aml_length, aml); 604 602 break;
+373
drivers/acpi/acpica/rsserial.c
··· 147 147 148 148 /******************************************************************************* 149 149 * 150 + * acpi_rs_convert_pinfunction 151 + * 152 + ******************************************************************************/ 153 + 154 + struct acpi_rsconvert_info acpi_rs_convert_pin_function[13] = { 155 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_FUNCTION, 156 + ACPI_RS_SIZE(struct acpi_resource_pin_function), 157 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_function)}, 158 + 159 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_FUNCTION, 160 + sizeof(struct aml_resource_pin_function), 161 + 0}, 162 + 163 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_function.revision_id), 164 + AML_OFFSET(pin_function.revision_id), 165 + 1}, 166 + 167 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.sharable), 168 + AML_OFFSET(pin_function.flags), 169 + 0}, 170 + 171 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_function.pin_config), 172 + AML_OFFSET(pin_function.pin_config), 173 + 1}, 174 + 175 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.pin_function.function_number), 176 + AML_OFFSET(pin_function.function_number), 177 + 2}, 178 + 179 + /* Pin Table */ 180 + 181 + /* 182 + * It is OK to use GPIO operations here because none of them refer GPIO 183 + * structures directly but instead use offsets given here. 184 + */ 185 + 186 + {ACPI_RSC_COUNT_GPIO_PIN, 187 + ACPI_RS_OFFSET(data.pin_function.pin_table_length), 188 + AML_OFFSET(pin_function.pin_table_offset), 189 + AML_OFFSET(pin_function.res_source_offset)}, 190 + 191 + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.pin_function.pin_table), 192 + AML_OFFSET(pin_function.pin_table_offset), 193 + 0}, 194 + 195 + /* Resource Source */ 196 + 197 + {ACPI_RSC_MOVE8, 198 + ACPI_RS_OFFSET(data.pin_function.resource_source.index), 199 + AML_OFFSET(pin_function.res_source_index), 200 + 1}, 201 + 202 + {ACPI_RSC_COUNT_GPIO_RES, 203 + ACPI_RS_OFFSET(data.pin_function.resource_source.string_length), 204 + AML_OFFSET(pin_function.res_source_offset), 205 + AML_OFFSET(pin_function.vendor_offset)}, 206 + 207 + {ACPI_RSC_MOVE_GPIO_RES, 208 + ACPI_RS_OFFSET(data.pin_function.resource_source.string_ptr), 209 + AML_OFFSET(pin_function.res_source_offset), 210 + 0}, 211 + 212 + /* Vendor Data */ 213 + 214 + {ACPI_RSC_COUNT_GPIO_VEN, 215 + ACPI_RS_OFFSET(data.pin_function.vendor_length), 216 + AML_OFFSET(pin_function.vendor_length), 217 + 1}, 218 + 219 + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.pin_function.vendor_data), 220 + AML_OFFSET(pin_function.vendor_offset), 221 + 0}, 222 + }; 223 + 224 + /******************************************************************************* 225 + * 150 226 * acpi_rs_convert_i2c_serial_bus 151 227 * 152 228 ******************************************************************************/ ··· 533 457 ACPI_RS_OFFSET(data.uart_serial_bus.default_baud_rate), 534 458 AML_OFFSET(uart_serial_bus.default_baud_rate), 535 459 1}, 460 + }; 461 + 462 + /******************************************************************************* 463 + * 464 + * acpi_rs_convert_pin_config 465 + * 466 + ******************************************************************************/ 467 + 468 + struct acpi_rsconvert_info acpi_rs_convert_pin_config[14] = { 469 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_CONFIG, 470 + ACPI_RS_SIZE(struct acpi_resource_pin_config), 471 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_config)}, 472 + 473 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_CONFIG, 474 + sizeof(struct aml_resource_pin_config), 475 + 0}, 476 + 477 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_config.revision_id), 478 + AML_OFFSET(pin_config.revision_id), 479 + 1}, 480 + 481 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.sharable), 482 + AML_OFFSET(pin_config.flags), 483 + 0}, 484 + 485 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.producer_consumer), 486 + AML_OFFSET(pin_config.flags), 487 + 1}, 488 + 489 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_config.pin_config_type), 490 + AML_OFFSET(pin_config.pin_config_type), 491 + 1}, 492 + 493 + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.pin_config.pin_config_value), 494 + AML_OFFSET(pin_config.pin_config_value), 495 + 1}, 496 + 497 + /* Pin Table */ 498 + 499 + /* 500 + * It is OK to use GPIO operations here because none of them refer GPIO 501 + * structures directly but instead use offsets given here. 502 + */ 503 + 504 + {ACPI_RSC_COUNT_GPIO_PIN, 505 + ACPI_RS_OFFSET(data.pin_config.pin_table_length), 506 + AML_OFFSET(pin_config.pin_table_offset), 507 + AML_OFFSET(pin_config.res_source_offset)}, 508 + 509 + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.pin_config.pin_table), 510 + AML_OFFSET(pin_config.pin_table_offset), 511 + 0}, 512 + 513 + /* Resource Source */ 514 + 515 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_config.resource_source.index), 516 + AML_OFFSET(pin_config.res_source_index), 517 + 1}, 518 + 519 + {ACPI_RSC_COUNT_GPIO_RES, 520 + ACPI_RS_OFFSET(data.pin_config.resource_source.string_length), 521 + AML_OFFSET(pin_config.res_source_offset), 522 + AML_OFFSET(pin_config.vendor_offset)}, 523 + 524 + {ACPI_RSC_MOVE_GPIO_RES, 525 + ACPI_RS_OFFSET(data.pin_config.resource_source.string_ptr), 526 + AML_OFFSET(pin_config.res_source_offset), 527 + 0}, 528 + 529 + /* Vendor Data */ 530 + 531 + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET(data.pin_config.vendor_length), 532 + AML_OFFSET(pin_config.vendor_length), 533 + 1}, 534 + 535 + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.pin_config.vendor_data), 536 + AML_OFFSET(pin_config.vendor_offset), 537 + 0}, 538 + }; 539 + 540 + /******************************************************************************* 541 + * 542 + * acpi_rs_convert_pin_group 543 + * 544 + ******************************************************************************/ 545 + 546 + struct acpi_rsconvert_info acpi_rs_convert_pin_group[10] = { 547 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP, 548 + ACPI_RS_SIZE(struct acpi_resource_pin_group), 549 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_group)}, 550 + 551 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP, 552 + sizeof(struct aml_resource_pin_group), 553 + 0}, 554 + 555 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group.revision_id), 556 + AML_OFFSET(pin_group.revision_id), 557 + 1}, 558 + 559 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group.producer_consumer), 560 + AML_OFFSET(pin_group.flags), 561 + 0}, 562 + 563 + /* Pin Table */ 564 + 565 + /* 566 + * It is OK to use GPIO operations here because none of them refer GPIO 567 + * structures directly but instead use offsets given here. 568 + */ 569 + 570 + {ACPI_RSC_COUNT_GPIO_PIN, 571 + ACPI_RS_OFFSET(data.pin_group.pin_table_length), 572 + AML_OFFSET(pin_group.pin_table_offset), 573 + AML_OFFSET(pin_group.label_offset)}, 574 + 575 + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.pin_group.pin_table), 576 + AML_OFFSET(pin_group.pin_table_offset), 577 + 0}, 578 + 579 + /* Resource Label */ 580 + 581 + {ACPI_RSC_COUNT_GPIO_RES, 582 + ACPI_RS_OFFSET(data.pin_group.resource_label.string_length), 583 + AML_OFFSET(pin_group.label_offset), 584 + AML_OFFSET(pin_group.vendor_offset)}, 585 + 586 + {ACPI_RSC_MOVE_GPIO_RES, 587 + ACPI_RS_OFFSET(data.pin_group.resource_label.string_ptr), 588 + AML_OFFSET(pin_group.label_offset), 589 + 0}, 590 + 591 + /* Vendor Data */ 592 + 593 + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET(data.pin_group.vendor_length), 594 + AML_OFFSET(pin_group.vendor_length), 595 + 1}, 596 + 597 + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.pin_group.vendor_data), 598 + AML_OFFSET(pin_group.vendor_offset), 599 + 0}, 600 + }; 601 + 602 + /******************************************************************************* 603 + * 604 + * acpi_rs_convert_pin_group_function 605 + * 606 + ******************************************************************************/ 607 + 608 + struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[13] = { 609 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION, 610 + ACPI_RS_SIZE(struct acpi_resource_pin_group_function), 611 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_group_function)}, 612 + 613 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION, 614 + sizeof(struct aml_resource_pin_group_function), 615 + 0}, 616 + 617 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group_function.revision_id), 618 + AML_OFFSET(pin_group_function.revision_id), 619 + 1}, 620 + 621 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.sharable), 622 + AML_OFFSET(pin_group_function.flags), 623 + 0}, 624 + 625 + {ACPI_RSC_1BITFLAG, 626 + ACPI_RS_OFFSET(data.pin_group_function.producer_consumer), 627 + AML_OFFSET(pin_group_function.flags), 628 + 1}, 629 + 630 + {ACPI_RSC_MOVE16, 631 + ACPI_RS_OFFSET(data.pin_group_function.function_number), 632 + AML_OFFSET(pin_group_function.function_number), 633 + 1}, 634 + 635 + /* Resource Source */ 636 + 637 + {ACPI_RSC_MOVE8, 638 + ACPI_RS_OFFSET(data.pin_group_function.resource_source.index), 639 + AML_OFFSET(pin_group_function.res_source_index), 640 + 1}, 641 + 642 + {ACPI_RSC_COUNT_GPIO_RES, 643 + ACPI_RS_OFFSET(data.pin_group_function.resource_source.string_length), 644 + AML_OFFSET(pin_group_function.res_source_offset), 645 + AML_OFFSET(pin_group_function.res_source_label_offset)}, 646 + 647 + {ACPI_RSC_MOVE_GPIO_RES, 648 + ACPI_RS_OFFSET(data.pin_group_function.resource_source.string_ptr), 649 + AML_OFFSET(pin_group_function.res_source_offset), 650 + 0}, 651 + 652 + /* Resource Source Label */ 653 + 654 + {ACPI_RSC_COUNT_GPIO_RES, 655 + ACPI_RS_OFFSET(data.pin_group_function.resource_source_label. 656 + string_length), 657 + AML_OFFSET(pin_group_function.res_source_label_offset), 658 + AML_OFFSET(pin_group_function.vendor_offset)}, 659 + 660 + {ACPI_RSC_MOVE_GPIO_RES, 661 + ACPI_RS_OFFSET(data.pin_group_function.resource_source_label. 662 + string_ptr), 663 + AML_OFFSET(pin_group_function.res_source_label_offset), 664 + 0}, 665 + 666 + /* Vendor Data */ 667 + 668 + {ACPI_RSC_COUNT_GPIO_VEN, 669 + ACPI_RS_OFFSET(data.pin_group_function.vendor_length), 670 + AML_OFFSET(pin_group_function.vendor_length), 671 + 1}, 672 + 673 + {ACPI_RSC_MOVE_GPIO_RES, 674 + ACPI_RS_OFFSET(data.pin_group_function.vendor_data), 675 + AML_OFFSET(pin_group_function.vendor_offset), 676 + 0}, 677 + }; 678 + 679 + /******************************************************************************* 680 + * 681 + * acpi_rs_convert_pin_group_config 682 + * 683 + ******************************************************************************/ 684 + 685 + struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[14] = { 686 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG, 687 + ACPI_RS_SIZE(struct acpi_resource_pin_group_config), 688 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_pin_group_config)}, 689 + 690 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG, 691 + sizeof(struct aml_resource_pin_group_config), 692 + 0}, 693 + 694 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group_config.revision_id), 695 + AML_OFFSET(pin_group_config.revision_id), 696 + 1}, 697 + 698 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.sharable), 699 + AML_OFFSET(pin_group_config.flags), 700 + 0}, 701 + 702 + {ACPI_RSC_1BITFLAG, 703 + ACPI_RS_OFFSET(data.pin_group_config.producer_consumer), 704 + AML_OFFSET(pin_group_config.flags), 705 + 1}, 706 + 707 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.pin_group_config.pin_config_type), 708 + AML_OFFSET(pin_group_config.pin_config_type), 709 + 1}, 710 + 711 + {ACPI_RSC_MOVE32, 712 + ACPI_RS_OFFSET(data.pin_group_config.pin_config_value), 713 + AML_OFFSET(pin_group_config.pin_config_value), 714 + 1}, 715 + 716 + /* Resource Source */ 717 + 718 + {ACPI_RSC_MOVE8, 719 + ACPI_RS_OFFSET(data.pin_group_config.resource_source.index), 720 + AML_OFFSET(pin_group_config.res_source_index), 721 + 1}, 722 + 723 + {ACPI_RSC_COUNT_GPIO_RES, 724 + ACPI_RS_OFFSET(data.pin_group_config.resource_source.string_length), 725 + AML_OFFSET(pin_group_config.res_source_offset), 726 + AML_OFFSET(pin_group_config.res_source_label_offset)}, 727 + 728 + {ACPI_RSC_MOVE_GPIO_RES, 729 + ACPI_RS_OFFSET(data.pin_group_config.resource_source.string_ptr), 730 + AML_OFFSET(pin_group_config.res_source_offset), 731 + 0}, 732 + 733 + /* Resource Source Label */ 734 + 735 + {ACPI_RSC_COUNT_GPIO_RES, 736 + ACPI_RS_OFFSET(data.pin_group_config.resource_source_label. 737 + string_length), 738 + AML_OFFSET(pin_group_config.res_source_label_offset), 739 + AML_OFFSET(pin_group_config.vendor_offset)}, 740 + 741 + {ACPI_RSC_MOVE_GPIO_RES, 742 + ACPI_RS_OFFSET(data.pin_group_config.resource_source_label.string_ptr), 743 + AML_OFFSET(pin_group_config.res_source_label_offset), 744 + 0}, 745 + 746 + /* Vendor Data */ 747 + 748 + {ACPI_RSC_COUNT_GPIO_VEN, 749 + ACPI_RS_OFFSET(data.pin_group_config.vendor_length), 750 + AML_OFFSET(pin_group_config.vendor_length), 751 + 1}, 752 + 753 + {ACPI_RSC_MOVE_GPIO_RES, 754 + ACPI_RS_OFFSET(data.pin_group_config.vendor_data), 755 + AML_OFFSET(pin_group_config.vendor_offset), 756 + 0}, 536 757 };
+4
drivers/acpi/acpica/tbdata.c
··· 867 867 return_ACPI_STATUS(status); 868 868 } 869 869 870 + ACPI_EXPORT_SYMBOL(acpi_tb_install_and_load_table) 871 + 870 872 /******************************************************************************* 871 873 * 872 874 * FUNCTION: acpi_tb_unload_table ··· 916 914 acpi_tb_set_table_loaded_flag(table_index, FALSE); 917 915 return_ACPI_STATUS(status); 918 916 } 917 + 918 + ACPI_EXPORT_SYMBOL(acpi_tb_unload_table)
+2 -2
drivers/acpi/acpica/tbfadt.c
··· 449 449 * The 64-bit X fields are optional extensions to the original 32-bit FADT 450 450 * V1.0 fields. Even if they are present in the FADT, they are optional and 451 451 * are unused if the BIOS sets them to zero. Therefore, we must copy/expand 452 - * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is 453 - * originally zero. 452 + * 32-bit V1.0 fields to the 64-bit X fields if the 64-bit X field is originally 453 + * zero. 454 454 * 455 455 * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address 456 456 * fields are expanded to the corresponding 64-bit X fields in the internal
+3 -3
drivers/acpi/acpica/tbutils.c
··· 141 141 * 142 142 * FUNCTION: acpi_tb_copy_dsdt 143 143 * 144 - * PARAMETERS: table_desc - Installed table to copy 144 + * PARAMETERS: table_index - Index of installed table to copy 145 145 * 146 - * RETURN: None 146 + * RETURN: The copied DSDT 147 147 * 148 148 * DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory. 149 149 * Some very bad BIOSs are known to either corrupt the DSDT or ··· 239 239 * 240 240 * FUNCTION: acpi_tb_parse_root_table 241 241 * 242 - * PARAMETERS: rsdp - Pointer to the RSDP 242 + * PARAMETERS: rsdp_address - Pointer to the RSDP 243 243 * 244 244 * RETURN: Status 245 245 *
+5 -3
drivers/acpi/acpica/utdecode.c
··· 460 460 /* 09 */ "Device PLD Check", 461 461 /* 0A */ "Reserved", 462 462 /* 0B */ "System Locality Update", 463 - /* 0C */ "Shutdown Request", 464 - /* Reserved in ACPI 6.0 */ 465 - /* 0D */ "System Resource Affinity Update" 463 + /* 0C */ "Reserved (was previously Shutdown Request)", 464 + /* Reserved in ACPI 6.0 */ 465 + /* 0D */ "System Resource Affinity Update", 466 + /* 0E */ "Heterogeneous Memory Attributes Update" 467 + /* ACPI 6.2 */ 466 468 }; 467 469 468 470 static const char *acpi_gbl_device_notify[5] = {
+9 -3
drivers/acpi/acpica/utownerid.c
··· 104 104 break; 105 105 } 106 106 107 - if (!(acpi_gbl_owner_id_mask[j] & (1 << k))) { 107 + /* 108 + * Note: the u32 cast ensures that 1 is stored as a unsigned 109 + * integer. Omitting the cast may result in 1 being stored as an 110 + * int. Some compilers or runtime error detection may flag this as 111 + * an error. 112 + */ 113 + if (!(acpi_gbl_owner_id_mask[j] & ((u32)1 << k))) { 108 114 /* 109 115 * Found a free ID. The actual ID is the bit index plus one, 110 116 * making zero an invalid Owner ID. Save this as the last ID 111 117 * allocated and update the global ID mask. 112 118 */ 113 - acpi_gbl_owner_id_mask[j] |= (1 << k); 119 + acpi_gbl_owner_id_mask[j] |= ((u32)1 << k); 114 120 115 121 acpi_gbl_last_owner_id_index = (u8)j; 116 122 acpi_gbl_next_owner_id_offset = (u8)(k + 1); ··· 207 201 /* Decode ID to index/offset pair */ 208 202 209 203 index = ACPI_DIV_32(owner_id); 210 - bit = 1 << ACPI_MOD_32(owner_id); 204 + bit = (u32)1 << ACPI_MOD_32(owner_id); 211 205 212 206 /* Free the owner ID only if it is valid */ 213 207
+315
drivers/acpi/acpica/utresdecode.c
··· 1 + /******************************************************************************* 2 + * 3 + * Module Name: utresdecode - Resource descriptor keyword strings 4 + * 5 + ******************************************************************************/ 6 + 7 + /* 8 + * Copyright (C) 2000 - 2017, Intel Corp. 9 + * All rights reserved. 10 + * 11 + * Redistribution and use in source and binary forms, with or without 12 + * modification, are permitted provided that the following conditions 13 + * are met: 14 + * 1. Redistributions of source code must retain the above copyright 15 + * notice, this list of conditions, and the following disclaimer, 16 + * without modification. 17 + * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 + * substantially similar to the "NO WARRANTY" disclaimer below 19 + * ("Disclaimer") and any redistribution must be conditioned upon 20 + * including a substantially similar Disclaimer requirement for further 21 + * binary redistribution. 22 + * 3. Neither the names of the above-listed copyright holders nor the names 23 + * of any contributors may be used to endorse or promote products derived 24 + * from this software without specific prior written permission. 25 + * 26 + * Alternatively, this software may be distributed under the terms of the 27 + * GNU General Public License ("GPL") version 2 as published by the Free 28 + * Software Foundation. 29 + * 30 + * NO WARRANTY 31 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 + * POSSIBILITY OF SUCH DAMAGES. 42 + */ 43 + 44 + #include <acpi/acpi.h> 45 + #include "accommon.h" 46 + #include "acresrc.h" 47 + 48 + #define _COMPONENT ACPI_UTILITIES 49 + ACPI_MODULE_NAME("utresdecode") 50 + 51 + #if defined (ACPI_DEBUG_OUTPUT) || \ 52 + defined (ACPI_DISASSEMBLER) || \ 53 + defined (ACPI_DEBUGGER) 54 + /* 55 + * Strings used to decode resource descriptors. 56 + * Used by both the disassembler and the debugger resource dump routines 57 + */ 58 + const char *acpi_gbl_bm_decode[] = { 59 + "NotBusMaster", 60 + "BusMaster" 61 + }; 62 + 63 + const char *acpi_gbl_config_decode[] = { 64 + "0 - Good Configuration", 65 + "1 - Acceptable Configuration", 66 + "2 - Suboptimal Configuration", 67 + "3 - ***Invalid Configuration***", 68 + }; 69 + 70 + const char *acpi_gbl_consume_decode[] = { 71 + "ResourceProducer", 72 + "ResourceConsumer" 73 + }; 74 + 75 + const char *acpi_gbl_dec_decode[] = { 76 + "PosDecode", 77 + "SubDecode" 78 + }; 79 + 80 + const char *acpi_gbl_he_decode[] = { 81 + "Level", 82 + "Edge" 83 + }; 84 + 85 + const char *acpi_gbl_io_decode[] = { 86 + "Decode10", 87 + "Decode16" 88 + }; 89 + 90 + const char *acpi_gbl_ll_decode[] = { 91 + "ActiveHigh", 92 + "ActiveLow", 93 + "ActiveBoth", 94 + "Reserved" 95 + }; 96 + 97 + const char *acpi_gbl_max_decode[] = { 98 + "MaxNotFixed", 99 + "MaxFixed" 100 + }; 101 + 102 + const char *acpi_gbl_mem_decode[] = { 103 + "NonCacheable", 104 + "Cacheable", 105 + "WriteCombining", 106 + "Prefetchable" 107 + }; 108 + 109 + const char *acpi_gbl_min_decode[] = { 110 + "MinNotFixed", 111 + "MinFixed" 112 + }; 113 + 114 + const char *acpi_gbl_mtp_decode[] = { 115 + "AddressRangeMemory", 116 + "AddressRangeReserved", 117 + "AddressRangeACPI", 118 + "AddressRangeNVS" 119 + }; 120 + 121 + const char *acpi_gbl_rng_decode[] = { 122 + "InvalidRanges", 123 + "NonISAOnlyRanges", 124 + "ISAOnlyRanges", 125 + "EntireRange" 126 + }; 127 + 128 + const char *acpi_gbl_rw_decode[] = { 129 + "ReadOnly", 130 + "ReadWrite" 131 + }; 132 + 133 + const char *acpi_gbl_shr_decode[] = { 134 + "Exclusive", 135 + "Shared", 136 + "ExclusiveAndWake", /* ACPI 5.0 */ 137 + "SharedAndWake" /* ACPI 5.0 */ 138 + }; 139 + 140 + const char *acpi_gbl_siz_decode[] = { 141 + "Transfer8", 142 + "Transfer8_16", 143 + "Transfer16", 144 + "InvalidSize" 145 + }; 146 + 147 + const char *acpi_gbl_trs_decode[] = { 148 + "DenseTranslation", 149 + "SparseTranslation" 150 + }; 151 + 152 + const char *acpi_gbl_ttp_decode[] = { 153 + "TypeStatic", 154 + "TypeTranslation" 155 + }; 156 + 157 + const char *acpi_gbl_typ_decode[] = { 158 + "Compatibility", 159 + "TypeA", 160 + "TypeB", 161 + "TypeF" 162 + }; 163 + 164 + const char *acpi_gbl_ppc_decode[] = { 165 + "PullDefault", 166 + "PullUp", 167 + "PullDown", 168 + "PullNone" 169 + }; 170 + 171 + const char *acpi_gbl_ior_decode[] = { 172 + "IoRestrictionNone", 173 + "IoRestrictionInputOnly", 174 + "IoRestrictionOutputOnly", 175 + "IoRestrictionNoneAndPreserve" 176 + }; 177 + 178 + const char *acpi_gbl_dts_decode[] = { 179 + "Width8bit", 180 + "Width16bit", 181 + "Width32bit", 182 + "Width64bit", 183 + "Width128bit", 184 + "Width256bit", 185 + }; 186 + 187 + /* GPIO connection type */ 188 + 189 + const char *acpi_gbl_ct_decode[] = { 190 + "Interrupt", 191 + "I/O" 192 + }; 193 + 194 + /* Serial bus type */ 195 + 196 + const char *acpi_gbl_sbt_decode[] = { 197 + "/* UNKNOWN serial bus type */", 198 + "I2C", 199 + "SPI", 200 + "UART" 201 + }; 202 + 203 + /* I2C serial bus access mode */ 204 + 205 + const char *acpi_gbl_am_decode[] = { 206 + "AddressingMode7Bit", 207 + "AddressingMode10Bit" 208 + }; 209 + 210 + /* I2C serial bus slave mode */ 211 + 212 + const char *acpi_gbl_sm_decode[] = { 213 + "ControllerInitiated", 214 + "DeviceInitiated" 215 + }; 216 + 217 + /* SPI serial bus wire mode */ 218 + 219 + const char *acpi_gbl_wm_decode[] = { 220 + "FourWireMode", 221 + "ThreeWireMode" 222 + }; 223 + 224 + /* SPI serial clock phase */ 225 + 226 + const char *acpi_gbl_cph_decode[] = { 227 + "ClockPhaseFirst", 228 + "ClockPhaseSecond" 229 + }; 230 + 231 + /* SPI serial bus clock polarity */ 232 + 233 + const char *acpi_gbl_cpo_decode[] = { 234 + "ClockPolarityLow", 235 + "ClockPolarityHigh" 236 + }; 237 + 238 + /* SPI serial bus device polarity */ 239 + 240 + const char *acpi_gbl_dp_decode[] = { 241 + "PolarityLow", 242 + "PolarityHigh" 243 + }; 244 + 245 + /* UART serial bus endian */ 246 + 247 + const char *acpi_gbl_ed_decode[] = { 248 + "LittleEndian", 249 + "BigEndian" 250 + }; 251 + 252 + /* UART serial bus bits per byte */ 253 + 254 + const char *acpi_gbl_bpb_decode[] = { 255 + "DataBitsFive", 256 + "DataBitsSix", 257 + "DataBitsSeven", 258 + "DataBitsEight", 259 + "DataBitsNine", 260 + "/* UNKNOWN Bits per byte */", 261 + "/* UNKNOWN Bits per byte */", 262 + "/* UNKNOWN Bits per byte */" 263 + }; 264 + 265 + /* UART serial bus stop bits */ 266 + 267 + const char *acpi_gbl_sb_decode[] = { 268 + "StopBitsZero", 269 + "StopBitsOne", 270 + "StopBitsOnePlusHalf", 271 + "StopBitsTwo" 272 + }; 273 + 274 + /* UART serial bus flow control */ 275 + 276 + const char *acpi_gbl_fc_decode[] = { 277 + "FlowControlNone", 278 + "FlowControlHardware", 279 + "FlowControlXON", 280 + "/* UNKNOWN flow control keyword */" 281 + }; 282 + 283 + /* UART serial bus parity type */ 284 + 285 + const char *acpi_gbl_pt_decode[] = { 286 + "ParityTypeNone", 287 + "ParityTypeEven", 288 + "ParityTypeOdd", 289 + "ParityTypeMark", 290 + "ParityTypeSpace", 291 + "/* UNKNOWN parity keyword */", 292 + "/* UNKNOWN parity keyword */", 293 + "/* UNKNOWN parity keyword */" 294 + }; 295 + 296 + /* pin_config type */ 297 + 298 + const char *acpi_gbl_ptyp_decode[] = { 299 + "Default", 300 + "Bias Pull-up", 301 + "Bias Pull-down", 302 + "Bias Default", 303 + "Bias Disable", 304 + "Bias High Impedance", 305 + "Bias Bus Hold", 306 + "Drive Open Drain", 307 + "Drive Open Source", 308 + "Drive Push Pull", 309 + "Drive Strength", 310 + "Slew Rate", 311 + "Input Debounce", 312 + "Input Schmitt Trigger", 313 + }; 314 + 315 + #endif
+11 -248
drivers/acpi/acpica/utresrc.c
··· 48 48 #define _COMPONENT ACPI_UTILITIES 49 49 ACPI_MODULE_NAME("utresrc") 50 50 51 - #if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) 52 - /* 53 - * Strings used to decode resource descriptors. 54 - * Used by both the disassembler and the debugger resource dump routines 55 - */ 56 - const char *acpi_gbl_bm_decode[] = { 57 - "NotBusMaster", 58 - "BusMaster" 59 - }; 60 - 61 - const char *acpi_gbl_config_decode[] = { 62 - "0 - Good Configuration", 63 - "1 - Acceptable Configuration", 64 - "2 - Suboptimal Configuration", 65 - "3 - ***Invalid Configuration***", 66 - }; 67 - 68 - const char *acpi_gbl_consume_decode[] = { 69 - "ResourceProducer", 70 - "ResourceConsumer" 71 - }; 72 - 73 - const char *acpi_gbl_dec_decode[] = { 74 - "PosDecode", 75 - "SubDecode" 76 - }; 77 - 78 - const char *acpi_gbl_he_decode[] = { 79 - "Level", 80 - "Edge" 81 - }; 82 - 83 - const char *acpi_gbl_io_decode[] = { 84 - "Decode10", 85 - "Decode16" 86 - }; 87 - 88 - const char *acpi_gbl_ll_decode[] = { 89 - "ActiveHigh", 90 - "ActiveLow", 91 - "ActiveBoth", 92 - "Reserved" 93 - }; 94 - 95 - const char *acpi_gbl_max_decode[] = { 96 - "MaxNotFixed", 97 - "MaxFixed" 98 - }; 99 - 100 - const char *acpi_gbl_mem_decode[] = { 101 - "NonCacheable", 102 - "Cacheable", 103 - "WriteCombining", 104 - "Prefetchable" 105 - }; 106 - 107 - const char *acpi_gbl_min_decode[] = { 108 - "MinNotFixed", 109 - "MinFixed" 110 - }; 111 - 112 - const char *acpi_gbl_mtp_decode[] = { 113 - "AddressRangeMemory", 114 - "AddressRangeReserved", 115 - "AddressRangeACPI", 116 - "AddressRangeNVS" 117 - }; 118 - 119 - const char *acpi_gbl_rng_decode[] = { 120 - "InvalidRanges", 121 - "NonISAOnlyRanges", 122 - "ISAOnlyRanges", 123 - "EntireRange" 124 - }; 125 - 126 - const char *acpi_gbl_rw_decode[] = { 127 - "ReadOnly", 128 - "ReadWrite" 129 - }; 130 - 131 - const char *acpi_gbl_shr_decode[] = { 132 - "Exclusive", 133 - "Shared", 134 - "ExclusiveAndWake", /* ACPI 5.0 */ 135 - "SharedAndWake" /* ACPI 5.0 */ 136 - }; 137 - 138 - const char *acpi_gbl_siz_decode[] = { 139 - "Transfer8", 140 - "Transfer8_16", 141 - "Transfer16", 142 - "InvalidSize" 143 - }; 144 - 145 - const char *acpi_gbl_trs_decode[] = { 146 - "DenseTranslation", 147 - "SparseTranslation" 148 - }; 149 - 150 - const char *acpi_gbl_ttp_decode[] = { 151 - "TypeStatic", 152 - "TypeTranslation" 153 - }; 154 - 155 - const char *acpi_gbl_typ_decode[] = { 156 - "Compatibility", 157 - "TypeA", 158 - "TypeB", 159 - "TypeF" 160 - }; 161 - 162 - const char *acpi_gbl_ppc_decode[] = { 163 - "PullDefault", 164 - "PullUp", 165 - "PullDown", 166 - "PullNone" 167 - }; 168 - 169 - const char *acpi_gbl_ior_decode[] = { 170 - "IoRestrictionNone", 171 - "IoRestrictionInputOnly", 172 - "IoRestrictionOutputOnly", 173 - "IoRestrictionNoneAndPreserve" 174 - }; 175 - 176 - const char *acpi_gbl_dts_decode[] = { 177 - "Width8bit", 178 - "Width16bit", 179 - "Width32bit", 180 - "Width64bit", 181 - "Width128bit", 182 - "Width256bit", 183 - }; 184 - 185 - /* GPIO connection type */ 186 - 187 - const char *acpi_gbl_ct_decode[] = { 188 - "Interrupt", 189 - "I/O" 190 - }; 191 - 192 - /* Serial bus type */ 193 - 194 - const char *acpi_gbl_sbt_decode[] = { 195 - "/* UNKNOWN serial bus type */", 196 - "I2C", 197 - "SPI", 198 - "UART" 199 - }; 200 - 201 - /* I2C serial bus access mode */ 202 - 203 - const char *acpi_gbl_am_decode[] = { 204 - "AddressingMode7Bit", 205 - "AddressingMode10Bit" 206 - }; 207 - 208 - /* I2C serial bus slave mode */ 209 - 210 - const char *acpi_gbl_sm_decode[] = { 211 - "ControllerInitiated", 212 - "DeviceInitiated" 213 - }; 214 - 215 - /* SPI serial bus wire mode */ 216 - 217 - const char *acpi_gbl_wm_decode[] = { 218 - "FourWireMode", 219 - "ThreeWireMode" 220 - }; 221 - 222 - /* SPI serial clock phase */ 223 - 224 - const char *acpi_gbl_cph_decode[] = { 225 - "ClockPhaseFirst", 226 - "ClockPhaseSecond" 227 - }; 228 - 229 - /* SPI serial bus clock polarity */ 230 - 231 - const char *acpi_gbl_cpo_decode[] = { 232 - "ClockPolarityLow", 233 - "ClockPolarityHigh" 234 - }; 235 - 236 - /* SPI serial bus device polarity */ 237 - 238 - const char *acpi_gbl_dp_decode[] = { 239 - "PolarityLow", 240 - "PolarityHigh" 241 - }; 242 - 243 - /* UART serial bus endian */ 244 - 245 - const char *acpi_gbl_ed_decode[] = { 246 - "LittleEndian", 247 - "BigEndian" 248 - }; 249 - 250 - /* UART serial bus bits per byte */ 251 - 252 - const char *acpi_gbl_bpb_decode[] = { 253 - "DataBitsFive", 254 - "DataBitsSix", 255 - "DataBitsSeven", 256 - "DataBitsEight", 257 - "DataBitsNine", 258 - "/* UNKNOWN Bits per byte */", 259 - "/* UNKNOWN Bits per byte */", 260 - "/* UNKNOWN Bits per byte */" 261 - }; 262 - 263 - /* UART serial bus stop bits */ 264 - 265 - const char *acpi_gbl_sb_decode[] = { 266 - "StopBitsZero", 267 - "StopBitsOne", 268 - "StopBitsOnePlusHalf", 269 - "StopBitsTwo" 270 - }; 271 - 272 - /* UART serial bus flow control */ 273 - 274 - const char *acpi_gbl_fc_decode[] = { 275 - "FlowControlNone", 276 - "FlowControlHardware", 277 - "FlowControlXON", 278 - "/* UNKNOWN flow control keyword */" 279 - }; 280 - 281 - /* UART serial bus parity type */ 282 - 283 - const char *acpi_gbl_pt_decode[] = { 284 - "ParityTypeNone", 285 - "ParityTypeEven", 286 - "ParityTypeOdd", 287 - "ParityTypeMark", 288 - "ParityTypeSpace", 289 - "/* UNKNOWN parity keyword */", 290 - "/* UNKNOWN parity keyword */", 291 - "/* UNKNOWN parity keyword */" 292 - }; 293 - 294 - #endif 295 - 296 51 /* 297 52 * Base sizes of the raw AML resource descriptors, indexed by resource type. 298 53 * Zero indicates a reserved (and therefore invalid) resource type. ··· 87 332 ACPI_AML_SIZE_LARGE(struct aml_resource_address64), 88 333 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_address64), 89 334 ACPI_AML_SIZE_LARGE(struct aml_resource_gpio), 90 - 0, 335 + ACPI_AML_SIZE_LARGE(struct aml_resource_pin_function), 91 336 ACPI_AML_SIZE_LARGE(struct aml_resource_common_serialbus), 337 + ACPI_AML_SIZE_LARGE(struct aml_resource_pin_config), 338 + ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group), 339 + ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group_function), 340 + ACPI_AML_SIZE_LARGE(struct aml_resource_pin_group_config), 92 341 }; 93 342 94 343 const u8 acpi_gbl_resource_aml_serial_bus_sizes[] = { ··· 143 384 ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ 144 385 ACPI_FIXED_LENGTH, /* 0B Extended* address */ 145 386 ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ 146 - 0, 147 - ACPI_VARIABLE_LENGTH /* 0E *serial_bus */ 387 + ACPI_VARIABLE_LENGTH, /* 0D pin_function */ 388 + ACPI_VARIABLE_LENGTH, /* 0E *serial_bus */ 389 + ACPI_VARIABLE_LENGTH, /* 0F pin_config */ 390 + ACPI_VARIABLE_LENGTH, /* 10 pin_group */ 391 + ACPI_VARIABLE_LENGTH, /* 11 pin_group_function */ 392 + ACPI_VARIABLE_LENGTH, /* 12 pin_group_config */ 148 393 }; 149 394 150 395 /*******************************************************************************
+4 -1
drivers/acpi/acpica/utxfmutex.c
··· 151 151 return (status); 152 152 } 153 153 154 + ACPI_EXPORT_SYMBOL(acpi_acquire_mutex) 155 + 154 156 /******************************************************************************* 155 157 * 156 158 * FUNCTION: acpi_release_mutex ··· 169 167 * not both. 170 168 * 171 169 ******************************************************************************/ 172 - 173 170 acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname) 174 171 { 175 172 acpi_status status; ··· 186 185 acpi_os_release_mutex(mutex_obj->mutex.os_mutex); 187 186 return (AE_OK); 188 187 } 188 + 189 + ACPI_EXPORT_SYMBOL(acpi_release_mutex)
+1 -1
drivers/acpi/button.c
··· 19 19 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 20 20 */ 21 21 22 - #define pr_fmt(fmt) "ACPI : button: " fmt 22 + #define pr_fmt(fmt) "ACPI: button: " fmt 23 23 24 24 #include <linux/kernel.h> 25 25 #include <linux/module.h>
+71 -13
drivers/acpi/ec.c
··· 27 27 28 28 /* Uncomment next line to get verbose printout */ 29 29 /* #define DEBUG */ 30 - #define pr_fmt(fmt) "ACPI : EC: " fmt 30 + #define pr_fmt(fmt) "ACPI: EC: " fmt 31 31 32 32 #include <linux/kernel.h> 33 33 #include <linux/module.h> ··· 190 190 191 191 static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */ 192 192 static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */ 193 + static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */ 193 194 194 195 /* -------------------------------------------------------------------------- 195 196 * Logging/Debugging ··· 317 316 ec->timestamp = jiffies; 318 317 } 319 318 320 - #ifdef DEBUG 319 + #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG) 321 320 static const char *acpi_ec_cmd_string(u8 cmd) 322 321 { 323 322 switch (cmd) { ··· 460 459 461 460 static void acpi_ec_submit_query(struct acpi_ec *ec) 462 461 { 463 - if (acpi_ec_event_enabled(ec) && 464 - !test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { 462 + acpi_ec_set_storm(ec, EC_FLAGS_COMMAND_STORM); 463 + if (!acpi_ec_event_enabled(ec)) 464 + return; 465 + if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { 465 466 ec_dbg_evt("Command(%s) submitted/blocked", 466 467 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); 467 468 ec->nr_pending_queries++; ··· 473 470 474 471 static void acpi_ec_complete_query(struct acpi_ec *ec) 475 472 { 476 - if (test_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { 477 - clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); 473 + if (test_and_clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) 478 474 ec_dbg_evt("Command(%s) unblocked", 479 475 acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); 480 - } 476 + acpi_ec_clear_storm(ec, EC_FLAGS_COMMAND_STORM); 481 477 } 482 478 483 479 static inline void __acpi_ec_enable_event(struct acpi_ec *ec) ··· 1364 1362 ec_parse_io_ports, ec); 1365 1363 if (ACPI_FAILURE(status)) 1366 1364 return status; 1365 + if (ec->data_addr == 0 || ec->command_addr == 0) 1366 + return AE_OK; 1367 1367 1368 - /* Get GPE bit assignment (EC events). */ 1369 - /* TODO: Add support for _GPE returning a package */ 1370 - status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp); 1371 - if (ACPI_FAILURE(status)) 1372 - return status; 1373 - ec->gpe = tmp; 1368 + if (boot_ec && boot_ec_is_ecdt && EC_FLAGS_IGNORE_DSDT_GPE) { 1369 + /* 1370 + * Always inherit the GPE number setting from the ECDT 1371 + * EC. 1372 + */ 1373 + ec->gpe = boot_ec->gpe; 1374 + } else { 1375 + /* Get GPE bit assignment (EC events). */ 1376 + /* TODO: Add support for _GPE returning a package */ 1377 + status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp); 1378 + if (ACPI_FAILURE(status)) 1379 + return status; 1380 + ec->gpe = tmp; 1381 + } 1374 1382 /* Use the global lock for all EC transactions? */ 1375 1383 tmp = 0; 1376 1384 acpi_evaluate_integer(handle, "_GLK", NULL, &tmp); ··· 1677 1665 {"", 0}, 1678 1666 }; 1679 1667 1668 + /* 1669 + * This function is not Windows-compatible as Windows never enumerates the 1670 + * namespace EC before the main ACPI device enumeration process. It is 1671 + * retained for historical reason and will be deprecated in the future. 1672 + */ 1680 1673 int __init acpi_ec_dsdt_probe(void) 1681 1674 { 1682 1675 acpi_status status; 1683 1676 struct acpi_ec *ec; 1684 1677 int ret; 1678 + 1679 + /* 1680 + * If a platform has ECDT, there is no need to proceed as the 1681 + * following probe is not a part of the ACPI device enumeration, 1682 + * executing _STA is not safe, and thus this probe may risk of 1683 + * picking up an invalid EC device. 1684 + */ 1685 + if (boot_ec) 1686 + return -ENODEV; 1685 1687 1686 1688 ec = acpi_ec_alloc(); 1687 1689 if (!ec) ··· 1779 1753 return 0; 1780 1754 } 1781 1755 1756 + /* 1757 + * Some DSDTs contain wrong GPE setting. 1758 + * Asus FX502VD/VE, GL702VMK, X550VXK, X580VD 1759 + * https://bugzilla.kernel.org/show_bug.cgi?id=195651 1760 + */ 1761 + static int ec_honor_ecdt_gpe(const struct dmi_system_id *id) 1762 + { 1763 + pr_debug("Detected system needing ignore DSDT GPE setting.\n"); 1764 + EC_FLAGS_IGNORE_DSDT_GPE = 1; 1765 + return 0; 1766 + } 1767 + 1782 1768 static struct dmi_system_id ec_dmi_table[] __initdata = { 1783 1769 { 1784 1770 ec_correct_ecdt, "MSI MS-171F", { 1785 1771 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star"), 1786 1772 DMI_MATCH(DMI_PRODUCT_NAME, "MS-171F"),}, NULL}, 1773 + { 1774 + ec_honor_ecdt_gpe, "ASUS FX502VD", { 1775 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1776 + DMI_MATCH(DMI_PRODUCT_NAME, "FX502VD"),}, NULL}, 1777 + { 1778 + ec_honor_ecdt_gpe, "ASUS FX502VE", { 1779 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1780 + DMI_MATCH(DMI_PRODUCT_NAME, "FX502VE"),}, NULL}, 1781 + { 1782 + ec_honor_ecdt_gpe, "ASUS GL702VMK", { 1783 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1784 + DMI_MATCH(DMI_PRODUCT_NAME, "GL702VMK"),}, NULL}, 1785 + { 1786 + ec_honor_ecdt_gpe, "ASUS X550VXK", { 1787 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1788 + DMI_MATCH(DMI_PRODUCT_NAME, "X550VXK"),}, NULL}, 1789 + { 1790 + ec_honor_ecdt_gpe, "ASUS X580VD", { 1791 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1792 + DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL}, 1787 1793 {}, 1788 1794 }; 1789 1795
+1 -1
drivers/acpi/ioapic.c
··· 21 21 * registered when we parsed the ACPI MADT. 22 22 */ 23 23 24 - #define pr_fmt(fmt) "ACPI : IOAPIC: " fmt 24 + #define pr_fmt(fmt) "ACPI: IOAPIC: " fmt 25 25 26 26 #include <linux/slab.h> 27 27 #include <linux/acpi.h>
+20 -1
drivers/acpi/pmic/intel_pmic_xpower.c
··· 21 21 #include "intel_pmic.h" 22 22 23 23 #define XPOWER_GPADC_LOW 0x5b 24 + #define XPOWER_GPI1_CTRL 0x92 25 + 26 + #define GPI1_LDO_MASK GENMASK(2, 0) 27 + #define GPI1_LDO_ON (3 << 0) 28 + #define GPI1_LDO_OFF (4 << 0) 24 29 25 30 static struct pmic_table power_table[] = { 26 31 { ··· 123 118 .reg = 0x10, 124 119 .bit = 0x00 125 120 }, /* BUC6 */ 121 + { 122 + .address = 0x4c, 123 + .reg = 0x92, 124 + }, /* GPI1 */ 126 125 }; 127 126 128 127 /* TMP0 - TMP5 are the same, all from GPADC */ ··· 165 156 if (regmap_read(regmap, reg, &data)) 166 157 return -EIO; 167 158 168 - *value = (data & BIT(bit)) ? 1 : 0; 159 + /* GPIO1 LDO regulator needs special handling */ 160 + if (reg == XPOWER_GPI1_CTRL) 161 + *value = ((data & GPI1_LDO_MASK) == GPI1_LDO_ON); 162 + else 163 + *value = (data & BIT(bit)) ? 1 : 0; 164 + 169 165 return 0; 170 166 } 171 167 ··· 178 164 int bit, bool on) 179 165 { 180 166 int data; 167 + 168 + /* GPIO1 LDO regulator needs special handling */ 169 + if (reg == XPOWER_GPI1_CTRL) 170 + return regmap_update_bits(regmap, reg, GPI1_LDO_MASK, 171 + on ? GPI1_LDO_ON : GPI1_LDO_OFF); 181 172 182 173 if (regmap_read(regmap, reg, &data)) 183 174 return -EIO;
+8
drivers/acpi/video_detect.c
··· 305 305 DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"), 306 306 }, 307 307 }, 308 + { 309 + .callback = video_detect_force_native, 310 + .ident = "Dell Precision 7510", 311 + .matches = { 312 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 313 + DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"), 314 + }, 315 + }, 308 316 { }, 309 317 }; 310 318
+2 -2
drivers/char/tpm/tpm_crb.c
··· 563 563 sm == ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD) 564 564 priv->flags |= CRB_FL_ACPI_START; 565 565 566 - if (sm == ACPI_TPM2_COMMAND_BUFFER_WITH_SMC) { 566 + if (sm == ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC) { 567 567 if (buf->header.length < (sizeof(*buf) + sizeof(*crb_smc))) { 568 568 dev_err(dev, 569 569 FW_BUG "TPM2 ACPI table has wrong size %u for start method type %d\n", 570 570 buf->header.length, 571 - ACPI_TPM2_COMMAND_BUFFER_WITH_SMC); 571 + ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC); 572 572 return -EINVAL; 573 573 } 574 574 crb_smc = ACPI_ADD_PTR(struct tpm2_crb_smc, buf, sizeof(*buf));
+5 -5
drivers/mailbox/pcc.c
··· 203 203 struct acpi_pcct_hw_reduced_type2 *pcct2_ss = chan->con_priv; 204 204 u32 id = chan - pcc_mbox_channels; 205 205 206 - doorbell_ack = &pcct2_ss->doorbell_ack_register; 206 + doorbell_ack = &pcct2_ss->platform_ack_register; 207 207 doorbell_ack_preserve = pcct2_ss->ack_preserve_mask; 208 208 doorbell_ack_write = pcct2_ss->ack_write_mask; 209 209 ··· 416 416 static int pcc_parse_subspace_irq(int id, 417 417 struct acpi_pcct_hw_reduced *pcct_ss) 418 418 { 419 - pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->doorbell_interrupt, 419 + pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->platform_interrupt, 420 420 (u32)pcct_ss->flags); 421 421 if (pcc_doorbell_irq[id] <= 0) { 422 422 pr_err("PCC GSI %d not registered\n", 423 - pcct_ss->doorbell_interrupt); 423 + pcct_ss->platform_interrupt); 424 424 return -EINVAL; 425 425 } 426 426 ··· 429 429 struct acpi_pcct_hw_reduced_type2 *pcct2_ss = (void *)pcct_ss; 430 430 431 431 pcc_doorbell_ack_vaddr[id] = acpi_os_ioremap( 432 - pcct2_ss->doorbell_ack_register.address, 433 - pcct2_ss->doorbell_ack_register.bit_width / 8); 432 + pcct2_ss->platform_ack_register.address, 433 + pcct2_ss->platform_ack_register.bit_width / 8); 434 434 if (!pcc_doorbell_ack_vaddr[id]) { 435 435 pr_err("Failed to ioremap PCC ACK register\n"); 436 436 return -ENOMEM;
+1 -1
include/acpi/acpixf.h
··· 46 46 47 47 /* Current ACPICA subsystem version in YYYYMMDD format */ 48 48 49 - #define ACPI_CA_VERSION 0x20170303 49 + #define ACPI_CA_VERSION 0x20170531 50 50 51 51 #include <acpi/acconfig.h> 52 52 #include <acpi/actypes.h>
+91 -1
include/acpi/acrestyp.h
··· 289 289 u8 type_specific; 290 290 }; 291 291 292 + struct acpi_resource_label { 293 + u16 string_length; 294 + char *string_ptr; 295 + }; 296 + 292 297 struct acpi_resource_source { 293 298 u8 index; 294 299 u16 string_length; ··· 539 534 #define ACPI_UART_CLEAR_TO_SEND (1<<6) 540 535 #define ACPI_UART_REQUEST_TO_SEND (1<<7) 541 536 537 + struct acpi_resource_pin_function { 538 + u8 revision_id; 539 + u8 pin_config; 540 + u8 sharable; /* For values, see Interrupt Attributes above */ 541 + u16 function_number; 542 + u16 pin_table_length; 543 + u16 vendor_length; 544 + struct acpi_resource_source resource_source; 545 + u16 *pin_table; 546 + u8 *vendor_data; 547 + }; 548 + 549 + struct acpi_resource_pin_config { 550 + u8 revision_id; 551 + u8 producer_consumer; /* For values, see Producer/Consumer above */ 552 + u8 sharable; /* For values, see Interrupt Attributes above */ 553 + u8 pin_config_type; 554 + u32 pin_config_value; 555 + u16 pin_table_length; 556 + u16 vendor_length; 557 + struct acpi_resource_source resource_source; 558 + u16 *pin_table; 559 + u8 *vendor_data; 560 + }; 561 + 562 + /* Values for pin_config_type field above */ 563 + 564 + #define ACPI_PIN_CONFIG_DEFAULT 0 565 + #define ACPI_PIN_CONFIG_BIAS_PULL_UP 1 566 + #define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2 567 + #define ACPI_PIN_CONFIG_BIAS_DEFAULT 3 568 + #define ACPI_PIN_CONFIG_BIAS_DISABLE 4 569 + #define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5 570 + #define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6 571 + #define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7 572 + #define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8 573 + #define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9 574 + #define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10 575 + #define ACPI_PIN_CONFIG_SLEW_RATE 11 576 + #define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12 577 + #define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13 578 + 579 + struct acpi_resource_pin_group { 580 + u8 revision_id; 581 + u8 producer_consumer; /* For values, see Producer/Consumer above */ 582 + u16 pin_table_length; 583 + u16 vendor_length; 584 + u16 *pin_table; 585 + struct acpi_resource_label resource_label; 586 + u8 *vendor_data; 587 + }; 588 + 589 + struct acpi_resource_pin_group_function { 590 + u8 revision_id; 591 + u8 producer_consumer; /* For values, see Producer/Consumer above */ 592 + u8 sharable; /* For values, see Interrupt Attributes above */ 593 + u16 function_number; 594 + u16 vendor_length; 595 + struct acpi_resource_source resource_source; 596 + struct acpi_resource_label resource_source_label; 597 + u8 *vendor_data; 598 + }; 599 + 600 + struct acpi_resource_pin_group_config { 601 + u8 revision_id; 602 + u8 producer_consumer; /* For values, see Producer/Consumer above */ 603 + u8 sharable; /* For values, see Interrupt Attributes above */ 604 + u8 pin_config_type; /* For values, see pin_config_type above */ 605 + u32 pin_config_value; 606 + u16 vendor_length; 607 + struct acpi_resource_source resource_source; 608 + struct acpi_resource_label resource_source_label; 609 + u8 *vendor_data; 610 + }; 611 + 542 612 /* ACPI_RESOURCE_TYPEs */ 543 613 544 614 #define ACPI_RESOURCE_TYPE_IRQ 0 ··· 636 556 #define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */ 637 557 #define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */ 638 558 #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */ 639 - #define ACPI_RESOURCE_TYPE_MAX 19 559 + #define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */ 560 + #define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */ 561 + #define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */ 562 + #define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */ 563 + #define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */ 564 + #define ACPI_RESOURCE_TYPE_MAX 24 640 565 641 566 /* Master union for resource descriptors */ 642 567 ··· 669 584 struct acpi_resource_spi_serialbus spi_serial_bus; 670 585 struct acpi_resource_uart_serialbus uart_serial_bus; 671 586 struct acpi_resource_common_serialbus common_serial_bus; 587 + struct acpi_resource_pin_function pin_function; 588 + struct acpi_resource_pin_config pin_config; 589 + struct acpi_resource_pin_group pin_group; 590 + struct acpi_resource_pin_group_function pin_group_function; 591 + struct acpi_resource_pin_group_config pin_group_config; 672 592 673 593 /* Common fields */ 674 594
+231 -7
include/acpi/actbl1.h
··· 65 65 #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ 66 66 #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ 67 67 #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ 68 + #define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */ 68 69 #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ 69 70 #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 70 71 #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ 72 + #define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */ 71 73 #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ 72 74 #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ 73 75 #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ ··· 432 430 ACPI_HEST_TYPE_AER_BRIDGE = 8, 433 431 ACPI_HEST_TYPE_GENERIC_ERROR = 9, 434 432 ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10, 435 - ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */ 433 + ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11, 434 + ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */ 436 435 }; 437 436 438 437 /* ··· 479 476 480 477 #define ACPI_HEST_FIRMWARE_FIRST (1) 481 478 #define ACPI_HEST_GLOBAL (1<<1) 479 + #define ACPI_HEST_GHES_ASSIST (1<<2) 482 480 483 481 /* 484 482 * Macros to access the bus/segment numbers in Bus field above: ··· 517 513 ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */ 518 514 ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */ 519 515 ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */ 520 - ACPI_HEST_NOTIFY_RESERVED = 11 /* 11 and greater are reserved */ 516 + ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */ 517 + ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */ 521 518 }; 522 519 523 520 /* Values for config_write_enable bitfield above */ ··· 539 534 struct acpi_hest_ia_machine_check { 540 535 struct acpi_hest_header header; 541 536 u16 reserved1; 542 - u8 flags; 537 + u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ 543 538 u8 enabled; 544 539 u32 records_to_preallocate; 545 540 u32 max_sections_per_record; ··· 554 549 struct acpi_hest_ia_corrected { 555 550 struct acpi_hest_header header; 556 551 u16 reserved1; 557 - u8 flags; 552 + u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ 558 553 u8 enabled; 559 554 u32 records_to_preallocate; 560 555 u32 max_sections_per_record; ··· 691 686 #define ACPI_HEST_GEN_VALID_FRU_STRING (1<<1) 692 687 #define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2) 693 688 689 + /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */ 690 + 691 + struct acpi_hest_ia_deferred_check { 692 + struct acpi_hest_header header; 693 + u16 reserved1; 694 + u8 flags; /* See flags ACPI_HEST_GLOBAL, etc. above */ 695 + u8 enabled; 696 + u32 records_to_preallocate; 697 + u32 max_sections_per_record; 698 + struct acpi_hest_notify notify; 699 + u8 num_hardware_banks; 700 + u8 reserved2[3]; 701 + }; 702 + 703 + /******************************************************************************* 704 + * 705 + * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2) 706 + * Version 1 707 + * 708 + ******************************************************************************/ 709 + 710 + struct acpi_table_hmat { 711 + struct acpi_table_header header; /* Common ACPI table header */ 712 + u32 reserved; 713 + }; 714 + 715 + /* Values for HMAT structure types */ 716 + 717 + enum acpi_hmat_type { 718 + ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */ 719 + ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */ 720 + ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */ 721 + ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ 722 + }; 723 + 724 + struct acpi_hmat_structure { 725 + u16 type; 726 + u16 reserved; 727 + u32 length; 728 + }; 729 + 730 + /* 731 + * HMAT Structures, correspond to Type in struct acpi_hmat_structure 732 + */ 733 + 734 + /* 0: Memory subystem address range */ 735 + 736 + struct acpi_hmat_address_range { 737 + struct acpi_hmat_structure header; 738 + u16 flags; 739 + u16 reserved1; 740 + u32 processor_PD; /* Processor proximity domain */ 741 + u32 memory_PD; /* Memory proximity domain */ 742 + u32 reserved2; 743 + u64 physical_address_base; /* Physical address range base */ 744 + u64 physical_address_length; /* Physical address range length */ 745 + }; 746 + 747 + /* Masks for Flags field above */ 748 + 749 + #define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: processor_PD field is valid */ 750 + #define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: memory_PD field is valid */ 751 + #define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */ 752 + 753 + /* 1: System locality latency and bandwidth information */ 754 + 755 + struct acpi_hmat_locality { 756 + struct acpi_hmat_structure header; 757 + u8 flags; 758 + u8 data_type; 759 + u16 reserved1; 760 + u32 number_of_initiator_Pds; 761 + u32 number_of_target_Pds; 762 + u32 reserved2; 763 + u64 entry_base_unit; 764 + }; 765 + 766 + /* Masks for Flags field above */ 767 + 768 + #define ACPI_HMAT_MEMORY_HIERARCHY (0x0F) 769 + 770 + /* Values for Memory Hierarchy flag */ 771 + 772 + #define ACPI_HMAT_MEMORY 0 773 + #define ACPI_HMAT_LAST_LEVEL_CACHE 1 774 + #define ACPI_HMAT_1ST_LEVEL_CACHE 2 775 + #define ACPI_HMAT_2ND_LEVEL_CACHE 3 776 + #define ACPI_HMAT_3RD_LEVEL_CACHE 4 777 + 778 + /* Values for data_type field above */ 779 + 780 + #define ACPI_HMAT_ACCESS_LATENCY 0 781 + #define ACPI_HMAT_READ_LATENCY 1 782 + #define ACPI_HMAT_WRITE_LATENCY 2 783 + #define ACPI_HMAT_ACCESS_BANDWIDTH 3 784 + #define ACPI_HMAT_READ_BANDWIDTH 4 785 + #define ACPI_HMAT_WRITE_BANDWIDTH 5 786 + 787 + /* 2: Memory side cache information */ 788 + 789 + struct acpi_hmat_cache { 790 + struct acpi_hmat_structure header; 791 + u32 memory_PD; 792 + u32 reserved1; 793 + u64 cache_size; 794 + u32 cache_attributes; 795 + u16 reserved2; 796 + u16 number_of_SMBIOShandles; 797 + }; 798 + 799 + /* Masks for cache_attributes field above */ 800 + 801 + #define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F) 802 + #define ACPI_HMAT_CACHE_LEVEL (0x000000F0) 803 + #define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00) 804 + #define ACPI_HMAT_WRITE_POLICY (0x0000F000) 805 + #define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000) 806 + 807 + /* Values for cache associativity flag */ 808 + 809 + #define ACPI_HMAT_CA_NONE (0) 810 + #define ACPI_HMAT_CA_DIRECT_MAPPED (1) 811 + #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2) 812 + 813 + /* Values for write policy flag */ 814 + 815 + #define ACPI_HMAT_CP_NONE (0) 816 + #define ACPI_HMAT_CP_WB (1) 817 + #define ACPI_HMAT_CP_WT (2) 818 + 694 819 /******************************************************************************* 695 820 * 696 821 * MADT - Multiple APIC Description Table ··· 840 705 841 706 /* Values for PCATCompat flag */ 842 707 843 - #define ACPI_MADT_DUAL_PIC 0 844 - #define ACPI_MADT_MULTIPLE_APIC 1 708 + #define ACPI_MADT_DUAL_PIC 1 709 + #define ACPI_MADT_MULTIPLE_APIC 0 845 710 846 711 /* Values for MADT subtable type in struct acpi_subtable_header */ 847 712 ··· 1282 1147 1283 1148 /******************************************************************************* 1284 1149 * 1150 + * PPTT - Processor Properties Topology Table (ACPI 6.2) 1151 + * Version 1 1152 + * 1153 + ******************************************************************************/ 1154 + 1155 + struct acpi_table_pptt { 1156 + struct acpi_table_header header; /* Common ACPI table header */ 1157 + }; 1158 + 1159 + /* Values for Type field above */ 1160 + 1161 + enum acpi_pptt_type { 1162 + ACPI_PPTT_TYPE_PROCESSOR = 0, 1163 + ACPI_PPTT_TYPE_CACHE = 1, 1164 + ACPI_PPTT_TYPE_ID = 2, 1165 + ACPI_PPTT_TYPE_RESERVED = 3 1166 + }; 1167 + 1168 + /* 0: Processor Hierarchy Node Structure */ 1169 + 1170 + struct acpi_pptt_processor { 1171 + struct acpi_subtable_header header; 1172 + u16 reserved; 1173 + u32 flags; 1174 + u32 parent; 1175 + u32 acpi_processor_id; 1176 + u32 number_of_priv_resources; 1177 + }; 1178 + 1179 + /* Flags */ 1180 + 1181 + #define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */ 1182 + #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */ 1183 + 1184 + /* 1: Cache Type Structure */ 1185 + 1186 + struct acpi_pptt_cache { 1187 + struct acpi_subtable_header header; 1188 + u16 reserved; 1189 + u32 flags; 1190 + u32 next_level_of_cache; 1191 + u32 size; 1192 + u32 number_of_sets; 1193 + u8 associativity; 1194 + u8 attributes; 1195 + u16 line_size; 1196 + }; 1197 + 1198 + /* Flags */ 1199 + 1200 + #define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */ 1201 + #define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */ 1202 + #define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */ 1203 + #define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */ 1204 + #define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */ 1205 + #define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */ 1206 + #define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */ 1207 + 1208 + /* Masks for Attributes */ 1209 + 1210 + #define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */ 1211 + #define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */ 1212 + #define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */ 1213 + 1214 + /* 2: ID Structure */ 1215 + 1216 + struct acpi_pptt_id { 1217 + struct acpi_subtable_header header; 1218 + u16 reserved; 1219 + u32 vendor_id; 1220 + u64 level1_id; 1221 + u64 level2_id; 1222 + u16 major_rev; 1223 + u16 minor_rev; 1224 + u16 spin_rev; 1225 + }; 1226 + 1227 + /******************************************************************************* 1228 + * 1285 1229 * SBST - Smart Battery Specification Table 1286 1230 * Version 1 1287 1231 * ··· 1406 1192 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, 1407 1193 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, 1408 1194 ACPI_SRAT_TYPE_GICC_AFFINITY = 3, 1409 - ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */ 1195 + ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */ 1196 + ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */ 1410 1197 }; 1411 1198 1412 1199 /* ··· 1478 1263 /* Flags for struct acpi_srat_gicc_affinity */ 1479 1264 1480 1265 #define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */ 1266 + 1267 + /* 4: GCC ITS Affinity (ACPI 6.2) */ 1268 + 1269 + struct acpi_srat_gic_its_affinity { 1270 + struct acpi_subtable_header header; 1271 + u32 proximity_domain; 1272 + u16 reserved; 1273 + u32 its_id; 1274 + }; 1481 1275 1482 1276 /* Reset to default packing */ 1483 1277
+56 -3
include/acpi/actbl2.h
··· 87 87 #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ 88 88 #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ 89 89 #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ 90 + #define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Migrations Table */ 90 91 #define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */ 91 92 92 93 #ifdef ACPI_UNDEFINED_TABLES ··· 1221 1220 * Version 2 1222 1221 * 1223 1222 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", 1224 - * December 19, 2014 1223 + * Version 1.2, Revision 8 1224 + * February 27, 2017 1225 1225 * 1226 1226 * NOTE: There are two versions of the table with the same signature -- 1227 1227 * the client version and the server version. The common platform_class ··· 1285 1283 * Version 4 1286 1284 * 1287 1285 * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", 1288 - * December 19, 2014 1286 + * Version 1.2, Revision 8 1287 + * February 27, 2017 1289 1288 * 1290 1289 ******************************************************************************/ 1291 1290 ··· 1307 1304 #define ACPI_TPM2_MEMORY_MAPPED 6 1308 1305 #define ACPI_TPM2_COMMAND_BUFFER 7 1309 1306 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8 1310 - #define ACPI_TPM2_COMMAND_BUFFER_WITH_SMC 11 1307 + #define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */ 1308 + 1309 + /* Trailer appears after any start_method subtables */ 1310 + 1311 + struct acpi_tpm2_trailer { 1312 + u32 minimum_log_length; /* Minimum length for the event log area */ 1313 + u64 log_address; /* Address of the event log area */ 1314 + }; 1315 + 1316 + /* 1317 + * Subtables (start_method-specific) 1318 + */ 1319 + 1320 + /* 11: Start Method for ARM SMC (V1.2 Rev 8) */ 1321 + 1322 + struct acpi_tpm2_arm_smc { 1323 + u32 global_interrupt; 1324 + u8 interrupt_flags; 1325 + u8 operation_flags; 1326 + u16 reserved; 1327 + u32 function_id; 1328 + }; 1329 + 1330 + /* Values for interrupt_flags above */ 1331 + 1332 + #define ACPI_TPM2_INTERRUPT_SUPPORT (1) 1333 + 1334 + /* Values for operation_flags above */ 1335 + 1336 + #define ACPI_TPM2_IDLE_SUPPORT (1) 1311 1337 1312 1338 /******************************************************************************* 1313 1339 * ··· 1529 1497 u16 max_count; /* Maximum counter value supported */ 1530 1498 u8 units; 1531 1499 }; 1500 + 1501 + /******************************************************************************* 1502 + * 1503 + * WSMT - Windows SMM Security Migrations Table 1504 + * Version 1 1505 + * 1506 + * Conforms to "Windows SMM Security Migrations Table", 1507 + * Version 1.0, April 18, 2016 1508 + * 1509 + ******************************************************************************/ 1510 + 1511 + struct acpi_table_wsmt { 1512 + struct acpi_table_header header; /* Common ACPI table header */ 1513 + u32 protection_flags; 1514 + }; 1515 + 1516 + /* Flags for protection_flags field above */ 1517 + 1518 + #define ACPI_WSMT_FIXED_COMM_BUFFERS (1) 1519 + #define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2) 1520 + #define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION (4) 1532 1521 1533 1522 /* Reset to default packing */ 1534 1523
+77 -5
include/acpi/actbl3.h
··· 116 116 u32 image_offset_y; 117 117 }; 118 118 119 + /* Flags for Status field above */ 120 + 121 + #define ACPI_BGRT_DISPLAYED (1) 122 + #define ACPI_BGRT_ORIENTATION_OFFSET (3 << 1) 123 + 119 124 /******************************************************************************* 120 125 * 121 126 * DRTM - Dynamic Root of Trust for Measurement table ··· 467 462 /******************************************************************************* 468 463 * 469 464 * PCCT - Platform Communications Channel Table (ACPI 5.0) 470 - * Version 1 465 + * Version 2 (ACPI 6.2) 471 466 * 472 467 ******************************************************************************/ 473 468 ··· 487 482 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, 488 483 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, 489 484 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */ 490 - ACPI_PCCT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ 485 + ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */ 486 + ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */ 487 + ACPI_PCCT_TYPE_RESERVED = 5 /* 5 and greater are reserved */ 491 488 }; 492 489 493 490 /* ··· 515 508 516 509 struct acpi_pcct_hw_reduced { 517 510 struct acpi_subtable_header header; 518 - u32 doorbell_interrupt; 511 + u32 platform_interrupt; 519 512 u8 flags; 520 513 u8 reserved; 521 514 u64 base_address; ··· 532 525 533 526 struct acpi_pcct_hw_reduced_type2 { 534 527 struct acpi_subtable_header header; 535 - u32 doorbell_interrupt; 528 + u32 platform_interrupt; 536 529 u8 flags; 537 530 u8 reserved; 538 531 u64 base_address; ··· 543 536 u32 latency; 544 537 u32 max_access_rate; 545 538 u16 min_turnaround_time; 546 - struct acpi_generic_address doorbell_ack_register; 539 + struct acpi_generic_address platform_ack_register; 547 540 u64 ack_preserve_mask; 548 541 u64 ack_write_mask; 542 + }; 543 + 544 + /* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */ 545 + 546 + struct acpi_pcct_ext_pcc_master { 547 + struct acpi_subtable_header header; 548 + u32 platform_interrupt; 549 + u8 flags; 550 + u8 reserved1; 551 + u64 base_address; 552 + u32 length; 553 + struct acpi_generic_address doorbell_register; 554 + u64 preserve_mask; 555 + u64 write_mask; 556 + u32 latency; 557 + u32 max_access_rate; 558 + u32 min_turnaround_time; 559 + struct acpi_generic_address platform_ack_register; 560 + u64 ack_preserve_mask; 561 + u64 ack_set_mask; 562 + u64 reserved2; 563 + struct acpi_generic_address cmd_complete_register; 564 + u64 cmd_complete_mask; 565 + struct acpi_generic_address cmd_update_register; 566 + u64 cmd_update_preserve_mask; 567 + u64 cmd_update_set_mask; 568 + struct acpi_generic_address error_status_register; 569 + u64 error_status_mask; 570 + }; 571 + 572 + /* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */ 573 + 574 + struct acpi_pcct_ext_pcc_slave { 575 + struct acpi_subtable_header header; 576 + u32 platform_interrupt; 577 + u8 flags; 578 + u8 reserved1; 579 + u64 base_address; 580 + u32 length; 581 + struct acpi_generic_address doorbell_register; 582 + u64 preserve_mask; 583 + u64 write_mask; 584 + u32 latency; 585 + u32 max_access_rate; 586 + u32 min_turnaround_time; 587 + struct acpi_generic_address platform_ack_register; 588 + u64 ack_preserve_mask; 589 + u64 ack_set_mask; 590 + u64 reserved2; 591 + struct acpi_generic_address cmd_complete_register; 592 + u64 cmd_complete_mask; 593 + struct acpi_generic_address cmd_update_register; 594 + u64 cmd_update_preserve_mask; 595 + u64 cmd_update_set_mask; 596 + struct acpi_generic_address error_status_register; 597 + u64 error_status_mask; 549 598 }; 550 599 551 600 /* Values for doorbell flags above */ ··· 619 556 u32 signature; 620 557 u16 command; 621 558 u16 status; 559 + }; 560 + 561 + /* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */ 562 + 563 + struct acpi_pcct_ext_pcc_shared_memory { 564 + u32 signature; 565 + u32 flags; 566 + u32 length; 567 + u32 command; 622 568 }; 623 569 624 570 /*******************************************************************************
+36 -31
include/acpi/actypes.h
··· 47 47 /* acpisrc:struct_defs -- for acpisrc conversion */ 48 48 49 49 /* 50 - * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header 51 - * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of 52 - * 12/2006. 50 + * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent 51 + * header and must be either 32 or 64. 16-bit ACPICA is no longer 52 + * supported, as of 12/2006. 53 53 */ 54 54 #ifndef ACPI_MACHINE_WIDTH 55 55 #error ACPI_MACHINE_WIDTH not defined ··· 87 87 * s64 64-bit (8 byte) signed value 88 88 * 89 89 * COMPILER_DEPENDENT_UINT64/s64 - These types are defined in the 90 - * compiler-dependent header(s) and were introduced because there is no common 91 - * 64-bit integer type across the various compilation models, as shown in 92 - * the table below. 90 + * compiler-dependent header(s) and were introduced because there is no 91 + * common 64-bit integer type across the various compilation models, as 92 + * shown in the table below. 93 93 * 94 94 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit 95 95 * char 8 8 8 8 8 8 ··· 106 106 * 2) These types represent the native word size of the target mode of the 107 107 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are 108 108 * usually used for memory allocation, efficient loop counters, and array 109 - * indexes. The types are similar to the size_t type in the C library and are 110 - * required because there is no C type that consistently represents the native 111 - * data width. acpi_size is needed because there is no guarantee that a 112 - * kernel-level C library is present. 109 + * indexes. The types are similar to the size_t type in the C library and 110 + * are required because there is no C type that consistently represents the 111 + * native data width. acpi_size is needed because there is no guarantee 112 + * that a kernel-level C library is present. 113 113 * 114 114 * acpi_size 16/32/64-bit unsigned value 115 115 * acpi_native_int 16/32/64-bit signed value ··· 169 169 170 170 /* 171 171 * In the case of the Itanium Processor Family (IPF), the hardware does not 172 - * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag 173 - * to indicate that special precautions must be taken to avoid alignment faults. 174 - * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) 172 + * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED 173 + * flag to indicate that special precautions must be taken to avoid alignment 174 + * faults. (IA64 or ia64 is currently used by existing compilers to indicate 175 + * IPF.) 175 176 * 176 177 * Note: EM64T and other X86-64 processors support misaligned transfers, 177 178 * so there is no need to define this flag. ··· 310 309 #endif 311 310 312 311 /* 313 - * Some compilers complain about unused variables. Sometimes we don't want to 314 - * use all the variables (for example, _acpi_module_name). This allows us 312 + * Some compilers complain about unused variables. Sometimes we don't want 313 + * to use all the variables (for example, _acpi_module_name). This allows us 315 314 * to tell the compiler in a per-variable manner that a variable 316 315 * is unused 317 316 */ ··· 320 319 #endif 321 320 322 321 /* 323 - * All ACPICA external functions that are available to the rest of the kernel 324 - * are tagged with thes macros which can be defined as appropriate for the host. 322 + * All ACPICA external functions that are available to the rest of the 323 + * kernel are tagged with these macros which can be defined as appropriate 324 + * for the host. 325 325 * 326 326 * Notes: 327 327 * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination ··· 385 383 386 384 /****************************************************************************** 387 385 * 388 - * ACPI Specification constants (Do not change unless the specification changes) 386 + * ACPI Specification constants (Do not change unless the specification 387 + * changes) 389 388 * 390 389 *****************************************************************************/ 391 390 ··· 487 484 #define ACPI_DO_NOT_WAIT 0 488 485 489 486 /* 490 - * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits. 491 - * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this 492 - * pertains to the ACPI integer type only, not to other integers used in the 493 - * implementation of the ACPICA subsystem. 487 + * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 488 + * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits. 489 + * Note that this pertains to the ACPI integer type only, not to other 490 + * integers used in the implementation of the ACPICA subsystem. 494 491 * 495 492 * 01/2010: This type is obsolete and has been removed from the entire ACPICA 496 493 * code base. It remains here for compatibility with device drivers that use ··· 632 629 #define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B 633 630 #define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C 634 631 #define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D 632 + #define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E 635 633 636 - #define ACPI_GENERIC_NOTIFY_MAX 0x0D 634 + #define ACPI_GENERIC_NOTIFY_MAX 0x0E 637 635 #define ACPI_SPECIFIC_NOTIFY_MAX 0x84 638 636 639 637 /* ··· 671 667 672 668 /* 673 669 * These are object types that do not map directly to the ACPI 674 - * object_type() operator. They are used for various internal purposes only. 675 - * If new predefined ACPI_TYPEs are added (via the ACPI specification), these 676 - * internal types must move upwards. (There is code that depends on these 677 - * values being contiguous with the external types above.) 670 + * object_type() operator. They are used for various internal purposes 671 + * only. If new predefined ACPI_TYPEs are added (via the ACPI 672 + * specification), these internal types must move upwards. (There 673 + * is code that depends on these values being contiguous with the 674 + * external types above.) 678 675 */ 679 676 #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 680 677 #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 ··· 775 770 * | | | | +-- Type of dispatch:to method, handler, notify, or none 776 771 * | | | +----- Interrupt type: edge or level triggered 777 772 * | | +------- Is a Wake GPE 778 - * | +--------- Is GPE masked by the software GPE masking machanism 773 + * | +--------- Is GPE masked by the software GPE masking mechanism 779 774 * +------------ <Reserved> 780 775 */ 781 776 #define ACPI_GPE_DISPATCH_NONE (u8) 0x00 ··· 913 908 */ 914 909 915 910 /* 916 - * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element 917 - * or an unresolved named reference. 911 + * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package 912 + * element or an unresolved named reference. 918 913 */ 919 914 union acpi_object { 920 915 acpi_object_type type; /* See definition of acpi_ns_type for values */ ··· 1171 1166 1172 1167 /* 1173 1168 * Structure returned from acpi_get_object_info. 1174 - * Optimized for both 32- and 64-bit builds 1169 + * Optimized for both 32-bit and 64-bit builds. 1175 1170 */ 1176 1171 struct acpi_device_info { 1177 1172 u32 info_size; /* Size of info, including ID strings */
+5
include/acpi/acuuid.h
··· 78 78 #define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" 79 79 #define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" 80 80 81 + /* Processor Properties (ACPI 6.2) */ 82 + 83 + #define UUID_CACHE_PROPERTIES "6DC63E77-257E-4E78-A973-A21F2796898D" 84 + #define UUID_PHYSICAL_PROPERTY "DDE4D59A-AA42-4349-B407-EA40F57D9FB7" 85 + 81 86 /* Miscellaneous */ 82 87 83 88 #define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
+4
include/acpi/platform/acenv.h
··· 382 382 #define ACPI_INIT_FUNCTION 383 383 #endif 384 384 385 + #ifndef ACPI_STRUCT_INIT 386 + #define ACPI_STRUCT_INIT(field, value) value 387 + #endif 388 + 385 389 #endif /* __ACENV_H__ */
+10
include/acpi/platform/acgcc.h
··· 48 48 * Use compiler specific <stdarg.h> is a good practice for even when 49 49 * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. 50 50 */ 51 + #ifndef va_arg 52 + #ifdef ACPI_USE_BUILTIN_STDARG 53 + typedef __builtin_va_list va_list; 54 + #define va_start(v, l) __builtin_va_start(v, l) 55 + #define va_end(v) __builtin_va_end(v) 56 + #define va_arg(v, l) __builtin_va_arg(v, l) 57 + #define va_copy(d, s) __builtin_va_copy(d, s) 58 + #else 51 59 #include <stdarg.h> 60 + #endif 61 + #endif 52 62 53 63 #define ACPI_INLINE __inline__ 54 64
+2
include/acpi/platform/acintel.h
··· 48 48 * Use compiler specific <stdarg.h> is a good practice for even when 49 49 * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. 50 50 */ 51 + #ifndef va_arg 51 52 #include <stdarg.h> 53 + #endif 52 54 53 55 /* Configuration specific to Intel 64-bit C compiler */ 54 56
+2
include/acpi/platform/aclinux.h
··· 178 178 #define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): " 179 179 #define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): " 180 180 181 + #define ACPI_STRUCT_INIT(field, value) .field = value 182 + 181 183 #else /* !__KERNEL__ */ 182 184 183 185 #define ACPI_USE_STANDARD_HEADERS
+7 -3
tools/power/acpi/os_specific/service_layers/osunixxf.c
··· 750 750 { 751 751 acpi_status status = AE_OK; 752 752 sem_t *sem = (sem_t *) handle; 753 + int ret_val; 753 754 #ifndef ACPI_USE_ALTERNATE_TIMEOUT 754 755 struct timespec time; 755 - int ret_val; 756 756 #endif 757 757 758 758 if (!sem) { ··· 778 778 779 779 case ACPI_WAIT_FOREVER: 780 780 781 - if (sem_wait(sem)) { 781 + while (((ret_val = sem_wait(sem)) == -1) && (errno == EINTR)) { 782 + continue; /* Restart if interrupted */ 783 + } 784 + if (ret_val != 0) { 782 785 status = (AE_TIME); 783 786 } 784 787 break; ··· 834 831 835 832 while (((ret_val = sem_timedwait(sem, &time)) == -1) 836 833 && (errno == EINTR)) { 837 - continue; 834 + continue; /* Restart if interrupted */ 835 + 838 836 } 839 837 840 838 if (ret_val != 0) {