From 9323d39baea2fb0cca3735136abe263eff405133 Mon Sep 17 00:00:00 2001 From: Edjunior Machado Date: Thu, 23 May 2013 10:06:24 -0500 Subject: PowerPC: Add functions for shared resources hints. --- sysdeps/powerpc/sys/platform/ppc.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'sysdeps/powerpc/sys') diff --git a/sysdeps/powerpc/sys/platform/ppc.h b/sysdeps/powerpc/sys/platform/ppc.h index 740831e677..833f3d8480 100644 --- a/sysdeps/powerpc/sys/platform/ppc.h +++ b/sysdeps/powerpc/sys/platform/ppc.h @@ -50,4 +50,36 @@ __ppc_get_timebase (void) #endif } +/* The following functions provide hints about the usage of shared processor + resources, as defined in ISA 2.06 and newer. */ + +/* Provides a hint that performance will probably be improved if shared + resources dedicated to the executing processor are released for use by other + processors. */ +static inline void +__ppc_yield (void) +{ + __asm__ volatile ("or 27,27,27"); +} + +/* Provides a hint that performance will probably be improved if shared + resources dedicated to the executing processor are released until + all outstanding storage accesses to caching-inhibited storage have been + completed. */ +static inline void +__ppc_mdoio (void) +{ + __asm__ volatile ("or 29,29,29"); +} + +/* Provides a hint that performance will probably be improved if shared + resources dedicated to the executing processor are released until all + outstanding storage accesses to cacheable storage for which the data is not + in the cache have been completed. */ +static inline void +__ppc_mdoom (void) +{ + __asm__ volatile ("or 30,30,30"); +} + #endif /* sys/platform/ppc.h */ -- cgit 1.4.1