File: op_extcall.s

package info (click to toggle)
fis-gtm 6.2-000-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,784 kB
  • ctags: 42,554
  • sloc: ansic: 358,483; asm: 4,847; csh: 4,574; sh: 2,261; awk: 200; makefile: 86; sed: 13
file content (83 lines) | stat: -rw-r--r-- 2,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#################################################################
#								#
#	Copyright 2007, 2010 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.	#
#								#
#################################################################

#	PAGE	,132
	.title	op_extcall.s

#	.386
#	.MODEL	FLAT, C

.include "linkage.si"
	.INCLUDE	"g_msf.si"

	.sbttl	op_extcall
#	PAGE	+
	.DATA
.extern	ERR_GTMCHECK
.extern	ERR_LABELUNKNOWN
.extern	frame_pointer

	.text
.extern	auto_zlink
.extern	new_stack_frame
.extern	rts_error

# PUBLIC	op_extcall
ENTRY op_extcall
	putframe
	addq    $8,REG_SP     					# burn the saved return pc
	cmpq	$0,REG64_ARG0					# if rhdaddr == 0, not yet linked into image
	je	l2
	cmpq    $0,REG64_ARG1					# if labaddr == 0 && rhdaddr != 0, label does not exist
        je      l4

l1:	movq	(REG64_ARG1),REG64_ACCUM			# &(code_offset) for this label (usually & of lntabent)
	cmpq	$0,REG64_ACCUM
	je	l4
	movslq	0(REG64_ACCUM),REG64_ACCUM			# code offset for this label
	movq	mrt_ptext_adr(REG64_ARG0),REG64_ARG1
	addq	REG64_ARG1,REG64_ACCUM
	movq	REG64_ACCUM,REG64_ARG2
	movq	mrt_lnk_ptr(REG64_ARG0),REG64_ARG1
	call	new_stack_frame
	getframe
	ret

l2:	cmpq	$0,REG64_ARG1
	jne	l4
	subq    $8,REG_SP					# Pass the SP as 2nd argument to auto_zlink.
        movq    REG_SP,REG64_ARG1				# auto_zlink will populate this with labaddr
        movq    frame_pointer(REG_IP),REG64_ACCUM
        movq    msf_mpc_off(REG64_ACCUM),REG64_ARG0
	call	auto_zlink
	cmpq	$0,REG64_RET0
	je	l3
	movq	REG64_RET0,REG64_ARG0
	popq	REG64_ARG1					# Get the 2nd argument populated by auto_zlink
	cmpq	$0,REG64_ARG1
	jne	l1

l3:	movl	ERR_GTMCHECK(REG_IP),REG32_ARG1
	movl	$1,REG32_ARG0
	movb    $0,REG8_ACCUM             # variable length argument
	call	rts_error
	getframe
	ret

l4:	movl    ERR_LABELUNKNOWN(REG_IP),REG32_ARG1
        movl    $1,REG32_ARG0
	movb    $0,REG8_ACCUM             # variable length argument
	call	rts_error
	getframe
	ret
# op_extcall ENDP

# END