]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC: Add functions for shared resources hints.
authorEdjunior Machado <emachado@linux.vnet.ibm.com>
Thu, 23 May 2013 15:06:24 +0000 (10:06 -0500)
committerRyan S. Arnold <rsa@linux.vnet.ibm.com>
Fri, 26 Jul 2013 14:06:49 +0000 (09:06 -0500)
(cherry picked from commit 9323d39baea2fb0cca3735136abe263eff405133)

ChangeLog
manual/platform.texi
sysdeps/powerpc/sys/platform/ppc.h

index a5e0b230c3be73573bcc379f1074e723635fdf03..422a02d2862bfb64bc8d6b1f10452f94a16bd7c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-05-23  Edjunior Machado  <emachado@linux.vnet.ibm.com>
+
+       * sysdeps/powerpc/sys/platform/ppc.h: Add __ppc_yield,
+       __ppc_mdoio and __ppc_mdoom.
+       * manual/platform.texi: Document new functions __ppc_yield,
+       __ppc_mdoio and __ppc_mdoom.
+
 2013-05-22  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
 
        * sysdeps/unix/sysv/linux/bits/siginfo.h (siginfo_t): Add si_addr_lsb
index e387ff4cc9bdad3bd8a38fc846a158e112d1f409..316b1f1f2dcfd5babd9e95a7a3809a054c9bfadf 100644 (file)
@@ -34,3 +34,27 @@ This frequency is not related to the processor clock or the bus clock.
 It is also possible that this frequency is not constant.  More information is
 available in @cite{Power ISA 2.06b - Book II - Section 5.2}.
 @end deftypefun
+
+The following functions provide hints about the usage of resources that are
+shared with other processors.  They can be used, for example, if a program
+waiting on a lock intends to divert the shared resources to be used by other
+processors.  More information is available in @cite{Power ISA 2.06b - Book II -
+Section 3.2}.
+
+@deftypefun {void} __ppc_yield (void)
+Provide a hint that performance will probably be improved if shared resources
+dedicated to the executing processor are released for use by other processors.
+@end deftypefun
+
+@deftypefun {void} __ppc_mdoio (void)
+Provide 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.
+@end deftypefun
+
+@deftypefun {void} __ppc_mdoom (void)
+Provide 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.
+@end deftypefun
index 58948e837aa1eefe4b05b1bb0bb09bc3b59b186e..d3ed6b9f23447ccf53c0f12274ccbb97cb757204 100644 (file)
@@ -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 */