kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

clear_cache.c (580B)


      1 /*
      2  * Runtime target for __builtin___clear_cache.
      3  *
      4  * kit lowers the builtin to the libgcc/compiler-rt symbol __clear_cache.
      5  * This weak fallback gives freestanding links a provider. Targets that need
      6  * real instruction-cache maintenance can override it with an arch-specific
      7  * runtime member.
      8  */
      9 __attribute__((weak)) void __clear_cache(char* begin, char* end) {
     10   (void)begin;
     11   (void)end;
     12 }
     13 
     14 __attribute__((weak)) void __kit_icache_invalidate(const void* p,
     15                                                    unsigned long n) {
     16   __clear_cache((char*)p, (char*)p + n);
     17 }