Text file src/runtime/sys_linux_mips64x.s

     1  // Copyright 2015 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  //go:build linux && (mips64 || mips64le)
     6  
     7  //
     8  // System calls and other sys.stuff for mips64, Linux
     9  //
    10  
    11  #include "go_asm.h"
    12  #include "go_tls.h"
    13  #include "textflag.h"
    14  
    15  #define AT_FDCWD -100
    16  
    17  #define SYS_exit		5058
    18  #define SYS_read		5000
    19  #define SYS_write		5001
    20  #define SYS_close		5003
    21  #define SYS_getpid		5038
    22  #define SYS_kill		5060
    23  #define SYS_fcntl		5070
    24  #define SYS_mmap		5009
    25  #define SYS_munmap		5011
    26  #define SYS_setitimer		5036
    27  #define SYS_clone		5055
    28  #define SYS_nanosleep		5034
    29  #define SYS_sched_yield		5023
    30  #define SYS_rt_sigreturn	5211
    31  #define SYS_rt_sigaction	5013
    32  #define SYS_rt_sigprocmask	5014
    33  #define SYS_sigaltstack		5129
    34  #define SYS_madvise		5027
    35  #define SYS_mincore		5026
    36  #define SYS_gettid		5178
    37  #define SYS_futex		5194
    38  #define SYS_sched_getaffinity	5196
    39  #define SYS_exit_group		5205
    40  #define SYS_epoll_create	5207
    41  #define SYS_epoll_ctl		5208
    42  #define SYS_timer_create	5216
    43  #define SYS_timer_settime	5217
    44  #define SYS_timer_delete	5220
    45  #define SYS_tgkill		5225
    46  #define SYS_openat		5247
    47  #define SYS_epoll_pwait		5272
    48  #define SYS_clock_gettime	5222
    49  #define SYS_epoll_create1	5285
    50  #define SYS_brk			5012
    51  #define SYS_pipe2		5287
    52  
    53  TEXT runtime·exit(SB),NOSPLIT|NOFRAME,$0-4
    54  	MOVW	code+0(FP), R4
    55  	MOVV	$SYS_exit_group, R2
    56  	SYSCALL
    57  	RET
    58  
    59  // func exitThread(wait *uint32)
    60  TEXT runtime·exitThread(SB),NOSPLIT|NOFRAME,$0-8
    61  	MOVV	wait+0(FP), R1
    62  	// We're done using the stack.
    63  	MOVW	$0, R2
    64  	SYNC
    65  	MOVW	R2, (R1)
    66  	SYNC
    67  	MOVW	$0, R4	// exit code
    68  	MOVV	$SYS_exit, R2
    69  	SYSCALL
    70  	JMP	0(PC)
    71  
    72  TEXT runtime·open(SB),NOSPLIT|NOFRAME,$0-20
    73  	// This uses openat instead of open, because Android O blocks open.
    74  	MOVW	$AT_FDCWD, R4 // AT_FDCWD, so this acts like open
    75  	MOVV	name+0(FP), R5
    76  	MOVW	mode+8(FP), R6
    77  	MOVW	perm+12(FP), R7
    78  	MOVV	$SYS_openat, R2
    79  	SYSCALL
    80  	BEQ	R7, 2(PC)
    81  	MOVW	$-1, R2
    82  	MOVW	R2, ret+16(FP)
    83  	RET
    84  
    85  TEXT runtime·closefd(SB),NOSPLIT|NOFRAME,$0-12
    86  	MOVW	fd+0(FP), R4
    87  	MOVV	$SYS_close, R2
    88  	SYSCALL
    89  	BEQ	R7, 2(PC)
    90  	MOVW	$-1, R2
    91  	MOVW	R2, ret+8(FP)
    92  	RET
    93  
    94  TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0-28
    95  	MOVV	fd+0(FP), R4
    96  	MOVV	p+8(FP), R5
    97  	MOVW	n+16(FP), R6
    98  	MOVV	$SYS_write, R2
    99  	SYSCALL
   100  	BEQ	R7, 2(PC)
   101  	SUBVU	R2, R0, R2	// caller expects negative errno
   102  	MOVW	R2, ret+24(FP)
   103  	RET
   104  
   105  TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
   106  	MOVW	fd+0(FP), R4
   107  	MOVV	p+8(FP), R5
   108  	MOVW	n+16(FP), R6
   109  	MOVV	$SYS_read, R2
   110  	SYSCALL
   111  	BEQ	R7, 2(PC)
   112  	SUBVU	R2, R0, R2	// caller expects negative errno
   113  	MOVW	R2, ret+24(FP)
   114  	RET
   115  
   116  // func pipe2(flags int32) (r, w int32, errno int32)
   117  TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
   118  	MOVV	$r+8(FP), R4
   119  	MOVW	flags+0(FP), R5
   120  	MOVV	$SYS_pipe2, R2
   121  	SYSCALL
   122  	BEQ	R7, 2(PC)
   123  	SUBVU	R2, R0, R2	// caller expects negative errno
   124  	MOVW	R2, errno+16(FP)
   125  	RET
   126  
   127  TEXT runtime·usleep(SB),NOSPLIT,$16-4
   128  	MOVWU	usec+0(FP), R3
   129  	MOVV	R3, R5
   130  	MOVW	$1000000, R4
   131  	DIVVU	R4, R3
   132  	MOVV	LO, R3
   133  	MOVV	R3, 8(R29)
   134  	MOVW	$1000, R4
   135  	MULVU	R3, R4
   136  	MOVV	LO, R4
   137  	SUBVU	R4, R5
   138  	MOVV	R5, 16(R29)
   139  
   140  	// nanosleep(&ts, 0)
   141  	ADDV	$8, R29, R4
   142  	MOVW	$0, R5
   143  	MOVV	$SYS_nanosleep, R2
   144  	SYSCALL
   145  	RET
   146  
   147  TEXT runtime·gettid(SB),NOSPLIT,$0-4
   148  	MOVV	$SYS_gettid, R2
   149  	SYSCALL
   150  	MOVW	R2, ret+0(FP)
   151  	RET
   152  
   153  TEXT runtime·raise(SB),NOSPLIT|NOFRAME,$0
   154  	MOVV	$SYS_getpid, R2
   155  	SYSCALL
   156  	MOVW	R2, R16
   157  	MOVV	$SYS_gettid, R2
   158  	SYSCALL
   159  	MOVW	R2, R5	// arg 2 tid
   160  	MOVW	R16, R4	// arg 1 pid
   161  	MOVW	sig+0(FP), R6	// arg 3
   162  	MOVV	$SYS_tgkill, R2
   163  	SYSCALL
   164  	RET
   165  
   166  TEXT runtime·raiseproc(SB),NOSPLIT|NOFRAME,$0
   167  	MOVV	$SYS_getpid, R2
   168  	SYSCALL
   169  	MOVW	R2, R4	// arg 1 pid
   170  	MOVW	sig+0(FP), R5	// arg 2
   171  	MOVV	$SYS_kill, R2
   172  	SYSCALL
   173  	RET
   174  
   175  TEXT ·getpid(SB),NOSPLIT|NOFRAME,$0-8
   176  	MOVV	$SYS_getpid, R2
   177  	SYSCALL
   178  	MOVV	R2, ret+0(FP)
   179  	RET
   180  
   181  TEXT ·tgkill(SB),NOSPLIT|NOFRAME,$0-24
   182  	MOVV	tgid+0(FP), R4
   183  	MOVV	tid+8(FP), R5
   184  	MOVV	sig+16(FP), R6
   185  	MOVV	$SYS_tgkill, R2
   186  	SYSCALL
   187  	RET
   188  
   189  TEXT runtime·setitimer(SB),NOSPLIT|NOFRAME,$0-24
   190  	MOVW	mode+0(FP), R4
   191  	MOVV	new+8(FP), R5
   192  	MOVV	old+16(FP), R6
   193  	MOVV	$SYS_setitimer, R2
   194  	SYSCALL
   195  	RET
   196  
   197  TEXT runtime·timer_create(SB),NOSPLIT,$0-28
   198  	MOVW	clockid+0(FP), R4
   199  	MOVV	sevp+8(FP), R5
   200  	MOVV	timerid+16(FP), R6
   201  	MOVV	$SYS_timer_create, R2
   202  	SYSCALL
   203  	MOVW	R2, ret+24(FP)
   204  	RET
   205  
   206  TEXT runtime·timer_settime(SB),NOSPLIT,$0-28
   207  	MOVW	timerid+0(FP), R4
   208  	MOVW	flags+4(FP), R5
   209  	MOVV	new+8(FP), R6
   210  	MOVV	old+16(FP), R7
   211  	MOVV	$SYS_timer_settime, R2
   212  	SYSCALL
   213  	MOVW	R2, ret+24(FP)
   214  	RET
   215  
   216  TEXT runtime·timer_delete(SB),NOSPLIT,$0-12
   217  	MOVW	timerid+0(FP), R4
   218  	MOVV	$SYS_timer_delete, R2
   219  	SYSCALL
   220  	MOVW	R2, ret+8(FP)
   221  	RET
   222  
   223  TEXT runtime·mincore(SB),NOSPLIT|NOFRAME,$0-28
   224  	MOVV	addr+0(FP), R4
   225  	MOVV	n+8(FP), R5
   226  	MOVV	dst+16(FP), R6
   227  	MOVV	$SYS_mincore, R2
   228  	SYSCALL
   229  	SUBVU	R2, R0, R2	// caller expects negative errno
   230  	MOVW	R2, ret+24(FP)
   231  	RET
   232  
   233  // func walltime() (sec int64, nsec int32)
   234  TEXT runtime·walltime(SB),NOSPLIT,$16-12
   235  	MOVV	R29, R16	// R16 is unchanged by C code
   236  	MOVV	R29, R1
   237  
   238  	MOVV	g_m(g), R17	// R17 = m
   239  
   240  	// Set vdsoPC and vdsoSP for SIGPROF traceback.
   241  	// Save the old values on stack and restore them on exit,
   242  	// so this function is reentrant.
   243  	MOVV	m_vdsoPC(R17), R2
   244  	MOVV	m_vdsoSP(R17), R3
   245  	MOVV	R2, 8(R29)
   246  	MOVV	R3, 16(R29)
   247  
   248  	MOVV	$ret-8(FP), R2 // caller's SP
   249  	MOVV	R31, m_vdsoPC(R17)
   250  	MOVV	R2, m_vdsoSP(R17)
   251  
   252  	MOVV	m_curg(R17), R4
   253  	MOVV	g, R5
   254  	BNE	R4, R5, noswitch
   255  
   256  	MOVV	m_g0(R17), R4
   257  	MOVV	(g_sched+gobuf_sp)(R4), R1	// Set SP to g0 stack
   258  
   259  noswitch:
   260  	SUBV	$16, R1
   261  	AND	$~15, R1	// Align for C code
   262  	MOVV	R1, R29
   263  
   264  	MOVW	$0, R4 // CLOCK_REALTIME
   265  	MOVV	$0(R29), R5
   266  
   267  	MOVV	runtime·vdsoClockgettimeSym(SB), R25
   268  	BEQ	R25, fallback
   269  
   270  	JAL	(R25)
   271  	// check on vdso call return for kernel compatibility
   272  	// see https://golang.org/issues/39046
   273  	// if we get any error make fallback permanent.
   274  	BEQ	R2, R0, finish
   275  	MOVV	R0, runtime·vdsoClockgettimeSym(SB)
   276  	MOVW	$0, R4 // CLOCK_REALTIME
   277  	MOVV	$0(R29), R5
   278  	JMP	fallback
   279  
   280  finish:
   281  	MOVV	0(R29), R3	// sec
   282  	MOVV	8(R29), R5	// nsec
   283  
   284  	MOVV	R16, R29	// restore SP
   285  	// Restore vdsoPC, vdsoSP
   286  	// We don't worry about being signaled between the two stores.
   287  	// If we are not in a signal handler, we'll restore vdsoSP to 0,
   288  	// and no one will care about vdsoPC. If we are in a signal handler,
   289  	// we cannot receive another signal.
   290  	MOVV	16(R29), R1
   291  	MOVV	R1, m_vdsoSP(R17)
   292  	MOVV	8(R29), R1
   293  	MOVV	R1, m_vdsoPC(R17)
   294  
   295  	MOVV	R3, sec+0(FP)
   296  	MOVW	R5, nsec+8(FP)
   297  	RET
   298  
   299  fallback:
   300  	MOVV	$SYS_clock_gettime, R2
   301  	SYSCALL
   302  	JMP finish
   303  
   304  TEXT runtime·nanotime1(SB),NOSPLIT,$16-8
   305  	MOVV	R29, R16	// R16 is unchanged by C code
   306  	MOVV	R29, R1
   307  
   308  	MOVV	g_m(g), R17	// R17 = m
   309  
   310  	// Set vdsoPC and vdsoSP for SIGPROF traceback.
   311  	// Save the old values on stack and restore them on exit,
   312  	// so this function is reentrant.
   313  	MOVV	m_vdsoPC(R17), R2
   314  	MOVV	m_vdsoSP(R17), R3
   315  	MOVV	R2, 8(R29)
   316  	MOVV	R3, 16(R29)
   317  
   318  	MOVV	$ret-8(FP), R2 // caller's SP
   319  	MOVV	R31, m_vdsoPC(R17)
   320  	MOVV	R2, m_vdsoSP(R17)
   321  
   322  	MOVV	m_curg(R17), R4
   323  	MOVV	g, R5
   324  	BNE	R4, R5, noswitch
   325  
   326  	MOVV	m_g0(R17), R4
   327  	MOVV	(g_sched+gobuf_sp)(R4), R1	// Set SP to g0 stack
   328  
   329  noswitch:
   330  	SUBV	$16, R1
   331  	AND	$~15, R1	// Align for C code
   332  	MOVV	R1, R29
   333  
   334  	MOVW	$1, R4 // CLOCK_MONOTONIC
   335  	MOVV	$0(R29), R5
   336  
   337  	MOVV	runtime·vdsoClockgettimeSym(SB), R25
   338  	BEQ	R25, fallback
   339  
   340  	JAL	(R25)
   341  	// see walltime for detail
   342  	BEQ	R2, R0, finish
   343  	MOVV	R0, runtime·vdsoClockgettimeSym(SB)
   344  	MOVW	$1, R4 // CLOCK_MONOTONIC
   345  	MOVV	$0(R29), R5
   346  	JMP	fallback
   347  
   348  finish:
   349  	MOVV	0(R29), R3	// sec
   350  	MOVV	8(R29), R5	// nsec
   351  
   352  	MOVV	R16, R29	// restore SP
   353  	// Restore vdsoPC, vdsoSP
   354  	// We don't worry about being signaled between the two stores.
   355  	// If we are not in a signal handler, we'll restore vdsoSP to 0,
   356  	// and no one will care about vdsoPC. If we are in a signal handler,
   357  	// we cannot receive another signal.
   358  	MOVV	16(R29), R1
   359  	MOVV	R1, m_vdsoSP(R17)
   360  	MOVV	8(R29), R1
   361  	MOVV	R1, m_vdsoPC(R17)
   362  
   363  	// sec is in R3, nsec in R5
   364  	// return nsec in R3
   365  	MOVV	$1000000000, R4
   366  	MULVU	R4, R3
   367  	MOVV	LO, R3
   368  	ADDVU	R5, R3
   369  	MOVV	R3, ret+0(FP)
   370  	RET
   371  
   372  fallback:
   373  	MOVV	$SYS_clock_gettime, R2
   374  	SYSCALL
   375  	JMP	finish
   376  
   377  TEXT runtime·rtsigprocmask(SB),NOSPLIT|NOFRAME,$0-28
   378  	MOVW	how+0(FP), R4
   379  	MOVV	new+8(FP), R5
   380  	MOVV	old+16(FP), R6
   381  	MOVW	size+24(FP), R7
   382  	MOVV	$SYS_rt_sigprocmask, R2
   383  	SYSCALL
   384  	BEQ	R7, 2(PC)
   385  	MOVV	R0, 0xf1(R0)	// crash
   386  	RET
   387  
   388  TEXT runtime·rt_sigaction(SB),NOSPLIT|NOFRAME,$0-36
   389  	MOVV	sig+0(FP), R4
   390  	MOVV	new+8(FP), R5
   391  	MOVV	old+16(FP), R6
   392  	MOVV	size+24(FP), R7
   393  	MOVV	$SYS_rt_sigaction, R2
   394  	SYSCALL
   395  	BEQ	R7, 2(PC)
   396  	SUBVU	R2, R0, R2	// caller expects negative errno
   397  	MOVW	R2, ret+32(FP)
   398  	RET
   399  
   400  TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
   401  	MOVW	sig+8(FP), R4
   402  	MOVV	info+16(FP), R5
   403  	MOVV	ctx+24(FP), R6
   404  	MOVV	fn+0(FP), R25
   405  	JAL	(R25)
   406  	RET
   407  
   408  TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$64
   409  	// initialize REGSB = PC&0xffffffff00000000
   410  	BGEZAL	R0, 1(PC)
   411  	SRLV	$32, R31, RSB
   412  	SLLV	$32, RSB
   413  
   414  	// this might be called in external code context,
   415  	// where g is not set.
   416  	MOVB	runtime·iscgo(SB), R1
   417  	BEQ	R1, 2(PC)
   418  	JAL	runtime·load_g(SB)
   419  
   420  	MOVW	R4, 8(R29)
   421  	MOVV	R5, 16(R29)
   422  	MOVV	R6, 24(R29)
   423  	MOVV	$runtime·sigtrampgo(SB), R1
   424  	JAL	(R1)
   425  	RET
   426  
   427  TEXT runtime·cgoSigtramp(SB),NOSPLIT,$0
   428  	JMP	runtime·sigtramp(SB)
   429  
   430  TEXT runtime·mmap(SB),NOSPLIT|NOFRAME,$0
   431  	MOVV	addr+0(FP), R4
   432  	MOVV	n+8(FP), R5
   433  	MOVW	prot+16(FP), R6
   434  	MOVW	flags+20(FP), R7
   435  	MOVW	fd+24(FP), R8
   436  	MOVW	off+28(FP), R9
   437  
   438  	MOVV	$SYS_mmap, R2
   439  	SYSCALL
   440  	BEQ	R7, ok
   441  	MOVV	$0, p+32(FP)
   442  	MOVV	R2, err+40(FP)
   443  	RET
   444  ok:
   445  	MOVV	R2, p+32(FP)
   446  	MOVV	$0, err+40(FP)
   447  	RET
   448  
   449  TEXT runtime·munmap(SB),NOSPLIT|NOFRAME,$0
   450  	MOVV	addr+0(FP), R4
   451  	MOVV	n+8(FP), R5
   452  	MOVV	$SYS_munmap, R2
   453  	SYSCALL
   454  	BEQ	R7, 2(PC)
   455  	MOVV	R0, 0xf3(R0)	// crash
   456  	RET
   457  
   458  TEXT runtime·madvise(SB),NOSPLIT|NOFRAME,$0
   459  	MOVV	addr+0(FP), R4
   460  	MOVV	n+8(FP), R5
   461  	MOVW	flags+16(FP), R6
   462  	MOVV	$SYS_madvise, R2
   463  	SYSCALL
   464  	MOVW	R2, ret+24(FP)
   465  	RET
   466  
   467  // int64 futex(int32 *uaddr, int32 op, int32 val,
   468  //	struct timespec *timeout, int32 *uaddr2, int32 val2);
   469  TEXT runtime·futex(SB),NOSPLIT|NOFRAME,$0
   470  	MOVV	addr+0(FP), R4
   471  	MOVW	op+8(FP), R5
   472  	MOVW	val+12(FP), R6
   473  	MOVV	ts+16(FP), R7
   474  	MOVV	addr2+24(FP), R8
   475  	MOVW	val3+32(FP), R9
   476  	MOVV	$SYS_futex, R2
   477  	SYSCALL
   478  	BEQ	R7, 2(PC)
   479  	SUBVU	R2, R0, R2	// caller expects negative errno
   480  	MOVW	R2, ret+40(FP)
   481  	RET
   482  
   483  // int64 clone(int32 flags, void *stk, M *mp, G *gp, void (*fn)(void));
   484  TEXT runtime·clone(SB),NOSPLIT|NOFRAME,$0
   485  	MOVW	flags+0(FP), R4
   486  	MOVV	stk+8(FP), R5
   487  
   488  	// Copy mp, gp, fn off parent stack for use by child.
   489  	// Careful: Linux system call clobbers ???.
   490  	MOVV	mp+16(FP), R16
   491  	MOVV	gp+24(FP), R17
   492  	MOVV	fn+32(FP), R18
   493  
   494  	MOVV	R16, -8(R5)
   495  	MOVV	R17, -16(R5)
   496  	MOVV	R18, -24(R5)
   497  	MOVV	$1234, R16
   498  	MOVV	R16, -32(R5)
   499  
   500  	MOVV	$SYS_clone, R2
   501  	SYSCALL
   502  	BEQ	R7, 2(PC)
   503  	SUBVU	R2, R0, R2	// caller expects negative errno
   504  
   505  	// In parent, return.
   506  	BEQ	R2, 3(PC)
   507  	MOVW	R2, ret+40(FP)
   508  	RET
   509  
   510  	// In child, on new stack.
   511  	MOVV	-32(R29), R16
   512  	MOVV	$1234, R1
   513  	BEQ	R16, R1, 2(PC)
   514  	MOVV	R0, 0(R0)
   515  
   516  	// Initialize m->procid to Linux tid
   517  	MOVV	$SYS_gettid, R2
   518  	SYSCALL
   519  
   520  	MOVV	-24(R29), R18		// fn
   521  	MOVV	-16(R29), R17		// g
   522  	MOVV	-8(R29), R16		// m
   523  
   524  	BEQ	R16, nog
   525  	BEQ	R17, nog
   526  
   527  	MOVV	R2, m_procid(R16)
   528  
   529  	// TODO: setup TLS.
   530  
   531  	// In child, set up new stack
   532  	MOVV	R16, g_m(R17)
   533  	MOVV	R17, g
   534  	//CALL	runtime·stackcheck(SB)
   535  
   536  nog:
   537  	// Call fn
   538  	JAL	(R18)
   539  
   540  	// It shouldn't return.	 If it does, exit that thread.
   541  	MOVW	$111, R4
   542  	MOVV	$SYS_exit, R2
   543  	SYSCALL
   544  	JMP	-3(PC)	// keep exiting
   545  
   546  TEXT runtime·sigaltstack(SB),NOSPLIT|NOFRAME,$0
   547  	MOVV	new+0(FP), R4
   548  	MOVV	old+8(FP), R5
   549  	MOVV	$SYS_sigaltstack, R2
   550  	SYSCALL
   551  	BEQ	R7, 2(PC)
   552  	MOVV	R0, 0xf1(R0)	// crash
   553  	RET
   554  
   555  TEXT runtime·osyield(SB),NOSPLIT|NOFRAME,$0
   556  	MOVV	$SYS_sched_yield, R2
   557  	SYSCALL
   558  	RET
   559  
   560  TEXT runtime·sched_getaffinity(SB),NOSPLIT|NOFRAME,$0
   561  	MOVV	pid+0(FP), R4
   562  	MOVV	len+8(FP), R5
   563  	MOVV	buf+16(FP), R6
   564  	MOVV	$SYS_sched_getaffinity, R2
   565  	SYSCALL
   566  	BEQ	R7, 2(PC)
   567  	SUBVU	R2, R0, R2	// caller expects negative errno
   568  	MOVW	R2, ret+24(FP)
   569  	RET
   570  
   571  // int32 runtime·epollcreate(int32 size);
   572  TEXT runtime·epollcreate(SB),NOSPLIT|NOFRAME,$0
   573  	MOVW    size+0(FP), R4
   574  	MOVV	$SYS_epoll_create, R2
   575  	SYSCALL
   576  	BEQ	R7, 2(PC)
   577  	SUBVU	R2, R0, R2	// caller expects negative errno
   578  	MOVW	R2, ret+8(FP)
   579  	RET
   580  
   581  // int32 runtime·epollcreate1(int32 flags);
   582  TEXT runtime·epollcreate1(SB),NOSPLIT|NOFRAME,$0
   583  	MOVW	flags+0(FP), R4
   584  	MOVV	$SYS_epoll_create1, R2
   585  	SYSCALL
   586  	BEQ	R7, 2(PC)
   587  	SUBVU	R2, R0, R2	// caller expects negative errno
   588  	MOVW	R2, ret+8(FP)
   589  	RET
   590  
   591  // func epollctl(epfd, op, fd int32, ev *epollEvent) int
   592  TEXT runtime·epollctl(SB),NOSPLIT|NOFRAME,$0
   593  	MOVW	epfd+0(FP), R4
   594  	MOVW	op+4(FP), R5
   595  	MOVW	fd+8(FP), R6
   596  	MOVV	ev+16(FP), R7
   597  	MOVV	$SYS_epoll_ctl, R2
   598  	SYSCALL
   599  	SUBVU	R2, R0, R2	// caller expects negative errno
   600  	MOVW	R2, ret+24(FP)
   601  	RET
   602  
   603  // int32 runtime·epollwait(int32 epfd, EpollEvent *ev, int32 nev, int32 timeout);
   604  TEXT runtime·epollwait(SB),NOSPLIT|NOFRAME,$0
   605  	// This uses pwait instead of wait, because Android O blocks wait.
   606  	MOVW	epfd+0(FP), R4
   607  	MOVV	ev+8(FP), R5
   608  	MOVW	nev+16(FP), R6
   609  	MOVW	timeout+20(FP), R7
   610  	MOVV	$0, R8
   611  	MOVV	$SYS_epoll_pwait, R2
   612  	SYSCALL
   613  	BEQ	R7, 2(PC)
   614  	SUBVU	R2, R0, R2	// caller expects negative errno
   615  	MOVW	R2, ret+24(FP)
   616  	RET
   617  
   618  // void runtime·closeonexec(int32 fd);
   619  TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
   620  	MOVW    fd+0(FP), R4  // fd
   621  	MOVV    $2, R5  // F_SETFD
   622  	MOVV    $1, R6  // FD_CLOEXEC
   623  	MOVV	$SYS_fcntl, R2
   624  	SYSCALL
   625  	RET
   626  
   627  // func sbrk0() uintptr
   628  TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8
   629  	// Implemented as brk(NULL).
   630  	MOVV	$0, R4
   631  	MOVV	$SYS_brk, R2
   632  	SYSCALL
   633  	MOVV	R2, ret+0(FP)
   634  	RET
   635  
   636  TEXT runtime·access(SB),$0-20
   637  	MOVV	R0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
   638  	MOVW	R0, ret+16(FP) // for vet
   639  	RET
   640  
   641  TEXT runtime·connect(SB),$0-28
   642  	MOVV	R0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
   643  	MOVW	R0, ret+24(FP) // for vet
   644  	RET
   645  
   646  TEXT runtime·socket(SB),$0-20
   647  	MOVV	R0, 2(R0) // unimplemented, only needed for android; declared in stubs_linux.go
   648  	MOVW	R0, ret+16(FP) // for vet
   649  	RET
   650  

View as plain text