[BACK]Return to evtchn.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / xen / xen

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/xen/xen/evtchn.c between version 1.35 and 1.36

version 1.35, 2008/04/14 13:38:03 version 1.36, 2008/04/19 13:46:12
Line 124  static int xen_misdirect_handler(void *)
Line 124  static int xen_misdirect_handler(void *)
   
 // #define IRQ_DEBUG 4  // #define IRQ_DEBUG 4
   
   /* http://mail-index.netbsd.org/port-amd64/2004/02/22/0000.html */
   #ifdef MULTIPROCESSOR
   
   /*
    * intr_biglock_wrapper: grab biglock and call a real interrupt handler.
    */
   
   int
   intr_biglock_wrapper(void *vp)
   {
           struct intrhand *ih = vp;
           int ret;
   
           KERNEL_LOCK(1, NULL);
   
           ret = (*ih->ih_realfun)(ih->ih_realarg);
   
           KERNEL_UNLOCK_ONE(NULL);
   
           return ret;
   }
   #endif /* MULTIPROCESSOR */
   
 void  void
 events_default_setup()  events_default_setup(void)
 {  {
         int i;          int i;
   
Line 151  events_default_setup()
Line 174  events_default_setup()
 }  }
   
 void  void
 init_events()  init_events(void)
 {  {
 #ifndef XEN3  #ifndef XEN3
         int evtch;          int evtch;
Line 238  evtchn_do_event(int evtch, struct intrfr
Line 261  evtchn_do_event(int evtch, struct intrfr
         ci->ci_ilevel = evtsource[evtch]->ev_maxlevel;          ci->ci_ilevel = evtsource[evtch]->ev_maxlevel;
         iplmask = evtsource[evtch]->ev_imask;          iplmask = evtsource[evtch]->ev_imask;
         sti();          sti();
 #ifdef MULTIPROCESSOR  
         x86_intlock(regs);  
 #endif  
         ih = evtsource[evtch]->ev_handlers;          ih = evtsource[evtch]->ev_handlers;
         while (ih != NULL) {          while (ih != NULL) {
                 if (ih->ih_level <= ilevel) {                  if (ih->ih_level <= ilevel) {
Line 248  evtchn_do_event(int evtch, struct intrfr
Line 268  evtchn_do_event(int evtch, struct intrfr
                 if (evtch == IRQ_DEBUG)                  if (evtch == IRQ_DEBUG)
                     printf("ih->ih_level %d <= ilevel %d\n", ih->ih_level, ilevel);                      printf("ih->ih_level %d <= ilevel %d\n", ih->ih_level, ilevel);
 #endif  #endif
 #ifdef MULTIPROCESSOR  
                         x86_intunlock(regs);  
 #endif  
                         cli();                          cli();
                         hypervisor_set_ipending(iplmask,                          hypervisor_set_ipending(iplmask,
                             evtch >> LONG_SHIFT, evtch & LONG_MASK);                              evtch >> LONG_SHIFT, evtch & LONG_MASK);
Line 264  evtchn_do_event(int evtch, struct intrfr
Line 281  evtchn_do_event(int evtch, struct intrfr
                 ih = ih->ih_evt_next;                  ih = ih->ih_evt_next;
         }          }
         cli();          cli();
 #ifdef MULTIPROCESSOR  
         x86_intunlock(regs);  
 #endif  
         hypervisor_enable_event(evtch);          hypervisor_enable_event(evtch);
 splx:  splx:
         /*          /*
Line 482  event_set_handler(int evtch, int (*func)
Line 496  event_set_handler(int evtch, int (*func)
         struct evtsource *evts;          struct evtsource *evts;
         struct intrhand *ih, **ihp;          struct intrhand *ih, **ihp;
         int s;          int s;
   #ifdef MULTIPROCESSOR
           bool mpsafe = (level != IPL_VM);
   #endif /* MULTIPROCESSOR */
   
 #ifdef IRQ_DEBUG  #ifdef IRQ_DEBUG
         printf("event_set_handler IRQ %d handler %p\n", evtch, func);          printf("event_set_handler IRQ %d handler %p\n", evtch, func);
Line 505  event_set_handler(int evtch, int (*func)
Line 522  event_set_handler(int evtch, int (*func)
   
   
         ih->ih_level = level;          ih->ih_level = level;
         ih->ih_fun = func;          ih->ih_fun = ih->ih_realfun = func;
         ih->ih_arg = arg;          ih->ih_arg = ih->ih_realarg = arg;
         ih->ih_evt_next = NULL;          ih->ih_evt_next = NULL;
         ih->ih_ipl_next = NULL;          ih->ih_ipl_next = NULL;
   #ifdef MULTIPROCESSOR
           if (!mpsafe) {
                   ih->ih_fun = intr_biglock_wrapper;
                   ih->ih_arg = ih;
           }
   #endif /* MULTIPROCESSOR */
   
         s = splhigh();          s = splhigh();
   
Line 690  static int
Line 713  static int
 xen_misdirect_handler(void *arg)  xen_misdirect_handler(void *arg)
 {  {
 #if 0  #if 0
         char *msg = "misdirect\n";          const char *msg = "misdirect\n";
         (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg);          (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg);
 #endif  #endif
         return 0;          return 0;

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

CVSweb <webmaster@jp.NetBSD.org>