1
0
mirror of https://github.com/golang/go synced 2024-11-22 07:04:40 -07:00

in C and asm, replace pkg·name with ·name

(eliminate assumption of package global name space,
make code easier to move between packages).

R=r
CC=golang-dev
https://golang.org/cl/194072
This commit is contained in:
Russ Cox 2010-01-25 18:52:55 -08:00
parent c90b05bf7d
commit 718be3215f
64 changed files with 416 additions and 416 deletions

View File

@ -6,7 +6,7 @@
// arithmetic operations on vectors implemented in arith.go. // arithmetic operations on vectors implemented in arith.go.
// func addVV_s(z, x, y *Word, n int) (c Word) // func addVV_s(z, x, y *Word, n int) (c Word)
TEXT big·addVV_s(SB),7,$0 TEXT ·addVV_s(SB),7,$0
MOVL z+0(FP), DI MOVL z+0(FP), DI
MOVL x+4(FP), SI MOVL x+4(FP), SI
MOVL y+8(FP), CX MOVL y+8(FP), CX
@ -31,7 +31,7 @@ E1: CMPL BX, BP // i < n
// func subVV_s(z, x, y *Word, n int) (c Word) // func subVV_s(z, x, y *Word, n int) (c Word)
// (same as addVV_s except for SBBL instead of ADCL and label names) // (same as addVV_s except for SBBL instead of ADCL and label names)
TEXT big·subVV_s(SB),7,$0 TEXT ·subVV_s(SB),7,$0
MOVL z+0(FP), DI MOVL z+0(FP), DI
MOVL x+4(FP), SI MOVL x+4(FP), SI
MOVL y+8(FP), CX MOVL y+8(FP), CX
@ -55,7 +55,7 @@ E2: CMPL BX, BP // i < n
// func addVW_s(z, x *Word, y Word, n int) (c Word) // func addVW_s(z, x *Word, y Word, n int) (c Word)
TEXT big·addVW_s(SB),7,$0 TEXT ·addVW_s(SB),7,$0
MOVL z+0(FP), DI MOVL z+0(FP), DI
MOVL x+4(FP), SI MOVL x+4(FP), SI
MOVL y+8(FP), AX // c = y MOVL y+8(FP), AX // c = y
@ -77,7 +77,7 @@ E3: CMPL BX, BP // i < n
// func subVW_s(z, x *Word, y Word, n int) (c Word) // func subVW_s(z, x *Word, y Word, n int) (c Word)
TEXT big·subVW_s(SB),7,$0 TEXT ·subVW_s(SB),7,$0
MOVL z+0(FP), DI MOVL z+0(FP), DI
MOVL x+4(FP), SI MOVL x+4(FP), SI
MOVL y+8(FP), AX // c = y MOVL y+8(FP), AX // c = y
@ -100,7 +100,7 @@ E4: CMPL BX, BP // i < n
// func mulAddVWW_s(z, x *Word, y, r Word, n int) (c Word) // func mulAddVWW_s(z, x *Word, y, r Word, n int) (c Word)
TEXT big·mulAddVWW_s(SB),7,$0 TEXT ·mulAddVWW_s(SB),7,$0
MOVL z+0(FP), DI MOVL z+0(FP), DI
MOVL x+4(FP), SI MOVL x+4(FP), SI
MOVL y+8(FP), BP MOVL y+8(FP), BP
@ -127,7 +127,7 @@ E5: CMPL BX, $0 // i < 0
// func addMulVVW_s(z, x *Word, y Word, n int) (c Word) // func addMulVVW_s(z, x *Word, y Word, n int) (c Word)
TEXT big·addMulVVW_s(SB),7,$0 TEXT ·addMulVVW_s(SB),7,$0
MOVL z+0(FP), DI MOVL z+0(FP), DI
MOVL x+4(FP), SI MOVL x+4(FP), SI
MOVL y+8(FP), BP MOVL y+8(FP), BP
@ -156,7 +156,7 @@ E6: CMPL BX, $0 // i < 0
// divWVW_s(z* Word, xn Word, x *Word, y Word, n int) (r Word) // divWVW_s(z* Word, xn Word, x *Word, y Word, n int) (r Word)
TEXT big·divWVW_s(SB),7,$0 TEXT ·divWVW_s(SB),7,$0
MOVL z+0(FP), DI MOVL z+0(FP), DI
MOVL xn+4(FP), DX // r = xn MOVL xn+4(FP), DX // r = xn
MOVL x+8(FP), SI MOVL x+8(FP), SI

View File

@ -8,7 +8,7 @@
// TODO(gri) - experiment with unrolled loops for faster execution // TODO(gri) - experiment with unrolled loops for faster execution
// func addVV_s(z, x, y *Word, n int) (c Word) // func addVV_s(z, x, y *Word, n int) (c Word)
TEXT big·addVV_s(SB),7,$0 TEXT ·addVV_s(SB),7,$0
MOVQ z+0(FP), R10 MOVQ z+0(FP), R10
MOVQ x+8(FP), R8 MOVQ x+8(FP), R8
MOVQ y+16(FP), R9 MOVQ y+16(FP), R9
@ -33,7 +33,7 @@ E1: CMPQ BX, R11 // i < n
// func subVV_s(z, x, y *Word, n int) (c Word) // func subVV_s(z, x, y *Word, n int) (c Word)
// (same as addVV_s except for SBBQ instead of ADCQ and label names) // (same as addVV_s except for SBBQ instead of ADCQ and label names)
TEXT big·subVV_s(SB),7,$0 TEXT ·subVV_s(SB),7,$0
MOVQ z+0(FP), R10 MOVQ z+0(FP), R10
MOVQ x+8(FP), R8 MOVQ x+8(FP), R8
MOVQ y+16(FP), R9 MOVQ y+16(FP), R9
@ -57,7 +57,7 @@ E2: CMPQ BX, R11 // i < n
// func addVW_s(z, x *Word, y Word, n int) (c Word) // func addVW_s(z, x *Word, y Word, n int) (c Word)
TEXT big·addVW_s(SB),7,$0 TEXT ·addVW_s(SB),7,$0
MOVQ z+0(FP), R10 MOVQ z+0(FP), R10
MOVQ x+8(FP), R8 MOVQ x+8(FP), R8
MOVQ y+16(FP), AX // c = y MOVQ y+16(FP), AX // c = y
@ -79,7 +79,7 @@ E3: CMPQ BX, R11 // i < n
// func subVW_s(z, x *Word, y Word, n int) (c Word) // func subVW_s(z, x *Word, y Word, n int) (c Word)
TEXT big·subVW_s(SB),7,$0 TEXT ·subVW_s(SB),7,$0
MOVQ z+0(FP), R10 MOVQ z+0(FP), R10
MOVQ x+8(FP), R8 MOVQ x+8(FP), R8
MOVQ y+16(FP), AX // c = y MOVQ y+16(FP), AX // c = y
@ -102,7 +102,7 @@ E4: CMPQ BX, R11 // i < n
// func mulAddVWW_s(z, x *Word, y, r Word, n int) (c Word) // func mulAddVWW_s(z, x *Word, y, r Word, n int) (c Word)
TEXT big·mulAddVWW_s(SB),7,$0 TEXT ·mulAddVWW_s(SB),7,$0
MOVQ z+0(FP), R10 MOVQ z+0(FP), R10
MOVQ x+8(FP), R8 MOVQ x+8(FP), R8
MOVQ y+16(FP), R9 MOVQ y+16(FP), R9
@ -127,7 +127,7 @@ E5: CMPQ BX, R11 // i < n
// func addMulVVW_s(z, x *Word, y Word, n int) (c Word) // func addMulVVW_s(z, x *Word, y Word, n int) (c Word)
TEXT big·addMulVVW_s(SB),7,$0 TEXT ·addMulVVW_s(SB),7,$0
MOVQ z+0(FP), R10 MOVQ z+0(FP), R10
MOVQ x+8(FP), R8 MOVQ x+8(FP), R8
MOVQ y+16(FP), R9 MOVQ y+16(FP), R9
@ -154,7 +154,7 @@ E6: CMPQ BX, R11 // i < n
// divWVW_s(z* Word, xn Word, x *Word, y Word, n int) (r Word) // divWVW_s(z* Word, xn Word, x *Word, y Word, n int) (r Word)
TEXT big·divWVW_s(SB),7,$0 TEXT ·divWVW_s(SB),7,$0
MOVQ z+0(FP), R10 MOVQ z+0(FP), R10
MOVQ xn+8(FP), DX // r = xn MOVQ xn+8(FP), DX // r = xn
MOVQ x+16(FP), R8 MOVQ x+16(FP), R8

View File

@ -6,24 +6,24 @@
// arithmetic operations on vectors implemented in arith.go. // arithmetic operations on vectors implemented in arith.go.
// TODO(gri) Implement these routines. // TODO(gri) Implement these routines.
TEXT big·addVV_s(SB),7,$0 TEXT ·addVV_s(SB),7,$0
B big·addVV_g(SB) B ·addVV_g(SB)
TEXT big·subVV_s(SB),7,$0 TEXT ·subVV_s(SB),7,$0
B big·subVV_g(SB) B ·subVV_g(SB)
TEXT big·addVW_s(SB),7,$0 TEXT ·addVW_s(SB),7,$0
B big·addVW_g(SB) B ·addVW_g(SB)
TEXT big·subVW_s(SB),7,$0 TEXT ·subVW_s(SB),7,$0
B big·subVW_g(SB) B ·subVW_g(SB)
TEXT big·mulAddVWW_s(SB),7,$0 TEXT ·mulAddVWW_s(SB),7,$0
B big·mulAddVWW_g(SB) B ·mulAddVWW_g(SB)
TEXT big·addMulVVW_s(SB),7,$0 TEXT ·addMulVVW_s(SB),7,$0
B big·addMulVVW_g(SB) B ·addMulVVW_g(SB)
TEXT big·divWVW_s(SB),7,$0 TEXT ·divWVW_s(SB),7,$0
B big·divWVW_g(SB) B ·divWVW_g(SB)

View File

@ -8,7 +8,7 @@
// func Mul128(x, y uint64) (z1, z0 uint64) // func Mul128(x, y uint64) (z1, z0 uint64)
// z1<<64 + z0 = x*y // z1<<64 + z0 = x*y
// //
TEXT bignum·Mul128(SB),7,$0 TEXT ·Mul128(SB),7,$0
MOVQ a+0(FP), AX MOVQ a+0(FP), AX
MULQ a+8(FP) MULQ a+8(FP)
MOVQ DX, a+16(FP) MOVQ DX, a+16(FP)
@ -19,7 +19,7 @@ TEXT bignum·Mul128(SB),7,$0
// func MulAdd128(x, y, c uint64) (z1, z0 uint64) // func MulAdd128(x, y, c uint64) (z1, z0 uint64)
// z1<<64 + z0 = x*y + c // z1<<64 + z0 = x*y + c
// //
TEXT bignum·MulAdd128(SB),7,$0 TEXT ·MulAdd128(SB),7,$0
MOVQ a+0(FP), AX MOVQ a+0(FP), AX
MULQ a+8(FP) MULQ a+8(FP)
ADDQ a+16(FP), AX ADDQ a+16(FP), AX
@ -32,7 +32,7 @@ TEXT bignum·MulAdd128(SB),7,$0
// func Div128(x1, x0, y uint64) (q, r uint64) // func Div128(x1, x0, y uint64) (q, r uint64)
// q = (x1<<64 + x0)/y + r // q = (x1<<64 + x0)/y + r
// //
TEXT bignum·Div128(SB),7,$0 TEXT ·Div128(SB),7,$0
MOVQ a+0(FP), DX MOVQ a+0(FP), DX
MOVQ a+8(FP), AX MOVQ a+8(FP), AX
DIVQ a+16(FP) DIVQ a+16(FP)

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
TEXT bytes·IndexByte(SB),7,$0 TEXT ·IndexByte(SB),7,$0
MOVL p+0(FP), SI MOVL p+0(FP), SI
MOVL len+4(FP), CX MOVL len+4(FP), CX
MOVB b+12(FP), AL MOVB b+12(FP), AL

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
TEXT bytes·IndexByte(SB),7,$0 TEXT ·IndexByte(SB),7,$0
MOVQ p+0(FP), SI MOVQ p+0(FP), SI
MOVL len+8(FP), CX MOVL len+8(FP), CX
MOVB b+16(FP), AL MOVB b+16(FP), AL

View File

