]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix Plan 9 build for new C calling convention
authorAnthony Martin <ality@pbrane.org>
Thu, 28 Aug 2014 23:02:15 +0000 (16:02 -0700)
committerAnthony Martin <ality@pbrane.org>
Thu, 28 Aug 2014 23:02:15 +0000 (16:02 -0700)
LGTM=0intro, rsc
R=rsc, 0intro
CC=golang-codereviews
https://golang.org/cl/132320043

src/pkg/runtime/sys_plan9_386.s
src/pkg/runtime/sys_plan9_amd64.s

index e40721d3420e258f144b74be05da6a42b13e8030..43fb367ed9aa88a2d0a03b7bfe7bdd6b60ddcb37 100644 (file)
@@ -217,28 +217,29 @@ TEXT runtime·setfpmasks(SB),NOSPLIT,$0
 
 #define ERRMAX 128     /* from os_plan9.h */
 
-// func errstr() String
+// void errstr(int8 *buf, int32 len)
+TEXT errstr<>(SB),NOSPLIT,$0
+       MOVL    $41, AX
+       INT     $64
+       RET
+
+// func errstr() string
 // Only used by package syscall.
 // Grab error string due to a syscall made
 // in entersyscall mode, without going
 // through the allocator (issue 4994).
 // See ../syscall/asm_plan9_386.s:/·Syscall/
-TEXT runtime·errstr(SB),NOSPLIT,$0
+TEXT runtime·errstr(SB),NOSPLIT,$8-8
        get_tls(AX)
        MOVL    g(AX), BX
        MOVL    g_m(BX), BX
        MOVL    m_errstr(BX), CX
-       MOVL    CX, ret_base+0(FP)
-       MOVL    $ERRMAX, ret_len+4(FP)
-       MOVL    $41, AX
-       INT     $64
-
-       // syscall requires caller-save
-       MOVL    ret_base+0(FP), CX
-
-       // push the argument
-       PUSHL   CX
+       MOVL    CX, 0(SP)
+       MOVL    $ERRMAX, 4(SP)
+       CALL    errstr<>(SB)
        CALL    runtime·findnull(SB)
-       POPL    CX
+       MOVL    4(SP), AX
        MOVL    AX, ret_len+4(FP)
+       MOVL    0(SP), AX
+       MOVL    AX, ret_base+0(FP)
        RET
index d83a57e2ac4fbc7d9d437bb73a7cebc7942418d0..ea0bd57b20ef29b4c66544093f38c9dd49704a79 100644 (file)
@@ -212,28 +212,29 @@ TEXT runtime·setfpmasks(SB),NOSPLIT,$8
 
 #define ERRMAX 128     /* from os_plan9.h */
 
-// func errstr() String
+// void errstr(int8 *buf, int32 len)
+TEXT errstr<>(SB),NOSPLIT,$0
+       MOVQ    $41, BP
+       SYSCALL
+       RET
+
+// func errstr() string
 // Only used by package syscall.
 // Grab error string due to a syscall made
 // in entersyscall mode, without going
 // through the allocator (issue 4994).
-// See ../syscall/asm_plan9_386.s:/·Syscall/
-TEXT runtime·errstr(SB),NOSPLIT,$0
+// See ../syscall/asm_plan9_amd64.s:/·Syscall/
+TEXT runtime·errstr(SB),NOSPLIT,$16-16
        get_tls(AX)
        MOVQ    g(AX), BX
        MOVQ    g_m(BX), BX
        MOVQ    m_errstr(BX), CX
-       MOVQ    CX, ret_base+0(FP)
-       MOVQ    $ERRMAX, ret_len+8(FP)
-       MOVQ    $41, BP
-       SYSCALL
-
-       // syscall requires caller-save
-       MOVQ    ret_base+0(FP), CX
-
-       // push the argument
-       PUSHQ   CX
+       MOVQ    CX, 0(SP)
+       MOVQ    $ERRMAX, 8(SP)
+       CALL    errstr<>(SB)
        CALL    runtime·findnull(SB)
-       POPQ    CX
+       MOVQ    8(SP), AX
        MOVQ    AX, ret_len+8(FP)
+       MOVQ    0(SP), AX
+       MOVQ    AX, ret_base+0(FP)
        RET