Anurag Chaudhary wrote:
I used nanosleep() in my device driver, but it crashed the kernel saying pagefault in kernel mode.
Can anybody please suggest some other method to be used in a kld to sleep

When you put the kernel to sleep, what were you expecting to wake it up? :-)


A literal answer would be an interrupt, but in many contexts, such as device drivers, tend to block receipt of new interrupts while servicing the existing one. Regardless, there is a critical design methodology involved: you shouldn't ever block or busy-wait in the kernel, at least if you can possibly avoid it. Look into continuations and performing a context swap to a runnable process until the next interrupt happens and your device driver can make more progress.

--
-Chuck


_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to