Skip to contentSkip to conversation

Why set ORIG_EAX(%esp) to -1 in arch/i386/kernel/entry.S:error_code?

DISCUSSION Jeremy Fitzhardinge 2 participants 3 messages Aug 29, 2006

lore
Share & tools
lore
#0 lore raw

There doesn't seem much point; nothing seems to use it on the trap-handling paths. Is it a historical left-over?

J

#1 lore raw
Quoted 3 lines · Jeremy Fitzhardinge

There doesn't seem much point; nothing seems to use it on the trap-handling paths. Is it a historical left-over?

No. It's important that ORIG_EAX be set to some value that is _not_ a valid system call number, so that the system call restart logic (see the signal handling code) doesn't trigger.

Linus

#2 lore raw
Quoted 2 lines · Linus Torvalds

No. It's important that ORIG_EAX be set to some value that is _not_ a valid system call number, so that the system call restart logic (see the signal handling code) doesn't trigger.

Ah, yes, I see. I'll add a comment in my i386-pda patch to entry.S.

J