mirror of
https://github.com/golang/go
synced 2024-11-19 21:04:43 -07:00
432f18221f
With this change the runtime can now read GOMAXPROCS, GOGC, etc. I'm not quite sure how we missed this. R=seed, lucio.dere, rsc CC=golang-dev https://golang.org/cl/6935062
127 lines
2.0 KiB
ArmAsm
127 lines
2.0 KiB
ArmAsm
// Copyright 2010 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
#include "defs_GOOS_GOARCH.h"
|
|
#include "zasm_GOOS_GOARCH.h"
|
|
|
|
// setldt(int entry, int address, int limit)
|
|
TEXT runtime·setldt(SB),7,$0
|
|
RET
|
|
|
|
TEXT runtime·open(SB),7,$0
|
|
MOVL $14, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·pread(SB),7,$0
|
|
MOVL $50, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·pwrite(SB),7,$0
|
|
MOVL $51, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·seek(SB),7,$0
|
|
MOVL $39, AX
|
|
INT $64
|
|
CMPL AX, $-1
|
|
JNE 4(PC)
|
|
MOVL a+0(FP), CX
|
|
MOVL AX, 0(CX)
|
|
MOVL AX, 4(CX)
|
|
RET
|
|
|
|
TEXT runtime·close(SB),7,$0
|
|
MOVL $4, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·exits(SB),7,$0
|
|
MOVL $8, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·brk_(SB),7,$0
|
|
MOVL $24, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·sleep(SB),7,$0
|
|
MOVL $17, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·plan9_semacquire(SB),7,$0
|
|
MOVL $37, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·plan9_tsemacquire(SB),7,$0
|
|
MOVL $52, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·notify(SB),7,$0
|
|
MOVL $28, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·noted(SB),7,$0
|
|
MOVL $29, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·plan9_semrelease(SB),7,$0
|
|
MOVL $38, AX
|
|
INT $64
|
|
RET
|
|
|
|
TEXT runtime·rfork(SB),7,$0
|
|
MOVL $19, AX // rfork
|
|
INT $64
|
|
|
|
// In parent, return.
|
|
CMPL AX, $0
|
|
JEQ 2(PC)
|
|
RET
|
|
|
|
// In child on old stack.
|
|
MOVL mm+12(SP), BX // m
|
|
MOVL gg+16(SP), DX // g
|
|
MOVL fn+20(SP), SI // fn
|
|
|
|
// set SP to be on the new child stack
|
|
MOVL stack+8(SP), CX
|
|
MOVL CX, SP
|
|
|
|
// Initialize m, g.
|
|
get_tls(AX)
|
|
MOVL DX, g(AX)
|
|
MOVL BX, m(AX)
|
|
|
|
// Initialize AX from _tos->pid
|
|
MOVL _tos(SB), AX
|
|
MOVL tos_pid(AX), AX
|
|
MOVL AX, m_procid(BX) // save pid as m->procid
|
|
|
|
CALL runtime·stackcheck(SB) // smashes AX, CX
|
|
|
|
MOVL 0(DX), DX // paranoia; check they are not nil
|
|
MOVL 0(BX), BX
|
|
|
|
// more paranoia; check that stack splitting code works
|
|
PUSHL SI
|
|
CALL runtime·emptyfunc(SB)
|
|
POPL SI
|
|
|
|
CALL SI // fn()
|
|
CALL runtime·exit(SB)
|
|
RET
|
|
|
|
// Only used by the 64-bit runtime.
|
|
TEXT runtime·setfpmasks(SB),7,$0
|
|
RET
|