rem: TRACE(("got interrupt after %Lu us\n",duration));
context: bool interrupt_test(void){	bool *testresult;	bool result;	bigtime_t duration;	int i;	TRACE(("testing if interrupt is working\n"));		// our stack is not mapped in interrupt context, we must use malloc	// to have a valid pointer inside the interrupt handler	testresult = malloc(sizeof(bool)); 	*testresult = false; // assume it's not working		install_io_interrupt_handler(config->irq, ich_test_int, testresult, 0);	// clear status bits	ich_reg_write_16(chan_po->regbase + ICH_REG_X_SR, SR_FIFOE | SR_BCIS | SR_LVBCI); 	// start transfer of 1 buffer	ich_reg_write_8(chan_po->regbase + ICH_REG_X_LVI, (ich_reg_read_8(chan_po->regbase + ICH_REG_X_LVI) + 1) % ICH_BD_COUNT);	// enable interrupts & busmaster transfer	ich_reg_write_8(chan_po->regbase + ICH_REG_X_CR, CR_RPBM | CR_LVBIE | CR_IOCE);	// the interrupt handler will set *testresult to true	duration = system_time();	for (i = 0; i < 500; i++) {		if (*testresult)			break;		else			snooze(1000); // 1 ms	}	duration = system_time() - duration;	// disable interrupts & busmaster transfer	ich_reg_write_8(chan_po->regbase + ICH_REG_X_CR, 0);	snooze(25000);	remove_io_interrupt_handler(config->irq, ich_test_int, testresult);	result = *testresult;	free(testresult);	#if DEBUG		if (result) {			TRACE(("got interrupt after %Lu us\n",duration));			LOG(("got interrupt after %Lu us\n",duration));		} else {			TRACE(("no interrupt, timeout after %Lu us\n",duration));			LOG(("no interrupt, timeout after %Lu us\n",duration));		}	#endif	return result;}