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) 2011, Lei Xia <lxia@northwestern.edu>
11 * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Lei Xia <lxia@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 #include <vnet/vnet_host.h>
21 #include <vnet/vnet.h>
23 struct vnet_host_hooks * host_hooks;
25 struct vnet_thread * vnet_start_thread(int (*func)(void *), void *arg, char * name){
26 if((host_hooks) && host_hooks->thread_start){
28 struct vnet_thread * thread = Vnet_Malloc(sizeof(struct vnet_thread));
31 PrintError("Cannot allocate space to create a vnet thread\n");
35 thread->host_thread = host_hooks->thread_start(func, arg, name);
37 if(thread->host_thread){
47 struct vnet_timer * vnet_create_timer(unsigned long interval,
48 void (* timer_fun)(void * priv_data),
50 if((host_hooks) && host_hooks->timer_create){
51 struct vnet_timer * timer = Vnet_Malloc(sizeof(struct vnet_timer));
54 PrintError("Cannot allocate space to create a vnet timer\n");
58 timer->host_timer = host_hooks->timer_create(interval, timer_fun, priv_data);
67 void init_vnet(struct vnet_host_hooks * hooks){