Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 410ae2fe authored by Ashok Bhat's avatar Ashok Bhat
Browse files

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: default avatarAshok Bhat <ashok.bhat@arm.com>
parent 46fbaf06
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);