From: Roland McGrath Date: Fri, 26 Mar 1993 21:39:42 +0000 (+0000) Subject: entered into RCS X-Git-Tag: upstream/2.30~10627^2~4304 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cc7ff46d76c3c5674259cebff1d1d9e2f2d8f45;p=external%2Fglibc.git entered into RCS --- diff --git a/sysdeps/unix/bsd/sun/m68k/Dist b/sysdeps/unix/bsd/sun/m68k/Dist new file mode 100644 index 0000000..cd893ff --- /dev/null +++ b/sysdeps/unix/bsd/sun/m68k/Dist @@ -0,0 +1 @@ +sigtramp.c diff --git a/sysdeps/unix/bsd/sun/m68k/Makefile b/sysdeps/unix/bsd/sun/m68k/Makefile index 2f0cd2e..ac4121d 100644 --- a/sysdeps/unix/bsd/sun/m68k/Makefile +++ b/sysdeps/unix/bsd/sun/m68k/Makefile @@ -1 +1,3 @@ -include $(+sysdep_dir)/unix/bsd/hp9k3bsd/Makefile +ifeq ($(subdir),signal) +sysdep_routines := $(sysdep_routines) sigtramp +endif diff --git a/sysdeps/unix/bsd/sun/m68k/sigcontext.h b/sysdeps/unix/bsd/sun/m68k/sigcontext.h new file mode 100644 index 0000000..926c44f --- /dev/null +++ b/sysdeps/unix/bsd/sun/m68k/sigcontext.h @@ -0,0 +1,26 @@ +/* Structure describing state saved while handling a signal. Sun 3 version. +Copyright (C) 1993 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +struct sigcontext + { + int sc_onstack; + sigset_t sc_mask; + + int sc_sp, sc_pc, sc_ps; + }; diff --git a/sysdeps/unix/bsd/sun/m68k/sigtramp.c b/sysdeps/unix/bsd/sun/m68k/sigtramp.c index 7b10a9f..32a2c20 100644 --- a/sysdeps/unix/bsd/sun/m68k/sigtramp.c +++ b/sysdeps/unix/bsd/sun/m68k/sigtramp.c @@ -73,29 +73,12 @@ static void DEFUN(trampoline, (sig, code, context, addr), int sig AND int code AND struct sigcontext *context AND PTR addr) { - register int a0 asm("%a0"); - register int a1 asm("%a1"); - register int d0 asm("%d0"); - register int d1 asm("%d1"); - - int savea[2], saved[2]; - - double fpsave[16]; - int fsr; - int savefpu; + int save[4]; /* Save the call-clobbered registers. */ - savea[0] = a0; - savea[1] = a1; - saved[0] = d0; - saved[1] = d1; - -#if 0 - /* Save the FPU regs if the FPU enable bit is set in the PSR, - and the signal isn't an FP exception. */ - savefpu = (context->sc_psr & 0x1000) && sig != SIGFPE; - if (savefpu) -#endif + asm volatile ("movem%.l d0-d1/a0-a1, %0" : : "m" (save[0])); + + /* XXX should save/restore FP regs */ /* Call the user's handler. */ (*((void EXFUN((*), (int sig, int code, struct sigcontext *context, @@ -103,15 +86,10 @@ DEFUN(trampoline, (sig, code, context, addr), (sig, code, context, addr); /* Restore the call-clobbered registers. */ - a0 = savea[0]; - a1 = savea[1]; - d0 = saved[0]; - d1 = saved[1]; - -#if 0 - if (savefpu) - ; -#endif + asm volatile ("movem%.l %0, d0-d1/a0-a1" : : "g" (save[0]) : + "d0", "d1", "a0", "a1"); + + __sigreturn (context); } #endif diff --git a/sysdeps/unix/bsd/sun/sigreturn.S b/sysdeps/unix/bsd/sun/sigreturn.S new file mode 100644 index 0000000..9a3b5e6 --- /dev/null +++ b/sysdeps/unix/bsd/sun/sigreturn.S @@ -0,0 +1,26 @@ +/* Copyright (C) 1993 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include + +#ifndef SYS_sigreturn +#define SYS_sigreturn 139 +#endif + +SYSCALL__ (sigreturn, 1) + /* Does not return. */