Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Feb 1995 06:19:41 -0500 (EST)
From:      Peter Dufault <dufault@hda.com>
To:        tinguely@plains.nodak.edu (Mark Tinguely)
Cc:        hackers@FreeBSD.org
Subject:   Re: longjump in kernel
Message-ID:  <199502041119.GAA26711@hda.com>
In-Reply-To: <199502040224.AA13601@plains.NoDak.edu> from "Mark Tinguely" at Feb 3, 95 08:24:58 pm

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199502041119.GAA26711>