Advertisement
Guest User

Untitled

a guest
May 27th, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.48 KB | None | 0 0
  1. ithread_loop()
  2.                 /*
  3.                  * Service interrupts.  If another interrupt arrives while
  4.                  * we are running, it will set it_need to note that we
  5.                  * should make another pass.
  6.                  */
  7.                 while (ithd->it_need) {
  8.                         /*
  9.                          * This might need a full read and write barrier
  10.                          * to make sure that this write posts before any
  11.                          * of the memory or device accesses in the
  12.                          * handlers.
  13.                          */
  14.                         atomic_store_rel_int(&ithd->it_need, 0);
  15.                         ithread_execute_handlers(p, ie);
  16.                 }
  17.  
  18.  
  19.  
  20. ......
  21. intr_event_schedule_thread()
  22.         /*              
  23.          * Set it_need to tell the thread to keep running if it is already
  24.          * running.  Then, lock the thread and see if we actually need to
  25.          * put it on the runqueue.
  26.          */    
  27.         it->it_need = 1;
  28.         thread_lock(td);
  29.         if (TD_AWAITING_INTR(td)) {
  30.                 CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid,
  31.                     td->td_name);
  32.                 TD_CLR_IWAIT(td);
  33.                 sched_add(td, SRQ_INTR);
  34.         } else {
  35.                 CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d",
  36.                     __func__, p->p_pid, td->td_name, it->it_need, td->td_state);
  37.         }
  38.         thread_unlock(td);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement