From: Hans-Georg Thien <1682-600@onlinehome.de>
To: root@chaos.analogic.com
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: getting timestamp of last interrupt?
Date: Mon, 06 Oct 2003 23:59:35 +0200 [thread overview]
Message-ID: <3F81E5C7.1040104@onlinehome.de> (raw)
In-Reply-To: <Pine.LNX.4.53.0310061507470.531@chaos>
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
next prev parent reply other threads:[~2003-10-06 21:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.fj0euih.s2sbop@ifi.uio.no>
[not found] ` <fa.fvjdidn.13ni70f@ifi.uio.no>
2003-10-04 4:03 ` Hans-Georg Thien
2003-10-06 12:52 ` Richard B. Johnson
2003-10-06 18:21 ` Hans-Georg Thien
2003-10-06 18:34 ` Richard B. Johnson
2003-10-06 19:05 ` Hans-Georg Thien
2003-10-06 19:33 ` Richard B. Johnson
2003-10-06 21:59 ` Hans-Georg Thien [this message]
[not found] ` <fa.ch95hks.10kepak@ifi.uio.no>
2003-10-04 4:05 ` Hans-Georg Thien
2003-10-06 15:26 ` Gabriel Paubert
2003-10-06 18:37 ` Hans-Georg Thien
2003-05-01 21:48 [RFC][PATCH] "Disable Trackpad while typing" on Notebooks withh a PS/2 Trackpad Hans-Georg Thien
2003-05-08 19:12 ` [RFC][PATCH] "Disable Trackpad while typing" on Notebooks withh aPS/2 Trackpad Khalid Aziz
2003-05-27 20:47 ` Hans-Georg Thien
2003-05-27 21:10 ` wwp
2003-10-02 17:40 ` getting timestamp of last interrupt? Hans-Georg Thien
2003-10-02 18:54 ` Karim Yaghmour
2003-10-02 18:59 ` Richard B. Johnson
2003-10-02 22:46 ` Peter Chubb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F81E5C7.1040104@onlinehome.de \
--to=1682-600@onlinehome.de \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome