10754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// Copyright 2009 The Go Authors. All rights reserved.
20754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// Use of this source code is governed by a BSD-style
30754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// license that can be found in the LICENSE file.
40754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
50754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#include "textflag.h"
60754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#include "funcdata.h"
70754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
80754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot#define SYS_SEEK 39	/* from zsysnum_plan9.go */
90754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
100754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// System call support for plan9 on arm
110754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
120754ce079d936daf401bbf49cb69a318aa79828android-build-team RobotTEXT	sysresult<>(SB),NOSPLIT,$12
130754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVWemptystring+0(SB), R2
140754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	CMP		$-1, R0
150754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	B.NE	ok
160754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R1, save-4(SP)
170754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		runtime·errstr(SB)
180754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	save-4(SP), R1
190754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$err-12(SP), R2
200754ce079d936daf401bbf49cb69a318aa79828android-build-team Robotok:
210754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA	(R2), [R3-R4]
220754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA	[R3-R4], (R1)
230754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	RET
240754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
250754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot//func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err ErrorString)
260754ce079d936daf401bbf49cb69a318aa79828android-build-team RobotTEXT	·Syscall(SB),NOSPLIT,$0-32
270754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		runtime·entersyscall(SB)
280754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	trap+0(FP), R0	// syscall num
290754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA.W	(R13),[R1-R2]	// pop LR and caller's LR
300754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	SWI		$0
310754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.DB.W	[R1-R2],(R13)	// push LR and caller's LR
320754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$0, R2
330754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$r1+16(FP), R1
340754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA.W	[R0,R2], (R1)
350754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		sysresult<>(SB)
360754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		runtime·exitsyscall(SB)
370754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	RET
380754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
390754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot//func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err ErrorString)
400754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// Actually Syscall5 but the rest of the code expects it to be named Syscall6.
410754ce079d936daf401bbf49cb69a318aa79828android-build-team RobotTEXT	·Syscall6(SB),NOSPLIT,$0-44
420754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		runtime·entersyscall(SB)
430754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	trap+0(FP), R0	// syscall num
440754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA.W	(R13),[R1-R2]	// pop LR and caller's LR
450754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	SWI		$0
460754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.DB.W	[R1-R2],(R13)	// push LR and caller's LR
470754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$0, R1
480754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$r1+28(FP), R1
490754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA.W	[R0,R2], (R1)
500754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		sysresult<>(SB)
510754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		runtime·exitsyscall(SB)
520754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	RET
530754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
540754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot//func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
550754ce079d936daf401bbf49cb69a318aa79828android-build-team RobotTEXT ·RawSyscall(SB),NOSPLIT,$0-28
560754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	trap+0(FP), R0	// syscall num
570754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA.W	(R13),[R1]		// pop caller's LR
580754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	SWI		$0
590754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.DB.W	[R1],(R13)		// push caller's LR
600754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R0, r1+16(FP)
610754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R0, r2+20(FP)
620754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R0, err+24(FP)
630754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	RET
640754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
650754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot//func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
660754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot// Actually RawSyscall5 but the rest of the code expects it to be named RawSyscall6.
670754ce079d936daf401bbf49cb69a318aa79828android-build-team RobotTEXT	·RawSyscall6(SB),NOSPLIT,$0-40
680754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	trap+0(FP), R0	// syscall num
690754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA.W	(R13),[R1]		// pop caller's LR
700754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	SWI		$0
710754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.DB.W	[R1],(R13)		// push caller's LR
720754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R0, r1+28(FP)
730754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R0, r2+32(FP)
740754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R0, err+36(FP)
750754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	RET
760754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot
770754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
780754ce079d936daf401bbf49cb69a318aa79828android-build-team RobotTEXT ·seek(SB),NOSPLIT,$0-36
790754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$newoffset_lo+20(FP), R5
800754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	R5, placeholder+0(FP)	//placeholder = dest for return value
810754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$SYS_SEEK, R0		// syscall num
820754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.IA.W	(R13),[R1]		// pop LR
830754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	SWI		$0
840754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVM.DB.W	[R1],(R13)		// push LR
850754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	CMP		$-1, R0
860754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW.EQ	R0, 0(R5)
870754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW.EQ	R0, 4(R5)
880754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	MOVW	$err+28(FP), R1
890754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	BL		sysresult<>(SB)
900754ce079d936daf401bbf49cb69a318aa79828android-build-team Robot	RET
91