Re: getting timestamp of last interrupt?

From: Hans-Georg Thien (1682-600_at_onlinehome.de)
Date: 10/06/03

  • Next message: Dag Nygren: "Re: Bug in the sg driver"
    Date:	Mon, 06 Oct 2003 21:05:13 +0200
    To: root@chaos.analogic.com
    
    

    Richard B. Johnson wrote:

    > On Mon, 6 Oct 2003, Hans-Georg Thien wrote:
    >
    >>
    >>[...]
    >>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
    >
    >
    > Then it gets real simple. Just use jiffies, if you can stand the [...]
    I fear that there is still some miss-understanding. Jiffies are totally
    OK for me. I can use them without any conversion.

    I'll try to formulate the problem with some other words:

    I hope that there is is something like a "jiffie-counter" for the
    keyboard driver, that stores the actual jiffies value whenever a
    keyboard interrupt occurs.

    I hope too, that there is a way to query that "jiffie-counter" from
    another kernel driver, so that I can write something like

    mymouse_module.c

    ...
    void mouse_event(){

        // get the current time in jiffies
        int now=jiffies;

        // get the jiffie value of the last kbd event
        int last_kbd_event= ????; // ... but how to do that ...

        if ((now - last_kbd_event) > delay) {
            do_some_very_smart_things();
        }
       }
    ...

    -Hans

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Dag Nygren: "Re: Bug in the sg driver"

    Relevant Pages

    • Re: getting timestamp of last interrupt?
      ... > I'm writing a kernel mode device driver. ... > format or whatever format does exist in the world. ... Just use jiffies, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Is C# support load device driver?
      ... DeviceIOControl is simply a way of passing "op-codes" to a kernel mode device driver and retrieving the results. ... You obviously can't *write* a device driver in C# but you can interrogate a device driver via pinvoke. ... Regards ...
      (microsoft.public.dotnet.languages.csharp)