2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #ifndef __VMM_SYMCALL_H__
21 #define __VMM_SYMCALL_H__
26 #include <palacios/vmm_regs.h>
30 struct v3_sym_cpu_context {
31 struct v3_gprs vm_regs;
41 struct v3_symcall_state {
43 uint_t sym_call_active : 1;
44 uint_t sym_call_returned : 1;
45 uint_t sym_call_error : 1;
46 } __attribute__((packed));
48 struct v3_sym_cpu_context old_ctx;
52 uint64_t sym_call_rip;
54 uint64_t sym_call_rsp;
60 typedef uint64_t sym_arg_t;
62 #define v3_sym_call0(info, call_num) \
63 v3_sym_call(info, call_num, 0, 0, 0, 0, 0)
64 #define v3_sym_call1(info, call_num, arg1) \
65 v3_sym_call(info, call_num, arg1, 0, 0, 0, 0)
66 #define v3_sym_call2(info, call_num, arg1, arg2) \
67 v3_sym_call(info, call_num, arg1, arg2, 0, 0, 0)
68 #define v3_sym_call3(info, call_num, arg1, arg2, arg3) \
69 v3_sym_call(info, call_num, arg1, arg2, arg3, 0, 0)
70 #define v3_sym_call4(info, call_num, arg1, arg2, arg3, arg4) \
71 v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, 0)
72 #define v3_sym_call5(info, call_num, arg1, arg2, arg3, arg4, arg5) \
73 v3_sym_call(info, call_num, arg1, arg2, arg3, arg4, arg5)
79 #define SYMCALL_TEST 1
80 #define SYMCALL_MEM_LOOKUP 10
83 int v3_sym_call(struct guest_info * info,
84 uint64_t call_num, sym_arg_t * arg0,
85 sym_arg_t * arg1, sym_arg_t * arg2,
86 sym_arg_t * arg3, sym_arg_t * arg4);
90 int v3_init_symcall_vm(struct v3_vm_info * vm);