Start source tree (final, I hope!) restructuration. Part 1/X
[reactos.git] / reactos / subsystems / mvdm / ntvdm / hardware / dma.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: dma.h
5 * PURPOSE: Direct Memory Access Controller emulation -
6 * i8237A compatible with 74LS612 Memory Mapper extension
7 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #ifndef _DMA_H_
11 #define _DMA_H_
12
13 /* INCLUDES *******************************************************************/
14
15 #include "ntvdm.h"
16
17 /* DEFINES ********************************************************************/
18
19 #define DMA_CONTROLLERS 2
20 #define DMA_CONTROLLER_CHANNELS 4 // Each DMA controller has 4 channels
21
22 typedef struct _DMA_CHANNEL
23 {
24 WORD BaseAddress;
25 WORD BaseWordCnt;
26 WORD CurrAddress;
27 WORD CurrWordCnt;
28 BYTE Mode;
29 } DMA_CHANNEL, *PDMA_CHANNEL;
30
31 typedef struct _DMA_CONTROLLER
32 {
33 DMA_CHANNEL DmaChannel[DMA_CONTROLLER_CHANNELS];
34
35 WORD TempAddress;
36 WORD TempWordCnt;
37
38 BYTE TempReg;
39
40 BYTE Command;
41 BYTE Request;
42 BYTE Mask;
43 BYTE Status;
44
45 BOOLEAN FlipFlop; // 0: LSB ; 1: MSB
46
47 } DMA_CONTROLLER, *PDMA_CONTROLLER;
48
49 /* 74LS612 Memory Mapper extension */
50 typedef struct _DMA_PAGE_REGISTER
51 {
52 BYTE Page;
53 } DMA_PAGE_REGISTER, *PDMA_PAGE_REGISTER;
54
55 // The 74LS612 contains 16 bytes, each of them being a page register.
56 // They are accessible via ports 0x80 through 0x8F .
57
58 /* FUNCTIONS ******************************************************************/
59
60 VOID DmaInitialize(VOID);
61
62 #endif // _DMA_H_
63
64 /* EOF */