afs: fs getcacheparms miscounts dcaches for large files
[openafs.git] / src / lwp / process.s390x.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/390X (64 bit)
10  * by Soewono Effendi <Soewono.Effendi@sysgo.de>
11  * & Horst Birthelmer <Horst.Birthelmer@sysgo.de>
12  *
13  * based on Linux for S/390 (31 bit)
14  * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
15 */
16
17 #define IGNORE_STDS_H  1
18 #include <afs/param.h>
19
20         .file   "process.s"
21
22               .globl savecontext
23               .type  savecontext,%function
24       /*
25        * savecontext(f, area1, newsp)
26        *      int (*f)();    struct savearea *area1; char *newsp;
27        * f     - r2
28        * area1 - r3
29        * newsp - r4
30        */
31
32        /*
33         * struct savearea {
34         *      char    *topstack;
35         * }
36         */
37
38 P_PRE:                    .long   PRE_Block
39 P_ABORT:                      .long   abort
40
41 savecontext:
42               stmg     %r6,%r15,48(%r15)       /* Save our registers */
43               lgr      %r1,%r15
44               aghi     %r15,-160
45               stg      %r1,0(%r15)
46               brasl    %r5,.L0                 /* Get A(A(PRE_Block)) */
47               .long   PRE_Block
48       .L0:
49               l       %r5,0(%r5)              /* Get A(PRE_Block) */
50               mvi     3(%r5),1                /* Set it */
51               lgr      %r6,%r3                 /* Get base of savearea */
52               stg      %r15,0(%r3)             /* Save stack pointer */
53               ltgr     %r4,%r4                 /* If new sp is 0 */
54               jz      .L1                     /* ... don't change sp */
55               lgr      %r15,%r4                /* Set new stack pointer */
56       .L1:
57               br      %r2                     /* Call the routine */
58               /* Can't get here....*/
59
60               brasl    %r5,.L2
61               .long   abort
62       .L2:
63               l      %r5,0(%r5)
64               balr    %r14,%r5
65
66       .savecontext_end:
67               .size   savecontext,.savecontext_end-savecontext
68
69       /*
70        * returnto(area2)
71        *      struct savearea *area2;
72        *
73        * area2 - r2
74        */
75         .globl  returnto
76         .type   returnto,%function
77 returnto:
78         lg       %r15,0(%r2)             /* New frame, to get correct pointer*/
79         brasl    %r5,.L3                         /* Get A(A(PRE_Block)) */
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               lg       %r15,0(%r15)
86               lmg      %r6,%r15,48(%r15)       /* Restore registers */
87               br      %r14                    /* Return */
88
89               /* Can't happen */
90               la      %r2,1234
91               brasl    %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