ReactOS  0.4.14-dev-323-g6fe6a88
emsdrv.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GPLv2+ - See COPYING in the top level directory
3  * PROJECT: ReactOS Virtual DOS Machine
4  * FILE: subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.h
5  * PURPOSE: DOS EMS Driver
6  * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7  */
8 
9 #ifndef _EMSDRV_H_
10 #define _EMSDRV_H_
11 
12 /* DEFINITIONS ****************************************************************/
13 
14 #define EMS_VERSION_NUM 0x40
15 #define EMS_INTERRUPT_NUM 0x67
16 #define EMS_SEGMENT 0xD000 // Default segment
17 // Specification: Operating system handle 0x0000; user handles from 0x0001 to 0x00FE
18 #define EMS_MAX_HANDLES 255
19 #define EMS_PAGE_BITS 14
20 #define EMS_PAGE_SIZE (1 << EMS_PAGE_BITS)
21 #define EMS_PHYSICAL_PAGES 4
22 
23 /* 16 MB of EMS memory */
24 #define EMS_TOTAL_PAGES 1024
25 
26 #define EMS_STATUS_SUCCESS 0x00
27 #define EMS_STATUS_INTERNAL_ERROR 0x80
28 #define EMS_STATUS_INVALID_HANDLE 0x83
29 #define EMS_STATUS_UNKNOWN_FUNCTION 0x84
30 #define EMS_STATUS_NO_MORE_HANDLES 0x85
31 #define EMS_STATUS_INSUFFICIENT_PAGES 0x88
32 #define EMS_STATUS_ZERO_PAGES 0x89
33 #define EMS_STATUS_INV_LOGICAL_PAGE 0x8A
34 #define EMS_STATUS_INV_PHYSICAL_PAGE 0x8B
35 #define EMS_STATUS_INVALID_SUBFUNCTION 0x8F
36 #define EMS_STATUS_HANDLE_NOT_FOUND 0xA0
37 #define EMS_STATUS_UNNAMED_HANDLE 0xA1
38 #define EMS_STATUS_HANDLE_ALREADY_EXISTS 0xA1
39 
40 typedef struct _EMS_HANDLE
41 {
45  UCHAR Name[8];
47 
48 typedef struct _EMS_PAGE
49 {
53 
54 #pragma pack(push, 1)
55 
56 typedef struct _EMS_HANDLE_PAGE_INFO
57 {
61 
62 typedef struct _EMS_HANDLE_DIR_ENTRY
63 {
65  UCHAR Name[8];
67 
68 typedef struct _EMS_COPY_DATA
69 {
80 
82 {
86 
87 typedef struct _EMS_HARDWARE_INFO
88 {
95 
96 #pragma pack(pop)
97 
98 /* FUNCTIONS ******************************************************************/
99 
102 
103 #endif /* _EMSDRV_H_ */
struct _EMS_MAPPABLE_PHYS_PAGE * PEMS_MAPPABLE_PHYS_PAGE
LIST_ENTRY PageList
Definition: emsdrv.h:44
USHORT Handle
Definition: emsdrv.h:64
ULONG RegionLength
Definition: emsdrv.h:70
struct _EMS_HANDLE * PEMS_HANDLE
struct _EMS_HANDLE_DIR_ENTRY EMS_HANDLE_DIR_ENTRY
USHORT DestHandle
Definition: emsdrv.h:76
WORD RawPageSize
Definition: emsdrv.h:89
USHORT SourceSegment
Definition: emsdrv.h:74
WORD DmaRegisterSets
Definition: emsdrv.h:92
WORD ContextAreaSize
Definition: emsdrv.h:91
struct _EMS_HANDLE EMS_HANDLE
struct _EMS_PAGE * PEMS_PAGE
WORD DmaChannelOperation
Definition: emsdrv.h:93
USHORT Handle
Definition: emsdrv.h:51
Definition: emsdrv.h:62
BOOLEAN Allocated
Definition: emsdrv.h:42
unsigned char BOOLEAN
struct _EMS_MAPPABLE_PHYS_PAGE EMS_MAPPABLE_PHYS_PAGE
USHORT DestSegment
Definition: emsdrv.h:78
BOOLEAN EmsDrvInitialize(USHORT Segment, ULONG TotalPages)
Definition: emsdrv.c:767
_Inout_ PVOID Segment
Definition: exfuncs.h:893
LIST_ENTRY Entry
Definition: emsdrv.h:50
VOID EmsDrvCleanup(VOID)
Definition: emsdrv.c:850
struct _EMS_HANDLE_DIR_ENTRY * PEMS_HANDLE_DIR_ENTRY
unsigned short WORD
Definition: ntddk_ex.h:93
USHORT SourceOffset
Definition: emsdrv.h:73
USHORT SourceHandle
Definition: emsdrv.h:72
unsigned char UCHAR
Definition: xmlstorage.h:181
Definition: typedefs.h:117
struct _EMS_HANDLE_PAGE_INFO EMS_HANDLE_PAGE_INFO
struct _EMS_HANDLE_PAGE_INFO * PEMS_HANDLE_PAGE_INFO
struct _EMS_COPY_DATA * PEMS_COPY_DATA
unsigned short USHORT
Definition: pedump.c:61
struct _EMS_COPY_DATA EMS_COPY_DATA
struct _EMS_HARDWARE_INFO EMS_HARDWARE_INFO
UCHAR SourceType
Definition: emsdrv.h:71
USHORT DestOffset
Definition: emsdrv.h:77
UCHAR DestType
Definition: emsdrv.h:75
unsigned int ULONG
Definition: retypes.h:1
WORD AlternateRegSets
Definition: emsdrv.h:90
struct _EMS_HARDWARE_INFO * PEMS_HARDWARE_INFO
USHORT PageCount
Definition: emsdrv.h:43
struct _EMS_PAGE EMS_PAGE