aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2021-05-21 17:00:08 -0400
committerCherry Mui <cherryyz@google.com>2021-05-21 21:49:42 +0000
commit21db1d193cc3d830e1a7d53a04271631ce1198cd (patch)
tree2baa324654263c1fac626f08ed90986f61f62c93 /src/runtime
parentb1a398cf0f04ac911be204d3c0ee001a94621683 (diff)
downloadgo-21db1d193cc3d830e1a7d53a04271631ce1198cd.tar.xz
[dev.typeparams] runtime: fix newproc arg size on ARM
At runtime startup it calls newproc from assembly code to start the main goroutine. runtime.main has no arguments, so the arg size should be 0, instead of 8. While here, use clearer code sequence to open the frame. Change-Id: I2bbb26a83521ea867897530b86a85b22a3c8be9d Reviewed-on: https://go-review.googlesource.com/c/go/+/321957 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/asm_arm.s10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index 6d3573d68f..872e56aeb4 100644
--- a/src/runtime/asm_arm.s
+++ b/src/runtime/asm_arm.s
@@ -168,14 +168,14 @@ TEXT runtime·rt0_go(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
BL runtime·schedinit(SB)
// create a new goroutine to start program
+ SUB $12, R13
MOVW $runtime·mainPC(SB), R0
- MOVW.W R0, -4(R13)
- MOVW $8, R0
- MOVW.W R0, -4(R13)
+ MOVW R0, 8(R13) // arg 2: fn
MOVW $0, R0
- MOVW.W R0, -4(R13) // push $0 as guard
+ MOVW R0, 4(R13) // arg 1: siz
+ MOVW R0, 0(R13) // dummy LR
BL runtime·newproc(SB)
- MOVW $12(R13), R13 // pop args and LR
+ ADD $12, R13 // pop args and LR
// start this M
BL runtime·mstart(SB)