afs: fs getcacheparms miscounts dcaches for large files
[openafs.git] / src / lwp / process.s390.s
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  *
9  * Linux for S/390 (31 bit)
10  *
11  * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
12  *
13  *  additional munging by Adam Thornton <adam@sinenomine.net>
14  */
15
16 #define IGNORE_STDS_H   1
17 #include <afs/param.h>
18
19         .file   "process.s"
20
21               .globl savecontext
22               .type  savecontext,%function
23       /*
24        * savecontext(f, area1, newsp)
25        *      int (*f)();    struct savearea *area1; char *newsp;
26        * f     - r2
27        * area1 - r3
28        * newsp - r4
29        */
30
31        /*
32         * struct savearea {
33         *      char    *topstack;
34         * }
35         */
36
37 P_PRE:                    .long   PRE_Block
38 P_ABORT:                      .long   abort
39
40 savecontext:
41               stm     %r6,%r15,24(%r15)       /* Save our registers */
42               lr      %r1,%r15
43               ahi     %r15,-96                /* Move out of harm's way */
44               st      %r1,0(%r15)
45               bras    %r5,.L0                 /* Get A(A(PRE_Block)) */
46               .long   PRE_Block
47       .L0:
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 */
55       .L1:
56               br      %r2                     /* Call the routine */
57               /* Can't get here....*/
58
59               bras    %r5,.L2
60               .long   abort
61       .L2:
62               l      %r5,0(%r5)
63               balr    %r14,%r5
64
65       .savecontext_end:
66               .size   savecontext,.savecontext_end-savecontext
67
68       /*
69        * returnto(area2)
70        *      struct savearea *area2;
71        *
72        * area2 - r2
73        */
74         .globl  returnto
75         .type   returnto,%function
76 returnto:
77         l       %r15,0(%r2)             /* New frame, to get correct pointer*/
78         bras    %r5,.L3                         /* Get A(A(PRE_Block))
79       */
80                  .long          PRE_Block
81       .L3:
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 */ 
85               l       %r15,0(%r15)
86               lm      %r6,%r15,24(%r15)       /* Restore registers */
87               br      %r14                    /* Return */
88
89               /* Can't happen */
90               la      %r2,1234
91               bras    %r5,.L4
92                 .long          abort
93       .L4:
94               l       %r5,0(%r5)
95               basr    %r14,%r5
96       .returnto_end:
97               .size   returnto,.returnto_end-returnto
98
99 #if defined(__linux__) && defined(__ELF__)
100         .section .note.GNU-stack,"",%progbits
101 #endif