diff options
author | Austin Clements <austin@google.com> | 2018-01-17 15:51:09 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2018-03-08 22:55:54 +0000 |
commit | c950a90d7240a6f2124ae38564c137b86866b191 (patch) | |
tree | d2a05d2c0be7fe5491b7827274f67f0d116b5ce9 /src/runtime/asm_386.s | |
parent | 7f1b2738bb7a8863ee78d5357acbc820b7083821 (diff) | |
download | go-c950a90d7240a6f2124ae38564c137b86866b191.tar.gz go-c950a90d7240a6f2124ae38564c137b86866b191.zip |
runtime: call abort instead of raw INT $3 or bad MOV
Everything except for amd64, amd64p32, and 386 currently defines and
uses an abort function. This CL makes these match. The next CL will
recognize the abort function to make this more useful.
Change-Id: I7c155871ea48919a9220417df0630005b444f488
Reviewed-on: https://go-review.googlesource.com/93660
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/asm_386.s')
-rw-r--r-- | src/runtime/asm_386.s | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s index 6cea848374..f565bb305d 100644 --- a/src/runtime/asm_386.s +++ b/src/runtime/asm_386.s @@ -132,7 +132,7 @@ bad_proc: // show that the program requires MMX. CALL runtime·write(SB) MOVL $1, 0(SP) CALL runtime·exit(SB) - INT $3 + CALL runtime·abort(SB) has_cpuid: MOVL $0, AX @@ -306,7 +306,7 @@ ok: // start this M CALL runtime·mstart(SB) - INT $3 + CALL runtime·abort(SB) RET DATA bad_proc_msg<>+0x00(SB)/8, $"This pro" @@ -500,14 +500,14 @@ TEXT runtime·morestack(SB),NOSPLIT,$0-0 CMPL g(CX), SI JNE 3(PC) CALL runtime·badmorestackg0(SB) - INT $3 + CALL runtime·abort(SB) // Cannot grow signal stack. MOVL m_gsignal(BX), SI CMPL g(CX), SI JNE 3(PC) CALL runtime·badmorestackgsignal(SB) - INT $3 + CALL runtime·abort(SB) // Called from f. // Set m->morebuf to f's caller. @@ -534,7 +534,7 @@ TEXT runtime·morestack(SB),NOSPLIT,$0-0 MOVL -4(AX), BX // fault if CALL would, before smashing SP MOVL AX, SP CALL runtime·newstack(SB) - MOVL $0, 0x1003 // crash if newstack returns + CALL runtime·abort(SB) // crash if newstack returns RET TEXT runtime·morestack_noctxt(SB),NOSPLIT,$0-0 @@ -907,16 +907,21 @@ TEXT setg_gcc<>(SB), NOSPLIT, $0 MOVL DX, g(AX) RET +TEXT runtime·abort(SB),NOSPLIT,$0-0 + INT $3 +loop: + JMP loop + // check that SP is in range [g->stack.lo, g->stack.hi) TEXT runtime·stackcheck(SB), NOSPLIT, $0-0 get_tls(CX) MOVL g(CX), AX CMPL (g_stack+stack_hi)(AX), SP JHI 2(PC) - INT $3 + CALL runtime·abort(SB) CMPL SP, (g_stack+stack_lo)(AX) JHI 2(PC) - INT $3 + CALL runtime·abort(SB) RET // func cputicks() int64 |