DPC crashing in NT4 legacy driver
- From: sgfallows@xxxxxxxxx
- Date: 17 Apr 2006 12:42:14 -0700
I guess I'm thick here...
I'm trying to get the simplest possible DPC to run from an ISR without
crashing the system. My only purpose is to be able to test the hardware
we have built (PCI card).
I can handle interrupts OK and acknowledge them in the hardware in my
ISR. However when I try to call a DPC the system (XP SP2) reboots.
The DPC looks like this:
VOID TcmDpcRoutine(IN PKDPC Dpc, IN PDEVICE_OBJECT DeviceObject, IN
PIRP Irp, IN PVOID Context)
{
DbgPrint(DBG_MSG_HDR ": Dpc !!!!!!!!!!!!!!!!!!!!!!");
return;
}
The ISR looks like this:
BOOLEAN TcmInterruptServiceRoutine(IN PKINTERRUPT Interrupt, IN OUT
PVOID Context )
{
PTCM_DEVICE_EXTENSION deviceExtension = Context;
PDEVICE_OBJECT deviceObject = deviceExtension->DeviceObject;
TCM_REGISTERS *pRegisters = deviceExtension->pRegisters;
DbgPrint(DBG_MSG_HDR ": InterruptServiceRoutine - Got one!\n");
// Verify in our Interrupt Status Register we interrupted
if (not our interrupt)
{
return FALSE;
}
// Clear all active the interrupts in our hardware registers
IoRequestDpc(deviceObject, NULL, NULL);
return TRUE;
}
My interrrupt setup routine, called from DriverEntry():
NTSTATUS TcmSetupISR(PDEVICE_OBJECT deviceObject,
ULONG BusNumber,
ULONG interruptLine )
{
PTCM_DEVICE_EXTENSION deviceExtension = NULL;
NTSTATUS ioConnectStatus = 0;
KIRQL Irql = 0;
ULONG MappedSysVect = 0;
deviceExtension = deviceObject->DeviceExtension;
// register DPC routine
IoInitializeDpcRequest(deviceObject, TcmDpcRoutine);
//Get a mapped vector for our interrupt
MappedSysVect = HalGetInterruptVector(PCIBus,
BusNumber,
deviceExtension->Level,
deviceExtension->Vector,
&Irql,
&deviceExtension->Affinity);
KeInitializeSpinLock( &deviceExtension->ISRSpinLock);
// connect the device driver to the IRQ
ioConnectStatus =
IoConnectInterrupt(&deviceExtension->InterruptObject,
TcmInterruptServiceRoutine,
deviceExtension,
&deviceExtension->ISRSpinLock,
MappedSysVect,
Irql,
Irql,
LevelSensitive,
TRUE,
deviceExtension->Affinity,
FALSE
);
return ioConnectStatus;
}
I have no #pragma alloc_text statements so I believe all code will
remain resident.
Can anybody tell me what I am doing wrong?
Thanks
.
- Follow-Ups:
- Re: DPC crashing in NT4 legacy driver
- From: Mark Roddy
- Re: DPC crashing in NT4 legacy driver
- Prev by Date: Re: USB HID filter or minidriver for custom mouse/keyboard?
- Next by Date: Re: Kernel debugging on notebooks
- Previous by thread: Re: How does GDI use the "hdev" element in a SURFOBJ?
- Next by thread: Re: DPC crashing in NT4 legacy driver
- Index(es):
Relevant Pages
|