1
// Copyright 2010 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
5
#include "zasm_GOOS_GOARCH.h"
7
// setldt(int entry, int address, int limit)
8
TEXT runtime·setldt(SB),7,$0
11
TEXT runtime·open(SB),7,$0
17
TEXT runtime·pread(SB),7,$0
23
TEXT runtime·pwrite(SB),7,$0
29
// int32 _seek(int64*, int32, int64, int32)
36
// int64 seek(int32, int64, int32)
37
TEXT runtime·seek(SB),7,$56
44
MOVQ whence+16(FP), CX
53
TEXT runtime·close(SB),7,$0
59
TEXT runtime·exits(SB),7,$0
65
TEXT runtime·brk_(SB),7,$0
71
TEXT runtime·sleep(SB),7,$0
77
TEXT runtime·plan9_semacquire(SB),7,$0
83
TEXT runtime·plan9_tsemacquire(SB),7,$0
89
TEXT runtime·notify(SB),7,$0
95
TEXT runtime·noted(SB),7,$0
101
TEXT runtime·plan9_semrelease(SB),7,$0
107
TEXT runtime·nanotime(SB),7,$0
113
TEXT runtime·rfork(SB),7,$0
115
MOVQ $19, BP // rfork
118
// In parent, return.
123
// In child on forked stack.
124
MOVQ mm+24(SP), BX // m
125
MOVQ gg+32(SP), DX // g
126
MOVQ fn+40(SP), SI // fn
128
// set SP to be on the new child stack
129
MOVQ stack+16(SP), CX
137
// Initialize AX from pid in TLS.
139
MOVQ AX, m_procid(BX) // save pid as m->procid
141
CALL runtime·stackcheck(SB) // smashes AX, CX
143
MOVQ 0(DX), DX // paranoia; check they are not nil
147
CALL runtime·exit(SB)
150
// This is needed by asm_amd64.s
151
TEXT runtime·settls(SB),7,$0
154
// void sigtramp(void *ureg, int8 *note)
155
TEXT runtime·sigtramp(SB),7,$0
158
// check that m exists
162
CALL runtime·badsignal(SB) // will exit
170
MOVQ m_gsignal(BX), R10
171
MOVQ g_stackbase(R10), BP
174
// make room for args and g
184
// load args and call sighandler
189
CALL runtime·sighandler(SB)
198
CALL runtime·noted(SB)
201
TEXT runtime·setfpmasks(SB),7,$8
210
#define ERRMAX 128 /* from os_plan9.h */
212
// func errstr() String
213
// Only used by package syscall.
214
// Grab error string due to a syscall made
215
// in entersyscall mode, without going
216
// through the allocator (issue 4994).
217
// See ../syscall/asm_plan9_386.s:/·Syscall/
218
TEXT runtime·errstr(SB),7,$0
221
MOVQ m_errstr(BX), CX
228
// syscall requires caller-save
233
CALL runtime·findnull(SB)