Re: getting timestamp of last interrupt?

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

  • Next message: Matthew Wilcox: "Re: [PATCH 3/3] 2.6.0 aacraid driver update"
    Date:	Mon, 06 Oct 2003 23:59:35 +0200
    To: root@chaos.analogic.com
    
    

    Richard B. Johnson wrote:

    > On Mon, 6 Oct 2003, Hans-Georg Thien wrote:
    >
    >
    >>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.
    >>
    >
    >
    > Well the keyboard driver and the mouse driver are entirely
    > different devices.
    >
    yes, - I know

    > The keyboard has a built-int CPU that generates scan-codes for
    > every key-press/key-release. It also performs auto-repeat. The
    > mouse generates mouse data at each interrupting event. This data
    > represents direction and three key events. Wheel mouse have may
    > have additional data, I haven't looked at them. They are not
    > related in any way.
    >
    yes, - I know

    >
    >
    >>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();
    >> }
    >> }
    >>...
    >>
    >
    >
    > Now this pseudo-code shows a "last_kbd_event", not a mouse-
    > event as shown in:
    >
    yes, - I know =8))

    It is because I want do some things with the mouse in relation to
    keyboard events.

    >
    > [... a quite detailed explanation on mouse interrupts, mouse data ...]
    yes, I know. But my question was: how can I get the timestamp of the
    last keyboard interrupt.

    > When your module is un-installed, it needs to restore the
    > previous (saved) value of that pointer.
    >
    yes, - I know

    > Whatever code you make that pointer point-to, must be
    > interrupt-safe. It can get the jiffie-count and put it
    > into a buffer, then return.
    >
    yes, - I know

    Hey Richard, - what is so difficult to understand ?

    Anyway, - have you read the email reply from Gabriel Paubert regarding
    this topic? Sounds very good for a 2.6.x kernel. It seems that I can use
    the /dev/input/event? device files. I have just modprobed the "evdev"
    module. It seems that I can get my timestamps by reading one of this
    files. Have to investigate still which one of them I have to use.

    -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: Matthew Wilcox: "Re: [PATCH 3/3] 2.6.0 aacraid driver update"

    Relevant Pages

    • Re: PB 4.2 error in keypad [Del.] key maping in RDP session
      ... The layout manager provides a mechanism to remap keys to various locales ... without having to rebuild the keyboard driver. ... of custom keyboard drivers, where the driver is included as part of the BSP ... >>key functionality and not just locale issues. ...
      (microsoft.public.windowsce.platbuilder)
    • Re: Severe Troll alert
      ... successfully re-install the standard PS2 keyboard and the internal keyboard ... cure (as opposed to because I needed anyone telling me to try asking Toshiba ... So I wondered if anyone had ever come across a keyboard driver OF ANY TYPE ... > have to perform an in-place upgrade that steps atop your current install ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: Severe Troll alert
      ... > successfully re-install the standard PS2 keyboard and the internal ... > still doesn't work AND there is no keyboard driver at the Toshiba web ... > So I wondered if anyone had ever come across a keyboard driver OF ANY TYPE ... >> would take you to go look on their web site for a driver. ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: no standby
      ... Hi Richard, ... Enhanced QuietKey PS2 with Dell Touch" I go the next window which still ... > Did you go to the "Power Options" tab under your keyboard. ...
      (microsoft.public.windowsxp.basics)
    • Re: Model Railroader mag -- observations and quesions
      ... >>Richard wrote: ... The keys on an electronic keyboard are ... I'll even state that 99.9% of the organ sounds I use most often ...
      (rec.models.railroad)