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_EXCP_H__
21 #define __VMM_EXCP_H__
26 #include <palacios/vmm_types.h>
28 #define DE_EXCEPTION 0x00
29 #define DB_EXCEPTION 0x01
30 #define NMI_EXCEPTION 0x02
31 #define BP_EXCEPTION 0x03
32 #define OF_EXCEPTION 0x04
33 #define BR_EXCEPTION 0x05
34 #define UD_EXCEPTION 0x06
35 #define NM_EXCEPTION 0x07
36 #define DF_EXCEPTION 0x08
37 #define TS_EXCEPTION 0x0a
38 #define NP_EXCEPTION 0x0b
39 #define SS_EXCEPTION 0x0c
40 #define GPF_EXCEPTION 0x0d
41 #define PF_EXCEPTION 0x0e
42 #define MF_EXCEPTION 0x10
43 #define AC_EXCEPTION 0x11
44 #define MC_EXCEPTION 0x12
45 #define XF_EXCEPTION 0x13
46 #define SX_EXCEPTION 0x1e
51 struct v3_excp_state {
53 /* We need to rework the exception state, to handle stacking */
56 uint_t excp_error_code_valid : 1;
57 uint_t excp_error_code;
62 void v3_init_exception_state(struct guest_info * info);
65 int v3_raise_exception(struct guest_info * info, uint_t excp);
66 int v3_raise_exception_with_error(struct guest_info * info, uint_t excp, uint_t error_code);
68 int v3_excp_pending(struct guest_info * info);
69 int v3_get_excp_number(struct guest_info * info);
70 int v3_injecting_excp(struct guest_info * info, uint_t excp);