// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /******************************************************************************* * * Module Name: rsmisc - Miscellaneous resource descriptors * ******************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acresrc.h" #define _COMPONENT … ACPI_MODULE_NAME("rsmisc") #define INIT_RESOURCE_TYPE(i) … #define INIT_RESOURCE_LENGTH(i) … #define INIT_TABLE_LENGTH(i) … #define COMPARE_OPCODE(i) … #define COMPARE_TARGET(i) … #define COMPARE_VALUE(i) … /******************************************************************************* * * FUNCTION: acpi_rs_convert_aml_to_resource * * PARAMETERS: resource - Pointer to the resource descriptor * aml - Where the AML descriptor is returned * info - Pointer to appropriate conversion table * * RETURN: Status * * DESCRIPTION: Convert an external AML resource descriptor to the corresponding * internal resource descriptor * ******************************************************************************/ acpi_status acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, union aml_resource *aml, struct acpi_rsconvert_info *info) { … } /******************************************************************************* * * FUNCTION: acpi_rs_convert_resource_to_aml * * PARAMETERS: resource - Pointer to the resource descriptor * aml - Where the AML descriptor is returned * info - Pointer to appropriate conversion table * * RETURN: Status * * DESCRIPTION: Convert an internal resource descriptor to the corresponding * external AML resource descriptor. * ******************************************************************************/ acpi_status acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, union aml_resource *aml, struct acpi_rsconvert_info *info) { … } #if 0 /* Previous resource validations */ if (aml->ext_address64.revision_ID != AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { return_ACPI_STATUS(AE_SUPPORT); } if (resource->data.start_dpf.performance_robustness >= 3) { return_ACPI_STATUS(AE_AML_BAD_RESOURCE_VALUE); } if (((aml->irq.flags & 0x09) == 0x00) || ((aml->irq.flags & 0x09) == 0x09)) { /* * Only [active_high, edge_sensitive] or [active_low, level_sensitive] * polarity/trigger interrupts are allowed (ACPI spec, section * "IRQ Format"), so 0x00 and 0x09 are illegal. */ ACPI_ERROR((AE_INFO, "Invalid interrupt polarity/trigger in resource list, 0x%X", aml->irq.flags)); return_ACPI_STATUS(AE_BAD_DATA); } resource->data.extended_irq.interrupt_count = temp8; if (temp8 < 1) { /* Must have at least one IRQ */ return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH); } if (resource->data.dma.transfer == 0x03) { ACPI_ERROR((AE_INFO, "Invalid DMA.Transfer preference (3)")); return_ACPI_STATUS(AE_BAD_DATA); } #endif