[PATCH] PowerPC: Add functions for shared resources hints
Roland McGrath
roland@hack.frob.com
Tue Nov 27 17:31:00 GMT 2012
> * sysdeps/powerpc/Makefile: Add test-shared-resources.c.
This should read:
* sysdeps/powerpc/Makefile [$(subdir) = misc] (tests):
Add test-shared-resources.
> * sysdeps/powerpc/sys/platform/ppc.h: Add __ppc_yield(),
> __ppc_mdoio() and __ppc_mdoom().
() is not part of a function's name.
Just use the name in comments and log entries.
> +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}.
Two spaces between sentences.
> + __asm__ volatile ("or 27,27,27\n");
No trailing \n.
> +static int
> +do_test (void)
> +{
> + __ppc_yield ();
> + __ppc_mdoio ();
> + __ppc_mdoom ();
> + return 0;
> +}
I don't understand the point of this test.
It doesn't actually verify anything but that it compiles.
More information about the Libc-alpha
mailing list