Directly using the SHUTDOWN_suspend macro as a parameter for the schedop
hypercall causes an error in the Xen hypercall handler. Also for consistency,
the SHUTDOWN_suspend param is wrapped in the sched_shutdown struct.
Signed-off-by: Bruno Alvisio <bruno.alvisio@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
HYPERVISOR_suspend(
unsigned long srec)
{
- return _hypercall3(int, sched_op, SCHEDOP_shutdown,
- SHUTDOWN_suspend, srec);
+ struct sched_shutdown shutdown = { .reason = SHUTDOWN_suspend };
+ return _hypercall3(int, sched_op, SCHEDOP_shutdown, &shutdown, srec);
}
static inline int
HYPERVISOR_suspend(
unsigned long srec)
{
- return _hypercall3(int, sched_op, SCHEDOP_shutdown,
- SHUTDOWN_suspend, srec);
+ struct sched_shutdown shutdown = { .reason = SHUTDOWN_suspend };
+ return _hypercall3(int, sched_op, SCHEDOP_shutdown, &shutdown, srec);
}
static inline int