...
Run Format

Text file src/runtime/sys_linux_amd64.s

     1	// Copyright 2009 The Go Authors. All rights reserved.
     2	// Use of this source code is governed by a BSD-style
     3	// license that can be found in the LICENSE file.
     4	
     5	//
     6	// System calls and other sys.stuff for AMD64, Linux
     7	//
     8	
     9	#include "go_asm.h"
    10	#include "go_tls.h"
    11	#include "textflag.h"
    12	
    13	TEXT runtime·exit(SB),NOSPLIT,$0-4
    14		MOVL	code+0(FP), DI
    15		MOVL	$231, AX	// exitgroup - force all os threads to exit
    16		SYSCALL
    17		RET
    18	
    19	TEXT runtime·exit1(SB),NOSPLIT,$0-4
    20		MOVL	code+0(FP), DI
    21		MOVL	$60, AX	// exit - exit the current os thread
    22		SYSCALL
    23		RET
    24	
    25	TEXT runtime·open(SB),NOSPLIT,$0-20
    26		MOVQ	name+0(FP), DI
    27		MOVL	mode+8(FP), SI
    28		MOVL	perm+12(FP), DX
    29		MOVL	$2, AX			// syscall entry
    30		SYSCALL
    31		CMPQ	AX, $0xfffffffffffff001
    32		JLS	2(PC)
    33		MOVL	$-1, AX
    34		MOVL	AX, ret+16(FP)
    35		RET
    36	
    37	TEXT runtime·closefd(SB),NOSPLIT,$0-12
    38		MOVL	fd+0(FP), DI
    39		MOVL	$3, AX			// syscall entry
    40		SYSCALL
    41		CMPQ	AX, $0xfffffffffffff001
    42		JLS	2(PC)
    43		MOVL	$-1, AX
    44		MOVL	AX, ret+8(FP)
    45		RET
    46	
    47	TEXT runtime·write(SB),NOSPLIT,$0-28
    48		MOVQ	fd+0(FP), DI
    49		MOVQ	p+8(FP), SI
    50		MOVL	n+16(FP), DX
    51		MOVL	$1, AX			// syscall entry
    52		SYSCALL
    53		CMPQ	AX, $0xfffffffffffff001
    54		JLS	2(PC)
    55		MOVL	$-1, AX
    56		MOVL	AX, ret+24(FP)
    57		RET
    58	
    59	TEXT runtime·read(SB),NOSPLIT,$0-28
    60		MOVL	fd+0(FP), DI
    61		MOVQ	p+8(FP), SI
    62		MOVL	n+16(FP), DX
    63		MOVL	$0, AX			// syscall entry
    64		SYSCALL
    65		CMPQ	AX, $0xfffffffffffff001
    66		JLS	2(PC)
    67		MOVL	$-1, AX
    68		MOVL	AX, ret+24(FP)
    69		RET
    70	
    71	TEXT runtime·getrlimit(SB),NOSPLIT,$0-20
    72		MOVL	kind+0(FP), DI
    73		MOVQ	limit+8(FP), SI
    74		MOVL	$97, AX			// syscall entry
    75		SYSCALL
    76		MOVL	AX, ret+16(FP)
    77		RET
    78	
    79	TEXT runtime·usleep(SB),NOSPLIT,$16
    80		MOVL	$0, DX
    81		MOVL	usec+0(FP), AX
    82		MOVL	$1000000, CX
    83		DIVL	CX
    84		MOVQ	AX, 0(SP)
    85		MOVQ	DX, 8(SP)
    86	
    87		// select(0, 0, 0, 0, &tv)
    88		MOVL	$0, DI
    89		MOVL	$0, SI
    90		MOVL	$0, DX
    91		MOVL	$0, R10
    92		MOVQ	SP, R8
    93		MOVL	$23, AX
    94		SYSCALL
    95		RET
    96	
    97	TEXT runtime·gettid(SB),NOSPLIT,$0-4
    98		MOVL	$186, AX	// syscall - gettid
    99		SYSCALL
   100		MOVL	AX, ret+0(FP)
   101		RET
   102	
   103	TEXT runtime·raise(SB),NOSPLIT,$0
   104		MOVL	$186, AX	// syscall - gettid
   105		SYSCALL
   106		MOVL	AX, DI	// arg 1 tid
   107		MOVL	sig+0(FP), SI	// arg 2
   108		MOVL	$200, AX	// syscall - tkill
   109		SYSCALL
   110		RET
   111	
   112	TEXT runtime·raiseproc(SB),NOSPLIT,$0
   113		MOVL	$39, AX	// syscall - getpid
   114		SYSCALL
   115		MOVL	AX, DI	// arg 1 pid
   116		MOVL	sig+0(FP), SI	// arg 2
   117		MOVL	$62, AX	// syscall - kill
   118		SYSCALL
   119		RET
   120	
   121	TEXT runtime·setitimer(SB),NOSPLIT,$0-24
   122		MOVL	mode+0(FP), DI
   123		MOVQ	new+8(FP), SI
   124		MOVQ	old+16(FP), DX
   125		MOVL	$38, AX			// syscall entry
   126		SYSCALL
   127		RET
   128	
   129	TEXT runtime·mincore(SB),NOSPLIT,$0-28
   130		MOVQ	addr+0(FP), DI
   131		MOVQ	n+8(FP), SI
   132		MOVQ	dst+16(FP), DX
   133		MOVL	$27, AX			// syscall entry
   134		SYSCALL
   135		MOVL	AX, ret+24(FP)
   136		RET
   137	
   138	// func now() (sec int64, nsec int32)
   139	TEXT time·now(SB),NOSPLIT,$16
   140		// Be careful. We're calling a function with gcc calling convention here.
   141		// We're guaranteed 128 bytes on entry, and we've taken 16, and the
   142		// call uses another 8.
   143		// That leaves 104 for the gettime code to use. Hope that's enough!
   144		MOVQ	runtime·__vdso_clock_gettime_sym(SB), AX
   145		CMPQ	AX, $0
   146		JEQ	fallback
   147		MOVL	$0, DI // CLOCK_REALTIME
   148		LEAQ	0(SP), SI
   149		CALL	AX
   150		MOVQ	0(SP), AX	// sec
   151		MOVQ	8(SP), DX	// nsec
   152		MOVQ	AX, sec+0(FP)
   153		MOVL	DX, nsec+8(FP)
   154		RET
   155	fallback:
   156		LEAQ	0(SP), DI
   157		MOVQ	$0, SI
   158		MOVQ	runtime·__vdso_gettimeofday_sym(SB), AX
   159		CALL	AX
   160		MOVQ	0(SP), AX	// sec
   161		MOVL	8(SP), DX	// usec
   162		IMULQ	$1000, DX
   163		MOVQ	AX, sec+0(FP)
   164		MOVL	DX, nsec+8(FP)
   165		RET
   166	
   167	TEXT runtime·nanotime(SB),NOSPLIT,$16
   168		// Duplicate time.now here to avoid using up precious stack space.
   169		// See comment above in time.now.
   170		MOVQ	runtime·__vdso_clock_gettime_sym(SB), AX
   171		CMPQ	AX, $0
   172		JEQ	fallback
   173		MOVL	$1, DI // CLOCK_MONOTONIC
   174		LEAQ	0(SP), SI
   175		CALL	AX
   176		MOVQ	0(SP), AX	// sec
   177		MOVQ	8(SP), DX	// nsec
   178		// sec is in AX, nsec in DX
   179		// return nsec in AX
   180		IMULQ	$1000000000, AX
   181		ADDQ	DX, AX
   182		MOVQ	AX, ret+0(FP)
   183		RET
   184	fallback:
   185		LEAQ	0(SP), DI
   186		MOVQ	$0, SI
   187		MOVQ	runtime·__vdso_gettimeofday_sym(SB), AX
   188		CALL	AX
   189		MOVQ	0(SP), AX	// sec
   190		MOVL	8(SP), DX	// usec
   191		IMULQ	$1000, DX
   192		// sec is in AX, nsec in DX
   193		// return nsec in AX
   194		IMULQ	$1000000000, AX
   195		ADDQ	DX, AX
   196		MOVQ	AX, ret+0(FP)
   197		RET
   198	
   199	TEXT runtime·rtsigprocmask(SB),NOSPLIT,$0-28
   200		MOVL	how+0(FP), DI
   201		MOVQ	new+8(FP), SI
   202		MOVQ	old+16(FP), DX
   203		MOVL	size+24(FP), R10
   204		MOVL	$14, AX			// syscall entry
   205		SYSCALL
   206		CMPQ	AX, $0xfffffffffffff001
   207		JLS	2(PC)
   208		MOVL	$0xf1, 0xf1  // crash
   209		RET
   210	
   211	TEXT runtime·sysSigaction(SB),NOSPLIT,$0-36
   212		MOVQ	sig+0(FP), DI
   213		MOVQ	new+8(FP), SI
   214		MOVQ	old+16(FP), DX
   215		MOVQ	size+24(FP), R10
   216		MOVL	$13, AX			// syscall entry
   217		SYSCALL
   218		MOVL	AX, ret+32(FP)
   219		RET
   220	
   221	// Call the function stored in _cgo_sigaction using the GCC calling convention.
   222	TEXT runtime·callCgoSigaction(SB),NOSPLIT,$16
   223		MOVQ	sig+0(FP), DI
   224		MOVQ	new+8(FP), SI
   225		MOVQ	old+16(FP), DX
   226		MOVQ	_cgo_sigaction(SB), AX
   227		MOVQ	SP, BX	// callee-saved
   228		ANDQ	$~15, SP	// alignment as per amd64 psABI
   229		CALL	AX
   230		MOVQ	BX, SP
   231		MOVL	AX, ret+24(FP)
   232		RET
   233	
   234	TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
   235		MOVQ	fn+0(FP),    AX
   236		MOVL	sig+8(FP),   DI
   237		MOVQ	info+16(FP), SI
   238		MOVQ	ctx+24(FP),  DX
   239		PUSHQ	BP
   240		MOVQ	SP, BP
   241		ANDQ	$~15, SP     // alignment for x86_64 ABI
   242		CALL	AX
   243		MOVQ	BP, SP
   244		POPQ	BP
   245		RET
   246	
   247	TEXT runtime·sigtramp(SB),NOSPLIT,$72
   248		// Save callee-saved C registers, since the caller may be a C signal handler.
   249		MOVQ	BX,  bx-8(SP)
   250		MOVQ	BP,  bp-16(SP)  // save in case GOEXPERIMENT=noframepointer is set
   251		MOVQ	R12, r12-24(SP)
   252		MOVQ	R13, r13-32(SP)
   253		MOVQ	R14, r14-40(SP)
   254		MOVQ	R15, r15-48(SP)
   255		// We don't save mxcsr or the x87 control word because sigtrampgo doesn't
   256		// modify them.
   257	
   258		MOVQ	DX, ctx-56(SP)
   259		MOVQ	SI, info-64(SP)
   260		MOVQ	DI, signum-72(SP)
   261		MOVQ	$runtime·sigtrampgo(SB), AX
   262		CALL AX
   263	
   264		MOVQ	r15-48(SP), R15
   265		MOVQ	r14-40(SP), R14
   266		MOVQ	r13-32(SP), R13
   267		MOVQ	r12-24(SP), R12
   268		MOVQ	bp-16(SP),  BP
   269		MOVQ	bx-8(SP),   BX
   270		RET
   271	
   272	// Used instead of sigtramp in programs that use cgo.
   273	// Arguments from kernel are in DI, SI, DX.
   274	TEXT runtime·cgoSigtramp(SB),NOSPLIT,$0
   275		// If no traceback function, do usual sigtramp.
   276		MOVQ	runtime·cgoTraceback(SB), AX
   277		TESTQ	AX, AX
   278		JZ	sigtramp
   279	
   280		// If no traceback support function, which means that
   281		// runtime/cgo was not linked in, do usual sigtramp.
   282		MOVQ	_cgo_callers(SB), AX
   283		TESTQ	AX, AX
   284		JZ	sigtramp
   285	
   286		// Figure out if we are currently in a cgo call.
   287		// If not, just do usual sigtramp.
   288		get_tls(CX)
   289		MOVQ	g(CX),AX
   290		TESTQ	AX, AX
   291		JZ	sigtrampnog     // g == nil
   292		MOVQ	g_m(AX), AX
   293		TESTQ	AX, AX
   294		JZ	sigtramp        // g.m == nil
   295		MOVL	m_ncgo(AX), CX
   296		TESTL	CX, CX
   297		JZ	sigtramp        // g.m.ncgo == 0
   298		MOVQ	m_curg(AX), CX
   299		TESTQ	CX, CX
   300		JZ	sigtramp        // g.m.curg == nil
   301		MOVQ	g_syscallsp(CX), CX
   302		TESTQ	CX, CX
   303		JZ	sigtramp        // g.m.curg.syscallsp == 0
   304		MOVQ	m_cgoCallers(AX), R8
   305		TESTQ	R8, R8
   306		JZ	sigtramp        // g.m.cgoCallers == nil
   307		MOVL	m_cgoCallersUse(AX), CX
   308		TESTL	CX, CX
   309		JNZ	sigtramp	// g.m.cgoCallersUse != 0
   310	
   311		// Jump to a function in runtime/cgo.
   312		// That function, written in C, will call the user's traceback
   313		// function with proper unwind info, and will then call back here.
   314		// The first three arguments, and the fifth, are already in registers.
   315		// Set the two remaining arguments now.
   316		MOVQ	runtime·cgoTraceback(SB), CX
   317		MOVQ	$runtime·sigtramp(SB), R9
   318		MOVQ	_cgo_callers(SB), AX
   319		JMP	AX
   320	
   321	sigtramp:
   322		JMP	runtime·sigtramp(SB)
   323	
   324	sigtrampnog:
   325		// Signal arrived on a non-Go thread. If this is SIGPROF, get a
   326		// stack trace.
   327		CMPL	DI, $27 // 27 == SIGPROF
   328		JNZ	sigtramp
   329	
   330		// Lock sigprofCallersUse.
   331		MOVL	$0, AX
   332		MOVL	$1, CX
   333		MOVQ	$runtime·sigprofCallersUse(SB), R11
   334		LOCK
   335		CMPXCHGL	CX, 0(R11)
   336		JNZ	sigtramp  // Skip stack trace if already locked.
   337	
   338		// Jump to the traceback function in runtime/cgo.
   339		// It will call back to sigprofNonGo, which will ignore the
   340		// arguments passed in registers.
   341		// First three arguments to traceback function are in registers already.
   342		MOVQ	runtime·cgoTraceback(SB), CX
   343		MOVQ	$runtime·sigprofCallers(SB), R8
   344		MOVQ	$runtime·sigprofNonGo(SB), R9
   345		MOVQ	_cgo_callers(SB), AX
   346		JMP	AX
   347	
   348	// For cgo unwinding to work, this function must look precisely like
   349	// the one in glibc.  The glibc source code is:
   350	// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86_64/sigaction.c
   351	// The code that cares about the precise instructions used is:
   352	// https://gcc.gnu.org/viewcvs/gcc/trunk/libgcc/config/i386/linux-unwind.h?revision=219188&view=markup
   353	TEXT runtime·sigreturn(SB),NOSPLIT,$0
   354		MOVQ	$15, AX	// rt_sigreturn
   355		SYSCALL
   356		INT $3	// not reached
   357	
   358	TEXT runtime·sysMmap(SB),NOSPLIT,$0
   359		MOVQ	addr+0(FP), DI
   360		MOVQ	n+8(FP), SI
   361		MOVL	prot+16(FP), DX
   362		MOVL	flags+20(FP), R10
   363		MOVL	fd+24(FP), R8
   364		MOVL	off+28(FP), R9
   365	
   366		MOVL	$9, AX			// mmap
   367		SYSCALL
   368		CMPQ	AX, $0xfffffffffffff001
   369		JLS	3(PC)
   370		NOTQ	AX
   371		INCQ	AX
   372		MOVQ	AX, ret+32(FP)
   373		RET
   374	
   375	// Call the function stored in _cgo_mmap using the GCC calling convention.
   376	// This must be called on the system stack.
   377	TEXT runtime·callCgoMmap(SB),NOSPLIT,$16
   378		MOVQ	addr+0(FP), DI
   379		MOVQ	n+8(FP), SI
   380		MOVL	prot+16(FP), DX
   381		MOVL	flags+20(FP), CX
   382		MOVL	fd+24(FP), R8
   383		MOVL	off+28(FP), R9
   384		MOVQ	_cgo_mmap(SB), AX
   385		MOVQ	SP, BX
   386		ANDQ	$~15, SP	// alignment as per amd64 psABI
   387		MOVQ	BX, 0(SP)
   388		CALL	AX
   389		MOVQ	0(SP), SP
   390		MOVQ	AX, ret+32(FP)
   391		RET
   392	
   393	TEXT runtime·munmap(SB),NOSPLIT,$0
   394		MOVQ	addr+0(FP), DI
   395		MOVQ	n+8(FP), SI
   396		MOVQ	$11, AX	// munmap
   397		SYSCALL
   398		CMPQ	AX, $0xfffffffffffff001
   399		JLS	2(PC)
   400		MOVL	$0xf1, 0xf1  // crash
   401		RET
   402	
   403	TEXT runtime·madvise(SB),NOSPLIT,$0
   404		MOVQ	addr+0(FP), DI
   405		MOVQ	n+8(FP), SI
   406		MOVL	flags+16(FP), DX
   407		MOVQ	$28, AX	// madvise
   408		SYSCALL
   409		// ignore failure - maybe pages are locked
   410		RET
   411	
   412	// int64 futex(int32 *uaddr, int32 op, int32 val,
   413	//	struct timespec *timeout, int32 *uaddr2, int32 val2);
   414	TEXT runtime·futex(SB),NOSPLIT,$0
   415		MOVQ	addr+0(FP), DI
   416		MOVL	op+8(FP), SI
   417		MOVL	val+12(FP), DX
   418		MOVQ	ts+16(FP), R10
   419		MOVQ	addr2+24(FP), R8
   420		MOVL	val3+32(FP), R9
   421		MOVL	$202, AX
   422		SYSCALL
   423		MOVL	AX, ret+40(FP)
   424		RET
   425	
   426	// int32 clone(int32 flags, void *stk, M *mp, G *gp, void (*fn)(void));
   427	TEXT runtime·clone(SB),NOSPLIT,$0
   428		MOVL	flags+0(FP), DI
   429		MOVQ	stk+8(FP), SI
   430		MOVQ	$0, DX
   431		MOVQ	$0, R10
   432	
   433		// Copy mp, gp, fn off parent stack for use by child.
   434		// Careful: Linux system call clobbers CX and R11.
   435		MOVQ	mp+16(FP), R8
   436		MOVQ	gp+24(FP), R9
   437		MOVQ	fn+32(FP), R12
   438	
   439		MOVL	$56, AX
   440		SYSCALL
   441	
   442		// In parent, return.
   443		CMPQ	AX, $0
   444		JEQ	3(PC)
   445		MOVL	AX, ret+40(FP)
   446		RET
   447	
   448		// In child, on new stack.
   449		MOVQ	SI, SP
   450	
   451		// If g or m are nil, skip Go-related setup.
   452		CMPQ	R8, $0    // m
   453		JEQ	nog
   454		CMPQ	R9, $0    // g
   455		JEQ	nog
   456	
   457		// Initialize m->procid to Linux tid
   458		MOVL	$186, AX	// gettid
   459		SYSCALL
   460		MOVQ	AX, m_procid(R8)
   461	
   462		// Set FS to point at m->tls.
   463		LEAQ	m_tls(R8), DI
   464		CALL	runtime·settls(SB)
   465	
   466		// In child, set up new stack
   467		get_tls(CX)
   468		MOVQ	R8, g_m(R9)
   469		MOVQ	R9, g(CX)
   470		CALL	runtime·stackcheck(SB)
   471	
   472	nog:
   473		// Call fn
   474		CALL	R12
   475	
   476		// It shouldn't return. If it does, exit that thread.
   477		MOVL	$111, DI
   478		MOVL	$60, AX
   479		SYSCALL
   480		JMP	-3(PC)	// keep exiting
   481	
   482	TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
   483		MOVQ	new+0(FP), DI
   484		MOVQ	old+8(FP), SI
   485		MOVQ	$131, AX
   486		SYSCALL
   487		CMPQ	AX, $0xfffffffffffff001
   488		JLS	2(PC)
   489		MOVL	$0xf1, 0xf1  // crash
   490		RET
   491	
   492	// set tls base to DI
   493	TEXT runtime·settls(SB),NOSPLIT,$32
   494	#ifdef GOOS_android
   495		// Same as in sys_darwin_386.s:/ugliness, different constant.
   496		// DI currently holds m->tls, which must be fs:0x1d0.
   497		// See cgo/gcc_android_amd64.c for the derivation of the constant.
   498		SUBQ	$0x1d0, DI  // In android, the tls base 
   499	#else
   500		ADDQ	$8, DI	// ELF wants to use -8(FS)
   501	#endif
   502		MOVQ	DI, SI
   503		MOVQ	$0x1002, DI	// ARCH_SET_FS
   504		MOVQ	$158, AX	// arch_prctl
   505		SYSCALL
   506		CMPQ	AX, $0xfffffffffffff001
   507		JLS	2(PC)
   508		MOVL	$0xf1, 0xf1  // crash
   509		RET
   510	
   511	TEXT runtime·osyield(SB),NOSPLIT,$0
   512		MOVL	$24, AX
   513		SYSCALL
   514		RET
   515	
   516	TEXT runtime·sched_getaffinity(SB),NOSPLIT,$0
   517		MOVQ	pid+0(FP), DI
   518		MOVQ	len+8(FP), SI
   519		MOVQ	buf+16(FP), DX
   520		MOVL	$204, AX			// syscall entry
   521		SYSCALL
   522		MOVL	AX, ret+24(FP)
   523		RET
   524	
   525	// int32 runtime·epollcreate(int32 size);
   526	TEXT runtime·epollcreate(SB),NOSPLIT,$0
   527		MOVL    size+0(FP), DI
   528		MOVL    $213, AX                        // syscall entry
   529		SYSCALL
   530		MOVL	AX, ret+8(FP)
   531		RET
   532	
   533	// int32 runtime·epollcreate1(int32 flags);
   534	TEXT runtime·epollcreate1(SB),NOSPLIT,$0
   535		MOVL	flags+0(FP), DI
   536		MOVL	$291, AX			// syscall entry
   537		SYSCALL
   538		MOVL	AX, ret+8(FP)
   539		RET
   540	
   541	// func epollctl(epfd, op, fd int32, ev *epollEvent) int
   542	TEXT runtime·epollctl(SB),NOSPLIT,$0
   543		MOVL	epfd+0(FP), DI
   544		MOVL	op+4(FP), SI
   545		MOVL	fd+8(FP), DX
   546		MOVQ	ev+16(FP), R10
   547		MOVL	$233, AX			// syscall entry
   548		SYSCALL
   549		MOVL	AX, ret+24(FP)
   550		RET
   551	
   552	// int32 runtime·epollwait(int32 epfd, EpollEvent *ev, int32 nev, int32 timeout);
   553	TEXT runtime·epollwait(SB),NOSPLIT,$0
   554		MOVL	epfd+0(FP), DI
   555		MOVQ	ev+8(FP), SI
   556		MOVL	nev+16(FP), DX
   557		MOVL	timeout+20(FP), R10
   558		MOVL	$232, AX			// syscall entry
   559		SYSCALL
   560		MOVL	AX, ret+24(FP)
   561		RET
   562	
   563	// void runtime·closeonexec(int32 fd);
   564	TEXT runtime·closeonexec(SB),NOSPLIT,$0
   565		MOVL    fd+0(FP), DI  // fd
   566		MOVQ    $2, SI  // F_SETFD
   567		MOVQ    $1, DX  // FD_CLOEXEC
   568		MOVL	$72, AX  // fcntl
   569		SYSCALL
   570		RET
   571	
   572	
   573	// int access(const char *name, int mode)
   574	TEXT runtime·access(SB),NOSPLIT,$0
   575		MOVQ	name+0(FP), DI
   576		MOVL	mode+8(FP), SI
   577		MOVL	$21, AX  // syscall entry
   578		SYSCALL
   579		MOVL	AX, ret+16(FP)
   580		RET
   581	
   582	// int connect(int fd, const struct sockaddr *addr, socklen_t addrlen)
   583	TEXT runtime·connect(SB),NOSPLIT,$0-28
   584		MOVL	fd+0(FP), DI
   585		MOVQ	addr+8(FP), SI
   586		MOVL	len+16(FP), DX
   587		MOVL	$42, AX  // syscall entry
   588		SYSCALL
   589		MOVL	AX, ret+24(FP)
   590		RET
   591	
   592	// int socket(int domain, int type, int protocol)
   593	TEXT runtime·socket(SB),NOSPLIT,$0-20
   594		MOVL	domain+0(FP), DI
   595		MOVL	typ+4(FP), SI
   596		MOVL	prot+8(FP), DX
   597		MOVL	$41, AX  // syscall entry
   598		SYSCALL
   599		MOVL	AX, ret+16(FP)
   600		RET

View as plain text