aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/softfloat_arm.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-07-18 12:23:38 -0400
committerRuss Cox <rsc@golang.org>2013-07-18 12:23:38 -0400
commit8166b2da192919679cd4583c4edb34becbe36e8c (patch)
treea660fef940ee48152b7bc36eea8b1618a6460dbc /src/pkg/runtime/softfloat_arm.c
parent249f807c39e96a30707f5005881b6c1b8e08077e (diff)
downloadgo-8166b2da192919679cd4583c4edb34becbe36e8c.tar.xz
runtime: record full frame size for arm _sfloat2
With preemption, _sfloat2 can show up in stack traces. Write the function prototype in a way that accurately shows the frame size and the fact that it might contain pointers. R=golang-dev, dvyukov CC=golang-dev https://golang.org/cl/11523043
Diffstat (limited to 'src/pkg/runtime/softfloat_arm.c')
-rw-r--r--src/pkg/runtime/softfloat_arm.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/pkg/runtime/softfloat_arm.c b/src/pkg/runtime/softfloat_arm.c
index 56a73fce5c..f021c929ff 100644
--- a/src/pkg/runtime/softfloat_arm.c
+++ b/src/pkg/runtime/softfloat_arm.c
@@ -576,23 +576,44 @@ done:
return 0;
}
-// The ... here is because there are actually 16 registers
-// being passed (r0, r1, and so on) amd we are too lazy
-// to list them all.
+typedef struct Sfregs Sfregs;
+
+// NOTE: These are all recorded as pointers because they are possibly live registers,
+// and we don't know what they contain. Recording them as pointers should be
+// safer than not.
+struct Sfregs
+{
+ uint32 *r0;
+ uint32 *r1;
+ uint32 *r2;
+ uint32 *r3;
+ uint32 *r4;
+ uint32 *r5;
+ uint32 *r6;
+ uint32 *r7;
+ uint32 *r8;
+ uint32 *r9;
+ uint32 *r10;
+ uint32 *r11;
+ uint32 *r12;
+ uint32 *r13;
+ uint32 cspr;
+};
+
#pragma textflag 7
uint32*
-runtime·_sfloat2(uint32 *lr, uint32 r0, ...)
+runtime·_sfloat2(uint32 *lr, Sfregs regs)
{
uint32 skip;
- skip = stepflt(lr, &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, &r0))
+ while(skip = stepflt(lr, (uint32*)&regs.r0))
lr += skip;
return lr;
}