Exemple #1
0
int loapic_resume(struct device *port, int pm_policy)
{
	int loapic_irq;

	ARG_UNUSED(port);

	if (pm_policy != SYS_PM_DEEP_SLEEP) {
		return 0;
	}

	/* Assuming all loapic device registers lose their state, the call to
	 * _loapic_init(), should bring all the registers to a sane state.
	 */
	_loapic_init(NULL);

	for (loapic_irq = 0; loapic_irq < LOAPIC_IRQ_COUNT; loapic_irq++) {

		if (_irq_to_interrupt_vector[LOAPIC_IRQ_BASE + loapic_irq]) {
			/* Configure vector and enable the required ones*/
			_loapic_int_vec_set(loapic_irq,
				_irq_to_interrupt_vector[LOAPIC_IRQ_BASE + loapic_irq]);

			if (sys_bitfield_test_bit((mem_addr_t) loapic_suspend_buf,
							loapic_irq)) {
				_loapic_irq_enable(loapic_irq);
			}
		}
	}

	return 0;
}
Exemple #2
0
static inline void loapicInit(void)
{
	_loapic_init();
}