WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2 of 4] xen: introduce PHYSDEVOP_get_nr_pirqs

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2 of 4] xen: introduce PHYSDEVOP_get_nr_pirqs
From: stefano.stabellini@xxxxxxxxxxxxx
Date: Mon, 30 Aug 2010 12:25:02 +0100
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 30 Aug 2010 04:32:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1008301154290.2545@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1008301154290.2545@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Introduce a new physdevop called PHYSDEVOP_get_nr_pirqs that allows PV
and PV on HVM guests to get the number of pirqs available.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff -r f2dc396b92aa xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Wed Aug 18 14:14:23 2010 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri Aug 20 14:49:52 2010 +0100
@@ -2290,6 +2290,7 @@ static long hvm_physdev_op(int cmd, XEN_
         case PHYSDEVOP_unmap_pirq:
         case PHYSDEVOP_eoi:
         case PHYSDEVOP_irq_status_query:
+        case PHYSDEVOP_get_nr_pirqs:
             return do_physdev_op(cmd, arg);
         default:
             return -ENOSYS;
@@ -2393,6 +2394,8 @@ static long hvm_physdev_op_compat32(
         case PHYSDEVOP_eoi:
         case PHYSDEVOP_irq_status_query:
             return compat_physdev_op(cmd, arg);
+        case PHYSDEVOP_get_nr_pirqs:
+            return do_physdev_op(cmd, arg);
         break;
     default:
             return -ENOSYS;
diff -r f2dc396b92aa xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Wed Aug 18 14:14:23 2010 +0100
+++ b/xen/arch/x86/physdev.c    Fri Aug 20 14:49:52 2010 +0100
@@ -572,6 +572,12 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
                               setup_gsi.polarity);
         break; 
     }
+    case PHYSDEVOP_get_nr_pirqs: {
+        struct physdev_nr_pirqs out;
+        out.nr_pirqs = v->domain->nr_pirqs;
+        ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+        break;
+    }
     default:
         ret = -ENOSYS;
         break;
diff -r f2dc396b92aa xen/include/public/physdev.h
--- a/xen/include/public/physdev.h      Wed Aug 18 14:14:23 2010 +0100
+++ b/xen/include/public/physdev.h      Fri Aug 20 14:49:52 2010 +0100
@@ -240,6 +240,15 @@ struct physdev_setup_gsi {
 typedef struct physdev_setup_gsi physdev_setup_gsi_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_setup_gsi_t);
 
+#define PHYSDEVOP_get_nr_pirqs    22
+struct physdev_nr_pirqs {
+    /* OUT */
+    uint32_t nr_pirqs;
+};
+
+typedef struct physdev_nr_pirqs physdev_nr_pirqs_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_nr_pirqs_t);
+
 /*
  * Notify that some PIRQ-bound event channels have been unmasked.
  * ** This command is obsolete since interface version 0x00030202 and is **

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>