From 741870b1343c661f677c3035c0794782bb62358a Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 28 Mar 2004 20:44:09 +0000 Subject: [PATCH] DbgPrint -> DPRINT svn path=/trunk/; revision=8910 --- reactos/drivers/dd/sndblst/card.c | 12 +++---- reactos/drivers/dd/sndblst/dma.c | 51 +++++++++++++-------------- reactos/drivers/dd/sndblst/irq.c | 5 +-- reactos/drivers/dd/sndblst/portio.c | 25 +++++++------ reactos/drivers/dd/sndblst/settings.c | 4 --- reactos/drivers/dd/sndblst/sndblst.c | 5 --- reactos/drivers/dd/sndblst/sndblst.h | 3 ++ 7 files changed, 45 insertions(+), 60 deletions(-) diff --git a/reactos/drivers/dd/sndblst/card.c b/reactos/drivers/dd/sndblst/card.c index 8c204973d0c..434406b2688 100644 --- a/reactos/drivers/dd/sndblst/card.c +++ b/reactos/drivers/dd/sndblst/card.c @@ -5,14 +5,12 @@ */ #include - -#include #include "sndblst.h" VOID SetOutputSampleRate(UINT BasePort, UINT SampleRate) { // This only works for DSP v4.xx ONLY - need a workaround! - DbgPrint("Setting output sample rate\n"); + DPRINT("Setting output sample rate\n"); // WAIT // if (! WaitToSend(BasePort)) @@ -26,7 +24,7 @@ VOID SetOutputSampleRate(UINT BasePort, UINT SampleRate) VOID EnableSpeaker(UINT BasePort, BOOLEAN SpeakerOn) { - DbgPrint("Setting speaker status %d\n", SpeakerOn); + DPRINT("Setting speaker status %d\n", SpeakerOn); // if (! WaitForWrite(BasePort)) // return; @@ -37,7 +35,7 @@ VOID EnableSpeaker(UINT BasePort, BOOLEAN SpeakerOn) BOOLEAN IsSpeakerEnabled(UINT BasePort) { - DbgPrint("Obtaining speaker status\n"); + DPRINT("Obtaining speaker status\n"); // if (! WaitToSend(BasePort)) // return FALSE; @@ -54,7 +52,7 @@ VOID BeginPlayback(UINT BasePort, UINT BitDepth, UINT Channels, UINT BlockSize) { CHAR Command; - DbgPrint("BeginPlayback(%d, %d, %d, %d)\n", BasePort, BitDepth, Channels, BlockSize); + DPRINT("BeginPlayback(%d, %d, %d, %d)\n", BasePort, BitDepth, Channels, BlockSize); // switch(BitDepth) // { @@ -63,7 +61,7 @@ VOID BeginPlayback(UINT BasePort, UINT BitDepth, UINT Channels, UINT BlockSize) // default : Command = 0xc0; // } - DbgPrint("Initiating playback\n"); + DPRINT("Initiating playback\n"); // TEMPORARY: SB_WRITE_BYTE(BasePort, 0xc6); diff --git a/reactos/drivers/dd/sndblst/dma.c b/reactos/drivers/dd/sndblst/dma.c index 3638f4fb308..cf72c558917 100644 --- a/reactos/drivers/dd/sndblst/dma.c +++ b/reactos/drivers/dd/sndblst/dma.c @@ -3,9 +3,6 @@ */ #include - -#include - #include "sndblst.h" @@ -46,7 +43,7 @@ IO_ALLOCATION_ACTION STDCALL SoundProgramDMA( UINT zzz; PUCHAR VirtualAddress = (PUCHAR) MmGetMdlVirtualAddress(Device->Mdl); - DbgPrint("IoMapTransfer\n"); + DPRINT("IoMapTransfer\n"); IoMapTransfer(Device->Adapter, Device->Mdl, MapRegisterBase, @@ -54,14 +51,14 @@ IO_ALLOCATION_ACTION STDCALL SoundProgramDMA( &Device->BufferSize, // is this right? TRUE); - DbgPrint("VBuffer == 0x%x (really 0x%x?) Bufsize == %u\n", Device->VirtualBuffer, MmGetPhysicalAddress(Device->VirtualBuffer), Device->BufferSize); + DPRINT("VBuffer == 0x%x (really 0x%x?) Bufsize == %u\n", Device->VirtualBuffer, MmGetPhysicalAddress(Device->VirtualBuffer), Device->BufferSize); - DbgPrint("Writing %u bytes of garbage...\n", Device->BufferSize); + DPRINT("Writing %u bytes of garbage...\n", Device->BufferSize); // Write some garbage: for (zzz = 0; zzz < Device->BufferSize; zzz ++) *(VirtualAddress + zzz) = (UCHAR) zzz % 200; - DbgPrint("done\n"); + DPRINT("done\n"); KeSetEvent(Context, 0, FALSE); @@ -79,7 +76,7 @@ BOOLEAN CreateDMA(PDEVICE_OBJECT DeviceObject) // Buffersize should already be set but it isn't yet ! Device->BufferSize = SB_BUFSIZE; - DbgPrint("Bufsize == %u\n", Device->BufferSize); + DPRINT("Bufsize == %u\n", Device->BufferSize); RtlZeroMemory(&Desc, sizeof(DEVICE_DESCRIPTION)); @@ -102,74 +99,74 @@ BOOLEAN CreateDMA(PDEVICE_OBJECT DeviceObject) // Desc.MinimumLength = 0; Desc.DmaPort = 0; - DbgPrint("Calling HalGetAdapter(), asking for %d mapped regs\n", MappedRegs); + DPRINT("Calling HalGetAdapter(), asking for %d mapped regs\n", MappedRegs); Device->Adapter = HalGetAdapter(&Desc, &MappedRegs); - DbgPrint("Called\n"); + DPRINT("Called\n"); if (! Device->Adapter) { - DbgPrint("HalGetAdapter() FAILED\n"); + DPRINT("HalGetAdapter() FAILED\n"); return FALSE; } - DbgPrint("Bufsize == %u\n", Device->BufferSize); + DPRINT("Bufsize == %u\n", Device->BufferSize); if (MappedRegs < BYTES_TO_PAGES(Device->BufferSize)) { - DbgPrint("Could only allocate %u mapping registers\n", MappedRegs); + DPRINT("Could only allocate %u mapping registers\n", MappedRegs); if (MappedRegs == 0) return FALSE; Device->BufferSize = MappedRegs * PAGE_SIZE; - DbgPrint("Bufsize == %u\n", Device->BufferSize); + DPRINT("Bufsize == %u\n", Device->BufferSize); } - DbgPrint("Allocated %u mapping registers\n", MappedRegs); + DPRINT("Allocated %u mapping registers\n", MappedRegs); // Check if we already have memory here... // Check to make sure we're >= minimum - DbgPrint("Allocating buffer\n"); + DPRINT("Allocating buffer\n"); - DbgPrint("Bufsize == %u\n", Device->BufferSize); + DPRINT("Bufsize == %u\n", Device->BufferSize); Device->VirtualBuffer = HalAllocateCommonBuffer(Device->Adapter, Device->BufferSize, &Device->Buffer, FALSE); // For some reason BufferSize == 0 here?! - DbgPrint("Buffer == 0x%x Bufsize == %u\n", Device->Buffer, Device->BufferSize); + DPRINT("Buffer == 0x%x Bufsize == %u\n", Device->Buffer, Device->BufferSize); if (! Device->VirtualBuffer) { - DbgPrint("Could not allocate buffer :(\n"); + DPRINT("Could not allocate buffer :(\n"); // should try again with smaller buffer... return FALSE; } - DbgPrint("Buffer == 0x%x Bufsize == %u\n", Device->Buffer, Device->BufferSize); + DPRINT("Buffer == 0x%x Bufsize == %u\n", Device->Buffer, Device->BufferSize); - DbgPrint("Calling IoAllocateMdl()\n"); + DPRINT("Calling IoAllocateMdl()\n"); Device->Mdl = IoAllocateMdl(Device->VirtualBuffer, Device->BufferSize, FALSE, FALSE, NULL); - DbgPrint("Bufsize == %u\n", Device->BufferSize); + DPRINT("Bufsize == %u\n", Device->BufferSize); // IS THIS RIGHT: if (! Device->VirtualBuffer) { - DbgPrint("IoAllocateMdl() FAILED\n"); + DPRINT("IoAllocateMdl() FAILED\n"); // Free the HAL buffer return FALSE; } - DbgPrint("VBuffer == 0x%x Mdl == %u Bufsize == %u\n", Device->VirtualBuffer, Device->Mdl, Device->BufferSize); + DPRINT("VBuffer == 0x%x Mdl == %u Bufsize == %u\n", Device->VirtualBuffer, Device->Mdl, Device->BufferSize); - DbgPrint("Calling MmBuildMdlForNonPagedPool\n"); + DPRINT("Calling MmBuildMdlForNonPagedPool\n"); MmBuildMdlForNonPagedPool(Device->Mdl); - DbgPrint("Bufsize == %u\n", Device->BufferSize); + DPRINT("Bufsize == %u\n", Device->BufferSize); // part II: KeInitializeEvent(&DMAEvent, SynchronizationEvent, FALSE); @@ -177,7 +174,7 @@ BOOLEAN CreateDMA(PDEVICE_OBJECT DeviceObject) IoAllocateAdapterChannel(Device->Adapter, DeviceObject, BYTES_TO_PAGES(Device->BufferSize), SoundProgramDMA, &DMAEvent); - DbgPrint("VBuffer == 0x%x Bufsize == %u\n", Device->VirtualBuffer, Device->BufferSize); + DPRINT("VBuffer == 0x%x Bufsize == %u\n", Device->VirtualBuffer, Device->BufferSize); // Lower IRQL KeWaitForSingleObject(&DMAEvent, Executive, KernelMode, FALSE, NULL); diff --git a/reactos/drivers/dd/sndblst/irq.c b/reactos/drivers/dd/sndblst/irq.c index a92887be29e..1448f772ee8 100644 --- a/reactos/drivers/dd/sndblst/irq.c +++ b/reactos/drivers/dd/sndblst/irq.c @@ -1,7 +1,4 @@ #include - -#include - #include "sndblst.h" @@ -65,7 +62,7 @@ BOOLEAN ISR( PDEVICE_OBJECT DeviceObject = (PDEVICE_OBJECT)Context; PDEVICE_EXTENSION Parameters = DeviceObject->DeviceExtension; - DbgPrint("*** Processing ISR ***\n"); + DPRINT("*** Processing ISR ***\n"); // What do we do here then? diff --git a/reactos/drivers/dd/sndblst/portio.c b/reactos/drivers/dd/sndblst/portio.c index e1b3773e2b5..7e12e414e89 100644 --- a/reactos/drivers/dd/sndblst/portio.c +++ b/reactos/drivers/dd/sndblst/portio.c @@ -13,12 +13,11 @@ #include #include "sndblst.h" - BOOLEAN WaitToSend(UINT BasePort) { int TimeOut; - DbgPrint("WaitToSend "); + DPRINT("WaitToSend "); // Check if it's OK to send for (TimeOut = SB_TIMEOUT; @@ -28,11 +27,11 @@ BOOLEAN WaitToSend(UINT BasePort) // If a time-out occurs, we report failure if (! TimeOut) { - DbgPrint("FAILED\n"); + DPRINT("FAILED\n"); return FALSE; } - DbgPrint("SUCCEEDED\n"); + DPRINT("SUCCEEDED\n"); return TRUE; } @@ -41,7 +40,7 @@ BOOLEAN WaitToReceive(UINT BasePort) { int TimeOut; - DbgPrint("WaitToReceive "); + DPRINT("WaitToReceive "); // Check if it's OK to receive for (TimeOut = SB_TIMEOUT; @@ -51,11 +50,11 @@ BOOLEAN WaitToReceive(UINT BasePort) // If a time-out occurs, we report failure if (! TimeOut) { - DbgPrint("FAILED\n"); + DPRINT("FAILED\n"); return FALSE; } - DbgPrint("SUCCEEDED\n"); + DPRINT("SUCCEEDED\n"); return TRUE; } @@ -67,9 +66,9 @@ WORD InitSoundCard(UINT BasePort) BOOLEAN Status; UCHAR DSP_Major, DSP_Minor; - DbgPrint("InitSoundCard() called\n"); + DPRINT("InitSoundCard() called\n"); - DbgPrint("Resetting sound card\n"); + DPRINT("Resetting sound card\n"); // if (!WaitToSend(BasePort)) // return FALSE; @@ -79,7 +78,7 @@ WORD InitSoundCard(UINT BasePort) // Check if it's OK to receive (some cards will ignore the above reset // command and so will not issue an ACK, so time out is NOT an error) - DbgPrint("Waiting for an ACK\n"); + DPRINT("Waiting for an ACK\n"); if (WaitToReceive(BasePort)) { // Check to make sure the reset was acknowledged: @@ -88,7 +87,7 @@ WORD InitSoundCard(UINT BasePort) TimeOut --); } - DbgPrint("Querying DSP version\n"); + DPRINT("Querying DSP version\n"); if (! WaitToSend(BasePort)) return FALSE; @@ -100,9 +99,9 @@ WORD InitSoundCard(UINT BasePort) DSP_Major = SB_READ_DATA(BasePort); DSP_Minor = SB_READ_DATA(BasePort); - DbgPrint("DSP v%d.%d\n", DSP_Major, DSP_Minor); + DPRINT("DSP v%d.%d\n", DSP_Major, DSP_Minor); - DbgPrint("Sound card initialized!\n"); + DPRINT("Sound card initialized!\n"); return (DSP_Major * 256) + DSP_Minor; } diff --git a/reactos/drivers/dd/sndblst/settings.c b/reactos/drivers/dd/sndblst/settings.c index e6783fd6118..983918d7159 100644 --- a/reactos/drivers/dd/sndblst/settings.c +++ b/reactos/drivers/dd/sndblst/settings.c @@ -11,11 +11,7 @@ #include #include - #include "sndblst.h" - -// #define NDEBUG -#include #include "sbdebug.h" // our own debug helper diff --git a/reactos/drivers/dd/sndblst/sndblst.c b/reactos/drivers/dd/sndblst/sndblst.c index 59cfb961624..85f043a564c 100644 --- a/reactos/drivers/dd/sndblst/sndblst.c +++ b/reactos/drivers/dd/sndblst/sndblst.c @@ -12,12 +12,7 @@ /* INCLUDES ****************************************************************/ #include -//#include - -//#define NDEBUG -#include #include - #include "sndblst.h" diff --git a/reactos/drivers/dd/sndblst/sndblst.h b/reactos/drivers/dd/sndblst/sndblst.h index d3a0a267299..39f26614f77 100644 --- a/reactos/drivers/dd/sndblst/sndblst.h +++ b/reactos/drivers/dd/sndblst/sndblst.h @@ -14,6 +14,9 @@ #include +#define NDEBUG +#include + #define DEFAULT_PORT 0x220 #define DEFAULT_IRQ 5 #define DEFAULT_DMA 1