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) 2013, The V3VEE Project <http://www.v3vee.org>
11 * All rights reserved.
13 * Author: Peter Dinda <pdinda@northwestern.edu>
15 * This is free software. You are permitted to use,
16 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
19 #ifndef __VMM_LAZY_FPU
20 #define __VMM_LAZY_FPU
22 #include <palacios/vmm_types.h>
25 struct v3_lazy_fpu_iface {
27 // if these two are provided then lazy FP save/restore handled by host
28 // indicate that the calling thread has used floating point
29 void (*used_fpu)(void);
30 // indicate that the calling thread wants to use floating point again
31 void (*need_fpu)(void);
40 extern void V3_Init_Lazy_FPU(struct v3_lazy_fpu_iface * palacios_lazy_fpu);
44 #define V3_LAZY_FPU_USED() \
46 extern struct v3_lazy_fpu_iface * palacios_lazy_fpu_hooks; \
47 if ((palacios_lazy_fpu_hooks) && (palacios_lazy_fpu_hooks)->used_fpu) { \
48 (palacios_lazy_fpu_hooks)->used_fpu(); \
52 #define V3_LAZY_FPU_NEED() \
54 extern struct v3_lazy_fpu_iface * palacios_lazy_fpu_hooks; \
55 if ((palacios_lazy_fpu_hooks) && (palacios_lazy_fpu_hooks)->need_fpu) { \
56 (palacios_lazy_fpu_hooks)->need_fpu(); \