rem: if (io_vectors[vector].handler_list.next == &io_vectors[vector].handler_list) { dprintf("unhandled io interrupt %d\n", vector); } else { struct io_handler *io;  for (io = io_vectors[vector].handler_list.next; io != &io_vectors[vector].handler_list; io = io->next) { if ((ret = io->func(io->data)) != B_UNHANDLED_INTERRUPT) break; } }
add: if (io_vectors[vector].handler_list.next == &io_vectors[vector].handler_list || io_vectors[vector].handler_list.next == NULL) { dprintf("unhandled io interrupt %d\n", vector); return B_UNHANDLED_INTERRUPT; }
context: int_io_interrupt_handler(int vector){ 	int ret = B_UNHANDLED_INTERRUPT; 	acquire_spinlock(&io_vectors[vector].vector_lock); 	if (io_vectors[vector].handler_list.next == &io_vectors[vector].handler_list) { 		dprintf("unhandled io interrupt %d\n", vector); 	} else { 		struct io_handler *io; 		/* Loop through the list of handlers. 		 * each handler returns as follows...		 * - B_UNHANDLED_INTERRUPT, the interrupt wasn't processed by the		 *                          fucntion, so try the next available.		 * - B_HANDLED_INTERRUPT, the interrupt has been handled and no further		 *                        attention is required		 * - B_INVOKE_SCHEDULER, the interrupt has been handled, but the function wants		 *                       the scheduler to be invoked		 *		 * XXX - this is a change of behaviour from newos where every handler registered		 *       be called, even if the interrupt had been "handled" by a previous		 *       function.		 *       The logic now is that if there are no handlers then we return		 *       B_UNHANDLED_INTERRUPT and let the system do as it will.		 *       When we have the first function that claims to have "handled" the		 *       interrupt, by returning B_HANDLED_... or B_INVOKE_SCHEDULER we simply		 *       stop calling further handlers and return the value from that		 *       handler.		 *       This may not be correct but appears to be what BeOS did and seems		 *       right.		 */		for (io = io_vectors[vector].handler_list.next; 		     io != &io_vectors[vector].handler_list; //XXX DOES this work for 1 entry?		     io = io->next) {			if ((ret = io->func(io->data)) != B_UNHANDLED_INTERRUPT)				break;		} 	} 	release_spinlock(&io_vectors[vector].vector_lock); 	return ret; }