ReactOS  0.4.14-dev-608-gd495a4f
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_COUNTPDMA1_ADDRESS_COUNT
 
typedef struct _DMA2_ADDRESS_COUNT DMA2_ADDRESS_COUNT
 
typedef struct _DMA2_ADDRESS_COUNTPDMA2_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_ENTRYPROS_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

◆ B_16BITS

#define B_16BITS   3

Definition at line 146 of file haldma.h.

◆ B_32BITS

#define B_32BITS   2

Definition at line 145 of file haldma.h.

◆ B_8BITS

#define B_8BITS   0

Definition at line 143 of file haldma.h.

◆ BLOCK_REQUEST_MODE

#define BLOCK_REQUEST_MODE   0x02

Definition at line 171 of file haldma.h.

◆ BURST_TIMING

#define BURST_TIMING   3

Definition at line 152 of file haldma.h.

◆ CASCADE_REQUEST_MODE

#define CASCADE_REQUEST_MODE   0x03

Definition at line 172 of file haldma.h.

◆ COMPATIBLE_TIMING

#define COMPATIBLE_TIMING   0

Definition at line 149 of file haldma.h.

◆ DEMAND_REQUEST_MODE

#define DEMAND_REQUEST_MODE   0x00

Definition at line 169 of file haldma.h.

◆ DMA_AUTO_INIT

#define DMA_AUTO_INIT   0x10

Definition at line 179 of file haldma.h.

◆ DMA_CLEARMASK

#define DMA_CLEARMASK   0

Definition at line 175 of file haldma.h.

◆ DMA_READ

#define DMA_READ   4

Definition at line 176 of file haldma.h.

◆ DMA_SETMASK

#define DMA_SETMASK   4

Definition at line 174 of file haldma.h.

◆ DMA_SINGLE_TRANSFER

#define DMA_SINGLE_TRANSFER   0x40

Definition at line 178 of file haldma.h.

◆ DMA_WRITE

#define DMA_WRITE   8

Definition at line 177 of file haldma.h.

◆ MAP_BASE_SW_SG

#define MAP_BASE_SW_SG   1

Definition at line 367 of file haldma.h.

◆ READ_TRANSFER

#define READ_TRANSFER   0x01

Definition at line 165 of file haldma.h.

◆ SINGLE_REQUEST_MODE

#define SINGLE_REQUEST_MODE   0x01

Definition at line 170 of file haldma.h.

◆ TYPE_A_TIMING

#define TYPE_A_TIMING   1

Definition at line 150 of file haldma.h.

◆ TYPE_B_TIMING

#define TYPE_B_TIMING   2

Definition at line 151 of file haldma.h.

◆ VERIFY_TRANSFER

#define VERIFY_TRANSFER   0x00

Definition at line 164 of file haldma.h.

◆ W_16BITS

#define W_16BITS   1

Definition at line 144 of file haldma.h.

◆ WRITE_TRANSFER

#define WRITE_TRANSFER   0x02

Definition at line 166 of file haldma.h.

Typedef Documentation

◆ ADAPTER_OBJECT

◆ DMA1_ADDRESS_COUNT

◆ DMA1_CONTROL

◆ DMA2_ADDRESS_COUNT

◆ DMA2_CONTROL

◆ DMA_CHANNEL_MASK

◆ DMA_CHANNEL_STOP

◆ DMA_EXTENDED_MODE

◆ DMA_MODE

typedef union _DMA_MODE DMA_MODE

◆ DMA_PAGE

◆ EISA_CONTROL

◆ GROW_WORK_ITEM

◆ PDMA1_ADDRESS_COUNT

◆ PDMA1_CONTROL

◆ PDMA2_ADDRESS_COUNT

◆ PDMA2_CONTROL

◆ PDMA_CHANNEL_MASK

◆ PDMA_CHANNEL_STOP

◆ PDMA_EXTENDED_MODE

◆ PDMA_MODE

typedef union _DMA_MODE * PDMA_MODE

◆ PDMA_PAGE

◆ PEISA_CONTROL

◆ PGROW_WORK_ITEM

◆ PROS_MAP_REGISTER_ENTRY

◆ ROS_MAP_REGISTER_ENTRY

Function Documentation

◆ HalpDmaAllocateMasterAdapter()

PADAPTER_OBJECT NTAPI HalpDmaAllocateMasterAdapter ( VOID  )

Definition at line 332 of file dma.c.

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 }
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:416
void * PVOID
Definition: retypes.h:9
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TAG_DMA
Definition: dma.c:116
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#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

◆ HalpDmaGetDmaAlignment()

ULONG NTAPI HalpDmaGetDmaAlignment ( PADAPTER_OBJECT  AdapterObject)

Definition at line 918 of file dma.c.

920 {
921  return 1;
922 }

◆ HalpGetDmaAdapter()

PDMA_ADAPTER NTAPI HalpGetDmaAdapter ( IN PVOID  Context,
IN PDEVICE_DESCRIPTION  DeviceDescription,
OUT PULONG  NumberOfMapRegisters 
)

Definition at line 790 of file dma.c.

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