From: Bruno Alvisio Date: Mon, 11 Dec 2017 06:51:07 +0000 (-0800) Subject: Save/Restore Support: Refactor HYPERVISOR_suspend hypercall X-Git-Tag: xen-RELEASE-4.14.0~25 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2f1419545d1067160c8dc1f7f56c6237e66612b8;p=mini-os.git Save/Restore Support: Refactor HYPERVISOR_suspend hypercall 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 Reviewed-by: Samuel Thibault --- diff --git a/include/x86/x86_32/hypercall-x86_32.h b/include/x86/x86_32/hypercall-x86_32.h index 5c93464..70505a4 100644 --- a/include/x86/x86_32/hypercall-x86_32.h +++ b/include/x86/x86_32/hypercall-x86_32.h @@ -298,8 +298,8 @@ 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 diff --git a/include/x86/x86_64/hypercall-x86_64.h b/include/x86/x86_64/hypercall-x86_64.h index 6171812..95f8ade 100644 --- a/include/x86/x86_64/hypercall-x86_64.h +++ b/include/x86/x86_64/hypercall-x86_64.h @@ -305,8 +305,8 @@ 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