Skip to content

Commit

Permalink
[PATCH] Initialize argument registers for 32bit signal handlers.
Browse files Browse the repository at this point in the history
In case the user space was compiled with -mregparm=3
Following i386. Pointed out by Albert Cahalan

Signed-off-by: Andi Kleen <ak@suse.de>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Sep 26, 2006
1 parent dd54a11 commit 536e3ee
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 @@ -478,6 +478,11 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
regs->rsp = (unsigned long) frame;
regs->rip = (unsigned long) ka->sa.sa_handler;

/* Make -mregparm=3 work */
regs->rax = sig;
regs->rdx = 0;
regs->rcx = 0;

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

Expand Down

0 comments on commit 536e3ee

Please sign in to comment.