Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18)

Unified Diff: unix/asm_darwin_386.s

Issue 124390043: code review 124390043: go.sys/unix: just jump to syscall.Syscall etc. (Closed)
Patch Set: diff -r fcb35749b21684f22dd11fb3b0a76908889b0863 https://code.google.com/p/go.sys Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | unix/asm_darwin_amd64.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unix/asm_darwin_386.s
===================================================================
--- a/unix/asm_darwin_386.s
+++ b/unix/asm_darwin_386.s
@@ -2,141 +2,26 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
-// so that go vet can check that they are correct.
-
#include "textflag.h"
//
// System call support for 386, Darwin
//
-// func Syscall(trap int32, a1, a2, a3 int32) (r1, r2, err int32);
-// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
-// Trap # in AX, args on stack above caller pc.
+// Just jump to package syscall's implementation for all these functions.
+// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-28
- CALL runtime·entersyscall(SB)
- MOVL 4(SP), AX // syscall entry
- // slide args down on top of system call number
- LEAL 8(SP), SI
- LEAL 4(SP), DI
- CLD
- MOVSL
- MOVSL
- MOVSL
- INT $0x80
- JAE ok
- MOVL $-1, 20(SP) // r1
- MOVL $-1, 24(SP) // r2
- MOVL AX, 28(SP) // errno
- CALL runtime·exitsyscall(SB)
- RET
-ok:
- MOVL AX, 20(SP) // r1
- MOVL DX, 24(SP) // r2
- MOVL $0, 28(SP) // errno
- CALL runtime·exitsyscall(SB)
- RET
+ JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-40
- CALL runtime·entersyscall(SB)
- MOVL 4(SP), AX // syscall entry
- // slide args down on top of system call number
- LEAL 8(SP), SI
- LEAL 4(SP), DI
- CLD
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- INT $0x80
- JAE ok6
- MOVL $-1, 32(SP) // r1
- MOVL $-1, 36(SP) // r2
- MOVL AX, 40(SP) // errno
- CALL runtime·exitsyscall(SB)
- RET
-ok6:
- MOVL AX, 32(SP) // r1
- MOVL DX, 36(SP) // r2
- MOVL $0, 40(SP) // errno
- CALL runtime·exitsyscall(SB)
- RET
+ JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-52
- CALL runtime·entersyscall(SB)
- MOVL 4(SP), AX // syscall entry
- // slide args down on top of system call number
- LEAL 8(SP), SI
- LEAL 4(SP), DI
- CLD
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- INT $0x80
- JAE ok9
- MOVL $-1, 44(SP) // r1
- MOVL $-1, 48(SP) // r2
- MOVL AX, 52(SP) // errno
- CALL runtime·exitsyscall(SB)
- RET
-ok9:
- MOVL AX, 44(SP) // r1
- MOVL DX, 48(SP) // r2
- MOVL $0, 52(SP) // errno
- CALL runtime·exitsyscall(SB)
- RET
+ JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
- MOVL 4(SP), AX // syscall entry
- // slide args down on top of system call number
- LEAL 8(SP), SI
- LEAL 4(SP), DI
- CLD
- MOVSL
- MOVSL
- MOVSL
- INT $0x80
- JAE ok1
- MOVL $-1, 20(SP) // r1
- MOVL $-1, 24(SP) // r2
- MOVL AX, 28(SP) // errno
- RET
-ok1:
- MOVL AX, 20(SP) // r1
- MOVL DX, 24(SP) // r2
- MOVL $0, 28(SP) // errno
- RET
+ JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
- MOVL 4(SP), AX // syscall entry
- // slide args down on top of system call number
- LEAL 8(SP), SI
- LEAL 4(SP), DI
- CLD
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- MOVSL
- INT $0x80
- JAE ok2
- MOVL $-1, 32(SP) // r1
- MOVL $-1, 36(SP) // r2
- MOVL AX, 40(SP) // errno
- RET
-ok2:
- MOVL AX, 32(SP) // r1
- MOVL DX, 36(SP) // r2
- MOVL $0, 40(SP) // errno
- RET
+ JMP syscall·RawSyscall6(SB)
« no previous file with comments | « no previous file | unix/asm_darwin_amd64.s » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b