xref: /netbsd-src/lib/libc/compat/arch/arm/sys/compat___sigtramp1.S (revision 2cf5e9962b510b600cc34eab5e486a837af7be16)
1*2cf5e996Smatt/*	$NetBSD: compat___sigtramp1.S,v 1.3 2013/08/19 22:11:50 matt Exp $	*/
2b638db2cSchristos
3b638db2cSchristos/*-
4b638db2cSchristos * Copyright (c) 2002 The NetBSD Foundation, Inc.
5b638db2cSchristos * All rights reserved.
6b638db2cSchristos *
7b638db2cSchristos * This code is derived from software contributed to The NetBSD Foundation
8b638db2cSchristos * by Jason R. Thorpe.
9b638db2cSchristos *
10b638db2cSchristos * Redistribution and use in source and binary forms, with or without
11b638db2cSchristos * modification, are permitted provided that the following conditions
12b638db2cSchristos * are met:
13b638db2cSchristos * 1. Redistributions of source code must retain the above copyright
14b638db2cSchristos *    notice, this list of conditions and the following disclaimer.
15b638db2cSchristos * 2. Redistributions in binary form must reproduce the above copyright
16b638db2cSchristos *    notice, this list of conditions and the following disclaimer in the
17b638db2cSchristos *    documentation and/or other materials provided with the distribution.
18b638db2cSchristos *
19b638db2cSchristos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20b638db2cSchristos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21b638db2cSchristos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22b638db2cSchristos * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23b638db2cSchristos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24b638db2cSchristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25b638db2cSchristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26b638db2cSchristos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27b638db2cSchristos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28b638db2cSchristos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29b638db2cSchristos * POSSIBILITY OF SUCH DAMAGE.
30b638db2cSchristos */
31b638db2cSchristos
32b638db2cSchristos#include "SYS.h"
33b638db2cSchristos
34b638db2cSchristos/*
35b638db2cSchristos * The ARM signal trampoline is invoked only to return from
36b638db2cSchristos * the signal; the kernel calls the signal handler directly.
37b638db2cSchristos *
38b638db2cSchristos * On entry, the stack looks like:
39b638db2cSchristos *
40b638db2cSchristos *	sp->	sigcontext structure
41b638db2cSchristos */
42*2cf5e996SmattENTRY(__sigtramp_sigcontext_1)
43b638db2cSchristos	mov	r0, sp			/* get pointer to sigcontext */
44b638db2cSchristos	SYSTRAP(compat_16___sigreturn14) /* and call sigreturn */
45b638db2cSchristos
46b638db2cSchristos	/* If that failed, exit with the error code. */
47b638db2cSchristos	SYSTRAP(exit)
48*2cf5e996SmattEND(__sigtramp_sigcontext_1)
49