Switch to 32 bit message indices when possible in aos
Larger queues need larger indices. Everything is 32 bits to support old
32 bit CPUs. Conditionally use 64 bit atomics when we can on 64 bit
processors so we can have more messages. 32 bit processors are becoming
pretty old, so no sense hamstringing the rest of the system based on
their constraints.
This also runs both tests on 64 bit processors to maintain coverage of
the 32 bit code.
Change-Id: I5ff61d4fc41163a0b7a2f71f08fc62d7e6048583
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/ipc_lib/BUILD b/aos/ipc_lib/BUILD
index cc46dac..b6c2a89 100644
--- a/aos/ipc_lib/BUILD
+++ b/aos/ipc_lib/BUILD
@@ -141,6 +141,32 @@
)
cc_library(
+ name = "index32",
+ srcs = ["index.cc"],
+ hdrs = ["index.h"],
+ defines = [
+ "AOS_QUEUE_ATOMIC_SIZE=32",
+ ],
+ target_compatible_with = ["@platforms//os:linux"],
+ visibility = ["//visibility:public"],
+ deps = [
+ ":shm_observers",
+ "@com_github_google_glog//:glog",
+ ],
+)
+
+cc_test(
+ name = "index32_test",
+ srcs = ["index_test.cc"],
+ target_compatible_with = ["@platforms//os:linux"],
+ deps = [
+ ":index32",
+ "//aos/testing:googletest",
+ "@com_github_google_glog//:glog",
+ ],
+)
+
+cc_library(
name = "index",
srcs = ["index.cc"],
hdrs = ["index.h"],