Example #1
0
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_int,
						   acpi_ev_sci_xrupt_handler,
						   acpi_gbl_gpe_xrupt_list_head);
	return_ACPI_STATUS(status);
}
Example #2
0
u32
acpi_ev_install_sci_handler (void)
{
	u32                     except = AE_OK;


	except = acpi_os_install_interrupt_handler ((u32) acpi_gbl_FADT->sci_int,
			  acpi_ev_sci_handler,
			  NULL);

	return (except);
}
Example #3
0
u32
acpi_ev_install_sci_handler (void)
{
	u32                     status = AE_OK;


	FUNCTION_TRACE ("Ev_install_sci_handler");


	status = acpi_os_install_interrupt_handler ((u32) acpi_gbl_FADT->sci_int,
			   acpi_ev_sci_handler, NULL);
	return_ACPI_STATUS (status);
}
Example #4
0
static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
                                   interrupt_number)
{
    struct acpi_gpe_xrupt_info *next_gpe_xrupt;
    struct acpi_gpe_xrupt_info *gpe_xrupt;
    acpi_status status;
    acpi_cpu_flags flags;

    ACPI_FUNCTION_TRACE(ev_get_gpe_xrupt_block);

    /* No need for lock since we are not changing any list elements here */

    next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
    while (next_gpe_xrupt) {
        if (next_gpe_xrupt->interrupt_number == interrupt_number) {
            return_PTR(next_gpe_xrupt);
        }

        next_gpe_xrupt = next_gpe_xrupt->next;
    }

    /* Not found, must allocate a new xrupt descriptor */

    gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info));
    if (!gpe_xrupt) {
        return_PTR(NULL);
    }

    gpe_xrupt->interrupt_number = interrupt_number;

    /* Install new interrupt descriptor with spin lock */

    flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
    if (acpi_gbl_gpe_xrupt_list_head) {
        next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
        while (next_gpe_xrupt->next) {
            next_gpe_xrupt = next_gpe_xrupt->next;
        }

        next_gpe_xrupt->next = gpe_xrupt;
        gpe_xrupt->previous = next_gpe_xrupt;
    } else {
        acpi_gbl_gpe_xrupt_list_head = gpe_xrupt;
    }
    acpi_os_release_lock(acpi_gbl_gpe_lock, flags);

    /* Install new interrupt handler if not SCI_INT */

    if (interrupt_number != acpi_gbl_FADT.sci_interrupt) {
        status = acpi_os_install_interrupt_handler(interrupt_number,
                               acpi_ev_gpe_xrupt_handler,
                               gpe_xrupt);
        if (ACPI_FAILURE(status)) {
            ACPI_ERROR((AE_INFO,
                    "Could not install GPE interrupt handler at level 0x%X",
                    interrupt_number));
            return_PTR(NULL);
        }
    }

    return_PTR(gpe_xrupt);
}
Example #5
0
static struct acpi_gpe_xrupt_info *
acpi_ev_get_gpe_xrupt_block (
	u32                             interrupt_level)
{
	struct acpi_gpe_xrupt_info      *next_gpe_xrupt;
	struct acpi_gpe_xrupt_info      *gpe_xrupt;
	acpi_status                     status;


	ACPI_FUNCTION_TRACE ("ev_get_gpe_xrupt_block");


	/* No need for spin lock since we are not changing any list elements here */

	next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
	while (next_gpe_xrupt) {
		if (next_gpe_xrupt->interrupt_level == interrupt_level) {
			return_PTR (next_gpe_xrupt);
		}

		next_gpe_xrupt = next_gpe_xrupt->next;
	}

	/* Not found, must allocate a new xrupt descriptor */

	gpe_xrupt = ACPI_MEM_CALLOCATE (sizeof (struct acpi_gpe_xrupt_info));
	if (!gpe_xrupt) {
		return_PTR (NULL);
	}

	gpe_xrupt->interrupt_level = interrupt_level;

	/* Install new interrupt descriptor with spin lock */

	acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);
	if (acpi_gbl_gpe_xrupt_list_head) {
		next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
		while (next_gpe_xrupt->next) {
			next_gpe_xrupt = next_gpe_xrupt->next;
		}

		next_gpe_xrupt->next = gpe_xrupt;
		gpe_xrupt->previous = next_gpe_xrupt;
	}
	else {
		acpi_gbl_gpe_xrupt_list_head = gpe_xrupt;
	}
	acpi_os_release_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);

	/* Install new interrupt handler if not SCI_INT */

	if (interrupt_level != acpi_gbl_FADT->sci_int) {
		status = acpi_os_install_interrupt_handler (interrupt_level,
				 acpi_ev_gpe_xrupt_handler, gpe_xrupt);
		if (ACPI_FAILURE (status)) {
			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
				"Could not install GPE interrupt handler at level 0x%X\n",
				interrupt_level));
			return_PTR (NULL);
		}
	}

	return_PTR (gpe_xrupt);
}
struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 interrupt_number)
{
	struct acpi_gpe_xrupt_info *next_gpe_xrupt;
	struct acpi_gpe_xrupt_info *gpe_xrupt;
	acpi_status status;
	acpi_cpu_flags flags;

	ACPI_FUNCTION_TRACE(ev_get_gpe_xrupt_block);

	

	next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
	while (next_gpe_xrupt) {
		if (next_gpe_xrupt->interrupt_number == interrupt_number) {
			return_PTR(next_gpe_xrupt);
		}

		next_gpe_xrupt = next_gpe_xrupt->next;
	}

	

	gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info));
	if (!gpe_xrupt) {
		return_PTR(NULL);
	}

	gpe_xrupt->interrupt_number = interrupt_number;

	

	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
	if (acpi_gbl_gpe_xrupt_list_head) {
		next_gpe_xrupt = acpi_gbl_gpe_xrupt_list_head;
		while (next_gpe_xrupt->next) {
			next_gpe_xrupt = next_gpe_xrupt->next;
		}

		next_gpe_xrupt->next = gpe_xrupt;
		gpe_xrupt->previous = next_gpe_xrupt;
	} else {
		acpi_gbl_gpe_xrupt_list_head = gpe_xrupt;
	}
	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);

	

	if (interrupt_number != acpi_gbl_FADT.sci_interrupt) {
		status = acpi_os_install_interrupt_handler(interrupt_number,
							   acpi_ev_gpe_xrupt_handler,
							   gpe_xrupt);
		if (ACPI_FAILURE(status)) {
			ACPI_ERROR((AE_INFO,
				    "Could not install GPE interrupt handler at level 0x%X",
				    interrupt_number));
			return_PTR(NULL);
		}
	}

	return_PTR(gpe_xrupt);
}