Sorting source tree a bit
[tpg/acess2.git] / KernelLand / Kernel / arch / x86 / include / vm8086.h
1 /*
2  * Acess2 VM8086 BIOS Interface
3  * - By John Hodge (thePowersGang)
4  *
5  * vm8086.h
6  * - Core Header
7  */
8 #ifndef _VM80806_H_
9 #define _VM80806_H_
10
11 // === TYPES ===
12 /**
13  * \note Semi-opaque - Past \a .IP, the implementation may add any data
14  *       it needs to the state.
15  */
16 typedef struct sVM8086
17 {
18         Uint16  AX, CX, DX, BX;
19         Uint16  BP, SP, SI, DI;
20         
21         Uint16  SS, DS, ES;
22         
23         Uint16  CS, IP;
24         
25         struct sVM8086_InternalData     *Internal;
26 }       tVM8086;
27
28 // === FUNCTIONS ===
29 /**
30  * \brief Create an instance of the VM8086 Emulator
31  * \note Do not free this pointer with ::free, instead use ::VM8086_Free
32  * \return Pointer to a tVM8086 structure, this structure may be larger than
33  *         tVM8086 due to internal data.
34  */
35 extern tVM8086  *VM8086_Init(void);
36 /**
37  * \brief Free an allocated tVM8086 structure
38  * \param State Emulator state to free
39  */
40 extern void     VM8086_Free(tVM8086 *State);
41 /**
42  * \brief Allocate a piece of memory in the emulated address space and
43  *        return a host and emulated pointer to it.
44  * \param State Emulator state
45  * \param Size  Size of memory block
46  * \param Segment       Pointer to location to store the allocated memory's segment
47  * \param Offset        Pointet to location to store the allocated memory's offset
48  * \return Host pointer to the allocated memory
49  */
50 extern void     *VM8086_Allocate(tVM8086 *State, int Size, Uint16 *Segment, Uint16 *Offset);
51 /**
52  * \brief Gets a pointer to a piece of emulated memory
53  * \todo Only 1 machine page is garenteed to be contiguous
54  * \param State Emulator State
55  * \param Segment       Source Segment
56  * \param Offset        Source Offset
57  * \return Host pointer to the emulated memory
58  */
59 extern void *VM8086_GetPointer(tVM8086 *State, Uint16 Segment, Uint16 Offset);
60 /**
61  * \brief Calls a real-mode interrupt described by the current state of the IVT.
62  * \param State Emulator State
63  * \param Interrupt     BIOS Interrupt to call
64  */
65 extern void     VM8086_Int(tVM8086 *State, Uint8 Interrupt);
66
67 #endif

UCC git Repository :: git.ucc.asn.au