Hi, You can achieve the same as follows: 1. Pend for the event using sleep_on / interruptible_sleep_on. 2. When the event happens (Ex: from the interrupt handler), call wake_up / wake_up_interruptible. One thing is that you will execute step 1 in one of the driver entrypoint which will be invoked from the user space. You can perform this repeatedly by having while loop calling the diver entrypoint. Regards, Anj ----- Original Message ----- From: "jnf" <jnf@redwhitearmy.com> To: <kernelnewbies@nl.linux.org> Sent: Tuesday, January 06, 2004 11:22 AM Subject: module function design question. > Hello, > > I have a function that adds itself to a wait queue and waits for an event > to wake it up, then on any (fatal) error condition or when it finishes, it > needs to readd itself to the wait queue and wait for the same event to > happen again later. What I am doing right now is just adding to myself to > the wait queue first thing in the function, then calling myself > recursivley where necessary, but as i understand it, the stack space in > the kernel is somewhat limited (anyone know exactly what the limits are?) > and it seems to me that a function that never returns will net call ret, > and thus each time it calls itself the stack will be decremented to make > room for the new frame (assuming it all works the same in the kernel as it > does in user space), and thus over a long enough time line I should run > out of stack space? Are my thoughts there correct, and what would be a > better way to accomplish the same thing? > > > Thanks, > jnf > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/