48 #define _COMPONENT ACPI_UTILITIES
50 #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
55 const char *acpi_gbl_bm_decode[] = {
60 const char *acpi_gbl_config_decode[] = {
61 "0 - Good Configuration",
62 "1 - Acceptable Configuration",
63 "2 - Suboptimal Configuration",
64 "3 - ***Invalid Configuration***",
67 const char *acpi_gbl_consume_decode[] = {
72 const char *acpi_gbl_dec_decode[] = {
77 const char *acpi_gbl_he_decode[] = {
82 const char *acpi_gbl_io_decode[] = {
87 const char *acpi_gbl_ll_decode[] = {
92 const char *acpi_gbl_max_decode[] = {
97 const char *acpi_gbl_mem_decode[] = {
104 const char *acpi_gbl_min_decode[] = {
109 const char *acpi_gbl_mtp_decode[] = {
110 "AddressRangeMemory",
111 "AddressRangeReserved",
116 const char *acpi_gbl_rng_decode[] = {
123 const char *acpi_gbl_rw_decode[] = {
128 const char *acpi_gbl_shr_decode[] = {
133 const char *acpi_gbl_siz_decode[] = {
140 const char *acpi_gbl_trs_decode[] = {
145 const char *acpi_gbl_ttp_decode[] = {
150 const char *acpi_gbl_typ_decode[] = {
157 const char *acpi_gbl_ppc_decode[] = {
164 const char *acpi_gbl_ior_decode[] = {
166 "IoRestrictionInputOnly",
167 "IoRestrictionOutputOnly",
168 "IoRestrictionNoneAndPreserve"
171 const char *acpi_gbl_dts_decode[] = {
182 const char *acpi_gbl_ct_decode[] = {
189 const char *acpi_gbl_sbt_decode[] = {
190 "/* UNKNOWN serial bus type */",
198 const char *acpi_gbl_am_decode[] = {
199 "AddressingMode7Bit",
200 "AddressingMode10Bit"
205 const char *acpi_gbl_sm_decode[] = {
206 "ControllerInitiated",
212 const char *acpi_gbl_wm_decode[] = {
219 const char *acpi_gbl_cph_decode[] = {
226 const char *acpi_gbl_cpo_decode[] = {
233 const char *acpi_gbl_dp_decode[] = {
240 const char *acpi_gbl_ed_decode[] = {
247 const char *acpi_gbl_bpb_decode[] = {
253 "/* UNKNOWN Bits per byte */",
254 "/* UNKNOWN Bits per byte */",
255 "/* UNKNOWN Bits per byte */"
260 const char *acpi_gbl_sb_decode[] = {
263 "StopBitsOnePlusHalf",
269 const char *acpi_gbl_fc_decode[] = {
271 "FlowControlHardware",
273 "/* UNKNOWN flow control keyword */"
278 const char *acpi_gbl_pt_decode[] = {
284 "/* UNKNOWN parity keyword */",
285 "/* UNKNOWN parity keyword */",
286 "/* UNKNOWN parity keyword */"
347 static const u8 acpi_gbl_resource_types[] = {
391 #ifdef ACPI_ASL_COMPILER
392 #define ACPI_RESOURCE_ERROR(plist)
394 #define ACPI_RESOURCE_ERROR(plist) ACPI_ERROR(plist)
416 acpi_size aml_length,
424 u8 end_tag[2] = { 0x79, 0x00 };
436 end_aml = aml + aml_length;
440 while (aml < end_aml) {
461 user_function(aml, length, offset, resource_index,
476 if ((aml + 1) >= end_aml) {
482 if (!user_function) {
503 user_function(end_tag, 2, offset, resource_index, context);
552 goto invalid_resource;
559 resource_index = (
u8) (resource_type - 0x70);
565 resource_index = (
u8)
573 if (!acpi_gbl_resource_types[resource_index]) {
574 goto invalid_resource;
582 minimum_resource_length = acpi_gbl_resource_aml_sizes[resource_index];
586 switch (acpi_gbl_resource_types[resource_index]) {
591 if (resource_length != minimum_resource_length) {
592 goto bad_resource_length;
600 if (resource_length < minimum_resource_length) {
601 goto bad_resource_length;
609 if ((resource_length > minimum_resource_length) ||
610 (resource_length < (minimum_resource_length - 1))) {
611 goto bad_resource_length;
619 goto invalid_resource;
631 "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
641 *return_index = resource_index;
649 "Invalid/unsupported resource descriptor: Type 0x%2.2X",
656 "Invalid resource descriptor length: Type "
657 "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
658 resource_type, resource_length,
659 minimum_resource_length));
734 return (resource_length);
812 if (!obj_desc->
buffer.length) {
813 *end_tag = obj_desc->
buffer.pointer;