Skip to content

Commit

Permalink
[PATCH] fix i386 regparm=3 RT signal handlers on x86_64
Browse files Browse the repository at this point in the history
The recent change to make x86_64 support i386 binaries compiled
with -mregparm=3 only covered signal handlers without SA_SIGINFO.
(the 3-arg "real-time" ones) This is useful for klibc at least.

Signed-off-by: Albert Cahalan <acahalan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Albert Cahalan authored and Linus Torvalds committed Oct 30, 2006
1 parent 202dd45 commit a7aacdf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86_64/ia32/ia32_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,11 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
regs->rsp = (unsigned long) frame;
regs->rip = (unsigned long) ka->sa.sa_handler;

/* Make -mregparm=3 work */
regs->rax = sig;
regs->rdx = (unsigned long) &frame->info;
regs->rcx = (unsigned long) &frame->uc;

asm volatile("movl %0,%%ds" :: "r" (__USER32_DS));
asm volatile("movl %0,%%es" :: "r" (__USER32_DS));

Expand Down

0 comments on commit a7aacdf

Please sign in to comment.