FADT.sci_interrupt 的产生

来源:互联网 发布:淘宝大表情 编辑:程序博客网 时间:2024/05/29 11:19
acpi_enable_subsystem->acpi_ev_install_xrupt_handlers->acpi_ev_install_sci_handler
u32 acpi_ev_install_sci_handler(void)
{
    u32 status = AE_OK;

    ACPI_FUNCTION_TRACE(ev_install_sci_handler);

    status =
        acpi_os_install_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
                          acpi_ev_sci_xrupt_handler,
                          acpi_gbl_gpe_xrupt_list_head);
    return_ACPI_STATUS(status);
}
acpi_ev_install_sci_handler 就会为acpi_gbl_FADT.sci_interrupt 注册中断函数,这样当uefi执行notify函数的时候就会调用acpi_ev_sci_xrupt_handler
acpi_ev_fixed_event_detect->acpi_ev_fixed_event_detect
u32 acpi_ev_fixed_event_detect(void)
{
    u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
    u32 fixed_status;
    u32 fixed_enable;
    u32 i;

    ACPI_FUNCTION_NAME(ev_fixed_event_detect);

    /*
     * Read the fixed feature status and enable registers, as all the cases
     * depend on their values. Ignore errors here.
     */
    (void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
    (void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);

    ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
              "Fixed Event Block: Enable %08X Status %08X\n",
              fixed_enable, fixed_status));

    /*
     * Check for all possible Fixed Events and dispatch those that are active
     */
    for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {

        /* Both the status and enable bits must be on for this event */

        if ((fixed_status & acpi_gbl_fixed_event_info[i].
             status_bit_mask)
            && (fixed_enable & acpi_gbl_fixed_event_info[i].
            enable_bit_mask)) {
            /*
             * Found an active (signalled) event. Invoke global event
             * handler if present.
             */
            acpi_fixed_event_count[i]++;
            if (acpi_gbl_global_event_handler) {
                acpi_gbl_global_event_handler
                    (ACPI_EVENT_TYPE_FIXED, NULL, i,
                     acpi_gbl_global_event_handler_context);
            }

            int_status |= acpi_ev_fixed_event_dispatch(i);
        }
    }

    return (int_status);
}
acpi_ev_fixed_event_detect 就会根据event 来调用对应的handler,针对button.c 就是acpi_device_fixed_event
0 0
原创粉丝点击