win-pvdrivers

changeset 582:3fb323edeea9

hypercall for ia64
author James Harper <james.harper@bendigoit.com.au>
date Tue Jun 02 22:50:25 2009 +1000 (2009-06-02)
parents da7ec4df7dd6
children 10147bb21470
files xenpci/hypercall_ia64.h
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xenpci/hypercall_ia64.h	Tue Jun 02 22:50:25 2009 +1000
     1.3 @@ -0,0 +1,88 @@
     1.4 +/*
     1.5 +PV Drivers for Windows Xen HVM Domains
     1.6 +Copyright (C) 2007 James Harper
     1.7 +
     1.8 +This program is free software; you can redistribute it and/or
     1.9 +modify it under the terms of the GNU General Public License
    1.10 +as published by the Free Software Foundation; either version 2
    1.11 +of the License, or (at your option) any later version.
    1.12 +
    1.13 +This program is distributed in the hope that it will be useful,
    1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.16 +GNU General Public License for more details.
    1.17 +
    1.18 +You should have received a copy of the GNU General Public License
    1.19 +along with this program; if not, write to the Free Software
    1.20 +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    1.21 +*/
    1.22 +
    1.23 +extern int _hypercall2(VOID *address, xen_ulong_t a1, xen_ulong_t a2);
    1.24 +extern int _hypercall3(VOID *address, xen_ulong_t a1, xen_ulong_t a2, xen_ulong_t a3);
    1.25 +
    1.26 +static __inline int
    1.27 +HYPERVISOR_memory_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *arg)
    1.28 +{
    1.29 +  PCHAR memory_op_func = xpdd->hypercall_stubs;
    1.30 +  memory_op_func += __HYPERVISOR_memory_op * 32;
    1.31 +  return _hypercall2(memory_op_func, (xen_ulong_t)cmd, (xen_ulong_t)arg);
    1.32 +}
    1.33 +
    1.34 +static __inline int
    1.35 +HYPERVISOR_xen_version(PXENPCI_DEVICE_DATA xpdd, int cmd, void *arg)
    1.36 +{
    1.37 +  PCHAR xen_version_func = xpdd->hypercall_stubs;
    1.38 +  xen_version_func += __HYPERVISOR_xen_version * 32;
    1.39 +  return _hypercall2(xen_version_func, (xen_ulong_t)cmd, (xen_ulong_t)arg);
    1.40 +}
    1.41 +
    1.42 +static __inline int
    1.43 +HYPERVISOR_grant_table_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *uop, unsigned int count)
    1.44 +{
    1.45 +  PCHAR grant_table_op_func = xpdd->hypercall_stubs;
    1.46 +  grant_table_op_func += __HYPERVISOR_grant_table_op * 32;
    1.47 +  return _hypercall3(grant_table_op_func, (xen_ulong_t)cmd, (xen_ulong_t)uop, (xen_ulong_t)count);
    1.48 +}
    1.49 +
    1.50 +static __inline int
    1.51 +HYPERVISOR_hvm_op(PXENPCI_DEVICE_DATA xpdd, int op, struct xen_hvm_param *arg)
    1.52 +{
    1.53 +  PCHAR hvm_op_func = xpdd->hypercall_stubs;
    1.54 +  hvm_op_func += __HYPERVISOR_hvm_op * 32;
    1.55 +  return _hypercall2(hvm_op_func, (xen_ulong_t)op, (xen_ulong_t)arg);
    1.56 +}
    1.57 +
    1.58 +static __inline int
    1.59 +HYPERVISOR_event_channel_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *op)
    1.60 +{
    1.61 +  PCHAR event_channel_op_func = xpdd->hypercall_stubs;
    1.62 +  event_channel_op_func += __HYPERVISOR_event_channel_op * 32;
    1.63 +  return _hypercall2(event_channel_op_func, (xen_ulong_t)cmd, (xen_ulong_t)op);
    1.64 +}
    1.65 +
    1.66 +static __inline int
    1.67 +HYPERVISOR_sched_op(PXENPCI_DEVICE_DATA xpdd, int cmd, void *arg)
    1.68 +{
    1.69 +  PCHAR sched_op_func = xpdd->hypercall_stubs;
    1.70 +  sched_op_func += __HYPERVISOR_sched_op * 32;
    1.71 +  return _hypercall2(sched_op_func, (xen_ulong_t)cmd, (xen_ulong_t)arg);
    1.72 +}
    1.73 +
    1.74 +static __inline int
    1.75 +HYPERVISOR_shutdown(PXENPCI_DEVICE_DATA xpdd, unsigned int reason)
    1.76 +{
    1.77 +  struct sched_shutdown ss;
    1.78 +  int retval;
    1.79 +
    1.80 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    1.81 +
    1.82 +  ss.reason = reason;
    1.83 +
    1.84 +  KdPrint((__DRIVER_NAME "     A\n"));
    1.85 +
    1.86 +  retval = HYPERVISOR_sched_op(xpdd, SCHEDOP_shutdown, &ss);
    1.87 +
    1.88 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    1.89 +
    1.90 +  return retval;
    1.91 +}