xref: /minix3/lib/csu/arch/sh3/crtn.S (revision f14fb602092e015ff630df58e17c2a9cd57d29b3)
1*f14fb602SLionel Sambuc/* $NetBSD: crtn.S,v 1.2 2012/01/28 12:45:43 uwe Exp $ */
2e83f7ba2SBen Gras
3e83f7ba2SBen Gras/*-
4e83f7ba2SBen Gras * Copyright (c) 2001 Ross Harvey
5e83f7ba2SBen Gras * All rights reserved.
6e83f7ba2SBen Gras *
7e83f7ba2SBen Gras * Redistribution and use in source and binary forms, with or without
8e83f7ba2SBen Gras * modification, are permitted provided that the following conditions
9e83f7ba2SBen Gras * are met:
10e83f7ba2SBen Gras * 1. Redistributions of source code must retain the above copyright
11e83f7ba2SBen Gras *    notice, this list of conditions and the following disclaimer.
12e83f7ba2SBen Gras * 2. Redistributions in binary form must reproduce the above copyright
13e83f7ba2SBen Gras *    notice, this list of conditions and the following disclaimer in the
14e83f7ba2SBen Gras *    documentation and/or other materials provided with the distribution.
15e83f7ba2SBen Gras * 3. All advertising materials mentioning features or use of this software
16e83f7ba2SBen Gras *    must display the following acknowledgement:
17e83f7ba2SBen Gras *	This product includes software developed by the NetBSD
18e83f7ba2SBen Gras *	Foundation, Inc. and its contributors.
19e83f7ba2SBen Gras * 4. Neither the name of The NetBSD Foundation nor the names of its
20e83f7ba2SBen Gras *    contributors may be used to endorse or promote products derived
21e83f7ba2SBen Gras *    from this software without specific prior written permission.
22e83f7ba2SBen Gras *
23e83f7ba2SBen Gras * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
24e83f7ba2SBen Gras * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25e83f7ba2SBen Gras * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26e83f7ba2SBen Gras * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
27e83f7ba2SBen Gras * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28e83f7ba2SBen Gras * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29e83f7ba2SBen Gras * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30e83f7ba2SBen Gras * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31e83f7ba2SBen Gras * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32e83f7ba2SBen Gras * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33e83f7ba2SBen Gras * POSSIBILITY OF SUCH DAMAGE.
34e83f7ba2SBen Gras */
35e83f7ba2SBen Gras
36e83f7ba2SBen Gras#include <machine/asm.h>
37e83f7ba2SBen Gras
38*f14fb602SLionel SambucRCSID("$NetBSD: crtn.S,v 1.2 2012/01/28 12:45:43 uwe Exp $")
39*f14fb602SLionel Sambuc
40*f14fb602SLionel Sambuc
41*f14fb602SLionel Sambuc/*
42*f14fb602SLionel Sambuc * Provide function epilogues for the code in .init and .fini sections.
43*f14fb602SLionel Sambuc * Corresponding prologues are in crti.S
44*f14fb602SLionel Sambuc */
45e83f7ba2SBen Gras
46e83f7ba2SBen Gras	.section ".init", "ax", @progbits
47e83f7ba2SBen Gras	mov	r14, sp
48e83f7ba2SBen Gras	lds.l	@sp+, pr
49e83f7ba2SBen Gras	rts
50e83f7ba2SBen Gras	 mov.l	@sp+, r14
51e83f7ba2SBen Gras
52e83f7ba2SBen Gras	.section ".fini", "ax", @progbits
53e83f7ba2SBen Gras	mov	r14, sp
54e83f7ba2SBen Gras	lds.l	@sp+, pr
55e83f7ba2SBen Gras	rts
56e83f7ba2SBen Gras	 mov.l	@sp+, r14
57