diff options
| author | Cherry Zhang <lunaria21@gmail.com> | 2016-04-27 22:18:02 -0400 |
|---|---|---|
| committer | Minux Ma <minux@golang.org> | 2016-05-01 02:36:46 +0000 |
| commit | 981395103e9addfc494245979063dc59a327e888 (patch) | |
| tree | a6bb5586114cd46c7c6e7096ebc2f15a309787ec /src/runtime/sys_linux_mips64x.s | |
| parent | 8dc0444a04a8a43887b4ca3753ee63b430cf2602 (diff) | |
| download | go-981395103e9addfc494245979063dc59a327e888.tar.xz | |
cmd/internal/obj/mips et al.: introduce SB register on mips64x
SB register (R28) is introduced for access external addresses with shorter
instruction sequences. It is loaded at entry points. External data within
2G of SB can be accessed this way.
cmd/internal/obj: relocaltion R_ADDRMIPS is split into two relocations
R_ADDRMIPS and R_ADDRMIPSU, handling the low 16 bits and the "upper" 16
bits of external addresses, respectively, since the instructios may not
be adjacent. It might be better if relocation Variant could be used.
cmd/link/internal/mips64: support new relocations.
cmd/compile/internal/mips64: reserve SB register.
runtime: initialize SB register at entry points.
Change-Id: I5f34868f88c5a9698c042a8a1f12f76806c187b9
Reviewed-on: https://go-review.googlesource.com/19802
Reviewed-by: Minux Ma <minux@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_mips64x.s')
| -rw-r--r-- | src/runtime/sys_linux_mips64x.s | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime/sys_linux_mips64x.s b/src/runtime/sys_linux_mips64x.s index f6877cb32d..e84b2c5bd5 100644 --- a/src/runtime/sys_linux_mips64x.s +++ b/src/runtime/sys_linux_mips64x.s @@ -233,6 +233,11 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32 RET TEXT runtime·sigtramp(SB),NOSPLIT,$64 + // initialize REGSB = PC&0xffffffff00000000 + BGEZAL R0, 1(PC) + SRLV $32, R31, RSB + SLLV $32, RSB + // initialize essential registers (just in case) JAL runtime·reginit(SB) @@ -250,8 +255,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$64 RET TEXT runtime·cgoSigtramp(SB),NOSPLIT,$0 - MOVV $runtime·sigtramp(SB), R1 - JMP (R1) + JMP runtime·sigtramp(SB) TEXT runtime·mmap(SB),NOSPLIT,$-8 MOVV addr+0(FP), R4 |
