#include "../../cmd/ld/textflag.h"
TEXT ·Syscall(SB),NOSPLIT,$0-64
CALL runtime·entersyscall(SB)
MOVQ $0x8000, AX
MOVQ 8(SP), BP
LEAQ 16(SP), SI
LEAQ 8(SP), DI
CLD
MOVSQ
MOVSQ
MOVSQ
SYSCALL
MOVQ AX, r1+40(SP)
MOVQ $0, r2+48(SP)
CMPL AX, $-1
JNE ok3
SUBQ $16, SP
CALL runtime·errstr(SB)
MOVQ SP, SI
ADDQ $16, SP
JMP copyresult3
ok3:
LEAQ runtime·emptystring(SB), SI
copyresult3:
LEAQ err+56(SP), DI
CLD
MOVSQ
MOVSQ
CALL runtime·exitsyscall(SB)
RET
TEXT ·Syscall6(SB),NOSPLIT,$0-88
CALL runtime·entersyscall(SB)
MOVQ $0x8000, AX
MOVQ 8(SP), BP
LEAQ 16(SP), SI
LEAQ 8(SP), DI
CLD
MOVSQ
MOVSQ
MOVSQ
MOVSQ
MOVSQ
MOVSQ
SYSCALL
MOVQ AX, r1+64(SP)
MOVQ $0, r2+72(SP)
CMPL AX, $-1
JNE ok4
SUBQ $16, SP
CALL runtime·errstr(SB)
MOVQ SP, SI
ADDQ $16, SP
JMP copyresult4
ok4:
LEAQ runtime·emptystring(SB), SI
copyresult4:
LEAQ err+80(SP), DI
CLD
MOVSQ
MOVSQ
CALL runtime·exitsyscall(SB)
RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
MOVQ $0x8000, AX
MOVQ 8(SP), BP
LEAQ 16(SP), SI
LEAQ 8(SP), DI
CLD
MOVSQ
MOVSQ
MOVSQ
SYSCALL
MOVQ AX, r1+40(SP)
MOVQ AX, r2+48(SP)
MOVQ AX, err+56(SP)
RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
MOVQ $0x8000, AX
MOVQ 8(SP), BP
LEAQ 16(SP), SI
LEAQ 8(SP), DI
CLD
MOVSQ
MOVSQ
MOVSQ
MOVSQ
MOVSQ
MOVSQ
SYSCALL
MOVQ AX, r1+64(SP)
MOVQ AX, r2+72(SP)
MOVQ AX, err+80(SP)
RET
#define SYS_SEEK 39
TEXT ·seek(SB),NOSPLIT,$0-56
LEAQ newoffset+40(SP), AX
MOVQ AX, placeholder+8(SP)
MOVQ $0x8000, AX
MOVQ $SYS_SEEK, BP
SYSCALL
CMPL AX, $-1
JNE ok6
MOVQ $-1, newoffset+40(SP)
SUBQ $16, SP
CALL syscall·errstr(SB)
MOVQ SP, SI
ADDQ $16, SP
JMP copyresult6
ok6:
LEAQ runtime·emptystring(SB), SI
copyresult6:
LEAQ err+48(SP), DI
CLD
MOVSQ
MOVSQ
RET
TEXT ·exit(SB),NOSPLIT,$8-8
MOVQ code+0(FP), AX
MOVQ AX, 0(SP)
CALL runtime·exit(SB)
RET