1*cf88c389Smatt/* $NetBSD: compat___sigtramp1.S,v 1.3 2011/01/15 07:31:13 matt Exp $ */ 2bfb62ce4Smatt 3bfb62ce4Smatt/*- 4bfb62ce4Smatt * Copyright (c) 2002 The NetBSD Foundation, Inc. 5bfb62ce4Smatt * All rights reserved. 6bfb62ce4Smatt * 7bfb62ce4Smatt * This code is derived from software contributed to The NetBSD Foundation 8bfb62ce4Smatt * by Jason R. Thorpe. 9bfb62ce4Smatt * 10bfb62ce4Smatt * Redistribution and use in source and binary forms, with or without 11bfb62ce4Smatt * modification, are permitted provided that the following conditions 12bfb62ce4Smatt * are met: 13bfb62ce4Smatt * 1. Redistributions of source code must retain the above copyright 14bfb62ce4Smatt * notice, this list of conditions and the following disclaimer. 15bfb62ce4Smatt * 2. Redistributions in binary form must reproduce the above copyright 16bfb62ce4Smatt * notice, this list of conditions and the following disclaimer in the 17bfb62ce4Smatt * documentation and/or other materials provided with the distribution. 18bfb62ce4Smatt * 19bfb62ce4Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20bfb62ce4Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21bfb62ce4Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22bfb62ce4Smatt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23bfb62ce4Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24bfb62ce4Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25bfb62ce4Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26bfb62ce4Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27bfb62ce4Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28bfb62ce4Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29bfb62ce4Smatt * POSSIBILITY OF SUCH DAMAGE. 30bfb62ce4Smatt */ 31bfb62ce4Smatt 32bfb62ce4Smatt#include "SYS.h" 33*cf88c389Smatt#include "assym.h" 34*cf88c389Smatt 35*cf88c389Smatt#if defined(LIBC_SCCS) 36*cf88c389Smatt__RCSID("$NetBSD: compat___sigtramp1.S,v 1.3 2011/01/15 07:31:13 matt Exp $") 37*cf88c389Smatt#endif 38bfb62ce4Smatt 39bfb62ce4Smatt/* 40bfb62ce4Smatt * On entry, stack and registers look like: 41bfb62ce4Smatt * 42bfb62ce4Smatt * r3 signal number 43bfb62ce4Smatt * r4 signal specific code 44bfb62ce4Smatt * r5 pointer to sigcontext structure 45bfb62ce4Smatt * lr address of handler 46bfb62ce4Smatt * 47bfb62ce4Smatt * sp-> sigcontext structure 48bfb62ce4Smatt */ 49bfb62ce4SmattENTRY_NOPROFILE(__sigtramp_sigcontext_1) 50*cf88c389Smatt addi %r1,%r1,-CALLFRAMELEN /* space for callee */ 51bfb62ce4Smatt blrl /* call handler */ 52*cf88c389Smatt addi %r3,%r1,CALLFRAMELEN /* compute address of sigcontext */ 53bfb62ce4Smatt _DOSYSCALL(compat_16___sigreturn14) /* and call sigreturn */ 54bfb62ce4Smatt _DOSYSCALL(exit) /* or exit with errno if failed */ 55*cf88c389SmattEND(__sigtramp_sigcontext_1) 56