xref: /netbsd-src/lib/libc/compat/arch/vax/sys/compat___sigtramp2.S (revision 0536d96d78d21a7ca05f9e1d13fd38e486b85952)
1*0536d96dSmatt/*	$NetBSD: compat___sigtramp2.S,v 1.3 2011/01/29 22:58:47 matt Exp $	*/
28b121c70Smatt
38b121c70Smatt/*
48b121c70Smatt * Copyright (c) 2002 Anders Magnusson, (ragge@NetBSD.org).
58b121c70Smatt * All rights reserved.
68b121c70Smatt *
78b121c70Smatt * Redistribution and use in source and binary forms, with or without
88b121c70Smatt * modification, are permitted provided that the following conditions
98b121c70Smatt * are met:
108b121c70Smatt * 1. Redistributions of source code must retain the above copyright
118b121c70Smatt *    notice, this list of conditions and the following disclaimer.
128b121c70Smatt * 2. Redistributions in binary form must reproduce the above copyright
138b121c70Smatt *    notice, this list of conditions and the following disclaimer in the
148b121c70Smatt *    documentation and/or other materials provided with the distribution.
158b121c70Smatt * 3. The name of the author may not be used to endorse or promote products
168b121c70Smatt *    derived from this software without specific prior written permission
178b121c70Smatt *
188b121c70Smatt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
198b121c70Smatt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
208b121c70Smatt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
218b121c70Smatt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
228b121c70Smatt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
238b121c70Smatt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
248b121c70Smatt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
258b121c70Smatt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
268b121c70Smatt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
278b121c70Smatt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
288b121c70Smatt */
298b121c70Smatt
308b121c70Smatt/*
318b121c70Smatt * Signal trampoline; registers when called:
328b121c70Smatt *	sp, pc, psl - obvious
338b121c70Smatt *	ap - points to argument list, see machdep.c:sendsig()
348b121c70Smatt *	fp - address of signal handler
358b121c70Smatt */
368b121c70Smatt
378b121c70Smatt#include "SYS.h"
388b121c70Smatt
39787e823fSmatt#ifdef SYSLIBC_SCCS
40*0536d96dSmattRCSID("$NetBSD: compat___sigtramp2.S,v 1.3 2011/01/29 22:58:47 matt Exp $")
41787e823fSmatt#endif
42787e823fSmatt
438b121c70Smatt	.text
448b121c70Smatt	_ALIGN_TEXT
458b121c70Smatt
468b121c70Smatt	.globl	_C_LABEL(__sigtramp_sigcontext_2)
478b121c70Smatt_C_LABEL(__sigtramp_sigcontext_2):
48787e823fSmatt	nop; nop;
498b121c70Smatt	pushr $(R0|R1|R2|R3|R4|R5)	# save scratch registers
508b121c70Smatt	callg (%ap),(%fp)		# use global arg list
518b121c70Smatt	popr $(R0|R1|R2|R3|R4|R5)	# restore regs
528b121c70Smatt	movab 8(%ap),%ap		# arg is pointer to sigctx
538b121c70Smatt	SYSTRAP(compat_16___sigreturn14) # exit from here
548b121c70Smatt	halt				# illegal insn
55*0536d96dSmattEND(__sigtramp_sigcontext_2)
56