[LLVMdev] libSystem, __clear_cache(), FreeBSD and ARM
Dimitry Andric
dimitry at andric.com
Thu May 13 13:15:34 PDT 2010
On 2010-05-13 19:07, Ed Schouten wrote:
> --- lib/System/Memory.cpp
> +++ lib/System/Memory.cpp
> @@ -61,7 +61,7 @@
> for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
> asm volatile("icbi 0, %0" : : "r"(Line));
> asm volatile("isync");
> -# elif defined(__arm__) && defined(__GNUC__)
> +# elif defined(__arm__) && defined(__GNUC__) && !defined(__FreeBSD__)
> // FIXME: Can we safely always call this for __GNUC__ everywhere?
> char *Start = (char*) Addr;
> char *End = Start + Len;
>
> I don't know anything about ARM, but isn't there a way we can do this
> using some inline asm instead of calling a glibc-function?
If you are talking about __clear_cache(), it is defined in libgcc, not
glibc. This should also be available on FreeBSD, though I can only find
the required libgcc2.h header in the gcc source directory...
The function is at least available on FreeBSD/i386-CURRENT:
$ readelf -a /lib/libgcc_s.so.1 | grep __clear_cache
51: 000046b0 5 FUNC GLOBAL DEFAULT 11 __clear_cache@@GCC_3.0
More information about the llvm-dev
mailing list