All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaofeng Ling <xiaofeng.ling@intel.com>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>,
	Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] make ctrl_if.c can be used in para-driver for unmodified guest
Date: Mon, 05 Sep 2005 17:22:50 +0800	[thread overview]
Message-ID: <431C0E6A.5000607@intel.com> (raw)

make ctrl_if.c can be used in para-driver for unmodified guest
changes are:
1. use bind_evtchn_to_irqhandler instead of setup_irq
2. set safe_to_schedule_task = 1 in ctrl_if_init
3. remove warnings when build.
#ifndef CONFIG_XEN means build with unmodified kernel not xen-linux.
xen_start_info.domain_controller_evtchn is set in event channel
pci driver.
This file is needed for the front end drivers that is not ported to
xenbus.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

diff -r 287d36b46fa3 linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c	Tue Aug 30 20:36:49 
2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/ctrl_if.c	Fri Sep  2 22:47:27 
2005
@@ -67,10 +67,11 @@
  int initdom_ctrlif_domcontroller_port = -1;

  static int        ctrl_if_evtchn;
+#ifdef CONFIG_XEN
  static int        ctrl_if_irq;
+static struct irqaction ctrl_if_irq_action;
+#endif
  static spinlock_t ctrl_if_lock;
-
-static struct irqaction ctrl_if_irq_action;

  static ctrl_front_ring_t ctrl_if_tx_ring;
  static ctrl_back_ring_t  ctrl_if_rx_ring;
@@ -475,8 +476,12 @@

  void ctrl_if_suspend(void)
  {
+#ifdef CONFIG_XEN
      teardown_irq(ctrl_if_irq, &ctrl_if_irq_action);
      unbind_evtchn_from_irq(ctrl_if_evtchn);
+#else
+    unbind_evtchn_from_irqhandler(ctrl_if_evtchn, NULL);
+#endif
  }

  void ctrl_if_resume(void)
@@ -510,12 +515,22 @@
      BACK_RING_ATTACH(&ctrl_if_rx_ring, &ctrl_if->rx_ring, 
CONTROL_RING_MEM);

      ctrl_if_evtchn = xen_start_info.domain_controller_evtchn;
+#ifdef CONFIG_XEN
      ctrl_if_irq    = bind_evtchn_to_irq(ctrl_if_evtchn);

      memset(&ctrl_if_irq_action, 0, sizeof(ctrl_if_irq_action));
      ctrl_if_irq_action.handler = ctrl_if_interrupt;
      ctrl_if_irq_action.name    = "ctrl-if";
      (void)setup_irq(ctrl_if_irq, &ctrl_if_irq_action);
+#else
+    if(bind_evtchn_to_irqhandler(
+        ctrl_if_evtchn, ctrl_if_interrupt, SA_SAMPLE_RANDOM, "ctrl-if", 
NULL))
+    {
+        printk("bind_evtchn_to_irqhandler failed\n" );
+        return;
+    }
+
+#endif
  }

  void __init ctrl_if_init(void)
@@ -532,6 +547,9 @@
      spin_lock_init(&ctrl_if_lock);

      ctrl_if_resume();
+#ifndef CONFIG_XEN
+    safe_to_schedule_task = 1;
+#endif
  }

             reply	other threads:[~2005-09-05  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-05  9:22 Xiaofeng Ling [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-09-08  2:10 [PATCH] make ctrl_if.c can be used in para-driver for unmodified guest Ling, Xiaofeng

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=431C0E6A.5000607@intel.com \
    --to=xiaofeng.ling@intel.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --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.