The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/powerpc/powerpc/setjmp.S

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $FreeBSD$  */
    2 /*      from:   NetBSD: setjmp.S,v 1.1 1998/01/27 15:13:12 sakamoto Exp $  */
    3 /*      from:   OpenBSD: setjmp.S,v 1.2 1996/12/28 06:22:18 rahnds Exp  */
    4 /* kernel version of this file, does not have signal goop */
    5 /* int setjmp(jmp_buf env) */
    6 
    7 #include <machine/asm.h>
    8 
    9 #ifdef __powerpc64__
   10 #define LD_REG  ld
   11 #define ST_REG  std
   12 #define REGWIDTH 8
   13 #else
   14 #define LD_REG  lwz
   15 #define ST_REG  stw
   16 #define REGWIDTH 4
   17 #endif
   18 
   19 #define JMP_r1  1*REGWIDTH
   20 #define JMP_r2  2*REGWIDTH
   21 #define JMP_r14 3*REGWIDTH
   22 #define JMP_r15 4*REGWIDTH
   23 #define JMP_r16 5*REGWIDTH
   24 #define JMP_r17 6*REGWIDTH
   25 #define JMP_r18 7*REGWIDTH
   26 #define JMP_r19 8*REGWIDTH
   27 #define JMP_r20 9*REGWIDTH
   28 #define JMP_r21 10*REGWIDTH
   29 #define JMP_r22 11*REGWIDTH
   30 #define JMP_r23 12*REGWIDTH
   31 #define JMP_r24 13*REGWIDTH
   32 #define JMP_r25 14*REGWIDTH
   33 #define JMP_r26 15*REGWIDTH
   34 #define JMP_r27 16*REGWIDTH
   35 #define JMP_r28 17*REGWIDTH
   36 #define JMP_r29 18*REGWIDTH
   37 #define JMP_r30 19*REGWIDTH
   38 #define JMP_r31 20*REGWIDTH
   39 #define JMP_lr  21*REGWIDTH
   40 #define JMP_cr  22*REGWIDTH
   41 #define JMP_ctr 23*REGWIDTH
   42 #define JMP_xer 24*REGWIDTH
   43 
   44 ASENTRY_NOPROF(setjmp)
   45         ST_REG 31, JMP_r31(3)
   46         /* r1, r2, r14-r30 */
   47         ST_REG 1,  JMP_r1 (3)
   48         ST_REG 2,  JMP_r2 (3)
   49         ST_REG 14, JMP_r14(3)
   50         ST_REG 15, JMP_r15(3)
   51         ST_REG 16, JMP_r16(3)
   52         ST_REG 17, JMP_r17(3)
   53         ST_REG 18, JMP_r18(3)
   54         ST_REG 19, JMP_r19(3)
   55         ST_REG 20, JMP_r20(3)
   56         ST_REG 21, JMP_r21(3)
   57         ST_REG 22, JMP_r22(3)
   58         ST_REG 23, JMP_r23(3)
   59         ST_REG 24, JMP_r24(3)
   60         ST_REG 25, JMP_r25(3)
   61         ST_REG 26, JMP_r26(3)
   62         ST_REG 27, JMP_r27(3)
   63         ST_REG 28, JMP_r28(3)
   64         ST_REG 29, JMP_r29(3)
   65         ST_REG 30, JMP_r30(3)
   66         /* cr, lr, ctr, xer */
   67         mfcr 0
   68         ST_REG 0, JMP_cr(3)
   69         mflr 0
   70         ST_REG 0, JMP_lr(3)
   71         mfctr 0
   72         ST_REG 0, JMP_ctr(3)
   73         mfxer 0
   74         ST_REG 0, JMP_xer(3)
   75         /* f14-f31, fpscr */
   76         li 3, 0
   77         blr
   78 ASEND(setjmp)
   79 
   80 
   81 .extern sigsetmask
   82 ASENTRY_NOPROF(longjmp)
   83         LD_REG 31, JMP_r31(3)
   84         /* r1, r2, r14-r30 */
   85         LD_REG 1,  JMP_r1 (3)
   86         LD_REG 2,  JMP_r2 (3)
   87         LD_REG 14, JMP_r14(3)
   88         LD_REG 15, JMP_r15(3)
   89         LD_REG 16, JMP_r16(3)
   90         LD_REG 17, JMP_r17(3)
   91         LD_REG 18, JMP_r18(3)
   92         LD_REG 19, JMP_r19(3)
   93         LD_REG 20, JMP_r20(3)
   94         LD_REG 21, JMP_r21(3)
   95         LD_REG 22, JMP_r22(3)
   96         LD_REG 23, JMP_r23(3)
   97         LD_REG 24, JMP_r24(3)
   98         LD_REG 25, JMP_r25(3)
   99         LD_REG 26, JMP_r26(3)
  100         LD_REG 27, JMP_r27(3)
  101         LD_REG 28, JMP_r28(3)
  102         LD_REG 29, JMP_r29(3)
  103         LD_REG 30, JMP_r30(3)
  104         /* cr, lr, ctr, xer */
  105         LD_REG 0, JMP_cr(3)
  106         mtcr 0
  107         LD_REG 0, JMP_lr(3)
  108         mtlr 0
  109         LD_REG 0, JMP_ctr(3)
  110         mtctr 0
  111         LD_REG 0, JMP_xer(3)
  112         mtxer 0
  113         /* f14-f31, fpscr */
  114         mr 3, 4
  115         blr
  116 ASEND(longjmp)

Cache object: 9caf93bd520a34524925b0efa835f878


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.