Ejemplo n.º 1
0
 void debug_print(PtrLen<const char> str)
  {
   if( Dev::IsIntContext() )
     {
      fifo.put(str);
     }
   else
     {
      print(str);
     }
  }
Ejemplo n.º 2
0
   void print(PtrLen<const char> str)
    {
     SingleHook<Video::VideoConsole> hook(host);

     if( +hook )
       {
        fifo.get(*hook);

        hook->print(str);
       }
     else
       {
        fifo.put(str);
       }
    }
Ejemplo n.º 3
0
  void run () {
    int  cnt = 0;
    xprintf("sender\n");
    while(1) {
      cnt++;
      bool ok = fifo.put(cnt);
      if (ok) { 
        PRINTF("Sending %d\n", cnt);
      } else {
        PRINTF("Fifo full\n");
      }	
      if ((cnt % 15) == 0) {
        PRINTF("Wainting 3 seconds\n");
	suspendCallerUntil(NOW() + 3*SECONDS);
      }
    }
  }