Commit 653fb6d8 authored by Russ Cox's avatar Russ Cox

liblink: make GO_ARGS the default for functions beginning with ·

If there is a leading ·, assume there is a Go prototype and
attach the Go prototype information to the function.
If the function is not called from Go and does not need a
Go prototype, it can be made file-local instead (using name<>(SB)).

This fixes the current BSD build failures, by giving functions like
sync/atomic.StoreUint32 argument stack map information.

Fixes #8753.

LGTM=khr, iant
R=golang-codereviews, iant, khr, bradfitz
CC=golang-codereviews, r, rlh
https://golang.org/cl/142150043
parent f1abe0d0
...@@ -125,7 +125,7 @@ static LSym *rdsym(Link*, Biobuf*, char*); ...@@ -125,7 +125,7 @@ static LSym *rdsym(Link*, Biobuf*, char*);
void void
writeobj(Link *ctxt, Biobuf *b) writeobj(Link *ctxt, Biobuf *b)
{ {
int flag; int flag, found;
Hist *h; Hist *h;
LSym *s, *text, *etext, *curtext, *data, *edata; LSym *s, *text, *etext, *curtext, *data, *edata;
Plist *pl; Plist *pl;
...@@ -252,6 +252,27 @@ writeobj(Link *ctxt, Biobuf *b) ...@@ -252,6 +252,27 @@ writeobj(Link *ctxt, Biobuf *b)
} }
} }
// Add reference to Go arguments for C or assembly functions without them.
for(s = text; s != nil; s = s->next) {
if(strncmp(s->name, "\"\".", 3) != 0)
continue;
found = 0;
for(p = s->text; p != nil; p = p->link) {
if(p->as == ctxt->arch->AFUNCDATA && p->from.type == ctxt->arch->D_CONST && p->from.offset == FUNCDATA_ArgsPointerMaps) {
found = 1;
break;
}
}
if(!found) {
p = appendp(ctxt, s->text);
p->as = ctxt->arch->AFUNCDATA;
p->from.type = ctxt->arch->D_CONST;
p->from.offset = FUNCDATA_ArgsPointerMaps;
p->to.type = ctxt->arch->D_EXTERN;
p->to.sym = linklookup(ctxt, smprint("%s.args_stackmap", s->name), s->version);
}
}
// Turn functions into machine code images. // Turn functions into machine code images.
for(s = text; s != nil; s = s->next) { for(s = text; s != nil; s = s->next) {
mkfwd(s); mkfwd(s);
......
...@@ -646,15 +646,13 @@ TEXT gosave<>(SB),NOSPLIT,$0 ...@@ -646,15 +646,13 @@ TEXT gosave<>(SB),NOSPLIT,$0
// Call fn(arg) on the scheduler stack, // Call fn(arg) on the scheduler stack,
// aligned appropriately for the gcc ABI. // aligned appropriately for the gcc ABI.
// See cgocall.c for more details. // See cgocall.c for more details.
TEXT runtime·asmcgocall(SB),NOSPLIT,$0-8 TEXT ·asmcgocall(SB),NOSPLIT,$0-8
GO_ARGS
MOVL fn+0(FP), AX MOVL fn+0(FP), AX
MOVL arg+4(FP), BX MOVL arg+4(FP), BX
CALL asmcgocall<>(SB) CALL asmcgocall<>(SB)
RET RET
TEXT runtime·asmcgocall_errno(SB),NOSPLIT,$0-12 TEXT ·asmcgocall_errno(SB),NOSPLIT,$0-12
GO_ARGS
MOVL fn+0(FP), AX MOVL fn+0(FP), AX
MOVL arg+4(FP), BX MOVL arg+4(FP), BX
CALL asmcgocall<>(SB) CALL asmcgocall<>(SB)
...@@ -714,8 +712,7 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$12-12 ...@@ -714,8 +712,7 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$12-12
// cgocallback_gofunc(FuncVal*, void *frame, uintptr framesize) // cgocallback_gofunc(FuncVal*, void *frame, uintptr framesize)
// See cgocall.c for more details. // See cgocall.c for more details.
TEXT runtime·cgocallback_gofunc(SB),NOSPLIT,$12-12 TEXT ·cgocallback_gofunc(SB),NOSPLIT,$12-12
GO_ARGS
NO_LOCAL_POINTERS NO_LOCAL_POINTERS
// If g is nil, Go did not create the current thread. // If g is nil, Go did not create the current thread.
......
...@@ -623,15 +623,13 @@ TEXT gosave<>(SB),NOSPLIT,$0 ...@@ -623,15 +623,13 @@ TEXT gosave<>(SB),NOSPLIT,$0
// Call fn(arg) on the scheduler stack, // Call fn(arg) on the scheduler stack,
// aligned appropriately for the gcc ABI. // aligned appropriately for the gcc ABI.
// See cgocall.c for more details. // See cgocall.c for more details.
TEXT runtime·asmcgocall(SB),NOSPLIT,$0-16 TEXT ·asmcgocall(SB),NOSPLIT,$0-16
GO_ARGS
MOVQ fn+0(FP), AX MOVQ fn+0(FP), AX
MOVQ arg+8(FP), BX MOVQ arg+8(FP), BX
CALL asmcgocall<>(SB) CALL asmcgocall<>(SB)
RET RET
TEXT runtime·asmcgocall_errno(SB),NOSPLIT,$0-20 TEXT ·asmcgocall_errno(SB),NOSPLIT,$0-20
GO_ARGS
MOVQ fn+0(FP), AX MOVQ fn+0(FP), AX
MOVQ arg+8(FP), BX MOVQ arg+8(FP), BX
CALL asmcgocall<>(SB) CALL asmcgocall<>(SB)
...@@ -700,8 +698,7 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$24-24 ...@@ -700,8 +698,7 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$24-24
// cgocallback_gofunc(FuncVal*, void *frame, uintptr framesize) // cgocallback_gofunc(FuncVal*, void *frame, uintptr framesize)
// See cgocall.c for more details. // See cgocall.c for more details.
TEXT runtime·cgocallback_gofunc(SB),NOSPLIT,$8-24 TEXT ·cgocallback_gofunc(SB),NOSPLIT,$8-24
GO_ARGS
NO_LOCAL_POINTERS NO_LOCAL_POINTERS
// If g is nil, Go did not create the current thread. // If g is nil, Go did not create the current thread.
......
...@@ -480,15 +480,13 @@ TEXT gosave<>(SB),NOSPLIT,$0 ...@@ -480,15 +480,13 @@ TEXT gosave<>(SB),NOSPLIT,$0
// Call fn(arg) on the scheduler stack, // Call fn(arg) on the scheduler stack,
// aligned appropriately for the gcc ABI. // aligned appropriately for the gcc ABI.
// See cgocall.c for more details. // See cgocall.c for more details.
TEXT runtime·asmcgocall(SB),NOSPLIT,$0-8 TEXT ·asmcgocall(SB),NOSPLIT,$0-8
GO_ARGS
MOVW fn+0(FP), R1 MOVW fn+0(FP), R1
MOVW arg+4(FP), R0 MOVW arg+4(FP), R0
BL asmcgocall<>(SB) BL asmcgocall<>(SB)
RET RET
TEXT runtime·asmcgocall_errno(SB),NOSPLIT,$0-12 TEXT ·asmcgocall_errno(SB),NOSPLIT,$0-12
GO_ARGS
MOVW fn+0(FP), R1 MOVW fn+0(FP), R1
MOVW arg+4(FP), R0 MOVW arg+4(FP), R0
BL asmcgocall<>(SB) BL asmcgocall<>(SB)
...@@ -551,8 +549,7 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$12-12 ...@@ -551,8 +549,7 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$12-12
// cgocallback_gofunc(void (*fn)(void*), void *frame, uintptr framesize) // cgocallback_gofunc(void (*fn)(void*), void *frame, uintptr framesize)
// See cgocall.c for more details. // See cgocall.c for more details.
TEXT runtime·cgocallback_gofunc(SB),NOSPLIT,$8-12 TEXT ·cgocallback_gofunc(SB),NOSPLIT,$8-12
GO_ARGS
NO_LOCAL_POINTERS NO_LOCAL_POINTERS
// Load m and g from thread-local storage. // Load m and g from thread-local storage.
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -70,7 +68,6 @@ ok6: ...@@ -70,7 +68,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -101,7 +98,6 @@ ok9: ...@@ -101,7 +98,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -123,7 +119,6 @@ ok1: ...@@ -123,7 +119,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
// Trap # in AX, args in DI SI DX, return in AX DX // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),NOSPLIT,$0-56 TEXT ·Syscall(SB),NOSPLIT,$0-56
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80 TEXT ·Syscall6(SB),NOSPLIT,$0-80
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -67,7 +65,6 @@ ok6: ...@@ -67,7 +65,6 @@ ok6:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -89,7 +86,6 @@ ok1: ...@@ -89,7 +86,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),NOSPLIT,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -39,7 +38,6 @@ ok: ...@@ -39,7 +38,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -67,7 +65,6 @@ ok6: ...@@ -67,7 +65,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-56 TEXT ·Syscall9(SB),NOSPLIT,$0-56
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -98,7 +95,6 @@ ok9: ...@@ -98,7 +95,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-32 TEXT ·RawSyscall(SB),NOSPLIT,$0-32
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -120,7 +116,6 @@ ok1: ...@@ -120,7 +116,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-44 TEXT ·RawSyscall6(SB),NOSPLIT,$0-44
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
// Trap # in AX, args in DI SI DX, return in AX DX // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),NOSPLIT,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -39,7 +38,6 @@ ok: ...@@ -39,7 +38,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -63,7 +61,6 @@ ok6: ...@@ -63,7 +61,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-112 TEXT ·Syscall9(SB),NOSPLIT,$0-112
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX MOVQ 8(SP), AX
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -97,7 +94,6 @@ ok9: ...@@ -97,7 +94,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-64 TEXT ·RawSyscall(SB),NOSPLIT,$0-64
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -118,7 +114,6 @@ ok1: ...@@ -118,7 +114,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -70,7 +68,6 @@ ok6: ...@@ -70,7 +68,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -101,7 +98,6 @@ ok9: ...@@ -101,7 +98,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -123,7 +119,6 @@ ok1: ...@@ -123,7 +119,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
// Trap # in AX, args in DI SI DX, return in AX DX // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),NOSPLIT,$0-56 TEXT ·Syscall(SB),NOSPLIT,$0-56
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -47,7 +46,6 @@ ok: ...@@ -47,7 +46,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80 TEXT ·Syscall6(SB),NOSPLIT,$0-80
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -71,7 +69,6 @@ ok6: ...@@ -71,7 +69,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-104 TEXT ·Syscall9(SB),NOSPLIT,$0-104
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX MOVQ 8(SP), AX
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -105,7 +102,6 @@ ok9: ...@@ -105,7 +102,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -126,7 +122,6 @@ ok1: ...@@ -126,7 +122,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, errno uintptr) // func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, errno uintptr)
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R7 // syscall number MOVW 0(FP), R7 // syscall number
MOVW 4(FP), R0 // a1 MOVW 4(FP), R0 // a1
...@@ -37,7 +36,6 @@ error: ...@@ -37,7 +36,6 @@ error:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R7 // syscall number MOVW 0(FP), R7 // syscall number
MOVW 4(FP), R0 // a1 MOVW 4(FP), R0 // a1
...@@ -64,7 +62,6 @@ error6: ...@@ -64,7 +62,6 @@ error6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R7 // syscall number MOVW 0(FP), R7 // syscall number
MOVW 4(FP), R0 // a1 MOVW 4(FP), R0 // a1
...@@ -91,7 +88,6 @@ error9: ...@@ -91,7 +88,6 @@ error9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
GO_ARGS
MOVW 0(FP), R7 // syscall number MOVW 0(FP), R7 // syscall number
MOVW 4(FP), R0 // a1 MOVW 4(FP), R0 // a1
MOVW 8(FP), R1 // a2 MOVW 8(FP), R1 // a2
...@@ -111,7 +107,6 @@ errorr: ...@@ -111,7 +107,6 @@ errorr:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVW 0(FP), R7 // syscall number MOVW 0(FP), R7 // syscall number
MOVW 4(FP), R0 // a1 MOVW 4(FP), R0 // a1
MOVW 8(FP), R1 // a2 MOVW 8(FP), R1 // a2
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
// Trap # in AX, args in BX CX DX SI DI, return in AX // Trap # in AX, args in BX CX DX SI DI, return in AX
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
// 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
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
...@@ -69,7 +67,6 @@ ok6: ...@@ -69,7 +67,6 @@ ok6:
// 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
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
MOVL 12(SP), CX MOVL 12(SP), CX
...@@ -92,7 +89,6 @@ ok1: ...@@ -92,7 +89,6 @@ ok1:
// 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
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
MOVL 12(SP), CX MOVL 12(SP), CX
...@@ -119,7 +115,6 @@ ok2: ...@@ -119,7 +115,6 @@ ok2:
// func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) // func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int)
// Kernel interface gets call sub-number and pointer to a0. // Kernel interface gets call sub-number and pointer to a0.
TEXT ·socketcall(SB),NOSPLIT,$0-36 TEXT ·socketcall(SB),NOSPLIT,$0-36
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL $SYS_SOCKETCALL, AX // syscall entry MOVL $SYS_SOCKETCALL, AX // syscall entry
MOVL 4(SP), BX // socket call number MOVL 4(SP), BX // socket call number
...@@ -144,7 +139,6 @@ oksock: ...@@ -144,7 +139,6 @@ oksock:
// func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) // func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int)
// Kernel interface gets call sub-number and pointer to a0. // Kernel interface gets call sub-number and pointer to a0.
TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
GO_ARGS
MOVL $SYS_SOCKETCALL, AX // syscall entry MOVL $SYS_SOCKETCALL, AX // syscall entry
MOVL 4(SP), BX // socket call number MOVL 4(SP), BX // socket call number
LEAL 8(SP), CX // pointer to call arguments LEAL 8(SP), CX // pointer to call arguments
...@@ -170,7 +164,6 @@ oksock1: ...@@ -170,7 +164,6 @@ oksock1:
// Underlying system call is // Underlying system call is
// llseek(int fd, int offhi, int offlo, int64 *result, int whence) // llseek(int fd, int offhi, int offlo, int64 *result, int whence)
TEXT ·seek(SB),NOSPLIT,$0-28 TEXT ·seek(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL $SYS__LLSEEK, AX // syscall entry MOVL $SYS__LLSEEK, AX // syscall entry
MOVL 4(SP), BX // fd MOVL 4(SP), BX // fd
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
// would pass 4th arg in CX, not R10. // would pass 4th arg in CX, not R10.
TEXT ·Syscall(SB),NOSPLIT,$0-56 TEXT ·Syscall(SB),NOSPLIT,$0-56
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -44,7 +43,6 @@ ok: ...@@ -44,7 +43,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80 TEXT ·Syscall6(SB),NOSPLIT,$0-80
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
...@@ -70,7 +68,6 @@ ok6: ...@@ -70,7 +68,6 @@ ok6:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -93,7 +90,6 @@ ok1: ...@@ -93,7 +90,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -116,7 +112,6 @@ ok2: ...@@ -116,7 +112,6 @@ ok2:
RET RET
TEXT ·gettimeofday(SB),NOSPLIT,$0-16 TEXT ·gettimeofday(SB),NOSPLIT,$0-16
GO_ARGS
MOVQ 8(SP), DI MOVQ 8(SP), DI
MOVQ $0, SI MOVQ $0, SI
MOVQ runtime·__vdso_gettimeofday_sym(SB), AX MOVQ runtime·__vdso_gettimeofday_sym(SB), AX
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// 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
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 4(SP), R7 MOVW 4(SP), R7
MOVW 8(SP), R0 MOVW 8(SP), R0
...@@ -46,7 +45,6 @@ ok: ...@@ -46,7 +45,6 @@ ok:
// 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);
// Actually Syscall5 but the rest of the code expects it to be named Syscall6. // Actually Syscall5 but the rest of the code expects it to be named Syscall6.
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
...@@ -78,7 +76,6 @@ ok6: ...@@ -78,7 +76,6 @@ ok6:
// 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);
// Actually RawSyscall5 but the rest of the code expects it to be named RawSyscall6. // Actually RawSyscall5 but the rest of the code expects it to be named RawSyscall6.
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
MOVW 12(SP), R1 MOVW 12(SP), R1
...@@ -111,7 +108,6 @@ ok2: ...@@ -111,7 +108,6 @@ ok2:
// Underlying system call is // Underlying system call is
// llseek(int fd, int offhi, int offlo, int64 *result, int whence) // llseek(int fd, int offhi, int offlo, int64 *result, int whence)
TEXT ·seek(SB),NOSPLIT,$0-32 TEXT ·seek(SB),NOSPLIT,$0-32
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW $SYS__LLSEEK, R7 // syscall entry MOVW $SYS__LLSEEK, R7 // syscall entry
MOVW 4(SP), R0 // fd MOVW 4(SP), R0 // fd
...@@ -139,7 +135,6 @@ okseek: ...@@ -139,7 +135,6 @@ okseek:
// 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
GO_ARGS
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
MOVW 12(SP), R1 MOVW 12(SP), R1
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
MOVL $(0x10000 + ((code)<<5)), AX; JMP AX MOVL $(0x10000 + ((code)<<5)), AX; JMP AX
TEXT syscall·Syscall(SB),NOSPLIT,$12-28 TEXT syscall·Syscall(SB),NOSPLIT,$12-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL trap+0(FP), AX MOVL trap+0(FP), AX
MOVL a1+4(FP), BX MOVL a1+4(FP), BX
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
MOVL $(0x10000 + ((code)<<5)), AX; JMP AX MOVL $(0x10000 + ((code)<<5)), AX; JMP AX
TEXT syscall·Syscall(SB),NOSPLIT,$0-28 TEXT syscall·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL trap+0(FP), AX MOVL trap+0(FP), AX
MOVL a1+4(FP), DI MOVL a1+4(FP), DI
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
MOVW $(0x10000 + ((code)<<5)), R8; B (R8) MOVW $(0x10000 + ((code)<<5)), R8; B (R8)
TEXT syscall·Syscall(SB),NOSPLIT,$0-28 TEXT syscall·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW trap+0(FP), R8 MOVW trap+0(FP), R8
MOVW a1+4(FP), R0 MOVW a1+4(FP), R0
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -70,7 +68,6 @@ ok6: ...@@ -70,7 +68,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -101,7 +98,6 @@ ok9: ...@@ -101,7 +98,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -123,7 +119,6 @@ ok1: ...@@ -123,7 +119,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
// Trap # in AX, args in DI SI DX, return in AX DX // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),NOSPLIT,$0-56 TEXT ·Syscall(SB),NOSPLIT,$0-56
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80 TEXT ·Syscall6(SB),NOSPLIT,$0-80
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -66,7 +64,6 @@ ok6: ...@@ -66,7 +64,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-104 TEXT ·Syscall9(SB),NOSPLIT,$0-104
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -99,7 +96,6 @@ ok9: ...@@ -99,7 +96,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -120,7 +116,6 @@ ok1: ...@@ -120,7 +116,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
// func Syscall9(trap int32, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int32) // func Syscall9(trap int32, a1, a2, a3, a4, a5, a6, a7, a8, a9 int64) (r1, r2, err int32)
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -37,7 +36,6 @@ error: ...@@ -37,7 +36,6 @@ error:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -63,7 +61,6 @@ error6: ...@@ -63,7 +61,6 @@ error6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
GO_ARGS
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
...@@ -89,7 +86,6 @@ error9: ...@@ -89,7 +86,6 @@ error9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
GO_ARGS
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
MOVW 8(FP), R2 // a2 MOVW 8(FP), R2 // a2
...@@ -109,7 +105,6 @@ errorr: ...@@ -109,7 +105,6 @@ errorr:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVW 0(FP), R0 // sigcall num MOVW 0(FP), R0 // sigcall num
MOVW 4(FP), R1 // a1 MOVW 4(FP), R1 // a1
MOVW 8(FP), R2 // a2 MOVW 8(FP), R2 // a2
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),NOSPLIT,$0-28 TEXT ·Syscall(SB),NOSPLIT,$0-28
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall6(SB),NOSPLIT,$0-40
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -70,7 +68,6 @@ ok6: ...@@ -70,7 +68,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-52 TEXT ·Syscall9(SB),NOSPLIT,$0-52
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -101,7 +98,6 @@ ok9: ...@@ -101,7 +98,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -123,7 +119,6 @@ ok1: ...@@ -123,7 +119,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
// Trap # in AX, args in DI SI DX, return in AX DX // Trap # in AX, args in DI SI DX, return in AX DX
TEXT ·Syscall(SB),NOSPLIT,$0-56 TEXT ·Syscall(SB),NOSPLIT,$0-56
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -42,7 +41,6 @@ ok: ...@@ -42,7 +41,6 @@ ok:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-80 TEXT ·Syscall6(SB),NOSPLIT,$0-80
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -66,7 +64,6 @@ ok6: ...@@ -66,7 +64,6 @@ ok6:
RET RET
TEXT ·Syscall9(SB),NOSPLIT,$0-104 TEXT ·Syscall9(SB),NOSPLIT,$0-104
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), AX // syscall entry MOVQ 8(SP), AX // syscall entry
MOVQ 16(SP), DI MOVQ 16(SP), DI
...@@ -99,7 +96,6 @@ ok9: ...@@ -99,7 +96,6 @@ ok9:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
...@@ -120,7 +116,6 @@ ok1: ...@@ -120,7 +116,6 @@ ok1:
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
GO_ARGS
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT ·Syscall(SB),NOSPLIT,$0-32 TEXT ·Syscall(SB),NOSPLIT,$0-32
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -55,7 +54,6 @@ copyresult3: ...@@ -55,7 +54,6 @@ copyresult3:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-44 TEXT ·Syscall6(SB),NOSPLIT,$0-44
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -94,7 +92,6 @@ copyresult4: ...@@ -94,7 +92,6 @@ copyresult4:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 TEXT ·RawSyscall(SB),NOSPLIT,$0-28
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -110,7 +107,6 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-28 ...@@ -110,7 +107,6 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-28
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
GO_ARGS
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI
...@@ -132,7 +128,6 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 ...@@ -132,7 +128,6 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
//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
GO_ARGS
LEAL newoffset+24(SP), AX LEAL newoffset+24(SP), AX
MOVL AX, placeholder+4(SP) MOVL AX, placeholder+4(SP)
...@@ -164,7 +159,6 @@ copyresult6: ...@@ -164,7 +159,6 @@ copyresult6:
//func exit(code int) //func exit(code int)
// Import runtime·exit for cleanly exiting. // Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),NOSPLIT,$4-4 TEXT ·exit(SB),NOSPLIT,$4-4
GO_ARGS
NO_LOCAL_POINTERS NO_LOCAL_POINTERS
MOVL code+0(FP), AX MOVL code+0(FP), AX
MOVL AX, 0(SP) MOVL AX, 0(SP)
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
//func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) //func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
TEXT ·Syscall(SB),NOSPLIT,$0-64 TEXT ·Syscall(SB),NOSPLIT,$0-64
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -54,7 +53,6 @@ copyresult3: ...@@ -54,7 +53,6 @@ copyresult3:
RET RET
TEXT ·Syscall6(SB),NOSPLIT,$0-88 TEXT ·Syscall6(SB),NOSPLIT,$0-88
GO_ARGS
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
...@@ -93,7 +91,6 @@ copyresult4: ...@@ -93,7 +91,6 @@ copyresult4:
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 TEXT ·RawSyscall(SB),NOSPLIT,$0-56
GO_ARGS
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAQ 16(SP), SI LEAQ 16(SP), SI
...@@ -109,7 +106,6 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-56 ...@@ -109,7 +106,6 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0-56
RET RET
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
GO_ARGS
MOVQ 8(SP), BP // syscall entry MOVQ 8(SP), BP // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAQ 16(SP), SI LEAQ 16(SP), SI
...@@ -131,7 +127,6 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 ...@@ -131,7 +127,6 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
//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
GO_ARGS
LEAQ newoffset+40(SP), AX LEAQ newoffset+40(SP), AX
MOVQ AX, placeholder+8(SP) MOVQ AX, placeholder+8(SP)
...@@ -162,7 +157,6 @@ copyresult6: ...@@ -162,7 +157,6 @@ copyresult6:
//func exit(code int) //func exit(code int)
// Import runtime·exit for cleanly exiting. // Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),NOSPLIT,$8-8 TEXT ·exit(SB),NOSPLIT,$8-8
GO_ARGS
NO_LOCAL_POINTERS NO_LOCAL_POINTERS
MOVQ code+0(FP), AX MOVQ code+0(FP), AX
MOVQ AX, 0(SP) MOVQ AX, 0(SP)
......
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log"
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
...@@ -190,7 +191,6 @@ func main() { ...@@ -190,7 +191,6 @@ func main() {
return return
} }
defer os.RemoveAll(dir) defer os.RemoveAll(dir)
ioutil.WriteFile(filepath.Join(dir, "main.go"), []byte("package main\nfunc main()\n"), 0666)
tests = strings.Replace(tests, "\t", " ", -1) tests = strings.Replace(tests, "\t", " ", -1)
tests = commentRE.ReplaceAllString(tests, "") tests = commentRE.ReplaceAllString(tests, "")
...@@ -230,6 +230,9 @@ TestCases: ...@@ -230,6 +230,9 @@ TestCases:
continue continue
} }
var gobuf bytes.Buffer
fmt.Fprintf(&gobuf, "package main\n")
var buf bytes.Buffer var buf bytes.Buffer
if goarch == "arm" { if goarch == "arm" {
fmt.Fprintf(&buf, "#define CALL BL\n#define REGISTER (R0)\n") fmt.Fprintf(&buf, "#define CALL BL\n#define REGISTER (R0)\n")
...@@ -277,11 +280,17 @@ TestCases: ...@@ -277,11 +280,17 @@ TestCases:
body = callRE.ReplaceAllString(body, "CALL ·$1(SB);") body = callRE.ReplaceAllString(body, "CALL ·$1(SB);")
body = callindRE.ReplaceAllString(body, "CALL REGISTER;") body = callindRE.ReplaceAllString(body, "CALL REGISTER;")
fmt.Fprintf(&gobuf, "func %s()\n", name)
fmt.Fprintf(&buf, "TEXT ·%s(SB)%s,$%d-0\n\t%s\n\tRET\n\n", name, nosplit, size, body) fmt.Fprintf(&buf, "TEXT ·%s(SB)%s,$%d-0\n\t%s\n\tRET\n\n", name, nosplit, size, body)
} }
} }
ioutil.WriteFile(filepath.Join(dir, "asm.s"), buf.Bytes(), 0666) if err := ioutil.WriteFile(filepath.Join(dir, "asm.s"), buf.Bytes(), 0666); err != nil {
log.Fatal(err)
}
if err := ioutil.WriteFile(filepath.Join(dir, "main.go"), gobuf.Bytes(), 0666); err != nil {
log.Fatal(err)
}
cmd := exec.Command("go", "build") cmd := exec.Command("go", "build")
cmd.Dir = dir cmd.Dir = dir
......
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