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

Delta Between Two Patch Sets: src/pkg/runtime/sys_plan9_amd64.s

Issue 6569068: code review 6569068: pkg/runtime: Plan 9: add support for recover() and pani... (Closed)
Left Patch Set: diff -r aa2f44cc25c0 https://go.googlecode.com/hg/ Created 11 years, 6 months ago
Right Patch Set: diff -r 5b5399bc3335 https://code.google.com/p/go Created 11 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/sys_plan9_386.s ('k') | src/pkg/runtime/thread_plan9.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2010 The Go Authors. All rights reserved. 1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #include "zasm_GOOS_GOARCH.h" 5 #include "zasm_GOOS_GOARCH.h"
6 6
7 // setldt(int entry, int address, int limit) 7 // setldt(int entry, int address, int limit)
8 TEXT runtime·setldt(SB),7,$0 8 TEXT runtime·setldt(SB),7,$0
9 RET 9 RET
10 10
11 TEXT runtime·open(SB),7,$0 11 TEXT runtime·open(SB),7,$0
12 MOVQ $0x8000, AX 12 MOVQ $0x8000, AX
13 MOVQ $14, BP 13 MOVQ $14, BP
14 SYSCALL 14 SYSCALL
15 RET 15 RET
16 16
17 TEXT runtime·pread(SB),7,$0 17 TEXT runtime·pread(SB),7,$0
18 MOVQ $0x8000, AX 18 MOVQ $0x8000, AX
19 MOVQ $50, BP 19 MOVQ $50, BP
20 SYSCALL 20 SYSCALL
21 RET 21 RET
22 22
23 TEXT runtime·pwrite(SB),7,$0 23 TEXT runtime·pwrite(SB),7,$0
24 MOVQ $0x8000, AX 24 MOVQ $0x8000, AX
25 MOVQ $51, BP 25 MOVQ $51, BP
26 SYSCALL 26 SYSCALL
27 RET
28
29 // int32 _seek(int64*, int32, int64, int32)
30 TEXT _seek<>(SB),7,$0
31 MOVQ $0x8000, AX
32 MOVQ $39, BP
33 SYSCALL
34 RET
35
36 // int64 seek(int32, int64, int32)
37 TEXT runtime·seek(SB),7,$56
38 LEAQ new+48(SP), CX
39 MOVQ CX, 0(SP)
40 MOVQ fd+0(FP), CX
41 MOVQ CX, 8(SP)
42 MOVQ off+8(FP), CX
43 MOVQ CX, 16(SP)
44 MOVQ whence+16(FP), CX
45 MOVQ CX, 24(SP)
46 CALL _seek<>(SB)
47 CMPL AX, $0
48 JGE 2(PC)
49 MOVQ $-1, new+48(SP)
50 MOVQ new+48(SP), AX
27 RET 51 RET
28 52
29 TEXT runtime·close(SB),7,$0 53 TEXT runtime·close(SB),7,$0
30 MOVQ $0x8000, AX 54 MOVQ $0x8000, AX
31 MOVQ $4, BP 55 MOVQ $4, BP
32 SYSCALL 56 SYSCALL
33 RET 57 RET
34 58
35 TEXT runtime·exits(SB),7,$0 59 TEXT runtime·exits(SB),7,$0
36 MOVQ $0x8000, AX 60 MOVQ $0x8000, AX
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 TEXT runtime·settls(SB),7,$0 145 TEXT runtime·settls(SB),7,$0
122 RET 146 RET
123 147
124 // void sigtramp(void *ureg, int8 *note) 148 // void sigtramp(void *ureg, int8 *note)
125 TEXT runtime·sigtramp(SB),7,$0 149 TEXT runtime·sigtramp(SB),7,$0
126 get_tls(AX) 150 get_tls(AX)
127 151
128 // check that m exists 152 // check that m exists
129 MOVQ m(AX), BX 153 MOVQ m(AX), BX
130 CMPQ BX, $0 154 CMPQ BX, $0
131 » JNE» 4(PC) 155 » JNE» 3(PC)
132 » MOVQ» $0, 8(SP)
133 CALL runtime·badsignal(SB) // will exit 156 CALL runtime·badsignal(SB) // will exit
134 RET 157 RET
135 158
136 // save args 159 // save args
137 MOVQ ureg+8(SP), CX 160 MOVQ ureg+8(SP), CX
138 MOVQ note+16(SP), DX 161 MOVQ note+16(SP), DX
139 162
140 // change stack 163 // change stack
141 MOVQ m_gsignal(BX), R10 164 MOVQ m_gsignal(BX), R10
142 MOVQ g_stackbase(R10), BP 165 MOVQ g_stackbase(R10), BP
143 MOVQ BP, SP 166 MOVQ BP, SP
144 167
145 // make room for args and g 168 // make room for args and g
146 » SUBQ» $90, SP 169 » SUBQ» $32, SP
147 170
148 // save g 171 // save g
149 MOVQ g(AX), BP 172 MOVQ g(AX), BP
150 » MOVQ» BP, 32(SP) 173 » MOVQ» BP, 24(SP)
151 174
152 // g = m->gsignal 175 // g = m->gsignal
153 MOVQ R10, g(AX) 176 MOVQ R10, g(AX)
154 177
155 // load args and call sighandler 178 // load args and call sighandler
156 MOVQ CX, 0(SP) 179 MOVQ CX, 0(SP)
157 MOVQ DX, 8(SP) 180 MOVQ DX, 8(SP)
158 MOVQ BP, 16(SP) 181 MOVQ BP, 16(SP)
159 182
160 CALL runtime·sighandler(SB) 183 CALL runtime·sighandler(SB)
161 184
162 // restore g 185 // restore g
163 get_tls(BX) 186 get_tls(BX)
164 » MOVQ» 32(SP), R10 187 » MOVQ» 24(SP), R10
165 MOVQ R10, g(BX) 188 MOVQ R10, g(BX)
166 189
167 // call noted(AX) 190 // call noted(AX)
168 MOVQ AX, 0(SP) 191 MOVQ AX, 0(SP)
169 CALL runtime·noted(SB) 192 CALL runtime·noted(SB)
170 RET 193 RET
194
195 TEXT runtime·setfpmasks(SB),7,$8
196 STMXCSR 0(SP)
197 MOVL 0(SP), AX
198 ANDL $~0x3F, AX
199 ORL $(0x3F<<7), AX
200 MOVL AX, 0(SP)
201 LDMXCSR 0(SP)
202 RET
LEFTRIGHT

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