Make the size of "cb_handle_t" same for 32/64-bit
cb_handle_t is usually created by Surfaceflinger which is a 64-bit process on
64-bit platform, and used by client processes which could be 32-bit processes
or 64-bit processes. Since the "cb_handle_t" is like a protocol, we should make
its size same for both 32-bit and 64-bit processes.
Change-Id: I11011576a389db2662888abfaf62dfb8e5611b7c
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
diff --git a/system/OpenglSystemCommon/gralloc_cb.h b/system/OpenglSystemCommon/gralloc_cb.h
index c138964..a0f6ed8 100644
--- a/system/OpenglSystemCommon/gralloc_cb.h
+++ b/system/OpenglSystemCommon/gralloc_cb.h
@@ -96,7 +96,11 @@
int glType; // OpenGL type enum used when uploading to host
int ashmemSize; // ashmem region size for the buffer (0 unless is HW_FB buffer or
// s/w access is needed)
- intptr_t ashmemBase; // CPU address of the mapped ashmem region
+ union {
+ intptr_t ashmemBase; // CPU address of the mapped ashmem region
+ uint64_t padding; // enforce same size on 32-bit/64-bit
+ } __attribute__((aligned(8)));
+
int ashmemBasePid; // process id which mapped the ashmem region
int mappedPid; // process id which succeeded gralloc_register call
int lockedLeft; // region of buffer locked for s/w write