Commit 9828b7c4 authored by Matthew Dempsky's avatar Matthew Dempsky

runtime, syscall: use FP instead of SP for parameters

Consistently access function parameters using the FP pseudo-register
instead of SP (e.g., x+0(FP) instead of x+4(SP) or x+8(SP), depending
on register size). Two reasons: 1) doc/asm says the SP pseudo-register
should use negative offsets in the range [-framesize, 0), and 2)
cmd/vet only validates parameter offsets when indexed from the FP
pseudo-register.

No binary changes to the compiled object files for any of the affected
package/OS/arch combinations.

Change-Id: I0efc6079bc7519fcea588c114ec6a39b245d68b0
Reviewed-on: https://go-review.googlesource.com/30085Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 79db1625
...@@ -237,8 +237,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0 ...@@ -237,8 +237,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0
RET RET
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVQ new+8(SP), DI MOVQ new+0(FP), DI
MOVQ old+16(SP), SI MOVQ old+8(FP), SI
MOVQ $53, AX MOVQ $53, AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
......
...@@ -229,8 +229,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0 ...@@ -229,8 +229,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0
RET RET
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVQ new+8(SP), DI MOVQ new+0(FP), DI
MOVQ old+16(SP), SI MOVQ old+8(FP), SI
MOVQ $53, AX MOVQ $53, AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
......
...@@ -379,8 +379,8 @@ nog: ...@@ -379,8 +379,8 @@ nog:
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVL $186, AX // sigaltstack MOVL $186, AX // sigaltstack
MOVL new+4(SP), BX MOVL new+0(FP), BX
MOVL old+8(SP), CX MOVL old+4(FP), CX
INVOKE_SYSCALL INVOKE_SYSCALL
CMPL AX, $0xfffff001 CMPL AX, $0xfffff001
JLS 2(PC) JLS 2(PC)
......
...@@ -445,8 +445,8 @@ nog: ...@@ -445,8 +445,8 @@ nog:
JMP -3(PC) // keep exiting JMP -3(PC) // keep exiting
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVQ new+8(SP), DI MOVQ new+0(FP), DI
MOVQ old+16(SP), SI MOVQ old+8(FP), SI
MOVQ $131, AX MOVQ $131, AX
SYSCALL SYSCALL
CMPQ AX, $0xfffffffffffff001 CMPQ AX, $0xfffffffffffff001
......
...@@ -285,8 +285,8 @@ TEXT runtime·lwp_tramp(SB),NOSPLIT,$0 ...@@ -285,8 +285,8 @@ TEXT runtime·lwp_tramp(SB),NOSPLIT,$0
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVL $281, AX // sys___sigaltstack14 MOVL $281, AX // sys___sigaltstack14
MOVL new+4(SP), BX MOVL new+0(FP), BX
MOVL old+8(SP), CX MOVL old+4(FP), CX
INT $0x80 INT $0x80
CMPL AX, $0xfffff001 CMPL AX, $0xfffff001
JLS 2(PC) JLS 2(PC)
......
...@@ -290,8 +290,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0 ...@@ -290,8 +290,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0
RET RET
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVQ new+8(SP), DI // arg 1 - nss MOVQ new+0(FP), DI // arg 1 - nss
MOVQ old+16(SP), SI // arg 2 - oss MOVQ old+8(FP), SI // arg 2 - oss
MOVQ $281, AX // sys___sigaltstack14 MOVQ $281, AX // sys___sigaltstack14
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
......
...@@ -294,8 +294,8 @@ TEXT runtime·tfork(SB),NOSPLIT,$12 ...@@ -294,8 +294,8 @@ TEXT runtime·tfork(SB),NOSPLIT,$12
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVL $288, AX // sys_sigaltstack MOVL $288, AX // sys_sigaltstack
MOVL new+4(SP), BX MOVL new+0(FP), BX
MOVL old+8(SP), CX MOVL old+4(FP), CX
INT $0x80 INT $0x80
CMPL AX, $0xfffff001 CMPL AX, $0xfffff001
JLS 2(PC) JLS 2(PC)
......
...@@ -278,8 +278,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0 ...@@ -278,8 +278,8 @@ TEXT runtime·madvise(SB),NOSPLIT,$0
RET RET
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8 TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVQ new+8(SP), DI // arg 1 - nss MOVQ new+0(FP), DI // arg 1 - nss
MOVQ old+16(SP), SI // arg 2 - oss MOVQ old+8(FP), SI // arg 2 - oss
MOVQ $288, AX // sys_sigaltstack MOVQ $288, AX // sys_sigaltstack
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
......
...@@ -178,8 +178,8 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0 ...@@ -178,8 +178,8 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0
RET RET
// save args // save args
MOVL ureg+4(SP), CX MOVL ureg+0(FP), CX
MOVL note+8(SP), DX MOVL note+4(FP), DX
// change stack // change stack
MOVL g_m(BX), BX MOVL g_m(BX), BX
......
...@@ -179,8 +179,8 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0 ...@@ -179,8 +179,8 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0
RET RET
// save args // save args
MOVQ ureg+8(SP), CX MOVQ ureg+0(FP), CX
MOVQ note+16(SP), DX MOVQ note+8(FP), DX
// change stack // change stack
MOVQ g_m(BX), BX MOVQ g_m(BX), BX
......
...@@ -309,7 +309,7 @@ TEXT runtime·callbackasm1+0(SB),NOSPLIT,$0 ...@@ -309,7 +309,7 @@ TEXT runtime·callbackasm1+0(SB),NOSPLIT,$0
// void tstart(M *newm); // void tstart(M *newm);
TEXT runtime·tstart(SB),NOSPLIT,$0 TEXT runtime·tstart(SB),NOSPLIT,$0
MOVL newm+4(SP), CX // m MOVL newm+0(FP), CX // m
MOVL m_g0(CX), DX // g MOVL m_g0(CX), DX // g
// Layout new m scheduler stack on os stack. // Layout new m scheduler stack on os stack.
...@@ -337,7 +337,7 @@ TEXT runtime·tstart(SB),NOSPLIT,$0 ...@@ -337,7 +337,7 @@ TEXT runtime·tstart(SB),NOSPLIT,$0
// uint32 tstart_stdcall(M *newm); // uint32 tstart_stdcall(M *newm);
TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0 TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0
MOVL newm+4(SP), BX MOVL newm+0(FP), BX
PUSHL BX PUSHL BX
CALL runtime·tstart(SB) CALL runtime·tstart(SB)
......
...@@ -11,124 +11,123 @@ ...@@ -11,124 +11,123 @@
// func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr) // func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW syscall+4(SP), R12 MOVW syscall+0(FP), R12
MOVW a1+8(SP), R0 MOVW a1+4(FP), R0
MOVW a2+12(SP), R1 MOVW a2+8(FP), R1
MOVW a3+16(SP), R2 MOVW a3+12(FP), R2
SWI $0x80 SWI $0x80
BCC ok BCC ok
MOVW $-1, R1 MOVW $-1, R1
MOVW R1, r1+20(SP) // r1 MOVW R1, r1+16(FP) // r1
MOVW $0, R2 MOVW $0, R2
MOVW R2, r2+24(SP) // r2 MOVW R2, r2+20(FP) // r2
MOVW R0, errno+28(SP) // errno MOVW R0, errno+24(FP) // errno
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
ok: ok:
MOVW R0, r1+20(SP) // r1 MOVW R0, r1+16(FP) // r1
MOVW R1, r2+24(SP) // r2 MOVW R1, r2+20(FP) // r2
MOVW $0, R0 MOVW $0, R0
MOVW R0, errno+28(SP) // errno MOVW R0, errno+24(FP) // errno
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr) // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
MOVW syscall+4(SP), R12 // syscall entry MOVW syscall+0(FP), R12 // syscall entry
MOVW a1+8(SP), R0 MOVW a1+4(FP), R0
MOVW a2+12(SP), R1 MOVW a2+8(FP), R1
MOVW a3+16(SP), R2 MOVW a3+12(FP), R2
SWI $0x80 SWI $0x80
BCC ok1 BCC ok1
MOVW $-1, R1 MOVW $-1, R1
MOVW R1, r1+20(SP) // r1 MOVW R1, r1+16(FP) // r1
MOVW $0, R2 MOVW $0, R2
MOVW R2, r2+24(SP) // r2 MOVW R2, r2+20(FP) // r2
MOVW R0, errno+28(SP) // errno MOVW R0, errno+24(FP) // errno
RET RET
ok1: ok1:
MOVW R0, r1+20(SP) // r1 MOVW R0, r1+16(FP) // r1
MOVW R1, r2+24(SP) // r2 MOVW R1, r2+20(FP) // r2
MOVW $0, R0 MOVW $0, R0
MOVW R0, errno+28(SP) // errno MOVW R0, errno+24(FP) // errno
RET RET
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW syscall+4(SP), R12 // syscall entry MOVW syscall+0(FP), R12 // syscall entry
MOVW a1+8(SP), R0 MOVW a1+4(FP), R0
MOVW a2+12(SP), R1 MOVW a2+8(FP), R1
MOVW a3+16(SP), R2 MOVW a3+12(FP), R2
MOVW a4+20(SP), R3 MOVW a4+16(FP), R3
MOVW a5+24(SP), R4 MOVW a5+20(FP), R4
MOVW a6+28(SP), R5 MOVW a6+24(FP), R5
SWI $0x80 SWI $0x80
BCC ok6 BCC ok6
MOVW $-1, R1 MOVW $-1, R1
MOVW R1, r1+32(SP) // r1 MOVW R1, r1+28(FP) // r1
MOVW $0, R2 MOVW $0, R2
MOVW R2, r2+36(SP) // r2 MOVW R2, r2+32(FP) // r2
MOVW R0, errno+40(SP) // errno MOVW R0, errno+36(FP) // errno
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
ok6: ok6:
MOVW R0, r1+32(SP) // r1 MOVW R0, r1+28(FP) // r1
MOVW R1, r2+36(SP) // r2 MOVW R1, r2+32(FP) // r2
MOVW $0, R0 MOVW $0, R0
MOVW R0, errno+40(SP) // errno MOVW R0, errno+36(FP) // errno
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) // func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
MOVW trap+4(SP), R12 // syscall entry MOVW trap+0(FP), R12 // syscall entry
MOVW a1+8(SP), R0 MOVW a1+4(FP), R0
MOVW a2+12(SP), R1 MOVW a2+8(FP), R1
MOVW a3+16(SP), R2 MOVW a3+12(FP), R2
MOVW a4+20(SP), R3 MOVW a4+16(FP), R3
MOVW a5+24(SP), R4 MOVW a5+20(FP), R4
MOVW a6+28(SP), R5 MOVW a6+24(FP), R5
SWI $0x80 SWI $0x80
BCC ok2 BCC ok2
MOVW $-1, R1 MOVW $-1, R1
MOVW R1, r1+32(SP) // r1 MOVW R1, r1+28(FP) // r1
MOVW $0, R2 MOVW $0, R2
MOVW R2, r2+36(SP) // r2 MOVW R2, r2+32(FP) // r2
MOVW R0, errno+40(SP) // errno MOVW R0, errno+36(FP) // errno
RET RET
ok2: ok2:
MOVW R0, r1+32(SP) // r1 MOVW R0, r1+28(FP) // r1
MOVW R1, r2+36(SP) // r2 MOVW R1, r2+32(FP) // r2
MOVW $0, R0 MOVW $0, R0
MOVW R0, errno+40(SP) // errno MOVW R0, errno+36(FP) // errno
RET RET
// Actually Syscall7. // Actually Syscall7.
TEXT ·Syscall9(SB),NOSPLIT,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW syscall+4(SP), R12 // syscall entry MOVW syscall+0(FP), R12 // syscall entry
MOVW a1+8(SP), R0 MOVW a1+4(FP), R0
MOVW a2+12(SP), R1 MOVW a2+8(FP), R1
MOVW a3+16(SP), R2 MOVW a3+12(FP), R2
MOVW a4+20(SP), R3 MOVW a4+16(FP), R3
MOVW a5+24(SP), R4 MOVW a5+20(FP), R4
MOVW a6+28(SP), R5 MOVW a6+24(FP), R5
MOVW a7+32(SP), R6 MOVW a7+28(FP), R6
SWI $0x80 SWI $0x80
BCC ok9 BCC ok9
MOVW $-1, R1 MOVW $-1, R1
MOVW R1, r1+44(SP) // r1 MOVW R1, r1+40(FP) // r1
MOVW $0, R2 MOVW $0, R2
MOVW R2, r2+48(SP) // r2 MOVW R2, r2+44(FP) // r2
MOVW R0, errno+52(SP) // errno MOVW R0, errno+48(FP) // errno
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
ok9: ok9:
MOVW R0, r1+44(SP) // r1 MOVW R0, r1+40(FP) // r1
MOVW R1, r2+48(SP) // r2 MOVW R1, r2+44(FP) // r2
MOVW $0, R0 MOVW $0, R0
MOVW R0, errno+52(SP) // errno MOVW R0, errno+48(FP) // errno
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
...@@ -29,8 +29,8 @@ TEXT ·Syscall(SB),NOSPLIT,$0-32 ...@@ -29,8 +29,8 @@ TEXT ·Syscall(SB),NOSPLIT,$0-32
MOVSL MOVSL
MOVSL MOVSL
INT $64 INT $64
MOVL AX, r1+20(SP) MOVL AX, r1+16(FP)
MOVL $0, r2+24(SP) MOVL $0, r2+20(FP)
CMPL AX, $-1 CMPL AX, $-1
JNE ok3 JNE ok3
...@@ -44,7 +44,7 @@ ok3: ...@@ -44,7 +44,7 @@ ok3:
LEAL runtime·emptystring(SB), SI LEAL runtime·emptystring(SB), SI
copyresult3: copyresult3:
LEAL err+28(SP), DI LEAL err+24(FP), DI
CLD CLD
MOVSL MOVSL
...@@ -67,8 +67,8 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-44 ...@@ -67,8 +67,8 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-44
MOVSL MOVSL
MOVSL MOVSL
INT $64 INT $64
MOVL AX, r1+32(SP) MOVL AX, r1+28(FP)
MOVL $0, r2+36(SP) MOVL $0, r2+32(FP)
CMPL AX, $-1 CMPL AX, $-1
JNE ok4 JNE ok4
...@@ -82,7 +82,7 @@ ok4: ...@@ -82,7 +82,7 @@ ok4:
LEAL runtime·emptystring(SB), SI LEAL runtime·emptystring(SB), SI
copyresult4: copyresult4:
LEAL err+40(SP), DI LEAL err+36(FP), DI
CLD CLD
MOVSL MOVSL
...@@ -101,9 +101,9 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-28 ...@@ -101,9 +101,9 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-28
MOVSL MOVSL
MOVSL MOVSL
INT $64 INT $64
MOVL AX, r1+20(SP) MOVL AX, r1+16(FP)
MOVL AX, r2+24(SP) MOVL AX, r2+20(FP)
MOVL AX, err+28(SP) MOVL AX, err+24(FP)
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
...@@ -119,17 +119,17 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 ...@@ -119,17 +119,17 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
MOVSL MOVSL
MOVSL MOVSL
INT $64 INT $64
MOVL AX, r1+32(SP) MOVL AX, r1+28(FP)
MOVL AX, r2+36(SP) MOVL AX, r2+32(FP)
MOVL AX, err+40(SP) MOVL AX, err+36(FP)
RET RET
#define SYS_SEEK 39 /* from zsysnum_plan9_386.go */ #define SYS_SEEK 39 /* from zsysnum_plan9_386.go */
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) //func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
TEXT ·seek(SB),NOSPLIT,$0-36 TEXT ·seek(SB),NOSPLIT,$0-36
LEAL newoffset+24(SP), AX LEAL newoffset+20(FP), AX
MOVL AX, placeholder+4(SP) MOVL AX, placeholder+0(FP)
MOVL $SYS_SEEK, AX // syscall entry MOVL $SYS_SEEK, AX // syscall entry
INT $64 INT $64
...@@ -149,7 +149,7 @@ ok6: ...@@ -149,7 +149,7 @@ ok6:
LEAL runtime·emptystring(SB), SI LEAL runtime·emptystring(SB), SI
copyresult6: copyresult6:
LEAL err+32(SP), DI LEAL err+28(FP), DI
CLD CLD
MOVSL MOVSL
......
...@@ -28,8 +28,8 @@ TEXT ·Syscall(SB),NOSPLIT,$0-64 ...@@ -28,8 +28,8 @@ TEXT ·Syscall(SB),NOSPLIT,$0-64
MOVSQ MOVSQ
MOVSQ MOVSQ
SYSCALL SYSCALL
MOVQ AX, r1+40(SP) MOVQ AX, r1+32(FP)
MOVQ $0, r2+48(SP) MOVQ $0, r2+40(FP)
CMPL AX, $-1 CMPL AX, $-1
JNE ok3 JNE ok3
...@@ -43,7 +43,7 @@ ok3: ...@@ -43,7 +43,7 @@ ok3:
LEAQ runtime·emptystring(SB), SI LEAQ runtime·emptystring(SB), SI
copyresult3: copyresult3:
LEAQ err+56(SP), DI LEAQ err+48(FP), DI
CLD CLD
MOVSQ MOVSQ
...@@ -66,8 +66,8 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-88 ...@@ -66,8 +66,8 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-88
MOVSQ MOVSQ
MOVSQ MOVSQ
SYSCALL SYSCALL
MOVQ AX, r1+64(SP) MOVQ AX, r1+56(FP)
MOVQ $0, r2+72(SP) MOVQ $0, r2+64(FP)
CMPL AX, $-1 CMPL AX, $-1
JNE ok4 JNE ok4
...@@ -81,7 +81,7 @@ ok4: ...@@ -81,7 +81,7 @@ ok4:
LEAQ runtime·emptystring(SB), SI LEAQ runtime·emptystring(SB), SI
copyresult4: copyresult4:
LEAQ err+80(SP), DI LEAQ err+72(FP), DI
CLD CLD
MOVSQ MOVSQ
...@@ -100,9 +100,9 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-56 ...@@ -100,9 +100,9 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-56
MOVSQ MOVSQ
MOVSQ MOVSQ
SYSCALL SYSCALL
MOVQ AX, r1+40(SP) MOVQ AX, r1+32(FP)
MOVQ AX, r2+48(SP) MOVQ AX, r2+40(FP)
MOVQ AX, err+56(SP) MOVQ AX, err+48(FP)
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
...@@ -118,24 +118,24 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 ...@@ -118,24 +118,24 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
MOVSQ MOVSQ
MOVSQ MOVSQ
SYSCALL SYSCALL
MOVQ AX, r1+64(SP) MOVQ AX, r1+56(FP)
MOVQ AX, r2+72(SP) MOVQ AX, r2+64(FP)
MOVQ AX, err+80(SP) MOVQ AX, err+72(FP)
RET RET
#define SYS_SEEK 39 /* from zsysnum_plan9_amd64.go */ #define SYS_SEEK 39 /* from zsysnum_plan9_amd64.go */
//func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) //func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string)
TEXT ·seek(SB),NOSPLIT,$0-56 TEXT ·seek(SB),NOSPLIT,$0-56
LEAQ newoffset+40(SP), AX LEAQ newoffset+32(FP), AX
MOVQ AX, placeholder+8(SP) MOVQ AX, placeholder+0(FP)
MOVQ $SYS_SEEK, BP // syscall entry MOVQ $SYS_SEEK, BP // syscall entry
SYSCALL SYSCALL
CMPL AX, $-1 CMPL AX, $-1
JNE ok6 JNE ok6
MOVQ $-1, newoffset+40(SP) MOVQ $-1, newoffset+32(FP)
SUBQ $16, SP SUBQ $16, SP
CALL syscall·errstr(SB) CALL syscall·errstr(SB)
...@@ -147,7 +147,7 @@ ok6: ...@@ -147,7 +147,7 @@ ok6:
LEAQ runtime·emptystring(SB), SI LEAQ runtime·emptystring(SB), SI
copyresult6: copyresult6:
LEAQ err+48(SP), DI LEAQ err+40(FP), DI
CLD CLD
MOVSQ MOVSQ
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment