contexthub: Explicitly pass nanoapp binary header data

Parse the nanoapp binary header in the framework and pass the relevant
data to the HAL explicitly in the NanoAppBinary structure. Note that not
all fields from the header are carried forward into NanoAppBinary, as
they are either implied by the HAL API (version, magic), or inherent in
the implementation-specific data (hwHubType), or unused and will only be
added via a future HAL version bump (second reserved field).

Also, convert the flags field in struct MemRange to a bitmask, which is
the proper representation for its use.

Bug: 34182159
Test: run hello world context hub GTS test
Change-Id: I13da9883b851e978d760548ec4265094ce81510a
diff --git a/contexthub/1.0/IContexthub.hal b/contexthub/1.0/IContexthub.hal
index 42f2e2d..c0928d5 100644
--- a/contexthub/1.0/IContexthub.hal
+++ b/contexthub/1.0/IContexthub.hal
@@ -77,7 +77,8 @@
      * device.
      *
      * @param hubId identifer of the contextHub
-     *        appBinary serialized NanoApppBinary for the nanoApp
+     *        appBinary contains the binary representation of the nanoApp, plus
+     *                  metadata
      *        transactionId transactionId for this call
      *
      * @return result OK if transation started
@@ -88,7 +89,7 @@
      *
      */
     loadNanoApp(uint32_t hubId,
-                vec<uint8_t> appBinary,
+                NanoAppBinary appBinary,
                 uint32_t transactionId)
             generates (Result result);