All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] [Mini-OS] Make bind_virq return the port
Date: Fri, 23 Nov 2007 16:22:33 +0000	[thread overview]
Message-ID: <20071123162233.GA11952@implementation.uk.xensource.com> (raw)

Make bind_virq() return the port bound to the irq, which is useful e.g.
for masking/unmasking it.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>

diff -r 2e05a6173be0 extras/mini-os/arch/ia64/time.c
--- a/extras/mini-os/arch/ia64/time.c	Fri Nov 23 11:58:11 2007 +0000
+++ b/extras/mini-os/arch/ia64/time.c	Fri Nov 23 16:18:57 2007 +0000
@@ -267,7 +267,7 @@ init_time(void)
 		printk("efi_get_time() failed\n");
 
 	err = bind_virq(VIRQ_ITC, timer_interrupt, NULL);
-	if (err != 0) {
+	if (err == -1) {
 		printk("XEN timer request chn bind failed %i\n", err);
 		return;
 	}
diff -r 2e05a6173be0 extras/mini-os/events.c
--- a/extras/mini-os/events.c	Fri Nov 23 11:58:11 2007 +0000
+++ b/extras/mini-os/events.c	Fri Nov 23 16:18:58 2007 +0000
@@ -102,7 +102,7 @@ void unbind_evtchn(evtchn_port_t port )
 	ev_actions[port].data = NULL;
 }
 
-int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
+evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
 {
 	evtchn_bind_virq_t op;
 
@@ -113,11 +113,11 @@ int bind_virq(uint32_t virq, evtchn_hand
 	if ( HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op) != 0 )
 	{
 		printk("Failed to bind virtual IRQ %d\n", virq);
-		return 1;
+		return -1;
     }
     set_bit(op.port,bound_ports);
     bind_evtchn(op.port, handler, data);
-	return 0;
+	return op.port;
 }
 
 #if defined(__x86_64__)
diff -r 2e05a6173be0 extras/mini-os/include/events.h
--- a/extras/mini-os/include/events.h	Fri Nov 23 11:58:11 2007 +0000
+++ b/extras/mini-os/include/events.h	Fri Nov 23 16:18:58 2007 +0000
@@ -26,7 +26,7 @@ typedef void (*evtchn_handler_t)(evtchn_
 
 /* prototypes */
 int do_event(evtchn_port_t port, struct pt_regs *regs);
-int bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
+evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
 evtchn_port_t bind_evtchn(evtchn_port_t port, evtchn_handler_t handler,
 						  void *data);
 void unbind_evtchn(evtchn_port_t port);

                 reply	other threads:[~2007-11-23 16:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071123162233.GA11952@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.