@ -3,6 +3,6 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// no memchr implementation on arm yet // no memchr implementation on arm yet
TEXT bytes·IndexByte(SB),7,$0 TEXT ·IndexByte(SB),7,$0
B bytes·indexBytePortable(SB) B ·indexBytePortable(SB)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Asin(x float64) float64 // func Asin(x float64) float64
TEXT math·Asin(SB),7,$0 TEXT ·Asin(SB),7,$0
FMOVD x+0(FP), F0 // F0=sin(x) FMOVD x+0(FP), F0 // F0=sin(x)
FMOVD F0, F1 // F0=sin(x), F1=sin(x) FMOVD F0, F1 // F0=sin(x), F1=sin(x)
FMULD F0, F0 // F0=sin(x)*sin(x), F1=sin(x) FMULD F0, F0 // F0=sin(x)*sin(x), F1=sin(x)
@ -15,7 +15,7 @@ TEXT math·Asin(SB),7,$0
RET RET
// func Acos(x float64) float64 // func Acos(x float64) float64
TEXT math·Acos(SB),7,$0 TEXT ·Acos(SB),7,$0
FMOVD x+0(FP), F0 // F0=cos(x) FMOVD x+0(FP), F0 // F0=cos(x)
FMOVD F0, F1 // F0=cos(x), F1=cos(x) FMOVD F0, F1 // F0=cos(x), F1=cos(x)
FMULD F0, F0 // F0=cos(x)*cos(x), F1=cos(x) FMULD F0, F0 // F0=cos(x)*cos(x), F1=cos(x)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Atan(x float64) float64 // func Atan(x float64) float64
TEXT math·Atan(SB),7,$0 TEXT ·Atan(SB),7,$0
FMOVD x+0(FP), F0 // F0=x FMOVD x+0(FP), F0 // F0=x
FLD1 // F0=1, F1=x FLD1 // F0=1, F1=x
FPATAN // F0=atan(F1/F0) FPATAN // F0=atan(F1/F0)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Exp(x float64) float64 // func Exp(x float64) float64
TEXT math·Exp(SB),7,$0 TEXT ·Exp(SB),7,$0
// test bits for not-finite // test bits for not-finite
MOVL x+4(FP), AX MOVL x+4(FP), AX
ANDL $0x7ff00000, AX ANDL $0x7ff00000, AX

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Fabs(x float64) float64 // func Fabs(x float64) float64
TEXT math·Fabs(SB),7,$0 TEXT ·Fabs(SB),7,$0
FMOVD x+0(FP), F0 // F0=x FMOVD x+0(FP), F0 // F0=x
FABS // F0=|x| FABS // F0=|x|
FMOVDP F0, r+8(FP) FMOVDP F0, r+8(FP)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Ceil(x float64) float64 // func Ceil(x float64) float64
TEXT math·Ceil(SB),7,$0 TEXT ·Ceil(SB),7,$0
FMOVD x+0(FP), F0 // F0=x FMOVD x+0(FP), F0 // F0=x
FSTCW -2(SP) // save old Control Word FSTCW -2(SP) // save old Control Word
MOVW -2(SP), AX MOVW -2(SP), AX
@ -17,7 +17,7 @@ TEXT math·Ceil(SB),7,$0
RET RET
// func Floor(x float64) float64 // func Floor(x float64) float64
TEXT math·Floor(SB),7,$0 TEXT ·Floor(SB),7,$0
FMOVD x+0(FP), F0 // F0=x FMOVD x+0(FP), F0 // F0=x
FSTCW -2(SP) // save old Control Word FSTCW -2(SP) // save old Control Word
MOVW -2(SP), AX MOVW -2(SP), AX

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Log(x float64) float64 // func Log(x float64) float64
TEXT math·Log(SB),7,$0 TEXT ·Log(SB),7,$0
FLDLN2 // F0=log(2) FLDLN2 // F0=log(2)
FMOVD x+0(FP), F0 // F0=x, F1=log(2) FMOVD x+0(FP), F0 // F0=x, F1=log(2)
FYL2X // F0=log(x)=log2(x)*log(2) FYL2X // F0=log(x)=log2(x)*log(2)
@ -11,7 +11,7 @@ TEXT math·Log(SB),7,$0
RET RET
// func Log10(x float64) float64 // func Log10(x float64) float64
TEXT math·Log10(SB),7,$0 TEXT ·Log10(SB),7,$0
FLDLG2 // F0=log10(2) FLDLG2 // F0=log10(2)
FMOVD x+0(FP), F0 // F0=x, F1=log10(2) FMOVD x+0(FP), F0 // F0=x, F1=log10(2)
FYL2X // F0=log10(x)=log2(x)*log10(2) FYL2X // F0=log10(x)=log2(x)*log10(2)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Cos(x float64) float64 // func Cos(x float64) float64
TEXT math·Cos(SB),7,$0 TEXT ·Cos(SB),7,$0
FMOVD x+0(FP), F0 // F0=x FMOVD x+0(FP), F0 // F0=x
FCOS // F0=cos(x) if -2**63 < x < 2**63 FCOS // F0=cos(x) if -2**63 < x < 2**63
FSTSW AX // AX=status word FSTSW AX // AX=status word
@ -24,7 +24,7 @@ TEXT math·Cos(SB),7,$0
RET RET
// func Sin(x float64) float64 // func Sin(x float64) float64
TEXT math·Sin(SB),7,$0 TEXT ·Sin(SB),7,$0
FMOVD x+0(FP), F0 // F0=x FMOVD x+0(FP), F0 // F0=x
FSIN // F0=sin(x) if -2**63 < x < 2**63 FSIN // F0=sin(x) if -2**63 < x < 2**63
FSTSW AX // AX=status word FSTSW AX // AX=status word

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Sqrt(x float64) float64 // func Sqrt(x float64) float64
TEXT math·Sqrt(SB),7,$0 TEXT ·Sqrt(SB),7,$0
FMOVD x+0(FP),F0 FMOVD x+0(FP),F0
FSQRT FSQRT
FMOVDP F0,r+8(FP) FMOVDP F0,r+8(FP)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Sqrt(x float64) float64 // func Sqrt(x float64) float64
TEXT math·Sqrt(SB),7,$0 TEXT ·Sqrt(SB),7,$0
MOVSD x+0(FP), X0 MOVSD x+0(FP), X0
SQRTSD X0, X0 SQRTSD X0, X0
MOVSD X0, r+8(FP) MOVSD X0, r+8(FP)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// func Tan(x float64) float64 // func Tan(x float64) float64
TEXT math·Tan(SB),7,$0 TEXT ·Tan(SB),7,$0
FMOVD x+0(FP), F0 // F0=x FMOVD x+0(FP), F0 // F0=x
FPTAN // F0=1, F1=tan(x) if -2**63 < x < 2**63 FPTAN // F0=1, F1=tan(x) if -2**63 < x < 2**63
FSTSW AX // AX=status word FSTSW AX // AX=status word

View File

@ -66,7 +66,7 @@ ok:
// create a new goroutine to start program // create a new goroutine to start program
PUSHL $mainstart(SB) // entry PUSHL $mainstart(SB) // entry
PUSHL $0 // arg size PUSHL $0 // arg size
CALL runtime·newproc(SB) CALL ·newproc(SB)
POPL AX POPL AX
POPL AX POPL AX
@ -142,7 +142,7 @@ TEXT gogocall(SB), 7, $0
*/ */
// Called during function prolog when more stack is needed. // Called during function prolog when more stack is needed.
TEXT runtime·morestack(SB),7,$0 TEXT ·morestack(SB),7,$0
// Cannot grow scheduler stack (m->g0). // Cannot grow scheduler stack (m->g0).
get_tls(CX) get_tls(CX)
MOVL m(CX), BX MOVL m(CX), BX
@ -224,7 +224,7 @@ TEXT reflect·call(SB), 7, $0
// Return point when leaving stack. // Return point when leaving stack.
TEXT runtime·lessstack(SB), 7, $0 TEXT ·lessstack(SB), 7, $0
// Save return value in m->cret // Save return value in m->cret
get_tls(CX) get_tls(CX)
MOVL m(CX), BX MOVL m(CX), BX
@ -289,7 +289,7 @@ TEXT jmpdefer(SB), 7, $0
SUBL $5, (SP) // return to CALL again SUBL $5, (SP) // return to CALL again
JMP AX // but first run the deferred function JMP AX // but first run the deferred function
TEXT runtime·memclr(SB),7,$0 TEXT ·memclr(SB),7,$0
MOVL 4(SP), DI // arg 1 addr MOVL 4(SP), DI // arg 1 addr
MOVL 8(SP), CX // arg 2 count MOVL 8(SP), CX // arg 2 count
ADDL $3, CX ADDL $3, CX
@ -300,12 +300,12 @@ TEXT runtime·memclr(SB),7,$0
STOSL STOSL
RET RET
TEXT runtime·getcallerpc+0(SB),7,$0 TEXT ·getcallerpc+0(SB),7,$0
MOVL x+0(FP),AX // addr of first arg MOVL x+0(FP),AX // addr of first arg
MOVL -4(AX),AX // get calling pc MOVL -4(AX),AX // get calling pc
RET RET
TEXT runtime·setcallerpc+0(SB),7,$0 TEXT ·setcallerpc+0(SB),7,$0
MOVL x+0(FP),AX // addr of first arg MOVL x+0(FP),AX // addr of first arg
MOVL x+4(FP), BX MOVL x+4(FP), BX
MOVL BX, -4(AX) // set calling pc MOVL BX, -4(AX) // set calling pc

View File

