acconvert.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /******************************************************************************
  2. *
  3. * Module Name: acapps - common include for ACPI applications/tools
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2017, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef _ACCONVERT
  43. #define _ACCONVERT
  44. /* Definitions for comment state */
  45. #define ASL_COMMENT_STANDARD 1
  46. #define ASLCOMMENT_INLINE 2
  47. #define ASL_COMMENT_OPEN_PAREN 3
  48. #define ASL_COMMENT_CLOSE_PAREN 4
  49. #define ASL_COMMENT_CLOSE_BRACE 5
  50. /* Definitions for comment print function*/
  51. #define AML_COMMENT_STANDARD 1
  52. #define AMLCOMMENT_INLINE 2
  53. #define AML_COMMENT_END_NODE 3
  54. #define AML_NAMECOMMENT 4
  55. #define AML_COMMENT_CLOSE_BRACE 5
  56. #define AML_COMMENT_ENDBLK 6
  57. #define AML_COMMENT_INCLUDE 7
  58. #ifdef ACPI_ASL_COMPILER
  59. /*
  60. * cvcompiler
  61. */
  62. void
  63. cv_process_comment(struct asl_comment_state current_state,
  64. char *string_buffer, int c1);
  65. void
  66. cv_process_comment_type2(struct asl_comment_state current_state,
  67. char *string_buffer);
  68. u32 cv_calculate_comment_lengths(union acpi_parse_object *op);
  69. void cv_process_comment_state(char input);
  70. char *cv_append_inline_comment(char *inline_comment, char *to_add);
  71. void cv_add_to_comment_list(char *to_add);
  72. void cv_place_comment(u8 type, char *comment_string);
  73. u32 cv_parse_op_block_type(union acpi_parse_object *op);
  74. struct acpi_comment_node *cv_comment_node_calloc(void);
  75. void cg_write_aml_def_block_comment(union acpi_parse_object *op);
  76. void
  77. cg_write_one_aml_comment(union acpi_parse_object *op,
  78. char *comment_to_print, u8 input_option);
  79. void cg_write_aml_comment(union acpi_parse_object *op);
  80. /*
  81. * cvparser
  82. */
  83. void
  84. cv_init_file_tree(struct acpi_table_header *table,
  85. u8 *aml_start, u32 aml_length);
  86. void cv_clear_op_comments(union acpi_parse_object *op);
  87. struct acpi_file_node *cv_filename_exists(char *filename,
  88. struct acpi_file_node *head);
  89. void cv_label_file_node(union acpi_parse_object *op);
  90. void
  91. cv_capture_list_comments(struct acpi_parse_state *parser_state,
  92. struct acpi_comment_node *list_head,
  93. struct acpi_comment_node *list_tail);
  94. void cv_capture_comments_only(struct acpi_parse_state *parser_state);
  95. void cv_capture_comments(struct acpi_walk_state *walk_state);
  96. void cv_transfer_comments(union acpi_parse_object *op);
  97. /*
  98. * cvdisasm
  99. */
  100. void cv_switch_files(u32 level, union acpi_parse_object *op);
  101. u8 cv_file_has_switched(union acpi_parse_object *op);
  102. void cv_close_paren_write_comment(union acpi_parse_object *op, u32 level);
  103. void cv_close_brace_write_comment(union acpi_parse_object *op, u32 level);
  104. void
  105. cv_print_one_comment_list(struct acpi_comment_node *comment_list, u32 level);
  106. void
  107. cv_print_one_comment_type(union acpi_parse_object *op,
  108. u8 comment_type, char *end_str, u32 level);
  109. #endif
  110. #endif /* _ACCONVERT */