From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262425AbTJFSVb (ORCPT ); Mon, 6 Oct 2003 14:21:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263184AbTJFSVb (ORCPT ); Mon, 6 Oct 2003 14:21:31 -0400 Received: from moutng.kundenserver.de ([212.227.126.189]:27585 "EHLO moutng.kundenserver.de") by vger.kernel.org with ESMTP id S262425AbTJFSVZ (ORCPT ); Mon, 6 Oct 2003 14:21:25 -0400 Message-ID: <3F81B2A3.4040001@onlinehome.de> Date: Mon, 06 Oct 2003 20:21:23 +0200 From: Hans-Georg Thien <1682-600@onlinehome.de> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030718 X-Accept-Language: en-us, en MIME-Version: 1.0 To: root@chaos.analogic.com CC: Kernel Mailing List Subject: Re: getting timestamp of last interrupt? References: <3F7E46AB.3030709@onlinehome.de> In-Reply-To: X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Richard B. Johnson wrote: > On Sat, 4 Oct 2003, Hans-Georg Thien wrote: > > >>> [...] >>>>I am looking for a possibility to read out the last timestamp when an >>>>interrupt has occured. >>>> >>>>e.g.: the user presses a key on the keyboard. Where can I read out the >>>>timestamp of this event? >>> >>> >>>You can get A SIGIO signal for every keyboard, (or other input) event. >>>What you do with it is entirely up to you. Linux/Unix doesn't have >>>"callbacks", instead it has signals. It also has select() and poll(), >>>all useful for handling such events. If you want a time-stamp, you >>>call gettimeofday() in your signal handler. >>> >> >>Thanks a lot Richard, >> >>... but ... can I use signals in kernel mode? > > > Well you talked about the user pressing a key and getting > a time-stamp as a result. If you need time-stamps > inside the kernel, i.e, a module, then you can call > the kernel's do_gettimeofday() function. > Hello Richard, - It seems, that I should be more precise about what I exactly mean... I'm writing a kernel mode device driver (mouse). In that device driver I need the timestamp of the last event for another kernel mode device (keyboard). I do not care if that timestamp is in jiffies or in gettimeofday() format or whatever format does exist in the world. I am absolutely sure I can convert it somehow to fit my needs. But since it is a kernel mode driver it can not -AFAIK- use the signal() syscall. -Hans