LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   sleep in kernel space (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/sleep-in-kernel-space-663637/)

ra2008 08-18-2008 12:39 PM

sleep in kernel space
 
hi, i am executing a while in kernel space, and each 100 ms a timer interrupt is generated. so after finishing my work, how can i sleep in kernel until the next interrupt occur.

thanx

blackhole54 08-19-2008 03:25 AM

I may be a little beyond my expertise here, but isn't that a very strange thing to do? If I understand correctly, you would be denying all user space processes the ability to run while the kernel has gone to sleep waiting for a blasted interrupt! That said, in other, more primitive, processors I've worked on (looong time ago!) there were commands called things similar to "wait on interrupt" which would push all the usual info onto the stack (so it doesn't have to be pushed after receiving the interrupt) and then stop all processor activity until an interupt comes in (at which time normal processing resumes). I would suspect there is some such command in whatever processor you are using. But again, IMHO it sounds like a very questionable thing to do.

ra2008 08-25-2008 05:15 AM

hi,
i dont mean to let the whole kernel slee and hang the whole kernel.
what i mean is let a task sleep until an is interrupted by certain IRQ.

any hints??

blackhole54 08-25-2008 06:41 PM

This is rather beyond anything I've done in Linux (so if this is a really stupid idea, be gentle ;) ), but can you generate a signal in kernel mode and then have the user space program put itself to sleep and wake on the signal?


All times are GMT -5. The time now is 10:38 AM.