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/config.bzl b/aos/config.bzl
index 4aa6b4a..d281027 100644
--- a/aos/config.bzl
+++ b/aos/config.bzl
@@ -1,4 +1,5 @@
load("//tools/build_rules:label.bzl", "expand_label")
+load("//tools/build_rules:select.bzl", "address_size_select")
AosConfigInfo = provider(fields = [
"transitive_flatbuffers",
@@ -9,6 +10,10 @@
_aos_config(
name = name,
src = src,
+ flags = address_size_select({
+ "32": ["--max_queue_size_override=0xffff"],
+ "64": ["--max_queue_size_override=0xffffffff"],
+ }),
config_json = name + ".json",
config_stripped = name + ".stripped.json",
config_binary = name + ".bfbs",
@@ -38,7 +43,7 @@
ctx.actions.run(
outputs = [config, stripped_config, binary_config],
inputs = all_files,
- arguments = [
+ arguments = ctx.attr.flags + [
config.path,
stripped_config.path,
binary_config.path,
@@ -74,6 +79,9 @@
mandatory = True,
allow_files = True,
),
+ "flags": attr.string_list(
+ doc = "Additional flags to pass to config_flattener.",
+ ),
"deps": attr.label_list(
providers = [AosConfigInfo],
),