Skip to contentSkip to conversation

Why pass pt_regs throughout the input system?

DISCUSSION Dmitry Torokhov 3 participants 3 messages May 12, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

I have a question - why do we have to pass pt_regs structure throughout entire input system? As far as I can tell it is a snapshot of all registers that is done at the keyboard interrupt time and it is not used for anything but for displaying this data when requested by SysRq.

Would it be wrong to save it by the hardware driver at interrupt time into a structure accessible by keyboard.c? I do not think it matters if the data shown by SysRq comes from interrupt other than one that serves keyboard...

Although it is somewhat a domain violation I do not think it is worse than fattening interface to pass information that is not needed by most of its users.

Signature · 1 line
Dmitry
#1 lore raw
Quoted 5 lines · Dmitry Torokhov

I have a question - why do we have to pass pt_regs structure throughout entire input system? As far as I can tell it is a snapshot of all registers that is done at the keyboard interrupt time and it is not used for anything but for displaying this data when requested by SysRq.

Quoted 7 lines

Would it be wrong to save it by the hardware driver at interrupt time into a structure accessible by keyboard.c? I do not think it matters if the data shown by SysRq comes from interrupt other than one that serves keyboard...

Although it is somewhat a domain violation I do not think it is worse than fattening interface to pass information that is not needed by most of its users.

Ask David S. Miller for details - I think the problem was with simultaneous invocation of multiple pt_regs printouts.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#2 lore raw
Quoted 2 lines · On Wed, 12 May 2004 10:40:56 +0200 Vojtech Pavlik <[email protected]> wrote:

Ask David S. Miller for details - I think the problem was with simultaneous invocation of multiple pt_regs printouts.

That's correct, if i'm using multiple keyboards (say one i8042 based and one USB based) in order to get fancy debugging dumps, any scheme that saves away info at interrupt time simply will be inaccurate and not work.