11#define STR_MODULENAME "AC97 Stream: "
30#pragma code_seg("PAGE")
44 "Allocation failures cause a system crash"))
58 if (*MiniportPCIStream)
60 (*MiniportPCIStream)->AddRef ();
78 DOUT (
DBG_PRINT, (
"[CMiniportWaveICHStream::~CMiniportWaveICHStream]"));
135 PreFetchOffset->SetPreFetchOffset(32 * (
DataFormat->WaveFormatEx.nChannels * 2));
136 PreFetchOffset->Release();
157 DOUT (
DBG_PRINT, (
"[CMiniportWaveICHStream::GetAllocatorFraming]"));
163 SampleSize =
DataFormat->WaveFormatEx.nChannels * 2;
362 SampleSize =
DataFormat->WaveFormatEx.nChannels * 2;
392 UCHAR nCurrentIndex = 0;
426 while (
i != nCurrentIndex)
463 ULONG ulOldDMAEngineState;
465 DOUT (
DBG_PRINT, (
"[CMiniportWaveICHStream::RevokeMappings]"));
501 *MappingsRevoked += 1;
528STDMETHODIMP_(
void) CMiniportWaveICHStream::MappingAvailable (
void)
558 ULONG ulBytesMapped = 0;
559 int nInsertMappings = 0;
562 DOUT (
DBG_PRINT, (
"[CMiniportWaveICHStream::GetNewMappings]"));
580 DOUT (
DBG_DMA, (
"[GetNewMappings] We starved ... Head %d, Tail %d, Entries %d.",
595 ULONG ulBufferLength;
601NEW_MAPPINGS_AVAILBLE_MAYBE:
627 goto NEW_MAPPINGS_AVAILBLE_MAYBE;
637 if (ulBufferLength > 0x1FFFE)
640 DOUT (
DBG_ERROR, (
"[GetNewMappings] Buffer length too long!"));
641 ulBufferLength = 0x1FFFE;
668 ulBytesMapped += ulBufferLength;
711 DOUT (
DBG_DMA, (
"[GetNewMappings] Got %d mappings.", nInsertMappings));
712 DOUT (
DBG_DMA, (
"[GetNewMappings] Head %d, Tail %d, Entries %d.",
738 int nMappingsReleased = 0;
740 DOUT (
DBG_PRINT, (
"[CMiniportWaveICHStream::ReleaseUsedMappings]"));
774 DOUT (
DBG_ERROR, (
"[ReleaseUsedMappings] CIV out of range!"));
785 DOUT (
DBG_ERROR, (
"[ReleaseUsedMappings] CIV out of range!"));
813 DOUT (
DBG_ERROR, (
"[ReleaseUsedMappings] Inconsitency: Tail reached and Entries != 1."));
855 if (nMappingsReleased)
860 DOUT (
DBG_DMA, (
"[ReleaseUsedMappings] Head %d, Tail %d, Entries %d.",
void ResumeDMA(ULONG state=DMA_ENGINE_ON)
UCHAR ReadReg8(ULONG addr)
NTSTATUS NormalizePhysicalPosition(_Inout_ PLONGLONG PhysicalPosition)
int GetBuffPos(DWORD *buffPos)
USHORT ReadReg16(ULONG addr)
PSERVICEGROUP ServiceGroup
void WriteReg8(ULONG addr, UCHAR data)
NTSTATUS SetState(_In_ KSSTATE State)
void PowerChangeNotify_(IN POWER_STATE NewState)
ULONGLONG TotalBytesMapped
void InterruptServiceRoutine()
NTSTATUS GetNewMappings(void)
~CMiniportWaveICHStream()
ULONGLONG TotalBytesReleased
NTSTATUS ReleaseUsedMappings(void)
#define NT_SUCCESS(StatCode)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define DOUT(lvl, strings)
const int DMA_ENGINE_PAUSE
#define IMP_CMiniportStream_QueryInterface(cType, sType)
#define IMP_CMiniportStream_SetFormat(cType)
const int DMA_ENGINE_PEND
#define __drv_reportError(why)
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define KeInitializeSpinLock(sl)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_In_ PKSALLOCATOR_FRAMING AllocatorFraming
#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY
#define KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY
#define _When_(expr, annos)
#define FILE_LONG_ALIGNMENT
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
__GNU_EXTENSION typedef __int64 * PLONGLONG
#define _100NS_UNITS_PER_SECOND
IPreFetchOffset * PPREFETCHOFFSET
const int MAX_BDL_ENTRIES
#define STATUS_INSUFFICIENT_RESOURCES
STDMETHODIMP_(void) CMiniportWaveICHStream
NTSTATUS CreateMiniportWaveICHStream(OUT CMiniportWaveICHStream **MiniportPCIStream, IN PUNKNOWN pUnknownOuter, _When_((PoolType &NonPagedPoolMustSucceed) !=0, __drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) IN POOL_TYPE PoolType)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
#define DBG_PRINT(ppi, ch, level)
_In_ ULONG _In_ ULONG ulTag
_Must_inspect_result_ _In_ ULONG Flags
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
@ NonPagedPoolMustSucceed