Sunday, October 16, 2022

[FIXED] How to call clear cache on Android Native ARM64?

Issue

Simple question for simple answer.

I just can't figure out how to clear the instruction cache properly on such architecture.

Did anyone use it?


Solution

GCC provide this built-in function

__builtin___clear_cache (void* start, void* end)

that is automatically managed according to the architecture.

Parameters set the range of memory to cache, where start is inclusive and end is exclusive. Every time a new memory area with instructions to execute, the cache should be cleared for that area.

reading



Answered By - Antonio Ken Iannillo
Answer Checked By - David Marino (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.