* hypercall after doing necessary argument munging.
*/
-#include <xen/config.h>
#include <xen/guest_access.h>
#include <xen/hypercall.h>
+#include <xen/trace.h>
+#include <public/sched.h>
#ifndef COMPAT
typedef long ret_t;
#ifndef COMPAT
+/* Legacy hypercall (as of 0x00030101). */
+long do_sched_op_compat(int cmd, unsigned long arg)
+{
+ switch ( cmd )
+ {
+ case SCHEDOP_yield:
+ case SCHEDOP_block:
+ return do_sched_op(cmd, guest_handle_from_ptr(NULL, void));
+
+ case SCHEDOP_shutdown:
+ TRACE_3D(TRC_SCHED_SHUTDOWN,
+ current->domain->domain_id, current->vcpu_id, arg);
+ domain_shutdown(current->domain, (u8)arg);
+ break;
+
+ default:
+ return -ENOSYS;
+ }
+
+ return 0;
+}
+
/* Legacy hypercall (as of 0x00030202). */
long do_event_channel_op_compat(XEN_GUEST_HANDLE_PARAM(evtchn_op_t) uop)
{
if ( unlikely(!(rflags & X86_EFLAGS_IF)) )
return hvm_vcpu_down(curr);
- do_sched_op_compat(SCHEDOP_block, 0);
+ do_sched_op(SCHEDOP_block, guest_handle_from_ptr(NULL, void));
HVMTRACE_1D(HLT, /* pending = */ vcpu_runnable(curr));
}
#include <asm/cpufeature.h>
#include <asm/processor.h>
#include <asm/amd.h>
-#include <asm/types.h>
+#include <asm/guest_access.h>
#include <asm/debugreg.h>
#include <asm/msr.h>
#include <asm/i387.h>
* Do something useful, like reschedule the guest
*/
perfc_incr(pauseloop_exits);
- do_sched_op_compat(SCHEDOP_yield, 0);
+ do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
}
static void
#include <xen/perfc.h>
#include <xen/hypercall.h>
#include <xen/domain_page.h>
+#include <asm/guest_access.h>
#include <asm/paging.h>
#include <asm/p2m.h>
#include <asm/apic.h>
{
case HvNotifyLongSpinWait:
perfc_incr(mshv_call_long_wait);
- do_sched_op_compat(SCHEDOP_yield, 0);
+ do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
status = HV_STATUS_SUCCESS;
break;
default:
#include <asm/regs.h>
#include <asm/cpufeature.h>
#include <asm/processor.h>
-#include <asm/types.h>
+#include <asm/guest_access.h>
#include <asm/debugreg.h>
#include <asm/msr.h>
#include <asm/paging.h>
case EXIT_REASON_PAUSE_INSTRUCTION:
perfc_incr(pauseloop_exits);
- do_sched_op_compat(SCHEDOP_yield, 0);
+ do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
break;
case EXIT_REASON_XSETBV:
kill_timer(&d->watchdog_timer[i]);
}
-long do_sched_op_compat(int cmd, unsigned long arg)
-{
- long ret = 0;
-
- switch ( cmd )
- {
- case SCHEDOP_yield:
- {
- ret = vcpu_yield();
- break;
- }
-
- case SCHEDOP_block:
- {
- vcpu_block_enable_events();
- break;
- }
-
- case SCHEDOP_shutdown:
- {
- TRACE_3D(TRC_SCHED_SHUTDOWN,
- current->domain->domain_id, current->vcpu_id, arg);
- domain_shutdown(current->domain, (u8)arg);
- break;
- }
-
- default:
- ret = -ENOSYS;
- }
-
- return ret;
-}
-
typedef long ret_t;
#endif /* !COMPAT */
do_ni_hypercall(
void);
-extern long
-do_sched_op_compat(
- int cmd,
- unsigned long arg);
-
extern long
do_sched_op(
int cmd,