hwcapdmaengine.h
来自「2个avstream类型驱动演示」· C头文件 代码 · 共 60 行
H
60 行
// HwcapDmaEngine.h: interface for the HwcapDmaEngine class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_HWCAPDMAENGINE_H__7E9DB63C_381A_4027_BD65_DC8DC0AFD776__INCLUDED_)
#define AFX_HWCAPDMAENGINE_H__7E9DB63C_381A_4027_BD65_DC8DC0AFD776__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////
// HwcapDmaEngine
//
// Scatter/gather DMA Simulation.
//
// Maintains a list of active DMA "scatter/gather" entries associated
// with pending "empty" stream frames.
//
// On each pin's OnProcess() request a list of new available mappings is
// added by calling AddMappings(). On each interrupt, these mappings get
// filled in with image data by calling CompleteMappings() from the DPC.
// As the mappings get filled in, the DPC advances the stream pointer
// accordingly.
//
class HwcapDmaEngine
{
public:
HwcapDmaEngine(ULONG MaxScatterGatherEntries=128);
~HwcapDmaEngine();
ULONG AddMappings(
PUCHAR* VirtualAddress,
KSSTREAM_POINTER_OFFSET& Mapping);
ULONG CompleteMappings(PUCHAR Image, ULONG ImageSize);
void DiscardMappings();
protected:
// "DMA entry" descriptor for the "hardware"
struct ScatterGatherEntry : public KHeapClient<ScatterGatherEntry> {
LIST_ENTRY m_ListEntry;
PUCHAR Address; /// virtual
ULONG ByteCount;
ScatterGatherEntry(PUCHAR Addr, ULONG Count) :
Address(Addr),ByteCount(Count) {}
};
KInterlockedList<ScatterGatherEntry> m_List;
KHeap<ScatterGatherEntry> m_Heap;
ULONG m_MaxScatterGatherEntries; // limit for growth
ULONG m_EntriesQueued;
ULONG m_BytesQueued;
};
#endif // !defined(AFX_HWCAPDMAENGINE_H__7E9DB63C_381A_4027_BD65_DC8DC0AFD776__INCLUDED_)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?