static int cm_stop( void ) /************************/ { struct itimerspec timer; if( MouseInstalled ) { timer.it_value.tv_sec = 0; timer.it_value.tv_nsec = 0; reltimer( MouseTimer, &timer, NULL ); mouse_read( MouseCtrl, NULL, 0, -1, 0 ); while( Creceive( UILocalProxy, 0, 0 ) > 0 ) {} } return( 0 ); }
int Loop() { pid_t pid; int status; while(link_count > 0) { pid = Receive(0, &msg, sizeof(msg)); if(pid == -1) { if(errno != EINTR) { Log("Receive() failed: [%d] %s", ERR(errno)); } continue; } if(pid == IrqProxy()) { while(Creceive(pid, 0, 0) == pid) ; // clear out any proxy overruns add_interrupt_randomness(options.irq); // Log("Irq: random size %d\n", get_random_size()); // now that we have more entropy... SelectTrigger(); DoReadQueue(); continue; } status = Service(pid, &msg); Log("Service() returned status %d (%s), link_count %d", status, status == -1 ? "none" : strerror(status), link_count); if(status >= EOK) { msg.status = status; ReplyMsg(pid, &msg, sizeof(msg.status)); } } return 0; }