LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 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 "amd64/asm.h" | 5 #include "amd64/asm.h" |
6 | 6 |
7 TEXT _rt0_amd64(SB),7,$-8 | 7 TEXT _rt0_amd64(SB),7,$-8 |
8 // copy arguments forward on an even stack | 8 // copy arguments forward on an even stack |
9 MOVQ 0(DI), AX // argc | 9 MOVQ 0(DI), AX // argc |
10 LEAQ 8(DI), BX // argv | 10 LEAQ 8(DI), BX // argv |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 // check that SP is in range [g->stackbase, g->stackguard) | 304 // check that SP is in range [g->stackbase, g->stackguard) |
305 TEXT stackcheck(SB), 7, $0 | 305 TEXT stackcheck(SB), 7, $0 |
306 CMPQ g_stackbase(g), SP | 306 CMPQ g_stackbase(g), SP |
307 JHI 2(PC) | 307 JHI 2(PC) |
308 INT $3 | 308 INT $3 |
309 CMPQ SP, g_stackguard(g) | 309 CMPQ SP, g_stackguard(g) |
310 JHI 2(PC) | 310 JHI 2(PC) |
311 INT $3 | 311 INT $3 |
312 RET | 312 RET |
313 | 313 |
| 314 TEXT ·memclr(SB),7,$0 |
| 315 MOVQ 8(SP), DI // arg 1 addr |
| 316 MOVL 16(SP), CX // arg 2 count |
| 317 ADDL $7, CX |
| 318 SHRL $3, CX |
| 319 MOVQ $0, AX |
| 320 CLD |
| 321 REP |
| 322 STOSQ |
| 323 RET |
| 324 |
| 325 TEXT ·getcallerpc+0(SB),7,$0 |
| 326 MOVQ x+0(FP),AX // addr of first arg |
| 327 MOVQ -8(AX),AX // get calling pc |
| 328 RET |
| 329 |
| 330 TEXT ·setcallerpc+0(SB),7,$0 |
| 331 MOVQ x+0(FP),AX // addr of first arg |
| 332 MOVQ x+8(FP), BX |
| 333 MOVQ BX, -8(AX) // set calling pc |
| 334 RET |
| 335 |
| 336 TEXT getcallersp(SB),7,$0 |
| 337 MOVQ sp+0(FP), AX |
| 338 RET |
| 339 |
LEFT | RIGHT |