Merge "More syntax fixes for circqueue_impl.h" into gce-dev
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..d911e9a
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,38 @@
+//
+// Copyright (C) 2017 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.
+
+subdirs = [
+ "common",
+]
+
+cc_library_headers {
+ name: "cuttlefish_common_headers",
+ export_include_dirs: ["."],
+ host_supported: true,
+}
+
+cc_defaults {
+ name: "cuttlefish_host",
+ gnu_extensions: false,
+ header_libs: ["cuttlefish_common_headers"],
+ // Build only 64 bit Intel Linux host executables
+ device_supported: false,
+ compile_multilib: "64",
+ target: {
+ darwin: {
+ enabled: false,
+ },
+ },
+}
diff --git a/common/Android.bp b/common/Android.bp
new file mode 100644
index 0000000..73c4f07
--- /dev/null
+++ b/common/Android.bp
@@ -0,0 +1,18 @@
+//
+// Copyright (C) 2017 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.
+
+subdirs = [
+ "libs",
+]
diff --git a/common/libs/Android.bp b/common/libs/Android.bp
new file mode 100644
index 0000000..9ea8fea
--- /dev/null
+++ b/common/libs/Android.bp
@@ -0,0 +1,18 @@
+//
+// Copyright (C) 2017 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.
+
+subdirs = [
+ "auto_resources",
+]
diff --git a/common/libs/auto_resources/Android.bp b/common/libs/auto_resources/Android.bp
new file mode 100644
index 0000000..6d460b1
--- /dev/null
+++ b/common/libs/auto_resources/Android.bp
@@ -0,0 +1,20 @@
+cc_library_host_static {
+ name: "cuttlefish_auto_resources",
+ srcs: [
+ "auto_resources.cpp",
+ ],
+ defaults: ["cuttlefish_host"],
+}
+
+cc_test_host {
+ name: "auto_free_buffer_test",
+ srcs: [
+ "auto_free_buffer_test.cpp",
+ ],
+ static_libs: [
+ "cuttlefish_auto_resources",
+ "libgmock",
+ ],
+ defaults: ["cuttlefish_host"],
+}
+
diff --git a/common/vsoc/shm/circqueue.h b/common/vsoc/shm/circqueue.h
index 0bea519..59bfeee 100644
--- a/common/vsoc/shm/circqueue.h
+++ b/common/vsoc/shm/circqueue.h
@@ -80,6 +80,9 @@
*/
intptr_t WriteReserveLocked(RegionView* r, size_t bytes, Range* t);
+ // Note: Both of these fields may hold values larger than the buffer size,
+ // they should be interpreted modulo the buffer size. This fact along with the
+ // buffer size being a power of two greatly simplyfies the index calculations.
// Advances when a reader has finished with buffer space
uint32_t r_released_;
// Advances when buffer space is filled and ready for a reader