阅读:2046回复:6
请问在驱动程序中如何进行延时操作?
请问在驱动程序中如何进行延时操作?
|
|
沙发#
发布于:2002-11-14 16:36
用定时器不行吗?
|
|
|
板凳#
发布于:2002-11-14 16:50
还有这两个函数:
KeDelayExecutionThread KeStallExecutionProcessor(<50毫秒) |
|
|
地板#
发布于:2002-11-14 16:54
用KeWaitforSingleObject也可以且不占有CPU。
|
|
|
地下室#
发布于:2002-11-14 17:12
可以定义一个事件,然后利用超时等待要延时的时间
|
|
5楼#
发布于:2002-11-14 17:24
靠,打开了等了一会儿,这么多人回复,早知道就不回复了。
|
|
6楼#
发布于:2002-11-15 08:54
1. KeDelayExecutionThread must be running at IRQL=PASSIVE_LEVEL
KeStallExecutionProcessor can be running at any IRQL 2. By the way, you have to finish ISR as soon as posibble to get the higher system\'s performance. Because OS will block other request that is <= the IRQL now is ruuning. 3. You have to create DPC object and associating the DPC object to the Interrupt object. Then calling KeStallExecutionProcessor in the DPC procedure to delay. 4. Be careful you may miss some interrupt if your delay is long. |
|