ReactOS 0.4.16-dev-122-g325d74c
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
40typedef struct _EMS_HANDLE
41{
47
48typedef struct _EMS_PAGE
49{
53
54#pragma pack(push, 1)
55
57{
61
63{
67
68typedef struct _EMS_COPY_DATA
69{
80
82{
86
87typedef struct _EMS_HARDWARE_INFO
88{
95
96#pragma pack(pop)
97
98/* FUNCTIONS ******************************************************************/
99
102
103#endif /* _EMSDRV_H_ */
unsigned char BOOLEAN
struct _EMS_COPY_DATA * PEMS_COPY_DATA
VOID EmsDrvCleanup(VOID)
Definition: emsdrv.c:850
BOOLEAN EmsDrvInitialize(USHORT Segment, ULONG TotalPages)
Definition: emsdrv.c:767
struct _EMS_HANDLE_PAGE_INFO * PEMS_HANDLE_PAGE_INFO
struct _EMS_HANDLE_DIR_ENTRY EMS_HANDLE_DIR_ENTRY
struct _EMS_PAGE * PEMS_PAGE
struct _EMS_COPY_DATA EMS_COPY_DATA
struct _EMS_HANDLE_PAGE_INFO EMS_HANDLE_PAGE_INFO
struct _EMS_HANDLE * PEMS_HANDLE
struct _EMS_HANDLE_DIR_ENTRY * PEMS_HANDLE_DIR_ENTRY
struct _EMS_HARDWARE_INFO EMS_HARDWARE_INFO
struct _EMS_PAGE EMS_PAGE
struct _EMS_MAPPABLE_PHYS_PAGE EMS_MAPPABLE_PHYS_PAGE
struct _EMS_MAPPABLE_PHYS_PAGE * PEMS_MAPPABLE_PHYS_PAGE
struct _EMS_HARDWARE_INFO * PEMS_HARDWARE_INFO
struct _EMS_HANDLE EMS_HANDLE
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned short USHORT
Definition: pedump.c:61
USHORT SourceOffset
Definition: emsdrv.h:73
USHORT SourceHandle
Definition: emsdrv.h:72
USHORT DestSegment
Definition: emsdrv.h:78
USHORT SourceSegment
Definition: emsdrv.h:74
USHORT DestHandle
Definition: emsdrv.h:76
USHORT DestOffset
Definition: emsdrv.h:77
UCHAR SourceType
Definition: emsdrv.h:71
UCHAR DestType
Definition: emsdrv.h:75
ULONG RegionLength
Definition: emsdrv.h:70
Definition: emsdrv.h:63
USHORT Handle
Definition: emsdrv.h:64
USHORT PageCount
Definition: emsdrv.h:43
LIST_ENTRY PageList
Definition: emsdrv.h:44
BOOLEAN Allocated
Definition: emsdrv.h:42
WORD RawPageSize
Definition: emsdrv.h:89
WORD DmaChannelOperation
Definition: emsdrv.h:93
WORD AlternateRegSets
Definition: emsdrv.h:90
WORD DmaRegisterSets
Definition: emsdrv.h:92
WORD ContextAreaSize
Definition: emsdrv.h:91
USHORT Handle
Definition: emsdrv.h:51
LIST_ENTRY Entry
Definition: emsdrv.h:50
Definition: typedefs.h:120
uint32_t ULONG
Definition: typedefs.h:59
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
unsigned char UCHAR
Definition: xmlstorage.h:181