xref: /original-bsd/lib/libc/sparc/gen/saveregs.s (revision c3e32dec)
1/*
2 * Copyright (c) 1992, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * This software was developed by the Computer Systems Engineering group
6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7 * contributed to Berkeley.
8 *
9 * %sccs.include.redist.c%
10 *
11 * from: $Header: saveregs.s,v 1.1 91/07/06 17:22:33 torek Exp $
12 */
13
14/*
15 * Save register arguments in caller's `arg dump' area, so that
16 * stdarg functions work.
17 *
18 * This really should be done with a pointer to the arg dump area;
19 * our caller should allocate that area, not our caller's caller.
20 * But then, they did not let me invent the calling sequence....
21 *
22 * We assume the caller has executed a `save' instruction.
23 */
24#include "DEFS.h"
25
26ENTRY(__builtin_saveregs)
27	st	%i0, [%fp + 0x44]	! fr->fr_argd[0]
28	st	%i1, [%fp + 0x48]	! fr->fr_argd[1]
29	st	%i2, [%fp + 0x4c]	! fr->fr_argd[2]
30	st	%i3, [%fp + 0x50]	! fr->fr_argd[3]
31	st	%i4, [%fp + 0x54]	! fr->fr_argd[4]
32	retl
33	st	%i5, [%fp + 0x58]	! fr->fr_argd[5]
34