summaryrefslogtreecommitdiff
path: root/transport/memory
diff options
context:
space:
mode:
authorHoward Chen <howardsoc@google.com>2017-11-07 23:45:02 +0800
committerHoward Chen <howardsoc@google.com>2017-11-29 16:55:49 +0800
commit2c16d029914a7908e225e9b7dca555b32638ea57 (patch)
tree2444f4ee5f7e7bedc4ca474c1990ca5577adf31a /transport/memory
parent62a38dfd2d846f23f609a492ffcc21b85baed5ff (diff)
downloadlibhidl-2c16d029914a7908e225e9b7dca555b32638ea57.tar.gz
Add IMemoryToken and the HidlMemoryToken
The IMemoryToken is an interface which composes shared memory. It provides a get() method, which returns an instance of hidl_memory that always refer to the same memory. The HidlMemoryToken is an implementation of the IMemoryToken. Bug: 69640337 Test: hidl_test Change-Id: Ida32a7971ba31e99f724c18159cf2e1f699b73b8
Diffstat (limited to 'transport/memory')
-rw-r--r--transport/memory/token/1.0/Android.bp17
-rw-r--r--transport/memory/token/1.0/IMemoryToken.hal27
2 files changed, 44 insertions, 0 deletions
diff --git a/transport/memory/token/1.0/Android.bp b/transport/memory/token/1.0/Android.bp
new file mode 100644
index 0000000..6fc1af6
--- /dev/null
+++ b/transport/memory/token/1.0/Android.bp
@@ -0,0 +1,17 @@
+// This file is autogenerated by hidl-gen -Landroidbp.
+
+hidl_interface {
+ name: "android.hidl.memory.token@1.0",
+ root: "android.hidl",
+ vndk: {
+ enabled: true,
+ },
+ srcs: [
+ "IMemoryToken.hal",
+ ],
+ interfaces: [
+ "android.hidl.base@1.0",
+ ],
+ gen_java: false,
+}
+
diff --git a/transport/memory/token/1.0/IMemoryToken.hal b/transport/memory/token/1.0/IMemoryToken.hal
new file mode 100644
index 0000000..6507cee
--- /dev/null
+++ b/transport/memory/token/1.0/IMemoryToken.hal
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.hidl.memory.token@1.0;
+
+/**
+ * Interface which composes shared memory
+ */
+interface IMemoryToken {
+ /**
+ * The returned instance of memory must always be a reference to the same memory.
+ * @return mem Memory referenced by this token.
+ */
+ get() generates (memory mem);
+};