runtime: ctrlhandler for windows amd64

R=rsc
CC=golang-dev
https://golang.org/cl/4825047
This commit is contained in:
Wei Guangjing 2011-08-18 12:37:42 -04:00 committed by Russ Cox
parent fca50820cc
commit acfb0a1584
2 changed files with 37 additions and 2 deletions

View File

@ -9,6 +9,7 @@
void
runtime·initsig(int32 queue)
{
runtime·siginit();
}
void

View File

@ -61,8 +61,42 @@ TEXT runtime·setlasterror(SB),7,$0
// Windows runs the ctrl handler in a new thread.
TEXT runtime·ctrlhandler(SB),7,$0
// TODO
RET
PUSHQ BP
MOVQ SP, BP
PUSHQ BX
PUSHQ SI
PUSHQ DI
PUSHQ 0x58(GS)
MOVQ SP, BX
// setup dummy m, g
SUBQ $(m_gostack+8), SP // at least space for m_gostack
LEAQ m_tls(SP), CX
MOVQ CX, 0x58(GS)
MOVQ SP, m(CX)
MOVQ SP, DX
SUBQ $16, SP // space for g_stack{guard,base}
MOVQ SP, g(CX)
MOVQ SP, m_g0(DX)
LEAQ -8192(SP), CX
MOVQ CX, g_stackguard(SP)
MOVQ BX, g_stackbase(SP)
PUSHQ 16(BP)
CALL runtime·ctrlhandler1(SB)
POPQ CX
get_tls(CX)
MOVQ g(CX), CX
MOVQ g_stackbase(CX), SP
POPQ 0x58(GS)
POPQ DI
POPQ SI
POPQ BX
POPQ BP
MOVQ 0(SP), CX
ADDQ $16, SP
JMP CX
TEXT runtime·callbackasm(SB),7,$0
// TODO