fis-gtm/sr_i386/error.si

76 lines
1.7 KiB
Plaintext

#################################################################
# #
# Copyright 2001, 2007 Fidelity Information Services, Inc #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
.sbttl error.si
# PAGE +
#-----------------------------------------------
# Mumps error condition handler macros
#-----------------------------------------------
.ifdef cygwin
# will need another 8 to save sigmasks
chnd_size = 220
.else
chnd_size = 168
.endif
chnd_save_active = 0
chnd_ch_active = 4
chnd_ch = 8
chnd_jmp = 12
.data
.extern ctxt
.extern active_ch
.text
.ifdef cygwin
# on cygwin, sigsetjmp is a macro which calls sigprocmask then setjmp
.extern _setjmp
.else
# setjmp is really __sigsetjmp(env,0)
.extern __sigsetjmp
.endif
.sbttl error.si ESTABLISH
.macro ESTABLISH x, label
addl $chnd_size,ctxt # ctxt++
movl ctxt,%eax
movl active_ch,%edx # ctxt->save_active_ch = active_ch
movl %edx,chnd_save_active(%eax)
movl $0,chnd_ch_active(%eax) # ctxt->ch_active = FALSE
movl %eax,active_ch # active_ch = ctxt
movl $\x,chnd_ch(%eax) # ctxt->ch = x
addl $chnd_jmp,%eax # setjmp(ctxt->jmp)
.ifndef cygwin
pushl $0
.endif
pushl %eax
.ifdef cygwin
call _setjmp
addl $4,%esp
.else
call __sigsetjmp
addl $8,%esp
.endif
incl %eax
jne \label
REVERT
jmp return
\label:
.endm
.sbttl error.si REVERT
.macro REVERT
movl ctxt,%eax # active_ch = ctxt->save_active_c
movl chnd_save_active(%eax),%eax
movl %eax,active_ch
subl $chnd_size,ctxt # ctxt--
.endm