]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix freebsd/arm instruction cache flush
authorDave Cheney <dave@cheney.net>
Tue, 1 Jan 2013 10:47:42 +0000 (21:47 +1100)
committerDave Cheney <dave@cheney.net>
Tue, 1 Jan 2013 10:47:42 +0000 (21:47 +1100)
sysarch requires arguments to be passed on the stack, not in registers.

Credit to Shenghou Ma (minux) for the fix.

R=minux.ma, devon.odell
CC=golang-dev
https://golang.org/cl/7037043

src/pkg/runtime/sys_freebsd_arm.s

index 0c30d44957ffccef3680fecc036d9cc3cf53c706..2c90a7ea523909ce13b38ab0ec3c3c2cc82abea8 100644 (file)
@@ -244,11 +244,16 @@ TEXT runtime·sigprocmask(SB),7,$0
        MOVW.CS R9, (R9)
        RET
 
-TEXT runtime·cacheflush(SB),7,$0
+TEXT runtime·cacheflush(SB),7,$8
+       MOVW $1, R0 // drain_writebuf
+       SWI $165 // sysarch
        MOVW $0, R0 // icacheflush
        MOVW 0(FP), R1 // start
+       MOVW R1, 4(R13)
        MOVW 4(FP), R2 // end
        SUB R1, R2 // R2 = length
+       MOVW R2, 8(R13)
+       MOVW $4(R13), R1
        SWI $165 // sysarch
        RET