summaryrefslogtreecommitdiffstats
path: root/include/hardware/hwcomposer.h
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-06-04 15:21:22 -0700
committerDan Stoza <stoza@google.com>2014-06-04 16:10:46 -0700
commit91699a82eb3cf382c78a6c5ba73405f86bc394c7 (patch)
tree8200cc29516b9c1d3cdc08820abb7726944f4ee0 /include/hardware/hwcomposer.h
parent80efde7c110d1bdedf9af3fd8ed8f299f8af08cf (diff)
downloadhardware_libhardware-91699a82eb3cf382c78a6c5ba73405f86bc394c7.zip
hardware_libhardware-91699a82eb3cf382c78a6c5ba73405f86bc394c7.tar.gz
hardware_libhardware-91699a82eb3cf382c78a6c5ba73405f86bc394c7.tar.bz2
hwcomposer: Correct padding for 32/64-bit
The size of hwc_layer_1_t varies depending on whether we're building for a 32- or 64-bit target. This change splits the padding into two sections so that we can add more fields without changing the overall size on either bitness. Change-Id: Ib7c960a9feb0061586dc6398211d7d3dc012d573
Diffstat (limited to 'include/hardware/hwcomposer.h')
-rw-r--r--include/hardware/hwcomposer.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/hardware/hwcomposer.h b/include/hardware/hwcomposer.h
index 049edea..fa772d6 100644
--- a/include/hardware/hwcomposer.h
+++ b/include/hardware/hwcomposer.h
@@ -297,10 +297,19 @@ typedef struct hwc_layer_1 {
};
};
- /* Allow for expansion w/o breaking binary compatibility.
- * Pad layer to 96 bytes, assuming 32-bit pointers.
+#ifdef __LP64__
+ /*
+ * For 64-bit mode, this struct is 120 bytes (and 8-byte aligned), and needs
+ * to be padded as such to maintain binary compatibility.
+ */
+ uint8_t reserved[120 - 96];
+#else
+ /*
+ * For 32-bit mode, this struct is 96 bytes, and needs to be padded as such
+ * to maintain binary compatibility.
*/
- int32_t reserved[24 - 19];
+ uint8_t reserved[96 - 76];
+#endif
} hwc_layer_1_t;