ReactOS  r76032
haldma.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DMA_PAGE
 
struct  _DMA_CHANNEL_MASK
 
union  _DMA_MODE
 
union  _DMA_EXTENDED_MODE
 
struct  _DMA_CHANNEL_STOP
 
struct  _DMA1_ADDRESS_COUNT
 
struct  _DMA2_ADDRESS_COUNT
 
struct  _DMA1_CONTROL
 
struct  _DMA2_CONTROL
 
struct  _EISA_CONTROL
 
struct  _ROS_MAP_REGISTER_ENTRY
 
struct  _ADAPTER_OBJECT
 
struct  _GROW_WORK_ITEM
 

Macros

#define B_8BITS   0
 
#define W_16BITS   1
 
#define B_32BITS   2
 
#define B_16BITS   3
 
#define COMPATIBLE_TIMING   0
 
#define TYPE_A_TIMING   1
 
#define TYPE_B_TIMING   2
 
#define BURST_TIMING   3
 
#define VERIFY_TRANSFER   0x00
 
#define READ_TRANSFER   0x01
 
#define WRITE_TRANSFER   0x02
 
#define DEMAND_REQUEST_MODE   0x00
 
#define SINGLE_REQUEST_MODE   0x01
 
#define BLOCK_REQUEST_MODE   0x02
 
#define CASCADE_REQUEST_MODE   0x03
 
#define DMA_SETMASK   4
 
#define DMA_CLEARMASK   0
 
#define DMA_READ   4
 
#define DMA_WRITE   8
 
#define DMA_SINGLE_TRANSFER   0x40
 
#define DMA_AUTO_INIT   0x10
 
#define MAP_BASE_SW_SG   1
 

Typedefs

typedef struct _DMA_PAGE DMA_PAGE
 
typedef struct _DMA_PAGEPDMA_PAGE
 
typedef struct _DMA_CHANNEL_MASK DMA_CHANNEL_MASK
 
typedef struct _DMA_CHANNEL_MASKPDMA_CHANNEL_MASK
 
typedef union _DMA_MODE DMA_MODE
 
typedef union _DMA_MODEPDMA_MODE
 
typedef union _DMA_EXTENDED_MODE DMA_EXTENDED_MODE
 
typedef union _DMA_EXTENDED_MODEPDMA_EXTENDED_MODE
 
typedef struct _DMA_CHANNEL_STOP DMA_CHANNEL_STOP
 
typedef struct _DMA_CHANNEL_STOPPDMA_CHANNEL_STOP
 
typedef struct _DMA1_ADDRESS_COUNT DMA1_ADDRESS_COUNT
 
typedef struct
_DMA1_ADDRESS_COUNT
PDMA1_ADDRESS_COUNT
 
typedef struct _DMA2_ADDRESS_COUNT DMA2_ADDRESS_COUNT
 
typedef struct
_DMA2_ADDRESS_COUNT
PDMA2_ADDRESS_COUNT
 
typedef struct _DMA1_CONTROL DMA1_CONTROL
 
typedef struct _DMA1_CONTROLPDMA1_CONTROL
 
typedef struct _DMA2_CONTROL DMA2_CONTROL
 
typedef struct _DMA2_CONTROLPDMA2_CONTROL
 
typedef struct _EISA_CONTROL EISA_CONTROL
 
typedef struct _EISA_CONTROLPEISA_CONTROL
 
typedef struct
_ROS_MAP_REGISTER_ENTRY 
ROS_MAP_REGISTER_ENTRY
 
typedef struct
_ROS_MAP_REGISTER_ENTRY
PROS_MAP_REGISTER_ENTRY
 
typedef struct _ADAPTER_OBJECT ADAPTER_OBJECT
 
typedef struct _GROW_WORK_ITEM GROW_WORK_ITEM
 
typedef struct _GROW_WORK_ITEMPGROW_WORK_ITEM
 

Functions

PADAPTER_OBJECT NTAPI HalpDmaAllocateMasterAdapter (VOID)
 
PDMA_ADAPTER NTAPI HalpGetDmaAdapter (IN PVOID Context, IN PDEVICE_DESCRIPTION DeviceDescription, OUT PULONG NumberOfMapRegisters)
 
ULONG NTAPI HalpDmaGetDmaAlignment (PADAPTER_OBJECT AdapterObject)
 

Macro Definition Documentation

#define B_16BITS   3

Definition at line 146 of file haldma.h.

#define B_32BITS   2

Definition at line 145 of file haldma.h.

#define B_8BITS   0

Definition at line 143 of file haldma.h.

#define BLOCK_REQUEST_MODE   0x02

Definition at line 171 of file haldma.h.

#define BURST_TIMING   3

Definition at line 152 of file haldma.h.

#define CASCADE_REQUEST_MODE   0x03

Definition at line 172 of file haldma.h.

#define COMPATIBLE_TIMING   0

Definition at line 149 of file haldma.h.

#define DEMAND_REQUEST_MODE   0x00

Definition at line 169 of file haldma.h.

#define DMA_AUTO_INIT   0x10

Definition at line 179 of file haldma.h.

