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