* libcurses++, libc++ and liblightOS++ are installed into the crosscompiler directory
[lightOS.git] / kernel / include / kernel / x86 / v86.hpp
blob4597a50c99a3ea77e3087fd2386830ea0b9ee1ee
1 /*
2 lightOS kernel
3 Copyright (C) 2007-2009 Jörg Pfähler
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef LIGHTOS_KERNEL_X86_V86_HPP
20 #define LIGHTOS_KERNEL_X86_V86_HPP
22 /*! \addtogroup kernel kernel */
23 /*@{*/
24 /*! \addtogroup x86 x86 */
25 /*@{*/
27 #ifdef _LIGHTOS_V86
29 #include <cstdint>
30 #include <kernel/processor.hpp>
32 namespace kernel
34 /*! The x86 cpu state */
35 struct state86
37 uint32_t eax;
38 uint32_t ebx;
39 uint32_t ecx;
40 uint32_t edx;
41 uint32_t ds;
42 uint32_t es;
43 uint32_t edi;
44 uint32_t esi;
47 class v86
49 public:
50 inline static v86 &instance(){return mInst;}
51 bool int86( uint32_t number,
52 uint32_t eax,
53 uint32_t ebx,
54 uint32_t ecx,
55 uint32_t edx,
56 uint32_t ds,
57 uint32_t es,
58 uint32_t edi,
59 uint32_t esi);
60 state86 get_state();
61 bool is_v86_mode(){return bInV86;}
62 processorId processor_id(){return mProcessorId;}
63 private:
64 inline v86():bInV86(false){}
65 inline ~v86(){}
67 static v86 mInst;
68 bool bInV86;
69 volatile processorId mProcessorId;
73 #endif
75 /*@}*/
76 /*@}*/
78 #endif