[SOFT386]
[reactos.git] / lib / soft386 / common.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: 386/486 CPU Emulation Library
4 * FILE: common.h
5 * PURPOSE: Common functions used internally by Soft386 (header file).
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9 #ifndef _COMMON_H_
10 #define _COMMON_H_
11
12 /* INCLUDES *******************************************************************/
13
14 #include <soft386.h>
15
16 /* DEFINES ********************************************************************/
17
18 #define GET_SEGMENT_RPL(s) ((s) & 3)
19 #define GET_SEGMENT_INDEX(s) ((s) & 0xFFF8)
20
21 /* FUNCTIONS ******************************************************************/
22
23 inline
24 BOOLEAN
25 Soft386ReadMemory
26 (
27 PSOFT386_STATE State,
28 INT SegmentReg,
29 ULONG Offset,
30 BOOLEAN InstFetch,
31 PVOID Buffer,
32 ULONG Size
33 );
34
35 inline
36 BOOLEAN
37 Soft386WriteMemory
38 (
39 PSOFT386_STATE State,
40 INT SegmentReg,
41 ULONG Offset,
42 PVOID Buffer,
43 ULONG Size
44 );
45
46 inline
47 BOOLEAN
48 Soft386StackPush
49 (
50 PSOFT386_STATE State,
51 ULONG Value
52 );
53
54 inline
55 BOOLEAN
56 Soft386StackPop
57 (
58 PSOFT386_STATE State,
59 PULONG Value
60 );
61
62 inline
63 BOOLEAN
64 Soft386LoadSegment
65 (
66 PSOFT386_STATE State,
67 INT Segment,
68 WORD Selector
69 );
70
71 #endif // _COMMON_H_
72
73 /* EOF */