Commit b3de7f28 authored by Anthony Martin's avatar Anthony Martin

runtime: fix Plan 9 build for new C calling convention

LGTM=0intro, rsc
R=rsc, 0intro
CC=golang-codereviews
https://golang.org/cl/132320043
parent 13c69f03
...@@ -217,28 +217,29 @@ TEXT runtime·setfpmasks(SB),NOSPLIT,$0 ...@@ -217,28 +217,29 @@ TEXT runtime·setfpmasks(SB),NOSPLIT,$0
#define ERRMAX 128 /* from os_plan9.h */ #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. // Only used by package syscall.
// Grab error string due to a syscall made // Grab error string due to a syscall made
// in entersyscall mode, without going // in entersyscall mode, without going
// through the allocator (issue 4994). // through the allocator (issue 4994).
// See ../syscall/asm_plan9_386.s:/·Syscall/ // See ../syscall/asm_plan9_386.s:/·Syscall/
TEXT runtime·errstr(SB),NOSPLIT,$0 TEXT runtime·errstr(SB),NOSPLIT,$8-8
get_tls(AX) get_tls(AX)
MOVL g(AX), BX MOVL g(AX), BX
MOVL g_m(BX), BX MOVL g_m(BX), BX
MOVL m_errstr(BX), CX MOVL m_errstr(BX), CX
MOVL CX, ret_base+0(FP) MOVL CX, 0(SP)
MOVL $ERRMAX, ret_len+4(FP) MOVL $ERRMAX, 4(SP)
MOVL $41, AX CALL errstr<>(SB)
INT $64
// syscall requires caller-save
MOVL ret_base+0(FP), CX
// push the argument
PUSHL CX
CALL runtime·findnull(SB) CALL runtime·findnull(SB)
POPL CX MOVL 4(SP), AX
MOVL AX, ret_len+4(FP) MOVL AX, ret_len+4(FP)
MOVL 0(SP), AX
MOVL AX, ret_base+0(FP)
RET RET
...@@ -212,28 +212,29 @@ TEXT runtime·setfpmasks(SB),NOSPLIT,$8 ...@@ -212,28 +212,29 @@ TEXT runtime·setfpmasks(SB),NOSPLIT,$8
#define ERRMAX 128 /* from os_plan9.h */ #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. // Only used by package syscall.
// Grab error string due to a syscall made // Grab error string due to a syscall made
// in entersyscall mode, without going // in entersyscall mode, without going
// through the allocator (issue 4994). // through the allocator (issue 4994).
// See ../syscall/asm_plan9_386.s:/·Syscall/ // See ../syscall/asm_plan9_amd64.s:/·Syscall/
TEXT runtime·errstr(SB),NOSPLIT,$0 TEXT runtime·errstr(SB),NOSPLIT,$16-16
get_tls(AX) get_tls(AX)
MOVQ g(AX), BX MOVQ g(AX), BX
MOVQ g_m(BX), BX MOVQ g_m(BX), BX
MOVQ m_errstr(BX), CX MOVQ m_errstr(BX), CX
MOVQ CX, ret_base+0(FP) MOVQ CX, 0(SP)
MOVQ $ERRMAX, ret_len+8(FP) MOVQ $ERRMAX, 8(SP)
MOVQ $41, BP CALL errstr<>(SB)
SYSCALL
// syscall requires caller-save
MOVQ ret_base+0(FP), CX
// push the argument
PUSHQ CX
CALL runtime·findnull(SB) CALL runtime·findnull(SB)
POPQ CX MOVQ 8(SP), AX
MOVQ AX, ret_len+8(FP) MOVQ AX, ret_len+8(FP)
MOVQ 0(SP), AX
MOVQ AX, ret_base+0(FP)
RET RET
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