}
EXPORT_SYMBOL_GPL(xencomm_hypercall_console_io);
+static int
+xencommize_event_channel_op(struct xencomm_mini **xc_area, void *op,
+ struct xencomm_handle **desc)
+{
+ *desc = __xencomm_map_no_alloc(op, sizeof(evtchn_op_t), *xc_area);
+ if (*desc == NULL)
+ return -EINVAL;
+ (*xc_area)++;
+ return 0;
+}
+
int
xencomm_hypercall_event_channel_op(int cmd, void *op)
{
+ int rc;
struct xencomm_handle *desc;
- desc = xencomm_map_no_alloc(op, sizeof(evtchn_op_t));
- if (desc == NULL)
- return -EINVAL;
+ XENCOMM_MINI_ALIGNED(xc_area, 2);
+
+ rc = xencommize_event_channel_op(&xc_area, op, &desc);
+ if (rc)
+ return rc;
return xencomm_arch_hypercall_event_channel_op(cmd, desc);
}
}
EXPORT_SYMBOL_GPL(xencomm_hypercall_xen_version);
-int
-xencomm_hypercall_physdev_op(int cmd, void *op)
+static int
+xencommize_physdev_op(struct xencomm_mini **xc_area, int cmd, void *op,
+ struct xencomm_handle **desc)
{
unsigned int argsize;
printk("%s: unknown physdev op %d\n", __func__, cmd);
return -ENOSYS;
}
-
- return xencomm_arch_hypercall_physdev_op
- (cmd, xencomm_map_no_alloc(op, argsize));
+
+ *desc = __xencomm_map_no_alloc(op, argsize, *xc_area);
+ if (*desc == NULL)
+ return -EINVAL;
+ (*xc_area)++;
+ return 0;
+}
+
+int
+xencomm_hypercall_physdev_op(int cmd, void *op)
+{
+ int rc;
+ struct xencomm_handle *desc;
+ XENCOMM_MINI_ALIGNED(xc_area, 2);
+
+ rc = xencommize_physdev_op(&xc_area, cmd, op, &desc);
+ if (rc)
+ return rc;
+
+ return xencomm_arch_hypercall_physdev_op(cmd, desc);
}
static int
return rc;
mce->args[1] = (unsigned long)desc;
break;
+ case __HYPERVISOR_event_channel_op:
+ rc = xencommize_event_channel_op(&xc_area,
+ (void *)mce->args[1],
+ &desc);
+ if (rc)
+ return rc;
+ mce->args[1] = (unsigned long)desc;
+ break;
+ case __HYPERVISOR_physdev_op:
+ switch (mce->args[0]) {
+ case PHYSDEVOP_eoi: {
+ struct physdev_eoi *eoi =
+ (struct physdev_eoi *)mce->args[1];
+ mce->op = __HYPERVISOR_ia64_fast_eoi;
+ mce->args[0] = eoi->irq;
+ break;
+ }
+ default:
+ rc = xencommize_physdev_op(&xc_area,
+ mce->args[0],
+ (void *)mce->args[1],
+ &desc);
+ if (rc)
+ return rc;
+ mce->args[1] = (unsigned long)desc;
+ break;
+ }
+ break;
case __HYPERVISOR_memory_op:
default:
printk("%s: unhandled multicall op entry op %lu\n",