# 2.11BSD#431 - /usr/src/lib/libc/pdp/gen/setjmp.s

##### Functions

    _longjmp          X
    _setjmp           X

       1: /*
       2:  * Copyright (c) 1987 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #if     defined(LIBC_SCCS) && !defined(lint)
       8:         <@(#)setjmp.s	1.5 (2.11BSD GTE) 1997/9/7\0>
       9:         .even
      10: #endif
      11:
      12: /*
      13:  * val = setjmp(env)
      14:  *	int	val;
      15:  *	jmp_buf	*env;
      16:  *
      17:  * longjmp(env, val)
      18:  *	jmp_buf	*env;
      19:  *	int	val;
      20:  *
      21:  * Overlaid version of setjmp and longjmp.  MUST BE LOADED IN BASE SEGMENT!!!
      22:  *
      23:  * Longjmp(env,val) will generate a "return(val)" from the last call to
      24:  * setjmp(env) by restoring the general registers r2, r3, and r4 from the
      25:  * stack and performing a sigreturn on the sigcontext constructed in env by
      26:  * setjmp, see <signal.h>.
      27:  */
      28: #include "DEFS.h"
      29:
      30: SIG_SETMASK = 3                         / XXX - from signal.h
      31:
      32: .globl  _sigaltstack, _sigprocmask      / needed to create sigcontext
      33: .globl  __ovno
      34:
      35: ENTRY(setjmp)
      36:         mov     r2,-(sp)        / save r2
      37:         mov     4(sp),r2        / r2 = env
      38:         sub     $6.,sp          / allocate sizeof(struct sigaltstack)
      39:         mov     sp,r0           /   and get current sigaltstack via
      40:         mov     r0,-(sp)        /   sigaltstack(0, sp) (cant use "mov sp,-(sp)")
      41:         clr     -(sp)
      42:         jsr     pc,_sigaltstack
      43:         add     $8.,sp          / toss 0, &oss, ss_sp, ss_size,
      44:         mov     (sp)+,(r2)+     /   save ss_flags of caller
      45:
      46:         sub     $4,sp           / sizeof (sigset_t) - oset
      47:         mov     sp,r0           / can't use mov sp,-(sp)
      48:         mov     r0,-(sp)        / 'oset'
      49:         clr     -(sp)           / 'set'
      50:         mov     $SIG_SETMASK,-(sp)      / 'how'
      51:         jsr     pc,_sigprocmask / sigprocmask(SIG_SETMASK, NULL, &oset)
      52:         add     $6,sp           / toss how, set, &oset
      53:         mov     (sp)+,(r2)+     / oset(hi) to env
      54:         mov     (sp)+,(r2)+     / oset(lo) to env
      55:
      56:         mov     sp,(r2)         / calculate caller's pre jsr pc,setjmp
      57:         add     $4,(r2)+        /   sp as (sp + saved r2 + ret addr)
      58:         mov     r5,(r2)+        / save caller's frame pointer
      59:         cmp     (r2)+,(r2)+     /   fake r0 & r1
      60:         mov     2(sp),(r2)+     /   return pc,
      61:         mov     $0170000,(r2)+  /   fake (but appropriate) ps, and
      62:         mov     __ovno,(r2)     /   current overlay
      63:         mov     (sp)+,r2        / restore r2
      64:         clr     r0              / and return a zero
      65:         rts     pc
      66:
      67: SC_FP   = 8.                    / offset of sc_fp in sigcontext
      68: SC_R0   = 12.                   / offset of sc_r0 in sigcontext
      69:
      70: .globl  rollback, _sigreturn, _longjmperror
      71: ENTRY(longjmp)
      72:         mov     2(sp),r1        / r1 = env
      73:         mov     SC_FP(r1),r0    / r0 = env->sc_fp
      74:         jsr     pc,rollback     / attempt stack frame rollback
      75:         mov     4(sp),r0        / r0 = val
      76:         bne     1f              / if (val == 0)
      77:         inc     r0              /   r0 = 1
      78: 1:
      79:         mov     r0,SC_R0(r1)    / env->sc_r0 = r0 (`return' val)
      80:         mov     2(sp),-(sp)     / push env
      81:         jsr     pc,_sigreturn   / perform sigreturn(env)
      82:         jsr     pc,_longjmperror / if sigreturn returns, it's an error
      83:         iot                     / and die if longjmperror returns

#### Defined functions

SC_FP defined in line 67; used 1 times

- in line 73

SC_R0 defined in line 68; used 1 times

- in line 79

SIG_SETMASK defined in line 30; used 1 times

- in line 50

_longjmp defined in line 71; used 174 times

- in /usr/ingres/source/iutil/reset.c line 33
- in /usr/src/bin/adb/main.c line 59, 143
- in /usr/src/bin/csh/sh.h line 123
- in /usr/src/bin/ed.c line 595
- in /usr/src/bin/login/login.c line 507
- in /usr/src/bin/mail.c line 665
- in /usr/src/bin/sh/error.c line 65
- in /usr/src/bin/sh/fault.c line 44
- in /usr/src/bin/sh/service.c line 166
- in /usr/src/bin/tcsh/sh.h line 416
- in /usr/src/bin/tcsh/tc.os.c line 513
- in /usr/src/games/boggle/boggle.c line 120
- in /usr/src/games/phantasia/func0.c line 153, 159, 165
- in /usr/src/games/phantasia/func2.c line 776, 785
- in /usr/src/games/robots/move_robs.c line 84
- in /usr/src/games/sail/pl_main.c line 156
- in /usr/src/games/trek/lose.c line 57
- in /usr/src/games/trek/play.c line 63
- in /usr/src/games/trek/win.c line 61
- in /usr/src/lib/ccom/c10.c line 788
- in /usr/src/lib/cpp/cpp.c line 184
- in /usr/src/lib/mip/trees.c line 574
- in /usr/src/libexec/ctimed/ctimed.c line 204
- in /usr/src/libexec/ftpd/ftpcmd.y line 885, 911, 1059
- in /usr/src/libexec/ftpd/ftpd.c line 1178
- in /usr/src/libexec/getty/main.c line 96, 105
- in /usr/src/libexec/tcpd/diag.c line 68
- in /usr/src/libexec/tcpd/options.c line 200, 211
- in /usr/src/libexec/tcpd/rfc931.c line 65
- in /usr/src/libexec/tftpd/tftpd.c line 297
- in /usr/src/local/less/signal.c line 128, 140
- in /usr/src/local/qterm/qterm.c line 1044
- in /usr/src/local/zmodem/minirb.c line 40
- in /usr/src/local/zmodem/rz.c line 249
- in /usr/src/local/zmodem/sz.c line 350, 1200
- in /usr/src/new/OLD/apl/src/ai.c line 482
- in /usr/src/new/OLD/apl/src/apl.h line 575
- in /usr/src/new/OLD/apl/src/xed.c line 53
- in /usr/src/new/PORT/B/src/bed/comm.c line 176
- in /usr/src/new/PORT/B/src/bed/save.c line 67
- in /usr/src/new/PORT/B/src/bint/b3sig.c line 132
- in /usr/src/new/PORT/B/src/bint/mkconfig.c line 23
- in /usr/src/new/PORT/B/src/bsmall/b2err.c line 155-161(3), 189, 197
- in /usr/src/new/PORT/apl/src/ai.c line 482
- in /usr/src/new/PORT/apl/src/apl.h line 575
- in /usr/src/new/PORT/apl/src/xed.c line 53
- in /usr/src/new/PORT/perl.1.0.0/arg.c line 1882-1885(2)
- in /usr/src/new/PORT/perl.1.0.10/arg.c line 1910-1913(2)
- in /usr/src/new/PORT/perl.1.0.10/util.c line 214
- in /usr/src/new/PORT/perl.1.0.16/arg.c line 1929-1932(2)
- in /usr/src/new/PORT/perl.1.0.16/util.c line 214
- in /usr/src/new/jove/jove.c line 881, 900, 918
- in /usr/src/new/jove/mac.c line 1581-1584(2), 1595
- in /usr/src/new/jove/misc.c line 102
- in /usr/src/new/jove/recover.c line 372
- in /usr/src/new/kermit5.188/cku2tm.c line 204
- in /usr/src/new/nntp/xmit/remote.c line 289
- in /usr/src/sbin/init/init.c line 186, 613, 621
- in /usr/src/sbin/shutdown/shutdown.c line 401
- in /usr/src/ucb/Mail/cmd1.c line 344
- in /usr/src/ucb/Mail/collect.c line 558, 581-586(2)
- in /usr/src/ucb/Mail/def.h line 261
- in /usr/src/ucb/Mail/main.c line 258
- in /usr/src/ucb/Mail/tty.c line 260, 267
- in /usr/src/ucb/PORT/pascal/pdx/main/main.c line 94, 105
- in /usr/src/ucb/ex/ex.h line 249
- in /usr/src/ucb/ex/ex_cmds2.c line 181
- in /usr/src/ucb/ex/ex_v.c line 400, 429
- in /usr/src/ucb/ex/ex_vget.c line 645
- in /usr/src/ucb/ftp/cmds.c line 638-643(2), 1649
- in /usr/src/ucb/ftp/ftp.c line 268, 447, 694, 1327
- in /usr/src/ucb/ftp/main.c line 150
- in /usr/src/ucb/more/more.c line 481, 1592, 1716, 1772
- in /usr/src/ucb/msgs/msgs.c line 645
- in /usr/src/ucb/rdist/docmd.c line 262
- in /usr/src/ucb/rlogin.c line 493, 501
- in /usr/src/ucb/talk/invite.c line 91
- in /usr/src/ucb/telnet.c line 344, 490, 500, 2302
- in /usr/src/ucb/tftp/main.c line 506
- in /usr/src/ucb/tftp/tftp.c line 63-65(2)
- in /usr/src/ucb/tn3270/tn3270.c line 714, 1163, 1170, 1216
- in /usr/src/ucb/window/wwrint.c line 46
- in /usr/src/usr.bin/m4/expr.c line 625
- in /usr/src/usr.bin/roff/common_source/n2.c line 223, 239, 246
- in /usr/src/usr.bin/tip/acu.c line 151
- in /usr/src/usr.bin/tip/aculib/biz22.c line 111
- in /usr/src/usr.bin/tip/aculib/biz31.c line 132
- in /usr/src/usr.bin/tip/aculib/courier.c line 101
- in /usr/src/usr.bin/tip/aculib/df.c line 104
- in /usr/src/usr.bin/tip/aculib/dn11.c line 87
- in /usr/src/usr.bin/tip/aculib/hayes.c line 132
- in /usr/src/usr.bin/tip/aculib/penril.c line 141
- in /usr/src/usr.bin/tip/aculib/v3451.c line 158
- in /usr/src/usr.bin/tip/aculib/v831.c line 96
- in /usr/src/usr.bin/tip/aculib/ventel.c line 141
- in /usr/src/usr.bin/tip/cmds.c line 629
- in /usr/src/usr.bin/tip/hunt.c line 23
- in /usr/src/usr.bin/tip/tip.c line 311
- in /usr/src/usr.bin/tip/tipout.c line 30, 63, 78
- in /usr/src/usr.bin/uucp/cico.c line 735, 884
- in /usr/src/usr.bin/uucp/condevs.c line 461
- in /usr/src/usr.bin/uucp/conn.c line 50, 810
- in /usr/src/usr.bin/uucp/fio.c line 75
- in /usr/src/usr.bin/uucp/gio.c line 16
- in /usr/src/usr.bin/uucp/pk1.c line 296, 313, 352, 423
- in /usr/src/usr.sbin/lpr/lpc.c line 77, 119
- in /usr/src/usr.sbin/named/tools/nslookup/subr.c line 101
- in /usr/src/usr.sbin/sendmail.MX/src/err.c line 82, 114
- in /usr/src/usr.sbin/sendmail.MX/src/usersmtp.c line 224
- in /usr/src/usr.sbin/sendmail.MX/src/util.c line 657
- in /usr/src/usr.sbin/sendmail/src/err.c line 73, 105
- in /usr/src/usr.sbin/sendmail/src/usersmtp.c line 219
- in /usr/src/usr.sbin/sendmail/src/util.c line 657
- in /usr/src/usr.sbin/timed/master.c line 241
- in /usr/src/usr.sbin/timed/slave.c line 99, 442
- in /usr/src/usr.sbin/timed/timedc.c line 81, 121

_setjmp defined in line 35; used 213 times

- in /usr/ingres/source/equel/main.c line 268
- in /usr/ingres/source/unix.h line 139
- in /usr/src/bin/adb/main.c line 122
- in /usr/src/bin/csh/sh.h line 122
- in /usr/src/bin/ed.c line 144
- in /usr/src/bin/login/login.c line 498
- in /usr/src/bin/mail.c line 72, 165, 176
- in /usr/src/bin/sh/expand.c line 84
- in /usr/src/bin/sh/main.c line 62, 137
- in /usr/src/bin/sh/service.c line 243
- in /usr/src/bin/sh/word.c line 132
- in /usr/src/bin/tcsh/sh.h line 415
- in /usr/src/bin/tcsh/tc.os.c line 526
- in /usr/src/games/boggle/boggle.c line 515, 581
- in /usr/src/games/phantasia/fight.c line 26
- in /usr/src/games/phantasia/main.c line 258
- in /usr/src/games/robots/play_level.c line 40
- in /usr/src/games/sail/main.c line 67
- in /usr/src/games/trek/main.c line 194
- in /usr/src/lib/ccom/c11.c line 972
- in /usr/src/lib/cpp/cpp.c line 1019
- in /usr/src/lib/mip/trees.c line 185
- in /usr/src/libexec/ctimed/ctimed.c line 69
- in /usr/src/libexec/ftpd/ftpd.c line 245, 745, 823, 1313
- in /usr/src/libexec/getty/main.c line 204, 253
- in /usr/src/libexec/tcpd/hosts_access.c line 106
- in /usr/src/libexec/tcpd/rfc931.c line 102
- in /usr/src/libexec/tcpd/tcpdchk.c line 225
- in /usr/src/libexec/tftpd/tftpd.c line 322, 386
- in /usr/src/local/less/command.c line 231
- in /usr/src/local/less/main.c line 310
- in /usr/src/local/qterm/qterm.c line 823, 843
- in /usr/src/local/zmodem/minirb.c line 146
- in /usr/src/local/zmodem/rz.c line 690
- in /usr/src/local/zmodem/sz.c line 1216, 1648
- in /usr/src/new/OLD/apl/src/ai.c line 295
- in /usr/src/new/OLD/apl/src/apl.h line 574
- in /usr/src/new/OLD/apl/src/xed.c line 52
- in /usr/src/new/PORT/B/src/bed/comm.c line 222, 264, 307
- in /usr/src/new/PORT/B/src/bed/demo.c line 312
- in /usr/src/new/PORT/B/src/bed/save.c line 147
- in /usr/src/new/PORT/B/src/bsmall/b2cmd.c line 29
- in /usr/src/new/PORT/B/src/bsmall/b2mai.c line 117
- in /usr/src/new/PORT/apl/src/ai.c line 295
- in /usr/src/new/PORT/apl/src/apl.h line 574
- in /usr/src/new/PORT/apl/src/xed.c line 52
- in /usr/src/new/PORT/perl.1.0.0/cmd.c line 100, 370
- in /usr/src/new/PORT/perl.1.0.0/perly.c line 196
- in /usr/src/new/PORT/perl.1.0.10/cmd.c line 103, 373
- in /usr/src/new/PORT/perl.1.0.10/perly.c line 208, 2508
- in /usr/src/new/PORT/perl.1.0.16/cmd.c line 103, 373
- in /usr/src/new/PORT/perl.1.0.16/perly.c line 209, 2509
- in /usr/src/new/jove/ask.c line 179
- in /usr/src/new/jove/extend.c line 1004
- in /usr/src/new/jove/jove.c line 960, 1009, 1174
- in /usr/src/new/jove/jove.h line 604
- in /usr/src/new/jove/recover.c line 414
- in /usr/src/new/kermit5.188/cku2tm.c line 69
- in /usr/src/new/nntp/xmit/remote.c line 310
- in /usr/src/sbin/init/init.c line 129-133(2), 631
- in /usr/src/sbin/shutdown/shutdown.c line 212
- in /usr/src/ucb/Mail/cmd1.c line 295
- in /usr/src/ucb/Mail/collect.c line 98(2), 132
- in /usr/src/ucb/Mail/def.h line 260
- in /usr/src/ucb/Mail/main.c line 229
- in /usr/src/ucb/Mail/tty.c line 93, 189
- in /usr/src/ucb/PORT/pascal/pdx/main/main.c line 52, 67
- in /usr/src/ucb/ex/ex.h line 251-255(2)
- in /usr/src/ucb/ex/ex_v.c line 75, 211
- in /usr/src/ucb/ex/ex_vget.c line 111
- in /usr/src/ucb/ftp/cmds.c line 382, 672, 1065, 1196, 1694
- in /usr/src/ucb/ftp/ftp.c line 480, 536, 728, 788, 1391
- in /usr/src/ucb/ftp/main.c line 130, 136
- in /usr/src/ucb/more/more.c line 224, 237, 270, 452
- in /usr/src/ucb/msgs/msgs.c line 449
- in /usr/src/ucb/rdist/docmd.c line 105
- in /usr/src/ucb/rlogin.c line 520
- in /usr/src/ucb/talk/invite.c line 56
- in /usr/src/ucb/telnet.c line 2120, 2357-2361(2)
- in /usr/src/ucb/tftp/main.c line 141-145(2)
- in /usr/src/ucb/tftp/tftp.c line 106, 204
- in /usr/src/ucb/tn3270/tn3270.c line 200-204(2), 273
- in /usr/src/ucb/window/wwiomux.c line 56
- in /usr/src/usr.bin/m4/expr.c line 144
- in /usr/src/usr.bin/roff/common_source/n1.c line 279
- in /usr/src/usr.bin/tip/acu.c line 54
- in /usr/src/usr.bin/tip/aculib/biz22.c line 123, 146
- in /usr/src/usr.bin/tip/aculib/biz31.c line 145, 169
- in /usr/src/usr.bin/tip/aculib/courier.c line 118, 167
- in /usr/src/usr.bin/tip/aculib/df.c line 44
- in /usr/src/usr.bin/tip/aculib/dn11.c line 37
- in /usr/src/usr.bin/tip/aculib/hayes.c line 149
- in /usr/src/usr.bin/tip/aculib/penril.c line 156
- in /usr/src/usr.bin/tip/aculib/v3451.c line 136
- in /usr/src/usr.bin/tip/aculib/v831.c line 43
- in /usr/src/usr.bin/tip/aculib/ventel.c line 156
- in /usr/src/usr.bin/tip/cmds.c line 115
- in /usr/src/usr.bin/tip/hunt.c line 49
- in /usr/src/usr.bin/tip/tip.c line 291
- in /usr/src/usr.bin/tip/tipout.c line 99
- in /usr/src/usr.bin/uucp/aculib/att2224.c line 17, 42, 63
- in /usr/src/usr.bin/uucp/aculib/bsdtcp.c line 39
- in /usr/src/usr.bin/uucp/aculib/cds224.c line 28
- in /usr/src/usr.bin/uucp/aculib/df12.c line 47
- in /usr/src/usr.bin/uucp/aculib/df2.c line 32, 58
- in /usr/src/usr.bin/uucp/aculib/dk.c line 23
- in /usr/src/usr.bin/uucp/aculib/dn.c line 35, 58
- in /usr/src/usr.bin/uucp/aculib/hys.c line 58, 104
- in /usr/src/usr.bin/uucp/aculib/hys24.c line 46
- in /usr/src/usr.bin/uucp/aculib/hysq.c line 68, 111
- in /usr/src/usr.bin/uucp/aculib/mic.c line 43
- in /usr/src/usr.bin/uucp/aculib/nov.c line 32
- in /usr/src/usr.bin/uucp/aculib/pen.c line 20
- in /usr/src/usr.bin/uucp/aculib/pnet.c line 32
- in /usr/src/usr.bin/uucp/aculib/rvmacs.c line 69
- in /usr/src/usr.bin/uucp/aculib/sy.c line 46
- in /usr/src/usr.bin/uucp/aculib/unet.c line 30
- in /usr/src/usr.bin/uucp/aculib/va212.c line 19
- in /usr/src/usr.bin/uucp/aculib/va811.c line 35
- in /usr/src/usr.bin/uucp/aculib/va820.c line 38
- in /usr/src/usr.bin/uucp/aculib/vad.c line 26
- in /usr/src/usr.bin/uucp/aculib/vent.c line 17
- in /usr/src/usr.bin/uucp/aculib/vmacs.c line 69
- in /usr/src/usr.bin/uucp/cico.c line 254, 448, 525, 600, 639
- in /usr/src/usr.bin/uucp/condevs.c line 193
- in /usr/src/usr.bin/uucp/conn.c line 275, 412, 610
- in /usr/src/usr.bin/uucp/fio.c line 144, 325
- in /usr/src/usr.bin/uucp/gio.c line 23, 33, 48, 72, 96, 149
- in /usr/src/usr.bin/uucp/pk1.c line 372
- in /usr/src/usr.bin/uucp/tio.c line 45, 71, 102, 166
- in /usr/src/usr.sbin/lpr/lpc.c line 64
- in /usr/src/usr.sbin/named/tools/nslookup/main.c line 297
- in /usr/src/usr.sbin/sendmail.MX/src/srvrsmtp.c line 151, 270
- in /usr/src/usr.sbin/sendmail.MX/src/usersmtp.c line 135
- in /usr/src/usr.sbin/sendmail.MX/src/util.c line 620
- in /usr/src/usr.sbin/sendmail/src/srvrsmtp.c line 142, 260
- in /usr/src/usr.sbin/sendmail/src/usersmtp.c line 131
- in /usr/src/usr.sbin/sendmail/src/util.c line 620
- in /usr/src/usr.sbin/timed/timed.c line 347, 395
- in /usr/src/usr.sbin/timed/timedc.c line 68

Last modified: 1997-09-10 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1978 |