Skip to contentSkip to conversation

i386 regparm=3 RT signal handlers on x86_64

PATCH New Albert Cahalan 1 participant 1 message Oct 30, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386 regparm=3 RT signal handlers on x86_64

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.

arch/x86_64/ia32/ia32_signal.c +5 -0
diff -Naurd old/arch/x86_64/ia32/ia32_signal.c new/arch/x86_64/ia32/ia32_signal.c
@@ -579,6 +579,11 @@
 	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));