Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


*** empty log message ***
[palacios.git] / palacios / src / palacios / vmm_intr.c
1 #include <palacios/vmm_intr.h>
2 #include <palacios/vm_guest.h>
3
4
5 void init_interrupt_state(struct vm_intr * state) {
6   state->excp_pending = 0;
7   state->excp_num = 0;
8   state->excp_error_code = 0;
9 }
10
11 int raise_exception(struct guest_info * info, uint_t excp) {
12
13   /* We can't stack exceptions, 
14      but do we need to have some sort of priority?
15   */
16   if (info->intr_state.excp_pending) {
17     info->intr_state.excp_pending = 1;
18     info->intr_state.excp_num = excp;
19   } else {
20     return -1;
21   }
22
23   return 0;
24 }
25
26
27 int intr_pending(struct vm_intr * intr) {
28   if (intr->excp_pending) {
29     return 1;
30   }
31
32   /* Check [A]PIC */
33
34   return 0;
35 }
36
37
38 uint_t get_intr_number(struct vm_intr * intr) {
39   if (intr->excp_pending) {
40     return intr->excp_num;
41   } 
42
43   /* someway to get the [A]PIC intr */
44
45   return 0;
46 }
47
48
49 uint_t get_intr_type(struct vm_intr * intr) {
50   if (intr->excp_pending) {
51     return EXCEPTION;
52   }
53
54   return INVALID_INTR;
55 }