/****************************************************************************** * hypercall.c * * Copyright (C) 2006, Virtual Iron Software, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307 USA. * */ #include MODULE_LICENSE("GPL"); #include "hypercall.h" char hypercall_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); static inline int HYPERVISOR_arg_test(long a, long b, long c, long d, long e) { return _hypercall5(int, grant_table_op, a, b, c, d, e); } extern void setup_xen_features(void); static int __init hypercall_page_setup(void) { hypercall_page_init(&hypercall_page); printk(KERN_ERR "hypercall_page @ %p\n", &hypercall_page); #if BITS_PER_LONG == 64 HYPERVISOR_arg_test(0x1111111111111111, 0x2222222222222222, 0x3333333333333333, 0x4444444444444444, 0x5555555555555555); #else HYPERVISOR_arg_test(0x11111111, 0x22222222, 0x33333333, 0x44444444, 0x55555555); #endif setup_xen_features(); return 0; } static void __exit hypercall_page_cleanup(void) { } module_init(hypercall_page_setup); module_exit(hypercall_page_cleanup);