Skip to content

Commit 6dbd142

Browse files
committed
add cache flushing call after generating closure.
go/test: passes 88% (306/347) R=rsc https://golang.org/cl/152089
1 parent e5636d6 commit 6dbd142

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/pkg/runtime/arm/closure.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ vars: WORD arg0
4343
WORD arg2
4444
*/
4545

46+
extern void cacheflush(byte* start, byte* end);
47+
4648
#pragma textflag 7
4749
void
4850
runtime·closure(int32 siz, byte *fn, byte *arg0)
@@ -121,5 +123,7 @@ runtime·closure(int32 siz, byte *fn, byte *arg0)
121123

122124
if(p > q)
123125
throw("bad math in sys.closure");
126+
127+
cacheflush(*ret, q+siz);
124128
}
125129

src/pkg/runtime/linux/arm/sys.s

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#define SYS_futex (SYS_BASE + 240)
2323
#define SYS_exit_group (SYS_BASE + 248)
2424

25+
#define ARM_BASE (SYS_BASE + 0x0f0000)
26+
#define SYS_ARM_cacheflush (ARM_BASE + 2)
27+
2528
TEXT write(SB),7,$0
2629
MOVW 0(FP), R0
2730
MOVW 4(FP), R1
@@ -136,3 +139,11 @@ TEXT clone(SB),7,$0
136139
MOVW R0, (R1)
137140

138141

142+
TEXT cacheflush(SB),7,$0
143+
MOVW 0(FP), R0
144+
MOVW 4(FP), R1
145+
MOVW $0, R2
146+
MOVW $SYS_ARM_cacheflush, R7
147+
SWI $0
148+
RET
149+

0 commit comments

Comments
 (0)