[PATCH] uml: Move signal handlers to arch code

Have most signals go through an arch-provided handler which recovers the
sigcontext and then calls a generic handler.  This replaces the
ARCH_GET_SIGCONTEXT macro, which was somewhat fragile.  On x86_64, recovering
%rdx (which holds the sigcontext pointer) must be the first thing that
happens.  sig_handler duly invokes that first, but there is no guarantee that
I can see that instructions won't be reordered such that %rdx is used before
that.  Having the arch provide the handler seems much more robust.

Some signals in some parts of UML require their own handlers - these places
don't call set_handler any more.  They call sigaction or signal themselves.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jeff Dike
2006-09-25 23:33:04 -07:00
committed by Linus Torvalds
parent 19bdf0409f
commit 4b84c69b5f
12 changed files with 102 additions and 89 deletions

View File

@@ -1,27 +0,0 @@
/*
* Copyright (C) 2004 PathScale, Inc
* Licensed under the GPL
*/
#ifndef __I386_SIGNAL_H_
#define __I386_SIGNAL_H_
#include <signal.h>
#define ARCH_SIGHDLR_PARAM int sig
#define ARCH_GET_SIGCONTEXT(sc, sig) \
do sc = (struct sigcontext *) (&sig + 1); while(0)
#endif
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/