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
|