summaryrefslogtreecommitdiffstats
path: root/media/libeffects/lvm/lib/Common/src/InstAlloc.c
diff options
context:
space:
mode:
authorAshok Bhat <ashok.bhat@arm.com>2014-02-18 11:40:00 +0000
committerAshok Bhat <ashok.bhat@arm.com>2014-02-20 14:12:49 +0000
commitb302bd5d288be2d3363b80053ca2392560b00b25 (patch)
tree7eaf242136ba86c73b7371e47475a2d7c5334847 /media/libeffects/lvm/lib/Common/src/InstAlloc.c
parent80b72e6f4202ce26facbe51b8739814bca198a2c (diff)
downloadframeworks_av-b302bd5d288be2d3363b80053ca2392560b00b25.zip
frameworks_av-b302bd5d288be2d3363b80053ca2392560b00b25.tar.gz
frameworks_av-b302bd5d288be2d3363b80053ca2392560b00b25.tar.bz2
LP64 fixes for media/libeffects
Changes include: [x] In get parameter series of functions, replaced size_t* formal parameter type with uint32_t* where actual parameter passed was uint32_t*. [x] In set parameter series of functions, changed size_t formal parameter to uint32_t where actual parameter was uint32_t. [x] Changed the definition of LVM_UINT32 from unsigned long to uint32_t as unsigned long is 64-bit in LP64. [x] Used other stdint.h types for other LVM_types for consistency. [x] Use of uintptr_t for the pNextMember of the INST_ALLOC structure, rather than LVM_UINT32, for portablility. [x] Use of uintptr_t where pointers are used in arithmetic. [x] Replaced the use of 0xFFFFFFFC with ~3 in places where it was used to clear last two bits. [x] Removed int casts where cmdSize and *replySize, both uint32_t, were being compared with sizeof(). Change-Id: Ibec0b4d8e9b855f44b1cd853be6df84d13cf4186 Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Diffstat (limited to 'media/libeffects/lvm/lib/Common/src/InstAlloc.c')
-rw-r--r--media/libeffects/lvm/lib/Common/src/InstAlloc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/media/libeffects/lvm/lib/Common/src/InstAlloc.c b/media/libeffects/lvm/lib/Common/src/InstAlloc.c
index 481df84..a89a5c3 100644
--- a/media/libeffects/lvm/lib/Common/src/InstAlloc.c
+++ b/media/libeffects/lvm/lib/Common/src/InstAlloc.c
@@ -30,7 +30,7 @@ void InstAlloc_Init( INST_ALLOC *pms,
void *StartAddr )
{
pms->TotalSize = 3;
- pms->pNextMember = (LVM_UINT32)(((LVM_UINT32)StartAddr + 3) & 0xFFFFFFFC);/* This code will fail if the platform address space is more than 32-bits*/
+ pms->pNextMember = (((uintptr_t)StartAddr + 3) & (uintptr_t)~3);
}
@@ -51,7 +51,7 @@ void* InstAlloc_AddMember( INST_ALLOC *pms,
void *NewMemberAddress; /* Variable to temporarily store the return value */
NewMemberAddress = (void*)pms->pNextMember;
- Size = ((Size + 3) & 0xFFFFFFFC); /* Ceil the size to a multiple of four */
+ Size = ((Size + 3) & (LVM_UINT32)~3); /* Ceil the size to a multiple of four */
pms->TotalSize += Size;
pms->pNextMember += Size;
@@ -84,30 +84,30 @@ LVM_UINT32 InstAlloc_GetTotal( INST_ALLOC *pms)
void InstAlloc_InitAll( INST_ALLOC *pms,
LVM_MemoryTable_st *pMemoryTable)
{
- LVM_UINT32 StartAddr;
+ uintptr_t StartAddr;
- StartAddr = (LVM_UINT32)pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].pBaseAddress;
+ StartAddr = (uintptr_t)pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].pBaseAddress;
pms[0].TotalSize = 3;
- pms[0].pNextMember = (LVM_UINT32)(((LVM_UINT32)StartAddr + 3) & 0xFFFFFFFC);
+ pms[0].pNextMember = ((StartAddr + 3) & (uintptr_t)~3);
- StartAddr = (LVM_UINT32)pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].pBaseAddress;
+ StartAddr = (uintptr_t)pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].pBaseAddress;
pms[1].TotalSize = 3;
- pms[1].pNextMember = (LVM_UINT32)(((LVM_UINT32)StartAddr + 3) & 0xFFFFFFFC);
+ pms[1].pNextMember = ((StartAddr + 3) & (uintptr_t)~3);
- StartAddr = (LVM_UINT32)pMemoryTable->Region[LVM_PERSISTENT_FAST_COEF].pBaseAddress;
+ StartAddr = (uintptr_t)pMemoryTable->Region[LVM_PERSISTENT_FAST_COEF].pBaseAddress;
pms[2].TotalSize = 3;
- pms[2].pNextMember = (LVM_UINT32)(((LVM_UINT32)StartAddr + 3) & 0xFFFFFFFC);
+ pms[2].pNextMember = ((StartAddr + 3) & (uintptr_t)~3);
- StartAddr = (LVM_UINT32)pMemoryTable->Region[LVM_TEMPORARY_FAST].pBaseAddress;
+ StartAddr = (uintptr_t)pMemoryTable->Region[LVM_TEMPORARY_FAST].pBaseAddress;
pms[3].TotalSize = 3;
- pms[3].pNextMember = (LVM_UINT32)(((LVM_UINT32)StartAddr + 3) & 0xFFFFFFFC);
+ pms[3].pNextMember = ((StartAddr + 3) & (uintptr_t)~3);
}