--- /dev/null
+sigtramp.c
-include $(+sysdep_dir)/unix/bsd/hp9k3bsd/Makefile
+ifeq ($(subdir),signal)
+sysdep_routines := $(sysdep_routines) sigtramp
+endif
--- /dev/null
+/* 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;
+ };
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,
(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
--- /dev/null
+/* 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 <sysdep.h>
+
+#ifndef SYS_sigreturn
+#define SYS_sigreturn 139
+#endif
+
+SYSCALL__ (sigreturn, 1)
+ /* Does not return. */