All of lore.kernel.org
 help / color / mirror / Atom feed
* error binding to event channel
@ 2005-02-21  8:26 Jacob Gorm Hansen
  2005-02-22 20:55 ` Jacob Gorm Hansen
  0 siblings, 1 reply; 2+ messages in thread
From: Jacob Gorm Hansen @ 2005-02-21  8:26 UTC (permalink / raw)
  To: xen-devel

hi,
I am trying to bind an event channel to my domain using the following code:

#include "xc.h"

int main()
{
     int xc_handle = xc_interface_open();
     int p1=0;
     int p2=0;
     int r;

     r = xc_evtchn_alloc_unbound(xc_handle,
                             1,
                             &p2);
     printf("%d ports %d %d\n", r,p1,p2);

     r = xc_evtchn_bind_interdomain(xc_handle,
             DOMID_SELF,1,
             &p1,&p2);

     printf("%d ports %d %d\n", r,p1,p2);
     r = xc_evtchn_send(xc_handle, p1);
     printf("send %d\n", r);

     return 0;
}

On a freshly booted Xen with one domU that works, printing:

0 ports 0 14
0 ports 15 14
send 0

however, the next time I run it I get:

0 ports 0 16
-1 ports 0 16
send -1


The bind_interdomain hypercall fails in Xen in common/evtchn.c, in the test:

     else if ( port2 >= d2->max_event_channel )
     {
         printk("port2 %d max_event_channel %d\n", 
port2,d2->max_event_channel);
         ERROR_EXIT(-EINVAL);
     }

The printk I have added prints:

(XEN) port2 16 max_event_channel 16


-- In general, max_event_channel seems to stop being increased after the 
first bind call. What am I doing wrong here?

thanks,
Jacob


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: error binding to event channel
  2005-02-21  8:26 error binding to event channel Jacob Gorm Hansen
@ 2005-02-22 20:55 ` Jacob Gorm Hansen
  0 siblings, 0 replies; 2+ messages in thread
From: Jacob Gorm Hansen @ 2005-02-22 20:55 UTC (permalink / raw)
  To: xen-devel

Jacob Gorm Hansen wrote:
> hi,
> I am trying to bind an event channel to my domain using the following code:

OK I have it sorted now, using a constant port number at the domU end, 
the code looks like this:

         int p1=0;
         int p2=0;
         int r;

         p2=14;
         r = xc_evtchn_bind_interdomain(xc_handle,
                 DOMID_SELF,domu_dom_id,
                 &p1,&p2);

         r = xc_evtchn_send(xc_handle, p1);


and on the receiving end:

         int my_irq = bind_evtchn_to_irq(14);
         printk("bound irq %d\n", my_irq);

         int r = request_irq(my_irq, my_interrupt_handler, 
SA_SAMPLE_RANDOM, , "myirq", 0);

Jacob


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-22 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-21  8:26 error binding to event channel Jacob Gorm Hansen
2005-02-22 20:55 ` Jacob Gorm Hansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.