Skip to contentSkip to conversation

Magic Alt-SysRq change in 2.6.18-rc1

PATCH Bodo Eggert 2 participants 2 messages Jul 12, 2006 14 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw
Quoted 13 lines · Paulo Marques
Quoted 9 lines · Roman Zippel

On Tue, 11 Jul 2006, Andrew Morton wrote:
[...]

Quoted 1 line

What, actually, is the problem?

It changes the behaviour, it will annoy the hell out of people like me who have to deal with different kernels and expect this to just work. :-( Since then has it been acceptable to just go ahead and break stuff? This problem doesn't really look unsolvable, so why is my request to fix the damn thing so unreasonable?

Ok, what about this one?

Quoted 7 lines

I don't have time to test it (it compiles, at least), but it seems the logic is pretty clear: once you have pressed both "Alt" and "SysRq" sysrq mode becomes active until you release *both* keys. In this mode any regular key press triggers handle_sysrq.

This allows for all the combinations mentioned before in this thread and makes the logic simpler, IMHO.

Why don't you use a bitmask?
alt-sysrq down -> val = 0b11
sysrq up -> val &= ~0b01
alt up -> val &= ~0b10

test is_sysrq == !!val

Signature · 4 lines
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.

http://david.woodhou.se/why-not-spf.html
#15 lore raw
Quoted 11 lines · Bodo Eggert

Paulo Marques <[email protected]> wrote:
[...]

Quoted 2 lines

This allows for all the combinations mentioned before in this thread and makes the logic simpler, IMHO.

Why don't you use a bitmask?
alt-sysrq down -> val = 0b11
sysrq up -> val &= ~0b01
alt up -> val &= ~0b10

test is_sysrq == !!val

It can be done, but it doesn't seem to buy you much.

The sysrq_alt variable is used wether we use magic sysrq or not, so we must keep it anyway. This var doesn't do what your high bit does, because in the bit mask this bit only goes on when both are pressed (not just alt).

alt up is actually 2 different keys (left and right). To detect it, we either copy the same "if" that is outside the #ifdef or we try to follow the state of sysrq_alt to detect the change from low to high :P

Anyway, I think the code can be simplified further, though, and it might involve a similar trick. And it definitely needs some more comments in there ;)

I'll play with it some more and try to produce a better patch.

Signature · 1 line
Paulo Marques