1 /*
2  * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3  *          Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  *
10  * As a special exception, you may use this file as part of a free software
11  * library without restriction.  Specifically, if other files instantiate
12  * templates or use macros or inline functions from this file, or you compile
13  * this file and link it with other files to produce an executable, this
14  * file does not by itself cause the resulting executable to be covered by
15  * the GNU General Public License.  This exception does not however
16  * invalidate any other reasons why the executable file might be covered by
17  * the GNU General Public License.
18  */
19 #pragma once
20 
21 #include <l4/sys/types.h>
22 
23 enum
24 {
25   /**
26    * Architecture specific version ID.
27    *
28    * This ID must match the version field in the l4_vcpu_state_t structure
29    * after enabling vCPU mode or extended vCPU mode for a thread.
30    */
31   L4_VCPU_STATE_VERSION = 0x43
32 };
33 
34 /**
35  * \brief vCPU registers.
36  * \ingroup l4_vcpu_api
37  */
38 typedef struct l4_vcpu_regs_t
39 {
40   l4_umword_t es;     /**< gs register */
41   l4_umword_t ds;     /**< fs register */
42   l4_umword_t gs;     /**< gs register */
43   l4_umword_t fs;     /**< fs register */
44 
45   l4_umword_t di;     /**< edi register */
46   l4_umword_t si;     /**< esi register */
47   l4_umword_t bp;     /**< ebp register */
48   l4_umword_t pfa;    /**< page fault address */
49   l4_umword_t bx;     /**< ebx register */
50   l4_umword_t dx;     /**< edx register */
51   l4_umword_t cx;     /**< ecx register */
52   l4_umword_t ax;     /**< eax register */
53 
54   l4_umword_t trapno; /**< trap number */
55   l4_umword_t err;    /**< error code */
56 
57   l4_umword_t ip;     /**< instruction pointer */
58   l4_umword_t dummy1; /**< dummy \internal */
59   l4_umword_t flags;  /**< eflags */
60   l4_umword_t sp;     /**< stack pointer */
61   l4_umword_t ss;     /**< ss register */
62 } l4_vcpu_regs_t;
63 
64 typedef struct l4_vcpu_arch_state_t {} l4_vcpu_arch_state_t;
65 
66 /**
67  * \brief vCPU message registers.
68  * \ingroup l4_vcpu_api
69  */
70 typedef struct l4_vcpu_ipc_regs_t
71 {
72   l4_umword_t _res[2];
73   l4_umword_t label;
74   l4_umword_t _res2[3];
75   l4_msgtag_t tag;
76 } l4_vcpu_ipc_regs_t;
77