/****************************************************************************** * * FUNCTION: acpi_hw_gpe_read * * PARAMETERS: value - Where the value is returned * reg - GPE register structure * * RETURN: Status * * DESCRIPTION: Read from a GPE register in either memory or IO space. * * LIMITATIONS: <These limitations also apply to acpi_hw_gpe_write> * space_ID must be system_memory or system_IO. *
******************************************************************************/
status = acpi_os_read_port((acpi_io_address)reg->address,
&value32, ACPI_GPE_REGISTER_WIDTH); if (ACPI_FAILURE(status))
return_ACPI_STATUS(status);
*value = (u64)value32;
return_ACPI_STATUS(AE_OK);
}
/****************************************************************************** * * FUNCTION: acpi_hw_gpe_write * * PARAMETERS: value - Value to be written * reg - GPE register structure * * RETURN: Status * * DESCRIPTION: Write to a GPE register in either memory or IO space. *
******************************************************************************/
/****************************************************************************** * * FUNCTION: acpi_hw_get_gpe_register_bit * * PARAMETERS: gpe_event_info - Info block for the GPE * * RETURN: Register mask with a one in the GPE bit position * * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the * correct position for the input GPE. *
******************************************************************************/
/****************************************************************************** * * FUNCTION: acpi_hw_low_set_gpe * * PARAMETERS: gpe_event_info - Info block for the GPE to be disabled * action - Enable or disable * * RETURN: Status * * DESCRIPTION: Enable or disable a single GPE in the parent enable register. * The enable_mask field of the involved GPE register must be * updated by the caller if necessary. *
******************************************************************************/
if (!(register_bit & gpe_register_info->mask_for_run)) {
/* Write the updated enable mask */
status = acpi_hw_gpe_write(enable_mask,
&gpe_register_info->enable_address);
} return (status);
}
/****************************************************************************** * * FUNCTION: acpi_hw_clear_gpe * * PARAMETERS: gpe_event_info - Info block for the GPE to be cleared * * RETURN: Status * * DESCRIPTION: Clear the status bit for a single GPE. *
******************************************************************************/
/* Get the info block for the entire GPE register */
gpe_register_info = gpe_event_info->register_info; if (!gpe_register_info) { return (AE_NOT_EXIST);
}
/* * Write a one to the appropriate bit in the status register to * clear this GPE.
*/
register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
status = acpi_hw_gpe_write(register_bit,
&gpe_register_info->status_address); return (status);
}
/****************************************************************************** * * FUNCTION: acpi_hw_get_gpe_status * * PARAMETERS: gpe_event_info - Info block for the GPE to queried * event_status - Where the GPE status is returned * * RETURN: Status * * DESCRIPTION: Return the status of a single GPE. *
******************************************************************************/
/****************************************************************************** * * FUNCTION: acpi_hw_gpe_enable_write * * PARAMETERS: enable_mask - Bit mask to write to the GPE register * gpe_register_info - Gpe Register info * * RETURN: Status * * DESCRIPTION: Write the enable mask byte to the given GPE register. *
******************************************************************************/
status =
acpi_hw_gpe_enable_write(0x00,
&gpe_block->register_info[i]); if (ACPI_FAILURE(status)) { return (status);
}
}
return (AE_OK);
}
/****************************************************************************** * * FUNCTION: acpi_hw_clear_gpe_block * * PARAMETERS: gpe_xrupt_info - GPE Interrupt info * gpe_block - Gpe Block info * * RETURN: Status * * DESCRIPTION: Clear status bits for all GPEs within a single GPE block *
******************************************************************************/
/* NOTE: assumes that all GPEs are currently disabled */
/* Examine each GPE Register within the block */
for (i = 0; i < gpe_block->register_count; i++) {
gpe_register_info = &gpe_block->register_info[i]; if (!gpe_register_info->enable_for_run) { continue;
}
/* Enable all "runtime" GPEs in this register */
enable_mask = gpe_register_info->enable_for_run &
~gpe_register_info->mask_for_run;
status =
acpi_hw_gpe_enable_write(enable_mask, gpe_register_info); if (ACPI_FAILURE(status)) { return (status);
}
}
return (AE_OK);
}
/****************************************************************************** * * FUNCTION: acpi_hw_enable_wakeup_gpe_block * * PARAMETERS: gpe_xrupt_info - GPE Interrupt info * gpe_block - Gpe Block info * * RETURN: Status * * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes * combination wake/run GPEs. *
******************************************************************************/
/****************************************************************************** * * FUNCTION: acpi_hw_get_gpe_block_status * * PARAMETERS: gpe_xrupt_info - GPE Interrupt info * gpe_block - Gpe Block info * context - GPE list walk context data * * RETURN: Success * * DESCRIPTION: Produce a combined GPE status bits mask for the given block. *
******************************************************************************/
status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
return_ACPI_STATUS(status);
}
/****************************************************************************** * * FUNCTION: acpi_hw_check_all_gpes * * PARAMETERS: gpe_skip_device - GPE devoce of the GPE to skip * gpe_skip_number - Number of the GPE to skip * * RETURN: Combined status of all GPEs * * DESCRIPTION: Check all enabled GPEs in all GPE blocks, except for the one * represented by the "skip" arguments, and return TRUE if the * status bit is set for at least one of them of FALSE otherwise. *
******************************************************************************/
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.