Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!sdd.hp.com!usc!cs.utexas.edu!texbell!nuchat!steve From: steve@nuchat.UUCP (Steve Nuchia) Newsgroups: comp.unix.wizards Subject: Re: driver close from exit can't catch signal? Message-ID: <26811@nuchat.UUCP> Date: 30 Jul 90 16:59:31 GMT References: <26789@nuchat.UUCP> <544@siswat.UUCP> Reply-To: steve@nuchat.UUCP (Steve Nuchia) Organization: Houston Public Access Lines: 45 In article <544@siswat.UUCP> buck@siswat.UUCP (A. Lester Buck) writes: >Since we all know that, unfortunately, interrupts are never guaranteed to >come, the only thing to do in an industrial strength driver is have a >watchdog timer. At some reasonable interval (every 1-10 sec, maybe) it Which brings up another problem -- there does not appear to be a good way to have a watchdog call the interrupt routine if the priority level of the ISR isn't the same as the one timeout uses. The "excellent manual" doesn't even say what priority level you get called at out of timeout. (At least not that I can find now. I thought I had seen it once but I gave up after hunting for it for a couple of hours last week.) Best way I could figure was to use a couple of gate-guard flags. Yuck. There has to be a canonical way to do this, right? This device does need a watchdog, but I've been holding off putting it in so as to get some idea how frequently it loses interupts. Also hoping for inspiration on the above problem. >The standard way to grab signals in a driver is by sleeping with PCATCH >or'ed into the sleep priority. Then wakeup has sleep return one instead of I about half expected this to work even inside exit, but Noooo. >even save the u.u_qsav and replace it with it's own jmpbuf to catch a signal >directly (wakeup does the longjmp itself if PCATCH is not set), but that is >probably not recommended. Not now that PCATCH extists. My understanding is that saving u_qsav used to be The Way. >The PCATCH/u_qsav information is in the AT&T Driver Development Manual, >the excellent manual in a three ring binder. I paid $100 last year, but >I think it is $200 now. I do sincerely hope "excellent" is simply missing a smiley. I've been wearing out my client's copy, and it is infuriating. Aside from about one trivial copy-editing botch per page, it has a very low information density, the customary (for AT+T) nonsensical organization, and it just leaves out a whole lot of necessary information. -- Steve Nuchia South Coast Computing Services (713) 964-2462 "To learn which questions are unanswerable, and _not_to_answer_them; this skill is most needful in times of stress and darkness." Ursula LeGuin, _The_Left_Hand_of_Darkness_