OLD | NEW |
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 // System calls and other sys.stuff for 386, NetBSD | 5 // System calls and other sys.stuff for 386, NetBSD |
6 // /usr/src/sys/kern/syscalls.master for syscall numbers. | 6 // /usr/src/sys/kern/syscalls.master for syscall numbers. |
7 // | 7 // |
8 | 8 |
9 #include "zasm_GOOS_GOARCH.h" | 9 #include "go_asm.h" |
| 10 #include "go_tls.h" |
10 #include "textflag.h" | 11 #include "textflag.h" |
11 | 12 |
12 // Exit the entire program (like C exit) | 13 // Exit the entire program (like C exit) |
13 TEXT runtime·exit(SB),NOSPLIT,$-4 | 14 TEXT runtime·exit(SB),NOSPLIT,$-4 |
14 MOVL $1, AX | 15 MOVL $1, AX |
15 INT $0x80 | 16 INT $0x80 |
16 MOVL $0xf1, 0xf1 // crash | 17 MOVL $0xf1, 0xf1 // crash |
17 RET | 18 RET |
18 | 19 |
19 TEXT runtime·exit1(SB),NOSPLIT,$-4 | 20 TEXT runtime·exit1(SB),NOSPLIT,$-4 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 MOVL $92, AX // fcntl | 376 MOVL $92, AX // fcntl |
376 // 0(SP) is where the caller PC would be; kernel skips it | 377 // 0(SP) is where the caller PC would be; kernel skips it |
377 MOVL fd+0(FP), BX | 378 MOVL fd+0(FP), BX |
378 MOVL BX, 4(SP) // fd | 379 MOVL BX, 4(SP) // fd |
379 MOVL $2, 8(SP) // F_SETFD | 380 MOVL $2, 8(SP) // F_SETFD |
380 MOVL $1, 12(SP) // FD_CLOEXEC | 381 MOVL $1, 12(SP) // FD_CLOEXEC |
381 INT $0x80 | 382 INT $0x80 |
382 JAE 2(PC) | 383 JAE 2(PC) |
383 NEGL AX | 384 NEGL AX |
384 RET | 385 RET |
OLD | NEW |