Пример #1
0
void GPIOB25_Handler(int gpio_num)
{
      //Linux Console
   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
	   void rs_interrupt(int irq, void * dev_id, struct pt_regs * regs) ;
	   rs_interrupt( GPIOINT_UART1, NULL, NULL ) ;
   #endif
   ClearGPIOIntStatus(GPIOINT_UART1);  
}
Пример #2
0
/*===========================================================================*
 *				tty_task				     *
 *===========================================================================*/
int main(void)
{
/* Main routine of the terminal task. */

  message tty_mess;		/* buffer for all incoming messages */
  int ipc_status;
  int line;
  int r;
  register tty_t *tp;

  /* SEF local startup. */
  sef_local_startup();
  while (TRUE) {
	/* Check for and handle any events on any of the ttys. */
	for (tp = FIRST_TTY; tp < END_TTY; tp++) {
		if (tp->tty_events) handle_events(tp);
	}

	/* Get a request message. */
	r= driver_receive(ANY, &tty_mess, &ipc_status);
	if (r != 0)
		panic("driver_receive failed with: %d", r);

	/* First handle all kernel notification types that the TTY supports. 
	 *  - An alarm went off, expire all timers and handle the events. 
	 *  - A hardware interrupt also is an invitation to check for events. 
	 *  - A new kernel message is available for printing.
	 *  - Reset the console on system shutdown. 
	 * Then see if this message is different from a normal device driver
	 * request and should be handled separately. These extra functions
	 * do not operate on a device, in constrast to the driver requests. 
	 */

	if (is_ipc_notify(ipc_status)) {
		switch (_ENDPOINT_P(tty_mess.m_source)) {
			case CLOCK:
				/* run watchdogs of expired timers */
				expire_timers(tty_mess.m_notify.timestamp);
				break;
			case HARDWARE: 
				/* hardware interrupt notification */

#if NR_RS_LINES > 0
				/* serial I/O */
				if (tty_mess.m_notify.interrupts & rs_irq_set)
					rs_interrupt(&tty_mess);
#endif
				/* run watchdogs of expired timers */
				expire_timers(tty_mess.m_notify.timestamp);
				break;
			default:
				/* do nothing */
				break;
		}

		/* done, get new message */
		continue;
	}

	switch (tty_mess.m_type) { 
	case TTY_FKEY_CONTROL:		/* (un)register a fkey observer */
		do_fkey_ctl(&tty_mess);
		continue;
	case TTY_INPUT_UP:
	case TTY_INPUT_EVENT:
		do_input(&tty_mess);
		continue;
	default:			/* should be a driver request */
		;			/* do nothing; end switch */
	}

	if (!IS_CDEV_RQ(tty_mess.m_type)) {
		chardriver_process(&tty_tab, &tty_mess, ipc_status);
		continue;
	}

	/* Only device requests should get to this point.
	 * All requests have a minor device number.
	 */
	if (OK != chardriver_get_minor(&tty_mess, &line))
		continue;

	if (line == VIDEO_MINOR) {
		do_video(&tty_mess, ipc_status);
		continue;
	}

	/* Execute the requested device driver function. */
	chardriver_process(&tty_tab, &tty_mess, ipc_status);
  }

  return 0;
}