#define DMA_CLEARMASK   0

Definition at line 175 of file haldma.h.

#define DMA_READ   4

Definition at line 176 of file haldma.h.

#define DMA_SETMASK   4

Definition at line 174 of file haldma.h.

#define DMA_SINGLE_TRANSFER   0x40

Definition at line 178 of file haldma.h.

#define DMA_WRITE   8

Definition at line 177 of file haldma.h.

#define MAP_BASE_SW_SG   1

Definition at line 367 of file haldma.h.

#define READ_TRANSFER   0x01

Definition at line 165 of file haldma.h.

#define SINGLE_REQUEST_MODE   0x01

Definition at line 170 of file haldma.h.

#define TYPE_A_TIMING   1

Definition at line 150 of file haldma.h.

#define TYPE_B_TIMING   2

Definition at line 151 of file haldma.h.

#define VERIFY_TRANSFER   0x00

Definition at line 164 of file haldma.h.

#define W_16BITS   1

Definition at line 144 of file haldma.h.

#define WRITE_TRANSFER   0x02

Definition at line 166 of file haldma.h.

Typedef Documentation

typedef union _DMA_MODE DMA_MODE
typedef union _DMA_MODE * PDMA_MODE

Function Documentation

PADAPTER_OBJECT NTAPI HalpDmaAllocateMasterAdapter ( VOID  )

Definition at line 332 of file dma.c.

Referenced by HalpInitDma().

333 {
334  PADAPTER_OBJECT MasterAdapter;
335  ULONG Size, SizeOfBitmap;
336 
337  SizeOfBitmap = MAX_MAP_REGISTERS;
338  Size = sizeof(ADAPTER_OBJECT);
339  Size += sizeof(RTL_BITMAP);
340  Size += (SizeOfBitmap + 7) >> 3;
341 
342  MasterAdapter = ExAllocatePoolWithTag(NonPagedPool, Size, TAG_DMA);
343  if (MasterAdapter == NULL)
344  return NULL;
345 
346  RtlZeroMemory(MasterAdapter, Size);
347 
348  KeInitializeSpinLock(&MasterAdapter->SpinLock);
349  InitializeListHead(&MasterAdapter->AdapterQueue);
350 
351  MasterAdapter->MapRegisters = (PVOID)(MasterAdapter + 1);
353  MasterAdapter->MapRegisters,
354  (PULONG)(MasterAdapter->MapRegisters + 1),
355  SizeOfBitmap);
356  RtlSetAllBits(MasterAdapter->MapRegisters);
357  MasterAdapter->NumberOfMapRegisters = 0;
358  MasterAdapter->CommittedMapRegisters = 0;
359 
360  MasterAdapter->MapRegisterBase = ExAllocatePoolWithTag(
361  NonPagedPool,
362  SizeOfBitmap * sizeof(ROS_MAP_REGISTER_ENTRY),
363  TAG_DMA);
364  if (MasterAdapter->MapRegisterBase == NULL)
365  {
366  ExFreePool(MasterAdapter);
367  return NULL;
368  }
369 
370  RtlZeroMemory(MasterAdapter->MapRegisterBase,
371  SizeOfBitmap * sizeof(ROS_MAP_REGISTER_ENTRY));
372  if (!HalpGrowMapBuffers(MasterAdapter, 0x10000))
373  {
374  ExFreePool(MasterAdapter);
375  return NULL;
376  }
377 
378  return MasterAdapter;
379 }
DWORD *typedef PVOID
Definition: winlogon.h:52
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
struct _RTL_BITMAP RTL_BITMAP
struct _ADAPTER_OBJECT ADAPTER_OBJECT
Definition: haldma.h:312
BOOLEAN NTAPI HalpGrowMapBuffers(IN PADAPTER_OBJECT AdapterObject, IN ULONG SizeOfMapBuffers)
Definition: dma.c:203
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
smooth NULL
Definition: ftsmooth.c:557
UINTN Size
Definition: acefiex.h:555
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TAG_DMA
Definition: dma.c:116
#define MAX_MAP_REGISTERS
Definition: dma.c:114
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
unsigned int * PULONG
Definition: retypes.h:1
NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP)
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
ULONG NTAPI HalpDmaGetDmaAlignment ( PADAPTER_OBJECT  AdapterObject)

Definition at line 918 of file dma.c.

920 {
921  return 1;
922 }
PDMA_ADAPTER NTAPI HalpGetDmaAdapter ( IN PVOID  Context,
IN PDEVICE_DESCRIPTION  DeviceDescription,
OUT PULONG  NumberOfMapRegisters 
)

Definition at line 790 of file dma.c.

Referenced by HalInitSystem(), and HalpInitDma().

794 {
796 }
_Out_ PULONG NumberOfMapRegisters
Definition: halfuncs.h:209
_Must_inspect_result_ _In_ PDEVICE_DESCRIPTION DeviceDescription
Definition: iofuncs.h:1015
PADAPTER_OBJECT NTAPI HalGetAdapter(IN PDEVICE_DESCRIPTION DeviceDescription, OUT PULONG NumberOfMapRegisters)
Definition: dma.c:22