Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
3719aa4d
Commit
3719aa4d
authored
Jun 27, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update darwin for segmented stacks
SVN=125154
parent
1f6828bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
30 deletions
+45
-30
rt0_amd64_darwin.s
src/runtime/rt0_amd64_darwin.s
+44
-29
rt0_amd64_linux.s
src/runtime/rt0_amd64_linux.s
+1
-1
No files found.
src/runtime/rt0_amd64_darwin.s
View file @
3719aa4d
...
@@ -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
src/runtime/rt0_amd64_linux.s
View file @
3719aa4d
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment