Subject: re: Is there any way to tell if the current thread has a user context?
To: Matthew Orgass <darkstar@city-net.com>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 09/06/2005 15:34:29
> but from running the kernel debugger it seems that sometimes while in my interrupt
> handler curlwp points to a "struct lwp" from a thread that was previously running.
I thought it was always supposed to be NULL in interrupt context, but
looking at the code I don't see this set anywhere except the idle loop
and on process exit. I guess it is just likely to be NULL at some point
if you are in an interrupt and useful only for diagnostic tests. If this
is correct, it looks like dev/ic/awi.c is using it incorrectly.
curlwp/curproc can only safely be used in a process context. interrupt
context code should never test/use them. their value in that context
is not defined.
.mrg.