direct-io.hg

changeset 13266:883c0080dd05

Enable compatibility mode operation for HYPERVISOR_sched_op and
HYPERVISOR_set_timer_op.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Emmanuel Ackaouy <ack@xensource.com>
date Fri Jan 05 17:34:35 2007 +0000 (2007-01-05)
parents c2a82e026497
children e1971b229e89
files xen/arch/x86/x86_64/compat/entry.S xen/common/Makefile xen/common/compat/schedule.c xen/common/schedule.c xen/include/xlat.lst
line diff
     1.1 --- a/xen/arch/x86/x86_64/compat/entry.S	Fri Jan 05 17:34:34 2007 +0000
     1.2 +++ b/xen/arch/x86/x86_64/compat/entry.S	Fri Jan 05 17:34:35 2007 +0000
     1.3 @@ -279,10 +279,8 @@ CFIX14:
     1.4  .section .rodata, "a", @progbits
     1.5  
     1.6  #define compat_platform_op domain_crash_synchronous
     1.7 -#define compat_set_timer_op domain_crash_synchronous
     1.8  #define compat_grant_table_op domain_crash_synchronous
     1.9  #define compat_acm_op domain_crash_synchronous
    1.10 -#define compat_arch_sched_op domain_crash_synchronous
    1.11  #define compat_xenoprof_op domain_crash_synchronous
    1.12  #define compat_sysctl domain_crash_synchronous
    1.13  #define compat_domctl domain_crash_synchronous
    1.14 @@ -317,7 +315,7 @@ ENTRY(compat_hypercall_table)
    1.15          .quad compat_mmuext_op
    1.16          .quad compat_acm_op
    1.17          .quad compat_nmi_op
    1.18 -        .quad compat_arch_sched_op
    1.19 +        .quad compat_sched_op
    1.20          .quad compat_callback_op        /* 30 */
    1.21          .quad compat_xenoprof_op
    1.22          .quad do_event_channel_op
    1.23 @@ -359,7 +357,7 @@ ENTRY(compat_hypercall_args_table)
    1.24          .byte 4 /* compat_mmuext_op         */
    1.25          .byte 1 /* compat_acm_op            */
    1.26          .byte 2 /* compat_nmi_op            */
    1.27 -        .byte 2 /* compat_arch_sched_op     */
    1.28 +        .byte 2 /* compat_sched_op          */
    1.29          .byte 2 /* compat_callback_op       */  /* 30 */
    1.30          .byte 2 /* compat_xenoprof_op       */
    1.31          .byte 2 /* compat_event_channel_op  */
     2.1 --- a/xen/common/Makefile	Fri Jan 05 17:34:34 2007 +0000
     2.2 +++ b/xen/common/Makefile	Fri Jan 05 17:34:35 2007 +0000
     2.3 @@ -39,3 +39,8 @@ subdir-$(CONFIG_COMPAT) += compat
     2.4  
     2.5  # Object file contains changeset and compiler information.
     2.6  version.o: $(BASEDIR)/include/xen/compile.h
     2.7 +
     2.8 +ifeq ($(CONFIG_COMPAT),y)
     2.9 +# extra dependencies
    2.10 +schedule.o: compat/schedule.c
    2.11 +endif
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/xen/common/compat/schedule.c	Fri Jan 05 17:34:35 2007 +0000
     3.3 @@ -0,0 +1,51 @@
     3.4 +/****************************************************************************
     3.5 + * schedule.c
     3.6 + *
     3.7 + */
     3.8 +
     3.9 +#include <compat/sched.h>
    3.10 +
    3.11 +#define COMPAT
    3.12 +#define ret_t int
    3.13 +
    3.14 +#define do_sched_op compat_sched_op
    3.15 +
    3.16 +#define xen_sched_shutdown sched_shutdown
    3.17 +CHECK_sched_shutdown;
    3.18 +#undef xen_sched_shutdown
    3.19 +
    3.20 +#define xen_sched_remote_shutdown sched_remote_shutdown
    3.21 +CHECK_sched_remote_shutdown;
    3.22 +#undef xen_sched_remote_shutdown
    3.23 +
    3.24 +static int compat_poll(struct compat_sched_poll *compat)
    3.25 +{
    3.26 +    struct sched_poll native;
    3.27 +
    3.28 +#define XLAT_sched_poll_HNDL_ports(_d_, _s_) \
    3.29 +    guest_from_compat_handle((_d_)->ports, (_s_)->ports)
    3.30 +    XLAT_sched_poll(&native, compat);
    3.31 +#undef XLAT_sched_poll_HNDL_ports
    3.32 +
    3.33 +    return do_poll(&native);
    3.34 +}
    3.35 +
    3.36 +#define do_poll compat_poll
    3.37 +#define sched_poll compat_sched_poll
    3.38 +
    3.39 +#include "../schedule.c"
    3.40 +
    3.41 +int compat_set_timer_op(u32 lo, s32 hi)
    3.42 +{
    3.43 +    return do_set_timer_op(((s64)hi << 32) | lo);
    3.44 +}
    3.45 +
    3.46 +/*
    3.47 + * Local variables:
    3.48 + * mode: C
    3.49 + * c-set-style: "BSD"
    3.50 + * c-basic-offset: 4
    3.51 + * tab-width: 4
    3.52 + * indent-tabs-mode: nil
    3.53 + * End:
    3.54 + */
     4.1 --- a/xen/common/schedule.c	Fri Jan 05 17:34:34 2007 +0000
     4.2 +++ b/xen/common/schedule.c	Fri Jan 05 17:34:35 2007 +0000
     4.3 @@ -13,6 +13,7 @@
     4.4   *
     4.5   */
     4.6  
     4.7 +#ifndef COMPAT
     4.8  #include <xen/config.h>
     4.9  #include <xen/init.h>
    4.10  #include <xen/lib.h>
    4.11 @@ -366,9 +367,13 @@ long do_sched_op_compat(int cmd, unsigne
    4.12      return ret;
    4.13  }
    4.14  
    4.15 -long do_sched_op(int cmd, XEN_GUEST_HANDLE(void) arg)
    4.16 +typedef long ret_t;
    4.17 +
    4.18 +#endif /* !COMPAT */
    4.19 +
    4.20 +ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE(void) arg)
    4.21  {
    4.22 -    long ret = 0;
    4.23 +    ret_t ret = 0;
    4.24  
    4.25      switch ( cmd )
    4.26      {
    4.27 @@ -445,6 +450,8 @@ long do_sched_op(int cmd, XEN_GUEST_HAND
    4.28      return ret;
    4.29  }
    4.30  
    4.31 +#ifndef COMPAT
    4.32 +
    4.33  /* Per-domain one-shot-timer hypercall. */
    4.34  long do_set_timer_op(s_time_t timeout)
    4.35  {
    4.36 @@ -736,6 +743,12 @@ void dump_runq(unsigned char key)
    4.37      local_irq_restore(flags);
    4.38  }
    4.39  
    4.40 +#ifdef CONFIG_COMPAT
    4.41 +#include "compat/schedule.c"
    4.42 +#endif
    4.43 +
    4.44 +#endif /* !COMPAT */
    4.45 +
    4.46  /*
    4.47   * Local variables:
    4.48   * mode: C
     5.1 --- a/xen/include/xlat.lst	Fri Jan 05 17:34:34 2007 +0000
     5.2 +++ b/xen/include/xlat.lst	Fri Jan 05 17:34:35 2007 +0000
     5.3 @@ -26,4 +26,7 @@
     5.4  !	memory_map			memory.h
     5.5  !	memory_reservation		memory.h
     5.6  !	translate_gpfn_list		memory.h
     5.7 +!	sched_poll			sched.h
     5.8 +?	sched_remote_shutdown		sched.h
     5.9 +?	sched_shutdown			sched.h
    5.10  !	vcpu_runstate_info		vcpu.h