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.


added vnet device
[palacios.git] / geekos / src / geekos / trap.c
1 /*
2  * Trap handlers
3  * Copyright (c) 2001,2003,2004 David H. Hovemeyer <daveho@cs.umd.edu>
4  * $Revision: 1.3 $
5  * 
6  * This is free software.  You are permitted to use,
7  * redistribute, and modify it as specified in the file "COPYING".
8  */
9
10 #include <geekos/idt.h>
11 #include <geekos/kthread.h>
12 #include <geekos/defs.h>
13 #include <geekos/trap.h>
14 #include <geekos/serial.h>
15 #include <geekos/debug.h>
16 /*
17  * TODO: need to add handlers for other exceptions (such as bounds
18  * check, debug, etc.)
19  */
20
21 /*
22  * Handler for general protection faults and other bad errors.
23  * Kill the current thread (which caused the fault).
24  */
25 static void GPF_Handler(struct Interrupt_State* state)
26 {
27     /* Send the thread to the reaper... */
28   SerialPrintLevel(1000,"VMM: Exception %d received, killing thread %p\n",state->intNum, g_currentThread);
29   Dump_Interrupt_State(state);
30   
31   Exit(-1);
32   
33   /* We will never get here */
34   KASSERT(false);
35 }
36
37 /*
38  * Initialize handlers for processor traps.
39  */
40 void Init_Traps(void)
41 {
42   PrintBoth("Initializing Traps\n");
43   Install_Interrupt_Handler(12, &GPF_Handler);  /* stack exception */
44   Install_Interrupt_Handler(13, &GPF_Handler);  /* general protection fault */
45 }