acstruct.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:7k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /******************************************************************************
  2.  *
  3.  * Name: acstruct.h - Internal structs
  4.  *       $Revision: 10 $
  5.  *
  6.  *****************************************************************************/
  7. /*
  8.  *  Copyright (C) 2000, 2001 R. Byron Moore
  9.  *
  10.  *  This program is free software; you can redistribute it and/or modify
  11.  *  it under the terms of the GNU General Public License as published by
  12.  *  the Free Software Foundation; either version 2 of the License, or
  13.  *  (at your option) any later version.
  14.  *
  15.  *  This program is distributed in the hope that it will be useful,
  16.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *  GNU General Public License for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License
  21.  *  along with this program; if not, write to the Free Software
  22.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23.  */
  24. #ifndef __ACSTRUCT_H__
  25. #define __ACSTRUCT_H__
  26. /*****************************************************************************
  27.  *
  28.  * Tree walking typedefs and structs
  29.  *
  30.  ****************************************************************************/
  31. /*
  32.  * Walk state - current state of a parse tree walk.  Used for both a leisurely stroll through
  33.  * the tree (for whatever reason), and for control method execution.
  34.  */
  35. #define NEXT_OP_DOWNWARD    1
  36. #define NEXT_OP_UPWARD      2
  37. #define WALK_NON_METHOD     0
  38. #define WALK_METHOD         1
  39. #define WALK_METHOD_RESTART 2
  40. typedef struct acpi_walk_state
  41. {
  42. u8                      data_type;                          /* To differentiate various internal objs MUST BE FIRST!*/
  43. acpi_owner_id           owner_id;                           /* Owner of objects created during the walk */
  44. u8                      last_predicate;                     /* Result of last predicate */
  45. u8                      current_result;                     /* */
  46. u8                      next_op_info;                       /* Info about Next_op */
  47. u8                      num_operands;                       /* Stack pointer for Operands[] array */
  48. u8                      return_used;
  49. u8                      walk_type;
  50. u16                     current_sync_level;                 /* Mutex Sync (nested acquire) level */
  51. u16                     opcode;                             /* Current AML opcode */
  52. u32                     arg_count;                          /* push for fixed or var args */
  53. u32                     aml_offset;
  54. u32                     arg_types;
  55. u32                     method_breakpoint;                  /* For single stepping */
  56. u32                     parse_flags;
  57. u32                     prev_arg_types;
  58. u8                      *aml_last_while;
  59. struct acpi_node        arguments[MTH_NUM_ARGS];            /* Control method arguments */
  60. union acpi_operand_obj  **caller_return_desc;
  61. acpi_generic_state      *control_state;                     /* List of control states (nested IFs) */
  62. struct acpi_node        local_variables[MTH_NUM_LOCALS];    /* Control method locals */
  63. struct acpi_node        *method_call_node;                  /* Called method Node*/
  64. acpi_parse_object       *method_call_op;                    /* Method_call Op if running a method */
  65. union acpi_operand_obj  *method_desc;                       /* Method descriptor if running a method */
  66. struct acpi_node        *method_node;                       /* Method Node if running a method */
  67. acpi_parse_object       *op;                                /* Current parser op */
  68. union acpi_operand_obj  *operands[OBJ_NUM_OPERANDS+1];      /* Operands passed to the interpreter (+1 for NULL terminator) */
  69. const acpi_opcode_info  *op_info;                           /* Info on current opcode */
  70. acpi_parse_object       *origin;                            /* Start of walk [Obsolete] */
  71. union acpi_operand_obj  **params;
  72. acpi_parse_state        parser_state;                       /* Current state of parser */
  73. union acpi_operand_obj  *result_obj;
  74. acpi_generic_state      *results;                           /* Stack of accumulated results */
  75. union acpi_operand_obj  *return_desc;                       /* Return object, if any */
  76. acpi_generic_state      *scope_info;                        /* Stack of nested scopes */
  77. /* TBD: Obsolete with removal of WALK procedure ? */
  78. acpi_parse_object       *prev_op;                           /* Last op that was processed */
  79. acpi_parse_object       *next_op;                           /* next op to be processed */
  80. acpi_parse_downwards    descending_callback;
  81. acpi_parse_upwards      ascending_callback;
  82. struct acpi_walk_list   *walk_list;
  83. struct acpi_walk_state  *next;                              /* Next Walk_state in list */
  84. } acpi_walk_state;
  85. /*
  86.  * Walk list - head of a tree of walk states.  Multiple walk states are created when there
  87.  * are nested control methods executing.
  88.  */
  89. typedef struct acpi_walk_list
  90. {
  91. acpi_walk_state         *walk_state;
  92. ACPI_OBJECT_MUTEX       acquired_mutex_list;               /* List of all currently acquired mutexes */
  93. } acpi_walk_list;
  94. /* Info used by Acpi_ps_init_objects */
  95. typedef struct acpi_init_walk_info
  96. {
  97. u16                     method_count;
  98. u16                     op_region_count;
  99. u16                     field_count;
  100. u16                     op_region_init;
  101. u16                     field_init;
  102. u16                     object_count;
  103. acpi_table_desc         *table_desc;
  104. } acpi_init_walk_info;
  105. /* Info used by TBD */
  106. typedef struct acpi_device_walk_info
  107. {
  108. u16                     device_count;
  109. u16                     num_STA;
  110. u16                     num_INI;
  111. acpi_table_desc         *table_desc;
  112. } acpi_device_walk_info;
  113. /* TBD: [Restructure] Merge with struct above */
  114. typedef struct acpi_walk_info
  115. {
  116. u32                     debug_level;
  117. u32                     owner_id;
  118. u8                      display_type;
  119. } acpi_walk_info;
  120. /* Display Types */
  121. #define ACPI_DISPLAY_SUMMARY    0
  122. #define ACPI_DISPLAY_OBJECTS    1
  123. typedef struct acpi_get_devices_info
  124. {
  125. acpi_walk_callback      user_function;
  126. void                    *context;
  127. NATIVE_CHAR             *hid;
  128. } acpi_get_devices_info;
  129. typedef union acpi_aml_operands
  130. {
  131. acpi_operand_object         *operands[7];
  132. struct
  133. {
  134. ACPI_OBJECT_INTEGER     *type;
  135. ACPI_OBJECT_INTEGER     *code;
  136. ACPI_OBJECT_INTEGER     *argument;
  137. } fatal;
  138. struct
  139. {
  140. acpi_operand_object     *source;
  141. ACPI_OBJECT_INTEGER     *index;
  142. acpi_operand_object     *target;
  143. } index;
  144. struct
  145. {
  146. acpi_operand_object     *source;
  147. ACPI_OBJECT_INTEGER     *index;
  148. ACPI_OBJECT_INTEGER     *length;
  149. acpi_operand_object     *target;
  150. } mid;
  151. } ACPI_AML_OPERANDS;
  152. #endif