2 BootMii - a Free Software replacement for the Nintendo/BroadOn bootloader.
5 Copyright (C) 2008 Segher Boessenkool <segher@kernel.crashing.org>
7 # This code is licensed to you under the terms of the GNU GPL, version 2;
8 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
11 #include "bootmii_ppc.h"
13 void sync_before_read(void *p, u32 len)
18 b = ((u32)p + len + 0x1f) & ~0x1f;
20 for ( ; a < b; a += 32)
21 asm("dcbi 0,%0" : : "b"(a));
26 void sync_after_write(const void *p, u32 len)
31 b = ((u32)p + len + 0x1f) & ~0x1f;
33 for ( ; a < b; a += 32)
34 asm("dcbst 0,%0" : : "b"(a));
39 void sync_before_exec(const void *p, u32 len)
44 b = ((u32)p + len + 0x1f) & ~0x1f;
46 for ( ; a < b; a += 32)
47 asm("dcbst 0,%0 ; sync ; icbi 0,%0" : : "b"(a));