...
Run Format

Text file src/syscall/asm_darwin_arm.s

Documentation: syscall

     1// Copyright 2014 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#include "textflag.h"
     6
     7//
     8// System call support for ARM, Darwin
     9//
    10
    11// func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
    12TEXT	·Syscall(SB),NOSPLIT,$0-28
    13	BL		runtime·entersyscall(SB)
    14	MOVW	trap+0(FP), R12
    15	MOVW	a1+4(FP), R0
    16	MOVW	a2+8(FP), R1
    17	MOVW	a3+12(FP), R2
    18	SWI		$0x80
    19	BCC		ok
    20	MOVW	$-1, R1
    21	MOVW	R1, r1+16(FP)	// r1
    22	MOVW	$0, R2
    23	MOVW	R2, r2+20(FP)	// r2
    24	MOVW	R0, err+24(FP)	// err
    25	BL		runtime·exitsyscall(SB)
    26	RET
    27ok:
    28	MOVW	R0, r1+16(FP) // r1
    29	MOVW	R1, r2+20(FP)	// r2
    30	MOVW	$0, R0
    31	MOVW	R0, err+24(FP)	// err
    32	BL		runtime·exitsyscall(SB)
    33	RET
    34
    35// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
    36TEXT ·RawSyscall(SB),NOSPLIT,$0-28
    37	MOVW	trap+0(FP), R12	// syscall entry
    38	MOVW	a1+4(FP), R0
    39	MOVW	a2+8(FP), R1
    40	MOVW	a3+12(FP), R2
    41	SWI		$0x80
    42	BCC		ok1
    43	MOVW	$-1, R1
    44	MOVW	R1, r1+16(FP)	// r1
    45	MOVW	$0, R2
    46	MOVW	R2, r2+20(FP)	// r2
    47	MOVW	R0, err+24(FP)	// err
    48	RET
    49ok1:
    50	MOVW	R0, r1+16(FP) // r1
    51	MOVW	R1, r2+20(FP)	// r2
    52	MOVW	$0, R0
    53	MOVW	R0, err+24(FP)	// err
    54	RET
    55
    56// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
    57TEXT	·Syscall6(SB),NOSPLIT,$0-40
    58	BL		runtime·entersyscall(SB)
    59	MOVW	trap+0(FP), R12	// syscall entry
    60	MOVW	a1+4(FP), R0
    61	MOVW	a2+8(FP), R1
    62	MOVW	a3+12(FP), R2
    63	MOVW	a4+16(FP), R3
    64	MOVW	a5+20(FP), R4
    65	MOVW	a6+24(FP), R5
    66	SWI		$0x80
    67	BCC		ok6
    68	MOVW	$-1, R1
    69	MOVW	R1, r1+28(FP)	// r1
    70	MOVW	$0, R2
    71	MOVW	R2, r2+32(FP)	// r2
    72	MOVW	R0, err+36(FP)	// err
    73	BL		runtime·exitsyscall(SB)
    74	RET
    75ok6:
    76	MOVW	R0, r1+28(FP) // r1
    77	MOVW	R1, r2+32(FP)	// r2
    78	MOVW	$0, R0
    79	MOVW	R0, err+36(FP)	// err
    80	BL		runtime·exitsyscall(SB)
    81	RET
    82
    83// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
    84TEXT	·RawSyscall6(SB),NOSPLIT,$0-40
    85	MOVW	trap+0(FP), R12	// syscall entry
    86	MOVW	a1+4(FP), R0
    87	MOVW	a2+8(FP), R1
    88	MOVW	a3+12(FP), R2
    89	MOVW	a4+16(FP), R3
    90	MOVW	a5+20(FP), R4
    91	MOVW	a6+24(FP), R5
    92	SWI		$0x80
    93	BCC		ok2
    94	MOVW	$-1, R1
    95	MOVW	R1, r1+28(FP)	// r1
    96	MOVW	$0, R2
    97	MOVW	R2, r2+32(FP)	// r2
    98	MOVW	R0, err+36(FP)	// err
    99	RET
   100ok2:
   101	MOVW	R0, r1+28(FP) // r1
   102	MOVW	R1, r2+32(FP)	// r2
   103	MOVW	$0, R0
   104	MOVW	R0, err+36(FP)	// err
   105	RET
   106
   107// Actually Syscall7.
   108TEXT	·Syscall9(SB),NOSPLIT,$0-52
   109	BL runtime·entersyscall(SB)
   110	MOVW	num+0(FP), R12	// syscall entry
   111	MOVW	a1+4(FP), R0
   112	MOVW	a2+8(FP), R1
   113	MOVW	a3+12(FP), R2
   114	MOVW	a4+16(FP), R3
   115	MOVW	a5+20(FP), R4
   116	MOVW	a6+24(FP), R5
   117	MOVW	a7+28(FP), R6
   118	SWI		$0x80
   119	BCC		ok9
   120	MOVW	$-1, R1
   121	MOVW	R1, r1+40(FP)	// r1
   122	MOVW	$0, R2
   123	MOVW	R2, r2+44(FP)	// r2
   124	MOVW	R0, err+48(FP)	// err
   125	BL		runtime·exitsyscall(SB)
   126	RET
   127ok9:
   128	MOVW	R0, r1+40(FP) // r1
   129	MOVW	R1, r2+44(FP)	// r2
   130	MOVW	$0, R0
   131	MOVW	R0, err+48(FP)	// err
   132	BL	runtime·exitsyscall(SB)
   133	RET

View as plain text