diff options
Diffstat (limited to 'include/acpi/acdisasm.h')
| -rw-r--r-- | include/acpi/acdisasm.h | 173 |
1 files changed, 165 insertions, 8 deletions
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 11a8fe39cb04..9a7d6921f534 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h | |||
| @@ -50,26 +50,72 @@ | |||
| 50 | #define BLOCK_PAREN 1 | 50 | #define BLOCK_PAREN 1 |
| 51 | #define BLOCK_BRACE 2 | 51 | #define BLOCK_BRACE 2 |
| 52 | #define BLOCK_COMMA_LIST 4 | 52 | #define BLOCK_COMMA_LIST 4 |
| 53 | #define ACPI_DEFAULT_RESNAME *(u32 *) "__RD" | ||
| 53 | 54 | ||
| 54 | struct acpi_external_list { | 55 | struct acpi_external_list { |
| 55 | char *path; | 56 | char *path; |
| 57 | char *internal_path; | ||
| 56 | struct acpi_external_list *next; | 58 | struct acpi_external_list *next; |
| 59 | u32 value; | ||
| 60 | u16 length; | ||
| 61 | u8 type; | ||
| 57 | }; | 62 | }; |
| 58 | 63 | ||
| 59 | extern struct acpi_external_list *acpi_gbl_external_list; | 64 | extern struct acpi_external_list *acpi_gbl_external_list; |
| 60 | 65 | ||
| 61 | /* Strings used for decoding flags to ASL keywords */ | 66 | typedef const struct acpi_dmtable_info { |
| 67 | u8 opcode; | ||
| 68 | u8 offset; | ||
| 69 | char *name; | ||
| 70 | |||
| 71 | } acpi_dmtable_info; | ||
| 72 | |||
| 73 | /* | ||
| 74 | * Values for Opcode above. | ||
| 75 | * Note: 0-7 must not change, used as a flag shift value | ||
| 76 | */ | ||
| 77 | #define ACPI_DMT_FLAG0 0 | ||
| 78 | #define ACPI_DMT_FLAG1 1 | ||
| 79 | #define ACPI_DMT_FLAG2 2 | ||
| 80 | #define ACPI_DMT_FLAG3 3 | ||
| 81 | #define ACPI_DMT_FLAG4 4 | ||
| 82 | #define ACPI_DMT_FLAG5 5 | ||
| 83 | #define ACPI_DMT_FLAG6 6 | ||
| 84 | #define ACPI_DMT_FLAG7 7 | ||
| 85 | #define ACPI_DMT_FLAGS0 8 | ||
| 86 | #define ACPI_DMT_FLAGS2 9 | ||
| 87 | #define ACPI_DMT_UINT8 10 | ||
| 88 | #define ACPI_DMT_UINT16 11 | ||
| 89 | #define ACPI_DMT_UINT24 12 | ||
| 90 | #define ACPI_DMT_UINT32 13 | ||
| 91 | #define ACPI_DMT_UINT56 14 | ||
| 92 | #define ACPI_DMT_UINT64 15 | ||
| 93 | #define ACPI_DMT_STRING 16 | ||
| 94 | #define ACPI_DMT_NAME4 17 | ||
| 95 | #define ACPI_DMT_NAME6 18 | ||
| 96 | #define ACPI_DMT_NAME8 19 | ||
| 97 | #define ACPI_DMT_CHKSUM 20 | ||
| 98 | #define ACPI_DMT_SPACEID 21 | ||
| 99 | #define ACPI_DMT_GAS 22 | ||
| 100 | #define ACPI_DMT_MADT 23 | ||
| 101 | #define ACPI_DMT_SRAT 24 | ||
| 102 | #define ACPI_DMT_EXIT 25 | ||
| 62 | 103 | ||
| 63 | extern const char *acpi_gbl_word_decode[4]; | 104 | typedef |
| 64 | extern const char *acpi_gbl_irq_decode[2]; | 105 | void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table); |
| 65 | extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; | 106 | |
| 66 | extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; | 107 | struct acpi_dmtable_data { |
| 67 | extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; | 108 | char *signature; |
| 68 | extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; | 109 | struct acpi_dmtable_info *table_info; |
| 110 | ACPI_TABLE_HANDLER table_handler; | ||
| 111 | }; | ||
| 69 | 112 | ||
| 70 | struct acpi_op_walk_info { | 113 | struct acpi_op_walk_info { |
| 71 | u32 level; | 114 | u32 level; |
| 115 | u32 last_level; | ||
| 116 | u32 count; | ||
| 72 | u32 bit_offset; | 117 | u32 bit_offset; |
| 118 | u32 flags; | ||
| 73 | struct acpi_walk_state *walk_state; | 119 | struct acpi_walk_state *walk_state; |
| 74 | }; | 120 | }; |
| 75 | 121 | ||
| @@ -77,6 +123,100 @@ typedef | |||
| 77 | acpi_status(*asl_walk_callback) (union acpi_parse_object * op, | 123 | acpi_status(*asl_walk_callback) (union acpi_parse_object * op, |
| 78 | u32 level, void *context); | 124 | u32 level, void *context); |
| 79 | 125 | ||
| 126 | struct acpi_resource_tag { | ||
| 127 | u32 bit_index; | ||
| 128 | char *tag; | ||
| 129 | }; | ||
| 130 | |||
| 131 | /* Strings used for decoding flags to ASL keywords */ | ||
| 132 | |||
| 133 | extern const char *acpi_gbl_word_decode[]; | ||
| 134 | extern const char *acpi_gbl_irq_decode[]; | ||
| 135 | extern const char *acpi_gbl_lock_rule[]; | ||
| 136 | extern const char *acpi_gbl_access_types[]; | ||
| 137 | extern const char *acpi_gbl_update_rules[]; | ||
| 138 | extern const char *acpi_gbl_match_ops[]; | ||
| 139 | |||
| 140 | extern struct acpi_dmtable_info acpi_dm_table_info_asf0[]; | ||
| 141 | extern struct acpi_dmtable_info acpi_dm_table_info_asf1[]; | ||
| 142 | extern struct acpi_dmtable_info acpi_dm_table_info_asf2[]; | ||
| 143 | extern struct acpi_dmtable_info acpi_dm_table_info_asf3[]; | ||
| 144 | extern struct acpi_dmtable_info acpi_dm_table_info_asf4[]; | ||
| 145 | extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[]; | ||
| 146 | extern struct acpi_dmtable_info acpi_dm_table_info_boot[]; | ||
| 147 | extern struct acpi_dmtable_info acpi_dm_table_info_cpep[]; | ||
| 148 | extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[]; | ||
| 149 | extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[]; | ||
| 150 | extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[]; | ||
| 151 | extern struct acpi_dmtable_info acpi_dm_table_info_facs[]; | ||
| 152 | extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[]; | ||
| 153 | extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[]; | ||
| 154 | extern struct acpi_dmtable_info acpi_dm_table_info_gas[]; | ||
| 155 | extern struct acpi_dmtable_info acpi_dm_table_info_header[]; | ||
| 156 | extern struct acpi_dmtable_info acpi_dm_table_info_hpet[]; | ||
| 157 | extern struct acpi_dmtable_info acpi_dm_table_info_madt[]; | ||
| 158 | extern struct acpi_dmtable_info acpi_dm_table_info_madt0[]; | ||
| 159 | extern struct acpi_dmtable_info acpi_dm_table_info_madt1[]; | ||
| 160 | extern struct acpi_dmtable_info acpi_dm_table_info_madt2[]; | ||
| 161 | extern struct acpi_dmtable_info acpi_dm_table_info_madt3[]; | ||
| 162 | extern struct acpi_dmtable_info acpi_dm_table_info_madt4[]; | ||
| 163 | extern struct acpi_dmtable_info acpi_dm_table_info_madt5[]; | ||
| 164 | extern struct acpi_dmtable_info acpi_dm_table_info_madt6[]; | ||
| 165 | extern struct acpi_dmtable_info acpi_dm_table_info_madt7[]; | ||
| 166 | extern struct acpi_dmtable_info acpi_dm_table_info_madt8[]; | ||
| 167 | extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[]; | ||
| 168 | extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[]; | ||
| 169 | extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[]; | ||
| 170 | extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[]; | ||
| 171 | extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[]; | ||
| 172 | extern struct acpi_dmtable_info acpi_dm_table_info_sbst[]; | ||
| 173 | extern struct acpi_dmtable_info acpi_dm_table_info_slit[]; | ||
| 174 | extern struct acpi_dmtable_info acpi_dm_table_info_spcr[]; | ||
| 175 | extern struct acpi_dmtable_info acpi_dm_table_info_spmi[]; | ||
| 176 | extern struct acpi_dmtable_info acpi_dm_table_info_srat[]; | ||
| 177 | extern struct acpi_dmtable_info acpi_dm_table_info_srat0[]; | ||
| 178 | extern struct acpi_dmtable_info acpi_dm_table_info_srat1[]; | ||
| 179 | extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[]; | ||
| 180 | extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[]; | ||
| 181 | |||
| 182 | /* | ||
| 183 | * dmtable | ||
| 184 | */ | ||
| 185 | void acpi_dm_dump_data_table(struct acpi_table_header *table); | ||
| 186 | |||
| 187 | void | ||
| 188 | acpi_dm_dump_table(u32 table_length, | ||
| 189 | u32 table_offset, | ||
| 190 | void *table, | ||
| 191 | u32 sub_table_length, struct acpi_dmtable_info *info); | ||
| 192 | |||
| 193 | void acpi_dm_line_header(u32 offset, u32 byte_length, char *name); | ||
| 194 | |||
| 195 | void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value); | ||
| 196 | |||
| 197 | /* | ||
| 198 | * dmtbdump | ||
| 199 | */ | ||
| 200 | void acpi_dm_dump_asf(struct acpi_table_header *table); | ||
| 201 | |||
| 202 | void acpi_dm_dump_cpep(struct acpi_table_header *table); | ||
| 203 | |||
| 204 | void acpi_dm_dump_fadt(struct acpi_table_header *table); | ||
| 205 | |||
| 206 | void acpi_dm_dump_srat(struct acpi_table_header *table); | ||
| 207 | |||
| 208 | void acpi_dm_dump_mcfg(struct acpi_table_header *table); | ||
| 209 | |||
| 210 | void acpi_dm_dump_madt(struct acpi_table_header *table); | ||
| 211 | |||
| 212 | u32 acpi_dm_dump_rsdp(struct acpi_table_header *table); | ||
| 213 | |||
| 214 | void acpi_dm_dump_rsdt(struct acpi_table_header *table); | ||
| 215 | |||
| 216 | void acpi_dm_dump_slit(struct acpi_table_header *table); | ||
| 217 | |||
| 218 | void acpi_dm_dump_xsdt(struct acpi_table_header *table); | ||
| 219 | |||
| 80 | /* | 220 | /* |
| 81 | * dmwalk | 221 | * dmwalk |
| 82 | */ | 222 | */ |
| @@ -84,6 +224,11 @@ void | |||
| 84 | acpi_dm_disassemble(struct acpi_walk_state *walk_state, | 224 | acpi_dm_disassemble(struct acpi_walk_state *walk_state, |
| 85 | union acpi_parse_object *origin, u32 num_opcodes); | 225 | union acpi_parse_object *origin, u32 num_opcodes); |
| 86 | 226 | ||
| 227 | void | ||
| 228 | acpi_dm_walk_parse_tree(union acpi_parse_object *op, | ||
| 229 | asl_walk_callback descending_callback, | ||
| 230 | asl_walk_callback ascending_callback, void *context); | ||
| 231 | |||
| 87 | /* | 232 | /* |
| 88 | * dmopcode | 233 | * dmopcode |
| 89 | */ | 234 | */ |
| @@ -166,6 +311,7 @@ void acpi_dm_dump_integer64(u64 value, char *name); | |||
| 166 | 311 | ||
| 167 | void | 312 | void |
| 168 | acpi_dm_resource_template(struct acpi_op_walk_info *info, | 313 | acpi_dm_resource_template(struct acpi_op_walk_info *info, |
| 314 | union acpi_parse_object *op, | ||
| 169 | u8 * byte_data, u32 byte_count); | 315 | u8 * byte_data, u32 byte_count); |
| 170 | 316 | ||
| 171 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); | 317 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); |
| @@ -176,6 +322,8 @@ void acpi_dm_bit_list(u16 mask); | |||
| 176 | 322 | ||
| 177 | void acpi_dm_decode_attribute(u8 attribute); | 323 | void acpi_dm_decode_attribute(u8 attribute); |
| 178 | 324 | ||
| 325 | void acpi_dm_descriptor_name(void); | ||
| 326 | |||
| 179 | /* | 327 | /* |
| 180 | * dmresrcl | 328 | * dmresrcl |
| 181 | */ | 329 | */ |
| @@ -248,6 +396,15 @@ acpi_dm_vendor_small_descriptor(union aml_resource *resource, | |||
| 248 | /* | 396 | /* |
| 249 | * dmutils | 397 | * dmutils |
| 250 | */ | 398 | */ |
| 251 | void acpi_dm_add_to_external_list(char *path); | 399 | void acpi_dm_add_to_external_list(char *path, u8 type, u32 value); |
| 400 | |||
| 401 | /* | ||
| 402 | * dmrestag | ||
| 403 | */ | ||
| 404 | void acpi_dm_find_resources(union acpi_parse_object *root); | ||
| 405 | |||
| 406 | void | ||
| 407 | acpi_dm_check_resource_reference(union acpi_parse_object *op, | ||
| 408 | struct acpi_walk_state *walk_state); | ||
| 252 | 409 | ||
| 253 | #endif /* __ACDISASM_H__ */ | 410 | #endif /* __ACDISASM_H__ */ |
