ReactOS 0.4.15-dev-7889-g76290a6
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 398 of file dma.c.

399{
400 PADAPTER_OBJECT MasterAdapter;
401 ULONG Size, SizeOfBitmap;
402
403 SizeOfBitmap = MAX_MAP_REGISTERS;
404 Size = sizeof(ADAPTER_OBJECT);
405 Size += sizeof(RTL_BITMAP);
406 Size += (SizeOfBitmap + 7) >> 3;
407
409 if (!MasterAdapter) return NULL;
410
411 RtlZeroMemory(MasterAdapter, Size);
412
413 KeInitializeSpinLock(&MasterAdapter->SpinLock);
414 InitializeListHead(&MasterAdapter->AdapterQueue);
415
416 MasterAdapter->MapRegisters = (PVOID)(MasterAdapter + 1);
417 RtlInitializeBitMap(MasterAdapter->MapRegisters,
418 (PULONG)(MasterAdapter->MapRegisters + 1),
419 SizeOfBitmap);
420 RtlSetAllBits(MasterAdapter->MapRegisters);
421 MasterAdapter->NumberOfMapRegisters = 0;
422 MasterAdapter->CommittedMapRegisters = 0;
423
424 MasterAdapter->MapRegisterBase = ExAllocatePoolWithTag(NonPagedPool,
425 SizeOfBitmap *
427 TAG_DMA);
428 if (!MasterAdapter->MapRegisterBase)
429 {
430 ExFreePool(MasterAdapter);
431 return NULL;
432 }
433
434 RtlZeroMemory(MasterAdapter->MapRegisterBase,
435 SizeOfBitmap * sizeof(ROS_MAP_REGISTER_ENTRY));
436 if (!HalpGrowMapBuffers(MasterAdapter, 0x10000))
437 {
438 ExFreePool(MasterAdapter);
439 return NULL;
440 }
441
442 return MasterAdapter;
443}
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
#define MAX_MAP_REGISTERS
Definition: dma.c:158
#define TAG_DMA
Definition: dma.c:160
BOOLEAN NTAPI HalpGrowMapBuffers(IN PADAPTER_OBJECT AdapterObject, IN ULONG SizeOfMapBuffers)
Definition: dma.c:271
struct _ADAPTER_OBJECT ADAPTER_OBJECT
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP)
Definition: haldma.h:313
uint32_t * PULONG
Definition: typedefs.h:59
void * PVOID
Definition: typedefs.h:50
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
struct _RTL_BITMAP RTL_BITMAP
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by HalpInitDma().

◆ HalpDmaGetDmaAlignment()

ULONG NTAPI HalpDmaGetDmaAlignment ( PADAPTER_OBJECT  AdapterObject)

◆ HalpGetDmaAdapter()

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

Definition at line 852 of file dma.c.

855{
857}
PADAPTER_OBJECT NTAPI HalGetAdapter(IN PDEVICE_DESCRIPTION DeviceDescription, OUT PULONG NumberOfMapRegisters)
Definition: dma.c:22
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:432
_Out_ PULONG NumberOfMapRegisters
Definition: halfuncs.h:209

Referenced by HalInitSystem(), and HalpInitDma().