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