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.


Modified boot and vmxassist to handle real/protected transition.
[palacios.git] / bios / vmxassist / vm86.h
1 /*
2  * vm86.h: vm86 emulator definitions.
3  *
4  * Leendert van Doorn, leendert@watson.ibm.com
5  * Copyright (c) 2005, International Business Machines Corporation.
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms and conditions of the GNU General Public License,
9  * version 2, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18  * Place - Suite 330, Boston, MA 02111-1307 USA.
19  */
20 #ifndef __VM86_H__
21 #define __VM86_H__
22
23 #ifndef __ASSEMBLY__
24 #include <stdint.h>
25 #endif
26
27 #include "vmx_assist.h"
28
29 #ifndef __ASSEMBLY__
30
31 struct regs {
32         unsigned        edi, esi, ebp, esp, ebx, edx, ecx, eax;
33         unsigned        trapno, errno;
34         unsigned        eip, cs, eflags, uesp, uss;
35         unsigned        ves, vds, vfs, vgs;
36 };
37
38 enum vm86_mode {
39         VM86_REAL = 0,
40         VM86_REAL_TO_PROTECTED,
41         VM86_PROTECTED_TO_REAL,
42         VM86_PROTECTED
43 };
44
45 #ifdef DEBUG
46 #define TRACE(a)        trace a
47 #else
48 #define TRACE(a)
49 #endif
50
51 extern enum vm86_mode prevmode, mode;
52 extern struct vmx_assist_context oldctx;
53
54 extern void emulate(struct regs *);
55 extern void dump_regs(struct regs *);
56 extern void trace(struct regs *, int, char *, ...);
57
58 extern void set_mode(struct regs *, enum vm86_mode);
59 extern void switch_to_real_mode(void);
60 extern void switch_to_protected_mode(void);
61
62 #endif /* __ASSEMBLY__ */
63
64 #endif /* __VM86_H__ */