entered into RCS
authorRoland McGrath <roland@gnu.org>
Fri, 26 Mar 1993 21:39:42 +0000 (21:39 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 26 Mar 1993 21:39:42 +0000 (21:39 +0000)
sysdeps/unix/bsd/sun/m68k/Dist [new file with mode: 0644]
sysdeps/unix/bsd/sun/m68k/Makefile
sysdeps/unix/bsd/sun/m68k/sigcontext.h [new file with mode: 0644]
sysdeps/unix/bsd/sun/m68k/sigtramp.c
sysdeps/unix/bsd/sun/sigreturn.S [new file with mode: 0644]

diff --git a/sysdeps/unix/bsd/sun/m68k/Dist b/sysdeps/unix/bsd/sun/m68k/Dist
new file mode 100644 (file)
index 0000000..cd893ff
--- /dev/null
@@ -0,0 +1 @@
+sigtramp.c
index 2f0cd2e..ac4121d 100644 (file)
@@ -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 (file)
index 0000000..926c44f
--- /dev/null
@@ -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;
+  };
index 7b10a9f..32a2c20 100644 (file)
@@ -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 (file)
index 0000000..9a3b5e6
--- /dev/null
@@ -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 <sysdep.h>
+
+#ifndef SYS_sigreturn
+#define SYS_sigreturn 139
+#endif
+
+SYSCALL__ (sigreturn, 1)
+       /* Does not return.  */