entered into RCS

This commit is contained in:
Roland McGrath 1993-03-26 21:39:42 +00:00
parent 6e1bdbcff1
commit 5cc7ff46d7
5 changed files with 62 additions and 29 deletions

View File

@ -0,0 +1 @@
sigtramp.c

View File

@ -1 +1,3 @@
include $(+sysdep_dir)/unix/bsd/hp9k3bsd/Makefile
ifeq ($(subdir),signal)
sysdep_routines := $(sysdep_routines) sigtramp
endif

View File

@ -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;
};

View 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;
asm volatile ("movem%.l d0-d1/a0-a1, %0" : : "m" (save[0]));
#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
/* 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];
asm volatile ("movem%.l %0, d0-d1/a0-a1" : : "g" (save[0]) :
"d0", "d1", "a0", "a1");
#if 0
if (savefpu)
;
#endif
__sigreturn (context);
}
#endif

View File

@ -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. */