@ -9,7 +9,7 @@
// fn func(arg0, arg1, arg2 *ptr, callerpc uintptr, xxx) yyy, // fn func(arg0, arg1, arg2 *ptr, callerpc uintptr, xxx) yyy,
// arg0, arg1, arg2 *ptr) (func(xxx) yyy) // arg0, arg1, arg2 *ptr) (func(xxx) yyy)
void void
runtime·closure(int32 siz, byte *fn, byte *arg0) ·closure(int32 siz, byte *fn, byte *arg0)
{ {
byte *p, *q, **ret; byte *p, *q, **ret;
int32 i, n; int32 i, n;

View File

@ -27,7 +27,7 @@ traceback(byte *pc0, byte *sp, G *g)
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
for(n=0; n<100; n++) { for(n=0; n<100; n++) {
if(pc == (uint64)runtime·lessstack) { if(pc == (uint64)·lessstack) {
// printf("--\n"); // printf("--\n");
// pop to earlier stack block // pop to earlier stack block
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
@ -68,7 +68,7 @@ traceback(byte *pc0, byte *sp, G *g)
for(i = 0; i < f->args; i++) { for(i = 0; i < f->args; i++) {
if(i != 0) if(i != 0)
prints(", "); prints(", ");
runtime·printhex(((uint32*)sp)[i]); ·printhex(((uint32*)sp)[i]);
if(i >= 4) { if(i >= 4) {
prints(", ..."); prints(", ...");
break; break;
@ -85,7 +85,7 @@ traceback(byte *pc0, byte *sp, G *g)
// func caller(n int) (pc uintptr, file string, line int, ok bool) // func caller(n int) (pc uintptr, file string, line int, ok bool)
void void
runtime·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retbool) ·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retbool)
{ {
uintptr pc; uintptr pc;
byte *sp; byte *sp;
@ -112,7 +112,7 @@ runtime·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retb
// now unwind n levels // now unwind n levels
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
while(n-- > 0) { while(n-- > 0) {
while(pc == (uintptr)runtime·lessstack) { while(pc == (uintptr)·lessstack) {
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
sp = stk->gobuf.sp; sp = stk->gobuf.sp;
stk = (Stktop*)stk->stackbase; stk = (Stktop*)stk->stackbase;

View File

@ -270,7 +270,7 @@ _divvu(Vlong *q, Vlong n, Vlong d)
} }
void void
runtime·uint64div(Vlong n, Vlong d, Vlong q) ·uint64div(Vlong n, Vlong d, Vlong q)
{ {
_divvu(&q, n, d); _divvu(&q, n, d);
} }
@ -288,7 +288,7 @@ _modvu(Vlong *r, Vlong n, Vlong d)
} }
void void
runtime·uint64mod(Vlong n, Vlong d, Vlong q) ·uint64mod(Vlong n, Vlong d, Vlong q)
{ {
_modvu(&q, n, d); _modvu(&q, n, d);
} }
@ -334,7 +334,7 @@ _divv(Vlong *q, Vlong n, Vlong d)
} }
void void
runtime·int64div(Vlong n, Vlong d, Vlong q) ·int64div(Vlong n, Vlong d, Vlong q)
{ {
_divv(&q, n, d); _divv(&q, n, d);
} }
@ -368,7 +368,7 @@ _modv(Vlong *r, Vlong n, Vlong d)
} }
void void
runtime·int64mod(Vlong n, Vlong d, Vlong q) ·int64mod(Vlong n, Vlong d, Vlong q)
{ {
_modv(&q, n, d); _modv(&q, n, d);
} }

View File

@ -37,7 +37,7 @@ TEXT _rt0_amd64(SB),7,$-8
// create a new goroutine to start program // create a new goroutine to start program
PUSHQ $mainstart(SB) // entry PUSHQ $mainstart(SB) // entry
PUSHQ $0 // arg size PUSHQ $0 // arg size
CALL runtime·newproc(SB) CALL ·newproc(SB)
POPQ AX POPQ AX
POPQ AX POPQ AX
@ -107,7 +107,7 @@ TEXT gogocall(SB), 7, $0
*/ */
// Called during function prolog when more stack is needed. // Called during function prolog when more stack is needed.
TEXT runtime·morestack(SB),7,$0 TEXT ·morestack(SB),7,$0
// Called from f. // Called from f.
// Set m->morebuf to f's caller. // Set m->morebuf to f's caller.
MOVQ 8(SP), AX // f's caller's PC MOVQ 8(SP), AX // f's caller's PC
@ -165,7 +165,7 @@ TEXT reflect·call(SB), 7, $0
RET RET
// Return point when leaving stack. // Return point when leaving stack.
TEXT runtime·lessstack(SB), 7, $0 TEXT ·lessstack(SB), 7, $0
// Save return value in m->cret // Save return value in m->cret
MOVQ AX, m_cret(m) MOVQ AX, m_cret(m)
@ -177,66 +177,66 @@ TEXT runtime·lessstack(SB), 7, $0
RET RET
// morestack trampolines // morestack trampolines
TEXT runtime·morestack00+0(SB),7,$0 TEXT ·morestack00+0(SB),7,$0
MOVQ $0, AX MOVQ $0, AX
MOVQ AX, m_moreframe(m) MOVQ AX, m_moreframe(m)
MOVQ $runtime·morestack+0(SB), AX MOVQ $·morestack+0(SB), AX
JMP AX JMP AX
TEXT runtime·morestack01+0(SB),7,$0 TEXT ·morestack01+0(SB),7,$0
SHLQ $32, AX SHLQ $32, AX
MOVQ AX, m_moreframe(m) MOVQ AX, m_moreframe(m)
MOVQ $runtime·morestack+0(SB), AX MOVQ $·morestack+0(SB), AX
JMP AX JMP AX
TEXT runtime·morestack10+0(SB),7,$0 TEXT ·morestack10+0(SB),7,$0
MOVLQZX AX, AX MOVLQZX AX, AX
MOVQ AX, m_moreframe(m) MOVQ AX, m_moreframe(m)
MOVQ $runtime·morestack+0(SB), AX MOVQ $·morestack+0(SB), AX
JMP AX JMP AX
TEXT runtime·morestack11+0(SB),7,$0 TEXT ·morestack11+0(SB),7,$0
MOVQ AX, m_moreframe(m) MOVQ AX, m_moreframe(m)
MOVQ $runtime·morestack+0(SB), AX MOVQ $·morestack+0(SB), AX
JMP AX JMP AX
// subcases of morestack01 // subcases of morestack01
// with const of 8,16,...48 // with const of 8,16,...48
TEXT runtime·morestack8(SB),7,$0 TEXT ·morestack8(SB),7,$0
PUSHQ $1 PUSHQ $1
MOVQ $runtime·morestackx(SB), AX MOVQ $·morestackx(SB), AX
JMP AX JMP AX
TEXT runtime·morestack16(SB),7,$0 TEXT ·morestack16(SB),7,$0
PUSHQ $2 PUSHQ $2
MOVQ $runtime·morestackx(SB), AX MOVQ $·morestackx(SB), AX
JMP AX JMP AX
TEXT runtime·morestack24(SB),7,$0 TEXT ·morestack24(SB),7,$0
PUSHQ $3 PUSHQ $3
MOVQ $runtime·morestackx(SB), AX MOVQ $·morestackx(SB), AX
JMP AX JMP AX
TEXT runtime·morestack32(SB),7,$0 TEXT ·morestack32(SB),7,$0
PUSHQ $4 PUSHQ $4
MOVQ $runtime·morestackx(SB), AX MOVQ $·morestackx(SB), AX
JMP AX JMP AX
TEXT runtime·morestack40(SB),7,$0 TEXT ·morestack40(SB),7,$0
PUSHQ $5 PUSHQ $5
MOVQ $runtime·morestackx(SB), AX MOVQ $·morestackx(SB), AX
JMP AX JMP AX
TEXT runtime·morestack48(SB),7,$0 TEXT ·morestack48(SB),7,$0
PUSHQ $6 PUSHQ $6
MOVQ $runtime·morestackx(SB), AX MOVQ $·morestackx(SB), AX
JMP AX JMP AX
TEXT runtime·morestackx(SB),7,$0 TEXT ·morestackx(SB),7,$0
POPQ AX POPQ AX
SHLQ $35, AX SHLQ $35, AX
MOVQ AX, m_moreframe(m) MOVQ AX, m_moreframe(m)
MOVQ $runtime·morestack(SB), AX MOVQ $·morestack(SB), AX
JMP AX JMP AX
// bool cas(int32 *val, int32 old, int32 new) // bool cas(int32 *val, int32 old, int32 new)

View File

@ -9,7 +9,7 @@
// fn func(arg0, arg1, arg2 *ptr, callerpc uintptr, xxx) yyy, // fn func(arg0, arg1, arg2 *ptr, callerpc uintptr, xxx) yyy,
// arg0, arg1, arg2 *ptr) (func(xxx) yyy) // arg0, arg1, arg2 *ptr) (func(xxx) yyy)
void void
runtime·closure(int32 siz, byte *fn, byte *arg0) ·closure(int32 siz, byte *fn, byte *arg0)
{ {
byte *p, *q, **ret; byte *p, *q, **ret;
int32 i, n; int32 i, n;

View File

@ -24,7 +24,7 @@ traceback(byte *pc0, byte *sp, G *g)
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
for(n=0; n<100; n++) { for(n=0; n<100; n++) {
if(pc == (uint64)runtime·lessstack) { if(pc == (uint64)·lessstack) {
// pop to earlier stack block // pop to earlier stack block
// printf("-- stack jump %p => %p\n", sp, stk->gobuf.sp); // printf("-- stack jump %p => %p\n", sp, stk->gobuf.sp);
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
@ -65,7 +65,7 @@ traceback(byte *pc0, byte *sp, G *g)
for(i = 0; i < f->args; i++) { for(i = 0; i < f->args; i++) {
if(i != 0) if(i != 0)
prints(", "); prints(", ");
runtime·printhex(((uint32*)sp)[i]); ·printhex(((uint32*)sp)[i]);
if(i >= 4) { if(i >= 4) {
prints(", ..."); prints(", ...");
break; break;
@ -82,7 +82,7 @@ traceback(byte *pc0, byte *sp, G *g)
// func caller(n int) (pc uint64, file string, line int, ok bool) // func caller(n int) (pc uint64, file string, line int, ok bool)
void void
runtime·Caller(int32 n, uint64 retpc, String retfile, int32 retline, bool retbool) ·Caller(int32 n, uint64 retpc, String retfile, int32 retline, bool retbool)
{ {
uint64 pc; uint64 pc;
byte *sp; byte *sp;
@ -109,7 +109,7 @@ runtime·Caller(int32 n, uint64 retpc, String retfile, int32 retline, bool retbo
// now unwind n levels // now unwind n levels
stk = (Stktop*)g->stackbase; stk = (Stktop*)g->stackbase;
while(n-- > 0) { while(n-- > 0) {
while(pc == (uintptr)runtime·lessstack) { while(pc == (uintptr)·lessstack) {
pc = (uintptr)stk->gobuf.pc; pc = (uintptr)stk->gobuf.pc;
sp = stk->gobuf.sp; sp = stk->gobuf.sp;
stk = (Stktop*)stk->stackbase; stk = (Stktop*)stk->stackbase;

View File

@ -49,7 +49,7 @@ TEXT _rt0_arm(SB),7,$-4
MOVW.W R0, -4(R13) MOVW.W R0, -4(R13)
MOVW $0, R0 MOVW $0, R0
MOVW.W R0, -4(R13) // push $0 as guard MOVW.W R0, -4(R13) // push $0 as guard
BL runtime·newproc(SB) BL ·newproc(SB)
MOVW $12(R13), R13 // pop args and LR MOVW $12(R13), R13 // pop args and LR
// start this M // start this M
@ -136,7 +136,7 @@ TEXT gogocall(SB), 7, $-4
// NB. we do not save R0 because the we've forced 5c to pass all arguments // NB. we do not save R0 because the we've forced 5c to pass all arguments
// on the stack. // on the stack.
// using frame size $-4 means do not save LR on stack. // using frame size $-4 means do not save LR on stack.
TEXT runtime·morestack(SB),7,$-4 TEXT ·morestack(SB),7,$-4
// Cannot grow scheduler stack (m->g0). // Cannot grow scheduler stack (m->g0).
MOVW m_g0(m), R4 MOVW m_g0(m), R4
CMP g, R4 CMP g, R4
@ -197,7 +197,7 @@ TEXT reflect·call(SB), 7, $-4
// Return point when leaving stack. // Return point when leaving stack.
// using frame size $-4 means do not save LR on stack. // using frame size $-4 means do not save LR on stack.
TEXT runtime·lessstack(SB), 7, $-4 TEXT ·lessstack(SB), 7, $-4
// Save return value in m->cret // Save return value in m->cret
MOVW R0, m_cret(m) MOVW R0, m_cret(m)
@ -219,7 +219,7 @@ TEXT jmpdefer(SB), 7, $0
MOVW $-4(R1), SP // correct for sp pointing to arg0, past stored lr MOVW $-4(R1), SP // correct for sp pointing to arg0, past stored lr
B (R0) B (R0)
TEXT runtime·memclr(SB),7,$20 TEXT ·memclr(SB),7,$20
MOVW 0(FP), R0 MOVW 0(FP), R0
MOVW $0, R1 // c = 0 MOVW $0, R1 // c = 0
MOVW R1, -16(SP) MOVW R1, -16(SP)
@ -232,11 +232,11 @@ TEXT runtime·memclr(SB),7,$20
MOVW -4(SP), g MOVW -4(SP), g
RET RET
TEXT runtime·getcallerpc+0(SB),7,$-4 TEXT ·getcallerpc+0(SB),7,$-4
MOVW 0(SP), R0 MOVW 0(SP), R0
RET RET
TEXT runtime·setcallerpc+0(SB),7,$-4 TEXT ·setcallerpc+0(SB),7,$-4
MOVW x+4(FP), R0 MOVW x+4(FP), R0
MOVW R0, 0(SP) MOVW R0, 0(SP)
RET RET

View File

@ -47,7 +47,7 @@ extern void cacheflush(byte* start, byte* end);
#pragma textflag 7 #pragma textflag 7
void void
runtime·closure(int32 siz, byte *fn, byte *arg0) ·closure(int32 siz, byte *fn, byte *arg0)
{ {
byte *p, *q, **ret; byte *p, *q, **ret;
uint32 *pc; uint32 *pc;

View File

@ -65,7 +65,7 @@ traceback(byte *pc0, byte *sp, G *g)
// for(i = 0; i < f->args; i++) { // for(i = 0; i < f->args; i++) {
// if(i != 0) // if(i != 0)
// prints(", "); // prints(", ");
// runtime·printhex(((uint32*)sp)[i]); // ·printhex(((uint32*)sp)[i]);
// if(i >= 4) { // if(i >= 4) {
// prints(", ..."); // prints(", ...");
// break; // break;
@ -82,7 +82,7 @@ traceback(byte *pc0, byte *sp, G *g)
// func caller(n int) (pc uintptr, file string, line int, ok bool) // func caller(n int) (pc uintptr, file string, line int, ok bool)
void void
runtime·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retbool) ·Caller(int32 n, uintptr retpc, String retfile, int32 retline, bool retbool)
{ {
// uintptr pc; // uintptr pc;
// byte *sp; // byte *sp;

View File

@ -143,7 +143,7 @@ _f2v(Vlong *y, float f)
} }
void void
runtime·float64toint64(double d, Vlong y) ·float64toint64(double d, Vlong y)
{ {
_d2v(&y, d); _d2v(&y, d);
} }
@ -169,7 +169,7 @@ _v2f(Vlong x)
} }
void void
runtime·int64tofloat64(Vlong y, double d) ·int64tofloat64(Vlong y, double d)
{ {
d = _v2d(y); d = _v2d(y);
} }
@ -250,7 +250,7 @@ _divvu(Vlong *q, Vlong n, Vlong d)
} }
void void
runtime·uint64div(Vlong n, Vlong d, Vlong q) ·uint64div(Vlong n, Vlong d, Vlong q)
{ {
_divvu(&q, n, d); _divvu(&q, n, d);
} }
@ -268,7 +268,7 @@ _modvu(Vlong *r, Vlong n, Vlong d)
} }
void void
runtime·uint64mod(Vlong n, Vlong d, Vlong q) ·uint64mod(Vlong n, Vlong d, Vlong q)
{ {
_modvu(&q, n, d); _modvu(&q, n, d);
} }
@ -313,7 +313,7 @@ _divv(Vlong *q, Vlong n, Vlong d)
} }
void void
runtime·int64div(Vlong n, Vlong d, Vlong q) ·int64div(Vlong n, Vlong d, Vlong q)
{ {
_divv(&q, n, d); _divv(&q, n, d);
} }
@ -340,7 +340,7 @@ _modv(Vlong *r, Vlong n, Vlong d)
} }
void void
runtime·int64mod(Vlong n, Vlong d, Vlong q) ·int64mod(Vlong n, Vlong d, Vlong q)
{ {
_modv(&q, n, d); _modv(&q, n, d);
} }

View File

@ -7,8 +7,8 @@
void *initcgo; /* filled in by dynamic linker when Cgo is available */ void *initcgo; /* filled in by dynamic linker when Cgo is available */
int64 ncgocall; int64 ncgocall;
void runtime·entersyscall(void); void ·entersyscall(void);
void runtime·exitsyscall(void); void ·exitsyscall(void);
void void
cgocall(void (*fn)(void*), void *arg) cgocall(void (*fn)(void*), void *arg)
@ -24,14 +24,14 @@ cgocall(void (*fn)(void*), void *arg)
* M to run goroutines while we are in the * M to run goroutines while we are in the
* foreign code. * foreign code.
*/ */
runtime·entersyscall(); ·entersyscall();
runcgo(fn, arg); runcgo(fn, arg);
runtime·exitsyscall(); ·exitsyscall();
return; return;
} }
void void
runtime·Cgocalls(int64 ret) ·Cgocalls(int64 ret)
{ {
ret = ncgocall; ret = ncgocall;
FLUSH(&ret); FLUSH(&ret);

View File

@ -95,7 +95,7 @@ makechan(Type *elem, uint32 hint)
if(elem->alg >= nelem(algarray)) { if(elem->alg >= nelem(algarray)) {
printf("chan(alg=%d)\n", elem->alg); printf("chan(alg=%d)\n", elem->alg);
throw("runtime·makechan: unsupported elem type"); throw("runtime.makechan: unsupported elem type");
} }
c = mal(sizeof(*c)); c = mal(sizeof(*c));
@ -126,15 +126,15 @@ makechan(Type *elem, uint32 hint)
if(debug) { if(debug) {
prints("makechan: chan="); prints("makechan: chan=");
runtime·printpointer(c); ·printpointer(c);
prints("; elemsize="); prints("; elemsize=");
runtime·printint(elem->size); ·printint(elem->size);
prints("; elemalg="); prints("; elemalg=");
runtime·printint(elem->alg); ·printint(elem->alg);
prints("; elemalign="); prints("; elemalign=");
runtime·printint(elem->align); ·printint(elem->align);
prints("; dataqsiz="); prints("; dataqsiz=");
runtime·printint(c->dataqsiz); ·printint(c->dataqsiz);
prints("\n"); prints("\n");
} }
@ -143,7 +143,7 @@ makechan(Type *elem, uint32 hint)
// makechan(elemsize uint32, elemalg uint32, hint uint32) (hchan *chan any); // makechan(elemsize uint32, elemalg uint32, hint uint32) (hchan *chan any);
void void
runtime·makechan(Type *elem, uint32 hint, Hchan *ret) ·makechan(Type *elem, uint32 hint, Hchan *ret)
{ {
ret = makechan(elem, hint); ret = makechan(elem, hint);
FLUSH(&ret); FLUSH(&ret);
@ -179,7 +179,7 @@ chansend(Hchan *c, byte *ep, bool *pres)
if(debug) { if(debug) {
prints("chansend: chan="); prints("chansend: chan=");
runtime·printpointer(c); ·printpointer(c);
prints("; elem="); prints("; elem=");
c->elemalg->print(c->elemsize, ep); c->elemalg->print(c->elemsize, ep);
prints("\n"); prints("\n");
@ -285,7 +285,7 @@ chanrecv(Hchan* c, byte *ep, bool* pres)
if(debug) { if(debug) {
prints("chanrecv: chan="); prints("chanrecv: chan=");
runtime·printpointer(c); ·printpointer(c);
prints("\n"); prints("\n");
} }
@ -385,7 +385,7 @@ closed:
// chansend1(hchan *chan any, elem any); // chansend1(hchan *chan any, elem any);
void void
runtime·chansend1(Hchan* c, ...) ·chansend1(Hchan* c, ...)
{ {
int32 o; int32 o;
byte *ae; byte *ae;
@ -397,7 +397,7 @@ runtime·chansend1(Hchan* c, ...)
// chansend2(hchan *chan any, elem any) (pres bool); // chansend2(hchan *chan any, elem any) (pres bool);
void void
runtime·chansend2(Hchan* c, ...) ·chansend2(Hchan* c, ...)
{ {
int32 o; int32 o;
byte *ae, *ap; byte *ae, *ap;
@ -412,7 +412,7 @@ runtime·chansend2(Hchan* c, ...)
// chanrecv1(hchan *chan any) (elem any); // chanrecv1(hchan *chan any) (elem any);
void void
runtime·chanrecv1(Hchan* c, ...) ·chanrecv1(Hchan* c, ...)
{ {
int32 o; int32 o;
byte *ae; byte *ae;
@ -425,7 +425,7 @@ runtime·chanrecv1(Hchan* c, ...)
// chanrecv2(hchan *chan any) (elem any, pres bool); // chanrecv2(hchan *chan any) (elem any, pres bool);
void void
runtime·chanrecv2(Hchan* c, ...) ·chanrecv2(Hchan* c, ...)
{ {
int32 o; int32 o;
byte *ae, *ap; byte *ae, *ap;
@ -440,7 +440,7 @@ runtime·chanrecv2(Hchan* c, ...)
// newselect(size uint32) (sel *byte); // newselect(size uint32) (sel *byte);
void void
runtime·newselect(int32 size, ...) ·newselect(int32 size, ...)
{ {
int32 n, o; int32 n, o;
Select **selp; Select **selp;
@ -459,16 +459,16 @@ runtime·newselect(int32 size, ...)
*selp = sel; *selp = sel;
if(debug) { if(debug) {
prints("newselect s="); prints("newselect s=");
runtime·printpointer(sel); ·printpointer(sel);
prints(" size="); prints(" size=");
runtime·printint(size); ·printint(size);
prints("\n"); prints("\n");
} }
} }
// selectsend(sel *byte, hchan *chan any, elem any) (selected bool); // selectsend(sel *byte, hchan *chan any, elem any) (selected bool);
void void
runtime·selectsend(Select *sel, Hchan *c, ...) ·selectsend(Select *sel, Hchan *c, ...)
{ {
int32 i, eo; int32 i, eo;
Scase *cas; Scase *cas;
@ -485,7 +485,7 @@ runtime·selectsend(Select *sel, Hchan *c, ...)
cas = mal(sizeof *cas + c->elemsize - sizeof(cas->u.elem)); cas = mal(sizeof *cas + c->elemsize - sizeof(cas->u.elem));
sel->scase[i] = cas; sel->scase[i] = cas;
cas->pc = runtime·getcallerpc(&sel); cas->pc = ·getcallerpc(&sel);
cas->chan = c; cas->chan = c;
eo = rnd(sizeof(sel), sizeof(c)); eo = rnd(sizeof(sel), sizeof(c));
@ -498,22 +498,22 @@ runtime·selectsend(Select *sel, Hchan *c, ...)
if(debug) { if(debug) {
prints("selectsend s="); prints("selectsend s=");
runtime·printpointer(sel); ·printpointer(sel);
prints(" pc="); prints(" pc=");
runtime·printpointer(cas->pc); ·printpointer(cas->pc);
prints(" chan="); prints(" chan=");
runtime·printpointer(cas->chan); ·printpointer(cas->chan);
prints(" so="); prints(" so=");
runtime·printint(cas->so); ·printint(cas->so);
prints(" send="); prints(" send=");
runtime·printint(cas->send); ·printint(cas->send);
prints("\n"); prints("\n");
} }
} }
// selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool); // selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool);
void void
runtime·selectrecv(Select *sel, Hchan *c, ...) ·selectrecv(Select *sel, Hchan *c, ...)
{ {
int32 i, eo; int32 i, eo;
Scase *cas; Scase *cas;
@ -528,7 +528,7 @@ runtime·selectrecv(Select *sel, Hchan *c, ...)
sel->ncase = i+1; sel->ncase = i+1;
cas = mal(sizeof *cas); cas = mal(sizeof *cas);
sel->scase[i] = cas; sel->scase[i] = cas;
cas->pc = runtime·getcallerpc(&sel); cas->pc = ·getcallerpc(&sel);
cas->chan = c; cas->chan = c;
eo = rnd(sizeof(sel), sizeof(c)); eo = rnd(sizeof(sel), sizeof(c));
@ -539,15 +539,15 @@ runtime·selectrecv(Select *sel, Hchan *c, ...)
if(debug) { if(debug) {
prints("selectrecv s="); prints("selectrecv s=");
runtime·printpointer(sel); ·printpointer(sel);
prints(" pc="); prints(" pc=");
runtime·printpointer(cas->pc); ·printpointer(cas->pc);
prints(" chan="); prints(" chan=");
runtime·printpointer(cas->chan); ·printpointer(cas->chan);
prints(" so="); prints(" so=");
runtime·printint(cas->so); ·printint(cas->so);
prints(" send="); prints(" send=");
runtime·printint(cas->send); ·printint(cas->send);
prints("\n"); prints("\n");
} }
} }
@ -555,7 +555,7 @@ runtime·selectrecv(Select *sel, Hchan *c, ...)
// selectdefaul(sel *byte) (selected bool); // selectdefaul(sel *byte) (selected bool);
void void
runtime·selectdefault(Select *sel, ...) ·selectdefault(Select *sel, ...)
{ {
int32 i; int32 i;
Scase *cas; Scase *cas;
@ -566,7 +566,7 @@ runtime·selectdefault(Select *sel, ...)
sel->ncase = i+1; sel->ncase = i+1;
cas = mal(sizeof *cas); cas = mal(sizeof *cas);
sel->scase[i] = cas; sel->scase[i] = cas;
cas->pc = runtime·getcallerpc(&sel); cas->pc = ·getcallerpc(&sel);
cas->chan = nil; cas->chan = nil;
cas->so = rnd(sizeof(sel), Structrnd); cas->so = rnd(sizeof(sel), Structrnd);
@ -575,13 +575,13 @@ runtime·selectdefault(Select *sel, ...)
if(debug) { if(debug) {
prints("selectdefault s="); prints("selectdefault s=");
runtime·printpointer(sel); ·printpointer(sel);
prints(" pc="); prints(" pc=");
runtime·printpointer(cas->pc); ·printpointer(cas->pc);
prints(" so="); prints(" so=");
runtime·printint(cas->so); ·printint(cas->so);
prints(" send="); prints(" send=");
runtime·printint(cas->send); ·printint(cas->send);
prints("\n"); prints("\n");
} }
} }
@ -628,7 +628,7 @@ selunlock(Select *sel)
// selectgo(sel *byte); // selectgo(sel *byte);
void void
runtime·selectgo(Select *sel) ·selectgo(Select *sel)
{ {
uint32 p, o, i, j; uint32 p, o, i, j;
Scase *cas, *dfl; Scase *cas, *dfl;
@ -642,7 +642,7 @@ runtime·selectgo(Select *sel)
if(debug) { if(debug) {
prints("selectgo: sel="); prints("selectgo: sel=");
runtime·printpointer(sel); ·printpointer(sel);
prints("\n"); prints("\n");
} }
@ -807,15 +807,15 @@ loop:
if(debug) { if(debug) {
prints("wait-return: sel="); prints("wait-return: sel=");
runtime·printpointer(sel); ·printpointer(sel);
prints(" c="); prints(" c=");
runtime·printpointer(c); ·printpointer(c);
prints(" cas="); prints(" cas=");
runtime·printpointer(cas); ·printpointer(cas);
prints(" send="); prints(" send=");
runtime·printint(cas->send); ·printint(cas->send);
prints(" o="); prints(" o=");
runtime·printint(o); ·printint(o);
prints("\n"); prints("\n");
} }
@ -857,11 +857,11 @@ gotr:
// recv path to wakeup the sender (sg) // recv path to wakeup the sender (sg)
if(debug) { if(debug) {
prints("gotr: sel="); prints("gotr: sel=");
runtime·printpointer(sel); ·printpointer(sel);
prints(" c="); prints(" c=");
runtime·printpointer(c); ·printpointer(c);
prints(" o="); prints(" o=");
runtime·printint(o); ·printint(o);
prints("\n"); prints("\n");
} }
if(cas->u.elemp != nil) if(cas->u.elemp != nil)
@ -882,11 +882,11 @@ gots:
// send path to wakeup the receiver (sg) // send path to wakeup the receiver (sg)
if(debug) { if(debug) {
prints("gots: sel="); prints("gots: sel=");
runtime·printpointer(sel); ·printpointer(sel);
prints(" c="); prints(" c=");
runtime·printpointer(c); ·printpointer(c);
prints(" o="); prints(" o=");
runtime·printint(o); ·printint(o);
prints("\n"); prints("\n");
} }
if(c->closed & Wclosed) if(c->closed & Wclosed)
@ -904,7 +904,7 @@ sclose:
retc: retc:
selunlock(sel); selunlock(sel);
runtime·setcallerpc(&sel, cas->pc); ·setcallerpc(&sel, cas->pc);
as = (byte*)&sel + cas->so; as = (byte*)&sel + cas->so;
freesel(sel); freesel(sel);
*as = true; *as = true;
@ -912,7 +912,7 @@ retc:
// closechan(sel *byte); // closechan(sel *byte);
void void
runtime·closechan(Hchan *c) ·closechan(Hchan *c)
{ {
SudoG *sg; SudoG *sg;
G* gp; G* gp;
@ -952,7 +952,7 @@ runtime·closechan(Hchan *c)
void void
chanclose(Hchan *c) chanclose(Hchan *c)
{ {
runtime·closechan(c); ·closechan(c);
} }
bool bool
@ -976,7 +976,7 @@ chancap(Hchan *c)
// closedchan(sel *byte) bool; // closedchan(sel *byte) bool;
void void
runtime·closedchan(Hchan *c, bool closed) ·closedchan(Hchan *c, bool closed)
{ {
closed = chanclosed(c); closed = chanclosed(c);
FLUSH(&closed); FLUSH(&closed);

View File

@ -35,7 +35,7 @@ TEXT write(SB),7,$0
CALL notok(SB) CALL notok(SB)
RET RET
TEXT runtime·mmap(SB),7,$0 TEXT ·mmap(SB),7,$0
MOVL $197, AX MOVL $197, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)

View File

@ -63,7 +63,7 @@ TEXT sigtramp(SB),7,$40
SYSCALL SYSCALL
INT $3 // not reached INT $3 // not reached
TEXT runtime·mmap(SB),7,$0 TEXT ·mmap(SB),7,$0
MOVQ 8(SP), DI // arg 1 addr MOVQ 8(SP), DI // arg 1 addr
MOVL 16(SP), SI // arg 2 len MOVL 16(SP), SI // arg 2 len
MOVL 20(SP), DX // arg 3 prot MOVL 20(SP), DX // arg 3 prot
@ -81,7 +81,7 @@ TEXT notok(SB),7,$0
MOVQ BP, (BP) MOVQ BP, (BP)
RET RET
TEXT runtime·memclr(SB),7,$0 TEXT ·memclr(SB),7,$0
MOVQ 8(SP), DI // arg 1 addr MOVQ 8(SP), DI // arg 1 addr
MOVL 16(SP), CX // arg 2 count MOVL 16(SP), CX // arg 2 count
ADDL $7, CX ADDL $7, CX
@ -92,12 +92,12 @@ TEXT runtime·memclr(SB),7,$0
STOSQ STOSQ
RET RET
TEXT runtime·getcallerpc+0(SB),7,$0 TEXT ·getcallerpc+0(SB),7,$0
MOVQ x+0(FP),AX // addr of first arg MOVQ x+0(FP),AX // addr of first arg
MOVQ -8(AX),AX // get calling pc MOVQ -8(AX),AX // get calling pc
RET RET
TEXT runtime·setcallerpc+0(SB),7,$0 TEXT ·setcallerpc+0(SB),7,$0
MOVQ x+0(FP),AX // addr of first arg MOVQ x+0(FP),AX // addr of first arg
MOVQ x+8(FP), BX MOVQ x+8(FP), BX
MOVQ BX, -8(AX) // set calling pc MOVQ BX, -8(AX) // set calling pc

View File

@ -236,7 +236,7 @@ machcall(MachHeader *h, int32 maxsize, int32 rxsize)
prints("send:\t"); prints("send:\t");
for(i=0; i<h->msgh_size/sizeof(p[0]); i++){ for(i=0; i<h->msgh_size/sizeof(p[0]); i++){
prints(" "); prints(" ");
runtime·printpointer((void*)p[i]); ·printpointer((void*)p[i]);
if(i%8 == 7) if(i%8 == 7)
prints("\n\t"); prints("\n\t");
} }
@ -249,7 +249,7 @@ machcall(MachHeader *h, int32 maxsize, int32 rxsize)
if(ret != 0){ if(ret != 0){
if(DebugMach){ if(DebugMach){
prints("mach_msg error "); prints("mach_msg error ");
runtime·printint(ret); ·printint(ret);
prints("\n"); prints("\n");
} }
return ret; return ret;
@ -260,7 +260,7 @@ machcall(MachHeader *h, int32 maxsize, int32 rxsize)
prints("recv:\t"); prints("recv:\t");
for(i=0; i<h->msgh_size/sizeof(p[0]); i++){ for(i=0; i<h->msgh_size/sizeof(p[0]); i++){
prints(" "); prints(" ");
runtime·printpointer((void*)p[i]); ·printpointer((void*)p[i]);
if(i%8 == 7) if(i%8 == 7)
prints("\n\t"); prints("\n\t");
} }
@ -271,9 +271,9 @@ machcall(MachHeader *h, int32 maxsize, int32 rxsize)
if(h->msgh_id != id+Reply){ if(h->msgh_id != id+Reply){
if(DebugMach){ if(DebugMach){
prints("mach_msg reply id mismatch "); prints("mach_msg reply id mismatch ");
runtime·printint(h->msgh_id); ·printint(h->msgh_id);
prints(" != "); prints(" != ");
runtime·printint(id+Reply); ·printint(id+Reply);
prints("\n"); prints("\n");
} }
return -303; // MIG_REPLY_MISMATCH return -303; // MIG_REPLY_MISMATCH
@ -290,7 +290,7 @@ machcall(MachHeader *h, int32 maxsize, int32 rxsize)
&& !(h->msgh_bits & MACH_MSGH_BITS_COMPLEX)){ && !(h->msgh_bits & MACH_MSGH_BITS_COMPLEX)){
if(DebugMach){ if(DebugMach){
prints("mig result "); prints("mig result ");
runtime·printint(c->code); ·printint(c->code);
prints("\n"); prints("\n");
} }
return c->code; return c->code;
@ -299,9 +299,9 @@ machcall(MachHeader *h, int32 maxsize, int32 rxsize)
if(h->msgh_size != rxsize){ if(h->msgh_size != rxsize){
if(DebugMach){ if(DebugMach){
prints("mach_msg reply size mismatch "); prints("mach_msg reply size mismatch ");
runtime·printint(h->msgh_size); ·printint(h->msgh_size);
prints(" != "); prints(" != ");
runtime·printint(rxsize); ·printint(rxsize);
prints("\n"); prints("\n");
} }
return -307; // MIG_ARRAY_TOO_LARGE return -307; // MIG_ARRAY_TOO_LARGE

View File

@ -66,7 +66,7 @@ TEXT notok(SB),7,$0
MOVL $0xf1, 0xf1 MOVL $0xf1, 0xf1
RET RET
TEXT runtime·mmap(SB),7,$-4 TEXT ·mmap(SB),7,$-4
MOVL $477, AX MOVL $477, AX
INT $0x80 INT $0x80
JAE 2(PC) JAE 2(PC)

View File

@ -76,7 +76,7 @@ TEXT sigtramp(SB),7,$24-16
CALL sighandler(SB) CALL sighandler(SB)
RET RET
TEXT runtime·mmap(SB),7,$-8 TEXT ·mmap(SB),7,$-8
MOVQ 8(SP), DI // arg 1 addr MOVQ 8(SP), DI // arg 1 addr
MOVL 16(SP), SI // arg 2 len MOVL 16(SP), SI // arg 2 len
MOVL 20(SP), DX // arg 3 prot MOVL 20(SP), DX // arg 3 prot
@ -94,7 +94,7 @@ TEXT notok(SB),7,$-8
MOVQ BP, (BP) MOVQ BP, (BP)
RET RET
TEXT runtime·memclr(SB),7,$-8 TEXT ·memclr(SB),7,$-8
MOVQ 8(SP), DI // arg 1 addr MOVQ 8(SP), DI // arg 1 addr
MOVL 16(SP), CX // arg 2 count MOVL 16(SP), CX // arg 2 count
ADDL $7, CX ADDL $7, CX
@ -105,12 +105,12 @@ TEXT runtime·memclr(SB),7,$-8
STOSQ STOSQ
RET RET
TEXT runtime·getcallerpc+0(SB),7,$0 TEXT ·getcallerpc+0(SB),7,$0
MOVQ x+0(FP),AX // addr of first arg MOVQ x+0(FP),AX // addr of first arg
MOVQ -8(AX),AX // get calling pc MOVQ -8(AX),AX // get calling pc
RET RET
TEXT runtime·setcallerpc+0(SB),7,$0 TEXT ·setcallerpc+0(SB),7,$0
MOVQ x+0(FP),AX // addr of first arg MOVQ x+0(FP),AX // addr of first arg
MOVQ x+8(FP), BX MOVQ x+8(FP), BX
MOVQ BX, -8(AX) // set calling pc MOVQ BX, -8(AX) // set calling pc

View File

@ -679,12 +679,12 @@ makemap(Type *key, Type *val, uint32 hint)
if(keyalg >= nelem(algarray) || algarray[keyalg].hash == nohash) { if(keyalg >= nelem(algarray) || algarray[keyalg].hash == nohash) {
printf("map(keyalg=%d)\n", keyalg); printf("map(keyalg=%d)\n", keyalg);
throw("runtime·makemap: unsupported map key type"); throw("runtime.makemap: unsupported map key type");
} }
if(valalg >= nelem(algarray)) { if(valalg >= nelem(algarray)) {
printf("map(valalg=%d)\n", valalg); printf("map(valalg=%d)\n", valalg);
throw("runtime·makemap: unsupported map value type"); throw("runtime.makemap: unsupported map value type");
} }
h = mal(sizeof(*h)); h = mal(sizeof(*h));
@ -733,7 +733,7 @@ makemap(Type *key, Type *val, uint32 hint)
// makemap(key, val *Type, hint uint32) (hmap *map[any]any); // makemap(key, val *Type, hint uint32) (hmap *map[any]any);
void void
runtime·makemap(Type *key, Type *val, uint32 hint, Hmap *ret) ·makemap(Type *key, Type *val, uint32 hint, Hmap *ret)
{ {
ret = makemap(key, val, hint); ret = makemap(key, val, hint);
FLUSH(&ret); FLUSH(&ret);
@ -759,7 +759,7 @@ mapaccess(Hmap *h, byte *ak, byte *av, bool *pres)
// mapaccess1(hmap *map[any]any, key any) (val any); // mapaccess1(hmap *map[any]any, key any) (val any);
void void
runtime·mapaccess1(Hmap *h, ...) ·mapaccess1(Hmap *h, ...)
{ {
byte *ak, *av; byte *ak, *av;
bool pres; bool pres;
@ -769,24 +769,24 @@ runtime·mapaccess1(Hmap *h, ...)
mapaccess(h, ak, av, &pres); mapaccess(h, ak, av, &pres);
if(!pres) if(!pres)
throw("runtime·mapaccess1: key not in map"); throw("runtime.mapaccess1: key not in map");
if(debug) { if(debug) {
prints("runtime·mapaccess1: map="); prints("runtime.mapaccess1: map=");
runtime·printpointer(h); ·printpointer(h);
prints("; key="); prints("; key=");
h->keyalg->print(h->keysize, ak); h->keyalg->print(h->keysize, ak);
prints("; val="); prints("; val=");
h->valalg->print(h->valsize, av); h->valalg->print(h->valsize, av);
prints("; pres="); prints("; pres=");
runtime·printbool(pres); ·printbool(pres);
prints("\n"); prints("\n");
} }
} }
// mapaccess2(hmap *map[any]any, key any) (val any, pres bool); // mapaccess2(hmap *map[any]any, key any) (val any, pres bool);
void void
runtime·mapaccess2(Hmap *h, ...) ·mapaccess2(Hmap *h, ...)
{ {
byte *ak, *av, *ap; byte *ak, *av, *ap;
@ -797,14 +797,14 @@ runtime·mapaccess2(Hmap *h, ...)
mapaccess(h, ak, av, ap); mapaccess(h, ak, av, ap);
if(debug) { if(debug) {
prints("runtime·mapaccess2: map="); prints("runtime.mapaccess2: map=");
runtime·printpointer(h); ·printpointer(h);
prints("; key="); prints("; key=");
h->keyalg->print(h->keysize, ak); h->keyalg->print(h->keysize, ak);
prints("; val="); prints("; val=");
h->valalg->print(h->valsize, av); h->valalg->print(h->valsize, av);
prints("; pres="); prints("; pres=");
runtime·printbool(*ap); ·printbool(*ap);
prints("\n"); prints("\n");
} }
} }
@ -830,22 +830,22 @@ mapassign(Hmap *h, byte *ak, byte *av)
if(debug) { if(debug) {
prints("mapassign: map="); prints("mapassign: map=");
runtime·printpointer(h); ·printpointer(h);
prints("; key="); prints("; key=");
h->keyalg->print(h->keysize, ak); h->keyalg->print(h->keysize, ak);
prints("; val="); prints("; val=");
h->valalg->print(h->valsize, av); h->valalg->print(h->valsize, av);
prints("; hit="); prints("; hit=");
runtime·printint(hit); ·printint(hit);
prints("; res="); prints("; res=");
runtime·printpointer(res); ·printpointer(res);
prints("\n"); prints("\n");
} }
} }
// mapassign1(hmap *map[any]any, key any, val any); // mapassign1(hmap *map[any]any, key any, val any);
void void
runtime·mapassign1(Hmap *h, ...) ·mapassign1(Hmap *h, ...)
{ {
byte *ak, *av; byte *ak, *av;
@ -857,7 +857,7 @@ runtime·mapassign1(Hmap *h, ...)
// mapassign2(hmap *map[any]any, key any, val any, pres bool); // mapassign2(hmap *map[any]any, key any, val any, pres bool);
void void
runtime·mapassign2(Hmap *h, ...) ·mapassign2(Hmap *h, ...)
{ {
byte *ak, *av, *ap; byte *ak, *av, *ap;
@ -872,7 +872,7 @@ runtime·mapassign2(Hmap *h, ...)
if(debug) { if(debug) {
prints("mapassign2: map="); prints("mapassign2: map=");
runtime·printpointer(h); ·printpointer(h);
prints("; key="); prints("; key=");
h->keyalg->print(h->keysize, ak); h->keyalg->print(h->keysize, ak);
prints("\n"); prints("\n");
@ -881,7 +881,7 @@ runtime·mapassign2(Hmap *h, ...)
// mapiterinit(hmap *map[any]any, hiter *any); // mapiterinit(hmap *map[any]any, hiter *any);
void void
runtime·mapiterinit(Hmap *h, struct hash_iter *it) ·mapiterinit(Hmap *h, struct hash_iter *it)
{ {
if(h == nil) { if(h == nil) {
it->data = nil; it->data = nil;
@ -890,12 +890,12 @@ runtime·mapiterinit(Hmap *h, struct hash_iter *it)
hash_iter_init(h, it); hash_iter_init(h, it);
it->data = hash_next(it); it->data = hash_next(it);
if(debug) { if(debug) {
prints("runtime·mapiterinit: map="); prints("runtime.mapiterinit: map=");
runtime·printpointer(h); ·printpointer(h);
prints("; iter="); prints("; iter=");
runtime·printpointer(it); ·printpointer(it);
prints("; data="); prints("; data=");
runtime·printpointer(it->data); ·printpointer(it->data);
prints("\n"); prints("\n");
} }
} }
@ -906,23 +906,23 @@ mapiterinit(Hmap *h)
struct hash_iter *it; struct hash_iter *it;
it = mal(sizeof *it); it = mal(sizeof *it);
runtime·mapiterinit(h, it); ·mapiterinit(h, it);
return it; return it;
} }
// mapiternext(hiter *any); // mapiternext(hiter *any);
void void
runtime·mapiternext(struct hash_iter *it) ·mapiternext(struct hash_iter *it)
{ {
if(gcwaiting) if(gcwaiting)
gosched(); gosched();
it->data = hash_next(it); it->data = hash_next(it);
if(debug) { if(debug) {
prints("runtime·mapiternext: iter="); prints("runtime.mapiternext: iter=");
runtime·printpointer(it); ·printpointer(it);
prints("; data="); prints("; data=");
runtime·printpointer(it->data); ·printpointer(it->data);
prints("\n"); prints("\n");
} }
} }
@ -930,12 +930,12 @@ runtime·mapiternext(struct hash_iter *it)
void void
mapiternext(struct hash_iter *it) mapiternext(struct hash_iter *it)
{ {
runtime·mapiternext(it); ·mapiternext(it);
} }
// mapiter1(hiter *any) (key any); // mapiter1(hiter *any) (key any);
void void
runtime·mapiter1(struct hash_iter *it, ...) ·mapiter1(struct hash_iter *it, ...)
{ {
Hmap *h; Hmap *h;
byte *ak, *res; byte *ak, *res;
@ -945,15 +945,15 @@ runtime·mapiter1(struct hash_iter *it, ...)
res = it->data; res = it->data;
if(res == nil) if(res == nil)
throw("runtime·mapiter2: key:val nil pointer"); throw("runtime.mapiter2: key:val nil pointer");
h->keyalg->copy(h->keysize, ak, res); h->keyalg->copy(h->keysize, ak, res);
if(debug) { if(debug) {
prints("mapiter2: iter="); prints("mapiter2: iter=");
runtime·printpointer(it); ·printpointer(it);
prints("; map="); prints("; map=");
runtime·printpointer(h); ·printpointer(h);
prints("\n"); prints("\n");
} }
} }
@ -974,7 +974,7 @@ mapiterkey(struct hash_iter *it, void *ak)
// mapiter2(hiter *any) (key any, val any); // mapiter2(hiter *any) (key any, val any);
void void
runtime·mapiter2(struct hash_iter *it, ...) ·mapiter2(struct hash_iter *it, ...)
{ {
Hmap *h; Hmap *h;
byte *ak, *av, *res; byte *ak, *av, *res;
@ -985,16 +985,16 @@ runtime·mapiter2(struct hash_iter *it, ...)
res = it->data; res = it->data;
if(res == nil) if(res == nil)
throw("runtime·mapiter2: key:val nil pointer"); throw("runtime.mapiter2: key:val nil pointer");
h->keyalg->copy(h->keysize, ak, res); h->keyalg->copy(h->keysize, ak, res);
h->valalg->copy(h->valsize, av, res+h->datavo); h->valalg->copy(h->valsize, av, res+h->datavo);
if(debug) { if(debug) {
prints("mapiter2: iter="); prints("mapiter2: iter=");
runtime·printpointer(it); ·printpointer(it);
prints("; map="); prints("; map=");
runtime·printpointer(h); ·printpointer(h);
prints("\n"); prints("\n");
} }
} }

View File

@ -66,7 +66,7 @@
#define malloc mal #define malloc mal
#define free(a) USED(a) #define free(a) USED(a)
#define offsetof(s,m) (uint32)(&(((s*)0)->m)) #define offsetof(s,m) (uint32)(&(((s*)0)->m))
#define memset(a,b,c) runtime·memclr((byte*)(a), (uint32)(c)) #define memset(a,b,c) ·memclr((byte*)(a), (uint32)(c))
#define memcpy(a,b,c) mcpy((byte*)(a),(byte*)(b),(uint32)(c)) #define memcpy(a,b,c) mcpy((byte*)(a),(byte*)(b),(uint32)(c))
#define assert(a) if(!(a)) throw("assert") #define assert(a) if(!(a)) throw("assert")

View File

@ -174,7 +174,7 @@ copyout(Type *t, void **src, void *dst)
// ifaceT2I(sigi *byte, sigt *byte, elem any) (ret Iface); // ifaceT2I(sigi *byte, sigt *byte, elem any) (ret Iface);
#pragma textflag 7 #pragma textflag 7
void void
runtime·ifaceT2I(InterfaceType *inter, Type *t, ...) ·ifaceT2I(InterfaceType *inter, Type *t, ...)
{ {
byte *elem; byte *elem;
Iface *ret; Iface *ret;
@ -190,7 +190,7 @@ runtime·ifaceT2I(InterfaceType *inter, Type *t, ...)
// ifaceT2E(sigt *byte, elem any) (ret Eface); // ifaceT2E(sigt *byte, elem any) (ret Eface);
#pragma textflag 7 #pragma textflag 7
void void
runtime·ifaceT2E(Type *t, ...) ·ifaceT2E(Type *t, ...)
{ {
byte *elem; byte *elem;
Eface *ret; Eface *ret;
@ -207,7 +207,7 @@ runtime·ifaceT2E(Type *t, ...)
// ifaceI2T(sigt *byte, iface any) (ret any); // ifaceI2T(sigt *byte, iface any) (ret any);
#pragma textflag 7 #pragma textflag 7
void void
runtime·ifaceI2T(Type *t, Iface i, ...) ·ifaceI2T(Type *t, Iface i, ...)
{ {
Itab *tab; Itab *tab;
byte *ret; byte *ret;
@ -228,7 +228,7 @@ runtime·ifaceI2T(Type *t, Iface i, ...)
// ifaceI2T2(sigt *byte, i Iface) (ret any, ok bool); // ifaceI2T2(sigt *byte, i Iface) (ret any, ok bool);
#pragma textflag 7 #pragma textflag 7
void void
runtime·ifaceI2T2(Type *t, Iface i, ...) ·ifaceI2T2(Type *t, Iface i, ...)
{ {
byte *ret; byte *ret;
bool *ok; bool *ok;
@ -240,7 +240,7 @@ runtime·ifaceI2T2(Type *t, Iface i, ...)
if(i.tab == nil || i.tab->type != t) { if(i.tab == nil || i.tab->type != t) {
*ok = false; *ok = false;
runtime·memclr(ret, wid); ·memclr(ret, wid);
return; return;
} }
@ -251,7 +251,7 @@ runtime·ifaceI2T2(Type *t, Iface i, ...)
// ifaceE2T(sigt *byte, e Eface) (ret any); // ifaceE2T(sigt *byte, e Eface) (ret any);
#pragma textflag 7 #pragma textflag 7
void void
runtime·ifaceE2T(Type *t, Eface e, ...) ·ifaceE2T(Type *t, Eface e, ...)
{ {
byte *ret; byte *ret;
@ -270,7 +270,7 @@ runtime·ifaceE2T(Type *t, Eface e, ...)
// ifaceE2T2(sigt *byte, iface any) (ret any, ok bool); // ifaceE2T2(sigt *byte, iface any) (ret any, ok bool);
#pragma textflag 7 #pragma textflag 7
void void
runtime·ifaceE2T2(Type *t, Eface e, ...) ·ifaceE2T2(Type *t, Eface e, ...)
{ {
byte *ret; byte *ret;
bool *ok; bool *ok;
@ -282,7 +282,7 @@ runtime·ifaceE2T2(Type *t, Eface e, ...)
if(t != e.type) { if(t != e.type) {
*ok = false; *ok = false;
runtime·memclr(ret, wid); ·memclr(ret, wid);
return; return;
} }
@ -293,7 +293,7 @@ runtime·ifaceE2T2(Type *t, Eface e, ...)
// ifaceI2E(sigi *byte, iface any) (ret any); // ifaceI2E(sigi *byte, iface any) (ret any);
// TODO(rsc): Move to back end, throw away function. // TODO(rsc): Move to back end, throw away function.
void void
runtime·ifaceI2E(Iface i, Eface ret) ·ifaceI2E(Iface i, Eface ret)
{ {
Itab *tab; Itab *tab;
@ -310,7 +310,7 @@ runtime·ifaceI2E(Iface i, Eface ret)
// called only for implicit (no type assertion) conversions. // called only for implicit (no type assertion) conversions.
// converting nil is okay. // converting nil is okay.
void void
runtime·ifaceI2I(InterfaceType *inter, Iface i, Iface ret) ·ifaceI2I(InterfaceType *inter, Iface i, Iface ret)
{ {
Itab *tab; Itab *tab;
@ -333,7 +333,7 @@ runtime·ifaceI2I(InterfaceType *inter, Iface i, Iface ret)
// called only for explicit conversions (with type assertion). // called only for explicit conversions (with type assertion).
// converting nil is not okay. // converting nil is not okay.
void void
runtime·ifaceI2Ix(InterfaceType *inter, Iface i, Iface ret) ·ifaceI2Ix(InterfaceType *inter, Iface i, Iface ret)
{ {
Itab *tab; Itab *tab;
@ -353,7 +353,7 @@ runtime·ifaceI2Ix(InterfaceType *inter, Iface i, Iface ret)
// ifaceI2I2(sigi *byte, iface any) (ret any, ok bool); // ifaceI2I2(sigi *byte, iface any) (ret any, ok bool);
void void
runtime·ifaceI2I2(InterfaceType *inter, Iface i, Iface ret, bool ok) ·ifaceI2I2(InterfaceType *inter, Iface i, Iface ret, bool ok)
{ {
Itab *tab; Itab *tab;
@ -400,14 +400,14 @@ ifaceE2I(InterfaceType *inter, Eface e, Iface *ret)
// ifaceE2I(sigi *byte, iface any) (ret any); // ifaceE2I(sigi *byte, iface any) (ret any);
// Called only for explicit conversions (with type assertion). // Called only for explicit conversions (with type assertion).
void void
runtime·ifaceE2I(InterfaceType *inter, Eface e, Iface ret) ·ifaceE2I(InterfaceType *inter, Eface e, Iface ret)
{ {
ifaceE2I(inter, e, &ret); ifaceE2I(inter, e, &ret);
} }
// ifaceE2I2(sigi *byte, iface any) (ret any, ok bool); // ifaceE2I2(sigi *byte, iface any) (ret any, ok bool);
void void
runtime·ifaceE2I2(InterfaceType *inter, Eface e, Iface ret, bool ok) ·ifaceE2I2(InterfaceType *inter, Eface e, Iface ret, bool ok)
{ {
Type *t; Type *t;
@ -511,7 +511,7 @@ efaceeq(Eface e1, Eface e2)
// ifaceeq(i1 any, i2 any) (ret bool); // ifaceeq(i1 any, i2 any) (ret bool);
void void
runtime·ifaceeq(Iface i1, Iface i2, bool ret) ·ifaceeq(Iface i1, Iface i2, bool ret)
{ {
ret = ifaceeq(i1, i2); ret = ifaceeq(i1, i2);
FLUSH(&ret); FLUSH(&ret);
@ -519,7 +519,7 @@ runtime·ifaceeq(Iface i1, Iface i2, bool ret)
// efaceeq(i1 any, i2 any) (ret bool) // efaceeq(i1 any, i2 any) (ret bool)
void void
runtime·efaceeq(Eface e1, Eface e2, bool ret) ·efaceeq(Eface e1, Eface e2, bool ret)
{ {
ret = efaceeq(e1, e2); ret = efaceeq(e1, e2);
FLUSH(&ret); FLUSH(&ret);
@ -527,7 +527,7 @@ runtime·efaceeq(Eface e1, Eface e2, bool ret)
// ifacethash(i1 any) (ret uint32); // ifacethash(i1 any) (ret uint32);
void void
runtime·ifacethash(Iface i1, uint32 ret) ·ifacethash(Iface i1, uint32 ret)
{ {
Itab *tab; Itab *tab;
@ -540,7 +540,7 @@ runtime·ifacethash(Iface i1, uint32 ret)
// efacethash(e1 any) (ret uint32) // efacethash(e1 any) (ret uint32)
void void
runtime·efacethash(Eface e1, uint32 ret) ·efacethash(Eface e1, uint32 ret)
{ {
Type *t; Type *t;
@ -552,13 +552,13 @@ runtime·efacethash(Eface e1, uint32 ret)
} }
void void
runtime·printiface(Iface i) ·printiface(Iface i)
{ {
printiface(i); printiface(i);
} }
void void
runtime·printeface(Eface e) ·printeface(Eface e)
{ {
printeface(e); printeface(e);
} }

View File

@ -60,7 +60,7 @@ TEXT sigreturn(SB),7,$0
INT $3 // not reached INT $3 // not reached
RET RET
TEXT runtime·mmap(SB),7,$0 TEXT ·mmap(SB),7,$0
MOVL $192, AX // mmap2 MOVL $192, AX // mmap2
MOVL 4(SP), BX MOVL 4(SP), BX
MOVL 8(SP), CX MOVL 8(SP), CX

View File

@ -36,7 +36,7 @@ TEXT write(SB),7,$0-24
SYSCALL SYSCALL
RET RET
TEXT runtime·write(SB),7,$0-24 TEXT ·write(SB),7,$0-24
MOVL 8(SP), DI MOVL 8(SP), DI
MOVQ 16(SP), SI MOVQ 16(SP), SI
MOVL 24(SP), DX MOVL 24(SP), DX
@ -69,7 +69,7 @@ TEXT sigreturn(SB),7,$0
SYSCALL SYSCALL
INT $3 // not reached INT $3 // not reached
TEXT runtime·mmap(SB),7,$0-32 TEXT ·mmap(SB),7,$0-32
MOVQ 8(SP), DI MOVQ 8(SP), DI
MOVQ $0, SI MOVQ $0, SI
MOVL 16(SP), SI MOVL 16(SP), SI
@ -91,7 +91,7 @@ TEXT notok(SB),7,$0
MOVQ BP, (BP) MOVQ BP, (BP)
RET RET
TEXT runtime·memclr(SB),7,$0-16 TEXT ·memclr(SB),7,$0-16
MOVQ 8(SP), DI // arg 1 addr MOVQ 8(SP), DI // arg 1 addr
MOVL 16(SP), CX // arg 2 count (cannot be zero) MOVL 16(SP), CX // arg 2 count (cannot be zero)
ADDL $7, CX ADDL $7, CX
@ -102,12 +102,12 @@ TEXT runtime·memclr(SB),7,$0-16
STOSQ STOSQ
RET RET
TEXT runtime·getcallerpc+0(SB),7,$0 TEXT ·getcallerpc+0(SB),7,$0
MOVQ x+0(FP),AX // addr of first arg MOVQ x+0(FP),AX // addr of first arg
MOVQ -8(AX),AX // get calling pc MOVQ -8(AX),AX // get calling pc
RET RET
TEXT runtime·setcallerpc+0(SB),7,$0 TEXT ·setcallerpc+0(SB),7,$0
MOVQ x+0(FP),AX // addr of first arg MOVQ x+0(FP),AX // addr of first arg
MOVQ x+8(FP), BX MOVQ x+8(FP), BX
MOVQ BX, -8(AX) // set calling pc MOVQ BX, -8(AX) // set calling pc

View File

@ -49,7 +49,7 @@ TEXT exit1(SB),7,$-4
MOVW $1003, R1 MOVW $1003, R1
MOVW R0, (R1) // fail hard MOVW R0, (R1) // fail hard
TEXT runtime·mmap(SB),7,$0 TEXT ·mmap(SB),7,$0
MOVW 0(FP), R0 MOVW 0(FP), R0
MOVW 4(FP), R1 MOVW 4(FP), R1
MOVW 8(FP), R2 MOVW 8(FP), R2

View File

@ -49,11 +49,11 @@ futexsleep(uint32 *addr, uint32 val)
return; return;
prints("futexsleep addr="); prints("futexsleep addr=");
runtime·printpointer(addr); ·printpointer(addr);
prints(" val="); prints(" val=");
runtime·printint(val); ·printint(val);
prints(" returned "); prints(" returned ");
runtime·printint(ret); ·printint(ret);
prints("\n"); prints("\n");
*(int32*)0x1005 = 0x1005; *(int32*)0x1005 = 0x1005;
} }
@ -74,9 +74,9 @@ futexwakeup(uint32 *addr)
// safe to loop and call futex again. // safe to loop and call futex again.
prints("futexwakeup addr="); prints("futexwakeup addr=");
runtime·printpointer(addr); ·printpointer(addr);
prints(" returned "); prints(" returned ");
runtime·printint(ret); ·printint(ret);
prints("\n"); prints("\n");
*(int32*)0x1006 = 0x1006; *(int32*)0x1006 = 0x1006;
} }

View File

@ -14,7 +14,7 @@ TEXT get_kernel_module(SB),7,$0
// TODO(rsc,hectorchu): Switch to m stack before call. // TODO(rsc,hectorchu): Switch to m stack before call.
TEXT stdcall(SB),7,$0 TEXT stdcall(SB),7,$0
CALL runtime·entersyscall(SB) CALL ·entersyscall(SB)
get_tls(CX) get_tls(CX)
MOVL m(CX), CX MOVL m(CX), CX
POPL m_return_address(CX) // save return address POPL m_return_address(CX) // save return address
@ -26,7 +26,7 @@ TEXT stdcall(SB),7,$0
MOVL m_stack_pointer(CX), SP MOVL m_stack_pointer(CX), SP
PUSHL AX PUSHL AX
PUSHL m_return_address(CX) PUSHL m_return_address(CX)
CALL runtime·exitsyscall(SB) CALL ·exitsyscall(SB)
MOVL 4(SP), AX MOVL 4(SP), AX
RET RET

View File

@ -54,7 +54,7 @@ TEXT mutex_unlock(SB),7,$0
TEXT thread_create(SB),7,$0 TEXT thread_create(SB),7,$0
JMP SYSCALL(thread_create) JMP SYSCALL(thread_create)
TEXT runtime·mmap(SB),7,$24 TEXT ·mmap(SB),7,$24
MOVL a1+0(FP), BX MOVL a1+0(FP), BX
MOVL a2+4(FP), CX // round up to 64 kB boundary; silences nacl warning MOVL a2+4(FP), CX // round up to 64 kB boundary; silences nacl warning
ADDL $(64*1024-1), CX ADDL $(64*1024-1), CX

View File

@ -23,7 +23,7 @@ SysAlloc(uintptr ask)
q = p; q = p;
p += ask; p += ask;
runtime·memclr(q, ask); ·memclr(q, ask);
return q; return q;
} }

View File

@ -6,12 +6,12 @@
int8 *goos = "pchw"; int8 *goos = "pchw";
extern void runtime·write(int32 fd, void *v, int32 len, int32 cap); // slice, spelled out extern void ·write(int32 fd, void *v, int32 len, int32 cap); // slice, spelled out
int32 int32
write(int32 fd, void *v, int32 len) write(int32 fd, void *v, int32 len)
{ {
runtime·write(fd, v, len, len); ·write(fd, v, len, len);
return len; return len;
} }

View File

@ -12,8 +12,8 @@ dump(byte *p, int32 n)
int32 i; int32 i;
for(i=0; i<n; i++) { for(i=0; i<n; i++) {
runtime·printpointer((byte*)(p[i]>>4)); ·printpointer((byte*)(p[i]>>4));
runtime·printpointer((byte*)(p[i]&0xf)); ·printpointer((byte*)(p[i]&0xf));
if((i&15) == 15) if((i&15) == 15)
prints("\n"); prints("\n");
else else
@ -73,25 +73,25 @@ printf(int8 *s, ...)
} }
switch(*p) { switch(*p) {
case 'd': case 'd':
runtime·printint(*(int32*)arg); ·printint(*(int32*)arg);
break; break;
case 'D': case 'D':
runtime·printint(*(int64*)arg); ·printint(*(int64*)arg);
break; break;
case 'x': case 'x':
runtime·printhex(*(uint32*)arg); ·printhex(*(uint32*)arg);
break; break;
case 'X': case 'X':
runtime·printhex(*(uint64*)arg); ·printhex(*(uint64*)arg);
break; break;
case 'p': case 'p':
runtime·printpointer(*(void**)arg); ·printpointer(*(void**)arg);
break; break;
case 's': case 's':
prints(*(int8**)arg); prints(*(int8**)arg);
break; break;
case 'S': case 'S':
runtime·printstring(*(String*)arg); ·printstring(*(String*)arg);
break; break;
} }
arg = narg; arg = narg;
@ -105,14 +105,14 @@ printf(int8 *s, ...)
void void
runtime·printpc(void *p) ·printpc(void *p)
{ {
prints("PC="); prints("PC=");
runtime·printhex((uint64)runtime·getcallerpc(p)); ·printhex((uint64)·getcallerpc(p));
} }
void void
runtime·printbool(bool v) ·printbool(bool v)
{ {
if(v) { if(v) {
write(fd, (byte*)"true", 4); write(fd, (byte*)"true", 4);
@ -122,7 +122,7 @@ runtime·printbool(bool v)
} }
void void
runtime·printfloat(float64 v) ·printfloat(float64 v)
{ {
byte buf[20]; byte buf[20];
int32 e, s, i, n; int32 e, s, i, n;
@ -200,7 +200,7 @@ runtime·printfloat(float64 v)
} }
void void
runtime·printuint(uint64 v) ·printuint(uint64 v)
{ {
byte buf[100]; byte buf[100];
int32 i; int32 i;
@ -215,17 +215,17 @@ runtime·printuint(uint64 v)
} }
void void
runtime·printint(int64 v) ·printint(int64 v)
{ {
if(v < 0) { if(v < 0) {
write(fd, "-", 1); write(fd, "-", 1);
v = -v; v = -v;
} }
runtime·printuint(v); ·printuint(v);
} }
void void
runtime·printhex(uint64 v) ·printhex(uint64 v)
{ {
static int8 *dig = "0123456789abcdef"; static int8 *dig = "0123456789abcdef";
byte buf[100]; byte buf[100];
@ -242,13 +242,13 @@ runtime·printhex(uint64 v)
} }
void void
runtime·printpointer(void *p) ·printpointer(void *p)
{ {
runtime·printhex((uint64)p); ·printhex((uint64)p);
} }
void void
runtime·printstring(String v) ·printstring(String v)
{ {
extern int32 maxstring; extern int32 maxstring;
@ -261,13 +261,13 @@ runtime·printstring(String v)
} }
void void
runtime·printsp(void) ·printsp(void)
{ {
write(fd, " ", 1); write(fd, " ", 1);
} }
void void
runtime·printnl(void) ·printnl(void)
{ {
write(fd, "\n", 1); write(fd, "\n", 1);
} }

View File

@ -536,7 +536,7 @@ gosched(void)
// This is called only from the go syscall library, not // This is called only from the go syscall library, not
// from the low-level system calls used by the runtime. // from the low-level system calls used by the runtime.
void void
runtime·entersyscall(void) ·entersyscall(void)
{ {
lock(&sched); lock(&sched);
if(sched.predawn) { if(sched.predawn) {
@ -564,7 +564,7 @@ runtime·entersyscall(void)
// This is called only from the go syscall library, not // This is called only from the go syscall library, not
// from the low-level system calls used by the runtime. // from the low-level system calls used by the runtime.
void void
runtime·exitsyscall(void) ·exitsyscall(void)
{ {
lock(&sched); lock(&sched);
if(sched.predawn) { if(sched.predawn) {
@ -732,7 +732,7 @@ newstack(void)
// Continue as if lessstack had just called m->morepc // Continue as if lessstack had just called m->morepc
// (the PC that decided to grow the stack). // (the PC that decided to grow the stack).
label.sp = sp; label.sp = sp;
label.pc = (byte*)runtime·lessstack; label.pc = (byte*)·lessstack;
label.g = m->curg; label.g = m->curg;
gogocall(&label, m->morepc); gogocall(&label, m->morepc);
@ -764,7 +764,7 @@ malg(int32 stacksize)
*/ */
#pragma textflag 7 #pragma textflag 7
void void
runtime·newproc(int32 siz, byte* fn, byte* arg0) ·newproc(int32 siz, byte* fn, byte* arg0)
{ {
byte *stk, *sp; byte *stk, *sp;
G *newg; G *newg;
@ -773,7 +773,7 @@ runtime·newproc(int32 siz, byte* fn, byte* arg0)
siz = (siz+7) & ~7; siz = (siz+7) & ~7;
if(siz > 1024) if(siz > 1024)
throw("runtime·newproc: too many args"); throw("runtime.newproc: too many args");
lock(&sched); lock(&sched);
@ -812,7 +812,7 @@ runtime·newproc(int32 siz, byte* fn, byte* arg0)
#pragma textflag 7 #pragma textflag 7
void void
runtime·deferproc(int32 siz, byte* fn, byte* arg0) ·deferproc(int32 siz, byte* fn, byte* arg0)
{ {
Defer *d; Defer *d;
@ -828,7 +828,7 @@ runtime·deferproc(int32 siz, byte* fn, byte* arg0)
#pragma textflag 7 #pragma textflag 7
void void
runtime·deferreturn(uintptr arg0) ·deferreturn(uintptr arg0)
{ {
Defer *d; Defer *d;
byte *sp, *fn; byte *sp, *fn;
@ -847,25 +847,25 @@ runtime·deferreturn(uintptr arg0)
} }
void void
runtime·Breakpoint(void) ·Breakpoint(void)
{ {
breakpoint(); breakpoint();
} }
void void
runtime·Goexit(void) ·Goexit(void)
{ {
goexit(); goexit();
} }
void void
runtime·Gosched(void) ·Gosched(void)
{ {
gosched(); gosched();
} }
void void
runtime·LockOSThread(void) ·LockOSThread(void)
{ {
if(sched.predawn) if(sched.predawn)
throw("cannot wire during init"); throw("cannot wire during init");
@ -875,7 +875,7 @@ runtime·LockOSThread(void)
// delete when scheduler is stronger // delete when scheduler is stronger
void void
runtime·GOMAXPROCS(int32 n) ·GOMAXPROCS(int32 n)
{ {
if(n < 1) if(n < 1)
n = 1; n = 1;
@ -897,7 +897,7 @@ runtime·GOMAXPROCS(int32 n)
} }
void void
runtime·UnlockOSThread(void) ·UnlockOSThread(void)
{ {
m->lockedg = nil; m->lockedg = nil;
g->lockedm = nil; g->lockedm = nil;
@ -905,7 +905,7 @@ runtime·UnlockOSThread(void)
// for testing of wire, unwire // for testing of wire, unwire
void void
runtime·mid(uint32 ret) ·mid(uint32 ret)
{ {
ret = m->id; ret = m->id;
FLUSH(&ret); FLUSH(&ret);

View File

@ -20,7 +20,7 @@ gotraceback(void)
} }
void void
runtime·panicl(int32 lno) ·panicl(int32 lno)
{ {
uint8 *sp; uint8 *sp;
@ -34,7 +34,7 @@ runtime·panicl(int32 lno)
printf("\npanic PC=%X\n", (uint64)(uintptr)&lno); printf("\npanic PC=%X\n", (uint64)(uintptr)&lno);
sp = (uint8*)&lno; sp = (uint8*)&lno;
if(gotraceback()){ if(gotraceback()){
traceback(runtime·getcallerpc(&lno), sp, g); traceback(·getcallerpc(&lno), sp, g);
tracebackothers(g); tracebackothers(g);
} }
breakpoint(); // so we can grab it in a debugger breakpoint(); // so we can grab it in a debugger
@ -42,25 +42,25 @@ runtime·panicl(int32 lno)
} }
void void
runtime·throwindex(void) ·throwindex(void)
{ {
throw("index out of range"); throw("index out of range");
} }
void void
runtime·throwslice(void) ·throwslice(void)
{ {
throw("slice out of range"); throw("slice out of range");
} }
void void
runtime·throwreturn(void) ·throwreturn(void)
{ {
throw("no return at end of a typed function"); throw("no return at end of a typed function");
} }
void void
runtime·throwinit(void) ·throwinit(void)
{ {
throw("recursive call during initialization"); throw("recursive call during initialization");
} }
@ -70,7 +70,7 @@ throw(int8 *s)
{ {
fd = 2; fd = 2;
printf("throw: %s\n", s); printf("throw: %s\n", s);
runtime·panicl(-1); ·panicl(-1);
*(int32*)0 = 0; // not reached *(int32*)0 = 0; // not reached
exit(1); // even more not reached exit(1); // even more not reached
} }
@ -324,7 +324,7 @@ memprint(uint32 s, void *a)
v = *(uint64*)a; v = *(uint64*)a;
break; break;
} }
runtime·printint(v); ·printint(v);
} }
static void static void
@ -362,7 +362,7 @@ static void
strprint(uint32 s, String *a) strprint(uint32 s, String *a)
{ {
USED(s); USED(s);
runtime·printstring(*a); ·printstring(*a);
} }
static uintptr static uintptr
@ -376,7 +376,7 @@ static void
interprint(uint32 s, Iface *a) interprint(uint32 s, Iface *a)
{ {
USED(s); USED(s);
runtime·printiface(*a); ·printiface(*a);
} }
static uint32 static uint32
@ -397,7 +397,7 @@ static void
nilinterprint(uint32 s, Eface *a) nilinterprint(uint32 s, Eface *a)
{ {
USED(s); USED(s);
runtime·printeface(*a); ·printeface(*a);
} }
static uint32 static uint32

View File

@ -335,7 +335,7 @@ int32 charntorune(int32*, uint8*, int32);
void gogo(Gobuf*, uintptr); void gogo(Gobuf*, uintptr);
void gogocall(Gobuf*, void(*)(void)); void gogocall(Gobuf*, void(*)(void));
uintptr gosave(Gobuf*); uintptr gosave(Gobuf*);
void runtime·lessstack(void); void ·lessstack(void);
void goargs(void); void goargs(void);
void FLUSH(void*); void FLUSH(void*);
void* getu(void); void* getu(void);
@ -388,8 +388,8 @@ void breakpoint(void);
void gosched(void); void gosched(void);
void goexit(void); void goexit(void);
void runcgo(void (*fn)(void*), void*); void runcgo(void (*fn)(void*), void*);
void runtime·entersyscall(void); void ·entersyscall(void);
void runtime·exitsyscall(void); void ·exitsyscall(void);
void siginit(void); void siginit(void);
bool sigsend(int32 sig); bool sigsend(int32 sig);
@ -441,21 +441,21 @@ void notewakeup(Note*);
* UTF-8 characters in identifiers. * UTF-8 characters in identifiers.
*/ */
#ifndef __GNUC__ #ifndef __GNUC__
#define runtime_memclr runtime·memclr #define runtime_memclr ·memclr
#define runtime_getcallerpc runtime·getcallerpc #define runtime_getcallerpc ·getcallerpc
#define runtime_mmap runtime·mmap #define runtime_mmap ·mmap
#define runtime_printslice runtime·printslice #define runtime_printslice ·printslice
#define runtime_printbool runtime·printbool #define runtime_printbool ·printbool
#define runtime_printfloat runtime·printfloat #define runtime_printfloat ·printfloat
#define runtime_printhex runtime·printhex #define runtime_printhex ·printhex
#define runtime_printint runtime·printint #define runtime_printint ·printint
#define runtime_printiface runtime·printiface #define runtime_printiface ·printiface
#define runtime_printeface runtime·printeface #define runtime_printeface ·printeface
#define runtime_printpc runtime·printpc #define runtime_printpc ·printpc
#define runtime_printpointer runtime·printpointer #define runtime_printpointer ·printpointer
#define runtime_printstring runtime·printstring #define runtime_printstring ·printstring
#define runtime_printuint runtime·printuint #define runtime_printuint ·printuint
#define runtime_setcallerpc runtime·setcallerpc #define runtime_setcallerpc ·setcallerpc
#endif #endif
/* /*

View File

@ -78,9 +78,9 @@ sigsend(int32 s)
// Called to receive a bitmask of queued signals. // Called to receive a bitmask of queued signals.
func Sigrecv() (m uint32) { func Sigrecv() (m uint32) {
runtime·entersyscall(); ·entersyscall();
notesleep(&sig); notesleep(&sig);
runtime·exitsyscall(); ·exitsyscall();
noteclear(&sig); noteclear(&sig);
for(;;) { for(;;) {
m = sig.mask; m = sig.mask;

View File

@ -11,7 +11,7 @@ static int32 debug = 0;
// see also unsafe·NewArray // see also unsafe·NewArray
// makeslice(typ *Type, nel int, cap int) (ary []any); // makeslice(typ *Type, nel int, cap int) (ary []any);
void void
runtime·makeslice(SliceType *t, uint32 nel, uint32 cap, Slice ret) ·makeslice(SliceType *t, uint32 nel, uint32 cap, Slice ret)
{ {
uint64 size; uint64 size;
@ -32,7 +32,7 @@ runtime·makeslice(SliceType *t, uint32 nel, uint32 cap, Slice ret)
if(debug) { if(debug) {
printf("makeslice(%S, %d, %d); ret=", printf("makeslice(%S, %d, %d); ret=",
*t->string, nel, cap); *t->string, nel, cap);
runtime·printslice(ret); ·printslice(ret);
} }
} }
@ -40,35 +40,35 @@ static void
throwslice(uint32 lb, uint32 hb, uint32 n) throwslice(uint32 lb, uint32 hb, uint32 n)
{ {
prints("slice["); prints("slice[");
runtime·printint(lb); ·printint(lb);
prints(":"); prints(":");
runtime·printint(hb); ·printint(hb);
prints("] of ["); prints("] of [");
runtime·printint(n); ·printint(n);
prints("] array\n"); prints("] array\n");
throw("array slice"); throw("array slice");
} }
// sliceslice(old []any, lb int, hb int, width int) (ary []any); // sliceslice(old []any, lb int, hb int, width int) (ary []any);
void void
runtime·sliceslice(Slice old, uint32 lb, uint32 hb, uint32 width, Slice ret) ·sliceslice(Slice old, uint32 lb, uint32 hb, uint32 width, Slice ret)
{ {
if(hb > old.cap || lb > hb) { if(hb > old.cap || lb > hb) {
if(debug) { if(debug) {
prints("runtime·sliceslice: old="); prints("runtime.sliceslice: old=");
runtime·printslice(old); ·printslice(old);
prints("; lb="); prints("; lb=");
runtime·printint(lb); ·printint(lb);
prints("; hb="); prints("; hb=");
runtime·printint(hb); ·printint(hb);
prints("; width="); prints("; width=");
runtime·printint(width); ·printint(width);
prints("\n"); prints("\n");
prints("oldarray: nel="); prints("oldarray: nel=");
runtime·printint(old.len); ·printint(old.len);
prints("; cap="); prints("; cap=");
runtime·printint(old.cap); ·printint(old.cap);
prints("\n"); prints("\n");
} }
throwslice(lb, hb, old.cap); throwslice(lb, hb, old.cap);
@ -82,38 +82,38 @@ runtime·sliceslice(Slice old, uint32 lb, uint32 hb, uint32 width, Slice ret)
FLUSH(&ret); FLUSH(&ret);
if(debug) { if(debug) {
prints("runtime·sliceslice: old="); prints("runtime.sliceslice: old=");
runtime·printslice(old); ·printslice(old);
prints("; lb="); prints("; lb=");
runtime·printint(lb); ·printint(lb);
prints("; hb="); prints("; hb=");
runtime·printint(hb); ·printint(hb);
prints("; width="); prints("; width=");
runtime·printint(width); ·printint(width);
prints("; ret="); prints("; ret=");
runtime·printslice(ret); ·printslice(ret);
prints("\n"); prints("\n");
} }
} }
// sliceslice1(old []any, lb int, width int) (ary []any); // sliceslice1(old []any, lb int, width int) (ary []any);
void void
runtime·sliceslice1(Slice old, uint32 lb, uint32 width, Slice ret) ·sliceslice1(Slice old, uint32 lb, uint32 width, Slice ret)
{ {
if(lb > old.len) { if(lb > old.len) {
if(debug) { if(debug) {
prints("runtime·sliceslice: old="); prints("runtime.sliceslice: old=");
runtime·printslice(old); ·printslice(old);
prints("; lb="); prints("; lb=");
runtime·printint(lb); ·printint(lb);
prints("; width="); prints("; width=");
runtime·printint(width); ·printint(width);
prints("\n"); prints("\n");
prints("oldarray: nel="); prints("oldarray: nel=");
runtime·printint(old.len); ·printint(old.len);
prints("; cap="); prints("; cap=");
runtime·printint(old.cap); ·printint(old.cap);
prints("\n"); prints("\n");
} }
throwslice(lb, old.len, old.cap); throwslice(lb, old.len, old.cap);
@ -127,21 +127,21 @@ runtime·sliceslice1(Slice old, uint32 lb, uint32 width, Slice ret)
FLUSH(&ret); FLUSH(&ret);
if(debug) { if(debug) {
prints("runtime·sliceslice: old="); prints("runtime.sliceslice: old=");
runtime·printslice(old); ·printslice(old);
prints("; lb="); prints("; lb=");
runtime·printint(lb); ·printint(lb);
prints("; width="); prints("; width=");
runtime·printint(width); ·printint(width);
prints("; ret="); prints("; ret=");
runtime·printslice(ret); ·printslice(ret);
prints("\n"); prints("\n");
} }
} }
// slicearray(old *any, nel int, lb int, hb int, width int) (ary []any); // slicearray(old *any, nel int, lb int, hb int, width int) (ary []any);
void void
runtime·slicearray(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, Slice ret) ·slicearray(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, Slice ret)
{ {
if(nel > 0 && old == nil) { if(nel > 0 && old == nil) {
// crash if old == nil. // crash if old == nil.
@ -153,16 +153,16 @@ runtime·slicearray(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, S
if(hb > nel || lb > hb) { if(hb > nel || lb > hb) {
if(debug) { if(debug) {
prints("runtime·slicearray: old="); prints("runtime.slicearray: old=");
runtime·printpointer(old); ·printpointer(old);
prints("; nel="); prints("; nel=");
runtime·printint(nel); ·printint(nel);
prints("; lb="); prints("; lb=");
runtime·printint(lb); ·printint(lb);
prints("; hb="); prints("; hb=");
runtime·printint(hb); ·printint(hb);
prints("; width="); prints("; width=");
runtime·printint(width); ·printint(width);
prints("\n"); prints("\n");
} }
throwslice(lb, hb, nel); throwslice(lb, hb, nel);
@ -176,25 +176,25 @@ runtime·slicearray(byte* old, uint32 nel, uint32 lb, uint32 hb, uint32 width, S
FLUSH(&ret); FLUSH(&ret);
if(debug) { if(debug) {
prints("runtime·slicearray: old="); prints("runtime.slicearray: old=");
runtime·printpointer(old); ·printpointer(old);
prints("; nel="); prints("; nel=");
runtime·printint(nel); ·printint(nel);
prints("; lb="); prints("; lb=");
runtime·printint(lb); ·printint(lb);
prints("; hb="); prints("; hb=");
runtime·printint(hb); ·printint(hb);
prints("; width="); prints("; width=");
runtime·printint(width); ·printint(width);
prints("; ret="); prints("; ret=");
runtime·printslice(ret); ·printslice(ret);
prints("\n"); prints("\n");
} }
} }
// slicecopy(to any, fr any, wid uint32) int // slicecopy(to any, fr any, wid uint32) int
void void
runtime·slicecopy(Slice to, Slice fm, uintptr width, int32 ret) ·slicecopy(Slice to, Slice fm, uintptr width, int32 ret)
{ {
if(fm.array == nil || fm.len == 0 || if(fm.array == nil || fm.len == 0 ||
to.array == nil || to.len == 0 || to.array == nil || to.len == 0 ||
@ -218,24 +218,24 @@ out:
if(debug) { if(debug) {
prints("main·copy: to="); prints("main·copy: to=");
runtime·printslice(to); ·printslice(to);
prints("; fm="); prints("; fm=");
runtime·printslice(fm); ·printslice(fm);
prints("; width="); prints("; width=");
runtime·printint(width); ·printint(width);
prints("; ret="); prints("; ret=");
runtime·printint(ret); ·printint(ret);
prints("\n"); prints("\n");
} }
} }
void void
runtime·printslice(Slice a) ·printslice(Slice a)
{ {
prints("["); prints("[");
runtime·printint(a.len); ·printint(a.len);
prints("/"); prints("/");
runtime·printint(a.cap); ·printint(a.cap);
prints("]"); prints("]");
runtime·printpointer(a.array); ·printpointer(a.array);
} }

View File

@ -98,11 +98,11 @@ prbounds(int8* s, int32 a, int32 b, int32 c)
{ {
prints(s); prints(s);
prints(" "); prints(" ");
runtime·printint(a); ·printint(a);
prints("<"); prints("<");
runtime·printint(b); ·printint(b);
prints(">"); prints(">");
runtime·printint(c); ·printint(c);
prints("\n"); prints("\n");
throw("string bounds"); throw("string bounds");
} }
@ -158,7 +158,7 @@ func slicestring(si String, lindex int32, hindex int32) (so String) {
if(lindex < 0 || lindex > si.len || if(lindex < 0 || lindex > si.len ||
hindex < lindex || hindex > si.len) { hindex < lindex || hindex > si.len) {
runtime·printpc(&si); ·printpc(&si);
prints(" "); prints(" ");
prbounds("slice", lindex, si.len, hindex); prbounds("slice", lindex, si.len, hindex);
} }
@ -176,7 +176,7 @@ func slicestring1(si String, lindex int32) (so String) {
int32 l; int32 l;
if(lindex < 0 || lindex > si.len) { if(lindex < 0 || lindex > si.len) {
runtime·printpc(&si); ·printpc(&si);
prints(" "); prints(" ");
prbounds("slice", lindex, si.len, si.len); prbounds("slice", lindex, si.len, si.len);
} }
@ -192,7 +192,7 @@ func slicestring1(si String, lindex int32) (so String) {
func indexstring(s String, i int32) (b byte) { func indexstring(s String, i int32) (b byte) {
if(i < 0 || i >= s.len) { if(i < 0 || i >= s.len) {
runtime·printpc(&s); ·printpc(&s);
prints(" "); prints(" ");
prbounds("index", 0, i, s.len); prbounds("index", 0, i, s.len);
} }

View File

@ -9,7 +9,7 @@
// return true; // return true;
// }else // }else
// return false; // return false;
TEXT sync·cas(SB), 7, $0 TEXT ·cas(SB), 7, $0
MOVL 4(SP), BX MOVL 4(SP), BX
MOVL 8(SP), AX MOVL 8(SP), AX
MOVL 12(SP), CX MOVL 12(SP), CX

View File

@ -9,7 +9,7 @@
// return true; // return true;
// }else // }else
// return false; // return false;
TEXT sync·cas(SB), 7, $0 TEXT ·cas(SB), 7, $0
MOVQ 8(SP), BX MOVQ 8(SP), BX
MOVL 16(SP), AX MOVL 16(SP), AX
MOVL 20(SP), CX MOVL 20(SP), CX

View File

@ -10,7 +10,7 @@
// }else // }else
// return false; // return false;
TEXT sync·cas(SB),7,$0 TEXT ·cas(SB),7,$0
MOVW 0(FP), R1 // *val MOVW 0(FP), R1 // *val
MOVW 4(FP), R2 // old MOVW 4(FP), R2 // old
MOVW 8(FP), R3 // new MOVW 8(FP), R3 // new

View File

@ -10,7 +10,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT syscall·Syscall(SB),7,$0 TEXT ·Syscall(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
@ -34,7 +34,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·Syscall6(SB),7,$0 TEXT ·Syscall6(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
@ -61,7 +61,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·RawSyscall(SB),7,$0 TEXT ·RawSyscall(SB),7,$0
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI

View File

@ -10,7 +10,7 @@
// func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64); // func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64);
// Trap # in AX, args in DI SI DX, return in AX DX // Trap # in AX, args in DI SI DX, return in AX DX
TEXT syscall·Syscall(SB),7,$0 TEXT ·Syscall(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
@ -34,7 +34,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·Syscall6(SB),7,$0 TEXT ·Syscall6(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
@ -58,7 +58,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·RawSyscall(SB),7,$0 TEXT ·RawSyscall(SB),7,$0
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX

View File

@ -10,7 +10,7 @@
// func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32); // func Syscall6(trap int32, a1, a2, a3, a4, a5, a6 int32) (r1, r2, err int32);
// Trap # in AX, args on stack above caller pc. // Trap # in AX, args on stack above caller pc.
TEXT syscall·Syscall(SB),7,$0 TEXT ·Syscall(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
@ -34,7 +34,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·Syscall6(SB),7,$0 TEXT ·Syscall6(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
@ -61,7 +61,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·RawSyscall(SB),7,$0 TEXT ·RawSyscall(SB),7,$0
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
// slide args down on top of system call number // slide args down on top of system call number
LEAL 8(SP), SI LEAL 8(SP), SI

View File

@ -10,7 +10,7 @@
// func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64); // func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64);
// Trap # in AX, args in DI SI DX, return in AX DX // Trap # in AX, args in DI SI DX, return in AX DX
TEXT syscall·Syscall(SB),7,$0 TEXT ·Syscall(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
@ -33,7 +33,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·Syscall6(SB),7,$0 TEXT ·Syscall6(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
@ -56,7 +56,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·RawSyscall(SB),7,$0 TEXT ·RawSyscall(SB),7,$0
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX

View File

@ -9,7 +9,7 @@
// func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
// Trap # in AX, args in BX CX DX SI DI, return in AX // Trap # in AX, args in BX CX DX SI DI, return in AX
TEXT syscall·Syscall(SB),7,$0 TEXT ·Syscall(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
@ -35,7 +35,7 @@ ok:
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
// Actually Syscall5 but the rest of the code expects it to be named Syscall6. // Actually Syscall5 but the rest of the code expects it to be named Syscall6.
TEXT syscall·Syscall6(SB),7,$0 TEXT ·Syscall6(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
@ -61,7 +61,7 @@ ok6:
RET RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
TEXT syscall·RawSyscall(SB),7,$0 TEXT ·RawSyscall(SB),7,$0
MOVL 4(SP), AX // syscall entry MOVL 4(SP), AX // syscall entry
MOVL 8(SP), BX MOVL 8(SP), BX
MOVL 12(SP), CX MOVL 12(SP), CX
@ -86,7 +86,7 @@ ok1:
// func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int) // func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, errno int)
// Kernel interface gets call sub-number and pointer to a0. // Kernel interface gets call sub-number and pointer to a0.
TEXT syscall·socketcall(SB),7,$0 TEXT ·socketcall(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL $SYS_SOCKETCALL, AX // syscall entry MOVL $SYS_SOCKETCALL, AX // syscall entry
MOVL 4(SP), BX // socket call number MOVL 4(SP), BX // socket call number
@ -114,7 +114,7 @@ oksock:
// taking the address of the return value newoffset. // taking the address of the return value newoffset.
// Underlying system call is // Underlying system call is
// llseek(int fd, int offhi, int offlo, int64 *result, int whence) // llseek(int fd, int offhi, int offlo, int64 *result, int whence)
TEXT syscall·Seek(SB),7,$0 TEXT ·Seek(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL $SYS__LLSEEK, AX // syscall entry MOVL $SYS__LLSEEK, AX // syscall entry
MOVL 4(SP), BX // fd MOVL 4(SP), BX // fd

View File

@ -11,7 +11,7 @@
// Note that this differs from "standard" ABI convention, which // Note that this differs from "standard" ABI convention, which
// would pass 4th arg in CX, not R10. // would pass 4th arg in CX, not R10.
TEXT syscall·Syscall(SB),7,$0 TEXT ·Syscall(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
@ -36,7 +36,7 @@ ok:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·Syscall6(SB),7,$0 TEXT ·Syscall6(SB),7,$0
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
@ -61,7 +61,7 @@ ok6:
CALL runtime·exitsyscall(SB) CALL runtime·exitsyscall(SB)
RET RET
TEXT syscall·RawSyscall(SB),7,$0 TEXT ·RawSyscall(SB),7,$0
MOVQ 16(SP), DI MOVQ 16(SP), DI
MOVQ 24(SP), SI MOVQ 24(SP), SI
MOVQ 32(SP), DX MOVQ 32(SP), DX

View File

@ -10,7 +10,7 @@
// func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
TEXT syscall·Syscall(SB),7,$0 TEXT ·Syscall(SB),7,$0
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 4(SP), R7 MOVW 4(SP), R7
MOVW 8(SP), R0 MOVW 8(SP), R0
@ -26,7 +26,7 @@ TEXT syscall·Syscall(SB),7,$0
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
// Actually Syscall5 but the rest of the code expects it to be named Syscall6. // Actually Syscall5 but the rest of the code expects it to be named Syscall6.
TEXT syscall·Syscall6(SB),7,$0 TEXT ·Syscall6(SB),7,$0
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
@ -44,7 +44,7 @@ TEXT syscall·Syscall6(SB),7,$0
RET RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
TEXT syscall·RawSyscall(SB),7,$0 TEXT ·RawSyscall(SB),7,$0
MOVW 4(SP), R7 // syscall entry MOVW 4(SP), R7 // syscall entry
MOVW 8(SP), R0 MOVW 8(SP), R0
MOVW 12(SP), R1 MOVW 12(SP), R1

View File

@ -11,7 +11,7 @@
// func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func Syscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
// Trap # in AX, args in BX CX DX SI DI, return in AX // Trap # in AX, args in BX CX DX SI DI, return in AX
TEXT syscall·Syscall(SB),7,$20 TEXT ·Syscall(SB),7,$20
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL trap+0(FP), AX // syscall entry MOVL trap+0(FP), AX // syscall entry
MOVL a1+4(FP), BX MOVL a1+4(FP), BX
@ -47,7 +47,7 @@ ok:
RET RET
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); // func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr);
TEXT syscall·Syscall6(SB),7,$24 TEXT ·Syscall6(SB),7,$24
CALL runtime·entersyscall(SB) CALL runtime·entersyscall(SB)
MOVL a1+4(FP), BX MOVL a1+4(FP), BX
MOVL a2+8(FP), CX MOVL a2+8(FP), CX
@ -85,7 +85,7 @@ ok6:
RET RET
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr);
TEXT syscall·RawSyscall(SB),7,$20 TEXT ·RawSyscall(SB),7,$20
MOVL trap+0(FP), AX // syscall entry MOVL trap+0(FP), AX // syscall entry
MOVL a1+4(FP), BX MOVL a1+4(FP), BX
MOVL a2+8(FP), CX MOVL a2+8(FP), CX