/* * First table entry must be ACPI_RSC_INITxxx and must contain the * table length (# of table entries)
*/
count = INIT_TABLE_LENGTH(info); while (count) {
target = NULL;
/* * Source is the external AML byte stream buffer, * destination is the internal resource descriptor
*/
source = ACPI_ADD_PTR(void, aml, info->aml_offset);
destination =
ACPI_ADD_PTR(void, resource, info->resource_offset);
switch (info->opcode) { case ACPI_RSC_INITGET: /* * Get the resource type and the initial (minimum) length
*/
memset(resource, 0, INIT_RESOURCE_LENGTH(info));
resource->type = INIT_RESOURCE_TYPE(info);
resource->length = INIT_RESOURCE_LENGTH(info); break;
case ACPI_RSC_INITSET: break;
case ACPI_RSC_FLAGINIT:
flags_mode = TRUE; break;
case ACPI_RSC_1BITFLAG: /* * Mask and shift the flag bit
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x01)); break;
case ACPI_RSC_2BITFLAG: /* * Mask and shift the flag bits
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x03)); break;
case ACPI_RSC_3BITFLAG: /* * Mask and shift the flag bits
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x07)); break;
case ACPI_RSC_6BITFLAG: /* * Mask and shift the flag bits
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x3F)); break;
case ACPI_RSC_COUNT_GPIO_RES: /* * Vendor data is optional (length/offset may both be zero) * Examine vendor data length field first
*/
target = ACPI_ADD_PTR(void, aml, (info->value + 2)); if (ACPI_GET16(target)) {
/* Use vendor offset to get resource source length */
target = ACPI_ADD_PTR(void, aml, info->value);
item_count =
ACPI_GET16(target) - ACPI_GET16(source);
} else { /* No vendor data to worry about */
case ACPI_RSC_MOVE8: case ACPI_RSC_MOVE16: case ACPI_RSC_MOVE32: case ACPI_RSC_MOVE64: /* * Raw data move. Use the Info value field unless item_count has * been previously initialized via a COUNT opcode
*/ if (info->value) {
item_count = info->value;
}
acpi_rs_move_data(destination, source, item_count,
info->opcode); break;
case ACPI_RSC_ADDRESS: /* * Common handler for address descriptor flags
*/ if (!acpi_rs_get_address_common(resource, aml)) {
return_ACPI_STATUS
(AE_AML_INVALID_RESOURCE_TYPE);
} break;
case ACPI_RSC_SOURCE: /* * Optional resource_source (Index and String)
*/
resource->length +=
acpi_rs_get_resource_source(aml_resource_length,
info->value,
destination, aml, NULL); break;
case ACPI_RSC_SOURCEX: /* * Optional resource_source (Index and String). This is the more * complicated case used by the Interrupt() macro
*/
target = ACPI_ADD_PTR(char, resource,
info->aml_offset +
(item_count * 4));
/******************************************************************************* * * 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. *
******************************************************************************/
case ACPI_RSC_FLAGINIT: /* * Clear the flag byte
*/
ACPI_SET8(destination, 0); break;
case ACPI_RSC_1BITFLAG: /* * Mask and shift the flag bit
*/
ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
((ACPI_GET8(source) & 0x01) << info->
value)); break;
case ACPI_RSC_2BITFLAG: /* * Mask and shift the flag bits
*/
ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
((ACPI_GET8(source) & 0x03) << info->
value)); break;
case ACPI_RSC_3BITFLAG: /* * Mask and shift the flag bits
*/
ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
((ACPI_GET8(source) & 0x07) << info->
value)); break;
case ACPI_RSC_6BITFLAG: /* * Mask and shift the flag bits
*/
ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
((ACPI_GET8(source) & 0x3F) << info->
value)); break;
/* Set the Resource Type, General Flags, and Type-Specific Flags */
acpi_rs_set_address_common(aml, resource); break;
case ACPI_RSC_SOURCEX: /* * Optional resource_source (Index and String)
*/
aml_length =
acpi_rs_set_resource_source(aml,
(acpi_rs_length)
aml_length, source);
acpi_rs_set_resource_length(aml_length, aml); break;
case ACPI_RSC_SOURCE: /* * Optional resource_source (Index and String). This is the more * complicated case used by the Interrupt() macro
*/
aml_length =
acpi_rs_set_resource_source(aml, info->value,
source);
acpi_rs_set_resource_length(aml_length, aml); break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.