Skip to contentSkip to conversation

Update minios to new event channel ops

PATCH In review Mark Williamson 1 participant 2 messages Sep 14, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update minios to new event channel ops

Fixes events for minios on Xen by using the new event channel hypercalls.

Cheers,
Mark

Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
extras/mini-os/events.c +15 -18
diff -r d75a1aacbac4 -r 9700dd261ef6 extras/mini-os/events.c
@@ -88,19 +88,18 @@ void unbind_evtchn(evtchn_port_t port )
 
 int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
 {
-	evtchn_op_t op;
+	struct evtchn_bind_virq op;
 
 	/* Try to bind the virq to a port */
-	op.cmd = EVTCHNOP_bind_virq;
-	op.u.bind_virq.virq = virq;
-	op.u.bind_virq.vcpu = smp_processor_id();
+	op.virq = virq;
+	op.vcpu = smp_processor_id();
 
-	if ( HYPERVISOR_event_channel_op(&op) != 0 )
+	if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op) != 0 )
 	{
 		printk("Failed to bind virtual IRQ %d\n", virq);
 		return 1;
     }
-    bind_evtchn(op.u.bind_virq.port, handler, data);
+    bind_evtchn(op.port, handler, data);
 	return 0;
 }
 
@@ -151,14 +150,13 @@ int evtchn_alloc_unbound(domid_t pal, ev
 int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
 						 void *data, evtchn_port_t *port)
 {
-    evtchn_op_t op;
-    op.cmd = EVTCHNOP_alloc_unbound;
-    op.u.alloc_unbound.dom = DOMID_SELF;
-    op.u.alloc_unbound.remote_dom = pal;
-    int err = HYPERVISOR_event_channel_op(&op);
+    evtchn_alloc_unbound_t op;
+    op.dom = DOMID_SELF;
+    op.remote_dom = pal;
+    int err = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound, &op);
     if (err)
 		return err;
-    *port = bind_evtchn(op.u.alloc_unbound.port, handler, data);
+    *port = bind_evtchn(op.port, handler, data);
     return err;
 }
 
@@ -169,14 +167,13 @@ int evtchn_bind_interdomain(domid_t pal,
 			    evtchn_handler_t handler, void *data,
 			    evtchn_port_t *local_port)
 {
-    evtchn_op_t op;
-    op.cmd = EVTCHNOP_bind_interdomain;
-    op.u.bind_interdomain.remote_dom = pal;
-    op.u.bind_interdomain.remote_port = remote_port;
-    int err = HYPERVISOR_event_channel_op(&op);
+    evtchn_bind_interdomain_t op;
+    op.remote_dom = pal;
+    op.remote_port = remote_port;
+    int err = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain, &op);
     if (err)
 		return err;
-	evtchn_port_t port = op.u.bind_interdomain.local_port;
+	evtchn_port_t port = op.local_port;
     clear_evtchn(port);	      /* Without, handler gets invoked now! */
     *local_port = bind_evtchn(port, handler, data);
     return err;
extras/mini-os/include/events.h +1 -2
diff -r d75a1aacbac4 -r 9700dd261ef6 extras/mini-os/include/events.h
@@ -40,9 +40,8 @@ static inline int notify_remote_via_evtc
 static inline int notify_remote_via_evtchn(evtchn_port_t port)
 {
     evtchn_op_t op;
-    op.cmd = EVTCHNOP_send;
     op.u.send.port = port;
-    return HYPERVISOR_event_channel_op(&op);
+    return HYPERVISOR_event_channel_op(EVTCHNOP_send, &op);
 }
 
 
extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +3 -3
diff -r d75a1aacbac4 -r 9700dd261ef6 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
@@ -238,9 +238,9 @@ HYPERVISOR_update_va_mapping(
 
 static inline int
 HYPERVISOR_event_channel_op(
-	void *op)
-{
-	return _hypercall1(int, event_channel_op, op);
+	int cmd, void *op)
+{
+	return _hypercall2(int, event_channel_op, cmd, op);
 }
 
 static inline int

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Unstupified my patch - this one really does fix all the event problems in minios.

Quoted 4 lines · Mark Williamson

Fixes events for minios on Xen by using the new event channel hypercalls.

Cheers,
Mark

Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
extras/mini-os/events.c +15 -18
diff -r d75a1aacbac4 -r 5fa177999cd4 extras/mini-os/events.c
@@ -88,19 +88,18 @@ void unbind_evtchn(evtchn_port_t port )
 
 int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
 {
-	evtchn_op_t op;
+	evtchn_bind_virq_t op;
 
 	/* Try to bind the virq to a port */
-	op.cmd = EVTCHNOP_bind_virq;
-	op.u.bind_virq.virq = virq;
-	op.u.bind_virq.vcpu = smp_processor_id();
+	op.virq = virq;
+	op.vcpu = smp_processor_id();
 
-	if ( HYPERVISOR_event_channel_op(&op) != 0 )
+	if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op) != 0 )
 	{
 		printk("Failed to bind virtual IRQ %d\n", virq);
 		return 1;
     }
-    bind_evtchn(op.u.bind_virq.port, handler, data);
+    bind_evtchn(op.port, handler, data);
 	return 0;
 }
 
@@ -151,14 +150,13 @@ int evtchn_alloc_unbound(domid_t pal, ev
 int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
 						 void *data, evtchn_port_t *port)
 {
-    evtchn_op_t op;
-    op.cmd = EVTCHNOP_alloc_unbound;
-    op.u.alloc_unbound.dom = DOMID_SELF;
-    op.u.alloc_unbound.remote_dom = pal;
-    int err = HYPERVISOR_event_channel_op(&op);
+    evtchn_alloc_unbound_t op;
+    op.dom = DOMID_SELF;
+    op.remote_dom = pal;
+    int err = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound, &op);
     if (err)
 		return err;
-    *port = bind_evtchn(op.u.alloc_unbound.port, handler, data);
+    *port = bind_evtchn(op.port, handler, data);
     return err;
 }
 
@@ -169,14 +167,13 @@ int evtchn_bind_interdomain(domid_t pal,
 			    evtchn_handler_t handler, void *data,
 			    evtchn_port_t *local_port)
 {
-    evtchn_op_t op;
-    op.cmd = EVTCHNOP_bind_interdomain;
-    op.u.bind_interdomain.remote_dom = pal;
-    op.u.bind_interdomain.remote_port = remote_port;
-    int err = HYPERVISOR_event_channel_op(&op);
+    evtchn_bind_interdomain_t op;
+    op.remote_dom = pal;
+    op.remote_port = remote_port;
+    int err = HYPERVISOR_event_channel_op(EVTCHNOP_bind_interdomain, &op);
     if (err)
 		return err;
-	evtchn_port_t port = op.u.bind_interdomain.local_port;
+	evtchn_port_t port = op.local_port;
     clear_evtchn(port);	      /* Without, handler gets invoked now! */
     *local_port = bind_evtchn(port, handler, data);
     return err;
extras/mini-os/include/events.h +3 -4
diff -r d75a1aacbac4 -r 5fa177999cd4 extras/mini-os/include/events.h
@@ -39,10 +39,9 @@ int evtchn_bind_interdomain(domid_t pal,
 
 static inline int notify_remote_via_evtchn(evtchn_port_t port)
 {
-    evtchn_op_t op;
-    op.cmd = EVTCHNOP_send;
-    op.u.send.port = port;
-    return HYPERVISOR_event_channel_op(&op);
+    evtchn_send_t op;
+    op.port = port;
+    return HYPERVISOR_event_channel_op(EVTCHNOP_send, &op);
 }
 
 
extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +3 -3
diff -r d75a1aacbac4 -r 5fa177999cd4 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
@@ -238,9 +238,9 @@ HYPERVISOR_update_va_mapping(
 
 static inline int
 HYPERVISOR_event_channel_op(
-	void *op)
-{
-	return _hypercall1(int, event_channel_op, op);
+	int cmd, void *op)
+{
+	return _hypercall2(int, event_channel_op, cmd, op);
 }
 
 static inline int

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel