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

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

Issue 6569068: code review 6569068: pkg/runtime: Plan 9: add support for recover() and pani... (Closed)
Left Patch Set: diff -r ff25343e334e 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/stack.h ('k') | src/pkg/runtime/sys_plan9_amd64.s » ('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 MOVL $14, AX 12 MOVL $14, AX
13 INT $64 13 INT $64
14 RET 14 RET
15 15
16 TEXT runtime·pread(SB),7,$0 16 TEXT runtime·pread(SB),7,$0
17 MOVL $50, AX 17 MOVL $50, AX
18 INT $64 18 INT $64
19 RET 19 RET
20 20
21 TEXT runtime·pwrite(SB),7,$0 21 TEXT runtime·pwrite(SB),7,$0
22 MOVL $51, AX 22 MOVL $51, AX
23 INT $64 23 INT $64
24 RET 24 RET
25 25
26 TEXT runtime·seek(SB),7,$0
27 MOVL $39, AX
28 INT $64
29 CMPL AX, $-1
30 JNE 4(PC)
31 MOVL a+0(FP), CX
32 MOVL AX, 0(CX)
33 MOVL AX, 4(CX)
34 RET
35
26 TEXT runtime·close(SB),7,$0 36 TEXT runtime·close(SB),7,$0
27 MOVL $4, AX 37 MOVL $4, AX
28 » INT» » $64 38 » INT» $64
29 RET 39 RET
30 40
31 TEXT runtime·exits(SB),7,$0 41 TEXT runtime·exits(SB),7,$0
32 MOVL $8, AX 42 MOVL $8, AX
33 INT $64 43 INT $64
34 RET 44 RET
35 45
36 TEXT runtime·brk_(SB),7,$0 46 TEXT runtime·brk_(SB),7,$0
37 MOVL $24, AX 47 MOVL $24, AX
38 INT $64 48 INT $64
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 94
85 // set SP to be on the new child stack 95 // set SP to be on the new child stack
86 MOVL stack+8(SP), CX 96 MOVL stack+8(SP), CX
87 MOVL CX, SP 97 MOVL CX, SP
88 98
89 // Initialize m, g. 99 // Initialize m, g.
90 get_tls(AX) 100 get_tls(AX)
91 MOVL DX, g(AX) 101 MOVL DX, g(AX)
92 MOVL BX, m(AX) 102 MOVL BX, m(AX)
93 103
94 » // Initialize AX from _tos->pid 104 » // Initialize AX from TOS struct.
95 » MOVL» _tos(SB), AX 105 » MOVL» procid(AX), AX
96 » MOVL» tos_pid(AX), AX
97 MOVL AX, m_procid(BX) // save pid as m->procid 106 MOVL AX, m_procid(BX) // save pid as m->procid
98 ········ 107 ········
99 CALL runtime·stackcheck(SB) // smashes AX, CX 108 CALL runtime·stackcheck(SB) // smashes AX, CX
100 ········ 109 ········
101 MOVL 0(DX), DX // paranoia; check they are not nil 110 MOVL 0(DX), DX // paranoia; check they are not nil
102 MOVL 0(BX), BX 111 MOVL 0(BX), BX
103 ········ 112 ········
104 // more paranoia; check that stack splitting code works 113 // more paranoia; check that stack splitting code works
105 PUSHL SI 114 PUSHL SI
106 CALL runtime·emptyfunc(SB) 115 CALL runtime·emptyfunc(SB)
107 POPL SI 116 POPL SI
108 ········ 117 ········
109 CALL SI // fn() 118 CALL SI // fn()
110 CALL runtime·exit(SB) 119 CALL runtime·exit(SB)
111 RET 120 RET
112 121
113 // void sigtramp(void *ureg, int8 *note) 122 // void sigtramp(void *ureg, int8 *note)
114 TEXT runtime·sigtramp(SB),7,$0 123 TEXT runtime·sigtramp(SB),7,$0
115 get_tls(AX) 124 get_tls(AX)
116 125
117 // check that m exists 126 // check that m exists
118 MOVL m(AX), BX 127 MOVL m(AX), BX
119 CMPL BX, $0 128 CMPL BX, $0
120 » JNE» 4(PC) 129 » JNE» 3(PC)
121 » MOVL» $0, 4(SP)
122 CALL runtime·badsignal(SB) // will exit 130 CALL runtime·badsignal(SB) // will exit
123 RET 131 RET
124 132
125 // save args 133 // save args
126 MOVL ureg+4(SP), CX 134 MOVL ureg+4(SP), CX
127 MOVL note+8(SP), DX 135 MOVL note+8(SP), DX
128 136
129 // change stack 137 // change stack
130 MOVL m_gsignal(BX), BP 138 MOVL m_gsignal(BX), BP
131 MOVL g_stackbase(BP), BP 139 MOVL g_stackbase(BP), BP
132 MOVL BP, SP 140 MOVL BP, SP
133 141
134 // make room for args and g 142 // make room for args and g
135 » SUBL» $90, SP 143 » SUBL» $16, SP
rsc 2012/10/06 22:22:38 90 is a strange choice, especially since it is not
akumar 2013/01/08 06:03:09 Yes; during testing, I chose an arbitrary large nu
136 144
137 // save g 145 // save g
138 MOVL g(AX), BP 146 MOVL g(AX), BP
139 » MOVL» BP, 20(SP) 147 » MOVL» BP, 12(SP)
140 148
141 // g = m->gsignal 149 // g = m->gsignal
142 MOVL m_gsignal(BX), DI 150 MOVL m_gsignal(BX), DI
143 MOVL DI, g(AX) 151 MOVL DI, g(AX)
144 152
145 // load args and call sighandler 153 // load args and call sighandler
146 MOVL CX, 0(SP) 154 MOVL CX, 0(SP)
147 MOVL DX, 4(SP) 155 MOVL DX, 4(SP)
148 MOVL BP, 8(SP) 156 MOVL BP, 8(SP)
149 157
150 CALL runtime·sighandler(SB) 158 CALL runtime·sighandler(SB)
151 159
152 // restore g 160 // restore g
153 get_tls(BX) 161 get_tls(BX)
154 » MOVL» 20(SP), BP 162 » MOVL» 12(SP), BP
155 MOVL BP, g(BX) 163 MOVL BP, g(BX)
156 164
157 // call noted(AX) 165 // call noted(AX)
158 MOVL AX, 0(SP) 166 MOVL AX, 0(SP)
159 CALL runtime·noted(SB) 167 CALL runtime·noted(SB)
160 RET 168 RET
169
170 // Only used by the 64-bit runtime.
171 TEXT runtime·setfpmasks(SB),7,$0
172 RET
LEFTRIGHT

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