Discussion:
udelay (Linux) equivalent API in WDK driver?
(too old to reply)
dsrking
2010-09-13 12:26:37 UTC
Permalink
Hi

I am porting Linux driver to Windows XP. In linux driver they used
'udelay' API for some micro seconds delay.
How can i port this API in Windows Driver (KMDF)?

thanks in Adavance,
D.
Burkhardt Braun
2010-09-13 16:08:49 UTC
Permalink
Hello,
KeWaitForSingleObject
or
KeSetTimerEx are candidates.
Kind regards
Burkhardt Braun
Post by dsrking
Hi
I am porting Linux driver to Windows XP. In linux driver they used
'udelay' API for some micro seconds delay.
How can i port this API in Windows Driver (KMDF)?
thanks in Adavance,
D.
RossettoeCioccolato
2010-09-13 16:12:21 UTC
Permalink
Try KeStallExecutionProcessor.
http://msdn.microsoft.com/en-us/library/ff553295(VS.85).aspx.
Post by dsrking
Hi
I am porting Linux driver to Windows XP. In linux driver they used
'udelay' API for some micro seconds delay.
How can i port this API in Windows Driver (KMDF)?
thanks in Adavance,
D.
David Craig
2010-09-14 00:47:07 UTC
Permalink
This is a very frequent question about the design of device driver
interfaces supported by Unix, Linux, and Windows. You omitted so much
information that providing correct answers is not possible. You forgot to
specify at what IRQL the code you wish to protect can be running, is there
hardware involved, what type of hardware, does it provide a Windows port
driver, does it require a miniport of some sort, and what is the port
driver?
Post by dsrking
Hi
I am porting Linux driver to Windows XP. In linux driver they used
'udelay' API for some micro seconds delay.
How can i port this API in Windows Driver (KMDF)?
thanks in Adavance,
D.
dsrking
2010-09-14 16:12:39 UTC
Permalink
Hi

Thanks for your reply.

'KeStallExecutionProcessor' is working for my case.

Regards,
D.
Tim Roberts
2010-09-15 05:33:56 UTC
Permalink
Post by dsrking
'KeStallExecutionProcessor' is working for my case.
Remember that KeStallExecutionProcessor runs a tight CPU loop, using 100%
of the CPU. KeDelayExecutionThread is a better choice, because it releases
the CPU during the wait.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
RossettoeCioccolato
2010-09-15 06:08:03 UTC
Permalink
Tim,

The premise is that the OP only wants to wait a few useconds, which makes
KeStallExecutionProcessor the better choice. KeDelayExecutionThread is the
better choice for longer waits, measured in milliseconds.

Regards,

Rossetoecioccolato.
dsrking
2010-09-15 12:19:15 UTC
Permalink
Thanks Tim & Rossetoecioccolato.

i have one more doubt regarding ISA non PNP interrupt handling. It is
clear for PNP interrupt handling is done by WDF layer. But for ISA non
PNP devices, we need to mention the interrupt number in LogConfig -
IRQConfig entry. I mentioned my interrupt number in IRQConfig entry.

But I did not get any interrupt for my device. should we do anything
inside the code for interrupt register and etc., for non pnp isa
device in WDF driver?

Currently I am using amcc5933 sample in WDK. For polling mode, i can
get interrupt but in interrupt mode, i didn't get any interrupt. So
only i got doubt in registering interrupt number, vector for isa non
pnp device.

Awaiting for response.

Thanks in advance.
D.
Maxim S. Shatskih
2010-09-16 10:17:00 UTC
Permalink
Post by dsrking
But I did not get any interrupt for my device. should we do anything
inside the code for interrupt register and etc., for non pnp isa
device in WDF driver?
No.

NonPnP ISA and PnP ISA are the same in driver code. The only difference is that you must register the IRQs in the INF file.
--
Maxim S. Shatskih
Windows DDK MVP
***@storagecraft.com
http://www.storagecraft.com
Loading...