DOCUMENT ID: 1152-02
SYNOPSIS: How to port spl5() routine on SVR4 to Solaris 2.1 X86
OS RELEASE: 2.1
PRODUCT: Solaris x86 for DDK
KEYWORDS: port spl5(), routine, interrupt, driver, DDK
DESCRIPTION:
In the old days to protect oneself from an interrupt a driver would do
something like
s = spl5();
STATE = xxxx;
cause_intr(); // Touch board to cause immediate interrupt
sleep(&someaddr);
splx(s);
and the interrupt routine COULD not be invoked before the sleep call and
it would
if (STATE == xxxx)
wakeup(&someaddr);
clear_intr();
SOLUTION:
Now in Solaris, interrupt routines should not be called before the call
to cv_wait() and the interrupt routine should look like
mutex_enter(&somemutex);
if (STATE == xxxx)
cv_signal(&someconditional);
clear_intr();
mutex_exit(&somemutex);
DATE APPROVED: 10/10/95