xref: /titanic_50/usr/src/lib/libbc/libc/sys/common/sparc/sendsig.s (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22	.ident	"%Z%%M%	%I%	%E% SMI"
23
24/*
25 * Copyright (c) 1993 by Sun Microsystems, Inc.
26 */
27
28#include <sys/asm_linkage.h>
29
30!
31!	__sendsig(sig, code, scp, addr, sigfunc)
32!
33!	Call a signal handler in a way that's compatible with statically
34!	linked 4.x binaries.
35!
36!	We have to save our first four arguments to the stack because
37!	that's what the 4.x kernel did and that's where the signal handler
38!	(__sigtramp, normally) expects to find them.
39!
40ENTRY_NP(__sendsig)
41	save	%sp, -SA(MINFRAME), %sp
42	! save i0-i3 to stack, %sp+64 (WINDOWSIZE)
43	std	%i0, [%sp + WINDOWSIZE]
44	std	%i2, [%sp + WINDOWSIZE + 8]
45	mov	%i0, %o0	! pass parameters in %o regs as well, in case
46	mov	%i1, %o1	!   we're calling directly into C code (as will
47	mov	%i2, %o2	!   happen if the a.out is dynamically linked)
48	jmpl	%i4, %o7	! call the signal handler
49	mov	%i3, %o3
50	ret
51	restore
52