2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
9 * Linux for S/390 (31 bit)
11 * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
13 * additional munging by Adam Thornton <adam@sinenomine.net>
16 #define IGNORE_STDS_H 1
17 #include <afs/param.h>
22 .type savecontext,%function
24 * savecontext(f, area1, newsp)
25 * int (*f)(); struct savearea *area1; char *newsp;
37 P_PRE: .long PRE_Block
41 stm %r6,%r15,24(%r15) /* Save our registers */
43 ahi %r15,-96 /* Move out of harm's way */
45 bras %r5,.L0 /* Get A(A(PRE_Block)) */
48 l %r5,0(%r5) /* Get A(PRE_Block) */
49 mvi 3(%r5),1 /* Set it */
50 lr %r6,%r3 /* Get base of savearea */
51 st %r15,0(%r3) /* Save stack pointer */
52 ltr %r4,%r4 /* If new sp is 0 */
53 jz .L1 /* ... don't change sp */
54 lr %r15,%r4 /* Set new stack pointer */
56 br %r2 /* Call the routine */
57 /* Can't get here....*/
66 .size savecontext,.savecontext_end-savecontext
70 * struct savearea *area2;
75 .type returnto,%function
77 l %r15,0(%r2) /* New frame, to get correct pointer*/
78 bras %r5,.L3 /* Get A(A(PRE_Block))
82 l %r5,0(%r5) /* Get A(PRE_Block) */
83 /*xc 0(4,%r5),0(%r5) /* Clear it */
84 mvi 3(%r5),0 /* Clear it */
86 lm %r6,%r15,24(%r15) /* Restore registers */
97 .size returnto,.returnto_end-returnto
99 #if defined(__linux__) && defined(__ELF__)
100 .section .note.GNU-stack,"",%progbits