Skip to content

Commit

Permalink
pixelflinger: use __builtin___clear_cache instead of cacheflush
Browse files Browse the repository at this point in the history
cacheflush doesn't exist on LP64 any more, and gcc's
__builtin___clear_cache is better in every way.  Use it instead.

Change-Id: Ibbf6facbdefc15b6dda51d014e1c44fb7aa2b17d
  • Loading branch information
colincross committed Feb 11, 2014
1 parent 85516e9 commit 32ea4a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions libpixelflinger/codeflinger/CodeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,9 @@ int CodeCache::cache( const AssemblyKeyBase& keyBase,
mCacheInUse += assemblySize;
mWhen++;
// synchronize caches...
#if defined(__arm__) || defined(__mips__) || defined(__aarch64__)
const long base = long(assembly->base());
const long curr = base + long(assembly->size());
err = cacheflush(base, curr, 0);
ALOGE_IF(err, "cacheflush error %s\n",
strerror(errno));
#endif
__builtin___clear_cache((void*)base, (void*)curr);
}

pthread_mutex_unlock(&mLock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,11 @@ dataTransferTest_t dataTransferTests [] =
};


int flushcache()
void flushcache()
{
const long base = long(instrMem);
const long curr = base + long(instrMemSize);
return cacheflush(base, curr, 0);
__builtin___clear_cache((void*)base, (void*)curr);
}
void dataOpTest(dataOpTest_t test, ARMAssemblerInterface *a64asm, uint32_t Rd = 0,
uint32_t Rn = 1, uint32_t Rm = 2, uint32_t Rs = 3)
Expand Down

0 comments on commit 32ea4a8

Please sign in to comment.