Add 64bit large object support

Add HAL hooks for filling in LO fields.

Change-Id: Ib9bdee714a062de519d2a9708c1016404a1b11a4

Conflicts:
	driver/rsdBcc.cpp
	driver/rsdCore.cpp
	rsAllocation.h
	rs_hal.h
diff --git a/rs_hal.h b/rs_hal.h
index 467c815..5eec3b1 100644
--- a/rs_hal.h
+++ b/rs_hal.h
@@ -45,6 +45,41 @@
 class Sampler;
 class FBOCache;
 
+/**
+ * Define the internal object types.  This ia a mirror of the
+ * definition in rs_types.rsh except with the p value typed
+ * 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
+ */
+
+#ifndef __LP64__
+#define RS_BASE_OBJ(_t_) typedef struct { const _t_* p; } __attribute__((packed, aligned(4)))
+#else
+#define RS_BASE_OBJ(_t_) typedef struct { const _t_* p; const void* r; const void* v1; const void* v2; }
+#endif
+
+RS_BASE_OBJ(Element) rs_element;
+RS_BASE_OBJ(Type) rs_type;
+RS_BASE_OBJ(Allocation) rs_allocation;
+RS_BASE_OBJ(Sampler) rs_sampler;
+RS_BASE_OBJ(Script) rs_script;
+RS_BASE_OBJ(ScriptGroup) rs_script_group;
+
+#ifndef __LP64__
+typedef struct { const int* p; } __attribute__((packed, aligned(4))) rs_mesh;
+typedef struct { const int* p; } __attribute__((packed, aligned(4))) rs_path;
+typedef struct { const int* p; } __attribute__((packed, aligned(4))) rs_program_fragment;
+typedef struct { const int* p; } __attribute__((packed, aligned(4))) rs_program_vertex;
+typedef struct { const int* p; } __attribute__((packed, aligned(4))) rs_program_raster;
+typedef struct { const int* p; } __attribute__((packed, aligned(4))) rs_program_store;
+typedef struct { const int* p; } __attribute__((packed, aligned(4))) rs_font;
+#endif // __LP64__
+
+
 typedef void *(*RsHalSymbolLookupFunc)(void *usrptr, char const *symbolName);
 
 /**
@@ -122,6 +157,7 @@
                                    const void * usr,
                                    size_t usrLen,
                                    const RsScriptCall *sc);
+        void (*updateCachedObject)(const Context *rsc, const Script *, rs_script *obj);
     } script;
 
     struct {
@@ -203,6 +239,8 @@
                               const void *data, uint32_t elementOff, size_t sizeBytes);
 
         void (*generateMipmaps)(const Context *rsc, const Allocation *alloc);
+
+        void (*updateCachedObject)(const Context *rsc, const Allocation *alloc, rs_allocation *obj);
     } allocation;
 
     struct {
@@ -251,6 +289,7 @@
     struct {
         bool (*init)(const Context *rsc, const Sampler *m);
         void (*destroy)(const Context *rsc, const Sampler *m);
+        void (*updateCachedObject)(const Context *rsc, const Sampler *s, rs_sampler *obj);
     } sampler;
 
     struct {
@@ -267,8 +306,21 @@
                           const ScriptKernelID *kid, Allocation *);
         void (*execute)(const Context *rsc, const ScriptGroup *sg);
         void (*destroy)(const Context *rsc, const ScriptGroup *sg);
+        void (*updateCachedObject)(const Context *rsc, const ScriptGroup *sg, rs_script_group *obj);
     } scriptgroup;
 
+    struct {
+        bool (*init)(const Context *rsc, const Type *m);
+        void (*destroy)(const Context *rsc, const Type *m);
+        void (*updateCachedObject)(const Context *rsc, const Type *s, rs_type *obj);
+    } type;
+
+    struct {
+        bool (*init)(const Context *rsc, const Element *m);
+        void (*destroy)(const Context *rsc, const Element *m);
+        void (*updateCachedObject)(const Context *rsc, const Element *s, rs_element *obj);
+    } element;
+
     void (*finish)(const Context *rsc);
 } RsdHalFunctions;