Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

7.4.2.  Signal and event handling

During initialization of the xterm the SystemC event, ioEvent is allocated:

  ioEvent = new sc_core::sc_event();
	  

When ioHandler is called in response to a Linux SIGIO event, it does not know which pseudo-TTY was responsible. The file descriptor responsible is identified by using an operating system select call. Using the mappings in instList, the corresponding class instance can be identified and its ioEvent notified.

  for( Fd2Inst *cur = instList; cur != NULL ; cur = cur->next ) {
    if( FD_ISSET( cur->fd, &readFdSet )) {
      (cur->inst)->ioEvent->notify();
    }
  }
	  

This event then allows the xtermThread to run and read a character.

Embecosm divider strip