From owner-freebsd-hackers Sat Feb 4 03:20:31 1995 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id DAA14563 for hackers-outgoing; Sat, 4 Feb 1995 03:20:31 -0800 Received: from hda.com (hda.com [199.232.40.182]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id DAA14556 for ; Sat, 4 Feb 1995 03:20:29 -0800 Received: (dufault@localhost) by hda.com (8.6.9/8.3) id GAA26711; Sat, 4 Feb 1995 06:19:42 -0500 From: Peter Dufault Message-Id: <199502041119.GAA26711@hda.com> Subject: Re: longjump in kernel To: tinguely@plains.nodak.edu (Mark Tinguely) Date: Sat, 4 Feb 1995 06:19:41 -0500 (EST) Cc: hackers@FreeBSD.org In-Reply-To: <199502040224.AA13601@plains.NoDak.edu> from "Mark Tinguely" at Feb 3, 95 08:24:58 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1779 Sender: hackers-owner@FreeBSD.org Precedence: bulk Mark Tinguely writes: > > > stupid question time. I have a video board that requires the camera to > supply vertical sync, and I need to wait for starts/stops of the vertical > syncs in the driver. if the camera is turned off and someone reads from the > camera, then my driver will hang forever (I guess this could be said for a > disk drive, but more users will shut their camera off when they would not > shut off their disk drive). > > am I correct in think there is nothing that can be done in this situation? > (a user process can set a timer and long jump out, but I can imagine this > is leagal in a device driver). > > I am about to change my sun based RGB grabber for nv/ivs to use this card > (the old cheap digial vision "computer eyes" - it was here, don't buy it if > you don't own one, we are going to buy a better card for real use). To set an alarm: -Use "sleep" to wait for the interrupt while in the user process context; -Use "wakeup" from the vertical sync interrupt to continue the blocked context; -Use "timeout" to set a timeout function that will wakeup the context with an error indication set in the event of loss of interrupt. Return an error code to the user process; -Use "untimeout" to cancel the timeout if the interrupt comes in on time. Grep around in /sys/i386/isa for "untimeout" and you will find some examples. This must be covered in the "The Design of the 4.3 OS" book by Leffler, Mckusick, and Karels. (Addison Wesley? We should add a bibliography section to the FAQ) -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267 -- Formerly hd@world.std.com. E-mail problems? Tell hdslip@iii.net