summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2017-04-27 20:53:22 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-04-28 15:56:10 -0400
commit9cf7adeca1f307b578021f227119495eecb1a510 (patch)
tree10b5645fd82f757d193ac5ff92d0225a644c52f7
parentc8e8ab1e4c1e0879f21e39504bf7fc01c0b5865f (diff)
ACPICA: iasl: add ASL conversion tool
ACPICA commit c04d310039d3e0ed1cb62876fe7e596fbc75ab01 ACPICA commit a65c1df7e6b4bad8e37df822018c40c6c446add9 The key feature of this utility is that the original comments within the input ASL files are preserved during the conversion process, and included within the converted ASL+ file -- thus creating a transparent conversion of existing ASL files to ASL+ (ASL 2.0) This patch is an automatic generation of the ASL converter commit, Linux kernel isn't affected by the functionality provided in this commit, but requires the linuxized changes to support future ACPICA release automation. Link: https://github.com/acpica/acpica/commit/c04d3100 Link: https://github.com/acpica/acpica/commit/a65c1df7 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/acconvert.h144
-rw-r--r--drivers/acpi/acpica/acglobal.h53
-rw-r--r--drivers/acpi/acpica/aclocal.h99
-rw-r--r--drivers/acpi/acpica/acmacros.h35
-rw-r--r--drivers/acpi/acpica/acopcode.h2
-rw-r--r--drivers/acpi/acpica/amlcode.h4
-rw-r--r--drivers/acpi/acpica/psargs.c23
-rw-r--r--drivers/acpi/acpica/psloop.c32
-rw-r--r--drivers/acpi/acpica/psobject.c38
-rw-r--r--drivers/acpi/acpica/psopcode.c5
-rw-r--r--drivers/acpi/acpica/psopinfo.c2
-rw-r--r--drivers/acpi/acpica/pstree.c7
-rw-r--r--drivers/acpi/acpica/psutils.c11
-rw-r--r--drivers/acpi/acpica/utalloc.c50
-rw-r--r--drivers/acpi/acpica/utdebug.c1
-rw-r--r--include/acpi/acconfig.h1
-rw-r--r--include/acpi/actbl2.h1
17 files changed, 490 insertions, 18 deletions
diff --git a/drivers/acpi/acpica/acconvert.h b/drivers/acpi/acpica/acconvert.h
new file mode 100644
index 000000000000..c84223b60b35
--- /dev/null
+++ b/drivers/acpi/acpica/acconvert.h
@@ -0,0 +1,144 @@
1/******************************************************************************
2 *
3 * Module Name: acapps - common include for ACPI applications/tools
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#ifndef _ACCONVERT
45#define _ACCONVERT
46
47/* Definitions for comment state */
48
49#define ASL_COMMENT_STANDARD 1
50#define ASLCOMMENT_INLINE 2
51#define ASL_COMMENT_OPEN_PAREN 3
52#define ASL_COMMENT_CLOSE_PAREN 4
53#define ASL_COMMENT_CLOSE_BRACE 5
54
55/* Definitions for comment print function*/
56
57#define AML_COMMENT_STANDARD 1
58#define AMLCOMMENT_INLINE 2
59#define AML_COMMENT_END_NODE 3
60#define AML_NAMECOMMENT 4
61#define AML_COMMENT_CLOSE_BRACE 5
62#define AML_COMMENT_ENDBLK 6
63#define AML_COMMENT_INCLUDE 7
64
65#ifdef ACPI_ASL_COMPILER
66/*
67 * cvcompiler
68 */
69void
70cv_process_comment(struct asl_comment_state current_state,
71 char *string_buffer, int c1);
72
73void
74cv_process_comment_type2(struct asl_comment_state current_state,
75 char *string_buffer);
76
77u32 cv_calculate_comment_lengths(union acpi_parse_object *op);
78
79void cv_process_comment_state(char input);
80
81char *cv_append_inline_comment(char *inline_comment, char *to_add);
82
83void cv_add_to_comment_list(char *to_add);
84
85void cv_place_comment(u8 type, char *comment_string);
86
87u32 cv_parse_op_block_type(union acpi_parse_object *op);
88
89struct acpi_comment_node *cv_comment_node_calloc(void);
90
91void cg_write_aml_def_block_comment(union acpi_parse_object *op);
92
93void
94cg_write_one_aml_comment(union acpi_parse_object *op,
95 char *comment_to_print, u8 input_option);
96
97void cg_write_aml_comment(union acpi_parse_object *op);
98
99/*
100 * cvparser
101 */
102void
103cv_init_file_tree(struct acpi_table_header *table,
104 u8 *aml_start, u32 aml_length);
105
106void cv_clear_op_comments(union acpi_parse_object *op);
107
108struct acpi_file_node *cv_filename_exists(char *filename,
109 struct acpi_file_node *head);
110
111void cv_label_file_node(union acpi_parse_object *op);
112
113void
114cv_capture_list_comments(struct acpi_parse_state *parser_state,
115 struct acpi_comment_node *list_head,
116 struct acpi_comment_node *list_tail);
117
118void cv_capture_comments_only(struct acpi_parse_state *parser_state);
119
120void cv_capture_comments(struct acpi_walk_state *walk_state);
121
122void cv_transfer_comments(union acpi_parse_object *op);
123
124/*
125 * cvdisasm
126 */
127void cv_switch_files(u32 level, union acpi_parse_object *op);
128
129u8 cv_file_has_switched(union acpi_parse_object *op);
130
131void cv_close_paren_write_comment(union acpi_parse_object *op, u32 level);
132
133void cv_close_brace_write_comment(union acpi_parse_object *op, u32 level);
134
135void
136cv_print_one_comment_list(struct acpi_comment_node *comment_list, u32 level);
137
138void
139cv_print_one_comment_type(union acpi_parse_object *op,
140 u8 comment_type, char *end_str, u32 level);
141
142#endif
143
144#endif /* _ACCONVERT */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 1d955fe216c4..abe8c316908c 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -370,6 +370,59 @@ ACPI_GLOBAL(const char, *acpi_gbl_pld_shape_list[]);
370 370
371#endif 371#endif
372 372
373/*
374 * Meant for the -ca option.
375 */
376ACPI_INIT_GLOBAL(char *, acpi_gbl_current_inline_comment, NULL);
377ACPI_INIT_GLOBAL(char *, acpi_gbl_current_end_node_comment, NULL);
378ACPI_INIT_GLOBAL(char *, acpi_gbl_current_open_brace_comment, NULL);
379ACPI_INIT_GLOBAL(char *, acpi_gbl_current_close_brace_comment, NULL);
380
381ACPI_INIT_GLOBAL(char *, acpi_gbl_root_filename, NULL);
382ACPI_INIT_GLOBAL(char *, acpi_gbl_current_filename, NULL);
383ACPI_INIT_GLOBAL(char *, acpi_gbl_current_parent_filename, NULL);
384ACPI_INIT_GLOBAL(char *, acpi_gbl_current_include_filename, NULL);
385
386ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_last_list_head, NULL);
387
388ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_def_blk_comment_list_head,
389 NULL);
390ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_def_blk_comment_list_tail,
391 NULL);
392
393ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_reg_comment_list_head,
394 NULL);
395ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_reg_comment_list_tail,
396 NULL);
397
398ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_inc_comment_list_head,
399 NULL);
400ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_inc_comment_list_tail,
401 NULL);
402
403ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_end_blk_comment_list_head,
404 NULL);
405ACPI_INIT_GLOBAL(struct acpi_comment_node, *acpi_gbl_end_blk_comment_list_tail,
406 NULL);
407
408ACPI_INIT_GLOBAL(struct acpi_comment_addr_node,
409 *acpi_gbl_comment_addr_list_head, NULL);
410
411ACPI_INIT_GLOBAL(union acpi_parse_object, *acpi_gbl_current_scope, NULL);
412
413ACPI_INIT_GLOBAL(struct acpi_file_node, *acpi_gbl_file_tree_root, NULL);
414
415ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_reg_comment_cache);
416ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_comment_addr_cache);
417ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_file_cache);
418
419ACPI_INIT_GLOBAL(u8, gbl_capture_comments, FALSE);
420
421ACPI_INIT_GLOBAL(u8, acpi_gbl_debug_asl_conversion, FALSE);
422ACPI_INIT_GLOBAL(ACPI_FILE, acpi_gbl_conv_debug_file, NULL);
423
424ACPI_GLOBAL(char, acpi_gbl_table_sig[4]);
425
373/***************************************************************************** 426/*****************************************************************************
374 * 427 *
375 * Application globals 428 * Application globals
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index ca984261acbb..f9b3f7fef462 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 0x82 56#define AML_NUM_OPCODES 0x83
57 57
58/* Forward declarations */ 58/* Forward declarations */
59 59
@@ -754,21 +754,52 @@ union acpi_parse_value {
754#define ACPI_DISASM_ONLY_MEMBERS(a) 754#define ACPI_DISASM_ONLY_MEMBERS(a)
755#endif 755#endif
756 756
757#if defined(ACPI_ASL_COMPILER)
758#define ACPI_CONVERTER_ONLY_MEMBERS(a) a;
759#else
760#define ACPI_CONVERTER_ONLY_MEMBERS(a)
761#endif
762
757#define ACPI_PARSE_COMMON \ 763#define ACPI_PARSE_COMMON \
758 union acpi_parse_object *parent; /* Parent op */\ 764 union acpi_parse_object *parent; /* Parent op */\
759 u8 descriptor_type; /* To differentiate various internal objs */\ 765 u8 descriptor_type; /* To differentiate various internal objs */\
760 u8 flags; /* Type of Op */\ 766 u8 flags; /* Type of Op */\
761 u16 aml_opcode; /* AML opcode */\ 767 u16 aml_opcode; /* AML opcode */\
762 u8 *aml; /* Address of declaration in AML */\ 768 u8 *aml; /* Address of declaration in AML */\
763 union acpi_parse_object *next; /* Next op */\ 769 union acpi_parse_object *next; /* Next op */\
764 struct acpi_namespace_node *node; /* For use by interpreter */\ 770 struct acpi_namespace_node *node; /* For use by interpreter */\
765 union acpi_parse_value value; /* Value or args associated with the opcode */\ 771 union acpi_parse_value value; /* Value or args associated with the opcode */\
766 u8 arg_list_length; /* Number of elements in the arg list */\ 772 u8 arg_list_length; /* Number of elements in the arg list */\
767 ACPI_DISASM_ONLY_MEMBERS (\ 773 ACPI_DISASM_ONLY_MEMBERS (\
768 u16 disasm_flags; /* Used during AML disassembly */\ 774 u16 disasm_flags; /* Used during AML disassembly */\
769 u8 disasm_opcode; /* Subtype used for disassembly */\ 775 u8 disasm_opcode; /* Subtype used for disassembly */\
770 char *operator_symbol;/* Used for C-style operator name strings */\ 776 char *operator_symbol; /* Used for C-style operator name strings */\
771 char aml_op_name[16]) /* Op name (debug only) */ 777 char aml_op_name[16]) /* Op name (debug only) */\
778 ACPI_CONVERTER_ONLY_MEMBERS (\
779 char *inline_comment; /* Inline comment */\
780 char *end_node_comment; /* End of node comment */\
781 char *name_comment; /* Comment associated with the first parameter of the name node */\
782 char *close_brace_comment; /* Comments that come after } on the same as } */\
783 struct acpi_comment_node *comment_list; /* comments that appears before this node */\
784 struct acpi_comment_node *end_blk_comment; /* comments that at the end of a block but before ) or } */\
785 char *cv_filename; /* Filename associated with this node. Used for ASL/ASL+ converter */\
786 char *cv_parent_filename) /* Parent filename associated with this node. Used for ASL/ASL+ converter */
787
788/* categories of comments */
789
790typedef enum {
791 STANDARD_COMMENT = 1,
792 INLINE_COMMENT,
793 ENDNODE_COMMENT,
794 OPENBRACE_COMMENT,
795 CLOSE_BRACE_COMMENT,
796 STD_DEFBLK_COMMENT,
797 END_DEFBLK_COMMENT,
798 FILENAME_COMMENT,
799 PARENTFILENAME_COMMENT,
800 ENDBLK_COMMENT,
801 INCLUDE_COMMENT
802} asl_comment_types;
772 803
773/* Internal opcodes for disasm_opcode field above */ 804/* Internal opcodes for disasm_opcode field above */
774 805
@@ -790,6 +821,34 @@ union acpi_parse_value {
790#define ACPI_DASM_DEFAULT 0x0F /* Else is a Default in a Switch/Case block */ 821#define ACPI_DASM_DEFAULT 0x0F /* Else is a Default in a Switch/Case block */
791 822
792/* 823/*
824 * List struct used in the -ca option
825 */
826struct acpi_comment_node {
827 char *comment;
828 struct acpi_comment_node *next;
829};
830
831struct acpi_comment_addr_node {
832 u8 *addr;
833 struct acpi_comment_addr_node *next;
834};
835
836/*
837 * File node - used for "Include" operator file stack and
838 * depdendency tree for the -ca option
839 */
840struct acpi_file_node {
841 void *file;
842 char *filename;
843 char *file_start; /* Points to AML and indicates when the AML for this particular file starts. */
844 char *file_end; /* Points to AML and indicates when the AML for this particular file ends. */
845 struct acpi_file_node *next;
846 struct acpi_file_node *parent;
847 u8 include_written;
848 struct acpi_comment_node *include_comment;
849};
850
851/*
793 * Generic operation (for example: If, While, Store) 852 * Generic operation (for example: If, While, Store)
794 */ 853 */
795struct acpi_parse_obj_common { 854struct acpi_parse_obj_common {
@@ -814,6 +873,8 @@ struct acpi_parse_obj_asl {
814 ACPI_PARSE_COMMON union acpi_parse_object *child; 873 ACPI_PARSE_COMMON union acpi_parse_object *child;
815 union acpi_parse_object *parent_method; 874 union acpi_parse_object *parent_method;
816 char *filename; 875 char *filename;
876 u8 file_changed;
877 char *parent_filename;
817 char *external_name; 878 char *external_name;
818 char *namepath; 879 char *namepath;
819 char name_seg[4]; 880 char name_seg[4];
@@ -843,6 +904,14 @@ union acpi_parse_object {
843 struct acpi_parse_obj_asl asl; 904 struct acpi_parse_obj_asl asl;
844}; 905};
845 906
907struct asl_comment_state {
908 u8 comment_type;
909 u32 spaces_before;
910 union acpi_parse_object *latest_parse_node;
911 union acpi_parse_object *parsing_paren_brace_node;
912 u8 capture_comments;
913};
914
846/* 915/*
847 * Parse state - one state per parser invocation and each control 916 * Parse state - one state per parser invocation and each control
848 * method. 917 * method.
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index c3337514e0ed..c7f0c96cc00f 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -493,4 +493,39 @@
493 493
494#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) 494#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7'))
495 495
496/*
497 * Macors used for the ASL-/ASL+ converter utility
498 */
499#ifdef ACPI_ASL_COMPILER
500
501#define ASL_CV_LABEL_FILENODE(a) cv_label_file_node(a);
502#define ASL_CV_CAPTURE_COMMENTS_ONLY(a) cv_capture_comments_only (a);
503#define ASL_CV_CAPTURE_COMMENTS(a) cv_capture_comments (a);
504#define ASL_CV_TRANSFER_COMMENTS(a) cv_transfer_comments (a);
505#define ASL_CV_CLOSE_PAREN(a,b) cv_close_paren_write_comment(a,b);
506#define ASL_CV_CLOSE_BRACE(a,b) cv_close_brace_write_comment(a,b);
507#define ASL_CV_SWITCH_FILES(a,b) cv_switch_files(a,b);
508#define ASL_CV_CLEAR_OP_COMMENTS(a) cv_clear_op_comments(a);
509#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) cv_print_one_comment_type (a,b,c,d);
510#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) cv_print_one_comment_list (a,b);
511#define ASL_CV_FILE_HAS_SWITCHED(a) cv_file_has_switched(a)
512#define ASL_CV_INIT_FILETREE(a,b,c) cv_init_file_tree(a,b,c);
513
514#else
515
516#define ASL_CV_LABEL_FILENODE(a)
517#define ASL_CV_CAPTURE_COMMENTS_ONLY(a)
518#define ASL_CV_CAPTURE_COMMENTS(a)
519#define ASL_CV_TRANSFER_COMMENTS(a)
520#define ASL_CV_CLOSE_PAREN(a,b) acpi_os_printf (")");
521#define ASL_CV_CLOSE_BRACE(a,b) acpi_os_printf ("}");
522#define ASL_CV_SWITCH_FILES(a,b)
523#define ASL_CV_CLEAR_OP_COMMENTS(a)
524#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d)
525#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b)
526#define ASL_CV_FILE_HAS_SWITCHED(a) 0
527#define ASL_CV_INIT_FILETREE(a,b,c)
528
529#endif
530
496#endif /* ACMACROS_H */ 531#endif /* ACMACROS_H */
diff --git a/drivers/acpi/acpica/acopcode.h b/drivers/acpi/acpica/acopcode.h
index e758f098ff4b..a5d9af758c52 100644
--- a/drivers/acpi/acpica/acopcode.h
+++ b/drivers/acpi/acpica/acopcode.h
@@ -90,6 +90,7 @@
90#define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST) 90#define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST)
91#define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA) 91#define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA)
92#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING) 92#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING)
93#define ARGP_COMMENT_OP ARGP_LIST2 (ARGP_BYTEDATA, ARGP_COMMENT)
93#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 94#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
94#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 95#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
95#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SIMPLENAME, ARGP_TARGET) 96#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SIMPLENAME, ARGP_TARGET)
@@ -223,6 +224,7 @@
223#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER) 224#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER)
224#define ARGI_BYTE_OP ARGI_INVALID_OPCODE 225#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
225#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE 226#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
227#define ARGI_COMMENT_OP ARGI_INVALID_OPCODE
226#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_ANYTYPE, ARGI_ANYTYPE, ARGI_TARGETREF) 228#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_ANYTYPE, ARGI_ANYTYPE, ARGI_TARGETREF)
227#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF) 229#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
228#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF) 230#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index 7e2b369487ae..176f7e9b4d0e 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -137,7 +137,8 @@
137#define AML_NOOP_OP (u16) 0xa3 137#define AML_NOOP_OP (u16) 0xa3
138#define AML_RETURN_OP (u16) 0xa4 138#define AML_RETURN_OP (u16) 0xa4
139#define AML_BREAK_OP (u16) 0xa5 139#define AML_BREAK_OP (u16) 0xa5
140#define AML_BREAKPOINT_OP (u16) 0xcc 140#define AML_COMMENT_OP (u16) 0xa9
141#define AML_BREAKPOINT_OP (u16) 0xcc
141#define AML_ONES_OP (u16) 0xff 142#define AML_ONES_OP (u16) 0xff
142 143
143/* 144/*
@@ -236,6 +237,7 @@
236#define ARGP_SIMPLENAME 0x12 /* name_string | local_term | arg_term */ 237#define ARGP_SIMPLENAME 0x12 /* name_string | local_term | arg_term */
237#define ARGP_NAME_OR_REF 0x13 /* For object_type only */ 238#define ARGP_NAME_OR_REF 0x13 /* For object_type only */
238#define ARGP_MAX 0x13 239#define ARGP_MAX 0x13
240#define ARGP_COMMENT 0x14
239 241
240/* 242/*
241 * Resolved argument types for the AML Interpreter 243 * Resolved argument types for the AML Interpreter
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index cda1e151dbc7..eb9dfaca555f 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -47,6 +47,7 @@
47#include "amlcode.h" 47#include "amlcode.h"
48#include "acnamesp.h" 48#include "acnamesp.h"
49#include "acdispat.h" 49#include "acdispat.h"
50#include "acconvert.h"
50 51
51#define _COMPONENT ACPI_PARSER 52#define _COMPONENT ACPI_PARSER
52ACPI_MODULE_NAME("psargs") 53ACPI_MODULE_NAME("psargs")
@@ -502,6 +503,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
502 503
503 ACPI_FUNCTION_TRACE(ps_get_next_field); 504 ACPI_FUNCTION_TRACE(ps_get_next_field);
504 505
506 ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state);
505 aml = parser_state->aml; 507 aml = parser_state->aml;
506 508
507 /* Determine field type */ 509 /* Determine field type */
@@ -546,6 +548,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
546 548
547 /* Decode the field type */ 549 /* Decode the field type */
548 550
551 ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state);
549 switch (opcode) { 552 switch (opcode) {
550 case AML_INT_NAMEDFIELD_OP: 553 case AML_INT_NAMEDFIELD_OP:
551 554
@@ -555,6 +558,22 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
555 acpi_ps_set_name(field, name); 558 acpi_ps_set_name(field, name);
556 parser_state->aml += ACPI_NAME_SIZE; 559 parser_state->aml += ACPI_NAME_SIZE;
557 560
561 ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state);
562
563#ifdef ACPI_ASL_COMPILER
564 /*
565 * Because the package length isn't represented as a parse tree object,
566 * take comments surrounding this and add to the previously created
567 * parse node.
568 */
569 if (field->common.inline_comment) {
570 field->common.name_comment =
571 field->common.inline_comment;
572 }
573 field->common.inline_comment = acpi_gbl_current_inline_comment;
574 acpi_gbl_current_inline_comment = NULL;
575#endif
576
558 /* Get the length which is encoded as a package length */ 577 /* Get the length which is encoded as a package length */
559 578
560 field->common.value.size = 579 field->common.value.size =
@@ -609,11 +628,13 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
609 if (ACPI_GET8(parser_state->aml) == AML_BUFFER_OP) { 628 if (ACPI_GET8(parser_state->aml) == AML_BUFFER_OP) {
610 parser_state->aml++; 629 parser_state->aml++;
611 630
631 ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state);
612 pkg_end = parser_state->aml; 632 pkg_end = parser_state->aml;
613 pkg_length = 633 pkg_length =
614 acpi_ps_get_next_package_length(parser_state); 634 acpi_ps_get_next_package_length(parser_state);
615 pkg_end += pkg_length; 635 pkg_end += pkg_length;
616 636
637 ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state);
617 if (parser_state->aml < pkg_end) { 638 if (parser_state->aml < pkg_end) {
618 639
619 /* Non-empty list */ 640 /* Non-empty list */
@@ -630,6 +651,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
630 opcode = ACPI_GET8(parser_state->aml); 651 opcode = ACPI_GET8(parser_state->aml);
631 parser_state->aml++; 652 parser_state->aml++;
632 653
654 ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state);
633 switch (opcode) { 655 switch (opcode) {
634 case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ 656 case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
635 657
@@ -660,6 +682,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
660 682
661 /* Fill in bytelist data */ 683 /* Fill in bytelist data */
662 684
685 ASL_CV_CAPTURE_COMMENTS_ONLY(parser_state);
663 arg->named.value.size = buffer_length; 686 arg->named.value.size = buffer_length;
664 arg->named.data = parser_state->aml; 687 arg->named.data = parser_state->aml;
665 } 688 }
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index b7da881b66da..b4224005783c 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -55,6 +55,7 @@
55#include "acparser.h" 55#include "acparser.h"
56#include "acdispat.h" 56#include "acdispat.h"
57#include "amlcode.h" 57#include "amlcode.h"
58#include "acconvert.h"
58 59
59#define _COMPONENT ACPI_PARSER 60#define _COMPONENT ACPI_PARSER
60ACPI_MODULE_NAME("psloop") 61ACPI_MODULE_NAME("psloop")
@@ -132,6 +133,21 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
132 !walk_state->arg_count) { 133 !walk_state->arg_count) {
133 walk_state->aml = walk_state->parser_state.aml; 134 walk_state->aml = walk_state->parser_state.aml;
134 135
136 switch (op->common.aml_opcode) {
137 case AML_METHOD_OP:
138 case AML_BUFFER_OP:
139 case AML_PACKAGE_OP:
140 case AML_VARIABLE_PACKAGE_OP:
141 case AML_WHILE_OP:
142
143 break;
144
145 default:
146
147 ASL_CV_CAPTURE_COMMENTS(walk_state);
148 break;
149 }
150
135 status = 151 status =
136 acpi_ps_get_next_arg(walk_state, 152 acpi_ps_get_next_arg(walk_state,
137 &(walk_state->parser_state), 153 &(walk_state->parser_state),
@@ -480,6 +496,8 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
480 /* Iterative parsing loop, while there is more AML to process: */ 496 /* Iterative parsing loop, while there is more AML to process: */
481 497
482 while ((parser_state->aml < parser_state->aml_end) || (op)) { 498 while ((parser_state->aml < parser_state->aml_end) || (op)) {
499 ASL_CV_CAPTURE_COMMENTS(walk_state);
500
483 aml_op_start = parser_state->aml; 501 aml_op_start = parser_state->aml;
484 if (!op) { 502 if (!op) {
485 status = 503 status =
@@ -516,6 +534,20 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
516 */ 534 */
517 walk_state->arg_count = 0; 535 walk_state->arg_count = 0;
518 536
537 switch (op->common.aml_opcode) {
538 case AML_BYTE_OP:
539 case AML_WORD_OP:
540 case AML_DWORD_OP:
541 case AML_QWORD_OP:
542
543 break;
544
545 default:
546
547 ASL_CV_CAPTURE_COMMENTS(walk_state);
548 break;
549 }
550
519 /* Are there any arguments that must be processed? */ 551 /* Are there any arguments that must be processed? */
520 552
521 if (walk_state->arg_types) { 553 if (walk_state->arg_types) {
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c
index 5c4aff0f4f26..5bcb61831706 100644
--- a/drivers/acpi/acpica/psobject.c
+++ b/drivers/acpi/acpica/psobject.c
@@ -45,6 +45,7 @@
45#include "accommon.h" 45#include "accommon.h"
46#include "acparser.h" 46#include "acparser.h"
47#include "amlcode.h" 47#include "amlcode.h"
48#include "acconvert.h"
48 49
49#define _COMPONENT ACPI_PARSER 50#define _COMPONENT ACPI_PARSER
50ACPI_MODULE_NAME("psobject") 51ACPI_MODULE_NAME("psobject")
@@ -190,6 +191,7 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
190 */ 191 */
191 while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) && 192 while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) &&
192 (GET_CURRENT_ARG_TYPE(walk_state->arg_types) != ARGP_NAME)) { 193 (GET_CURRENT_ARG_TYPE(walk_state->arg_types) != ARGP_NAME)) {
194 ASL_CV_CAPTURE_COMMENTS(walk_state);
193 status = 195 status =
194 acpi_ps_get_next_arg(walk_state, 196 acpi_ps_get_next_arg(walk_state,
195 &(walk_state->parser_state), 197 &(walk_state->parser_state),
@@ -203,6 +205,18 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
203 INCREMENT_ARG_LIST(walk_state->arg_types); 205 INCREMENT_ARG_LIST(walk_state->arg_types);
204 } 206 }
205 207
208 /* are there any inline comments associated with the name_seg?? If so, save this. */
209
210 ASL_CV_CAPTURE_COMMENTS(walk_state);
211
212#ifdef ACPI_ASL_COMPILER
213 if (acpi_gbl_current_inline_comment != NULL) {
214 unnamed_op->common.name_comment =
215 acpi_gbl_current_inline_comment;
216 acpi_gbl_current_inline_comment = NULL;
217 }
218#endif
219
206 /* 220 /*
207 * Make sure that we found a NAME and didn't run out of arguments 221 * Make sure that we found a NAME and didn't run out of arguments
208 */ 222 */
@@ -243,6 +257,30 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
243 257
244 acpi_ps_append_arg(*op, unnamed_op->common.value.arg); 258 acpi_ps_append_arg(*op, unnamed_op->common.value.arg);
245 259
260#ifdef ACPI_ASL_COMPILER
261
262 /* save any comments that might be associated with unnamed_op. */
263
264 (*op)->common.inline_comment = unnamed_op->common.inline_comment;
265 (*op)->common.end_node_comment = unnamed_op->common.end_node_comment;
266 (*op)->common.close_brace_comment =
267 unnamed_op->common.close_brace_comment;
268 (*op)->common.name_comment = unnamed_op->common.name_comment;
269 (*op)->common.comment_list = unnamed_op->common.comment_list;
270 (*op)->common.end_blk_comment = unnamed_op->common.end_blk_comment;
271 (*op)->common.cv_filename = unnamed_op->common.cv_filename;
272 (*op)->common.cv_parent_filename =
273 unnamed_op->common.cv_parent_filename;
274 (*op)->named.aml = unnamed_op->common.aml;
275
276 unnamed_op->common.inline_comment = NULL;
277 unnamed_op->common.end_node_comment = NULL;
278 unnamed_op->common.close_brace_comment = NULL;
279 unnamed_op->common.name_comment = NULL;
280 unnamed_op->common.comment_list = NULL;
281 unnamed_op->common.end_blk_comment = NULL;
282#endif
283
246 if ((*op)->common.aml_opcode == AML_REGION_OP || 284 if ((*op)->common.aml_opcode == AML_REGION_OP ||
247 (*op)->common.aml_opcode == AML_DATA_REGION_OP) { 285 (*op)->common.aml_opcode == AML_DATA_REGION_OP) {
248 /* 286 /*
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index b8f0617fd421..c343a0d5a3d2 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -652,7 +652,10 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
652 652
653 /* 81 */ ACPI_OP("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, 653 /* 81 */ ACPI_OP("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP,
654 ACPI_TYPE_ANY, AML_CLASS_EXECUTE, /* ? */ 654 ACPI_TYPE_ANY, AML_CLASS_EXECUTE, /* ? */
655 AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R) 655 AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R),
656/* 82 */ ACPI_OP("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP,
657 ACPI_TYPE_STRING, AML_CLASS_ARGUMENT,
658 AML_TYPE_LITERAL, AML_CONSTANT)
656 659
657/*! [End] no source code translation !*/ 660/*! [End] no source code translation !*/
658}; 661};
diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c
index 89f95b7f26e9..eff22950232b 100644
--- a/drivers/acpi/acpica/psopinfo.c
+++ b/drivers/acpi/acpica/psopinfo.c
@@ -226,7 +226,7 @@ const u8 acpi_gbl_short_op_index[256] = {
226/* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74, 226/* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74,
227/* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A, 227/* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A,
228/* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61, 228/* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61,
229/* 0xA8 */ 0x62, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 229/* 0xA8 */ 0x62, 0x82, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
230/* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 230/* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
231/* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 231/* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
232/* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 232/* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
diff --git a/drivers/acpi/acpica/pstree.c b/drivers/acpi/acpica/pstree.c
index a11d475b79cd..c06d6e2fc7a5 100644
--- a/drivers/acpi/acpica/pstree.c
+++ b/drivers/acpi/acpica/pstree.c
@@ -45,6 +45,7 @@
45#include "accommon.h" 45#include "accommon.h"
46#include "acparser.h" 46#include "acparser.h"
47#include "amlcode.h" 47#include "amlcode.h"
48#include "acconvert.h"
48 49
49#define _COMPONENT ACPI_PARSER 50#define _COMPONENT ACPI_PARSER
50ACPI_MODULE_NAME("pstree") 51ACPI_MODULE_NAME("pstree")
@@ -216,6 +217,7 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
216 217
217 next = acpi_ps_get_arg(op, 0); 218 next = acpi_ps_get_arg(op, 0);
218 if (next) { 219 if (next) {
220 ASL_CV_LABEL_FILENODE(next);
219 return (next); 221 return (next);
220 } 222 }
221 223
@@ -223,6 +225,7 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
223 225
224 next = op->common.next; 226 next = op->common.next;
225 if (next) { 227 if (next) {
228 ASL_CV_LABEL_FILENODE(next);
226 return (next); 229 return (next);
227 } 230 }
228 231
@@ -233,6 +236,8 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
233 while (parent) { 236 while (parent) {
234 arg = acpi_ps_get_arg(parent, 0); 237 arg = acpi_ps_get_arg(parent, 0);
235 while (arg && (arg != origin) && (arg != op)) { 238 while (arg && (arg != origin) && (arg != op)) {
239
240 ASL_CV_LABEL_FILENODE(arg);
236 arg = arg->common.next; 241 arg = arg->common.next;
237 } 242 }
238 243
@@ -247,6 +252,7 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
247 252
248 /* Found sibling of parent */ 253 /* Found sibling of parent */
249 254
255 ASL_CV_LABEL_FILENODE(parent->common.next);
250 return (parent->common.next); 256 return (parent->common.next);
251 } 257 }
252 258
@@ -254,6 +260,7 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
254 parent = parent->common.parent; 260 parent = parent->common.parent;
255 } 261 }
256 262
263 ASL_CV_LABEL_FILENODE(next);
257 return (next); 264 return (next);
258} 265}
259 266
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index 2fa38bb76a55..02642760cb93 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -45,6 +45,7 @@
45#include "accommon.h" 45#include "accommon.h"
46#include "acparser.h" 46#include "acparser.h"
47#include "amlcode.h" 47#include "amlcode.h"
48#include "acconvert.h"
48 49
49#define _COMPONENT ACPI_PARSER 50#define _COMPONENT ACPI_PARSER
50ACPI_MODULE_NAME("psutils") 51ACPI_MODULE_NAME("psutils")
@@ -152,6 +153,15 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode, u8 *aml)
152 acpi_ps_init_op(op, opcode); 153 acpi_ps_init_op(op, opcode);
153 op->common.aml = aml; 154 op->common.aml = aml;
154 op->common.flags = flags; 155 op->common.flags = flags;
156 ASL_CV_CLEAR_OP_COMMENTS(op);
157
158 if (opcode == AML_SCOPE_OP) {
159 acpi_gbl_current_scope = op;
160 }
161 }
162
163 if (gbl_capture_comments) {
164 ASL_CV_TRANSFER_COMMENTS(op);
155 } 165 }
156 166
157 return (op); 167 return (op);
@@ -174,6 +184,7 @@ void acpi_ps_free_op(union acpi_parse_object *op)
174{ 184{
175 ACPI_FUNCTION_NAME(ps_free_op); 185 ACPI_FUNCTION_NAME(ps_free_op);
176 186
187 ASL_CV_CLEAR_OP_COMMENTS(op);
177 if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { 188 if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
178 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, 189 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
179 "Free retval op: %p\n", op)); 190 "Free retval op: %p\n", op));
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c
index a3401bd29413..5594a359dbf1 100644
--- a/drivers/acpi/acpica/utalloc.c
+++ b/drivers/acpi/acpica/utalloc.c
@@ -142,6 +142,45 @@ acpi_status acpi_ut_create_caches(void)
142 if (ACPI_FAILURE(status)) { 142 if (ACPI_FAILURE(status)) {
143 return (status); 143 return (status);
144 } 144 }
145#ifdef ACPI_ASL_COMPILER
146 /*
147 * For use with the ASL-/ASL+ option. This cache keeps track of regular
148 * 0xA9 0x01 comments.
149 */
150 status =
151 acpi_os_create_cache("Acpi-Comment",
152 sizeof(struct acpi_comment_node),
153 ACPI_MAX_COMMENT_CACHE_DEPTH,
154 &acpi_gbl_reg_comment_cache);
155 if (ACPI_FAILURE(status)) {
156 return (status);
157 }
158
159 /*
160 * This cache keeps track of the starting addresses of where the comments
161 * lie. This helps prevent duplication of comments.
162 */
163 status =
164 acpi_os_create_cache("Acpi-Comment-Addr",
165 sizeof(struct acpi_comment_addr_node),
166 ACPI_MAX_COMMENT_CACHE_DEPTH,
167 &acpi_gbl_comment_addr_cache);
168 if (ACPI_FAILURE(status)) {
169 return (status);
170 }
171
172 /*
173 * This cache will be used for nodes that represent files.
174 */
175 status =
176 acpi_os_create_cache("Acpi-File", sizeof(struct acpi_file_node),
177 ACPI_MAX_COMMENT_CACHE_DEPTH,
178 &acpi_gbl_file_cache);
179 if (ACPI_FAILURE(status)) {
180 return (status);
181 }
182#endif
183
145#ifdef ACPI_DBG_TRACK_ALLOCATIONS 184#ifdef ACPI_DBG_TRACK_ALLOCATIONS
146 185
147 /* Memory allocation lists */ 186 /* Memory allocation lists */
@@ -201,6 +240,17 @@ acpi_status acpi_ut_delete_caches(void)
201 (void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache); 240 (void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache);
202 acpi_gbl_ps_node_ext_cache = NULL; 241 acpi_gbl_ps_node_ext_cache = NULL;
203 242
243#ifdef ACPI_ASL_COMPILER
244 (void)acpi_os_delete_cache(acpi_gbl_reg_comment_cache);
245 acpi_gbl_reg_comment_cache = NULL;
246
247 (void)acpi_os_delete_cache(acpi_gbl_comment_addr_cache);
248 acpi_gbl_comment_addr_cache = NULL;
249
250 (void)acpi_os_delete_cache(acpi_gbl_file_cache);
251 acpi_gbl_file_cache = NULL;
252#endif
253
204#ifdef ACPI_DBG_TRACK_ALLOCATIONS 254#ifdef ACPI_DBG_TRACK_ALLOCATIONS
205 255
206 /* Debug only - display leftover memory allocation, if any */ 256 /* Debug only - display leftover memory allocation, if any */
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index bd5ea3101eb7..615a885e2ca3 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -627,4 +627,5 @@ acpi_trace_point(acpi_trace_event_type type, u8 begin, u8 *aml, char *pathname)
627} 627}
628 628
629ACPI_EXPORT_SYMBOL(acpi_trace_point) 629ACPI_EXPORT_SYMBOL(acpi_trace_point)
630
630#endif 631#endif
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 07740072da55..6db3b4668b1a 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -78,6 +78,7 @@
78#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ 78#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
79#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ 79#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
80#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ 80#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
81#define ACPI_MAX_COMMENT_CACHE_DEPTH 96 /* Comments for the -ca option */
81 82
82/* 83/*
83 * Should the subsystem abort the loading of an ACPI table if the 84 * Should the subsystem abort the loading of an ACPI table if the
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 83666cb3ec2c..eb0eadcf9918 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -87,6 +87,7 @@
87#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ 87#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
88#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ 88#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
89#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ 89#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
90#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */
90 91
91#ifdef ACPI_UNDEFINED_TABLES 92#ifdef ACPI_UNDEFINED_TABLES
92/* 93/*