Commit 3719aa4d authored by Rob Pike's avatar Rob Pike

update darwin for segmented stacks

SVN=125154
parent 1f6828bc
...@@ -3,43 +3,56 @@ ...@@ -3,43 +3,56 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
TEXT _rt0_amd64_darwin(SB),1,$-8 TEXT _rt0_amd64_darwin(SB),7,$-8
PUSHQ $0
MOVQ SP, BP // copy arguments forward on an even stack
ANDQ $~15, SP
MOVQ 8(BP), DI // argc
LEAQ 16(BP), SI // argv MOVQ 0(SP), AX // argc
MOVL DI, DX LEAQ 8(SP), BX // argv
ADDL $1, DX ANDQ $~7, SP
SHLL $3, DX SUBQ $32, SP
ADDQ SI, DX MOVQ AX, 16(SP)
MOVQ DX, CX MOVQ BX, 24(SP)
CMPQ (CX), $0
JEQ done // allocate the per-user block
loop: LEAQ peruser<>(SB), R15 // dedicated u. register
ADDQ $8, CX MOVQ SP, AX
CMPQ (CX), $0 SUBQ $4096, AX
JNE loop MOVQ AX, 0(R15)
done:
ADDQ $8, CX
SUBQ $16, SP
MOVL DI, 0(SP)
MOVQ SI, 8(SP)
CALL args(SB)
ADDQ $16, SP
CALL check(SB) CALL check(SB)
// process the arguments
MOVL 16(SP), AX
MOVL AX, 0(SP)
MOVQ 24(SP), AX
MOVQ AX, 8(SP)
CALL args(SB)
CALL main·main(SB) CALL main·main(SB)
MOVQ $0, AX
MOVQ AX, 0(SP) // exit status
CALL sys·exit(SB) CALL sys·exit(SB)
CALL notok(SB) CALL notok(SB)
POPQ AX
ADDQ $32, SP
RET
TEXT _morestack(SB), 7, $0
MOVQ SP, AX
SUBQ $1024, AX
MOVQ AX, 0(R15)
RET RET
TEXT FLUSH(SB),7,$-8 TEXT FLUSH(SB),7,$-8
RET RET
TEXT sys·exit(SB),7,$-8 TEXT sys·exit(SB),1,$-8
MOVL 8(SP), DI // arg 1 exit status MOVL 8(SP), DI // arg 1 exit status
MOVL $(0x2000000+1), AX MOVL $(0x2000000+1), AX
SYSCALL SYSCALL
...@@ -138,7 +151,9 @@ TEXT sys·memclr(SB),1,$-8 ...@@ -138,7 +151,9 @@ TEXT sys·memclr(SB),1,$-8
STOSQ STOSQ
RET RET
TEXT sys·getcallerpc+0(SB),0,$0 TEXT sys·getcallerpc+0(SB),1,$0
MOVQ x+0(FP),AX MOVQ x+0(FP),AX
MOVQ -8(AX),AX MOVQ -8(AX),AX
RET RET
GLOBL peruser<>(SB),$64
...@@ -154,7 +154,7 @@ TEXT sys·memclr(SB),1,$-8 ...@@ -154,7 +154,7 @@ TEXT sys·memclr(SB),1,$-8
STOSQ STOSQ
RET RET
TEXT sys·getcallerpc+0(SB),0,$0 TEXT sys·getcallerpc+0(SB),1,$0
MOVQ x+0(FP),AX MOVQ x+0(FP),AX
MOVQ -8(AX),AX MOVQ -8(AX),AX
RET RET
......
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