Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6bfa02f authored by Christophe Leroy's avatar Christophe Leroy Committed by Scott Wood
Browse files

powerpc: add inline functions for cache related instructions



This patch adds inline functions to use dcbz, dcbi, dcbf, dcbst
from C functions

Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarScott Wood <oss@buserror.net>
parent 766d45cb
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -69,6 +69,25 @@ extern void _set_L3CR(unsigned long);
#define _set_L3CR(val)	do { } while(0)
#endif

static inline void dcbz(void *addr)
{
	__asm__ __volatile__ ("dcbz 0, %0" : : "r"(addr) : "memory");
}

static inline void dcbi(void *addr)
{
	__asm__ __volatile__ ("dcbi 0, %0" : : "r"(addr) : "memory");
}

static inline void dcbf(void *addr)
{
	__asm__ __volatile__ ("dcbf 0, %0" : : "r"(addr) : "memory");
}

static inline void dcbst(void *addr)
{
	__asm__ __volatile__ ("dcbst 0, %0" : : "r"(addr) : "memory");
}
#endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_CACHE_H */