diff options
author | Ashok Bhat <ashok.bhat@arm.com> | 2014-06-19 11:03:32 +0100 |
---|---|---|
committer | Ashok Bhat <ashok.bhat@arm.com> | 2014-06-19 12:29:19 +0100 |
commit | 410ae2fe8e5d78cbce7b20be87828c5595e76842 (patch) | |
tree | 4c9a47218762a86079214c57484f6ceb6a68e59c /libpixelflinger/codeflinger | |
parent | 46fbaf062fd94e3fecc7165f4b42d42145e0603d (diff) | |
download | core-410ae2fe8e5d78cbce7b20be87828c5595e76842.tar.gz core-410ae2fe8e5d78cbce7b20be87828c5595e76842.tar.bz2 core-410ae2fe8e5d78cbce7b20be87828c5595e76842.zip |
pixelflinger: Use pointer arithmetic to determine cache flush parameters
CodeCache casts base address to long and then adds size (of type
ssize_t) to get end address. This can cause sign-extension problems.
This patch instead uses simple pointer arithmetic.
Change-Id: Ib71d515a6fd6a7f4762cf974d6cf4eba9a601fa8
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Diffstat (limited to 'libpixelflinger/codeflinger')
-rw-r--r-- | libpixelflinger/codeflinger/CodeCache.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp index 8afe0a994..cfd2b3709 100644 --- a/libpixelflinger/codeflinger/CodeCache.cpp +++ b/libpixelflinger/codeflinger/CodeCache.cpp @@ -201,9 +201,9 @@ int CodeCache::cache( const AssemblyKeyBase& keyBase, mCacheInUse += assemblySize; mWhen++; // synchronize caches... - const long base = long(assembly->base()); - const long curr = base + long(assembly->size()); - __builtin___clear_cache((void*)base, (void*)curr); + void* base = assembly->base(); + void* curr = (uint8_t*)base + assembly->size(); + __builtin___clear_cache(base, curr); } pthread_mutex_unlock(&mLock); |