From 24e22e3e024d0779e4d93546c51e31816b7a6186 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 23 Mar 2016 15:48:39 -0500 Subject: Fix gralloc_drm_handle_t size mismatch on 32 and 64 bit builds, take 2 On x86 there was still a size mismatch due to x86-32 structs not following natural alignment for 64-bit values. Force the alignment of the union. Also, there appeared to be some padding on the end, so move the union to the end of the struct. Signed-off-by: Rob Herring --- gralloc_drm_handle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gralloc_drm_handle.h b/gralloc_drm_handle.h index ee96fbf..8e0ea95 100644 --- a/gralloc_drm_handle.h +++ b/gralloc_drm_handle.h @@ -55,7 +55,7 @@ struct gralloc_drm_handle_t { union { struct gralloc_drm_bo_t *data; /* pointer to struct gralloc_drm_bo_t */ int64_t __padding; - }; + } __attribute__((aligned(8))); }; #define GRALLOC_DRM_HANDLE_MAGIC 0x12345678 -- cgit v1.1