Commit 36aa7d4d authored by Russ Cox's avatar Russ Cox

runtime: inline calls to notok

When a very low-level system call that should never fail
does fail, we call notok, which crashes the program.
Often, we are then left with only the program counter as
information about the crash, and it is in notok.
Instead, inline calls to notok (it is just one instruction
on most systems) so that the program counter will
tell us which system call is unhappy.

R=golang-dev, gri, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/5792048
parent c978a5a3
...@@ -73,7 +73,7 @@ ok: ...@@ -73,7 +73,7 @@ ok:
// start this M // start this M
CALL runtime·mstart(SB) CALL runtime·mstart(SB)
CALL runtime·notok(SB) // never returns MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·breakpoint(SB),7,$0 TEXT runtime·breakpoint(SB),7,$0
......
...@@ -8,15 +8,11 @@ ...@@ -8,15 +8,11 @@
#include "zasm_GOOS_GOARCH.h" #include "zasm_GOOS_GOARCH.h"
TEXT runtime·notok(SB),7,$0
MOVL $0xf1, 0xf1
RET
// Exit the entire program (like C exit) // Exit the entire program (like C exit)
TEXT runtime·exit(SB),7,$0 TEXT runtime·exit(SB),7,$0
MOVL $1, AX MOVL $1, AX
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// Exit this OS thread (like pthread_exit, which eventually // Exit this OS thread (like pthread_exit, which eventually
...@@ -25,7 +21,7 @@ TEXT runtime·exit1(SB),7,$0 ...@@ -25,7 +21,7 @@ TEXT runtime·exit1(SB),7,$0
MOVL $361, AX MOVL $361, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$0 TEXT runtime·write(SB),7,$0
...@@ -52,14 +48,14 @@ TEXT runtime·madvise(SB),7,$0 ...@@ -52,14 +48,14 @@ TEXT runtime·madvise(SB),7,$0
MOVL $75, AX MOVL $75, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·munmap(SB),7,$0 TEXT runtime·munmap(SB),7,$0
MOVL $73, AX MOVL $73, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·setitimer(SB),7,$0 TEXT runtime·setitimer(SB),7,$0
...@@ -110,14 +106,14 @@ TEXT runtime·sigprocmask(SB),7,$0 ...@@ -110,14 +106,14 @@ TEXT runtime·sigprocmask(SB),7,$0
MOVL $329, AX // pthread_sigmask (on OS X, sigprocmask==entire process) MOVL $329, AX // pthread_sigmask (on OS X, sigprocmask==entire process)
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigaction(SB),7,$0 TEXT runtime·sigaction(SB),7,$0
MOVL $46, AX MOVL $46, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// Sigtramp's job is to call the actual signal handler. // Sigtramp's job is to call the actual signal handler.
...@@ -165,14 +161,14 @@ TEXT runtime·sigtramp(SB),7,$40 ...@@ -165,14 +161,14 @@ TEXT runtime·sigtramp(SB),7,$40
MOVL BX, 8(SP) MOVL BX, 8(SP)
MOVL $184, AX // sigreturn(ucontext, infostyle) MOVL $184, AX // sigreturn(ucontext, infostyle)
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigaltstack(SB),7,$0 TEXT runtime·sigaltstack(SB),7,$0
MOVL $53, AX MOVL $53, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·usleep(SB),7,$32 TEXT runtime·usleep(SB),7,$32
...@@ -268,7 +264,7 @@ TEXT runtime·bsdthread_register(SB),7,$40 ...@@ -268,7 +264,7 @@ TEXT runtime·bsdthread_register(SB),7,$40
MOVL $0, 24(SP) // dispatchqueue_offset MOVL $0, 24(SP) // dispatchqueue_offset
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// Invoke Mach system call. // Invoke Mach system call.
......
...@@ -18,7 +18,7 @@ TEXT runtime·exit(SB),7,$0 ...@@ -18,7 +18,7 @@ TEXT runtime·exit(SB),7,$0
MOVL 8(SP), DI // arg 1 exit status MOVL 8(SP), DI // arg 1 exit status
MOVL $(0x2000000+1), AX // syscall entry MOVL $(0x2000000+1), AX // syscall entry
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// Exit this OS thread (like pthread_exit, which eventually // Exit this OS thread (like pthread_exit, which eventually
...@@ -27,7 +27,7 @@ TEXT runtime·exit1(SB),7,$0 ...@@ -27,7 +27,7 @@ TEXT runtime·exit1(SB),7,$0
MOVL 8(SP), DI // arg 1 exit status MOVL 8(SP), DI // arg 1 exit status
MOVL $(0x2000000+361), AX // syscall entry MOVL $(0x2000000+361), AX // syscall entry
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$0 TEXT runtime·write(SB),7,$0
...@@ -62,7 +62,7 @@ TEXT runtime·madvise(SB), 7, $0 ...@@ -62,7 +62,7 @@ TEXT runtime·madvise(SB), 7, $0
MOVL $(0x2000000+75), AX // syscall entry madvise MOVL $(0x2000000+75), AX // syscall entry madvise
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// func now() (sec int64, nsec int32) // func now() (sec int64, nsec int32)
...@@ -99,7 +99,7 @@ TEXT runtime·sigprocmask(SB),7,$0 ...@@ -99,7 +99,7 @@ TEXT runtime·sigprocmask(SB),7,$0
MOVL $(0x2000000+329), AX // pthread_sigmask (on OS X, sigprocmask==entire process) MOVL $(0x2000000+329), AX // pthread_sigmask (on OS X, sigprocmask==entire process)
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigaction(SB),7,$0 TEXT runtime·sigaction(SB),7,$0
...@@ -111,7 +111,7 @@ TEXT runtime·sigaction(SB),7,$0 ...@@ -111,7 +111,7 @@ TEXT runtime·sigaction(SB),7,$0
MOVL $(0x2000000+46), AX // syscall entry MOVL $(0x2000000+46), AX // syscall entry
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigtramp(SB),7,$64 TEXT runtime·sigtramp(SB),7,$64
...@@ -164,12 +164,7 @@ TEXT runtime·munmap(SB),7,$0 ...@@ -164,12 +164,7 @@ TEXT runtime·munmap(SB),7,$0
MOVL $(0x2000000+73), AX // syscall entry MOVL $(0x2000000+73), AX // syscall entry
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET
TEXT runtime·notok(SB),7,$0
MOVL $0xf1, BP
MOVQ BP, (BP)
RET RET
TEXT runtime·sigaltstack(SB),7,$0 TEXT runtime·sigaltstack(SB),7,$0
...@@ -178,7 +173,7 @@ TEXT runtime·sigaltstack(SB),7,$0 ...@@ -178,7 +173,7 @@ TEXT runtime·sigaltstack(SB),7,$0
MOVQ $(0x2000000+53), AX MOVQ $(0x2000000+53), AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·usleep(SB),7,$16 TEXT runtime·usleep(SB),7,$16
...@@ -266,7 +261,7 @@ TEXT runtime·bsdthread_register(SB),7,$0 ...@@ -266,7 +261,7 @@ TEXT runtime·bsdthread_register(SB),7,$0
MOVQ $(0x2000000+366), AX // bsdthread_register MOVQ $(0x2000000+366), AX // bsdthread_register
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// Mach system calls use 0x1000000 instead of the BSD's 0x2000000. // Mach system calls use 0x1000000 instead of the BSD's 0x2000000.
......
...@@ -45,14 +45,14 @@ TEXT runtime·thr_start(SB),7,$0 ...@@ -45,14 +45,14 @@ TEXT runtime·thr_start(SB),7,$0
TEXT runtime·exit(SB),7,$-4 TEXT runtime·exit(SB),7,$-4
MOVL $1, AX MOVL $1, AX
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·exit1(SB),7,$-4 TEXT runtime·exit1(SB),7,$-4
MOVL $431, AX MOVL $431, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$-4 TEXT runtime·write(SB),7,$-4
...@@ -79,10 +79,6 @@ TEXT runtime·raisesigpipe(SB),7,$12 ...@@ -79,10 +79,6 @@ TEXT runtime·raisesigpipe(SB),7,$12
INT $0x80 INT $0x80
RET RET
TEXT runtime·notok(SB),7,$0
MOVL $0xf1, 0xf1
RET
TEXT runtime·mmap(SB),7,$32 TEXT runtime·mmap(SB),7,$32
LEAL arg0+0(FP), SI LEAL arg0+0(FP), SI
LEAL 4(SP), DI LEAL 4(SP), DI
...@@ -103,7 +99,7 @@ TEXT runtime·munmap(SB),7,$-4 ...@@ -103,7 +99,7 @@ TEXT runtime·munmap(SB),7,$-4
MOVL $73, AX MOVL $73, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·setitimer(SB), 7, $-4 TEXT runtime·setitimer(SB), 7, $-4
...@@ -157,7 +153,7 @@ TEXT runtime·sigaction(SB),7,$-4 ...@@ -157,7 +153,7 @@ TEXT runtime·sigaction(SB),7,$-4
MOVL $416, AX MOVL $416, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigtramp(SB),7,$44 TEXT runtime·sigtramp(SB),7,$44
...@@ -194,14 +190,14 @@ TEXT runtime·sigtramp(SB),7,$44 ...@@ -194,14 +190,14 @@ TEXT runtime·sigtramp(SB),7,$44
MOVL AX, 4(SP) MOVL AX, 4(SP)
MOVL $417, AX // sigreturn(ucontext) MOVL $417, AX // sigreturn(ucontext)
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigaltstack(SB),7,$0 TEXT runtime·sigaltstack(SB),7,$0
MOVL $53, AX MOVL $53, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·usleep(SB),7,$20 TEXT runtime·usleep(SB),7,$20
...@@ -317,7 +313,7 @@ TEXT runtime·sigprocmask(SB),7,$16 ...@@ -317,7 +313,7 @@ TEXT runtime·sigprocmask(SB),7,$16
MOVL $340, AX // sys_sigprocmask MOVL $340, AX // sys_sigprocmask
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
GLOBL runtime·tlsoffset(SB),$4 GLOBL runtime·tlsoffset(SB),$4
...@@ -47,14 +47,14 @@ TEXT runtime·exit(SB),7,$-8 ...@@ -47,14 +47,14 @@ TEXT runtime·exit(SB),7,$-8
MOVL 8(SP), DI // arg 1 exit status MOVL 8(SP), DI // arg 1 exit status
MOVL $1, AX MOVL $1, AX
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·exit1(SB),7,$-8 TEXT runtime·exit1(SB),7,$-8
MOVQ 8(SP), DI // arg 1 exit status MOVQ 8(SP), DI // arg 1 exit status
MOVL $431, AX MOVL $431, AX
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$-8 TEXT runtime·write(SB),7,$-8
...@@ -129,7 +129,7 @@ TEXT runtime·sigaction(SB),7,$-8 ...@@ -129,7 +129,7 @@ TEXT runtime·sigaction(SB),7,$-8
MOVL $416, AX MOVL $416, AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigtramp(SB),7,$64 TEXT runtime·sigtramp(SB),7,$64
...@@ -174,12 +174,7 @@ TEXT runtime·munmap(SB),7,$0 ...@@ -174,12 +174,7 @@ TEXT runtime·munmap(SB),7,$0
MOVL $73, AX MOVL $73, AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET
TEXT runtime·notok(SB),7,$-8
MOVL $0xf1, BP
MOVQ BP, (BP)
RET RET
TEXT runtime·sigaltstack(SB),7,$-8 TEXT runtime·sigaltstack(SB),7,$-8
...@@ -188,7 +183,7 @@ TEXT runtime·sigaltstack(SB),7,$-8 ...@@ -188,7 +183,7 @@ TEXT runtime·sigaltstack(SB),7,$-8
MOVQ $53, AX MOVQ $53, AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·usleep(SB),7,$16 TEXT runtime·usleep(SB),7,$16
...@@ -216,7 +211,7 @@ TEXT runtime·settls(SB),7,$8 ...@@ -216,7 +211,7 @@ TEXT runtime·settls(SB),7,$8
MOVQ $165, AX // sysarch MOVQ $165, AX // sysarch
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sysctl(SB),7,$0 TEXT runtime·sysctl(SB),7,$0
...@@ -246,5 +241,5 @@ TEXT runtime·sigprocmask(SB),7,$0 ...@@ -246,5 +241,5 @@ TEXT runtime·sigprocmask(SB),7,$0
MOVL $340, AX // sys_sigprocmask MOVL $340, AX // sys_sigprocmask
SYSCALL SYSCALL
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
...@@ -139,7 +139,7 @@ TEXT runtime·rtsigprocmask(SB),7,$0-32 ...@@ -139,7 +139,7 @@ TEXT runtime·rtsigprocmask(SB),7,$0-32
SYSCALL SYSCALL
CMPQ AX, $0xfffffffffffff001 CMPQ AX, $0xfffffffffffff001
JLS 2(PC) JLS 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·rt_sigaction(SB),7,$0-32 TEXT runtime·rt_sigaction(SB),7,$0-32
...@@ -205,7 +205,7 @@ TEXT runtime·munmap(SB),7,$0 ...@@ -205,7 +205,7 @@ TEXT runtime·munmap(SB),7,$0
SYSCALL SYSCALL
CMPQ AX, $0xfffffffffffff001 CMPQ AX, $0xfffffffffffff001
JLS 2(PC) JLS 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·madvise(SB),7,$0 TEXT runtime·madvise(SB),7,$0
...@@ -216,12 +216,7 @@ TEXT runtime·madvise(SB),7,$0 ...@@ -216,12 +216,7 @@ TEXT runtime·madvise(SB),7,$0
SYSCALL SYSCALL
CMPQ AX, $0xfffffffffffff001 CMPQ AX, $0xfffffffffffff001
JLS 2(PC) JLS 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET
TEXT runtime·notok(SB),7,$0
MOVQ $0xf1, BP
MOVQ BP, (BP)
RET RET
// int64 futex(int32 *uaddr, int32 op, int32 val, // int64 futex(int32 *uaddr, int32 op, int32 val,
...@@ -290,7 +285,7 @@ TEXT runtime·sigaltstack(SB),7,$-8 ...@@ -290,7 +285,7 @@ TEXT runtime·sigaltstack(SB),7,$-8
SYSCALL SYSCALL
CMPQ AX, $0xfffffffffffff001 CMPQ AX, $0xfffffffffffff001
JLS 2(PC) JLS 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// set tls base to DI // set tls base to DI
...@@ -303,7 +298,7 @@ TEXT runtime·settls(SB),7,$32 ...@@ -303,7 +298,7 @@ TEXT runtime·settls(SB),7,$32
SYSCALL SYSCALL
CMPQ AX, $0xfffffffffffff001 CMPQ AX, $0xfffffffffffff001
JLS 2(PC) JLS 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·osyield(SB),7,$0 TEXT runtime·osyield(SB),7,$0
......
...@@ -38,11 +38,6 @@ ...@@ -38,11 +38,6 @@
#define ARM_BASE (SYS_BASE + 0x0f0000) #define ARM_BASE (SYS_BASE + 0x0f0000)
#define SYS_ARM_cacheflush (ARM_BASE + 2) #define SYS_ARM_cacheflush (ARM_BASE + 2)
TEXT notok<>(SB),7,$0
MOVW $0, R9
MOVW R9, (R9)
B 0(PC)
TEXT runtime·open(SB),7,$0 TEXT runtime·open(SB),7,$0
MOVW 0(FP), R0 MOVW 0(FP), R0
MOVW 4(FP), R1 MOVW 4(FP), R1
...@@ -126,7 +121,8 @@ TEXT runtime·munmap(SB),7,$0 ...@@ -126,7 +121,8 @@ TEXT runtime·munmap(SB),7,$0
SWI $0 SWI $0
MOVW $0xfffff001, R6 MOVW $0xfffff001, R6
CMP R6, R0 CMP R6, R0
BL.HI notok<>(SB) MOVW.HI $0, R9 // crash on syscall failure
MOVW.HI R9, (R9)
RET RET
TEXT runtime·madvise(SB),7,$0 TEXT runtime·madvise(SB),7,$0
...@@ -137,7 +133,8 @@ TEXT runtime·madvise(SB),7,$0 ...@@ -137,7 +133,8 @@ TEXT runtime·madvise(SB),7,$0
SWI $0 SWI $0
MOVW $0xfffff001, R6 MOVW $0xfffff001, R6
CMP R6, R0 CMP R6, R0
BL.HI notok<>(SB) MOVW.HI $0, R9 // crash on syscall failure
MOVW.HI R9, (R9)
RET RET
TEXT runtime·setitimer(SB),7,$0 TEXT runtime·setitimer(SB),7,$0
...@@ -291,7 +288,8 @@ TEXT runtime·sigaltstack(SB),7,$0 ...@@ -291,7 +288,8 @@ TEXT runtime·sigaltstack(SB),7,$0
SWI $0 SWI $0
MOVW $0xfffff001, R6 MOVW $0xfffff001, R6
CMP R6, R0 CMP R6, R0
BL.HI notok<>(SB) MOVW.HI $0, R9 // crash on syscall failure
MOVW.HI R9, (R9)
RET RET
TEXT runtime·sigtramp(SB),7,$24 TEXT runtime·sigtramp(SB),7,$24
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
TEXT runtime·exit(SB),7,$-4 TEXT runtime·exit(SB),7,$-4
MOVL $1, AX MOVL $1, AX
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·exit1(SB),7,$-4 TEXT runtime·exit1(SB),7,$-4
MOVL $302, AX // sys_threxit MOVL $302, AX // sys_threxit
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$-4 TEXT runtime·write(SB),7,$-4
...@@ -55,10 +55,6 @@ TEXT runtime·raisesigpipe(SB),7,$12 ...@@ -55,10 +55,6 @@ TEXT runtime·raisesigpipe(SB),7,$12
INT $0x80 INT $0x80
RET RET
TEXT runtime·notok(SB),7,$0
MOVL $0xf1, 0xf1
RET
TEXT runtime·mmap(SB),7,$36 TEXT runtime·mmap(SB),7,$36
LEAL arg0+0(FP), SI LEAL arg0+0(FP), SI
LEAL 4(SP), DI LEAL 4(SP), DI
...@@ -83,7 +79,7 @@ TEXT runtime·munmap(SB),7,$-4 ...@@ -83,7 +79,7 @@ TEXT runtime·munmap(SB),7,$-4
MOVL $73, AX // sys_munmap MOVL $73, AX // sys_munmap
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·setitimer(SB),7,$-4 TEXT runtime·setitimer(SB),7,$-4
...@@ -136,7 +132,7 @@ TEXT runtime·sigaction(SB),7,$-4 ...@@ -136,7 +132,7 @@ TEXT runtime·sigaction(SB),7,$-4
MOVL $46, AX // sys_sigaction MOVL $46, AX // sys_sigaction
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigtramp(SB),7,$44 TEXT runtime·sigtramp(SB),7,$44
...@@ -173,7 +169,7 @@ TEXT runtime·sigtramp(SB),7,$44 ...@@ -173,7 +169,7 @@ TEXT runtime·sigtramp(SB),7,$44
MOVL AX, 4(SP) // arg 1 - sigcontext MOVL AX, 4(SP) // arg 1 - sigcontext
MOVL $103, AX // sys_sigreturn MOVL $103, AX // sys_sigreturn
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// int32 rfork_thread(int32 flags, void *stack, M *m, G *g, void (*fn)(void)); // int32 rfork_thread(int32 flags, void *stack, M *m, G *g, void (*fn)(void));
...@@ -285,7 +281,7 @@ TEXT runtime·settls(SB),7,$16 ...@@ -285,7 +281,7 @@ TEXT runtime·settls(SB),7,$16
MOVL $165, AX // sys_sysarch MOVL $165, AX // sys_sysarch
INT $0x80 INT $0x80
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·osyield(SB),7,$-4 TEXT runtime·osyield(SB),7,$-4
......
...@@ -83,13 +83,13 @@ TEXT runtime·exit(SB),7,$-8 ...@@ -83,13 +83,13 @@ TEXT runtime·exit(SB),7,$-8
MOVL 8(SP), DI // arg 1 - exit status MOVL 8(SP), DI // arg 1 - exit status
MOVL $1, AX // sys_exit MOVL $1, AX // sys_exit
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·exit1(SB),7,$-8 TEXT runtime·exit1(SB),7,$-8
MOVL $302, AX // sys_threxit MOVL $302, AX // sys_threxit
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$-8 TEXT runtime·write(SB),7,$-8
...@@ -170,7 +170,7 @@ TEXT runtime·sigaction(SB),7,$-8 ...@@ -170,7 +170,7 @@ TEXT runtime·sigaction(SB),7,$-8
MOVL $46, AX MOVL $46, AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigtramp(SB),7,$64 TEXT runtime·sigtramp(SB),7,$64
...@@ -221,12 +221,7 @@ TEXT runtime·munmap(SB),7,$0 ...@@ -221,12 +221,7 @@ TEXT runtime·munmap(SB),7,$0
MOVL $73, AX // sys_munmap MOVL $73, AX // sys_munmap
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET
TEXT runtime·notok(SB),7,$-8
MOVL $0xf1, BP
MOVQ BP, (BP)
RET RET
TEXT runtime·sigaltstack(SB),7,$-8 TEXT runtime·sigaltstack(SB),7,$-8
...@@ -235,7 +230,7 @@ TEXT runtime·sigaltstack(SB),7,$-8 ...@@ -235,7 +230,7 @@ TEXT runtime·sigaltstack(SB),7,$-8
MOVQ $288, AX // sys_sigaltstack MOVQ $288, AX // sys_sigaltstack
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// set tls base to DI // set tls base to DI
...@@ -248,7 +243,7 @@ TEXT runtime·settls(SB),7,$8 ...@@ -248,7 +243,7 @@ TEXT runtime·settls(SB),7,$8
MOVQ $165, AX // sys_sysarch MOVQ $165, AX // sys_sysarch
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sysctl(SB),7,$0 TEXT runtime·sysctl(SB),7,$0
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
TEXT runtime·exit(SB),7,$-4 TEXT runtime·exit(SB),7,$-4
MOVL $1, AX MOVL $1, AX
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·exit1(SB),7,$-4 TEXT runtime·exit1(SB),7,$-4
MOVL $302, AX // sys_threxit MOVL $302, AX // sys_threxit
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$-4 TEXT runtime·write(SB),7,$-4
...@@ -55,10 +55,6 @@ TEXT runtime·raisesigpipe(SB),7,$12 ...@@ -55,10 +55,6 @@ TEXT runtime·raisesigpipe(SB),7,$12
INT $0x80 INT $0x80
RET RET
TEXT runtime·notok(SB),7,$0
MOVL $0xf1, 0xf1
RET
TEXT runtime·mmap(SB),7,$36 TEXT runtime·mmap(SB),7,$36
LEAL arg0+0(FP), SI LEAL arg0+0(FP), SI
LEAL 4(SP), DI LEAL 4(SP), DI
...@@ -83,7 +79,7 @@ TEXT runtime·munmap(SB),7,$-4 ...@@ -83,7 +79,7 @@ TEXT runtime·munmap(SB),7,$-4
MOVL $73, AX // sys_munmap MOVL $73, AX // sys_munmap
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·setitimer(SB),7,$-4 TEXT runtime·setitimer(SB),7,$-4
...@@ -136,7 +132,7 @@ TEXT runtime·sigaction(SB),7,$-4 ...@@ -136,7 +132,7 @@ TEXT runtime·sigaction(SB),7,$-4
MOVL $46, AX // sys_sigaction MOVL $46, AX // sys_sigaction
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigtramp(SB),7,$44 TEXT runtime·sigtramp(SB),7,$44
...@@ -173,7 +169,7 @@ TEXT runtime·sigtramp(SB),7,$44 ...@@ -173,7 +169,7 @@ TEXT runtime·sigtramp(SB),7,$44
MOVL AX, 4(SP) // arg 1 - sigcontext MOVL AX, 4(SP) // arg 1 - sigcontext
MOVL $103, AX // sys_sigreturn MOVL $103, AX // sys_sigreturn
INT $0x80 INT $0x80
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// int32 rfork_thread(int32 flags, void *stack, M *m, G *g, void (*fn)(void)); // int32 rfork_thread(int32 flags, void *stack, M *m, G *g, void (*fn)(void));
...@@ -285,7 +281,7 @@ TEXT runtime·settls(SB),7,$16 ...@@ -285,7 +281,7 @@ TEXT runtime·settls(SB),7,$16
MOVL $165, AX // sys_sysarch MOVL $165, AX // sys_sysarch
INT $0x80 INT $0x80
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·osyield(SB),7,$-4 TEXT runtime·osyield(SB),7,$-4
......
...@@ -83,13 +83,13 @@ TEXT runtime·exit(SB),7,$-8 ...@@ -83,13 +83,13 @@ TEXT runtime·exit(SB),7,$-8
MOVL 8(SP), DI // arg 1 - exit status MOVL 8(SP), DI // arg 1 - exit status
MOVL $1, AX // sys_exit MOVL $1, AX // sys_exit
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·exit1(SB),7,$-8 TEXT runtime·exit1(SB),7,$-8
MOVL $302, AX // sys_threxit MOVL $302, AX // sys_threxit
SYSCALL SYSCALL
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·write(SB),7,$-8 TEXT runtime·write(SB),7,$-8
...@@ -170,7 +170,7 @@ TEXT runtime·sigaction(SB),7,$-8 ...@@ -170,7 +170,7 @@ TEXT runtime·sigaction(SB),7,$-8
MOVL $46, AX MOVL $46, AX
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigtramp(SB),7,$64 TEXT runtime·sigtramp(SB),7,$64
...@@ -221,12 +221,7 @@ TEXT runtime·munmap(SB),7,$0 ...@@ -221,12 +221,7 @@ TEXT runtime·munmap(SB),7,$0
MOVL $73, AX // sys_munmap MOVL $73, AX // sys_munmap
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET
TEXT runtime·notok(SB),7,$-8
MOVL $0xf1, BP
MOVQ BP, (BP)
RET RET
TEXT runtime·sigaltstack(SB),7,$-8 TEXT runtime·sigaltstack(SB),7,$-8
...@@ -235,7 +230,7 @@ TEXT runtime·sigaltstack(SB),7,$-8 ...@@ -235,7 +230,7 @@ TEXT runtime·sigaltstack(SB),7,$-8
MOVQ $288, AX // sys_sigaltstack MOVQ $288, AX // sys_sigaltstack
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
// set tls base to DI // set tls base to DI
...@@ -248,7 +243,7 @@ TEXT runtime·settls(SB),7,$8 ...@@ -248,7 +243,7 @@ TEXT runtime·settls(SB),7,$8
MOVQ $165, AX // sys_sysarch MOVQ $165, AX // sys_sysarch
SYSCALL SYSCALL
JCC 2(PC) JCC 2(PC)
CALL runtime·notok(SB) MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sysctl(SB),7,$0 TEXT runtime·sysctl(SB),7,$0
......
...@@ -268,11 +268,6 @@ TEXT runtime·tstart_stdcall(SB),7,$0 ...@@ -268,11 +268,6 @@ TEXT runtime·tstart_stdcall(SB),7,$0
XORL AX, AX // return 0 == success XORL AX, AX // return 0 == success
RET RET
TEXT runtime·notok(SB),7,$0
MOVQ $0xf1, BP
MOVQ BP, (BP)
RET
// set tls base to DI // set tls base to DI
TEXT runtime·settls(SB),7,$0 TEXT runtime·settls(SB),7,$0
CALL runtime·setstacklimits(SB) CALL runtime·setstacklimits(SB)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment