xref: /freebsd/sys/powerpc/powerpc/sigcode32.S (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
1c3e289e1SNathan Whitehorn/* $NetBSD: sigcode.S,v 1.1 1999/11/17 14:56:11 kleink Exp $	*/
2c3e289e1SNathan Whitehorn
3c3e289e1SNathan Whitehorn/*-
4c3e289e1SNathan Whitehorn * Copyright (C) 1995, 1996 Wolfgang Solfrank.
5c3e289e1SNathan Whitehorn * Copyright (C) 1995, 1996 TooLs GmbH.
6c3e289e1SNathan Whitehorn * All rights reserved.
7c3e289e1SNathan Whitehorn *
8c3e289e1SNathan Whitehorn * Redistribution and use in source and binary forms, with or without
9c3e289e1SNathan Whitehorn * modification, are permitted provided that the following conditions
10c3e289e1SNathan Whitehorn * are met:
11c3e289e1SNathan Whitehorn * 1. Redistributions of source code must retain the above copyright
12c3e289e1SNathan Whitehorn *    notice, this list of conditions and the following disclaimer.
13c3e289e1SNathan Whitehorn * 2. Redistributions in binary form must reproduce the above copyright
14c3e289e1SNathan Whitehorn *    notice, this list of conditions and the following disclaimer in the
15c3e289e1SNathan Whitehorn *    documentation and/or other materials provided with the distribution.
16c3e289e1SNathan Whitehorn * 3. All advertising materials mentioning features or use of this software
17c3e289e1SNathan Whitehorn *    must display the following acknowledgement:
18c3e289e1SNathan Whitehorn *	This product includes software developed by TooLs GmbH.
19c3e289e1SNathan Whitehorn * 4. The name of TooLs GmbH may not be used to endorse or promote products
20c3e289e1SNathan Whitehorn *    derived from this software without specific prior written permission.
21c3e289e1SNathan Whitehorn *
22c3e289e1SNathan Whitehorn * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
23c3e289e1SNathan Whitehorn * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24c3e289e1SNathan Whitehorn * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25c3e289e1SNathan Whitehorn * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26c3e289e1SNathan Whitehorn * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27c3e289e1SNathan Whitehorn * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28c3e289e1SNathan Whitehorn * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29c3e289e1SNathan Whitehorn * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30c3e289e1SNathan Whitehorn * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31c3e289e1SNathan Whitehorn * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32c3e289e1SNathan Whitehorn */
33c3e289e1SNathan Whitehorn
34c3e289e1SNathan Whitehorn#include <machine/asm.h>
35c3e289e1SNathan Whitehorn#include <sys/syscall.h>
36*fc2a8776SEd Maste#include "assym.inc"
37c3e289e1SNathan Whitehorn
38c3e289e1SNathan Whitehorn/*
39c3e289e1SNathan Whitehorn * The following code gets copied to the top of the user stack on process
40c3e289e1SNathan Whitehorn * execution.  It does signal trampolining on signal delivery.
41c3e289e1SNathan Whitehorn *
42c3e289e1SNathan Whitehorn * On entry r1 points to a struct sigframe at bottom of current stack.
43c3e289e1SNathan Whitehorn * All other registers are unchanged.
44c3e289e1SNathan Whitehorn */
45c3e289e1SNathan Whitehorn	.globl	CNAME(sigcode32),CNAME(szsigcode32)
46c3e289e1SNathan WhitehornCNAME(sigcode32):
47a4d64816SJustin Hibbits	addi	1,1,-32			/* reserved space for callee */
48c3e289e1SNathan Whitehorn	blrl
49a4d64816SJustin Hibbits	addi	3,1,32+SF_UC		/* restore sp, and get &frame->sf_uc */
50c3e289e1SNathan Whitehorn	li	0,SYS_sigreturn
51c3e289e1SNathan Whitehorn	sc				/* sigreturn(scp) */
52c3e289e1SNathan Whitehorn	li	0,SYS_exit
53c3e289e1SNathan Whitehorn	sc				/* exit(errno) */
54c3e289e1SNathan Whitehornendsigcode32:
55c3e289e1SNathan Whitehorn
56c3e289e1SNathan Whitehorn	.data
57c3e289e1SNathan WhitehornCNAME(szsigcode32):
58c3e289e1SNathan Whitehorn	.long	endsigcode32 - CNAME(sigcode32)
59