Date: Thu, 24 Apr 2003 14:33:56 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 29635 for review Message-ID: <200304242133.h3OLXuQG068023@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=29635 Change 29635 by peter@peter_daintree on 2003/04/24 14:33:41 Take a shot at making signals actually work. Damn this regparm thing. Affected files ... .. //depot/projects/hammer/sys/x86_64/include/sigframe.h#5 edit .. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#75 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/sigframe.h#5 (text+ko) ==== @@ -35,18 +35,6 @@ * Signal frames, arguments passed to application signal handlers. */ struct sigframe { - /* - * The first four members may be used by applications. - * - * NOTE: The 4th argument is undocumented, ill commented - * on and seems to be somewhat BSD "standard". Handlers - * installed with sigvec may be using it. - */ - register_t sf_signum; - register_t sf_siginfo; /* code or pointer to sf_si */ - register_t sf_ucontext; /* points to sf_uc */ - register_t sf_addr; /* undocumented 4th arg */ - union { __siginfohandler_t *sf_action; __sighandler_t *sf_handler; ==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#75 (text+ko) ==== @@ -269,22 +269,22 @@ sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; /* Build the argument list for the signal handler. */ - sf.sf_signum = sig; - sf.sf_ucontext = (register_t)&sfp->sf_uc; + regs->tf_rdi = sig; /* arg 1 in %rdi */ + regs->tf_rdx = (register_t)&sfp->sf_uc; /* arg 3 in %rdx */ PROC_LOCK(p); if (SIGISMEMBER(p->p_sigacts->ps_siginfo, sig)) { /* Signal handler installed with SA_SIGINFO. */ - sf.sf_siginfo = (register_t)&sfp->sf_si; + regs->tf_rsi = (register_t)&sfp->sf_si; /* arg 2 in %rsi */ sf.sf_ahu.sf_action = (__siginfohandler_t *)catcher; /* Fill in POSIX parts */ sf.sf_si.si_signo = sig; sf.sf_si.si_code = code; - sf.sf_si.si_addr = (void *)regs->tf_err; + regs->tf_rcx = regs->tf_err; /* arg 4 in %rcx */ } else { /* Old FreeBSD-style arguments. */ - sf.sf_siginfo = code; - sf.sf_addr = regs->tf_err; + regs->tf_rsi = code; /* arg 2 in %rsi */ + regs->tf_rcx = regs->tf_err; /* arg 4 in %rcx */ sf.sf_ahu.sf_handler = catcher; } PROC_UNLOCK(p);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304242133.h3OLXuQG068023>