aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@google.com>2020-05-06 02:31:56 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-06 02:31:56 +0000
commit72d90f271fde96fdfaf9f87dfadd0a901d76d403 (patch)
tree4ea583a838007a2cadad5acb922b530b0cdee4fd
parentc7589ee2ec2c0ece715c2bfd38d555e012ee9dd8 (diff)
parent4738081a0c261172112281e49220adba017f65ad (diff)
downloadgeneric-72d90f271fde96fdfaf9f87dfadd0a901d76d403.tar.gz
Merge remote-tracking branch 'goog/upstream-master' into bill-rvc-06 am: 4738081a0c
Change-Id: Id3d8788e496cd291650ddfeef9b4eb30869c8739
-rw-r--r--.bazelrc2
-rw-r--r--.gitignore2
-rw-r--r--nugget/include/app_nugget.h13
-rw-r--r--nugget/include/application.h13
4 files changed, 25 insertions, 5 deletions
diff --git a/.bazelrc b/.bazelrc
deleted file mode 100644
index 68ed17e..0000000
--- a/.bazelrc
+++ /dev/null
@@ -1,2 +0,0 @@
-# TODO(b/135549199): Remove this file when the problem is fixed
-build --incompatible_disable_deprecated_attr_params=false
diff --git a/.gitignore b/.gitignore
index ac51a05..a6ef824 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-bazel-*
+/bazel-*
diff --git a/nugget/include/app_nugget.h b/nugget/include/app_nugget.h
index 0c88e61..14191df 100644
--- a/nugget/include/app_nugget.h
+++ b/nugget/include/app_nugget.h
@@ -27,7 +27,7 @@ extern "C" {
*/
/****************************************************************************/
-/* App-specific errors */
+/* App-specific errors (across all commands) */
enum {
NUGGET_ERROR_LOCKED = APP_SPECIFIC_ERROR,
NUGGET_ERROR_RETRY,
@@ -398,6 +398,17 @@ struct nugget_app_low_power_stats {
* @param reply_len depends on the counters in the file
*/
+/*
+ * Error returned if coverage data didn't fit in the buffer.
+ *
+ * TODO: Should really have a second arg which is an offset in the coverage
+ * data. That way we could call repeatedly to return data too big to return in
+ * a single command.
+ */
+enum {
+ NUGGET_ERROR_COVERAGE_OVERFLOW = APP_SPECIFIC_ERROR + 0x300,
+};
+
/****************************************************************************/
/* These are bringup / debug functions only. */
diff --git a/nugget/include/application.h b/nugget/include/application.h
index 505dc1b..9415811 100644
--- a/nugget/include/application.h
+++ b/nugget/include/application.h
@@ -315,8 +315,19 @@ enum app_status {
APP_ERROR_TIMEOUT, /* the app took too long to respond */
/* more? */
+ /*
+ * Applications can define their own app-specific error codes. For example,
+ * app_foobar.h can do:
+ *
+ * #define APP_ERROR_FOOBAR_BAZ (APP_SPECIFIC_ERROR + 0)
+ *
+ * Do not use (APP_SPECIFIC_ERROR + N) directly in your code, because the
+ * error definition, firmware which generates it, and host code which
+ * interprets it are all in different repos. You'll never be able to keep
+ * the constants straight without using a #define or enum in your app's
+ * header file that everyone can share.
+ */
APP_SPECIFIC_ERROR = 0x20, /* "should be enough for anybody" */
- /* App-specific error codes can use APP_SPECIFIC_ERROR+0, +1, +2, ... */
/* For debugging, returning a line number might be helpful */
APP_LINE_NUMBER_BASE = 0x70000000,