"Fossies" - the Fresh Open Source Software Archive

Member "threads/src/sco/sigsetjmp.S" (8 Nov 2000, 5226 Bytes) of package /linux/misc/old/pthreads-3.14.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PowerPC Assembler source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 /* Copyright (C) 1992-2000 1993, 1994, 1995, 1996, 1997, 1998 the Florida State University
    2    Distributed by the Florida State University under the terms of the
    3    GNU Library General Public License.
    4 
    5 This file is part of Pthreads.
    6 
    7 Pthreads is free software; you can redistribute it and/or
    8 modify it under the terms of the GNU Library General Public
    9 License as published by the Free Software Foundation (version 2).
   10 
   11 Pthreads is distributed "AS IS" in the hope that it will be
   12 useful, but WITHOUT ANY WARRANTY; without even the implied
   13 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   14 See the GNU Library General Public License for more details.
   15 
   16 You should have received a copy of the GNU Library General Public
   17 License along with Pthreads; see the file COPYING.  If not, write
   18 to the Free Software Foundation, 675 Mass Ave, Cambridge,
   19 MA 02139, USA.
   20 
   21 Report problems and direct all questions to:
   22 
   23   pthreads-bugs@ada.cs.fsu.edu
   24 
   25   @(#)sigsetjmp.S   3.14 11/8/00
   26 
   27 */
   28 
   29 /*
   30  * pthread_sigsetjmp, pthread_siglongjmp
   31  *
   32  *  pthread_siglongjmp(a,v,restore_float)
   33  * will generate a "return(v)" from the last call to
   34  *  pthread_sigsetjmp(a,m,save_float)
   35  * by restoring registers from the environment 'a'.
   36  * The previous signal state is NOT restored.
   37  * The state of the floating point unit is saved.
   38  */
   39 
   40 
   41     .global setjmp
   42 setjmp:
   43         movl    4(%esp),%eax
   44         movl    %ebx,0(%eax)
   45         movl    %esi,4(%eax)
   46         movl    %edi,8(%eax)
   47         movl    %ebp,12(%eax)
   48         popl    %edx
   49         movl    %esp,16(%eax)
   50         movl    %edx,20(%eax)
   51         subl    %eax,%eax
   52         jmp     *%edx
   53         END0(setjmp)
   54 
   55     .global sigsetjmp
   56 sigsetjmp:
   57     movl    4(%esp),%eax
   58         movl    $0,24(%eax)
   59         cmpl    $0,8(%esp)
   60         je      1f
   61 #ifdef _SCO_ELF
   62     pushl   %ebx
   63 #endif
   64         movl    $1,24(%eax)
   65         addl    $28,%eax
   66         pushl   %eax
   67         pushl   $0
   68         pushl   $0
   69 #ifdef _SCO_ELF
   70     call    .L1
   71 .L1:
   72     popl    %ebx
   73     addl    $_GLOBAL_OFFSET_TABLE_+[.-.L1],%ebx
   74         call    sigprocmask@PLT
   75 #else
   76     call    sigprocmask
   77 #endif
   78         addl    $12,%esp
   79 #ifdef _SCO_ELF
   80     popl    %ebx
   81 #endif
   82 1:      movl    4(%esp),%eax
   83         movl    %ebx,0(%eax)
   84         movl    %esi,4(%eax)
   85         movl    %edi,8(%eax)
   86         movl    %ebp,12(%eax)
   87         popl    %edx
   88         movl    %esp,16(%eax)
   89         movl    %edx,20(%eax)
   90         subl    %eax,%eax
   91         jmp     *%edx
   92         END0(sigsetjmp)
   93 
   94     .global pthread_sigsetjmp
   95 pthread_sigsetjmp:
   96     movl    4(%esp),%eax
   97         movl    $0,24(%eax)
   98         cmpl    $0,8(%esp)
   99         je      1f
  100 #ifdef _SCO_ELF
  101     pushl   %ebx
  102 #endif
  103         movl    $1,24(%eax)
  104         addl    $28,%eax
  105         pushl   %eax
  106         pushl   $0
  107         pushl   $0
  108 #ifdef _SCO_ELF
  109     call    .L2
  110 .L2:
  111     popl    %ebx
  112     addl    $_GLOBAL_OFFSET_TABLE_+[.-.L2],%ebx
  113         call    sigprocmask@PLT
  114 #else
  115         call    sigprocmask
  116 #endif
  117         addl    $12,%esp
  118 #ifdef _SCO_ELF
  119     popl    %ebx
  120 #endif
  121 1:      movl    4(%esp),%eax
  122         movl    %ebx,0(%eax)
  123         movl    %esi,4(%eax)
  124         movl    %edi,8(%eax)
  125         movl    %ebp,12(%eax)
  126     cmpl    $0,12(%esp)
  127     je  2f
  128     fnsave  32(%eax)
  129 2:
  130         popl    %edx
  131         movl    %esp,16(%eax)
  132         movl    %edx,20(%eax)
  133         subl    %eax,%eax
  134         jmp     *%edx
  135         END0(pthread_sigsetjmp)
  136 
  137     .global longjmp
  138 longjmp:
  139         movl    4(%esp),%edx
  140         movl    8(%esp),%eax
  141         movl    0(%edx),%ebx
  142         movl    4(%edx),%esi
  143         movl    8(%edx),%edi
  144         movl    12(%edx),%ebp
  145         movl    16(%edx),%esp
  146     testl   %eax,%eax
  147     jnz 1f
  148     incl    %eax
  149 1:  jmp     *20(%edx)
  150     END0(longjmp)
  151 
  152     .global siglongjmp
  153 siglongjmp:
  154     pushl   %ebp
  155     movl    %esp, %ebp
  156     movl    8(%ebp), %edx
  157     cmpl    $0, 24(%edx)
  158     jz  1f
  159 #ifdef _SCO_ELF
  160     pushl   %ebx
  161 #endif
  162         pushl   $0
  163         addl    $28,%edx
  164         pushl   %edx
  165         pushl   $0
  166 #ifdef _SCO_ELF
  167     call    .L3
  168 .L3:
  169     popl    %ebx
  170     addl    $_GLOBAL_OFFSET_TABLE_+[.-.L3],%ebx
  171     call    sigprocmask@PLT
  172 #else
  173     call    sigprocmask
  174 #endif
  175         addl    $12,%esp
  176 #ifdef _SCO_ELF
  177     popl    %ebx
  178 #endif
  179 1:
  180 #ifdef _SCO_ELF
  181     pushl   %ebx
  182 #endif
  183     pushl   12(%ebp)
  184     pushl   8(%ebp)
  185 #ifdef _SCO_ELF
  186     call    .L31
  187 .L31:
  188     popl    %ebx
  189     addl    $_GLOBAL_OFFSET_TABLE_+[.-.L31],%ebx
  190     call    longjmp@PLT
  191 #else
  192     call    longjmp
  193 #endif
  194         addl    $8,%esp
  195 #ifdef _SCO_ELF
  196     popl    %ebx
  197 #endif
  198         movl    %ebp, %esp
  199         popl    %ebp
  200         ret
  201         END0(siglongjmp)
  202 
  203     .global pthread_siglongjmp
  204 pthread_siglongjmp:
  205     pushl   %ebp
  206     movl    %esp, %ebp
  207     movl    8(%ebp), %edx
  208     cmpl    $0, 24(%edx)
  209     jz  1f
  210 #ifdef _SCO_ELF
  211     pushl   %ebx
  212 #endif
  213         pushl   $0
  214         addl    $28,%edx
  215         pushl   %edx
  216         pushl   $0
  217 #ifdef _SCO_ELF
  218     call    .L4
  219 .L4:
  220     popl    %ebx
  221     addl    $_GLOBAL_OFFSET_TABLE_+[.-.L4],%ebx
  222     call    sigprocmask@PLT
  223 #else
  224     call    sigprocmask
  225 #endif
  226         addl    $12,%esp
  227 #ifdef _SCO_ELF
  228     popl    %ebx
  229 #endif
  230 1:
  231     cmpl    $0, 16(%ebp)
  232     jz  2f
  233     movl    8(%ebp), %edx
  234     frstor  32(%edx)
  235 2:
  236 #ifdef _SCO_ELF
  237     pushl   %ebx
  238 #endif
  239     pushl   12(%ebp)
  240     pushl   8(%ebp)
  241 #ifdef _SCO_ELF
  242     call    .L5
  243 .L5:
  244     popl    %ebx
  245     addl    $_GLOBAL_OFFSET_TABLE_+[.-.L5],%ebx
  246     call    longjmp@PLT
  247 #else
  248     call    longjmp
  249 #endif
  250         addl    $8,%esp
  251 #ifdef _SCO_ELF
  252     popl    %ebx
  253 #endif
  254         movl    %ebp, %esp
  255         popl    %ebp
  256         ret
  257         END0(pthread_siglongjmp)