1 // Copyright 2008-2009 Segher Boessenkool <segher@kernel.crashing.org>
2 // This code is licensed to you under the terms of the GNU GPL, version 2;
3 // see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
7 void sync_before_read(void *p, u32 len)
12 b = ((u32)p + len + 0x1f) & ~0x1f;
14 for ( ; a < b; a += 32)
15 asm("dcbi 0,%0" : : "b"(a) : "memory");
20 void sync_after_write(const void *p, u32 len)
25 b = ((u32)p + len + 0x1f) & ~0x1f;
27 for ( ; a < b; a += 32)
28 asm("dcbst 0,%0" : : "b"(a));
33 void sync_before_exec(const void *p, u32 len)
38 b = ((u32)p + len + 0x1f) & ~0x1f;
40 for ( ; a < b; a += 32)
41 asm("dcbst 0,%0 ; sync ; icbi 0,%0" : : "b"(a));