xref: /minix3/lib/libc/compat/arch/vax/sys/compat___sigtramp2.S (revision e415d488727a332a2c69df018aa35e2cecf4148a)
1*e415d488SLionel Sambuc/*	$NetBSD: compat___sigtramp2.S,v 1.3 2011/01/29 22:58:47 matt Exp $	*/
22fe8fb19SBen Gras
32fe8fb19SBen Gras/*
42fe8fb19SBen Gras * Copyright (c) 2002 Anders Magnusson, (ragge@NetBSD.org).
52fe8fb19SBen Gras * All rights reserved.
62fe8fb19SBen Gras *
72fe8fb19SBen Gras * Redistribution and use in source and binary forms, with or without
82fe8fb19SBen Gras * modification, are permitted provided that the following conditions
92fe8fb19SBen Gras * are met:
102fe8fb19SBen Gras * 1. Redistributions of source code must retain the above copyright
112fe8fb19SBen Gras *    notice, this list of conditions and the following disclaimer.
122fe8fb19SBen Gras * 2. Redistributions in binary form must reproduce the above copyright
132fe8fb19SBen Gras *    notice, this list of conditions and the following disclaimer in the
142fe8fb19SBen Gras *    documentation and/or other materials provided with the distribution.
152fe8fb19SBen Gras * 3. The name of the author may not be used to endorse or promote products
162fe8fb19SBen Gras *    derived from this software without specific prior written permission
172fe8fb19SBen Gras *
182fe8fb19SBen Gras * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
192fe8fb19SBen Gras * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
202fe8fb19SBen Gras * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
212fe8fb19SBen Gras * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
222fe8fb19SBen Gras * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
232fe8fb19SBen Gras * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242fe8fb19SBen Gras * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252fe8fb19SBen Gras * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262fe8fb19SBen Gras * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
272fe8fb19SBen Gras * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282fe8fb19SBen Gras */
292fe8fb19SBen Gras
302fe8fb19SBen Gras/*
312fe8fb19SBen Gras * Signal trampoline; registers when called:
322fe8fb19SBen Gras *	sp, pc, psl - obvious
332fe8fb19SBen Gras *	ap - points to argument list, see machdep.c:sendsig()
342fe8fb19SBen Gras *	fp - address of signal handler
352fe8fb19SBen Gras */
362fe8fb19SBen Gras
372fe8fb19SBen Gras#include "SYS.h"
382fe8fb19SBen Gras
39*e415d488SLionel Sambuc#ifdef SYSLIBC_SCCS
40*e415d488SLionel SambucRCSID("$NetBSD: compat___sigtramp2.S,v 1.3 2011/01/29 22:58:47 matt Exp $")
41*e415d488SLionel Sambuc#endif
42*e415d488SLionel Sambuc
432fe8fb19SBen Gras	.text
442fe8fb19SBen Gras	_ALIGN_TEXT
452fe8fb19SBen Gras
462fe8fb19SBen Gras	.globl	_C_LABEL(__sigtramp_sigcontext_2)
472fe8fb19SBen Gras_C_LABEL(__sigtramp_sigcontext_2):
48*e415d488SLionel Sambuc	nop; nop;
492fe8fb19SBen Gras	pushr $(R0|R1|R2|R3|R4|R5)	# save scratch registers
502fe8fb19SBen Gras	callg (%ap),(%fp)		# use global arg list
512fe8fb19SBen Gras	popr $(R0|R1|R2|R3|R4|R5)	# restore regs
522fe8fb19SBen Gras	movab 8(%ap),%ap		# arg is pointer to sigctx
532fe8fb19SBen Gras	SYSTRAP(compat_16___sigreturn14) # exit from here
542fe8fb19SBen Gras	halt				# illegal insn
55*e415d488SLionel SambucEND(__sigtramp_sigcontext_2)
56