aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 15:01:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 15:01:29 -0400
commit0f5abd4020bfd2b1eec6975b91bd5068aa674a93 (patch)
tree2ed5f67c556bb48df2b8e299b5be154f3a215be2
parent54e514b91b95d6441c12a7955addfb9f9d2afc65 (diff)
parent0ee0d34985ceffe4036319e1e46df8bff591b9e3 (diff)
Merge tag 'acpica-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPICA updates from Rafael Wysocki: "This updates the kernel's ACPICA code to upstream revision 20150410 and adds a fix for a GPE handling regression introduced during the 3.19 cycle on top of that. Included are two stable-candidate bug fixes (one of them fixing a 3.16 regression), multiple other fixes and a bunch of cleanups. Specifics: - Fix for a GPE handling regression on Dell Latitude D600 that caused GPE signaling to stop working on that machine, which appears to be due to a hardware glitch, but it used to work and it can be made work again in a relativly straightforward way (Rafael J Wysocki). - Fix for a mutex unlock regression related to the handling of ACPI tables introduced during the 3.16 development cycle (Octavian Purdila). - _REV modification to always return 2 which has been done by all versions of Windows since NT and the firmware people started to use it to distinguish between OSes in their AML and do some silly and wrong things on that basis (Bob Moore). - Fixes and cleanups related to the acpi_physicall_address data type including one stable-candidate fix for an issue occasionally occuring on 64-bit machines running 32-bit kernels where using offsets provided by the firmware may lead to address overflows (Lv Zheng). - External() opcode support infrastructure needed for recompiling disassembled ACPI tables in some cases including interpreter modification to ignore that opcode (Bob Moore). - Support for the "Windows 2015" string in _OSI (Bob Moore). - GPE debug interface change to return values read from hardware registers (Lv Zheng). - Removal of the __DATE__ macro usage in tools (Rasmus Villemoes). - Assorted minor fixes and cleanups (Lv Zheng, Rickard Strandqvist, Bob Moore)" * tag 'acpica-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits) ACPICA: Store GPE register enable masks upfront ACPICA: Update version to 20150410. ACPICA: Fix a couple issues with the local printf module. ACPICA: Disassembler: Some cleanup of the table dump module. ACPICA: iASL: Add support for MSDM ACPI table. ACPICA: Update for SLIC ACPI table. ACPICA: Add "//" before ascii output of buffers. ACPICA: Remove unused internal AML opcode. ACPICA: Permanently set _REV to the value '2'. ACPICA: Add "Windows 2015" string to _OSI support. ACPICA: Add infrastructure for External() opcode. ACPICA: iASL: Enhancement for constant folding. ACPICA: iASL/Disassembler: Add option to assume table contains valid AML. ACPICA: Update AML Debugger global variables. ACPICA: Update Resource descriptor dump module. ACPICA: Fix a sscanf format string. ACPICA: Casting changes around acpi_physical_address/acpi_size. ACPICA: Resources: Correct conditional compilation definitions. ACPICA: Utilities: Correct conditional compilation definitions. ACPICA: Tables: Move an iasl specific table function to iasl source file. ...
-rw-r--r--drivers/acpi/acpica/acapps.h8
-rw-r--r--drivers/acpi/acpica/acglobal.h5
-rw-r--r--drivers/acpi/acpica/aclocal.h2
-rw-r--r--drivers/acpi/acpica/acmacros.h13
-rw-r--r--drivers/acpi/acpica/acopcode.h2
-rw-r--r--drivers/acpi/acpica/acresrc.h6
-rw-r--r--drivers/acpi/acpica/acstruct.h5
-rw-r--r--drivers/acpi/acpica/actables.h9
-rw-r--r--drivers/acpi/acpica/acutils.h22
-rw-r--r--drivers/acpi/acpica/amlcode.h2
-rw-r--r--drivers/acpi/acpica/dsopcode.c7
-rw-r--r--drivers/acpi/acpica/dsutils.c11
-rw-r--r--drivers/acpi/acpica/evgpe.c5
-rw-r--r--drivers/acpi/acpica/evregion.c2
-rw-r--r--drivers/acpi/acpica/evxfevnt.c5
-rw-r--r--drivers/acpi/acpica/exdump.c4
-rw-r--r--drivers/acpi/acpica/exfldio.c10
-rw-r--r--drivers/acpi/acpica/exoparg3.c13
-rw-r--r--drivers/acpi/acpica/exregion.c17
-rw-r--r--drivers/acpi/acpica/hwgpe.c24
-rw-r--r--drivers/acpi/acpica/hwvalid.c16
-rw-r--r--drivers/acpi/acpica/nsdump.c12
-rw-r--r--drivers/acpi/acpica/psopcode.c8
-rw-r--r--drivers/acpi/acpica/psopinfo.c2
-rw-r--r--drivers/acpi/acpica/rsdump.c227
-rw-r--r--drivers/acpi/acpica/tbdata.c35
-rw-r--r--drivers/acpi/acpica/tbinstal.c67
-rw-r--r--drivers/acpi/acpica/tbprint.c19
-rw-r--r--drivers/acpi/acpica/tbxfroot.c7
-rw-r--r--drivers/acpi/acpica/utaddress.c34
-rw-r--r--drivers/acpi/acpica/utbuffer.c8
-rw-r--r--drivers/acpi/acpica/utglobal.c13
-rw-r--r--drivers/acpi/acpica/utmisc.c2
-rw-r--r--drivers/acpi/acpica/utosi.c1
-rw-r--r--drivers/acpi/acpica/utprint.c13
-rw-r--r--drivers/acpi/acpica/utstate.c34
-rw-r--r--drivers/acpi/acpica/utuuid.c2
-rw-r--r--include/acpi/acpixf.h14
-rw-r--r--include/acpi/actbl2.h70
-rw-r--r--include/acpi/actypes.h50
-rw-r--r--include/acpi/platform/acenv.h1
-rw-r--r--tools/power/acpi/os_specific/service_layers/oslinuxtbl.c2
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixmap.c2
43 files changed, 391 insertions, 420 deletions
diff --git a/drivers/acpi/acpica/acapps.h b/drivers/acpi/acpica/acapps.h
index d863016565b5..e9f0833e818d 100644
--- a/drivers/acpi/acpica/acapps.h
+++ b/drivers/acpi/acpica/acapps.h
@@ -64,15 +64,15 @@
64/* Macros for signons and file headers */ 64/* Macros for signons and file headers */
65 65
66#define ACPI_COMMON_SIGNON(utility_name) \ 66#define ACPI_COMMON_SIGNON(utility_name) \
67 "\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \ 67 "\n%s\n%s version %8.8X%s\n%s\n\n", \
68 ACPICA_NAME, \ 68 ACPICA_NAME, \
69 utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \ 69 utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, \
70 ACPICA_COPYRIGHT 70 ACPICA_COPYRIGHT
71 71
72#define ACPI_COMMON_HEADER(utility_name, prefix) \ 72#define ACPI_COMMON_HEADER(utility_name, prefix) \
73 "%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \ 73 "%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \
74 prefix, ACPICA_NAME, \ 74 prefix, ACPICA_NAME, \
75 prefix, utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \ 75 prefix, utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, \
76 prefix, ACPICA_COPYRIGHT, \ 76 prefix, ACPICA_COPYRIGHT, \
77 prefix 77 prefix
78 78
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index a165d25343e8..a0c478784314 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -306,6 +306,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_db_output_flags, ACPI_DB_CONSOLE_OUTPUT);
306ACPI_INIT_GLOBAL(u8, acpi_gbl_no_resource_disassembly, FALSE); 306ACPI_INIT_GLOBAL(u8, acpi_gbl_no_resource_disassembly, FALSE);
307ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_noop_operator, FALSE); 307ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_noop_operator, FALSE);
308ACPI_INIT_GLOBAL(u8, acpi_gbl_cstyle_disassembly, TRUE); 308ACPI_INIT_GLOBAL(u8, acpi_gbl_cstyle_disassembly, TRUE);
309ACPI_INIT_GLOBAL(u8, acpi_gbl_force_aml_disassembly, FALSE);
309 310
310ACPI_GLOBAL(u8, acpi_gbl_db_opt_disasm); 311ACPI_GLOBAL(u8, acpi_gbl_db_opt_disasm);
311ACPI_GLOBAL(u8, acpi_gbl_db_opt_verbose); 312ACPI_GLOBAL(u8, acpi_gbl_db_opt_verbose);
@@ -321,9 +322,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_db_terminate_threads, FALSE);
321ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE); 322ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
322ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE); 323ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
323 324
324ACPI_GLOBAL(u8, acpi_gbl_db_opt_tables); 325ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_ini_methods);
325ACPI_GLOBAL(u8, acpi_gbl_db_opt_stats);
326ACPI_GLOBAL(u8, acpi_gbl_db_opt_ini_methods);
327ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support); 326ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);
328ACPI_GLOBAL(u8, acpi_gbl_db_output_to_file); 327ACPI_GLOBAL(u8, acpi_gbl_db_output_to_file);
329ACPI_GLOBAL(char *, acpi_gbl_db_buffer); 328ACPI_GLOBAL(char *, acpi_gbl_db_buffer);
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 7add32e5d8c5..87b27521fcac 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -53,7 +53,7 @@ typedef u32 acpi_mutex_handle;
53 53
54/* Total number of aml opcodes defined */ 54/* Total number of aml opcodes defined */
55 55
56#define AML_NUM_OPCODES 0x81 56#define AML_NUM_OPCODES 0x82
57 57
58/* Forward declarations */ 58/* Forward declarations */
59 59
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index cf607fe69dbd..c240bdf824f2 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -63,23 +63,12 @@
63#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (u64) (val)) 63#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (u64) (val))
64 64
65/* 65/*
66 * printf() format helpers. These macros are workarounds for the difficulties 66 * printf() format helper. This macros is a workaround for the difficulties
67 * with emitting 64-bit integers and 64-bit pointers with the same code 67 * with emitting 64-bit integers and 64-bit pointers with the same code
68 * for both 32-bit and 64-bit hosts. 68 * for both 32-bit and 64-bit hosts.
69 */ 69 */
70#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) 70#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
71 71
72#if ACPI_MACHINE_WIDTH == 64
73#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
74#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
75#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"
76
77#else
78#define ACPI_FORMAT_NATIVE_UINT(i) 0, (u32) (i)
79#define ACPI_FORMAT_TO_UINT(i) (u32) (i)
80#define ACPI_PRINTF_UINT "0x%8.8X"
81#endif
82
83/* 72/*
84 * Macros for moving data around to/from buffers that are possibly unaligned. 73 * Macros for moving data around to/from buffers that are possibly unaligned.
85 * If the hardware supports the transfer of unaligned data, just do the store. 74 * If the hardware supports the transfer of unaligned data, just do the store.
diff --git a/drivers/acpi/acpica/acopcode.h b/drivers/acpi/acpica/acopcode.h
index a5f17de45ac6..fd85ad05a24a 100644
--- a/drivers/acpi/acpica/acopcode.h
+++ b/drivers/acpi/acpica/acopcode.h
@@ -111,6 +111,7 @@
111#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA) 111#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
112#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST) 112#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
113#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME) 113#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
114#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA)
114#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG) 115#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
115#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST) 116#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
116#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET) 117#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
@@ -243,6 +244,7 @@
243#define ARGI_DWORD_OP ARGI_INVALID_OPCODE 244#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
244#define ARGI_ELSE_OP ARGI_INVALID_OPCODE 245#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
245#define ARGI_EVENT_OP ARGI_INVALID_OPCODE 246#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
247#define ARGI_EXTERNAL_OP ARGI_LIST3 (ARGI_STRING, ARGI_INTEGER, ARGI_INTEGER)
246#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER) 248#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
247#define ARGI_FIELD_OP ARGI_INVALID_OPCODE 249#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
248#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 250#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h
index efc4c7124ccc..6357efb01b93 100644
--- a/drivers/acpi/acpica/acresrc.h
+++ b/drivers/acpi/acpica/acresrc.h
@@ -299,11 +299,13 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
299 union aml_resource *aml); 299 union aml_resource *aml);
300 300
301/* 301/*
302 * rsdump 302 * rsdump - Debugger support
303 */ 303 */
304#ifdef ACPI_DEBUGGER
304void acpi_rs_dump_resource_list(struct acpi_resource *resource); 305void acpi_rs_dump_resource_list(struct acpi_resource *resource);
305 306
306void acpi_rs_dump_irq_list(u8 * route_table); 307void acpi_rs_dump_irq_list(u8 *route_table);
308#endif
307 309
308/* 310/*
309 * Resource conversion tables 311 * Resource conversion tables
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h
index d14b547b7cd5..87c7860b3394 100644
--- a/drivers/acpi/acpica/acstruct.h
+++ b/drivers/acpi/acpica/acstruct.h
@@ -68,11 +68,6 @@
68#define ACPI_WALK_METHOD 0x01 68#define ACPI_WALK_METHOD 0x01
69#define ACPI_WALK_METHOD_RESTART 0x02 69#define ACPI_WALK_METHOD_RESTART 0x02
70 70
71/* Flags for iASL compiler only */
72
73#define ACPI_WALK_CONST_REQUIRED 0x10
74#define ACPI_WALK_CONST_OPTIONAL 0x20
75
76struct acpi_walk_state { 71struct acpi_walk_state {
77 struct acpi_walk_state *next; /* Next walk_state in list */ 72 struct acpi_walk_state *next; /* Next walk_state in list */
78 u8 descriptor_type; /* To differentiate various internal objs */ 73 u8 descriptor_type; /* To differentiate various internal objs */
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index 1c127a43017b..7e0b6f1bec9c 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -58,7 +58,9 @@ u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length);
58/* 58/*
59 * tbdata - table data structure management 59 * tbdata - table data structure management
60 */ 60 */
61acpi_status acpi_tb_get_next_root_index(u32 *table_index); 61acpi_status
62acpi_tb_get_next_table_descriptor(u32 *table_index,
63 struct acpi_table_desc **table_desc);
62 64
63void 65void
64acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc, 66acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc,
@@ -119,11 +121,6 @@ acpi_tb_install_standard_table(acpi_physical_address address,
119 u8 flags, 121 u8 flags,
120 u8 reload, u8 override, u32 *table_index); 122 u8 reload, u8 override, u32 *table_index);
121 123
122acpi_status
123acpi_tb_store_table(acpi_physical_address address,
124 struct acpi_table_header *table,
125 u32 length, u8 flags, u32 *table_index);
126
127void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc); 124void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc);
128 125
129void acpi_tb_terminate(void); 126void acpi_tb_terminate(void);
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index c2f03e8774ad..2b3c5bd222f1 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -502,6 +502,9 @@ const union acpi_predefined_info *acpi_ut_get_next_predefined_method(const union
502 502
503const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name); 503const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name);
504 504
505void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes);
506
507#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
505const union acpi_predefined_info *acpi_ut_match_resource_name(char *name); 508const union acpi_predefined_info *acpi_ut_match_resource_name(char *name);
506 509
507void 510void
@@ -509,9 +512,8 @@ acpi_ut_display_predefined_method(char *buffer,
509 const union acpi_predefined_info *this_name, 512 const union acpi_predefined_info *this_name,
510 u8 multi_line); 513 u8 multi_line);
511 514
512void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes);
513
514u32 acpi_ut_get_resource_bit_width(char *buffer, u16 types); 515u32 acpi_ut_get_resource_bit_width(char *buffer, u16 types);
516#endif
515 517
516/* 518/*
517 * utstate - Generic state creation/cache routines 519 * utstate - Generic state creation/cache routines
@@ -539,14 +541,6 @@ acpi_ut_create_update_state_and_push(union acpi_operand_object *object,
539 u16 action, 541 u16 action,
540 union acpi_generic_state **state_list); 542 union acpi_generic_state **state_list);
541 543
542#ifdef ACPI_FUTURE_USAGE
543acpi_status
544acpi_ut_create_pkg_state_and_push(void *internal_object,
545 void *external_object,
546 u16 index,
547 union acpi_generic_state **state_list);
548#endif /* ACPI_FUTURE_USAGE */
549
550union acpi_generic_state *acpi_ut_create_control_state(void); 544union acpi_generic_state *acpi_ut_create_control_state(void);
551 545
552void acpi_ut_delete_generic_state(union acpi_generic_state *state); 546void acpi_ut_delete_generic_state(union acpi_generic_state *state);
@@ -570,7 +564,9 @@ const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status
570 564
571u8 acpi_ut_is_pci_root_bridge(char *id); 565u8 acpi_ut_is_pci_root_bridge(char *id);
572 566
567#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
573u8 acpi_ut_is_aml_table(struct acpi_table_header *table); 568u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
569#endif
574 570
575acpi_status 571acpi_status
576acpi_ut_walk_package_tree(union acpi_operand_object *source_object, 572acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
@@ -629,15 +625,19 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag);
629 */ 625 */
630void acpi_ut_strupr(char *src_string); 626void acpi_ut_strupr(char *src_string);
631 627
628#ifdef ACPI_ASL_COMPILER
632void acpi_ut_strlwr(char *src_string); 629void acpi_ut_strlwr(char *src_string);
633 630
634int acpi_ut_stricmp(char *string1, char *string2); 631int acpi_ut_stricmp(char *string1, char *string2);
632#endif
635 633
636acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer); 634acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer);
637 635
638void acpi_ut_print_string(char *string, u16 max_length); 636void acpi_ut_print_string(char *string, u16 max_length);
639 637
638#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
640void ut_convert_backslashes(char *pathname); 639void ut_convert_backslashes(char *pathname);
640#endif
641 641
642u8 acpi_ut_valid_acpi_name(char *name); 642u8 acpi_ut_valid_acpi_name(char *name);
643 643
@@ -785,6 +785,8 @@ int acpi_ut_file_printf(ACPI_FILE file, const char *format, ...);
785/* 785/*
786 * utuuid -- UUID support functions 786 * utuuid -- UUID support functions
787 */ 787 */
788#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
788void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer); 789void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer);
790#endif
789 791
790#endif /* _ACUTILS_H */ 792#endif /* _ACUTILS_H */
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index 3a95068fc119..be9fd009cb28 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -65,6 +65,7 @@
65#define AML_PACKAGE_OP (u16) 0x12 65#define AML_PACKAGE_OP (u16) 0x12
66#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ 66#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */
67#define AML_METHOD_OP (u16) 0x14 67#define AML_METHOD_OP (u16) 0x14
68#define AML_EXTERNAL_OP (u16) 0x15 /* ACPI 6.0 */
68#define AML_DUAL_NAME_PREFIX (u16) 0x2e 69#define AML_DUAL_NAME_PREFIX (u16) 0x2e
69#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f 70#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f
70#define AML_NAME_CHAR_SUBSEQ (u16) 0x30 71#define AML_NAME_CHAR_SUBSEQ (u16) 0x30
@@ -206,7 +207,6 @@
206#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031 207#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031
207#define AML_INT_ACCESSFIELD_OP (u16) 0x0032 208#define AML_INT_ACCESSFIELD_OP (u16) 0x0032
208#define AML_INT_BYTELIST_OP (u16) 0x0033 209#define AML_INT_BYTELIST_OP (u16) 0x0033
209#define AML_INT_STATICSTRING_OP (u16) 0x0034
210#define AML_INT_METHODCALL_OP (u16) 0x0035 210#define AML_INT_METHODCALL_OP (u16) 0x0035
211#define AML_INT_RETURN_VALUE_OP (u16) 0x0036 211#define AML_INT_RETURN_VALUE_OP (u16) 0x0036
212#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 212#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 77244182ff02..ea0cc4e08f80 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -446,7 +446,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
446 446
447 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n", 447 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
448 obj_desc, 448 obj_desc,
449 ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address), 449 ACPI_FORMAT_UINT64(obj_desc->region.address),
450 obj_desc->region.length)); 450 obj_desc->region.length));
451 451
452 /* Now the address and length are valid for this opregion */ 452 /* Now the address and length are valid for this opregion */
@@ -539,13 +539,12 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
539 return_ACPI_STATUS(AE_NOT_EXIST); 539 return_ACPI_STATUS(AE_NOT_EXIST);
540 } 540 }
541 541
542 obj_desc->region.address = 542 obj_desc->region.address = ACPI_PTR_TO_PHYSADDR(table);
543 (acpi_physical_address) ACPI_TO_INTEGER(table);
544 obj_desc->region.length = table->length; 543 obj_desc->region.length = table->length;
545 544
546 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n", 545 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
547 obj_desc, 546 obj_desc,
548 ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address), 547 ACPI_FORMAT_UINT64(obj_desc->region.address),
549 obj_desc->region.length)); 548 obj_desc->region.length));
550 549
551 /* Now the address and length are valid for this opregion */ 550 /* Now the address and length are valid for this opregion */
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index e5ff89bcb3f5..deeddd6d2f05 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -564,6 +564,17 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
564 acpi_operand_object, 564 acpi_operand_object,
565 acpi_gbl_root_node); 565 acpi_gbl_root_node);
566 status = AE_OK; 566 status = AE_OK;
567 } else if (parent_op->common.aml_opcode ==
568 AML_EXTERNAL_OP) {
569
570 /* TBD: May only be temporary */
571
572 obj_desc =
573 acpi_ut_create_string_object((acpi_size) name_length);
574
575 ACPI_STRNCPY(obj_desc->string.pointer,
576 name_string, name_length);
577 status = AE_OK;
567 } else { 578 } else {
568 /* 579 /*
569 * We just plain didn't find it -- which is a 580 * We just plain didn't find it -- which is a
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index 5ed064e8673c..ccf793247447 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -92,6 +92,7 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info)
92 ACPI_SET_BIT(gpe_register_info->enable_for_run, 92 ACPI_SET_BIT(gpe_register_info->enable_for_run,
93 (u8)register_bit); 93 (u8)register_bit);
94 } 94 }
95 gpe_register_info->enable_mask = gpe_register_info->enable_for_run;
95 96
96 return_ACPI_STATUS(AE_OK); 97 return_ACPI_STATUS(AE_OK);
97} 98}
@@ -123,7 +124,7 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
123 124
124 /* Enable the requested GPE */ 125 /* Enable the requested GPE */
125 126
126 status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE_SAVE); 127 status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE);
127 return_ACPI_STATUS(status); 128 return_ACPI_STATUS(status);
128} 129}
129 130
@@ -202,7 +203,7 @@ acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
202 if (ACPI_SUCCESS(status)) { 203 if (ACPI_SUCCESS(status)) {
203 status = 204 status =
204 acpi_hw_low_set_gpe(gpe_event_info, 205 acpi_hw_low_set_gpe(gpe_event_info,
205 ACPI_GPE_DISABLE_SAVE); 206 ACPI_GPE_DISABLE);
206 } 207 }
207 208
208 if (ACPI_FAILURE(status)) { 209 if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 9abace3401f9..2ba28a63fb68 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -272,7 +272,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
272 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, 272 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
273 "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", 273 "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
274 &region_obj->region.handler->address_space, handler, 274 &region_obj->region.handler->address_space, handler,
275 ACPI_FORMAT_NATIVE_UINT(address), 275 ACPI_FORMAT_UINT64(address),
276 acpi_ut_get_region_name(region_obj->region. 276 acpi_ut_get_region_name(region_obj->region.
277 space_id))); 277 space_id)));
278 278
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index df06a23c4197..faad911d46b5 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -356,7 +356,8 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
356 } 356 }
357 357
358 if (in_byte) { 358 if (in_byte) {
359 local_event_status |= ACPI_EVENT_FLAG_ENABLED; 359 local_event_status |=
360 (ACPI_EVENT_FLAG_ENABLED | ACPI_EVENT_FLAG_ENABLE_SET);
360 } 361 }
361 362
362 /* Fixed event currently active? */ 363 /* Fixed event currently active? */
@@ -369,7 +370,7 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
369 } 370 }
370 371
371 if (in_byte) { 372 if (in_byte) {
372 local_event_status |= ACPI_EVENT_FLAG_SET; 373 local_event_status |= ACPI_EVENT_FLAG_STATUS_SET;
373 } 374 }
374 375
375 (*event_status) = local_event_status; 376 (*event_status) = local_event_status;
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index 7c213b6b6472..1da52bef632e 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -767,8 +767,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
767 acpi_os_printf("\n"); 767 acpi_os_printf("\n");
768 } else { 768 } else {
769 acpi_os_printf(" base %8.8X%8.8X Length %X\n", 769 acpi_os_printf(" base %8.8X%8.8X Length %X\n",
770 ACPI_FORMAT_NATIVE_UINT(obj_desc->region. 770 ACPI_FORMAT_UINT64(obj_desc->region.
771 address), 771 address),
772 obj_desc->region.length); 772 obj_desc->region.length);
773 } 773 }
774 break; 774 break;
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index 49479927e7f7..725a3746a2df 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -263,17 +263,15 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
263 } 263 }
264 264
265 ACPI_DEBUG_PRINT_RAW((ACPI_DB_BFIELD, 265 ACPI_DEBUG_PRINT_RAW((ACPI_DB_BFIELD,
266 " Region [%s:%X], Width %X, ByteBase %X, Offset %X at %p\n", 266 " Region [%s:%X], Width %X, ByteBase %X, Offset %X at %8.8X%8.8X\n",
267 acpi_ut_get_region_name(rgn_desc->region. 267 acpi_ut_get_region_name(rgn_desc->region.
268 space_id), 268 space_id),
269 rgn_desc->region.space_id, 269 rgn_desc->region.space_id,
270 obj_desc->common_field.access_byte_width, 270 obj_desc->common_field.access_byte_width,
271 obj_desc->common_field.base_byte_offset, 271 obj_desc->common_field.base_byte_offset,
272 field_datum_byte_offset, ACPI_CAST_PTR(void, 272 field_datum_byte_offset,
273 (rgn_desc-> 273 ACPI_FORMAT_UINT64(rgn_desc->region.address +
274 region. 274 region_offset)));
275 address +
276 region_offset))));
277 275
278 /* Invoke the appropriate address_space/op_region handler */ 276 /* Invoke the appropriate address_space/op_region handler */
279 277
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index b813fed95e56..1c64a988cbee 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -114,7 +114,18 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
114 /* Might return while OS is shutting down, just continue */ 114 /* Might return while OS is shutting down, just continue */
115 115
116 ACPI_FREE(fatal); 116 ACPI_FREE(fatal);
117 break; 117 goto cleanup;
118
119 case AML_EXTERNAL_OP:
120 /*
121 * If the interpreter sees this opcode, just ignore it. The External
122 * op is intended for use by disassemblers in order to properly
123 * disassemble control method invocations. The opcode or group of
124 * opcodes should be surrounded by an "if (0)" clause to ensure that
125 * AML interpreters never see the opcode.
126 */
127 status = AE_OK;
128 goto cleanup;
118 129
119 default: 130 default:
120 131
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 0fe188e238ef..f6c2f5499935 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -165,8 +165,8 @@ acpi_ex_system_memory_space_handler(u32 function,
165 * one page, which is similar to the original code that used a 4k 165 * one page, which is similar to the original code that used a 4k
166 * maximum window. 166 * maximum window.
167 */ 167 */
168 page_boundary_map_length = 168 page_boundary_map_length = (acpi_size)
169 ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address; 169 (ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address);
170 if (page_boundary_map_length == 0) { 170 if (page_boundary_map_length == 0) {
171 page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE; 171 page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
172 } 172 }
@@ -177,12 +177,13 @@ acpi_ex_system_memory_space_handler(u32 function,
177 177
178 /* Create a new mapping starting at the address given */ 178 /* Create a new mapping starting at the address given */
179 179
180 mem_info->mapped_logical_address = acpi_os_map_memory((acpi_physical_address) address, map_length); 180 mem_info->mapped_logical_address =
181 acpi_os_map_memory(address, map_length);
181 if (!mem_info->mapped_logical_address) { 182 if (!mem_info->mapped_logical_address) {
182 ACPI_ERROR((AE_INFO, 183 ACPI_ERROR((AE_INFO,
183 "Could not map memory at 0x%8.8X%8.8X, size %u", 184 "Could not map memory at 0x%8.8X%8.8X, size %u",
184 ACPI_FORMAT_NATIVE_UINT(address), 185 ACPI_FORMAT_UINT64(address),
185 (u32) map_length)); 186 (u32)map_length));
186 mem_info->mapped_length = 0; 187 mem_info->mapped_length = 0;
187 return_ACPI_STATUS(AE_NO_MEMORY); 188 return_ACPI_STATUS(AE_NO_MEMORY);
188 } 189 }
@@ -202,8 +203,7 @@ acpi_ex_system_memory_space_handler(u32 function,
202 203
203 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 204 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
204 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n", 205 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
205 bit_width, function, 206 bit_width, function, ACPI_FORMAT_UINT64(address)));
206 ACPI_FORMAT_NATIVE_UINT(address)));
207 207
208 /* 208 /*
209 * Perform the memory read or write 209 * Perform the memory read or write
@@ -318,8 +318,7 @@ acpi_ex_system_io_space_handler(u32 function,
318 318
319 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 319 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
320 "System-IO (width %u) R/W %u Address=%8.8X%8.8X\n", 320 "System-IO (width %u) R/W %u Address=%8.8X%8.8X\n",
321 bit_width, function, 321 bit_width, function, ACPI_FORMAT_UINT64(address)));
322 ACPI_FORMAT_NATIVE_UINT(address)));
323 322
324 /* Decode the function parameter */ 323 /* Decode the function parameter */
325 324
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 84bc550f4f1d..73cfa5947ff3 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -89,6 +89,8 @@ u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info)
89 * RETURN: Status 89 * RETURN: Status
90 * 90 *
91 * DESCRIPTION: Enable or disable a single GPE in the parent enable register. 91 * DESCRIPTION: Enable or disable a single GPE in the parent enable register.
92 * The enable_mask field of the involved GPE register must be
93 * updated by the caller if necessary.
92 * 94 *
93 ******************************************************************************/ 95 ******************************************************************************/
94 96
@@ -119,7 +121,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
119 /* Set or clear just the bit that corresponds to this GPE */ 121 /* Set or clear just the bit that corresponds to this GPE */
120 122
121 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); 123 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
122 switch (action & ~ACPI_GPE_SAVE_MASK) { 124 switch (action) {
123 case ACPI_GPE_CONDITIONAL_ENABLE: 125 case ACPI_GPE_CONDITIONAL_ENABLE:
124 126
125 /* Only enable if the corresponding enable_mask bit is set */ 127 /* Only enable if the corresponding enable_mask bit is set */
@@ -149,9 +151,6 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
149 /* Write the updated enable mask */ 151 /* Write the updated enable mask */
150 152
151 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address); 153 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
152 if (ACPI_SUCCESS(status) && (action & ACPI_GPE_SAVE_MASK)) {
153 gpe_register_info->enable_mask = (u8)enable_mask;
154 }
155 return (status); 154 return (status);
156} 155}
157 156
@@ -250,6 +249,17 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
250 local_event_status |= ACPI_EVENT_FLAG_WAKE_ENABLED; 249 local_event_status |= ACPI_EVENT_FLAG_WAKE_ENABLED;
251 } 250 }
252 251
252 /* GPE currently enabled (enable bit == 1)? */
253
254 status = acpi_hw_read(&in_byte, &gpe_register_info->enable_address);
255 if (ACPI_FAILURE(status)) {
256 return (status);
257 }
258
259 if (register_bit & in_byte) {
260 local_event_status |= ACPI_EVENT_FLAG_ENABLE_SET;
261 }
262
253 /* GPE currently active (status bit == 1)? */ 263 /* GPE currently active (status bit == 1)? */
254 264
255 status = acpi_hw_read(&in_byte, &gpe_register_info->status_address); 265 status = acpi_hw_read(&in_byte, &gpe_register_info->status_address);
@@ -258,7 +268,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
258 } 268 }
259 269
260 if (register_bit & in_byte) { 270 if (register_bit & in_byte) {
261 local_event_status |= ACPI_EVENT_FLAG_SET; 271 local_event_status |= ACPI_EVENT_FLAG_STATUS_SET;
262 } 272 }
263 273
264 /* Set return value */ 274 /* Set return value */
@@ -286,10 +296,8 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
286{ 296{
287 acpi_status status; 297 acpi_status status;
288 298
299 gpe_register_info->enable_mask = enable_mask;
289 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address); 300 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
290 if (ACPI_SUCCESS(status)) {
291 gpe_register_info->enable_mask = enable_mask;
292 }
293 return (status); 301 return (status);
294} 302}
295 303
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index 2bd33fe56cb3..29033d71417b 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -142,17 +142,17 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
142 byte_width = ACPI_DIV_8(bit_width); 142 byte_width = ACPI_DIV_8(bit_width);
143 last_address = address + byte_width - 1; 143 last_address = address + byte_width - 1;
144 144
145 ACPI_DEBUG_PRINT((ACPI_DB_IO, "Address %p LastAddress %p Length %X", 145 ACPI_DEBUG_PRINT((ACPI_DB_IO,
146 ACPI_CAST_PTR(void, address), ACPI_CAST_PTR(void, 146 "Address %8.8X%8.8X LastAddress %8.8X%8.8X Length %X",
147 last_address), 147 ACPI_FORMAT_UINT64(address),
148 byte_width)); 148 ACPI_FORMAT_UINT64(last_address), byte_width));
149 149
150 /* Maximum 16-bit address in I/O space */ 150 /* Maximum 16-bit address in I/O space */
151 151
152 if (last_address > ACPI_UINT16_MAX) { 152 if (last_address > ACPI_UINT16_MAX) {
153 ACPI_ERROR((AE_INFO, 153 ACPI_ERROR((AE_INFO,
154 "Illegal I/O port address/length above 64K: %p/0x%X", 154 "Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X",
155 ACPI_CAST_PTR(void, address), byte_width)); 155 ACPI_FORMAT_UINT64(address), byte_width));
156 return_ACPI_STATUS(AE_LIMIT); 156 return_ACPI_STATUS(AE_LIMIT);
157 } 157 }
158 158
@@ -181,8 +181,8 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
181 181
182 if (acpi_gbl_osi_data >= port_info->osi_dependency) { 182 if (acpi_gbl_osi_data >= port_info->osi_dependency) {
183 ACPI_DEBUG_PRINT((ACPI_DB_IO, 183 ACPI_DEBUG_PRINT((ACPI_DB_IO,
184 "Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)", 184 "Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)",
185 ACPI_CAST_PTR(void, address), 185 ACPI_FORMAT_UINT64(address),
186 byte_width, port_info->name, 186 byte_width, port_info->name,
187 port_info->start, 187 port_info->start,
188 port_info->end)); 188 port_info->end));
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 80f097eb7381..d259393505fa 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -271,12 +271,11 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
271 switch (type) { 271 switch (type) {
272 case ACPI_TYPE_PROCESSOR: 272 case ACPI_TYPE_PROCESSOR:
273 273
274 acpi_os_printf("ID %02X Len %02X Addr %p\n", 274 acpi_os_printf("ID %02X Len %02X Addr %8.8X%8.8X\n",
275 obj_desc->processor.proc_id, 275 obj_desc->processor.proc_id,
276 obj_desc->processor.length, 276 obj_desc->processor.length,
277 ACPI_CAST_PTR(void, 277 ACPI_FORMAT_UINT64(obj_desc->processor.
278 obj_desc->processor. 278 address));
279 address));
280 break; 279 break;
281 280
282 case ACPI_TYPE_DEVICE: 281 case ACPI_TYPE_DEVICE:
@@ -347,8 +346,9 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
347 space_id)); 346 space_id));
348 if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { 347 if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
349 acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n", 348 acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n",
350 ACPI_FORMAT_NATIVE_UINT 349 ACPI_FORMAT_UINT64(obj_desc->
351 (obj_desc->region.address), 350 region.
351 address),
352 obj_desc->region.length); 352 obj_desc->region.length);
353 } else { 353 } else {
354 acpi_os_printf 354 acpi_os_printf
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index 1af4a405e351..ed90fddf2487 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -646,7 +646,13 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
646 AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), 646 AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
647/* 80 */ ACPI_OP("-ExtAccessField-", ARGP_CONNECTFIELD_OP, 647/* 80 */ ACPI_OP("-ExtAccessField-", ARGP_CONNECTFIELD_OP,
648 ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, 648 ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY,
649 AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0) 649 AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
650
651/* ACPI 6.0 opcodes */
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)
650 656
651/*! [End] no source code translation !*/ 657/*! [End] no source code translation !*/
652}; 658};
diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c
index e18e7c47f482..20e1a35169fc 100644
--- a/drivers/acpi/acpica/psopinfo.c
+++ b/drivers/acpi/acpica/psopinfo.c
@@ -210,7 +210,7 @@ const u8 acpi_gbl_short_op_index[256] = {
210/* 8 9 A B C D E F */ 210/* 8 9 A B C D E F */
211/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK, 211/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK,
212/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK, 212/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK,
213/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK, 213/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, 0x81, _UNK, _UNK,
214/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 214/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
215/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 215/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
216/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, 216/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 1539394c8c52..c428bb33204e 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -1,6 +1,6 @@
1/******************************************************************************* 1/*******************************************************************************
2 * 2 *
3 * Module Name: rsdump - Functions to display the resource structures. 3 * Module Name: rsdump - AML debugger support for resource structures.
4 * 4 *
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
@@ -48,7 +48,10 @@
48#define _COMPONENT ACPI_RESOURCES 48#define _COMPONENT ACPI_RESOURCES
49ACPI_MODULE_NAME("rsdump") 49ACPI_MODULE_NAME("rsdump")
50 50
51#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) 51/*
52 * All functions in this module are used by the AML Debugger only
53 */
54#if defined(ACPI_DEBUGGER)
52/* Local prototypes */ 55/* Local prototypes */
53static void acpi_rs_out_string(char *title, char *value); 56static void acpi_rs_out_string(char *title, char *value);
54 57
@@ -80,6 +83,116 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table);
80 83
81/******************************************************************************* 84/*******************************************************************************
82 * 85 *
86 * FUNCTION: acpi_rs_dump_resource_list
87 *
88 * PARAMETERS: resource_list - Pointer to a resource descriptor list
89 *
90 * RETURN: None
91 *
92 * DESCRIPTION: Dispatches the structure to the correct dump routine.
93 *
94 ******************************************************************************/
95
96void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
97{
98 u32 count = 0;
99 u32 type;
100
101 ACPI_FUNCTION_ENTRY();
102
103 /* Check if debug output enabled */
104
105 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
106 return;
107 }
108
109 /* Walk list and dump all resource descriptors (END_TAG terminates) */
110
111 do {
112 acpi_os_printf("\n[%02X] ", count);
113 count++;
114
115 /* Validate Type before dispatch */
116
117 type = resource_list->type;
118 if (type > ACPI_RESOURCE_TYPE_MAX) {
119 acpi_os_printf
120 ("Invalid descriptor type (%X) in resource list\n",
121 resource_list->type);
122 return;
123 }
124
125 /* Sanity check the length. It must not be zero, or we loop forever */
126
127 if (!resource_list->length) {
128 acpi_os_printf
129 ("Invalid zero length descriptor in resource list\n");
130 return;
131 }
132
133 /* Dump the resource descriptor */
134
135 if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
136 acpi_rs_dump_descriptor(&resource_list->data,
137 acpi_gbl_dump_serial_bus_dispatch
138 [resource_list->data.
139 common_serial_bus.type]);
140 } else {
141 acpi_rs_dump_descriptor(&resource_list->data,
142 acpi_gbl_dump_resource_dispatch
143 [type]);
144 }
145
146 /* Point to the next resource structure */
147
148 resource_list = ACPI_NEXT_RESOURCE(resource_list);
149
150 /* Exit when END_TAG descriptor is reached */
151
152 } while (type != ACPI_RESOURCE_TYPE_END_TAG);
153}
154
155/*******************************************************************************
156 *
157 * FUNCTION: acpi_rs_dump_irq_list
158 *
159 * PARAMETERS: route_table - Pointer to the routing table to dump.
160 *
161 * RETURN: None
162 *
163 * DESCRIPTION: Print IRQ routing table
164 *
165 ******************************************************************************/
166
167void acpi_rs_dump_irq_list(u8 *route_table)
168{
169 struct acpi_pci_routing_table *prt_element;
170 u8 count;
171
172 ACPI_FUNCTION_ENTRY();
173
174 /* Check if debug output enabled */
175
176 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
177 return;
178 }
179
180 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table);
181
182 /* Dump all table elements, Exit on zero length element */
183
184 for (count = 0; prt_element->length; count++) {
185 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
186 count);
187 acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
188
189 prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table,
190 prt_element, prt_element->length);
191 }
192}
193
194/*******************************************************************************
195 *
83 * FUNCTION: acpi_rs_dump_descriptor 196 * FUNCTION: acpi_rs_dump_descriptor
84 * 197 *
85 * PARAMETERS: resource - Buffer containing the resource 198 * PARAMETERS: resource - Buffer containing the resource
@@ -357,116 +470,6 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
357 470
358/******************************************************************************* 471/*******************************************************************************
359 * 472 *
360 * FUNCTION: acpi_rs_dump_resource_list
361 *
362 * PARAMETERS: resource_list - Pointer to a resource descriptor list
363 *
364 * RETURN: None
365 *
366 * DESCRIPTION: Dispatches the structure to the correct dump routine.
367 *
368 ******************************************************************************/
369
370void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
371{
372 u32 count = 0;
373 u32 type;
374
375 ACPI_FUNCTION_ENTRY();
376
377 /* Check if debug output enabled */
378
379 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
380 return;
381 }
382
383 /* Walk list and dump all resource descriptors (END_TAG terminates) */
384
385 do {
386 acpi_os_printf("\n[%02X] ", count);
387 count++;
388
389 /* Validate Type before dispatch */
390
391 type = resource_list->type;
392 if (type > ACPI_RESOURCE_TYPE_MAX) {
393 acpi_os_printf
394 ("Invalid descriptor type (%X) in resource list\n",
395 resource_list->type);
396 return;
397 }
398
399 /* Sanity check the length. It must not be zero, or we loop forever */
400
401 if (!resource_list->length) {
402 acpi_os_printf
403 ("Invalid zero length descriptor in resource list\n");
404 return;
405 }
406
407 /* Dump the resource descriptor */
408
409 if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
410 acpi_rs_dump_descriptor(&resource_list->data,
411 acpi_gbl_dump_serial_bus_dispatch
412 [resource_list->data.
413 common_serial_bus.type]);
414 } else {
415 acpi_rs_dump_descriptor(&resource_list->data,
416 acpi_gbl_dump_resource_dispatch
417 [type]);
418 }
419
420 /* Point to the next resource structure */
421
422 resource_list = ACPI_NEXT_RESOURCE(resource_list);
423
424 /* Exit when END_TAG descriptor is reached */
425
426 } while (type != ACPI_RESOURCE_TYPE_END_TAG);
427}
428
429/*******************************************************************************
430 *
431 * FUNCTION: acpi_rs_dump_irq_list
432 *
433 * PARAMETERS: route_table - Pointer to the routing table to dump.
434 *
435 * RETURN: None
436 *
437 * DESCRIPTION: Print IRQ routing table
438 *
439 ******************************************************************************/
440
441void acpi_rs_dump_irq_list(u8 * route_table)
442{
443 struct acpi_pci_routing_table *prt_element;
444 u8 count;
445
446 ACPI_FUNCTION_ENTRY();
447
448 /* Check if debug output enabled */
449
450 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
451 return;
452 }
453
454 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table);
455
456 /* Dump all table elements, Exit on zero length element */
457
458 for (count = 0; prt_element->length; count++) {
459 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
460 count);
461 acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
462
463 prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table,
464 prt_element, prt_element->length);
465 }
466}
467
468/*******************************************************************************
469 *
470 * FUNCTION: acpi_rs_out* 473 * FUNCTION: acpi_rs_out*
471 * 474 *
472 * PARAMETERS: title - Name of the resource field 475 * PARAMETERS: title - Name of the resource field
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 6a144957aadd..d7f8386455bd 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -113,9 +113,9 @@ acpi_tb_acquire_table(struct acpi_table_desc *table_desc,
113 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: 113 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
114 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: 114 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
115 115
116 table = 116 table = ACPI_CAST_PTR(struct acpi_table_header,
117 ACPI_CAST_PTR(struct acpi_table_header, 117 ACPI_PHYSADDR_TO_PTR(table_desc->
118 table_desc->address); 118 address));
119 break; 119 break;
120 120
121 default: 121 default:
@@ -214,7 +214,8 @@ acpi_tb_acquire_temp_table(struct acpi_table_desc *table_desc,
214 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: 214 case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
215 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: 215 case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
216 216
217 table_header = ACPI_CAST_PTR(struct acpi_table_header, address); 217 table_header = ACPI_CAST_PTR(struct acpi_table_header,
218 ACPI_PHYSADDR_TO_PTR(address));
218 if (!table_header) { 219 if (!table_header) {
219 return (AE_NO_MEMORY); 220 return (AE_NO_MEMORY);
220 } 221 }
@@ -398,14 +399,14 @@ acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature)
398 table_desc->length); 399 table_desc->length);
399 if (ACPI_FAILURE(status)) { 400 if (ACPI_FAILURE(status)) {
400 ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY, 401 ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY,
401 "%4.4s " ACPI_PRINTF_UINT 402 "%4.4s 0x%8.8X%8.8X"
402 " Attempted table install failed", 403 " Attempted table install failed",
403 acpi_ut_valid_acpi_name(table_desc-> 404 acpi_ut_valid_acpi_name(table_desc->
404 signature. 405 signature.
405 ascii) ? 406 ascii) ?
406 table_desc->signature.ascii : "????", 407 table_desc->signature.ascii : "????",
407 ACPI_FORMAT_TO_UINT(table_desc-> 408 ACPI_FORMAT_UINT64(table_desc->
408 address))); 409 address)));
409 goto invalidate_and_exit; 410 goto invalidate_and_exit;
410 } 411 }
411 } 412 }
@@ -483,19 +484,23 @@ acpi_status acpi_tb_resize_root_table_list(void)
483 484
484/******************************************************************************* 485/*******************************************************************************
485 * 486 *
486 * FUNCTION: acpi_tb_get_next_root_index 487 * FUNCTION: acpi_tb_get_next_table_descriptor
487 * 488 *
488 * PARAMETERS: table_index - Where table index is returned 489 * PARAMETERS: table_index - Where table index is returned
490 * table_desc - Where table descriptor is returned
489 * 491 *
490 * RETURN: Status and table index. 492 * RETURN: Status and table index/descriptor.
491 * 493 *
492 * DESCRIPTION: Allocate a new ACPI table entry to the global table list 494 * DESCRIPTION: Allocate a new ACPI table entry to the global table list
493 * 495 *
494 ******************************************************************************/ 496 ******************************************************************************/
495 497
496acpi_status acpi_tb_get_next_root_index(u32 *table_index) 498acpi_status
499acpi_tb_get_next_table_descriptor(u32 *table_index,
500 struct acpi_table_desc **table_desc)
497{ 501{
498 acpi_status status; 502 acpi_status status;
503 u32 i;
499 504
500 /* Ensure that there is room for the table in the Root Table List */ 505 /* Ensure that there is room for the table in the Root Table List */
501 506
@@ -507,8 +512,16 @@ acpi_status acpi_tb_get_next_root_index(u32 *table_index)
507 } 512 }
508 } 513 }
509 514
510 *table_index = acpi_gbl_root_table_list.current_table_count; 515 i = acpi_gbl_root_table_list.current_table_count;
511 acpi_gbl_root_table_list.current_table_count++; 516 acpi_gbl_root_table_list.current_table_count++;
517
518 if (table_index) {
519 *table_index = i;
520 }
521 if (table_desc) {
522 *table_desc = &acpi_gbl_root_table_list.tables[i];
523 }
524
512 return (AE_OK); 525 return (AE_OK);
513} 526}
514 527
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 9bad45e63a45..008a251780f4 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -187,8 +187,9 @@ acpi_tb_install_fixed_table(acpi_physical_address address,
187 status = acpi_tb_acquire_temp_table(&new_table_desc, address, 187 status = acpi_tb_acquire_temp_table(&new_table_desc, address,
188 ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL); 188 ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
189 if (ACPI_FAILURE(status)) { 189 if (ACPI_FAILURE(status)) {
190 ACPI_ERROR((AE_INFO, "Could not acquire table length at %p", 190 ACPI_ERROR((AE_INFO,
191 ACPI_CAST_PTR(void, address))); 191 "Could not acquire table length at %8.8X%8.8X",
192 ACPI_FORMAT_UINT64(address)));
192 return_ACPI_STATUS(status); 193 return_ACPI_STATUS(status);
193 } 194 }
194 195
@@ -246,8 +247,9 @@ acpi_tb_install_standard_table(acpi_physical_address address,
246 247
247 status = acpi_tb_acquire_temp_table(&new_table_desc, address, flags); 248 status = acpi_tb_acquire_temp_table(&new_table_desc, address, flags);
248 if (ACPI_FAILURE(status)) { 249 if (ACPI_FAILURE(status)) {
249 ACPI_ERROR((AE_INFO, "Could not acquire table length at %p", 250 ACPI_ERROR((AE_INFO,
250 ACPI_CAST_PTR(void, address))); 251 "Could not acquire table length at %8.8X%8.8X",
252 ACPI_FORMAT_UINT64(address)));
251 return_ACPI_STATUS(status); 253 return_ACPI_STATUS(status);
252 } 254 }
253 255
@@ -258,9 +260,10 @@ acpi_tb_install_standard_table(acpi_physical_address address,
258 if (!reload && 260 if (!reload &&
259 acpi_gbl_disable_ssdt_table_install && 261 acpi_gbl_disable_ssdt_table_install &&
260 ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) { 262 ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) {
261 ACPI_INFO((AE_INFO, "Ignoring installation of %4.4s at %p", 263 ACPI_INFO((AE_INFO,
262 new_table_desc.signature.ascii, ACPI_CAST_PTR(void, 264 "Ignoring installation of %4.4s at %8.8X%8.8X",
263 address))); 265 new_table_desc.signature.ascii,
266 ACPI_FORMAT_UINT64(address)));
264 goto release_and_exit; 267 goto release_and_exit;
265 } 268 }
266 269
@@ -346,7 +349,6 @@ acpi_tb_install_standard_table(acpi_physical_address address,
346 */ 349 */
347 acpi_tb_uninstall_table(&new_table_desc); 350 acpi_tb_uninstall_table(&new_table_desc);
348 *table_index = i; 351 *table_index = i;
349 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
350 return_ACPI_STATUS(AE_OK); 352 return_ACPI_STATUS(AE_OK);
351 } 353 }
352 } 354 }
@@ -354,7 +356,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,
354 356
355 /* Add the table to the global root table list */ 357 /* Add the table to the global root table list */
356 358
357 status = acpi_tb_get_next_root_index(&i); 359 status = acpi_tb_get_next_table_descriptor(&i, NULL);
358 if (ACPI_FAILURE(status)) { 360 if (ACPI_FAILURE(status)) {
359 goto release_and_exit; 361 goto release_and_exit;
360 } 362 }
@@ -429,11 +431,11 @@ finish_override:
429 return; 431 return;
430 } 432 }
431 433
432 ACPI_INFO((AE_INFO, "%4.4s " ACPI_PRINTF_UINT 434 ACPI_INFO((AE_INFO, "%4.4s 0x%8.8X%8.8X"
433 " %s table override, new table: " ACPI_PRINTF_UINT, 435 " %s table override, new table: 0x%8.8X%8.8X",
434 old_table_desc->signature.ascii, 436 old_table_desc->signature.ascii,
435 ACPI_FORMAT_TO_UINT(old_table_desc->address), 437 ACPI_FORMAT_UINT64(old_table_desc->address),
436 override_type, ACPI_FORMAT_TO_UINT(new_table_desc.address))); 438 override_type, ACPI_FORMAT_UINT64(new_table_desc.address)));
437 439
438 /* We can now uninstall the original table */ 440 /* We can now uninstall the original table */
439 441
@@ -455,43 +457,6 @@ finish_override:
455 457
456/******************************************************************************* 458/*******************************************************************************
457 * 459 *
458 * FUNCTION: acpi_tb_store_table
459 *
460 * PARAMETERS: address - Table address
461 * table - Table header
462 * length - Table length
463 * flags - Install flags
464 * table_index - Where the table index is returned
465 *
466 * RETURN: Status and table index.
467 *
468 * DESCRIPTION: Add an ACPI table to the global table list
469 *
470 ******************************************************************************/
471
472acpi_status
473acpi_tb_store_table(acpi_physical_address address,
474 struct acpi_table_header * table,
475 u32 length, u8 flags, u32 *table_index)
476{
477 acpi_status status;
478 struct acpi_table_desc *table_desc;
479
480 status = acpi_tb_get_next_root_index(table_index);
481 if (ACPI_FAILURE(status)) {
482 return (status);
483 }
484
485 /* Initialize added table */
486
487 table_desc = &acpi_gbl_root_table_list.tables[*table_index];
488 acpi_tb_init_table_descriptor(table_desc, address, flags, table);
489 table_desc->pointer = table;
490 return (AE_OK);
491}
492
493/*******************************************************************************
494 *
495 * FUNCTION: acpi_tb_uninstall_table 460 * FUNCTION: acpi_tb_uninstall_table
496 * 461 *
497 * PARAMETERS: table_desc - Table descriptor 462 * PARAMETERS: table_desc - Table descriptor
@@ -517,7 +482,7 @@ void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc)
517 482
518 if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) == 483 if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) ==
519 ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL) { 484 ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL) {
520 ACPI_FREE(ACPI_CAST_PTR(void, table_desc->address)); 485 ACPI_FREE(ACPI_PHYSADDR_TO_PTR(table_desc->address));
521 } 486 }
522 487
523 table_desc->address = ACPI_PTR_TO_PHYSADDR(NULL); 488 table_desc->address = ACPI_PTR_TO_PHYSADDR(NULL);
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index ef16c06e5091..77ba5c71c6e7 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -127,18 +127,12 @@ acpi_tb_print_table_header(acpi_physical_address address,
127{ 127{
128 struct acpi_table_header local_header; 128 struct acpi_table_header local_header;
129 129
130 /*
131 * The reason that we use ACPI_PRINTF_UINT and ACPI_FORMAT_TO_UINT is to
132 * support both 32-bit and 64-bit hosts/addresses in a consistent manner.
133 * The %p specifier does not emit uniform output on all hosts. On some,
134 * leading zeros are not supported.
135 */
136 if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) { 130 if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_FACS)) {
137 131
138 /* FACS only has signature and length fields */ 132 /* FACS only has signature and length fields */
139 133
140 ACPI_INFO((AE_INFO, "%-4.4s " ACPI_PRINTF_UINT " %06X", 134 ACPI_INFO((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
141 header->signature, ACPI_FORMAT_TO_UINT(address), 135 header->signature, ACPI_FORMAT_UINT64(address),
142 header->length)); 136 header->length));
143 } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) { 137 } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
144 138
@@ -149,9 +143,8 @@ acpi_tb_print_table_header(acpi_physical_address address,
149 header)->oem_id, ACPI_OEM_ID_SIZE); 143 header)->oem_id, ACPI_OEM_ID_SIZE);
150 acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE); 144 acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE);
151 145
152 ACPI_INFO((AE_INFO, 146 ACPI_INFO((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
153 "RSDP " ACPI_PRINTF_UINT " %06X (v%.2d %-6.6s)", 147 ACPI_FORMAT_UINT64(address),
154 ACPI_FORMAT_TO_UINT(address),
155 (ACPI_CAST_PTR(struct acpi_table_rsdp, header)-> 148 (ACPI_CAST_PTR(struct acpi_table_rsdp, header)->
156 revision > 149 revision >
157 0) ? ACPI_CAST_PTR(struct acpi_table_rsdp, 150 0) ? ACPI_CAST_PTR(struct acpi_table_rsdp,
@@ -165,9 +158,9 @@ acpi_tb_print_table_header(acpi_physical_address address,
165 acpi_tb_cleanup_table_header(&local_header, header); 158 acpi_tb_cleanup_table_header(&local_header, header);
166 159
167 ACPI_INFO((AE_INFO, 160 ACPI_INFO((AE_INFO,
168 "%-4.4s " ACPI_PRINTF_UINT 161 "%-4.4s 0x%8.8X%8.8X"
169 " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)", 162 " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
170 local_header.signature, ACPI_FORMAT_TO_UINT(address), 163 local_header.signature, ACPI_FORMAT_UINT64(address),
171 local_header.length, local_header.revision, 164 local_header.length, local_header.revision,
172 local_header.oem_id, local_header.oem_table_id, 165 local_header.oem_id, local_header.oem_table_id,
173 local_header.oem_revision, 166 local_header.oem_revision,
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index eac52cf14f1a..fa76a3603aa1 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -142,7 +142,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp * rsdp)
142 * 142 *
143 ******************************************************************************/ 143 ******************************************************************************/
144 144
145acpi_status __init acpi_find_root_pointer(acpi_size *table_address) 145acpi_status __init acpi_find_root_pointer(acpi_physical_address * table_address)
146{ 146{
147 u8 *table_ptr; 147 u8 *table_ptr;
148 u8 *mem_rover; 148 u8 *mem_rover;
@@ -200,7 +200,8 @@ acpi_status __init acpi_find_root_pointer(acpi_size *table_address)
200 physical_address += 200 physical_address +=
201 (u32) ACPI_PTR_DIFF(mem_rover, table_ptr); 201 (u32) ACPI_PTR_DIFF(mem_rover, table_ptr);
202 202
203 *table_address = physical_address; 203 *table_address =
204 (acpi_physical_address) physical_address;
204 return_ACPI_STATUS(AE_OK); 205 return_ACPI_STATUS(AE_OK);
205 } 206 }
206 } 207 }
@@ -233,7 +234,7 @@ acpi_status __init acpi_find_root_pointer(acpi_size *table_address)
233 (ACPI_HI_RSDP_WINDOW_BASE + 234 (ACPI_HI_RSDP_WINDOW_BASE +
234 ACPI_PTR_DIFF(mem_rover, table_ptr)); 235 ACPI_PTR_DIFF(mem_rover, table_ptr));
235 236
236 *table_address = physical_address; 237 *table_address = (acpi_physical_address) physical_address;
237 return_ACPI_STATUS(AE_OK); 238 return_ACPI_STATUS(AE_OK);
238 } 239 }
239 240
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c
index 1279f50da757..911ea8e7fe87 100644
--- a/drivers/acpi/acpica/utaddress.c
+++ b/drivers/acpi/acpica/utaddress.c
@@ -107,10 +107,10 @@ acpi_ut_add_address_range(acpi_adr_space_type space_id,
107 acpi_gbl_address_range_list[space_id] = range_info; 107 acpi_gbl_address_range_list[space_id] = range_info;
108 108
109 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 109 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
110 "\nAdded [%4.4s] address range: 0x%p-0x%p\n", 110 "\nAdded [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
111 acpi_ut_get_node_name(range_info->region_node), 111 acpi_ut_get_node_name(range_info->region_node),
112 ACPI_CAST_PTR(void, address), 112 ACPI_FORMAT_UINT64(address),
113 ACPI_CAST_PTR(void, range_info->end_address))); 113 ACPI_FORMAT_UINT64(range_info->end_address)));
114 114
115 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 115 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
116 return_ACPI_STATUS(AE_OK); 116 return_ACPI_STATUS(AE_OK);
@@ -160,15 +160,13 @@ acpi_ut_remove_address_range(acpi_adr_space_type space_id,
160 } 160 }
161 161
162 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 162 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
163 "\nRemoved [%4.4s] address range: 0x%p-0x%p\n", 163 "\nRemoved [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
164 acpi_ut_get_node_name(range_info-> 164 acpi_ut_get_node_name(range_info->
165 region_node), 165 region_node),
166 ACPI_CAST_PTR(void, 166 ACPI_FORMAT_UINT64(range_info->
167 range_info-> 167 start_address),
168 start_address), 168 ACPI_FORMAT_UINT64(range_info->
169 ACPI_CAST_PTR(void, 169 end_address)));
170 range_info->
171 end_address)));
172 170
173 ACPI_FREE(range_info); 171 ACPI_FREE(range_info);
174 return_VOID; 172 return_VOID;
@@ -245,16 +243,14 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
245 region_node); 243 region_node);
246 244
247 ACPI_WARNING((AE_INFO, 245 ACPI_WARNING((AE_INFO,
248 "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)", 246 "%s range 0x%8.8X%8.8X-0x%8.8X%8.8X conflicts with OpRegion 0x%8.8X%8.8X-0x%8.8X%8.8X (%s)",
249 acpi_ut_get_region_name(space_id), 247 acpi_ut_get_region_name(space_id),
250 ACPI_CAST_PTR(void, address), 248 ACPI_FORMAT_UINT64(address),
251 ACPI_CAST_PTR(void, end_address), 249 ACPI_FORMAT_UINT64(end_address),
252 ACPI_CAST_PTR(void, 250 ACPI_FORMAT_UINT64(range_info->
253 range_info-> 251 start_address),
254 start_address), 252 ACPI_FORMAT_UINT64(range_info->
255 ACPI_CAST_PTR(void, 253 end_address),
256 range_info->
257 end_address),
258 pathname)); 254 pathname));
259 ACPI_FREE(pathname); 255 ACPI_FREE(pathname);
260 } 256 }
diff --git a/drivers/acpi/acpica/utbuffer.c b/drivers/acpi/acpica/utbuffer.c
index 242bd071f007..a8c39643e618 100644
--- a/drivers/acpi/acpica/utbuffer.c
+++ b/drivers/acpi/acpica/utbuffer.c
@@ -150,6 +150,14 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
150 return; 150 return;
151 } 151 }
152 152
153 /*
154 * Add comment characters so rest of line is ignored when
155 * compiled
156 */
157 if (j == 0) {
158 acpi_os_printf("// ");
159 }
160
153 buf_char = buffer[(acpi_size) i + j]; 161 buf_char = buffer[(acpi_size) i + j];
154 if (ACPI_IS_PRINT(buf_char)) { 162 if (ACPI_IS_PRINT(buf_char)) {
155 acpi_os_printf("%c", buf_char); 163 acpi_os_printf("%c", buf_char);
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 5e8df9177da4..a72685c1e819 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -102,12 +102,19 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {
102 {"_SB_", ACPI_TYPE_DEVICE, NULL}, 102 {"_SB_", ACPI_TYPE_DEVICE, NULL},
103 {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 103 {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
104 {"_TZ_", ACPI_TYPE_DEVICE, NULL}, 104 {"_TZ_", ACPI_TYPE_DEVICE, NULL},
105 {"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL}, 105 /*
106 * March, 2015:
107 * The _REV object is in the process of being deprecated, because
108 * other ACPI implementations permanently return 2. Thus, it
109 * has little or no value. Return 2 for compatibility with
110 * other ACPI implementations.
111 */
112 {"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR(char, 2)},
106 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 113 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
107 {"_GL_", ACPI_TYPE_MUTEX, (char *)1}, 114 {"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR(char, 1)},
108 115
109#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 116#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
110 {"_OSI", ACPI_TYPE_METHOD, (char *)1}, 117 {"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR(char, 1)},
111#endif 118#endif
112 119
113 /* Table terminator */ 120 /* Table terminator */
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index 56bbacd576f2..cbb7034d28d8 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -75,6 +75,7 @@ u8 acpi_ut_is_pci_root_bridge(char *id)
75 return (FALSE); 75 return (FALSE);
76} 76}
77 77
78#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
78/******************************************************************************* 79/*******************************************************************************
79 * 80 *
80 * FUNCTION: acpi_ut_is_aml_table 81 * FUNCTION: acpi_ut_is_aml_table
@@ -102,6 +103,7 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
102 103
103 return (FALSE); 104 return (FALSE);
104} 105}
106#endif
105 107
106/******************************************************************************* 108/*******************************************************************************
107 * 109 *
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c
index 574cd3118313..44035abdbf29 100644
--- a/drivers/acpi/acpica/utosi.c
+++ b/drivers/acpi/acpica/utosi.c
@@ -100,6 +100,7 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = {
100 {"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ 100 {"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
101 {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */ 101 {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
102 {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */ 102 {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
103 {"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */
103 104
104 /* Feature Group Strings */ 105 /* Feature Group Strings */
105 106
diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c
index 82ca9142e10d..2be6bd4bdc09 100644
--- a/drivers/acpi/acpica/utprint.c
+++ b/drivers/acpi/acpica/utprint.c
@@ -357,11 +357,11 @@ int
357acpi_ut_vsnprintf(char *string, 357acpi_ut_vsnprintf(char *string,
358 acpi_size size, const char *format, va_list args) 358 acpi_size size, const char *format, va_list args)
359{ 359{
360 u8 base = 10; 360 u8 base;
361 u8 type = 0; 361 u8 type;
362 s32 width = -1; 362 s32 width;
363 s32 precision = -1; 363 s32 precision;
364 char qualifier = 0; 364 char qualifier;
365 u64 number; 365 u64 number;
366 char *pos; 366 char *pos;
367 char *end; 367 char *end;
@@ -380,6 +380,9 @@ acpi_ut_vsnprintf(char *string,
380 continue; 380 continue;
381 } 381 }
382 382
383 type = 0;
384 base = 10;
385
383 /* Process sign */ 386 /* Process sign */
384 387
385 do { 388 do {
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c
index 8274cc16edc3..f201171c5dda 100644
--- a/drivers/acpi/acpica/utstate.c
+++ b/drivers/acpi/acpica/utstate.c
@@ -49,39 +49,6 @@ ACPI_MODULE_NAME("utstate")
49 49
50/******************************************************************************* 50/*******************************************************************************
51 * 51 *
52 * FUNCTION: acpi_ut_create_pkg_state_and_push
53 *
54 * PARAMETERS: object - Object to be added to the new state
55 * action - Increment/Decrement
56 * state_list - List the state will be added to
57 *
58 * RETURN: Status
59 *
60 * DESCRIPTION: Create a new state and push it
61 *
62 ******************************************************************************/
63acpi_status
64acpi_ut_create_pkg_state_and_push(void *internal_object,
65 void *external_object,
66 u16 index,
67 union acpi_generic_state **state_list)
68{
69 union acpi_generic_state *state;
70
71 ACPI_FUNCTION_ENTRY();
72
73 state =
74 acpi_ut_create_pkg_state(internal_object, external_object, index);
75 if (!state) {
76 return (AE_NO_MEMORY);
77 }
78
79 acpi_ut_push_generic_state(state_list, state);
80 return (AE_OK);
81}
82
83/*******************************************************************************
84 *
85 * FUNCTION: acpi_ut_push_generic_state 52 * FUNCTION: acpi_ut_push_generic_state
86 * 53 *
87 * PARAMETERS: list_head - Head of the state stack 54 * PARAMETERS: list_head - Head of the state stack
@@ -92,7 +59,6 @@ acpi_ut_create_pkg_state_and_push(void *internal_object,
92 * DESCRIPTION: Push a state object onto a state stack 59 * DESCRIPTION: Push a state object onto a state stack
93 * 60 *
94 ******************************************************************************/ 61 ******************************************************************************/
95
96void 62void
97acpi_ut_push_generic_state(union acpi_generic_state **list_head, 63acpi_ut_push_generic_state(union acpi_generic_state **list_head,
98 union acpi_generic_state *state) 64 union acpi_generic_state *state)
diff --git a/drivers/acpi/acpica/utuuid.c b/drivers/acpi/acpica/utuuid.c
index c6149a212149..e6cab669bd9c 100644
--- a/drivers/acpi/acpica/utuuid.c
+++ b/drivers/acpi/acpica/utuuid.c
@@ -47,6 +47,7 @@
47#define _COMPONENT ACPI_COMPILER 47#define _COMPONENT ACPI_COMPILER
48ACPI_MODULE_NAME("utuuid") 48ACPI_MODULE_NAME("utuuid")
49 49
50#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
50/* 51/*
51 * UUID support functions. 52 * UUID support functions.
52 * 53 *
@@ -94,3 +95,4 @@ void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer)
94 1]); 95 1]);
95 } 96 }
96} 97}
98#endif
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index d56f5d722138..08ef57bc8d63 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20150204 49#define ACPI_CA_VERSION 0x20150410
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -431,13 +431,13 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void))
431ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void)) 431ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void))
432 432
433ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init 433ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
434 acpi_find_root_pointer(acpi_size * rsdp_address)) 434 acpi_find_root_pointer(acpi_physical_address *
435 435 rsdp_address))
436ACPI_EXTERNAL_RETURN_STATUS(acpi_status 436ACPI_EXTERNAL_RETURN_STATUS(acpi_status
437 acpi_get_table_header(acpi_string signature, 437 acpi_get_table_header(acpi_string signature,
438 u32 instance, 438 u32 instance,
439 struct acpi_table_header 439 struct acpi_table_header
440 *out_table_header)) 440 *out_table_header))
441ACPI_EXTERNAL_RETURN_STATUS(acpi_status 441ACPI_EXTERNAL_RETURN_STATUS(acpi_status
442 acpi_get_table(acpi_string signature, u32 instance, 442 acpi_get_table(acpi_string signature, u32 instance,
443 struct acpi_table_header 443 struct acpi_table_header
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index f06d75e5fa54..cafdeb50fbdf 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -73,6 +73,7 @@
73#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */ 73#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
74#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ 74#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
75#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ 75#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
76#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
76#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */ 77#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
77#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ 78#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
78#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ 79#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
@@ -845,7 +846,8 @@ struct acpi_lpit_header {
845 846
846enum acpi_lpit_type { 847enum acpi_lpit_type {
847 ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00, 848 ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
848 ACPI_LPIT_TYPE_SIMPLE_IO = 0x01 849 ACPI_LPIT_TYPE_SIMPLE_IO = 0x01,
850 ACPI_LPIT_TYPE_RESERVED = 0x02 /* 2 and above are reserved */
849}; 851};
850 852
851/* Masks for Flags field above */ 853/* Masks for Flags field above */
@@ -935,6 +937,21 @@ struct acpi_table_mchi {
935 937
936/******************************************************************************* 938/*******************************************************************************
937 * 939 *
940 * MSDM - Microsoft Data Management table
941 *
942 * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
943 * November 29, 2011. Copyright 2011 Microsoft
944 *
945 ******************************************************************************/
946
947/* Basic MSDM table is only the common ACPI header */
948
949struct acpi_table_msdm {
950 struct acpi_table_header header; /* Common ACPI table header */
951};
952
953/*******************************************************************************
954 *
938 * MTMR - MID Timer Table 955 * MTMR - MID Timer Table
939 * Version 1 956 * Version 1
940 * 957 *
@@ -959,10 +976,9 @@ struct acpi_mtmr_entry {
959/******************************************************************************* 976/*******************************************************************************
960 * 977 *
961 * SLIC - Software Licensing Description Table 978 * SLIC - Software Licensing Description Table
962 * Version 1
963 * 979 *
964 * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems", 980 * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
965 * Copyright 2006 981 * November 29, 2011. Copyright 2011 Microsoft
966 * 982 *
967 ******************************************************************************/ 983 ******************************************************************************/
968 984
@@ -972,52 +988,6 @@ struct acpi_table_slic {
972 struct acpi_table_header header; /* Common ACPI table header */ 988 struct acpi_table_header header; /* Common ACPI table header */
973}; 989};
974 990
975/* Common SLIC subtable header */
976
977struct acpi_slic_header {
978 u32 type;
979 u32 length;
980};
981
982/* Values for Type field above */
983
984enum acpi_slic_type {
985 ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
986 ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
987 ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
988};
989
990/*
991 * SLIC Subtables, correspond to Type in struct acpi_slic_header
992 */
993
994/* 0: Public Key Structure */
995
996struct acpi_slic_key {
997 struct acpi_slic_header header;
998 u8 key_type;
999 u8 version;
1000 u16 reserved;
1001 u32 algorithm;
1002 char magic[4];
1003 u32 bit_length;
1004 u32 exponent;
1005 u8 modulus[128];
1006};
1007
1008/* 1: Windows Marker Structure */
1009
1010struct acpi_slic_marker {
1011 struct acpi_slic_header header;
1012 u32 version;
1013 char oem_id[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
1014 char oem_table_id[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
1015 char windows_flag[8];
1016 u32 slic_version;
1017 u8 reserved[16];
1018 u8 signature[128];
1019};
1020
1021/******************************************************************************* 991/*******************************************************************************
1022 * 992 *
1023 * SPCR - Serial Port Console Redirection table 993 * SPCR - Serial Port Console Redirection table
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index b034f1068dfe..f5ca0e989bba 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -199,9 +199,29 @@ typedef int s32;
199typedef s32 acpi_native_int; 199typedef s32 acpi_native_int;
200 200
201typedef u32 acpi_size; 201typedef u32 acpi_size;
202
203#ifdef ACPI_32BIT_PHYSICAL_ADDRESS
204
205/*
206 * OSPMs can define this to shrink the size of the structures for 32-bit
207 * none PAE environment. ASL compiler may always define this to generate
208 * 32-bit OSPM compliant tables.
209 */
202typedef u32 acpi_io_address; 210typedef u32 acpi_io_address;
203typedef u32 acpi_physical_address; 211typedef u32 acpi_physical_address;
204 212
213#else /* ACPI_32BIT_PHYSICAL_ADDRESS */
214
215/*
216 * It is reported that, after some calculations, the physical addresses can
217 * wrap over the 32-bit boundary on 32-bit PAE environment.
218 * https://bugzilla.kernel.org/show_bug.cgi?id=87971
219 */
220typedef u64 acpi_io_address;
221typedef u64 acpi_physical_address;
222
223#endif /* ACPI_32BIT_PHYSICAL_ADDRESS */
224
205#define ACPI_MAX_PTR ACPI_UINT32_MAX 225#define ACPI_MAX_PTR ACPI_UINT32_MAX
206#define ACPI_SIZE_MAX ACPI_UINT32_MAX 226#define ACPI_SIZE_MAX ACPI_UINT32_MAX
207 227
@@ -713,33 +733,32 @@ typedef u32 acpi_event_type;
713 * The encoding of acpi_event_status is illustrated below. 733 * The encoding of acpi_event_status is illustrated below.
714 * Note that a set bit (1) indicates the property is TRUE 734 * Note that a set bit (1) indicates the property is TRUE
715 * (e.g. if bit 0 is set then the event is enabled). 735 * (e.g. if bit 0 is set then the event is enabled).
716 * +-------------+-+-+-+-+ 736 * +-------------+-+-+-+-+-+
717 * | Bits 31:4 |3|2|1|0| 737 * | Bits 31:5 |4|3|2|1|0|
718 * +-------------+-+-+-+-+ 738 * +-------------+-+-+-+-+-+
719 * | | | | | 739 * | | | | | |
720 * | | | | +- Enabled? 740 * | | | | | +- Enabled?
721 * | | | +--- Enabled for wake? 741 * | | | | +--- Enabled for wake?
722 * | | +----- Set? 742 * | | | +----- Status bit set?
723 * | +------- Has a handler? 743 * | | +------- Enable bit set?
724 * +------------- <Reserved> 744 * | +--------- Has a handler?
745 * +--------------- <Reserved>
725 */ 746 */
726typedef u32 acpi_event_status; 747typedef u32 acpi_event_status;
727 748
728#define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00 749#define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00
729#define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 750#define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01
730#define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02 751#define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02
731#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04 752#define ACPI_EVENT_FLAG_STATUS_SET (acpi_event_status) 0x04
732#define ACPI_EVENT_FLAG_HAS_HANDLER (acpi_event_status) 0x08 753#define ACPI_EVENT_FLAG_ENABLE_SET (acpi_event_status) 0x08
754#define ACPI_EVENT_FLAG_HAS_HANDLER (acpi_event_status) 0x10
755#define ACPI_EVENT_FLAG_SET ACPI_EVENT_FLAG_STATUS_SET
733 756
734/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ 757/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */
735 758
736#define ACPI_GPE_ENABLE 0 759#define ACPI_GPE_ENABLE 0
737#define ACPI_GPE_DISABLE 1 760#define ACPI_GPE_DISABLE 1
738#define ACPI_GPE_CONDITIONAL_ENABLE 2 761#define ACPI_GPE_CONDITIONAL_ENABLE 2
739#define ACPI_GPE_SAVE_MASK 4
740
741#define ACPI_GPE_ENABLE_SAVE (ACPI_GPE_ENABLE | ACPI_GPE_SAVE_MASK)
742#define ACPI_GPE_DISABLE_SAVE (ACPI_GPE_DISABLE | ACPI_GPE_SAVE_MASK)
743 762
744/* 763/*
745 * GPE info flags - Per GPE 764 * GPE info flags - Per GPE
@@ -1251,6 +1270,7 @@ struct acpi_memory_list {
1251#define ACPI_OSI_WIN_VISTA_SP2 0x0A 1270#define ACPI_OSI_WIN_VISTA_SP2 0x0A
1252#define ACPI_OSI_WIN_7 0x0B 1271#define ACPI_OSI_WIN_7 0x0B
1253#define ACPI_OSI_WIN_8 0x0C 1272#define ACPI_OSI_WIN_8 0x0C
1273#define ACPI_OSI_WIN_10 0x0D
1254 1274
1255/* Definitions of file IO */ 1275/* Definitions of file IO */
1256 1276
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index ad74dc51d5b7..ecdf9405dd3a 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -76,6 +76,7 @@
76#define ACPI_LARGE_NAMESPACE_NODE 76#define ACPI_LARGE_NAMESPACE_NODE
77#define ACPI_DATA_TABLE_DISASSEMBLY 77#define ACPI_DATA_TABLE_DISASSEMBLY
78#define ACPI_SINGLE_THREADED 78#define ACPI_SINGLE_THREADED
79#define ACPI_32BIT_PHYSICAL_ADDRESS
79#endif 80#endif
80 81
81/* acpi_exec configuration. Multithreaded with full AML debugger */ 82/* acpi_exec configuration. Multithreaded with full AML debugger */
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
index 92f1fd700344..db15c9d2049e 100644
--- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
+++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
@@ -1156,7 +1156,7 @@ osl_table_name_from_file(char *filename, char *signature, u32 *instance)
1156 /* Extract instance number */ 1156 /* Extract instance number */
1157 1157
1158 if (isdigit((int)filename[ACPI_NAME_SIZE])) { 1158 if (isdigit((int)filename[ACPI_NAME_SIZE])) {
1159 sscanf(&filename[ACPI_NAME_SIZE], "%d", instance); 1159 sscanf(&filename[ACPI_NAME_SIZE], "%u", instance);
1160 } else if (strlen(filename) != ACPI_NAME_SIZE) { 1160 } else if (strlen(filename) != ACPI_NAME_SIZE) {
1161 return (AE_BAD_SIGNATURE); 1161 return (AE_BAD_SIGNATURE);
1162 } else { 1162 } else {
diff --git a/tools/power/acpi/os_specific/service_layers/osunixmap.c b/tools/power/acpi/os_specific/service_layers/osunixmap.c
index 3853a7350440..0b1fa290245a 100644
--- a/tools/power/acpi/os_specific/service_layers/osunixmap.c
+++ b/tools/power/acpi/os_specific/service_layers/osunixmap.c
@@ -146,6 +146,6 @@ void acpi_os_unmap_memory(void *where, acpi_size length)
146 acpi_size page_size; 146 acpi_size page_size;
147 147
148 page_size = acpi_os_get_page_size(); 148 page_size = acpi_os_get_page_size();
149 offset = (acpi_physical_address) where % page_size; 149 offset = ACPI_TO_INTEGER(where) % page_size;
150 munmap((u8 *)where - offset, (length + offset)); 150 munmap((u8 *)where - offset, (length + offset));
151} 151}