[git commit future] cacheflush.c: compile only if __NR_cacheflush is available

Peter S. Mazinger ps.m at gmx.net
Wed Mar 30 11:53:36 UTC 2011

commit: http://git.uclibc.org/uClibc/commit/?id=f77c1955ed9ca26c1474e19aeb67e8548466c069
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

The header had to be removed under the guard, else asm/cachectl.h might
not be available at all.
While there, disable __cachectl prototype.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
 libc/sysdeps/linux/bfin/cacheflush.c   |    7 ++++---
 libc/sysdeps/linux/mips/cacheflush.c   |    4 ++--
 libc/sysdeps/linux/mips/sys/cachectl.h |    2 ++
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/libc/sysdeps/linux/bfin/cacheflush.c b/libc/sysdeps/linux/bfin/cacheflush.c
index a8d81c4..6ff3ad5 100644
--- a/libc/sysdeps/linux/bfin/cacheflush.c
+++ b/libc/sysdeps/linux/bfin/cacheflush.c
@@ -6,9 +6,10 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#include <unistd.h>
-#include <errno.h>
 #include <sys/syscall.h>
-#include <sys/cachectl.h>
+#ifdef __NR_cacheflush
+# include <sys/cachectl.h>
 _syscall3 (int, cacheflush, void *, start, const int, nbytes, const int, flags)
diff --git a/libc/sysdeps/linux/mips/cacheflush.c b/libc/sysdeps/linux/mips/cacheflush.c
index 235414d..56472a0 100644
--- a/libc/sysdeps/linux/mips/cacheflush.c
+++ b/libc/sysdeps/linux/mips/cacheflush.c
@@ -16,15 +16,15 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
-#include <errno.h>
-#include <unistd.h>
 #include <sys/syscall.h>
 #ifdef __NR_cacheflush
+# include <sys/cachectl.h>
 _syscall3(int, cacheflush, void *, addr, const int, nbytes, const int, op)
 strong_alias(cacheflush, _flush_cache)
 #ifdef __NR_cachectl
+# include <sys/cachectl.h>
 _syscall3(int, cachectl, void *, addr, const int, nbytes, const int, op)
diff --git a/libc/sysdeps/linux/mips/sys/cachectl.h b/libc/sysdeps/linux/mips/sys/cachectl.h
index a93e1fb..805c785 100644
--- a/libc/sysdeps/linux/mips/sys/cachectl.h
+++ b/libc/sysdeps/linux/mips/sys/cachectl.h
@@ -31,7 +31,9 @@ __BEGIN_DECLS
 #ifdef __USE_MISC
 extern int cachectl (void *addr, __const int nbytes, __const int op) __THROW;
+#if 0
 extern int __cachectl (void *addr, __const int nbytes, __const int op) __THROW;
 #ifdef __USE_MISC
 extern int cacheflush (void *addr, __const int nbytes, __const int op) __THROW;

More information about the uClibc-cvs mailing list