aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/softfloat_arm.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-04 21:12:31 -0400
committerRuss Cox <rsc@golang.org>2014-09-04 21:12:31 -0400
commitdb58ab96fa4767ca6144678d63203be5381709d6 (patch)
tree734bf2f8992b8992c96a8a56c946acfc33db05f2 /src/pkg/runtime/softfloat_arm.c
parent1a14b5bad8926941023ca310fa3b53c70717b1e2 (diff)
downloadgo-db58ab96fa4767ca6144678d63203be5381709d6.tar.xz
runtime: more C to Go conversion adjustments
Mostly NOSPLIT additions. Had to rewrite atomic_arm.c in Go because it calls lock, and lock is too complex. With this CL, I find no Go -> C calls that can split the stack on any system except Solaris and Windows. Solaris and Windows need more work and will be done separately. LGTM=iant, dave R=golang-codereviews, bradfitz, iant, dave CC=dvyukov, golang-codereviews, khr, r https://golang.org/cl/137160043
Diffstat (limited to 'src/pkg/runtime/softfloat_arm.c')
-rw-r--r--src/pkg/runtime/softfloat_arm.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/pkg/runtime/softfloat_arm.c b/src/pkg/runtime/softfloat_arm.c
index 6b37160114..5e5f4025ec 100644
--- a/src/pkg/runtime/softfloat_arm.c
+++ b/src/pkg/runtime/softfloat_arm.c
@@ -606,20 +606,43 @@ struct Sfregs
uint32 cspr;
};
+static void sfloat2(void);
+
#pragma textflag NOSPLIT
uint32*
runtime·_sfloat2(uint32 *lr, Sfregs regs)
{
+ void (*fn)(void);
+
+ g->m->ptrarg[0] = lr;
+ g->m->ptrarg[1] = &regs;
+ fn = sfloat2;
+ runtime·onM(&fn);
+ lr = g->m->ptrarg[0];
+ g->m->ptrarg[0] = nil;
+ return lr;
+}
+
+static void
+sfloat2(void)
+{
+ uint32 *lr;
+ Sfregs *regs;
uint32 skip;
+
+ lr = g->m->ptrarg[0];
+ regs = g->m->ptrarg[1];
+ g->m->ptrarg[0] = nil;
+ g->m->ptrarg[1] = nil;
- skip = stepflt(lr, (uint32*)&regs.r0);
+ skip = stepflt(lr, (uint32*)&regs->r0);
if(skip == 0) {
runtime·printf("sfloat2 %p %x\n", lr, *lr);
fabort(); // not ok to fail first instruction
}
lr += skip;
- while(skip = stepflt(lr, (uint32*)&regs.r0))
+ while(skip = stepflt(lr, (uint32*)&regs->r0))
lr += skip;
- return lr;
+ g->m->ptrarg[0] = lr;
}