From 700e68883c4324c15b380ff6724249f39d4f498c Mon Sep 17 00:00:00 2001 From: "I-Jui (Ray) Sung" Date: Mon, 6 Mar 2017 14:42:53 -0800 Subject: Rename unused fields of RS base object handle in 64-bits Fields other than the first one (p) in RS_BASE_OBJECT are set in some part of existing RS runtime, but is not used at all. However, removing them is not desirable as size of RS_BASE_OBJECT is really part of the ABI and thus if we change it, we are creating a new ABI variant here, which is not always desirable. For example, consider a library that contains compiled scripts and assuming we pass allocation handles between the library and other user codes, changes to handle size only in user code would break the compatibility on things like array of rs_allocations. Thus, to keep ABI compatibility the unused fields r, v1, v2 are renamed. Also they are now assigned zero consistently. These field however are not copied consistently in the current runtime, and are not expected so anyways. Bug: 35043722 Test: mm, CTS and RSTest on Angler Change-Id: I426fad8e07bf445b6d8625bd23c689acaee26322 --- rs_hal.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'rs_hal.h') diff --git a/rs_hal.h b/rs_hal.h index 4534126f..1866a0b7 100644 --- a/rs_hal.h +++ b/rs_hal.h @@ -101,9 +101,7 @@ class FBOCache; * correctly. * * p = pointer to internal object implementation - * r = reserved by libRS runtime - * v1 = Mirror of p->mHal.drv - * v2 = reserved for use by vendor drivers + * unused1, unused2, unused3 = reserved for ABI compatibility */ // RS_BASE_OBJ must have the same layout as _RS_OBJECT_DECL defined in @@ -113,7 +111,7 @@ class FBOCache; #define RS_BASE_OBJ(_t_) typedef struct { const _t_* p; } __attribute__((packed, aligned(4))) #define RS_BASE_NULL_OBJ {0} #else -#define RS_BASE_OBJ(_t_) typedef struct { const _t_* p; const void* r; const void* v1; const void* v2; } +#define RS_BASE_OBJ(_t_) typedef struct { const _t_* p; const void* unused1; const void* unused2; const void* unused3; } #define RS_BASE_NULL_OBJ {0, 0, 0, 0} #endif -- cgit v1.2.3