Commit 6e904323 authored by Cherry Zhang's avatar Cherry Zhang Committed by Minux Ma

runtime/cgo: add context argument to crosscall2 on mips64

Change-Id: Id018516075842afd8af12fbf207763a851d5a851
Reviewed-on: https://go-review.googlesource.com/22754Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 082881da
...@@ -7,38 +7,39 @@ ...@@ -7,38 +7,39 @@
#include "textflag.h" #include "textflag.h"
/* /*
* void crosscall2(void (*fn)(void*, int32), void*, int32) * void crosscall2(void (*fn)(void*, int32, uintptr), void*, int32, uintptr)
* Save registers and call fn with two arguments. * Save registers and call fn with two arguments.
*/ */
TEXT crosscall2(SB),NOSPLIT,$-8 TEXT crosscall2(SB),NOSPLIT,$-8
/* /*
* We still need to save all callee save register as before, and then * We still need to save all callee save register as before, and then
* push 2 args for fn (R5 and R6). * push 3 args for fn (R5, R6, R7).
* Also note that at procedure entry in gc world, 8(R29) will be the * Also note that at procedure entry in gc world, 8(R29) will be the
* first arg. * first arg.
*/ */
ADDV $(-8*22), R29 ADDV $(-8*23), R29
MOVV R5, (8*1)(R29) MOVV R5, (8*1)(R29)
MOVV R6, (8*2)(R29) MOVV R6, (8*2)(R29)
MOVV R16, (8*3)(R29) MOVV R7, (8*3)(R29)
MOVV R17, (8*4)(R29) MOVV R16, (8*4)(R29)
MOVV R18, (8*5)(R29) MOVV R17, (8*5)(R29)
MOVV R19, (8*6)(R29) MOVV R18, (8*6)(R29)
MOVV R20, (8*7)(R29) MOVV R19, (8*7)(R29)
MOVV R21, (8*8)(R29) MOVV R20, (8*8)(R29)
MOVV R22, (8*9)(R29) MOVV R21, (8*9)(R29)
MOVV R23, (8*10)(R29) MOVV R22, (8*10)(R29)
MOVV RSB, (8*11)(R29) MOVV R23, (8*11)(R29)
MOVV g, (8*12)(R29) MOVV RSB, (8*12)(R29)
MOVV R31, (8*13)(R29) MOVV g, (8*13)(R29)
MOVD F24, (8*14)(R29) MOVV R31, (8*14)(R29)
MOVD F25, (8*15)(R29) MOVD F24, (8*15)(R29)
MOVD F26, (8*16)(R29) MOVD F25, (8*16)(R29)
MOVD F27, (8*17)(R29) MOVD F26, (8*17)(R29)
MOVD F28, (8*18)(R29) MOVD F27, (8*18)(R29)
MOVD F29, (8*19)(R29) MOVD F28, (8*19)(R29)
MOVD F30, (8*20)(R29) MOVD F29, (8*20)(R29)
MOVD F31, (8*21)(R29) MOVD F30, (8*21)(R29)
MOVD F31, (8*22)(R29)
// Initialize Go ABI environment // Initialize Go ABI environment
// prepare SB register = PC & 0xffffffff00000000 // prepare SB register = PC & 0xffffffff00000000
...@@ -51,24 +52,25 @@ TEXT crosscall2(SB),NOSPLIT,$-8 ...@@ -51,24 +52,25 @@ TEXT crosscall2(SB),NOSPLIT,$-8
MOVV (8*1)(R29), R5 MOVV (8*1)(R29), R5
MOVV (8*2)(R29), R6 MOVV (8*2)(R29), R6
MOVV (8*3)(R29), R16 MOVV (8*3)(R29), R7
MOVV (8*4)(R29), R17 MOVV (8*4)(R29), R16
MOVV (8*5)(R29), R18 MOVV (8*5)(R29), R17
MOVV (8*6)(R29), R19 MOVV (8*6)(R29), R18
MOVV (8*7)(R29), R20 MOVV (8*7)(R29), R19
MOVV (8*8)(R29), R21 MOVV (8*8)(R29), R20
MOVV (8*9)(R29), R22 MOVV (8*9)(R29), R21
MOVV (8*10)(R29), R23 MOVV (8*10)(R29), R22
MOVV (8*11)(R29), RSB MOVV (8*11)(R29), R23
MOVV (8*12)(R29), g MOVV (8*12)(R29), RSB
MOVV (8*13)(R29), R31 MOVV (8*13)(R29), g
MOVD (8*14)(R29), F24 MOVV (8*14)(R29), R31
MOVD (8*15)(R29), F25 MOVD (8*15)(R29), F24
MOVD (8*16)(R29), F26 MOVD (8*16)(R29), F25
MOVD (8*17)(R29), F27 MOVD (8*17)(R29), F26
MOVD (8*18)(R29), F28 MOVD (8*18)(R29), F27
MOVD (8*19)(R29), F29 MOVD (8*19)(R29), F28
MOVD (8*20)(R29), F30 MOVD (8*20)(R29), F29
MOVD (8*21)(R29), F31 MOVD (8*21)(R29), F30
ADDV $(8*22), R29 MOVD (8*22)(R29), F31
ADDV $(8*23), R29
RET RET
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment