DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Multithreading device drivers

Modifying the start routine

All code that calls the start( ) entry point routine needs to obtain the lock. Any early error checks need to release lock_xxtab. lock_xxtab is released in the start( ) routine just after:

   if(!xxtab.b_active) {
   ...
       xxtab.b_active++;
       unlockb(&lock_xxtab, -1);
   ...
   }
The -1 argument to the unlockb( ) function indicates that unlockb( ) will not restore the spl value; that is, your driver will call splx(D3oddi) after the unlockb( ) call, usually in the routine that called start( ). If start( ) was called as a result of an interprocessor interrupt, from the use of startio(D3oddi), then the kernel will perform the necessary splx at the end of the interrupt.
© 2005 The SCO Group, Inc. All rights reserved.