All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make ctrl_if.c can be used in para-driver for unmodified guest
@ 2005-09-05  9:22 Xiaofeng Ling
  0 siblings, 0 replies; 2+ messages in thread
From: Xiaofeng Ling @ 2005-09-05  9:22 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

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
  }

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

* RE: [PATCH] make ctrl_if.c can be used in para-driver for unmodified guest
@ 2005-09-08  2:10 Ling, Xiaofeng
  0 siblings, 0 replies; 2+ messages in thread
From: Ling, Xiaofeng @ 2005-09-08  2:10 UTC (permalink / raw)
  To: Ling, Xiaofeng, Ian Pratt, Keir Fraser; +Cc: xen-devel

ctrl_if.c is removed now, so this patch is obsoleted now.

Xiaofeng Ling <> wrote:
> 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
>   }
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

end of thread, other threads:[~2005-09-08  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-05  9:22 [PATCH] make ctrl_if.c can be used in para-driver for unmodified guest Xiaofeng Ling
  -- strict thread matches above, loose matches on Subject: below --
2005-09-08  2:10 Ling, Xiaofeng

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.