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