MajorasKid
MajorasKid

Reputation: 873

(mips) Cacheflush function on arm/arm64

as part of a project, I try to compile a .c file for Android10 (a Pixel 3) for arm64 using the ninja buildsystem. This .c file is part of a PoC that was already successfully used (so, it should work somehow).

The problem is now: this file contains a reference to the "cacheflush" function, that is well defined for bionic/MIPS, but not for arm64. The error message is: error: use of undeclared identifier 'cacheflush'

As I said, the example is referenced to work. I already installed the android ndk/sdk and other dependencies that were listed in the project. I also tested including different header files (such as cacheflush.h and unistd.h)

Can anybody help me to get this function to work? Many thanks!

Upvotes: 0

Views: 585

Answers (1)

ben liu
ben liu

Reputation: 11

I am using "cacheflush" for poc as well, if you type "man cacheflush" in linux-based distrubutions, you can see notes like this in synopsis:

Note: On some architectures, there is no glibc wrapper for this system call; see NOTES.

So i guess no cacheflush function in ARM architecture.

You can search ARM instruction set reference for instructions which do the same job(like clflush in x86).

Upvotes: 1

Related Questions