vaseboot/include/VasEBoot/i386/xen/hypercall.h

86 lines
2.6 KiB
C

/*
* VasEBoot -- GRand Unified Bootloader
* Copyright (C) 2013 Free Software Foundation, Inc.
*
* VasEBoot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VasEBoot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VasEBoot. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VasEBoot_XEN_CPU_HYPERCALL_HEADER
#define VasEBoot_XEN_CPU_HYPERCALL_HEADER 1
#include <VasEBoot/types.h>
int
EXPORT_FUNC (VasEBoot_xen_hypercall) (VasEBoot_uint32_t callno, VasEBoot_uint32_t a0,
VasEBoot_uint32_t a1, VasEBoot_uint32_t a2,
VasEBoot_uint32_t a3, VasEBoot_uint32_t a4,
VasEBoot_uint32_t a5)
__attribute__ ((regparm (3), cdecl));
static inline int
VasEBoot_xen_sched_op (int cmd, void *arg)
{
return VasEBoot_xen_hypercall (__HYPERVISOR_sched_op, cmd, (VasEBoot_uint32_t) arg,
0, 0, 0, 0);
}
static inline int
VasEBoot_xen_mmu_update (const struct mmu_update *reqs,
unsigned count, unsigned *done_out, unsigned foreigndom)
{
return VasEBoot_xen_hypercall (__HYPERVISOR_mmu_update, (VasEBoot_uint32_t) reqs,
(VasEBoot_uint32_t) count, (VasEBoot_uint32_t) done_out,
(VasEBoot_uint32_t) foreigndom, 0, 0);
}
static inline int
VasEBoot_xen_mmuext_op (mmuext_op_t * ops,
unsigned int count,
unsigned int *pdone, unsigned int foreigndom)
{
return VasEBoot_xen_hypercall (__HYPERVISOR_mmuext_op, (VasEBoot_uint32_t) ops,
count, (VasEBoot_uint32_t) pdone, foreigndom, 0, 0);
}
static inline int
VasEBoot_xen_event_channel_op (int op, void *arg)
{
return VasEBoot_xen_hypercall (__HYPERVISOR_event_channel_op, op,
(VasEBoot_uint32_t) arg, 0, 0, 0, 0);
}
static inline int
VasEBoot_xen_update_va_mapping (void *addr, uint64_t pte, uint32_t flags)
{
return VasEBoot_xen_hypercall (__HYPERVISOR_update_va_mapping,
(VasEBoot_uint32_t) addr, pte, pte >> 32, flags, 0,
0);
}
static inline int
VasEBoot_xen_grant_table_op (int a, void *b, int c)
{
return VasEBoot_xen_hypercall (__HYPERVISOR_grant_table_op, a,
(VasEBoot_uint32_t) b, c, 0, 0, 0);
}
static inline int
VasEBoot_xen_vm_assist (int cmd, int type)
{
return VasEBoot_xen_hypercall (__HYPERVISOR_vm_assist, cmd, type, 0, 0, 0, 0);
}
#endif